My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
AntennaMasterMsg.h
Go to the documentation of this file.
1 #ifndef ANTENNAMASTERMSG_H
2 #define ANTENNAMASTERMSG_H
3 
11 #include <string>
12 
13 #include "gcp/util/common/SignalTask.h"
14 #include "gcp/util/common/GenericMasterTaskMsg.h"
15 
16 #include "gcp/antenna/control/specific/AntennaControlMsg.h"
17 #include "gcp/antenna/control/specific/AntennaDriveMsg.h"
18 #include "gcp/antenna/control/specific/AntennaMonitorMsg.h"
19 #include "gcp/antenna/control/specific/AntennaRxMsg.h"
20 #include "gcp/antenna/control/specific/AntennaRoachMsg.h"
21 #include "gcp/antenna/control/specific/AntennaTask.h"
22 
23 namespace gcp {
24  namespace antenna {
25  namespace control {
26 
33 
34  public:
35 
39  enum MsgType {
40  CONTROL_MSG, // A message for the communications task
41  CONTROL_CONNECTED, // We are dis/connected from/to the control host
42  DRIVE_MSG, // A message for the drive task
43  SCANNER_CONNECTED, // We are dis/connected from/to the archiver
44  MONITOR_MSG, // A message for the monitor task
45  DRIVE_CONNECTED, // The ACU is dis/connected
46  RX_MSG, // A message for the rx task
47  RX_CONNECTED, // A message The rx task is connected/disconnected
48  RX_TIMER, // A message regarding turnign the RX timers on/off
49  ROACH_MSG, // A message for the rx task
50  ROACH_CONNECTED, // A message The rx task is connected/disconnected
51  ROACH_TIMER, // A message regarding turnign the ROACH timers on/off
52  SEND_HEARTBEAT, // Initiate a heartbeat.
53  };
54 
59 
63  union {
64 
69  struct {
70  bool connected;
72 
73 
78  struct {
79  bool connected;
80  } rxConnected;
81 
85  struct {
86  bool on;
87  } rxTimer;
88 
93  struct {
94  bool connected;
96 
100  struct {
101  bool on;
102  } roachTimer;
103 
108  struct {
109  bool connected;
111 
115  struct {
116  bool connected;
117  } driveConnected;
118 
119  //------------------------------------------------------------
120  // Message bodies for threads managed by the AntennaMaster
121  //------------------------------------------------------------
122 
127 
132 
137 
142 
147 
148  } body;
149 
150  //------------------------------------------------------------
151  // Methods for accessing task messages managed by this class.
152  //------------------------------------------------------------
153 
154  inline AntennaControlMsg* getControlMsg()
155  {
156  genericMsgType_ =
157  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
158 
159  type = CONTROL_MSG;
160  return &body.controlMsg;
161  }
162 
163  inline AntennaDriveMsg* getDriveMsg()
164  {
165  genericMsgType_ =
166  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
167 
168  type = DRIVE_MSG;
169  return &body.driveMsg;
170  }
171 
172  inline AntennaMonitorMsg* getMonitorMsg()
173  {
174  genericMsgType_ =
175  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
176 
177  type = MONITOR_MSG;
178  return &body.monitorMsg;
179  }
180 
181  inline AntennaRxMsg* getRxMsg()
182  {
183  genericMsgType_ =
184  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
185 
186  type = RX_MSG;
187  return &body.rxMsg;
188  }
189 
190  inline AntennaRoachMsg* getRoachMsg()
191  {
192  genericMsgType_ =
193  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
194 
195  type = ROACH_MSG;
196  return &body.roachMsg;
197  }
198 
199  //------------------------------------------------------------
200  // Methods for packaging messages intended for this task.
201  //------------------------------------------------------------
202 
206  inline void packSendHeartBeatMsg()
207  {
208  genericMsgType_ =
209  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
210 
211  type = SEND_HEARTBEAT;
212  }
213 
214  inline void packControlConnectedMsg(bool connected)
215  {
216  genericMsgType_ =
217  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
218 
219  type = CONTROL_CONNECTED;
220 
221  body.controlConnected.connected = connected;
222  }
223 
224  inline void packRxConnectedMsg(bool connected)
225  {
226  genericMsgType_ =
227  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
228 
229  type = RX_CONNECTED;
230 
231  body.rxConnected.connected = connected;
232  }
233 
234  inline void packRxTimerMsg(bool timeOn)
235  {
236  genericMsgType_ =
237  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
238 
239  type = RX_TIMER;
240 
241  body.rxTimer.on = timeOn;
242  }
243 
244  inline void packRoachConnectedMsg(bool connected)
245  {
246  genericMsgType_ =
247  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
248 
249  type = ROACH_CONNECTED;
250 
251  body.roachConnected.connected = connected;
252  }
253 
254  inline void packRoachTimerMsg(bool timeOn)
255  {
256  genericMsgType_ =
257  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
258 
259  type = ROACH_TIMER;
260 
261  body.roachTimer.on = timeOn;
262  }
263 
264  inline void packScannerConnectedMsg(bool connected)
265  {
266  genericMsgType_ =
267  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
268 
269  type = SCANNER_CONNECTED;
270 
271  body.scannerConnected.connected = connected;
272  }
273 
274  inline void packDriveConnectedMsg(bool connected)
275  {
276  genericMsgType_ =
277  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
278 
279  type = DRIVE_CONNECTED;
280 
281  body.driveConnected.connected = connected;
282  }
283 
284  }; // End class AntennaMasterMsg
285 
286  }; // End namespace control
287  }; // End namespace antenna
288 } // End namespace gcp
289 
290 #endif // End #ifndef
struct gcp::antenna::control::AntennaMasterMsg::@8::@9 controlConnected
AntennaDriveMsg driveMsg
Definition: AntennaMasterMsg.h:131
void packSendHeartBeatMsg()
Definition: AntennaMasterMsg.h:206
AntennaRxMsg rxMsg
Definition: AntennaMasterMsg.h:141
union gcp::antenna::control::AntennaMasterMsg::@8 body
Definition: GenericMasterTaskMsg.h:36
AntennaMonitorMsg monitorMsg
Definition: AntennaMasterMsg.h:136
Definition: AntennaMasterMsg.h:31
struct gcp::antenna::control::AntennaMasterMsg::@8::@12 roachConnected
Definition: AntennaRoachMsg.h:24
GenericMsgType genericMsgType_
Definition: GenericTaskMsg.h:50
Definition: AntennaMonitorMsg.h:21
Definition: AntennaControlMsg.h:22
struct gcp::antenna::control::AntennaMasterMsg::@8::@10 rxConnected
struct gcp::antenna::control::AntennaMasterMsg::@8::@13 roachTimer
struct gcp::antenna::control::AntennaMasterMsg::@8::@14 scannerConnected
MsgType
Definition: AntennaMasterMsg.h:39
AntennaControlMsg controlMsg
Definition: AntennaMasterMsg.h:126
Definition: AntennaRxMsg.h:26
AntennaRoachMsg roachMsg
Definition: AntennaMasterMsg.h:146
struct gcp::antenna::control::AntennaMasterMsg::@8::@11 rxTimer
struct gcp::antenna::control::AntennaMasterMsg::@8::@15 driveConnected
MsgType type
Definition: AntennaMasterMsg.h:58
Definition: AntennaDriveMsg.h:27