Skip to content

Commit fcfeffc

Browse files
committed
add home_no_unhome_option to action button
1 parent 9559514 commit fcfeffc

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

lib/python/qtvcp/widgets/action_button.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def __init__(self, parent=None):
107107
self.exit = False
108108
self.template_label = False
109109
self.lathe_mirror_x = False
110-
110+
self.home_no_unhome = False
111111
self.toggle_float = False
112112
self._toggle_state = 0
113113
self.joint = -1
@@ -473,15 +473,19 @@ def action(self, state=None):
473473
if state:
474474
ACTION.SET_MACHINE_HOMING(self.joint)
475475
else:
476-
ACTION.SET_MACHINE_UNHOMED(self.joint)
476+
if not self.home_no_unhome:
477+
ACTION.SET_MACHINE_UNHOMED(self.joint)
477478
else:
478479
if self.joint == -1:
479480
if STATUS.is_all_homed():
480-
ACTION.SET_MACHINE_UNHOMED(-1)
481+
if not self.home_no_unhome:
482+
ACTION.SET_MACHINE_UNHOMED(-1)
481483
else:
482484
ACTION.SET_MACHINE_HOMING(-1)
483485
elif STATUS.is_joint_homed(self.joint):
484-
ACTION.SET_MACHINE_UNHOMED(self.joint)
486+
if not self.home_no_unhome:
487+
ACTION.SET_MACHINE_UNHOMED(self.joint)
488+
pass
485489
else:
486490
ACTION.SET_MACHINE_HOMING(self.joint)
487491
elif self.unhome:
@@ -1422,6 +1426,14 @@ def get_lathe_mirror_x(self):
14221426
def reset_lathe_mirror_x(self):
14231427
self.lathe_mirror_x = False
14241428

1429+
def set_home_no_unhome(self, data):
1430+
self.home_no_unhome = data
1431+
def get_home_no_unhome(self):
1432+
return self.home_no_unhome
1433+
def reset_home_no_unhome(self):
1434+
self.home_no_unhome = False
1435+
1436+
14251437
# NON BOOL VARIABLES------------------
14261438
def set_incr_imperial(self, data):
14271439
self.jog_incr_imperial = data
@@ -1567,6 +1579,9 @@ def reset_ini_mdi_key(self):
15671579
machine_log_dialog_action = QtCore.pyqtProperty(bool, get_machine_log_dialog, set_machine_log_dialog, reset_machine_log_dialog)
15681580
lathe_mirror_x_action = QtCore.pyqtProperty(bool, get_lathe_mirror_x, set_lathe_mirror_x, reset_lathe_mirror_x)
15691581

1582+
1583+
home_no_unhome_option = QtCore.pyqtProperty(bool, get_home_no_unhome, set_home_no_unhome, reset_home_no_unhome)
1584+
15701585
def set_template_label(self, data):
15711586
self.template_label = data
15721587
def get_template_label(self):
@@ -1575,6 +1590,7 @@ def reset_template_label(self):
15751590
self.template_label = False
15761591
template_label_option = QtCore.pyqtProperty(bool, get_template_label, set_template_label, reset_template_label)
15771592

1593+
15781594
# NON BOOL
15791595
joint_number = QtCore.pyqtProperty(int, get_joint, set_joint, reset_joint)
15801596
axis_letter = QtCore.pyqtProperty(str, get_axis, set_axis, reset_axis)

0 commit comments

Comments
 (0)