changeset 8932:8731c3dabb56

Extracting some winfo logic without breaking old code
author gernotbelger
date Tue, 06 Mar 2018 17:04:59 +0100
parents b10f8415798c
children 05b5588bdd94
files artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java	Tue Mar 06 17:04:17 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java	Tue Mar 06 17:04:59 2018 +0100
@@ -85,9 +85,17 @@
     public static final String CSV_Q_HEADER =
         "export.waterlevel.csv.header.q";
 
+    /**
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
+     */
+    @Deprecated
     public static final String CSV_Q_DESC_HEADER =
         "export.waterlevel.csv.header.q.desc";
 
+    /**
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
+     */
+    @Deprecated
     public static final String CSV_W_DESC_HEADER =
         "export.waterlevel.csv.header.w.desc";
 
@@ -130,7 +138,15 @@
     public static final String DEFAULT_CSV_KM_HEADER       = "Fluss-Km";
     public static final String DEFAULT_CSV_W_HEADER        = "W [NN + m]";
     public static final String DEFAULT_CSV_Q_HEADER        = "Q [m\u00b3/s]";
+    /**
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
+     */
+    @Deprecated
     public static final String DEFAULT_CSV_Q_DESC_HEADER   = "Bezeichnung";
+    /**
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
+     */
+    @Deprecated
     public static final String DEFAULT_CSV_W_DESC_HEADER   = "W/Pegel [cm]";
     public static final String DEFAULT_CSV_LOCATION_HEADER = "Lage";
     public static final String DEFAULT_CSV_GAUGE_HEADER    = "Bezugspegel";
@@ -268,6 +284,10 @@
     }
 
 
+    /**
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
+     */
+    @Deprecated
     protected String getCSVRowTitle(WINFOArtifact winfo, WQKms wqkms) {
         log.debug("WaterlevelExporter.prepareNamedValue");
 
@@ -299,7 +319,10 @@
     /**
      * Get a string like 'W=' or 'Q=' with a number following in localized
      * format.
+     * 
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
      */
+    @Deprecated
     protected String localizeWQKms(WINFOArtifact winfo, WQKms wqkms) {
         WQ_MODE wqmode   = RiverUtils.getWQMode(winfo);
         Double  rawValue = wqkms.getRawValue();
@@ -548,6 +571,8 @@
                 msg(CSV_KM_HEADER, DEFAULT_CSV_KM_HEADER),
                 msg(CSV_W_HEADER, DEFAULT_CSV_W_HEADER, new Object[] { unit }),
                 msg(CSV_Q_HEADER, DEFAULT_CSV_Q_HEADER),
+                
+                // FIXME: use WaterlevelDescriptionBuilder instead and also remove all this duplicate code.
                 (isQ
                     ? msg(CSV_Q_DESC_HEADER, DEFAULT_CSV_Q_DESC_HEADER)
                     : msg(CSV_W_DESC_HEADER, DEFAULT_CSV_W_DESC_HEADER)),
@@ -616,6 +641,10 @@
         });
     }
 
+    /**
+     * @deprecated Use {@link WaterlevelDescriptionBuilder} instead.
+     */
+    @Deprecated
     private String getDesc(WQKms wqkms, boolean isQ)
     {
         D4EArtifact flys = (D4EArtifact) master;

http://dive4elements.wald.intevation.org