comparison artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveGenerator.java @ 8202:e4606eae8ea5

sed src/**/*.java 's/logger/log/g'
author Sascha L. Teichmann <teichmann@intevation.de>
date Fri, 05 Sep 2014 12:58:17 +0200
parents 59e50aa0c6c2
children 8c60595fd74c
comparison
equal deleted inserted replaced
8201:4b8c5a08de04 8202:e4606eae8ea5
40 */ 40 */
41 public class ComputedDischargeCurveGenerator 41 public class ComputedDischargeCurveGenerator
42 extends DischargeCurveGenerator 42 extends DischargeCurveGenerator
43 implements FacetTypes 43 implements FacetTypes
44 { 44 {
45 /** The logger used in this generator. */ 45 /** The log used in this generator. */
46 private static Logger logger = 46 private static Logger log =
47 Logger.getLogger(ComputedDischargeCurveGenerator.class); 47 Logger.getLogger(ComputedDischargeCurveGenerator.class);
48 48
49 public static final String I18N_CHART_TITLE = 49 public static final String I18N_CHART_TITLE =
50 "chart.computed.discharge.curve.title"; 50 "chart.computed.discharge.curve.title";
51 51
104 ThemeDocument attr, 104 ThemeDocument attr,
105 boolean visible 105 boolean visible
106 ) { 106 ) {
107 String name = artifactFacet.getFacetName(); 107 String name = artifactFacet.getFacetName();
108 108
109 logger.debug("ComputedDischargeCurveGenerator.doOut: " + name); 109 log.debug("ComputedDischargeCurveGenerator.doOut: " + name);
110 110
111 if (name == null) { 111 if (name == null) {
112 logger.warn("Broken facet in computed discharge out generation."); 112 log.warn("Broken facet in computed discharge out generation.");
113 return; 113 return;
114 } 114 }
115 115
116 MiscDischargeProcessor dProcessor = new MiscDischargeProcessor(getRange()[0]); 116 MiscDischargeProcessor dProcessor = new MiscDischargeProcessor(getRange()[0]);
117 if (dProcessor.canHandle(name)) { 117 if (dProcessor.canHandle(name)) {
158 artifactFacet.getFacetDescription(), 158 artifactFacet.getFacetDescription(),
159 attr, 159 attr,
160 visible); 160 visible);
161 } 161 }
162 else { 162 else {
163 logger.warn("Unknown facet type for computed discharge: " + name); 163 log.warn("Unknown facet type for computed discharge: " + name);
164 return; 164 return;
165 } 165 }
166 } 166 }
167 167
168 168
174 Object wq, 174 Object wq,
175 ArtifactAndFacet aaf, 175 ArtifactAndFacet aaf,
176 ThemeDocument theme, 176 ThemeDocument theme,
177 boolean visible 177 boolean visible
178 ) { 178 ) {
179 logger.debug("ComputedDischargeCurveGenerator: doWQOut"); 179 log.debug("ComputedDischargeCurveGenerator: doWQOut");
180 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); 180 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme);
181 if (wq instanceof double[][]) { 181 if (wq instanceof double[][]) {
182 double [][] data = (double [][]) wq; 182 double [][] data = (double [][]) wq;
183 StyledSeriesBuilder.addPoints(series, data, true); 183 StyledSeriesBuilder.addPoints(series, data, true);
184 } else if (wq instanceof WQKms) { 184 } else if (wq instanceof WQKms) {
199 WQKms wqkms, 199 WQKms wqkms,
200 ArtifactAndFacet aaf, 200 ArtifactAndFacet aaf,
201 ThemeDocument theme, 201 ThemeDocument theme,
202 boolean visible 202 boolean visible
203 ) { 203 ) {
204 logger.debug("ComputedDischargeCurveGenerator: doDischargeQOut"); 204 log.debug("ComputedDischargeCurveGenerator: doDischargeQOut");
205 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); 205 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme);
206 206
207 double subtractPNP = getCurrentGaugeDatum(); 207 double subtractPNP = getCurrentGaugeDatum();
208 208
209 if (subtractPNP == 0d) { 209 if (subtractPNP == 0d) {
231 WQKms wqkms, 231 WQKms wqkms,
232 ArtifactAndFacet aaf, 232 ArtifactAndFacet aaf,
233 ThemeDocument theme, 233 ThemeDocument theme,
234 boolean visible 234 boolean visible
235 ) { 235 ) {
236 logger.debug("ComputedDischargeCurveGenerator: doQOut (add W/Q data)."); 236 log.debug("ComputedDischargeCurveGenerator: doQOut (add W/Q data).");
237 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); 237 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme);
238 StyledSeriesBuilder.addPointsQW(series, wqkms); 238 StyledSeriesBuilder.addPointsQW(series, wqkms);
239 239
240 addAxisSeries(series, YAXIS.W.idx, visible); 240 addAxisSeries(series, YAXIS.W.idx, visible);
241 } 241 }
281 Facet facet = aandf.getFacet(); 281 Facet facet = aandf.getFacet();
282 282
283 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>(); 283 List<StickyAxisAnnotation> xy = new ArrayList<StickyAxisAnnotation>();
284 // Try to find them as WKms as well... 284 // Try to find them as WKms as well...
285 if (wqkms instanceof double[][]) { 285 if (wqkms instanceof double[][]) {
286 logger.debug("its double[][] time, baby"); 286 log.debug("its double[][] time, baby");
287 double [][] data = (double [][]) wqkms; 287 double [][] data = (double [][]) wqkms;
288 // TODO Do we need interpolation? 288 // TODO Do we need interpolation?
289 for (int i = 0; i< data[0].length; i++) { 289 for (int i = 0; i< data[0].length; i++) {
290 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), 290 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(),
291 (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); 291 (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS));
293 293
294 doAnnotations(new RiverAnnotation(facet.getDescription(), xy), 294 doAnnotations(new RiverAnnotation(facet.getDescription(), xy),
295 aandf, theme, visible); 295 aandf, theme, visible);
296 } 296 }
297 else { 297 else {
298 logger.debug("its wkms time, baby"); 298 log.debug("its wkms time, baby");
299 WKms data = (WKms) wqkms; 299 WKms data = (WKms) wqkms;
300 // Assume its WKms. 300 // Assume its WKms.
301 // XXX DEAD CODE // double location = getRange()[0]; 301 // XXX DEAD CODE // double location = getRange()[0];
302 double w = StaticWKmsArtifact.getWAtKmLin(data, getRange()[0]); 302 double w = StaticWKmsArtifact.getWAtKmLin(data, getRange()[0]);
303 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), 303 xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(),

http://dive4elements.wald.intevation.org