CARMA C++
DefaultCorrControl.h
Go to the documentation of this file.
1 #ifndef CARMA_CORRELATOR_OBSRECORD2_DEFAULTCORRCONTROL_H
2 #define CARMA_CORRELATOR_OBSRECORD2_DEFAULTCORRCONTROL_H
3 
7 
8 #include "carma/corba/corba.h"
9 #include "carma/correlator/obsRecord2/CorDataBase.h"
11 #include "carma/util/PthreadMutex.h"
12 
13 #include <memory>
14 #include <vector>
15 
16 
17 namespace carma {
18 
19 namespace corba {
20  class Server;
21 }
22 
23 namespace correlator {
24 
25 
26 namespace lib {
27  class CorrelatorConfigChecker;
28  class CorrelatorData;
29 }
30 
31 
32 namespace obsRecord2 {
33 
34 
35 class BandStatus;
36 
45 {
46  public:
48  DefaultCorrControl( int controlPort );
49 
51  virtual ~DefaultCorrControl( );
52 
55  const ::std::string & servedObjName,
56  void (*shutdownCallback)( void * ),
57  void * shutdownCallbackArg );
58 
67  obsRecord2::FpgaModeType fpgaMode,
68  CORBA::Long seqNo ,
69  CORBA::Long astroBandNo);
70 
75  void setBandwidthVector(const BandWidthSeq & bandwidth,
76  const FpgaModeSeq & fpgaMode,
77  CORBA::Long seqNo ,
78  const carma::util::SeqLong & astroBandNo );
79 
85  void setNoiseSourceState( CORBA::Boolean isOn );
86 
87 
91  void setInputDelayTriplets( const DelayTripletSeq & tripletSeq );
92 
104  void setWalshColumns(
105  const carma::util::SeqLong & cols90,
106  const carma::util::SeqLong & cols180,
107  CORBA::Long nStates90,
108  CORBA::Long nStates180,
109  CORBA::Boolean noiseEnabled);
110 
120  CORBA::Double freq,
122  CORBA::Boolean bdcEnabled );
123 
130 
135  void optimizeThresholds( CORBA::Long seqNo );
136 
141  void flattenPhases( CORBA::Long seqNo );
142 
145  // CARMA boards only; No-op for COBRA hardware boards.
146  // @param enable Enable calibration or not
147  // @param cache Whether to cache new calibration spectra.
148  // @param count Integration time for calibration spectra (in frames).
149  // @param seqNo Command sequence number for monitor stream reporting.
150  void calibrateSpectra( CORBA::Boolean enable,
151  CORBA::Boolean cache,
152  CORBA::Long count,
153  CORBA::Long seqNo );
154 
158  // @param enable True to enable correlation, false to disable.
159  void enableCorrelation( CORBA::Boolean enable );
160 
161  protected:
162 
163  class CobraClient;
164  struct AccumDelaySamps;
165 
166  typedef enum {
167  INVALID_NOISE_SOURCE_STATE,
168  ON_NOISE_SOURCE_STATE,
169  OFF_NOISE_SOURCE_STATE
170  } NoiseSourceState;
171 
172  util::PthreadMutex guard_;
173 
174  // Control connection to the correlator
175  ::std::auto_ptr< CobraClient > cobraClient_;
176 
177  NoiseSourceState requestedNoiseSourceState_;
178  ::std::auto_ptr< AccumDelaySamps > accumDelaySamps_;
179 };
180 
181 
182 } // namespace carma::correlator::obsRecord2
183 } // namespace carma::correlator
184 } // namespace carma
185 
186 
187 #endif
void enableCorrelation(CORBA::Boolean enable)
Enables or disables correlations on COBRA boards.
void setWalshColumns(const carma::util::SeqLong &cols90, const carma::util::SeqLong &cols180, CORBA::Long nStates90, CORBA::Long nStates180, CORBA::Boolean noiseEnabled)
Sets correlator input Walsh column indices.
void setDownconverterSettings(CORBA::Double freq, carma::correlator::obsRecord2::SidebandType sb, CORBA::Boolean bdcEnabled)
Specifies the downconverter frequency and sideband in use for the band.
Class to receive phase switching tables which then triggers more processing.
void setNoiseSourceState(CORBA::Boolean isOn)
Updates the current status of the noise source.
void calibrateSpectra(CORBA::Boolean enable, CORBA::Boolean cache, CORBA::Long count, CORBA::Long seqNo)
Initiates the correlator hardware spectra calibration routine.
sequence< float > SeqFloat
Sequence of CORBA::Float.
Definition: SeqTypedefs.idl:8
Class responsible for handling all CORBA type functionality related to the correlator.
void setBandwidthVector(const BandWidthSeq &bandwidth, const FpgaModeSeq &fpgaMode, CORBA::Long seqNo, const carma::util::SeqLong &astroBandNo)
Vectorized version of setBandwidth command for CARMA3G correlator.
void setDownconverterSettingsVector(const carma::util::SeqFloat &freq)
Vectorized version of setDownconverterSettings command for CARMA3G correlator.
void optimizeThresholds(CORBA::Long seqNo)
Optimize CARMA digitizer thresholds.
sequence< long > SeqLong
Sequence of CORBA::Long.
Definition: SeqTypedefs.idl:9
void startControlServer(carma::corba::Server &server, const ::std::string &servedObjName, void(*shutdownCallback)(void *), void *shutdownCallbackArg)
Start the control server (doesn&#39;t block).
SidebandType
Downconverter sideband choice.
Definition: CorDataBase.idl:62
void flattenPhases(CORBA::Long seqNo)
Initiates the correlator hardware phase flattening routine.
BandWidthType
Supported spectral correlator bandwidths.
Definition: CorDataBase.idl:25
DefaultCorrControl(int controlPort)
Constructor.
void setInputDelayTriplets(const DelayTripletSeq &tripletSeq)
Set Input Delay coefficients.
Class for creating, managing and serving requests to CORBA servants.
Definition: Server.h:22
void setBandwidth(obsRecord2::BandWidthType bandwidth, obsRecord2::FpgaModeType fpgaMode, CORBA::Long seqNo, CORBA::Long astroBandNo)
Sets the spectral bandwidth mode for the band.
A simple wrapper class that makes use of ::pthread_mutex_t easier in a C++ world. ...
Definition: PthreadMutex.h:41
FpgaModeType
Astroband mode – The correlator FPGA configuration/polarization mode.
Definition: CorDataBase.idl:68
Phaseswitching corba server DO implementation.