@@ -21,7 +21,7 @@ def __init__(self, config):
21
21
mcu_probe = probe_obj .mcu_probe
22
22
else :
23
23
mcu_probe = probe .ProbeEndstopWrapper (config )
24
-
24
+
25
25
#figure out a way to determine which type of printer we are running on
26
26
#only call __init__ for z_v2settling_probe extension for the correct type of printer
27
27
atypes = { 'none' : None , 'cartesian' : 'cartesian' , 'corexy' : 'corexy' ,
@@ -30,9 +30,9 @@ def __init__(self, config):
30
30
'polar' : 'polar' , 'winch' : 'winch' }
31
31
kinematics_config = config .getsection ('printer' )
32
32
kinematics_choice = kinematics_config .getchoice ('kinematics' , atypes , 'none' )
33
- if kinematics_choice in ['corexy' ,'cartesian' ,'corexz' ,'hybrid_corexy' ,'hybrid_corexz' ]:
33
+ if kinematics_choice in ['corexy' ,'cartesian' ,'corexz' ,'hybrid_corexy' ,'hybrid_corexz' , 'rotary_delta' , 'delta' , 'deltesian' , 'polar' ]:
34
34
logging .info ("z_v2settling_probe ::INFO:: Printer has the following "
35
- "kinematics: %s" % (kinematics_choice ))
35
+ "kinematics: %s" % (kinematics_choice ))
36
36
else :
37
37
logging .info ("z_v2settling_probe ::ERROR:: Printer has the following "
38
38
"kinematics:\n kinematics = %s\n "
@@ -69,7 +69,7 @@ def handle_ready(self):
69
69
probe_obj = self .printer .objects .pop ('probe' , None )
70
70
self .printer .objects ['probe' ] = self
71
71
del probe_obj
72
-
72
+
73
73
def _run_settling_probe (self , gcmd ):
74
74
gcmd .respond_info ("Settling sample (ignored)..." )
75
75
speed = gcmd .get_float ("PROBE_SPEED" , self .speed , above = 0. )
@@ -80,31 +80,31 @@ def _run_settling_probe(self, gcmd):
80
80
pos [2 ] += sample_retract_dist
81
81
self ._move (pos , lift_speed )
82
82
83
- def run_probe (self , gcmd ):
83
+ def run_probe (self , gcmd ):
84
84
# The following use self.run_probe : probe.PrinterProbe.cmd_PROBE; probe.PrinterProbe.cmd_PROBE_CALIBRATE;
85
85
# and probe.ProbePointsHelper.start_probe
86
86
if gcmd .get_int ("SETTLING_SAMPLE" , self .settling_sample ):
87
87
self ._run_settling_probe (gcmd )
88
88
return probe .PrinterProbe .run_probe (self , gcmd )
89
-
89
+
90
90
def cmd_PROBE_ACCURACY (self , gcmd ):
91
91
# the probe.PrinterProbe.cmd_PROBE_ACCURACY calls self._probe(speed) not self.run_probe(gcmd)
92
92
if gcmd .get_int ("SETTLING_SAMPLE" , self .settling_sample ):
93
93
self ._run_settling_probe (gcmd )
94
94
return probe .PrinterProbe .cmd_PROBE_ACCURACY (self , gcmd )
95
-
95
+
96
96
class V2SettlingZCalibrationHelper (z_calibration .ZCalibrationHelper ):
97
97
def __init__ (self , config ):
98
98
self .printer = config .get_printer ()
99
99
z_calibration_config = config .getsection ('z_calibration' )
100
-
100
+
101
101
# Unregister any pre-existing z_calibration commands first.
102
102
self .gcode = self .printer .lookup_object ('gcode' )
103
103
self .gcode .register_command ('CALIBRATE_Z' , None )
104
104
self .gcode .register_command ('PROBE_Z_ACCURACY' , None )
105
105
z_calibration .ZCalibrationHelper .__init__ (self , z_calibration_config )
106
106
self .printer .register_event_handler ("klippy:ready" , self .handle_ready )
107
-
107
+
108
108
def handle_ready (self ):
109
109
self .probe = self .printer .lookup_object ('probe' )
110
110
self .settling_sample = self .probe .settling_sample
@@ -117,7 +117,7 @@ def handle_ready(self):
117
117
z_calibration_obj = self .printer .objects .pop ('z_calibration' , None )
118
118
self .printer .objects ['z_calibration' ] = self
119
119
del z_calibration_obj
120
-
120
+
121
121
def move_to_z_endstop (self , gcmd , lift_speed ):
122
122
if self .z_homing is None :
123
123
raise gcmd .error ("Must home axes first" )
@@ -129,19 +129,19 @@ def move_to_z_endstop(self, gcmd, lift_speed):
129
129
self ._move (pos , lift_speed )
130
130
# move to z-endstop position
131
131
self ._move (list (self .nozzle_site ), self .speed )
132
-
132
+
133
133
def _test_cmdline_param (self , gcmd ):
134
134
try :
135
135
gcmd .get_int ("SETTLING_SAMPLE" )
136
136
except :
137
137
pass
138
138
else :
139
- gcmd .respond_info ("Ignoring parameter 'SETTLING_SAMPLE'" )
140
-
139
+ gcmd .respond_info ("Ignoring parameter 'SETTLING_SAMPLE'" )
140
+
141
141
def _message_first_fast (self , gcmd ):
142
142
gcmd .respond_info ("Settling sample (ignored)...for each probe location [endstop, switch body, and bed] ..." )
143
143
self ._test_cmdline_param (gcmd )
144
-
144
+
145
145
# cmd_CALIBRATE_Z will always discard the settling_sample as long as self.first_fast is set to true
146
146
def cmd_CALIBRATE_Z (self , gcmd ):
147
147
global_first_fast = self .first_fast
@@ -157,17 +157,17 @@ def cmd_CALIBRATE_Z(self, gcmd):
157
157
self .first_fast = False
158
158
else :
159
159
return z_calibration .ZCalibrationHelper .cmd_CALIBRATE_Z (self , gcmd )
160
-
160
+
161
161
def cmd_PROBE_Z_ACCURACY (self , gcmd ):
162
162
speed = gcmd .get_float ("PROBE_SPEED" , self .second_speed , above = 0. )
163
- lift_speed = gcmd .get_float ("LIFT_SPEED" , self .lift_speed , above = 0. )
163
+ lift_speed = gcmd .get_float ("LIFT_SPEED" , self .lift_speed , above = 0. )
164
164
if gcmd .get_int ("SETTLING_SAMPLE" , self .settling_sample ):
165
165
self .move_to_z_endstop (gcmd , lift_speed )
166
- gcmd .respond_info ("Settling sample (ignored)..." )
166
+ gcmd .respond_info ("Settling sample (ignored)..." )
167
167
#self._probe() does a probe and a retract
168
- pos = self ._probe (self .z_endstop , self .position_min , speed )
169
- return z_calibration .ZCalibrationHelper .cmd_PROBE_Z_ACCURACY (self , gcmd )
170
-
168
+ pos = self ._probe (self .z_endstop , self .position_min , speed )
169
+ return z_calibration .ZCalibrationHelper .cmd_PROBE_Z_ACCURACY (self , gcmd )
170
+
171
171
def load_config (config ):
172
172
try :
173
173
z_calibration_obj = config .get_printer ().lookup_object ('z_calibration' )
@@ -176,8 +176,7 @@ def load_config(config):
176
176
" command will not be available!\n "
177
177
"CALIBRATE_Z command will not be available!\n "
178
178
"This printer does not use the Klipper plugin for "
179
- "the self calibrating Z offset!" )
179
+ "the self calibrating Z offset!" )
180
180
return V2SettlingProbe (config )
181
181
else :
182
- return V2SettlingProbe (config ), V2SettlingZCalibrationHelper (config )
183
-
182
+ return V2SettlingProbe (config ), V2SettlingZCalibrationHelper (config )
0 commit comments