From 8298f389a446cf61e0d5825309c2a91287a395da Mon Sep 17 00:00:00 2001 From: darmbrust Date: Sat, 18 Jan 2020 09:21:28 -0600 Subject: [PATCH] fix issue with calculation of the range on the temp gauges --- .../weatherlink/gui/WeatherLinkLiveGUIController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/sagebits/weatherlink/gui/WeatherLinkLiveGUIController.java b/src/main/java/net/sagebits/weatherlink/gui/WeatherLinkLiveGUIController.java index d4817d1..02201be 100644 --- a/src/main/java/net/sagebits/weatherlink/gui/WeatherLinkLiveGUIController.java +++ b/src/main/java/net/sagebits/weatherlink/gui/WeatherLinkLiveGUIController.java @@ -714,7 +714,7 @@ private Gauge buildTempGauge(String wllDeviceId, String sensorId, String title, double current = temp.asDouble().get(); return Math.round(Math.max( Math.max((heatIndexM == null ? current : heatIndexM.getValue()), (tempHeatWindM == null ? current : tempHeatWindM.getValue())), - Math.min(110.0, current + 20.0))); + Math.min(110.0, Math.max(current, mMax.getValue()) + 20.0))); }; //The lowest the guage needs to go @@ -723,7 +723,7 @@ private Gauge buildTempGauge(String wllDeviceId, String sensorId, String title, double current = temp.asDouble().get(); return Math.round(Math.min( Math.min((dewPointM == null ? current : dewPointM.getValue()),(windChillM == null ? current : windChillM.getValue())), - Math.max(-40.0, current - 20.0))); + Math.max(-40.0, Math.min(current, mMin.getValue()) - 20.0))); }; gauge.setMinValue(minCalc.getAsDouble());