From 8168a53e5f6fc6bf1b088867830cc88e618fdb03 Mon Sep 17 00:00:00 2001 From: Ruud Overeem <overeem@astron.nl> Date: Fri, 20 Oct 2006 14:40:54 +0000 Subject: [PATCH] BugID: 797 Moved startChildController from ObservationControl to ChildControl so it is available in all controller. --- .../ObservationControl/ObservationControl.cc | 49 ++----------------- .../ObservationControl/ObservationControl.h | 1 - 2 files changed, 3 insertions(+), 47 deletions(-) diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc index 8e85761581f..2a55ae2495b 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc @@ -145,49 +145,6 @@ void ObservationControl::setState(CTState::CTstateNr newState) } -// -// startChildControllers() -// -void ObservationControl::startChildControllers() -{ - string myname = globalParameterSet()->getString("_moduleName"); - string fullname = globalParameterSet()->locateModule(myname)+myname+"."; - ParameterSet subset = globalParameterSet()->makeSubset(fullname); - - ParameterSet::const_iterator iter = subset.begin(); - ParameterSet::const_iterator end = subset.end(); - string childname; - while (iter != end) { - string::size_type pos = iter->first.find(".", 0); - if (pos != string::npos && iter->first.substr(0,pos) != childname) { - childname = iter->first.substr(0,pos); - // collect the information to start the child controller - string childhostname = subset.getString(childname+"._hostname"); - uint16 childCntlrType = getControllerType(childname); - uint32 treeID = globalParameterSet()->getUint32("_treeID"); - uint16 instanceNr = 0; // TODO - string childCntlrName = controllerName(childCntlrType, instanceNr, treeID); - - // child already running??? - CTState::CTstateNr requestedState= - itsChildControl->getRequestedState(childCntlrName); - - if (requestedState == CTState::NOSTATE) { - // fire request for new controller, will result in CONTROL_STARTED - itsChildControl->startChild(childCntlrName, - treeID, - childCntlrType, - instanceNr, - myHostname(true)); - // Note: controller is now in state NO_STATE/CONNECTED (C/R) - - LOG_DEBUG_STR("Requested start of " << childCntlrName); - } - } - iter++; - } -} - // // handlePropertySetAnswer(answer) // @@ -362,7 +319,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter case F_ENTRY: { // convert times and periods to timersettings. setObservationTimers(); - startChildControllers(); + itsChildControl->startChildControllers(); itsHeartBeat = itsTimerPort->setTimer(1.0 * itsHeartBeat); break; } @@ -394,7 +351,7 @@ GCFEvent::TResult ObservationControl::active_state(GCFEvent& event, GCFPortInter // TODO: do something else? --> OE 837 } else if (timerEvent.id == itsStartTimer) { - setState(CTState::ACTIVE); + setState(CTState::RESUME); itsStartTimer = 0; // TODO: do something else? --> OE 837 } @@ -536,7 +493,7 @@ void ObservationControl::setObservationTimers() // (re)set the start timer itsTimerPort->cancelTimer(itsStartTimer); - if (itsState < CTState::ACTIVE) { // not yet active? + if (itsState < CTState::RESUME) { // not yet active? sec2go = start - now; if (sec2go > 0) { itsStartTimer = itsTimerPort->setTimer(1.0 * sec2go); diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h index 453a615650f..42a45d5a07b 100644 --- a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h +++ b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.h @@ -94,7 +94,6 @@ private: void setState(CTState::CTstateNr newState); void setObservationTimers(); - void startChildControllers(); void doHeartBeatTask(); -- GitLab