_SystemDescription.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tug_ist_diagnosis_msgs/SystemDescription.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 SystemDescription(genpy.Message):
00009   _md5sum = "367459a5d65a9e456af927b052e15768"
00010   _type = "tug_ist_diagnosis_msgs/SystemDescription"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """float32 out_time
00013 string[] rules
00014 string[] props
00015 string AB
00016 string NAB
00017 string neg_prefix
00018 
00019 """
00020   __slots__ = ['out_time','rules','props','AB','NAB','neg_prefix']
00021   _slot_types = ['float32','string[]','string[]','string','string','string']
00022 
00023   def __init__(self, *args, **kwds):
00024     """
00025     Constructor. Any message fields that are implicitly/explicitly
00026     set to None will be assigned a default value. The recommend
00027     use is keyword arguments as this is more robust to future message
00028     changes.  You cannot mix in-order arguments and keyword arguments.
00029 
00030     The available fields are:
00031        out_time,rules,props,AB,NAB,neg_prefix
00032 
00033     :param args: complete set of field values, in .msg order
00034     :param kwds: use keyword arguments corresponding to message field names
00035     to set specific fields.
00036     """
00037     if args or kwds:
00038       super(SystemDescription, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.out_time is None:
00041         self.out_time = 0.
00042       if self.rules is None:
00043         self.rules = []
00044       if self.props is None:
00045         self.props = []
00046       if self.AB is None:
00047         self.AB = ''
00048       if self.NAB is None:
00049         self.NAB = ''
00050       if self.neg_prefix is None:
00051         self.neg_prefix = ''
00052     else:
00053       self.out_time = 0.
00054       self.rules = []
00055       self.props = []
00056       self.AB = ''
00057       self.NAB = ''
00058       self.neg_prefix = ''
00059 
00060   def _get_types(self):
00061     """
00062     internal API method
00063     """
00064     return self._slot_types
00065 
00066   def serialize(self, buff):
00067     """
00068     serialize message into buffer
00069     :param buff: buffer, ``StringIO``
00070     """
00071     try:
00072       buff.write(_struct_f.pack(self.out_time))
00073       length = len(self.rules)
00074       buff.write(_struct_I.pack(length))
00075       for val1 in self.rules:
00076         length = len(val1)
00077         if python3 or type(val1) == unicode:
00078           val1 = val1.encode('utf-8')
00079           length = len(val1)
00080         buff.write(struct.pack('<I%ss'%length, length, val1))
00081       length = len(self.props)
00082       buff.write(_struct_I.pack(length))
00083       for val1 in self.props:
00084         length = len(val1)
00085         if python3 or type(val1) == unicode:
00086           val1 = val1.encode('utf-8')
00087           length = len(val1)
00088         buff.write(struct.pack('<I%ss'%length, length, val1))
00089       _x = self.AB
00090       length = len(_x)
00091       if python3 or type(_x) == unicode:
00092         _x = _x.encode('utf-8')
00093         length = len(_x)
00094       buff.write(struct.pack('<I%ss'%length, length, _x))
00095       _x = self.NAB
00096       length = len(_x)
00097       if python3 or type(_x) == unicode:
00098         _x = _x.encode('utf-8')
00099         length = len(_x)
00100       buff.write(struct.pack('<I%ss'%length, length, _x))
00101       _x = self.neg_prefix
00102       length = len(_x)
00103       if python3 or type(_x) == unicode:
00104         _x = _x.encode('utf-8')
00105         length = len(_x)
00106       buff.write(struct.pack('<I%ss'%length, length, _x))
00107     except struct.error as se: self._check_types(se)
00108     except TypeError as te: self._check_types(te)
00109 
00110   def deserialize(self, str):
00111     """
00112     unpack serialized message in str into this message instance
00113     :param str: byte array of serialized message, ``str``
00114     """
00115     try:
00116       end = 0
00117       start = end
00118       end += 4
00119       (self.out_time,) = _struct_f.unpack(str[start:end])
00120       start = end
00121       end += 4
00122       (length,) = _struct_I.unpack(str[start:end])
00123       self.rules = []
00124       for i in range(0, length):
00125         start = end
00126         end += 4
00127         (length,) = _struct_I.unpack(str[start:end])
00128         start = end
00129         end += length
00130         if python3:
00131           val1 = str[start:end].decode('utf-8')
00132         else:
00133           val1 = str[start:end]
00134         self.rules.append(val1)
00135       start = end
00136       end += 4
00137       (length,) = _struct_I.unpack(str[start:end])
00138       self.props = []
00139       for i in range(0, length):
00140         start = end
00141         end += 4
00142         (length,) = _struct_I.unpack(str[start:end])
00143         start = end
00144         end += length
00145         if python3:
00146           val1 = str[start:end].decode('utf-8')
00147         else:
00148           val1 = str[start:end]
00149         self.props.append(val1)
00150       start = end
00151       end += 4
00152       (length,) = _struct_I.unpack(str[start:end])
00153       start = end
00154       end += length
00155       if python3:
00156         self.AB = str[start:end].decode('utf-8')
00157       else:
00158         self.AB = str[start:end]
00159       start = end
00160       end += 4
00161       (length,) = _struct_I.unpack(str[start:end])
00162       start = end
00163       end += length
00164       if python3:
00165         self.NAB = str[start:end].decode('utf-8')
00166       else:
00167         self.NAB = str[start:end]
00168       start = end
00169       end += 4
00170       (length,) = _struct_I.unpack(str[start:end])
00171       start = end
00172       end += length
00173       if python3:
00174         self.neg_prefix = str[start:end].decode('utf-8')
00175       else:
00176         self.neg_prefix = str[start:end]
00177       return self
00178     except struct.error as e:
00179       raise genpy.DeserializationError(e) #most likely buffer underfill
00180 
00181 
00182   def serialize_numpy(self, buff, numpy):
00183     """
00184     serialize message with numpy array types into buffer
00185     :param buff: buffer, ``StringIO``
00186     :param numpy: numpy python module
00187     """
00188     try:
00189       buff.write(_struct_f.pack(self.out_time))
00190       length = len(self.rules)
00191       buff.write(_struct_I.pack(length))
00192       for val1 in self.rules:
00193         length = len(val1)
00194         if python3 or type(val1) == unicode:
00195           val1 = val1.encode('utf-8')
00196           length = len(val1)
00197         buff.write(struct.pack('<I%ss'%length, length, val1))
00198       length = len(self.props)
00199       buff.write(_struct_I.pack(length))
00200       for val1 in self.props:
00201         length = len(val1)
00202         if python3 or type(val1) == unicode:
00203           val1 = val1.encode('utf-8')
00204           length = len(val1)
00205         buff.write(struct.pack('<I%ss'%length, length, val1))
00206       _x = self.AB
00207       length = len(_x)
00208       if python3 or type(_x) == unicode:
00209         _x = _x.encode('utf-8')
00210         length = len(_x)
00211       buff.write(struct.pack('<I%ss'%length, length, _x))
00212       _x = self.NAB
00213       length = len(_x)
00214       if python3 or type(_x) == unicode:
00215         _x = _x.encode('utf-8')
00216         length = len(_x)
00217       buff.write(struct.pack('<I%ss'%length, length, _x))
00218       _x = self.neg_prefix
00219       length = len(_x)
00220       if python3 or type(_x) == unicode:
00221         _x = _x.encode('utf-8')
00222         length = len(_x)
00223       buff.write(struct.pack('<I%ss'%length, length, _x))
00224     except struct.error as se: self._check_types(se)
00225     except TypeError as te: self._check_types(te)
00226 
00227   def deserialize_numpy(self, str, numpy):
00228     """
00229     unpack serialized message in str into this message instance using numpy for array types
00230     :param str: byte array of serialized message, ``str``
00231     :param numpy: numpy python module
00232     """
00233     try:
00234       end = 0
00235       start = end
00236       end += 4
00237       (self.out_time,) = _struct_f.unpack(str[start:end])
00238       start = end
00239       end += 4
00240       (length,) = _struct_I.unpack(str[start:end])
00241       self.rules = []
00242       for i in range(0, length):
00243         start = end
00244         end += 4
00245         (length,) = _struct_I.unpack(str[start:end])
00246         start = end
00247         end += length
00248         if python3:
00249           val1 = str[start:end].decode('utf-8')
00250         else:
00251           val1 = str[start:end]
00252         self.rules.append(val1)
00253       start = end
00254       end += 4
00255       (length,) = _struct_I.unpack(str[start:end])
00256       self.props = []
00257       for i in range(0, length):
00258         start = end
00259         end += 4
00260         (length,) = _struct_I.unpack(str[start:end])
00261         start = end
00262         end += length
00263         if python3:
00264           val1 = str[start:end].decode('utf-8')
00265         else:
00266           val1 = str[start:end]
00267         self.props.append(val1)
00268       start = end
00269       end += 4
00270       (length,) = _struct_I.unpack(str[start:end])
00271       start = end
00272       end += length
00273       if python3:
00274         self.AB = str[start:end].decode('utf-8')
00275       else:
00276         self.AB = str[start:end]
00277       start = end
00278       end += 4
00279       (length,) = _struct_I.unpack(str[start:end])
00280       start = end
00281       end += length
00282       if python3:
00283         self.NAB = str[start:end].decode('utf-8')
00284       else:
00285         self.NAB = str[start:end]
00286       start = end
00287       end += 4
00288       (length,) = _struct_I.unpack(str[start:end])
00289       start = end
00290       end += length
00291       if python3:
00292         self.neg_prefix = str[start:end].decode('utf-8')
00293       else:
00294         self.neg_prefix = str[start:end]
00295       return self
00296     except struct.error as e:
00297       raise genpy.DeserializationError(e) #most likely buffer underfill
00298 
00299 _struct_I = genpy.struct_I
00300 _struct_f = struct.Struct("<f")


tug_ist_diagnosis_msgs
Author(s): Safdar Zaman, Gerald Steinbauer
autogenerated on Mon Jan 6 2014 11:51:02