@@ -33,13 +33,10 @@ def home(parent):
33
33
34
34
if f'actionHome_{ joint } ' in parent .home_controls :
35
35
getattr (parent , f'actionHome_{ joint } ' ).setEnabled (False )
36
-
37
36
if f'home_pb_{ joint } ' in parent .home_controls :
38
37
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 :
41
39
getattr (parent , f'actionUnhome_{ joint } ' ).setEnabled (True )
42
-
43
40
if f'unhome_pb_{ joint } ' in parent .unhome_controls :
44
41
getattr (parent , f'unhome_pb_{ joint } ' ).setEnabled (True )
45
42
@@ -71,15 +68,20 @@ def unhome(parent):
71
68
parent .command .teleop_enable (False )
72
69
parent .command .wait_complete ()
73
70
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 :
76
74
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
+
77
80
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 )
83
85
84
86
def unhome_all (parent ):
85
87
set_mode (parent , emc .MODE_MANUAL )
0 commit comments