_Version.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/Version.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 Version(genpy.Message):
00010   _md5sum = "436db5a21d31ed873f1f24270392aeca"
00011   _type = "applanix_msgs/Version"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# Group 99
00014 TimeDistance td
00015 
00016 uint8[120] system_version
00017 uint8[80] primary_gnss_version
00018 uint8[80] secondary_gnss_version
00019 
00020 float32 total_hours
00021 uint32 num_runs
00022 float32 avg_run_length
00023 float32 longest_run
00024 float32 current_run
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   __slots__ = ['td','system_version','primary_gnss_version','secondary_gnss_version','total_hours','num_runs','avg_run_length','longest_run','current_run']
00036   _slot_types = ['applanix_msgs/TimeDistance','uint8[120]','uint8[80]','uint8[80]','float32','uint32','float32','float32','float32']
00037 
00038   def __init__(self, *args, **kwds):
00039     """
00040     Constructor. Any message fields that are implicitly/explicitly
00041     set to None will be assigned a default value. The recommend
00042     use is keyword arguments as this is more robust to future message
00043     changes.  You cannot mix in-order arguments and keyword arguments.
00044 
00045     The available fields are:
00046        td,system_version,primary_gnss_version,secondary_gnss_version,total_hours,num_runs,avg_run_length,longest_run,current_run
00047 
00048     :param args: complete set of field values, in .msg order
00049     :param kwds: use keyword arguments corresponding to message field names
00050     to set specific fields.
00051     """
00052     if args or kwds:
00053       super(Version, self).__init__(*args, **kwds)
00054       #message fields cannot be None, assign default values for those that are
00055       if self.td is None:
00056         self.td = applanix_msgs.msg.TimeDistance()
00057       if self.system_version is None:
00058         self.system_version = chr(0)*120
00059       if self.primary_gnss_version is None:
00060         self.primary_gnss_version = chr(0)*80
00061       if self.secondary_gnss_version is None:
00062         self.secondary_gnss_version = chr(0)*80
00063       if self.total_hours is None:
00064         self.total_hours = 0.
00065       if self.num_runs is None:
00066         self.num_runs = 0
00067       if self.avg_run_length is None:
00068         self.avg_run_length = 0.
00069       if self.longest_run is None:
00070         self.longest_run = 0.
00071       if self.current_run is None:
00072         self.current_run = 0.
00073     else:
00074       self.td = applanix_msgs.msg.TimeDistance()
00075       self.system_version = chr(0)*120
00076       self.primary_gnss_version = chr(0)*80
00077       self.secondary_gnss_version = chr(0)*80
00078       self.total_hours = 0.
00079       self.num_runs = 0
00080       self.avg_run_length = 0.
00081       self.longest_run = 0.
00082       self.current_run = 0.
00083 
00084   def _get_types(self):
00085     """
00086     internal API method
00087     """
00088     return self._slot_types
00089 
00090   def serialize(self, buff):
00091     """
00092     serialize message into buffer
00093     :param buff: buffer, ``StringIO``
00094     """
00095     try:
00096       _x = self
00097       buff.write(_struct_3d2B.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type))
00098       _x = self.system_version
00099       # - if encoded as a list instead, serialize as bytes instead of string
00100       if type(_x) in [list, tuple]:
00101         buff.write(_struct_120B.pack(*_x))
00102       else:
00103         buff.write(_struct_120s.pack(_x))
00104       _x = self.primary_gnss_version
00105       # - if encoded as a list instead, serialize as bytes instead of string
00106       if type(_x) in [list, tuple]:
00107         buff.write(_struct_80B.pack(*_x))
00108       else:
00109         buff.write(_struct_80s.pack(_x))
00110       _x = self.secondary_gnss_version
00111       # - if encoded as a list instead, serialize as bytes instead of string
00112       if type(_x) in [list, tuple]:
00113         buff.write(_struct_80B.pack(*_x))
00114       else:
00115         buff.write(_struct_80s.pack(_x))
00116       _x = self
00117       buff.write(_struct_fI3f.pack(_x.total_hours, _x.num_runs, _x.avg_run_length, _x.longest_run, _x.current_run))
00118     except struct.error as se: self._check_types(se)
00119     except TypeError as te: self._check_types(te)
00120 
00121   def deserialize(self, str):
00122     """
00123     unpack serialized message in str into this message instance
00124     :param str: byte array of serialized message, ``str``
00125     """
00126     try:
00127       if self.td is None:
00128         self.td = applanix_msgs.msg.TimeDistance()
00129       end = 0
00130       _x = self
00131       start = end
00132       end += 26
00133       (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type,) = _struct_3d2B.unpack(str[start:end])
00134       start = end
00135       end += 120
00136       self.system_version = str[start:end]
00137       start = end
00138       end += 80
00139       self.primary_gnss_version = str[start:end]
00140       start = end
00141       end += 80
00142       self.secondary_gnss_version = str[start:end]
00143       _x = self
00144       start = end
00145       end += 20
00146       (_x.total_hours, _x.num_runs, _x.avg_run_length, _x.longest_run, _x.current_run,) = _struct_fI3f.unpack(str[start:end])
00147       return self
00148     except struct.error as e:
00149       raise genpy.DeserializationError(e) #most likely buffer underfill
00150 
00151 
00152   def serialize_numpy(self, buff, numpy):
00153     """
00154     serialize message with numpy array types into buffer
00155     :param buff: buffer, ``StringIO``
00156     :param numpy: numpy python module
00157     """
00158     try:
00159       _x = self
00160       buff.write(_struct_3d2B.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type))
00161       _x = self.system_version
00162       # - if encoded as a list instead, serialize as bytes instead of string
00163       if type(_x) in [list, tuple]:
00164         buff.write(_struct_120B.pack(*_x))
00165       else:
00166         buff.write(_struct_120s.pack(_x))
00167       _x = self.primary_gnss_version
00168       # - if encoded as a list instead, serialize as bytes instead of string
00169       if type(_x) in [list, tuple]:
00170         buff.write(_struct_80B.pack(*_x))
00171       else:
00172         buff.write(_struct_80s.pack(_x))
00173       _x = self.secondary_gnss_version
00174       # - if encoded as a list instead, serialize as bytes instead of string
00175       if type(_x) in [list, tuple]:
00176         buff.write(_struct_80B.pack(*_x))
00177       else:
00178         buff.write(_struct_80s.pack(_x))
00179       _x = self
00180       buff.write(_struct_fI3f.pack(_x.total_hours, _x.num_runs, _x.avg_run_length, _x.longest_run, _x.current_run))
00181     except struct.error as se: self._check_types(se)
00182     except TypeError as te: self._check_types(te)
00183 
00184   def deserialize_numpy(self, str, numpy):
00185     """
00186     unpack serialized message in str into this message instance using numpy for array types
00187     :param str: byte array of serialized message, ``str``
00188     :param numpy: numpy python module
00189     """
00190     try:
00191       if self.td is None:
00192         self.td = applanix_msgs.msg.TimeDistance()
00193       end = 0
00194       _x = self
00195       start = end
00196       end += 26
00197       (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type,) = _struct_3d2B.unpack(str[start:end])
00198       start = end
00199       end += 120
00200       self.system_version = str[start:end]
00201       start = end
00202       end += 80
00203       self.primary_gnss_version = str[start:end]
00204       start = end
00205       end += 80
00206       self.secondary_gnss_version = str[start:end]
00207       _x = self
00208       start = end
00209       end += 20
00210       (_x.total_hours, _x.num_runs, _x.avg_run_length, _x.longest_run, _x.current_run,) = _struct_fI3f.unpack(str[start:end])
00211       return self
00212     except struct.error as e:
00213       raise genpy.DeserializationError(e) #most likely buffer underfill
00214 
00215 _struct_I = genpy.struct_I
00216 _struct_fI3f = struct.Struct("<fI3f")
00217 _struct_80B = struct.Struct("<80B")
00218 _struct_120s = struct.Struct("<120s")
00219 _struct_3d2B = struct.Struct("<3d2B")
00220 _struct_80s = struct.Struct("<80s")
00221 _struct_120B = struct.Struct("<120B")


applanix_msgs
Author(s): Mike Purvis
autogenerated on Thu Jan 2 2014 11:04:51