[PATCH] Subtract PNP before calculating wcm from wMinCM (issue1155)

Wald Commits scm-commit at wald.intevation.org
Tue Jul 23 15:09:34 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1374584970 -7200
# Node ID 65a5deaee769c8c8c7e1e30f35956fa8b66ba119
# Parent  3aa6c1f5ddc35e85927cab80b588a3a9118ce5d3
Subtract PNP before calculating wcm from wMinCM (issue1155)

diff -r 3aa6c1f5ddc3 -r 65a5deaee769 artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATWriter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATWriter.java	Tue Jul 23 09:49:11 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATWriter.java	Tue Jul 23 15:09:30 2013 +0200
@@ -115,7 +115,7 @@
 
         double wMin = minW(invInst, wMax, qMax[0]);
 
-        double wMinCM = wMin * 100d;
+        double wMinCM = wMin * 100d - subtractPNP;
         double wMaxCM = wMax * 100d;
 
         int wRow = ((int)wMinCM / 10) * 10;
@@ -124,7 +124,7 @@
             wMinCM = (int)wMinCM + 1d;
         }
 
-        double w = wMinCM / 100.0;
+        double w = (wMinCM + subtractPNP) / 100.0;
 
         int wcm = ((int)wMinCM) % 10;
 
@@ -132,9 +132,10 @@
             log.debug("wMinCM: " + wMinCM);
             log.debug("wMaxCM: " + wMaxCM);
             log.debug("wcm: " + wcm);
+            log.debug("subtractPNP: " + subtractPNP);
         }
 
-        out.printf(Locale.US, "%8d", wRow - subtractPNP);
+        out.printf(Locale.US, "%8d", wRow);
 
         for (int i = 0; i < wcm; i++) {
             out.print(ATWriter.EMPTY);
@@ -158,7 +159,7 @@
             if (w > wMax) {
                 break;
             }
-            out.printf(Locale.US, "%8d", (wRow += 10) - subtractPNP);
+            out.printf(Locale.US, "%8d", (wRow += 10));
             wcm = 0;
         }
 


More information about the Dive4elements-commits mailing list