CARMA C++
Downconverter.h
Go to the documentation of this file.
1 
11 #ifndef CARMA_DOWNCONVERTER_DOWNCONVERTER_H
12 #define CARMA_DOWNCONVERTER_DOWNCONVERTER_H
13 
15 #include "carma/monitor/WbdcSubsystem.h"
16 
17 #include <map>
18 #include <string>
19 #include <tao/Basic_Types.h>
20 #include <vector>
21 
22 namespace carma {
23 
27 namespace downconverter {
28 
29 
36  public:
37 
47  carma::monitor::WbdcSubsystem & wbdcSubsys );
48 
52  virtual ~Downconverter();
53 
61  std::map<carma::canbus::msgType, std::string>
62  getHalfSecMonitors() const;
63 
71  std::map<carma::canbus::msgType, std::string> getSlowMonitors() const;
72 
82  bool sim );
83 
98 
107  static carma::canbus::nodeType calculateNodeId(short input, short band);
108 
116 
122  void updateFrameData();
123 
127  void disableCommandLogging( );
128 
132  void enableCommandLogging( );
133 
134  // CORBA control methods implemented from idl defined interface
135  void setPsysPreset();
136  void setPsys(::CORBA::Float psys);
137  void setPsysAtten(::CORBA::Float atten);
138  void setIfOutPreset();
139  void setIfOut(::CORBA::Float ifout);
140  void setIfOutAtten(::CORBA::Float atten);
141  void enableRfInputAmp(::CORBA::Boolean enable);
142  void enableIfOutAlc(::CORBA::Boolean enable);
143 
144  // For Engineering use only
145  ::CORBA::Boolean
146  checkIfOutputPower(::CORBA::Float power, ::CORBA::Float delta);
147 
148  private:
149 
150  // Copy and assignment not permitted for this class.
151  Downconverter(const Downconverter &);
152  Downconverter &operator=(const Downconverter &);
153 
154 
155  // Methods to process individual CAN messages. These routines
156  // are called by processMsg upon receipt of any message addressed
157  // to this device.
158  void processBlankingFramePacket1( carma::canbus::DataVector & data );
159  void processBlankingFramePacket2( carma::canbus::DataVector & data );
160  void processBlankingFramePacket3( carma::canbus::DataVector & data );
161  void processBlankingFramePacket4( carma::canbus::DataVector & data );
162  void processBlankingFramePacket5( carma::canbus::DataVector & data );
163  void processSystemMonitorPacket4( carma::canbus::DataVector & data );
164 
165 
166  // Methods to produce simulated CAN messages. These routines are
167  // called by simulateMsg and then placed in the CAN message queue
168  // where they will eventually be processed by processMsg above.
169  carma::canbus::Message simBlankingFramePacket1();
170  carma::canbus::Message simBlankingFramePacket2();
171  carma::canbus::Message simBlankingFramePacket3();
172  carma::canbus::Message simBlankingFramePacket4();
173  carma::canbus::Message simBlankingFramePacket5();
174  carma::canbus::Message simSystemMonitorPacket4();
175 
176  const unsigned int inputNo_; // Input/antenna id/slot # (1..8)
177  const unsigned int bandNo_; // Band # (1..16)
178  const std::string stringId_;
179  carma::monitor::WbdcSubsystem::Input * mon_; // Ref to monitor system
180 
181  // State variables for use with engineering commands only.
182  double ifOutputPower_;
183 
184  bool commandLoggingEnabled_;
185 
186  };
187 } // Namespace downconverter
188 } // Namespace carma
189 #endif
void disableCommandLogging()
Disable command logging.
virtual ~Downconverter()
Destructor.
Class to encapsulate a CAN message.
Definition: Message.h:21
void updateFrameData()
Update data on a frame time scale This routine is called automatically by carma::canbus::Master every...
void processMsg(carma::canbus::msgType mid, carma::canbus::DataVector &data, bool sim)
Process a CAN message.
XacDevice canbus::device class implementation.
Definition: XacDevice.h:37
unsigned short apiType
Carma API id type.
Definition: Types.h:64
static carma::canbus::apiType getApiId()
Staticly retrieve the API Id.
std::map< carma::canbus::msgType, std::string > getSlowMonitors() const
Retrieve a map of this devices slow monitor points.
unsigned short nodeType
Carma Node Type id type.
Definition: Types.h:66
void enableCommandLogging()
Enable command logging.
std::map< carma::canbus::msgType, std::string > getHalfSecMonitors() const
Retrieve a map of this devices half second monitor points.
::std::vector< ::carma::canbus::byteType > DataVector
Alias for CAN data.
Definition: Types.h:72
Downconverter Device class implementation.
Definition: Downconverter.h:35
carma::canbus::devices::XacDevice class declaration.
carma::canbus::Message simulateMsg(carma::canbus::msgType mid)
Produce a simulated CAN message for a given msgType.
unsigned short msgType
Carma Message id type.
Definition: Types.h:69
CanOutput interface.
Definition: CanOutput.h:26
Downconverter(carma::canbus::nodeType node, carma::canbus::CanOutput &io, carma::monitor::WbdcSubsystem &wbdcSubsys)
Constructor.
static carma::canbus::nodeType calculateNodeId(short input, short band)
Helper routine to calculate a downconverter node id from an input and band id.