private class MonitorPanel.AirPressureSliderProxy extends MonitorPanel.SliderProxy
Modifier and Type | Field and Description |
---|---|
private java.lang.String[] |
FORECAST
Forecast based on traditional barometer legend.
|
private int |
FORECAST_MAX
Maximum forecast index.
|
private double |
m_const
Units to millibars conversion constant.
|
private int |
m_index
Index into value history.
|
private double |
m_sph
Samples per hour.
|
private double[] |
m_values
Value history (one hour nominal) in configured units.
|
private static double |
MILLIBARS_MAX
Maximum millibars for forecast lookup.
|
private static double |
MILLIBARS_MIN
Minimum millibars for forecast lookup.
|
private double |
MILLIBARS_SCALE
Millibars multiplier to forecast range.
|
private java.lang.String[] |
TREND_RATE
Barometer trend strings.
|
private java.lang.String |
TREND_UNITS
Barometer trend strings.
|
m_decimalFormat, m_multiplier, m_slider
Modifier | Constructor and Description |
---|---|
private |
MonitorPanel.AirPressureSliderProxy(javax.swing.JSlider slider,
java.lang.String config,
java.text.DecimalFormat decimalFormat,
long interval)
Creates a new instance of slider proxy.
|
Modifier and Type | Method and Description |
---|---|
private double |
calculateTrend(double value)
Calculates the barometric rate of change and updates the history.
|
private java.lang.String |
formatToolTip(double value)
Formats the tooltip forecast based on the barometric pressure.
|
protected void |
setValue(java.lang.Number value)
Sets the value on the slider multiplied by the configured constant.
|
private int |
toForecastIndex(double value,
double trend)
Calculates the forecast based on the barometric pressure and rate of
change.
|
private static final double MILLIBARS_MIN
private static final double MILLIBARS_MAX
private final java.lang.String[] FORECAST
private final int FORECAST_MAX
private final double MILLIBARS_SCALE
private final java.lang.String[] TREND_RATE
private final java.lang.String TREND_UNITS
private final double m_const
private double[] m_values
private int m_index
private double m_sph
private MonitorPanel.AirPressureSliderProxy(javax.swing.JSlider slider, java.lang.String config, java.text.DecimalFormat decimalFormat, long interval)
slider
- the slider to control.config
- configuration string.decimalFormat
- for custom numeric output.interval
- sampling interval for the device in milliseconds.protected void setValue(java.lang.Number value)
setValue
in class MonitorPanel.SliderProxy
value
- to set in the configured units.private java.lang.String formatToolTip(double value)
value
- in the configured units.private double calculateTrend(double value)
value
- in the configured units.private int toForecastIndex(double value, double trend)
value
- in the configured units.trend
- rate of change per hour in the configured units.