LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
LCD.h
1 #ifndef LCD_H_
2 #define LCD_H_
3 
4 #include <WPILib.h>
5 #include "../Process/SynchronizedProcess.h"
6 #include "../RobotState.h"
7 
12 class LCD : public SynchronizedProcess
13 {
14 public:
15  static const UINT32 kSyncTimeout_ms = 20;
16  static const UINT16 kFullDisplayTextCommand = 0x9FFF;
17 
18  enum LCDLines
19  {
20  kHeartbeatLine = 0,
21  kDriveLine = 1,
22  kDriveTrainLine = 2,
23  kShooterLine = 3,
24  kCollectorLine = 4,
25  kClimberLine = 5,
26  kWinchLine = 6,
27  kENDLINES = 7
28  };
29 
30  ~LCD();
31  static LCD* Instance();
32  static void Finalize();
33 
34  void LCDUpdate();
35  void Print(UINT8 line, UINT8 index, bool clear, const char* format, ...);
36 
37  void ScrollLCD(int x, int y);
38 
39 protected:
40  void Tick();
41 
42 private:
43  LCD();
44  static LCD* instance;
45  DISALLOW_COPY_AND_ASSIGN(LCD);
46 
47  int curLineIndex;
48  int curColumnIndex;
49 
50  static const UINT8 kNumBufferLines = 20;
51  static const UINT8 kNumBufferColumns = 40;
52 
53  static const UINT8 kNumLcdPhysicalLines = 6;
54  // even on the new DriverStation, still 21 char
55  static const UINT8 kNumLcdPhysicalColumns = 21;
56 
57  const char* loadArray;
58  char* textBuffer;
59  char* outputBuffer;
60  semaphore* textBufferSemaphore;
61 
62  RobotState &m_robotState;
63 };
64 
65 #endif //LRT_DRIVER_STATION_LCD_H_