annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/MINFOArtifact.java @ 3203:1b9f791937c3

Moved FixationArtifactAccess to new access package. flys-artifacts/trunk@4820 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 28 Jun 2012 08:16:20 +0000
parents 2f922be407ea
children b888c5eb65b3
rev   line source
2693
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.artifacts;
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 import de.intevation.flys.artifacts.model.FacetTypes;
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4
2713
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
5 import de.intevation.flys.artifacts.states.SoundingsSelect;
2693
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 import de.intevation.flys.utils.FLYSUtils;
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8
2713
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
9 import gnu.trove.TIntArrayList;
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
10
2693
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import org.apache.log4j.Logger;
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 /**
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 * The default MINFO artifact.
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15 *
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 */
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 public class MINFOArtifact
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19 extends FLYSArtifact
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 implements FacetTypes {
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22 /** The logger for this class. */
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 private static Logger logger = Logger.getLogger(MINFOArtifact.class);
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 /** The name of the artifact. */
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 public static final String ARTIFACT_NAME = "minfo";
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28 /** XPath */
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29 public static final String XPATH_STATIC_UI ="/art:result/art:ui/art:static";
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 /**
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 * The default constructor.
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 */
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35 public MINFOArtifact() {
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36 }
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 /**
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39 * Returns the name of the concrete artifact.
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 *
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 * @return the name of the concrete artifact.
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 */
3193
2f922be407ea Moved common code of the *Artifacts into FLYSArtifact.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2713
diff changeset
43 @Override
2693
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 public String getName() {
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 return ARTIFACT_NAME;
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 }
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47
2702
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
48 public int[] getMainChannels() {
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
49 String data = getDataAsString("main.channel");
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
50
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
51 if (data == null) {
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
52 logger.warn("No 'main.channel' parameter specified!");
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
53 return null;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
54 }
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
55
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
56 return FLYSUtils.intArrayFromString(data);
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
57 }
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
58
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
59
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
60 public int[] getTotalChannels() {
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
61 String data = getDataAsString("total.channel");
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
62
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
63 if (data == null) {
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
64 logger.warn("No 'total.channel' parameter specified!");
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
65 return null;
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
66 }
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
67
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
68 return FLYSUtils.intArrayFromString(data);
4c00cf83fff1 Added state, calculation and csv exporter for MINFO flow velociy calculation.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2693
diff changeset
69 }
2713
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
70
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
71
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
72 public int[] getBedHeightSingleIDs() {
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
73 String data = getDataAsString("soundings");
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
74
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
75 if (data == null) {
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
76 logger.warn("No 'soundings' parameter specified!");
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
77 return null;
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
78 }
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
79
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
80 String[] parts = data.split(";");
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
81
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
82 TIntArrayList ids = new TIntArrayList();
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
83
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
84 for (String part: parts) {
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
85 if (part.indexOf(SoundingsSelect.PREFIX_SINGLE) >= 0) {
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
86 String tmp = part.replace(SoundingsSelect.PREFIX_SINGLE, "");
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
87
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
88 try {
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
89 ids.add(Integer.parseInt(tmp));
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
90 }
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
91 catch (NumberFormatException nfe) {
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
92 logger.warn("Cannot parse int from string: '" + tmp + "'");
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
93 }
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
94 }
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
95 }
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
96
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
97 return ids.toNativeArray();
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
98 }
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
99
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
100
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
101 public int[] getBedHeightEpochIDs() {
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
102 String data = getDataAsString("soundings");
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
103
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
104 if (data == null) {
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
105 logger.warn("No 'soundings' parameter specified!");
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
106 return null;
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
107 }
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
108
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
109 String[] parts = data.split(";");
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
110
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
111 TIntArrayList ids = new TIntArrayList();
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
112
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
113 for (String part: parts) {
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
114 if (part.indexOf(SoundingsSelect.PREFIX_EPOCH) >= 0) {
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
115 String tmp = part.replace(SoundingsSelect.PREFIX_EPOCH, "");
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
116
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
117 try {
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
118 ids.add(Integer.parseInt(tmp));
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
119 }
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
120 catch (NumberFormatException nfe) {
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
121 logger.warn("Cannot parse int from string: '" + tmp + "'");
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
122 }
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
123 }
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
124 }
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
125
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
126 return ids.toNativeArray();
b60751cfdd6c Start MINFO middle bed height calculation in the relevant state and creates facets for chart and csv.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2702
diff changeset
127 }
2693
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128 }
edaa2297aea3 Started module MINFO (MINFOArtifact, state to choose calculations, configurations).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org