#include <DriverStationLCD.h>
Public Types | |
enum | Line { kMain_Line6 =0, kUser_Line1 =0, kUser_Line2 =1, kUser_Line3 =2, kUser_Line4 =3, kUser_Line5 =4, kUser_Line6 =5 } |
Public Member Functions | |
void | UpdateLCD () |
void | Printf (Line line, int32_t startingColumn, const char *writeFmt,...) |
void | VPrintf (Line line, int32_t startingColumn, const char *writeFmt, va_list args) |
void | PrintfLine (Line line, const char *writeFmt,...) |
void | VPrintfLine (Line line, const char *writeFmt, va_list args) |
void | Clear () |
Public Member Functions inherited from SensorBase | |
SensorBase () | |
virtual | ~SensorBase () |
Public Member Functions inherited from ErrorBase | |
virtual Error & | GetError () |
Retrieve the current error. Get the current error information associated with this sensor. | |
virtual const Error & | GetError () const |
virtual void | SetErrnoError (const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const |
Set error information associated with a C library call that set an error to the "errno" global variable. More... | |
virtual void | SetImaqError (int success, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const |
Set the current error information associated from the nivision Imaq API. More... | |
virtual void | SetError (Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const |
Set the current error information associated with this sensor. More... | |
virtual void | SetWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) const |
Set the current error information associated with this sensor. More... | |
virtual void | CloneError (ErrorBase *rhs) const |
virtual void | ClearError () const |
Clear the current error information associated with this sensor. | |
virtual bool | StatusIsFatal () const |
Check if the current error code represents a fatal error. More... | |
Static Public Member Functions | |
static DriverStationLCD * | GetInstance () |
Static Public Member Functions inherited from SensorBase | |
static void | DeleteSingletons () |
static uint32_t | GetDefaultAnalogModule () |
static uint32_t | GetDefaultDigitalModule () |
static uint32_t | GetDefaultSolenoidModule () |
static bool | CheckAnalogModule (uint8_t moduleNumber) |
static bool | CheckDigitalModule (uint8_t moduleNumber) |
static bool | CheckPWMModule (uint8_t moduleNumber) |
static bool | CheckRelayModule (uint8_t moduleNumber) |
static bool | CheckSolenoidModule (uint8_t moduleNumber) |
static bool | CheckDigitalChannel (uint32_t channel) |
static bool | CheckRelayChannel (uint32_t channel) |
static bool | CheckPWMChannel (uint32_t channel) |
static bool | CheckAnalogChannel (uint32_t channel) |
static bool | CheckSolenoidChannel (uint32_t channel) |
Static Public Member Functions inherited from ErrorBase | |
static void | SetGlobalError (Error::Code code, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) |
static void | SetGlobalWPIError (const char *errorMessage, const char *contextMessage, const char *filename, const char *function, uint32_t lineNumber) |
static Error & | GetGlobalError () |
Static Public Attributes | |
static const uint32_t | kSyncTimeout_ms = 20 |
static const uint16_t | kFullDisplayTextCommand = 0x9FFF |
static const int32_t | kLineLength = 21 |
static const int32_t | kNumLines = 6 |
Static Public Attributes inherited from SensorBase | |
static const uint32_t | kSystemClockTicksPerMicrosecond = 40 |
static const uint32_t | kDigitalChannels = 14 |
static const uint32_t | kAnalogChannels = 8 |
static const uint32_t | kAnalogModules = 2 |
static const uint32_t | kDigitalModules = 2 |
static const uint32_t | kSolenoidChannels = 8 |
static const uint32_t | kSolenoidModules = 2 |
static const uint32_t | kPwmChannels = 10 |
static const uint32_t | kRelayChannels = 8 |
static const uint32_t | kChassisSlots = 8 |
Protected Member Functions | |
DriverStationLCD () | |
Protected Member Functions inherited from SensorBase | |
void | AddToSingletonList () |
Protected Member Functions inherited from ErrorBase | |
ErrorBase () | |
Initialize the instance status to 0 for now. | |
Additional Inherited Members | |
Protected Attributes inherited from ErrorBase | |
Error | m_error |
Static Protected Attributes inherited from ErrorBase | |
static SEM_ID | _globalErrorMutex = semMCreate(SEM_Q_PRIORITY | SEM_DELETE_SAFE | SEM_INVERSION_SAFE) |
static Error | _globalError |
Provide access to "LCD" on the Driver Station. This is the Messages box on the DS Operation tab.
Buffer the printed data locally and then send it when UpdateLCD is called.
|
protected |
DriverStationLCD contructor.
This is only called once the first time GetInstance() is called
void DriverStationLCD::Clear | ( | ) |
Clear all lines on the LCD.
|
static |
Return a pointer to the singleton DriverStationLCD.
void DriverStationLCD::Printf | ( | Line | line, |
int32_t | startingColumn, | ||
const char * | writeFmt, | ||
... | |||
) |
Print formatted text to the Driver Station LCD text bufer.
Use UpdateLCD() periodically to actually send the text to the Driver Station.
line | The line on the LCD to print to. |
startingColumn | The column to start printing to. This is a 1-based number. |
writeFmt | The printf format string describing how to print. |
void DriverStationLCD::PrintfLine | ( | Line | line, |
const char * | writeFmt, | ||
... | |||
) |
Print formatted text to the Driver Station LCD text bufer. This function pads the line with empty spaces.
Use UpdateLCD() periodically to actually send the text to the Driver Station.
line | The line on the LCD to print to. |
writeFmt | The printf format string describing how to print. |
void DriverStationLCD::UpdateLCD | ( | ) |
Send the text data to the Driver Station.