# HG changeset patch # User Felix Wolfsteller # Date 1344951169 0 # Node ID 9dfbd36474b877a14b233eefb89a91e7f63d51e8 # Parent 5cb5a9edc2511ea764e8353191b0b1ba4eacd5f1 Add more facets to DC and W/Q diag. flys-artifacts/trunk@5203 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 5cb5a9edc251 -r 9dfbd36474b8 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue Aug 14 08:42:29 2012 +0000 +++ b/flys-artifacts/ChangeLog Tue Aug 14 13:32:49 2012 +0000 @@ -1,3 +1,12 @@ +2012-08-13 Felix Wolfsteller + + * doc/conf/artifacts/fixanalysis.xml: Add more facets to compat. list. + + * doc/conf/meta-data.xml: Show more additional data in FixA w/q-diag. + + * src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java: + Handle new, annotation-type facets. + 2012-08-13 Felix Wolfsteller * doc/conf/artifacts/fixanalysis.xml: Added wqkms facets to comp. list. diff -r 5cb5a9edc251 -r 9dfbd36474b8 flys-artifacts/doc/conf/artifacts/fixanalysis.xml --- a/flys-artifacts/doc/conf/artifacts/fixanalysis.xml Tue Aug 14 08:42:29 2012 +0000 +++ b/flys-artifacts/doc/conf/artifacts/fixanalysis.xml Tue Aug 14 13:32:49 2012 +0000 @@ -145,8 +145,12 @@ + + + + diff -r 5cb5a9edc251 -r 9dfbd36474b8 flys-artifacts/doc/conf/meta-data.xml --- a/flys-artifacts/doc/conf/meta-data.xml Tue Aug 14 08:42:29 2012 +0000 +++ b/flys-artifacts/doc/conf/meta-data.xml Tue Aug 14 13:32:49 2012 +0000 @@ -656,6 +656,10 @@ + + + + diff -r 5cb5a9edc251 -r 9dfbd36474b8 flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java Tue Aug 14 08:42:29 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixWQCurveGenerator.java Tue Aug 14 13:32:49 2012 +0000 @@ -1,12 +1,15 @@ package de.intevation.flys.exports.fixings; import de.intevation.artifactdatabase.state.ArtifactAndFacet; +import de.intevation.artifactdatabase.state.Facet; import de.intevation.flys.artifacts.FLYSArtifact; +import de.intevation.flys.artifacts.StaticWKmsArtifact; import de.intevation.flys.artifacts.access.FixAnalysisAccess; import de.intevation.flys.artifacts.model.DateRange; import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.NamedDouble; import de.intevation.flys.artifacts.model.QWDDateRange; +import de.intevation.flys.artifacts.model.WKms; import de.intevation.flys.artifacts.model.fixings.FixFunction; import de.intevation.flys.artifacts.model.fixings.FixWQCurveFacet; import de.intevation.flys.artifacts.model.fixings.QW; @@ -17,6 +20,7 @@ import de.intevation.flys.jfree.CollisionFreeXYTextAnnotation; import de.intevation.flys.jfree.FLYSAnnotation; import de.intevation.flys.jfree.JFreeUtil; +import de.intevation.flys.jfree.StickyAxisAnnotation; import de.intevation.flys.jfree.StyledXYSeries; import de.intevation.flys.utils.ThemeUtil; @@ -113,6 +117,15 @@ else if(QSECTOR.equals(name)) { doQSectorOut(aaf, doc, visible); } + else if(STATIC_WKMS_INTERPOL.equals(name) || + STATIC_WKMS.equals(name) || + HEIGHTMARKS_POINTS.equals(name) ) { + doWAnnotations( + aaf.getData(context), + aaf, + doc, + visible); + } else if(STATIC_WQ.equals(name)) { doWQOut(aaf.getData(context), aaf, doc, visible); } @@ -247,6 +260,50 @@ } } + /** + * Add W-Annotations to plot. + * @param wqkms actual data (double[][]). + * @param theme theme to use. + */ + protected void doWAnnotations( + Object wqkms, + ArtifactAndFacet aandf, + Document theme, + boolean visible + ) { + Facet facet = aandf.getFacet(); + + List xy = new ArrayList(); + if (wqkms instanceof double[][]) { + logger.debug("Got double[][]"); + double [][] data = (double [][]) wqkms; + for (int i = 0; i< data[0].length; i++) { + xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), + (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); + } + + doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), + aandf, theme, visible); + } + else { + // Assume its WKms. + logger.debug("Got WKms"); + WKms data = (WKms) wqkms; + Double ckm = (Double) context.getContextValue("currentKm"); + double location = (ckm != null) + ? ckm.doubleValue() + : getRange()[0]; + double w = ((StaticWKmsArtifact) aandf.getArtifact()) + .getWAtKmLin(data, location); + xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), + (float) w, StickyAxisAnnotation.SimpleAxis.Y_AXIS)); + + doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), + aandf, theme, visible); + } + } + + /** * Add WQ Data to plot. * @param wqkms data as double[][]