CARMA C++
carma::downconverter::SpectralDownconverter Class Reference

SpectralDownconverter CAN Device class implementation. More...

#include <carma/downconverter/spectral/SpectralDownconverter.h>

Inheritance diagram for carma::downconverter::SpectralDownconverter:
carma::canbus::devices::XacDevice carma::canbus::Device

Public Member Functions

::CORBA::Boolean checkIfOutputPower (::CORBA::Float power,::CORBA::Float delta)
 Check that IF Output power is within a specified range. More...
 
void disableCommandLogging ()
 Disable command logging. More...
 
void enableCommandLogging ()
 Enable command logging. More...
 
void enableIfOutAlc (::CORBA::Boolean enable) const
 Enable or disable the IF Output ALC (Automatic Level Control) loop (normally on). More...
 
void enableRfInputAmp (::CORBA::Boolean enable) const
 Switch the RF Input Amplifier on or off. More...
 
std::map
< carma::canbus::msgType,
std::string > 
getHalfSecMonitors () const
 Retrieve a map of this devices half second monitor points. More...
 
std::map
< carma::canbus::msgType,
std::string > 
getSlowMonitors () const
 Retrieve a map of this devices slow monitor points. More...
 
::CORBA::Boolean isOnline ()
 Is this module online? More...
 
void processMsg (carma::canbus::msgType mid, std::vector< carma::canbus::byteType > &data, bool sim)
 Process a CAN message. More...
 
void selectOutputFilter (enum SpectralDownconverterControl::FilterType filter) const
 Select which of the available output bandwidth defining filters to use. More...
 
void selectSideband (enum SpectralDownconverterControl::SidebandType sideband) const
 Select which sideband the single sideband downconverter is to use. More...
 
void setIfOut (::CORBA::Float ifout) const
 Set the IF Output power level to the requested level. More...
 
void setIfOutAtten (::CORBA::Float atten) const
 Set the downconverter IF Output Attenuation to the requested value. More...
 
void setIfOutPreset () const
 Set the IF Output Power level to the preset value stored in the compensation EEPROM. More...
 
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 value (used for testing). More...
 
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 modulator settings. More...
 
void setPsys (::CORBA::Float psys) const
 Set Psys to requested power level. More...
 
void setPsysAtten (::CORBA::Float atten) const
 Set Psys attenuation level to the requested level. More...
 
void setPsysPreset () const
 Set Psys power level to the preset value stored in the compensation EEPROM. More...
 
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 value. More...
 
carma::canbus::Message simulateMsg (carma::canbus::msgType mid)
 Produce a simulated CAN message for a given msgType. More...
 
 SpectralDownconverter (carma::canbus::nodeType node, carma::canbus::CanOutput &co, carma::monitor::SldcSubsystem &sldcMon)
 Constructor. More...
 
void updateFrameData ()
 Update data on a frame time scale This routine is called automatically by carma::canbus::Master every half second. More...
 
virtual ~SpectralDownconverter ()
 Destructor. More...
 
- Public Member Functions inherited from carma::canbus::devices::XacDevice
bool isOnline ()
 Is Device ONLINE? More...
 
void reset ()
 Reset the can module via CORBA using Device::softReset() method. More...
 
void startChannelOneFastSampling (unsigned short fastItem)
 Start fast sampling on channel one with the requested data item. More...
 
void startChannelTwoFastSampling (unsigned short fastItem)
 Start fast sampling on channel two with the requested data item. More...
 
void stopChannelOneFastSampling ()
 Stop fast sampling on channel one. More...
 
void stopChannelTwoFastSampling ()
 Stop fast sampling on channel two. More...
 
 XacDevice (carma::canbus::apiType api, carma::canbus::nodeType node, carma::canbus::CanOutput &canOutput)
 Constructor. More...
 
virtual ~XacDevice ()
 Destructor. More...
 
- Public Member Functions inherited from carma::canbus::Device
carma::canbus::Message createDummyMsg () const
 Create a dummy CAN message. More...
 
carma::canbus::Message createMsgToAllNodes (msgType messageId) const
 Create a CAN message addressed to all nodes of this type. More...
 
carma::canbus::Message createMsgToHost (msgType messageId) const
 Create a CAN message addressed from this Device to the host. More...
 
carma::canbus::Message createMsgToNode (msgType messageId) const
 Create a CAN message addressed to this device from the host. More...
 
 Device (apiType api, nodeType node, CanOutput &io)
 Device constructor. More...
 
apiType getApi () const
 Return api code of device. More...
 
char getApiVersion () const
 Get API Version of this Device. More...
 
boardType getBoardType () const
 Return board type id of device. More...
 
busIdType getBusId () const
 Return bus Id that node resides on. More...
 
virtual MsgIdInfoMap getControls () const
 Return a map of devices controls. More...
 
keyType getKey () const
 Create a key unique to this api and node. More...
 
double getLastRxTime () const
 Get Last RX Time for device. More...
 
unsigned int getNlatePackets () const
 Get number of late packets. More...
 
nodeType getNode () const
 Return node location code of device. More...
 
serialNumberType getSerialNumber () const
 Return serial number of device. More...
 
deviceStateType getState () const
 Status access routine. More...
 
void reset ()
 Perform a software reset of module. More...
 
void setBoardType (boardType bt)
 Set board type of device. More...
 
void setBusId (busIdType busId)
 Set busId of device. More...
 
virtual void setLastRxTime (double rxMjd)
 Set latest rx time. More...
 
void setSerialNumber (serialNumberType sn)
 Set serial number of device. More...
 
void startChannelOneFastSampling (unsigned short fastItem)
 Start fast sampling the specified data item on channel 1. More...
 
void startChannelTwoFastSampling (unsigned short fastItem)
 Start fast sampling the specified data item on channel 2. More...
 
void stopChannelOneFastSampling ()
 Stop fast sampling on channel 1 This routine will stop fast sampling on channel 1 regardless of whether this node is fast sampling the channel or not! In other words the request goes out globally. More...
 
void stopChannelTwoFastSampling ()
 Stop fast sampling on channel 2 This routine will stop fast sampling on channel 2 regardless of whether this node is fast sampling the channel or not! In other words the request goes out globally. More...
 
virtual ~Device ()
 Device destructor. More...
 

Static Public Member Functions

static carma::canbus::nodeType calculateNodeId (unsigned short input, unsigned short band)
 Calculate node id based on the input and band id. More...
 
static std::string filterAsString (const carma::downconverter::DownconverterControl::FilterType filter)
 Return a string representation of the input filter. More...
 
static carma::canbus::apiType getApiId ()
 Staticly retrieve the API Id. More...
 
- Static Public Member Functions inherited from carma::canbus::Device
static keyType createKey (apiType api, nodeType node)
 

Additional Inherited Members

- Static Public Attributes inherited from carma::canbus::devices::XacDevice
static const carma::canbus::msgType SYSTEM_MONITOR_PACKET_1 = 0x120
 
static const carma::canbus::msgType SYSTEM_MONITOR_PACKET_2 = 0x121
 
static const carma::canbus::msgType SYSTEM_MONITOR_PACKET_3 = 0x122
 
static const carma::canbus::msgType SYSTEM_MONITOR_PACKET_4 = 0x123
 
static const carma::canbus::msgType SYSTEM_MONITOR_PACKET_5 = 0x124
 
- Protected Member Functions inherited from carma::canbus::devices::XacDevice
virtual void initialize ()
 Initialization hook. More...
 
void processSystemMonitorPacket (carma::canbus::msgType mid, carma::canbus::DataVector &data, carma::monitor::Xac &xac)
 Process a system monitor packet. More...
 
void processSystemMonitorPacket1 (carma::canbus::DataVector &data, carma::monitor::Xac &xac)
 Process System Monitor Packet 1 This routine processes standard system monitor packet 1 and places the data into the input Xac reference. More...
 
void processSystemMonitorPacket2 (carma::canbus::DataVector &data, carma::monitor::Xac &xac)
 Process System Monitor Packet 2. More...
 
void processSystemMonitorPacket3 (carma::canbus::DataVector &data, carma::monitor::Xac &xac)
 Process System Monitor Packet 3. More...
 
void processSystemMonitorPacket4 (carma::canbus::DataVector &data, carma::monitor::Xac &xac)
 Process System Monitor Packet 4. More...
 
void processSystemMonitorPacket5 (carma::canbus::DataVector &data, carma::monitor::Xac &xac)
 Process System Monitor Packet 5. More...
 
carma::canbus::Message simSystemMonitorPacket (carma::canbus::msgType mid)
 Simulate system monitor packet. More...
 
carma::canbus::Message simSystemMonitorPacket1 ()
 Simulate System Monitor Packet 1. More...
 
carma::canbus::Message simSystemMonitorPacket2 ()
 Simulate System Monitor Packet 2. More...
 
carma::canbus::Message simSystemMonitorPacket3 ()
 Simulate System Monitor Packet 3. More...
 
carma::canbus::Message simSystemMonitorPacket4 ()
 Simulate System Monitor Packet 4. More...
 
carma::canbus::Message simSystemMonitorPacket5 ()
 Simulate System Monitor Packet 5. More...
 
- Protected Member Functions inherited from carma::canbus::Device
void incrementLatePacketCount ()
 Increment the late packet count by 1. More...
 
bool isPacketLate (double window=100.0)
 Determine if the last packet sent from this device was late. More...
 
void resetLatePacketCount ()
 Reset the late packet count to 0. More...
 
void setApiVersion (char api)
 Set API Version. More...
 
- Static Protected Member Functions inherited from carma::canbus::devices::XacDevice
static bool isSystemMonitorPacket (carma::canbus::msgType)
 Check that input message type is a system monitor packet. More...
 
- Protected Attributes inherited from carma::canbus::Device
const apiType api_
 
CanOutputio_
 Reference to CanOutput object. More...
 
const keyType key_
 
const nodeType node_
 
- Static Protected Attributes inherited from carma::canbus::Device
static const msgType RESET = 0x0000
 Software reset message id. More...
 
static const msgType START_CHANNEL_1_FAST_SAMPLING = 0x0004
 Begin channel 1 fast sampling message id. More...
 
static const msgType START_CHANNEL_2_FAST_SAMPLING = 0x0005
 Begin channel 2 fast sampling message id. More...
 
static const msgType STOP_CHANNEL_1_FAST_SAMPLING = 0x0002
 Stop channel 1 fast sampling message id. More...
 
static const msgType STOP_CHANNEL_2_FAST_SAMPLING = 0x0003
 

Detailed Description

SpectralDownconverter CAN Device class implementation.

This class implements the carma::canbus::Device base class for Carma CAN API 024 describing the Spectral Downconverter CAN device.

Definition at line 38 of file SpectralDownconverter.h.

Constructor & Destructor Documentation

carma::downconverter::SpectralDownconverter::SpectralDownconverter ( carma::canbus::nodeType  node,
carma::canbus::CanOutput co,
carma::monitor::SldcSubsystem &  sldcMon 
)

Constructor.

Creates a SpectralDownconverter device with the given node id.

Parameters
nodeNode id of device.
ioReference to CanOutput class.
sldcMonReference to sldc monitor subsystem.
virtual carma::downconverter::SpectralDownconverter::~SpectralDownconverter ( )
virtual

Destructor.

Member Function Documentation

static carma::canbus::nodeType carma::downconverter::SpectralDownconverter::calculateNodeId ( unsigned short  input,
unsigned short  band 
)
static

Calculate node id based on the input and band id.

Parameters
inputInput (antenna) id (1-15) - not the index.
bandBand id (1-8) - not the index.
Returns
node id of device.
::CORBA::Boolean carma::downconverter::SpectralDownconverter::checkIfOutputPower ( ::CORBA::Float  power,
::CORBA::Float  delta 
)

Check that IF Output power is within a specified range.

This command is for engineering use only!

Parameters
powercenter IF Output power in dBm
deltavalue around IF Output power in dBm
Returns
true if within boundaries false otherwise.
Exceptions
carma::util::UserExceptionif module is OFFLINE.
void carma::downconverter::SpectralDownconverter::disableCommandLogging ( )

Disable command logging.

Turn off command logging on commands which are called on a per-band basis. This allows the higher level wrapper to log once per band rather than log for every call to every input for each band thus reducing the log volume.

void carma::downconverter::SpectralDownconverter::enableCommandLogging ( )

Enable command logging.

Re-enable command logging for per-band commands.

void carma::downconverter::SpectralDownconverter::enableIfOutAlc ( ::CORBA::Boolean  enable) const

Enable or disable the IF Output ALC (Automatic Level Control) loop (normally on).

Parameters
enableTrue to enable, falst to disable.
void carma::downconverter::SpectralDownconverter::enableRfInputAmp ( ::CORBA::Boolean  enable) const

Switch the RF Input Amplifier on or off.

Parameters
enableTrue to enable, false to disable.
static std::string carma::downconverter::SpectralDownconverter::filterAsString ( const carma::downconverter::DownconverterControl::FilterType  filter)
static

Return a string representation of the input filter.

Parameters
filterInput filter.
static carma::canbus::apiType carma::downconverter::SpectralDownconverter::getApiId ( )
static

Staticly retrieve the API Id.

This is a helper routine and does the same thing as the getApi member function with the exception that it can be called staticly.

Returns
api id of device.
std::map<carma::canbus::msgType, std::string> carma::downconverter::SpectralDownconverter::getHalfSecMonitors ( ) const
virtual

Retrieve a map of this devices half second monitor points.

The monitor points returned from this routine will be simulated if the device is in the OFFLINE state.

Returns
map of string description of half second monitors keyed by msgType (message id).

Implements carma::canbus::Device.

std::map<carma::canbus::msgType, std::string> carma::downconverter::SpectralDownconverter::getSlowMonitors ( ) const
virtual

Retrieve a map of this devices slow monitor points.

These monitor points will be simulated every 5 seconds if the device is in the OFFLINE state.

Returns
map of string description of slow (5 second) monitors keyed by msgType (message id).

Reimplemented from carma::canbus::devices::XacDevice.

::CORBA::Boolean carma::downconverter::SpectralDownconverter::isOnline ( )

Is this module online?

Returns
True if online false if offline.
void carma::downconverter::SpectralDownconverter::processMsg ( carma::canbus::msgType  mid,
std::vector< carma::canbus::byteType > &  data,
bool  sim 
)
virtual

Process a CAN message.

This routine is responsible for processing all CAN messages addressed to this device.

Parameters
midthe 10bit message id (carma::canbus::msgType)
datareference to the byte vector containing the raw data.

Implements carma::canbus::Device.

void carma::downconverter::SpectralDownconverter::selectOutputFilter ( enum SpectralDownconverterControl::FilterType  filter) const

Select which of the available output bandwidth defining filters to use.

Different boards may have different filters available from the OutputFilterType list. However, if an unavailable filter is requested, an error will be sent back in the monitor stream. Upon reset, the module will use the same filter it used prior to the reset. However, the INITREQ flag will be set since the high-level system may have attempted to reset the filter.

Parameters
filterDesired filter of OutputFilterType.
void carma::downconverter::SpectralDownconverter::selectSideband ( enum SpectralDownconverterControl::SidebandType  sideband) const

Select which sideband the single sideband downconverter is to use.

Upon reset the module will use the same sideband it used prior to reset but INITREQ will be set until this command is called again. This is required since the control system may have changed the sideband while the module was offline.

Parameters
sidebandDesired sideband.
void carma::downconverter::SpectralDownconverter::setIfOut ( ::CORBA::Float  ifout) const

Set the IF Output power level to the requested level.

The downconverter adjusts the IF Output VVA voltage until the IF Output Log Detector power level reaches the requested value. Once this level is set, it is not adjusted again until this message i or an IFOUT Level command is received. The actual power in versus voltage out characteristics of the IFOUT Log Detector are contained in the downconverter Compensation EEPROM. When this message is sent the hardware ALC is enabled.

Parameters
ifoutRequested IF Output power level in dBm.
void carma::downconverter::SpectralDownconverter::setIfOutAtten ( ::CORBA::Float  atten) const

Set the downconverter IF Output Attenuation to the requested value.

Once this value is set, it is not adjusted again until this message or a Set IF Output to Requested Power Level command is received (setIfOut). When this message is sent, the hardware ALC is disabled.

Parameters
attenRequested IF Output attenuation value in dB.
void carma::downconverter::SpectralDownconverter::setIfOutPreset ( ) const

Set the IF Output Power level to the preset value stored in the compensation EEPROM.

The downconverter adjusts the IFOUT VVA voltage until the IF Output Log Detector voltage reaches the required power level. Once this level is set, it is not adjusted again until this message or an IFOUT Level command is received. The hardware contains a closed loop system that continuously keeps the IF Output Power level at this level without any interaction from the microcontroller. When this message is sent, the hardware ALC is enabled.

void carma::downconverter::SpectralDownconverter::setIModulatorVoltage ( ::CORBA::Short  I) const

Manually set the differential voltage on the I channel of the 90 degree I/Q modulator to a particular value (used for testing).

Parameters
Imodulator voltage in mv.
void carma::downconverter::SpectralDownconverter::setLOFrequency ( ::CORBA::Double  lofreq) const

Sends the 2nd LO frequency to this module which in turn uses it to determine required I and Q modulator settings.

Again, upon reset the prior value is used but INITREQ is set in case the control system changed this value while the module was offline.

Parameters
lofreq2nd LO frequency in GHz.
void carma::downconverter::SpectralDownconverter::setPsys ( ::CORBA::Float  psys) const

Set Psys to requested power level.

Once this level is set, once this level is set, it is not adjusted again until this message or a Set Psys to Preset Level command is received. The power in versus voltage out characteristics of the Psys Log Detector are contained in the downconverter compensation EEPROM.

Parameters
psysRequested Psys level in dBm.
void carma::downconverter::SpectralDownconverter::setPsysAtten ( ::CORBA::Float  atten) const

Set Psys attenuation level to the requested level.

Once this value is set, it is not adjusted again until this message or a set Psys Level command is received.

Parameters
attenRequested Psys attenuation level in dB.
void carma::downconverter::SpectralDownconverter::setPsysPreset ( ) const

Set Psys power level to the preset value stored in the compensation EEPROM.

void carma::downconverter::SpectralDownconverter::setQModulatorVoltage ( ::CORBA::Short  Q) const

Manually set the differential voltage on the Q channel of the 90 degree I/Q modulator to a particular value.

Parameters
Qmodulator voltage in mv.
carma::canbus::Message carma::downconverter::SpectralDownconverter::simulateMsg ( carma::canbus::msgType  mid)
virtual

Produce a simulated CAN message for a given msgType.

This routine creates a Message with simulated data for the input message id. The returned message is automatically placed in the CAN message queue for retrieval and processing by the Master class. When this device is OFFLINE, it is called for each message type returned from SpectralDownconverter::getSlowMonitors and SpectralDownconverter::getHalfSecMonitors and thus tests the processMsg() method and monitor system. Note that this routine is called by the carma::canbus::Master base class automatically.

Parameters
midMessage id of CAN message to simulate.
Returns
Simulated CAN message.

Implements carma::canbus::Device.

void carma::downconverter::SpectralDownconverter::updateFrameData ( )
virtual

Update data on a frame time scale This routine is called automatically by carma::canbus::Master every half second.

It is used to set the state monitor point among other things.

Reimplemented from carma::canbus::Device.


The documentation for this class was generated from the following file: