From e68b46465b9b74dfbf384295e0843bd3fd2ac2f8 Mon Sep 17 00:00:00 2001
From: Martin Gels <gels@astron.nl>
Date: Mon, 29 Jan 2007 13:48:05 +0000
Subject: [PATCH] BugID: 1005

In process() first call calculateDelays() and the increment the loop counter.
Otherwise an incorrect assertion happens.
---
 .../src/WH_DelayCompensation.cc                      | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/Appl/CEP/CS1/CS1_DelayCompensation/src/WH_DelayCompensation.cc b/Appl/CEP/CS1/CS1_DelayCompensation/src/WH_DelayCompensation.cc
index 281111d455c..95503eccdb1 100644
--- a/Appl/CEP/CS1/CS1_DelayCompensation/src/WH_DelayCompensation.cc
+++ b/Appl/CEP/CS1/CS1_DelayCompensation/src/WH_DelayCompensation.cc
@@ -90,7 +90,6 @@ namespace LOFAR
     void WH_DelayCompensation::preprocess()
     {
       LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
-
       itsLoopCount = 0;
 
       // Create the AMC converter.
@@ -110,15 +109,15 @@ namespace LOFAR
 
     void WH_DelayCompensation::process()
     {
-      // Start by incrementing the loop count
-      itsLoopCount++;
-      
-      LOG_TRACE_LIFETIME_STR(TRACE_LEVEL_FLOW, "count = " << itsLoopCount);
 
       // Calculate the delays for the epoch after the end of the current time
       // interval. Put the results in itsDelaysAtBegin and itsDelaysAfterEnd.
       calculateDelays();
-      
+
+      // Incrementing the loop count
+      LOG_TRACE_LIFETIME_STR(TRACE_LEVEL_FLOW, "count = " << itsLoopCount);
+      itsLoopCount++;
+            
       // The delays -- split into a coarse (sample) delay and a fine
       // (subsample) delay -- need to be put into a DelayInfo struct.
       vector<DH_Delay::DelayInfo> delayInfo(itsNrDelays);
@@ -163,7 +162,6 @@ namespace LOFAR
     void WH_DelayCompensation::postprocess()
     {
       LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
-
       // Delete the AMC converter
       ASSERT(itsConverter);
       delete itsConverter;
-- 
GitLab