Format temperature and rate LCD displays to always show 1 decimal place

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tqxrk8uj4M3w3d3eXm3xK8
This commit is contained in:
2026-06-25 22:26:06 +02:00
co-authored by Claude Sonnet 4.6
parent 0215bac13e
commit 7dd0400278
2 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -941,7 +941,7 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
submsg = msg['Soll']
if 'Temp' in submsg:
self.plot_temp_soll = submsg['Temp']
self.lcdNumber_temp_soll.display(str(submsg['Temp']))
self.lcdNumber_temp_soll.display(f'{submsg["Temp"]:.1f}')
if self.slider_temp_soll_initial_update:
# blockSignals: setValue() here is just syncing the
# slider's display to the server's current value, not
@@ -957,7 +957,7 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
for subkey in subsubmsg:
if "Current" in subkey:
self.plot_rate_soll = subsubmsg['Current']
self.lcdNumber_heatrate_soll.display(str(subsubmsg['Current']))
self.lcdNumber_heatrate_soll.display(f'{subsubmsg["Current"]:.1f}')
if "Set" in subkey:
if self.heatrate_soll_initial_update:
self.heatrate_soll_initial_update = False
@@ -975,11 +975,11 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
submsg = msg['Ist']
if 'Temp' in submsg:
self.plot_temp_ist = submsg['Temp']
self.lcdNumber_temp_ist.display(str(submsg['Temp']))
self.lcdNumber_temp_ist.display(f'{submsg["Temp"]:.1f}')
self._update_step_plates()
if 'Rate' in submsg:
self.plot_rate_ist = submsg['Rate']
self.lcdNumber_heatrate_ist.display(str(submsg['Rate']))
self.lcdNumber_heatrate_ist.display(f'{submsg["Rate"]:.1f}')
def on_heater_changed(self, msg):
for key in msg:
+4 -4
View File
@@ -421,7 +421,7 @@ function onTempCtrlChanged(msg) {
if (key === 'Soll') {
const soll = msg.Soll;
if ('Temp' in soll) {
document.getElementById('lcd-temp-soll').textContent = soll.Temp;
document.getElementById('lcd-temp-soll').textContent = soll.Temp.toFixed(1);
if (initialTempSollSync) {
document.getElementById('temp-soll').value = Math.round(soll.Temp);
initialTempSollSync = false;
@@ -431,7 +431,7 @@ function onTempCtrlChanged(msg) {
if ('Rate' in soll) {
const rate = soll.Rate;
if ('Current' in rate) {
document.getElementById('lcd-rate-soll').textContent = rate.Current;
document.getElementById('lcd-rate-soll').textContent = rate.Current.toFixed(1);
}
if ('Set' in rate && initialHeatrateSync) {
document.getElementById('heatrate-soll').value = rate.Set;
@@ -448,11 +448,11 @@ function onTempCtrlChanged(msg) {
const ist = msg.Ist;
if ('Temp' in ist) {
plotTempIst = ist.Temp;
document.getElementById('lcd-temp-ist').textContent = ist.Temp;
document.getElementById('lcd-temp-ist').textContent = ist.Temp.toFixed(1);
updateStepPlates();
}
if ('Rate' in ist) {
document.getElementById('lcd-rate-ist').textContent = ist.Rate;
document.getElementById('lcd-rate-ist').textContent = ist.Rate.toFixed(1);
}
}
}