annotate artifacts/src/main/java/org/dive4elements/river/artifacts/bundu/bezugswst/BunduMinfoArtifactWrapper.java @ 9636:ac41551a8e4d

Bundu/Bzws: Error message for missing channel/year, Nachtrag Pos. 20: import of two levels of infrastructure types
author mschaefer
date Mon, 11 Nov 2019 16:29:36 +0100
parents 7e1fb8d0cb0d
children
rev   line source
9450
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
2 * Software engineering by
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
3 * Björnsen Beratende Ingenieure GmbH
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
5 *
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
6 * This file is Free Software under the GNU AGPL (>=v3)
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
8 * documentation coming with Dive4Elements River for details.
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
9 */
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
10 package org.dive4elements.river.artifacts.bundu.bezugswst;
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
11
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
12 import java.util.Collection;
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
13 import java.util.Date;
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
14
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
15 import org.dive4elements.artifactdatabase.data.DefaultStateData;
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
16 import org.dive4elements.artifactdatabase.data.StateData;
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
17 import org.dive4elements.river.artifacts.D4EArtifact;
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
18
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
19 /**
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
20 * Wrapper around an (bundu) artifact to be extended and used for calculations that expect a MinfoArtifact
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
21 * (BedQualityCalculation)
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
22 *
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
23 * @author Matthias Schäfer
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
24 */
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
25 public final class BunduMinfoArtifactWrapper extends D4EArtifact {
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
26
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
27 private static final long serialVersionUID = 1L;
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
28
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
29 public BunduMinfoArtifactWrapper(final D4EArtifact dataSource, final Date startDay, final Date endDay) {
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
30
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
31 final Collection<StateData> allData = dataSource.getAllData();
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
32 for (final StateData stateData : allData) {
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
33
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
34 final DefaultStateData clonedData = new DefaultStateData();
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
35 clonedData.set(stateData);
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
36
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
37 addData(clonedData.getName(), clonedData);
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
38 }
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
39
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
40 addStringData("calculation_mode", "calc.bed.quality");
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
41 addStringData("bed_diameter", "d50"); // REMARK we don't need any calculation for d50 but the BedQualityCalculation must have at least one diameter
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
42 addStringData("periods", Long.toString(startDay.getTime()) + "," + Long.toString(endDay.getTime()));
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
43 }
7e1fb8d0cb0d Bundu bzws calculation nearly completed, some corrections with csv output, started with linking the minfo density calculation
mschaefer
parents:
diff changeset
44 }

http://dive4elements.wald.intevation.org