Skip to content

Commit

Permalink
Disable buttons and enable reset button in MonitorClient class
Browse files Browse the repository at this point in the history
  • Loading branch information
JonneSaloranta committed Mar 20, 2024
1 parent c47e078 commit 21f30ac
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,10 @@ def emergency_stop(self):
self.socketclient.send_message("Emergency")
self.state = State.EMERGENCY_STOPPED

self.start_button.config(state="normal")
self.stop_button.config(state="normal")
self.start_button.config(state="disabled")
self.stop_button.config(state="disabled")
self.emergency_button.config(state="disabled")
self.reset_button.config(state="normal")

def start(self):
self.status_label.config(text=f"{self.labels.get('status_label')}: {State.RUNNING.name}")
Expand All @@ -257,6 +258,7 @@ def start(self):
self.start_button.config(state="disabled")
self.stop_button.config(state="normal")
self.emergency_button.config(state="normal")
self.reset_button.config(state="normal")

def stop(self):
self.status_label.config(text=f"{self.labels.get('status_label')}: {State.STOPPED.name}")
Expand All @@ -266,15 +268,17 @@ def stop(self):
self.start_button.config(state="normal")
self.stop_button.config(state="disabled")
self.emergency_button.config(state="normal")
self.emergency_button.config(state="normal")

def reset(self):
self.status_label.config(text=f"{self.labels.get('status_label')}: {State.IDLE.name}")
self.socketclient.send_message("Reset")
self.state = State.IDLE

self.start_button.config(state="normal")
self.stop_button.config(state="disabled")
self.emergency_button.config(state="disabled")
self.stop_button.config(state="normal")
self.emergency_button.config(state="normal")
self.reset_button.config(state="normal")

def set_screen_blank(self):
blank_image = Image.new('RGB', (640, 480), (0, 0, 0))
Expand Down

0 comments on commit 21f30ac

Please sign in to comment.