Merge "Issue #1161 Fixed anomaly with RFCFFG and graph QPE times" into development

Former-commit-id: 056e74d3cf [formerly 056e74d3cf [formerly 19dc13a0d5ef2b0fc41300815dd6be34d7001afd]]
Former-commit-id: 83fc018f38
Former-commit-id: 1d0bdbd25c
This commit is contained in:
Lee Venable 2012-09-11 09:15:47 -05:00 committed by Gerrit Code Review
commit 83c441319e
3 changed files with 21 additions and 14 deletions

View file

@ -647,6 +647,13 @@ public class FFMPMonitor extends ResourceMonitor {
Date previousQueryTime = ffmpAvailableUriQueryDates.get(siteKey).get(
sourceName);
SourceXML source = getSourceConfig().getSource(sourceName);
if (source.getSourceType().equals(
SOURCE_TYPE.GUIDANCE.getSourceType())) {
// Always look back for guidance types because of long expiration times,
// prevents mosaic brittleness from occurring.
retrieveNew = true;
}
if (retrieveNew
|| ((time != null) && ((previousQueryTime == null) || (time
@ -2322,14 +2329,11 @@ public class FFMPMonitor extends ResourceMonitor {
final String fsiteKey;
final boolean fisProductLoad;
public FFMPLoadRecord(boolean isProductLoad, String siteKey,
FFMPRecord ffmpRec, String source, String huc) throws Exception {
this.fffmpRec = ffmpRec;
this.fsource = source;
this.fsiteKey = siteKey;
this.fisProductLoad = isProductLoad;
this.fhuc = huc;
}

View file

@ -3339,13 +3339,15 @@ public class FFMPResource extends
ArrayList<Double> qpeTimes = new ArrayList<Double>();
if (qpeBasin != null) {
for (Date date : qpeBasin.getValues().keySet()) {
double dtime = FFMPGuiUtils.getTimeDiff(mostRecentRefTime,
date);
fgd.setQpe(dtime, (double) qpeBasin.getAccumValue(date,
double currVal = qpeBasin.getAccumValue(date,
mostRecentRefTime, getQpeSourceExpiration(),
isRate()));
isRate());
fgd.setQpe(dtime, currVal);
qpeTimes.add(dtime);
}
}

View file

@ -161,11 +161,13 @@ public class FFMPBasin implements ISerializableObject, Cloneable {
ArrayList<Date> keys = new ArrayList<Date>();
for (Date date : values.descendingKeySet()) {
for (Date date : values.keySet()) {
if (date.before(beforeDate) && date.after(afterDate)) {
keys.add(date);
}
}
float factor = 0.0f;
for (Date key : keys) {
Date tdate = key;
@ -179,30 +181,29 @@ public class FFMPBasin implements ISerializableObject, Cloneable {
if (val > 0.0f) {
float factor = 0.0f;
if ((prevDate.getTime() - tdate.getTime()) > expirationTime) {
// handle the gap and accumulate the book ends
// of it
factor = (float) ((prevDate.getTime() - (prevDate
.getTime() - expirationTime)) / (1000.0 * 60.0 * 60.0));
factor = ((prevDate.getTime() - (prevDate
.getTime() - expirationTime)) / (1000.0f * 60.0f * 60.0f));
} else {
factor = (float) ((prevDate.getTime() - tdate
.getTime()) / (1000.0 * 60.0 * 60.0));
factor = ((prevDate.getTime() - tdate
.getTime()) / (1000.0f * 60.0f * 60.0f));
}
// do absolute values so it dosen't matter which way
// you traverse the list
val = val * Math.abs(factor);
}
}
dvalue += val;
prevDate = key;
}
}
}
return dvalue;
}