changeset 8295:9ab967eb2c51

At least since rev eb052d759fcc, there are no bed height epochs anymore.
author "Tom Gottfried <tom@intevation.de>"
date Thu, 18 Sep 2014 18:16:51 +0200
parents d08e3737ab2d
children df5838cc7ecc
files artifacts/doc/conf/artifacts/minfo.xml 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/MiddleBedHeightData.java artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightExporter.java artifacts/src/main/java/org/dive4elements/river/exports/process/MiddleBedHeightProcessor.java
diffstat 9 files changed, 35 insertions(+), 123 deletions(-) [+]
line wrap: on
line diff
--- 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"/>
--- 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" />
--- 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>
--- 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>
--- 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";
--- 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
--- 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++;
         }
--- 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});
--- 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);
     }
 }

http://dive4elements.wald.intevation.org