Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/VelocityProcessor.java @ 9016:6e5ff436febe
Added datacage select and chart display for TKH series loaded from database
author | mschaefer |
---|---|
date | Mon, 23 Apr 2018 15:18:48 +0200 |
parents | b194fa64506a |
children | 23945061daec |
rev | line source |
---|---|
8940 | 1 /* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 | |
11 package org.dive4elements.river.artifacts.sinfo.common; | |
12 | |
13 import java.util.HashSet; | |
14 import java.util.Set; | |
15 | |
16 import org.dive4elements.artifactdatabase.state.Facet; | |
17 import org.dive4elements.artifacts.CallContext; | |
18 | |
8948 | 19 public final class VelocityProcessor extends AbstractSInfoLineProcessor<AbstractTkhCalculationResult> { |
8940 | 20 |
8980
b194fa64506a
SINFO - show results themes according to spec, either raw data or floating mean values.
gernotbelger
parents:
8956
diff
changeset
|
21 public static final String FACET_TKH_VELOCITY_FILTERED = "sinfo_facet_velocity"; |
8940 | 22 |
8941
a9950a3a71e5
SINFO - tkh, configured result facets and themes
gernotbelger
parents:
8940
diff
changeset
|
23 private static final String I18N_AXIS_LABEL = "sinfo.chart.tkh_velocity.section.yaxis.label"; |
8940 | 24 |
8941
a9950a3a71e5
SINFO - tkh, configured result facets and themes
gernotbelger
parents:
8940
diff
changeset
|
25 private static final String SINFO_CHART_VELOCITY_YAXIS_LABEL = "sinfo.chart.tkh_velocity.yaxis.label"; |
8940 | 26 |
8980
b194fa64506a
SINFO - show results themes according to spec, either raw data or floating mean values.
gernotbelger
parents:
8956
diff
changeset
|
27 private static final String I18N_FACET_TKH_VELOCITY_FILTERED_DESCRIPTION = "sinfo.facet.tkh_velocity.description"; |
8940 | 28 |
29 private static final Set<String> HANDLED_FACET_TYPES = new HashSet<>(); | |
30 | |
31 static { | |
32 HANDLED_FACET_TYPES.add(FACET_TKH_VELOCITY_FILTERED); | |
33 } | |
34 | |
35 public VelocityProcessor() { | |
36 super(I18N_AXIS_LABEL, HANDLED_FACET_TYPES); | |
37 } | |
38 | |
39 @Override | |
8948 | 40 protected double[][] doGetPoints(final AbstractTkhCalculationResult data, final String facetName) { |
8940 | 41 |
42 if (FACET_TKH_VELOCITY_FILTERED.contentEquals(facetName)) | |
8948 | 43 return data.getStationPoints(SInfoResultType.velocity); |
8940 | 44 |
45 final String error = String.format("Unknown facet name: %s", facetName); | |
46 throw new UnsupportedOperationException(error); | |
47 } | |
48 | |
8948 | 49 public static Facet createVelocityFacet(final CallContext context, final String hash, final String id, final AbstractSInfoCalculationResult result, |
8940 | 50 final int index) { |
8956 | 51 return AbstractSInfoLineProcessor.createFacet(context, hash, id, result, index, SINFO_CHART_VELOCITY_YAXIS_LABEL, FACET_TKH_VELOCITY_FILTERED, |
52 I18N_FACET_TKH_VELOCITY_FILTERED_DESCRIPTION); | |
8940 | 53 } |
54 } |