# HG changeset patch # User Raimund Renkert # Date 1365065746 -7200 # Node ID 38acd82feeac0528417da02b935e9430872a0df3 # Parent 12f4d088f088db2c3be7ced7ab28e4434f05d4c6 Added bed quality facets to flow velocity datacage. * Added facets in artifact config. * Added datacage config for bedquality facets. * Added ouput methods for bedquality facets to generator. diff -r 12f4d088f088 -r 38acd82feeac flys-artifacts/doc/conf/artifacts/minfo.xml --- a/flys-artifacts/doc/conf/artifacts/minfo.xml Wed Apr 03 23:16:11 2013 +0200 +++ b/flys-artifacts/doc/conf/artifacts/minfo.xml Thu Apr 04 10:55:46 2013 +0200 @@ -154,6 +154,9 @@ + + + diff -r 12f4d088f088 -r 38acd82feeac flys-artifacts/doc/conf/meta-data.xml --- a/flys-artifacts/doc/conf/meta-data.xml Wed Apr 03 23:16:11 2013 +0200 +++ b/flys-artifacts/doc/conf/meta-data.xml Thu Apr 04 10:55:46 2013 +0200 @@ -2477,6 +2477,78 @@ + + + + + + + + SELECT a.gid AS aid, + f.id AS fid, + f.name AS facet_name, + f.num AS facet_num, + f.description AS facet_description + FROM outs AS o, facets AS f, artifacts AS a + WHERE + (f.name = 'bed_longitudinal_section.bed_diameter_toplayer' + OR f.name = 'bed_longitudinal_section.bed_diameter_sublayer') AND + f.out_id = o.id AND + o.artifact_id = ${a_id} AND + a.id = ${a_id} + + + + + + + + + + + + + + + + + + + + + + + + + SELECT a.gid AS aid, + f.id AS fid, + f.name AS facet_name, + f.num AS facet_num, + f.description AS facet_description + FROM outs AS o, facets AS f, artifacts AS a + WHERE + f.name = 'bed_longitudinal_section.bedload_diameter' AND + f.out_id = o.id AND + o.artifact_id = ${a_id} AND + a.id = ${a_id} + + + + + + + + + + + + + + + + + + @@ -2522,6 +2594,12 @@ + + + + + + diff -r 12f4d088f088 -r 38acd82feeac flys-artifacts/src/main/java/de/intevation/flys/exports/FlowVelocityGenerator.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/FlowVelocityGenerator.java Wed Apr 03 23:16:11 2013 +0200 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/FlowVelocityGenerator.java Thu Apr 04 10:55:46 2013 +0200 @@ -16,6 +16,8 @@ import de.intevation.flys.artifacts.access.FlowVelocityAccess; import de.intevation.flys.artifacts.model.FacetTypes; import de.intevation.flys.artifacts.model.FlowVelocityData; +import de.intevation.flys.artifacts.model.minfo.BedDiameterResult; +import de.intevation.flys.artifacts.model.minfo.BedloadDiameterResult; import de.intevation.flys.model.FlowVelocityMeasurementValue; import de.intevation.flys.jfree.Bounds; @@ -38,7 +40,8 @@ public enum YAXIS { V(0), T(1), - Q(2); + Q(2), + D(3); /* TODO Q and Density will come as 4th and 3rd axis. */ protected int idx; private YAXIS(int c) { @@ -85,13 +88,14 @@ public static final String I18N_3YAXIS_LABEL = "chart.flow_velocity.section.yaxis.third.label"; + public static final String I18N_4YAXIS_LABEL = "chart.bedquality.yaxis.label.diameter"; public static final String I18N_CHART_TITLE_DEFAULT = "Geschwindigkeit- und Schubspannung"; public static final String I18N_XAXIS_LABEL_DEFAULT = "km"; public static final String I18N_YAXIS_LABEL_DEFAULT = "Geschwindigkeit v [m/s]"; public static final String I18N_2YAXIS_LABEL_DEFAULT = "Schubspannung Tau [N]"; public static final String I18N_3YAXIS_LABEL_DEFAULT = "Q [m³/s]"; - + public static final String I18N_4YAXIS_LABEL_DEFAULT = "Durchmesser [mm]"; @Override protected YAxisWalker getYAxisWalker() { @@ -152,6 +156,9 @@ else if (index == YAXIS.Q.idx) { label = getQAxisLabel(); } + else if (index == YAXIS.D.idx) { + label = getDAxisLabel(); + } return label; } @@ -179,6 +186,12 @@ return msg(I18N_2YAXIS_LABEL, I18N_2YAXIS_LABEL_DEFAULT); } + /** + * Get internationalized label for the y axis. + */ + protected String getDAxisLabel() { + return msg(I18N_4YAXIS_LABEL, I18N_4YAXIS_LABEL_DEFAULT); + } /** * Produce output. @@ -318,6 +331,27 @@ attr, visible); } + else if (name.equals(BED_QUALITY_BED_DIAMETER_SUBLAYER)) { + doBedQualitySubLayerOut( + (BedDiameterResult)artifactAndFacet.getData(context), + artifactAndFacet, + attr, + visible); + } + else if (name.equals(BED_QUALITY_BED_DIAMETER_TOPLAYER)) { + doBedQualityTopLayerOut( + (BedDiameterResult)artifactAndFacet.getData(context), + artifactAndFacet, + attr, + visible); + } + else if (name.equals(BED_QUALITY_BEDLOAD_DIAMETER)) { + doBedQualityLoadDiameter( + (BedloadDiameterResult)artifactAndFacet.getData(context), + artifactAndFacet, + attr, + visible); + } else { logger.warn("Unknown facet name: " + name); return; @@ -325,6 +359,42 @@ } + private void doBedQualityLoadDiameter( + BedloadDiameterResult data, + ArtifactAndFacet aandf, + Document attr, + boolean visible) { + XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), attr); + StyledSeriesBuilder.addPoints(series, data.getDiameterData(), true); + + addAxisSeries(series, YAXIS.D.idx, visible); + } + + + private void doBedQualityTopLayerOut( + BedDiameterResult data, + ArtifactAndFacet aandf, + Document attr, + boolean visible) { + XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), attr); + StyledSeriesBuilder.addPoints(series, data.getDiameterSubData(), true); + addAxisSeries(series, YAXIS.D.idx, visible); + } + + + private void doBedQualitySubLayerOut( + BedDiameterResult data, + ArtifactAndFacet aandf, + Document attr, + boolean visible + ) { + logger.debug("Do beddiametersubout"); + XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), attr); + StyledSeriesBuilder.addPoints(series, data.getDiameterSubData(), true); + addAxisSeries(series, YAXIS.D.idx, visible); + } + + /** * Process the output for W facets in a longitudinal section curve. *