Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Segment.java @ 5379:61bf64b102bc mapgenfix
Merge with default branch
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Fri, 22 Mar 2013 11:25:54 +0100 |
parents | 345f3bba6f15 |
children |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Segment.java Wed Mar 06 14:14:15 2013 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/Segment.java Fri Mar 22 11:25:54 2013 +0100 @@ -15,6 +15,7 @@ import org.apache.log4j.Logger; +/** A Range with values and a reference point. */ public class Segment implements Serializable { @@ -53,6 +54,7 @@ return from < to; } + /** Checks whether given km lies inside the to/from bounds of this segment. */ public boolean inside(double km) { return from < to ? km >= from && km <= to @@ -120,6 +122,7 @@ return referencePoint; } + /** Use DoubleUtil to parse Segments. */ public static List<Segment> parseSegments(String input) { final List<Segment> segments = new ArrayList<Segment>(); @@ -176,18 +179,21 @@ DischargeTable dt = gauge.fetchMasterDischargeTable(); + //TODO: Change scale from 100 to 1 immediately after + // discharge table import changed to cm! double [][] table = - DischargeTables.loadDischargeTableValues(dt, 1); + DischargeTables.loadDischargeTableValues(dt, 100); // need the original values for naming segment.backup(); for (int i = 0; i < values.length; ++i) { - double w = values[i] / 100.0; + //TODO: s.o. + double w = values[i]; /* / 100.0; */ double [] qs = DischargeTables.getQsForW(table, w); if (qs.length == 0) { log.warn("No Qs found for W = " + values[i]); - report.addProblem("cannot.find.w.for.q", values[i]); + report.addProblem("cannot.find.q.for.w", values[i]); values[i] = Double.NaN; success = false; }