CARMA C++
AntennaDriveMsg.h
Go to the documentation of this file.
1 #ifndef ANTENNADRIVEMSG_H
2 #define ANTENNADRIVEMSG_H
3 
11 #include <string>
12 
15 
17 
18 #include "carma/szaarrayutils/szaregs.h"
19 
20 namespace sza {
21  namespace antenna {
22  namespace control {
23 
29 
30  public:
31 
35  enum MsgType {
36  FLAG_BOARD, // A message to flag a board.
37  PMAC_CONNECTED, // A message from the Tracker task that
38  // the pmac is dis/connected.
39  TRACKER_MSG // A message for the tracker thread.
40  };
41 
46 
50  union {
51 
55  struct {
56  unsigned short board; // The register map index of the
57  // board to un/flag
58  bool flag; // True to flag, false to unflag
59  } flagBoard;
60 
64  struct {
65  bool connected;
66  } pmacConnected;
67 
71  TrackerMsg trackerMsg;
72 
73  } body;
74 
75  //------------------------------------------------------------
76  // Methods for accessing messages for tasks managed by this
77  // class.
78  //------------------------------------------------------------
79 
80  inline TrackerMsg* getTrackerMsg()
81  {
83  sza::util::GenericTaskMsg::TASK_SPECIFIC;
84 
85  type = TRACKER_MSG;
86 
87  return &body.trackerMsg;
88  }
89 
90  //------------------------------------------------------------
91  // Methods for packing messsages to the drive task.
92  //------------------------------------------------------------
93 
94  inline void packFlagBoardMsg(unsigned short board, bool flag) {
96  sza::util::GenericTaskMsg::TASK_SPECIFIC;
97 
98  type = FLAG_BOARD;
99  body.flagBoard.board = board;
100  body.flagBoard.flag = flag;
101  }
102 
103  inline void packPmacConnectedMsg(bool connected)
104  {
105  genericMsgType_ =
106  sza::util::GenericTaskMsg::TASK_SPECIFIC;
107 
108  type = PMAC_CONNECTED;
109 
110  body.pmacConnected.connected = connected;
111  }
112 
113  }; // End AntennaDriveMsg class
114 
115  }; // End namespace control
116  }; // End namespace antenna
117 }; // End namespace sza
118 
119 #endif // End #ifndef
struct sza::antenna::control::AntennaDriveMsg::@7::@8 flagBoard
Flag a board.
A container for messages sent to the Drive Task.
struct sza::antenna::control::AntennaDriveMsg::@7::@9 pmacConnected
A message that the pmac is dis/connected.
MsgType type
The type of this message.
union sza::antenna::control::AntennaDriveMsg::@7 body
A union of supported messages.
TrackerMsg trackerMsg
A message for the Tracker thread.
Tagged: Fri Nov 14 12:39:34 UTC 2003.
MsgType
Enumerate supported messages for this task.
Tagged: Thu Nov 13 16:53:56 UTC 2003.
GenericMsgType genericMsgType_
A type for this message.
A class to encapsulate message types for a generic task.
Tagged: Fri Nov 14 12:39:33 UTC 2003.