def _enable_main_coil_eos_cutoff_rule(self): if self.config['hold_coil']: self.debug_log('Enabling main coil EOS cutoff rule w/o hold') rule = self.machine.platform_controller.set_pulse_on_hit_and_release_and_disable_rule( SwitchRuleSettings(switch=self.config['activation_switch'], debounce=False, invert=False), SwitchRuleSettings(switch=self.config['eos_switch'], debounce=False, invert=False), DriverRuleSettings(driver=self.config['main_coil'], recycle=False), PulseRuleSettings(duration=self._get_hold_pulse_ms(), power=self._get_hold_pulse_power()), EosRuleSettings( enable_repulse=self.config["repulse_on_eos_open"])) self._active_rules.append(rule) else: self.debug_log('Enabling main coil EOS cutoff rule w/ hold') rule = self.machine.platform_controller.set_pulse_on_hit_and_enable_and_release_and_disable_rule( SwitchRuleSettings(switch=self.config['activation_switch'], debounce=False, invert=False), SwitchRuleSettings(switch=self.config['eos_switch'], debounce=False, invert=False), DriverRuleSettings(driver=self.config['main_coil'], recycle=False), PulseRuleSettings(duration=self._get_hold_pulse_ms(), power=self._get_hold_pulse_power()), HoldRuleSettings(power=self._get_hold_power()), EosRuleSettings( enable_repulse=self.config["repulse_on_eos_open"])) self._active_rules.append(rule)
def _enable_hold_coil_rule(self): self.debug_log('Enabling hold coil rule') rule = self.machine.platform_controller.set_pulse_on_hit_and_enable_and_release_rule( SwitchRuleSettings(switch=self.config['activation_switch'], debounce=False, invert=False), DriverRuleSettings(driver=self.config['hold_coil'], recycle=False), PulseRuleSettings(duration=self._get_hold_pulse_ms(), power=self._get_hold_pulse_power()), HoldRuleSettings(power=self._get_hold_power()) ) self._active_rules.append(rule)