터치 패널 PC 대기 점멸 정리

This commit is contained in:
seo committed 2026-07-30 19:21:14 +09:00
1 parent 6e3c809f22
commit a3e6ea1c89
1 file changed
+10 -3
+10 -3
View File
@@ -244,6 +244,7 @@ class PcWakeButton(StatusTile):
self.last_wake_at = 0.0 self.last_wake_at = 0.0
self.wait_until = 0.0 self.wait_until = 0.0
self.error_until = 0.0 self.error_until = 0.0
self.wait_phase = False
self.blink_timer = QTimer(self) self.blink_timer = QTimer(self)
self.blink_timer.timeout.connect(self.tick_waiting) self.blink_timer.timeout.connect(self.tick_waiting)
self.blink_timer.start(250) self.blink_timer.start(250)
@@ -255,19 +256,25 @@ class PcWakeButton(StatusTile):
self.error_dot.set_steady(now < self.error_until) self.error_dot.set_steady(now < self.error_until)
if online: if online:
self.wait_until = 0.0 self.wait_until = 0.0
self.wait_phase = False
self.write_dot.set_steady(False)
self.detail.setText("켜짐") self.detail.setText("켜짐")
elif now < self.wait_until: elif now < self.wait_until:
remaining = int(self.wait_until - now) remaining = int(self.wait_until - now)
self.detail.setText(f"대기 {remaining}s") self.detail.setText(f"대기 {remaining}s")
else: else:
self.write_dot.set_steady(False)
self.detail.setText("꺼짐") self.detail.setText("꺼짐")
def tick_waiting(self): def tick_waiting(self):
now = time.monotonic() now = time.monotonic()
if not self.online and now < self.wait_until: if not self.online and now < self.wait_until:
self.write_dot.blink() self.wait_phase = not self.wait_phase
self.write_dot.set_steady(self.wait_phase)
if not self.online and self.wait_until > 0 and now >= self.wait_until: if not self.online and self.wait_until > 0 and now >= self.wait_until:
self.wait_until = 0.0 self.wait_until = 0.0
self.wait_phase = False
self.write_dot.set_steady(False)
self.error_until = now + 60 self.error_until = now + 60
self.error_dot.set_steady(True) self.error_dot.set_steady(True)
self.detail.setText("실패") self.detail.setText("실패")
@@ -277,11 +284,12 @@ class PcWakeButton(StatusTile):
def mousePressEvent(self, event): def mousePressEvent(self, event):
if event.button() == Qt.LeftButton: if event.button() == Qt.LeftButton:
self.write_dot.blink()
now = time.monotonic() now = time.monotonic()
if not self.online and now >= self.wait_until: if not self.online and now >= self.wait_until:
self.last_wake_at = now self.last_wake_at = now
self.wait_until = now + 60 self.wait_until = now + 60
self.wait_phase = True
self.write_dot.set_steady(True)
self.error_until = 0.0 self.error_until = 0.0
self.error_dot.set_steady(False) self.error_dot.set_steady(False)
self.detail.setText("깨우는 중") self.detail.setText("깨우는 중")
@@ -292,7 +300,6 @@ class PcWakeButton(StatusTile):
super().mousePressEvent(event) super().mousePressEvent(event)
def tick(self): def tick(self):
self.write_dot.tick()
self.error_dot.tick() self.error_dot.tick()