changeset 1680:f4da2009eb8b

fixed flys/issue177 flys-artifacts/trunk@2897 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Wed, 05 Oct 2011 15:04:00 +0000
parents 69929c471646
children e5f7f25a511c
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java
diffstat 2 files changed, 37 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Wed Oct 05 14:23:53 2011 +0000
+++ b/flys-artifacts/ChangeLog	Wed Oct 05 15:04:00 2011 +0000
@@ -1,3 +1,10 @@
+2011-10-05	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	fixed flys/issue177
+
+	* src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java:
+	  Revert rev2245. Code works fine now! :-)
+
 2011-10-05  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/jfree/FLYSAnnotation.java: Stores a
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java	Wed Oct 05 14:23:53 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/DischargeCurveGenerator.java	Wed Oct 05 15:04:00 2011 +0000
@@ -149,37 +149,37 @@
 
 
     protected String getSeriesName(Gauge gauge) {
-        // XXX The following code stops the artifact server accepting new HTTP
-        // requests. It needs more analysis! Is loading the discharge table a
-        // memory problem? Or is the time interval the problem?
-
-        //List<DischargeTable> dts = gauge.getDischargeTables();
-
-        //for (DischargeTable dt: dts) {
-        //    if (dt.getKind() == 0) {
-        //        TimeInterval ti = dt.getTimeInterval();
-
-        //        Date start = ti.getStartTime();
-        //        Date end   = ti.getStopTime();
-
-        //        String name  = gauge.getName();
+         //XXX The following code stops the artifact server accepting new HTTP
+         //requests. It needs more analysis! Is loading the discharge table a
+         //memory problem? Or is the time interval the problem?
 
-        //        if (end == null) {
-        //            Object[] args = new Object[] { name, start };
-        //            return msg(
-        //                "chart.discharge.curve.curve.valid.from",
-        //                "",
-        //                args);
-        //        }
-        //        else {
-        //            Object[] args = new Object[] { name, start, end };
-        //            return msg(
-        //                "chart.discharge.curve.curve.valid.range",
-        //                "",
-        //                args);
-        //        }
-        //    }
-        //}
+        List<DischargeTable> dts = gauge.getDischargeTables();
+
+        for (DischargeTable dt: dts) {
+            if (dt.getKind() == 0) {
+                TimeInterval ti = dt.getTimeInterval();
+
+                Date start = ti.getStartTime();
+                Date end   = ti.getStopTime();
+
+                String name  = gauge.getName();
+
+                if (end == null) {
+                    Object[] args = new Object[] { name, start };
+                    return msg(
+                        "chart.discharge.curve.curve.valid.from",
+                        "",
+                        args);
+                }
+                else {
+                    Object[] args = new Object[] { name, start, end };
+                    return msg(
+                        "chart.discharge.curve.curve.valid.range",
+                        "",
+                        args);
+                }
+            }
+        }
 
         return gauge.getName();
     }

http://dive4elements.wald.intevation.org