diff --git a/LCS/ApplCommon/src/Observation.cc b/LCS/ApplCommon/src/Observation.cc index eeabd57aa1967f6a11a97acb41e3ba504d966a4a..52db959bc9861d5e57eba6586bb2652153563bc7 100644 --- a/LCS/ApplCommon/src/Observation.cc +++ b/LCS/ApplCommon/src/Observation.cc @@ -298,7 +298,7 @@ bitset<MAX_RCUS> Observation::getRCUbitset(int nrLBAs, int nrHBAs, int nrRSPs, b { #define MAX2(a,b) ((a) > (b) ? (a) : (b)) - if (antennaSet.empty()) { // old ParameterSet? + if (antennaSet.empty() || ((nrLBAs+nrHBAs+nrRSPs) == 0)) { // old ParameterSet or force no interpretation? return (RCUset); // return old info. } diff --git a/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc b/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc index bcd27149b90909eb1d09ccf3e69900b9a50bbce9..acff4e8dd75a3022a214b5b675d339563432ea72 100644 --- a/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc +++ b/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc @@ -238,9 +238,13 @@ GCFEvent::TResult ObsClaimer::preparePVSS_state (GCFEvent& event, GCFPortInterfa theObsPS->setValue(PN_OBS_BGL_NODE_LIST, GCFPVString (theObs.BGLNodeList), 0.0, false); theObsPS->setValue(PN_OBS_STORAGE_NODE_LIST,GCFPVString (theObs.storageNodeList), 0.0, false); +#if defined(THERE_IS_NO_REMOTE_STATION_CONFIG_ON_MCU001) // the receiver bitmap can be derived from the RCUset. StationConfig config; bitset<MAX_RCUS> theRCUs(theObs.getRCUbitset(config.nrLBAs, config.nrHBAs, config.nrRSPs, config.hasSplitters)); +#endif + // TODO: this code should be moved to the StationController + bitset<MAX_RCUS> theRCUs(theObs.getRCUbitset(96, 48, 12, true)); string rbm; rbm.resize(MAX_RCUS, '0'); for (int i = 0; i < MAX_RCUS; i++) { diff --git a/MAC/APL/StationCU/src/StationControl/ActiveObs.cc b/MAC/APL/StationCU/src/StationControl/ActiveObs.cc index 585fcd9a39e4de0bf5ce275653deec075b0ad2ef..a4efe77922bf4915b6437bc1310524eef55f8185 100644 --- a/MAC/APL/StationCU/src/StationControl/ActiveObs.cc +++ b/MAC/APL/StationCU/src/StationControl/ActiveObs.cc @@ -31,6 +31,8 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/SystemUtil.h> +#include <ApplCommon/StationConfig.h> +#include <GCF/PVSS/GCF_PVTypes.h> #include <GCF/TM/GCF_Protocols.h> #include <APL/APLCommon/ChildControl.h> #include <APL/APLCommon/ControllerDefines.h> @@ -43,6 +45,7 @@ namespace LOFAR { using namespace APLCommon; using namespace MACIO; using namespace GCF::TM; + using namespace GCF::PVSS; using namespace GCF::RTDB; namespace StationCU { @@ -166,6 +169,22 @@ GCFEvent::TResult ActiveObs::starting(GCFEvent& event, GCFPortInterface& port) switch (event.signal) { case F_ENTRY: { + // first make a mapping of the receivers that are used. + // the StationController already modified the set to reflect the available receivers + // So askfor this 'core' set by passed zeros. + // the receiver bitmap can be derived from the RCUset. + StationConfig config; + bitset<MAX_RCUS> theRCUs(itsObsPar.getRCUbitset(0, 0, 0, config.hasSplitters)); + string rbm; + rbm.resize(MAX_RCUS, '0'); + for (int i = 0; i < MAX_RCUS; i++) { + if (theRCUs[i]) { + rbm[i] = '1'; + } + } + itsPropertySet->setValue(PN_OBS_RECEIVER_BITMAP,GCFPVString (rbm), 0.0, false); + + // Startup the right controllers. itsReqState = CTState::CREATED; LOG_DEBUG_STR("Starting controller " << itsCalCntlrName); ChildControl::instance()->startChild(CNTLRTYPE_CALIBRATIONCTRL, diff --git a/MAC/APL/StationCU/src/StationControl/StationControl.cc b/MAC/APL/StationCU/src/StationControl/StationControl.cc index 62d5a0b37098071f554e994fc0ff404a1b50b055..63d89cdaca189300b8b6058e9859bf09bae2c79a 100644 --- a/MAC/APL/StationCU/src/StationControl/StationControl.cc +++ b/MAC/APL/StationCU/src/StationControl/StationControl.cc @@ -1069,6 +1069,7 @@ LOG_DEBUG_STR("theOBS=" << theObs); LOG_INFO_STR("Available receivers for observation " << theObs.obsID << ":" << string(realReceivers.to_string<char,char_traits<char>,allocator<char> >())); + // create an activeObservation object that will manage the child controllers. ActiveObs* theNewObs = new ActiveObs(name, (State)&ActiveObs::initial, &theObsPS, *this); if (!theNewObs) {