My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
AntennaGpibMsg.h
Go to the documentation of this file.
1 // $Id: AntennaGpibMsg.h,v 1.4 2009/08/25 23:40:42 eml Exp $
2 
3 #ifndef GCP_ANTENNA_CONTROL_ANTENNAGPIBMSG_H
4 #define GCP_ANTENNA_CONTROL_ANTENNAGPIBMSG_H
5 
15 #include "gcp/util/common/GenericTaskMsg.h"
16 
17 namespace gcp {
18  namespace antenna {
19  namespace control {
20 
23 
24  public:
25 
26  enum MsgType {
27  CONNECT,
28  READOUT_THERMO,
29  PROBE_CRYOCON,
30  GPIB_CMD,
31  };
32 
36  MsgType type;
37 
42  union {
43 
44  struct {
45  unsigned device;
46  unsigned cmdId;
47  int intVals[2];
48  float fltVal;
49  } gpib;
50 
51  } body;
52 
53  //------------------------------------------------------------
54  // Pack a command to connect to the GPIB controller
55  //------------------------------------------------------------
56 
57  inline void packConnectMsg()
58  {
60  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
61 
62  type = CONNECT;
63  }
64 
65  //------------------------------------------------------------
66  // Pack a command to readout the thermometry
67  //------------------------------------------------------------
68 
69  inline void packReadoutMsg()
70  {
72  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
73 
74  type = READOUT_THERMO;
75  }
76 
77  //------------------------------------------------------------
78  // Pack a GPIB command received from the contrnol system
79  //------------------------------------------------------------
80 
81  inline void packGpibCmdMsg(unsigned device, unsigned cmdId, int* intVals, float fltVal)
82  {
84  gcp::util::GenericTaskMsg::TASK_SPECIFIC;
85 
86  type = GPIB_CMD;
87 
88  body.gpib.device = device;
89  body.gpib.cmdId = cmdId;
90  body.gpib.intVals[0] = intVals[0];
91  body.gpib.intVals[1] = intVals[1];
92  body.gpib.fltVal = fltVal;
93  }
94 
95  }; // End class AntennaGpibMsg
96 
97  } // End namespace control
98  } // End namespace antenna
99 } // End namespace gcp
100 
101 
102 
103 #endif // End #ifndef GCP_ANTENNA_CONTROL_ANTENNAGPIBMSG_H
Definition: GenericTaskMsg.h:31
Definition: AntennaGpibMsg.h:21
GenericMsgType genericMsgType_
Definition: GenericTaskMsg.h:50
MsgType type
Definition: AntennaGpibMsg.h:36
union gcp::antenna::control::AntennaGpibMsg::@4 body