Skip to content

Commit

Permalink
fix issue with calculation of the range on the temp gauges
Browse files Browse the repository at this point in the history
  • Loading branch information
darmbrust committed Jan 18, 2020
1 parent 77513d4 commit 8298f38
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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());
Expand Down

0 comments on commit 8298f38

Please sign in to comment.