I was trying to link these parameters:
hm2_5i25.0.encoder.03.scale
hm2_5i25.0.pwmgen.00.scale
What I did finally was to change tormach_mill_ui.py at the lines where the spindle range button is updated (as the image has to change), and did the following at lines 1521 and 3683 where the if statements are:
Code:
if self.hal['spindle-range']:
# high
self.set_image('spindle_range_image', 'Spindle_Range_HI_Highlight.png')
encoder_scale = self.ini_float("SPINDLE", "HI_ENCODER_SCALE", 0.0)
pwm_scale = self.ini_float("SPINDLE", "HI_RANGE_MAX", 0.0)
else:
# low
self.set_image('spindle_range_image', 'Spindle_Range_LO_Highlight.png')
encoder_scale = self.ini_float("SPINDLE", "LO_ENCODER_SCALE", 0.0)
pwm_scale = self.ini_float("SPINDLE", "LO_RANGE_MAX", 0.0)
halcmd_list = ['halcmd', 'setp', 'hm2_5i25.0.encoder.03.scale', str(encoder_scale)]
run_mdi_admin_program(self, halcmd_list)
halcmd_list = ['halcmd', 'setp', 'hm2_5i25.0.pwmgen.00.scale', str(pwm_scale)]
run_mdi_admin_program(self, halcmd_list)