_StateMachineCmd.py
Go to the documentation of this file.
00001 """autogenerated by genpy from mtconnect_example_msgs/StateMachineCmdRequest.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 StateMachineCmdRequest(genpy.Message):
00009   _md5sum = "2d868471d0fdc4ce08a50620b142cbc3"
00010   _type = "mtconnect_example_msgs/StateMachineCmdRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 int8 FAULT_RESET=1
00014 int8 START=2
00015 int8 STOP =3
00016 int8 command
00017 
00018 """
00019   # Pseudo-constants
00020   FAULT_RESET = 1
00021   START = 2
00022   STOP = 3
00023 
00024   __slots__ = ['command']
00025   _slot_types = ['int8']
00026 
00027   def __init__(self, *args, **kwds):
00028     """
00029     Constructor. Any message fields that are implicitly/explicitly
00030     set to None will be assigned a default value. The recommend
00031     use is keyword arguments as this is more robust to future message
00032     changes.  You cannot mix in-order arguments and keyword arguments.
00033 
00034     The available fields are:
00035        command
00036 
00037     :param args: complete set of field values, in .msg order
00038     :param kwds: use keyword arguments corresponding to message field names
00039     to set specific fields.
00040     """
00041     if args or kwds:
00042       super(StateMachineCmdRequest, self).__init__(*args, **kwds)
00043       #message fields cannot be None, assign default values for those that are
00044       if self.command is None:
00045         self.command = 0
00046     else:
00047       self.command = 0
00048 
00049   def _get_types(self):
00050     """
00051     internal API method
00052     """
00053     return self._slot_types
00054 
00055   def serialize(self, buff):
00056     """
00057     serialize message into buffer
00058     :param buff: buffer, ``StringIO``
00059     """
00060     try:
00061       buff.write(_struct_b.pack(self.command))
00062     except struct.error as se: self._check_types(se)
00063     except TypeError as te: self._check_types(te)
00064 
00065   def deserialize(self, str):
00066     """
00067     unpack serialized message in str into this message instance
00068     :param str: byte array of serialized message, ``str``
00069     """
00070     try:
00071       end = 0
00072       start = end
00073       end += 1
00074       (self.command,) = _struct_b.unpack(str[start:end])
00075       return self
00076     except struct.error as e:
00077       raise genpy.DeserializationError(e) #most likely buffer underfill
00078 
00079 
00080   def serialize_numpy(self, buff, numpy):
00081     """
00082     serialize message with numpy array types into buffer
00083     :param buff: buffer, ``StringIO``
00084     :param numpy: numpy python module
00085     """
00086     try:
00087       buff.write(_struct_b.pack(self.command))
00088     except struct.error as se: self._check_types(se)
00089     except TypeError as te: self._check_types(te)
00090 
00091   def deserialize_numpy(self, str, numpy):
00092     """
00093     unpack serialized message in str into this message instance using numpy for array types
00094     :param str: byte array of serialized message, ``str``
00095     :param numpy: numpy python module
00096     """
00097     try:
00098       end = 0
00099       start = end
00100       end += 1
00101       (self.command,) = _struct_b.unpack(str[start:end])
00102       return self
00103     except struct.error as e:
00104       raise genpy.DeserializationError(e) #most likely buffer underfill
00105 
00106 _struct_I = genpy.struct_I
00107 _struct_b = struct.Struct("<b")
00108 """autogenerated by genpy from mtconnect_example_msgs/StateMachineCmdResponse.msg. Do not edit."""
00109 import sys
00110 python3 = True if sys.hexversion > 0x03000000 else False
00111 import genpy
00112 import struct
00113 
00114 
00115 class StateMachineCmdResponse(genpy.Message):
00116   _md5sum = "1ea39b897cc8620c46aaa14cb60920cd"
00117   _type = "mtconnect_example_msgs/StateMachineCmdResponse"
00118   _has_header = False #flag to mark the presence of a Header object
00119   _full_text = """
00120 bool accepted
00121 
00122 """
00123   __slots__ = ['accepted']
00124   _slot_types = ['bool']
00125 
00126   def __init__(self, *args, **kwds):
00127     """
00128     Constructor. Any message fields that are implicitly/explicitly
00129     set to None will be assigned a default value. The recommend
00130     use is keyword arguments as this is more robust to future message
00131     changes.  You cannot mix in-order arguments and keyword arguments.
00132 
00133     The available fields are:
00134        accepted
00135 
00136     :param args: complete set of field values, in .msg order
00137     :param kwds: use keyword arguments corresponding to message field names
00138     to set specific fields.
00139     """
00140     if args or kwds:
00141       super(StateMachineCmdResponse, self).__init__(*args, **kwds)
00142       #message fields cannot be None, assign default values for those that are
00143       if self.accepted is None:
00144         self.accepted = False
00145     else:
00146       self.accepted = False
00147 
00148   def _get_types(self):
00149     """
00150     internal API method
00151     """
00152     return self._slot_types
00153 
00154   def serialize(self, buff):
00155     """
00156     serialize message into buffer
00157     :param buff: buffer, ``StringIO``
00158     """
00159     try:
00160       buff.write(_struct_B.pack(self.accepted))
00161     except struct.error as se: self._check_types(se)
00162     except TypeError as te: self._check_types(te)
00163 
00164   def deserialize(self, str):
00165     """
00166     unpack serialized message in str into this message instance
00167     :param str: byte array of serialized message, ``str``
00168     """
00169     try:
00170       end = 0
00171       start = end
00172       end += 1
00173       (self.accepted,) = _struct_B.unpack(str[start:end])
00174       self.accepted = bool(self.accepted)
00175       return self
00176     except struct.error as e:
00177       raise genpy.DeserializationError(e) #most likely buffer underfill
00178 
00179 
00180   def serialize_numpy(self, buff, numpy):
00181     """
00182     serialize message with numpy array types into buffer
00183     :param buff: buffer, ``StringIO``
00184     :param numpy: numpy python module
00185     """
00186     try:
00187       buff.write(_struct_B.pack(self.accepted))
00188     except struct.error as se: self._check_types(se)
00189     except TypeError as te: self._check_types(te)
00190 
00191   def deserialize_numpy(self, str, numpy):
00192     """
00193     unpack serialized message in str into this message instance using numpy for array types
00194     :param str: byte array of serialized message, ``str``
00195     :param numpy: numpy python module
00196     """
00197     try:
00198       end = 0
00199       start = end
00200       end += 1
00201       (self.accepted,) = _struct_B.unpack(str[start:end])
00202       self.accepted = bool(self.accepted)
00203       return self
00204     except struct.error as e:
00205       raise genpy.DeserializationError(e) #most likely buffer underfill
00206 
00207 _struct_I = genpy.struct_I
00208 _struct_B = struct.Struct("<B")
00209 class StateMachineCmd(object):
00210   _type          = 'mtconnect_example_msgs/StateMachineCmd'
00211   _md5sum = '71ab87155d9ffa50f42e7dafb74aeca4'
00212   _request_class  = StateMachineCmdRequest
00213   _response_class = StateMachineCmdResponse


mtconnect_example_msgs
Author(s): Shaun M. Edwards
autogenerated on Mon Jan 6 2014 11:29:52