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


pr2_self_test_msgs
Author(s): Kevin Watts
autogenerated on Sat Dec 28 2013 17:29:33