# HG changeset patch # User Felix Wolfsteller # Date 1343311958 0 # Node ID b9c2becbcc9eb7a64b1e60673188c32eeb1baca9 # Parent 8160e62bbb3af492c4cf309e4e497b9f803d5f3d Towards issue745 (lines for averages in deltawt). flys-artifacts/trunk@5139 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 8160e62bbb3a -r b9c2becbcc9e flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Thu Jul 26 11:47:04 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Jul 26 14:12:38 2012 +0000 @@ -1,3 +1,12 @@ +2012-07-26 Felix Wolfsteller + + * src/main/java/de/intevation/flys/artifacts/model/QWDDateRange.java: + New class. QWD and a DateRange. + + * src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java, + src/main/java/de/intevation/flys/artifacts/model/fixings/FixAvSectorFacet.java: + Produce QWDDateRanges in state, consume in generator. + 2012-07-26 Ingo Weinzierl * doc/conf/artifacts/fixanalysis.xml: Registered new Output diff -r 8160e62bbb3a -r b9c2becbcc9e flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/QWDDateRange.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/QWDDateRange.java Thu Jul 26 14:12:38 2012 +0000 @@ -0,0 +1,20 @@ +package de.intevation.flys.artifacts.model; + + +import java.io.Serializable; + +import de.intevation.flys.artifacts.model.fixings.QWD; + +public class QWDDateRange +implements Serializable +{ + + public QWD qwd; + public DateRange dateRange; + + public QWDDateRange(QWD qwd, DateRange dr) { + this.qwd = qwd; + this.dateRange = dr; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 8160e62bbb3a -r b9c2becbcc9e flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAvSectorFacet.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAvSectorFacet.java Thu Jul 26 11:47:04 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixAvSectorFacet.java Thu Jul 26 14:12:38 2012 +0000 @@ -11,6 +11,8 @@ import de.intevation.flys.artifacts.model.DataFacet; import de.intevation.flys.artifacts.model.FacetTypes; +import de.intevation.flys.artifacts.model.QWDDateRange; + import de.intevation.flys.artifacts.states.DefaultState.ComputeType; import de.intevation.flys.utils.KMIndex; @@ -103,7 +105,7 @@ if (qwdData == null) { return null; } - return qwdData[sectorNdx]; + return new QWDDateRange(qwdData[sectorNdx], periods[periodNdx].getDateRange()); } else { logger.warn("Artifact is no instance of FLYSArtifact."); diff -r 8160e62bbb3a -r b9c2becbcc9e flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java Thu Jul 26 11:47:04 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/fixings/FixDeltaWtGenerator.java Thu Jul 26 14:12:38 2012 +0000 @@ -8,6 +8,7 @@ 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.QWDDateRange; import de.intevation.flys.artifacts.model.fixings.QWD; import de.intevation.flys.artifacts.resources.Resources; import de.intevation.flys.exports.TimeseriesChartGenerator; @@ -46,6 +47,7 @@ extends TimeseriesChartGenerator implements FacetTypes { + /** Private logger. */ private static Logger logger = Logger.getLogger(FixDeltaWtGenerator.class); @@ -217,23 +219,31 @@ { logger.debug("doSectorAverageOut(): description = " + desc); - QWD qwd = (QWD) data; + QWDDateRange qwd = (QWDDateRange) data; TimeSeriesCollection tsc = new TimeSeriesCollection(); TimeSeries series = new StyledTimeSeries(desc, theme); - if (qwd == null) { + if (qwd == null || qwd.qwd == null || qwd.dateRange == null) { return; } - RegularTimePeriod rtp = new Day(qwd.getDate()); - double value = qwd.getDeltaW(); + RegularTimePeriod rtp = new Day(qwd.qwd.getDate()); + double value = qwd.qwd.getDeltaW(); + /* + // Draw a line spanning the analysis time. series.add(rtp, value); + rtp = new Day(qwd.dateRange.getFrom()); + series.add(rtp, value); + rtp = new Day(qwd.dateRange.getTo()); + series.add(rtp, value); + */ + tsc.addSeries(series); addAxisDataset(tsc, 0, visible); addAttribute(desc, "outline"); Map annoIdxMap = new HashMap(); annoIdxMap.put (0, new int[]{0,0}); - doQWDTextAnnotations(annoIdxMap, tsc, new QWD[]{qwd}, theme, visible); + doQWDTextAnnotations(annoIdxMap, tsc, new QWD[]{qwd.qwd}, theme, visible); }