qtdragon mod
- Mr. Mass
-
Topic Author
- Offline
- Senior Member
-
Less
More
- Posts: 57
- Thank you received: 36
23 Nov 2025 12:36 #339047
by Mr. Mass
Replied by Mr. Mass on topic qtdragon mod
Thanks for the explanation, it really helped. I made indicators for e-stop, on/off, manual mode, and MDI. There was a slight issue with auto mode. I wanted to make indicators for auto mode, running programs, and pause. This is the only way I could do it:
Is this ok, or is there a more elegant way?
STATUS.connect("interp-run",lambda w: self.set_auto_led())
STATUS.connect("interp-paused",lambda w: self.set_auto_led())
STATUS.connect("interp-idle",lambda w: self.set_auto_led())
STATUS.connect("interp-waiting",lambda w: self.set_auto_led())
def set_auto_led(self):
c = ""
if STATUS.is_auto_running() and STATUS.is_auto_mode() and not STATUS.is_auto_paused():
c = "blue"
self.set_led_color(c)
elif STATUS.is_auto_paused() and STATUS.is_auto_mode():
c = "aquamarine"
self.set_led_color(c)
elif STATUS.is_auto_mode():
c = "green_dark"
self.set_led_color(c)
def set_led_color(self, color):
print(color, self.LED_color[color])
self.h["led-red"] = self.LED_color[color][0]
self.h["led-green"] = self.LED_color[color][1]
self.h["led-blue"] = self.LED_color[color][2]Is this ok, or is there a more elegant way?
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.069 seconds