[PATCH] vergessen
Wald Commits
scm-commit at wald.intevation.org
Wed Aug 29 17:30:16 CEST 2018
# HG changeset patch
# User gernotbelger
# Date 1535556429 -7200
# Node ID da7b5f07303ddabb90f1988006db2b6e464d83fb
# Parent 8d6e56e57c4a5fcc841003eddacd240acc1e5731
vergessen
diff -r 8d6e56e57c4a -r da7b5f07303d artifacts/src/main/java/org/dive4elements/river/artifacts/AbstractFixBunduArtifact.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/AbstractFixBunduArtifact.java Wed Aug 29 17:27:09 2018 +0200
@@ -0,0 +1,59 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts;
+
+import java.io.Serializable;
+
+import org.apache.log4j.Logger;
+import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.river.artifacts.model.CalculationResult;
+import org.dive4elements.river.artifacts.model.WKms;
+import org.dive4elements.river.artifacts.model.fixings.FixRealizingResult;
+import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
+
+/**
+ * The default fixation analysis artifact.
+ *
+ * @author <a href="mailto:raimund.renkert at intevation.de">Raimund Renkert</a>
+ */
+public class AbstractFixBunduArtifact extends D4EArtifact implements WaterLineArtifact {
+
+ private static final long serialVersionUID = 1L;
+
+ /** The log for this class. */
+ private static Logger log = Logger.getLogger(AbstractFixBunduArtifact.class);
+
+ /**
+ * The default constructor.
+ */
+ public AbstractFixBunduArtifact() {
+ log.debug("ctor()");
+ }
+
+ /** Calculate waterlines against a cross section. */
+ @Override
+ public double getWaterLevel(final ComputeType type, final String hash, final String stateId, final double currentKm, final Serializable waterLineIndex,
+ final double nextKm, final double prevKm, final CallContext context) {
+ final FixRealizingResult result = (FixRealizingResult) ((CalculationResult) this.compute(context, ComputeType.ADVANCE, false)).getData();
+
+ final int wstIndex = (Integer) waterLineIndex;
+
+ final WKms wkms = result.getWQKms()[wstIndex];
+
+ // Find W at km.
+ final double wAtKm = StaticWKmsArtifact.getWAtKm(wkms, currentKm);
+
+ if (wAtKm == -1 || Double.isNaN(wAtKm)) {
+ log.warn("Waterlevel at km " + currentKm + " unknown.");
+ return Double.NaN;
+ }
+
+ return wAtKm;
+ }
+}
\ No newline at end of file
diff -r 8d6e56e57c4a -r da7b5f07303d artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java Wed Aug 29 16:57:13 2018 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java Wed Aug 29 17:27:09 2018 +0200
@@ -126,10 +126,7 @@
addStringData(DATA_IS_MASTER, newString);
final StringBuilder builder = new StringBuilder();
builder.append("CrossSectionArtifact line 128 cross_section_id = ").append(cs.getId()).append(" IS_START? : ").append(String.valueOf(isNewest));
- log.info(builder.toString()); // TODO: remove ALL
log.debug(builder.toString());
- log.warn(builder.toString());
-
if (!fs.isEmpty()) {
addFacets(getCurrentStateId(), fs);
}
More information about the Dive4Elements-commits
mailing list