# automatically generated by the FlatBuffers compiler, do not modify

# namespace: isp

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class ForwardGears(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAs(cls, buf, offset=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = ForwardGears()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def GetRootAsForwardGears(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    @classmethod
    def ForwardGearsBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x49\x53\x50\x46", size_prefixed=size_prefixed)

    # ForwardGears
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # ForwardGears
    def Ratio(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # ForwardGears
    def DownRatio(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

    # ForwardGears
    def UpRatio(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float64Flags, o + self._tab.Pos)
        return 0.0

def ForwardGearsStart(builder): builder.StartObject(3)
def Start(builder):
    return ForwardGearsStart(builder)
def ForwardGearsAddRatio(builder, ratio): builder.PrependFloat64Slot(0, ratio, 0.0)
def AddRatio(builder, ratio):
    return ForwardGearsAddRatio(builder, ratio)
def ForwardGearsAddDownRatio(builder, downRatio): builder.PrependFloat64Slot(1, downRatio, 0.0)
def AddDownRatio(builder, downRatio):
    return ForwardGearsAddDownRatio(builder, downRatio)
def ForwardGearsAddUpRatio(builder, upRatio): builder.PrependFloat64Slot(2, upRatio, 0.0)
def AddUpRatio(builder, upRatio):
    return ForwardGearsAddUpRatio(builder, upRatio)
def ForwardGearsEnd(builder): return builder.EndObject()
def End(builder):
    return ForwardGearsEnd(builder)