CARMA C++
BiasTunedGunn.h
Go to the documentation of this file.
1 #ifndef BIASTUNEDGUNN_H
2 #define BIASTUNEDGUNN_H
3 
5 #include "carma/antenna/sza/antenna/canbus/Oscillator.h"
6 
7 #define ZABER_MAX_DEV 255
8 
16 #include <string>
17 
18 namespace sza {
19  namespace antenna {
20  namespace canbus {
21 
22  class BiasTunedGunn : public Oscillator {
23  public:
24 
25  enum {
26  GUNN = 0x1,
27  SWEEP = 0x2,
28  IFMON = 0x4,
29 
30  TUNER = 0x8,
31  BACKSHORT = 0x10,
32  ATTEN = 0x20,
33 
34  ALL = TUNER | BACKSHORT | ATTEN
35  };
36 
40  BiasTunedGunn(sza::antenna::control::SzaShare* share,
41  std::string name,
44 
45  //------------------------------------------------------------
46  // Blanking-frame monitor members.
47  //------------------------------------------------------------
48 
52  std::map<carma::canbus::msgType, std::string>
53  getHalfSecMonitors() const;
54 
58  void processBlankingFrameMonitor1(std::vector<carma::canbus::byteType>& data, bool isSim);
59 
63  void processBlankingFrameMonitor2(std::vector<carma::canbus::byteType>& data, bool isSim);
64 
68  void processBlankingFrameMonitor3(std::vector<carma::canbus::byteType>& data, bool isSim);
69 
73  void processBlankingFrameMonitor4(std::vector<carma::canbus::byteType>& data, bool isSim);
74 
78  void processBlankingFrameMonitor5(std::vector<carma::canbus::byteType>& data, bool isSim);
79 
83  void processBlankingFrameMonitor6(std::vector<carma::canbus::byteType>& data, bool isSim);
84 
88  void processBlankingFrameMonitor7(std::vector<carma::canbus::byteType>& data, bool isSim);
89 
93  void processBlankingFrameMonitor8(std::vector<carma::canbus::byteType>& data, bool isSim);
94 
98  void processBlankingFrameMonitor9(std::vector<carma::canbus::byteType>& data, bool isSim);
99 
100  //------------------------------------------------------------
101  // Commands for this device.
102  //------------------------------------------------------------
103 
107  enum hostCommands
108  {
109  HOSTCMD_SET_LO_FREQ = 0x040, // Set the LO frequency
110  HOSTCMD_SET_GUNN_VOLTAGE = 0x080, // Set the Gunn operating voltage
111  HOSTCMD_SET_LOOP_GAIN = 0x081, // Set the loop gain for the phase-lock loop.
112 
113  HOSTCMD_SET_GUNN_STATE = 0x082, // Turn Gunn on or off
114  HOSTCMD_SET_SWEEP_STATE = 0x083, // Turn sweep on or off
115  HOSTCMD_SET_IFMON_STATE = 0x084, // Turn phase-lock IF monitor output on or off
116 
117  HOSTCMD_SET_TUNER_POS = 0x085, // Set the tuner position
118  HOSTCMD_SET_BACKSHORT_POS= 0x086, // Move the Gunn backshort to a given position
119  HOSTCMD_SET_ATTEN_POS = 0x087, // Move the LO attenuator to a given position
120 
121  HOSTCMD_JOG_TUNER = 0x088, // Move the tuner by a given number of micro-steps
122  HOSTCMD_JOG_BACKSHORT = 0x089, // Move the backshort by a given number of micro-steps
123  HOSTCMD_JOG_ATTEN = 0x08A, // Move the attenuator by a given number of micro-steps
124 
125  HOSTCMD_TOGGLE_AUTO_RELOCK=0x08B, // Turns auto-relock on or off
126  HOSTCMD_HOME_ACTUATORS = 0x08C, // Set the specified actuators to home position
127  };
128 
132  std::vector<carma::canbus::Message>
133  setLoFrequency(unsigned short frequency, bool send=true);
134 
138  std::vector<carma::canbus::Message>
139  setVoltage(unsigned short voltage, bool send=true);
140 
144  std::vector<carma::canbus::Message>
145  setLoopGainResistance(unsigned short gain, bool send=true);
146 
150  std::vector<carma::canbus::Message>
151  setDeviceState(unsigned device, bool state, bool send=true);
152 
156  std::vector<carma::canbus::Message>
157  setDevicePosition(unsigned device, unsigned int position, bool send=true);
158 
162  std::vector<carma::canbus::Message>
163  jogDevicePosition(unsigned device, int step, bool send=true);
164 
168  std::vector<carma::canbus::Message>
169  enableAutoRelock(bool enable, bool send=true);
170 
174  std::vector<carma::canbus::Message>
175  homeDevice(unsigned int mask, bool send=true);
176 
180  enum engineeringCommands
181  {
182  ENGCMD_SET_GUNN_FREQ = 0x300,
183  ENGCMD_DL_GUNN_ID = 0x301,
184  ENGCMD_DL_TUNING_TABLE = 0x302,
185  ENGCMD_DL_TO_OWIRE = 0x303,
186  // Note: there is presently no command 0x304 in the API
187  ENGCMD_CONTROL_ZABER = 0x305,
188  ENGCMD_ZABER_REQUEST = 0x306,
189  };
190 
194  std::vector<carma::canbus::Message>
195  setFrequency(unsigned short frequency, bool send=true);
196 
200  std::vector<carma::canbus::Message>
201  downloadId(unsigned short gunnId, unsigned char calMonth, unsigned char calDay,
202  unsigned char calYear,
203  unsigned short calVoltage, unsigned char nRow, bool send=true);
204 
208  std::vector<carma::canbus::Message>
209  downloadTuningTableEntry(unsigned int freq,
210  unsigned int tunerPos,
211  unsigned int backshortPos,
212  unsigned int attenPos,
213  bool send=true);
217  std::vector<carma::canbus::Message>
218  downloadTuningTableToOneWire(bool send=true);
219 
223  std::vector<carma::canbus::Message>
224  controlZaber(unsigned short deviceNo,
225  unsigned char zaberCmdCode,
226  std::vector<unsigned char>& zaberData,
227  bool send);
228 
232  std::vector<carma::canbus::Message>
233  requestZaberPackets(bool request, bool send=true);
234 
238  virtual std::map<carma::canbus::msgType, std::string>
239  getSpecificControls() const;
240 
245  std::string controlPrefix();
246 
247  // Check the current lock status, and determine whether or not
248  // it is an error, given the current receiver id
249 
250  void checkHwLockStatus();
251 
252  void setRxId(sza::util::Rx::Id rxId);
253 
254  // Store the current hardware lock status
255 
256  unsigned char hwLockStatus_;
257 
258  }; // End class BiasTunedGunn
259 
260  }; // End namespace canbus
261  }; // End namespace antenna
262 }; // End namespace sza
263 
264 #endif // End #ifndef
265 
266 
Started: Fri Nov 21 15:46:44 UTC 2003.
unsigned short nodeType
Carma Node Type id type.
Definition: Types.h:66
CanOutput interface.
Definition: CanOutput.h:26
An instance of this class is created by AntennaMaster and passed to the constructors of other tasks...
Definition: Share.h:38