CARMA C++
SpectralDownconverter.h
Go to the documentation of this file.
1 
10 #ifndef CARMA_DOWNCONVERTER_SPECTRALDOWNCONVERTER_H
11 #define CARMA_DOWNCONVERTER_SPECTRALDOWNCONVERTER_H
12 
13 // C++ Standard library includes
14 #include <map>
15 #include <string>
16 #include <vector>
17 
18 // Carma includes
19 #include "carma/corba/corba.h"
21 #include "carma/canbus/Types.h"
22 #include "carma/downconverter/spectral/SpectralDownconverterControl.h"
23 #include "carma/monitor/SldcSubsystem.h"
24 
25 namespace log4cpp {
26  class Category;
27 } // namespace log4cpp
28 
29 
30 namespace carma {
31 namespace downconverter {
32 
39  public:
40 
51  carma::monitor::SldcSubsystem & sldcMon );
52 
56  virtual ~SpectralDownconverter();
57 
65  std::map<carma::canbus::msgType, std::string>
66  getHalfSecMonitors() const;
67 
75  std::map<carma::canbus::msgType, std::string> getSlowMonitors() const;
76 
85  std::vector<carma::canbus::byteType> &data, bool sim);
86 
103 
111 
119  unsigned short input,
120  unsigned short band);
121 
128  void updateFrameData();
129 
130  // Control commands
131 
136  void setPsysPreset() const;
137 
147  void setPsys(::CORBA::Float psys) const;
148 
155  void setPsysAtten(::CORBA::Float atten) const;
156 
168  void setIfOutPreset() const;
169 
181  void setIfOut(::CORBA::Float ifout) const;
182 
191  void setIfOutAtten(::CORBA::Float atten) const;
192 
197  void enableRfInputAmp(::CORBA::Boolean enable) const;
198 
204  void enableIfOutAlc(::CORBA::Boolean enable) const;
205 
216  void selectOutputFilter(
217  enum SpectralDownconverterControl::FilterType filter ) const;
218 
227  void selectSideband(
228  enum SpectralDownconverterControl::SidebandType sideband ) const;
229 
238  void setLOFrequency( ::CORBA::Double lofreq ) const;
239 
245  void setIModulatorVoltage( ::CORBA::Short I ) const;
246 
252  void setQModulatorVoltage( ::CORBA::Short Q ) const;
253 
258  ::CORBA::Boolean isOnline();
259 
268  ::CORBA::Boolean checkIfOutputPower(
269  ::CORBA::Float power,
270  ::CORBA::Float delta);
271 
279  void disableCommandLogging();
280 
285  void enableCommandLogging();
286 
291  static std::string filterAsString(
293 
294  private:
295 
296  // Copy and assignment not permitted for this class.
298  SpectralDownconverter &operator=(const SpectralDownconverter &);
299 
300  // Methods to process individual CAN messages. These routines
301  // are called by processMsg upon receipt of any message addressed
302  // to this device.
303  void processBlankingFramePacket1(
304  std::vector<carma::canbus::byteType> &data);
305  void processBlankingFramePacket2(
306  std::vector<carma::canbus::byteType> &data);
307  void processBlankingFramePacket3(
308  std::vector<carma::canbus::byteType> &data);
309  void processBlankingFramePacket4(
310  std::vector<carma::canbus::byteType> &data);
311  void processBlankingFramePacket5(
312  std::vector<carma::canbus::byteType> &data);
313  void processBlankingFramePacket6(
314  std::vector<carma::canbus::byteType> &data);
315 
316  // Methods to produce simulated CAN messages. These routines are
317  // called by simulateMsg and then placed in the CAN message queue
318  // where they will eventually be processed by processMsg above.
319  carma::canbus::Message simBlankingFramePacket1();
320  carma::canbus::Message simBlankingFramePacket2();
321  carma::canbus::Message simBlankingFramePacket3();
322  carma::canbus::Message simBlankingFramePacket4();
323  carma::canbus::Message simBlankingFramePacket5();
324  carma::canbus::Message simBlankingFramePacket6();
325 
326  void setState( carma::canbus::deviceStateType state );
327 
328  // Helper routines
329  ::std::string printInputAndBand() const;
330 
331  const unsigned short inputNo_; // Input/antenna id/slot # (1..8)
332  const unsigned short bandNo_; // Band # (1..16)
333  log4cpp::Category &log_; // Reference to the logger.
334  carma::monitor::SldcSubsystem::Input * mon_; // Monitor system.
335  double ifOutputPower_;
336 
337  unsigned int lastLogWarnFrame_;
338  unsigned int offlinesSinceLastLog_;
339  bool commandLoggingEnabled_;
340  };
341 } // End namespace downconverter
342 } // End namespace carma
343 #endif
void setIModulatorVoltage(::CORBA::Short I) const
Manually set the differential voltage on the I channel of the 90 degree I/Q modulator to a particular...
void setPsysPreset() const
Set Psys power level to the preset value stored in the compensation EEPROM.
static carma::canbus::nodeType calculateNodeId(unsigned short input, unsigned short band)
Calculate node id based on the input and band id.
carma::canbus::Message simulateMsg(carma::canbus::msgType mid)
Produce a simulated CAN message for a given msgType.
Declarations of carma::canbus types.
Class to encapsulate a CAN message.
Definition: Message.h:21
FilterType
Valid output bandwidth filter types.
void disableCommandLogging()
Disable command logging.
static carma::canbus::apiType getApiId()
Staticly retrieve the API Id.
void selectSideband(enum SpectralDownconverterControl::SidebandType sideband) const
Select which sideband the single sideband downconverter is to use.
::CORBA::Boolean isOnline()
Is this module online?
void setIfOutPreset() const
Set the IF Output Power level to the preset value stored in the compensation EEPROM.
void updateFrameData()
Update data on a frame time scale This routine is called automatically by carma::canbus::Master every...
void selectOutputFilter(enum SpectralDownconverterControl::FilterType filter) const
Select which of the available output bandwidth defining filters to use.
XacDevice canbus::device class implementation.
Definition: XacDevice.h:37
void enableCommandLogging()
Enable command logging.
void enableIfOutAlc(::CORBA::Boolean enable) const
Enable or disable the IF Output ALC (Automatic Level Control) loop (normally on). ...
unsigned short apiType
Carma API id type.
Definition: Types.h:64
static std::string filterAsString(const carma::downconverter::DownconverterControl::FilterType filter)
Return a string representation of the input filter.
void setQModulatorVoltage(::CORBA::Short Q) const
Manually set the differential voltage on the Q channel of the 90 degree I/Q modulator to a particular...
void setPsysAtten(::CORBA::Float atten) const
Set Psys attenuation level to the requested level.
void processMsg(carma::canbus::msgType mid, std::vector< carma::canbus::byteType > &data, bool sim)
Process a CAN message.
unsigned short nodeType
Carma Node Type id type.
Definition: Types.h:66
std::map< carma::canbus::msgType, std::string > getSlowMonitors() const
Retrieve a map of this devices slow monitor points.
void setIfOut(::CORBA::Float ifout) const
Set the IF Output power level to the requested level.
SpectralDownconverter CAN Device class implementation.
void setPsys(::CORBA::Float psys) const
Set Psys to requested power level.
void setLOFrequency(::CORBA::Double lofreq) const
Sends the 2nd LO frequency to this module which in turn uses it to determine required I and Q modulat...
carma::canbus::devices::XacDevice class declaration.
void enableRfInputAmp(::CORBA::Boolean enable) const
Switch the RF Input Amplifier on or off.
std::map< carma::canbus::msgType, std::string > getHalfSecMonitors() const
Retrieve a map of this devices half second monitor points.
unsigned short msgType
Carma Message id type.
Definition: Types.h:69
CanOutput interface.
Definition: CanOutput.h:26
void setIfOutAtten(::CORBA::Float atten) const
Set the downconverter IF Output Attenuation to the requested value.
SpectralDownconverter(carma::canbus::nodeType node, carma::canbus::CanOutput &co, carma::monitor::SldcSubsystem &sldcMon)
Constructor.
::CORBA::Boolean checkIfOutputPower(::CORBA::Float power,::CORBA::Float delta)
Check that IF Output power is within a specified range.