comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/predefinedtkh/PredefinedTkhFacet.java @ 9033:384eee4b4135

Added datacage select and chart display for flow depth evolution series loaded from database, and a correction for the tkh data
author mschaefer
date Fri, 27 Apr 2018 17:41:59 +0200
parents 6e5ff436febe
children a4121ec450d6
comparison
equal deleted inserted replaced
9032:1f63e9d3b0ec 9033:384eee4b4135
66 66
67 final Collection<ResultRow> rows = new ArrayList<>(); 67 final Collection<ResultRow> rows = new ArrayList<>();
68 SoilKind bedMobility = SoilKind.mobil; 68 SoilKind bedMobility = SoilKind.mobil;
69 for (final TkhValue tkhValue : tkhValues) { 69 for (final TkhValue tkhValue : tkhValues) {
70 final ResultRow row = ResultRow.create(); 70 final ResultRow row = ResultRow.create();
71 row.putValue(GeneralResultType.station, tkhValue.getStation().doubleValue()); 71 row.putValue(GeneralResultType.station, tkhValue.getStation());
72 if (soilKindFinder != null) 72 if (soilKindFinder != null) {
73 bedMobility = soilKindFinder.findSoilKind(tkhValue.getStation().doubleValue()); 73 bedMobility = soilKindFinder.findSoilKind(tkhValue.getStation().doubleValue());
74 row.putValue(SInfoResultType.soilkind, bedMobility); 74 row.putValue(SInfoResultType.soilkind, bedMobility);
75 final double tkh = tkhValue(tkhValue.getTkheight()) * 100;
76 row.putValue(SInfoResultType.tkh, tkh);
77 switch (bedMobility) {
78 case starr:
79 row.putValue(SInfoResultType.tkhup, tkh);
80 row.putValue(SInfoResultType.tkhdown, 0.0);
81 break;
82 case mobil:
83 default:
84 row.putValue(SInfoResultType.tkhup, tkh / 2);
85 row.putValue(SInfoResultType.tkhdown, -tkh / 2);
86 break;
87 } 75 }
76 else
77 row.putValue(SInfoResultType.soilkind, null);
78 row.putValue(SInfoResultType.tkh, tkhValue.getTkhCm());
79 row.putValue(SInfoResultType.tkhup, tkhValue.getTkhUpCm(bedMobility == SoilKind.mobil));
80 row.putValue(SInfoResultType.tkhdown, tkhValue.getTkhDownCm(bedMobility == SoilKind.mobil));
88 rows.add(row); 81 rows.add(row);
89 } 82 }
90 return new PredefinedTkhQueryCalculationResult(series.getName(), rows); 83 return new PredefinedTkhQueryCalculationResult(series.getName(), rows);
91 }
92
93 private double tkhValue(final Double value) {
94 if (value != null)
95 return value.doubleValue();
96 else
97 return Double.NaN;
98 } 84 }
99 85
100 /** 86 /**
101 * Create a deep copy of this Facet. 87 * Create a deep copy of this Facet.
102 * 88 *

http://dive4elements.wald.intevation.org