comparison artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveGenerator.java @ 6441:216ea53b77b3

ComputedDischargeCurveGenerator: Renamed function.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 26 Jun 2013 15:09:33 +0200
parents e32b166c881b
children 3681ae5dcfd4
comparison
equal deleted inserted replaced
6440:004b87755fa4 6441:216ea53b77b3
93 93
94 94
95 /** 95 /**
96 * Returns the PNP (Datum) of gauge, if at gauge, 0 otherwise. 96 * Returns the PNP (Datum) of gauge, if at gauge, 0 otherwise.
97 */ 97 */
98 protected int atGaugeSubtractPNP() { 98 protected int getCurrentGaugeDatum() {
99 // Code borrowed from FixATWriter. 99 // Code borrowed from FixATWriter.
100 Gauge gauge = RiverUtils.getGauge((D4EArtifact) getMaster()); 100 Gauge gauge = RiverUtils.getGauge((D4EArtifact) getMaster());
101 int subtractPNP = 0; 101 int subtractPNP = 0;
102 if (Math.abs(getRange()[0] - gauge.getStation().doubleValue()) < 1e-4) { 102 if (Math.abs(getRange()[0] - gauge.getStation().doubleValue()) < 1e-4) {
103 subtractPNP = (int) Math.round(gauge.getDatum().doubleValue() /** 100*/); 103 subtractPNP = (int) Math.round(gauge.getDatum().doubleValue() /** 100*/);
138 firstYAxis); 138 firstYAxis);
139 139
140 axis.setAutoRangeIncludesZero(false); 140 axis.setAutoRangeIncludesZero(false);
141 axis.setLabelFont(labelFont); 141 axis.setLabelFont(labelFont);
142 axis.setTickLabelFont(labelFont); 142 axis.setTickLabelFont(labelFont);
143 axis.setShift((double)-atGaugeSubtractPNP()); 143 axis.setShift((double)-getCurrentGaugeDatum());
144 144
145 return axis; 145 return axis;
146 } 146 }
147 147
148 148
253 boolean visible 253 boolean visible
254 ) { 254 ) {
255 logger.debug("ComputedDischargeCurveGenerator: doDischargeQOut"); 255 logger.debug("ComputedDischargeCurveGenerator: doDischargeQOut");
256 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme); 256 XYSeries series = new StyledXYSeries(aaf.getFacetDescription(), theme);
257 257
258 int subtractPNP = atGaugeSubtractPNP(); 258 int subtractPNP = getCurrentGaugeDatum();
259 259
260 if (subtractPNP == 0) { 260 if (subtractPNP == 0) {
261 StyledSeriesBuilder.addPointsQW(series, wqkms); 261 StyledSeriesBuilder.addPointsQW(series, wqkms);
262 addAxisSeries(series, YAXIS.W.idx, visible); 262 addAxisSeries(series, YAXIS.W.idx, visible);
263 } 263 }

http://dive4elements.wald.intevation.org