[Dive4elements-commits] [PATCH 1 of 2] Added new elements to M-INFO datacage

Wald Commits scm-commit at wald.intevation.org
Mon Apr 8 14:54:37 CEST 2013


# HG changeset patch
# User Raimund Renkert <rrenkert at intevation.de>
# Date 1365425579 -7200
# Node ID 55d6c5cac9d18e6fb1a75b5c892e19e614ae1daf
# Parent  1827798ca53f71fce16d0aff26e50c92d61e8f5d
Added new elements to M-INFO datacage.

* New macros for density, porosity and flow velocity.
* Added annotations to 'Sohlbeschaffenheit'.

diff -r 1827798ca53f -r 55d6c5cac9d1 flys-artifacts/doc/conf/artifacts/minfo.xml
--- a/flys-artifacts/doc/conf/artifacts/minfo.xml	Mon Apr 08 11:24:39 2013 +0200
+++ b/flys-artifacts/doc/conf/artifacts/minfo.xml	Mon Apr 08 14:52:59 2013 +0200
@@ -362,6 +362,7 @@
                         <facet name="bed_longitudinal_section.bed_diameter_sublayer"/>
                         <facet name="bed_longitudinal_section.manualpoints" />
                     	<facet name="bed_longitudinal_section.bedload_diameter"/>
+                        <facet name="longitudinal_section.annotations" description="facet.longitudinal_section.annotations"/>
                     </facets>
                 </outputmode>
                 <outputmode name="bed_quality_export" description="output.bed_quality_export" type="export">
diff -r 1827798ca53f -r 55d6c5cac9d1 flys-artifacts/doc/conf/meta-data.xml
--- a/flys-artifacts/doc/conf/meta-data.xml	Mon Apr 08 11:24:39 2013 +0200
+++ b/flys-artifacts/doc/conf/meta-data.xml	Mon Apr 08 14:52:59 2013 +0200
@@ -729,6 +729,9 @@
               <dc:call-macro name="annotations_per_type"/>
               <dc:call-macro name="flow_velocity_measurements"/>
             </dc:if>
+            <dc:if test="dc:contains($artifact-outs, 'bed_longitudinal_section')">
+              <dc:call-macro name="annotations_per_type"/>
+            </dc:if>
             <dc:comment>
               MINFO bedheight middle
             </dc:comment>
@@ -2565,6 +2568,116 @@
               </bed_quality_load>
             </dc:macro>
 
+            <dc:macro name="bedquality-density">
+              <bed_quality_density>
+                <dc:for-each>
+                  <dc:context>
+                    <dc:call-macro name="range-filter">
+                      <dc:context>
+                        <dc:statement>
+                          SELECT a.gid         AS aid,
+                                 f.id          AS fid,
+                                 f.name        AS facet_name,
+                                 f.num         AS facet_num,
+                                 f.description AS facet_description
+                          FROM outs AS o, facets AS f, artifacts AS a
+                          WHERE
+                             (f.name = 'bed_longitudinal_section.sediment_density_toplayer' OR
+                              f.name = 'bed_longitudinal_section.sediment_density_sublayer') AND
+                             f.out_id = o.id         AND
+                             o.artifact_id = ${a_id} AND
+                             a.id = ${a_id}
+                        </dc:statement>
+                        <dc:for-each>
+                          <dc:element name="${facet_name}">
+                            <dc:attribute name="factory" value="minfo"/>
+                            <dc:attribute name="description" value="${facet_description}"/>
+                            <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                            <dc:attribute name="artifact-id" value="${aid}"/>
+                            <dc:attribute name="out" value="bed_longitudinal_section"/>
+                          </dc:element>
+                        </dc:for-each>
+                      </dc:context>
+                    </dc:call-macro>
+                  </dc:context>
+                </dc:for-each>
+              </bed_quality_density>
+            </dc:macro>
+
+            <dc:macro name="bedquality-porosity">
+              <bed_quality_porosity>
+                <dc:for-each>
+                  <dc:context>
+                    <dc:call-macro name="range-filter">
+                      <dc:context>
+                        <dc:statement>
+                          SELECT a.gid         AS aid,
+                                 f.id          AS fid,
+                                 f.name        AS facet_name,
+                                 f.num         AS facet_num,
+                                 f.description AS facet_description
+                          FROM outs AS o, facets AS f, artifacts AS a
+                          WHERE
+                             (f.name = 'bed_longitudinal_section.porosity_toplayer' OR
+                              f.name = 'bed_longitudinal_section.porosity_sublayer') AND
+                             f.out_id = o.id         AND
+                             o.artifact_id = ${a_id} AND
+                             a.id = ${a_id}
+                        </dc:statement>
+                        <dc:for-each>
+                          <dc:element name="${facet_name}">
+                            <dc:attribute name="factory" value="minfo"/>
+                            <dc:attribute name="description" value="${facet_description}"/>
+                            <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                            <dc:attribute name="artifact-id" value="${aid}"/>
+                            <dc:attribute name="out" value="bed_longitudinal_section"/>
+                          </dc:element>
+                        </dc:for-each>
+                      </dc:context>
+                    </dc:call-macro>
+                  </dc:context>
+                </dc:for-each>
+              </bed_quality_porosity>
+            </dc:macro>
+
+            <dc:macro name="flow-velocity">
+              <flow-velocity>
+                <dc:for-each>
+                  <dc:context>
+                    <dc:call-macro name="range-filter">
+                      <dc:context>
+                        <dc:statement>
+                          SELECT a.gid         AS aid,
+                                 f.id          AS fid,
+                                 f.name        AS facet_name,
+                                 f.num         AS facet_num,
+                                 f.description AS facet_description
+                          FROM outs AS o, facets AS f, artifacts AS a
+                          WHERE
+                            (f.name = 'flow_velocity.totalchannel' OR
+                             f.name = 'flow_velocity.mainchannel' OR
+                             f.name = 'flow_velocity.totalchannel.filtered' OR
+                             f.name = 'flow_velocity.mainchannel.filtered') AND
+                             f.out_id = o.id         AND
+                             o.artifact_id = ${a_id} AND
+                             a.id = ${a_id}
+                        </dc:statement>
+                        <dc:for-each>
+                          <dc:element name="${facet_name}">
+                            <dc:attribute name="factory" value="minfo"/>
+                            <dc:attribute name="description" value="${facet_description}"/>
+                            <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                            <dc:attribute name="artifact-id" value="${aid}"/>
+                            <dc:attribute name="out" value="bed_longitudinal_section"/>
+                          </dc:element>
+                        </dc:for-each>
+                      </dc:context>
+                    </dc:call-macro>
+                  </dc:context>
+                </dc:for-each>
+              </flow-velocity>
+            </dc:macro>
+
 
             <dc:if test="dc:contains($artifact-outs, 'longitudinal_section') or (dc:contains($artifact-outs, 'discharge_longitudinal_section') or (dc:contains($artifact-outs, 'w_differences')))">
               <dc:call-macro name="longitudinal"/>
@@ -2613,9 +2726,13 @@
             </dc:if>
             <dc:if test="dc:contains($artifact-outs, 'flow_velocity')">
               <dc:call-macro name="bedquality-bed"/>
+              <dc:call-macro name="bedquality-load"/>
             </dc:if>
-            <dc:if test="dc:contains($artifact-outs, 'flow_velocity')">
+            <dc:if test="dc:contains($artifact-outs, 'bed_longitudinal_section')">
+              <dc:call-macro name="bedquality-bed"/>
               <dc:call-macro name="bedquality-load"/>
+              <dc:call-macro name="bedquality-density"/>
+              <dc:call-macro name="bedquality-porosity"/>
             </dc:if>
           </dc:context>
         </dc:call-macro>
diff -r 1827798ca53f -r 55d6c5cac9d1 flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedQualityGenerator.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedQualityGenerator.java	Mon Apr 08 11:24:39 2013 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/minfo/BedQualityGenerator.java	Mon Apr 08 14:52:59 2013 +0200
@@ -12,6 +12,7 @@
 import de.intevation.flys.artifacts.model.minfo.BedloadDiameterResult;
 import de.intevation.flys.exports.StyledSeriesBuilder;
 import de.intevation.flys.exports.XYChartGenerator;
+import de.intevation.flys.jfree.FLYSAnnotation;
 import de.intevation.flys.jfree.StyledXYSeries;
 
 
@@ -182,6 +183,13 @@
                 (BedParametersResult) artifactAndFacet.getData(context),
                 artifactAndFacet, attr, visible);
         }
+        else if (name.equals(LONGITUDINAL_ANNOTATION)) {
+            doAnnotations(
+                (FLYSAnnotation) artifactAndFacet.getData(context),
+                 artifactAndFacet,
+                 attr,
+                 visible);
+        }
         else if (FacetTypes.IS.MANUALPOINTS(name)) {
             doPoints(artifactAndFacet.getData(context), artifactAndFacet, attr,
                 visible, YAXIS.W.idx);


More information about the Dive4elements-commits mailing list