# HG changeset patch # User Felix Wolfsteller # Date 1337712657 0 # Node ID 55a3b575f6441b0d8af16579530823439d9ceab3 # Parent 0657e7966c87a6c4b53e75e3bed2f62faa505d23 Handle 'classical' discharges, theoretically. flys-artifacts/trunk@4464 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 0657e7966c87 -r 55a3b575f644 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue May 22 18:23:32 2012 +0000 +++ b/flys-artifacts/ChangeLog Tue May 22 18:50:57 2012 +0000 @@ -1,3 +1,8 @@ +2012-05-22 Felix Wolfsteller + + * src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java: + Render discharge outs (was own out once). + 2012-05-22 Felix Wolfsteller * doc/conf/artifacts/winfo.xml: Allow cross-section stuff in diff -r 0657e7966c87 -r 55a3b575f644 flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java Tue May 22 18:23:32 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/ComputedDischargeCurveGenerator.java Tue May 22 18:50:57 2012 +0000 @@ -14,8 +14,11 @@ import de.intevation.artifactdatabase.state.ArtifactAndFacet; import de.intevation.artifactdatabase.state.Facet; +import de.intevation.flys.artifacts.WINFOArtifact; + import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.WQKms; +import de.intevation.flys.artifacts.model.WKms; import de.intevation.flys.jfree.FLYSAnnotation; import de.intevation.flys.jfree.StickyAxisAnnotation; @@ -91,6 +94,9 @@ } + /** + * Process data, build up plot. + */ @Override public void doOut( ArtifactAndFacet artifactFacet, @@ -129,7 +135,7 @@ doAnnotations((FLYSAnnotation) artifactFacet.getData(context), artifactFacet, attr, visible); } - else if (name.equals(STATIC_WKMS_INTERPOL)) { + else if (name.equals(STATIC_WKMS_INTERPOL) || name.equals(HEIGHTMARKS_POINTS)) { doWAnnotations( artifactFacet.getData(context), artifactFacet, @@ -141,6 +147,14 @@ artifactFacet, attr, visible, YAXIS.W.idx); } + else if (name.equals(DISCHARGE_CURVE)) { + doDischargeOut( + (WINFOArtifact) artifactFacet.getArtifact(), + artifactFacet.getData(context), + artifactFacet.getFacetDescription(), + attr, + visible); + } else { logger.warn("Unknown facet type for computed discharge: " + name); return; @@ -224,14 +238,28 @@ Facet facet = aandf.getFacet(); List xy = new ArrayList(); - double [][] data = (double [][]) wqkms; - for (int i = 0; i< data[0].length; i++) { + // Try to find them as WKms as well... + if (wqkms instanceof 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 { + WKms data = (WKms) wqkms; + // assume its WKms xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), - (float) data[1][i], StickyAxisAnnotation.SimpleAxis.Y_AXIS)); + (float) data.getW(0), StickyAxisAnnotation.SimpleAxis.Y_AXIS)); + xy.add(new StickyAxisAnnotation(aandf.getFacetDescription(), + (float) 180f, StickyAxisAnnotation.SimpleAxis.Y_AXIS)); + + doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), + aandf, theme, visible); } - - doAnnotations(new FLYSAnnotation(facet.getDescription(), xy), - aandf, theme, visible); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :