annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/MiddleBedHeightData.java @ 4837:9e25c7523485

Fixed calculation of effective width in MINFO SQ relation. * Get all (including empty datasets) from db. * Filter empty datasets when processing data of the same date. * Added debug outputs.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 23 Jan 2013 11:14:41 +0100
parents 5fced192b95c
children
rev   line source
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:
diff changeset
1 package de.intevation.flys.artifacts.model;
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:
diff changeset
2
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:
diff changeset
3 import java.io.Serializable;
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:
diff changeset
4
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
5 import java.util.ArrayList;
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
6
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:
diff changeset
7 import gnu.trove.TDoubleArrayList;
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:
diff changeset
8
2714
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
9 import de.intevation.artifacts.CallContext;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
10
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
11 import de.intevation.flys.artifacts.resources.Resources;
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
12
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
13 import org.apache.log4j.Logger;
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
14
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:
diff changeset
15
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:
diff changeset
16 public class MiddleBedHeightData implements Serializable {
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:
diff changeset
17
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
18 /** Very private logger. */
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
19 private static final Logger logger = Logger.getLogger(MiddleBedHeightData.class);
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
20
2714
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
21 public static final String I18N_SINGLE_NAME = "facet.bedheight_middle.single";
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
22 public static final String I18N_EPOCH_NAME = "facet.bedheight_middle.epoch";
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
23
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:
diff changeset
24 private int startYear;
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:
diff changeset
25 private int endYear;
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:
diff changeset
26 private String evaluatedBy;
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:
diff changeset
27 private String description;
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:
diff changeset
28
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:
diff changeset
29 private TDoubleArrayList km;
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:
diff changeset
30 private TDoubleArrayList middleHeight;
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:
diff changeset
31 private TDoubleArrayList uncertainty;
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:
diff changeset
32 private TDoubleArrayList soundingWidth;
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:
diff changeset
33 private TDoubleArrayList dataGap;
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:
diff changeset
34 private TDoubleArrayList width;
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
35 private ArrayList empty;
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:
diff changeset
36
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:
diff changeset
37
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:
diff changeset
38 protected MiddleBedHeightData(int start, int end, String eval, String desc) {
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:
diff changeset
39 this.startYear = start;
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:
diff changeset
40 this.endYear = end;
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:
diff changeset
41 this.evaluatedBy = eval;
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:
diff changeset
42 this.description = desc;
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:
diff changeset
43
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:
diff changeset
44 this.km = new TDoubleArrayList();
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:
diff changeset
45 this.middleHeight = new TDoubleArrayList();
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:
diff changeset
46 this.uncertainty = new TDoubleArrayList();
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:
diff changeset
47 this.soundingWidth = new TDoubleArrayList();
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:
diff changeset
48 this.dataGap = new TDoubleArrayList();
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:
diff changeset
49 this.width = new TDoubleArrayList();
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
50 this.empty = new ArrayList();
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
51 }
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
52
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
53 public void addAll(double station, double height, double uncertainty,
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
54 double soundingWidth, double dataGap, double width, boolean isEmpty) {
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
55 addKM(station);
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
56 addMiddleHeight(height);
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
57 addUncertainty(uncertainty);
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
58 addSoundingWidth(soundingWidth);
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
59 addDataGap(dataGap);
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
60 addWidth(width);
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
61 addIsEmpty(isEmpty);
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:
diff changeset
62 }
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:
diff changeset
63
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:
diff changeset
64
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:
diff changeset
65 public int getStartYear() {
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:
diff changeset
66 return startYear;
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:
diff changeset
67 }
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:
diff changeset
68
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:
diff changeset
69 public int getEndYear() {
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:
diff changeset
70 return endYear;
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:
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:
diff changeset
72
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:
diff changeset
73 public String getEvaluatedBy() {
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:
diff changeset
74 return evaluatedBy;
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:
diff changeset
75 }
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:
diff changeset
76
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:
diff changeset
77 public String getDescription() {
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:
diff changeset
78 return description;
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:
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:
diff changeset
80
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:
diff changeset
81
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
82 protected void addKM(double km) {
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:
diff changeset
83 this.km.add(km);
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:
diff changeset
84 }
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:
diff changeset
85
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:
diff changeset
86 public double getKM(int idx) {
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:
diff changeset
87 return km.get(idx);
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:
diff changeset
88 }
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:
diff changeset
89
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
90 protected void addMiddleHeight(double middleHeight) {
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:
diff changeset
91 this.middleHeight.add(middleHeight);
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:
diff changeset
92 }
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:
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:
diff changeset
94 public double getMiddleHeight(int idx) {
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:
diff changeset
95 return middleHeight.get(idx);
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:
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:
diff changeset
97
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
98 protected void addUncertainty(double uncertainty) {
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:
diff changeset
99 this.uncertainty.add(uncertainty);
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:
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:
diff changeset
101
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:
diff changeset
102 public double getUncertainty(int idx) {
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:
diff changeset
103 return uncertainty.get(idx);
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:
diff changeset
104 }
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:
diff changeset
105
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
106 protected void addSoundingWidth(double soundingWidth) {
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:
diff changeset
107 this.soundingWidth.add(soundingWidth);
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:
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:
diff changeset
109
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:
diff changeset
110 public double getSoundingWidth(int idx) {
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:
diff changeset
111 return soundingWidth.get(idx);
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:
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:
diff changeset
113
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
114 protected void addDataGap(double gap) {
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:
diff changeset
115 this.dataGap.add(gap);
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:
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:
diff changeset
117
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:
diff changeset
118 public double getDataGap(int idx) {
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:
diff changeset
119 return dataGap.get(idx);
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:
diff changeset
120 }
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:
diff changeset
121
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
122 protected void addIsEmpty(boolean empty) {
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
123 this.empty.add(empty);
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
124 }
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
125
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
126 public boolean isEmpty(int idx) {
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
127 return (Boolean) empty.get(idx);
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
128 }
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
129
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
130
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
131 protected void addWidth(double width) {
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:
diff changeset
132 this.width.add(width);
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:
diff changeset
133 }
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:
diff changeset
134
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:
diff changeset
135 public double getWidth(int idx) {
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:
diff changeset
136 return width.get(idx);
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:
diff changeset
137 }
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:
diff changeset
138
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:
diff changeset
139 public int size() {
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:
diff changeset
140 return km.size();
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:
diff changeset
141 }
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:
diff changeset
142
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:
diff changeset
143
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
144 /**
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
145 * Get the points, ready to be drawn
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
146 * @return [[km1, km2,...],[height1,height2,...]]
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
147 */
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:
diff changeset
148 public double[][] getMiddleHeightsPoints() {
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:
diff changeset
149 double[][] points = new double[2][size()];
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:
diff changeset
150
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:
diff changeset
151 for (int i = 0, n = size(); i < n; i++) {
3924
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
152 if (isEmpty(i)) {
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
153 points[0][i] = getKM(i);
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
154 points[1][i] = Double.NaN;
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
155 }
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
156 else {
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
157 points[0][i] = getKM(i);
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
158 points[1][i] = getMiddleHeight(i);
5fced192b95c Towards fix of issue863 (gaps in middle heigh bed data).
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 3083
diff changeset
159 }
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:
diff changeset
160 }
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:
diff changeset
161
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:
diff changeset
162 return points;
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:
diff changeset
163 }
2714
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
164
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
165
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
166 public String getSoundingName(CallContext context) {
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
167 if (getStartYear() == getEndYear()) {
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
168 return Resources.getMsg(
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
169 context.getMeta(),
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
170 I18N_SINGLE_NAME,
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
171 I18N_SINGLE_NAME,
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
172 new Object[] { getStartYear() }
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
173 );
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
174 }
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
175 else {
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
176 return Resources.getMsg(
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
177 context.getMeta(),
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
178 I18N_EPOCH_NAME,
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
179 I18N_EPOCH_NAME,
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
180 new Object[] { getStartYear(), getEndYear() }
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
181 );
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
182 }
2952f6dee5cf Added an exporter for middle bed height values.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2713
diff changeset
183 }
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:
diff changeset
184 }
3083
4bd3d8bbb60c Added missing vim lines.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 2714
diff changeset
185 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org