changeset 6691:f41ba63e7a43

issue1391: Unify datacage elements in discharge curve outs and add historical discharges
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 29 Jul 2013 12:16:12 +0200
parents 0b0325d1ab7f
children ce691d22cee3
files artifacts/doc/conf/meta-data.xml
diffstat 1 files changed, 64 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Mon Jul 29 12:14:51 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Mon Jul 29 12:16:12 2013 +0200
@@ -146,8 +146,29 @@
                   <dc:when test="$out = 'discharge_longitudinal_section'">
                     <dc:call-macro name="longitudinal-section-prototype"/>
                   </dc:when>
+                  <dc:when test="$out = 'historical_discharge_wq'">
+                    <dc:call-macro name="historical-discharge-curve"/>
+                    <dc:call-macro name="discharge_table_gauge"/>
+                    <dc:call-macro name="basedata_2_fixations_wqkms"/>
+                    <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="mainvalues"/>
+                    <dc:call-macro name="historical-discharge-curve"/>
+                    <dc:call-macro name="discharge_table_gauge"/>
+                    <dc:call-macro name="basedata_2_fixations_wqkms"/>
+                    <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 = 'duration_curve'">
                     <dc:call-macro name="mainvalues"/>
@@ -256,6 +277,7 @@
                     </dc:choose>
                   </dc:when>
                   <dc:when test="$out = 'computed_discharge_curve'">
+                    <dc:call-macro name="historical-discharge-curve"/>
                     <dc:call-macro name="discharge_table_gauge"/>
                     <dc:call-macro name="basedata_2_fixations_wqkms"/>
                     <dc:call-macro name="basedata_5_flood-protections"/>
@@ -356,6 +378,7 @@
                       <dc:call-macro name="fix-derivate-curve"/>
                     </dc:when>
                     <dc:when test="$out = 'fix_wq_curve'">
+                      <dc:call-macro name="historical-discharge-curve"/>
                       <dc:call-macro name="fix-wq-curve"/>
                       <dc:call-macro name="waterlevels-fix"/>
                     </dc:when>
@@ -460,6 +483,46 @@
       </dc:filter>
     </dc:macro>
 
+
+    <dc:macro name="historical-discharge-curve">
+      <dc:context>
+        <dc:statement>
+          SELECT g.id   AS gauge_id,
+                 g.name AS gauge_name,
+                 dt.id AS dt_id,
+                 t.start_time AS start_time,
+                 t.stop_time AS stop_time,
+                 dt.description AS desc,
+                 dt.bfg_id AS bfg_id
+          FROM gauges g
+          JOIN discharge_tables dt ON g.id = dt.gauge_id
+          LEFT JOIN time_intervals t ON dt.time_interval_id = t.id
+          LEFT JOIN ranges r ON g.range_id = r.id
+          WHERE g.river_id = ${river_id}
+          AND dt.kind &lt;&gt; 0
+          AND NOT((${tokm} &lt; r.a) or (${fromkm} &gt; r.b))
+          ORDER BY start_time
+        </dc:statement>
+        <dc:if test="dc:has-result()">
+          <historical_discharge_curves>
+            <dc:group expr="$gauge_name">
+              <dc:for-each>
+                <dc:variable name="combined_desc" expr="concat($bfg_id, ' ', dc:date-format('dd.MM.yyyy', $start_time), ' - ', dc:date-format('dd.MM.yyyy', $stop_time))"/>
+                <dc:message>
+                  Hallo ANDRE23 {dc:dump-variables()}
+                </dc:message>
+                <histdis name="{$combined_desc}"
+                  description="{$combined_desc}"
+                  factory="gaugedischarge" target_out="{$out}"
+                  ids="{$gauge_name};{$dt_id};{$combined_desc}"/>
+              </dc:for-each>
+            </dc:group>
+          </historical_discharge_curves>
+        </dc:if>
+      </dc:context>
+    </dc:macro>
+
+
     <dc:macro name="computed-discharge-curve">
       <dc:filter expr="$facet_name = 'computed_discharge_curve.q'">
         <dc:if test="dc:has-result()">

http://dive4elements.wald.intevation.org