Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/states/WDifferencesState.java @ 8647:5f60bd7c4b42
(issue1754) Simplify code to handle a>b cases.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 30 Mar 2015 19:28:41 +0200 |
parents | 0f6f702742b4 |
children | 8c64617a7991 5e38e2924c07 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WDifferencesState.java Mon Mar 30 19:27:11 2015 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WDifferencesState.java Mon Mar 30 19:28:41 2015 +0200 @@ -194,10 +194,8 @@ WINFOArtifact winfo = (WINFOArtifact) artifact; String id = getID(); RangeAccess rangeAccess = new RangeAccess(artifact); - double from = rangeAccess.getFrom(); - double to = rangeAccess.getTo(); - double start; - double end; + double from = rangeAccess.getFrom(true); + double to = rangeAccess.getTo(true); // Load the Artifacts/facets that we want to subtract and display. // Expected format is: // [42537f1e-3522-42ef-8968-635b03d8e9c6;longitudinal_section.w;0]#[1231f2-....] @@ -207,15 +205,6 @@ log.debug("Difference from: " + from + " to: " + to); /* Check if we need to obtain the data in a different order */ - if ((!Double.isNaN(from) && !Double.isNaN(to)) && from > to) { - log.debug("Reordering range."); - start = to; - end = from; - } else { - start = from; - end = to; - } - // Validate the Data-Strings. for (String s: datas) { if (!WaterlevelSelectState.isValueValid(s)) { @@ -233,9 +222,9 @@ // e.g.: // 42537f1e-3522-42ef-8968-635b03d8e9c6;longitudinal_section.w;1 WKms minuendWKms = getWKms(StringUtil.unbracket(datas[i+0]), - context, start, end); + context, from, to); WKms subtrahendWKms = getWKms(StringUtil.unbracket(datas[i+1]), - context, start, end); + context, from, to); String facetName = "diff ()"; String minName = "min";