WPILib 2012
WPILibRoboticsLibraryforFRC
DriverStationLCD.h
00001 /*----------------------------------------------------------------------------*/
00002 /* Copyright (c) FIRST 2008. All Rights Reserved.                                                         */
00003 /* Open Source Software - may be modified and shared by FRC teams. The code   */
00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib.  */
00005 /*----------------------------------------------------------------------------*/
00006 
00007 #ifndef __DRIVER_STATION_LCD_H__
00008 #define __DRIVER_STATION_LCD_H__
00009 
00010 #include "SensorBase.h"
00011 
00018 class DriverStationLCD : public SensorBase
00019 {
00020 public:
00021         static const UINT32 kSyncTimeout_ms = 20;
00022         static const UINT16 kFullDisplayTextCommand = 0x9FFF;
00023         static const INT32 kLineLength = 21;
00024         static const INT32 kNumLines = 6;
00025         enum Line {kMain_Line6=0, kUser_Line1=0, kUser_Line2=1, kUser_Line3=2, kUser_Line4=3, kUser_Line5=4, kUser_Line6=5};
00026 
00027         virtual ~DriverStationLCD();
00028         static DriverStationLCD *GetInstance();
00029 
00030         void UpdateLCD();
00031         void Printf(Line line, INT32 startingColumn, const char *writeFmt, ...);
00032         void PrintfLine(Line line, const char *writeFmt, ...);
00033  
00034         void Clear();
00035 
00036 
00037 protected:
00038         DriverStationLCD();
00039 
00040 private:
00041         static void InitTask(DriverStationLCD *ds);
00042         static DriverStationLCD *m_instance;
00043         DISALLOW_COPY_AND_ASSIGN(DriverStationLCD);
00044 
00045         char *m_textBuffer;
00046         SEM_ID m_textBufferSemaphore;
00047 };
00048 
00049 #endif
00050 
 All Classes Functions Variables