diff artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/BunduResultType.java @ 9330:0a0937f33bb5

bundu.bezugswst first result for missing volume added
author gernotbelger
date Fri, 27 Jul 2018 17:19:27 +0200
parents 7b2b086e45f0
children 127638669052
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/BunduResultType.java	Fri Jul 27 16:19:09 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/BunduResultType.java	Fri Jul 27 17:19:27 2018 +0200
@@ -26,10 +26,15 @@
         super(unit, csvHeader, pdfHeader);
     }
 
+    protected BunduResultType(final String unit, final String csvHeader) {
+        super(unit, csvHeader, csvHeader);
+    }
+
     private static final long serialVersionUID = 1L;
 
-    public static final BunduResultType bezugswst = new BunduResultType(I18NStrings.CSV_META_HEIGHT_UNIT_RIVER, "bundu.wst.export.csv.meta.header.bezugswst",
-            "bundu.wst.export.csv.meta.header.bezugswst") { // UNIT needed?
+    public static final BunduResultType bezugswst = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.wst.export.csv.meta.header.bezugswst",
+            "bundu.wst.export.pdf.meta.header.bezugswst") { // Unit
+                                                            // dynamic
         private static final long serialVersionUID = 1L;
 
         @Override
@@ -44,4 +49,189 @@
         }
     };
 
+    public static final BunduResultType sounding = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.sounding") {
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public String exportValue(final CallContext context, final Object value) {
+            return exportStringValue(value);
+        }
+
+        @Override
+        protected NumberFormat createFormatter(final CallContext context) {
+            throw new UnsupportedOperationException();
+        }
+    };
+
+    public static final BunduResultType channelLowerEdge = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.channel.lower_edge",
+            "bundu.export.bezugswst.pdf.meta.miss.channel.lower_edge") { // Unit dynamic
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public String exportValue(final CallContext context, final Object value) {
+            final double doubleValue = asDouble(value);
+            return exportDoubleValue(context, doubleValue);
+        }
+
+        @Override
+        protected NumberFormat createFormatter(final CallContext context) {
+            return Formatter.getWaterlevelQ(context); // Richtiges Format? TODO check!
+        }
+    };
+
+    public static final BunduResultType channelMinDepth = new BunduResultType(I18NStrings.UNIT_M, "bundu.export.bezugswst.csv.meta.miss.channel.min_depth",
+            "bundu.export.bezugswst.pdf.meta.miss.channel.min_depth") {
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public String exportValue(final CallContext context, final Object value) {
+            final double doubleValue = asDouble(value);
+            return exportDoubleValue(context, doubleValue);
+        }
+
+        @Override
+        protected NumberFormat createFormatter(final CallContext context) {
+            return Formatter.getWaterlevelQ(context); // Richtiges Format? TODO check!
+        }
+    };
+
+    public static final BunduResultType hasMissingDepth = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.exists",
+            "bundu.export.bezugswst.pdf.meta.miss.exists") {
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public String exportValue(final CallContext context, final Object value) {
+            return exportStringValue(value);
+        }
+
+        @Override
+        protected NumberFormat createFormatter(final CallContext context) {
+            throw new UnsupportedOperationException();
+        }
+    };
+    public static final BunduResultType missVolume = new BunduResultType(I18NStrings.UNIT_CUBIC_M, "bundu.export.bezugswst.csv.meta.miss.volume") {
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public String exportValue(final CallContext context, final Object value) {
+            final double doubleValue = asDouble(value);
+            return exportDoubleValue(context, doubleValue);
+        }
+
+        @Override
+        protected NumberFormat createFormatter(final CallContext context) {
+            return Formatter.getWaterlevelQ(context); // Richtiges Format? TODO check!
+        }
+    };
+
+    public static final BunduResultType missMass = new BunduResultType(I18NStrings.UNIT_TON, "bundu.export.bezugswst.csv.meta.miss.mass",
+            "bundu.export.bezugswst.csv.meta.miss.mass") {
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public String exportValue(final CallContext context, final Object value) {
+            final double doubleValue = asDouble(value);
+            return exportDoubleValue(context, doubleValue);
+        }
+
+        @Override
+        protected NumberFormat createFormatter(final CallContext context) {
+            return Formatter.getWaterlevelQ(context); // Richtiges Format? TODO check!
+        }
+    };
+
+    public static final BunduResultType excavationVolume = new BunduResultType(I18NStrings.UNIT_CUBIC_M, "bundu.export.bezugswst.csv.meta.miss.excavation",
+            "bundu.export.bezugswst.pdf.meta.miss.excavation") {
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public String exportValue(final CallContext context, final Object value) {
+            final double doubleValue = asDouble(value);
+            return exportDoubleValue(context, doubleValue);
+        }
+
+        @Override
+        protected NumberFormat createFormatter(final CallContext context) {
+            return Formatter.getWaterlevelQ(context); // Richtiges Format? TODO check!
+        }
+    };
+
+    public static final BunduResultType excavationCosts = new BunduResultType(I18NStrings.UNIT_EURO, "bundu.export.bezugswst.csv.meta.miss.costs",
+            "bundu.export.bezugswst.pdf.meta.miss.costs") {
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public String exportValue(final CallContext context, final Object value) {
+            final double doubleValue = asDouble(value);
+            return exportDoubleValue(context, doubleValue);
+        }
+
+        @Override
+        protected NumberFormat createFormatter(final CallContext context) {
+            return Formatter.getWaterlevelQ(context); // Richtiges Format? TODO check!
+        }
+    };
+
+    public static final BunduResultType channelWidth = new BunduResultType(I18NStrings.UNIT_M, "bundu.export.bezugswst.csv.meta.miss.channel.width",
+            "bundu.export.bezugswst.pdf.meta.miss.channel.width") {
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public String exportValue(final CallContext context, final Object value) {
+            final double doubleValue = asDouble(value);
+            return exportDoubleValue(context, doubleValue);
+        }
+
+        @Override
+        protected NumberFormat createFormatter(final CallContext context) {
+            return Formatter.getWaterlevelQ(context); // Richtiges Format? TODO check!
+        }
+    };
+
+    public static final BunduResultType density = new BunduResultType(I18NStrings.UNIT_M, "bundu.export.bezugswst.csv.meta.miss.density",
+            "bundu.export.bezugswst.pdf.meta.miss.density") {
+        private static final long serialVersionUID = 1L;
+
+        @Override
+        public String exportValue(final CallContext context, final Object value) {
+            final double doubleValue = asDouble(value);
+            return exportDoubleValue(context, doubleValue);
+        }
+
+        @Override
+        protected NumberFormat createFormatter(final CallContext context) {
+            return Formatter.getWaterlevelQ(context); // Richtiges Format? TODO check!
+        }
+    };
+
+    public static final BunduResultType field = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.field") {
+        private static final long serialVersionUID = 1L; // unit steht in der zelle jedesmal: z.B. 1125 [m³] / 1912.5 [t] (Dezimaltrennzeichen bwt)
+        // ist warscheinlich schwierig mit dem Replacement von "{0}"
+
+        @Override
+        public String exportValue(final CallContext context, final Object value) {
+            final double doubleValue = asDouble(value);
+            return exportDoubleValue(context, doubleValue);
+        }
+
+        @Override
+        protected NumberFormat createFormatter(final CallContext context) {
+            return Formatter.getWaterlevelQ(context); // Richtiges Format? TODO check!
+        }
+    };
+
+    public static final BunduResultType meanBedheight = new BunduResultType(I18NStrings.UNIT_NONE, "bundu.export.bezugswst.csv.meta.miss.mean_bedheight") {
+        private static final long serialVersionUID = 1L; // unit steht in der zelle jedesmal: z.B. 1125 [m³] / 1912.5 [t] (Dezimaltrennzeichen bwt)
+
+        @Override
+        public String exportValue(final CallContext context, final Object value) {
+            final double doubleValue = asDouble(value);
+            return exportDoubleValue(context, doubleValue);
+        }
+
+        @Override
+        protected NumberFormat createFormatter(final CallContext context) {
+            return Formatter.getWaterlevelQ(context); // Richtiges Format? TODO check!
+        }
+    };
 }
\ No newline at end of file

http://dive4elements.wald.intevation.org