Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java @ 6445:192fbd23d97f
Moved code from ComputedDischargeCurveGenerator to DischargeCurveGenerator.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Wed, 26 Jun 2013 16:45:43 +0200 |
parents | 6d58f5a4c96a |
children | f11165468f0a |
comparison
equal
deleted
inserted
replaced
6444:3681ae5dcfd4 | 6445:192fbd23d97f |
---|---|
62 "chart.discharge.curve.yaxis.label"; | 62 "chart.discharge.curve.yaxis.label"; |
63 | 63 |
64 public static final String I18N_CHART_TITLE_DEFAULT = "Abflusskurven"; | 64 public static final String I18N_CHART_TITLE_DEFAULT = "Abflusskurven"; |
65 public static final String I18N_XAXIS_LABEL_DEFAULT = "Q [m\u00b3/s]"; | 65 public static final String I18N_XAXIS_LABEL_DEFAULT = "Q [m\u00b3/s]"; |
66 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [cm]"; | 66 public static final String I18N_YAXIS_LABEL_DEFAULT = "W [cm]"; |
67 | |
68 | |
69 /** | |
70 * Returns the PNP (Datum) of gauge, if at gauge, 0 otherwise. | |
71 */ | |
72 public static double getCurrentGaugeDatum(double km, D4EArtifact artifact) { | |
73 // Code borrowed from FixATWriter. | |
74 Gauge gauge = RiverUtils.getGauge(artifact); | |
75 double subtractPNP = 0d; | |
76 if (Math.abs(km - gauge.getStation().doubleValue()) < 1e-4) { | |
77 subtractPNP = gauge.getDatum().doubleValue(); | |
78 } | |
79 return subtractPNP; | |
80 } | |
81 | |
82 public double getCurrentGaugeDatum() { | |
83 return getCurrentGaugeDatum(getRange()[0], (D4EArtifact) getMaster()); | |
84 } | |
67 | 85 |
68 | 86 |
69 public DischargeCurveGenerator() { | 87 public DischargeCurveGenerator() { |
70 super(); | 88 super(); |
71 } | 89 } |