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