comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/WDifferencesState.java @ 8881:6b93a2498e06

Slightly better abstraction for extraction waterlevels via datacage
author gernotbelger
date Fri, 09 Feb 2018 16:11:34 +0100
parents 23264d1a528f
children 3f49835a00c3
comparison
equal deleted inserted replaced
8879:64ca63f79f6f 8881:6b93a2498e06
109 109
110 /** 110 /**
111 * Access the data (wkms) of an artifact, coded in mingle. 111 * Access the data (wkms) of an artifact, coded in mingle.
112 */ 112 */
113 // FIXME: meanwhile used by several places outside this context; refactor into separate helper class to access waterlevels 113 // FIXME: meanwhile used by several places outside this context; refactor into separate helper class to access waterlevels
114 // FIXME: use org.dive4elements.river.artifacts.states.WaterlevelFetcher instead
114 public WKms getWKms( 115 public WKms getWKms(
115 String mingle, 116 String mingle,
116 CallContext context, 117 CallContext context,
117 double from, 118 double from,
118 double to 119 double to
158 159
159 WKms[] wkms = (WKms[]) flys.getWaterlevelData(context). 160 WKms[] wkms = (WKms[]) flys.getWaterlevelData(context).
160 getData(); 161 getData();
161 if (wkms == null || wkms.length == 0) { 162 if (wkms == null || wkms.length == 0) {
162 log.warn("no waterlevels in artifact"); 163 log.warn("no waterlevels in artifact");
164 // FIXME: fall through will lead to exception...
163 } 165 }
164 else if (wkms.length < idx+1) { 166 else if (wkms.length < idx+1) {
165 log.warn("Not enough waterlevels in artifact."); 167 log.warn("Not enough waterlevels in artifact.");
166 retval = new WQKms(); 168 retval = new WQKms();
167 } 169 }

http://dive4elements.wald.intevation.org