@@ -93,9 +93,9 @@ def __init__(self, context):
93
93
path = get_package_share_directory ("rqt_controller_manager" )
94
94
self ._icons = {
95
95
"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" ),
99
99
}
100
100
101
101
# Controllers display
@@ -229,10 +229,10 @@ def _on_ctrl_menu(self, pos):
229
229
menu = QMenu (self ._widget .ctrl_table_view )
230
230
if ctrl .state == "active" :
231
231
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" )
233
233
elif ctrl .state == "inactive" :
234
234
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 " )
236
236
elif ctrl .state == "unconfigured" :
237
237
action_configure = menu .addAction (self ._icons ["inactive" ], "Configure" )
238
238
action_spawn = menu .addAction (self ._icons ["active" ], "Configure and Activate" )
@@ -251,11 +251,13 @@ def _on_ctrl_menu(self, pos):
251
251
elif action is action_kill :
252
252
self ._deactivate_controller (ctrl .name )
253
253
unload_controller (self ._node , self ._cm_name , ctrl .name )
254
- elif ctrl .state in ( "finalized" , " inactive") :
254
+ elif ctrl .state == " inactive" :
255
255
if action is action_activate :
256
256
self ._activate_controller (ctrl .name )
257
- elif action is action_unload :
257
+ elif action is action_cleanup :
258
+ # TODO: use cleanup service once available
258
259
unload_controller (self ._node , self ._cm_name , ctrl .name )
260
+ load_controller (self ._node , self ._cm_name , ctrl .name )
259
261
elif ctrl .state == "unconfigured" :
260
262
if action is action_configure :
261
263
configure_controller (self ._node , self ._cm_name , ctrl .name )
@@ -358,7 +360,7 @@ def _on_hw_menu(self, pos):
358
360
menu = QMenu (self ._widget .hw_table_view )
359
361
if hw_component .state .label == "active" :
360
362
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" )
362
364
elif hw_component .state .label == "inactive" :
363
365
action_activate = menu .addAction (self ._icons ["active" ], "Activate" )
364
366
action_cleanup = menu .addAction (self ._icons ["unconfigured" ], "Cleanup" )
@@ -514,10 +516,11 @@ def data(self, index, role):
514
516
if index .column () == 0 :
515
517
return ctrl .name
516
518
elif index .column () == 1 :
517
- return ctrl .state or "not loaded "
519
+ return ctrl .state or "unloaded "
518
520
519
521
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 )
521
524
522
525
if role == Qt .FontRole and index .column () == 0 :
523
526
bf = QFont ()
@@ -565,7 +568,7 @@ def data(self, index, role):
565
568
if index .column () == 0 :
566
569
return hw_component .name
567
570
elif index .column () == 1 :
568
- return hw_component .state .label or "not loaded "
571
+ return hw_component .state .label or "unloaded "
569
572
570
573
if role == Qt .DecorationRole and index .column () == 0 :
571
574
return self ._icons .get (hw_component .state .label )
0 commit comments