# HG changeset patch # User Sascha L. Teichmann # Date 1405589845 -7200 # Node ID cde6d2a9ec3204db1cfb997e7af0b54fb81582e9 # Parent c835f3cf098e032bd440982ea1a26eff209030cd Sediment Load: Added table to figure out where grain fractions are measured. diff -r c835f3cf098e -r cde6d2a9ec32 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java Thu Jul 17 11:19:59 2014 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadData.java Thu Jul 17 11:37:25 2014 +0200 @@ -32,6 +32,21 @@ public static final int GF_SUSPENDED_LOAD = 8; public static final int GF_MAX = 8; + public static final int [] MEASUREMENT_STATION_GF = { + /* GF_COARSE */ Station.BED_LOAD, + /* GF_FINE_MIDDLE */ Station.BED_LOAD, + /* GF_SAND */ Station.BED_LOAD, + /* GF_SUSP_SAND */ Station.BED_LOAD, + /* GF_SUSP_SAND_BED */ Station.BED_LOAD, + /* GF_SUSP_SEDIMENT */ Station.SUSPENDED + }; + + public static final int measurementStationType(int grainFraction) { + return grainFraction < 0 || grainFraction >= MEASUREMENT_STATION_GF.length + ? Station.UNKNOWN + : MEASUREMENT_STATION_GF[grainFraction]; + } + public static final int grainFractionIndex(String name) { if ("coarse".equals(name)) return GF_COARSE; if ("fine_middle".equals(name)) return GF_FINE_MIDDLE; @@ -123,6 +138,7 @@ public static class Station implements Serializable { + public static final int UNKNOWN = 0; public static final int BED_LOAD = 1; public static final int SUSPENDED = 2;