Go to the documentation of this file.00001 """autogenerated by genpy from industrial_msgs/DebugLevel.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 DebugLevel(genpy.Message):
00009 _md5sum = "5bfde194fd95d83abdb02a03ee48fbe7"
00010 _type = "industrial_msgs/DebugLevel"
00011 _has_header = False
00012 _full_text = """# Debug level message enumeration. This may replicate some functionality that
00013 # alreay exists in the ROS logger.
00014 # TODO: Get more information on the ROS Logger.
00015 uint8 val
00016
00017 uint8 DEBUG = 5
00018 uint8 INFO = 4
00019 uint8 WARN = 3
00020 uint8 ERROR = 2
00021 uint8 FATAL = 1
00022 uint8 NONE = 0
00023
00024 """
00025
00026 DEBUG = 5
00027 INFO = 4
00028 WARN = 3
00029 ERROR = 2
00030 FATAL = 1
00031 NONE = 0
00032
00033 __slots__ = ['val']
00034 _slot_types = ['uint8']
00035
00036 def __init__(self, *args, **kwds):
00037 """
00038 Constructor. Any message fields that are implicitly/explicitly
00039 set to None will be assigned a default value. The recommend
00040 use is keyword arguments as this is more robust to future message
00041 changes. You cannot mix in-order arguments and keyword arguments.
00042
00043 The available fields are:
00044 val
00045
00046 :param args: complete set of field values, in .msg order
00047 :param kwds: use keyword arguments corresponding to message field names
00048 to set specific fields.
00049 """
00050 if args or kwds:
00051 super(DebugLevel, self).__init__(*args, **kwds)
00052
00053 if self.val is None:
00054 self.val = 0
00055 else:
00056 self.val = 0
00057
00058 def _get_types(self):
00059 """
00060 internal API method
00061 """
00062 return self._slot_types
00063
00064 def serialize(self, buff):
00065 """
00066 serialize message into buffer
00067 :param buff: buffer, ``StringIO``
00068 """
00069 try:
00070 buff.write(_struct_B.pack(self.val))
00071 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00072 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00073
00074 def deserialize(self, str):
00075 """
00076 unpack serialized message in str into this message instance
00077 :param str: byte array of serialized message, ``str``
00078 """
00079 try:
00080 end = 0
00081 start = end
00082 end += 1
00083 (self.val,) = _struct_B.unpack(str[start:end])
00084 return self
00085 except struct.error as e:
00086 raise genpy.DeserializationError(e)
00087
00088
00089 def serialize_numpy(self, buff, numpy):
00090 """
00091 serialize message with numpy array types into buffer
00092 :param buff: buffer, ``StringIO``
00093 :param numpy: numpy python module
00094 """
00095 try:
00096 buff.write(_struct_B.pack(self.val))
00097 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00098 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00099
00100 def deserialize_numpy(self, str, numpy):
00101 """
00102 unpack serialized message in str into this message instance using numpy for array types
00103 :param str: byte array of serialized message, ``str``
00104 :param numpy: numpy python module
00105 """
00106 try:
00107 end = 0
00108 start = end
00109 end += 1
00110 (self.val,) = _struct_B.unpack(str[start:end])
00111 return self
00112 except struct.error as e:
00113 raise genpy.DeserializationError(e)
00114
00115 _struct_I = genpy.struct_I
00116 _struct_B = struct.Struct("<B")