_TextAlignment.py
Go to the documentation of this file.
00001 """autogenerated by genpy from rve_msgs/TextAlignment.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 TextAlignment(genpy.Message):
00009   _md5sum = "63cbfa496dfe0c00b2baca61b9d11f86"
00010   _type = "rve_msgs/TextAlignment"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint8 H_LEFT = 0
00013 uint8 H_CENTER = 1
00014 
00015 uint8 horizontal
00016 
00017 uint8 V_TOP = 0
00018 uint8 V_CENTER = 1
00019 uint8 V_BOTTOM = 2
00020 
00021 uint8 vertical
00022 
00023 """
00024   # Pseudo-constants
00025   H_LEFT = 0
00026   H_CENTER = 1
00027   V_TOP = 0
00028   V_CENTER = 1
00029   V_BOTTOM = 2
00030 
00031   __slots__ = ['horizontal','vertical']
00032   _slot_types = ['uint8','uint8']
00033 
00034   def __init__(self, *args, **kwds):
00035     """
00036     Constructor. Any message fields that are implicitly/explicitly
00037     set to None will be assigned a default value. The recommend
00038     use is keyword arguments as this is more robust to future message
00039     changes.  You cannot mix in-order arguments and keyword arguments.
00040 
00041     The available fields are:
00042        horizontal,vertical
00043 
00044     :param args: complete set of field values, in .msg order
00045     :param kwds: use keyword arguments corresponding to message field names
00046     to set specific fields.
00047     """
00048     if args or kwds:
00049       super(TextAlignment, self).__init__(*args, **kwds)
00050       #message fields cannot be None, assign default values for those that are
00051       if self.horizontal is None:
00052         self.horizontal = 0
00053       if self.vertical is None:
00054         self.vertical = 0
00055     else:
00056       self.horizontal = 0
00057       self.vertical = 0
00058 
00059   def _get_types(self):
00060     """
00061     internal API method
00062     """
00063     return self._slot_types
00064 
00065   def serialize(self, buff):
00066     """
00067     serialize message into buffer
00068     :param buff: buffer, ``StringIO``
00069     """
00070     try:
00071       _x = self
00072       buff.write(_struct_2B.pack(_x.horizontal, _x.vertical))
00073     except struct.error as se: self._check_types(se)
00074     except TypeError as te: self._check_types(te)
00075 
00076   def deserialize(self, str):
00077     """
00078     unpack serialized message in str into this message instance
00079     :param str: byte array of serialized message, ``str``
00080     """
00081     try:
00082       end = 0
00083       _x = self
00084       start = end
00085       end += 2
00086       (_x.horizontal, _x.vertical,) = _struct_2B.unpack(str[start:end])
00087       return self
00088     except struct.error as e:
00089       raise genpy.DeserializationError(e) #most likely buffer underfill
00090 
00091 
00092   def serialize_numpy(self, buff, numpy):
00093     """
00094     serialize message with numpy array types into buffer
00095     :param buff: buffer, ``StringIO``
00096     :param numpy: numpy python module
00097     """
00098     try:
00099       _x = self
00100       buff.write(_struct_2B.pack(_x.horizontal, _x.vertical))
00101     except struct.error as se: self._check_types(se)
00102     except TypeError as te: self._check_types(te)
00103 
00104   def deserialize_numpy(self, str, numpy):
00105     """
00106     unpack serialized message in str into this message instance using numpy for array types
00107     :param str: byte array of serialized message, ``str``
00108     :param numpy: numpy python module
00109     """
00110     try:
00111       end = 0
00112       _x = self
00113       start = end
00114       end += 2
00115       (_x.horizontal, _x.vertical,) = _struct_2B.unpack(str[start:end])
00116       return self
00117     except struct.error as e:
00118       raise genpy.DeserializationError(e) #most likely buffer underfill
00119 
00120 _struct_I = genpy.struct_I
00121 _struct_2B = struct.Struct("<2B")


rve_msgs
Author(s): Josh Faust
autogenerated on Wed Dec 11 2013 14:30:38