changeset 6501:7cb247824ed1

Amtl. Linien: Added report if an official line was found in report.
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 28 Jun 2013 14:11:58 +0200
parents f3b3742fbdad
children 9daf7c9cf663 7664ab97b4c7
files artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelState.java artifacts/src/main/resources/messages.properties artifacts/src/main/resources/messages_de.properties artifacts/src/main/resources/messages_de_DE.properties artifacts/src/main/resources/messages_en.properties
diffstat 5 files changed, 27 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelState.java	Fri Jun 28 14:00:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelState.java	Fri Jun 28 14:11:58 2013 +0200
@@ -17,14 +17,17 @@
 import org.dive4elements.river.artifacts.ChartArtifact;
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.WINFOArtifact;
+import org.dive4elements.river.artifacts.model.Calculation;
 import org.dive4elements.river.artifacts.model.CalculationResult;
 import org.dive4elements.river.artifacts.model.CrossSectionWaterLineFacet;
 import org.dive4elements.river.artifacts.model.DataFacet;
 import org.dive4elements.river.artifacts.model.EmptyFacet;
 import org.dive4elements.river.artifacts.model.FacetTypes;
+import org.dive4elements.river.artifacts.model.OfficialLineFinder;
 import org.dive4elements.river.artifacts.model.ReportFacet;
 import org.dive4elements.river.artifacts.model.WQKms;
 import org.dive4elements.river.artifacts.model.WaterlevelFacet;
+import org.dive4elements.river.artifacts.resources.Resources;
 import org.dive4elements.river.utils.RiverUtils;
 
 /** State in which a waterlevel has been calculated. */
@@ -112,7 +115,22 @@
             facets.add(pdf);
         }
 
-        if (res.getReport().hasProblems()) {
+        Calculation report = res.getReport();
+
+        List<OfficialLineFinder.ValueRange> ols =
+            OfficialLineFinder.findOfficialLines(winfo);
+
+        if (!ols.isEmpty()) {
+            for (OfficialLineFinder.ValueRange ol: ols) {
+                report.addProblem(Resources.format(
+                    cc.getMeta(),
+                    "official.line.found",
+                    "Found official line for {0}.",
+                    ol.getName()));
+            }
+        }
+
+        if (report.hasProblems()) {
             facets.add(new ReportFacet(ComputeType.ADVANCE, hash, id));
         }
 
--- a/artifacts/src/main/resources/messages.properties	Fri Jun 28 14:00:15 2013 +0200
+++ b/artifacts/src/main/resources/messages.properties	Fri Jun 28 14:11:58 2013 +0200
@@ -436,6 +436,8 @@
 wsplgen.job.queued = WSPLGEN job in queue.
 wsplgen.job.error = An unexpected error while starting WSPLGEN occured.
 
+official.line.found = Found official line for {0}.
+
 wsp.selected.string = {0}
 
 Mosel = Mosel
--- a/artifacts/src/main/resources/messages_de.properties	Fri Jun 28 14:00:15 2013 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Fri Jun 28 14:11:58 2013 +0200
@@ -436,6 +436,8 @@
 wsplgen.job.queued = WSPLGEN Berechnung befindet sich in Warteschlange.
 wsplgen.job.error = Ein unerwarteter Fehler beim Starten von WSPLGEN ist aufgetreten.
 
+official.line.found = Es existiert eine amtliche Festlegung f\u00fcr {0}.
+
 wsp.selected.string = {0}
 
 Mosel = Mosel
--- a/artifacts/src/main/resources/messages_de_DE.properties	Fri Jun 28 14:00:15 2013 +0200
+++ b/artifacts/src/main/resources/messages_de_DE.properties	Fri Jun 28 14:11:58 2013 +0200
@@ -433,6 +433,8 @@
 wsplgen.job.queued = WSPLGEN Berechnung befindet sich in Warteschlange.
 wsplgen.job.error = Ein unerwarteter Fehler beim Starten von WSPLGEN ist aufgetreten.
 
+official.line.found = Es existiert eine amtliche Festlegung f\u00fcr {0}.
+
 wsp.selected.string = {0}
 
 Mosel = Mosel
--- a/artifacts/src/main/resources/messages_en.properties	Fri Jun 28 14:00:15 2013 +0200
+++ b/artifacts/src/main/resources/messages_en.properties	Fri Jun 28 14:11:58 2013 +0200
@@ -438,6 +438,8 @@
 wsplgen.job.queued = WSPLGEN job in queue.
 wsplgen.job.error = An unexpected error while starting WSPLGEN occured.
 
+official.line.found = Found official line for {0}.
+
 wsp.selected.string = {0}
 
 Mosel = Mosel

http://dive4elements.wald.intevation.org