# HG changeset patch # User Felix Wolfsteller # Date 1317044250 0 # Node ID fb296bdf815f40c3a7c3abc73312888d114f7776 # Parent 12235a2ace21e55f3fcfbd3fe66c40193cc8325a Improved w-differences diagram generation with included 'absolute' values. flys-artifacts/trunk@2825 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 12235a2ace21 -r fb296bdf815f flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Mon Sep 26 13:17:55 2011 +0000 +++ b/flys-artifacts/ChangeLog Mon Sep 26 13:37:30 2011 +0000 @@ -1,3 +1,13 @@ +2011-09-26 Felix Wolfsteller + + Improved w-differences diagram generation with included "absolute" + values. + + * src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java: + Fixed one (of two) incorrect labels. + (doWaterlevelOut): Survive non-found gauge, fetch kilometer and w + instead of values for w and q. + 2011-09-26 Felix Wolfsteller Add positional-conflict-awareness when merging Facets for a diff -r 12235a2ace21 -r fb296bdf815f flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java Mon Sep 26 13:17:55 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/WDifferencesCurveGenerator.java Mon Sep 26 13:37:30 2011 +0000 @@ -18,10 +18,8 @@ import de.intevation.flys.artifacts.model.WKms; import de.intevation.flys.utils.DataUtil; -import de.intevation.flys.model.DischargeTable; import de.intevation.flys.model.Gauge; import de.intevation.flys.model.River; -import de.intevation.flys.model.TimeInterval; import de.intevation.flys.artifacts.WINFOArtifact; @@ -53,7 +51,7 @@ // TODO proper i18n. public static final String I18N_CHART_TITLE_DEFAULT = "W-Differenzen"; public static final String I18N_XAXIS_LABEL_DEFAULT = "km"; - public static final String I18N_YAXIS_LABEL_DEFAULT = "W [NN + m]"; + public static final String I18N_YAXIS_LABEL_DEFAULT = "W [m]"; /** @@ -104,34 +102,44 @@ } + /** + * Add the waterlevel-curves (the "absolutes" from which + * differences were calculated). + * @param wqkms The wqkms to add to the diagram. + */ public void doWaterlevelOut(WQKms wqkms, String description, Document theme, WINFOArtifact flysArtifact) { - String gaugeName = wqkms.getName(); + String wqkmsName = wqkms.getName(); River river = FLYSUtils.getRiver(flysArtifact); if (river == null) { - logger.debug("no river found"); + logger.warn("no river found"); return; } - Gauge gauge = river.determineGaugeByName(gaugeName); + logger.debug("WDifferencesCurveGenerator.doWaterlevelOut, gauge: " + + wqkmsName); + /* + Gauge gauge = river.determineGaugeByName(wqkmsName); if (gauge == null) { - logger.debug("no gauge found"); + logger.warn("no gauge found"); return; } + */ - String seriesName = "(tbd)Source for Diff."; - //getSeriesName(gauge); double [][] values = new double [][] { - wqkms.getQs(), wqkms.getWs() }; + wqkms.getKms(), wqkms.getWs() }; int size = values != null ? values[0].length : 0; + String seriesName = wqkmsName; + //getSeriesName(gauge); + XYSeries series = new StyledXYSeries(seriesName, theme); for (int i = 0; i < size; i++) {