[Dive4elements-commits] [PATCH 1 of 3] Updade sq relation pdf export as specified in issue1071

Wald Commits scm-commit at wald.intevation.org
Wed Jun 5 18:03:41 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1370436276 -7200
# Node ID a82a724356f0e41e00e5d33a25be8cfd2860a2aa
# Parent  743eab7acfdb3e653d7fc5bd9f6bb51d2de25e46
Updade sq relation pdf export as specified in issue1071

diff -r 743eab7acfdb -r a82a724356f0 artifacts/doc/conf/jasper/sqrelation.jasper
Binary file artifacts/doc/conf/jasper/sqrelation.jasper has changed
diff -r 743eab7acfdb -r a82a724356f0 artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java
--- 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());
diff -r 743eab7acfdb -r a82a724356f0 artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java
--- 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) {


More information about the Dive4elements-commits mailing list