diff artifacts/src/main/java/org/dive4elements/river/exports/ATWriter.java @ 8362:839032ac1523

Purge obsolete representation of reference system for discharge tables.
author Tom Gottfried <tom@intevation.de>
date Wed, 01 Oct 2014 15:54:47 +0200
parents e4606eae8ea5
children 0a5239a1e46e
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ATWriter.java	Wed Oct 01 15:42:55 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ATWriter.java	Wed Oct 01 15:54:47 2014 +0200
@@ -46,9 +46,6 @@
     public static final String I18N_AT_GAUGE_HEADER =
         "export.discharge.curve.at.gauge.header";
 
-    public static final String I18N_AT_CALC_GAUGE_HEADER =
-        "export.discharge.curve.at.gauge.calc.header";
-
     public static final String EMPTY = "         ";
 
     public static double getQ(int w, UnivariateRealFunction qFunc) {
@@ -75,24 +72,6 @@
         out.printf(Locale.US, format, q);
     }
 
-    protected static void printCalculatedGaugeHeader(
-        PrintWriter out,
-        CallMeta    callMeta,
-        String      river,
-        double      km,
-        String      gName,
-        BigDecimal  datum,
-        Date        date,
-        String      unit
-    ) {
-        out.print("*" + Resources.getMsg(
-            callMeta,
-            I18N_AT_CALC_GAUGE_HEADER,
-            I18N_AT_CALC_GAUGE_HEADER,
-            new Object[] { river, gName, datum, unit } ));
-        out.print("\r\n");
-    }
-
     protected static void printGaugeHeader(
         PrintWriter out,
         CallMeta    callMeta,
@@ -148,20 +127,8 @@
 
         WQ wq = WQ.getFixedWQforExportAtGauge(values, datum);
 
-        // If we converted to centimeter we know that the WQ table is
-        // calculated because of the assumption that all calculations
-        // are in Meter and only the discharge tables data is in meter.
-        boolean isCalculation = wq.getReferenceSystem() != values.getReferenceSystem();
-
         int [] bounds = wq.longestIncreasingWRangeIndices();
 
-        if (log.isDebugEnabled()) {
-            log.debug("exporting " + (isCalculation ? "calculated " : "") +
-                "w between indices " + bounds[0] + " and " + bounds[1] + " (" +
-                (int)Math.ceil(wq.getW(bounds[0])) + ", " +
-                (int)Math.floor(wq.getW(bounds[1]))+ ")");
-        }
-
         if (bounds[1]-bounds[0] < 1) { // Only first w can be written out.
             minW = maxW = (int)Math.round(wq.getW(bounds[0]));
             minQ = maxQ = wq.getQ(bounds[0]);
@@ -195,11 +162,7 @@
         // A header is required, because the desktop version of FLYS will skip
         // the first row.
         if (gName != null) {
-            if (isCalculation) {
-                printCalculatedGaugeHeader(out, meta, river, km, gName, datum, date, unit);
-            } else {
-                printGaugeHeader(out, meta, river, km, gName, datum, date, unit);
-            }
+            printGaugeHeader(out, meta, river, km, gName, datum, date, unit);
         }
         else {
             printHeader(out, meta, river, km);

http://dive4elements.wald.intevation.org