Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/VelocityProcessor.java @ 9600:bf79a865f6df
Dont interpolate results in chart of flow depth developement.
author | gernotbelger |
---|---|
date | Tue, 12 Feb 2019 12:03:49 +0100 |
parents | 08f46ccd37ba |
children |
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 | |
9203 | 16 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; |
8940 | 17 import org.dive4elements.artifactdatabase.state.Facet; |
18 import org.dive4elements.artifacts.CallContext; | |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8980
diff
changeset
|
19 import org.dive4elements.river.artifacts.common.AbstractCalculationResult; |
9347 | 20 import org.dive4elements.river.artifacts.common.AbstractProcessor; |
9203 | 21 import org.dive4elements.river.exports.DiagramGenerator; |
22 import org.dive4elements.river.themes.ThemeDocument; | |
8940 | 23 |
9347 | 24 public final class VelocityProcessor extends AbstractProcessor { |
8940 | 25 |
8980
b194fa64506a
SINFO - show results themes according to spec, either raw data or floating mean values.
gernotbelger
parents:
8956
diff
changeset
|
26 public static final String FACET_TKH_VELOCITY_FILTERED = "sinfo_facet_velocity"; |
8940 | 27 |
8941
a9950a3a71e5
SINFO - tkh, configured result facets and themes
gernotbelger
parents:
8940
diff
changeset
|
28 private static final String I18N_AXIS_LABEL = "sinfo.chart.tkh_velocity.section.yaxis.label"; |
8940 | 29 |
8941
a9950a3a71e5
SINFO - tkh, configured result facets and themes
gernotbelger
parents:
8940
diff
changeset
|
30 private static final String SINFO_CHART_VELOCITY_YAXIS_LABEL = "sinfo.chart.tkh_velocity.yaxis.label"; |
8940 | 31 |
8980
b194fa64506a
SINFO - show results themes according to spec, either raw data or floating mean values.
gernotbelger
parents:
8956
diff
changeset
|
32 private static final String I18N_FACET_TKH_VELOCITY_FILTERED_DESCRIPTION = "sinfo.facet.tkh_velocity.description"; |
8940 | 33 |
34 private static final Set<String> HANDLED_FACET_TYPES = new HashSet<>(); | |
35 | |
36 static { | |
37 HANDLED_FACET_TYPES.add(FACET_TKH_VELOCITY_FILTERED); | |
38 } | |
39 | |
40 public VelocityProcessor() { | |
41 super(I18N_AXIS_LABEL, HANDLED_FACET_TYPES); | |
42 } | |
43 | |
9203 | 44 protected SInfoResultType doGetType(final String facetName) { |
8940 | 45 |
46 if (FACET_TKH_VELOCITY_FILTERED.contentEquals(facetName)) | |
9203 | 47 return SInfoResultType.velocity; |
8940 | 48 |
49 final String error = String.format("Unknown facet name: %s", facetName); | |
50 throw new UnsupportedOperationException(error); | |
51 } | |
52 | |
9150
23945061daec
gigantic refactoring: exporter, result, results
gernotbelger
parents:
8980
diff
changeset
|
53 public static Facet createVelocityFacet(final CallContext context, final String hash, final String id, final AbstractCalculationResult result, |
8940 | 54 final int index) { |
9347 | 55 return AbstractProcessor.createFacet(context, hash, id, result, index, SINFO_CHART_VELOCITY_YAXIS_LABEL, FACET_TKH_VELOCITY_FILTERED, |
8956 | 56 I18N_FACET_TKH_VELOCITY_FILTERED_DESCRIPTION); |
8940 | 57 } |
9203 | 58 |
59 @Override | |
60 protected String generateSeries(final DiagramGenerator generator, final ArtifactAndFacet bundle, final ThemeDocument theme, final boolean visible) { | |
61 // TODO Auto-generated method stub | |
62 return buildSeriesForType(generator, bundle, theme, visible, doGetType(bundle.getFacetName()), GAP_DISTANCE); | |
63 } | |
8940 | 64 } |