changeset 6207:a82a724356f0

Updade sq relation pdf export as specified in issue1071
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 05 Jun 2013 14:44:36 +0200
parents 743eab7acfdb
children 715e010d40de
files artifacts/doc/conf/jasper/sqrelation.jasper artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java
diffstat 3 files changed, 19 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
Binary file artifacts/doc/conf/jasper/sqrelation.jasper has changed
--- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java	Wed Jun 05 13:18:25 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java	Wed Jun 05 14:44:36 2013 +0200
@@ -171,8 +171,8 @@
             }
 
             String a, b, sd, o, t;
-            a  = Formatter.getSQRelation(context).format(parameters.getValue(0, "a"));
-            b  = Formatter.getSQRelation(context).format(parameters.getValue(0, "b"));
+            a  = Formatter.getSQRelationA(context).format(parameters.getValue(0, "a"));
+            b  = Formatter.getSQRelationB(context).format(parameters.getValue(0, "b"));
             sd = Formatter.getVariance(context).format(Math.sqrt(parameters.getValue(0, "std_dev")));
 
             o  = String.valueOf(fraction.totalNumOutliers());
--- a/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Wed Jun 05 13:18:25 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Wed Jun 05 14:44:36 2013 +0200
@@ -88,12 +88,14 @@
     public static final int FIX_DELTA_W_DELTA_Q_MIN_DIGITS  = 0;
     public static final int FIX_DELTA_W_DELTA_Q_MAX_DIGITS  = 2;
 
-    public static final int VARIANCE_MIN_DIGITS = 0;
-    public static final int VARIANCE_MAX_DIGITS = 4;
+    public static final int VARIANCE_MIN_DIGITS = 3;
+    public static final int VARIANCE_MAX_DIGITS = 3;
 
     // SQ Relation
-    public static final int SQ_RELATION_MAX_DIGITS = 8;
-    public static final int SQ_RELATION_MIN_DIGITS = 0;
+    public static final int SQ_RELATION_A_MAX_DIGITS = 7;
+    public static final int SQ_RELATION_A_MIN_DIGITS = 7;
+    public static final int SQ_RELATION_B_MAX_DIGITS = 3;
+    public static final int SQ_RELATION_B_MIN_DIGITS = 3;
 
     /**
      * Creates a localized NumberFormatter with given range of decimal digits.
@@ -437,12 +439,18 @@
                 VARIANCE_MAX_DIGITS);
     }
 
-    public static NumberFormat getSQRelation(CallContext context) {
-        // Would be nice if E0 would not be shown
-        return getScientificFormater(
+    public static NumberFormat getSQRelationA(CallContext context) {
+        return getFormatter(
                 context,
-                SQ_RELATION_MIN_DIGITS,
-                SQ_RELATION_MAX_DIGITS);
+                SQ_RELATION_A_MIN_DIGITS,
+                SQ_RELATION_A_MAX_DIGITS);
+    }
+
+    public static NumberFormat getSQRelationB(CallContext context) {
+        return getFormatter(
+                context,
+                SQ_RELATION_B_MIN_DIGITS,
+                SQ_RELATION_B_MAX_DIGITS);
     }
 
     public static NumberFormat getMeterFormat(CallContext context) {

http://dive4elements.wald.intevation.org