LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
RobotState.h
1 #ifndef ROBOT_STATE_H_
2 #define ROBOT_STATE_H_
3 
4 #include <RobotBase.h>
5 #include <Timer.h>
6 #include <DriverStation.h>
7 
8 #include "Rhesus/Toolkit/GameState.h"
9 
10 using namespace Rhesus::Toolkit;
11 
12 class RobotState
13 {
14 public:
15  static void Initialize();
16  static RobotState& Instance();
17  static void Finalize();
18 
19  GameState::Enum GameMode();
20  GameState::Enum LastGameMode();
21  DriverStation::Alliance Alliance();
22  bool FMSAttached();
23  double MatchTime(); // Seconds
24  double TotalTime(); // Seconds
25  double LastCycleTime(); // Seconds
26 
27  void Update();
28 
29 private:
30  RobotState();
31  ~RobotState();
32 
33  static RobotState* m_instance;
34 
35  GameState::Enum m_gameMode;
36  GameState::Enum m_lastGameMode;
37  DriverStation::Alliance m_alliance;
38  Timer m_matchTimer;
39  Timer m_totalTimer;
40  double m_lastTime;
41  double m_currentTime;
42  bool m_fms;
43 
44  DISALLOW_COPY_AND_ASSIGN(RobotState);
45 };
46 
47 #endif