mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-24 23:24:01 -06:00
probe: Add last_z_result to get the latest z result in an Macro (#3835)
Signed-off-by: Christian Schnellrieder <schnello.android@gmail.com>
This commit is contained in:
parent
b2cbb9aa96
commit
bc2f6faa17
2 changed files with 6 additions and 1 deletions
|
@ -26,6 +26,7 @@ class PrinterProbe:
|
|||
self.probe_calibrate_z = 0.
|
||||
self.multi_probe_pending = False
|
||||
self.last_state = False
|
||||
self.last_z_result = 0.
|
||||
# Infer Z position to move to during a probe
|
||||
if config.has_section('stepper_z'):
|
||||
zconfig = config.getsection('stepper_z')
|
||||
|
@ -185,6 +186,7 @@ class PrinterProbe:
|
|||
def cmd_PROBE(self, gcmd):
|
||||
pos = self.run_probe(gcmd)
|
||||
gcmd.respond_info("Result is z=%.6f" % (pos[2],))
|
||||
self.last_z_result = pos[2]
|
||||
cmd_QUERY_PROBE_help = "Return the status of the z-probe"
|
||||
def cmd_QUERY_PROBE(self, gcmd):
|
||||
toolhead = self.printer.lookup_object('toolhead')
|
||||
|
@ -193,7 +195,8 @@ class PrinterProbe:
|
|||
self.last_state = res
|
||||
gcmd.respond_info("probe: %s" % (["open", "TRIGGERED"][not not res],))
|
||||
def get_status(self, eventtime):
|
||||
return {'last_query': self.last_state}
|
||||
return {'last_query': self.last_state,
|
||||
'last_z_result': self.last_z_result}
|
||||
cmd_PROBE_ACCURACY_help = "Probe Z-height accuracy at current XY position"
|
||||
def cmd_PROBE_ACCURACY(self, gcmd):
|
||||
speed = gcmd.get_float("PROBE_SPEED", self.speed, above=0.)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue