Skip to content

Commit 0e593ef

Browse files
committed
fix unhome menu items enable/disable
Signed-off-by: John Thornton <[email protected]>
1 parent 5245096 commit 0e593ef

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

Diff for: flexgui/src/libflexgui/commands.py

+13-11
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,10 @@ def home(parent):
3333

3434
if f'actionHome_{joint}' in parent.home_controls:
3535
getattr(parent, f'actionHome_{joint}').setEnabled(False)
36-
3736
if f'home_pb_{joint}' in parent.home_controls:
3837
getattr(parent, f'home_pb_{joint}').setEnabled(False)
39-
40-
if f'actionHome_{joint}' in parent.home_controls:
38+
if f'actionUnhome_{joint}' in parent.unhome_controls:
4139
getattr(parent, f'actionUnhome_{joint}').setEnabled(True)
42-
4340
if f'unhome_pb_{joint}' in parent.unhome_controls:
4441
getattr(parent, f'unhome_pb_{joint}').setEnabled(True)
4542

@@ -71,15 +68,20 @@ def unhome(parent):
7168
parent.command.teleop_enable(False)
7269
parent.command.wait_complete()
7370
parent.command.unhome(joint)
74-
getattr(parent, f'unhome_pb_{joint}').setEnabled(False)
75-
if f'home_pb_{joint}' in parent.children:
71+
if f'actionHome_{joint}' in parent.home_controls:
72+
getattr(parent, f'actionHome_{joint}').setEnabled(True)
73+
if f'home_pb_{joint}' in parent.home_controls:
7674
getattr(parent, f'home_pb_{joint}').setEnabled(True)
75+
if f'actionUnhome_{joint}' in parent.unhome_controls:
76+
getattr(parent, f'actionUnhome_{joint}').setEnabled(False)
77+
if f'unhome_pb_{joint}' in parent.unhome_controls:
78+
getattr(parent, f'unhome_pb_{joint}').setEnabled(False)
79+
7780
if utilities.all_unhomed(parent):
78-
if 'unhome_all_pb' in parent.children:
79-
parent.unhome_all_pb.setEnabled(False)
80-
if utilities.home_all_check(parent):
81-
if 'home_all_pb' in parent.children:
82-
parent.home_all_pb.setEnabled(True)
81+
for item in parent.unhome_controls:
82+
getattr(parent, item).setEnabled(False)
83+
for item in parent.home_controls:
84+
getattr(parent, item).setEnabled(True)
8385

8486
def unhome_all(parent):
8587
set_mode(parent, emc.MODE_MANUAL)

0 commit comments

Comments
 (0)