From 9b19ec5b29ab7a89646060ab8778843dd941d26b Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Thu, 25 Oct 2012 13:03:41 -0500 Subject: [PATCH] Issue #1194 change TimeMatcher so it only uses dtd in cases where dt and dtf are very different. Former-commit-id: 1aa108da3e26e698af4ea0206ca1e7fb1ffcc588 --- .../uf/viz/d2d/core/time/TimeMatcher.java | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/TimeMatcher.java b/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/TimeMatcher.java index 5835596c5c..b98565f68f 100644 --- a/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/TimeMatcher.java +++ b/cave/com.raytheon.uf.viz.d2d.core/src/com/raytheon/uf/viz/d2d/core/time/TimeMatcher.java @@ -651,21 +651,12 @@ public class TimeMatcher { dtd = (rv.intrinsicPeriod * 3) / 2; dataFcsts = rv.haveForecasts; - if (fspatial) { - dtf = dt; - frameFcsts = dataFcsts; - } else { - rv = intrinsicPeriod(frameTimes, frameFcsts); - dtf = rv.intrinsicPeriod; - frameFcsts = rv.haveForecasts; - } + rv = intrinsicPeriod(frameTimes, frameFcsts); + dtf = rv.intrinsicPeriod; + frameFcsts = rv.haveForecasts; - if (dt > ONE_MINUTE_MS && dt <= ELEVEN_MINUTES_MS - && dtf > ONE_MINUTE_MS && dtf <= ELEVEN_MINUTES_MS - && radarOnRadarYes) { - if (dtf < dt) { - dt = dtf; - } + if (fspatial) { + frameFcsts = dataFcsts; } else if (dtf > dt) { dt = dtf; } @@ -683,12 +674,17 @@ public class TimeMatcher { dt++; } - if (dt > dtd || frameTimes[ef].getMatchValid() - latest.getTime() > dtd) { - // The first check makes sure that dtd is always bigger than dt - // since dtd is supposed to add extra padding to the time. The - // second check makes it so that if the latest frameTime is past the - // latest depictTime by more than dtd than we ignore dtd by setting - // it to dt which makes it a no op. + if (dt > dtd || dt < dtf + || frameTimes[ef].getMatchValid() - latest.getTime() > dtd) { + // Three conditions here: + // 1) dtd is supposed to provide extra padding compared to dt, so if + // dt is bigger then set them equal to avoid reducing the padding. + // 2) Clear the extra padding if the acceptable depict time spacing + // is not bigger than the frame time spacing + // 3) Clear the extra padding if the latest frame time is not within + // dtd of the latest depict time + + // setting dtd to dt makes any use of dtd a noop. dtd = dt; }