changeset 5905:0c61dba8c0de

flys/issue1244 Historical discharge curve: Suppress current discharge curve.
author Sascha L. Teichmann <teichmann@intevation.de>
date Mon, 06 May 2013 17:53:22 +0200
parents 1272d52e052e
children 8025cb45c31a e76fceaf84fc
files artifacts/src/main/java/org/dive4elements/river/artifacts/services/DischargeInfoService.java
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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);
         }

http://dive4elements.wald.intevation.org