jerrym | f157933 | 2013-02-07 01:56:28 +0000 | [diff] [blame] | 1 | /*----------------------------------------------------------------------------*/
|
| 2 | /* Copyright (c) FIRST 2008. All Rights Reserved. */
|
| 3 | /* Open Source Software - may be modified and shared by FRC teams. The code */
|
| 4 | /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */
|
| 5 | /*----------------------------------------------------------------------------*/
|
| 6 |
|
| 7 | #ifndef __DRIVER_STATION_LCD_H__
|
| 8 | #define __DRIVER_STATION_LCD_H__
|
| 9 |
|
| 10 | #include "SensorBase.h"
|
| 11 |
|
| 12 | /**
|
| 13 | * Provide access to "LCD" on the Driver Station.
|
| 14 | * This is the Messages box on the DS Operation tab.
|
| 15 | *
|
| 16 | * Buffer the printed data locally and then send it
|
| 17 | * when UpdateLCD is called.
|
| 18 | */
|
| 19 | class DriverStationLCD : public SensorBase
|
| 20 | {
|
| 21 | public:
|
| 22 | static const UINT32 kSyncTimeout_ms = 20;
|
| 23 | static const UINT16 kFullDisplayTextCommand = 0x9FFF;
|
| 24 | static const INT32 kLineLength = 21;
|
| 25 | static const INT32 kNumLines = 6;
|
| 26 | enum Line {kMain_Line6=0, kUser_Line1=0, kUser_Line2=1, kUser_Line3=2, kUser_Line4=3, kUser_Line5=4, kUser_Line6=5};
|
| 27 |
|
| 28 | virtual ~DriverStationLCD();
|
| 29 | static DriverStationLCD *GetInstance();
|
| 30 |
|
| 31 | void UpdateLCD();
|
| 32 | void Printf(Line line, INT32 startingColumn, const char *writeFmt, ...);
|
| 33 | void VPrintf(Line line, INT32 startingColumn, const char *writeFmt, va_list args);
|
| 34 | void PrintfLine(Line line, const char *writeFmt, ...);
|
| 35 | void VPrintfLine(Line line, const char *writeFmt, va_list args);
|
| 36 |
|
| 37 | void Clear();
|
| 38 |
|
| 39 | protected:
|
| 40 | DriverStationLCD();
|
| 41 |
|
| 42 | private:
|
| 43 | static void InitTask(DriverStationLCD *ds);
|
| 44 | static DriverStationLCD *m_instance;
|
| 45 | DISALLOW_COPY_AND_ASSIGN(DriverStationLCD);
|
| 46 |
|
| 47 | char *m_textBuffer;
|
| 48 | SEM_ID m_textBufferSemaphore;
|
| 49 | };
|
| 50 |
|
| 51 | #endif
|
| 52 |
|