changeset 6717:71da3d4ffb4a 3.0.13

issue1391: Some more unification fix km filtering for calculated discharges The km filtering still remains a problem for fix and historical
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 30 Jul 2013 19:14:49 +0200
parents b494a9cf25e5
children 1b9529f6f5ff
files artifacts/doc/conf/meta-data.xml gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties
diffstat 5 files changed, 24 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Tue Jul 30 18:59:35 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Tue Jul 30 19:14:49 2013 +0200
@@ -147,7 +147,7 @@
                     <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="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"/>
@@ -159,7 +159,7 @@
                     </computed_discharge_curve>
                   </dc:when>
                   <dc:when test="$out = 'discharge_curve'">
-                    <dc:call-macro name="historical-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"/>
@@ -185,13 +185,14 @@
                     <dc:call-macro name="basedata_5_flood-protections_relative_points"/>
                   </dc:when>
                   <dc:when test="$out = 'fix_wq_curve'">
+                    <dc:call-macro name="historical_discharge_curve"/>
+                    <dc:call-macro name="discharge_table_gauge"/>
                     <dc:call-macro name="basedata_0_wq"/>
                     <dc:call-macro name="basedata_1_additionals_marks"/>
                     <dc:call-macro name="basedata_2_fixations_wqkms"/>
                     <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:call-macro name="discharge_table_gauge"/>
                   </dc:when>
                   <dc:when test="$out = 'fix_longitudinal_section_curve'">
                     <dc:call-macro name="longitudinal-section-prototype"/>
@@ -277,7 +278,7 @@
                     </dc:choose>
                   </dc:when>
                   <dc:when test="$out = 'computed_discharge_curve'">
-                    <dc:call-macro name="historical-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"/>
@@ -365,9 +366,6 @@
                     <dc:when test="$out = 'reference_curve'">
                       <dc:call-macro name="reference-curves"/>
                     </dc:when>
-                    <dc:when test="$out = 'computed_discharge_curve'">
-                      <dc:call-macro name="computed-discharge-curve"/>
-                    </dc:when>
                     <dc:when test="$out = 'cross_section'">
                       <dc:call-macro name="waterlevels"/>
                     </dc:when>
@@ -378,7 +376,6 @@
                       <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>
@@ -484,7 +481,7 @@
     </dc:macro>
 
 
-    <dc:macro name="historical-discharge-curve">
+    <dc:macro name="historical_discharge_curve">
       <dc:context>
         <dc:statement>
           SELECT g.id   AS gauge_id,
@@ -497,10 +494,10 @@
           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))
+          AND g.station = ${fromkm}
+          AND g.station = ${tokm}
           ORDER BY start_time
         </dc:statement>
         <dc:if test="dc:has-result()">
@@ -523,25 +520,6 @@
     </dc:macro>
 
 
-    <dc:macro name="computed-discharge-curve">
-      <dc:filter expr="$facet_name = 'computed_discharge_curve.q'">
-        <dc:if test="dc:has-result()">
-          <computed_discharge_curves>
-            <dc:for-each>
-              <dc:element name="${facet_name}">
-                <dc:attribute name="description" value="${facet_description}"/>
-                <dc:attribute name="factory" value="winfo"/>
-                <dc:attribute name="target_out" value="${out}"/>
-                <dc:attribute name="artifact-id" value="${a_id}"/>
-                <dc:attribute name="ids" value="${a_id}"/>
-                <dc:attribute name="out" value="computed_discharge_curve"/>
-              </dc:element>
-            </dc:for-each>
-          </computed_discharge_curves>
-        </dc:if>
-      </dc:filter>
-    </dc:macro>
-
     <dc:macro name="flood-map">
       <dc:filter expr="$facet_name = 'floodmap.wsplgen'">
         <dc:if test="dc:has-result()">
@@ -1348,20 +1326,25 @@
       <dc:context>
         <dc:statement>
           SELECT g.id   AS gauge_id,
-                 g.name AS gauge_name
+                 g.name AS gauge_name,
+                 t.start_time AS start_time,
+                 t.stop_time AS stop_time
           FROM gauges g
-          LEFT JOIN ranges r ON g.range_id = r.id
+          JOIN discharge_tables dt ON g.id = dt.gauge_id
+          LEFT JOIN time_intervals t ON dt.time_interval_id = t.id
           WHERE g.river_id = ${river_id}
-          AND NOT((${tokm} &lt; r.a) or (${fromkm} &gt; r.b))
+          AND dt.kind = 0
+          AND g.station = ${fromkm}
+          AND g.station = ${tokm}
         </dc:statement>
         <dc:if test="dc:has-result()">
-          <discharge_table_gauge>
+          <current_gauge>
             <dc:for-each>
-              <gauge name="{$gauge_name}"
+              <gauge name="{$gauge_name} ({dc:date-format('dd.MM.yyyy', $start_time)})"
                 factory="gaugedischarge" target_out="{$out}"
                 ids="{$gauge_name}"/>
             </dc:for-each>
-          </discharge_table_gauge>
+          </current_gauge>
         </dc:if>
       </dc:context>
     </dc:macro>
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Tue Jul 30 18:59:35 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Tue Jul 30 19:14:49 2013 +0200
@@ -1311,5 +1311,7 @@
     String official_regulation();
 
     String historical_discharge_curves();
+
+    String current_gauge();
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Tue Jul 30 18:59:35 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Tue Jul 30 19:14:49 2013 +0200
@@ -278,6 +278,7 @@
 pdf = PDF
 computed_dischargecurve_at_export = Discharge Curve Export
 gauge_discharge_curve_at_export = Gauge Discharge Curve
+current_gauge = Current Gauge Discharge Curve
 gauge_class = Gauge Class
 eventselect = Eventselection
 events = Events
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Tue Jul 30 18:59:35 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Tue Jul 30 19:14:49 2013 +0200
@@ -216,6 +216,7 @@
 discharge_curve = Abflusskurve am Pegel
 discharge_curve_gaugeless = Abflusskurve
 gauge_discharge_curve = Abflusstafel am Pegel
+current_gauge = aktuelle Abflusstafel am Pegel
 computed_discharge_curve = Abflusskurve
 computed_discharge_curves = Abflusskurven
 historical_discharge_curves = Historische Abflusskurven
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties	Tue Jul 30 18:59:35 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties	Tue Jul 30 19:14:49 2013 +0200
@@ -213,6 +213,7 @@
 static_sqrelation = SQ relation
 discharge_curve = Discharge Curve at Gauge
 discharge_curve_gaugeless = Discharge Curve
+current_gauge = Current Gauge Discharge Curve
 gauge_discharge_curve = Discharge Table at Gauge
 computed_discharge_curve = Discharge Curve
 computed_discharge_curves = Discharge Curves

http://dive4elements.wald.intevation.org