터치 패널 온도 조회 주기 조정
This commit is contained in:
1 parent
5d79938a56
commit
95a4750137
2 files changed
+12
-12
No files matched your search
+11
-11
@@ -107,10 +107,11 @@ SAMPLE_INTERVAL_MS = 50
|
||||
GRAPH_SECONDS = 10
|
||||
GRAPH_POINTS = GRAPH_SECONDS * 1000 // SAMPLE_INTERVAL_MS
|
||||
SYNOLOGY_RESTART_INTERVAL_MS = 1000
|
||||
DISK_TEMP_INTERVAL_MS = SAMPLE_INTERVAL_MS
|
||||
TEMP_INTERVAL_MS = 1000
|
||||
DISK_TEMP_INTERVAL_MS = TEMP_INTERVAL_MS
|
||||
RPI_THROTTLE_INTERVAL_MS = SAMPLE_INTERVAL_MS
|
||||
SYNOLOGY_DISK_TEMP_INTERVAL_MS = SAMPLE_INTERVAL_MS
|
||||
SYNOLOGY_HEALTH_INTERVAL_MS = SAMPLE_INTERVAL_MS
|
||||
SYNOLOGY_DISK_TEMP_INTERVAL_MS = TEMP_INTERVAL_MS
|
||||
SYNOLOGY_HEALTH_INTERVAL_MS = TEMP_INTERVAL_MS
|
||||
|
||||
|
||||
def byte_rate_unit(values):
|
||||
@@ -802,7 +803,6 @@ class TouchPanel(QMainWindow):
|
||||
dt = max(0.001, now - self.last_sample) if self.last_sample else 0.001
|
||||
self.last_sample = now
|
||||
|
||||
temp = cpu_temp()
|
||||
rpm = read_int(self.fan["rpm"])
|
||||
pwm = read_int(self.fan["pwm"])
|
||||
enable = read_int(self.fan["enable"], 2)
|
||||
@@ -843,9 +843,9 @@ class TouchPanel(QMainWindow):
|
||||
self.last_net[key] = current
|
||||
|
||||
self.current_rates = rates
|
||||
self.render_status(temp, rpm, pwm, percent, enable, groups, rates, activity, io_read_activity, io_write_activity, disk_error)
|
||||
self.render_status(rpm, pwm, percent, enable, groups, rates, activity, io_read_activity, io_write_activity, disk_error)
|
||||
|
||||
def render_status(self, temp, rpm, pwm, percent, enable, groups, rates, activity, io_read_activity, io_write_activity, disk_error):
|
||||
def render_status(self, rpm, pwm, percent, enable, groups, rates, activity, io_read_activity, io_write_activity, disk_error):
|
||||
disk_temp_text = f"{self.disk_temp:.1f} C" if self.disk_temp is not None else "- C"
|
||||
self.rows["io"].set_state(disk_temp_text, disk_error, io_read_activity, io_write_activity)
|
||||
self.rows["local"].set_state(self.iface_detail(groups["local"], "lo"), activity["local"]["error"], activity["local"]["read"], activity["local"]["write"])
|
||||
@@ -853,10 +853,8 @@ class TouchPanel(QMainWindow):
|
||||
self.rows["lan"].set_state(self.iface_detail(groups["lan"], "eth1"), activity["lan"]["error"], activity["lan"]["read"], activity["lan"]["write"])
|
||||
self.rows["wifi24"].set_state(self.iface_detail(groups["wifi24"], "wlan0"), activity["wifi24"]["error"], activity["wifi24"]["read"], activity["wifi24"]["write"])
|
||||
self.rows["wifi5"].set_state(self.iface_detail(groups["wifi5"], "wlan1"), activity["wifi5"]["error"], activity["wifi5"]["read"], activity["wifi5"]["write"])
|
||||
self.render_rpi_temp(temp)
|
||||
self.render_rpi_fan(rpm)
|
||||
|
||||
self.latest_temp = temp
|
||||
self.latest_rpm = rpm
|
||||
self.latest_pwm = pwm
|
||||
self.latest_percent = percent
|
||||
@@ -864,7 +862,7 @@ class TouchPanel(QMainWindow):
|
||||
|
||||
def update_dashboard(self):
|
||||
rpm = getattr(self, "latest_rpm", read_int(self.fan["rpm"]))
|
||||
temp = getattr(self, "latest_temp", cpu_temp())
|
||||
temp = getattr(self, "latest_temp", 0.0)
|
||||
pwm = getattr(self, "latest_pwm", read_int(self.fan["pwm"]))
|
||||
percent = getattr(self, "latest_percent", pwm / 255 * 100 if pwm > 0 else 0)
|
||||
mem_percent = memory_percent()
|
||||
@@ -968,6 +966,8 @@ class TouchPanel(QMainWindow):
|
||||
self.rows["rpi_throttle"].set_state("OK", read_steady=True, write_steady=False, error_steady=False)
|
||||
|
||||
def update_disk_temp(self):
|
||||
self.latest_temp = cpu_temp()
|
||||
self.render_rpi_temp(self.latest_temp)
|
||||
if self.disk_temp_proc.state() != QProcess.NotRunning:
|
||||
return
|
||||
self.disk_temp_proc.start("/usr/bin/sudo", ["-n", "/usr/sbin/smartctl", "-A", "-d", "sntasmedia", "/dev/sda"])
|
||||
@@ -981,7 +981,7 @@ class TouchPanel(QMainWindow):
|
||||
for part in parts:
|
||||
if part.isdigit():
|
||||
self.disk_temp = float(part)
|
||||
self.render_rpi_temp(getattr(self, "latest_temp", cpu_temp()))
|
||||
self.render_rpi_temp(getattr(self, "latest_temp", 0.0))
|
||||
return
|
||||
|
||||
def update_synology_status(self):
|
||||
@@ -1159,7 +1159,7 @@ class TouchPanel(QMainWindow):
|
||||
self.rows[key].set_state(self.drop_detail(drops, detail), error_activity, read_activity, write_activity)
|
||||
|
||||
def update_graphs(self):
|
||||
temp = getattr(self, "latest_temp", cpu_temp())
|
||||
temp = getattr(self, "latest_temp", 0.0)
|
||||
rpm = getattr(self, "latest_rpm", read_int(self.fan["rpm"]))
|
||||
self.temp_history.append(temp)
|
||||
self.rpm_history.append(rpm)
|
||||
|
||||
Reference in new issue
Block a user