Mercurial > dive4elements > river
changeset 3883:f858028dde5f
Manual points (work in progress)
flys-artifacts/trunk@5533 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Thu, 20 Sep 2012 07:16:45 +0000 |
parents | 8e806d51ebe4 |
children | f6fae9d13507 |
files | flys-artifacts/ChangeLog flys-artifacts/doc/conf/artifacts/fixanalysis.xml flys-artifacts/doc/conf/artifacts/manualpoints.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ManualPointsSingleState.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java |
diffstat | 7 files changed, 48 insertions(+), 46 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog Wed Sep 19 09:17:14 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Sep 20 07:16:45 2012 +0000 @@ -1,3 +1,13 @@ +2012-09-20 Christian Lins <christian.lins@intevation.de> + + * doc/conf/artifacts/fixanalysis.xml, + doc/conf/artifacts/manualpoints.xml, + src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java, + src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java, + src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java, + src/main/java/de/intevation/flys/artifacts/states/ManualPointsSingleState.java: + Work on manual points in fix analysis charts (not yet working). + 2012-09-19 Sascha L. Teichmann <sascha.teichmann@intevation.de> * src/main/java/de/intevation/flys/exports/minfo/BedQualityExporter.java:
--- a/flys-artifacts/doc/conf/artifacts/fixanalysis.xml Wed Sep 19 09:17:14 2012 +0000 +++ b/flys-artifacts/doc/conf/artifacts/fixanalysis.xml Thu Sep 20 07:16:45 2012 +0000 @@ -194,7 +194,7 @@ <outputmode name="fix_derivate_curve" description="output.fix_derivate_curve" mine-type="image/png" type="chart"> <facets> <facet name="fix_derivate" description="Derivate curve"/> - <facet name="fix_derivate_curve.manualpoints" description="Manual points"/> + <facet name="fix_derivate.manualpoints" description="Manual points"/> </facets> </outputmode> <outputmode name="fix_report" description="output.fix_report.report" mime-type="text/plain" type="report">
--- a/flys-artifacts/doc/conf/artifacts/manualpoints.xml Wed Sep 19 09:17:14 2012 +0000 +++ b/flys-artifacts/doc/conf/artifacts/manualpoints.xml Thu Sep 20 07:16:45 2012 +0000 @@ -18,12 +18,13 @@ <facet name="reference_curve_normalized.manualpoints" description="points"/> <facet name="historical_discharge.manualpoints" description="Points provided by user." /> <facet name="cross_section.manualline" description="Lines provided by user." /> - <facet name="fix_wq_curve.manualpoints" description="Points provided by user." /> - <facet name="fix_deltawt_curve.manualpoints" description="Points provided by user." /> - <facet name="fix_longitudinal_section_curve.manualpoints" description="Points provided by user." /> - <facet name="fix_derivate_curve.manualpoints" description="Points provided by user." /> </facets> </outputmode> + <outputmode name="fix_derivate_curve" description="output.fix_derivate_curve" mime-type="image/png" type="chart"> + <facets> + <facet name="fix_derivate.manualpoints" description="Points provided by user." /> + </facets> + </outputmode> </outputmodes> </state> </states>
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Wed Sep 19 09:17:14 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Thu Sep 20 07:16:45 2012 +0000 @@ -1,5 +1,25 @@ package de.intevation.flys.artifacts; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +import javax.xml.xpath.XPathConstants; + +import net.sf.ehcache.Cache; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + import de.intevation.artifactdatabase.ArtifactDatabaseImpl; import de.intevation.artifactdatabase.DefaultArtifact; import de.intevation.artifactdatabase.ProtocolUtils; @@ -29,26 +49,6 @@ import de.intevation.flys.artifacts.states.DefaultState.ComputeType; import de.intevation.flys.utils.FLYSUtils; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; - -import javax.xml.xpath.XPathConstants; - -import net.sf.ehcache.Cache; - -import org.apache.log4j.Logger; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - /** * The default FLYS artifact with convenience added. * (Subclass to get fully functional artifacts). @@ -189,7 +189,7 @@ String name = getName(); if (debug) { - log.debug("Set initial state for artifact '" + name + "'"); + log.debug("setup(): Set initial state for artifact '" + name + "'"); } if (states == null) {
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java Wed Sep 19 09:17:14 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/FacetTypes.java Thu Sep 20 07:16:45 2012 +0000 @@ -104,6 +104,7 @@ }; public enum ChartType { + FD("fix_derivate"), LS("longitudinal_section"), CS("cross_section"), DLS("discharge_longitudinal_section"), @@ -121,6 +122,7 @@ this.chartTypeString = description; } + @Override public String toString() { return chartTypeString; }
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ManualPointsSingleState.java Wed Sep 19 09:17:14 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ManualPointsSingleState.java Thu Sep 20 07:16:45 2012 +0000 @@ -3,22 +3,17 @@ import java.util.List; import org.apache.log4j.Logger; - import org.json.JSONArray; import org.json.JSONException; -import de.intevation.artifacts.CallMeta; +import de.intevation.artifactdatabase.state.Facet; import de.intevation.artifacts.CallContext; - -import de.intevation.artifactdatabase.state.Facet; - +import de.intevation.artifacts.CallMeta; import de.intevation.flys.artifacts.FLYSArtifact; import de.intevation.flys.artifacts.ManualPointsArtifact; - import de.intevation.flys.artifacts.model.CrossSectionWaterLineFacet; import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.ManualPointsFacet; - import de.intevation.flys.artifacts.resources.Resources; /** @@ -66,6 +61,7 @@ // Add Facet per Diagram type if data given. for (ChartType ct: ChartType.values()) { + logger.debug("compute(): points for " + ct); // Handle points. String pointData = points.getDataAsString(ct + "." + MANUALPOINTS + DOT_DATA); @@ -76,11 +72,10 @@ 0, fName, Resources.getMsg(meta, "manualpoints", "Manual Points")); - facets.add(facet); } else { - //logger.debug("No points for " + ct); + logger.debug("compute(): No points for " + ct); } // Handle lines. @@ -89,7 +84,7 @@ if (linesData != null && linesData.length() != 0 && !linesData.equals("[]")) { try { - JSONArray lines = new JSONArray((String) linesData); + JSONArray lines = new JSONArray(linesData); for (int i = 0, P = lines.length(); i < P; i++) { JSONArray array = lines.getJSONArray(i); double y = array.getDouble(0);
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java Wed Sep 19 09:17:14 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java Thu Sep 20 07:16:45 2012 +0000 @@ -1,13 +1,14 @@ package de.intevation.flys.artifacts.states; +import java.util.List; + +import org.apache.log4j.Logger; + import de.intevation.artifactdatabase.state.Facet; - import de.intevation.artifacts.CallContext; - import de.intevation.flys.artifacts.ChartArtifact; import de.intevation.flys.artifacts.FLYSArtifact; import de.intevation.flys.artifacts.WINFOArtifact; - import de.intevation.flys.artifacts.model.CalculationResult; import de.intevation.flys.artifacts.model.CrossSectionWaterLineFacet; import de.intevation.flys.artifacts.model.DataFacet; @@ -16,13 +17,8 @@ import de.intevation.flys.artifacts.model.ReportFacet; import de.intevation.flys.artifacts.model.WQKms; import de.intevation.flys.artifacts.model.WaterlevelFacet; - import de.intevation.flys.utils.FLYSUtils; -import java.util.List; - -import org.apache.log4j.Logger; - public class WaterlevelState extends DefaultState implements FacetTypes @@ -127,7 +123,6 @@ Object old ) { if (artifact instanceof ChartArtifact) { - ChartArtifact chart = (ChartArtifact)artifact; facets.add(new EmptyFacet()); return null; } @@ -147,7 +142,6 @@ Object old ) { if (artifact instanceof ChartArtifact) { - ChartArtifact chart = (ChartArtifact)artifact; facets.add(new EmptyFacet()); return null; }