add move_distances config option (#1211)
* add move_distances option * address review comments * adjust check * comment out example * doc update * address review comments
This commit is contained in:
parent
02ba0f9594
commit
727a6657ee
@ -20,7 +20,7 @@ Write in the file only the options that need to be changed, and restart KlipperS
|
|||||||
|
|
||||||
|
|
||||||
## Main Options
|
## Main Options
|
||||||
The options listed here are not changeable from within the ui.
|
The options listed here are not editable from within the user interface.
|
||||||
```{ .ini .no-copy }
|
```{ .ini .no-copy }
|
||||||
[main]
|
[main]
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ The options listed here are not changeable from within the ui.
|
|||||||
# If multiple printers are defined, this can be set the name of the one to show at startup.
|
# If multiple printers are defined, this can be set the name of the one to show at startup.
|
||||||
# default_printer: MyPrinter
|
# default_printer: MyPrinter
|
||||||
|
|
||||||
# To define a full set of custom menues (instead of merging user entries with default entries)
|
# To define a full set of custom menus (instead of merging user entries with default entries)
|
||||||
# set this to False. See Menu section below.
|
# set this to False. See Menu section below.
|
||||||
# use_default_menu: True
|
# use_default_menu: True
|
||||||
|
|
||||||
@ -106,6 +106,9 @@ moonraker_port: 7125
|
|||||||
# extrude_distances: 5, 10, 15, 25
|
# extrude_distances: 5, 10, 15, 25
|
||||||
# extrude_speeds: 1, 2, 5, 25
|
# extrude_speeds: 1, 2, 5, 25
|
||||||
|
|
||||||
|
# Define distances for the move panel. comma-separated list with 2 to 7 floats and/or integers
|
||||||
|
# move_distances: 0.1, 0.5, 1, 5, 10, 25, 50
|
||||||
|
|
||||||
# Camera needs to be configured in moonraker:
|
# Camera needs to be configured in moonraker:
|
||||||
# https://moonraker.readthedocs.io/en/latest/configuration/#webcam
|
# https://moonraker.readthedocs.io/en/latest/configuration/#webcam
|
||||||
```
|
```
|
||||||
|
@ -173,7 +173,7 @@ class KlipperScreenConfig:
|
|||||||
strs = (
|
strs = (
|
||||||
'moonraker_api_key', 'moonraker_host', 'titlebar_name_type',
|
'moonraker_api_key', 'moonraker_host', 'titlebar_name_type',
|
||||||
'screw_positions', 'power_devices', 'titlebar_items', 'z_babystep_values',
|
'screw_positions', 'power_devices', 'titlebar_items', 'z_babystep_values',
|
||||||
'extrude_distances', "extrude_speeds",
|
'extrude_distances', 'extrude_speeds', 'move_distances',
|
||||||
)
|
)
|
||||||
numbers = (
|
numbers = (
|
||||||
'moonraker_port', 'move_speed_xy', 'move_speed_z', 'screw_rotation',
|
'moonraker_port', 'move_speed_xy', 'move_speed_z', 'screw_rotation',
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import re
|
||||||
import logging
|
import logging
|
||||||
import gi
|
import gi
|
||||||
|
|
||||||
@ -13,6 +14,15 @@ class Panel(ScreenPanel):
|
|||||||
|
|
||||||
def __init__(self, screen, title):
|
def __init__(self, screen, title):
|
||||||
super().__init__(screen, title)
|
super().__init__(screen, title)
|
||||||
|
|
||||||
|
if self.ks_printer_cfg is not None:
|
||||||
|
dis = self.ks_printer_cfg.get("move_distances", '0.1, 0.5, 1, 50, 10, 25, 50')
|
||||||
|
if re.match(r'^[0-9,\.\s]+$', dis):
|
||||||
|
dis = [str(i.strip()) for i in dis.split(',')]
|
||||||
|
if 1 < len(dis) <= 7 and len(dis) >= 2:
|
||||||
|
self.distances = dis
|
||||||
|
self.distance = self.distances[-2]
|
||||||
|
|
||||||
self.settings = {}
|
self.settings = {}
|
||||||
self.menu = ['move_menu']
|
self.menu = ['move_menu']
|
||||||
self.buttons = {
|
self.buttons = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user