[PATCH] sinfo.collisions review
Wald Commits
scm-commit at wald.intevation.org
Thu Jun 28 15:57:50 CEST 2018
# HG changeset patch
# User gernotbelger
# Date 1530194260 -7200
# Node ID f692f5a0536ae214875efc046363d1821948fd5f
# Parent 0633f963c5be7e2a6bd555d29f12731b6a535915
sinfo.collisions review
diff -r 0633f963c5be -r f692f5a0536a artifacts/doc/conf/jasper/templates/sinfo.collision.detail.jrxml
--- a/artifacts/doc/conf/jasper/templates/sinfo.collision.detail.jrxml Thu Jun 28 15:10:04 2018 +0200
+++ b/artifacts/doc/conf/jasper/templates/sinfo.collision.detail.jrxml Thu Jun 28 15:57:40 2018 +0200
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.5.1.final using JasperReports Library version 4.5.0 -->
-<!-- 2018-06-22T14:12:56 -->
+<!-- 2018-06-28T15:32:43 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="flysreport" language="groovy" pageWidth="595" pageHeight="842" columnWidth="515" leftMargin="60" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
@@ -99,15 +99,7 @@
<band splitType="Stretch"/>
</background>
<title>
- <band height="30" splitType="Stretch">
- <textField>
- <reportElement style="htmlStyle" x="0" y="0" width="515" height="30"/>
- <textElement>
- <font size="18"/>
- </textElement>
- <textFieldExpression><![CDATA[$F{meta:header} + " " + $F{meta:river}]]></textFieldExpression>
- </textField>
- </band>
+ <band splitType="Stretch"/>
</title>
<columnHeader>
<band height="25" splitType="Stretch">
diff -r 0633f963c5be -r f692f5a0536a artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/CalculationSelectSinfo.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/CalculationSelectSinfo.java Thu Jun 28 15:10:04 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/CalculationSelectSinfo.java Thu Jun 28 15:57:40 2018 +0200
@@ -11,14 +11,18 @@
import java.util.ArrayList;
import java.util.Collection;
+import java.util.List;
import org.apache.log4j.Logger;
import org.dive4elements.artifacts.Artifact;
import org.dive4elements.artifacts.CallContext;
import org.dive4elements.artifacts.CallMeta;
import org.dive4elements.artifacts.common.utils.XMLUtils;
+import org.dive4elements.river.artifacts.model.CollisionHibernateFactory;
import org.dive4elements.river.artifacts.resources.Resources;
+import org.dive4elements.river.artifacts.sinfo.collision.CollisionAccess;
import org.dive4elements.river.artifacts.states.DefaultState;
+import org.dive4elements.river.model.sinfo.Collision;
import org.w3c.dom.Element;
/**
@@ -55,7 +59,19 @@
final SINFOArtifact sinfo = (SINFOArtifact) artifact;
/* throws an exception if calculation mode is invalid */
- sinfo.getCalculationMode();
+ final String calcmode = sinfo.getCalculationMode().toString(); // "toString()" is important
+ if (calcmode.equals("sinfo_calc_collision")) {
+
+ final CollisionAccess access = new CollisionAccess((SINFOArtifact) artifact);
+
+ final List<Collision> list = CollisionHibernateFactory.getCollisionsByRiver(access.getRiver());
+
+ if (list.size() == 0) {
+ throw new IllegalArgumentException("error_no_data_for_river");
+ }
+ }
+
return true;
}
+
}
\ No newline at end of file
diff -r 0633f963c5be -r f692f5a0536a artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/CalculationSelectUinfo.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/CalculationSelectUinfo.java Thu Jun 28 15:10:04 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/CalculationSelectUinfo.java Thu Jun 28 15:57:40 2018 +0200
@@ -61,7 +61,7 @@
final String river = uinfo.getRiver();
if (!UedauernPropertiesHelper.fileExistsForRiver(river)) {
- throw new IllegalArgumentException("error_river_inundationdur_file_not_found");
+ throw new IllegalArgumentException("error_no_data_for_river");
}
}
diff -r 0633f963c5be -r f692f5a0536a artifacts/src/main/resources/messages.properties
--- a/artifacts/src/main/resources/messages.properties Thu Jun 28 15:10:04 2018 +0200
+++ b/artifacts/src/main/resources/messages.properties Thu Jun 28 15:57:40 2018 +0200
@@ -1112,8 +1112,8 @@
sinfo.export.csv.header.infrastructure.height = Infrastrukturh\u00f6he
infrastructure.height.title = Geod. H\u00f6he
-sinfo.export.csv.title.collision.detail = Detail View
-sinfo.export.csv.title.collison.overview = Overview
+sinfo.export.csv.title.collision.detail = Abfluss/Abflusszustand
+sinfo.export.csv.title.collison.overview = H\u00e4ufigkeiten
sinfo.export.csv.header.collision.count = Anzahl der Grundber\u00fchrungen
collision.count.title = Grundber\u00fchrungen {0}
chart.collision_count.section.yaxis.label = H\u00e4ufigkeit
diff -r 0633f963c5be -r f692f5a0536a artifacts/src/main/resources/messages_de.properties
--- a/artifacts/src/main/resources/messages_de.properties Thu Jun 28 15:10:04 2018 +0200
+++ b/artifacts/src/main/resources/messages_de.properties Thu Jun 28 15:57:40 2018 +0200
@@ -1112,8 +1112,8 @@
sinfo.export.csv.header.infrastructure.height = Infrastrukturh\u00f6he
infrastructure.height.title = Geod. H\u00f6he
-sinfo.export.csv.title.collision.detail = Detailansicht
-sinfo.export.csv.title.collison.overview = \u00dcbersicht
+sinfo.export.csv.title.collision.detail = Abfluss/Abflusszustand
+sinfo.export.csv.title.collison.overview = H\u00e4ufigkeiten
sinfo.export.csv.header.collision.count = Anzahl der Grundber\u00fchrungen
collision.count.title = Grundber\u00fchrungen {0}
chart.collision_count.section.yaxis.label = H\u00e4ufigkeit
diff -r 0633f963c5be -r f692f5a0536a gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java Thu Jun 28 15:10:04 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java Thu Jun 28 15:57:40 2018 +0200
@@ -1537,7 +1537,9 @@
String waterlevel_ground_state();
- String error_river_inundationdur_file_not_found();
+ String error_no_data_for_river();
String sinfo_flood_duration();
+
+ String sinfo_collision_export();
}
\ No newline at end of file
diff -r 0633f963c5be -r f692f5a0536a gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties Thu Jun 28 15:10:04 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties Thu Jun 28 15:57:40 2018 +0200
@@ -324,7 +324,7 @@
ele_window_save_error = Error while saving elevations.
ele_window_geometry_error = The geometry is not supported:
-error_river_inundationdur_file_not_found = F\u00fcr das gew\u00e4hlte Gew\u00e4sser liegen keine Daten vor.
+error_no_data_for_river = F\u00fcr das gew\u00e4hlte Gew\u00e4sser liegen keine Daten vor.
unexpected_exception = There occured an unexpected exception
error_years_wrong = The second year needs to be bigger than the first year.
error_read_minmax_values = Error while reading min/max values for the location input.
@@ -760,6 +760,7 @@
no_data_sediment_difference = Invalid value: $1
sinfo = S-INFO
+sinfo_collision_export = Grundber\u00fchrungen Export
sinfo_flowdepth_export = Flie\u00dftiefen Export
sinfo_flowdepth_report = Flie\u00dftiefen Bericht
sinfo_flow_depth = Flie\u00dftiefen
diff -r 0633f963c5be -r f692f5a0536a gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties Thu Jun 28 15:10:04 2018 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties Thu Jun 28 15:57:40 2018 +0200
@@ -324,7 +324,7 @@
ele_window_save_error = Fehler beim Speichern der H\u00f6hen.
ele_window_geometry_error = Die Geometrie wird nicht unterst\u00fctzt:
-error_river_inundationdur_file_not_found = F\u00fcr das gew\u00e4hlte Gew\u00e4sser liegen keine Daten vor.
+error_no_data_for_river = F\u00fcr das gew\u00e4hlte Gew\u00e4sser liegen keine Daten vor.
unexpected_exception = Ein unerwarteter Fehler ist aufgetreten
error_years_wrong = Das zweite Jahr muss gr\u00f6\u00dfer als das erste sein.
error_read_minmax_values = Fehler beim Lesen der min/max Werte. Es kann keine Validierung der eingegebenen Strecke durchgef\u00fchrt werden.
@@ -760,6 +760,7 @@
no_data_sediment_difference = Der Wert $1 ist ung\u00fcltig.
sinfo = S-INFO
+sinfo_collision_export = Grundber\u00fchrungen Export
sinfo_flowdepth_export = Flie\u00dftiefen Export
sinfo_flowdepth_report = Flie\u00dftiefen Bericht
sinfo_flow_depth = Flie\u00dftiefen
More information about the Dive4Elements-commits
mailing list