Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/WDifferencesState.java @ 8856:5e38e2924c07 3.2.x
Fix code style.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 18 Jan 2018 20:12:01 +0100 |
parents | 5f60bd7c4b42 |
children | 28df64078f27 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8855:d7c005e12af0 | 8856:5e38e2924c07 |
---|---|
107 | 107 |
108 | 108 |
109 /** | 109 /** |
110 * Access the data (wkms) of an artifact, coded in mingle. | 110 * Access the data (wkms) of an artifact, coded in mingle. |
111 */ | 111 */ |
112 public WKms getWKms(String mingle, CallContext context, double from, double to) { | 112 public WKms getWKms( |
113 String mingle, | |
114 CallContext context, | |
115 double from, | |
116 double to | |
117 ) { | |
113 log.debug("WDifferencesState.getWKms " + mingle); | 118 log.debug("WDifferencesState.getWKms " + mingle); |
114 String[] def = mingle.split(";"); | 119 String[] def = mingle.split(";"); |
115 String uuid = def[0]; | 120 String uuid = def[0]; |
116 String name = def[1]; | 121 String name = def[1]; |
117 int idx = Integer.parseInt(def[2]); | 122 int idx = Integer.parseInt(def[2]); |
118 D4EArtifact d4eArtifact = RiverUtils.getArtifact( | 123 D4EArtifact d4eArtifact = RiverUtils.getArtifact( |
119 uuid, | 124 uuid, |
120 context); | 125 context); |
121 | 126 |
122 if (d4eArtifact == null) { | 127 if (d4eArtifact == null) { |
123 log.warn("One of the artifacts (1) for diff calculation could not be loaded"); | 128 log.warn("One of the artifacts (1) for diff calculation " |
129 + "could not be loaded"); | |
124 return null; | 130 return null; |
125 } | 131 } |
126 | 132 |
127 WKms retval = null; | 133 WKms retval = null; |
128 if (d4eArtifact instanceof StaticWKmsArtifact) { | 134 if (d4eArtifact instanceof StaticWKmsArtifact) { |
160 retval = frR.getWQKms()[idx]; | 166 retval = frR.getWQKms()[idx]; |
161 } | 167 } |
162 | 168 |
163 | 169 |
164 if (retval == null) { | 170 if (retval == null) { |
165 log.error("Do not know how to handle (getWKms) minuend/subtrahend"); | 171 log.error( |
172 "Do not know how to handle (getWKms) minuend/subtrahend"); | |
166 } else if (!Double.isNaN(from) && !Double.isNaN(to)) { | 173 } else if (!Double.isNaN(from) && !Double.isNaN(to)) { |
167 /* Filter out only the relevant data points for calulation results.*/ | 174 /* Filter out only relevant data points for calulation results.*/ |
168 log.debug("Before filter: " + retval.size()); | 175 log.debug("Before filter: " + retval.size()); |
169 retval = retval.filteredKms(from, to); | 176 retval = retval.filteredKms(from, to); |
170 log.debug("After filter: " + retval.size()); | 177 log.debug("After filter: " + retval.size()); |
171 } | 178 } |
172 | 179 |
196 RangeAccess rangeAccess = new RangeAccess(artifact); | 203 RangeAccess rangeAccess = new RangeAccess(artifact); |
197 double from = rangeAccess.getFrom(true); | 204 double from = rangeAccess.getFrom(true); |
198 double to = rangeAccess.getTo(true); | 205 double to = rangeAccess.getTo(true); |
199 // Load the Artifacts/facets that we want to subtract and display. | 206 // Load the Artifacts/facets that we want to subtract and display. |
200 // Expected format is: | 207 // Expected format is: |
201 // [42537f1e-3522-42ef-8968-635b03d8e9c6;longitudinal_section.w;0]#[1231f2-....] | 208 //[42537f1e-3522-42ef-8968-635b03d8e9c6;longitudinal_section.w;0]#[...] |
202 String diffids = winfo.getDataAsString("diffids"); | 209 String diffids = winfo.getDataAsString("diffids"); |
203 log.debug("WDifferencesState has: " + diffids); | 210 log.debug("WDifferencesState has: " + diffids); |
204 String datas[] = diffids.split("#"); | 211 String datas[] = diffids.split("#"); |
205 | 212 |
206 log.debug("Difference from: " + from + " to: " + to); | 213 log.debug("Difference from: " + from + " to: " + to); |