diff --git a/.gitattributes b/.gitattributes index 1248179f7873e9cfa1846b6416dca9e46d2bbfc0..880a726760a2e7070d825bf44f73453b6b09fb73 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1352,14 +1352,11 @@ MAC/Deployment/data/StaticMetaData/AntennaFields/CS004-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS005-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS006-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS007-AntennaField.conf -text -MAC/Deployment/data/StaticMetaData/AntennaFields/CS011-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS017-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS021-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS024-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS026-AntennaField.conf -text -MAC/Deployment/data/StaticMetaData/AntennaFields/CS028-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS030-AntennaField.conf -text -MAC/Deployment/data/StaticMetaData/AntennaFields/CS031-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS032-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS101-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS103-AntennaField.conf -text @@ -1369,17 +1366,13 @@ MAC/Deployment/data/StaticMetaData/AntennaFields/CS302-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS401-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/CS501-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/DE601-AntennaField.conf -text -MAC/Deployment/data/StaticMetaData/AntennaFields/DE602-AntennaField.conf -text -MAC/Deployment/data/StaticMetaData/AntennaFields/DE603-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/DE604-AntennaField.conf -text -MAC/Deployment/data/StaticMetaData/AntennaFields/DE605-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/FR606-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS106-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS205-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS208-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS306-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS307-AntennaField.conf -text -MAC/Deployment/data/StaticMetaData/AntennaFields/RS406-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS503-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/RS509-AntennaField.conf -text MAC/Deployment/data/StaticMetaData/AntennaFields/UK608-AntennaField.conf -text @@ -1435,6 +1428,7 @@ MAC/Deployment/data/StaticMetaData/CalTables/CalTable_024_mode3.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_024_mode5.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_024_mode6.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_024_mode7.dat -text +MAC/Deployment/data/StaticMetaData/CalTables/CalTable_026_mode1.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_026_mode3.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_026_mode5.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_026_mode6.dat -text @@ -1495,6 +1489,7 @@ MAC/Deployment/data/StaticMetaData/CalTables/CalTable_401_mode7.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_501_mode1.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_501_mode3.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_503_mode1.dat -text +MAC/Deployment/data/StaticMetaData/CalTables/CalTable_503_mode3.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_503_mode5.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_503_mode6.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_503_mode7.dat -text @@ -1502,7 +1497,11 @@ MAC/Deployment/data/StaticMetaData/CalTables/CalTable_601_mode3.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_601_mode5.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_601_mode7.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_602_mode3.dat -text +MAC/Deployment/data/StaticMetaData/CalTables/CalTable_603_mode3.dat -text +MAC/Deployment/data/StaticMetaData/CalTables/CalTable_603_mode5.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_603_mode6.dat -text +MAC/Deployment/data/StaticMetaData/CalTables/CalTable_606_mode3.dat -text +MAC/Deployment/data/StaticMetaData/CalTables/CalTable_606_mode5.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_608_mode3.dat -text MAC/Deployment/data/StaticMetaData/CalTables/CalTable_608_mode5.dat -text MAC/Deployment/data/StaticMetaData/ControlInfo.dat -text @@ -1532,28 +1531,22 @@ MAC/Deployment/data/StaticMetaData/iHBADeltas/CS004-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS005-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS006-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS007-iHBADeltas.conf -text -MAC/Deployment/data/StaticMetaData/iHBADeltas/CS011-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS021-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS024-iHBADeltas.conf -text -MAC/Deployment/data/StaticMetaData/iHBADeltas/CS028-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS030-iHBADeltas.conf -text -MAC/Deployment/data/StaticMetaData/iHBADeltas/CS031-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS103-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS301-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS302-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/CS401-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/DE601-iHBADeltas.conf -text -MAC/Deployment/data/StaticMetaData/iHBADeltas/DE602-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/DE603-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/DE604-iHBADeltas.conf -text -MAC/Deployment/data/StaticMetaData/iHBADeltas/DE605-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/FR606-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS106-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS205-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS208-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS306-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS307-iHBADeltas.conf -text -MAC/Deployment/data/StaticMetaData/iHBADeltas/RS406-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS503-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/RS509-iHBADeltas.conf -text MAC/Deployment/data/StaticMetaData/iHBADeltas/UK608-iHBADeltas.conf -text @@ -2041,6 +2034,7 @@ MAC/_System/lofar29.journal -text svneol=native#application/octet-stream MAC/_System/lofar29.sysconf -text svneol=native#application/octet-stream MAC/_System/lofar30.journal -text svneol=native#application/octet-stream MAC/_System/lofar30.sysconf -text svneol=native#application/octet-stream +/RELEASE_NOTES -text RTCP/CNProc/src/ArenaMapping.h -text RTCP/CNProc/src/AsyncTransposeBeams.cc -text RTCP/CNProc/src/AsyncTransposeBeams.h -text diff --git a/MAC/APL/APLCommon/src/AntennaField.cc b/MAC/APL/APLCommon/src/AntennaField.cc index a5f493d5d279882d4c205989ce76dcdfd8eb5761..0ec05b3190c902de2b449ee8f8ab193888fb1b96 100644 --- a/MAC/APL/APLCommon/src/AntennaField.cc +++ b/MAC/APL/APLCommon/src/AntennaField.cc @@ -80,7 +80,7 @@ AntennaField::AntennaField(const string& filename) ifstream inputStream; inputStream.open(fullFilename.c_str()); - ASSERTSTR(inputStream.good(), "File " << fullFilename << " cannot be opened succesfully."); + ASSERTSTR(inputStream.good(), "File :" << fullFilename << " (extracted from: " << filename << ") cannot be opened succesfully."); // reserve space for expected info. itsAntPos.resize(MAX_FIELDS); diff --git a/MAC/APL/APLCommon/src/ChildControl.cc b/MAC/APL/APLCommon/src/ChildControl.cc index bad917a9220672956d0d03d65cbcf76b46897551..d3c356385f83a224860c659227e97cd8576770b8 100644 --- a/MAC/APL/APLCommon/src/ChildControl.cc +++ b/MAC/APL/APLCommon/src/ChildControl.cc @@ -83,7 +83,7 @@ ChildControl::ChildControl() : getInt32("ChildControl.StartupRetryInterval"); } if (globalParameterSet()->isDefined("ChildControl.MaxStartupRetries")) { - itsStartupRetryInterval = globalParameterSet()-> + itsMaxStartupRetries = globalParameterSet()-> getInt32("ChildControl.MaxStartupRetries"); } if (globalParameterSet()->isDefined("ChildControl.GarbageCollectionInterval")) { @@ -936,25 +936,25 @@ void ChildControl::_doGarbageCollection() const_CIiter end = itsCntlrList->end(); while (iter != end) { // Note: Removing a controller is done in two stages. - // 1: port == 0: inform main task about removal + // 1: port == 0: inform main task about removal after retry interval expired // 2: port == -1: remove from list // This is necc. because main task may poll childcontrol for results. if (!iter->port) { - LOG_DEBUG_STR ("Controller " << iter->cntlrName << - " is still unreachable, informing main task"); - _setEstablishedState(iter->cntlrName, CTState::QUITED, time(0), - CT_RESULT_LOST_CONNECTION); - iter->port = (GCFPortInterface*) -1; - // start timer for second stage. - if (itsGarbageTimer) { - itsTimerPort.cancelTimer(itsGarbageTimer); + LOG_DEBUG_STR(time(0)<<"-"<<iter->requestTime<<">="<<itsStartupRetryInterval<<"*"<<itsMaxStartupRetries<<"?"); + if ((uint32(time(0)-iter->requestTime)) >= itsStartupRetryInterval*itsMaxStartupRetries) { + LOG_DEBUG_STR ("Controller " << iter->cntlrName << " is still unreachable, informing main task"); + _setEstablishedState(iter->cntlrName, CTState::QUITED, time(0), CT_RESULT_LOST_CONNECTION); + iter->port = (GCFPortInterface*) -1; + // start timer for second stage. + if (itsGarbageTimer) { + itsTimerPort.cancelTimer(itsGarbageTimer); + } + itsGarbageTimer = itsTimerPort.setTimer(1.0 * itsGarbageInterval); + LOG_DEBUG_STR("GarbageTimer = " << itsGarbageTimer); } - itsGarbageTimer = itsTimerPort.setTimer(1.0 * itsGarbageInterval); - LOG_DEBUG_STR("GarbageTimer = " << itsGarbageTimer); iter++; } else if (iter->port == (GCFPortInterface*)-1) { - LOG_DEBUG_STR ("Removing controller " << iter->cntlrName << - " from the controller list"); + LOG_DEBUG_STR ("Removing controller " << iter->cntlrName << " from the controller list"); CIiter iterCopy = iter; iter++; itsCntlrList->erase(iterCopy); diff --git a/MAC/APL/APLCommon/src/ParentControl.cc b/MAC/APL/APLCommon/src/ParentControl.cc index 33eb87f71a1ff781b803428dd0d1fcee7bfcb101..448aab84b75cc3bad33505c279571fce96602c58 100644 --- a/MAC/APL/APLCommon/src/ParentControl.cc +++ b/MAC/APL/APLCommon/src/ParentControl.cc @@ -192,7 +192,7 @@ bool ParentControl::activateObservationTimers(const string& cntlrName, // >0 <0 stopTime < startTime, captured above // <0 >0 obs should be running by now!! // <0 <0 obs is over! - if (stopDiff.seconds() < 0) { + if (stopDiff.total_seconds() < 0) { LOG_ERROR("Stoptime is already past! Shutting down controller."); parent->requestedState = CTState::QUITED; parent->requestTime = time(0); @@ -200,7 +200,7 @@ bool ParentControl::activateObservationTimers(const string& cntlrName, return (false); } - if (startDiff.seconds() < 0) { + if (startDiff.total_seconds() < 0) { LOG_WARN("Observation should have been started, going to start-state a.s.a.p."); parent->requestedState = CTState::RESUMED; parent->requestTime = time(0); @@ -209,16 +209,16 @@ bool ParentControl::activateObservationTimers(const string& cntlrName, // set or reset the real timers. itsTimerPort.cancelTimer(parent->startTimer); - if (startDiff.seconds() > 0) { - parent->startTimer = itsTimerPort.setTimer((double)startDiff.seconds()); + if (startDiff.total_seconds() > 0) { + parent->startTimer = itsTimerPort.setTimer((double)startDiff.total_seconds()); } else { parent->startTimer = 0; } itsTimerPort.cancelTimer(parent->stopTimer); - if (stopDiff.seconds() > 0) { - parent->stopTimer = itsTimerPort.setTimer((double)stopDiff.seconds()); + if (stopDiff.total_seconds() > 0) { + parent->stopTimer = itsTimerPort.setTimer((double)stopDiff.total_seconds()); } else { parent->stopTimer = 0; diff --git a/MAC/APL/APLCommon/src/swlevel.conf b/MAC/APL/APLCommon/src/swlevel.conf index 6b91a3e9adcb08fac363e52067af43419c88a042..9f351873fae73412961c8db1c2fc3a71e13620ff 100644 --- a/MAC/APL/APLCommon/src/swlevel.conf +++ b/MAC/APL/APLCommon/src/swlevel.conf @@ -30,7 +30,7 @@ 6::d:::ObservationControl 6::d:::OnlineControl 6:u:d:::StationControl -6::d:::ClockControl +6:u:d:::ClockControl 6::d:::CalibrationControl 6::d:::BeamControl 6::d:::TBBControl diff --git a/MAC/APL/CASATools/src/CasaConverter.cc b/MAC/APL/CASATools/src/CasaConverter.cc index 5bacc089d408df6794f2f65714fe14c446e4a24f..0998eaf49bfe03278404716c0bac7ce4a3776445 100644 --- a/MAC/APL/CASATools/src/CasaConverter.cc +++ b/MAC/APL/CASATools/src/CasaConverter.cc @@ -42,7 +42,8 @@ using namespace casa; using namespace blitz; using namespace RTC; -static const char* supportedTypes[] = { "J2000", "ITRF", "B1950", "AZEL", +static const char* supportedTypes[] = { "J2000", "ITRF", "B1950", "HADEC", "AZELGEO", "TOPO", "ICRS", + "APP", "GALACTIC", "ECLIPTIC", "COMET", "MERCURY", "VENUS", "MARS", "JUPITER", "SATURN", "URANUS", "NEPTUNE", "PLUTO", "SUN", "MOON", "" }; diff --git a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc index 5e0068855d5be56dc9cdb3a4ff78743823e83d84..92acc6dc139a31465863c86c3d70e8babe6f09e0 100644 --- a/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc +++ b/MAC/APL/CURTDBDaemons/src/SoftwareMonitor/SoftwareMonitor.cc @@ -313,18 +313,20 @@ GCFEvent::TResult SoftwareMonitor::checkPrograms(GCFEvent& event, GCFPortInterfa else { // proc is not in our obsProcList, do we know this observation?? int obsID = _solveObservationID(cpIter->second); - obsMap_t::iterator obsIter = itsObsMap.find(obsID); - if (obsIter == itsObsMap.end()) { // new observationID? - itsClaimMgrTask->claimObject("Observation", observationName(obsID), port); // ask claim manager - break; // process this later. - } - else { // obsID is known but proces not (strange), just add it. - Process newProc(llIter->name, obsIter->second.DPname+"_"+llIter->name, obsID, llIter->level); - newProc.pid = cpIter->second; - itsObsProcs.push_back(newProc); - LOG_DEBUG_STR("new unknown process for obs: " << obsID << ":" << llIter->name); - _updateProcess(_searchObsProcess(newProc.pid), newProc.pid, curLevel); - } + if (obsID) { + obsMap_t::iterator obsIter = itsObsMap.find(obsID); + if (obsIter == itsObsMap.end()) { // new observationID? + itsClaimMgrTask->claimObject("Observation", "LOFAR_ObsSW_" + observationName(obsID), port); // ask claim manager + break; // process this later. + } + else { // obsID is known but proces not (strange), just add it. + Process newProc(llIter->name, obsIter->second.DPname+"_"+llIter->name, obsID, llIter->level); + newProc.pid = cpIter->second; + itsObsProcs.push_back(newProc); + LOG_DEBUG_STR("new unknown process for obs: " << obsID << ":" << llIter->name); + _updateProcess(_searchObsProcess(newProc.pid), newProc.pid, curLevel); + } + } // obsID != 0 } // process (not) in ObsProcList } // process is obs-bound llIter++; @@ -650,14 +652,17 @@ int SoftwareMonitor::_solveObservationID(int pid) if (obsPos) { int obsID = 0; sscanf (obsPos, "Observation%d%*s", &obsID); + if (!obsID) { + LOG_WARN_STR("ObservationNr=0 in cmdline: " << buffer); + } return (obsID); } - LOG_DEBUG_STR("No observationID found in:" << buffer); + LOG_WARN_STR("No observationID found in:" << buffer); } close(fd); } - LOG_DEBUG_STR("No observationId found for process " << pid); + LOG_WARN_STR("No observationId found for process " << pid); return (0); } diff --git a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc index 3cde24c3593ce40b19004fa64c6d32516b4fcb07..8f0493db8ad2c97bd0acfafb6a3e9c5064827a60 100644 --- a/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc +++ b/MAC/APL/MainCU/src/MACScheduler/MACScheduler.cc @@ -86,6 +86,9 @@ MACScheduler::MACScheduler() : // Read the schedule periods for starting observations. itsQueuePeriod = globalParameterSet()->getTime("QueuePeriod"); itsClaimPeriod = globalParameterSet()->getTime("ClaimPeriod"); + LOG_INFO_STR("Queueperiod = " << itsQueuePeriod << ", claimperiod = " << itsClaimPeriod); + ASSERTSTR(itsQueuePeriod > itsClaimPeriod, + "QueuePeriod must be longer than ClaimPeriod otherwise there is no time for the preparePeriod"); // attach to child control task itsChildControl = ChildControl::instance(); @@ -584,12 +587,21 @@ void MACScheduler::_updatePlannedList() vector<OTDBtree> plannedDBlist = itsOTDBconnection->getTreeGroup(1, itsPlannedPeriod); // planned observations if (!plannedDBlist.empty()) { - LOG_DEBUG(formatString("OTDBCheck:First planned observation (%d) is at %s (over %d seconds)", + LOG_DEBUG(formatString("OTDBCheck:First planned observation (%d) is at %s (active over %d seconds)", plannedDBlist[0].treeID(), to_simple_string(plannedDBlist[0].starttime).c_str(), - time_duration(plannedDBlist[0].starttime - currentTime))); + time_duration(plannedDBlist[0].starttime - currentTime).total_seconds())); } // NOTE: do not exit routine on emptylist: we need to write an empty list to clear the DB + // make a copy of the current prepared observations (= observations shown in the navigator in the 'future' + // list). By eliminating the observations that are in the current SAS list we end up (at the end of this function) + // with a list of observations that were in the SASlist the last time but now not anymore. Normally those observations + // will appear in the active-list and will be removed there from the prepared list but WHEN AN OPERATOR CHANGES + // THE STATUS MANUALLY into something different (e.g. ON-HOLD) the observation stays in the preparedlist. + // EVEN WORSE: when the observation re-enters the system with different settings (again as scheduled) the system + // still knows the observation and will use the OLD information of the observation. + ObsList backupObsList = itsPreparedObs; + // walk through the list, prepare PVSS for the new obs, update own admin lists. GCFPValueArray plannedArr; uint32 listSize = plannedDBlist.size(); @@ -600,6 +612,12 @@ void MACScheduler::_updatePlannedList() treeIDType obsID = plannedDBlist[idx].treeID(); string obsName(observationName(obsID)); + // remove obs from backup of the planned-list (it is in the list again) + OLiter oldObsIter = backupObsList.find(obsID); + if (oldObsIter != backupObsList.end()) { + backupObsList.erase(oldObsIter); + } + // must we claim this observation at the claimMgr? OLiter prepIter = itsPreparedObs.find(obsID); if ((prepIter == itsPreparedObs.end()) || (prepIter->second == false)) { @@ -625,9 +643,9 @@ void MACScheduler::_updatePlannedList() } // should this observation (have) be(en) started? - time_duration timeBeforeStart(plannedDBlist[idx].starttime - currentTime); -// LOG_TRACE_VAR_STR(obsName << " starts over " << timeBeforeStart << " seconds"); - if (timeBeforeStart > seconds(0) && timeBeforeStart <= seconds(itsQueuePeriod)) { + int timeBeforeStart = time_duration(plannedDBlist[idx].starttime - currentTime).total_seconds(); +// LOG_DEBUG_STR(obsName << " starts over " << timeBeforeStart << " seconds"); + if (timeBeforeStart > 0 && timeBeforeStart <= (int)itsQueuePeriod) { if (itsPreparedObs[obsID] == false) { LOG_ERROR_STR("Observation " << obsID << " must be started but is not claimed yet."); } @@ -637,16 +655,21 @@ void MACScheduler::_updatePlannedList() // Note: as soon as the ObservationController has reported itself to the MACScheduler // the observation will not be returned in the 'plannedDBlist' anymore. string cntlrName(controllerName(CNTLRTYPE_OBSERVATIONCTRL, 0, obsID)); - LOG_DEBUG_STR("Requesting start of " << cntlrName); - itsChildControl->startChild(CNTLRTYPE_OBSERVATIONCTRL, - obsID, - 0, // instanceNr - myHostname(true)); - // Note: controller is now in state NO_STATE/CONNECTED (C/R) - - // add controller to our 'monitor' administration - itsControllerMap[cntlrName] = obsID; - LOG_DEBUG_STR("itsControllerMap[" << cntlrName << "]=" << obsID); + if (itsControllerMap.find(cntlrName) == itsControllerMap.end()) { + LOG_DEBUG_STR("Requesting start of " << cntlrName); + itsChildControl->startChild(CNTLRTYPE_OBSERVATIONCTRL, + obsID, + 0, // instanceNr + myHostname(true)); + // Note: controller is now in state NO_STATE/CONNECTED (C/R) + + // add controller to our 'monitor' administration + itsControllerMap[cntlrName] = obsID; + LOG_DEBUG_STR("itsControllerMap[" << cntlrName << "]=" << obsID); + } + else { + LOG_DEBUG_STR("Observation " << obsID << " is already (being) started"); + } } } idx++; @@ -655,6 +678,18 @@ void MACScheduler::_updatePlannedList() // Finally we can pass the list with planned observations to PVSS. itsPropertySet->setValue(PN_MS_PLANNED_OBSERVATIONS, GCFPVDynArr(LPT_DYNSTRING, plannedArr)); + // the backupObsList now contains the observations that were are in the preparedObs list but are not in + // the SAS list anymore. Remove them here from the preparedObs list. + OLiter oldObsIter = backupObsList.begin(); + OLiter prepIter; + while (oldObsIter != backupObsList.end()) { + prepIter = itsPreparedObs.find(oldObsIter->first); + if (prepIter != itsPreparedObs.end()) { + LOG_INFO_STR("Removing " << oldObsIter->first << " from the prepared list."); + itsPreparedObs.erase(prepIter); + } + oldObsIter++; + } } // @@ -719,8 +754,7 @@ void MACScheduler::_updateFinishedList() } // while // Finally we can pass the list with finished observations to PVSS. - itsPropertySet->setValue(PN_MS_FINISHED_OBSERVATIONS, - GCFPVDynArr(LPT_DYNSTRING, finishedArr)); + itsPropertySet->setValue(PN_MS_FINISHED_OBSERVATIONS, GCFPVDynArr(LPT_DYNSTRING, finishedArr)); } diff --git a/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc b/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc index b6dc7e382677cda81ec8f5109fac1ac9d87e8ced..0392d0c8acf43a38d4ce9c04e017042be829ea96 100644 --- a/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc +++ b/MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc @@ -158,6 +158,12 @@ GCFEvent::TResult ObsClaimer::idle_state (GCFEvent& event, GCFPortInterface& por case CM_CLAIM_RESULT: { CMClaimResultEvent cmEvent(event); + if (cmEvent.DPname.empty()) { + LOG_ERROR_STR("No datapoint returned for " << cmEvent.nameInAppl); + TRAN(ObsClaimer::idle_state); + break; + } + LOG_INFO_STR(cmEvent.nameInAppl << " is mapped to " << cmEvent.DPname); OMiter iter = itsObsMap.find(cmEvent.nameInAppl); // ASSERTSTR(iter != itsObsMap.end(), "Cannot find " << cmEvent.nameInAppl << " in admin"); diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc index 56d5dbc02c246e90bc92a787c4de1f66607ea180..d952e65fdbb35c97105c9dc9c0dd4a36d35314e3 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc @@ -310,9 +310,16 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter break; case F_ENTRY: { - // convert times and periods to timersettings. + // do some bookkeeping itsChildControl->startChildControllers(); itsNrControllers = itsChildControl->countChilds(0, CNTLRTYPE_NO_TYPE); + itsNrStations = itsChildControl->countChilds(0, CNTLRTYPE_STATIONCTRL); + itsNrOnlineCtrls = itsChildControl->countChilds(0, CNTLRTYPE_ONLINECTRL); + itsNrOfflineCtrls= itsChildControl->countChilds(0, CNTLRTYPE_OFFLINECTRL); + LOG_INFO(formatString ("Controlling: %d stations, %d onlinectrl, %d offlinectrl, %d unknown ctrl", + itsNrStations, itsNrOnlineCtrls, itsNrOfflineCtrls, + itsNrControllers-itsNrStations-itsNrOnlineCtrls-itsNrOfflineCtrls)); + // convert times and periods to timersettings. setObservationTimers(); itsHeartBeatTimer = itsTimerPort->setTimer(1.0 * itsHeartBeatItv); break; @@ -387,6 +394,9 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter } // -------------------- EVENT RECEIVED FROM PARENT CONTROL -------------------- + case CONTROL_CONNECT: + LOG_INFO("Opening connection with parent controller"); + break; case CONTROL_QUIT: { LOG_INFO("Received manual request for shutdown, accepting it."); itsTimerPort->cancelTimer(itsStopTimer); // cancel old timer @@ -450,6 +460,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter LOG_DEBUG_STR("Received CLAIMED(" << msg.cntlrName << "):" << msg.result); itsChildResult |= msg.result; itsChildsInError += (msg.result == CT_RESULT_NO_ERROR) ? 0 : 1; + itsBusyControllers--; // [15122010] see note in doHeartBeatTask! doHeartBeatTask(); break; } @@ -459,6 +470,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter LOG_DEBUG_STR("Received PREPARED(" << msg.cntlrName << "):" << msg.result); itsChildResult |= msg.result; itsChildsInError += (msg.result == CT_RESULT_NO_ERROR) ? 0 : 1; + itsBusyControllers--; // [15122010] see note in doHeartBeatTask! doHeartBeatTask(); break; } @@ -468,6 +480,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter LOG_DEBUG_STR("Received RESUMED(" << msg.cntlrName << "):" << msg.result); itsChildResult |= msg.result; itsChildsInError += (msg.result == CT_RESULT_NO_ERROR) ? 0 : 1; + itsBusyControllers--; // [15122010] see note in doHeartBeatTask! doHeartBeatTask(); break; } @@ -477,6 +490,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter LOG_DEBUG_STR("Received SUSPENDED(" << msg.cntlrName << "):" << msg.result); itsChildResult |= msg.result; itsChildsInError += (msg.result == CT_RESULT_NO_ERROR) ? 0 : 1; + itsBusyControllers--; // [15122010] see note in doHeartBeatTask! doHeartBeatTask(); break; } @@ -486,6 +500,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter LOG_DEBUG_STR("Received RELEASED(" << msg.cntlrName << "):" << msg.result); itsChildResult |= msg.result; itsChildsInError += (msg.result == CT_RESULT_NO_ERROR) ? 0 : 1; + itsBusyControllers--; // [15122010] see note in doHeartBeatTask! doHeartBeatTask(); break; } @@ -495,6 +510,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter LOG_DEBUG_STR("Received QUITED(" << msg.cntlrName << "):" << msg.result); itsChildResult |= msg.result; itsChildsInError += (msg.result == CT_RESULT_NO_ERROR) ? 0 : 1; + itsBusyControllers--; // [15122010] see note in doHeartBeatTask! doHeartBeatTask(); break; } @@ -685,6 +701,17 @@ void ObservationControl::doHeartBeatTask() } } +#if 1 + // NOTE: [15122010] Sending respons when first child reached required state. + // NOTE: [15122010] WHEN nrChilds = 1 EACH TIME WE COME HERE A REPLY IS SENT!!!!! + if (itsBusyControllers == nrChilds-1) { // first reply received? + CTState cts; // report that state is reached. + LOG_INFO_STR("First controller reached required state " << cts.name(cts.stateAck(itsState)) << + ", informing SAS although it is too early!"); + sendControlResult(*itsParentPort, cts.signal(cts.stateAck(itsState)), getName(), CT_RESULT_NO_ERROR); + } +#endif + LOG_TRACE_FLOW_STR("itsBusyControllers=" << itsBusyControllers); // all controllers up to date? @@ -695,7 +722,11 @@ void ObservationControl::doHeartBeatTask() TRAN(ObservationControl::finishing_state); return; } - +#if 0 + // NOTE: [15122010] When one (or more) stations fail the reach the new state the state is not + // reported back to the MACScheduler, hence SAS is not updated... + // For now we send the acknowledge as soon as the first child reaches the desired state. + // See related code-changes in statemachine active_state. if (itsBusyControllers) { // last time NOT all cntrls ready? CTState cts; // report that state is reached. setState(cts.stateAck(itsState)); @@ -704,6 +735,7 @@ void ObservationControl::doHeartBeatTask() sendControlResult(*itsParentPort, cts.signal(itsState), getName(), itsChildResult); } +#endif return; } diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h index 7c768928583bac6fe244d3ac68bf3ac9f7b3fabd..afd24f6f56e7d0fe589fce63b55afa3d26cd8cdf 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h @@ -117,6 +117,9 @@ private: GCFTimerPort* itsTimerPort; CTState::CTstateNr itsState; + uint32 itsNrStations; + uint32 itsNrOnlineCtrls; + uint32 itsNrOfflineCtrls; uint32 itsNrControllers; uint32 itsBusyControllers; uint16 itsChildResult; diff --git a/MAC/APL/PAC/Cal_Server/src/CalServer.conf.in b/MAC/APL/PAC/Cal_Server/src/CalServer.conf.in index 309794c24fb0bf9b1924920ce3a794acc7f96aaf..b5922963d375e788914061a1bbb885eb514b3e83 100644 --- a/MAC/APL/PAC/Cal_Server/src/CalServer.conf.in +++ b/MAC/APL/PAC/Cal_Server/src/CalServer.conf.in @@ -25,7 +25,7 @@ CalServer.ACCTestFile=ACC.txt # to clients. # For now the normal operation is DisableCalibration=1 and DisableACMProxy=0 CalServer.DisableCalibration=1 -CalServer.DisableACMProxy=0 +CalServer.DisableACMProxy=1 # ----- Flags to produce interim data files for debugging ----- diff --git a/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc b/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc index a51b2d0dfebd5d1436c9706465279d4e2a99764b..9992f8f4aba2c007c7646f48cc22ba7823847cc8 100644 --- a/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc +++ b/MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc @@ -1456,7 +1456,7 @@ void BeamServer::compute_weights(Timestamp weightTime) blitz::Array<double,2> curPoint(1,2); // [1, angles] curPoint(0,0) = currentPointing.angle0(); curPoint(0,1) = currentPointing.angle1(); - LOG_DEBUG_STR("current pointing for beam " << beamIter->second->name() << ":" << currentPointing); + LOG_INFO_STR("current pointing for beam " << beamIter->second->name() << ":" << currentPointing); if (!itsJ2000Converter->doConversion(currentPointing.getType(), curPoint, fieldCentreITRF, weightTime, sourceJ2000xyz)) { LOG_FATAL_STR("Conversion of source to J2000 failed"); continue; diff --git a/MAC/APL/PIC/RSP_Protocol/src/CMakeLists.txt b/MAC/APL/PIC/RSP_Protocol/src/CMakeLists.txt index b7489c6878aa2d440c91199718913a765c243c25..8389fd1bafbc7be98cc25b45bc229d37aec29c90 100644 --- a/MAC/APL/PIC/RSP_Protocol/src/CMakeLists.txt +++ b/MAC/APL/PIC/RSP_Protocol/src/CMakeLists.txt @@ -6,7 +6,6 @@ include(LofarPackageVersion) include(MACAddProtocol) mac_add_protocol(EPA_Protocol "${MACIO_SOURCE_DIR}/autogen") mac_add_protocol(RSP_Protocol "${MACIO_SOURCE_DIR}/autogen") -mac_add_protocol(RSPFE_Protocol "${MACIO_SOURCE_DIR}/autogen") # Add the directory where the generated C++ headers are stored to the -I path. include_directories(${CMAKE_BINARY_DIR}/include/MAC) @@ -15,11 +14,11 @@ lofar_add_library(rsp_protocol Package__Version.cc EPA_Protocol.cc RSP_Protocol.cc - RSPFE_Protocol.cc AllRegisterState.cc BeamletWeights.cc BypassSettings.cc HBASettings.cc + Latency.cc MEPHeader.cc MEPData.cc RCUSettings.cc @@ -32,7 +31,6 @@ lofar_add_library(rsp_protocol TDStatus.cc Versions.cc WGSettings.cc - XCStatistics.cc - Latency.cc) + XCStatistics.cc) lofar_add_bin_program(versionrsp_protocol versionrsp_protocol.cc) diff --git a/MAC/APL/PIC/RSP_Protocol/src/RSPFE_Protocol.prot b/MAC/APL/PIC/RSP_Protocol/src/RSPFE_Protocol.prot deleted file mode 100644 index 245f7fc223a961d52a5b35ee2660c56b18919aef..0000000000000000000000000000000000000000 --- a/MAC/APL/PIC/RSP_Protocol/src/RSPFE_Protocol.prot +++ /dev/null @@ -1,43 +0,0 @@ -// -*- mode: c++ -*-// -// Protocol definition for the FrontEnd of rspctl -// -autogen definitions protocol; - -description = "Protocol for the RSP driver interface"; -prefix = "RSPFE"; // for the signal names -id = "(LOFAR::MACIO::F_APL_PROTOCOL+14)"; - -// specify extra include files - -prelude = << PRELUDE_END - -PRELUDE_END; - -// -// An "event" has a "signal" and a "dir" (direction) -// and zero or more "param"s. -// "dir" can be one of "IN" or "OUT". -// A "param" has a "name" and a "type". -// Userdefine types are -// - -// -// Stop message -// -event = { - signal = STOP_RSPCTL; - dir = OUT; -}; - -// -// Status message -// -event = { - signal = STATUS_UPDATE; - dir = IN; - param = { - name = "status"; - type = "string"; - }; -}; - diff --git a/MAC/APL/RTDBCommon/include/APL/RTDBCommon/ClaimMgrTask.h b/MAC/APL/RTDBCommon/include/APL/RTDBCommon/ClaimMgrTask.h index 63d518c2ee92f0d16f6d8643a4ad0cd6d9065dbe..2fb9d8e21187a301f2ce0e79ec1795abbea04b1c 100644 --- a/MAC/APL/RTDBCommon/include/APL/RTDBCommon/ClaimMgrTask.h +++ b/MAC/APL/RTDBCommon/include/APL/RTDBCommon/ClaimMgrTask.h @@ -24,8 +24,7 @@ #ifndef GTM_SERVICEBROKER_H #define GTM_SERVICEBROKER_H -#include <Common/lofar_map.h> -#include <Common/lofar_list.h> +#include <queue> #include <MACIO/GCF_Event.h> #include <GCF/TM/GCF_Control.h> #include <GCF/RTDB/RTDB_PropertySet.h> @@ -52,7 +51,7 @@ public: static ClaimMgrTask* instance(bool temporary = false); static void release(); - // Ask the claimManager the claim an object. An ClaimReply event is send to the given port. + // Ask the claimManager to claim an object. An ClaimReply event is send to the given port. void claimObject(const string& objectType, const string& nameInAppl, GCFPortInterface& replyPort); @@ -71,17 +70,26 @@ private: // state methods GCFEvent::TResult operational (GCFEvent& e, GCFPortInterface& p); + + typedef struct cmRequest { + string objectType; + string objectName; + GCFPortInterface* replyPort; + cmRequest(const string& oType, const string& oName, GCFPortInterface* rPort) : + objectType(oType), objectName(oName), replyPort(rPort) {}; + } cmRequest_t; // data members - GCFPortInterface* itsReplyPort; // Port to send the result to - GCFTimerPort* itsTimerPort; // for reconnecting to brokers - RTDBPropertySet* itsClaimMgrPS; // for accessing the ClaimManager - string itsObjectType; // Objecttype of object in claim - string itsNameInAppl; // Name user likes to use - uint32 itsResolveState; // Where we are in claiming the object. + std::queue<cmRequest_t> itsRequestPool; // pool with waiting requests + GCFPortInterface* itsReplyPort; // Port to send the result to + GCFTimerPort* itsTimerPort; // for reconnecting to brokers + RTDBPropertySet* itsClaimMgrPS; // for accessing the ClaimManager + string itsObjectType; // Objecttype of object in claim + string itsNameInAppl; // Name user likes to use + uint32 itsResolveState; // Where we are in claiming the object. // result fields - uint32 itsFieldsReceived; - string itsResultDPname; + uint32 itsFieldsReceived; + string itsResultDPname; }; class CMHandler : public GCFHandler diff --git a/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc b/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc index 184a8ecdebf522bcf4093391ca6f506e084c0001..4e989ae88ab7bc791f5efa0749e4c483691222e2 100644 --- a/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc +++ b/MAC/APL/RTDBCommon/src/ClaimMgrTask.cc @@ -58,6 +58,7 @@ ClaimMgrTask::ClaimMgrTask() : itsClaimMgrPS (0), itsResolveState(RO_UNDEFINED) { + LOG_DEBUG_STR("ClaimMgrTask()"); registerProtocol(DP_PROTOCOL, DP_PROTOCOL_STRINGS); } @@ -112,8 +113,19 @@ void ClaimMgrTask::claimObject(const string& objectType, const string& nameInAppl, GCFPortInterface& replyPort) // ??? { - ASSERTSTR(itsClaimMgrPS, "There is no propertyset to access the claimManager"); - LOG_DEBUG_STR("ClaimObject(" << objectType << "," << nameInAppl << ")"); + // not yet started yet? (user called us directly after creation) + if (itsResolveState==RO_UNDEFINED) { + itsRequestPool.push(cmRequest_t(objectType,nameInAppl,&replyPort)); + LOG_INFO_STR("claimrequest '" << nameInAppl << "' queued because manager is still starting up"); + return; + } + + // are we in an idle state? + if (!itsObjectType.empty() || !itsNameInAppl.empty()) { + itsRequestPool.push(cmRequest_t(objectType,nameInAppl,&replyPort)); + LOG_INFO_STR("claimrequest '" << nameInAppl << "' queued because manager is still busy with " << itsNameInAppl); + return; + } // save info itsObjectType = objectType; @@ -122,7 +134,7 @@ void ClaimMgrTask::claimObject(const string& objectType, if (itsResolveState == RO_READY) { itsTimerPort->setTimer(0.1); // wake up FSM } - // else: some other time must be ative. + // else: some other timer must be active. } @@ -173,12 +185,24 @@ GCFEvent::TResult ClaimMgrTask::operational(GCFEvent& event, GCFPortInterface& p case RO_READY: // 4 if (itsObjectType.empty() || itsNameInAppl.empty()) { - LOG_DEBUG_STR("Nothing to claim"); - break; + if (itsRequestPool.empty()) { + LOG_DEBUG_STR("Nothing to claim"); + break; + } + // continue with requests on the stack + cmRequest_t newRequest = itsRequestPool.front(); + itsObjectType = newRequest.objectType; + itsNameInAppl = newRequest.objectName; + itsReplyPort = newRequest.replyPort; + itsRequestPool.pop(); } // request a DPname - itsClaimMgrPS->setValue("request.typeName", GCFPVString(itsObjectType), 0.0, false); - itsClaimMgrPS->setValue("request.newObjectName", GCFPVString(itsNameInAppl), 0.0, false); + LOG_INFO_STR("ClaimObject(" << itsObjectType << "," << itsNameInAppl << ")"); + itsClaimMgrPS->setValue("request.typeName", GCFPVString(itsObjectType), 0.0, false); + itsClaimMgrPS->setValue("request.newObjectName", GCFPVString(itsNameInAppl), 0.0, false); + // clear the answer also otherwise we will not be notified when asking the same question twice. + itsClaimMgrPS->setValue("response.DPName", GCFPVString(""), 0.0, false); + itsClaimMgrPS->setValue("response.newObjectName", GCFPVString(""), 0.0, false); itsClaimMgrPS->flush(); itsResolveState = RO_ASKED; // 3 // clear result fields @@ -189,11 +213,20 @@ GCFEvent::TResult ClaimMgrTask::operational(GCFEvent& event, GCFPortInterface& p break; case RO_ASKED: // 3 - LOG_ERROR_STR("No response from ClaimManager in 3 seconds, retrying"); + LOG_ERROR_STR("No response from ClaimManager in 3 seconds, for DP:" << itsNameInAppl); + // Report claimfailure back to the user + CMClaimResultEvent cmEvent; + cmEvent.typeName = itsObjectType; + cmEvent.nameInAppl = itsNameInAppl; + cmEvent.DPname = ""; + itsReplyPort->send(cmEvent); + // clear admin to receive a new claim request. + itsObjectType.clear(); + itsNameInAppl.clear(); + itsResultDPname.clear(); itsResolveState = RO_READY; itsTimerPort->cancelAllTimers(); itsTimerPort->setTimer(0.0); - // ??? break; } } @@ -211,13 +244,17 @@ GCFEvent::TResult ClaimMgrTask::operational(GCFEvent& event, GCFPortInterface& p LOG_DEBUG_STR("DP " << dpEvent.DPname << " changed"); if (dpEvent.DPname.find("response.newObjectName") != string::npos) { string fldContents(((GCFPVString*)(dpEvent.value._pValue))->getValue()); - ASSERTSTR(fldContents == itsNameInAppl, "CM returned answer for request '" - << fldContents <<"' iso " << itsNameInAppl); - itsFieldsReceived++; + if (!fldContents.empty()) { + ASSERTSTR(fldContents == itsNameInAppl, "CM returned answer for request '" + << fldContents <<"' iso " << itsNameInAppl); + itsFieldsReceived++; + } } else if (dpEvent.DPname.find("response.DPName") != string::npos) { itsResultDPname = ((GCFPVString*)(dpEvent.value._pValue))->getValue(); - itsFieldsReceived++; + if (!itsResultDPname.empty()) { + itsFieldsReceived++; + } } if (itsFieldsReceived >= 2) { LOG_DEBUG_STR("ClaimMgr:" << itsNameInAppl << "=" << itsResultDPname); @@ -232,7 +269,8 @@ GCFEvent::TResult ClaimMgrTask::operational(GCFEvent& event, GCFPortInterface& p itsNameInAppl.clear(); itsResultDPname.clear(); itsResolveState = RO_READY; -// itsTimerPort->cancelAllTimers(); + itsTimerPort->cancelAllTimers(); + itsTimerPort->setTimer(0.0); } } break; diff --git a/MAC/APL/RTDBCommon/test/tClaimManager.cc b/MAC/APL/RTDBCommon/test/tClaimManager.cc index f1eaf6d6f131c7ee4c97f78e8925275dd7fb4b3b..7e198278f3dd1a530b4afc0a476fe9cdee7cab04 100644 --- a/MAC/APL/RTDBCommon/test/tClaimManager.cc +++ b/MAC/APL/RTDBCommon/test/tClaimManager.cc @@ -36,7 +36,7 @@ namespace LOFAR { int gTestNr = 0; MgrTest::MgrTest(const string& name) : - GCFTask((State)&MgrTest::doTest, name), + GCFTask((State)&MgrTest::doSingleTest, name), itsTimerPort(0) { LOG_DEBUG_STR("=@=@= MgrTest(" << name << ")"); @@ -59,20 +59,20 @@ MgrTest::~MgrTest() } // -// doTest (event, port) +// doSingleTest (event, port) // -GCFEvent::TResult MgrTest::doTest(GCFEvent& event, GCFPortInterface& port) +GCFEvent::TResult MgrTest::doSingleTest(GCFEvent& event, GCFPortInterface& port) { - LOG_DEBUG_STR ("=@=@= doTest:" << eventName(event) << "@" << port.getName()); + LOG_DEBUG_STR ("=@=@= doSingleTest:" << eventName(event) << "@" << port.getName()); GCFEvent::TResult status = GCFEvent::HANDLED; switch (event.signal) { case F_INIT: - LOG_DEBUG_STR("=@=@= Creating a ClaimManager"); + LOG_INFO_STR("=@=@= Creating a ClaimManager"); itsClaimMgrTask = ClaimMgrTask::instance(); ASSERTSTR(itsClaimMgrTask, "Can't construct a claimMgrTask"); - LOG_DEBUG_STR("=@=@= Calling claimManager for 'Observation7'"); + LOG_INFO_STR("=@=@= Calling claimManager for 'Observation7'"); itsClaimMgrTask->claimObject("Observation", "LOFAR_ObsSW_Observation7", *itsMsgPort); itsTimerPort->setTimer(10.0); break; @@ -82,13 +82,64 @@ GCFEvent::TResult MgrTest::doTest(GCFEvent& event, GCFPortInterface& port) case CM_CLAIM_RESULT: { CMClaimResultEvent cmEvent(event); - LOG_DEBUG_STR("=@=@= ObjectType: " << cmEvent.typeName); - LOG_DEBUG_STR("=@=@= NameInAppl: " << cmEvent.nameInAppl); - LOG_DEBUG_STR("=@=@= DBaseName : " << cmEvent.DPname); + LOG_INFO_STR("=@=@= ObjectType: " << cmEvent.typeName); + LOG_INFO_STR("=@=@= NameInAppl: " << cmEvent.nameInAppl); + LOG_INFO_STR("=@=@= DBaseName : " << cmEvent.DPname); + itsTimerPort->cancelAllTimers(); + TRAN(MgrTest::doMultipleTest); } break; case F_TIMER: + LOG_FATAL("=@=@= Did not receive an answer from the claimManager, aborting program!"); + GCFScheduler::instance()->stop(); + break; + + default: + status = GCFEvent::NOT_HANDLED; + break; + } + + return status; +} +// +// doMultipleTest (event, port) +// +GCFEvent::TResult MgrTest::doMultipleTest(GCFEvent& event, GCFPortInterface& port) +{ + LOG_DEBUG_STR ("=@=@= doMultipleTest:" << eventName(event) << "@" << port.getName()); + GCFEvent::TResult status = GCFEvent::HANDLED; + + switch (event.signal) { + case F_ENTRY: + LOG_INFO_STR("=@=@= Calling claimManager for 'Observation8'"); + itsClaimMgrTask->claimObject("Observation", "LOFAR_ObsSW_Observation8", *itsMsgPort); + LOG_INFO_STR("=@=@= Calling claimManager for 'Observation9'"); + itsClaimMgrTask->claimObject("Observation", "LOFAR_ObsSW_Observation9", *itsMsgPort); + LOG_INFO_STR("=@=@= Calling claimManager for 'Observation10'"); + itsClaimMgrTask->claimObject("Observation", "LOFAR_ObsSW_Observation10", *itsMsgPort); + LOG_INFO_STR("=@=@= Calling claimManager for 'Observation11'"); + itsClaimMgrTask->claimObject("Observation", "LOFAR_ObsSW_Observation11", *itsMsgPort); + LOG_INFO_STR("=@=@= Calling claimManager for 'Observation12'"); + itsClaimMgrTask->claimObject("Observation", "LOFAR_ObsSW_Observation12", *itsMsgPort); + itsAnswers2Xpect=5; + itsTimerPort->setTimer(10.0); + break; + + case CM_CLAIM_RESULT: { + CMClaimResultEvent cmEvent(event); + LOG_INFO_STR("=@=@= ObjectType: " << cmEvent.typeName); + LOG_INFO_STR("=@=@= NameInAppl: " << cmEvent.nameInAppl); + LOG_INFO_STR("=@=@= DBaseName : " << cmEvent.DPname); + if (--itsAnswers2Xpect == 0) { + LOG_INFO("Received all 5 answers, successful end of program"); + GCFScheduler::instance()->stop(); + } + } + break; + + case F_TIMER: + LOG_FATAL_STR("Still waiting for " << itsAnswers2Xpect << " answers, aborting program"); GCFScheduler::instance()->stop(); break; diff --git a/MAC/APL/RTDBCommon/test/tClaimManager.h b/MAC/APL/RTDBCommon/test/tClaimManager.h index 224a6bdc401e5a99c8efa0c3c8a3cefd0fd4085c..9c46541d201428232499da544cef877ccc5ec032 100644 --- a/MAC/APL/RTDBCommon/test/tClaimManager.h +++ b/MAC/APL/RTDBCommon/test/tClaimManager.h @@ -36,12 +36,14 @@ public: MgrTest (const string& name); virtual ~MgrTest(); - GCFEvent::TResult doTest (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult doSingleTest (GCFEvent& e, GCFPortInterface& p); + GCFEvent::TResult doMultipleTest(GCFEvent& e, GCFPortInterface& p); private: GCF::TM::GCFTimerPort* itsTimerPort; GCF::TM::GCFITCPort* itsMsgPort; ClaimMgrTask* itsClaimMgrTask; + int itsAnswers2Xpect; }; } // namespace RTDBCommon diff --git a/MAC/APL/StationCU/src/ClockControl/ClockControlMain.cc b/MAC/APL/StationCU/src/ClockControl/ClockControlMain.cc index d7b8a5b121fb8e827964d6bf898c0d56db651c62..ff30754e77e30551be5f97478fc7fc9185943ed5 100644 --- a/MAC/APL/StationCU/src/ClockControl/ClockControlMain.cc +++ b/MAC/APL/StationCU/src/ClockControl/ClockControlMain.cc @@ -30,7 +30,7 @@ using namespace LOFAR::StationCU; int main(int argc, char* argv[]) { - if (argc < 2) { + if (argc < 3) { return (1); } diff --git a/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_026_mode1.dat b/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_026_mode1.dat new file mode 100644 index 0000000000000000000000000000000000000000..da20499082d2dc54e73683683b2a4ed3310fb1d0 Binary files /dev/null and b/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_026_mode1.dat differ diff --git a/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_503_mode3.dat b/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_503_mode3.dat new file mode 100644 index 0000000000000000000000000000000000000000..4c2f2728bd77c6768ec35e7c7209412947b7bc69 Binary files /dev/null and b/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_503_mode3.dat differ diff --git a/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_603_mode3.dat b/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_603_mode3.dat new file mode 100644 index 0000000000000000000000000000000000000000..bb3d96a5f887f3d79c67a5266dc7a8808100b101 Binary files /dev/null and b/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_603_mode3.dat differ diff --git a/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_603_mode5.dat b/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_603_mode5.dat new file mode 100644 index 0000000000000000000000000000000000000000..25742e2c287b036379f8fd4461295f3b49f0dee6 Binary files /dev/null and b/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_603_mode5.dat differ diff --git a/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_606_mode3.dat b/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_606_mode3.dat new file mode 100644 index 0000000000000000000000000000000000000000..d56475049c4aa46487bba092f42b4856220d62d4 Binary files /dev/null and b/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_606_mode3.dat differ diff --git a/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_606_mode5.dat b/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_606_mode5.dat new file mode 100644 index 0000000000000000000000000000000000000000..a68a7abab667d047d7692d7079d2ca2fdad0f7e3 Binary files /dev/null and b/MAC/Deployment/data/StaticMetaData/CalTables/CalTable_606_mode5.dat differ diff --git a/MAC/Deployment/data/StaticMetaData/MAC+IP.dat b/MAC/Deployment/data/StaticMetaData/MAC+IP.dat index d75ce35c257f7239343687c01fa57d77f7c218dd..bbec663c13a839b010f9d41584c7dd5a0c41af8d 100644 --- a/MAC/Deployment/data/StaticMetaData/MAC+IP.dat +++ b/MAC/Deployment/data/StaticMetaData/MAC+IP.dat @@ -204,19 +204,21 @@ R02-M1-N15-J00 10.170.2.189 00:14:5E:7D:1D:51 R02-M1-N15-J01 10.170.2.190 00:14:5E:7D:1D:52 LIST001 10.181.0.1 00:19:B9:D8:E4:C7 LIST002 10.181.0.2 00:19:B9:D8:E4:B3 -R00-BG0-DE601 10.170.0.178 00:12:F2:C3:3A:00 -R00-BG0-DE602 10.170.0.50 00:12:F2:C3:3A:00 -R00-BG0-DE603 10.170.0.18 00:12:F2:C3:3A:00 -R00-BG3-DE604 10.170.0.190 00:12:F2:C6:BB:00 -R00-BG0-DE605 10.170.0.130 00:12:F2:C3:3A:00 -R00-BG1-FR606 10.170.0.17 00:12:F2:C3:3A:00 -R00-BG2-SE607 10.170.0.58 00:12:F2:C4:C6:00 -R00-BG3-UK608 10.170.0.62 00:12:F2:C3:3A:00 -R01-BG0-DE601 10.170.1.178 00:12:F2:C3:3A:00 -R01-BG0-DE602 10.170.1.50 00:12:F2:C3:3A:00 -R01-BG0-DE603 10.170.1.18 00:12:F2:C3:3A:00 -R01-BG3-DE604 10.170.1.190 00:12:F2:C6:BB:00 -R01-BG0-DE605 10.170.1.130 00:12:F2:C3:3A:00 -R01-BG1-FR606 10.170.1.17 00:12:F2:C3:3A:00 -R01-BG2-SE607 10.170.1.58 00:12:F2:C4:C6:00 -R01-BG3-UK608 10.170.1.62 00:12:F2:C3:3A:00 +R00-BG3-DE601 10.170.0.29 00:12:F2:C6:BB:00 +R00-BG1-DE602 10.170.0.182 00:12:F2:C6:C1:00 +R00-BG1-DE603 10.170.0.38 00:12:F2:C6:C1:00 +R00-BG1-DE604 10.170.0.37 00:12:F2:C6:C1:00 +R00-BG3-DE605 10.170.0.30 00:12:F2:C6:BB:00 +R00-BG2-FR606 10.170.0.25 00:12:F2:C4:C6:00 +R00-BG2-SE607 10.170.0.26 00:12:F2:C4:C6:00 +R00-BG2-UK608 10.170.0.58 00:12:F2:C4:C6:00 + +R01-BG3-DE601 10.170.1.29 00:12:F2:C6:BB:00 +R01-BG1-DE602 10.170.1.182 00:12:F2:C6:C1:00 +R01-BG1-DE603 10.170.1.38 00:12:F2:C6:C1:00 +R01-BG1-DE604 10.170.1.37 00:12:F2:C6:C1:00 +R01-BG3-DE605 10.170.1.30 00:12:F2:C6:BB:00 +R01-BG2-FR606 10.170.1.25 00:12:F2:C4:C6:00 +R01-BG2-SE607 10.170.1.26 00:12:F2:C4:C6:00 +R01-BG2-UK608 10.170.1.58 00:12:F2:C4:C6:00 + diff --git a/MAC/Deployment/data/StaticMetaData/RSPConnections.dat.tmpl b/MAC/Deployment/data/StaticMetaData/RSPConnections.dat.tmpl index aa08234659afedfac58b41aa7b84c071f8f5c39f..7ae947834be7b2a64e1045f82cc4d4f727606ad1 100644 --- a/MAC/Deployment/data/StaticMetaData/RSPConnections.dat.tmpl +++ b/MAC/Deployment/data/StaticMetaData/RSPConnections.dat.tmpl @@ -34,77 +34,35 @@ CS006 RSP_1 @BGP-PARTITION@-M0-N01-J01 CS007 RSP_0 @BGP-PARTITION@-M1-N02-J01 CS007 RSP_1 @BGP-PARTITION@-M0-N02-J01 -CS008 RSP_0 -CS008 RSP_1 +CS011 RSP_0 @BGP-PARTITION@-M1-N09-J00 +CS011 RSP_1 @BGP-PARTITION@-M0-N09-J00 -CS009 RSP_0 -CS009 RSP_1 - -CS010 RSP_0 @BGP-PARTITION@-M1-N05-J00 -CS010 RSP_1 @BGP-PARTITION@-M0-N05-J00 - -CS011 RSP_0 -CS011 RSP_1 - -CS012 RSP_0 -CS012 RSP_1 - -CS013 RSP_0 @BGP-PARTITION@-M1-N04-J01 -CS013 RSP_1 @BGP-PARTITION@-M0-N04-J01 - -CS014 RSP_0 -CS014 RSP_1 - -CS015 RSP_0 -CS015 RSP_1 - -CS016 RSP_0 @BGP-PARTITION@-M1-N07-J01 -CS016 RSP_1 @BGP-PARTITION@-M0-N07-J01 +CS013 RSP_0 @BGP-PARTITION@-M0-N10-J01 +CS013 RSP_1 @BGP-PARTITION@-M0-N14-J01 CS017 RSP_0 @BGP-PARTITION@-M1-N08-J00 CS017 RSP_1 @BGP-PARTITION@-M0-N08-J00 -CS018 RSP_0 -CS018 RSP_1 - -CS019 RSP_0 -CS019 RSP_1 - -CS020 RSP_0 -CS020 RSP_1 - CS021 RSP_0 @BGP-PARTITION@-M1-N00-J00 CS021 RSP_1 @BGP-PARTITION@-M0-N00-J00 -CS022 RSP_0 -CS022 RSP_1 - -CS023 RSP_0 -CS023 RSP_1 - CS024 RSP_0 @BGP-PARTITION@-M1-N03-J01 CS024 RSP_1 @BGP-PARTITION@-M0-N03-J01 -CS025 RSP_0 -CS025 RSP_1 - CS026 RSP_0 @BGP-PARTITION@-M1-N05-J00 CS026 RSP_1 @BGP-PARTITION@-M0-N05-J00 -CS028 RSP_0 -CS028 RSP_1 - -CS029 RSP_0 -CS029 RSP_1 +CS028 RSP_0 @BGP-PARTITION@-M1-N09-J01 +CS028 RSP_1 @BGP-PARTITION@-M0-N09-J01 CS030 RSP_0 @BGP-PARTITION@-M1-N06-J00 CS030 RSP_1 @BGP-PARTITION@-M0-N06-J00 -CS031 RSP_0 -CS031 RSP_1 +CS031 RSP_0 @BGP-PARTITION@-M1-N13-J00 +CS031 RSP_1 @BGP-PARTITION@-M1-N13-J01 CS032 RSP_0 @BGP-PARTITION@-M1-N04-J01 -CS032 RSP_1 @BGP-PARTITION@-M1-N14-J01 +CS032 RSP_1 @BGP-PARTITION@-M0-N04-J01 CS101 RSP_0 @BGP-PARTITION@-M1-N04-J00 CS101 RSP_1 @BGP-PARTITION@-M0-N04-J00 @@ -118,8 +76,8 @@ CS201 RSP_1 @BGP-PARTITION@-M0-N05-J01 CS301 RSP_0 @BGP-PARTITION@-M1-N06-J01 CS301 RSP_1 @BGP-PARTITION@-M0-N06-J01 -CS302 RSP_0 @BGP-PARTITION@-M1-N09-J00 -CS302 RSP_1 @BGP-PARTITION@-M0-N09-J00 +CS302 RSP_0 @BGP-PARTITION@-M0-N13-J00 +CS302 RSP_1 @BGP-PARTITION@-M0-N13-J01 CS401 RSP_0 @BGP-PARTITION@-M1-N07-J01 CS401 RSP_1 @BGP-PARTITION@-M0-N07-J01 @@ -129,53 +87,21 @@ CS501 RSP_1 @BGP-PARTITION@-M0-N10-J00 # Remote stations -RS102 RSP_0 - RS104 RSP_0 @BGP-PARTITION@-M0-N08-J01 RS106 RSP_0 @BGP-PARTITION@-M1-N11-J01 -RS107 RSP_0 - -RS108 RSP_0 - -RS109 RSP_0 - -RS202 RSP_0 - -RS203 RSP_0 - -RS204 RSP_0 - -RS205 RSP_0 @BGP-PARTITION@-M1-N09-J01 - -RS206 RSP_0 - -RS207 RSP_0 +RS205 RSP_0 @BGP-PARTITION@-M0-N11-J01 RS208 RSP_0 @BGP-PARTITION@-M1-N08-J01 -RS210 RSP_0 @BGP-PARTITION@-M0-N09-J01 - -RS303 RSP_0 - -RS304 RSP_0 +RS210 RSP_0 @BGP-PARTITION@-M0-N14-J01 RS306 RSP_0 @BGP-PARTITION@-M1-N14-J00 RS307 RSP_0 @BGP-PARTITION@-M1-N15-J00 -RS308 RSP_0 - -RS309 RSP_0 - -RS310 RSP_0 @BGP-PARTITION@-M0-N12-J00 - -RS311 RSP_0 - -RS402 RSP_0 - -RS403 RSP_0 +RS310 RSP_0 @BGP-PARTITION@-M0-N12-J01 RS404 RSP_0 @BGP-PARTITION@-M0-N14-J00 @@ -183,44 +109,29 @@ RS406 RSP_0 @BGP-PARTITION@-M0-N15-J00 RS407 RSP_0 @BGP-PARTITION@-M1-N12-J00 -RS408 RSP_0 +RS409 RSP_0 @BGP-PARTITION@-M1-N12-J01 -RS409 RSP_0 @BGP-PARTITION@-M1-N13-J00 - -RS410 RSP_0 @BGP-PARTITION@-M0-N11-J01 - -RS411 RSP_0 - -RS412 RSP_0 - -RS413 RSP_0 - -RS502 RSP_0 +RS410 RSP_0 @BGP-PARTITION@-M0-N12-J00 RS503 RSP_0 @BGP-PARTITION@-M1-N10-J01 -RS504 RSP_0 +RS508 RSP_0 @BGP-PARTITION@-M1-N15-J01 -RS506 RSP_0 +RS509 RSP_0 @BGP-PARTITION@-M0-N15-J01 -RS507 RSP_0 +DE601 RSP_0 @BGP-PARTITION@-BG3-DE601 -RS508 RSP_0 @BGP-PARTITION@-M0-N13-J00 +DE602 RSP_0 @BGP-PARTITION@-BG1-DE602 -RS509 RSP_0 @BGP-PARTITION@-M0-N10-J01 +DE603 RSP_0 @BGP-PARTITION@-BG1-DE603 -DE601 RSP_0 @BGP-PARTITION@-BG0-DE601 +DE604 RSP_0 @BGP-PARTITION@-BG1-DE604 -DE602 RSP_0 @BGP-PARTITION@-BG0-DE602 +DE605 RSP_0 @BGP-PARTITION@-BG3-DE605 -DE603 RSP_0 @BGP-PARTITION@-BG0-DE603 - -DE604 RSP_0 @BGP-PARTITION@-BG3-DE604 - -DE605 RSP_0 @BGP-PARTITION@-BG0-DE605 - -FR606 RSP_0 @BGP-PARTITION@-BG1-FR606 +FR606 RSP_0 @BGP-PARTITION@-BG2-FR606 SE607 RSP_0 @BGP-PARTITION@-BG2-SE607 -UK608 RSP_0 @BGP-PARTITION@-BG3-UK608 +UK608 RSP_0 @BGP-PARTITION@-BG2-UK608 + diff --git a/RELEASE_NOTES b/RELEASE_NOTES new file mode 100644 index 0000000000000000000000000000000000000000..07715db79105fa59bef60434624bd030886d1669 --- /dev/null +++ b/RELEASE_NOTES @@ -0,0 +1,41 @@ +MAC/APL/PAC/ITRFBeamServer/src/BeamServer.cc +Logging of 'current pointing' now at level INFO iso DEBUG + + +MAC/APL/CASATools/src/CasaConverter.cc +Added support for some other coordinatesystems. The supported systems are now: +APP AZELGEO B1950 COMET ECLIPTIC GALACTIC HADEC ICRS ITRF J2000 JUPITER MARS +MERCURY MOON NEPTUNE PLUTO SATURN SUN TOPO URANUS VENUS + + +MAC/APL/PIC/RSP_Protocol/src/RSPFE_Protocol.prot +Removed obsolete protocol + + +MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc +The ObservationController now sends the 'reached required state' message to the MACScheduler +as soon as the first child reaches this state. Although this is not correct it prevents that +an observations is not reported 'active' in SAS when one station fails. +Future solution will be defining and implementing the Quality Measures. + + +MAC/APL/RTDBCUDaemons/src/SoftwareMonitor.cc +Call to claimManager in PVSS now asks for datapoint with fullname (LOFAR_ObsSW_xxx). +Check for observationID==0 to avoid needless calls to the claimManager. + + +MAC/APL/MainCU/src/MACScheduler/ObsClaimer.cc +When claimManager from PVSS returns an empty name an error message is generated. + + +MAC/APL/RTDBCommon/src/ClaimMgrTask.cc +The claimManager will try each claim only once and will not retry it every 3 seconds infinitely. +A request queue was introduced to make it more robust. + + +MAC/APL/APLCommon/src/swlevel.conf +Added 'u' to the ClockControl control-pattern so that the software monitor logs to LOFAR_PermSW iso LOFAR_ObsSW. + + +MAC/APL/StationCU/src/ClockControl/ClockControl.cc +Programs terminates silently when less than 2 startup arguments are given. Relates to change above.