- Posts: 574
- Thank you received: 0
Qtlathe
6 years 3 months ago #173679
by cmorley
yes.
add a hal push button, set checked_state_text option true and set text for true and false state.
call it 'pushbutton_metric'
in the handler under _init_
under initialized__(self):
then add:
add a hal push button, set checked_state_text option true and set text for true and false state.
call it 'pushbutton_metric'
in the handler under _init_
Code:
STATUS.connect("metric-mode-changed", lambda w, d: self.mode_changed(d))
STATUS.connect('state-off', lambda w: self.w.pushbutton_metric.setEnabled(False))
STATUS.connect('state-estop', lambda w: self.w.pushbutton_metric.setEnabled(False))
STATUS.connect('interp-idle', lambda w: self.w.pushbutton_metric.setEnabled(self.homed_on_test()))
STATUS.connect('interp-run', lambda w: self.w.pushbutton_metric.setEnabled(False))
STATUS.connect('all-homed', lambda w: self.w.pushbutton_metric.setEnabled(True))
STATUS.connect('not-all-homed', lambda w, data: self.w.pushbutton_metric.setEnabled(False))
self._block_signal = False
under initialized__(self):
Code:
self.w.pushbutton_metric.clicked[bool].connect(self.change_mode)
then add:
Code:
#####################
# general functions #
#####################
def mode_changed(self,data):
self._block_signal = True
self.w.pushbutton_metric.setChecked(data)
# if using state labels option update the labels
if self.w.pushbutton_metric._state_text:
self.w.pushbutton_metric.setText(None)
self._block_signal = False
def change_mode(self, data):
if self._block_signal: return
if data:
ACTION.CALL_MDI('G21')
else:
ACTION.CALL_MDI('G20')
def homed_on_test(self):
return (STATUS.machine_is_on()
and (STATUS.is_all_homed() or INFO.NO_HOME_REQUIRED))
Please Log in to join the conversation.
6 years 3 months ago #174092
by hottabich
Thank. I wanted to bi comments and suggestions turners. Did you use the latest edition? I edited several times. Wee removed Active Feed and Mdi Touchy seems so prettier to me. But your right as you wish.How to fix
when switching G21-Coolant on, G20-Coolant off so that it does not change?
when switching G21-Coolant on, G20-Coolant off so that it does not change?
Please Log in to join the conversation.
6 years 3 months ago #174187
by hottabich
Thanks and so good. With the pictures it seems to be enough, but with the macros some questions. By default, none work. But I have to learn this. It will take a lot of time. I think the macro should work both in the metric system and in the imperial system. Also be able to edit gcod in the gcode editor or write manually.
Please Log in to join the conversation.
Time to create page: 0.100 seconds
