Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/utils/Formatter.java @ 2702:4c00cf83fff1
Added state, calculation and csv exporter for MINFO flow velociy calculation.
flys-artifacts/trunk@4418 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 16 May 2012 08:37:27 +0000 |
parents | 7dd45896e941 |
children | 2952f6dee5cf |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/utils/Formatter.java Wed May 16 08:21:02 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/utils/Formatter.java Wed May 16 08:37:27 2012 +0000 @@ -48,6 +48,15 @@ public static final int DURATION_D_MAX_DIGITS = 0; + // FLOW VELOCITY FORMATTER CONSTANTS + public static final int FLOW_VELOCITY_KM_MIN_DIGITS = 3; + public static final int FLOW_VELOCITY_KM_MAX_DIGITS = 3; + public static final int FLOW_VELOCITY_VALUES_MIN_DIGITS = 2; + public static final int FLOW_VELOCITY_VALUES_MAX_DIGITS = 2; + public static final int FLOW_VELOCITY_Q_MIN_DIGITS = 0; + public static final int FLOW_VELOCITY_Q_MAX_DIGITS = 2; + + public static NumberFormat getFormatter(CallMeta m, int min, int max){ Locale locale = Resources.getLocale(m); NumberFormat nf = NumberFormat.getInstance(locale); @@ -233,5 +242,29 @@ CALCULATION_REPORT_KM_MIN_DIGITS, CALCULATION_REPORT_KM_MAX_DIGITS); } + + + public static NumberFormat getFlowVelocityKM(CallContext context) { + return getFormatter( + context, + FLOW_VELOCITY_KM_MIN_DIGITS, + FLOW_VELOCITY_KM_MAX_DIGITS); + } + + + public static NumberFormat getFlowVelocityValues(CallContext context) { + return getFormatter( + context, + FLOW_VELOCITY_VALUES_MIN_DIGITS, + FLOW_VELOCITY_VALUES_MAX_DIGITS); + } + + + public static NumberFormat getFlowVelocityQ(CallContext context) { + return getFormatter( + context, + FLOW_VELOCITY_Q_MIN_DIGITS, + FLOW_VELOCITY_Q_MAX_DIGITS); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :