[PATCH 2 of 4] merged changes from default into longitudinal-symmetrie branch
Wald Commits
scm-commit at wald.intevation.org
Fri Aug 9 12:12:49 CEST 2013
# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1375894649 -7200
# Branch longitudinal-symmetry
# Node ID 962f6b805b48db22a14c3b227ef447bfed32dcc1
# Parent dd5355775ce11b287b883ee2e0d5a72f36ad4e8c
# Parent c146fd412f9d379fcc42bde727891e4581d3d048
merged changes from default into longitudinal-symmetrie branch
diff -r dd5355775ce1 -r 962f6b805b48 artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml Wed Aug 07 18:57:29 2013 +0200
@@ -502,9 +502,6 @@
<dc:group expr="$gauge_name">
<dc:for-each>
<dc:variable name="combined_desc" expr="concat($bfg_id, ' ', dc:date-format('dd.MM.yyyy', $start_time), ' - ', dc:date-format('dd.MM.yyyy', $stop_time))"/>
- <dc:message>
- Hallo ANDRE23 {dc:dump-variables()}
- </dc:message>
<histdis name="{$combined_desc}"
description="{$combined_desc}"
factory="gaugedischarge" target_out="{$out}"
diff -r dd5355775ce1 -r 962f6b805b48 artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Datacage.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Datacage.java Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Datacage.java Wed Aug 07 18:57:29 2013 +0200
@@ -896,8 +896,8 @@
@Override
public boolean doIt() throws SQLException {
prepareStatement(SQL_UPDATE_ARTIFACT_STATE);
- stmnt.setInt(1, artifactId);
- stmnt.setString(2, artifact.getCurrentStateId());
+ stmnt.setString(1, artifact.getCurrentStateId());
+ stmnt.setInt(2, artifactId);
stmnt.execute();
conn.commit();
return true;
diff -r dd5355775ce1 -r 962f6b805b48 artifacts/src/main/java/org/dive4elements/river/artifacts/math/MovingAverage.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/math/MovingAverage.java Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/math/MovingAverage.java Wed Aug 07 18:57:29 2013 +0200
@@ -37,7 +37,11 @@
return new double [][] { xs, ys };
}
- public static double[][] weighted(double[][] values, double radius) {
+ /** Build moving average over values. Weight them. */
+ public static double[][] weighted(
+ double[][] values,
+ double radius
+ ) {
TreeMap<Double, Double> map = toMap(values);
int N = map.size();
double [] xs = new double[N];
@@ -62,6 +66,7 @@
return new double [][] { xs, ys };
}
+ /** From [x1,x2][y1,y2] makes {x1:y1,x2:y2}. Sorted by x! */
private static TreeMap<Double, Double> toMap(double[][] values) {
TreeMap<Double, Double> map = new TreeMap<Double, Double>();
double [] xs = values[0];
diff -r dd5355775ce1 -r 962f6b805b48 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java Wed Aug 07 18:57:29 2013 +0200
@@ -11,10 +11,10 @@
import gnu.trove.TDoubleArrayList;
+/** Result of a bed diff year calculation. */
public class BedDiffYearResult
extends BedDifferencesResult
{
-
protected TDoubleArrayList bedHeights;
protected TDoubleArrayList dataGap;
protected TDoubleArrayList morphWidth;
@@ -115,3 +115,4 @@
};
}
}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r dd5355775ce1 -r 962f6b805b48 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFactory.java Wed Aug 07 18:57:29 2013 +0200
@@ -24,6 +24,8 @@
import org.dive4elements.river.artifacts.model.StaticBedHeightCacheKey;
import org.dive4elements.river.backend.SessionHolder;
+
+/** Create BedHeights from database. */
public class BedHeightFactory {
/** Private logger to use here. */
private static Logger log = Logger.getLogger(BedHeightFactory.class);
diff -r dd5355775ce1 -r 962f6b805b48 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/QualityMeasurement.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/QualityMeasurement.java Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/QualityMeasurement.java Wed Aug 07 18:57:29 2013 +0200
@@ -23,7 +23,7 @@
private double depth2;
private Map<String, Double> charDiameter;
- public QualityMeasurement() {
+ private QualityMeasurement() {
}
diff -r dd5355775ce1 -r 962f6b805b48 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 Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/QualityMeasurementFactory.java Wed Aug 07 18:57:29 2013 +0200
@@ -86,12 +86,15 @@
" m.datum BETWEEN :start AND :end " +
"ORDER BY m.km";
+ /** Transform query result into objects, use INSTANCE singleton. */
public static final class QualityMeasurementResultTransformer
extends BasicTransformerAdapter {
- public static QualityMeasurementResultTransformer INSTANCE = new QualityMeasurementResultTransformer();
+ // Make a singleton
+ public static QualityMeasurementResultTransformer INSTANCE =
+ new QualityMeasurementResultTransformer();
- public QualityMeasurementResultTransformer() {
+ private QualityMeasurementResultTransformer() {
}
@Override
diff -r dd5355775ce1 -r 962f6b805b48 artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java Wed Aug 07 18:57:29 2013 +0200
@@ -98,8 +98,14 @@
return res;
}
- protected void generateFacets(CallContext context, List<Facet> newFacets,
- BedDifferencesResult[] results, String stateId, String hash) {
+ /** Generate Facets based on given results. */
+ protected void generateFacets(
+ CallContext context,
+ List<Facet> newFacets,
+ BedDifferencesResult[] results,
+ String stateId,
+ String hash
+ ) {
logger.debug("DifferencesState.generateFacets");
CallMeta meta = context.getMeta();
diff -r dd5355775ce1 -r 962f6b805b48 artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java Wed Aug 07 18:57:29 2013 +0200
@@ -45,7 +45,8 @@
* @param series Series to add points to.
* @param points Points to add to series, points[0] to 1st dim, points[1]
* to 2nd dim.
- * @param skipNANs if true, skip NAN values in points parameter.
+ * @param skipNANs if true, skip NAN values in points parameter. Otherwise,
+ * the NaNs lead to gaps in graph.
* @param distance if two consecutive entries in points[0] are more
* than distance apart, create a NaN value to skip in display.
*/
diff -r dd5355775ce1 -r 962f6b805b48 artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityGenerator.java Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityGenerator.java Wed Aug 07 18:57:29 2013 +0200
@@ -223,7 +223,7 @@
boolean visible
) {
XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
- StyledSeriesBuilder.addPoints(series, data.getDiameterData(), true);
+ StyledSeriesBuilder.addPoints(series, data.getDiameterData(), true, 0.101d);
addAxisSeries(series, YAXIS.W.idx, visible);
}
@@ -233,7 +233,7 @@
logger.debug("BedQuality.doBedDiameterTopLayerOut");
XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
- StyledSeriesBuilder.addPoints(series, data.getDiameterCapData(), true);
+ StyledSeriesBuilder.addPoints(series, data.getDiameterCapData(), true, 0.101d);
addAxisSeries(series, YAXIS.W.idx, visible);
}
@@ -243,7 +243,7 @@
logger.debug("BedQuality.doBedDiameterSubLayerOut");
XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
- StyledSeriesBuilder.addPoints(series, data.getDiameterSubData(), true);
+ StyledSeriesBuilder.addPoints(series, data.getDiameterSubData(), true, 0.101d);
addAxisSeries(series, YAXIS.W.idx, visible);
}
@@ -253,7 +253,7 @@
logger.debug("BedQuality.doBedLoadDiameterOut");
XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
- StyledSeriesBuilder.addPoints(series, data.getDiameterData(), true);
+ StyledSeriesBuilder.addPoints(series, data.getDiameterData(), true, 0.101d);
addAxisSeries(series, YAXIS.W.idx, visible);
}
@@ -265,7 +265,7 @@
XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
StyledSeriesBuilder.addPoints(series, data.getPorosityCapData(),
- true);
+ true, 0.101d);
addAxisSeries(series, YAXIS.P.idx, visible);
}
@@ -277,7 +277,7 @@
XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
StyledSeriesBuilder.addPoints(series, data.getPorositySubData(),
- true);
+ true, 0.101d);
addAxisSeries(series, YAXIS.P.idx, visible);
}
@@ -289,7 +289,7 @@
XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
StyledSeriesBuilder.addPoints(series, data.getDensityCapData(),
- true);
+ true, 0.101d);
addAxisSeries(series, YAXIS.D.idx, visible);
}
@@ -301,7 +301,7 @@
XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
StyledSeriesBuilder.addPoints(series, data.getDensitySubData(),
- true);
+ true, 0.101d);
addAxisSeries(series, YAXIS.D.idx, visible);
}
diff -r dd5355775ce1 -r 962f6b805b48 artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffHeightYearProcessor.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffHeightYearProcessor.java Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffHeightYearProcessor.java Wed Aug 07 18:57:29 2013 +0200
@@ -62,7 +62,7 @@
int axidx) {
XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
- StyledSeriesBuilder.addPoints(series, data.getHeightPerYearData(), true);
+ StyledSeriesBuilder.addPoints(series, data.getHeightPerYearData(), false, 0.101d);
generator.addAxisSeries(series, axidx, visible);
}
diff -r dd5355775ce1 -r 962f6b805b48 artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffYearProcessor.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffYearProcessor.java Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/process/BedDiffYearProcessor.java Wed Aug 07 18:57:29 2013 +0200
@@ -71,10 +71,10 @@
XYSeries series = new StyledXYSeries(bundle.getFacetDescription(), attr);
if (idx == 0) {
- StyledSeriesBuilder.addPoints(series, data.getHeights1Data(), true);
+ StyledSeriesBuilder.addPoints(series, data.getHeights1Data(), false, 0.101d);
}
else {
- StyledSeriesBuilder.addPoints(series, data.getHeights2Data(), true);
+ StyledSeriesBuilder.addPoints(series, data.getHeights2Data(), false, 0.101d);
}
generator.addAxisSeries(series, axidx, visible);
diff -r dd5355775ce1 -r 962f6b805b48 artifacts/src/main/resources/datacage-sql/org-h2-driver.properties
--- a/artifacts/src/main/resources/datacage-sql/org-h2-driver.properties Wed Aug 07 18:53:15 2013 +0200
+++ b/artifacts/src/main/resources/datacage-sql/org-h2-driver.properties Wed Aug 07 18:57:29 2013 +0200
@@ -17,7 +17,7 @@
insert.out = INSERT INTO outs (id, artifact_id, name, description, out_type) VALUES (?, ?, ?, ?, ?)
facet.id.nextval = SELECT NEXTVAL('FACETS_ID_SEQ')
insert.facet = INSERT INTO facets (id, out_id, name, num, state, description) VALUES (?, ?, ?, ?, ?, ?)
-update.artifact.state = UPDATE artifacts SET state = ? WHERE gid = ?
+update.artifact.state = UPDATE artifacts SET state = ? WHERE id = ?
update.collection.name = UPDATE collections SET name = ? WHERE gid = ?
delete.artifact.from.collection = DELETE FROM collection_items WHERE collection_id = ? AND artifact_id = ?
More information about the Dive4elements-commits
mailing list