diff --git a/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc b/MAC/APL/MainCU/src/ObservationControl/ObservationControl.cc index 8e85761581f3f6d29dbb7124a01af6c918ec64dc..2a55ae2495b1537f6ee6362e954c8cafe5a1ddea 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 453a615650f8a2a3c06313b9bcbd94ed23146b09..42a45d5a07b4bbc8fdabb63d27253dfb18a539b5 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();