Now you can download a copy of these docs so you can use them offline! Download now
LiveWindow.h
1 #ifndef _LIVE_WINDOW_H
2 #define _LIVE_WINDOW_H
3 
4 #include "LiveWindow/LiveWindowSendable.h"
5 #include "tables/ITable.h"
6 #include "Commands/Scheduler.h"
7 #include <vector>
8 #include <map>
9 
11 {
12  std::string subsystem;
13  std::string name;
14  bool isSensor;
15 
17  {}//WTF?
18  LiveWindowComponent(std::string subsystem, std::string name, bool isSensor)
19  {
20  this->subsystem = subsystem;
21  this->name = name;
22  this->isSensor = isSensor;
23  }
24 };
25 
32 class LiveWindow {
33 public:
34  static LiveWindow * GetInstance();
35  void Run();
36  void AddSensor(const char *subsystem, const char *name, LiveWindowSendable *component);
37  void AddActuator(const char *subsystem, const char *name, LiveWindowSendable *component);
38  void AddSensor(std::string type, int module, int channel, LiveWindowSendable *component);
39  void AddActuator(std::string type, int module, int channel, LiveWindowSendable *component);
40 
41  bool IsEnabled() { return m_enabled; }
42  void SetEnabled(bool enabled);
43 
44 protected:
45  LiveWindow();
46  virtual ~LiveWindow();
47 
48 private:
49  void UpdateValues();
50  void Initialize();
51  void InitializeLiveWindowComponents();
52 
53  std::vector<LiveWindowSendable *> m_sensors;
54  std::map<LiveWindowSendable *, LiveWindowComponent> m_components;
55 
56  static LiveWindow *m_instance;
57  ITable *m_liveWindowTable;
58  ITable *m_statusTable;
59 
60  Scheduler *m_scheduler;
61 
62  bool m_enabled;
63  bool m_firstTime;
64 };
65 
66 #endif
67 
void AddActuator(const char *subsystem, const char *name, LiveWindowSendable *component)
Definition: LiveWindow.cpp:96
void SetEnabled(bool enabled)
Definition: LiveWindow.cpp:38
Definition: ITable.h:26
void Run()
Definition: LiveWindow.cpp:151
void AddSensor(const char *subsystem, const char *name, LiveWindowSendable *component)
Definition: LiveWindow.cpp:82
static LiveWindow * GetInstance()
Definition: LiveWindow.cpp:13

Generated on Sat Apr 26 2014 12:26:45 for WPILibC++ by doxygen 1.8.6