CARMA C++
carma::control::CorrelatorHandle Class Reference

Manages correlator control DO connections. More...

#include <carma/control/CorrelatorHandle.h>

Inheritance diagram for carma::control::CorrelatorHandle:
carma::control::RemoteObjHandleT< T > carma::control::RemoteObjHandleBase

Public Member Functions

unsigned int astroBandNo () const
 
void calibrateSpectra (const bool noiseEnabled, const float intTime, const bool cache, const bool enable, const int preferredSeqNo)
 Calibrate spectra (bandpass) on the band. More...
 
unsigned int correlatorBandNo () const
 
 CorrelatorHandle (unsigned int astroBandNo, carma::util::CorrelatorType corrType, monitor::MonitorSystem &monitorSys, monitor::ControlSubsystemBase::Reachable &reachable, bool defaultLogIfNotReach)
 Constructor. More...
 
void enableCorrelation (const bool enable)
 Enable or disable correlations (COBRA boards only). More...
 
void flattenPhases (const int preferredSeqNo)
 Flatten phases on the band. More...
 
util::CorrelatorFpgaModeType getFpgaMode () const
 Get the FPGA mode of this band. More...
 
carma::util::hardwareType hardwareType () const
 @ return the underlying hardware type of correlator that this handle controls More...
 
bool isActionComplete (const monitor::MonitorSystem &monsys, int monDataErrorLimit)
 Compare next sequence number with one returned from monitor system. More...
 
bool isC3g () const
 
bool isOffline () const
 
bool isSpectral () const
 
bool isWideband () const
 
void optimizeThresholds (const int preferredSeqNo)
 Optimize thresholds on the band. More...
 
void setAstroBandMode (util::CorrelatorFpgaModeType astroBandMode)
 Set the Astroband (FPGA) mode of this band. More...
 
void setBandwidth (carma::correlator::obsRecord2::BandWidthType bw, const int preferredSeqNo, const unsigned int astroBandNo=0)
 Set bandwidth with a preferred sequence number. More...
 
void setBandwidth (::std::vector< carma::correlator::obsRecord2::BandWidthType > bw,::std::vector< carma::correlator::obsRecord2::FpgaModeType > fm, const int preferredSeqNo,::std::vector< unsigned int > astroBandNo)
 Vectorized version of setBandwidth, for support of C3G Correlator. More...
 
void setDownconverterSettings (::std::vector< float > dcFreqGHz)
 Vectorized version of call to set the downconverter settings. More...
 
void setInputDelayTriplets (::std::vector< correlator::obsRecord2::DelayTriplet > triplets)
 set input delay triplets for a single polarization. More...
 
void setOnline (const bool online)
 Mark a band offline or online. More...
 
void setWalshColumns (::std::vector< int > cols90,::std::vector< int > cols180, const int nStates90, const int nStates180, const bool noiseEnabled)
 Sets correlator input Walsh column indices. More...
 
- Public Member Functions inherited from carma::control::RemoteObjHandleT< T >
template<typename S >
S::_var_type narrowedRemoteObj () const
 Returns remote object handle as var. More...
 
T::_var_type remoteObj () const
 Returns remote object handle as var. More...
 
 RemoteObjHandleT (const ::std::string &doName, monitor::MonitorPointBool *mpReachable, const monitor::MonitorSubsystem *subsystem, monitor::MonitorSystem *system, bool defaultLogIfNotReachable, bool defaultLogSentCommands)
 Constructor. More...
 
virtual ~RemoteObjHandleT ()
 Destructor. More...
 
- Public Member Functions inherited from carma::control::RemoteObjHandleBase
bool attemptToReconnectIfNeeded ()
 Try reconnect to the DO if needed. More...
 
::std::string doName () const
 get the DO name More...
 
void forceFullReconnect ()
 Force a full re-lookup of the DO by name. More...
 
bool isObjReachable ()
 If state is 'not reachable' and monitor system is current, tries to reconnect. More...
 
bool isObjReachable (bool logIfNotReachable)
 
 RemoteObjHandleBase (const ::std::string &doName, monitor::MonitorPointBool *mpReachable, const monitor::MonitorSubsystem *subsystem, monitor::MonitorSystem *system, bool defaultLogIfNotReachable, bool defaultLogSentCommands)
 Constructor. More...
 
virtual ~RemoteObjHandleBase ()
 Destructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from carma::control::RemoteObjHandleT< T >
virtual bool resolveObjRef ()
 
- Protected Member Functions inherited from carma::control::RemoteObjHandleBase
bool getDefaultLogIfNotReachable () const
 
bool getDefaultLogSentCommands () const
 
void invalidateObjRef ()
 
void invalidateObjRefIfNeededForCaught ()
 
void logException (const ::std::string &callString, const ::std::string &exString) const
 
void logSentCommand (const ::std::string &callString, const double mjd) const
 
void logSentCommand (const ::std::string &callString, const double mjd, const ::std::string &subDoName) const
 
void logSentCommandIfNeeded (const ::std::string &callString, const double mjd) const
 
void logSentCommandIfNeeded (const ::std::string &callString, const double mjd, const ::std::string &subDoName) const
 
void markObjRefValid ()
 
void processException (const ::std::string &callString, const ::CORBA::Exception &corbaException)
 
void throwBadRemoteObjAccess () const
 
void throwIfObjRefIsNotValid () const
 

Detailed Description

Manages correlator control DO connections.

Definition at line 37 of file CorrelatorHandle.h.

Constructor & Destructor Documentation

carma::control::CorrelatorHandle::CorrelatorHandle ( unsigned int  astroBandNo,
carma::util::CorrelatorType  corrType,
monitor::MonitorSystem monitorSys,
monitor::ControlSubsystemBase::Reachable &  reachable,
bool  defaultLogIfNotReach 
)

Constructor.

Parameters
monitorSystemmonitor system reference which allows this handle to get a reference to its own monitor stream. This constructor will throw ErrorException if the Band hardware type comes back as HARDWARE_TYPE_UNKNOWN.
See Also
util/corrUtils.h

Member Function Documentation

void carma::control::CorrelatorHandle::calibrateSpectra ( const bool  noiseEnabled,
const float  intTime,
const bool  cache,
const bool  enable,
const int  preferredSeqNo 
)

Calibrate spectra (bandpass) on the band.

The process on the remote object takes ~30(?) seconds Noise source must be in requested state

Parameters
enableWhether or not to enable bandpass (spectral) calibration (can be used to toggle it on and off)
noiseEnabledWhether or not to enable the noise source. For instance, you would set this to false if doing bandpass calibration on an astronomical source.
cacheWhether or not to cache the result for subsequent division.
intTimeIntegration time in seconds for the calibration.
preferredSeqNo- The preferred sequence number for this command. If the preferred sequence number has already been used, the actual sequence number is set to preferred + 10.
void carma::control::CorrelatorHandle::enableCorrelation ( const bool  enable)

Enable or disable correlations (COBRA boards only).

This is to be used when the correlator room is overheating.

Parameters
enableEnable correlation or not.
void carma::control::CorrelatorHandle::flattenPhases ( const int  preferredSeqNo)

Flatten phases on the band.

The process on the remote object takes ~30 seconds Noise source must be ON

Parameters
preferredSeqNo- The preferred sequence number for this command. If the preferred sequence number has already been used, the actual sequence number is set to preferred + 10.
util::CorrelatorFpgaModeType carma::control::CorrelatorHandle::getFpgaMode ( ) const

Get the FPGA mode of this band.

Returns
The FPGA configuration mode: SINGLEPOL, FULLPOL, or CARMA23

Definition at line 174 of file CorrelatorHandle.h.

carma::util::hardwareType carma::control::CorrelatorHandle::hardwareType ( ) const

@ return the underlying hardware type of correlator that this handle controls

Definition at line 200 of file CorrelatorHandle.h.

bool carma::control::CorrelatorHandle::isActionComplete ( const monitor::MonitorSystem monsys,
int  monDataErrorLimit 
)

Compare next sequence number with one returned from monitor system.

If they are the same then the last drive action is complete.

Parameters
monsysmonitor system from which to retrieve completion
monitorDataErrorLimitnumber of consecutive monitor data invalid limit before thowing an exception
Returns
true if last action is complete
Exceptions
ifnumber of consecutive monitor data errors is exceeed
bool carma::control::CorrelatorHandle::isC3g ( ) const
Returns
True if the underlying hardware type is HARDWARE_TYPE_C3G, false otherwise.

Definition at line 215 of file CorrelatorHandle.h.

bool carma::control::CorrelatorHandle::isOffline ( ) const
Returns
True if the band has been marked offline, false if it is marked online, REGARDLESS OF WHETHER OR NOT THE REMOVE OBJECT IS REACHABLE.

Definition at line 68 of file CorrelatorHandle.h.

bool carma::control::CorrelatorHandle::isSpectral ( ) const
Returns
True if the underlying hardware type is HARDWARE_TYPE_CARMA, false otherwise.

Definition at line 205 of file CorrelatorHandle.h.

bool carma::control::CorrelatorHandle::isWideband ( ) const
Returns
True if the underlying hardware type is HARDWARE_TYPE_COBRA, false otherwise.

Definition at line 210 of file CorrelatorHandle.h.

void carma::control::CorrelatorHandle::optimizeThresholds ( const int  preferredSeqNo)

Optimize thresholds on the band.

The process on the remote object takes ~10 seconds Noise source must be OFF.

Parameters
preferredSeqNo- The preferred sequence number for this command. If the preferred sequence number has already been used, the actual sequence number is set to preferred + 10.
void carma::control::CorrelatorHandle::setAstroBandMode ( util::CorrelatorFpgaModeType  astroBandMode)

Set the Astroband (FPGA) mode of this band.

This will typically happen from within configband().

Parameters
astroBandModeThe FPGA configuration mode: SINGLEPOL, DUALPOL, FULLPOL, or CARMA23

Definition at line 170 of file CorrelatorHandle.h.

void carma::control::CorrelatorHandle::setBandwidth ( carma::correlator::obsRecord2::BandWidthType  bw,
const int  preferredSeqNo,
const unsigned int  astroBandNo = 0 
)

Set bandwidth with a preferred sequence number.

Sets spectral bandwidth mode for the band. The process takes several seconds and is spawned off in a thread.

Parameters
bwbandwidth indicator (500MHZ, 250MHZ_3BIT, etc)
preferredSeqNo- The preferred sequence number for this command. If the preferred sequence number has already been used, the actual sequence number is set to preferred + 10.
TheastroBand number to set. Default of -1 means the cobra library will set it to the Correlator Band number.
void carma::control::CorrelatorHandle::setBandwidth ( ::std::vector< carma::correlator::obsRecord2::BandWidthType bw,
::std::vector< carma::correlator::obsRecord2::FpgaModeType fm,
const int  preferredSeqNo,
::std::vector< unsigned int >  astroBandNo 
)

Vectorized version of setBandwidth, for support of C3G Correlator.

Parameters
bwvector of bandwidth indicators (500MHZ, 250MHZ_3BIT, etc)
bwvector of fpgmmode indicators (LL, FULLPOL, etc)
preferredSeqNo- The preferred sequence number for this command. If the preferred sequence number has already been used, the actual sequence number is set to preferred + 10.
astrobandNovector of astroBand numbers for, one for each bandwidth indicator
void carma::control::CorrelatorHandle::setDownconverterSettings ( ::std::vector< float >  dcFreqGHz)

Vectorized version of call to set the downconverter settings.

There is no handle wrapper for the non-vector call since no sequence number needs to be set and the cobra library call returns quickly. This method must convert vector to CORBA sequence before the remote call.

Parameters
dcFreq- vector of downconverter frequencies in GHz.
void carma::control::CorrelatorHandle::setInputDelayTriplets ( ::std::vector< correlator::obsRecord2::DelayTriplet >  triplets)

set input delay triplets for a single polarization.

Note
The vector argument is passed by value so we can safely insure that it is fully and deeply copied across the thread barrier when this method is forked out to the worker pool
void carma::control::CorrelatorHandle::setOnline ( const bool  online)

Mark a band offline or online.

An offline band will ignore all commands.

Definition at line 73 of file CorrelatorHandle.h.

void carma::control::CorrelatorHandle::setWalshColumns ( ::std::vector< int >  cols90,
::std::vector< int >  cols180,
const int  nStates90,
const int  nStates180,
const bool  noiseEnabled 
)

Sets correlator input Walsh column indices.

Parameters
cols90Walsh columns used for 90-deg demodulation.
cols180Walsh columns used for 180-deg demodulation.
nStates90Number of states for 90-deg demodulation (zero maintains existing value).
nStates180Number of states for 180-deg demodulation (zero maintains existing value).
noiseEnabledTrue if the columns are for the noise source False if RF.

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