diff artifacts/src/main/java/org/dive4elements/river/exports/WstWriter.java @ 7604:05549a84ee83

(issue1620) Add export of official lines in WST as specified
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 27 Nov 2013 16:21:00 +0100
parents af13ceeba52a
children edb323a4c286
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/WstWriter.java	Mon Nov 25 17:40:47 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/WstWriter.java	Wed Nov 27 16:21:00 2013 +0100
@@ -230,7 +230,7 @@
      */
     protected boolean dischargesChanged(double[] newQs) {
         // XXX maybe there is a way to do this faster
-        for (int i = 0; i < cols; i++) {
+        for (int i = 0; i < cols && i < qs.length && i < newQs.length; i++) {
             if (Math.abs(newQs[i] - qs[i]) >= 0.001) {
                 return true;
             }
@@ -238,5 +238,12 @@
 
         return false;
     }
+
+    /**
+     * Get the lines that have alreay been added to this writer
+     * lines are a map with km as the key and a wstline as value */
+    public Map<Double, WstLine> getLines() {
+        return lines;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org