My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
NewNetMsg.h
Go to the documentation of this file.
1 // $Id: NewNetMsg.h,v 1.1.1.1 2009/07/06 23:57:26 eml Exp $
2 
3 #ifndef GCP_UTIL_NEWNETMSG_H
4 #define GCP_UTIL_NEWNETMSG_H
5 
15 #include <map>
16 
17 #include "gcp/util/common/NetStruct.h"
18 #include "gcp/util/common/NetUnion.h"
19 
20 namespace gcp {
21  namespace util {
22 
23  // Define an allocator for an experiment-specific network message.
24  // This must be defined by inheritors
25 
26  class NewNetMsg;
27  NewNetMsg* newSpecificNewNetMsg();
28 
29  // Send a greeting message
30 
32  public:
33  unsigned int revision;
34  unsigned int nReg;
35  unsigned int nByte;
36 
38  NETSTRUCT_UINT(revision);
39  NETSTRUCT_UINT(nReg);
40  NETSTRUCT_UINT(nByte);
41  }
42  };
43 
44  // The following object is used to forward log messages from the
45  // real-time control system to the control program. Note that
46  // cnt_send_log_message() in controller.c relies on the text[]
47  // member of NetLogMsg being the last member (in order not to have
48  // to copy all NET_LOG_MAX+1 bytes of text[] if the string in
49  // text[] is shorter).
50 
51  #define NET_LOG_MAX 127
52 
54  public:
55  short bad; // True if the text describes an error
56  // condition
57  unsigned seq;
58  bool end;
59  char text[NET_LOG_MAX+1]; // The text of the log message
60 
61  NewNetLogMsg() {
62  NETSTRUCT_SHORT(bad); // True if the text describes an
63  // error condition
64  NETSTRUCT_UINT(seq);
65  NETSTRUCT_BOOL(end);
66  NETSTRUCT_CHAR_ARR(text, NET_LOG_MAX+1); // The text of the log message
67  }
68  };
69 
70  // The following object is used by the receiver-control task to
71  // report the completion of a setreg transactions.
72 
74  public:
75  unsigned int seq; // The sequence number of the
76  // transaction that completed
77 
79  NETSTRUCT_UINT(seq); // The sequence number of the transaction
80  // that completed
81  }
82  };
83 
84  // The following object is used by the scanner task to report the
85  // completion of a tv_offset transaction.
86 
88  public:
89  unsigned int seq; // The sequence number of the
90  // transaction that completed
91 
93  NETSTRUCT_UINT(seq); // The sequence number of the transaction
94  // that completed
95  }
96  };
97 
98 
99  // The following object is used by the tracker task to report
100  // target acquisition.
101 
103  public:
104  unsigned int seq; // The sequence number of the
105  // transaction that completed
106 
108  NETSTRUCT_UINT(seq); // The sequence number of the transaction
109  // that completed
110  }
111  };
112 
113  // The following object is used by the tracker task to report
114  // target acquisition.
115 
117  public:
118  unsigned int seq; // The sequence number of the
119  // transaction that completed
120 
122  NETSTRUCT_UINT(seq); // The sequence number of the transaction
123  // that completed
124  }
125  };
126 
127  // The following object is used by the tracker task to report
128  // target acquisition.
129 
131  public:
132  unsigned int seq; // The sequence number of the
133  // transaction that completed
134 
136  NETSTRUCT_UINT(seq); // The sequence number of the transaction
137  // that completed
138  }
139  };
140 
141  // The following object is used by the tracker task to report
142  // target acquisition.
143 
145  public:
146  unsigned int seq; // The sequence number of the
147  // transaction that completed
148 
150  NETSTRUCT_UINT(seq); // The sequence number of the transaction
151  // that completed
152  }
153  };
154 
155 
156  // The following object is used by the tracker task to report if
157  // the telescope can't reach the current source due to it being
158  // too low in the sky.
159 
160  class NewNetSourceSetMsg : public NetStruct {
161  public:
162  unsigned int seq; // The sequence number of the
163  // transaction that resulted in the
164  // telescope needing to point too
165  // low.
166 
168  NETSTRUCT_UINT(seq); // The sequence number of the
169  // transaction that resulted in the
170  // telescope needing to point too low.
171  }
172  };
173 
174  // The following object is used by the tracker task to report if
175  // the telescope can't reach the current source due to it being
176  // too low in the sky.
177 
179  public:
180  unsigned int seq; // The sequence number of the
181  // transaction that resulted in the
182  // telescope needing to point too
183  // low.
184 
186  NETSTRUCT_UINT(seq); // The sequence number of the
187  // transaction that resulted in the
188  // telescope needing to point too low.
189  }
190  };
191 
196  class NewNetMsg : public NetUnion {
197  public:
198 
199  // Enumerate structs that are part of this message
200 
201  enum {
202  NET_UNKNOWN_MSG, // No message has been specified
203  NET_FRAME_DONE_MSG, // A frame completion message
204  NET_GREETING_MSG, // A handshake message
205  NET_ID_MSG, // A message from an antenna to
206  // identify itself
207  NET_LOG_MSG, // A message to be logged
208  NET_DRIVE_DONE_MSG, // A pmac transaction-completion message
209  NET_BENCH_DONE_MSG, // A BENCH transaction-completion message
210  NET_SCAN_DONE_MSG, // A scan-completion message
211  NET_SOURCE_SET_MSG, // A warning message that the source has set
212  NET_SETREG_DONE_MSG, // A setreg transaction completion message
213  NET_TV_OFFSET_DONE_MSG, // A tv_offset transaction completion message
214  NET_NAV_UPDATE_MSG, // A request from the controller for
215  // a re-initialization of ephemeris
216  // positions from the navigator
217  // thread
218 
219  NET_SCRIPT_DONE_MSG,
220  NET_LAST_MSG, // This should always come last
221  };
222 
223  // This class will contain a representative of each type of
224  // message
225 
226  NewNetFrameDoneMsg frame_done; // A greeting message
227  NewNetGreetingMsg greeting; // A greeting message
228  NewNetLogMsg log; // A message to be logged
229  NewNetDriveDoneMsg drive_done; // A tracker
230  // transaction-completion message
231  NewNetBenchDoneMsg bench_done; // A bench
232  // transaction-completion message
233  NewNetScanDoneMsg scan_done; // A tracker
234  // transaction-completion message
235  NewNetSetregDoneMsg setreg_done; // A setreg transaction
236  // completion message
237  // NetSourceSetMsg source_set;
238  NewNetSourceSetMsg source_set; // A source-has-set advisory
239  // message
240  NewNetTvOffsetDoneMsg tv_offset_done;// A tv_offset transaction
241 
242  NewNetScriptDoneMsg scriptDone;
243 
244  // Constructor/Destructors
245 
246  NewNetMsg();
247  virtual ~NewNetMsg();
248 
249  }; // End class NewNetMsg
250 
251  } // End namespace util
252 } // End namespace gcp
253 
254 
255 #endif // End #ifndef GCP_UTIL_NEWNETMSG_H
Definition: NewNetMsg.h:102
Definition: NewNetMsg.h:160
Definition: NetStruct.h:21
Definition: NewNetMsg.h:116
Definition: NewNetMsg.h:178
Definition: NewNetMsg.h:196
Definition: NewNetMsg.h:31
Definition: NewNetMsg.h:87
Definition: NewNetMsg.h:130
virtual ~NewNetMsg()
Definition: NewNetMsg.cc:51
Definition: NewNetMsg.h:73
Definition: NewNetMsg.h:53
Definition: NewNetMsg.h:144
NewNetMsg()
Definition: NewNetMsg.cc:10
Definition: NetUnion.h:23