changeset 8306:33d90858b2dc

Remove duplications from discharge prototypes and put it all together.
author "Tom Gottfried <tom@intevation.de>"
date Mon, 22 Sep 2014 18:17:47 +0200
parents f5ed7698c4db
children 60212ed56023
files artifacts/doc/conf/meta-data.xml artifacts/doc/datacage_ref_de.rst
diffstat 2 files changed, 22 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- 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 &lt;&gt; 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>
--- 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**
+

http://dive4elements.wald.intevation.org