My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
ScannerMsg.h
1 #ifndef GCP_GRABBER_SCANNERMSG_H
2 #define GCP_GRABBER_SCANNERMSG_H
3 
11 #include "gcp/util/common/GenericTaskMsg.h"
12 
13 #include "gcp/control/code/unix/libunix_src/specific/rtcnetcoms.h"
14 
15 namespace gcp {
16  namespace grabber {
17 
18  class ScannerMsg :
20 
21  public:
22 
26  enum MsgType {
27  CONNECT, // A message to connect to the archiver port.
28  GRAB_FRAME, // A message to start a new data frame.
29  CONFIGURE, // A message to configure the frame grabber
30  };
31 
35  MsgType type;
36 
37  union {
38 
39  struct {
40  unsigned mask;
41  unsigned channelMask;
42  unsigned nCombine;
43  unsigned flatfield;
44  unsigned seconds;
45  } configure;
46 
47  } body;
48 
49  //------------------------------------------------------------
50  // Methods for packing messages intended for the
51  // Scanner task
52  //------------------------------------------------------------
53 
57  inline void packGrabFrameMsg() {
58 
60  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
61 
62  type = GRAB_FRAME;
63  }
64 
68  inline void packConnectMsg() {
69 
71  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
72 
73  type = CONNECT;
74  }
75 
79  inline void packConfigureMsg(gcp::control::FgOpt mask,
80  unsigned channelMask,
81  unsigned nCombine,
82  unsigned flatfield,
83  unsigned seconds) {
84 
86  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
87 
88  type = CONFIGURE;
89 
90  body.configure.mask = mask;
91  body.configure.channelMask = channelMask;
92  body.configure.nCombine = nCombine;
93  body.configure.flatfield = flatfield;
94  body.configure.seconds = seconds;
95  }
96 
97  }; // End class ScannerMsg
98 
99 
100  }; // End namespace grabber
101 }; // End namespace gcp
102 
103 
104 #endif // End #ifndef SZA_UTIL_GRABBERMSG_H
Definition: GenericTaskMsg.h:31
void packConnectMsg()
Definition: ScannerMsg.h:68
void packGrabFrameMsg()
Definition: ScannerMsg.h:57
void packConfigureMsg(gcp::control::FgOpt mask, unsigned channelMask, unsigned nCombine, unsigned flatfield, unsigned seconds)
Definition: ScannerMsg.h:79
GenericMsgType genericMsgType_
Definition: GenericTaskMsg.h:50
MsgType
Definition: ScannerMsg.h:26
MsgType type
Definition: ScannerMsg.h:35