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:
Code:
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?