# HG changeset patch # User Sascha L. Teichmann # Date 1308321429 0 # Node ID af3b5d9e91a4aae5ae9959717f3e8191d540a1ed # Parent 32ed5d789e5048ad35e014795b6df0bdc8a62170 Generate data facets for the computed states. flys-artifacts/branches/facets-slt@2154 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 32ed5d789e50 -r af3b5d9e91a4 flys-artifacts/doc/conf/artifacts/winfo.xml --- a/flys-artifacts/doc/conf/artifacts/winfo.xml Fri Jun 17 14:03:29 2011 +0000 +++ b/flys-artifacts/doc/conf/artifacts/winfo.xml Fri Jun 17 14:37:09 2011 +0000 @@ -180,7 +180,7 @@ - + diff -r 32ed5d789e50 -r af3b5d9e91a4 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java Fri Jun 17 14:03:29 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java Fri Jun 17 14:37:09 2011 +0000 @@ -10,11 +10,15 @@ import de.intevation.flys.artifacts.FLYSArtifact; import de.intevation.flys.artifacts.WINFOArtifact; + import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.WaterlevelFacet; +import de.intevation.flys.artifacts.model.DataFacet; import de.intevation.flys.artifacts.model.WQKms; + import de.intevation.flys.artifacts.resources.Resources; + /** * The final state that will be reached after the discharge curve calculation * mode has been chosen. @@ -68,9 +72,8 @@ "", args); - Facet q = new WaterlevelFacet(0, COMPUTED_DISCHARGE_Q, name); - - facets.add(q); + facets.add(new WaterlevelFacet(0, COMPUTED_DISCHARGE_Q, name)); + facets.add(new DataFacet(CSV, "CSV data")); return new WQKms[] { res }; } diff -r 32ed5d789e50 -r af3b5d9e91a4 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java Fri Jun 17 14:03:29 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java Fri Jun 17 14:37:09 2011 +0000 @@ -15,6 +15,8 @@ import de.intevation.flys.artifacts.model.WQKms; import de.intevation.flys.artifacts.model.WQCKms; +import de.intevation.flys.artifacts.model.DataFacet; + public class DischargeLongitudinalSection extends DefaultState implements FacetTypes @@ -83,6 +85,11 @@ } } + if (res.length > 0) { + facets.add(new DataFacet(CSV, "CSV data")); + facets.add(new DataFacet(WST, "WST data")); + } + return res; } } diff -r 32ed5d789e50 -r af3b5d9e91a4 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java Fri Jun 17 14:03:29 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java Fri Jun 17 14:37:09 2011 +0000 @@ -15,6 +15,9 @@ import de.intevation.flys.artifacts.model.WQDay; import de.intevation.flys.artifacts.resources.Resources; +import de.intevation.flys.artifacts.model.DataFacet; + + /** * The final state that will be reached after the duration curve calculation * mode has been chosen. @@ -77,6 +80,8 @@ facets.add(w); facets.add(q); + facets.add(new DataFacet(CSV, "CSV data")); + return new WQDay[] { res }; } } diff -r 32ed5d789e50 -r af3b5d9e91a4 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java Fri Jun 17 14:03:29 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/WaterlevelState.java Fri Jun 17 14:37:09 2011 +0000 @@ -19,6 +19,8 @@ import de.intevation.flys.artifacts.model.WaterlevelFacet; import de.intevation.flys.artifacts.model.WQKms; +import de.intevation.flys.artifacts.model.DataFacet; + public class WaterlevelState extends DefaultState @@ -85,6 +87,14 @@ facets.add(q); } + if (res.length > 0) { + Facet wst = new DataFacet(WST, "WST data"); + Facet csv = new DataFacet(CSV, "CSV data"); + + facets.add(wst); + facets.add(csv); + } + return res; } }