From 69bd6e2ed2a6ef66d0b9e6f60bbbd47a06c66940 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: c17578805a465c31de0ee9b3490d582b4c80080e [formerly b01de6a0519448f67e38079a73e45eda10c29c79] [formerly 9bbee1eeacd2e9f336cd51720eef76e5c959ee07 [formerly 8400bc010bce80df375b4d5bbe052297cafdcc99]] [formerly 9b19ec5b29ab7a89646060ab8778843dd941d26b [formerly 8400bc010bce80df375b4d5bbe052297cafdcc99 [formerly 1aa108da3e26e698af4ea0206ca1e7fb1ffcc588]]] Former-commit-id: 9b19ec5b29ab7a89646060ab8778843dd941d26b Former-commit-id: 6d559b2d96230015c6f68945edc7880764314c16 [formerly f65f294d2aec8d988bcbeb610f0635a9a36187aa] Former-commit-id: 884fa10618dcffcd932c70e7ea21adb35bd6359d --- .../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; }