1 #ifndef CARMA_SIGNALPATH_SIGNALPATHCONTROLIMPL_H
2 #define CARMA_SIGNALPATH_SIGNALPATHCONTROLIMPL_H
4 #include "carma/control/CorrDefs.h"
6 #include "carma/monitor/BlockDownconverter.h"
7 #include "carma/monitor/ControlBandCommon.h"
8 #include "carma/monitor/CorrDesignation.h"
10 #include "carma/monitor/SignalPathSubsystem.h"
12 #include "carma/signalpath/SignalPathMapperControl.h"
15 #include "carma/util/PthreadMutex.h"
16 #include "carma/util/SeqTypedefs.h"
17 #include "carma/util/corrUtils.h"
21 #include "carma/szautil/PeriodicTimer.h"
25 namespace signalpath {
27 class SignalPathMapperControlImpl {
30 class SwitchyardConfiguration {
32 std::string fileName_;
33 sza::util::String confName_;
34 sza::util::String astroBandConfName_;
36 SignalPathMapperControl::SwitchyardConfiguration tag_;
38 SwitchyardConfiguration(std::string confName,
39 SignalPathMapperControl::SwitchyardConfiguration tag,
40 std::string astroBandConfName,
44 confName_ = confName_.toUpper();
48 astroBandConfName_ = astroBandConfName;
49 astroBandConfName_ = astroBandConfName_.toUpper();
54 SwitchyardConfiguration(
const SwitchyardConfiguration& conf) {
58 void operator=(
const SwitchyardConfiguration& conf) {
59 *
this = (SwitchyardConfiguration&) conf;
62 void operator=(SwitchyardConfiguration& conf) {
63 fileName_ = conf.fileName_;
64 confName_ = conf.confName_;
65 astroBandConfName_ = conf.astroBandConfName_;
71 SignalPathMapperControlImpl();
73 ~SignalPathMapperControlImpl();
81 void initializeCableMap(std::string fileName);
85 void loadConfiguration(std::string fileName, std::string confName, std::string astroBandConfName);
89 void addAntenna(
unsigned short antNo,
unsigned short subarrayNo);
93 void removeAntenna(
unsigned short antNo,
unsigned short subarrayNo);
97 void addCorrelator(carma::util::CorrelatorType type,
unsigned short subarrayNo);
101 void removeCorrelator(carma::util::CorrelatorType type,
unsigned short subarrayNo);
105 void configureAstroBand(
unsigned short bandNo, std::string confName,
106 unsigned short subarrayNo=0,
107 carma::util::CorrelatorType type=carma::util::CORR_ALL);
111 void checkConfigurationValidity(
unsigned short bandNo, std::string confName,
112 unsigned short subarrayNo=0,
113 carma::util::CorrelatorType type=carma::util::CORR_ALL);
117 bool configurationIsValid(
unsigned short bandNo, std::string confName,
118 unsigned short subarrayNo=0,
119 carma::util::CorrelatorType type=carma::util::CORR_ALL);
123 void clearAstroBandConfiguration(
unsigned short bandNo,
124 unsigned short subarrayNo=0,
125 carma::util::CorrelatorType type=carma::util::CORR_ALL);
129 void assignWalshColumn(SignalPathMapperControl::WalshColumnAssignment wca);
133 void clearWalshColumnAssignment(
unsigned short antNo);
137 carma::switchyard::SwitchPositionSeq*
138 getIFSwitchSettings(
unsigned short astroBandNo);
140 carma::switchyard::SwitchPositionSeq*
141 getLOSwitchSettings(
unsigned short astroBandNo);
143 carma::switchyard::SwitchPositionSeq*
144 getDCLOSwitchSettings(
unsigned short astroBandNo);
146 carma::switchyard::SwitchPositionSeq*
147 getLLSwitchSettings(
unsigned short astroBandNo);
152 getFpgaMode(
unsigned short astroBandNo);
156 SignalPathMapperControl::AntennaSeq*
157 getAntennas(
unsigned short astroBandNo=0);
161 SignalPathMapperControl::PolarizationSeq*
162 getPolarizations(
unsigned short astroBandNo=0);
166 SignalPathMapperControl::BlockDownconverterSettingSeq*
167 getBdcSettings(
unsigned short astroBandNo=0);
171 SignalPathMapperControl::WalshColumnAssignmentSeq*
172 getWalshColumnAssignment(
unsigned short antNo=0);
176 SignalPathMapperControl::CorrelatorBandSeq*
177 getActiveCorrelatorBands(carma::util::CorrelatorType type);
181 SignalPathMapperControl::CorrelatorBandInputSeq*
182 getCorrelatorBandInputMap(SignalPathMapperControl::CorrelatorBand band);
186 SignalPathMapperControl::CorrelatorBandSeq*
187 getCorrelatorBands(
unsigned short astroBandNo);
199 SignalPathMapperControl::CorrelatorCrateSeq*
200 getActiveCorrelatorCrates(carma::util::CorrelatorType type);
204 SignalPathMapperControl::AstroBandSeq*
205 getActiveAstroBands(carma::util::CorrelatorType type);
209 SignalPathMapperControl::AstroBandSeq*
210 getAstroBandsForConfiguration(std::string confName,
211 unsigned short subarrayNo,
212 carma::util::CorrelatorType type);
216 SignalPathMapperControl::CorrelatorCrateInputSeq*
217 getCorrelatorCrateInputMap(SignalPathMapperControl::CorrelatorCrate crate);
222 bool canAssertSwitchPosition(carma::switchyard::SwitchPosition pos);
226 char* queryConfiguration();
230 void checkConfigurationSuccess(
unsigned short astroBandNo);
233 char * getConfName(
unsigned short astroBandNo );
238 short getAstroBandForCorrelatorBand(
unsigned short corrBandNo,
239 carma::util::CorrelatorType type );
243 carma::util::CorrelatorType getCorrTypeForAstroBand(
unsigned short astroBandNo);
253 sza::util::BitMask invalidMask_;
255 std::vector<int> lastModifiedVec_;
257 sza::util::AbsoluteTimer* writeMonitorSystemTimer_;
259 sza::util::PeriodicTimer* checkConfigTimer_;
260 bool checkConfigEnabled_;
262 std::vector<unsigned> savedAstroBands_;
263 std::vector<CorrelatorBandSpec> savedCorrelatorBands_;
265 std::vector<carma::signalpath::SignalPathMapperControlImpl::SwitchyardConfiguration*> knownConfigurations_;
273 carma::monitor::SignalPathSubsystem* msSp_;
278 void initializeMonitorSystemWriter();
279 static ABSOLUTE_TIMER_HANDLER(writeMonitorSystemHandler);
280 void writeMonitorSystemWrapper();
284 void initializeConfigurationChecker();
285 void enableConfigurationChecker(
bool enable);
286 static PERIODIC_TIMER_HANDLER(checkConfigHandler);
288 void checkConfigurationSuccessWrapper(
unsigned short astroBandNo);
289 void checkConfigurationSuccessLocal(
unsigned short astroBandNo,
int frameCount);
291 void addCorrelatorLocal(carma::util::CorrelatorType type,
unsigned short subarrayNo);
293 void removeCorrelatorLocal(carma::util::CorrelatorType type,
unsigned short subarrayNo);
297 void markHardwareConfigurationAsValid(
unsigned short astroBandNo,
bool valid);
300 void clearAstroBandConfigurationLocal(
unsigned short bandNo,
301 unsigned short subarrayNo=0,
302 carma::util::CorrelatorType type=carma::util::CORR_ALL);
305 antType(carma::signalpath::AntennaType type);
308 switchPos(carma::signalpath::SubarrayId);
311 subarrayNumber(carma::signalpath::SubarrayId);
313 carma::signalpath::SubarrayId
314 subarrayId(
unsigned short subarrayNo);
318 carma::util::CorrelatorType
321 MonitorCorrelatorDesignation
324 carma::signalpath::SignalPathMapperControl::PolarizationType
325 polType(carma::signalpath::PolarizationType type);
327 carma::monitor::PolarizationMonitorPointEnum::POLARIZATION
328 msPolType(carma::signalpath::PolarizationType type);
330 carma::monitor::BlockDownconverter::PolarizationMonitorPointEnum::POLARIZATION
333 carma::monitor::BlockDownconverter::PolarizationMonitorPointEnum::POLARIZATION
334 msPolType(carma::signalpath::BlockDownconverterInputType type);
336 carma::monitor::SplitterChannelMonitorPointEnum::SPLITTERCHANNEL
337 msSplitterChannel(carma::signalpath::SplitterChannelId channelId);
339 carma::monitor::ConfTagMonitorPointEnum::CONFTAG
340 msConfTag(std::string name);
342 carma::monitor::ConfTagMonitorPointEnum::CONFTAG
343 msConfTag(carma::signalpath::SignalPathMapperControl::SwitchyardConfiguration confTag);
346 astroBandConfToCorrFpgaMode(std::string swConfName, std::string abConfName);
348 carma::monitor::ControlBandPoints::FpgaModeMonitorPointEnum::FPGAMODE
351 void checkIFSwitchSetting(carma::signalpath::SwitchSetting& swPos);
352 void checkLOSwitchSetting(
unsigned short switchNo,
unsigned short switchPos);
353 void checkDCLOSwitchSetting(carma::signalpath::SwitchSetting& swPos);
354 void checkLLSwitchSetting(
unsigned short switchNo,
unsigned short switchPos);
355 void checkBdcSetting(BlockDownconverterSetting& setting);
357 void checkWalshColumnAssignment(
unsigned antNo,
unsigned walshColNo);
361 void updateMonitorPoints();
363 void updateAstroBandMonitorPoints();
364 void clearAstroBandMonitorPoints();
366 void updateCorrBandMonitorPoints();
367 void clearCorrBandMonitorPoints();
370 void updateIFSwitchMonitorPoints();
371 void clearIFSwitchMonitorPoints();
373 void updateAntennaMonitorPoints();
374 void clearAntennaMonitorPoints();
376 void updateSubarrayMonitorPoints();
377 void clearSubarrayMonitorPoints();
381 std::vector<carma::signalpath::SwitchSetting>
382 getDCLOSwitchSettingsLocal(
unsigned short astroBandNo);
385 void saveCurrentConfiguration(
unsigned astroBandNo, carma::util::CorrelatorType type);
388 void markSavedConfigurationAsModified(
int frameCount);
390 void markAstroBandAsModified(
unsigned astroBandNo,
int frameCount);
391 void markCorrelatorBandAsModified(CorrelatorBandSpec& band,
int frameCount);
393 std::vector<unsigned>
394 getActiveAstroBands(
unsigned astroBandNo, carma::util::CorrelatorType type);
396 std::vector<CorrelatorBandSpec>
397 getActiveCorrelatorBands(
unsigned astroBandNo, carma::util::CorrelatorType type);
sequence< short > SeqShort
Sequence of CORBA::Short.
Polarization
Polarization input selector.
Tagged: Tue Mar 6 16:39:02 PST 2012.
CorrelatorFpgaModeType
FPGA configuration modes.
The monitor system base class.
The monitor system for the Control subsystem.
Tagged: Tue Feb 2 14:45:04 NZDT 2010.
Tagged: Wed Nov 24 09:41:29 PST 2010.
A class to encapsulate the switchyard cable map.
CorrelatorType
Enum to encapsulate a correlator type. These.
AntennaType
Enumeration of possible types for antennas.
A simple wrapper class that makes use of ::pthread_mutex_t easier in a C++ world. ...
Tagged: Wed May 12 09:30:13 PDT 2004.