changeset 6695:5d071e1cb17c

issue1418: skip MainValues with NaN values.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 29 Jul 2013 15:02:22 +0200
parents 14a18c4c8dea
children c86f5d903205
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java	Mon Jul 29 12:29:40 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesQFacet.java	Mon Jul 29 15:02:22 2013 +0200
@@ -128,6 +128,10 @@
         StickyAxisAnnotation annotation = null;
         if (this.name.equals(DURATION_MAINVALUES_Q)) {
             for (NamedDouble q: qs) {
+                if (Double.isNaN(q.getValue())) {
+                    logger.warn("NaN MainValue " + q.getName());
+                    continue;
+                }
                 annotation =
                     new StickyAxisAnnotation(
                         q.getName(),
@@ -142,6 +146,10 @@
         }
         else {
             for (NamedDouble q: qs) {
+                if (Double.isNaN(q.getValue())) {
+                    logger.warn("NaN MainValue " + q.getName());
+                    continue;
+                }
                 annotation =
                     new StickyAxisAnnotation(
                         q.getName(),
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java	Mon Jul 29 12:29:40 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MainValuesWFacet.java	Mon Jul 29 15:02:22 2013 +0200
@@ -122,6 +122,11 @@
         }
 
         for (NamedDouble w: ws) {
+            logger.debug("W Annotation at " + w.getValue() + " ("+w.getName()+")"+ wqdays);
+            if (Double.isNaN(w.getValue())) {
+                logger.warn("NaN MainValue " + w.getName());
+                continue;
+            }
             StickyAxisAnnotation annotation =
                 new StickyAxisAnnotation(
                     w.getName(),

http://dive4elements.wald.intevation.org