Skip to content

Commit c0bd909

Browse files
authored
Update rqt_controller_manager controller state color scheme to match list_controllers color scheme (#2143)
1 parent fe95a9a commit c0bd909

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed
40.3 KB
Loading
4.21 KB
Loading
-4.14 KB
Binary file not shown.
4.09 KB
Loading

rqt_controller_manager/rqt_controller_manager/controller_manager.py

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ def __init__(self, context):
9393
path = get_package_share_directory("rqt_controller_manager")
9494
self._icons = {
9595
"active": QIcon(f"{path}/resource/led_green.png"),
96-
"finalized": QIcon(f"{path}/resource/led_off.png"),
97-
"inactive": QIcon(f"{path}/resource/led_red.png"),
98-
"unconfigured": QIcon(f"{path}/resource/led_off.png"),
96+
"inactive": QIcon(f"{path}/resource/led_cyan.png"),
97+
"unconfigured": QIcon(f"{path}/resource/led_yellow.png"),
98+
"unloaded": QIcon(f"{path}/resource/led_off.png"),
9999
}
100100

101101
# Controllers display
@@ -229,10 +229,10 @@ def _on_ctrl_menu(self, pos):
229229
menu = QMenu(self._widget.ctrl_table_view)
230230
if ctrl.state == "active":
231231
action_deactivate = menu.addAction(self._icons["inactive"], "Deactivate")
232-
action_kill = menu.addAction(self._icons["finalized"], "Deactivate and Unload")
232+
action_kill = menu.addAction(self._icons["unloaded"], "Deactivate and Unload")
233233
elif ctrl.state == "inactive":
234234
action_activate = menu.addAction(self._icons["active"], "Activate")
235-
action_unload = menu.addAction(self._icons["unconfigured"], "Unload")
235+
action_cleanup = menu.addAction(self._icons["unconfigured"], "Cleanup")
236236
elif ctrl.state == "unconfigured":
237237
action_configure = menu.addAction(self._icons["inactive"], "Configure")
238238
action_spawn = menu.addAction(self._icons["active"], "Configure and Activate")
@@ -251,11 +251,13 @@ def _on_ctrl_menu(self, pos):
251251
elif action is action_kill:
252252
self._deactivate_controller(ctrl.name)
253253
unload_controller(self._node, self._cm_name, ctrl.name)
254-
elif ctrl.state in ("finalized", "inactive"):
254+
elif ctrl.state == "inactive":
255255
if action is action_activate:
256256
self._activate_controller(ctrl.name)
257-
elif action is action_unload:
257+
elif action is action_cleanup:
258+
# TODO: use cleanup service once available
258259
unload_controller(self._node, self._cm_name, ctrl.name)
260+
load_controller(self._node, self._cm_name, ctrl.name)
259261
elif ctrl.state == "unconfigured":
260262
if action is action_configure:
261263
configure_controller(self._node, self._cm_name, ctrl.name)
@@ -358,7 +360,7 @@ def _on_hw_menu(self, pos):
358360
menu = QMenu(self._widget.hw_table_view)
359361
if hw_component.state.label == "active":
360362
action_deactivate = menu.addAction(self._icons["inactive"], "Deactivate")
361-
action_cleanup = menu.addAction(self._icons["finalized"], "Deactivate and Cleanup")
363+
action_cleanup = menu.addAction(self._icons["unconfigured"], "Deactivate and Cleanup")
362364
elif hw_component.state.label == "inactive":
363365
action_activate = menu.addAction(self._icons["active"], "Activate")
364366
action_cleanup = menu.addAction(self._icons["unconfigured"], "Cleanup")
@@ -514,10 +516,11 @@ def data(self, index, role):
514516
if index.column() == 0:
515517
return ctrl.name
516518
elif index.column() == 1:
517-
return ctrl.state or "not loaded"
519+
return ctrl.state or "unloaded"
518520

519521
if role == Qt.DecorationRole and index.column() == 0:
520-
return self._icons.get(ctrl.state)
522+
state_key = ctrl.state if ctrl.state else "unloaded"
523+
return self._icons.get(state_key)
521524

522525
if role == Qt.FontRole and index.column() == 0:
523526
bf = QFont()
@@ -565,7 +568,7 @@ def data(self, index, role):
565568
if index.column() == 0:
566569
return hw_component.name
567570
elif index.column() == 1:
568-
return hw_component.state.label or "not loaded"
571+
return hw_component.state.label or "unloaded"
569572

570573
if role == Qt.DecorationRole and index.column() == 0:
571574
return self._icons.get(hw_component.state.label)

0 commit comments

Comments
 (0)