changeset 3587:9dfbd36474b8

Add more facets to DC and W/Q diag. flys-artifacts/trunk@5203 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 14 Aug 2012 13:32:49 +0000
parents 5cb5a9edc251
children 76571c601d06
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, 74 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Aug 14 08:42:29 2012 +0000
+++ b/flys-artifacts/ChangeLog	Tue Aug 14 13:32:49 2012 +0000
@@ -1,3 +1,12 @@
+2012-08-13	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
+
+	* doc/conf/artifacts/fixanalysis.xml: Add more facets to compat. list.
+
+	* doc/conf/meta-data.xml: Show more additional data in FixA w/q-diag.
+
+	* src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java:
+	  Handle new, annotation-type facets.
+
 2012-08-13	Felix Wolfsteller	<felix.wolfsteller@intevation.de>
 
 	* doc/conf/artifacts/fixanalysis.xml: Added wqkms facets to comp. list.
--- a/flys-artifacts/doc/conf/artifacts/fixanalysis.xml	Tue Aug 14 08:42:29 2012 +0000
+++ b/flys-artifacts/doc/conf/artifacts/fixanalysis.xml	Tue Aug 14 13:32:49 2012 +0000
@@ -145,8 +145,12 @@
                         <facet name="fix_wq_curve" description="WQ curve"/>
                         <facet name="qsectors" description="qsectors."/>
                         <facet name="fix_outlier" description="The outliers"/>
+                        <facet name="other.wqkms.q"          description="W-Type of data" />
+                        <facet name="other.wqkms.w"          description="W-Type of data" />
+                        <facet name="other.wkms" description="facet.other.wqkms"/>
                         <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"/>
                     </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 08:42:29 2012 +0000
+++ b/flys-artifacts/doc/conf/meta-data.xml	Tue Aug 14 13:32:49 2012 +0000
@@ -656,6 +656,10 @@
                <dc:if test="dc:contains($artifact-outs, 'fix_wq_curve')">
                  <dc:call-macro name="basedata_0_wq"/>
                  <dc:call-macro name="basedata_1_additionals"/>
+                 <dc:call-macro name="basedata_2_fixations"/>
+                 <dc:call-macro name="basedata_3_officials"/>
+                 <dc:call-macro name="basedata_4_heightmarks-points"/>
+                 <dc:call-macro name="basedata_5_flood-protections_relative_points"/>
                </dc:if>
                <dc:if test="dc:contains($artifact-outs, 'fix_deltawt_curve')">
                </dc:if>
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java	Tue Aug 14 08:42:29 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java	Tue Aug 14 13:32:49 2012 +0000
@@ -1,12 +1,15 @@
 package de.intevation.flys.exports.fixings;
 
 import de.intevation.artifactdatabase.state.ArtifactAndFacet;
+import de.intevation.artifactdatabase.state.Facet;
 import de.intevation.flys.artifacts.FLYSArtifact;
+import de.intevation.flys.artifacts.StaticWKmsArtifact;
 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.fixings.FixFunction;
 import de.intevation.flys.artifacts.model.fixings.FixWQCurveFacet;
 import de.intevation.flys.artifacts.model.fixings.QW;
@@ -17,6 +20,7 @@
 import de.intevation.flys.jfree.CollisionFreeXYTextAnnotation;
 import de.intevation.flys.jfree.FLYSAnnotation;
 import de.intevation.flys.jfree.JFreeUtil;
+import de.intevation.flys.jfree.StickyAxisAnnotation;
 import de.intevation.flys.jfree.StyledXYSeries;
 import de.intevation.flys.utils.ThemeUtil;
 
@@ -113,6 +117,15 @@
         else if(QSECTOR.equals(name)) {
             doQSectorOut(aaf, doc, visible);
         }
+        else if(STATIC_WKMS_INTERPOL.equals(name) ||
+                STATIC_WKMS.equals(name) ||
+                HEIGHTMARKS_POINTS.equals(name) ) {
+            doWAnnotations(
+                    aaf.getData(context),
+                    aaf,
+                    doc,
+                    visible);
+        }
         else if(STATIC_WQ.equals(name)) {
             doWQOut(aaf.getData(context), aaf, doc, visible);
         }
@@ -247,6 +260,50 @@
         }
     }
 
+   /**
+     * Add W-Annotations to plot.
+     * @param wqkms actual data (double[][]).
+     * @param theme theme to use.
+     */
+    protected void doWAnnotations(
+        Object   wqkms,
+        ArtifactAndFacet aandf,
+        Document theme,
+        boolean  visible
+    ) {
+        Facet facet = aandf.getFacet();
+
+        List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>();
+        if (wqkms instanceof double[][]) {
+            logger.debug("Got double[][]");
+            double [][] data = (double [][]) wqkms;
+            for (int i = 0; i< data[0].length; i++) {
+                xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(),
+                    (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS));
+            }
+
+            doAnnotations(new FLYSAnnotation(facet.getDescription(), xy),
+                aandf, theme, visible);
+        }
+        else {
+            // Assume its WKms.
+            logger.debug("Got WKms");
+            WKms data = (WKms) wqkms;
+            Double ckm = (Double) context.getContextValue("currentKm");
+            double location = (ckm != null)
+                              ? ckm.doubleValue()
+                              : getRange()[0];
+            double w = ((StaticWKmsArtifact) aandf.getArtifact())
+                .getWAtKmLin(data, location);
+            xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(),
+              (float) w, StickyAxisAnnotation.SimpleAxis.Y_AXIS));
+
+            doAnnotations(new FLYSAnnotation(facet.getDescription(), xy),
+                aandf, theme, visible);
+        }
+    }
+
+
     /**
      * Add WQ Data to plot.
      * @param wqkms data as double[][]

http://dive4elements.wald.intevation.org