add extra digit for z_offset close #943

This commit is contained in:
alfrix 2023-04-02 09:29:00 -06:00
parent a1c602b46d
commit d775e15fa0
3 changed files with 8 additions and 8 deletions

View File

@ -123,7 +123,7 @@ class FineTunePanel(ScreenPanel):
if "gcode_move" in data:
if "homing_origin" in data["gcode_move"]:
self.labels['zoffset'].set_label(f' {data["gcode_move"]["homing_origin"][2]:.2f}mm')
self.labels['zoffset'].set_label(f' {data["gcode_move"]["homing_origin"][2]:.3f}mm')
if "extrude_factor" in data["gcode_move"]:
self.extrusion = round(float(data["gcode_move"]["extrude_factor"]) * 100)
self.labels['extrudefactor'].set_label(f" {self.extrusion:3}%")
@ -142,7 +142,7 @@ class FineTunePanel(ScreenPanel):
z_offset += float(self.bs_delta)
else:
z_offset -= float(self.bs_delta)
self.labels['zoffset'].set_label(f' {round(z_offset, 2):.2f}mm')
self.labels['zoffset'].set_label(f' {z_offset:.3f}mm')
self._screen._ws.klippy.gcode_script(f"SET_GCODE_OFFSET Z_ADJUST={direction}{self.bs_delta} MOVE=1")
def change_bs_delta(self, widget, bs):

View File

@ -393,11 +393,11 @@ class JobStatusPanel(ScreenPanel):
if device == "probe":
probe = self._printer.get_probe()
saved_z_offset = probe['z_offset'] if probe else "?"
label.set_label(_("Apply %s%.2f offset to Probe?") % (sign, abs(self.zoffset))
label.set_label(_("Apply %s%.3f offset to Probe?") % (sign, abs(self.zoffset))
+ "\n\n"
+ _("Saved offset: %s") % saved_z_offset)
elif device == "endstop":
label.set_label(_("Apply %s%.2f offset to Endstop?") % (sign, abs(self.zoffset)))
label.set_label(_("Apply %s%.3f offset to Endstop?") % (sign, abs(self.zoffset)))
label.set_hexpand(True)
label.set_halign(Gtk.Align.CENTER)
label.set_vexpand(True)
@ -563,7 +563,7 @@ class JobStatusPanel(ScreenPanel):
self.buttons['speed'].set_label(self.labels['req_speed'].get_label())
with contextlib.suppress(KeyError):
self.zoffset = float(data["gcode_move"]["homing_origin"][2])
self.labels['zoffset'].set_label(f"{self.zoffset:.2f} {self.mm}")
self.labels['zoffset'].set_label(f"{self.zoffset:.3f} {self.mm}")
if "motion_report" in data:
with contextlib.suppress(KeyError):
self.labels['pos_x'].set_label(f"X: {data['motion_report']['live_position'][0]:6.2f}")

View File

@ -34,7 +34,7 @@ class ZCalibratePanel(ScreenPanel):
pos.attach(Gtk.Label(_("Probe Offset") + ": "), 0, 2, 2, 1)
pos.attach(Gtk.Label(_("Saved")), 0, 3, 1, 1)
pos.attach(Gtk.Label(_("New")), 1, 3, 1, 1)
pos.attach(Gtk.Label(f"{self.z_offset:.2f}"), 0, 4, 1, 1)
pos.attach(Gtk.Label(f"{self.z_offset:.3f}"), 0, 4, 1, 1)
pos.attach(self.widgets['zoffset'], 1, 4, 1, 1)
self.buttons = {
'zpos': self._gtk.Button('z-farther', _("Raise Nozzle"), 'color4'),
@ -257,9 +257,9 @@ class ZCalibratePanel(ScreenPanel):
return
def update_position(self, position):
self.widgets['zposition'].set_text(f"Z: {position[2]:.2f}")
self.widgets['zposition'].set_text(f"Z: {position[2]:.3f}")
if self.z_offset is not None:
self.widgets['zoffset'].set_text(f"{position[2] - self.z_offset:.2f}")
self.widgets['zoffset'].set_text(f"{position[2] - self.z_offset:.3f}")
def change_distance(self, widget, distance):
logging.info(f"### Distance {distance}")