mirror of
https://github.com/Klipper3d/klipper.git
synced 2026-02-08 01:01:06 -07:00
probe_eddy_current: Minor reorg to PrinterEddyProbe startup
Some checks are pending
Build test / build (push) Waiting to run
Some checks are pending
Build test / build (push) Waiting to run
The EddyTap class doesn't need the calibration object. Add some code comments. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
1fe9fb3ad4
commit
576d0ca13d
1 changed files with 9 additions and 10 deletions
|
|
@ -478,11 +478,9 @@ class EddyEndstopWrapper:
|
|||
|
||||
# Probing helper for "tap" requests
|
||||
class EddyTap:
|
||||
def __init__(self, config, sensor_helper, calibration,
|
||||
param_helper, trigger_analog):
|
||||
def __init__(self, config, sensor_helper, param_helper, trigger_analog):
|
||||
self._printer = config.get_printer()
|
||||
self._sensor_helper = sensor_helper
|
||||
self._calibration = calibration
|
||||
self._param_helper = param_helper
|
||||
self._trigger_analog = trigger_analog
|
||||
self._z_min_position = probe.lookup_minimum_z(config)
|
||||
|
|
@ -677,21 +675,21 @@ class PrinterEddyProbe:
|
|||
self.eddy_descend = EddyDescend(
|
||||
config, self.sensor_helper, self.calibration, self.probe_offsets,
|
||||
self.param_helper, trig_analog)
|
||||
self.cmd_helper = probe.ProbeCommandHelper(config, self,
|
||||
replace_z_offset=True)
|
||||
self.probe_session = probe.ProbeSessionHelper(
|
||||
config, self.param_helper, self._start_descend_wrapper)
|
||||
# Create wrapper to support Z homing with probe
|
||||
mcu_probe = EddyEndstopWrapper(self.sensor_helper, self.eddy_descend)
|
||||
probe.HomingViaProbeHelper(
|
||||
config, mcu_probe, self.probe_offsets, self.param_helper)
|
||||
probe.HomingViaProbeHelper(config, mcu_probe,
|
||||
self.probe_offsets, self.param_helper)
|
||||
# Probing via "tap" interface
|
||||
self.eddy_tap = EddyTap(config, self.sensor_helper, self.calibration,
|
||||
self.eddy_tap = EddyTap(config, self.sensor_helper,
|
||||
self.param_helper, trig_analog)
|
||||
# Probing via "scan" and "rapid_scan" requests
|
||||
self.eddy_scan = EddyScanningProbe(config, self.sensor_helper,
|
||||
self.calibration, self.probe_offsets)
|
||||
# Register with main probe interface
|
||||
self.cmd_helper = probe.ProbeCommandHelper(config, self,
|
||||
replace_z_offset=True)
|
||||
self.probe_session = probe.ProbeSessionHelper(
|
||||
config, self.param_helper, self._start_descend_wrapper)
|
||||
self.printer.add_object('probe', self)
|
||||
def add_client(self, cb):
|
||||
self.sensor_helper.add_client(cb)
|
||||
|
|
@ -712,6 +710,7 @@ class PrinterEddyProbe:
|
|||
method = gcmd.get('METHOD', 'automatic').lower()
|
||||
if method in ('scan', 'rapid_scan'):
|
||||
return self.eddy_scan.start_probe_session(gcmd)
|
||||
# For "tap" and normal, probe_session can average multiple attempts
|
||||
return self.probe_session.start_probe_session(gcmd)
|
||||
def register_drift_compensation(self, comp):
|
||||
self.calibration.register_drift_compensation(comp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue