changeset 6923:254a3f3556ee

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.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 26 Aug 2013 15:32:57 +0200
parents 6fb355b87f50
children b87240ac9205
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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

http://dive4elements.wald.intevation.org