"""
Autogenerated python message buffer code.
Source: clad/types/cameraFOVInfo.clad
Full command line: victor-clad/tools/message-buffers/emitters/Python_emitter.py -C src -I clad/src lib/util/source/anki/clad robot/clad/src coretech/vision/clad_src coretech/common/clad_src -o generated/cladPython clad/types/cameraFOVInfo.clad
"""

from __future__ import absolute_import
from __future__ import print_function

def _modify_path():
  import inspect, os, sys
  search_paths = [
    '../..',
    '../../../../victor-clad/tools/message-buffers/support/python',
  ]
  currentpath = os.path.abspath(os.path.dirname(inspect.getfile(inspect.currentframe())))
  for search_path in search_paths:
    search_path = os.path.normpath(os.path.abspath(os.path.realpath(os.path.join(currentpath, search_path))))
    if search_path not in sys.path:
      sys.path.insert(0, search_path)
_modify_path()

import msgbuffers

Anki = msgbuffers.Namespace()
Anki.Vector = msgbuffers.Namespace()

class CameraFOVInfo(object):
  "Generated message-passing message."

  __slots__ = (
    '_horizontalFOV', # float_32
    '_verticalFOV',   # float_32
  )

  @property
  def horizontalFOV(self):
    "float_32 horizontalFOV struct property."
    return self._horizontalFOV

  @horizontalFOV.setter
  def horizontalFOV(self, value):
    self._horizontalFOV = msgbuffers.validate_float(
      'CameraFOVInfo.horizontalFOV', value, 'f')

  @property
  def verticalFOV(self):
    "float_32 verticalFOV struct property."
    return self._verticalFOV

  @verticalFOV.setter
  def verticalFOV(self, value):
    self._verticalFOV = msgbuffers.validate_float(
      'CameraFOVInfo.verticalFOV', value, 'f')

  def __init__(self, horizontalFOV=0.0, verticalFOV=0.0):
    self.horizontalFOV = horizontalFOV
    self.verticalFOV = verticalFOV

  @classmethod
  def unpack(cls, buffer):
    "Reads a new CameraFOVInfo from the given buffer."
    reader = msgbuffers.BinaryReader(buffer)
    value = cls.unpack_from(reader)
    if reader.tell() != len(reader):
      raise msgbuffers.ReadError(
        ('CameraFOVInfo.unpack received a buffer of length {length}, ' +
        'but only {position} bytes were read.').format(
        length=len(reader), position=reader.tell()))
    return value

  @classmethod
  def unpack_from(cls, reader):
    "Reads a new CameraFOVInfo from the given BinaryReader."
    _horizontalFOV = reader.read('f')
    _verticalFOV = reader.read('f')
    return cls(_horizontalFOV, _verticalFOV)

  def pack(self):
    "Writes the current CameraFOVInfo, returning bytes."
    writer = msgbuffers.BinaryWriter()
    self.pack_to(writer)
    return writer.dumps()

  def pack_to(self, writer):
    "Writes the current CameraFOVInfo to the given BinaryWriter."
    writer.write(self._horizontalFOV, 'f')
    writer.write(self._verticalFOV, 'f')

  def __eq__(self, other):
    if type(self) is type(other):
      return (self._horizontalFOV == other._horizontalFOV and
        self._verticalFOV == other._verticalFOV)
    else:
      return NotImplemented

  def __ne__(self, other):
    if type(self) is type(other):
      return not self.__eq__(other)
    else:
      return NotImplemented

  def __len__(self):
    return (msgbuffers.size(self._horizontalFOV, 'f') +
      msgbuffers.size(self._verticalFOV, 'f'))

  def __str__(self):
    return '{type}(horizontalFOV={horizontalFOV}, verticalFOV={verticalFOV})'.format(
      type=type(self).__name__,
      horizontalFOV=self._horizontalFOV,
      verticalFOV=self._verticalFOV)

  def __repr__(self):
    return '{type}(horizontalFOV={horizontalFOV}, verticalFOV={verticalFOV})'.format(
      type=type(self).__name__,
      horizontalFOV=repr(self._horizontalFOV),
      verticalFOV=repr(self._verticalFOV))

Anki.Vector.CameraFOVInfo = CameraFOVInfo
del CameraFOVInfo


