From 94a8cd63b5fa4a954bcaf5da32b61dc827edf173 Mon Sep 17 00:00:00 2001
From: Ruud Overeem <overeem@astron.nl>
Date: Tue, 31 Jul 2007 07:16:31 +0000
Subject: [PATCH] BugID: 826 CS1Hack. Saving the name of the observation
 parsetfile so that it can be passed to the python script we call during the
 creation of the parametersubsets.

---
 LCS/ACC/ACCbin/include/ACCbin/ApplController.h | 3 +++
 LCS/ACC/ACCbin/src/ApplController.cc           | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/LCS/ACC/ACCbin/include/ACCbin/ApplController.h b/LCS/ACC/ACCbin/include/ACCbin/ApplController.h
index 6ebcc954389..e50a95c6ca5 100644
--- a/LCS/ACC/ACCbin/include/ACCbin/ApplController.h
+++ b/LCS/ACC/ACCbin/include/ACCbin/ApplController.h
@@ -111,6 +111,9 @@ private:
 	ProcRuler			itsProcRuler;		// Starts/stops all AP's
 
 	uint16				itsNrOfProcs;		// Nr of processes to manage.
+
+	// TODO: REMOVE THIS CS1 HACK
+	string				itsObsPSfilename;	// name of observation parameterset.
 };
 
 // @} addgroup
diff --git a/LCS/ACC/ACCbin/src/ApplController.cc b/LCS/ACC/ACCbin/src/ApplController.cc
index f0dc8064bba..abe33d9b6bf 100644
--- a/LCS/ACC/ACCbin/src/ApplController.cc
+++ b/LCS/ACC/ACCbin/src/ApplController.cc
@@ -263,7 +263,8 @@ void ApplController::createParSubsets()
 		// by a python script, for final LOFAR we need to do this in SAS.
 		if (procPrefix == "InputAppl.Transpose") {
 			LOG_DEBUG("CS1_SPECIAL: calling prepare_CS1_InputSection.py");
-			nrProcs = system("/opt/lofar/bin/prepare_CS1_InputSection.py")/256;
+			string	command("/opt/lofar/bin/prepare_CS1_InputSection.py --parsetfile " + itsObsPSfilename);
+			nrProcs = system(command.c_str())/256;
 			LOG_DEBUG_STR("nrOfProcesses calculated by script = " << nrProcs);
 		}
         
@@ -438,6 +439,9 @@ void ApplController::startCmdState()
 	case StateInitController:
 		// read in the Application Parameter file
 		itsObsParamSet->adoptFile(itsCurACMsg->getOptions());// May throw
+		// CS1_HACK save name of parameterfile
+		itsObsPSfilename = itsCurACMsg->getOptions();
+		LOG_DEBUG_STR("Observation parsetfilename=" << itsObsPSfilename);
 		// StateEngine needs to know the timeout values for the states
 		itsStateEngine->init(itsObsParamSet);
 		itsStateEngine->ready();				// report this state is ready.
@@ -454,7 +458,7 @@ void ApplController::startCmdState()
 		// the incomming acks decide the result of the start action
 		break;
 	case StateKillAppl:
-		sleep (10);								// give procs some extra time
+		sleep (5);								// give procs some extra time
 		itsProcRuler.stopAll();
 		itsStateEngine->ready();				// report this state is ready.
 		break;
-- 
GitLab