fine_tune: Allow z babystep intervals to be configured
This commit is contained in:
parent
a57ab7f9d5
commit
3f2ed97385
@ -45,6 +45,9 @@ moonraker_host: 127.0.0.1
|
|||||||
moonraker_port: 7125
|
moonraker_port: 7125
|
||||||
# Moonraker API key if this is not connecting from a trusted client IP
|
# Moonraker API key if this is not connecting from a trusted client IP
|
||||||
moonraker_api_key: False
|
moonraker_api_key: False
|
||||||
|
|
||||||
|
# Define the z_babystep intervals in a CSV list. Currently only 2 are supported
|
||||||
|
z_babystep_values: 0.01, 0.05
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
#### 2021 02 22
|
#### 2021 02 22
|
||||||
|
* Add configurable z_babystep intervals
|
||||||
* Fixed cursor issue on startup
|
* Fixed cursor issue on startup
|
||||||
* Fixed font ratio for large, but short screens
|
* Fixed font ratio for large, but short screens
|
||||||
* Re-vamped logging system
|
* Re-vamped logging system
|
||||||
|
@ -188,6 +188,14 @@ class KlipperScreenConfig:
|
|||||||
|
|
||||||
return preheat_options
|
return preheat_options
|
||||||
|
|
||||||
|
def get_printer_config(self, name):
|
||||||
|
if not name.startswith("printer "):
|
||||||
|
name = "printer %s" % name
|
||||||
|
|
||||||
|
if name not in self.config:
|
||||||
|
return None
|
||||||
|
return self.config[name]
|
||||||
|
|
||||||
def get_printer_power_name(self):
|
def get_printer_power_name(self):
|
||||||
return self.config['settings'].get("printer_power_name", "printer")
|
return self.config['settings'].get("printer_power_name", "printer")
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import gi
|
import gi
|
||||||
import logging
|
import logging
|
||||||
|
import re
|
||||||
|
|
||||||
gi.require_version("Gtk", "3.0")
|
gi.require_version("Gtk", "3.0")
|
||||||
from gi.repository import Gtk, Gdk, GLib
|
from gi.repository import Gtk, Gdk, GLib
|
||||||
@ -30,6 +31,17 @@ class FineTunePanel(ScreenPanel):
|
|||||||
grid.set_row_homogeneous(False)
|
grid.set_row_homogeneous(False)
|
||||||
logging.debug("FineTunePanel")
|
logging.debug("FineTunePanel")
|
||||||
|
|
||||||
|
print_cfg = self._config.get_printer_config(self._screen.connected_printer)
|
||||||
|
if print_cfg is not None:
|
||||||
|
bs = print_cfg.get("z_babystep_values","0.01, 0.05")
|
||||||
|
if re.match(r'^[0-9,\.\s]+$', bs):
|
||||||
|
bs = [str(i.strip()) for i in bs.split(',')]
|
||||||
|
if len(bs) <= 2:
|
||||||
|
self.bs_deltas = bs
|
||||||
|
else:
|
||||||
|
self.bs_deltas = [bs[0], bs[-1]]
|
||||||
|
self.bs_delta = self.bs_deltas[0]
|
||||||
|
|
||||||
|
|
||||||
self.labels['z+'] = self._gtk.ButtonImage("move-z-", _("Z+"), "color1")
|
self.labels['z+'] = self._gtk.ButtonImage("move-z-", _("Z+"), "color1")
|
||||||
self.labels['z+'].connect("clicked", self.change_babystepping, "+")
|
self.labels['z+'].connect("clicked", self.change_babystepping, "+")
|
||||||
|
@ -126,6 +126,7 @@ class KlipperScreen(Gtk.Window):
|
|||||||
if self.files is not None:
|
if self.files is not None:
|
||||||
self.files.stop()
|
self.files.stop()
|
||||||
|
|
||||||
|
logging.info("Connecting to printer: %s" % name)
|
||||||
self.apiclient = KlippyRest(self._config.get_main_config_option("moonraker_host"),
|
self.apiclient = KlippyRest(self._config.get_main_config_option("moonraker_host"),
|
||||||
self._config.get_main_config_option("moonraker_port"),
|
self._config.get_main_config_option("moonraker_port"),
|
||||||
self._config.get_main_config_option("moonraker_api_key", False))
|
self._config.get_main_config_option("moonraker_api_key", False))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user