changeset 6393:a8a97f27ca27

Draw sediment load fraction 'unknown' in chart.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 21 Jun 2013 15:36:48 +0200
parents 9a0f8d532797
children cf4889a257cb
files artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java
diffstat 1 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java	Fri Jun 21 15:35:44 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java	Fri Jun 21 15:36:48 2013 +0200
@@ -9,6 +9,7 @@
 package org.dive4elements.river.exports.minfo;
 
 import java.util.Arrays;
+import java.util.Set;
 
 import org.apache.log4j.Logger;
 import org.jfree.data.xy.XYSeries;
@@ -24,6 +25,8 @@
 import org.dive4elements.river.artifacts.model.WKms;
 import org.dive4elements.river.artifacts.model.minfo.BedDiffEpochResult;
 import org.dive4elements.river.artifacts.model.minfo.BedDiffYearResult;
+import org.dive4elements.river.artifacts.model.minfo.SedimentLoad;
+import org.dive4elements.river.artifacts.model.minfo.SedimentLoadFraction;
 import org.dive4elements.river.exports.StyledSeriesBuilder;
 import org.dive4elements.river.exports.XYChartGenerator;
 import org.dive4elements.river.jfree.Bounds;
@@ -145,6 +148,13 @@
                 attr,
                 visible);
         }
+        else if (FacetTypes.IS.SEDIMENT_LOAD_UNKNOWN(name)) {
+            doSedimentLoadUnknownOut(
+                (SedimentLoad)bundle.getData(context),
+                bundle,
+                attr,
+                visible);
+        }
         else if (name.equals(FLOW_VELOCITY_TOTALCHANNEL)) {
             doFlowVelocityTotalOut(
                 (FlowVelocityData) bundle.getData(context),
@@ -257,6 +267,24 @@
         addAxisSeries(series, YAXIS.L.idx, visible);
     }
 
+    protected void doSedimentLoadUnknownOut(SedimentLoad load,
+        ArtifactAndFacet aandf, Document theme, boolean visible) {
+
+        Set<Double> kms = load.getKms();
+        double[][] data = new double[2][kms.size()];
+        int counter = 0;
+        for (Double km: kms) {
+            SedimentLoadFraction fraction = load.getFraction(km);
+            data[0][counter] = km;
+            data[1][counter] = fraction.getUnknown();
+            counter++;
+        }
+        XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
+        StyledSeriesBuilder.addPoints(series, data, false);
+
+        addAxisSeries(series, YAXIS.L.idx, visible);
+    }
+
     protected void doFlowVelocityMainOut(
         FlowVelocityData data,
         ArtifactAndFacet aandf,

http://dive4elements.wald.intevation.org