_DGPSSourceControl.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/DGPSSourceControl.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class DGPSSourceControl(genpy.Message):
00009   _md5sum = "647a618f1252a3c18cb54ba603253af8"
00010   _type = "applanix_msgs/DGPSSourceControl"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Msg 41
00013 uint16 transaction
00014 
00015 # TODO: enums
00016 uint8 dgps_source_mode
00017 uint8 beacon_acquisition_mode
00018 uint16 beacon_channel_0_frequency
00019 uint16 beacon_channel_1_frequency
00020 
00021 uint8 satellite_id
00022 
00023 uint16 satellite_bitrate
00024 float64 satellite_frequency
00025 
00026 uint8 request_database_source
00027 uint8 landstar_correction_source
00028 uint8[26] omnistar_activation_code
00029 
00030 """
00031   __slots__ = ['transaction','dgps_source_mode','beacon_acquisition_mode','beacon_channel_0_frequency','beacon_channel_1_frequency','satellite_id','satellite_bitrate','satellite_frequency','request_database_source','landstar_correction_source','omnistar_activation_code']
00032   _slot_types = ['uint16','uint8','uint8','uint16','uint16','uint8','uint16','float64','uint8','uint8','uint8[26]']
00033 
00034   def __init__(self, *args, **kwds):
00035     """
00036     Constructor. Any message fields that are implicitly/explicitly
00037     set to None will be assigned a default value. The recommend
00038     use is keyword arguments as this is more robust to future message
00039     changes.  You cannot mix in-order arguments and keyword arguments.
00040 
00041     The available fields are:
00042        transaction,dgps_source_mode,beacon_acquisition_mode,beacon_channel_0_frequency,beacon_channel_1_frequency,satellite_id,satellite_bitrate,satellite_frequency,request_database_source,landstar_correction_source,omnistar_activation_code
00043 
00044     :param args: complete set of field values, in .msg order
00045     :param kwds: use keyword arguments corresponding to message field names
00046     to set specific fields.
00047     """
00048     if args or kwds:
00049       super(DGPSSourceControl, self).__init__(*args, **kwds)
00050       #message fields cannot be None, assign default values for those that are
00051       if self.transaction is None:
00052         self.transaction = 0
00053       if self.dgps_source_mode is None:
00054         self.dgps_source_mode = 0
00055       if self.beacon_acquisition_mode is None:
00056         self.beacon_acquisition_mode = 0
00057       if self.beacon_channel_0_frequency is None:
00058         self.beacon_channel_0_frequency = 0
00059       if self.beacon_channel_1_frequency is None:
00060         self.beacon_channel_1_frequency = 0
00061       if self.satellite_id is None:
00062         self.satellite_id = 0
00063       if self.satellite_bitrate is None:
00064         self.satellite_bitrate = 0
00065       if self.satellite_frequency is None:
00066         self.satellite_frequency = 0.
00067       if self.request_database_source is None:
00068         self.request_database_source = 0
00069       if self.landstar_correction_source is None:
00070         self.landstar_correction_source = 0
00071       if self.omnistar_activation_code is None:
00072         self.omnistar_activation_code = chr(0)*26
00073     else:
00074       self.transaction = 0
00075       self.dgps_source_mode = 0
00076       self.beacon_acquisition_mode = 0
00077       self.beacon_channel_0_frequency = 0
00078       self.beacon_channel_1_frequency = 0
00079       self.satellite_id = 0
00080       self.satellite_bitrate = 0
00081       self.satellite_frequency = 0.
00082       self.request_database_source = 0
00083       self.landstar_correction_source = 0
00084       self.omnistar_activation_code = chr(0)*26
00085 
00086   def _get_types(self):
00087     """
00088     internal API method
00089     """
00090     return self._slot_types
00091 
00092   def serialize(self, buff):
00093     """
00094     serialize message into buffer
00095     :param buff: buffer, ``StringIO``
00096     """
00097     try:
00098       _x = self
00099       buff.write(_struct_H2B2HBHd2B.pack(_x.transaction, _x.dgps_source_mode, _x.beacon_acquisition_mode, _x.beacon_channel_0_frequency, _x.beacon_channel_1_frequency, _x.satellite_id, _x.satellite_bitrate, _x.satellite_frequency, _x.request_database_source, _x.landstar_correction_source))
00100       _x = self.omnistar_activation_code
00101       # - if encoded as a list instead, serialize as bytes instead of string
00102       if type(_x) in [list, tuple]:
00103         buff.write(_struct_26B.pack(*_x))
00104       else:
00105         buff.write(_struct_26s.pack(_x))
00106     except struct.error as se: self._check_types(se)
00107     except TypeError as te: self._check_types(te)
00108 
00109   def deserialize(self, str):
00110     """
00111     unpack serialized message in str into this message instance
00112     :param str: byte array of serialized message, ``str``
00113     """
00114     try:
00115       end = 0
00116       _x = self
00117       start = end
00118       end += 21
00119       (_x.transaction, _x.dgps_source_mode, _x.beacon_acquisition_mode, _x.beacon_channel_0_frequency, _x.beacon_channel_1_frequency, _x.satellite_id, _x.satellite_bitrate, _x.satellite_frequency, _x.request_database_source, _x.landstar_correction_source,) = _struct_H2B2HBHd2B.unpack(str[start:end])
00120       start = end
00121       end += 26
00122       self.omnistar_activation_code = str[start:end]
00123       return self
00124     except struct.error as e:
00125       raise genpy.DeserializationError(e) #most likely buffer underfill
00126 
00127 
00128   def serialize_numpy(self, buff, numpy):
00129     """
00130     serialize message with numpy array types into buffer
00131     :param buff: buffer, ``StringIO``
00132     :param numpy: numpy python module
00133     """
00134     try:
00135       _x = self
00136       buff.write(_struct_H2B2HBHd2B.pack(_x.transaction, _x.dgps_source_mode, _x.beacon_acquisition_mode, _x.beacon_channel_0_frequency, _x.beacon_channel_1_frequency, _x.satellite_id, _x.satellite_bitrate, _x.satellite_frequency, _x.request_database_source, _x.landstar_correction_source))
00137       _x = self.omnistar_activation_code
00138       # - if encoded as a list instead, serialize as bytes instead of string
00139       if type(_x) in [list, tuple]:
00140         buff.write(_struct_26B.pack(*_x))
00141       else:
00142         buff.write(_struct_26s.pack(_x))
00143     except struct.error as se: self._check_types(se)
00144     except TypeError as te: self._check_types(te)
00145 
00146   def deserialize_numpy(self, str, numpy):
00147     """
00148     unpack serialized message in str into this message instance using numpy for array types
00149     :param str: byte array of serialized message, ``str``
00150     :param numpy: numpy python module
00151     """
00152     try:
00153       end = 0
00154       _x = self
00155       start = end
00156       end += 21
00157       (_x.transaction, _x.dgps_source_mode, _x.beacon_acquisition_mode, _x.beacon_channel_0_frequency, _x.beacon_channel_1_frequency, _x.satellite_id, _x.satellite_bitrate, _x.satellite_frequency, _x.request_database_source, _x.landstar_correction_source,) = _struct_H2B2HBHd2B.unpack(str[start:end])
00158       start = end
00159       end += 26
00160       self.omnistar_activation_code = str[start:end]
00161       return self
00162     except struct.error as e:
00163       raise genpy.DeserializationError(e) #most likely buffer underfill
00164 
00165 _struct_I = genpy.struct_I
00166 _struct_26s = struct.Struct("<26s")
00167 _struct_26B = struct.Struct("<26B")
00168 _struct_H2B2HBHd2B = struct.Struct("<H2B2HBHd2B")


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