CARMA C++
CorrelatorHandle.h
Go to the documentation of this file.
1 #ifndef CARMA_CONTROL_CORRELATOR_HANDLE_H
2 #define CARMA_CONTROL_CORRELATOR_HANDLE_H
3 
14 #include <vector>
15 
16 #include "carma/corba/corba.h"
18 #include "carma/control/CorrelatorInfo.h"
19 #include "carma/control/CorrDefs.h"
21 #include "carma/monitor/ControlSubsystem.h"
22 #include "carma/monitor/NoiseSource.h"
23 #include "carma/correlator/obsRecord2/CorDataBase.h"
25 #include "carma/util/corrUtils.h"
26 
27 
28 namespace carma {
29 namespace control {
30 
31 
32 typedef RemoteObjHandleT< correlator::obsRecord2::Correlator_I >
33  CorrelatorControlRemoteObjHandle;
34 
35 
38  public:
50  unsigned int astroBandNo,
51  carma::util::CorrelatorType corrType,
52  monitor::MonitorSystem & monitorSys,
53  monitor::ControlSubsystemBase::Reachable & reachable,
54  bool defaultLogIfNotReach );
55 
56  virtual ~CorrelatorHandle( );
57 
63  ::std::vector< correlator::obsRecord2::DelayTriplet > triplets );
64 
68  bool isOffline() const { return !online_ ; }
69 
72  //@param offline True if the band is online, false if offline
73  void setOnline( const bool online ) {
74  online_ = online;
75  }
76 
87  void setBandwidth(
89  const int preferredSeqNo,
90  const unsigned int astroBandNo = 0 );
91 
100  void setBandwidth(
101  ::std::vector<carma::correlator::obsRecord2::BandWidthType> bw,
102  ::std::vector<carma::correlator::obsRecord2::FpgaModeType> fm,
103  const int preferredSeqNo,
104  ::std::vector<unsigned int> astroBandNo );
105 
112  void optimizeThresholds( const int preferredSeqNo );
113 
120  void flattenPhases( const int preferredSeqNo );
121 
136  void calibrateSpectra( const bool noiseEnabled,
137  const float intTime,
138  const bool cache,
139  const bool enable,
140  const int preferredSeqNo
141  );
142 
149  void setDownconverterSettings( ::std::vector<float> dcFreqGHz );
150 
151 
155  void enableCorrelation( const bool enable );
156 
164  bool isActionComplete( const monitor::MonitorSystem & monsys,
165  int monDataErrorLimit );
166 
170  void setAstroBandMode( util::CorrelatorFpgaModeType astroBandMode ) { astroBandMode_ = astroBandMode; }
171 
174  util::CorrelatorFpgaModeType getFpgaMode( ) const { return astroBandMode_; }
175 
176  unsigned int correlatorBandNo() const {return bandNo_;}
177  unsigned int astroBandNo() const {return astroBandNo_ ;}
178 
190  void setWalshColumns(
191  ::std::vector<int> cols90,
192  ::std::vector<int> cols180,
193  const int nStates90,
194  const int nStates180,
195  const bool noiseEnabled);
196 
201 
206 
211 
215  bool isC3g() const { return hardwareType() == carma::util::HARDWARE_TYPE_C3G; }
216 
217  // @FIXME NO LONGER NEEDED.
229  private:
230 
231  bool isNoiseSourceEnabled( void );
232  bool isNoiseSourceDisabled( void );
233  bool isNoiseSource(
234  monitor::NoiseStatusMonitorPointEnum::NOISESTATUS status
235  );
236  void setNextSequenceNo( int preferredSequenceNo );
237 
238  bool online_;
239  int nextSequenceNo_;
240  int consecutiveErrors_;
241  int errLimit_;
242  monitor::MonitorSystem & monitorSys_;
243  unsigned int bandNo_;
244  unsigned int astroBandNo_;
245  util::CorrelatorFpgaModeType astroBandMode_;
246  carma::util::CorrelatorType corrType_;
247 
248 };
249 
250 
251 } // namespace carma::control
252 } // namespace carma
253 
254 
255 #endif
void enableCorrelation(const bool enable)
Enable or disable correlations (COBRA boards only).
Helper routines for, e.g.
Carma control interface server implementation.
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.
void setAstroBandMode(util::CorrelatorFpgaModeType astroBandMode)
Set the Astroband (FPGA) mode of this band.
CorrelatorFpgaModeType
FPGA configuration modes.
void flattenPhases(const int preferredSeqNo)
Flatten phases on the band.
util::CorrelatorFpgaModeType getFpgaMode() const
Get the FPGA mode of this band.
CARMA 3rd generation correlator hardware.
Definition: corrUtils.h:31
void setDownconverterSettings(::std::vector< float > dcFreqGHz)
Vectorized version of call to set the downconverter settings.
enum carma::util::hardwareTypeEnum hardwareType
The type of board hardware in a given band.
Definition: corrUtils.h:20
CARMA board hardware.
Definition: corrUtils.h:30
void setOnline(const bool online)
Mark a band offline or online.
void calibrateSpectra(const bool noiseEnabled, const float intTime, const bool cache, const bool enable, const int preferredSeqNo)
Calibrate spectra (bandpass) on the band.
COBRA board hardware.
Definition: corrUtils.h:29
carma::util::hardwareType hardwareType() const
@ return the underlying hardware type of correlator that this handle controls
Manages correlator control DO connections.
CorrelatorHandle(unsigned int astroBandNo, carma::util::CorrelatorType corrType, monitor::MonitorSystem &monitorSys, monitor::ControlSubsystemBase::Reachable &reachable, bool defaultLogIfNotReach)
Constructor.
Manages connection to remote DO.
Typed class for managing connections to DOs.
Monitor system base class.
Definition: MonitorSystem.h:81
BandWidthType
Supported spectral correlator bandwidths.
Definition: CorDataBase.idl:25
void setBandwidth(carma::correlator::obsRecord2::BandWidthType bw, const int preferredSeqNo, const unsigned int astroBandNo=0)
Set bandwidth with a preferred sequence number.
void setInputDelayTriplets(::std::vector< correlator::obsRecord2::DelayTriplet > triplets)
set input delay triplets for a single polarization.
hardwareType hwType(unsigned int astroBandNo)
void optimizeThresholds(const int preferredSeqNo)
Optimize thresholds on the band.
bool isActionComplete(const monitor::MonitorSystem &monsys, int monDataErrorLimit)
Compare next sequence number with one returned from monitor system.