FACT++  1.0
HeadersPower.h
Go to the documentation of this file.
1 #ifndef FACT_HeadersPower
2 #define FACT_HeadersPower
3 
4 #include <iosfwd>
5 #include <stdint.h>
6 
7 class QString;
8 class QDomNamedNodeMap;
9 
10 namespace Power
11 {
12  namespace State
13  {
14  enum states_t
15  {
19  kCameraOn = 4,
20  kBiasOn = 8,
21  kDriveOn = 16,
27  };
28  };
29 
30  struct Status
31  {
34 
35  bool fPwr24VOn;
36  bool fPwrPumpOn;
37  bool fPwrBiasOn;
39 
42 
43  Status() { }
44 
45  bool Set(bool &rc, const QString &value);
46  bool Set(const QDomNamedNodeMap &map);
47 
48  void Print(std::ostream &out, const char *title, const bool &val, const char *t="enabled", const char *f="disabled");
49  void Print(std::ostream &out);
50 
51  uint8_t GetVal() const
52  {
53  return
54  fWaterLevelOk <<0 |
55  fWaterFlowOk <<1 |
56  fPwr24VOn <<2 |
57  fPwrPumpOn <<3 |
58  fPwrDriveOn <<4 |
59  fDriveMainSwitchOn <<5 |
60  fDriveFeedbackOn <<6;
61  }
62 
63  } __attribute__((__packed__));
64 };
65 #endif
uint8_t GetVal() const
Definition: HeadersPower.h:51
enum Power::State::states_t __attribute__
bool fWaterLevelOk
Definition: HeadersPower.h:32
bool fDriveMainSwitchOn
Definition: HeadersPower.h:40
bool fDriveFeedbackOn
Definition: HeadersPower.h:41
bool Set(bool &rc, const QString &value)
void Print(std::ostream &out, const char *title, const bool &val, const char *t="enabled", const char *f="disabled")
TT t
Definition: test_client.c:26