[PATCH] Remove duplications from discharge prototypes and put it all together

Wald Commits scm-commit at wald.intevation.org
Mon Sep 22 18:18:29 CEST 2014


# HG changeset patch
# User "Tom Gottfried <tom at intevation.de>"
# Date 1411402667 -7200
# Node ID 33d90858b2dc8c89dfcf410e9c5b0b1a6db3df10
# Parent  f5ed7698c4db7cc82cfe1ab59a796e70cdaf175f
Remove duplications from discharge prototypes and put it all together.

diff -r f5ed7698c4db -r 33d90858b2dc artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Mon Sep 22 17:11:20 2014 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Mon Sep 22 18:17:47 2014 +0200
@@ -182,35 +182,19 @@
                   <dc:comment> Discharge curves </dc:comment>
                   <dc:when test="$out = 'historical_discharge_wq'">
                     <dc:call-macro name="discharge-curve-prototype"/>
-                    <dc:call-macro name="basedata_5_flood-protections"/>
-                    <dc:call-macro name="basedata_0"/>
-                    <dc:call-macro name="basedata_1_additionals"/>
-                    <dc:call-macro name="basedata_4_heightmarks-points"/>
-                    <computed_discharge_curve>
-                      <dc:call-macro name="mainvalues"/>
-                    </computed_discharge_curve>
                   </dc:when>
                   <dc:when test="$out = 'discharge_curve'">
-                    <dc:call-macro name="discharge-prototype"/>
-                    <computed_discharge_curve>
-                      <dc:call-macro name="mainvalues"/>
-                    </computed_discharge_curve>
+                    <dc:call-macro name="discharge-curve-prototype"/>
                   </dc:when>
                   <dc:when test="$out = 'fix_wq_curve'">
-                    <dc:call-macro name="discharge-prototype"/>
+                    <dc:call-macro name="discharge-curve-prototype"/>
                   </dc:when>
                   <dc:when test="$out = 'computed_discharge_curve'">
                     <dc:call-macro name="discharge-curve-prototype"/>
-                    <dc:call-macro name="basedata_0_wq"/>
-                    <dc:call-macro name="basedata_1_additionals_wq"/>
-                    <dc:call-macro name="basedata_5_flood-protections"/>
-                    <computed_discharge_curve>
-                      <dc:call-macro name="mainvalues"/>
-                    </computed_discharge_curve>
                   </dc:when>
                   <dc:when test="starts-with($out, 'sq_relation') or
                                  $out = 'sq_overview'">
-                    <dc:call-macro name="sqrelations"/>
+                    <dc:call-macro name="discharge-curve-prototype"/>
                   </dc:when>
                   <dc:comment> Cross sections </dc:comment>
                   <dc:when test="$out = 'cross_section'">
@@ -478,7 +462,6 @@
 
 
     <dc:macro name="historical_discharge_curve">
-      <dc:variable name="refgauge" type="number" expr="$reference_gauge"/>
       <dc:context>
         <dc:statement>
           SELECT g.id   AS gauge_id,
@@ -493,7 +476,7 @@
           WHERE g.river_id = ${river_id}
             AND dt.kind <> 0
             AND ((g.station = ${fromkm} AND g.station = ${tokm})
-              OR g.official_number = ${refgauge})
+              OR g.official_number = ${reference_gauge})
           ORDER BY start_time
         </dc:statement>
         <dc:if test="dc:has-result()">
@@ -1256,13 +1239,26 @@
       </dc:filter>
     </dc:macro>
 
+
+    <!-- discharge curve prototype -->
     <dc:macro name="discharge-curve-prototype">
-        <dc:call-macro name="discharge_table_gauge"/>
+        <computed_discharge_curve>
+          <dc:call-macro name="discharge_table_gauge"/>
+          <dc:call-macro name="mainvalues"/>
+        </computed_discharge_curve>
         <dc:call-macro name="historical_discharge_curve"/>
         <dc:call-macro name="basedata_0_wq"/>
+        <dc:call-macro name="basedata_1_additionals_wq"/>
+        <dc:call-macro name="basedata_2_fixations_wqkms"/>
         <dc:call-macro name="basedata_3_officials_wq"/>
-        <dc:call-macro name="basedata_2_fixations_wqkms"/>
         <dc:call-macro name="basedata_4_heightmarks-points"/>
+        <dc:call-macro name="basedata_5_flood-protections"/>
+        <minfo>
+          <dc:call-macro name="sqrelations"/>
+          <!-- add MINFO-Fixation-Data here -->
+          <!-- basedata_6_...-->
+          <!-- basedata_7_...-->
+        </minfo>
     </dc:macro>
 
     <dc:macro name="longitudinal-section-prototype">
@@ -1306,25 +1302,6 @@
       <dc:call-macro name="sediment-load"/>
     </dc:macro>
 
-    <dc:macro name="discharge-prototype">
-      <dc:call-macro name="discharge-curve-prototype"/>
-      <dc:call-macro name="basedata_5_flood-protections"/>
-      <dc:call-macro name="basedata_0"/>
-      <dc:call-macro name="basedata_1_additionals"/>
-      <dc:call-macro name="basedata_1_additionals_marks"/>
-      <dc:call-macro name="basedata_4_heightmarks-points"/>
-      <dc:call-macro name="basedata_1_additionals-relative_point"/>
-      <dc:call-macro name="basedata_2_fixations_relative_point"/>
-      <dc:call-macro name="basedata_4_heightmarks-points-relative_points"/>
-      <dc:call-macro name="basedata_5_flood-protections_relative_points"/>
-      <dc:call-macro name="mainvalues"/>
-      <dc:call-macro name="annotations"/>
-
-      <computed_discharge_curve>
-        <dc:call-macro name="mainvalues"/>
-      </computed_discharge_curve>
-    </dc:macro>
-
     <dc:macro name="porosities">
       <porosities>
       <dc:context>
@@ -1728,7 +1705,7 @@
           WHERE g.river_id = ${river_id}
           AND dt.kind = 0
           AND ((g.station = ${fromkm} AND g.station = ${tokm})
-          OR g.official_number = ${refgauge})
+          OR g.official_number = ${reference_gauge})
         </dc:statement>
         <dc:if test="dc:has-result()">
           <dc:for-each>
diff -r f5ed7698c4db -r 33d90858b2dc artifacts/doc/datacage_ref_de.rst
--- a/artifacts/doc/datacage_ref_de.rst	Mon Sep 22 17:11:20 2014 +0200
+++ b/artifacts/doc/datacage_ref_de.rst	Mon Sep 22 18:17:47 2014 +0200
@@ -756,3 +756,5 @@
 
 ``dc:toValue`` **TODO**
 
+``dc:coalesce`` **TODO**
+


More information about the Dive4Elements-commits mailing list