[PATCH] At least since rev eb052d759fcc, there are no bed height epochs anymore

Wald Commits scm-commit at wald.intevation.org
Thu Sep 18 18:16:54 CEST 2014


# HG changeset patch
# User "Tom Gottfried <tom at intevation.de>"
# Date 1411057011 -7200
# Node ID 9ab967eb2c51e8c2859b5d1db0f8cf2fd9455216
# Parent  d08e3737ab2da663693a3281231a63f9c3550305
At least since rev eb052d759fcc, there are no bed height epochs anymore.

diff -r d08e3737ab2d -r 9ab967eb2c51 artifacts/doc/conf/artifacts/minfo.xml
--- a/artifacts/doc/conf/artifacts/minfo.xml	Wed Sep 17 19:46:19 2014 +0200
+++ b/artifacts/doc/conf/artifacts/minfo.xml	Thu Sep 18 18:16:51 2014 +0200
@@ -166,7 +166,6 @@
                 <outputmode name="bedheight_middle" description="output.bedheight_middle" mime-type="image/png" type="chart">
                     <facets>
                         <facet name="bedheight_middle.single" description="A facet for total channels"/>
-                        <facet name="bedheight_middle.epoch"  description="A facet for total channels"/>
                         <facet name="longitudinal_section.w"  description="Datacage facet"/>
                         <facet name="bedheight_middle.manualpoints" description="points"/>
                         <facet name="bedheight" description="Datacage facet"/>
diff -r d08e3737ab2d -r 9ab967eb2c51 artifacts/doc/conf/themes.xml
--- a/artifacts/doc/conf/themes.xml	Wed Sep 17 19:46:19 2014 +0200
+++ b/artifacts/doc/conf/themes.xml	Thu Sep 18 18:16:51 2014 +0200
@@ -215,7 +215,6 @@
         <mapping from="flow_velocity.discharge" to="FlowVelocityDischarge" />
         <mapping from="flow_velocity.measurement" to="FlowVelocityDischarge" />
         <mapping from="bedheight_middle.single" to="MiddleBedHeightSingle" />
-        <mapping from="bedheight_middle.epoch" to="MiddleBedHeightEpoch" />
         <mapping from="bed_longitudinal_section.porosity_toplayer" to="PorosityTopLayer" />
         <mapping from="bed_longitudinal_section.porosity_sublayer" to="PorositySubLayer" />
         <mapping from="bed_longitudinal_section.sediment_density_toplayer" to="DensityTopLayer" />
diff -r d08e3737ab2d -r 9ab967eb2c51 artifacts/doc/conf/themes/default.xml
--- a/artifacts/doc/conf/themes/default.xml	Wed Sep 17 19:46:19 2014 +0200
+++ b/artifacts/doc/conf/themes/default.xml	Thu Sep 18 18:16:51 2014 +0200
@@ -872,16 +872,6 @@
         </fields>
     </theme>
 
-    <theme name="MiddleBedHeightEpoch">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
     <!-- Bed Quality -->
     <theme name="PorosityTopLayer">
         <inherits>
diff -r d08e3737ab2d -r 9ab967eb2c51 artifacts/doc/conf/themes/second.xml
--- a/artifacts/doc/conf/themes/second.xml	Wed Sep 17 19:46:19 2014 +0200
+++ b/artifacts/doc/conf/themes/second.xml	Thu Sep 18 18:16:51 2014 +0200
@@ -872,16 +872,6 @@
         </fields>
     </theme>
 
-    <theme name="MiddleBedHeightEpoch">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
     <!-- Bed Quality -->
     <theme name="PorosityTopLayer">
         <inherits>
diff -r d08e3737ab2d -r 9ab967eb2c51 artifacts/src/main/java/org/dive4elements/river/artifacts/model/FacetTypes.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FacetTypes.java	Wed Sep 17 19:46:19 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FacetTypes.java	Thu Sep 18 18:16:51 2014 +0200
@@ -49,8 +49,7 @@
             return type.equals(FLOW_VELOCITY_TAU);
         }
         public static boolean H(String type) {
-            return type.equals(MIDDLE_BED_HEIGHT_SINGLE)
-                || type.equals(MIDDLE_BED_HEIGHT_EPOCH);
+            return type.equals(MIDDLE_BED_HEIGHT_SINGLE);
         }
         public static boolean MANUALPOINTS(String type) {
             return type.endsWith("manualpoints");
@@ -313,7 +312,6 @@
     String FLOW_VELOCITY_WATERLEVEL            = "flow_velocity.waterlevel";
 
     String MIDDLE_BED_HEIGHT_SINGLE     = "bedheight_middle.single";
-    String MIDDLE_BED_HEIGHT_EPOCH      = "bedheight_middle.epoch";
     String MIDDLE_BED_HEIGHT_ANNOTATION = "bedheight_middle.annotation";
 
     String BED_QUALITY_POROSITY_TOPLAYER         = "bed_longitudinal_section.porosity_toplayer";
diff -r d08e3737ab2d -r 9ab967eb2c51 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MiddleBedHeightData.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MiddleBedHeightData.java	Wed Sep 17 19:46:19 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/MiddleBedHeightData.java	Thu Sep 18 18:16:51 2014 +0200
@@ -28,10 +28,8 @@
     private static final Logger log = Logger.getLogger(MiddleBedHeightData.class);
 
     public static final String I18N_SINGLE_NAME = "facet.bedheight_middle.single";
-    public static final String I18N_EPOCH_NAME  = "facet.bedheight_middle.epoch";
 
-    private int    startYear;
-    private int    endYear;
+    private int    year;
     private String evaluatedBy;
     private String description;
 
@@ -50,12 +48,11 @@
     private ArrayList empty;
 
 
-    protected MiddleBedHeightData(int start, int end, String eval, String desc,
+    protected MiddleBedHeightData(int year, int end, String eval, String desc,
         String curElevationModel, String oldElevationModel,
         String riverElevationModel, String type,
         String locationSystem, Integer soundingWidth) {
-        this.startYear   = start;
-        this.endYear     = end;
+        this.year   = year;
         this.evaluatedBy = eval;
         this.description = desc;
         this.curElevationModel = curElevationModel;
@@ -86,12 +83,8 @@
     }
 
 
-    public int getStartYear() {
-        return startYear;
-    }
-
-    public int getEndYear() {
-        return endYear;
+    public int getYear() {
+        return year;
     }
 
     public String getEvaluatedBy() {
@@ -214,22 +207,11 @@
 
 
     public String getSoundingName(CallContext context) {
-        if (getStartYear() == getEndYear()) {
-            return Resources.getMsg(
-                context.getMeta(),
-                I18N_SINGLE_NAME,
-                I18N_SINGLE_NAME,
-                new Object[] { getStartYear() }
-            );
-        }
-        else {
-            return Resources.getMsg(
-                context.getMeta(),
-                I18N_EPOCH_NAME,
-                I18N_EPOCH_NAME,
-                new Object[] { getStartYear(), getEndYear() }
-            );
-        }
+        return Resources.getMsg(
+            context.getMeta(),
+            I18N_SINGLE_NAME,
+            new Object[] { getYear() }
+        );
     }
 
     @Override
diff -r d08e3737ab2d -r 9ab967eb2c51 artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java	Wed Sep 17 19:46:19 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java	Thu Sep 18 18:16:51 2014 +0200
@@ -71,56 +71,29 @@
         int    idx = 0;
 
         for (MiddleBedHeightData d: data) {
-            if (d.getStartYear() == d.getEndYear()) {
-                MiddleBedHeightFacet mf = new MiddleBedHeightFacet(
-                    idx,
-                    MIDDLE_BED_HEIGHT_SINGLE,
-                    d.getDescription(),
-                    ComputeType.ADVANCE,
-                    id,
-                    hash
-                );
-                mf.addMetaData(Resources.getMsg(
+            MiddleBedHeightFacet mf = new MiddleBedHeightFacet(
+                idx,
+                MIDDLE_BED_HEIGHT_SINGLE,
+                d.getDescription(),
+                ComputeType.ADVANCE,
+                id,
+                hash
+            );
+            mf.addMetaData(Resources.getMsg(
                     context.getMeta(),
                     "meta.bedheight.cur.elevation",
                     "Current elevation model"),
-                    d.getCurElevationModel());
-                mf.addMetaData(Resources.getMsg(
+                d.getCurElevationModel());
+            mf.addMetaData(Resources.getMsg(
                     context.getMeta(),
                     "meta.bedheight.old.elevation",
                     "Old elevation model"),
-                    d.getOldElevationModel());
-                mf.addMetaData(Resources.getMsg(
+                d.getOldElevationModel());
+            mf.addMetaData(Resources.getMsg(
                     context.getMeta(),
                     "meta.bedheight.river.elevation",
                     "River elevation model"), u.getName());
-                newFacets.add(mf);
-            }
-            else {
-                MiddleBedHeightFacet mf = new MiddleBedHeightFacet(
-                    idx,
-                    MIDDLE_BED_HEIGHT_EPOCH,
-                    d.getDescription(),
-                    ComputeType.ADVANCE,
-                    id,
-                    hash
-                );
-                mf.addMetaData(Resources.getMsg(
-                    context.getMeta(),
-                    "meta.bedheight.cur.elevation",
-                    "Current elevation model"),
-                    d.getCurElevationModel());
-                mf.addMetaData(Resources.getMsg(
-                    context.getMeta(),
-                    "meta.bedheight.old.elevation",
-                    "Old elevation model"),
-                    d.getOldElevationModel());
-                mf.addMetaData(Resources.getMsg(
-                    context.getMeta(),
-                    "meta.bedheight.river.elevation",
-                    "River elevation model"), u.getName());
-                newFacets.add(mf);
-            }
+            newFacets.add(mf);
 
             idx++;
         }
diff -r d08e3737ab2d -r 9ab967eb2c51 artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java	Wed Sep 17 19:46:19 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java	Thu Sep 18 18:16:51 2014 +0200
@@ -167,17 +167,13 @@
         }
 
         for (int i: kmIndexMap.values()) {
-            int start = data.getStartYear();
-            int end   = data.getEndYear();
-
-            if (start == end) {
-                String uncert = !Double.isNaN(data.getUncertainty(i)) ?
-                    uncertF.format(data.getUncertainty(i)) : "";
-                String gap = !Double.isNaN(data.getDataGap(i)) ?
-                    gapF.format(data.getDataGap(i)) + "%" : "";
-                String sound = !Double.isNaN(data.getSoundingWidth(i)) ?
-                    soundF.format(data.getSoundingWidth(i)) : "";
-                writer.writeNext(new String[] {
+            String uncert = !Double.isNaN(data.getUncertainty(i)) ?
+                uncertF.format(data.getUncertainty(i)) : "";
+            String gap = !Double.isNaN(data.getDataGap(i)) ?
+                gapF.format(data.getDataGap(i)) + "%" : "";
+            String sound = !Double.isNaN(data.getSoundingWidth(i)) ?
+                soundF.format(data.getSoundingWidth(i)) : "";
+            writer.writeNext(new String[] {
                     kmF.format(data.getKM(i)),
                     data.getDescription(),
                     heightF.format(data.getMiddleHeight(i)),
@@ -187,20 +183,6 @@
                     widthF.format(data.getWidth(i)),
                     RiverUtils.getLocationDescription(flys, data.getKM(i)),
                 });
-            }
-            else {
-                writer.writeNext(new String[] {
-                    kmF.format(data.getKM(i)),
-                    data.getDescription(),
-                    heightF.format(data.getMiddleHeight(i)),
-                    "",
-                    "",
-                    "",
-                    "",
-                    RiverUtils.getLocationDescription(flys, data.getKM(i)),
-                });
-            }
-
         }
     }
 
@@ -208,8 +190,8 @@
     private void writeMetaData(CSVWriter writer, MiddleBedHeightData data) {
          writer.writeNext(new String[]{"#"});
          String year = "";
-         if (data.getStartYear() != 0) {
-             year = String.valueOf(data.getStartYear());
+         if (data.getYear() != 0) {
+             year = String.valueOf(data.getYear());
          }
          writer.writeNext(new String[]{"# " + msg(CSV_META_YEAR) +
              ": " + year});
diff -r d08e3737ab2d -r 9ab967eb2c51 artifacts/src/main/java/org/dive4elements/river/exports/process/MiddleBedHeightProcessor.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/MiddleBedHeightProcessor.java	Wed Sep 17 19:46:19 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/MiddleBedHeightProcessor.java	Thu Sep 18 18:16:51 2014 +0200
@@ -91,7 +91,6 @@
         if (facetType == null) {
             return false;
         }
-        return facetType.equals(FacetTypes.MIDDLE_BED_HEIGHT_EPOCH) ||
-            facetType.equals(FacetTypes.MIDDLE_BED_HEIGHT_SINGLE);
+        return facetType.equals(FacetTypes.MIDDLE_BED_HEIGHT_SINGLE);
     }
 }


More information about the Dive4Elements-commits mailing list