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:
@@ -941,7 +941,7 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
submsg = msg['Soll']
|
submsg = msg['Soll']
|
||||||
if 'Temp' in submsg:
|
if 'Temp' in submsg:
|
||||||
self.plot_temp_soll = submsg['Temp']
|
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:
|
if self.slider_temp_soll_initial_update:
|
||||||
# blockSignals: setValue() here is just syncing the
|
# blockSignals: setValue() here is just syncing the
|
||||||
# slider's display to the server's current value, not
|
# slider's display to the server's current value, not
|
||||||
@@ -957,7 +957,7 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
for subkey in subsubmsg:
|
for subkey in subsubmsg:
|
||||||
if "Current" in subkey:
|
if "Current" in subkey:
|
||||||
self.plot_rate_soll = subsubmsg['Current']
|
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 "Set" in subkey:
|
||||||
if self.heatrate_soll_initial_update:
|
if self.heatrate_soll_initial_update:
|
||||||
self.heatrate_soll_initial_update = False
|
self.heatrate_soll_initial_update = False
|
||||||
@@ -975,11 +975,11 @@ class Window(QtWidgets.QMainWindow, Ui_MainWindow):
|
|||||||
submsg = msg['Ist']
|
submsg = msg['Ist']
|
||||||
if 'Temp' in submsg:
|
if 'Temp' in submsg:
|
||||||
self.plot_temp_ist = submsg['Temp']
|
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()
|
self._update_step_plates()
|
||||||
if 'Rate' in submsg:
|
if 'Rate' in submsg:
|
||||||
self.plot_rate_ist = submsg['Rate']
|
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):
|
def on_heater_changed(self, msg):
|
||||||
for key in msg:
|
for key in msg:
|
||||||
|
|||||||
+4
-4
@@ -421,7 +421,7 @@ function onTempCtrlChanged(msg) {
|
|||||||
if (key === 'Soll') {
|
if (key === 'Soll') {
|
||||||
const soll = msg.Soll;
|
const soll = msg.Soll;
|
||||||
if ('Temp' in 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) {
|
if (initialTempSollSync) {
|
||||||
document.getElementById('temp-soll').value = Math.round(soll.Temp);
|
document.getElementById('temp-soll').value = Math.round(soll.Temp);
|
||||||
initialTempSollSync = false;
|
initialTempSollSync = false;
|
||||||
@@ -431,7 +431,7 @@ function onTempCtrlChanged(msg) {
|
|||||||
if ('Rate' in soll) {
|
if ('Rate' in soll) {
|
||||||
const rate = soll.Rate;
|
const rate = soll.Rate;
|
||||||
if ('Current' in 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) {
|
if ('Set' in rate && initialHeatrateSync) {
|
||||||
document.getElementById('heatrate-soll').value = rate.Set;
|
document.getElementById('heatrate-soll').value = rate.Set;
|
||||||
@@ -448,11 +448,11 @@ function onTempCtrlChanged(msg) {
|
|||||||
const ist = msg.Ist;
|
const ist = msg.Ist;
|
||||||
if ('Temp' in ist) {
|
if ('Temp' in ist) {
|
||||||
plotTempIst = ist.Temp;
|
plotTempIst = ist.Temp;
|
||||||
document.getElementById('lcd-temp-ist').textContent = ist.Temp;
|
document.getElementById('lcd-temp-ist').textContent = ist.Temp.toFixed(1);
|
||||||
updateStepPlates();
|
updateStepPlates();
|
||||||
}
|
}
|
||||||
if ('Rate' in ist) {
|
if ('Rate' in ist) {
|
||||||
document.getElementById('lcd-rate-ist').textContent = ist.Rate;
|
document.getElementById('lcd-rate-ist').textContent = ist.Rate.toFixed(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user