CARMA C++
VaractorTunedGunn.h
Go to the documentation of this file.
1 #ifndef VARACTORTUNEDGUNN_H
2 #define VARACTORTUNEDGUNN_H
3 
4 #include "carma/antenna/sza/antenna/canbus/Oscillator.h"
5 
13 namespace sza {
14  namespace antenna {
15  namespace canbus {
16 
17  class VaractorTunedGunn : public Oscillator {
18  public:
19 
23  enum {
24  LOCKED = 0x1,
25  RF_GOOD = 0x2,
26  SWEEP_ON = 0x4,
27  GUNN_ON = 0x8,
28  };
29 
33  VaractorTunedGunn(sza::antenna::control::SzaShare* share,
34  std::string boardName,
37 
41  std::vector<carma::canbus::Message>
42  turnGunnOn(bool on, bool send=true);
43 
47  std::vector<carma::canbus::Message>
48  turnSweepOn(bool on, bool send=true);
49 
53  std::vector<carma::canbus::Message>
54  turnMonitorOn(bool on, bool send=true);
55 
59  std::vector<carma::canbus::Message>
60  setLoopGainResistance(unsigned short voltage, bool send=true);
61 
62  /*
63  * Convert from an integral lock state to an orthogonal bit so
64  * that states can be unioned
65  */
66  unsigned char statusToBit(unsigned char lockState);
67  unsigned char statusToBit(unsigned char lockStatus, unsigned char refStatus, unsigned char sweepStatus, unsigned char gunnStatus);
68  unsigned char validityToBit(unsigned char ifmonStatus, unsigned char dataValid);
69 
70  enum halfSecMonitors {
71  VAR_MONITOR_PACKET_1 = 0x110,
72  VAR_MONITOR_PACKET_2 = 0x111,
73  VAR_MONITOR_PACKET_3 = 0x112,
74  VAR_MONITOR_PACKET_4 = 0x113,
75  };
76 
80  std::map<carma::canbus::msgType, std::string>
81  getHalfSecMonitors() const;
82 
86  void processBlankingFrameMonitor1(std::vector<carma::canbus::byteType>& data, bool isSim);
87 
91  void processBlankingFrameMonitor2(std::vector<carma::canbus::byteType>& data, bool isSim);
92 
96  void processBlankingFrameMonitor3(std::vector<carma::canbus::byteType>& data, bool isSim);
97 
101  void processBlankingFrameMonitor4(std::vector<carma::canbus::byteType>& data, bool isSim);
102 
103 
107  void processBlankingFrameMonitor5(std::vector<carma::canbus::byteType>& data, bool isSim);
108 
109  //------------------------------------------------------------
110  // Commands for this device.
111  //------------------------------------------------------------
112 
116  enum hostCommands
117  {
118  HOSTCMD_GUNN = 0x080,
119  HOSTCMD_SWEEP = 0x081,
120  HOSTCMD_MONITOR = 0x082,
121  HOSTCMD_LOOP_GAIN_RESISTANCE = 0x083,
122  };
123 
130  enum engineeringCommands
131  {
132  ENGCMD_GUNN = 0x300,
133  ENGCMD_SWEEP = 0x301,
134  ENGCMD_MONITOR = 0x302,
135  ENGCMD_LOOP_GAIN_RESISTANCE = 0x303,
136  };
137 
141  virtual std::map<carma::canbus::msgType, std::string>
142  getSpecificControls() const;
143 
148  std::string controlPrefix();
149 
150  // Check the current lock status, and determine whether or not
151  // it is an error, given the current receiver id
152 
153  void checkHwLockStatus();
154 
155  void setRxId(sza::util::Rx::Id rxId);
156 
157  // Store the current hardware lock status
158 
159  unsigned char hwLockStatus_;
160 
161  }; // End class VaractorTunedGunn
162 
163  }; // End namespace canbus
164  }; // End namespace antenna
165 }; // End namespace sza
166 
167 #endif // End #ifndef
168 
169 
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