##
##############################################################################
#
# @file       flighttelemetrystats.py
# @author     The LibrePilot Project, http://www.librepilot.org Copyright (C) 2017.
#             The OpenPilot Team, http://www.openpilot.org Copyright (C) 2011.
# @brief      Implementation of the FlightTelemetryStats object. This file has been
#             automatically generated by the UAVObjectGenerator. For use with
#             the PyMite VM of the FlightPlan module.
#
# @note       Object definition file: flighttelemetrystats.xml.
#             This is an automatically generated file.
#             DO NOT modify manually.
#
# @see        The GNU Public License (GPL) Version 3
#
#############################################################################/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

from librepilot.uavtalk.uavobject import *

# Field TxDataRate definition
class TxDataRateField(UAVObjectField):
    def __init__(self):
        UAVObjectField.__init__(self, 6, 1)

# Field TxBytes definition
class TxBytesField(UAVObjectField):
    def __init__(self):
        UAVObjectField.__init__(self, 5, 1)

# Field TxFailures definition
class TxFailuresField(UAVObjectField):
    def __init__(self):
        UAVObjectField.__init__(self, 5, 1)

# Field TxRetries definition
class TxRetriesField(UAVObjectField):
    def __init__(self):
        UAVObjectField.__init__(self, 5, 1)

# Field RxDataRate definition
class RxDataRateField(UAVObjectField):
    def __init__(self):
        UAVObjectField.__init__(self, 6, 1)

# Field RxBytes definition
class RxBytesField(UAVObjectField):
    def __init__(self):
        UAVObjectField.__init__(self, 5, 1)

# Field RxFailures definition
class RxFailuresField(UAVObjectField):
    def __init__(self):
        UAVObjectField.__init__(self, 5, 1)

# Field RxSyncErrors definition
class RxSyncErrorsField(UAVObjectField):
    def __init__(self):
        UAVObjectField.__init__(self, 5, 1)

# Field RxCrcErrors definition
class RxCrcErrorsField(UAVObjectField):
    def __init__(self):
        UAVObjectField.__init__(self, 5, 1)

# Field Status definition
class StatusField(UAVObjectField):
    # Enumeration options
    DISCONNECTED = 0
    HANDSHAKEREQ = 1
    HANDSHAKEACK = 2
    CONNECTED = 3
    def __init__(self):
        UAVObjectField.__init__(self, 7, 1)



# Object FlightTelemetryStats definition
class FlightTelemetryStats(UAVObject):
    # Object constants
    OBJID = 1731705690

    # Constructor
    def __init__(self):
        UAVObject.__init__(self, FlightTelemetryStats.OBJID)

        # Create object fields
        self.TxDataRate = TxDataRateField()
        self.addField(self.TxDataRate)
        self.TxBytes = TxBytesField()
        self.addField(self.TxBytes)
        self.TxFailures = TxFailuresField()
        self.addField(self.TxFailures)
        self.TxRetries = TxRetriesField()
        self.addField(self.TxRetries)
        self.RxDataRate = RxDataRateField()
        self.addField(self.RxDataRate)
        self.RxBytes = RxBytesField()
        self.addField(self.RxBytes)
        self.RxFailures = RxFailuresField()
        self.addField(self.RxFailures)
        self.RxSyncErrors = RxSyncErrorsField()
        self.addField(self.RxSyncErrors)
        self.RxCrcErrors = RxCrcErrorsField()
        self.addField(self.RxCrcErrors)
        self.Status = StatusField()
        self.addField(self.Status)

        # Read field data
        self.read()
        self.metadata.read()
