00001 """autogenerated by genpy from mtconnect_example_msgs/StateMachineStatus.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 std_msgs.msg
00008
00009 class StateMachineStatus(genpy.Message):
00010 _md5sum = "6fff571932373881ce2e9858ba00d3c3"
00011 _type = "mtconnect_example_msgs/StateMachineStatus"
00012 _has_header = True
00013 _full_text = """# The StateMachineStatus message contains status information
00014 # about the current running state machine.
00015
00016 # The header frame ID is not used
00017 Header header
00018
00019 # Current state (enumerated type)
00020 int32 state
00021
00022 # Current state (string)
00023 string state_name
00024
00025 ================================================================================
00026 MSG: std_msgs/Header
00027 # Standard metadata for higher-level stamped data types.
00028 # This is generally used to communicate timestamped data
00029 # in a particular coordinate frame.
00030 #
00031 # sequence ID: consecutively increasing ID
00032 uint32 seq
00033 #Two-integer timestamp that is expressed as:
00034 # * stamp.secs: seconds (stamp_secs) since epoch
00035 # * stamp.nsecs: nanoseconds since stamp_secs
00036 # time-handling sugar is provided by the client library
00037 time stamp
00038 #Frame this data is associated with
00039 # 0: no frame
00040 # 1: global frame
00041 string frame_id
00042
00043 """
00044 __slots__ = ['header','state','state_name']
00045 _slot_types = ['std_msgs/Header','int32','string']
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 header,state,state_name
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(StateMachineStatus, self).__init__(*args, **kwds)
00063
00064 if self.header is None:
00065 self.header = std_msgs.msg.Header()
00066 if self.state is None:
00067 self.state = 0
00068 if self.state_name is None:
00069 self.state_name = ''
00070 else:
00071 self.header = std_msgs.msg.Header()
00072 self.state = 0
00073 self.state_name = ''
00074
00075 def _get_types(self):
00076 """
00077 internal API method
00078 """
00079 return self._slot_types
00080
00081 def serialize(self, buff):
00082 """
00083 serialize message into buffer
00084 :param buff: buffer, ``StringIO``
00085 """
00086 try:
00087 _x = self
00088 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00089 _x = self.header.frame_id
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 buff.write(_struct_i.pack(self.state))
00096 _x = self.state_name
00097 length = len(_x)
00098 if python3 or type(_x) == unicode:
00099 _x = _x.encode('utf-8')
00100 length = len(_x)
00101 buff.write(struct.pack('<I%ss'%length, length, _x))
00102 except struct.error as se: self._check_types(se)
00103 except TypeError as te: self._check_types(te)
00104
00105 def deserialize(self, str):
00106 """
00107 unpack serialized message in str into this message instance
00108 :param str: byte array of serialized message, ``str``
00109 """
00110 try:
00111 if self.header is None:
00112 self.header = std_msgs.msg.Header()
00113 end = 0
00114 _x = self
00115 start = end
00116 end += 12
00117 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00118 start = end
00119 end += 4
00120 (length,) = _struct_I.unpack(str[start:end])
00121 start = end
00122 end += length
00123 if python3:
00124 self.header.frame_id = str[start:end].decode('utf-8')
00125 else:
00126 self.header.frame_id = str[start:end]
00127 start = end
00128 end += 4
00129 (self.state,) = _struct_i.unpack(str[start:end])
00130 start = end
00131 end += 4
00132 (length,) = _struct_I.unpack(str[start:end])
00133 start = end
00134 end += length
00135 if python3:
00136 self.state_name = str[start:end].decode('utf-8')
00137 else:
00138 self.state_name = str[start:end]
00139 return self
00140 except struct.error as e:
00141 raise genpy.DeserializationError(e)
00142
00143
00144 def serialize_numpy(self, buff, numpy):
00145 """
00146 serialize message with numpy array types into buffer
00147 :param buff: buffer, ``StringIO``
00148 :param numpy: numpy python module
00149 """
00150 try:
00151 _x = self
00152 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00153 _x = self.header.frame_id
00154 length = len(_x)
00155 if python3 or type(_x) == unicode:
00156 _x = _x.encode('utf-8')
00157 length = len(_x)
00158 buff.write(struct.pack('<I%ss'%length, length, _x))
00159 buff.write(_struct_i.pack(self.state))
00160 _x = self.state_name
00161 length = len(_x)
00162 if python3 or type(_x) == unicode:
00163 _x = _x.encode('utf-8')
00164 length = len(_x)
00165 buff.write(struct.pack('<I%ss'%length, length, _x))
00166 except struct.error as se: self._check_types(se)
00167 except TypeError as te: self._check_types(te)
00168
00169 def deserialize_numpy(self, str, numpy):
00170 """
00171 unpack serialized message in str into this message instance using numpy for array types
00172 :param str: byte array of serialized message, ``str``
00173 :param numpy: numpy python module
00174 """
00175 try:
00176 if self.header is None:
00177 self.header = std_msgs.msg.Header()
00178 end = 0
00179 _x = self
00180 start = end
00181 end += 12
00182 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.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 self.header.frame_id = str[start:end].decode('utf-8')
00190 else:
00191 self.header.frame_id = str[start:end]
00192 start = end
00193 end += 4
00194 (self.state,) = _struct_i.unpack(str[start:end])
00195 start = end
00196 end += 4
00197 (length,) = _struct_I.unpack(str[start:end])
00198 start = end
00199 end += length
00200 if python3:
00201 self.state_name = str[start:end].decode('utf-8')
00202 else:
00203 self.state_name = str[start:end]
00204 return self
00205 except struct.error as e:
00206 raise genpy.DeserializationError(e)
00207
00208 _struct_I = genpy.struct_I
00209 _struct_i = struct.Struct("<i")
00210 _struct_3I = struct.Struct("<3I")