|
40 | 40 | LOG = logger.getLogger(__name__) |
41 | 41 |
|
42 | 42 | # Force the log level for this module |
43 | | -# LOG.setLevel(logger.INFO) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL |
| 43 | +LOG.setLevel(logger.DEBUG) # One of DEBUG, INFO, WARNING, ERROR, CRITICAL |
44 | 44 |
|
45 | 45 | class ActionButton(IndicatedPushButton): |
46 | 46 | def __init__(self, parent=None): |
47 | 47 | super(ActionButton, self).__init__(parent) |
48 | 48 | self._block_signal = False |
49 | 49 | self._designer_block_signal = False |
50 | 50 | self._designer_running = False |
| 51 | + self._no_action = False |
51 | 52 | self.estop = False |
52 | 53 | self.machine_on = False |
53 | 54 | self.home = False |
@@ -432,6 +433,8 @@ def spindle_control_test(e,d): |
432 | 433 | STATUS.connect('all-homed', lambda w: self.setEnabled(True)) |
433 | 434 | STATUS.connect('interp-idle', lambda w: self.setEnabled(homed_on_test())) |
434 | 435 | STATUS.connect('interp-run', lambda w: self.setEnabled(False)) |
| 436 | + elif self._no_action: |
| 437 | + pass |
435 | 438 |
|
436 | 439 | # connect a signal and callback function to the button |
437 | 440 | if self.isCheckable(): |
@@ -462,7 +465,9 @@ def view_check(self,data): |
462 | 465 | def action(self, state=None): |
463 | 466 | # don't do anything if the signal is blocked |
464 | 467 | if self._block_signal: return |
465 | | - if self.estop: |
| 468 | + if self._no_action: |
| 469 | + pass |
| 470 | + elif self.estop: |
466 | 471 | if self.isCheckable(): |
467 | 472 | if STATUS.estop_is_clear(): |
468 | 473 | ACTION.SET_ESTOP_STATE(STATUS.STATE_ESTOP) |
@@ -897,13 +902,22 @@ def _toggle_properties(self, picked): |
897 | 902 | 'launch_calibration', |
898 | 903 | 'exit', 'machine_log_dialog', 'zero_g5x', 'zero_g92', 'zero_zrot', |
899 | 904 | 'origin_offset_dialog', 'run_from_status', 'run_from_slot', |
900 | | - 'tool_chooser_dialog', 'lathe_mirror_x') |
| 905 | + 'tool_chooser_dialog', 'lathe_mirror_x', 'no') |
901 | 906 |
|
902 | 907 | for i in data: |
903 | 908 | if not i == picked: |
904 | 909 | self[i+'_action'] = False |
905 | 910 |
|
906 | 911 | # BOOL VARIABLES---------------------- |
| 912 | + def set_no_action(self, data): |
| 913 | + self._no_action = data |
| 914 | + if data: |
| 915 | + self._toggle_properties('no') |
| 916 | + def get_no_action(self): |
| 917 | + return self._no_action |
| 918 | + def reset_no_action(self): |
| 919 | + self._no_action = False |
| 920 | + |
907 | 921 | def set_estop(self, data): |
908 | 922 | self.estop = data |
909 | 923 | if data: |
@@ -1539,6 +1553,7 @@ def reset_ini_mdi_key(self): |
1539 | 1553 |
|
1540 | 1554 | # designer will show these properties in this order: |
1541 | 1555 | # BOOL |
| 1556 | + no_action = QtCore.pyqtProperty(bool, get_no_action, set_no_action, reset_no_action) |
1542 | 1557 | estop_action = QtCore.pyqtProperty(bool, get_estop, set_estop, reset_estop) |
1543 | 1558 | machine_on_action = QtCore.pyqtProperty(bool, get_machine_on, set_machine_on, reset_machine_on) |
1544 | 1559 | auto_action = QtCore.pyqtProperty(bool, get_auto, set_auto, reset_auto) |
|
0 commit comments