Skip to content

Commit 277e355

Browse files
committed
qtvcp -action button: indicate when MDI cmd is done
as an option th eindicator will light upo at the start and turn off when the machin ehoes idle
1 parent dbe09b8 commit 277e355

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

lib/python/qtvcp/widgets/action_button.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,8 +702,13 @@ def action(self, state=None):
702702
# we prefer named INI MDI commands:
703703
if not self.ini_mdi_keystring == '' and \
704704
not INFO.get_ini_mdi_command(self.ini_mdi_keystring) is None:
705+
# set the indicator that the MDI command is running
706+
# if the indicator option is turned on
707+
if self._is_mdi_command_finished:
708+
self._flip_state(True)
705709
LOG.debug("INI MDI COMMAND #: {}".format(self.ini_mdi_keystring))
706710
ACTION.CALL_INI_MDI(self.ini_mdi_keystring)
711+
707712
# legacy version (nth line)
708713
elif not self.ini_mdi_num <0 and \
709714
not INFO.get_ini_mdi_command(self.ini_mdi_num) is None:

lib/python/qtvcp/widgets/indicatorMixIn.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def __init__(self):
7777
self._is_limits_overridden = False
7878
self._is_manual = False
7979
self._is_mdi = False
80+
self._is_mdi_command_finished = False
8081
self._is_auto = False
8182
self._is_spindle_stopped = False
8283
self._is_spindle_fwd = False
@@ -256,6 +257,8 @@ def only_false(data):
256257
elif self._is_idle:
257258
STATUS.connect('interp-idle', lambda w: self._flip_state(True))
258259
STATUS.connect('interp-run', lambda w: self._flip_state(False))
260+
elif self._is_mdi_command_finished:
261+
STATUS.connect('interp-idle', lambda w: self._flip_state(False))
259262
elif self._is_paused:
260263
STATUS.connect('program-pause-changed', lambda w, data: self._flip_state(data))
261264
elif self._is_flood:
@@ -796,7 +799,7 @@ def _toggle_status_properties(self, picked):
796799
'is_flood', 'is_mist', 'is_block_delete', 'is_optional_stop',
797800
'is_joint_homed', 'is_limits_overridden','is_manual',
798801
'is_mdi', 'is_auto', 'is_spindle_stopped', 'is_spindle_fwd',
799-
'is_spindle_rev')
802+
'is_spindle_rev', 'is_mdi_finished')
800803

801804
for i in data:
802805
if not i == picked:
@@ -852,6 +855,16 @@ def get_is_idle(self):
852855
def reset_is_idle(self):
853856
self._is_idle = False
854857

858+
# machine is mdi finished status
859+
def set_is_mdi_fin(self, data):
860+
self._is_mdi_command_finished = data
861+
if data:
862+
self._toggle_status_properties('is_mdi_finished')
863+
def get_is_mdi_fin(self):
864+
return self._is_mdi_command_finished
865+
def reset_is_mdi_fin(self):
866+
self._is_mdi_command_finished = False
867+
855868
# machine_is_homed status
856869
def set_is_homed(self, data):
857870
self._is_homed = data
@@ -999,6 +1012,7 @@ def reset_joint_number(self):
9991012
is_estopped_status = QtCore.pyqtProperty(bool, get_is_estopped, set_is_estopped, reset_is_estopped)
10001013
is_on_status = QtCore.pyqtProperty(bool, get_is_on, set_is_on, reset_is_on)
10011014
is_idle_status = QtCore.pyqtProperty(bool, get_is_idle, set_is_idle, reset_is_idle)
1015+
is_mdi_finished_status = QtCore.pyqtProperty(bool, get_is_mdi_fin, set_is_mdi_fin, reset_is_mdi_fin)
10021016
is_homed_status = QtCore.pyqtProperty(bool, get_is_homed, set_is_homed, reset_is_homed)
10031017
is_flood_status = QtCore.pyqtProperty(bool, get_is_flood, set_is_flood, reset_is_flood)
10041018
is_mist_status = QtCore.pyqtProperty(bool, get_is_mist, set_is_mist, reset_is_mist)

0 commit comments

Comments
 (0)