changeset 3588:76571c601d06

Add more discharge curve data to DC and W/Q diag. flys-artifacts/trunk@5204 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 14 Aug 2012 14:02:28 +0000
parents 9dfbd36474b8
children ab447cd29b73
files flys-artifacts/ChangeLog flys-artifacts/doc/conf/artifacts/fixanalysis.xml flys-artifacts/doc/conf/meta-data.xml flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java
diffstat 4 files changed, 61 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Aug 14 13:32:49 2012 +0000
+++ b/flys-artifacts/ChangeLog	Tue Aug 14 14:02:28 2012 +0000
@@ -1,3 +1,13 @@
+2012-08-13	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* doc/conf/artifacts/fixanalysis.xml: Add discharge curve facet to
+	  compat. list.
+
+	* doc/conf/meta-data.xml: Show discharge curves for FixA WQ DC.
+
+	* src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java:
+	  Handle discharge curve data.
+
 2012-08-13	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* doc/conf/artifacts/fixanalysis.xml: Add more facets to compat. list.
--- a/flys-artifacts/doc/conf/artifacts/fixanalysis.xml	Tue Aug 14 13:32:49 2012 +0000
+++ b/flys-artifacts/doc/conf/artifacts/fixanalysis.xml	Tue Aug 14 14:02:28 2012 +0000
@@ -151,6 +151,7 @@
                         <facet name="other.wqkms" description="facet.other.wqkms"/>
                         <facet name="other.wq"    description="Point-like data like fixations"/>
                         <facet name="heightmarks_points" description="facet.other.wkms.heightmarks_points"/>
+                        <facet name="discharge_curve.curve" description="facet.discharge_curve.curve"/>
                     </facets>
                 </outputmode>
                 <outputmode name="fix_deltawt_curve" description="output.fix_deltawt_curve" mine-type="image/png" type="chart">
--- a/flys-artifacts/doc/conf/meta-data.xml	Tue Aug 14 13:32:49 2012 +0000
+++ b/flys-artifacts/doc/conf/meta-data.xml	Tue Aug 14 14:02:28 2012 +0000
@@ -1618,7 +1618,7 @@
                        <dc:statement>
                          SELECT name AS facet_name, num as facet_num, description AS facet_description
                          FROM facets
-                         WHERE out_id = ${out_id} and ( name LIKE 'fix_sector_average_wq%' OR name = 'fix_wq_curve' )
+                         WHERE out_id = ${out_id} and ( name LIKE 'fix_sector_average_wq%' OR name = 'fix_wq_curve' OR name LIKE 'fix_analysis_events_wq%' OR name LIKE 'fix_reference_events_wq%' )
                          ORDER BY num ASC, name DESC
                        </dc:statement>
                        <waterlevels>
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java	Tue Aug 14 13:32:49 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java	Tue Aug 14 14:02:28 2012 +0000
@@ -4,12 +4,14 @@
 import de.intevation.artifactdatabase.state.Facet;
 import de.intevation.flys.artifacts.FLYSArtifact;
 import de.intevation.flys.artifacts.StaticWKmsArtifact;
+import de.intevation.flys.artifacts.WINFOArtifact;
 import de.intevation.flys.artifacts.access.FixAnalysisAccess;
 import de.intevation.flys.artifacts.model.DateRange;
 import de.intevation.flys.artifacts.model.FacetTypes;
 import de.intevation.flys.artifacts.model.NamedDouble;
 import de.intevation.flys.artifacts.model.QWDDateRange;
 import de.intevation.flys.artifacts.model.WKms;
+import de.intevation.flys.artifacts.model.WQKms;
 import de.intevation.flys.artifacts.model.fixings.FixFunction;
 import de.intevation.flys.artifacts.model.fixings.FixWQCurveFacet;
 import de.intevation.flys.artifacts.model.fixings.QW;
@@ -23,6 +25,10 @@
 import de.intevation.flys.jfree.StickyAxisAnnotation;
 import de.intevation.flys.jfree.StyledXYSeries;
 import de.intevation.flys.utils.ThemeUtil;
+import de.intevation.flys.utils.FLYSUtils;
+
+import de.intevation.flys.model.Gauge;
+import de.intevation.flys.model.River;
 
 import org.jfree.chart.plot.Marker;
 import org.jfree.chart.plot.ValueMarker;
@@ -129,6 +135,14 @@
         else if(STATIC_WQ.equals(name)) {
             doWQOut(aaf.getData(context), aaf, doc, visible);
         }
+        else if (name.equals(DISCHARGE_CURVE)) {
+            doDischargeOut(
+                (WINFOArtifact) aaf.getArtifact(),
+                aaf.getData(context),
+                aaf.getFacetDescription(),
+                doc,
+                visible);
+        }
         else {
             logger.warn("Unknown facet name " + name);
             return;
@@ -305,6 +319,41 @@
 
 
     /**
+     * Add series with discharge curve to diagram.
+     */
+    protected void doDischargeOut(
+        WINFOArtifact artifact,
+        Object        o,
+        String        description,
+        Document      theme,
+        boolean       visible)
+    {
+        WQKms wqkms = (WQKms) o;
+
+        String gaugeName = wqkms.getName();
+
+        River river = FLYSUtils.getRiver(artifact);
+
+        if (river == null) {
+            logger.debug("no river found");
+            return;
+        }
+
+        Gauge gauge = river.determineGaugeByName(gaugeName);
+
+        if (gauge == null) {
+            logger.debug("no gauge found");
+            return;
+        }
+
+        XYSeries series = new StyledXYSeries(description, theme);
+
+        StyledSeriesBuilder.addPointsQW(series, wqkms);
+
+        addAxisSeries(series, YAXIS.W.idx, visible);
+    }
+
+    /**
      * Add WQ Data to plot.
      * @param wqkms data as double[][]
      */

http://dive4elements.wald.intevation.org