LibDS
Qt-based library for controlling FRC robots
Classes | Public Types | Static Public Member Functions | Friends | List of all members
DS Class Reference

Defines the data types shared between the modules of the LibDS. More...

#include <DS_Common.h>

Inheritance diagram for DS:
DS_Base DriverStation DS_Config

Classes

struct  Joystick
 Represents a joystick and its respective properties. More...
 

Public Types

enum  ControlMode { kControlTest, kControlAutonomous, kControlTeleoperated }
 Represents the available control modes of the robot. More...
 
enum  Alliance { kAllianceRed, kAllianceBlue }
 Represents the team alliance. More...
 
enum  Position { kPosition1, kPosition2, kPosition3 }
 Represents the different team positions for each alliance. More...
 
enum  CommStatus { kCommsWorking, kCommsFailing }
 Represents the communication status between the client and a target. More...
 
enum  CodeStatus { kCodeRunning, kCodeFailing }
 Represents the status of the robot code. More...
 
enum  EnableStatus { kEnabled, kDisabled }
 Represents the enabled state of the robot. More...
 
enum  OperationStatus { kNormal, kEmergencyStop }
 Represents the operation status of the robot. More...
 
enum  VoltageStatus { kVoltageNormal, kVoltageBrownout }
 Represents the status of the robot power supply. When the battery level is low or there are too many power spikes, the robot may report a voltage brownout. More...
 
enum  SocketType { kSocketTypeUDP, kSocketTypeTCP }
 Represents the socket types that can be used by the DS modules. More...
 

Static Public Member Functions

static QString getStaticIP (int net, int team, int host)
 Returns a calculated IP address based on the team address. More...
 
static QString timezone ()
 Returns the current timezone as a string.
 
static QByteArray readSocket (QUdpSocket *socket)
 Reads the datagrams received by the given UDP socket.
 
static QByteArray readSocket (QTcpSocket *socket)
 Reads the data received by the given TCP socket.
 

Friends

Q_DECL_CONSTEXPR const QMetaObject * qt_getEnumMetaObject (ControlMode) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const char * qt_getEnumName (ControlMode) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const QMetaObject * qt_getEnumMetaObject (Alliance) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const char * qt_getEnumName (Alliance) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const QMetaObject * qt_getEnumMetaObject (Position) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const char * qt_getEnumName (Position) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const QMetaObject * qt_getEnumMetaObject (CommStatus) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const char * qt_getEnumName (CommStatus) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const QMetaObject * qt_getEnumMetaObject (CodeStatus) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const char * qt_getEnumName (CodeStatus) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const QMetaObject * qt_getEnumMetaObject (EnableStatus) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const char * qt_getEnumName (EnableStatus) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const QMetaObject * qt_getEnumMetaObject (OperationStatus) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const char * qt_getEnumName (OperationStatus) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const QMetaObject * qt_getEnumMetaObject (VoltageStatus) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const char * qt_getEnumName (VoltageStatus) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const QMetaObject * qt_getEnumMetaObject (SocketType) Q_DECL_NOEXCEPT
 
Q_DECL_CONSTEXPR const char * qt_getEnumName (SocketType) Q_DECL_NOEXCEPT
 

Detailed Description

Defines the data types shared between the modules of the LibDS.

Holds the common data types shared between the DriverStation and the Protocol classes of this library. This data must be registered inside a QObject class in order to allow full support for QML applications.

Member Enumeration Documentation

Represents the team alliance.

Enumerator
kAllianceRed 

Set robot to red alliance

kAllianceBlue 

Set robot to blue alliance

Represents the status of the robot code.

Enumerator
kCodeRunning 

Robot code is operational

kCodeFailing 

For some reason, robot does not have code

Represents the communication status between the client and a target.

Enumerator
kCommsWorking 

Communications with target have been established

kCommsFailing 

We don't have a working comms. link with target

Represents the available control modes of the robot.

Enumerator
kControlTest 

Dashboard controls individual actuators

kControlAutonomous 

Robot uses its programming to move

kControlTeleoperated 

Driver moves robot

Represents the enabled state of the robot.

Enumerator
kEnabled 

Robot is enabled

kDisabled 

Robot is disabled

Represents the operation status of the robot.

Enumerator
kNormal 

Robot program operates

kEmergencyStop 

Robot program is stopped

Represents the different team positions for each alliance.

Enumerator
kPosition1 

Position 1, regardless of alliance

kPosition2 

Position 2, regardless of alliance

kPosition3 

Position 3, regardless of alliance

Represents the socket types that can be used by the DS modules.

Enumerator
kSocketTypeUDP 

Represents a UDP socket

kSocketTypeTCP 

Represents a TCP socket

Represents the status of the robot power supply. When the battery level is low or there are too many power spikes, the robot may report a voltage brownout.

Enumerator
kVoltageNormal 

Robot systems have enough power to operate

kVoltageBrownout 

Robot systems may fail due to lack of power

Member Function Documentation

static QString DS::getStaticIP ( int  net,
int  team,
int  host 
)
inlinestatic

Returns a calculated IP address based on the team address.

For example:

  • getStaticIp ( 10, 3794, 1) would return 10.37.94.1
  • getStaticIp (177, 3794, 2) would return 177.37.94.2
  • getStaticIp ( 10, 118, 3) would return 10.01.18.3
  • And so on...

Referenced by FRC_2014::radioAddress(), FRC_2015::radioAddress(), Protocol::radioAddress(), FRC_2014::robotAddress(), and Protocol::robotAddress().


The documentation for this class was generated from the following file: