00001 """autogenerated by genpy from applanix_msgs/LoggingStatus.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import applanix_msgs.msg
00008
00009 class LoggingStatus(genpy.Message):
00010 _md5sum = "bc37af667689cff6ff70d20f8053fa45"
00011 _type = "applanix_msgs/LoggingStatus"
00012 _has_header = False
00013 _full_text = """TimeDistance td
00014
00015 uint32 disk_kb_remaining
00016 uint32 disk_kb_logged
00017 uint32 disk_time_remaining
00018 uint32 disk_kb_total
00019
00020 uint8 STATE_STANDBY=0
00021 uint8 STATE_LOGGING=1
00022 uint8 STATE_BUFFERING=2
00023 uint8 STATE_INVALID=255
00024 uint8 state
00025
00026 ================================================================================
00027 MSG: applanix_msgs/TimeDistance
00028 float64 time1
00029 float64 time2
00030 float64 distance
00031 uint8 time_types
00032 uint8 distance_type
00033
00034 """
00035
00036 STATE_STANDBY = 0
00037 STATE_LOGGING = 1
00038 STATE_BUFFERING = 2
00039 STATE_INVALID = 255
00040
00041 __slots__ = ['td','disk_kb_remaining','disk_kb_logged','disk_time_remaining','disk_kb_total','state']
00042 _slot_types = ['applanix_msgs/TimeDistance','uint32','uint32','uint32','uint32','uint8']
00043
00044 def __init__(self, *args, **kwds):
00045 """
00046 Constructor. Any message fields that are implicitly/explicitly
00047 set to None will be assigned a default value. The recommend
00048 use is keyword arguments as this is more robust to future message
00049 changes. You cannot mix in-order arguments and keyword arguments.
00050
00051 The available fields are:
00052 td,disk_kb_remaining,disk_kb_logged,disk_time_remaining,disk_kb_total,state
00053
00054 :param args: complete set of field values, in .msg order
00055 :param kwds: use keyword arguments corresponding to message field names
00056 to set specific fields.
00057 """
00058 if args or kwds:
00059 super(LoggingStatus, self).__init__(*args, **kwds)
00060
00061 if self.td is None:
00062 self.td = applanix_msgs.msg.TimeDistance()
00063 if self.disk_kb_remaining is None:
00064 self.disk_kb_remaining = 0
00065 if self.disk_kb_logged is None:
00066 self.disk_kb_logged = 0
00067 if self.disk_time_remaining is None:
00068 self.disk_time_remaining = 0
00069 if self.disk_kb_total is None:
00070 self.disk_kb_total = 0
00071 if self.state is None:
00072 self.state = 0
00073 else:
00074 self.td = applanix_msgs.msg.TimeDistance()
00075 self.disk_kb_remaining = 0
00076 self.disk_kb_logged = 0
00077 self.disk_time_remaining = 0
00078 self.disk_kb_total = 0
00079 self.state = 0
00080
00081 def _get_types(self):
00082 """
00083 internal API method
00084 """
00085 return self._slot_types
00086
00087 def serialize(self, buff):
00088 """
00089 serialize message into buffer
00090 :param buff: buffer, ``StringIO``
00091 """
00092 try:
00093 _x = self
00094 buff.write(_struct_3d2B4IB.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.disk_kb_remaining, _x.disk_kb_logged, _x.disk_time_remaining, _x.disk_kb_total, _x.state))
00095 except struct.error as se: self._check_types(se)
00096 except TypeError as te: self._check_types(te)
00097
00098 def deserialize(self, str):
00099 """
00100 unpack serialized message in str into this message instance
00101 :param str: byte array of serialized message, ``str``
00102 """
00103 try:
00104 if self.td is None:
00105 self.td = applanix_msgs.msg.TimeDistance()
00106 end = 0
00107 _x = self
00108 start = end
00109 end += 43
00110 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.disk_kb_remaining, _x.disk_kb_logged, _x.disk_time_remaining, _x.disk_kb_total, _x.state,) = _struct_3d2B4IB.unpack(str[start:end])
00111 return self
00112 except struct.error as e:
00113 raise genpy.DeserializationError(e)
00114
00115
00116 def serialize_numpy(self, buff, numpy):
00117 """
00118 serialize message with numpy array types into buffer
00119 :param buff: buffer, ``StringIO``
00120 :param numpy: numpy python module
00121 """
00122 try:
00123 _x = self
00124 buff.write(_struct_3d2B4IB.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.disk_kb_remaining, _x.disk_kb_logged, _x.disk_time_remaining, _x.disk_kb_total, _x.state))
00125 except struct.error as se: self._check_types(se)
00126 except TypeError as te: self._check_types(te)
00127
00128 def deserialize_numpy(self, str, numpy):
00129 """
00130 unpack serialized message in str into this message instance using numpy for array types
00131 :param str: byte array of serialized message, ``str``
00132 :param numpy: numpy python module
00133 """
00134 try:
00135 if self.td is None:
00136 self.td = applanix_msgs.msg.TimeDistance()
00137 end = 0
00138 _x = self
00139 start = end
00140 end += 43
00141 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.disk_kb_remaining, _x.disk_kb_logged, _x.disk_time_remaining, _x.disk_kb_total, _x.state,) = _struct_3d2B4IB.unpack(str[start:end])
00142 return self
00143 except struct.error as e:
00144 raise genpy.DeserializationError(e)
00145
00146 _struct_I = genpy.struct_I
00147 _struct_3d2B4IB = struct.Struct("<3d2B4IB")