Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.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 | f4421417f3e1 |
children | 27d42c9ee367 |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java Fri Sep 05 12:54:58 2014 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java Fri Sep 05 12:58:17 2014 +0200 @@ -72,8 +72,8 @@ extends D4EArtifact implements FacetTypes, WaterLineArtifact { - /** The logger for this class. */ - private static Logger logger = Logger.getLogger(WINFOArtifact.class); + /** The log for this class. */ + private static Logger log = Logger.getLogger(WINFOArtifact.class); /** The name of the artifact. */ public static final String ARTIFACT_NAME = "winfo"; @@ -193,7 +193,7 @@ */ public CalculationResult getWaterlevelData(CallContext context) { - logger.debug("WINFOArtifact.getWaterlevelData"); + log.debug("WINFOArtifact.getWaterlevelData"); String calculationMode = getDataAsString("calculation_mode"); @@ -212,7 +212,7 @@ this.compute(context, ComputeType.ADVANCE, true); } else { - logger.warn("Unhandled calculation_mode " + calculationMode); + log.warn("Unhandled calculation_mode " + calculationMode); } } @@ -234,7 +234,7 @@ Calculation report = new Calculation(); if (qs == null) { - logger.debug("Determine Q values based on a set of W values."); + log.debug("Determine Q values based on a set of W values."); qSel = false; ws = getWs(); double [][] qws = getQsForWs(ws); @@ -263,7 +263,7 @@ if (isFreeQ() || isFreeW()) { refKm = range[0]; - logger.debug("'free' calculation (km " + refKm + ")"); + log.debug("'free' calculation (km " + refKm + ")"); } else { Gauge gauge = river.determineGaugeByPosition(range[0]); @@ -274,7 +274,7 @@ refKm = gauge.getStation().doubleValue(); - logger.debug( + log.debug( "reference gauge: " + gauge.getName() + " (km " + refKm + ")"); } @@ -300,7 +300,7 @@ double refKm, Calculation report ) { - logger.info("WINFOArtifact.computeWaterlevelData"); + log.info("WINFOArtifact.computeWaterlevelData"); Calculation1 calc1 = new Calculation1(kms, qs, ws, refKm); @@ -318,7 +318,7 @@ * @return the data computed by a duration curve computation. */ public CalculationResult getDurationCurveData() { - logger.debug("WINFOArtifact.getDurationCurveData"); + log.debug("WINFOArtifact.getDurationCurveData"); River r = RiverUtils.getRiver(this); @@ -361,7 +361,7 @@ WstValueTable wst, double location) { - logger.info("WINFOArtifact.computeDurationCurveData"); + log.info("WINFOArtifact.computeDurationCurveData"); Object[] obj = gauge.fetchDurationCurveData(); @@ -382,7 +382,7 @@ public CalculationResult getComputedDischargeCurveData() throws NullPointerException { - logger.debug("WINFOArtifact.getComputedDischargeCurveData"); + log.debug("WINFOArtifact.getComputedDischargeCurveData"); River r = RiverUtils.getRiver(this); @@ -420,7 +420,7 @@ WstValueTable wst, double location) { - logger.info("WINFOArtifact.computeDischargeCurveData"); + log.info("WINFOArtifact.computeDischargeCurveData"); Calculation2 calculation = new Calculation2(location); @@ -481,16 +481,16 @@ StateData sd = getData("reference_startpoint"); if (sd == null) { - logger.warn("no reference start given."); + log.warn("no reference start given."); return null; } - logger.debug("Reference start km given: " + sd.getValue()); + log.debug("Reference start km given: " + sd.getValue()); String input = (String) sd.getValue(); if (input == null || (input = input.trim()).length() == 0) { - logger.warn("reference start string is empty."); + log.warn("reference start string is empty."); return null; } @@ -498,7 +498,7 @@ return Double.valueOf(input); } catch (NumberFormatException nfe) { - logger.warn("reference start string is not numeric."); + log.warn("reference start string is not numeric."); } return null; @@ -512,17 +512,17 @@ StateData sd = getData("reference_endpoint"); if (sd == null) { - logger.warn("no reference end given."); + log.warn("no reference end given."); return null; } else { - logger.debug("Reference end km : " + sd.getValue()); + log.debug("Reference end km : " + sd.getValue()); } String input = (String) sd.getValue(); if (input == null || (input = input.trim()).length() == 0) { - logger.warn("reference end string is empty."); + log.warn("reference end string is empty."); return null; } @@ -536,7 +536,7 @@ } } catch (NumberFormatException nfe) { - logger.warn("reference end string is not numeric."); + log.warn("reference end string is not numeric."); } } @@ -560,7 +560,7 @@ WQCKms triple = (WQCKms) wqckms[idx-1]; if (triple.size() == 0) { - logger.warn("Calculation of c/waterline is empty."); + log.warn("Calculation of c/waterline is empty."); return Lines.createWaterLines(points, 0.0f); } @@ -595,7 +595,7 @@ @Override public Lines.LineData getWaterLines(int idx, FastCrossSectionLine csl, double nextIgnored, double prevIgnored, CallContext context) { - logger.debug("getWaterLines(" + idx + ")"); + log.debug("getWaterLines(" + idx + ")"); List<Point2D> points = csl.getPoints(); @@ -611,12 +611,12 @@ } if (wqkms.length == 0) { - logger.error("No WQKms found."); + log.error("No WQKms found."); return Lines.createWaterLines(points, 0.0f); } if (wqkms.length <= idx) { - logger.error("getWaterLines() requested index (" + log.error("getWaterLines() requested index (" + idx + " not found."); return waterLineC(idx, csl); } @@ -628,7 +628,7 @@ double wishKM = csl.getKm(); if (triple.size() == 0) { - logger.warn("Calculation of waterline is empty."); + log.warn("Calculation of waterline is empty."); return Lines.createWaterLines(points, 0.0f); } @@ -638,7 +638,7 @@ if (wishKM < min_km || wishKM > max_km) { // TODO Does this have to be done in the other WaterlineArtifact // implementations, too? - logger.warn("Will not extrapolate waterlevels."); + log.warn("Will not extrapolate waterlevels."); return Lines.createWaterLines(points, 0.0f); } @@ -672,36 +672,36 @@ public double [][] getQsForWs(double[] ws) { if (ws == null) { - logger.error("getQsForWs: ws == null"); + log.error("getQsForWs: ws == null"); return null; } - boolean debug = logger.isDebugEnabled(); + boolean debug = log.isDebugEnabled(); if (debug) { - logger.debug("D4EArtifact.getQsForWs"); + log.debug("D4EArtifact.getQsForWs"); } River r = RiverUtils.getRiver(this); if (r == null) { - logger.warn("no river found"); + log.warn("no river found"); return null; } RangeAccess rangeAccess = new RangeAccess(this); double [] range = rangeAccess.getKmRange(); if (range == null) { - logger.warn("no ranges found"); + log.warn("no ranges found"); return null; } if (isFreeW()) { - logger.debug("Bezugslinienverfahren I: W auf freier Strecke"); + log.debug("Bezugslinienverfahren I: W auf freier Strecke"); // The simple case of the "Bezugslinienverfahren" // "W auf freier Strecke". WstValueTable wst = WstValueTableFactory.getTable(r); if (wst == null) { - logger.warn("no wst value table found"); + log.warn("no wst value table found"); return null; } double km = range[0]; @@ -714,7 +714,7 @@ for (int i = 0; i < ws.length; ++i) { double w = ws[i]; if (debug) { - logger.debug("getQsForWs: lookup Q for W: " + w); + log.debug("getQsForWs: lookup Q for W: " + w); } // There could bemore than one Q per W. double [] qs = wst.findQsForW(km, w); @@ -726,7 +726,7 @@ } if (debug) { - logger.debug("getQsForWs: number of Qs: " + outQs.size()); + log.debug("getQsForWs: number of Qs: " + outQs.size()); } return new double [][] { @@ -735,23 +735,23 @@ } if (debug) { - logger.debug("range: " + Arrays.toString(range)); + log.debug("range: " + Arrays.toString(range)); } Gauge g = r.determineGaugeByPosition(range[0]); if (g == null) { - logger.warn("no gauge found for km: " + range[0]); + log.warn("no gauge found for km: " + range[0]); return null; } if (debug) { - logger.debug("convert w->q with gauge '" + g.getName() + "'"); + log.debug("convert w->q with gauge '" + g.getName() + "'"); } DischargeTable dt = g.fetchMasterDischargeTable(); if (dt == null) { - logger.warn("No master discharge table found for gauge '" + log.warn("No master discharge table found for gauge '" + g.getName() + "'"); return null; } @@ -765,13 +765,13 @@ for (int i = 0; i < ws.length; i++) { if (Double.isNaN(ws[i])) { - logger.warn("W is NaN: ignored"); + log.warn("W is NaN: ignored"); continue; } double [] qs = DischargeTables.getQsForW(values, ws[i]); if (qs.length == 0) { - logger.warn("No Qs found for W = " + ws[i]); + log.warn("No Qs found for W = " + ws[i]); } else { for (double q: qs) { @@ -798,7 +798,7 @@ StateData mode = getData("ld_mode"); if (mode == null) { - logger.warn("No mode location/range chosen. Defaults to range."); + log.warn("No mode location/range chosen. Defaults to range."); return true; } @@ -835,7 +835,7 @@ StateData dStep = getData("ld_step"); if (dStep == null) { - logger.warn("No step width given. Cannot compute Kms."); + log.warn("No step width given. Cannot compute Kms."); return null; } @@ -936,7 +936,7 @@ } } else { - logger.warn("You try to get Qs, but W has been inserted."); + log.warn("You try to get Qs, but W has been inserted."); return null; } } @@ -980,7 +980,7 @@ StateData mode = getData("wq_isfree"); String value = (mode != null) ? (String) mode.getValue() : null; - logger.debug("isFreeQ: " + value); + log.debug("isFreeQ: " + value); return value != null && Boolean.valueOf(value); } @@ -1000,7 +1000,7 @@ return getWQForDist(range); } - logger.warn("You try to get Qs, but Ws has been inserted."); + log.warn("You try to get Qs, but Ws has been inserted."); return null; } @@ -1017,7 +1017,7 @@ return getWQForDist(range); } - logger.warn("You try to get Ws, but Qs has been inserted."); + log.warn("You try to get Ws, but Qs has been inserted."); return null; } @@ -1038,7 +1038,7 @@ } } else { - logger.warn("You try to get Ws, but Q has been inserted."); + log.warn("You try to get Ws, but Q has been inserted."); return null; } } @@ -1052,11 +1052,11 @@ * @return an array of W or Q values. */ protected double[] getWQForDist(double[] dist) { - logger.debug("Search wq values for range: " + dist[0] + " - " + dist[1]); + log.debug("Search wq values for range: " + dist[0] + " - " + dist[1]); StateData data = getData("wq_values"); if (data == null) { - logger.warn("Missing wq values!"); + log.warn("Missing wq values!"); return null; } @@ -1080,7 +1080,7 @@ res[i] = Double.parseDouble(values[i]); } catch (NumberFormatException nfe) { - logger.warn(nfe, nfe); + log.warn(nfe, nfe); } } @@ -1088,7 +1088,7 @@ } } - logger.warn("Specified range for WQ not found!"); + log.warn("Specified range for WQ not found!"); return null; } @@ -1105,7 +1105,7 @@ StateData dTo = getData("wq_to"); if (dFrom == null || dTo == null) { - logger.warn("Missing start or end value for range."); + log.warn("Missing start or end value for range."); return null; } @@ -1115,7 +1115,7 @@ StateData dStep = getData("wq_step"); if (dStep == null) { - logger.warn("No step width given. Cannot compute Qs."); + log.warn("No step width given. Cannot compute Qs."); return null; } @@ -1142,7 +1142,7 @@ StateData dSingle = getData("wq_single"); if (dSingle == null) { - logger.warn("Cannot determine single WQ values. No data given."); + log.warn("Cannot determine single WQ values. No data given."); return null; } @@ -1156,7 +1156,7 @@ values.add(Double.parseDouble(strValue)); } catch (NumberFormatException nfe) { - logger.warn(nfe, nfe); + log.warn(nfe, nfe); } }