changeset 8310:e3a8aa6eee32

Make SQ-relations loadable in WQ-diagrams.
author "Tom Gottfried <tom@intevation.de>"
date Tue, 23 Sep 2014 16:45:47 +0200
parents 4acf7cff7355
children 5294660df81b
files artifacts/doc/conf/generators/discharge-diagram-defaults.xml artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java artifacts/src/main/java/org/dive4elements/river/exports/injector/ComputedDischargeInjector.java
diffstat 3 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/generators/discharge-diagram-defaults.xml	Tue Sep 23 15:07:39 2014 +0200
+++ b/artifacts/doc/conf/generators/discharge-diagram-defaults.xml	Tue Sep 23 16:45:47 2014 +0200
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <discharge-defaults>
     <axis name="W"/>
+    <axis name="Transport" logarithmic="true"/>
     <domain-axis key="chart.discharge.xaxis.label" default="Q [kubikmeter]"/>
     <processor class="org.dive4elements.river.exports.process.DischargeProcessor" axis="W"/>
     <processor class="org.dive4elements.river.exports.process.MiscDischargeProcessor" axis="W"/>
@@ -8,4 +9,5 @@
     <processor class="org.dive4elements.river.exports.process.HistoricalDischargeProcessor" axis="W"/>
     <processor class="org.dive4elements.river.exports.process.FixWQProcessor" axis="W"/>
     <processor class="org.dive4elements.river.exports.process.FixDerivedProcessor" axis="W"/>
+    <processor class="org.dive4elements.river.exports.process.SQRelationProcessor" axis="Transport"/>
 </discharge-defaults>
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java	Tue Sep 23 15:07:39 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java	Tue Sep 23 16:45:47 2014 +0200
@@ -133,7 +133,7 @@
         }
 
         if (from == null) {
-            log.warn("No 'from' found. assume max of river.");
+            log.warn("No 'from' found. Assume min of river.");
             return getRiver().determineMinMaxDistance()[0];
         }
 
@@ -152,7 +152,7 @@
         }
 
         if (to == null) {
-            log.warn("No 'to' found. assume max of river.");
+            log.warn("No 'to' found. Assume max of river.");
             return getRiver().determineMinMaxDistance()[1];
         }
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/injector/ComputedDischargeInjector.java	Tue Sep 23 15:07:39 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/injector/ComputedDischargeInjector.java	Tue Sep 23 16:45:47 2014 +0200
@@ -28,7 +28,9 @@
         Document doc
     ) {
         RangeAccess access = new RangeAccess((D4EArtifact)artifact);
-        double km = access.getFrom();
-        ctx.putContextValue(CURRENT_KM, km);
+        if (access.hasFrom()) {
+            double km = access.getFrom();
+            ctx.putContextValue(CURRENT_KM, km);
+        }
     }
 }

http://dive4elements.wald.intevation.org