From e93536cf602086e3b66734c9af99e5256561d39f Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Thu, 27 Aug 2015 09:33:55 +0000 Subject: [PATCH] Task #6883: Only start CLAIMing once per observation --- .../src/StationControl/StationControl.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/MAC/APL/StationCU/src/StationControl/StationControl.cc b/MAC/APL/StationCU/src/StationControl/StationControl.cc index 2b76220f6e3..cb6717d8203 100644 --- a/MAC/APL/StationCU/src/StationControl/StationControl.cc +++ b/MAC/APL/StationCU/src/StationControl/StationControl.cc @@ -785,9 +785,16 @@ GCFEvent::TResult StationControl::startObservation_state(GCFEvent& event, GCFPor switch (event.signal) { case CONTROL_CLAIM: { - // defer the setup to the timer event - itsClaimSequence = 0; - itsClaimTimerPort->setTimer(0.0); + // defer the setup to the timer eventa + // NOTE: StationControl can receive multiple CLAIM requests. Example: + // * We're in CLAIMED + // * Station receives PREPARE (due to state sync errors?) + // * Station will replay PREPARE -> CLAIM + // So we ONLY start the ClaimTimer if the ClaimSequence was not yet started + if (itsClaimSequence == 0) { + itsClaimSequence++; + itsClaimTimerPort->setTimer(0.0); + } } break; @@ -841,7 +848,7 @@ GCFEvent::TResult StationControl::startObservation_state(GCFEvent& event, GCFPor case F_TIMER: { if (&port == itsClaimTimerPort) { switch (itsClaimSequence++) { - case 0: { + case 1: { // Set the clock if (itsClock != itsStartingObs->second->obsPar()->sampleClock) { // Check if all others obs are down otherwise we may not switch the clock @@ -872,7 +879,7 @@ GCFEvent::TResult StationControl::startObservation_state(GCFEvent& event, GCFPor } break; - case 1: { + case 2: { // Set the splitters StationConfig sc; if (!sc.hasSplitters) { @@ -891,7 +898,7 @@ GCFEvent::TResult StationControl::startObservation_state(GCFEvent& event, GCFPor } break; - case 2: { + case 3: { // Set the bit mode if (itsBitmode != itsStartingObs->second->obsPar()->bitsPerSample) { // Check if all others obs are down otherwise we may not switch the bitmode -- GitLab