[PATCH 11 of 13] WstValueTable: Add method to find out wether the Qs are 'fake'

Wald Commits scm-commit at wald.intevation.org
Mon Aug 26 15:27:20 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1377523977 -7200
# Node ID 254a3f3556eedd356ca32b77e54c954ede6082a3
# Parent  6fb355b87f504022069ed0cb14ceca4df8cb11d6
WstValueTable: Add method to find out wether the Qs are 'fake'
This happens in import process when no Q values are found (they are
set to zero). As consequence, these datasets can only be drawn
as markers to an axis.

diff -r 6fb355b87f50 -r 254a3f3556ee artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java	Mon Aug 26 15:28:46 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java	Mon Aug 26 15:32:57 2013 +0200
@@ -1275,6 +1275,27 @@
     }
 
 
+    /** True if no QRange is given or Q equals zero. */
+    public boolean hasEmptyQ() {
+        for (Column column: columns) {
+            if (column.getQRangeTree() == null) {
+                return true;
+            }
+            else {
+                if (Math.abs(column.getQRangeTree().maxQ()) <= 0.01d) {
+                    return true;
+                }
+            }
+        }
+
+        if (columns.length == 0) {
+            log.warn("No columns in WstValueTable.");
+        }
+
+        return false;
+    }
+
+
     /** Find ranges that are between km1 and km2 (inclusive?) */
     public List<Range> findSegments(double km1, double km2) {
         return columns.length != 0


More information about the Dive4elements-commits mailing list