changeset 8130:bbad52b073a4

Use old names for SedimentloadDataFractions and add average fraction
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 25 Aug 2014 19:58:00 +0200
parents 306a16d3ac2e
children fae48b3c09d1
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataCalculation.java
diffstat 2 files changed, 22 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java	Mon Aug 25 17:28:48 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java	Mon Aug 25 19:58:00 2014 +0200
@@ -31,7 +31,8 @@
     public static final int GF_TOTAL          =  6;
     public static final int GF_BED_LOAD       =  7;
     public static final int GF_SUSPENDED_LOAD =  8;
-    public static final int GF_MAX            =  8;
+    public static final int GF_AVERAGE        =  9;
+    public static final int GF_MAX            =  9;
 
     public static final int [] MEASUREMENT_STATION_GF = {
         /* GF_COARSE         */ Station.BED_LOAD,
@@ -61,6 +62,7 @@
         if ("total".equals(name))              return GF_TOTAL;
         if ("bed_load".equals(name))           return GF_BED_LOAD;
         if ("suspended_load".equals(name))     return GF_SUSPENDED_LOAD;
+        if ("average".equals(name))            return GF_AVERAGE;
         return GF_UNKNOWN;
     }
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataCalculation.java	Mon Aug 25 17:28:48 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadDataCalculation.java	Mon Aug 25 19:58:00 2014 +0200
@@ -91,6 +91,10 @@
         SedimentLoadData.GF_SUSP_SEDIMENT
     };
 
+    public static final int [] AVERAGE_FLYS = {
+        SedimentLoadData.GF_AVERAGE
+    };
+
     public static final class GrainFraction {
         private String description;
         private int [] grainFractions;
@@ -113,19 +117,21 @@
     } // class GrainFraction
 
     public static final GrainFraction [] GRAIN_FRACTIONS = {
-        // TODO: i18n
-        GrainFraction.make("minfo.total.load.flys",         TOTAL_LOAD_FLYS),
-        GrainFraction.make("minfo.bed.load.flys",           BED_LOAD_FLYS),
-        GrainFraction.make("minfo.bed.load.susp.sand.flys", BED_LOAD_SUSP_SAND_FLYS),
-        GrainFraction.make("minfo.total.load.bfg",          TOTAL_LOAD_BFG),
-        GrainFraction.make("minfo.bed.load.bfg",            BED_LOAD_BFG),
-        GrainFraction.make("minfo.suspended.load.bfg",      SUSPENDED_LOAD_BFG),
-        GrainFraction.make("minfo.coarse.flys",             COARSE_FLYS),
-        GrainFraction.make("minfo.fine.middle.flys",        FINE_MIDDLE_FLYS),
-        GrainFraction.make("minfo.sand.flys",               SAND_FLYS) ,
-        GrainFraction.make("minfo.susp.sand.flys",          SUSP_SAND_FLYS),
-        GrainFraction.make("minfo.susp.sand.bed.flys",      SUSP_SAND_BED_FLYS),
-        GrainFraction.make("minfo.susp.sediment.flys",      SUSP_SEDIMENT_FLYS),
+        // TODO: i18n for bfg parts
+        // Grain fraction names are alignt to the grain_fractions table
+        GrainFraction.make("total",              TOTAL_LOAD_FLYS),
+        GrainFraction.make("bed_load",           BED_LOAD_FLYS),
+        GrainFraction.make("susp_sand_bed",      BED_LOAD_SUSP_SAND_FLYS),
+        GrainFraction.make("total.bfg",          TOTAL_LOAD_BFG),
+        GrainFraction.make("bed_load.bfg",       BED_LOAD_BFG),
+        GrainFraction.make("suspended_load.bfg", SUSPENDED_LOAD_BFG),
+        GrainFraction.make("coarse",             COARSE_FLYS),
+        GrainFraction.make("fine_middle",        FINE_MIDDLE_FLYS),
+        GrainFraction.make("sand",               SAND_FLYS) ,
+        GrainFraction.make("susp_sand",          SUSP_SAND_FLYS),
+        GrainFraction.make("susp_sand_bed",      SUSP_SAND_BED_FLYS),
+        GrainFraction.make("suspended_sediment", SUSP_SEDIMENT_FLYS),
+        GrainFraction.make("average",            AVERAGE_FLYS),
     };
 
     public static class Sum implements Value.Visitor {

http://dive4elements.wald.intevation.org