From 1deafeab912f5b7e7857d4130f19beada3360b11 Mon Sep 17 00:00:00 2001 From: Ruud Overeem <overeem@astron.nl> Date: Mon, 16 Oct 2006 08:00:45 +0000 Subject: [PATCH] BugID: 679 Update after testing. --- MAC/APL/APLCommon/src/ChildControl.cc | 3 ++- MAC/APL/APLCommon/src/ControllerAdmin.cc | 4 +++- MAC/APL/APLCommon/src/ParentControl.cc | 24 +++++++++++++----------- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/MAC/APL/APLCommon/src/ChildControl.cc b/MAC/APL/APLCommon/src/ChildControl.cc index 62b664e3fe0..3a20c21c6aa 100644 --- a/MAC/APL/APLCommon/src/ChildControl.cc +++ b/MAC/APL/APLCommon/src/ChildControl.cc @@ -29,6 +29,7 @@ #include <GCF/GCF_ServiceInfo.h> #include <GCF/Utils.h> #include <APL/APLCommon/APLUtilities.h> +#include <APL/APLCommon/ControllerDefines.h> #include <APL/APLCommon/StationInfo.h> #include <APL/APLCommon/ChildControl.h> #include <Controller_Protocol.ph> @@ -165,7 +166,7 @@ bool ChildControl::startChild (const string& aName, string prefix = wholeSet.getString("prefix"); // Create a parameterset with software related issues. - string cntlrSetName(formatString("%s/%s", LOFAR_SHARE_LOCATION, aName.c_str())); + string cntlrSetName(formatString("%s/%s", LOFAR_SHARE_LOCATION, sharedControllerName(aName).c_str())); LOG_DEBUG_STR("Creating parameterfile: " << cntlrSetName); // first add the controller specific stuff string nodeName(parsetNodeName(aCntlrType)); diff --git a/MAC/APL/APLCommon/src/ControllerAdmin.cc b/MAC/APL/APLCommon/src/ControllerAdmin.cc index 813c9162d4a..513166c276b 100644 --- a/MAC/APL/APLCommon/src/ControllerAdmin.cc +++ b/MAC/APL/APLCommon/src/ControllerAdmin.cc @@ -25,6 +25,7 @@ //# Includes #include <Common/LofarLogger.h> +#include <APL/APLCommon/ControllerDefines.h> #include <APL/APLCommon/ControllerAdmin.h> namespace LOFAR { @@ -51,8 +52,9 @@ ControllerAdmin* ControllerAdmin::instance() ControllerAdmin::CIiter ControllerAdmin::findController(const string& name) { CIiter iter = itsList.begin(); const_CIiter end = itsList.end(); + string adminName = sharedControllerName(name); - while (iter != end && iter->getName() != name) { + while (iter != end && sharedControllerName(iter->getName()) != adminName) { iter++; } diff --git a/MAC/APL/APLCommon/src/ParentControl.cc b/MAC/APL/APLCommon/src/ParentControl.cc index 3432533f0cc..25e6042ad9e 100644 --- a/MAC/APL/APLCommon/src/ParentControl.cc +++ b/MAC/APL/APLCommon/src/ParentControl.cc @@ -122,17 +122,19 @@ ParentControl::~ParentControl() // GCFITCPort* ParentControl::registerTask(GCFTask* mainTask) { - itsMainTaskPort = new GCFITCPort(*mainTask, *this, mainTask->getName(), - GCFPortInterface::SAP, CONTROLLER_PROTOCOL); - ASSERTSTR(itsMainTaskPort, "Can not allocate ITC port for parent-control"); - itsMainTaskPort->open(); // will result in F_CONN signal - - itsSDPort = new GCFTCPPort(*this, MAC_SVCMASK_STARTDAEMON, - GCFPortInterface::SAP, STARTDAEMON_PROTOCOL); - ASSERTSTR(itsSDPort, "Can not allocate clientport to startDaemon"); - itsSDPort->open(); // will result in F_COON or F_DISCONN signal - - itsControllerName = mainTask->getName(); // remember for later + if (!itsMainTaskPort) { + itsMainTaskPort = new GCFITCPort(*mainTask, *this, mainTask->getName(), + GCFPortInterface::SAP, CONTROLLER_PROTOCOL); + ASSERTSTR(itsMainTaskPort, "Can not allocate ITC port for parent-control"); + itsMainTaskPort->open(); // will result in F_CONN signal + + itsSDPort = new GCFTCPPort(*this, MAC_SVCMASK_STARTDAEMON, + GCFPortInterface::SAP, STARTDAEMON_PROTOCOL); + ASSERTSTR(itsSDPort, "Can not allocate clientport to startDaemon"); + itsSDPort->open(); // will result in F_COON or F_DISCONN signal + + itsControllerName = mainTask->getName(); // remember for later + } return (itsMainTaskPort); } -- GitLab