Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Calculation5.java @ 2256:dd93a8e1377a
First steps to serve the data in cm if we are are gauges only.
flys-artifacts/trunk@3910 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Fri, 03 Feb 2012 18:03:26 +0000 |
parents | 4e3bfa2d9584 |
children | 46918e6a831d |
comparison
equal
deleted
inserted
replaced
2255:eab357067e06 | 2256:dd93a8e1377a |
---|---|
1 package de.intevation.flys.artifacts.model; | 1 package de.intevation.flys.artifacts.model; |
2 | 2 |
3 import java.util.ArrayList; | 3 import java.util.ArrayList; |
4 import java.util.Map; | |
4 | 5 |
5 import org.apache.log4j.Logger; | 6 import org.apache.log4j.Logger; |
6 | 7 |
7 | 8 |
8 public class Calculation5 | 9 public class Calculation5 |
19 public Calculation5(double startKm, double [] endKms) { | 20 public Calculation5(double startKm, double [] endKms) { |
20 this.startKm = startKm; | 21 this.startKm = startKm; |
21 this.endKms = endKms; | 22 this.endKms = endKms; |
22 } | 23 } |
23 | 24 |
24 public CalculationResult calculate(WstValueTable wst) { | 25 public CalculationResult calculate( |
26 WstValueTable wst, | |
27 Map<Double, Double> kms2gaugeDatums | |
28 ) { | |
25 ArrayList<WW> results = new ArrayList<WW>(); | 29 ArrayList<WW> results = new ArrayList<WW>(); |
26 | 30 |
27 int numProblems = numProblems(); | 31 int numProblems = numProblems(); |
28 | 32 |
29 for (double endKm: endKms) { | 33 for (double endKm: endKms) { |
32 int newNumProblems = numProblems(); | 36 int newNumProblems = numProblems(); |
33 | 37 |
34 if (wws.length == 2) { | 38 if (wws.length == 2) { |
35 WW ww = new WW( | 39 WW ww = new WW( |
36 generateName(startKm, endKm), | 40 generateName(startKm, endKm), |
37 startKm, wws[0], | 41 startKm, kms2gaugeDatums.get(startKm), wws[0], |
38 endKm, wws[1]); | 42 endKm, kms2gaugeDatums.get(endKm), wws[1]); |
39 | 43 |
40 if (newNumProblems > numProblems) { | 44 if (newNumProblems > numProblems) { |
41 ww.removeNaNs(); | 45 ww.removeNaNs(); |
42 } | 46 } |
43 | 47 |