CARMA C++
IFMod.h
Go to the documentation of this file.
1 #ifndef SZA_ANTENNA_CANBUS_IFMOD_H
2 #define SZA_ANTENNA_CANBUS_IFMOD_H
3 
12 
14 #include "carma/szautil/Rx.h"
15 
16 #define CARMA_MODULES
17 
18 namespace sza {
19  namespace antenna {
20 
21  namespace control {
22  class AntennaRx;
23  }
24 
25  namespace canbus {
26 
27  class IFMod : public CanDevice {
28  public:
29 
35  std::string boardName,
38 
42  virtual ~IFMod();
43 
47  std::vector<carma::canbus::Message>
48  selectBand(sza::util::Rx::Id switchPos, bool send=true);
49 
55  std::vector<carma::canbus::Message>
56  setAtten(float atten, bool send=true);
57 
58  std::vector<carma::canbus::Message>
59  setAtten(sza::util::Attenuation atten, bool send=true);
60 
61  std::vector<carma::canbus::Message>
62  setAtten(float input, float output, bool send=true);
63 
69  std::vector<carma::canbus::Message>
70  setLevel(float level, bool send=true);
71 
75  std::vector<carma::canbus::Message>
76  setInputAtten(float inputLevel, bool send=true);
77 
78  std::vector<carma::canbus::Message>
79  setOutputAtten(float outputLevel, bool send=true);
80 
85  void registerRequest(unsigned seq);
86 
87  private:
88 
90 
91  RegMapBlock* ifTotalPowerReg_;
92  RegMapBlock* pamTemperatureReg_;
93  RegMapBlock* totalAttenReg_;
94  RegMapBlock* pamStatusReg_;
95  RegMapBlock* ifSwitchStateReg_;
96  RegMapBlock* laserStatusReg_;
97  RegMapBlock* laserPowerReg_;
98  RegMapBlock* laserRegErrorReg_;
99  RegMapBlock* inputAttenReg_;
100  RegMapBlock* outputAttenReg_;
101  RegMapBlock* laserIdReg_;
102 
103  float ifTotalPower_;
104  float pamTemperature_;
105 
106  float totalAtten_;
107  unsigned char pamStatus_;
108  unsigned char ifSwitchState_;
109  unsigned char laserStatus_;
110 
111  float laserPower_;
112  float laserRegError_;
113 
114  float inputAtten_;
115  float outputAtten_;
116 
117  unsigned char laserId_[8];
118 
119  float lastInputAtten_;
120  float lastOutputAtten_;
121 
125  long lastReq_;
126 
130  long lastAck_;
131 
135  void registerDone();
136 
137  //------------------------------------------------------------
138  // Blanking-frame (half-second) monitor members.
139  //------------------------------------------------------------
140 
141 #ifndef CARMA_MODULES
142 
146  enum halfSecMonitors {
147  MONITOR_PACKET_1 = 0x110,
148  MONITOR_PACKET_2 = 0x111,
149  MONITOR_PACKET_3 = 0x112,
150  MONITOR_PACKET_4 = 0x113,
151  MONITOR_PACKET_5 = 0x114,
152  };
153 #endif
154 
158  std::map<carma::canbus::msgType, std::string>
159  getHalfSecMonitors() const;
160 
161  // Methods to deal with monitor packets for this device.
162 
166  void processBlankingFrameMonitor1(std::vector<carma::canbus::byteType>& data, bool isSim);
167 
171  void processBlankingFrameMonitor2(std::vector<carma::canbus::byteType>& data, bool isSim);
172 
176  void processBlankingFrameMonitor3(std::vector<carma::canbus::byteType>& data, bool isSim);
177 
181  void processBlankingFrameMonitor4(std::vector<carma::canbus::byteType>& data, bool isSim);
182 
183 
187  void processBlankingFrameMonitor5(std::vector<carma::canbus::byteType>& data, bool isSim);
188 
189  //------------------------------------------------------------
190  // Status messages
191  //------------------------------------------------------------
192 
193  enum statusMessages {
194  STATUS_MSG_1 = 0x130, // PAM status
195  STATUS_MSG_2 = 0x131, // switch status
196  };
197 
201  virtual std::map<carma::canbus::msgType, std::string>
202  getStatusMessages() const;
203 
204  // Methods for processing status messages
205 
206  void processStatusMessage1(bool isSim);
207  void processStatusMessage2(bool isSim);
208 
209  //------------------------------------------------------------
210  // Commands for this device.
211  //------------------------------------------------------------
212 
216 #ifdef CARMA_MODULES
217  enum engineeringCommands
218  {
219  ENGCMD_SELECT_BAND = 0x080,
220  ENGCMD_SET_IF_TOTAL_ATTEN = 0x081,
221  ENGCMD_SET_IF_LEVEL = 0x082,
222  ENGCMD_SET_IF_INPUT_ATTEN = 0x083,
223  ENGCMD_SET_IF_OUTPUT_ATTEN = 0x084,
224 
225  ENGCMD_SET_IF_INOUT_ATTEN = 0x103,
226  ENGCMD_QUERY_ATTEN_VS_FREQ = 0x105
227  };
228 #else
229  enum engineeringCommands
230  {
231  ENGCMD_SELECT_BAND = 0x100,
232  ENGCMD_SET_IF_TOTAL_ATTEN = 0x101,
233  ENGCMD_SET_IF_LEVEL = 0x102,
234  ENGCMD_SET_IF_INOUT_ATTEN = 0x103,
235  ENGCMD_QUERY_ATTEN_VS_FREQ = 0x105
236  };
237 #endif
238 
239  }; // End class IFMod
240 
241  } // End namespace canbus
242  } // End namespace antenna
243 } // End namespace sza
244 
245 
246 
247 #endif // End #ifndef SZA_ANTENNA_CANBUS_IFMOD_H
Started: Fri Nov 21 15:46:44 UTC 2003.
AntennaRx class will handle all receiver functions.
Definition: AntennaRx.h:55
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
Tagged: Sun Mar 27 12:36:42 PST 2005.