[PATCH] With the exception of real calculation results, descriptions of sediment loads can all follow the same pattern

Wald Commits scm-commit at wald.intevation.org
Tue Aug 26 17:16:46 CEST 2014


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1409066181 -7200
# Node ID d4e4dde1d5cb3c4f4a98ea48ee1c45582ecef2d6
# Parent  37cdfad302cbb56b370cc0b7c7d1b0aeb696c93c
With the exception of real calculation results, descriptions of sediment loads can all follow the same pattern.

diff -r 37cdfad302cb -r d4e4dde1d5cb artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Tue Aug 26 12:09:18 2014 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Tue Aug 26 17:16:21 2014 +0200
@@ -1016,9 +1016,6 @@
                     <dc:attribute name="target_out" value="${out}"/>
                     <dc:attribute name="description" value="${facet_description}"/>
                     <dc:attribute name="ids" value="${facet_num}"/>
-                    <dc:comment>
-                      <!--dc:attribute name="info" value="debug: ${facet_num}-${facet_name}"/-->
-                    </dc:comment>
                     <dc:attribute name="artifact-id" value="${a_gid}"/>
                     <dc:attribute name="out" value="sedimentload_ls"/>
                   </dc:element>
diff -r 37cdfad302cb -r d4e4dde1d5cb artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataFacet.java	Tue Aug 26 12:09:18 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataFacet.java	Tue Aug 26 17:16:21 2014 +0200
@@ -71,11 +71,17 @@
         name = BASE_NAME + "." + typeUnit + "." + fraction_name;
 
         CallMeta meta = context.getMeta();
+        /* descriptions of real calculation results have to be distinguished
+           from simple fractions from the database */
+        String isCalculated = fraction_name.equals("total") ||
+            fraction_name.equals("bed_load") ||
+            fraction_name.equals("suspended_load") ? "calc." : "";
         description = Resources.getMsg(
                 meta,
-                "facet.sedimentload." + fraction_name,
+                "facet.sedimentload." + isCalculated + fraction_name,
                 "Error: please add l10n for facet.sedimentload." + fraction_name,
-                new Object[] { i18nUnit });
+                /* TODO handle multiple periods per fraction */
+                new Object[] { "period", i18nUnit });
 
         /* Is this necessary? */
         metaData.put("X", "chart.longitudinal.section.xaxis.label");
diff -r 37cdfad302cb -r d4e4dde1d5cb artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Tue Aug 26 12:09:18 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Tue Aug 26 17:16:21 2014 +0200
@@ -87,7 +87,7 @@
         String idStr = split[0];
 
         String fraction = split.length >= 2 ? split[1] : "";
-        String years    = split.length >= 3 ? " - " + split[2] : "";
+        String years    = split.length >= 3 ? split[2] : "";
 
         // Name has the pattern sedimentload.<grainfraction_name>
         name = NAME + "." + fraction;
@@ -96,7 +96,7 @@
         description = Resources.getMsg(
                 callMeta,
                 "facet.sedimentload." + fraction,
-                new Object[] { years });
+                new Object[] { years, "t/a" });
 
         ((D4EArtifact)artifact).addStringData("load_id", idStr);
     }
diff -r 37cdfad302cb -r d4e4dde1d5cb artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadLSFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadLSFacet.java	Tue Aug 26 12:09:18 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadLSFacet.java	Tue Aug 26 17:16:21 2014 +0200
@@ -97,10 +97,7 @@
         String code = D4EArtifact.getDatacageIDValue(data);
         String[] split = code.split(";");
         String idStr = split[0];
-        String desc = "";
-        if (split.length >= 2) {
-            desc = split[1];
-        }
+        String years = split.length >= 2 ? split[1] : "";
 
         int id = Integer.valueOf(idStr);
         SedimentLoadLS theLoad = SedimentLoadLS.getSedimentLoadById(id);
@@ -143,9 +140,9 @@
 
         description = Resources.getMsg(
                 callMeta,
-                "facet.sedimentload.ls." + gfName,
-                "Error: please add l10n for facet.sedimentload.ls." + gfName,
-                new Object[] { desc, i18nUnit });
+                "facet.sedimentload." + gfName,
+                "Error: please add l10n for facet.sedimentload." + gfName,
+                new Object[] { years, i18nUnit });
         ((D4EArtifact)artifact).addStringData("load_id", idStr);
     }
 
diff -r 37cdfad302cb -r d4e4dde1d5cb artifacts/src/main/resources/messages.properties
--- a/artifacts/src/main/resources/messages.properties	Tue Aug 26 12:09:18 2014 +0200
+++ b/artifacts/src/main/resources/messages.properties	Tue Aug 26 17:16:21 2014 +0200
@@ -262,26 +262,18 @@
 chart.sedimentload.ls.xaxis.label = km
 chart.sedimentload.ls.yaxis.label.diff = [t/a]
 
-facet.sedimentload.ls.coarse = Coarse gravel - {0} [{1}]
-facet.sedimentload.ls.fine_middle = Fine/Mid. gravel - {0} [{1}]
-facet.sedimentload.ls.sand = Sand - {0} [{1}]
-facet.sedimentload.ls.susp_sand =  Suspended sand - {0} [{1}]
-facet.sedimentload.ls.susp_sand_bed = Bed. part suspended sand - {0} [{1}]
-facet.sedimentload.ls.suspended_sediment = Suspended sediment - {0} [{1}]
-facet.sedimentload.ls.total = Total load - {0} [{1}]
-facet.sedimentload.ls.bed_load = Bed load - {0} [{1}]
-facet.sedimentload.ls.suspended_load = Suspended load - {0} [{1}]
-facet.sedimentload.ls.unknown = Unknown - {0} [{1}]
-
-facet.sedimentload.coarse = Coarse gravel{0} [t/a]
-facet.sedimentload.fine_middle = Fine/Mid. gravel{0} [t/a]
-facet.sedimentload.sand = Sand{0} [t/a]
-facet.sedimentload.susp_sand = Suspended sand{0} [t/a]
-facet.sedimentload.susp_sand_bed = Bed. part suspended sand{0} [t/a]
-facet.sedimentload.suspended_sediment = Suspended sediment{0} [t/a]
-facet.sedimentload.total = Total load{0} [t/a]
-facet.sedimentload.bed_load = Bed load{0} [t/a]
-facet.sedimentload.suspended_load = Suspended load{0} [t/a]
+facet.sedimentload.coarse = Coarse gravel - {0} [{1}]
+facet.sedimentload.fine_middle = Fine/Mid. gravel - {0} [{1}]
+facet.sedimentload.sand = Sand - {0} [{1}]
+facet.sedimentload.susp_sand = Suspended sand - {0} [{1}]
+facet.sedimentload.susp_sand_bed = Bed. part suspended sand - {0} [{1}]
+facet.sedimentload.suspended_sediment = Suspended sediment - {0} [{1}]
+facet.sedimentload.total = Total load (from database) - {0} [{1}]
+facet.sedimentload.bed_load = Bed load (from database) - {0} [{1}]
+facet.sedimentload.suspended_load = Suspended load (from database) - {0} [{1}]
+facet.sedimentload.calc.total = Gesamtfracht (calculated) - {0} [{1}]
+facet.sedimentload.calc.bed_load = Geschiebefracht (calculated) - {0} [{1}]
+facet.sedimentload.calc.suspended_load = Suspensionsfracht (calculated) - {0} [{1}]
 
 missing.fraction.coarse = Year {0}: Missing coarse fraction
 missing.fraction.fine_middle = Year {0}: Missing fine/middle fraction
diff -r 37cdfad302cb -r d4e4dde1d5cb artifacts/src/main/resources/messages_de.properties
--- a/artifacts/src/main/resources/messages_de.properties	Tue Aug 26 12:09:18 2014 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Tue Aug 26 17:16:21 2014 +0200
@@ -263,26 +263,18 @@
 chart.sedimentload.ls.xaxis.label = km
 chart.sedimentload.ls.yaxis.label.diff = [t/a]
 
-facet.sedimentload.ls.coarse = Grober Kies/Steine - {0} [{1}]
-facet.sedimentload.ls.fine_middle = Fein/Mittlerer Kies - {0} [{1}]
-facet.sedimentload.ls.sand = Sand - {0} [{1}]
-facet.sedimentload.ls.susp_sand = suspendierter Sand - {0} [{1}]
-facet.sedimentload.ls.susp_sand_bed = bettbildender Anteil suspendierter Sand - {0} [{1}]
-facet.sedimentload.ls.suspended_sediment = Schwebstoff - {0} [{1}]
-facet.sedimentload.ls.total = Gesamtfracht - {0} [{1}]
-facet.sedimentload.ls.bed_load = Geschiebefracht - {0} [{1}]
-facet.sedimentload.ls.suspended_load = Suspensionsfracht - {0} [{1}]
-facet.sedimentload.ls.unknown = Unbekannt - {0} [{1}]
-
-facet.sedimentload.coarse = Grober Kies/Steine{0} [t/a]
-facet.sedimentload.fine_middle = Fein/Mittlerer Kies{0} [t/a]
-facet.sedimentload.sand = Sand{0} [t/a]
-facet.sedimentload.susp_sand = suspendierter Sand{0} [t/a]
-facet.sedimentload.susp_sand_bed = bettbildender Anteil suspendierter Sand{0} [t/a]
-facet.sedimentload.suspended_sediment = Schwebstoff{0} [t/a]
-facet.sedimentload.total = Gesamtfracht{0} [t/a]
-facet.sedimentload.bed_load = Geschiebefracht{0} [t/a]
-facet.sedimentload.suspended_load = Suspensionsfracht{0} [t/a]
+facet.sedimentload.coarse = Grober Kies/Steine - {0} [{1}]
+facet.sedimentload.fine_middle = Fein/Mittlerer Kies - {0} [{1}]
+facet.sedimentload.sand = Sand - {0} [{1}]
+facet.sedimentload.susp_sand = suspendierter Sand - {0} [{1}]
+facet.sedimentload.susp_sand_bed = bettbildender Anteil suspendierter Sand - {0} [{1}]
+facet.sedimentload.suspended_sediment = Schwebstoff - {0} [{1}]
+facet.sedimentload.total = Gesamtfracht (Berechnung BfG) - {0} [{1}]
+facet.sedimentload.bed_load = Geschiebefracht (Berechnung BfG) - {0} [{1}]
+facet.sedimentload.suspended_load = Suspensionsfracht (Berechnung BfG) - {0} [{1}]
+facet.sedimentload.calc.total = Gesamtfracht (Berechnung FLYS) - {0} [{1}]
+facet.sedimentload.calc.bed_load = Geschiebefracht (Berechnung FLYS) - {0} [{1}]
+facet.sedimentload.calc.suspended_load = Suspensionsfracht (Berechnung FLYS) - {0} [{1}]
 
 missing.fraction.coarse = Jahr {0}: Fehlende Fraktion: grober Kies
 missing.fraction.fine_middle = Jahr {0}: Fehlende Fraktion: fein/mittlerer Kies
diff -r 37cdfad302cb -r d4e4dde1d5cb artifacts/src/main/resources/messages_de_DE.properties
--- a/artifacts/src/main/resources/messages_de_DE.properties	Tue Aug 26 12:09:18 2014 +0200
+++ b/artifacts/src/main/resources/messages_de_DE.properties	Tue Aug 26 17:16:21 2014 +0200
@@ -260,26 +260,18 @@
 chart.sedimentload.ls.xaxis.label = km
 chart.sedimentload.ls.yaxis.label.diff = [t/a]
 
-facet.sedimentload.ls.coarse = Grober Kies/Steine - {0} [{1}]
-facet.sedimentload.ls.fine_middle = Fein/Mittlerer Kies - {0} [{1}]
-facet.sedimentload.ls.sand = Sand - {0} [{1}]
-facet.sedimentload.ls.susp_sand = suspendierter Sand - {0} [{1}]
-facet.sedimentload.ls.susp_sand_bed = bettbildender Anteil suspendierter Sand - {0} [{1}]
-facet.sedimentload.ls.suspended_sediment = Schwebstoff - {0} [{1}]
-facet.sedimentload.ls.total = Gesamtfracht (Berechnung BfG) - {0} [{1}]
-facet.sedimentload.ls.bed_load = Geschiebefracht (Berechnung BfG) - {0} [{1}]
-facet.sedimentload.ls.suspended_load = Suspensionsfracht (Berechnung BfG) - {0} [{1}]
-facet.sedimentload.ls.unknown = Unbekannt - {0} [{1}]
-
-facet.sedimentload.coarse = Grober Kies/Steine{0} [t/a]
-facet.sedimentload.fine_middle = Fein/Mittlerer Kies{0} [t/a]
-facet.sedimentload.sand = Sand{0} [t/a]
-facet.sedimentload.susp_sand = suspendierter Sand{0} [t/a]
-facet.sedimentload.susp_sand_bed = bettbildender Anteil suspendierter Sand{0} [t/a]
-facet.sedimentload.suspended_sediment = Schwebstoff{0} [t/a]
-facet.sedimentload.total = Gesamtfracht (Berechnung BfG){0} [t/a]
-facet.sedimentload.bed_load = Geschiebefracht (Berechnung BfG){0} [t/a]
-facet.sedimentload.suspended_load = Suspensionsfracht (Berechnung BfG){0} [t/a]
+facet.sedimentload.coarse = Grober Kies/Steine - {0} [{1}]
+facet.sedimentload.fine_middle = Fein/Mittlerer Kies - {0} [{1}]
+facet.sedimentload.sand = Sand - {0} [{1}]
+facet.sedimentload.susp_sand = suspendierter Sand - {0} [{1}]
+facet.sedimentload.susp_sand_bed = bettbildender Anteil suspendierter Sand - {0} [{1}]
+facet.sedimentload.suspended_sediment = Schwebstoff - {0} [{1}]
+facet.sedimentload.total = Gesamtfracht (Berechnung BfG) - {0} [{1}]
+facet.sedimentload.bed_load = Geschiebefracht (Berechnung BfG) - {0} [{1}]
+facet.sedimentload.suspended_load = Suspensionsfracht (Berechnung BfG) - {0} [{1}]
+facet.sedimentload.calc.total = Gesamtfracht (Berechnung FLYS) - {0} [{1}]
+facet.sedimentload.calc.bed_load = Geschiebefracht (Berechnung FLYS) - {0} [{1}]
+facet.sedimentload.calc.suspended_load = Suspensionsfracht (Berechnung FLYS) - {0} [{1}]
 
 missing.fraction.coarse = Jahr {0}: Fehlende Fraktion: grober Kies
 missing.fraction.fine_middle = Jahr {0}: Fehlende Fraktion: fein/mittlerer Kies
diff -r 37cdfad302cb -r d4e4dde1d5cb artifacts/src/main/resources/messages_en.properties
--- a/artifacts/src/main/resources/messages_en.properties	Tue Aug 26 12:09:18 2014 +0200
+++ b/artifacts/src/main/resources/messages_en.properties	Tue Aug 26 17:16:21 2014 +0200
@@ -264,26 +264,18 @@
 chart.sedimentload.ls.xaxis.label = km
 chart.sedimentload.ls.yaxis.label.diff = [t/a]
 
-facet.sedimentload.ls.coarse = Coarse gravel - {0} [{1}]
-facet.sedimentload.ls.fine_middle = Fine/Mid. gravel - {0} [{1}]
-facet.sedimentload.ls.sand = Sand - {0} [{1}]
-facet.sedimentload.ls.susp_sand =  Suspended sand - {0} [{1}]
-facet.sedimentload.ls.susp_sand_bed = Bed. part suspended sand - {0} [{1}]
-facet.sedimentload.ls.suspended_sediment = Suspended sediment - {0} [{1}]
-facet.sedimentload.ls.total = Total load - {0} [{1}]
-facet.sedimentload.ls.bed_load = Bed load - {0} [{1}]
-facet.sedimentload.ls.suspended_load = Suspended load - {0} [{1}]
-facet.sedimentload.ls.unknown = Unknown - {0} [{1}]
-
-facet.sedimentload.coarse = Coarse gravel{0} [t/a]
-facet.sedimentload.fine_middle = Fine/Mid. gravel{0} [t/a]
-facet.sedimentload.sand = Sand{0} [t/a]
-facet.sedimentload.susp_sand = Suspended sand{0} [t/a]
-facet.sedimentload.susp_sand_bed = Bed. part suspended sand{0} [t/a]
-facet.sedimentload.suspended_sediment = Suspended sediment{0} [t/a]
-facet.sedimentload.total = Total load{0} [t/a]
-facet.sedimentload.bed_load = Bed load{0} [t/a]
-facet.sedimentload.suspended_load = Suspended load{0} [t/a]
+facet.sedimentload.coarse = Coarse gravel - {0} [{1}]
+facet.sedimentload.fine_middle = Fine/Mid. gravel - {0} [{1}]
+facet.sedimentload.sand = Sand - {0} [{1}]
+facet.sedimentload.susp_sand = Suspended sand - {0} [{1}]
+facet.sedimentload.susp_sand_bed = Bed. part suspended sand - {0} [{1}]
+facet.sedimentload.suspended_sediment = Suspended sediment - {0} [{1}]
+facet.sedimentload.total = Total load (from database) - {0} [{1}]
+facet.sedimentload.bed_load = Bed load (from database) - {0} [{1}]
+facet.sedimentload.suspended_load = Suspended load (from database) - {0} [{1}]
+facet.sedimentload.calc.total = Gesamtfracht (calculated) - {0} [{1}]
+facet.sedimentload.calc.bed_load = Geschiebefracht (calculated) - {0} [{1}]
+facet.sedimentload.calc.suspended_load = Suspensionsfracht (calculated) - {0} [{1}]
 
 missing.fraction.coarse = Year {0}: Missing coarse fraction
 missing.fraction.fine_middle = Year {0}: Missing fine/middle fraction


More information about the Dive4Elements-commits mailing list