o
    ex¯g†  ã                   @   s6   d Z 	 ddlmZ ddlZddlZG dd„ deƒZdS )zYLCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
é    )ÚBytesIONc                
   @   s’   e Zd Zg d¢Zg d¢Zdddddddddgdgg
Zdd„ Zdd„ Zd	d
„ Ze	de
fdd„ƒZe	dd„ ƒZe	dd„ ƒZdZe	dd„ ƒZdd„ ZdS )Úidt_t)
ÚheaderÚvalidÚ	timestampÚ	ping_timeÚping_numberÚaltitudeÚintervalÚnbeamsÚrangeÚintense)
zoi.lcm_header_tÚint8_tÚdoubler   Úint32_tÚfloatr   r   r   r   Nr   c                 C   sV   t  ¡ | _	 d| _	 d| _	 d| _	 d| _	 d| _	 d| _	 d| _		 g | _
	 g | _d S )Nr   g        )ÚoiÚlcm_header_tr   r   r   r   r   r	   r
   r   r   r   ©Úself© r   úc/mbari/ProjectLibrary/901101_OceanImaging/2025 Scoping Study/2 Studies/LCM_DataAnalysis/oi/idt_t.pyÚ__init__   s(   
zidt_t.__init__c                 C   s&   t ƒ }| t ¡ ¡ |  |¡ | ¡ S )N)r   Úwriter   Ú_get_packed_fingerprintÚ_encode_oneÚgetvalue©r   Úbufr   r   r   ÚencodeT   s   
zidt_t.encodec                 C   s¨   | j  ¡ tj ¡ ksJ ‚| j  |¡ | t d| j| j	| j
| j| j| j| j¡¡ | tjd| j g| jd | j… ¢R Ž ¡ | tjd| j g| jd | j… ¢R Ž ¡ d S )Nú>bddifiiú>%dfú>%di)r   r   r   r   r   r   ÚstructÚpackr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   Z   s
   ,*.zidt_t._encode_oneÚdatac                 C   s<   t | dƒr| }nt| ƒ}| d¡t ¡ krtdƒ‚t |¡S )NÚreadé   zDecode error)Úhasattrr   r&   r   r   Ú
ValueErrorÚ_decode_one)r%   r   r   r   r   Údecodea   s   

zidt_t.decodec                 C   s†   t ƒ }tj | ¡|_t d|  d¡¡\|_|_	|_
|_|_|_|_t d|j |  |jd ¡¡|_t d|j |  |jd ¡¡|_|S )Nr    é!   r!   é   r"   )r   r   r   r*   r   r#   Úunpackr&   r   r   r   r   r	   r
   r   r   r   )r   r   r   r   r   r*   k   s   .  zidt_t._decode_onec                 C   sF   t | v rdS | t g }dtj |¡ d@ }|d> d@ |d?  d@ }|S )Nr   l   Éh—-xîh l   ÿÿÿÿ é   é?   )r   r   r   Ú_get_hash_recursive)ÚparentsÚ
newparentsÚtmphashr   r   r   r1   t   s
   
zidt_t._get_hash_recursivec                   C   s$   t jd u rt dt  g ¡¡t _t jS )Nú>Q)r   Ú_packed_fingerprintr#   r$   r1   r   r   r   r   r   }   s   
zidt_t._get_packed_fingerprintc                 C   s   t  dt ¡ ¡d S )zGet the LCM hash of the structr5   r   )r#   r.   r   r   r   r   r   r   Úget_hashƒ   s   zidt_t.get_hash)Ú__name__Ú
__module__Ú__qualname__Ú	__slots__Ú__typenames__Ú__dimensions__r   r   r   ÚstaticmethodÚbytesr+   r*   r1   r6   r   r7   r   r   r   r   r      s"    :	


r   )Ú__doc__Úior   r#   r   Úobjectr   r   r   r   r   Ú<module>   s    