My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
AdcMonitor.h
1 #ifndef ADCMONITOR_H
2 #define ADCMONITOR_H
3 
11 #include "gcp/util/common/Labjack.h"
12 #include "gcp/util/common/LabjackU3.h"
13 #include "gcp/antenna/control/specific/Board.h"
14 #include "gcp/control/code/unix/libunix_src/common/tcpip.h"
15 #include "gcp/control/code/unix/libunix_src/common/regmap.h"
16 #include "gcp/util/common/GenericTaskMsg.h"
17 
18 namespace gcp {
19  namespace antenna {
20  namespace control {
21 
22  // define a class to hold the message
24  public:
25 
26  enum MsgType {
27  CONNECT,
28  DISCONNECT,
29  GET_VOLTAGE,
30  };
31 
32  // A type for this message
33 
34  MsgType type_;
35  };
36 
37 
38  // Class to read data back from the DlpUsbThermal device
39 
40  class SpecificShare;
41 
42  class AdcMonitor : public Board, public gcp::util::SpawnableTask<AdcMonitorMsg> {
43 
44  public:
45 
49  AdcMonitor();
50  AdcMonitor(SpecificShare* share, std::string name, bool spawn);
51 
55  virtual ~AdcMonitor();
56 
60  void processMsg(AdcMonitorMsg* msg);
61 
62  // Pointer to resources.
63  gcp::util::Labjack* labjack_;
64 
65  // connects:
66  void connect();
67  // disconnects:
68  bool disconnect();
69 
70  // is the response valid?
71  bool isValid_;
72  bool connected_;
73 
74  // values from the previous reading
75  float prevAdcValues_[NUM_LABJACK_VOLTS];
76 
80  void sendVoltRequest();
81 
85  void requestAllVoltages();
86 
93  RegMapBlock* adcVoltPtr_;
94 
95 
96  }; // End class AdcMonitor
97  } // End namespace control
98  } // End namespace antenna
99 } // End namespace gcp
100 #endif // End #ifndef ADCMONITOR_H
Definition: GenericTaskMsg.h:31
void sendVoltRequest()
Definition: AdcMonitor.cc:159
Definition: AdcMonitor.h:23
bool disconnect()
Definition: AdcMonitor.cc:116
Definition: Board.h:24
Definition: AdcMonitor.h:42
Definition: SpawnableTask.h:31
void requestAllVoltages()
Definition: AdcMonitor.cc:79
void connect()
Definition: AdcMonitor.cc:45
AdcMonitor()
Definition: AdcMonitor.cc:16
virtual ~AdcMonitor()
Definition: AdcMonitor.cc:36
RegMapBlock * adcVoltPtr_
Definition: AdcMonitor.h:93
Definition: Labjack.h:27
void processMsg(AdcMonitorMsg *msg)
Definition: AdcMonitor.cc:127