Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java @ 4323:33d6d4025d0f
FixWQCurveGenerator: Handle extreme_wq_curve facets (stub).
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 30 Oct 2012 12:06:29 +0100 |
parents | db0b9cff8496 |
children | ff83ec9b4c0b |
comparison
equal
deleted
inserted
replaced
4322:f36550788add | 4323:33d6d4025d0f |
---|---|
28 import de.intevation.flys.artifacts.model.FacetTypes; | 28 import de.intevation.flys.artifacts.model.FacetTypes; |
29 import de.intevation.flys.artifacts.model.NamedDouble; | 29 import de.intevation.flys.artifacts.model.NamedDouble; |
30 import de.intevation.flys.artifacts.model.QWDDateRange; | 30 import de.intevation.flys.artifacts.model.QWDDateRange; |
31 import de.intevation.flys.artifacts.model.WKms; | 31 import de.intevation.flys.artifacts.model.WKms; |
32 import de.intevation.flys.artifacts.model.WQKms; | 32 import de.intevation.flys.artifacts.model.WQKms; |
33 import de.intevation.flys.artifacts.model.extreme.Curve; | |
34 import de.intevation.flys.artifacts.model.extreme.ExtremeCurveFacet; | |
33 import de.intevation.flys.artifacts.model.fixings.FixFunction; | 35 import de.intevation.flys.artifacts.model.fixings.FixFunction; |
34 import de.intevation.flys.artifacts.model.fixings.FixWQCurveFacet; | 36 import de.intevation.flys.artifacts.model.fixings.FixWQCurveFacet; |
35 import de.intevation.flys.artifacts.model.fixings.QWD; | 37 import de.intevation.flys.artifacts.model.fixings.QWD; |
36 import de.intevation.flys.artifacts.model.fixings.QWI; | 38 import de.intevation.flys.artifacts.model.fixings.QWI; |
37 import de.intevation.flys.artifacts.resources.Resources; | 39 import de.intevation.flys.artifacts.resources.Resources; |
147 else if (FacetTypes.IS.MANUALPOINTS(aaf.getFacetName())) { | 149 else if (FacetTypes.IS.MANUALPOINTS(aaf.getFacetName())) { |
148 doPoints(aaf.getData(context), | 150 doPoints(aaf.getData(context), |
149 aaf, | 151 aaf, |
150 doc, visible, YAXIS.W.idx); | 152 doc, visible, YAXIS.W.idx); |
151 } | 153 } |
154 else if (name.equals(EXTREME_WQ_CURVE)) { | |
155 doExtremeCurveOut(aaf, doc, visible); | |
156 } | |
152 else { | 157 else { |
153 logger.warn("Unknown facet name " + name); | 158 logger.warn("Unknown facet name " + name); |
154 return; | 159 return; |
155 } | 160 } |
156 } | 161 } |
200 else { | 205 else { |
201 logger.debug("doAnalysisEventsOut: qwds == null"); | 206 logger.debug("doAnalysisEventsOut: qwds == null"); |
202 } | 207 } |
203 } | 208 } |
204 | 209 |
210 | |
205 /** Add reference event points to chart */ | 211 /** Add reference event points to chart */ |
206 protected void doReferenceEventsOut(ArtifactAndFacet aaf, Document doc, boolean visible) { | 212 protected void doReferenceEventsOut(ArtifactAndFacet aaf, Document doc, boolean visible) { |
207 logger.debug("doReferenceEventsOut"); | 213 logger.debug("doReferenceEventsOut"); |
208 | 214 |
209 QWI qwd = (QWI)aaf.getData(context); | 215 QWI qwd = (QWI)aaf.getData(context); |
230 } | 236 } |
231 } | 237 } |
232 else { | 238 else { |
233 logger.debug("doAnalysisEventsOut: qwds == null"); | 239 logger.debug("doAnalysisEventsOut: qwds == null"); |
234 } | 240 } |
241 } | |
242 | |
243 | |
244 /** Do Extreme Curve out */ | |
245 // TODO Refactor, donate own Generator. | |
246 protected void doExtremeCurveOut(ArtifactAndFacet aaf, Document doc, boolean visible) { | |
247 logger.debug("doExtremeCurveOut"); | |
248 ExtremeCurveFacet facet = (ExtremeCurveFacet) aaf.getFacet(); | |
249 Curve curve = (Curve) facet.getData(aaf.getArtifact(), context); | |
250 if (curve == null) { | |
251 logger.warn("doExtremeCurveOut: Facet does not contain Curve"); | |
252 return; | |
253 } | |
254 // TODO find max Q. | |
255 // TODO add marker where extrapolation starts. | |
256 double maxQ = 4000; | |
257 StyledXYSeries series = JFreeUtil.sampleFunction2D( | |
258 curve, | |
259 doc, | |
260 aaf.getFacetDescription(), | |
261 500, // number of samples | |
262 0.0 , // start | |
263 maxQ); // end | |
264 | |
265 addAxisSeries(series, 0, visible); | |
235 } | 266 } |
236 | 267 |
237 protected void doWQCurveOut(ArtifactAndFacet aaf, Document doc, boolean visible) { | 268 protected void doWQCurveOut(ArtifactAndFacet aaf, Document doc, boolean visible) { |
238 logger.debug("doWQCurveOut"); | 269 logger.debug("doWQCurveOut"); |
239 | 270 |