Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/tkhstate/DefaultBedHeights.java @ 8948:a4f1ac81f26d
Work on SINFO-FlowDepthMinMax.
Also rework of result row stuff, in order to reduce abstraction, using result type concept
author | gernotbelger |
---|---|
date | Wed, 14 Mar 2018 14:10:32 +0100 |
parents | 11bf13cf0463 |
children | fb976ea01463 |
rev | line source |
---|---|
8942
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
2 * Software engineering by |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
3 * Björnsen Beratende Ingenieure GmbH |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
5 * |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
6 * This file is Free Software under the GNU AGPL (>=v3) |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
8 * documentation coming with Dive4Elements River for details. |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
9 */ |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
10 package org.dive4elements.river.artifacts.sinfo.tkhstate; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
11 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
12 import java.io.File; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
13 import java.io.IOException; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
14 import java.io.InputStreamReader; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
15 import java.nio.charset.StandardCharsets; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
16 import java.nio.file.Files; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
17 import java.util.ArrayList; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
18 import java.util.Arrays; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
19 import java.util.Collection; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
20 import java.util.Collections; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
21 import java.util.List; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
22 import java.util.Properties; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
23 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
24 import org.apache.commons.lang.ArrayUtils; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
25 import org.apache.commons.lang.StringUtils; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
26 import org.apache.commons.lang.math.NumberRange; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
27 import org.dive4elements.artifacts.common.utils.Config; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
28 import org.dive4elements.river.artifacts.model.Calculation; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
29 import org.dive4elements.river.model.BedHeight; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
30 import org.dive4elements.river.model.Range; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
31 import org.dive4elements.river.model.River; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
32 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
33 /** |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
34 * This class knows how to find the default bed heights defined for tkh calculation |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
35 * |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
36 * @author Gernot Belger |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
37 */ |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
38 final class DefaultBedHeights { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
39 private static final String CONFIG_FILE = "sinfo_tkh_bedheights.properties"; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
40 private final River river; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
41 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
42 public DefaultBedHeights(final River river) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
43 this.river = river; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
44 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
45 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
46 public List<BedHeight> getBedHeights(final Calculation problems) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
47 final Collection<String> bedHeightNames = loadBedHeightDefaultsForRiver(this.river, problems); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
48 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
49 final List<BedHeight> defaultBedHeights = loadBedHeightsByName(this.river, bedHeightNames, problems); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
50 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
51 final List<BedHeight> validBedHeights = new ArrayList<>(defaultBedHeights.size()); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
52 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
53 // REMARK: check for bad ranges because db schema allow for incomplete ranges, and ignore if this is the case |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
54 for (final BedHeight bedHeight : defaultBedHeights) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
55 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
56 final Range range = bedHeight.getRange(); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
57 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
58 if (range.getA() == null || range.getB() == null) |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
59 problems.addProblem("sinfo.bedheightsfinder.badrange", bedHeight.getDescription()); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
60 else |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
61 validBedHeights.add(bedHeight); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
62 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
63 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
64 /* check for overlapping ranges, N2-search, but we expect only have small numbers of bed heights */ |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
65 final List<BedHeight> result = new ArrayList<>(defaultBedHeights.size()); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
66 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
67 for (int i = 0; i < defaultBedHeights.size(); i++) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
68 final BedHeight bedHeight = validBedHeights.get(i); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
69 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
70 final Range range = bedHeight.getRange(); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
71 final NumberRange bedRange = new NumberRange(range.getA(), range.getB()); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
72 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
73 if (overlapsRange(bedRange, validBedHeights, i + 1)) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
74 problems.addProblem("sinfo.bedheightsfinder.overlappingrange", bedHeight.getDescription()); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
75 } else |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
76 result.add(bedHeight); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
77 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
78 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
79 return result; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
80 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
81 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
82 private static Collection<String> loadBedHeightDefaultsForRiver(final River river, final Calculation problems) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
83 final File configDir = Config.getConfigDirectory(); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
84 final File configFile = new File(configDir, CONFIG_FILE); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
85 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
86 final Properties properties = new Properties(); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
87 try (final InputStreamReader reader = new InputStreamReader(Files.newInputStream(configFile.toPath()), StandardCharsets.ISO_8859_1)) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
88 properties.load(reader); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
89 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
90 final String value = properties.getProperty(river.getName()); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
91 final String[] split = StringUtils.split(StringUtils.trim(value), ','); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
92 if (ArrayUtils.isEmpty(split)) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
93 problems.addProblem("sinfo.bedheightsfinder.configfile.missingriver", CONFIG_FILE, river.getName()); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
94 return Collections.emptyList(); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
95 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
96 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
97 return Arrays.asList(split); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
98 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
99 catch (final IOException e) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
100 e.printStackTrace(); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
101 problems.addProblem("sinfo.bedheightsfinder.configfile.loaderror", CONFIG_FILE, e.getMessage()); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
102 return Collections.emptyList(); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
103 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
104 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
105 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
106 private static List<BedHeight> loadBedHeightsByName(final River shouldBeRiver, final Collection<String> bedHeightNames, final Calculation problems) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
107 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
108 final List<BedHeight> bedHeights = new ArrayList<>(bedHeightNames.size()); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
109 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
110 for (final String name : bedHeightNames) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
111 try { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
112 final BedHeight bedHeight = BedHeight.getBedHeightByDescription(name); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
113 if (bedHeight == null) |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
114 problems.addProblem("sinfo.bedheightsfinder.missingdescription", name); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
115 else { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
116 final River river = bedHeight.getRiver(); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
117 if (!shouldBeRiver.getId().equals(river.getId())) |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
118 problems.addProblem("sinfo.bedheightsfinder.wrongriver", name, shouldBeRiver.getName()); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
119 else |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
120 bedHeights.add(bedHeight); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
121 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
122 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
123 catch (final Exception e) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
124 e.printStackTrace(); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
125 problems.addProblem("sinfo.bedheightsfinder.missingdescription", name); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
126 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
127 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
128 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
129 return bedHeights; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
130 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
131 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
132 private static boolean overlapsRange(final NumberRange bedRange, final List<BedHeight> result, final int startIndex) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
133 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
134 for (int i = startIndex; i < result.size(); i++) { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
135 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
136 final BedHeight compareBed = result.get(i); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
137 final Range range = compareBed.getRange(); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
138 final NumberRange compareRange = new NumberRange(range.getA(), range.getB()); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
139 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
140 if (compareRange.overlapsRange(bedRange)) |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
141 return true; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
142 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
143 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
144 return false; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
145 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
diff
changeset
|
146 } |