My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
labjackmon.h
1 #ifndef LABJACKMONITOR_H
2 #define LABJACKMONITOR_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 #define NUM_TOTAL_VOLTAGES 12
19 #define NUM_DEVICES_EXPECTED 2
20 #define LNA_LABJACK_SERIAL_NUMBER 320050844
21 #define ADC_LABJACK_SERIAL_NUMBER 320050869
22 
23 namespace gcp {
24  namespace antenna {
25  namespace control {
26 
27  // define a class to hold the message
29  public:
30 
31  enum MsgType {
32  CONNECT,
33  DISCONNECT,
34  GET_VOLTAGE,
35  };
36 
37  // A type for this message
38 
39  MsgType type_;
40  };
41 
42 
43  // Class to read data back from the DlpUsbThermal device
44 
45  class SpecificShare;
46 
47  class LabjackMonitor : public Board, public gcp::util::SpawnableTask<LabjackMonitorMsg> {
48 
49  public:
50 
55  LabjackMonitor(SpecificShare* share, std::string name, bool spawn);
56 
60  virtual ~LabjackMonitor();
61 
65  void processMsg(LabjackMonitorMsg* msg);
66 
67  // Pointer to resources.
68  gcp::util::Labjack* labjack_;
69 
70  // connects:
71  void connect();
72  // disconnects:
73  bool disconnect();
74 
75  bool connected_;
76  int reConnectCounter_;
77  // is the response valid?
78  bool isValid_;
79 
80  // values from the previous reading
81  float prevDrainCurrentVals_[NUM_RECEIVER_AMPLIFIERS];
82  float prevDrainVoltageVals_[NUM_RECEIVER_AMPLIFIERS];
83  float prevGateVoltageVals_[NUM_RECEIVER_AMPLIFIERS];
84 
88  void sendVoltRequest();
89 
93  void requestAllVoltages();
94 
101  RegMapBlock* drainCurrent_;
102  RegMapBlock* drainVoltage_;
103  RegMapBlock* gateVoltage_;
104 
105  }; // End class LabjackMonitor
106  } // End namespace control
107  } // End namespace antenna
108 } // End namespace gcp
109 #endif // End #ifndef LABJACKMONITOR_H
Definition: GenericTaskMsg.h:31
void processMsg(LabjackMonitorMsg *msg)
Definition: Board.h:24
RegMapBlock * drainCurrent_
Definition: labjackmon.h:101
Definition: SpawnableTask.h:31
Definition: labjackmon.h:47
Definition: labjackmon.h:28
Definition: Labjack.h:27