diff --git a/MAC/APL/APLCommon/include/APL/APLCommon/ControllerDefines.h b/MAC/APL/APLCommon/include/APL/APLCommon/ControllerDefines.h index 4c2c7ebf27a709bd724d066506f9e9f80562455d..d6cb089b03713bd328c67fe2a88c40cf22d8ca6f 100644 --- a/MAC/APL/APLCommon/include/APL/APLCommon/ControllerDefines.h +++ b/MAC/APL/APLCommon/include/APL/APLCommon/ControllerDefines.h @@ -46,6 +46,8 @@ enum { CNTLRTYPE_NO_TYPE = 0, // no type defined yet CNTLRTYPE_SCHEDULERCTRL, // MACscheduler CNTLRTYPE_OBSERVATIONCTRL, // ObservationControl + CNTLRTYPE_ONLINECTRL, // OnlineControl + CNTLRTYPE_OFFLINECTRL, // OfflineControl CNTLRTYPE_BEAMDIRECTIONCTRL, // BeamDirectionControl CNTLRTYPE_GROUPCTRL, // RingControl CNTLRTYPE_STATIONCTRL, // StationControl diff --git a/MAC/APL/APLCommon/include/APL/APLCommon/Makefile.am b/MAC/APL/APLCommon/include/APL/APLCommon/Makefile.am index 861fb54d5fb68098384eb4fb37456ad2c42b1e07..fae43cd2a764676e1fbb11b0526b0a5899271cdc 100644 --- a/MAC/APL/APLCommon/include/APL/APLCommon/Makefile.am +++ b/MAC/APL/APLCommon/include/APL/APLCommon/Makefile.am @@ -6,6 +6,7 @@ pkginclude_HEADERS = \ APL_Defines.h \ APLUtilities.h \ ControllerDefines.h \ + StationInfo.h \ PropertySetAnswer.h \ PropertySetAnswerHandlerInterface.h \ CTState.h \ diff --git a/MAC/APL/APLCommon/src/ChildControl.cc b/MAC/APL/APLCommon/src/ChildControl.cc index b34acf73df77520ff7268117f705eeb4c3d113ac..c176fd59b74452b72a6079c84851214d56107908 100644 --- a/MAC/APL/APLCommon/src/ChildControl.cc +++ b/MAC/APL/APLCommon/src/ChildControl.cc @@ -25,11 +25,11 @@ //# Includes #include <Common/LofarLogger.h> -#include <Deployment/StationInfo.h> #include <APS/ParameterSet.h> #include <GCF/GCF_ServiceInfo.h> #include <GCF/Utils.h> #include <APL/APLCommon/APLUtilities.h> +#include <APL/APLCommon/StationInfo.h> #include <APL/APLCommon/ChildControl.h> #include <Controller_Protocol.ph> #include <StartDaemon_Protocol.ph> @@ -178,9 +178,10 @@ bool ChildControl::startChild (const string& aName, // Add some comment lines and some extra fields to the file cntlrSet.add("prefix", prefix+position+nodeName+"."); cntlrSet.add("_instanceNr", lexical_cast<string>(instanceNr)); + cntlrSet.add("_moduleName", nodeName); cntlrSet.add("_treeID", lexical_cast<string>(anObsID)); - cntlrSet.add("# modulename", nodeName); - cntlrSet.add("# pathname", prefix+position+nodeName+"."); + cntlrSet.add("# moduleName", nodeName); + cntlrSet.add("# pathName", prefix+position+nodeName+"."); cntlrSet.add("# treeID", lexical_cast<string>(anObsID)); // Finally write to subset to the file. cntlrSet.writeFile (cntlrSetName); @@ -441,7 +442,7 @@ void ChildControl::_processActionList() switch (action->requestedState) { case CTState::CONNECTED: // start program, wait for CONNECTED msgs of child { - // first check if connection if StartDaemon is made + // first check if connection with StartDaemon is made SDiter startDaemon = itsStartDaemonMap.find(action->hostname); if (startDaemon == itsStartDaemonMap.end() || !startDaemon->second->isConnected()) { @@ -781,7 +782,8 @@ GCFEvent::TResult ChildControl::operational(GCFEvent& event, case F_INIT: break; - case F_ENTRY: + case F_ENTRY: // process actions that where queued during my startup. + _processActionList(); break; case F_ACCEPT_REQ: { diff --git a/MAC/APL/APLCommon/src/ControllerDefines.cc b/MAC/APL/APLCommon/src/ControllerDefines.cc index e7018538be5f550d8de0b2de096a39ae62cb6832..d594163e4921468a73c49cea16887aff7500a7e1 100644 --- a/MAC/APL/APLCommon/src/ControllerDefines.cc +++ b/MAC/APL/APLCommon/src/ControllerDefines.cc @@ -26,10 +26,10 @@ //# Includes #include <Common/LofarLogger.h> #include <Common/StringUtil.h> // rtrim -#include <Deployment/StationInfo.h> #include <GCF/Utils.h> // myHostname #include <APS/ParameterSet.h> // indexValue #include <APL/APLCommon/ControllerDefines.h> +#include <APL/APLCommon/StationInfo.h> #include <boost/config.hpp> #include <boost/lexical_cast.hpp> @@ -47,9 +47,13 @@ typedef struct cntlrDefinition { } cntlrDefinition_t; static cntlrDefinition_t controllerTable[] = { +// executable parsetNode shared +//---------------------------------------------------------- { "", "", false }, { "MACScheduler", "MACScheduler", false }, { "ObservationControl", "ObsCtrl", false }, + { "OnlineControl", "OnlineCtrl", false }, + { "OfflineControl", "OfflineCtrl", false }, { "BeamDirectionControl", "BeamDirCtrl", true }, { "RingControl", "RingCtrl", true }, { "StationControl", "StationCtrl", false }, @@ -134,6 +138,7 @@ int32 getControllerType (const string& controllerName) { string cntlrName(controllerName); // destroyable copy rtrim(cntlrName, "[]{}0123456789"); // cut down to executable name + // first try on controllername uint32 idx = CNTLRTYPE_NO_TYPE + 1; while (idx < CNTLRTYPE_NR_TYPES) { if (!strcmp (controllerTable[idx].cntlrName, cntlrName.c_str())) { @@ -142,6 +147,15 @@ int32 getControllerType (const string& controllerName) idx++; } + // not found, may user passed parsetNodename + idx = CNTLRTYPE_NO_TYPE + 1; + while (idx < CNTLRTYPE_NR_TYPES) { + if (!strcmp (controllerTable[idx].parsetName, cntlrName.c_str())) { + return (idx); + } + idx++; + } + return (CNTLRTYPE_NO_TYPE); } diff --git a/MAC/APL/APLCommon/src/Makefile.am b/MAC/APL/APLCommon/src/Makefile.am index 1444d091d7f91db5e40b1d87403993de754b94c6..6680bd38dd9ebd35a2004ce8c796d1aa95c8291d 100644 --- a/MAC/APL/APLCommon/src/Makefile.am +++ b/MAC/APL/APLCommon/src/Makefile.am @@ -15,6 +15,7 @@ libaplcommon_la_SOURCES = $(DOCHDRS) \ Controller_Protocol.cc \ APLUtilities.cc \ ControllerDefines.cc \ + StationInfo.cc \ PropertySetAnswer.cc \ CTState.cc \ ControllerAdmin.cc \ diff --git a/MAC/APL/APLCommon/src/ParentControl.cc b/MAC/APL/APLCommon/src/ParentControl.cc index d5551fe916005c801f4e359c62a9fda911a9a120..0d2c14916eb5d3094f41e2539845e311cc74b795 100644 --- a/MAC/APL/APLCommon/src/ParentControl.cc +++ b/MAC/APL/APLCommon/src/ParentControl.cc @@ -25,12 +25,12 @@ //# Includes #include <Common/LofarLogger.h> -#include <Deployment/StationInfo.h> #include <APS/ParameterSet.h> #include <GCF/GCF_ServiceInfo.h> #include <GCF/Utils.h> #include <APL/APLCommon/APLUtilities.h> #include <APL/APLCommon/ParentControl.h> +#include <APL/APLCommon/StationInfo.h> #include <Controller_Protocol.ph> #include <StartDaemon_Protocol.ph>