comparison backend/src/main/java/org/dive4elements/river/importer/ImportBedHeightValue.java @ 9034:8aa7d9eaaa21

Added bed_height_values section heights height01 to height10
author mschaefer
date Mon, 30 Apr 2018 10:13:15 +0200
parents 392bbcd8a88b
children
comparison
equal deleted inserted replaced
9033:384eee4b4135 9034:8aa7d9eaaa21
30 protected Double uncertainty; 30 protected Double uncertainty;
31 protected Double dataGap; 31 protected Double dataGap;
32 protected Double soundingWidth; 32 protected Double soundingWidth;
33 protected Double minHeight; 33 protected Double minHeight;
34 protected Double maxHeight; 34 protected Double maxHeight;
35 protected Double[] sectionHeight;
35 36
36 protected BedHeightValue peer; 37 protected BedHeightValue peer;
37 38
38 39
39 public ImportBedHeightValue(final ImportBedHeight bedHeight, final Double station, final Double height, final Double uncertainty, final Double dataGap, 40 public ImportBedHeightValue(final ImportBedHeight bedHeight, final Double station, final Double height, final Double uncertainty, final Double dataGap,
44 this.uncertainty = uncertainty; 45 this.uncertainty = uncertainty;
45 this.dataGap = dataGap; 46 this.dataGap = dataGap;
46 this.soundingWidth = soundingWidth; 47 this.soundingWidth = soundingWidth;
47 this.minHeight = minHeight; 48 this.minHeight = minHeight;
48 this.maxHeight = maxHeight; 49 this.maxHeight = maxHeight;
50 this.sectionHeight = new Double[10];
49 } 51 }
50 52
53
54 public void setSectionHeight(final int index, final Double value) {
55 this.sectionHeight[index - 1] = value;
56 }
51 57
52 public void storeDependencies(final BedHeight bedHeight) { 58 public void storeDependencies(final BedHeight bedHeight) {
53 getPeer(bedHeight); 59 getPeer(bedHeight);
54 } 60 }
55 61
74 values = query.list(); 80 values = query.list();
75 } 81 }
76 if ((values == null) || values.isEmpty()) { 82 if ((values == null) || values.isEmpty()) {
77 this.peer = new BedHeightValue(bedHeight, this.station, this.height, this.uncertainty, this.dataGap, this.soundingWidth, 83 this.peer = new BedHeightValue(bedHeight, this.station, this.height, this.uncertainty, this.dataGap, this.soundingWidth,
78 this.minHeight, this.maxHeight); 84 this.minHeight, this.maxHeight);
85 for (int i = 1; i <= 10; i++)
86 this.peer.setSectionHeight(i, this.sectionHeight[i - 1]);
79 session.save(this.peer); 87 session.save(this.peer);
80 } else { 88 } else {
81 this.peer = values.get(0); 89 this.peer = values.get(0);
82 } 90 }
83 return this.peer; 91 return this.peer;

http://dive4elements.wald.intevation.org