_MultiWaveformTransition.py
Go to the documentation of this file.
00001 """autogenerated by genpy from ethercat_trigger_controllers/MultiWaveformTransition.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 MultiWaveformTransition(genpy.Message):
00009   _md5sum = "bdd47e5d1c3d77473af2df9833a0608a"
00010   _type = "ethercat_trigger_controllers/MultiWaveformTransition"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Used to specify a transition in the SetMultiWaveform service.
00013 
00014 float64 time # Transition time after start of period.
00015 uint32 value # Value of the digital output after the transition time.
00016 string topic # Topic to publish the transition timestamp to, or empty string if the transition should not be published.
00017 
00018 """
00019   __slots__ = ['time','value','topic']
00020   _slot_types = ['float64','uint32','string']
00021 
00022   def __init__(self, *args, **kwds):
00023     """
00024     Constructor. Any message fields that are implicitly/explicitly
00025     set to None will be assigned a default value. The recommend
00026     use is keyword arguments as this is more robust to future message
00027     changes.  You cannot mix in-order arguments and keyword arguments.
00028 
00029     The available fields are:
00030        time,value,topic
00031 
00032     :param args: complete set of field values, in .msg order
00033     :param kwds: use keyword arguments corresponding to message field names
00034     to set specific fields.
00035     """
00036     if args or kwds:
00037       super(MultiWaveformTransition, self).__init__(*args, **kwds)
00038       #message fields cannot be None, assign default values for those that are
00039       if self.time is None:
00040         self.time = 0.
00041       if self.value is None:
00042         self.value = 0
00043       if self.topic is None:
00044         self.topic = ''
00045     else:
00046       self.time = 0.
00047       self.value = 0
00048       self.topic = ''
00049 
00050   def _get_types(self):
00051     """
00052     internal API method
00053     """
00054     return self._slot_types
00055 
00056   def serialize(self, buff):
00057     """
00058     serialize message into buffer
00059     :param buff: buffer, ``StringIO``
00060     """
00061     try:
00062       _x = self
00063       buff.write(_struct_dI.pack(_x.time, _x.value))
00064       _x = self.topic
00065       length = len(_x)
00066       if python3 or type(_x) == unicode:
00067         _x = _x.encode('utf-8')
00068         length = len(_x)
00069       buff.write(struct.pack('<I%ss'%length, length, _x))
00070     except struct.error as se: self._check_types(se)
00071     except TypeError as te: self._check_types(te)
00072 
00073   def deserialize(self, str):
00074     """
00075     unpack serialized message in str into this message instance
00076     :param str: byte array of serialized message, ``str``
00077     """
00078     try:
00079       end = 0
00080       _x = self
00081       start = end
00082       end += 12
00083       (_x.time, _x.value,) = _struct_dI.unpack(str[start:end])
00084       start = end
00085       end += 4
00086       (length,) = _struct_I.unpack(str[start:end])
00087       start = end
00088       end += length
00089       if python3:
00090         self.topic = str[start:end].decode('utf-8')
00091       else:
00092         self.topic = str[start:end]
00093       return self
00094     except struct.error as e:
00095       raise genpy.DeserializationError(e) #most likely buffer underfill
00096 
00097 
00098   def serialize_numpy(self, buff, numpy):
00099     """
00100     serialize message with numpy array types into buffer
00101     :param buff: buffer, ``StringIO``
00102     :param numpy: numpy python module
00103     """
00104     try:
00105       _x = self
00106       buff.write(_struct_dI.pack(_x.time, _x.value))
00107       _x = self.topic
00108       length = len(_x)
00109       if python3 or type(_x) == unicode:
00110         _x = _x.encode('utf-8')
00111         length = len(_x)
00112       buff.write(struct.pack('<I%ss'%length, length, _x))
00113     except struct.error as se: self._check_types(se)
00114     except TypeError as te: self._check_types(te)
00115 
00116   def deserialize_numpy(self, str, numpy):
00117     """
00118     unpack serialized message in str into this message instance using numpy for array types
00119     :param str: byte array of serialized message, ``str``
00120     :param numpy: numpy python module
00121     """
00122     try:
00123       end = 0
00124       _x = self
00125       start = end
00126       end += 12
00127       (_x.time, _x.value,) = _struct_dI.unpack(str[start:end])
00128       start = end
00129       end += 4
00130       (length,) = _struct_I.unpack(str[start:end])
00131       start = end
00132       end += length
00133       if python3:
00134         self.topic = str[start:end].decode('utf-8')
00135       else:
00136         self.topic = str[start:end]
00137       return self
00138     except struct.error as e:
00139       raise genpy.DeserializationError(e) #most likely buffer underfill
00140 
00141 _struct_I = genpy.struct_I
00142 _struct_dI = struct.Struct("<dI")


ethercat_trigger_controllers
Author(s): Blaise Gassend
autogenerated on Fri Jan 3 2014 11:41:29