# HG changeset patch # User Sascha L. Teichmann # Date 1371569428 -7200 # Node ID 791c7492b4ee9ae038b7549d19d3a0aee7f832e5 # Parent a8b065038c0cc7c90c660fc46caf64fd06e6dd27# Parent d3ba73a88533ad99c9b43b693f6f226f99c66364 Merged diff -r a8b065038c0c -r 791c7492b4ee .hgtags --- a/.hgtags Tue Jun 18 17:28:27 2013 +0200 +++ b/.hgtags Tue Jun 18 17:30:28 2013 +0200 @@ -52,3 +52,4 @@ 1a169e10c0f3e1f33990a91dd294512ac97d1a70 3.0.5 b689d2b9d1675739778083b2bcba336abb33f70c 3.0.6 5733d7f27196c5a8cf18231fbf187738f8fea560 3.0.7 +eec895f6ec801a7faaed96e9f01721e1143e7bb8 3.0.8 diff -r a8b065038c0c -r 791c7492b4ee artifacts/doc/conf/meta-data.xml --- a/artifacts/doc/conf/meta-data.xml Tue Jun 18 17:28:27 2013 +0200 +++ b/artifacts/doc/conf/meta-data.xml Tue Jun 18 17:30:28 2013 +0200 @@ -105,6 +105,9 @@ + + + diff -r a8b065038c0c -r 791c7492b4ee artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedloadDiameterDataFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedloadDiameterDataFacet.java Tue Jun 18 17:28:27 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedloadDiameterDataFacet.java Tue Jun 18 17:30:28 2013 +0200 @@ -35,7 +35,7 @@ D4EArtifact d4e = (D4EArtifact) artifact; BedQualityAccess access = new BedQualityAccess(d4e, context); int ndx = getIndex() & 7; - int diam = (getIndex() >> 3); + int diam = (getIndex() >> 4); String diameter = ""; switch (diam) { case 1: diameter = "d10"; break; diff -r a8b065038c0c -r 791c7492b4ee artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/QualityMeasurementFactory.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/QualityMeasurementFactory.java Tue Jun 18 17:28:27 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/QualityMeasurementFactory.java Tue Jun 18 17:30:28 2013 +0200 @@ -55,7 +55,8 @@ " sp.tiefevon IS NOT NULL AND " + " sp.tiefebis IS NOT NULL AND " + // TODO: Test if char diameter ist null. " st.km BETWEEN :from - 0.001 AND :to + 0.001 AND " + - " st.datum BETWEEN :start AND :end"; + " st.datum BETWEEN :start AND :end " + + "ORDER BY st.km"; private static final String SQL_BEDLOAD_MEASUREMENT = "SELECT m.km as km," + @@ -82,7 +83,8 @@ " m.km IS NOT NULL AND " + " m.d10 IS NOT NULL AND" + //TODO: Add all other char. diameter. " m.km BETWEEN :from - 0.001 AND :to + 0.001 AND" + - " m.datum BETWEEN :start AND :end"; + " m.datum BETWEEN :start AND :end " + + "ORDER BY m.km"; public static final class QualityMeasurementResultTransformer extends BasicTransformerAdapter { diff -r a8b065038c0c -r 791c7492b4ee artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadCalculate.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadCalculate.java Tue Jun 18 17:28:27 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadCalculate.java Tue Jun 18 17:30:28 2013 +0200 @@ -14,6 +14,8 @@ import org.apache.log4j.Logger; import org.dive4elements.artifactdatabase.state.Facet; +import org.dive4elements.artifactdatabase.state.FacetActivity; +import org.dive4elements.artifacts.Artifact; import org.dive4elements.artifacts.CallContext; import org.dive4elements.artifacts.CallMeta; import org.dive4elements.river.artifacts.D4EArtifact; @@ -48,6 +50,33 @@ public static final String I18N_FACET_SEDIMENTLOAD_TOTAL_LOAD = "facet.sedimentload.total_load"; public static final String I18N_FACET_SEDIMENTLOAD_TOTAL = "facet.sedimentload.total"; + static { + // Active/deactivate facets. + FacetActivity.Registry.getInstance().register( + "minfo", + new FacetActivity() { + @Override + public Boolean isInitialActive( + Artifact artifact, + Facet facet, + String output + ) { + String name = facet.getName(); + if (name.equals(SEDIMENT_LOAD_COARSE) || + name.equals(SEDIMENT_LOAD_FINEMIDDLE) || + name.equals(SEDIMENT_LOAD_SAND) || + name.equals(SEDIMENT_LOAD_SUSP_SAND) || + name.equals(SEDIMENT_LOAD_SUSP_SEDIMENT) || + name.equals(SEDIMENT_LOAD_SUSP_SAND_BED)){ + return Boolean.FALSE; + } + else { + return null; + } + } + }); + } + @Override public Object computeAdvance(D4EArtifact artifact, String hash, CallContext context, List facets, Object old) { diff -r a8b065038c0c -r 791c7492b4ee artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java Tue Jun 18 17:28:27 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java Tue Jun 18 17:30:28 2013 +0200 @@ -122,6 +122,9 @@ row[ndx] = beds[k].getDiameterCap(km); row[ndx + 1] = beds[k].getDiameterSub(km); } + if (beds.length == 0) { + continue; + } BedParametersResult[] params = results[j].getParameters(); for(int k = 0; k < params.length; k++) { // loads.length + (beds.lenght * 2) * (j + 1): shift bed and bedload columns. @@ -203,6 +206,9 @@ beds[j].getType().toString()) + " - " + d1 + "-" + d2); } + if (beds.length == 0) { + continue; + } if (params.length > 0) { header.add( msg(CSV_HEADER_DENSITY_CAP, CSV_HEADER_DENSITY_CAP) + diff -r a8b065038c0c -r 791c7492b4ee artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java Tue Jun 18 17:28:27 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java Tue Jun 18 17:30:28 2013 +0200 @@ -70,7 +70,7 @@ public static final String I18N_YAXIS_D_LABEL_DEFAULT = "delta S [m]"; public static final String I18N_YAXIS_V_LABEL_DEFAULT = "Geschwindigkeit v [m/s]"; - private D4EArtifact artifact; + private String yLabel = ""; @Override protected YAxisWalker getYAxisWalker() { @@ -101,8 +101,16 @@ } Facet facet = bundle.getFacet(); - artifact = (D4EArtifact)bundle.getArtifact(); + D4EArtifact artifact = (D4EArtifact)bundle.getArtifact(); + SedimentLoadAccess slaccess = new SedimentLoadAccess(artifact); + String unit = slaccess.getUnit(); + if (unit != null && unit.equals("m3_per_a")) { + yLabel = msg(I18N_YAXIS_LABEL_2, I18N_YAXIS_LABEL_DEFAULT_2); + } + else { + yLabel = msg(I18N_YAXIS_LABEL_1, I18N_YAXIS_LABEL_DEFAULT_1); + } if (facet == null) { return; } @@ -118,13 +126,11 @@ context.putContextValue("endkm", getXBounds(0).getUpper()); } else if (getXBounds(0) == null && getDomainAxisRange() == null) { - D4EArtifact artifact = (D4EArtifact)bundle.getArtifact(); RangeAccess access = new RangeAccess(artifact); context.putContextValue("startkm", access.getFrom()); context.putContextValue("endkm", access.getTo()); } else if (getXBounds(0) == null && getDomainAxisRange() != null){ - D4EArtifact artifact = (D4EArtifact)bundle.getArtifact(); RangeAccess access = new RangeAccess(artifact); Bounds b = new DoubleBounds(access.getFrom(), access.getTo()); Bounds bounds = @@ -226,13 +232,7 @@ protected String getDefaultYAxisLabel(int pos) { String label = "default"; if (pos == YAXIS.L.idx) { - SedimentLoadAccess access = new SedimentLoadAccess(artifact); - if (access.getUnit().equals("m3_per_a")) { - label = msg(I18N_YAXIS_LABEL_2, I18N_YAXIS_LABEL_DEFAULT_2); - } - else { - label = msg(I18N_YAXIS_LABEL_1, I18N_YAXIS_LABEL_DEFAULT_1); - } + label = yLabel; } else if (pos == YAXIS.V.idx) { label = msg(I18N_YAXIS_V_LABEL, I18N_YAXIS_V_LABEL_DEFAULT); diff -r a8b065038c0c -r 791c7492b4ee gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html --- a/gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html Tue Jun 18 17:28:27 2013 +0200 +++ b/gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html Tue Jun 18 17:30:28 2013 +0200 @@ -76,8 +76,8 @@ - - + + diff -r a8b065038c0c -r 791c7492b4ee gwt-client/src/main/webapp/images/FLYS_Saale.png Binary file gwt-client/src/main/webapp/images/FLYS_Saale.png has changed diff -r a8b065038c0c -r 791c7492b4ee gwt-client/src/main/webapp/images/FLYS_Saale_1_inactive.png Binary file gwt-client/src/main/webapp/images/FLYS_Saale_1_inactive.png has changed diff -r a8b065038c0c -r 791c7492b4ee gwt-client/src/main/webapp/images/FLYS_Saale_Thueringen.png Binary file gwt-client/src/main/webapp/images/FLYS_Saale_Thueringen.png has changed diff -r a8b065038c0c -r 791c7492b4ee gwt-client/src/main/webapp/images/FLYS_Saale_Thueringen_inactive.png Binary file gwt-client/src/main/webapp/images/FLYS_Saale_Thueringen_inactive.png has changed diff -r a8b065038c0c -r 791c7492b4ee gwt-client/src/main/webapp/images/FLYS_Saale_inactive.png Binary file gwt-client/src/main/webapp/images/FLYS_Saale_inactive.png has changed