From d06bf63a8f210d2ad1e805cedc5a21a79698fdca Mon Sep 17 00:00:00 2001
From: Ruud Overeem <overeem@astron.nl>
Date: Fri, 8 Nov 2013 09:24:25 +0000
Subject: [PATCH] Task #4941: Moved createPropertySetName to
 ApplCommon/StationInfo together with two other related functions.

---
 .../include/ApplCommon/StationInfo.h          |  11 ++
 LCS/ApplCommon/src/StationInfo.cc             | 155 +++++++++++++++++
 .../include/APL/APLCommon/ControllerDefines.h |  11 --
 MAC/APL/APLCommon/src/ControllerDefines.cc    | 157 +-----------------
 .../src/CEPHardwareMonitor/BlueGeneMonitor.cc |   4 +-
 .../src/CEPHardwareMonitor/ClusterMonitor.cc  |   4 +-
 .../src/PVSSGateway/PVSSGateway.cc            |   5 +-
 .../src/ClockControl/ClockControl.cc          |   1 +
 .../src/HardwareMonitor/ECMonitor.cc          |   3 +-
 .../src/HardwareMonitor/RSPMonitor.cc         |   3 +-
 .../src/HardwareMonitor/TBBMonitor.cc         |   3 +-
 .../StationCU/src/StationControl/ActiveObs.cc |   2 +-
 12 files changed, 176 insertions(+), 183 deletions(-)

diff --git a/LCS/ApplCommon/include/ApplCommon/StationInfo.h b/LCS/ApplCommon/include/ApplCommon/StationInfo.h
index fba98ff296f..2569e63e865 100644
--- a/LCS/ApplCommon/include/ApplCommon/StationInfo.h
+++ b/LCS/ApplCommon/include/ApplCommon/StationInfo.h
@@ -53,6 +53,17 @@ string	stationRingName();									// Core, Remote, Europe
 string	PVSSDatabaseName(const string&	someName = "");		// hostname w/o CUtype
 string	realHostname(const string&	someName);				// adds 'C' when it is missing.
 
+// Get the ObservationNr from the controllername.
+uint32	getObservationNr (const string&	ObservationName);
+
+// Get the instanceNr from the controllername.
+uint16	getInstanceNr (const string&	ObservationName);
+
+// Construct PS name solving markers line @observation@, @ring@, etc.
+string	createPropertySetName(const string&		propSetMask,
+							  const string&		controllerName,
+							  const string&		realDPname = "REALDPNAME");
+
 string  PVSS2SASname(const string& PVSSname);				// convert PVSS DPname to SAS DPname
 string  SAS2PVSSname(const string& SASname);				// convert SAS DPname to PVSS DPname
 
diff --git a/LCS/ApplCommon/src/StationInfo.cc b/LCS/ApplCommon/src/StationInfo.cc
index f6cbc084553..f77212a3776 100644
--- a/LCS/ApplCommon/src/StationInfo.cc
+++ b/LCS/ApplCommon/src/StationInfo.cc
@@ -25,6 +25,7 @@
 
 #include <Common/lofar_string.h>
 #include <Common/LofarTypes.h>
+#include <Common/ParameterSet.h>	// indexValue
 #include <Common/StringUtil.h>
 #include <Common/SystemUtil.h>
 #include <ApplCommon/StationInfo.h>
@@ -138,6 +139,160 @@ string	realHostname(const string&	someName)
 	return (someName+'C');
 }
 
+//
+// getObservationNr(controllerName)
+//
+// Get the ObservationNr from the controllername.
+uint32	getObservationNr (const string&	controllerName)
+{
+	return (indexValue(controllerName, "{}"));
+}
+
+//
+// getInstanceNr(controllername)
+//
+// Get the instanceNr from the controllername.
+uint16	getInstanceNr (const string&	controllerName)
+{
+	string		cntlrName (controllerName);		// destroyable copy
+	rtrim(cntlrName, "{}0123456789");
+	return (indexValue(cntlrName, "[]"));
+}
+
+//
+// createPropertySetName(propSetMask)
+//
+//  A PropSetMask may contain the markers:
+//	@ring@
+//	@station@
+//  @instance@
+//	@observation@
+//	@cabinet@
+//	@subrack@
+//	@RSPboard@
+//	@TBboard@
+//	@rcu@
+//      @bgp@
+//      @midplane@
+//      @ionode@
+//      @osrack@
+//      @ossubcluster@
+//      @storagenode@
+//      @offlinenode@
+//  @inputbuffer@
+//  @adder@
+//  @storage@
+//  @cobaltnode@
+//  @cobaltnic@
+//  @oscobaltnode@
+//  @pscobaltnode@
+//  @cobaltgpuproc@
+//
+string	createPropertySetName(const string&		propSetMask,
+							  const string&		controllerName,
+							  const string&		realDPname)
+{
+	string	psName(propSetMask);		// editable copy
+	string::size_type	pos;
+	// when name contains @ring@_@station@ cut out this marker and prepend hostname
+	// stationname+:  -> LOFAR_ObsSW_@ring@_@station@_CalCtrl_xxx --> CS010:LOFAR_ObsSW_CalCtrl_xxx
+	if ((pos = psName.find("@ring@_@station@_")) != string::npos) {
+		psName.erase(pos, 17);
+		psName = PVSSDatabaseName(myHostname(false)) + ":" + psName;
+	}
+
+	if ((pos = psName.find("@ring@")) != string::npos) {
+		psName.replace(pos, 6, stationRingName());
+	}
+
+	if ((pos = psName.find("@station@")) != string::npos) {
+		psName.replace(pos, 9, PVSSDatabaseName(myHostname(false)));
+	}
+
+	if ((pos = psName.find("@instance@")) != string::npos) {
+		uint16	instanceNr = getInstanceNr(controllerName);
+		if (instanceNr) {
+			psName.replace(pos, 10, lexical_cast<string>(instanceNr));
+		}
+		else {
+			psName.replace(pos, 10, "");	
+		}
+	}
+
+	if ((pos = psName.find("LOFAR_ObsSW_@observation@")) != string::npos) {
+		psName.replace(pos, 25, realDPname);
+	}
+
+	if ((pos = psName.find("@cabinet@")) != string::npos) {
+		psName.replace(pos, 9, string("Cabinet%d"));
+	}
+	if ((pos = psName.find("@subrack@")) != string::npos) {
+		psName.replace(pos, 9, string("Subrack%d"));
+	}
+	if ((pos = psName.find("@RSPBoard@")) != string::npos) {
+		psName.replace(pos, 10, string("RSPBoard%d"));
+	}
+	if ((pos = psName.find("@TBBoard@")) != string::npos) {
+		psName.replace(pos, 9, string("TBBoard%d"));
+	}
+	if ((pos = psName.find("@rcu@")) != string::npos) {
+		psName.replace(pos, 5, string("RCU%d"));
+	}
+	if ((pos = psName.find("@bgp@")) != string::npos) {
+		psName.replace(pos, 5, string("BGP%d"));
+	}
+	if ((pos = psName.find("@midplane@")) != string::npos) {
+		psName.replace(pos, 10, string("Midplane%d"));
+	}
+	if ((pos = psName.find("@ionode@")) != string::npos) {
+		psName.replace(pos, 8, string("IONode%02d"));
+	}
+	if ((pos = psName.find("@osionode@")) != string::npos) {
+		psName.replace(pos, 10, string("OSIONode%02d"));
+	}
+	if ((pos = psName.find("@locusnode@")) != string::npos) {
+		psName.replace(pos, 11, string("LocusNode%03d"));
+	}
+	if ((pos = psName.find("@osrack@")) != string::npos) {
+		psName.replace(pos, 8, string("OSRack%d"));
+	}
+	if ((pos = psName.find("@ossubcluster@")) != string::npos) {
+		psName.replace(pos, 14, string("OSSubcluster%d"));
+	}
+	if ((pos = psName.find("@storagenode@")) != string::npos) {
+		psName.replace(pos, 13, string("StorageNode%d"));
+	}
+	if ((pos = psName.find("@offlinenode@")) != string::npos) {
+		psName.replace(pos, 13, string("OfflineNode%d"));
+	}
+	if ((pos = psName.find("@inputbuffer@")) != string::npos) {
+		psName.replace(pos, 13, string("InputBuffer%d"));
+	}
+	if ((pos = psName.find("@adder@")) != string::npos) {
+		psName.replace(pos, 7, string("Adder%d"));
+	}
+	if ((pos = psName.find("@storage@")) != string::npos) {
+		psName.replace(pos, 9, string("Storage%d"));
+	}
+	if ((pos = psName.find("@cobaltnode@")) != string::npos) {
+		psName.replace(pos, 12, string("CBT%03d"));
+	}
+	if ((pos = psName.find("@cobaltnic@")) != string::npos) {
+		psName.replace(pos, 11, string("CobaltNIC%02d"));
+	}
+	if ((pos = psName.find("@oscobaltnode@")) != string::npos) {
+		psName.replace(pos, 14, string("OSCBT%03d"));
+	}
+	if ((pos = psName.find("@pscobaltnode@")) != string::npos) {
+		psName.replace(pos, 14, string("PSCBT%03d"));
+	}
+	if ((pos = psName.find("@cobaltgpuproc@")) != string::npos) {
+		psName.replace(pos, 15, string("CobaltGPUProc%02d"));
+	}
+		
+	return (psName);
+}
+
 #if defined HAVE_BOOST_REGEX
 
 //
diff --git a/MAC/APL/APLCommon/include/APL/APLCommon/ControllerDefines.h b/MAC/APL/APLCommon/include/APL/APLCommon/ControllerDefines.h
index f15072bfd52..04352c5fed3 100644
--- a/MAC/APL/APLCommon/include/APL/APLCommon/ControllerDefines.h
+++ b/MAC/APL/APLCommon/include/APL/APLCommon/ControllerDefines.h
@@ -106,12 +106,6 @@ string	getExecutable (uint16		cntlrType);
 // return 'shared' bit of controllertype
 bool	isSharedController(uint16		cntrlType) ;
 
-// Get the ObservationNr from the controllername.
-uint32	getObservationNr (const string&	ObservationName);
-
-// Get the instanceNr from the controllername.
-uint16	getInstanceNr (const string&	ObservationName);
-
 // Get the controllerType from the controllername.
 int32	getControllerType	(const string&	ObservationName);
 
@@ -121,11 +115,6 @@ string 	observationName(int	obsID);
 // Get the name of the parset of the observation.
 string 	observationParset(int	obsID);
 
-// Construct PS name solving markers line @observation@, @ring@, etc.
-string	createPropertySetName(const string&		propSetMask,
-							  const string&		controllerName,
-							  const string&		realDPname = "REALDPNAME");
-
 // Construct a message the matches the given CTState and send it on the port.
 bool sendControlResult(GCF::TM::GCFPortInterface&	port,
 					   uint16						signal,
diff --git a/MAC/APL/APLCommon/src/ControllerDefines.cc b/MAC/APL/APLCommon/src/ControllerDefines.cc
index bc70abd9ca4..ba80f725ad8 100644
--- a/MAC/APL/APLCommon/src/ControllerDefines.cc
+++ b/MAC/APL/APLCommon/src/ControllerDefines.cc
@@ -27,9 +27,8 @@
 #include <Common/LofarLogger.h>
 #include <Common/StringUtil.h>					// rtrim
 #include <Common/SystemUtil.h>
-#include <Common/ParameterSet.h>					// indexValue
+#include <ApplCommon/LofarDirs.h>
 #include <APL/APLCommon/ControllerDefines.h>
-#include <ApplCommon/StationInfo.h>
 #include "Controller_Protocol.ph"
 
 #include <boost/config.hpp>
@@ -160,26 +159,6 @@ bool	isSharedController(uint16		cntlrType)
 	return (controllerTable[cntlrType].shared);
 }
 
-//
-// getObservationNr(controllerName)
-//
-// Get the ObservationNr from the controllername.
-uint32	getObservationNr (const string&	controllerName)
-{
-	return (indexValue(controllerName, "{}"));
-}
-
-//
-// getInstanceNr(controllername)
-//
-// Get the instanceNr from the controllername.
-uint16	getInstanceNr (const string&	controllerName)
-{
-	string		cntlrName (controllerName);		// destroyable copy
-	rtrim(cntlrName, "{}0123456789");
-	return (indexValue(cntlrName, "[]"));
-}
-
 //
 // getControllerType(controllerName)
 //
@@ -230,140 +209,6 @@ string observationParset(int	obsID)
 	return (formatString("%s/%s", LOFAR_SHARE_LOCATION, observationName(obsID).c_str()));
 }
 
-//
-// createPropertySetName(propSetMask)
-//
-//  A PropSetMask may contain the markers:
-//	@ring@
-//	@station@
-//  @instance@
-//	@observation@
-//	@cabinet@
-//	@subrack@
-//	@RSPboard@
-//	@TBboard@
-//	@rcu@
-//      @bgp@
-//      @midplane@
-//      @ionode@
-//      @osrack@
-//      @ossubcluster@
-//      @storagenode@
-//      @offlinenode@
-//  @inputbuffer@
-//  @adder@
-//  @storage@
-//  @cobaltnode@
-//  @cobaltnic@
-//  @oscobaltnode@
-//  @pscobaltnode@
-//  @cobaltgpuproc@
-//
-string	createPropertySetName(const string&		propSetMask,
-							  const string&		controllerName,
-							  const string&		realDPname)
-{
-	string	psName(propSetMask);		// editable copy
-	string::size_type	pos;
-	// when name contains @ring@_@station@ cut out this marker and prepend hostname
-	// stationname+:  -> LOFAR_ObsSW_@ring@_@station@_CalCtrl_xxx --> CS010:LOFAR_ObsSW_CalCtrl_xxx
-	if ((pos = psName.find("@ring@_@station@_")) != string::npos) {
-		psName.erase(pos, 17);
-		psName = PVSSDatabaseName(myHostname(false)) + ":" + psName;
-	}
-
-	if ((pos = psName.find("@ring@")) != string::npos) {
-		psName.replace(pos, 6, stationRingName());
-	}
-
-	if ((pos = psName.find("@station@")) != string::npos) {
-		psName.replace(pos, 9, PVSSDatabaseName(myHostname(false)));
-	}
-
-	if ((pos = psName.find("@instance@")) != string::npos) {
-		uint16	instanceNr = getInstanceNr(controllerName);
-		if (instanceNr) {
-			psName.replace(pos, 10, lexical_cast<string>(instanceNr));
-		}
-		else {
-			psName.replace(pos, 10, "");	
-		}
-	}
-
-	if ((pos = psName.find("LOFAR_ObsSW_@observation@")) != string::npos) {
-		psName.replace(pos, 25, realDPname);
-	}
-
-	if ((pos = psName.find("@cabinet@")) != string::npos) {
-		psName.replace(pos, 9, string("Cabinet%d"));
-	}
-	if ((pos = psName.find("@subrack@")) != string::npos) {
-		psName.replace(pos, 9, string("Subrack%d"));
-	}
-	if ((pos = psName.find("@RSPBoard@")) != string::npos) {
-		psName.replace(pos, 10, string("RSPBoard%d"));
-	}
-	if ((pos = psName.find("@TBBoard@")) != string::npos) {
-		psName.replace(pos, 9, string("TBBoard%d"));
-	}
-	if ((pos = psName.find("@rcu@")) != string::npos) {
-		psName.replace(pos, 5, string("RCU%d"));
-	}
-	if ((pos = psName.find("@bgp@")) != string::npos) {
-		psName.replace(pos, 5, string("BGP%d"));
-	}
-	if ((pos = psName.find("@midplane@")) != string::npos) {
-		psName.replace(pos, 10, string("Midplane%d"));
-	}
-	if ((pos = psName.find("@ionode@")) != string::npos) {
-		psName.replace(pos, 8, string("IONode%02d"));
-	}
-	if ((pos = psName.find("@osionode@")) != string::npos) {
-		psName.replace(pos, 10, string("OSIONode%02d"));
-	}
-	if ((pos = psName.find("@locusnode@")) != string::npos) {
-		psName.replace(pos, 11, string("LocusNode%03d"));
-	}
-	if ((pos = psName.find("@osrack@")) != string::npos) {
-		psName.replace(pos, 8, string("OSRack%d"));
-	}
-	if ((pos = psName.find("@ossubcluster@")) != string::npos) {
-		psName.replace(pos, 14, string("OSSubcluster%d"));
-	}
-	if ((pos = psName.find("@storagenode@")) != string::npos) {
-		psName.replace(pos, 13, string("StorageNode%d"));
-	}
-	if ((pos = psName.find("@offlinenode@")) != string::npos) {
-		psName.replace(pos, 13, string("OfflineNode%d"));
-	}
-	if ((pos = psName.find("@inputbuffer@")) != string::npos) {
-		psName.replace(pos, 13, string("InputBuffer%d"));
-	}
-	if ((pos = psName.find("@adder@")) != string::npos) {
-		psName.replace(pos, 7, string("Adder%d"));
-	}
-	if ((pos = psName.find("@storage@")) != string::npos) {
-		psName.replace(pos, 9, string("Storage%d"));
-	}
-	if ((pos = psName.find("@cobaltnode@")) != string::npos) {
-		psName.replace(pos, 12, string("CBT%03d"));
-	}
-	if ((pos = psName.find("@cobaltnic@")) != string::npos) {
-		psName.replace(pos, 11, string("CobaltNIC%02d"));
-	}
-	if ((pos = psName.find("@oscobaltnode@")) != string::npos) {
-		psName.replace(pos, 14, string("OSCBT%03d"));
-	}
-	if ((pos = psName.find("@pscobaltnode@")) != string::npos) {
-		psName.replace(pos, 14, string("PSCBT%03d"));
-	}
-	if ((pos = psName.find("@cobaltgpuproc@")) != string::npos) {
-		psName.replace(pos, 15, string("CobaltGPUProc%02d"));
-	}
-		
-	return (psName);
-}
-
 //
 // sendControlResult(port, CONTROLsignal, cntlrName, result)
 //
diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.cc b/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.cc
index 350d5f831a1..c37e4133906 100644
--- a/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.cc
+++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/BlueGeneMonitor.cc
@@ -25,14 +25,13 @@
 #include <Common/LofarLocators.h>
 #include <Common/StringUtil.h>
 #include <Common/ParameterSet.h>
+#include <ApplCommon/StationInfo.h>
 
 #include <GCF/PVSS/GCF_PVTypes.h>
 #include <GCF/PVSS/PVSSinfo.h>
 #include <MACIO/MACServiceInfo.h>
-#include <APL/APLCommon/ControllerDefines.h>
 #include <APL/RTDBCommon/RTDButilities.h>
 #include <GCF/RTDB/DP_Protocol.ph>
-//#include <APL/APLCommon/StationInfo.h>
 #include <errno.h>
 #include <signal.h>
 #include <unistd.h>	// usleep
@@ -45,7 +44,6 @@
 #define MAX2(a,b)	((a) > (b)) ? (a) : (b)
 
 namespace LOFAR {
-	using namespace APLCommon;
 	using namespace APL::RTDBCommon;
 	using namespace GCF::TM;
 	using namespace GCF::PVSS;
diff --git a/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.cc b/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.cc
index 20fffaa8bea..3df9e8519bb 100644
--- a/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.cc
+++ b/MAC/APL/CEPCU/src/CEPHardwareMonitor/ClusterMonitor.cc
@@ -26,14 +26,13 @@
 #include <Common/lofar_vector.h>
 #include <Common/StringUtil.h>
 #include <Common/ParameterSet.h>
+#include <ApplCommon/StationInfo.h>
 
 #include <GCF/PVSS/GCF_PVTypes.h>
 #include <GCF/PVSS/PVSSinfo.h>
 #include <MACIO/MACServiceInfo.h>
-#include <APL/APLCommon/ControllerDefines.h>
 #include <APL/RTDBCommon/RTDButilities.h>
 #include <GCF/RTDB/DP_Protocol.ph>
-//#include <APL/APLCommon/StationInfo.h>
 #include <errno.h>
 #include <signal.h>
 #include <unistd.h>	// usleep
@@ -46,7 +45,6 @@
 #define MAX2(a,b)	((a) > (b)) ? (a) : (b)
 
 namespace LOFAR {
-	using namespace APLCommon;
 	using namespace APL::RTDBCommon;
 	using namespace GCF::TM;
 	using namespace GCF::PVSS;
diff --git a/MAC/APL/CURTDBDaemons/src/PVSSGateway/PVSSGateway.cc b/MAC/APL/CURTDBDaemons/src/PVSSGateway/PVSSGateway.cc
index 62a4e0adf20..073a02770b2 100644
--- a/MAC/APL/CURTDBDaemons/src/PVSSGateway/PVSSGateway.cc
+++ b/MAC/APL/CURTDBDaemons/src/PVSSGateway/PVSSGateway.cc
@@ -21,11 +21,11 @@
 //#  $Id: PVSSGateway.cc 23417 2012-12-20 14:06:29Z loose $
 
 #include <lofar_config.h>
-#include <ApplCommon/PosixTime.h>
 #include <Common/LofarLogger.h>
 #include <Common/Version.h>
 #include <Common/ParameterSet.h>
-#include <APL/APLCommon/ControllerDefines.h>
+#include <ApplCommon/PosixTime.h>
+#include <ApplCommon/StationInfo.h>
 #include <MACIO/GCF_Event.h>
 #include <MACIO/MACServiceInfo.h>
 #include <MACIO/KVT_Protocol.ph>
@@ -40,7 +40,6 @@
 
 namespace LOFAR {
   using namespace MACIO;
-  using namespace APLCommon;
   namespace GCF {
     using namespace TM;
     using namespace PVSS;
diff --git a/MAC/APL/StationCU/src/ClockControl/ClockControl.cc b/MAC/APL/StationCU/src/ClockControl/ClockControl.cc
index 65423c1a981..c551aec3044 100644
--- a/MAC/APL/StationCU/src/ClockControl/ClockControl.cc
+++ b/MAC/APL/StationCU/src/ClockControl/ClockControl.cc
@@ -26,6 +26,7 @@
 
 #include <Common/ParameterSet.h>
 #include <ApplCommon/StationConfig.h>
+#include <ApplCommon/StationInfo.h>
 #include <MACIO/MACServiceInfo.h>
 #include <GCF/PVSS/GCF_PVTypes.h>
 #include <APL/APLCommon/APL_Defines.h>
diff --git a/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc b/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc
index adcc499e5fb..74ccce3700a 100644
--- a/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc
+++ b/MAC/APL/StationCU/src/HardwareMonitor/ECMonitor.cc
@@ -26,18 +26,17 @@
 #include <Common/LofarConstants.h>
 #include <Common/StringUtil.h>
 #include <Common/hexdump.h>
+#include <ApplCommon/StationInfo.h>
 
 #include <GCF/PVSS/GCF_PVTypes.h>
 #include <GCF/PVSS/PVSSinfo.h>
 #include <MACIO/MACServiceInfo.h>
-#include <APL/APLCommon/ControllerDefines.h>
 #include <APL/APLCommon/APLUtilities.h>
 #include <ApplCommon/StationConfig.h>
 #include <APL/RTDBCommon/RTDButilities.h>
 #include <EC_Protocol.ph>
 #include <GCF/RTDB/DP_Protocol.ph>
 #include <GCF/TM/GCF_RawPort.h>
-//#include <APL/APLCommon/StationInfo.h>
 #include <signal.h>
 
 #include "ECMonitor.h"
diff --git a/MAC/APL/StationCU/src/HardwareMonitor/RSPMonitor.cc b/MAC/APL/StationCU/src/HardwareMonitor/RSPMonitor.cc
index 91b483e3cc1..921c4039edb 100644
--- a/MAC/APL/StationCU/src/HardwareMonitor/RSPMonitor.cc
+++ b/MAC/APL/StationCU/src/HardwareMonitor/RSPMonitor.cc
@@ -25,16 +25,15 @@
 #include <Common/LofarLocators.h>
 #include <Common/StringUtil.h>
 #include <Common/ParameterSet.h>
+#include <ApplCommon/StationInfo.h>
 
 #include <GCF/PVSS/GCF_PVTypes.h>
 #include <GCF/PVSS/PVSSinfo.h>
 #include <MACIO/MACServiceInfo.h>
-#include <APL/APLCommon/ControllerDefines.h>
 #include <APL/APLCommon/AntennaMapper.h>
 #include <APL/RTDBCommon/RTDButilities.h>
 #include <APL/RSP_Protocol/RSP_Protocol.ph>
 #include <GCF/RTDB/DP_Protocol.ph>
-//#include <APL/APLCommon/StationInfo.h>
 #include <signal.h>
 #include <unistd.h>	// usleep
 
diff --git a/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.cc b/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.cc
index e6ecabf7565..c7d1c9d0f62 100644
--- a/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.cc
+++ b/MAC/APL/StationCU/src/HardwareMonitor/TBBMonitor.cc
@@ -23,15 +23,14 @@
 #include <Common/LofarLogger.h>
 #include <Common/LofarConstants.h>
 #include <Common/StringUtil.h>
+#include <ApplCommon/StationInfo.h>
 
 #include <GCF/PVSS/GCF_PVTypes.h>
 #include <MACIO/MACServiceInfo.h>
-#include <APL/APLCommon/ControllerDefines.h>
 #include <APL/APLCommon/APLUtilities.h>
 #include <APL/RTDBCommon/RTDButilities.h>
 #include <APL/TBB_Protocol/TBB_Protocol.ph>
 #include <GCF/RTDB/DP_Protocol.ph>
-//#include <APL/APLCommon/StationInfo.h>
 #include <signal.h>
 
 #include "TBBMonitor.h"
diff --git a/MAC/APL/StationCU/src/StationControl/ActiveObs.cc b/MAC/APL/StationCU/src/StationControl/ActiveObs.cc
index 524673d378e..8323c99fbcc 100644
--- a/MAC/APL/StationCU/src/StationControl/ActiveObs.cc
+++ b/MAC/APL/StationCU/src/StationControl/ActiveObs.cc
@@ -32,10 +32,10 @@
 #include <Common/LofarLogger.h>
 #include <Common/SystemUtil.h>
 #include <ApplCommon/StationConfig.h>
+#include <ApplCommon/StationInfo.h>
 #include <GCF/PVSS/GCF_PVTypes.h>
 #include <GCF/TM/GCF_Protocols.h>
 #include <APL/APLCommon/ChildControl.h>
-#include <APL/APLCommon/ControllerDefines.h>
 #include <APL/APLCommon/Controller_Protocol.ph>
 #include <GCF/RTDB/DP_Protocol.ph>
 #include "PVSSDatapointDefs.h"
-- 
GitLab