_LoggingControl.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/LoggingControl.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 LoggingControl(genpy.Message):
00010   _md5sum = "c039312796bd7205fe681c6df276e3af"
00011   _type = "applanix_msgs/LoggingControl"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# Msg 51, 52, 61
00014 uint16 transaction
00015 
00016 uint16 groups_count
00017 OutputGroup[] groups
00018 
00019 # 1, 2, 10, 20, 25, 50, 100, 200
00020 uint16 rate
00021 
00022 uint8 AUTOLOG_DISABLED=0
00023 uint8 AUTOLOG_ENABLED=1
00024 uint8 autolog
00025 
00026 uint8 DISK_LOGGING_STOP=0
00027 uint8 DISK_LOGGING_START=1
00028 uint8 disk_logging
00029 
00030 uint8[32] filename_kernel
00031 uint8[32] reserved
00032 
00033 ================================================================================
00034 MSG: applanix_msgs/OutputGroup
00035 uint16 group
00036 
00037 """
00038   # Pseudo-constants
00039   AUTOLOG_DISABLED = 0
00040   AUTOLOG_ENABLED = 1
00041   DISK_LOGGING_STOP = 0
00042   DISK_LOGGING_START = 1
00043 
00044   __slots__ = ['transaction','groups_count','groups','rate','autolog','disk_logging','filename_kernel','reserved']
00045   _slot_types = ['uint16','uint16','applanix_msgs/OutputGroup[]','uint16','uint8','uint8','uint8[32]','uint8[32]']
00046 
00047   def __init__(self, *args, **kwds):
00048     """
00049     Constructor. Any message fields that are implicitly/explicitly
00050     set to None will be assigned a default value. The recommend
00051     use is keyword arguments as this is more robust to future message
00052     changes.  You cannot mix in-order arguments and keyword arguments.
00053 
00054     The available fields are:
00055        transaction,groups_count,groups,rate,autolog,disk_logging,filename_kernel,reserved
00056 
00057     :param args: complete set of field values, in .msg order
00058     :param kwds: use keyword arguments corresponding to message field names
00059     to set specific fields.
00060     """
00061     if args or kwds:
00062       super(LoggingControl, self).__init__(*args, **kwds)
00063       #message fields cannot be None, assign default values for those that are
00064       if self.transaction is None:
00065         self.transaction = 0
00066       if self.groups_count is None:
00067         self.groups_count = 0
00068       if self.groups is None:
00069         self.groups = []
00070       if self.rate is None:
00071         self.rate = 0
00072       if self.autolog is None:
00073         self.autolog = 0
00074       if self.disk_logging is None:
00075         self.disk_logging = 0
00076       if self.filename_kernel is None:
00077         self.filename_kernel = chr(0)*32
00078       if self.reserved is None:
00079         self.reserved = chr(0)*32
00080     else:
00081       self.transaction = 0
00082       self.groups_count = 0
00083       self.groups = []
00084       self.rate = 0
00085       self.autolog = 0
00086       self.disk_logging = 0
00087       self.filename_kernel = chr(0)*32
00088       self.reserved = chr(0)*32
00089 
00090   def _get_types(self):
00091     """
00092     internal API method
00093     """
00094     return self._slot_types
00095 
00096   def serialize(self, buff):
00097     """
00098     serialize message into buffer
00099     :param buff: buffer, ``StringIO``
00100     """
00101     try:
00102       _x = self
00103       buff.write(_struct_2H.pack(_x.transaction, _x.groups_count))
00104       length = len(self.groups)
00105       buff.write(_struct_I.pack(length))
00106       for val1 in self.groups:
00107         buff.write(_struct_H.pack(val1.group))
00108       _x = self
00109       buff.write(_struct_H2B.pack(_x.rate, _x.autolog, _x.disk_logging))
00110       _x = self.filename_kernel
00111       # - if encoded as a list instead, serialize as bytes instead of string
00112       if type(_x) in [list, tuple]:
00113         buff.write(_struct_32B.pack(*_x))
00114       else:
00115         buff.write(_struct_32s.pack(_x))
00116       _x = self.reserved
00117       # - if encoded as a list instead, serialize as bytes instead of string
00118       if type(_x) in [list, tuple]:
00119         buff.write(_struct_32B.pack(*_x))
00120       else:
00121         buff.write(_struct_32s.pack(_x))
00122     except struct.error as se: self._check_types(se)
00123     except TypeError as te: self._check_types(te)
00124 
00125   def deserialize(self, str):
00126     """
00127     unpack serialized message in str into this message instance
00128     :param str: byte array of serialized message, ``str``
00129     """
00130     try:
00131       if self.groups is None:
00132         self.groups = None
00133       end = 0
00134       _x = self
00135       start = end
00136       end += 4
00137       (_x.transaction, _x.groups_count,) = _struct_2H.unpack(str[start:end])
00138       start = end
00139       end += 4
00140       (length,) = _struct_I.unpack(str[start:end])
00141       self.groups = []
00142       for i in range(0, length):
00143         val1 = applanix_msgs.msg.OutputGroup()
00144         start = end
00145         end += 2
00146         (val1.group,) = _struct_H.unpack(str[start:end])
00147         self.groups.append(val1)
00148       _x = self
00149       start = end
00150       end += 4
00151       (_x.rate, _x.autolog, _x.disk_logging,) = _struct_H2B.unpack(str[start:end])
00152       start = end
00153       end += 32
00154       self.filename_kernel = str[start:end]
00155       start = end
00156       end += 32
00157       self.reserved = str[start:end]
00158       return self
00159     except struct.error as e:
00160       raise genpy.DeserializationError(e) #most likely buffer underfill
00161 
00162 
00163   def serialize_numpy(self, buff, numpy):
00164     """
00165     serialize message with numpy array types into buffer
00166     :param buff: buffer, ``StringIO``
00167     :param numpy: numpy python module
00168     """
00169     try:
00170       _x = self
00171       buff.write(_struct_2H.pack(_x.transaction, _x.groups_count))
00172       length = len(self.groups)
00173       buff.write(_struct_I.pack(length))
00174       for val1 in self.groups:
00175         buff.write(_struct_H.pack(val1.group))
00176       _x = self
00177       buff.write(_struct_H2B.pack(_x.rate, _x.autolog, _x.disk_logging))
00178       _x = self.filename_kernel
00179       # - if encoded as a list instead, serialize as bytes instead of string
00180       if type(_x) in [list, tuple]:
00181         buff.write(_struct_32B.pack(*_x))
00182       else:
00183         buff.write(_struct_32s.pack(_x))
00184       _x = self.reserved
00185       # - if encoded as a list instead, serialize as bytes instead of string
00186       if type(_x) in [list, tuple]:
00187         buff.write(_struct_32B.pack(*_x))
00188       else:
00189         buff.write(_struct_32s.pack(_x))
00190     except struct.error as se: self._check_types(se)
00191     except TypeError as te: self._check_types(te)
00192 
00193   def deserialize_numpy(self, str, numpy):
00194     """
00195     unpack serialized message in str into this message instance using numpy for array types
00196     :param str: byte array of serialized message, ``str``
00197     :param numpy: numpy python module
00198     """
00199     try:
00200       if self.groups is None:
00201         self.groups = None
00202       end = 0
00203       _x = self
00204       start = end
00205       end += 4
00206       (_x.transaction, _x.groups_count,) = _struct_2H.unpack(str[start:end])
00207       start = end
00208       end += 4
00209       (length,) = _struct_I.unpack(str[start:end])
00210       self.groups = []
00211       for i in range(0, length):
00212         val1 = applanix_msgs.msg.OutputGroup()
00213         start = end
00214         end += 2
00215         (val1.group,) = _struct_H.unpack(str[start:end])
00216         self.groups.append(val1)
00217       _x = self
00218       start = end
00219       end += 4
00220       (_x.rate, _x.autolog, _x.disk_logging,) = _struct_H2B.unpack(str[start:end])
00221       start = end
00222       end += 32
00223       self.filename_kernel = str[start:end]
00224       start = end
00225       end += 32
00226       self.reserved = str[start:end]
00227       return self
00228     except struct.error as e:
00229       raise genpy.DeserializationError(e) #most likely buffer underfill
00230 
00231 _struct_I = genpy.struct_I
00232 _struct_32B = struct.Struct("<32B")
00233 _struct_H = struct.Struct("<H")
00234 _struct_32s = struct.Struct("<32s")
00235 _struct_2H = struct.Struct("<2H")
00236 _struct_H2B = struct.Struct("<H2B")


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