Mercurial > dive4elements > river
changeset 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 | f36550788add |
children | 4980659b2f22 |
files | flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java |
diffstat | 1 files changed, 31 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java Tue Oct 30 12:04:49 2012 +0100 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java Tue Oct 30 12:06:29 2012 +0100 @@ -30,6 +30,8 @@ import de.intevation.flys.artifacts.model.QWDDateRange; import de.intevation.flys.artifacts.model.WKms; import de.intevation.flys.artifacts.model.WQKms; +import de.intevation.flys.artifacts.model.extreme.Curve; +import de.intevation.flys.artifacts.model.extreme.ExtremeCurveFacet; import de.intevation.flys.artifacts.model.fixings.FixFunction; import de.intevation.flys.artifacts.model.fixings.FixWQCurveFacet; import de.intevation.flys.artifacts.model.fixings.QWD; @@ -149,6 +151,9 @@ aaf, doc, visible, YAXIS.W.idx); } + else if (name.equals(EXTREME_WQ_CURVE)) { + doExtremeCurveOut(aaf, doc, visible); + } else { logger.warn("Unknown facet name " + name); return; @@ -202,6 +207,7 @@ } } + /** Add reference event points to chart */ protected void doReferenceEventsOut(ArtifactAndFacet aaf, Document doc, boolean visible) { logger.debug("doReferenceEventsOut"); @@ -234,6 +240,31 @@ } } + + /** Do Extreme Curve out */ + // TODO Refactor, donate own Generator. + protected void doExtremeCurveOut(ArtifactAndFacet aaf, Document doc, boolean visible) { + logger.debug("doExtremeCurveOut"); + ExtremeCurveFacet facet = (ExtremeCurveFacet) aaf.getFacet(); + Curve curve = (Curve) facet.getData(aaf.getArtifact(), context); + if (curve == null) { + logger.warn("doExtremeCurveOut: Facet does not contain Curve"); + return; + } + // TODO find max Q. + // TODO add marker where extrapolation starts. + double maxQ = 4000; + StyledXYSeries series = JFreeUtil.sampleFunction2D( + curve, + doc, + aaf.getFacetDescription(), + 500, // number of samples + 0.0 , // start + maxQ); // end + + addAxisSeries(series, 0, visible); + } + protected void doWQCurveOut(ArtifactAndFacet aaf, Document doc, boolean visible) { logger.debug("doWQCurveOut");