[Dive4elements-commits] [PATCH] flys/issue1244 Historical discharge curve: Suppress current discharge curve
Wald Commits
scm-commit at wald.intevation.org
Mon May 6 17:53:41 CEST 2013
# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1367855602 -7200
# Node ID 0c61dba8c0de53707b45c28643b7c9801b226819
# Parent 1272d52e052e5da844029e9e6cfd184606f03247
flys/issue1244 Historical discharge curve: Suppress current discharge curve.
diff -r 1272d52e052e -r 0c61dba8c0de artifacts/src/main/java/org/dive4elements/river/artifacts/services/DischargeInfoService.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/DischargeInfoService.java Mon May 06 17:42:46 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/DischargeInfoService.java Mon May 06 17:53:22 2013 +0200
@@ -84,11 +84,14 @@
protected Document buildDocument(Gauge gauge) {
Document result = XMLUtils.newDocument();
- List<DischargeTable> tables =gauge.getDischargeTables();
+ List<DischargeTable> tables = gauge.getDischargeTables();
Collections.sort(tables);
Element all = result.createElement("discharges");
for (DischargeTable dt: tables) {
+ if (dt.getKind() == DischargeTables.MASTER) {
+ continue;
+ }
Element discharge = result.createElement("discharge");
discharge.setAttribute("description", dt.getDescription());
@@ -110,16 +113,13 @@
continue;
}
- if (stopTime != null && dt.getKind() != DischargeTables.MASTER) {
+ if (stopTime != null) {
discharge.setAttribute("end", String.valueOf(stopTime.getTime()));
}
- else if (dt.getKind() == DischargeTables.MASTER) {
+ else {
long now = System.currentTimeMillis();
discharge.setAttribute("end", String.valueOf(now));
}
- else {
- continue;
- }
all.appendChild(discharge);
}
More information about the Dive4elements-commits
mailing list