changeset 8117:ca072278ad02

Complete mapping and themes for sediment load.
author "Tom Gottfried <tom@intevation.de>"
date Thu, 21 Aug 2014 18:09:37 +0200
parents fdb29e8b7ec0
children f2fa88f5f751
files artifacts/doc/conf/themes.xml artifacts/doc/conf/themes/default.xml artifacts/doc/conf/themes/second.xml artifacts/src/main/java/org/dive4elements/river/artifacts/model/FacetTypes.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java artifacts/src/main/java/org/dive4elements/river/exports/process/SedimentLoadProcessor.java artifacts/src/main/java/org/dive4elements/river/exports/process/SedimentLoadTAProcessor.java
diffstat 7 files changed, 232 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/themes.xml	Thu Aug 21 15:48:01 2014 +0200
+++ b/artifacts/doc/conf/themes.xml	Thu Aug 21 18:09:37 2014 +0200
@@ -311,31 +311,34 @@
         <mapping from="extreme_wq_curve" to="ExtremeWQCurve" />
         <mapping from="extreme_wq_curve_base" to="ExtremeWQBaseCurve" />
         <mapping from="sedimentload.ta.coarse" to="SedimentLoadTACoarse" />
-        <mapping from="sedimentload.ta.finemiddle" to="SedimentLoadTAFineMid" />
         <mapping from="sedimentload.ta.fine_middle" to="SedimentLoadTAFineMid" />
         <mapping from="sedimentload.ta.sand" to="SedimentLoadTASand" />
         <mapping from="sedimentload.ta.susp_sand" to="SedimentLoadTASuspSand" />
         <mapping from="sedimentload.ta.susp_sand_bed" to="SedimentLoadTASuspSandBed" />
-        <mapping from="sedimentload.ta.susp_sediment" to="SedimentLoadTASediment" />
         <mapping from="sedimentload.ta.suspended_sediment" to="SedimentLoadTASediment" />
         <mapping from="sedimentload.ta.suspended_load" to="SedimentLoadTASusp" />
-        <mapping from="sedimentload.ta.total_load" to="SedimentLoadTATotalLoad" />
         <mapping from="sedimentload.ta.total" to="SedimentLoadTATotal" />
         <mapping from="sedimentload.ta.bed_load" to="SedimentLoadTABed" />
         <mapping from="sedimentload.ta.unknown" to="SedimentLoadTAUnknown" />
         <mapping from="sedimentload.m3a.coarse" to="SedimentLoadM3ACoarse" />
-        <mapping from="sedimentload.m3a.finemiddle" to="SedimentLoadM3AFineMid" />
         <mapping from="sedimentload.m3a.fine_middle" to="SedimentLoadM3AFineMid" />
         <mapping from="sedimentload.m3a.sand" to="SedimentLoadM3ASand" />
         <mapping from="sedimentload.m3a.susp_sand" to="SedimentLoadM3ASuspSand" />
         <mapping from="sedimentload.m3a.susp_sand_bed" to="SedimentLoadM3ASuspSandBed" />
-        <mapping from="sedimentload.m3a.susp_sediment" to="SedimentLoadM3ASediment" />
         <mapping from="sedimentload.m3a.suspended_sediment" to="SedimentLoadM3ASediment" />
         <mapping from="sedimentload.m3a.suspended_load" to="SedimentLoadM3ASusp" />
-        <mapping from="sedimentload.m3a.total_load" to="SedimentLoadM3ATotalLoad" />
         <mapping from="sedimentload.m3a.total" to="SedimentLoadM3ATotal" />
         <mapping from="sedimentload.m3a.bed_load" to="SedimentLoadM3ABed" />
         <mapping from="sedimentload.m3a.unknown" to="SedimentLoadM3AUnknown" />
+        <mapping from="sedimentload.coarse" to="SedimentLoadCoarse" />
+        <mapping from="sedimentload.fine_middle" to="SedimentLoadFineMid" />
+        <mapping from="sedimentload.sand" to="SedimentLoadSand" />
+        <mapping from="sedimentload.susp_sand" to="SedimentLoadSuspSand" />
+        <mapping from="sedimentload.susp_sand_bed" to="SedimentLoadSuspSandBed" />
+        <mapping from="sedimentload.suspended_sediment" to="SedimentLoadSediment" />
+        <mapping from="sedimentload.suspended_load" to="SedimentLoadSusp" />
+        <mapping from="sedimentload.total" to="SedimentLoadTotal" />
+        <mapping from="sedimentload.bed_load" to="SedimentLoadBed" />
     </mappings>
 
 </themes>
--- a/artifacts/doc/conf/themes/default.xml	Thu Aug 21 15:48:01 2014 +0200
+++ b/artifacts/doc/conf/themes/default.xml	Thu Aug 21 18:09:37 2014 +0200
@@ -1100,7 +1100,7 @@
         </fields>
     </theme>
 
-    <!-- Sediment load, M^3/A -->
+    <!-- Sediment load longitudinal sections, M^3/A -->
     <theme name="SedimentLoadM3A">
         <inherits>
             <inherit from="LongitudinalSection" />
@@ -1204,7 +1204,7 @@
             <inherit from="SedimentLoadM3A" />
         </inherits>
         <fields>
-            <field name="linecolor" type="Color" default="45, 255, 241" />
+            <field name="linecolor" type="Color" default="200, 200, 200" />
         </fields>
     </theme>
 
@@ -1217,7 +1217,7 @@
         </fields>
     </theme>
 
-    <!-- Sediment load, T/A -->
+    <!-- Sediment load longitudinal sections, T/A -->
     <theme name="SedimentLoadTACoarse">
         <inherits>
             <inherit from="LongitudinalSection" />
@@ -1312,7 +1312,7 @@
             <inherit from="LongitudinalSection" />
         </inherits>
         <fields>
-            <field name="linecolor" type="Color" default="45, 255, 241" />
+            <field name="linecolor" type="Color" default="200, 200, 200" />
         </fields>
     </theme>
 
@@ -1325,6 +1325,108 @@
         </fields>
     </theme>
 
+    <!-- Sediment load at measurement stations -->
+    <theme name="SedimentLoad">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" default="true" />
+            <field name="pointsize" type="int" default="3" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadCoarse">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 0, 255" />
+            <field name="pointcolor" type="Color" default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadFineMid">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 0, 0" />
+            <field name="pointcolor" type="Color" default="255, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadSand">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 0, 255" />
+            <field name="pointcolor" type="Color" default="0, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadSuspSand">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 255, 0" />
+            <field name="pointcolor" type="Color" default="255, 255, 0" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadSediment">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 255, 255" />
+            <field name="pointcolor" type="Color" default="0, 255, 255" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadSuspSandBed">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 255, 0" />
+            <field name="pointcolor" type="Color" default="0, 255, 0" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadTotal">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 100, 200" />
+            <field name="pointcolor" type="Color" default="0, 100, 200" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadBed">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="200, 200, 200" />
+            <field name="pointcolor" type="Color" default="200, 200, 200" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadSusp">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="85, 255, 0" />
+            <field name="pointcolor" type="Color" default="85, 255, 0" />
+        </fields>
+    </theme>
+
+
     <theme name="LongitudinalSectionArea">
         <inherits>
             <inherit from="Areas" />
--- a/artifacts/doc/conf/themes/second.xml	Thu Aug 21 15:48:01 2014 +0200
+++ b/artifacts/doc/conf/themes/second.xml	Thu Aug 21 18:09:37 2014 +0200
@@ -1100,7 +1100,7 @@
         </fields>
     </theme>
 
-    <!-- Sediment load, M^3/A -->
+    <!-- Sediment load longitudinal sections, M^3/A -->
     <theme name="SedimentLoadM3A">
         <inherits>
             <inherit from="LongitudinalSection" />
@@ -1204,7 +1204,7 @@
             <inherit from="SedimentLoadM3A" />
         </inherits>
         <fields>
-            <field name="linecolor" type="Color" default="45, 255, 241" />
+            <field name="linecolor" type="Color" default="200, 200, 200" />
         </fields>
     </theme>
 
@@ -1217,7 +1217,7 @@
         </fields>
     </theme>
 
-    <!-- Sediment load, T/A -->
+    <!-- Sediment load longitudinal sections, T/A -->
     <theme name="SedimentLoadTACoarse">
         <inherits>
             <inherit from="LongitudinalSection" />
@@ -1312,7 +1312,7 @@
             <inherit from="LongitudinalSection" />
         </inherits>
         <fields>
-            <field name="linecolor" type="Color" default="45, 255, 241" />
+            <field name="linecolor" type="Color" default="200, 200, 200" />
         </fields>
     </theme>
 
@@ -1325,6 +1325,108 @@
         </fields>
     </theme>
 
+    <!-- Sediment load at measurement stations -->
+    <theme name="SedimentLoad">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" default="true" />
+            <field name="pointsize" type="int" default="3" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadCoarse">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 0, 255" />
+            <field name="pointcolor" type="Color" default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadFineMid">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 0, 0" />
+            <field name="pointcolor" type="Color" default="255, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadSand">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 0, 255" />
+            <field name="pointcolor" type="Color" default="0, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadSuspSand">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 255, 0" />
+            <field name="pointcolor" type="Color" default="255, 255, 0" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadSediment">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 255, 255" />
+            <field name="pointcolor" type="Color" default="0, 255, 255" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadSuspSandBed">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 255, 0" />
+            <field name="pointcolor" type="Color" default="0, 255, 0" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadTotal">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 100, 200" />
+            <field name="pointcolor" type="Color" default="0, 100, 200" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadBed">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="200, 200, 200" />
+            <field name="pointcolor" type="Color" default="200, 200, 200" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadSusp">
+        <inherits>
+            <inherit from="SedimentLoad" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="85, 255, 0" />
+            <field name="pointcolor" type="Color" default="85, 255, 0" />
+        </fields>
+    </theme>
+
+
     <theme name="LongitudinalSectionArea">
         <inherits>
             <inherit from="Areas" />
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FacetTypes.java	Thu Aug 21 15:48:01 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FacetTypes.java	Thu Aug 21 18:09:37 2014 +0200
@@ -149,13 +149,14 @@
         public static boolean SEDIMENT_LOAD_TA(String type) {
             return type.startsWith("sedimentload.ta") && !type.contains("unknown");
         }
+        public static boolean SEDIMENT_LOAD(String type){
+            return type.startsWith("sedimentload") &&
+                !(type.contains(".m3a.") || type.contains(".ta."));
+        }
         public static boolean SEDIMENT_LOAD_UNKNOWN(String type) {
             return type.equals("sedimentload.m3a.unknown") ||
               type.equals("sedimentload.ta.unknown");
         }
-        public static boolean SEDIMENT_LOAD_NO_FLOAT(String type) {
-            return type.startsWith("sedimentload") && !type.contains("susp");
-        }
     };
 
     /** Available diagram/chart-types.  This enum is evaluated at certain
@@ -358,7 +359,6 @@
     String SEDIMENT_LOAD_TA_TOTAL         = "sedimentload.ta.total";
     String SEDIMENT_LOAD_TA_TOTAL_LOAD    = "sedimentload.ta.total_load";
     String SEDIMENT_LOAD_TA_UNKNOWN       = "sedimentload.ta.unknown";
-    String SEDIMENT_LOAD_TA_STATIC        = "sedimentload.ta.static";
 
     String SEDIMENT_LOAD_M3A_COARSE        = "sedimentload.m3a.coarse";
     String SEDIMENT_LOAD_M3A_SAND          = "sedimentload.m3a.sand";
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Thu Aug 21 15:48:01 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Thu Aug 21 18:09:37 2014 +0200
@@ -49,7 +49,7 @@
 {
     private static Logger logger = Logger.getLogger(SedimentLoadFacet.class);
 
-    private static final String NAME = SEDIMENT_LOAD_TA_STATIC;
+    private static final String NAME = "sedimentload";
 
     public SedimentLoadFacet() {
     }
@@ -100,7 +100,9 @@
         String fraction = split.length >= 2 ? split[1] : "";
         String years    = split.length >= 3 ? " - " + split[2] : "";
 
-        name = NAME;
+        // Name has the pattern sedimentload.<grainfraction_name>
+        name = NAME + "." + fraction;
+        logger.debug("Created facet: " + name);
 
         description = Resources.getMsg(
                 callMeta,
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/SedimentLoadProcessor.java	Thu Aug 21 15:48:01 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/SedimentLoadProcessor.java	Thu Aug 21 18:09:37 2014 +0200
@@ -47,7 +47,8 @@
 
         logger.debug("Do out for: " + facetName);
         if (FacetTypes.IS.SEDIMENT_LOAD_M3A(facetName) ||
-                FacetTypes.IS.SEDIMENT_LOAD_TA(facetName)) {
+                FacetTypes.IS.SEDIMENT_LOAD_TA(facetName) ||
+                FacetTypes.IS.SEDIMENT_LOAD(facetName)) {
             points = (double[][]) data;
         } else if (FacetTypes.IS.SEDIMENT_LOAD_UNKNOWN(facetName)) {
             SedimentLoadLSData load = (SedimentLoadLSData) data;
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/SedimentLoadTAProcessor.java	Thu Aug 21 15:48:01 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/SedimentLoadTAProcessor.java	Thu Aug 21 18:09:37 2014 +0200
@@ -25,6 +25,7 @@
     @Override
     public boolean canHandle(String facettype) {
         return FacetTypes.IS.SEDIMENT_LOAD_TA(facettype) ||
+            FacetTypes.IS.SEDIMENT_LOAD(facettype) ||
             FacetTypes.SEDIMENT_LOAD_TA_UNKNOWN.equals(facettype);
     }
 

http://dive4elements.wald.intevation.org