From a504ef11c88648fdbfedc60e8034efabe007a863 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Tue, 13 Mar 2012 09:00:49 +0000
Subject: [PATCH] Task #2871: Obey the stop time in the parset unless MAC tells
 us otherwise

---
 RTCP/IONProc/src/Job.cc | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/RTCP/IONProc/src/Job.cc b/RTCP/IONProc/src/Job.cc
index 475354b3904..b053bb0de33 100644
--- a/RTCP/IONProc/src/Job.cc
+++ b/RTCP/IONProc/src/Job.cc
@@ -91,7 +91,14 @@ Job::Job(const char *parsetName)
       } catch (Exception &ex) {
         LOG_WARN_STR(itsLogPrefix << "Could not connect to ApplController on " << itsParset.PLC_Host() << ":" << itsParset.PLC_Port() << " as " << itsParset.PLC_ProcID() << " -- continuing on autopilot: " << ex);
       }
+    }
+
+    if (!itsPLCClient) {
+      // we are either not PLC controlled, or we're supposed to be but can't connect to
+      // the ApplController
+      LOG_INFO_STR(itsLogPrefix << "Not controlled by ApplController");
     }  
+
   }
 
   // check enough parset settings just to get to the coordinated check in jobThread safely
@@ -504,18 +511,10 @@ void Job::jobThread()
         canStart = false;
       }
 
-      if (!itsPLCClient) {
-        // we are either not PLC controlled, or we're supposed to be but can't connect to
-        // the ApplController
-        LOG_INFO_STR(itsLogPrefix << "Not controlled by ApplController");
-
-        // perform some functions which ApplController would have us do
-
-        // obey the stop time in the parset -- the first anotherRun() will broadcast it
-        if (!pause(itsParset.stopTime())) {
-          LOG_ERROR_STR(itsLogPrefix << "Could not set observation stop time");
-          canStart = false;
-        }
+      // obey the stop time in the parset -- the first anotherRun() will broadcast it
+      if (!pause(itsParset.stopTime())) {
+        LOG_ERROR_STR(itsLogPrefix << "Could not set observation stop time");
+        canStart = false;
       }
 
       if (canStart) {
-- 
GitLab