Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a5e931d17 | ||
|
|
f047830852 | ||
|
|
2c87e096f4 | ||
|
|
acbfd6e5c5 | ||
|
|
79eefbd170 | ||
|
|
a332556a51 | ||
|
|
874b74d59a | ||
|
|
49f7cf0e46 | ||
|
|
57aa7e6e85 | ||
|
|
054f7c72db | ||
|
|
1d746c074c | ||
|
|
9f2a328b62 | ||
|
|
e1d01c81a2 | ||
|
|
b251a2ebbb | ||
|
|
c3f0abd671 | ||
|
|
b6fb4c1da2 | ||
|
|
6228465fdd | ||
|
|
05623b7a26 | ||
|
|
b258d64fb4 | ||
|
|
7d1ec41f4b | ||
|
|
1e9aabec7d | ||
|
|
7609cedda4 | ||
|
|
f5a2d97842 | ||
|
|
c2dc0fdb46 | ||
|
|
faabceeafd | ||
|
|
4b4faaab88 | ||
|
|
3e4ae3bdee | ||
|
|
ad17131393 | ||
|
|
d25f642716 | ||
|
|
f1ced2ac46 | ||
|
|
1137ddb265 | ||
|
|
3f2fc93be4 | ||
|
|
d6bf77870b | ||
|
|
874dd509bf | ||
|
|
3ea8402303 | ||
|
|
f297699396 | ||
|
|
52cadb7744 | ||
|
|
90c84d5f17 | ||
|
|
a51360f372 | ||
|
|
fc074c350f | ||
|
|
c926184918 | ||
|
|
a17c8665ac | ||
|
|
6c252b0862 | ||
|
|
30ed648934 | ||
|
|
da9570a925 | ||
|
|
37f8a5d632 | ||
|
|
0453627d40 | ||
|
|
4f929ba342 | ||
|
|
8920516053 | ||
|
|
a087ecfa30 | ||
|
|
ab7cffe4d6 | ||
|
|
32ccfc125d | ||
|
|
ffb24a2ffd | ||
|
|
6e3965bf6c | ||
|
|
b1f110c13a | ||
|
|
6f15bb1d91 | ||
|
|
ca8abecb55 | ||
|
|
934acd0ad0 | ||
|
|
71abc27ad8 | ||
|
|
642fe8a52e | ||
|
|
b2b3127183 | ||
|
|
d11e9ec3a6 | ||
|
|
3fee1ff947 | ||
|
|
0bdb5ac457 | ||
|
|
3a60277392 | ||
|
|
0b8751836c | ||
|
|
e227f22aba | ||
|
|
b57cbc8352 | ||
|
|
7b593b704c | ||
|
|
3c2bdee22a | ||
|
|
c08a293f83 | ||
|
|
9d89311bcc | ||
|
|
63764ee32e | ||
|
|
c58b040be2 | ||
|
|
389eceaf06 | ||
|
|
9aa4389eaf | ||
|
|
931d15b6cc | ||
|
|
3abbe921b2 | ||
|
|
e2a0f86f45 | ||
|
|
263b07ae94 | ||
|
|
f223332cd8 | ||
|
|
1c2519be41 | ||
|
|
9016b67c6f | ||
|
|
37c043b3f9 | ||
|
|
717e4ee902 | ||
|
|
cb90a0bd70 | ||
|
|
6a6161dfef | ||
|
|
1973002b3d | ||
|
|
51714180ac | ||
|
|
246c15494c | ||
|
|
5c1d5a1825 | ||
|
|
136ecf79fb | ||
|
|
3fe1665e0b | ||
|
|
c3f96418ea | ||
|
|
bcbbc03151 | ||
|
|
51da7cecc8 | ||
|
|
07554250ad | ||
|
|
9f4204b898 | ||
|
|
5682eb5616 | ||
|
|
47d08f5385 | ||
|
|
ecc4c5ac4c | ||
|
|
f343f03b96 | ||
|
|
36c9b42970 | ||
|
|
5408aec036 | ||
|
|
7471cd39b9 | ||
|
|
238badb110 | ||
|
|
ea465b0f4d | ||
|
|
fb0a0557c5 | ||
|
|
e6b71d5478 | ||
|
|
a18eb42399 | ||
|
|
9047f58c60 | ||
|
|
1c384144c4 | ||
|
|
348a9e3e42 | ||
|
|
4736ed4d84 | ||
|
|
0907c6a06a | ||
|
|
cf3a924bb2 | ||
|
|
d61db5fb17 | ||
|
|
3ad44d9ecf | ||
|
|
cb39b469b0 | ||
|
|
5ad29f0183 | ||
|
|
a2f178c7e0 | ||
|
|
7efb0fddf0 | ||
|
|
46410f797a | ||
|
|
c7496973ee | ||
|
|
2d29eef255 | ||
|
|
3e11fad1fd | ||
|
|
a724836378 | ||
|
|
25b89cb7e9 | ||
|
|
b37ba531f7 | ||
|
|
58b6325776 | ||
|
|
5cfed7f477 | ||
|
|
369fc24e16 | ||
|
|
a099151693 | ||
|
|
c182cc21f2 | ||
|
|
16f7d4543a | ||
|
|
3a4c556f25 | ||
|
|
67e04248c3 | ||
|
|
08a7057668 | ||
|
|
6d71022dbf | ||
|
|
972c869e62 | ||
|
|
c36aa4b430 | ||
|
|
90950101d8 | ||
|
|
67d61d164c | ||
|
|
cc59ec68d0 | ||
|
|
48c276d22f | ||
|
|
728f9cfa0f | ||
|
|
1c0e4fbf86 | ||
|
|
f7484c3df5 | ||
|
|
b70e84a7ee | ||
|
|
16c2c64904 | ||
|
|
70c93ee878 | ||
|
|
1b7146c8ec | ||
|
|
ac2e9de2d4 | ||
|
|
8204e3ab17 | ||
|
|
f0f4581241 | ||
|
|
d5fc92c1af | ||
|
|
906da8550e | ||
|
|
2f25ef2040 | ||
|
|
3b62439939 | ||
|
|
557dd86364 | ||
|
|
aeea57bd2f | ||
|
|
186c8026cf | ||
|
|
7db6a541f2 | ||
|
|
2341642cc2 | ||
|
|
2ffe6809fd | ||
|
|
2626899d53 | ||
|
|
6e8f904983 | ||
|
|
cc5b87eefe | ||
|
|
85a2ba116c | ||
|
|
c2be717fa9 | ||
|
|
c57760d857 | ||
|
|
891539c5ff | ||
|
|
87d346e541 | ||
|
|
f223f74f7f | ||
|
|
df5ac88f84 | ||
|
|
8733292dc3 | ||
|
|
8df55012d7 | ||
|
|
18a55fab2e | ||
|
|
ca9960871d | ||
|
|
127237fd76 | ||
|
|
ca9f869ac3 | ||
|
|
d29c0ab063 | ||
|
|
33beb60af9 | ||
|
|
29f78bda5e | ||
|
|
1a8e6dd250 | ||
|
|
12c0e9f5b1 | ||
|
|
952d46da24 | ||
|
|
929efa8e41 | ||
|
|
fb840f2404 | ||
|
|
19e0ff5028 |
No files matched your search
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||
patreon: klipperscreen
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
@@ -1,147 +0,0 @@
|
||||
{
|
||||
"preheat_options": {
|
||||
"PLA": {
|
||||
"tool": 195,
|
||||
"bed": 40
|
||||
},
|
||||
"ABS":{
|
||||
"tool": 220,
|
||||
"bed": 90
|
||||
}
|
||||
},
|
||||
"mainmenu": [
|
||||
{
|
||||
"name": "Homing",
|
||||
"icon": "home",
|
||||
"panel": "menu",
|
||||
"items": [
|
||||
{
|
||||
"name": "Home All",
|
||||
"icon": "home",
|
||||
"method": "printer.gcode.script",
|
||||
"params": {"script": "G28"}
|
||||
},
|
||||
{
|
||||
"name": "Home X",
|
||||
"icon": "home-x",
|
||||
"method": "printer.gcode.script",
|
||||
"params": {"script": "G28 X"}
|
||||
},
|
||||
{
|
||||
"name": "Home Y",
|
||||
"icon": "home-y",
|
||||
"method": "printer.gcode.script",
|
||||
"params": {"script": "G28 Y"}
|
||||
},
|
||||
{
|
||||
"name": "Home Z",
|
||||
"icon": "home-z",
|
||||
"method": "printer.gcode.script",
|
||||
"params": {"script": "G28 Z"}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Preheat",
|
||||
"icon": "heat-up",
|
||||
"panel": "preheat"
|
||||
},
|
||||
{
|
||||
"name": "Actions" ,
|
||||
"icon": "actions",
|
||||
"panel": "menu",
|
||||
"items": [
|
||||
{
|
||||
"name": "Move",
|
||||
"icon": "move",
|
||||
"panel": "move"
|
||||
},
|
||||
{
|
||||
"name": "Extrude",
|
||||
"icon": "filament",
|
||||
"panel": "extrude"
|
||||
},
|
||||
{
|
||||
"name": "Fan",
|
||||
"icon": "fan",
|
||||
"panel": "fan"
|
||||
},
|
||||
{
|
||||
"name": "Temperature",
|
||||
"icon": "heat-up",
|
||||
"panel": "temperature"
|
||||
},
|
||||
{
|
||||
"name": "Disable Motors",
|
||||
"icon": "motor-off",
|
||||
"method": "printer.gcode.script",
|
||||
"params": {"script": "M18"},
|
||||
"command": {
|
||||
"method": "printer.gcode.script",
|
||||
"params": {"script": "M18"}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Configuration",
|
||||
"icon": "control",
|
||||
"panel": "menu",
|
||||
"items": [
|
||||
{
|
||||
"name": "Bed Level",
|
||||
"icon": "bed-level",
|
||||
"panel": "bed_level"
|
||||
},
|
||||
{
|
||||
"name": "ZOffsets",
|
||||
"icon": "z-offset-increase",
|
||||
"panel": "zcalibrate"
|
||||
},
|
||||
{
|
||||
"name": "Network",
|
||||
"icon": "network",
|
||||
"panel": "network"
|
||||
},
|
||||
{
|
||||
"name": "System",
|
||||
"icon": "info",
|
||||
"panel": "system"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Print",
|
||||
"icon": "print",
|
||||
"panel": "print"
|
||||
}
|
||||
],
|
||||
"printmenu": [
|
||||
{
|
||||
"name": "Temperature",
|
||||
"icon": "heat-up",
|
||||
"panel": "temperature"
|
||||
},
|
||||
{
|
||||
"name": "Tuning",
|
||||
"icon": "fan",
|
||||
"panel": "finetune"
|
||||
},
|
||||
{
|
||||
"name": "Network",
|
||||
"icon": "network",
|
||||
"panel": "network"
|
||||
},
|
||||
{
|
||||
"name": "System",
|
||||
"icon": "info",
|
||||
"panel": "system"
|
||||
},
|
||||
{
|
||||
"name": "Extrude",
|
||||
"icon": "filament",
|
||||
"panel": "extrude"
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
@@ -1,209 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib
|
||||
import os
|
||||
klipperscreendir = os.getcwd()
|
||||
|
||||
class KlippyGtk:
|
||||
labels = {}
|
||||
|
||||
@staticmethod
|
||||
def Label(label, style):
|
||||
l = Gtk.Label(label)
|
||||
if style != False:
|
||||
l.get_style_context().add_class(style)
|
||||
return l
|
||||
|
||||
@staticmethod
|
||||
def ImageLabel(image_name, text, size=20, style=False):
|
||||
box1 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=15)
|
||||
image = Gtk.Image()
|
||||
#TODO: update file reference
|
||||
image.set_from_file(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg")
|
||||
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg", 20, 20, True)
|
||||
image.set_from_pixbuf(pixbuf)
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_text(text)
|
||||
box1.add(image) #, size, size)
|
||||
box1.add(label)
|
||||
|
||||
if style != False:
|
||||
ctx = box1.get_style_context()
|
||||
ctx.add_class(style)
|
||||
|
||||
return {"l": label, "b": box1}
|
||||
|
||||
@staticmethod
|
||||
def Image(image_name, style=False, width=None, height=None):
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg")
|
||||
|
||||
if height != None and width != None:
|
||||
pixbuf = pixbuf.scale_simple(width, height, GdkPixbuf.InterpType.BILINEAR)
|
||||
|
||||
return Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
@staticmethod
|
||||
def ImageFromFile(filename, style=False, width=None, height=None):
|
||||
if height != -1 or width != -1:
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, width, height, True)
|
||||
else:
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file(filename)
|
||||
|
||||
return Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
@staticmethod
|
||||
def PixbufFromFile(filename, style=False, width=None, height=None):
|
||||
if height != -1 or width != -1:
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, width, height, True)
|
||||
else:
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file(filename)
|
||||
|
||||
return pixbuf
|
||||
|
||||
@staticmethod
|
||||
def ProgressBar(style=False):
|
||||
bar = Gtk.ProgressBar()
|
||||
|
||||
if style != False:
|
||||
ctx = bar.get_style_context()
|
||||
ctx.add_class(style)
|
||||
|
||||
return bar
|
||||
|
||||
@staticmethod
|
||||
def Button(label=None, style=None):
|
||||
b = Gtk.Button(label=label)
|
||||
b.set_hexpand(True)
|
||||
b.set_vexpand(True)
|
||||
b.set_can_focus(False)
|
||||
b.props.relief = Gtk.ReliefStyle.NONE
|
||||
|
||||
if style != None:
|
||||
b.get_style_context().add_class(style)
|
||||
|
||||
return b
|
||||
|
||||
@staticmethod
|
||||
def ButtonImage(image_name, label=None, style=None, height=None, width=None):
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg")
|
||||
|
||||
if height != None and width != None:
|
||||
pixbuf = pixbuf.scale_simple(width, height, GdkPixbuf.InterpType.BILINEAR)
|
||||
|
||||
|
||||
img = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
b = Gtk.Button(label=label)
|
||||
b.set_image(img)
|
||||
b.set_hexpand(True)
|
||||
b.set_vexpand(True)
|
||||
b.set_can_focus(False)
|
||||
b.set_image_position(Gtk.PositionType.TOP)
|
||||
b.set_always_show_image(True)
|
||||
b.props.relief = Gtk.ReliefStyle.NONE
|
||||
|
||||
if style != None:
|
||||
b.get_style_context().add_class(style)
|
||||
|
||||
return b
|
||||
|
||||
@staticmethod
|
||||
def ConfirmDialog(screen, text, buttons, callback=None, *args):
|
||||
dialog = Gtk.Dialog()
|
||||
#TODO: Factor other resolutions in
|
||||
dialog.set_default_size(984, 580)
|
||||
dialog.set_resizable(False)
|
||||
dialog.set_transient_for(screen)
|
||||
dialog.set_modal(True)
|
||||
|
||||
for button in buttons:
|
||||
dialog.add_button(button_text=button['name'], response_id=button['response'])
|
||||
|
||||
dialog.connect("response", callback, *args)
|
||||
dialog.get_style_context().add_class("dialog")
|
||||
|
||||
content_area = dialog.get_content_area()
|
||||
content_area.set_margin_start(15)
|
||||
content_area.set_margin_end(15)
|
||||
content_area.set_margin_top(15)
|
||||
content_area.set_margin_bottom(15)
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_line_wrap(True)
|
||||
label.set_size_request(800, -1)
|
||||
label.set_markup(text)
|
||||
label.get_style_context().add_class("text")
|
||||
table = Gtk.Table(1, 1, False)
|
||||
table.attach(label, 0, 1, 0, 1, Gtk.AttachOptions.SHRINK | Gtk.AttachOptions.FILL)
|
||||
table.set_vexpand(True)
|
||||
table.set_halign(Gtk.Align.CENTER)
|
||||
table.set_valign(Gtk.Align.CENTER)
|
||||
content_area.add(table)
|
||||
|
||||
dialog.show_all()
|
||||
|
||||
return dialog
|
||||
|
||||
|
||||
@staticmethod
|
||||
def ToggleButtonImage(image_name, label, style=False):
|
||||
img = Gtk.Image.new_from_file(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg")
|
||||
|
||||
b = Gtk.ToggleButton(label=label)
|
||||
#b.props.relief = Gtk.RELIEF_NONE
|
||||
b.set_image(img)
|
||||
b.set_hexpand(True)
|
||||
b.set_vexpand(True)
|
||||
b.set_can_focus(False)
|
||||
b.set_image_position(Gtk.PositionType.TOP)
|
||||
b.set_always_show_image(True)
|
||||
b.props.relief = Gtk.ReliefStyle.NONE
|
||||
|
||||
if style != False:
|
||||
ctx = b.get_style_context()
|
||||
ctx.add_class(style)
|
||||
|
||||
return b
|
||||
|
||||
@staticmethod
|
||||
def HomogeneousGrid():
|
||||
g = Gtk.Grid()
|
||||
g.set_row_homogeneous(True)
|
||||
g.set_column_homogeneous(True)
|
||||
return g
|
||||
|
||||
@staticmethod
|
||||
def ToggleButton(text):
|
||||
b = Gtk.ToggleButton(text)
|
||||
b.props.relief = Gtk.ReliefStyle.NONE
|
||||
b.set_hexpand(True)
|
||||
b.set_vexpand(True)
|
||||
return b
|
||||
|
||||
@staticmethod
|
||||
def formatFileName(name):
|
||||
name = name.split('/')[-1] if "/" in name else name
|
||||
name = name.split('.gcod')[0] if ".gcode" in name else name
|
||||
if len(name) > 25:
|
||||
return name[0:25] + "\n" + name[25:50]
|
||||
return name
|
||||
|
||||
|
||||
@staticmethod
|
||||
def formatTimeString(seconds):
|
||||
time = int(seconds)
|
||||
text = ""
|
||||
if int(time/3600) !=0:
|
||||
text += str(int(time/3600))+"h "
|
||||
text += str(int(time/60)%60)+"m "+str(time%60)+"s"
|
||||
return text
|
||||
|
||||
@staticmethod
|
||||
def formatTemperatureString(temp, target):
|
||||
if (target > temp-2 and target < temp+2) or round(target,0) == 0:
|
||||
return str(round(temp,2)) + "°C" #°C →"
|
||||
return str(round(temp,2)) + "°C → " + str(round(target,2)) + "°C"
|
||||
@@ -1,23 +0,0 @@
|
||||
import json
|
||||
import requests
|
||||
import logging
|
||||
|
||||
|
||||
|
||||
class KlippyRest:
|
||||
def __init__(self, ip, port=7125):
|
||||
self.ip = ip
|
||||
self.port = port
|
||||
|
||||
def get_info(self):
|
||||
return self.send_request("server/info")
|
||||
|
||||
def send_request(self, method):
|
||||
r = requests.get("http://%s:%s/%s" % (self.ip, self.port, method))
|
||||
if r.status_code != 200:
|
||||
return False
|
||||
|
||||
#TODO: Try/except
|
||||
data = json.loads(r.content)
|
||||
|
||||
return data
|
||||
@@ -1,5 +1,5 @@
|
||||
# KlipperScreen
|
||||
KlipperScreen is an idea based from [OctoScreen](https://github.com/Z-Bolt/OctoScreen/), but instead of needing OctoPrint or to compile go, KlipperScreen is python based and interacts directly with Moonraker, Klipper's API service, so that it can be run with no dependencies besides Klipper.
|
||||
KlipperScreen is an idea based from [OctoScreen](https://github.com/Z-Bolt/OctoScreen/), but instead of needing OctoPrint or to compile go, KlipperScreen is python based and interacts directly with [Moonraker](https://github.com/arksine/moonraker), Klipper's API service.
|
||||
|
||||
Current feature list:
|
||||
- [x] Homing
|
||||
@@ -10,53 +10,36 @@ Current feature list:
|
||||
- [x] Fan control
|
||||
- [x] Disable steppers
|
||||
- [x] Configure Z Offset using PROBE_CALIBRATE
|
||||
- [ ] Print tuning (Z Babystepping, Speed Control, Flow Control)
|
||||
- [x] Print tuning (Z Babystepping, Speed Control, Flow Control)
|
||||
- [x] Manual bed leveling assist
|
||||
- [x] Using thumbnails from prusa on job status page
|
||||
- [x] Scale UI based off of resolution
|
||||
- [ ] Better system panel
|
||||
- [ ] Wifi selection
|
||||
- [ ] Manual bed leveling assist
|
||||
- [ ] Using thumbnails from prusa on job status page
|
||||
- [ ] Scale UI based off of resolution
|
||||
|
||||
|
||||
More details to come...
|
||||
[Changelog](docs/changelog.md)
|
||||
|
||||
### Required Hardware
|
||||
KlipperScreen should run on any HDMI touchscreen that you can connect to a raspberry pi. The required video driver may
|
||||
be slightly different depending on what model you get. I am developing on a 1024x600 resolution screen. Due to this,
|
||||
other resolutions may not be scaled properly at this moment. UI scaling is a future development item.
|
||||
KlipperScreen should run on any touchscreen that you can connect to a computer. The required video driver may be
|
||||
slightly different depending on what model you get. KlipperScreen will scale to the resolution of the screen being used.
|
||||
However, three resolutions are tested during development: 1024x600, 800x480, 480x320.
|
||||
|
||||
#### Configure Hardware
|
||||
There are no recommended screens, but there are several screens that work with KlipperScreen. They include screens that
|
||||
use HDMI/USB, Raspberry Pi GPIO, or the Rapsberry Pi DSI (ribbon cable) port.
|
||||
|
||||
Add the following to _/boot/config.txt_. You can alter the hdmi_cvt to your screen specifications. This example is setup
|
||||
for a resolution of 1024x600 and a refresh rate of 60hz.
|
||||
```
|
||||
hdmi_cvt=1024 600 60 6 0 0 0
|
||||
hdmi_group=2
|
||||
hdmi_mode=87
|
||||
hdmi_drive=2
|
||||
```
|
||||
* Development has been using 1024x600 for a screen resolution. Other resolutions may have issues currently
|
||||
### Links
|
||||
|
||||
After changing _/boot/config.txt_ you must reboot your raspberry pi. Please also ensure you followed setting up your screen via the screen instructions. This will likely have a xorg.conf.d file for input from the touchscreen that you need to create.
|
||||
[Installation](docs/Installation.md)
|
||||
|
||||
### Installation
|
||||
[Configuration](docs/Configuration.md)
|
||||
|
||||
Follow the instructions to install klipper and moonraker.
|
||||
klipper: https://github.com/KevinOConnor/klipper/
|
||||
moonraker: https://github.com/Arksine/moonraker
|
||||
[Panels](docs/panels.md)
|
||||
|
||||
Ensure that 127.0.0.1 is a trusted client for moonraker, such as in this example:
|
||||
```
|
||||
[authorization]
|
||||
trusted_clients:
|
||||
127.0.0.1
|
||||
```
|
||||
|
||||
For moonraker, ensure that 127.0.0.1 is a trusted client:
|
||||
### Sample Panels
|
||||
|
||||
Run _scripts/KlipperScreen-install.sh_
|
||||
This script will install packages that are listed under manual install, create a
|
||||
python virtual environment at ${HOME}/.KlipperScreen-env and install a systemd
|
||||
service file.
|
||||
Main Menu
|
||||

|
||||
|
||||
As an option to do development or interact with KlipperScreen from your computer, you may install tigervnc-scraping-server and VNC to your pi instance. Follow tigervnc server setup procedures for details on how to do that.
|
||||
Job Status
|
||||

|
||||
@@ -1,207 +1,117 @@
|
||||
# Configuration
|
||||
|
||||
In the KlipperScreen folder, a file _KlipperScreen.config_ allows for configuration of the screen. The configuration
|
||||
file is a json formatted file. There are three main options to configure.
|
||||
KlipperScreen has some configuration options which are outlined below. KlipperScreen will search for a configuration
|
||||
file in the following order:
|
||||
_${HOME}/KlipperScreen.conf_
|
||||
_${KlipperScreen_Directory}/KlipperScreen.conf_
|
||||
|
||||
If one of those files are found, it will be used over the default configuration. The default configuration will be
|
||||
merged with the custom configuration, so if you do not define any menus the default menus will be used.The default
|
||||
config is included here: [ks_includes/KlipperScreen.conf](../ks_includes/KlipperScreen.conf)
|
||||
|
||||
## Main Options
|
||||
```
|
||||
{
|
||||
"preheat_options",
|
||||
"mainmenu",
|
||||
"printmenu"
|
||||
}
|
||||
[main]
|
||||
# Invert axis in move panel. Default is False. Change to true to invert
|
||||
invert_x: False
|
||||
invert_y: False
|
||||
invert_z: False
|
||||
|
||||
# Time (seconds) before the Job Status page reverts to main menu after a successful job
|
||||
job_complete_timeout: 30
|
||||
|
||||
# Time (seconds) before the Job Status page reverts to main menu after a successful job.
|
||||
# If this option is 0, the user must click on a button to go back to the main menu.
|
||||
job_error_timeout: 0
|
||||
|
||||
#
|
||||
# The following main options are deprecated and will be removed in the near future
|
||||
#
|
||||
|
||||
# Define the moonraker host/port if different from 127.0.0.1 and 7125
|
||||
moonraker_host: 127.0.0.1
|
||||
moonraker_port: 7125
|
||||
# Moonraker API key if this is not connecting from a trusted client IP
|
||||
moonraker_api_key: False
|
||||
```
|
||||
|
||||
## Printer Options
|
||||
Multiple printers can be defined, currently only the first one will be used until an update in the near future.
|
||||
```
|
||||
# Define printer and name. Name is anything after the first printer word
|
||||
[printer Ender 3 Pro]
|
||||
# Define the moonraker host/port if different from 127.0.0.1 and 7125
|
||||
moonraker_host: 127.0.0.1
|
||||
moonraker_port: 7125
|
||||
# Moonraker API key if this is not connecting from a trusted client IP
|
||||
moonraker_api_key: False
|
||||
```
|
||||
|
||||
|
||||
## Preheat Options
|
||||
Under preheat options, you may specify pre-defined temperatures for easy warmup. Each material should be formatted as
|
||||
follows:
|
||||
```
|
||||
"Material": {
|
||||
"tool": 195,
|
||||
"bed": 40
|
||||
}
|
||||
```
|
||||
Tool is the extruder temperature, bed is the heated bed temperature. An example configuration for PLA and abs would be
|
||||
like this:
|
||||
```
|
||||
"preheat_options": {
|
||||
"PLA": {
|
||||
"tool": 195,
|
||||
"bed": 40
|
||||
},
|
||||
"ABS":{
|
||||
"tool": 220,
|
||||
"bed": 90
|
||||
}
|
||||
}
|
||||
[preheat my_temp_setting]
|
||||
# Temperature for the heated bed
|
||||
bed: 40
|
||||
# Temperature for the tools
|
||||
extruder: 195
|
||||
```
|
||||
|
||||
## Main menu
|
||||
## Menu
|
||||
This allows a custom configuration for the menu displayed while the printer is idle. You can use sub-menus to group
|
||||
different items and there are several panel options available. It is possible to have a gcode script run on a menu
|
||||
button press.
|
||||
|
||||
Available panels:
|
||||
* bed_level: Manual bed level
|
||||
* extrude: Controls for extrusion
|
||||
* fan: Controls fan speed
|
||||
* finetune: Controls for fine-tuning print settings such as z-babystepping or extrustion rate
|
||||
* menu: Allows for a sub-menu
|
||||
* move: Controls the print head
|
||||
* network: Network information panel
|
||||
* preheat: Preheat bed/tools
|
||||
* system: System information panel
|
||||
* temperature: Controls temperature settings
|
||||
* zcalibrate: Calibrating a probe
|
||||
button press. There are two menus available in KlipperScreen, __main and __print. The __main menu is displayed while the
|
||||
printer is idle. The __print menu is accessible from the printing status page.
|
||||
|
||||
A menu item is configured as follows:
|
||||
```
|
||||
{
|
||||
"name": "Name displayed",
|
||||
"icon": "file name from icons folder",
|
||||
"panel": "panel from above options",
|
||||
# Optional parameters
|
||||
"items": [] # Items for a submenu
|
||||
"method": "printer.gcode.script" # Moonraker method for a request
|
||||
"params": {} # Parameters for the moonraker method
|
||||
}
|
||||
[menu __main my_menu_item]
|
||||
# To build a sub-menu of this menu item, you would next use [menu __main my_menu_item sub_menu_item]
|
||||
name: Item Name
|
||||
icon: home
|
||||
# Optional Parameters
|
||||
# Panel from the panels listed below
|
||||
panel: preheat
|
||||
# Moonraker method to call when the item is selected
|
||||
method: printer.gcode.script
|
||||
# Parameters that would be passed with the method above
|
||||
params: {"script":"G28 X"}
|
||||
# Enable allows hiding of a menu if the condition is false. This statement is evaluated in Jinja2
|
||||
# Available variables are listed below.
|
||||
enable: {{ printer.power_devices.count > 0 }}
|
||||
```
|
||||
Available panels are listed here: [docs/panels.md](panels.md)
|
||||
|
||||
Certain variables are available for conditional testing of the enable statement:
|
||||
```
|
||||
printer.bltouch # Available if bltouch section defined in config
|
||||
printer.gcode_macros.count # Number of gcode macros
|
||||
printer.idle_timeout # Idle timeout section
|
||||
printer.pause_resume # Pause resume section of Klipper
|
||||
printer.probe # Available if probe section defined in config
|
||||
printer.power_devices.count # Number of power devices configured in Moonraker
|
||||
```
|
||||
|
||||
|
||||
A sample configuration of a main menu would be as follows:
|
||||
```
|
||||
"mainmenu": [
|
||||
{
|
||||
"name": "Homing",
|
||||
"icon": "home",
|
||||
"panel": "menu",
|
||||
"items": [
|
||||
{
|
||||
"name": "Home All",
|
||||
"icon": "home",
|
||||
"method": "printer.gcode.script",
|
||||
"params": {"script": "G28"}
|
||||
},
|
||||
{
|
||||
"name": "Home X",
|
||||
"icon": "home-x",
|
||||
"method": "printer.gcode.script",
|
||||
"params": {"script": "G28 X"}
|
||||
},
|
||||
{
|
||||
"name": "Home Y",
|
||||
"icon": "home-y",
|
||||
"method": "printer.gcode.script",
|
||||
"params": {"script": "G28 Y"}
|
||||
},
|
||||
{
|
||||
"name": "Home Z",
|
||||
"icon": "home-z",
|
||||
"method": "printer.gcode.script",
|
||||
"params": {"script": "G28 Z"}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Preheat",
|
||||
"icon": "heat-up",
|
||||
"panel": "preheat"
|
||||
},
|
||||
{
|
||||
"name": "Actions" ,
|
||||
"icon": "actions",
|
||||
"panel": "menu",
|
||||
"items": [
|
||||
{
|
||||
"name": "Move",
|
||||
"icon": "move",
|
||||
"panel": "move"
|
||||
},
|
||||
{
|
||||
"name": "Extrude",
|
||||
"icon": "filament",
|
||||
"panel": "extrude"
|
||||
},
|
||||
{
|
||||
"name": "Fan",
|
||||
"icon": "fan",
|
||||
"panel": "fan"
|
||||
},
|
||||
{
|
||||
"name": "Temperature",
|
||||
"icon": "heat-up",
|
||||
"panel": "temperature"
|
||||
},
|
||||
{
|
||||
"name": "Disable Motors",
|
||||
"icon": "motor-off",
|
||||
"method": "printer.gcode.script",
|
||||
"params": {"script": "M18"},
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Configuration",
|
||||
"icon": "control",
|
||||
"panel": "menu",
|
||||
"items": [
|
||||
{
|
||||
"name": "Bed Level",
|
||||
"icon": "bed-level",
|
||||
"panel": "bed_level"
|
||||
},
|
||||
{
|
||||
"name": "ZOffsets",
|
||||
"icon": "z-offset-increase",
|
||||
"panel": "zcalibrate"
|
||||
},
|
||||
{
|
||||
"name": "Network",
|
||||
"icon": "network",
|
||||
"panel": "network"
|
||||
},
|
||||
{
|
||||
"name": "System",
|
||||
"icon": "info",
|
||||
"panel": "system"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Print",
|
||||
"icon": "print",
|
||||
"panel": "print"
|
||||
}
|
||||
]
|
||||
```
|
||||
[menu __main homing]
|
||||
name: Homing
|
||||
icon: home
|
||||
|
||||
## Print menu
|
||||
The print menu controls items that are available during a print job. Certain panels, such as movement or homing, are
|
||||
panels that shouldn't be displayed during a print as they could cause print errors. A default configuration is below:
|
||||
[menu __main preheat]
|
||||
name: Preheat
|
||||
icon: heat-up
|
||||
panel: preheat
|
||||
|
||||
```
|
||||
"printmenu": [
|
||||
{
|
||||
"name": "Temperature",
|
||||
"icon": "heat-up",
|
||||
"panel": "temperature"
|
||||
},
|
||||
{
|
||||
"name": "Tuning",
|
||||
"icon": "fan",
|
||||
"panel": "finetune"
|
||||
},
|
||||
{
|
||||
"name": "Network",
|
||||
"icon": "network",
|
||||
"panel": "network"
|
||||
},
|
||||
{
|
||||
"name": "System",
|
||||
"icon": "info",
|
||||
"panel": "system"
|
||||
},
|
||||
{
|
||||
"name": "Extrude",
|
||||
"icon": "filament",
|
||||
"panel": "extrude"
|
||||
}
|
||||
]
|
||||
[menu __main print]
|
||||
name: Print
|
||||
icon: print
|
||||
panel: print
|
||||
|
||||
[menu __main homing homeall]
|
||||
name: Home All
|
||||
icon: home
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28"}
|
||||
```
|
||||
@@ -0,0 +1,82 @@
|
||||
### Required Hardware
|
||||
KlipperScreen should run on any HDMI touchscreen that you can connect to a computer. The required video driver may
|
||||
be slightly different depending on what model you get. I am developing on a 1024x600 resolution screen. Due to this,
|
||||
other resolutions may not be scaled properly at this moment. UI scaling is a future development item.
|
||||
|
||||
#### Configure Hardware
|
||||
|
||||
Add the following to _/boot/config.txt_. You can alter the hdmi_cvt to your screen specifications. This example is setup
|
||||
for a resolution of 1024x600 and a refresh rate of 60hz.
|
||||
```
|
||||
hdmi_cvt=1024 600 60 6 0 0 0
|
||||
hdmi_group=2
|
||||
hdmi_mode=87
|
||||
hdmi_drive=2
|
||||
```
|
||||
* Development has been using 1024x600 for a screen resolution. Other resolutions may have issues currently
|
||||
|
||||
After changing _/boot/config.txt_ you must reboot your raspberry pi. Please also ensure you followed setting up your screen via the screen instructions. This will likely have a xorg.conf.d file for input from the touchscreen that you need to create.
|
||||
|
||||
### Installation
|
||||
|
||||
#### Setup Raspberry Pi
|
||||
This install process is meant for Raspbian non-desktop version. If you have installed it on the GUI version, use
|
||||
`sudo raspi-config` to set boot to console by choosing the following options in order:
|
||||
* 1 System Options
|
||||
* S5 Boot / Auto Login
|
||||
* B1 Console
|
||||
|
||||
#### Klipper and Moonraker Installation
|
||||
|
||||
Follow the instructions to install klipper and moonraker.
|
||||
klipper: https://github.com/KevinOConnor/klipper/
|
||||
moonraker: https://github.com/Arksine/moonraker
|
||||
|
||||
Ensure that 127.0.0.1 is a trusted client for moonraker, such as in this example:
|
||||
```
|
||||
[authorization]
|
||||
trusted_clients:
|
||||
127.0.0.1
|
||||
```
|
||||
|
||||
If you wish to use the update manager feature of moonraker for KlipperScreen, add the following block into the moonraker
|
||||
configuration:
|
||||
```
|
||||
[update_manager client KlipperScreen]
|
||||
type: git_repo
|
||||
path: /home/pi/KlipperScreen
|
||||
origin: https://github.com/jordanruthe/KlipperScreen.git
|
||||
env: /home/pi/.KlipperScreen-env/bin/python
|
||||
requirements: scripts/KlipperScreen-requirements.txt
|
||||
install_script: scripts/KlipperScreen-install.sh
|
||||
```
|
||||
|
||||
#### KlipperScreen Installation
|
||||
To clone and install execute the following commands:
|
||||
```
|
||||
cd ~/
|
||||
git clone https://github.com/jordanruthe/KlipperScreen.git
|
||||
cd ~/KlipperScreen
|
||||
./scripts/KlipperScreen-install.sh
|
||||
```
|
||||
|
||||
This script will install packages that are listed under manual install, create a python virtual environment at
|
||||
${HOME}/.KlipperScreen-env and install a systemd service file.
|
||||
|
||||
KlipperScreen will create a log file output at `/tmp/KlipperScreen.log`. If you are having issues and KlipperScreen has
|
||||
not gotten to the point where the log file has been created. Run `journalctl -xe -u KlipperScreen` to view the ouput and
|
||||
see any issues that may be happening.
|
||||
|
||||
As an option to do development or interact with KlipperScreen from your computer, you may install tigervnc-scraping-server and VNC to your pi instance. Follow tigervnc server setup procedures for details on how to do that.
|
||||
|
||||
If you need a custom location for the configuration file, you can add -c or --configfile to the systemd file and specify
|
||||
the location of your configuration file.
|
||||
|
||||
#### Touchscreen Calibration
|
||||
Most people don't need to calibrate, but if you do need to calibrate your touchscreen, follow this process:
|
||||
|
||||
```
|
||||
DISPLAY=:0 xinput_calibrator --list
|
||||
Device "wch.cn USB2IIC_CTP_CONTROL" id=6
|
||||
DISPLAY=:0 xinput_calibrator -v --device <id from last command>
|
||||
```
|
||||
@@ -0,0 +1,19 @@
|
||||
## Create Translations
|
||||
|
||||
You can use a editor such as [poedit](https://poedit.net/) to assist in translations. This guide will assume that you
|
||||
will be using poedit.
|
||||
|
||||
This guide will refer to `language designation`. This can be found from running `echo $LANG` on your pi, as long as you
|
||||
have set your pi up for your preferred language.
|
||||
|
||||
#### New Language
|
||||
|
||||
* Select `Create a new translation` or `File -> New from POT/PO` and select `ks_includes/locals/KlipperScreen.pot`.
|
||||
* Enter your language designation.
|
||||
* Create the translations
|
||||
* Save the file as `ks_includes/locales/{LANGUAGE DESIGNATION}/KlipperScreen.po`.
|
||||
* Select `File -> Compile to MO`. Save this file as `ks_includes/locales/{LANGUAGE DESIGNATION}/KlipperScreen.mo`
|
||||
|
||||
Once you have followed those steps, as long as your pi is set up for your preferred language, KlipperScreen will
|
||||
automatically use the translations provided in the file. KlipperScreen currently does not detect RTL languages, but
|
||||
support for RTL is planned in the near future.
|
||||
@@ -1,4 +1,89 @@
|
||||
## Changelog
|
||||
|
||||
#### 2021 02 15
|
||||
* Added action bar to left side (moves the Back, E-stop, and Home buttons)
|
||||
* Added wifi manager. Will show current wifi details in network panel. Will allow switching networks in the future.
|
||||
* Show printer name in main menu (user will need to configure the printer)
|
||||
|
||||
#### 2021 01 21
|
||||
* Configure screen blanking from settings panel
|
||||
|
||||
#### 2021 01 21
|
||||
* !! Important. matchbox-keyboard must be installed. Install script has changed to include this
|
||||
* Added onscreen keyboard
|
||||
* Can now add bed mesh profiles
|
||||
|
||||
#### 2021 01 20
|
||||
* Add different time estimation methods to settings panel
|
||||
* Job status panel will use time estimation method selected from settings panel
|
||||
* Bugfixes to state tracking
|
||||
|
||||
#### 2021 01 10
|
||||
* Added system reboot/shutdown buttons to systems panel.
|
||||
|
||||
#### 2021 01 09
|
||||
* Better RTL support (most panels now properly support RTL)
|
||||
* Fixes to install script for latest version of raspbian.
|
||||
|
||||
#### 2021 01 08
|
||||
* Added settings panel. Invert axis and hiding macros can now be configured from within KlipperScreen
|
||||
|
||||
#### 2021 01 03
|
||||
* Updated base language translation files with new phrases
|
||||
* Allow translations from KlipperScreen.conf for
|
||||
* Update menus for RTL languages
|
||||
* Add fr_FR and he_IL language (courtesy of manu7irl)
|
||||
|
||||
#### 2020 12 21
|
||||
* KlipperScreen doesn't have to be a trusted client. It can use the Moonraker API key
|
||||
* Updates to job_status for multiple extruders. Will now show the current extruder.
|
||||
* Updates to extrude panel to show multiple extruders and allow switching between them.
|
||||
|
||||
#### 2020 12 18
|
||||
* Add gcode_macros panel
|
||||
|
||||
#### 2020 12 16
|
||||
* Config file can now be specified when running from the command line
|
||||
* Moonraker host/port can be specified in the configuration file
|
||||
|
||||
#### 2020 12 09
|
||||
* Z value in job status now reflects the gcode Z value. This allows people with ABL to have a better understanding of Z
|
||||
|
||||
#### 2020 12 08
|
||||
* Screen Width/Height are now definable in the configuration file
|
||||
* Changed job page to allow for more information, display thumbnail of STL
|
||||
* Job page will now say a job is complete and timeout to the main menu (time changeable from the config)
|
||||
* Job page will now stay on the job page if there is an error.
|
||||
* Restart option is available upon a completed/failed job
|
||||
|
||||
#### 2020 12 05
|
||||
* Added ability to invert Z axis in move panel
|
||||
* Fixed problem with metadata being retrieved constantly
|
||||
|
||||
#### 2020 12 04
|
||||
* Removed fan options from fine tuning
|
||||
* Add bed mesh panel
|
||||
* Added more variables to the menu enable option
|
||||
* Hide extrude panel during printing if the printer is not paused
|
||||
* Add fan panel to print control menu
|
||||
* Included screws_tilt_calculate gcode command into the bed level panel. This section must be configured in klipper.
|
||||
|
||||
#### 2020 12 02
|
||||
* Change panel layout: Added Title, Back, Emergency Stop, and Home to panels.
|
||||
|
||||
#### 2020 11 28
|
||||
* Add option for enable in menu for configuration. This can hide certain options
|
||||
* Add Power panel to control power devices via moonraker
|
||||
* Add klipper version to system panel
|
||||
|
||||
#### 2020 11 18
|
||||
* Changed configuration file format.
|
||||
* Moved default configuration file to an include folder.
|
||||
* Added ability to do a confirm dialog from a menu item when running a script
|
||||
* Added "Save Config" button to default configuration's Configuration menu.
|
||||
|
||||
#### 2020 11 14
|
||||
* Update print panel to include line wrapping for longer filenames
|
||||
|
||||
#### 2020 11 13
|
||||
* Fine Tuning Panel is now fully functional: Z BabyStepping, Fan Speed, Speed Factor, and Extrusion Factor
|
||||
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 86 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 131 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 273 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 267 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 86 KiB |
@@ -2,14 +2,88 @@
|
||||
|
||||
### Index
|
||||
* [Main menu](#main-menu)
|
||||
* [Move](#move)
|
||||
* [Preheat](#preheat)
|
||||
* [Job Status](#job-status)
|
||||
* [bed_level](#bed-level)
|
||||
* [extrude](#extrude)
|
||||
* [fan](#fan)
|
||||
* [fine_tune](#finetune)
|
||||
* [gcode_macros](#gcode-macros)
|
||||
* [move](#move)
|
||||
* [network](#network)
|
||||
* [preheat](#preheat)
|
||||
* [print](#print)
|
||||
* [system](#system)
|
||||
* [temperature](#temperature)
|
||||
* [zcalibrate](#zcalibrate)
|
||||
|
||||
|
||||
### Main Menu
|
||||

|
||||

|
||||
|
||||
### Job Status
|
||||

|
||||
|
||||
### Bed Level
|
||||
type: bed_level
|
||||

|
||||
|
||||
The bed level panel has the ability to have preset locations from Klipper. Please see documentation on the following
|
||||
Klipper Sections:
|
||||
* [bed_screws](https://github.com/KevinOConnor/klipper/blob/master/docs/Config_Reference.md#bed_screws)
|
||||
* [screws_tilt_adjust](https://github.com/KevinOConnor/klipper/blob/master/docs/Config_Reference.md#screws_tilt_adjust)
|
||||
|
||||
_Important Note: Due to Klipper using the bltouch/probe offsets in screws_tilt_adjust, if a bltouch/probe is enabled_
|
||||
_KlipperScreen will add the offset to the defined screw values. This will not occur if bed_screws section is used._
|
||||
|
||||
This panel will favor screws_tilt_adjust over the bed_screws section. If screws_tilt_adjust is defined, an extra button
|
||||
for _Screws Calibrate_ will appear. This button runs the SCREWS_TILT_CALCULATE command and shows the results on the
|
||||
panel.
|
||||
|
||||
|
||||
### Extrude
|
||||
type: extrude
|
||||

|
||||
|
||||
### Fan
|
||||
type: fan
|
||||

|
||||
|
||||
### Fine Tune
|
||||
type: fine_tune
|
||||

|
||||
|
||||
### Gcode Macros
|
||||
type: gcode_macros
|
||||

|
||||
|
||||
### Menu
|
||||
type: menu
|
||||

|
||||
|
||||
### Move
|
||||

|
||||
type: move
|
||||

|
||||
|
||||
### Network
|
||||
type: network
|
||||

|
||||
|
||||
### Preheat
|
||||

|
||||
type: preheat
|
||||

|
||||
|
||||
### Print
|
||||
type: print
|
||||

|
||||
|
||||
### System
|
||||
type: system
|
||||

|
||||
|
||||
### Temperature
|
||||
type: temperature
|
||||

|
||||
|
||||
### Z Calibrate
|
||||
type: zcalibrate
|
||||

|
||||
@@ -1,105 +0,0 @@
|
||||
import logging
|
||||
import asyncio
|
||||
import json
|
||||
import os
|
||||
import base64
|
||||
|
||||
import gi
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.KlippyFiles")
|
||||
|
||||
class KlippyFiles:
|
||||
callbacks = []
|
||||
filelist = []
|
||||
files = {}
|
||||
timeout = None
|
||||
|
||||
def __init__(self, screen):
|
||||
self._screen = screen
|
||||
self.timeout = GLib.timeout_add(2000, self.ret_files)
|
||||
|
||||
if not os.path.exists('/tmp/.KS-thumbnails'):
|
||||
os.makedirs('/tmp/.KS-thumbnails')
|
||||
GLib.idle_add(self.ret_files, False)
|
||||
|
||||
|
||||
def _callback(self, result, method, params):
|
||||
if method == "server.files.list":
|
||||
if "result" in result and isinstance(result['result'],list):
|
||||
newfiles = []
|
||||
deletedfiles = self.filelist.copy()
|
||||
for item in result['result']:
|
||||
if item['filename'] in self.files:
|
||||
deletedfiles.remove(item['filename'])
|
||||
else:
|
||||
newfiles.append(item['filename'])
|
||||
logger.debug("New file: %s", item['filename'])
|
||||
self.filelist.append(item['filename'])
|
||||
self.files[item['filename']] = {
|
||||
"size": item['size'],
|
||||
"modified": item['modified']
|
||||
}
|
||||
self.update_metadata(item['filename'])
|
||||
|
||||
if len(self.callbacks) > 0 and (len(newfiles) > 0 or len(deletedfiles) > 0):
|
||||
logger.debug("Running callbacks...")
|
||||
for cb in self.callbacks:
|
||||
cb(newfiles, deletedfiles)
|
||||
|
||||
if len(deletedfiles) > 0:
|
||||
logger.debug("Deleted files: %s", deletedfiles)
|
||||
for file in deletedfiles:
|
||||
self.filelist.remove(file)
|
||||
self.files.pop(file, None)
|
||||
|
||||
#self.get_file_data(item['filename'])
|
||||
#files = [asyncio.create_task(self.get_file_data(file)) for file in self.files]
|
||||
#await asyncio.gather(files)
|
||||
#files = [GLib.idle_add(self.ret_file_data, file) for file in self.files]
|
||||
|
||||
elif method == "server.files.metadata":
|
||||
if "error" in result.keys():
|
||||
logger.debug("Error in getting metadata for %s" %(params['filename']))
|
||||
GLib.timeout_add(2000, self._screen._ws.klippy.get_file_metadata, params['filename'], self._callback)
|
||||
return
|
||||
|
||||
logger.debug("Got metadata for %s" % (result['result']['filename']))
|
||||
for x in result['result']:
|
||||
self.files[params['filename']][x] = result['result'][x]
|
||||
if "thumbnails" in self.files[params['filename']]:
|
||||
self.files[params['filename']]['thumbnails'].sort(key=lambda x: x['size'], reverse=True)
|
||||
|
||||
for thumbnail in self.files[params['filename']]['thumbnails']:
|
||||
f = open("/tmp/.KS-thumbnails/%s-%s" % (params['filename'], thumbnail['size']), "wb")
|
||||
f.write(base64.b64decode(thumbnail['data']))
|
||||
f.close()
|
||||
for cb in self.callbacks:
|
||||
cb([], [], [params['filename']])
|
||||
|
||||
def add_file_callback(self, callback):
|
||||
self.callbacks.append(callback)
|
||||
|
||||
def ret_files(self, retval=True):
|
||||
self._screen._ws.klippy.get_file_list(self._callback)
|
||||
return retval
|
||||
|
||||
def ret_file_data (self, filename):
|
||||
print("Getting file info for %s" % (filename))
|
||||
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
|
||||
|
||||
def get_file_list(self):
|
||||
return self.filelist
|
||||
|
||||
def get_file_info(self, filename):
|
||||
if filename not in self.files:
|
||||
return None
|
||||
|
||||
return self.files[filename]
|
||||
|
||||
def add_file(self, file_name, size, modified, old_file_name = None):
|
||||
print(file_name)
|
||||
|
||||
def update_metadata(self, filename):
|
||||
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
|
||||
@@ -0,0 +1,218 @@
|
||||
[main]
|
||||
moonraker_host: 127.0.0.1
|
||||
moonraker_port: 7125
|
||||
|
||||
[preheat PLA]
|
||||
bed = 40
|
||||
extruder = 195
|
||||
|
||||
[preheat ABS]
|
||||
bed = 90
|
||||
extruder = 220
|
||||
|
||||
[menu __main]
|
||||
name: {{ gettext('Main Menu') }}
|
||||
|
||||
[menu __main homing]
|
||||
name: {{ gettext('Homing') }}
|
||||
icon: home
|
||||
|
||||
[menu __main preheat]
|
||||
name: {{ gettext('Preheat') }}
|
||||
icon: heat-up
|
||||
panel: preheat
|
||||
|
||||
[menu __main actions]
|
||||
name: {{ gettext('Actions') }}
|
||||
icon: actions
|
||||
|
||||
[menu __main config]
|
||||
name: {{ gettext('Configuration') }}
|
||||
icon: control
|
||||
|
||||
[menu __main print]
|
||||
name: {{ gettext('Print') }}
|
||||
icon: print
|
||||
panel: print
|
||||
|
||||
[menu __main homing homeall]
|
||||
name: {{ gettext('Home All') }}
|
||||
icon: home
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28"}
|
||||
|
||||
[menu __main homing homex]
|
||||
name: {{ gettext('Home X') }}
|
||||
icon: home-x
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 X"}
|
||||
|
||||
[menu __main homing homey]
|
||||
name: {{ gettext('Home Y') }}
|
||||
icon: home-y
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 Y"}
|
||||
|
||||
[menu __main homing homez]
|
||||
name: {{ gettext('Home Z') }}
|
||||
icon: home-z
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 Z"}
|
||||
|
||||
[menu __main homing homexy]
|
||||
name: {{ gettext('Home XY') }}
|
||||
icon: home
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 X Y"}
|
||||
|
||||
[menu __main actions move]
|
||||
name: {{ gettext('Move') }}
|
||||
icon: move
|
||||
panel: move
|
||||
|
||||
[menu __main actions extrude]
|
||||
name: {{ gettext('Extrude') }}
|
||||
icon: filament
|
||||
panel: extrude
|
||||
|
||||
[menu __main actions fan]
|
||||
name: {{ gettext('Fan') }}
|
||||
icon: fan
|
||||
panel: fan
|
||||
|
||||
[menu __main actions temperature]
|
||||
name: {{ gettext('Temperature') }}
|
||||
icon: heat-up
|
||||
panel: temperature
|
||||
|
||||
[menu __main actions quad_gantry_level]
|
||||
name: {{ gettext('Quad Gantry Level') }}
|
||||
icon: home-z
|
||||
method: printer.gcode.script
|
||||
params: {"script":"QUAD_GANTRY_LEVEL"}
|
||||
enable: {{ printer.quad_gantry_level is defined }}
|
||||
|
||||
[menu __main actions macros]
|
||||
name: {{ gettext('Macros') }}
|
||||
icon: custom-script
|
||||
panel: gcode_macros
|
||||
enable: {{ printer.gcode_macros.count > 0 }}
|
||||
|
||||
[menu __main actions power]
|
||||
name: {{ gettext('Power') }}
|
||||
icon: shutdown
|
||||
panel: power
|
||||
enable: {{ printer.power_devices.count > 0 }}
|
||||
|
||||
[menu __main actions disablemotors]
|
||||
name: {{ gettext('Disable Motors') }}
|
||||
icon: motor-off
|
||||
method: printer.gcode.script
|
||||
params: {"script":"M18"}
|
||||
|
||||
[menu __main config bedlevel]
|
||||
name: {{ gettext('Bed Level') }}
|
||||
icon: bed-level
|
||||
panel: bed_level
|
||||
|
||||
[menu __main config bedmesh]
|
||||
name: {{ gettext('Bed Mesh') }}
|
||||
icon: bed-level
|
||||
panel: bed_mesh
|
||||
enable: {{ printer.bed_mesh is defined }}
|
||||
|
||||
[menu __main config zoffset]
|
||||
name: {{ gettext('Z Calibrate') }}
|
||||
icon: z-offset-increase
|
||||
panel: zcalibrate
|
||||
enable: {{ ((printer.bltouch is defined) or (printer.probe is defined)) }}
|
||||
|
||||
[menu __main config network]
|
||||
name: {{ gettext('Network') }}
|
||||
icon: network
|
||||
panel: network
|
||||
|
||||
[menu __main config system]
|
||||
name: {{ gettext('System') }}
|
||||
icon: info
|
||||
panel: system
|
||||
|
||||
[menu __main config save]
|
||||
name: {{ gettext('Save Config') }}
|
||||
icon: complete
|
||||
method: printer.gcode.script
|
||||
params: {"script":"SAVE_CONFIG"}
|
||||
confirm:
|
||||
{{ gettext('Save configuration.') }}
|
||||
|
||||
{{ gettext('Klipper will reboot') }}
|
||||
|
||||
[menu __main config settings]
|
||||
name: {{ gettext('Settings') }}
|
||||
icon: settings
|
||||
panel: settings
|
||||
|
||||
[menu __print]
|
||||
name: {{ gettext('Print Control') }}
|
||||
|
||||
[menu __print temperature]
|
||||
name: {{ gettext('Temperature') }}
|
||||
icon: heat-up
|
||||
panel: temperature
|
||||
|
||||
[menu __print tuning]
|
||||
name: {{ gettext('Fine Tuning') }}
|
||||
icon: fan
|
||||
panel: fine_tune
|
||||
|
||||
[menu __print fan]
|
||||
name: {{ gettext('Fan') }}
|
||||
icon: fan
|
||||
panel: fan
|
||||
|
||||
[menu __print extrude]
|
||||
name: {{ gettext('Extrude') }}
|
||||
icon: filament
|
||||
panel: extrude
|
||||
enable: {{ printer.pause_resume.is_paused == True }}
|
||||
|
||||
[menu __print power]
|
||||
name: {{ gettext('Power') }}
|
||||
icon: shutdown
|
||||
panel: power
|
||||
enable: {{ printer.power_devices.count > 0 }}
|
||||
|
||||
[menu __print network]
|
||||
name: {{ gettext('Network') }}
|
||||
icon: network
|
||||
panel: network
|
||||
|
||||
[menu __print system]
|
||||
name: {{ gettext('System') }}
|
||||
icon: info
|
||||
panel: system
|
||||
|
||||
[menu __print settings]
|
||||
name: {{ gettext('Settings') }}
|
||||
icon: settings
|
||||
panel: settings
|
||||
|
||||
|
||||
[menu __splashscreen]
|
||||
name: {{ gettext('Menu') }}
|
||||
|
||||
[menu __splashscreen power]
|
||||
name: {{ gettext('Power') }}
|
||||
icon: shutdown
|
||||
panel: power
|
||||
enable: {{ printer.power_devices.count > 0 }}
|
||||
|
||||
[menu __splashscreen network]
|
||||
name: {{ gettext('Network') }}
|
||||
icon: network
|
||||
panel: network
|
||||
|
||||
[menu __splashscreen system]
|
||||
name: {{ gettext('System') }}
|
||||
icon: info
|
||||
panel: system
|
||||
@@ -34,16 +34,16 @@ class KlippyGcodes:
|
||||
|
||||
@staticmethod
|
||||
def set_bed_temp(temp):
|
||||
return KlippyGcodes.SET_BED_TEMP + " S" + str(temp)
|
||||
return "%s S%s" % (KlippyGcodes.SET_BED_TEMP, str(temp))
|
||||
|
||||
@staticmethod
|
||||
def set_ext_temp(temp, tool=0):
|
||||
return KlippyGcodes.SET_EXT_TEMP + " T" + str(tool) + " S" + str(temp)
|
||||
return "%s T%s S%s" % (KlippyGcodes.SET_EXT_TEMP, str(tool), str(temp))
|
||||
|
||||
@staticmethod
|
||||
def set_fan_speed(speed):
|
||||
speed = str( int(float(int(speed) % 101)/100*255) )
|
||||
return KlippyGcodes.SET_FAN_SPEED + " S"+ speed
|
||||
return "%s S%s" % (KlippyGcodes.SET_FAN_SPEED, speed)
|
||||
|
||||
@staticmethod
|
||||
def set_extrusion_rate(rate):
|
||||
@@ -59,4 +59,16 @@ class KlippyGcodes:
|
||||
|
||||
@staticmethod
|
||||
def extrude(dist, speed=500):
|
||||
return KlippyGcodes.MOVE + " E" + dist + " F" + speed
|
||||
return "%s E%s F%s" % (KlippyGcodes.MOVE, dist, speed)
|
||||
|
||||
@staticmethod
|
||||
def bed_mesh_load(profile):
|
||||
return "BED_MESH_PROFILE LOAD='%s'" % profile
|
||||
|
||||
@staticmethod
|
||||
def bed_mesh_remove(profile):
|
||||
return "BED_MESH_PROFILE REMOVE='%s'" % profile
|
||||
|
||||
@staticmethod
|
||||
def bed_mesh_save(profile):
|
||||
return "BED_MESH_PROFILE SAVE='%s'" % profile
|
||||
@@ -0,0 +1,248 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib, Pango
|
||||
import os
|
||||
klipperscreendir = os.getcwd()
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.KlippyGtk")
|
||||
|
||||
class KlippyGtk:
|
||||
labels = {}
|
||||
font_ratio = 51
|
||||
width_ratio = 16
|
||||
height_ratio = 9.375
|
||||
|
||||
def __init__(self, width, height):
|
||||
self.width = width
|
||||
self.height = height
|
||||
|
||||
self.font_size = int(round(self.width / self.font_ratio))
|
||||
self.header_size = int(round((self.width / self.width_ratio) / 1.33))
|
||||
self.img_width = int(round(self.width / self.width_ratio))
|
||||
self.img_height = int(round(self.height / self.height_ratio))
|
||||
self.action_bar_width = int(self.width * .1)
|
||||
self.header_image_scale_width = 1.2
|
||||
self.header_image_scale_height = 1.4
|
||||
|
||||
logger.debug("img width: %s height: %s" % (self.img_width, self.img_height))
|
||||
|
||||
def get_action_bar_width(self):
|
||||
return self.action_bar_width
|
||||
|
||||
def get_content_width(self):
|
||||
return self.width - self.action_bar_width
|
||||
|
||||
def get_content_height(self):
|
||||
return self.height - self.header_size
|
||||
|
||||
def get_header_size(self):
|
||||
return self.header_size
|
||||
|
||||
def get_header_image_scale(self):
|
||||
return [self.header_image_scale_width, self.header_image_scale_height]
|
||||
|
||||
def get_image_width(self):
|
||||
return self.img_width
|
||||
|
||||
def get_image_height(self):
|
||||
return self.img_height
|
||||
|
||||
def get_font_size(self):
|
||||
return self.font_size
|
||||
|
||||
def Label(self, label, style=None):
|
||||
l = Gtk.Label(label)
|
||||
if style != None and style != False:
|
||||
l.get_style_context().add_class(style)
|
||||
return l
|
||||
|
||||
def ImageLabel(self, image_name, text, size=20, style=False, width_scale=.32, height_scale=.32):
|
||||
box1 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=15)
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
|
||||
"%s/styles/z-bolt/images/%s.svg" % (klipperscreendir, str(image_name)),
|
||||
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
|
||||
|
||||
image = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_text(text)
|
||||
box1.add(image)
|
||||
box1.add(label)
|
||||
|
||||
if style != False:
|
||||
ctx = box1.get_style_context()
|
||||
ctx.add_class(style)
|
||||
|
||||
return {"l": label, "b": box1}
|
||||
|
||||
def Image(self, image_name, style=False, width_scale=1, height_scale=1):
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
|
||||
"%s/styles/z-bolt/images/%s" % (klipperscreendir, str(image_name)),
|
||||
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
|
||||
|
||||
return Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
def ImageFromFile(self, filename, style=False, width_scale=1, height_scale=1):
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename,
|
||||
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
|
||||
|
||||
return Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
def PixbufFromFile(self, filename, style=False, width_scale=1, height_scale=1):
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, int(round(self.img_width * width_scale)),
|
||||
int(round(self.img_height * height_scale)), True)
|
||||
|
||||
return pixbuf
|
||||
|
||||
def ProgressBar(self, style=False):
|
||||
bar = Gtk.ProgressBar()
|
||||
|
||||
if style != False:
|
||||
ctx = bar.get_style_context()
|
||||
ctx.add_class(style)
|
||||
|
||||
return bar
|
||||
|
||||
def Button(self, label=None, style=None):
|
||||
b = Gtk.Button(label=label)
|
||||
b.set_hexpand(True)
|
||||
b.set_vexpand(True)
|
||||
b.set_can_focus(False)
|
||||
b.props.relief = Gtk.ReliefStyle.NONE
|
||||
|
||||
if style != None:
|
||||
b.get_style_context().add_class(style)
|
||||
|
||||
return b
|
||||
|
||||
def ButtonImage(self, image_name, label=None, style=None, width_scale=1, height_scale=1,
|
||||
position=Gtk.PositionType.TOP):
|
||||
filename = "%s/styles/z-bolt/images/%s.svg" % (klipperscreendir, str(image_name))
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
|
||||
filename,
|
||||
int(round(self.img_width * width_scale)),
|
||||
int(round(self.img_height * height_scale)),
|
||||
True
|
||||
)
|
||||
|
||||
img = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
b = Gtk.Button(label=label)
|
||||
b.set_image(img)
|
||||
b.set_hexpand(True)
|
||||
b.set_vexpand(True)
|
||||
b.set_can_focus(False)
|
||||
b.set_image_position(position)
|
||||
b.set_always_show_image(True)
|
||||
b.props.relief = Gtk.ReliefStyle.NONE
|
||||
|
||||
#try:
|
||||
# # Get the label object
|
||||
# child = b.get_children()[0].get_children()[0].get_children()[1]
|
||||
# child.set_line_wrap(True)
|
||||
# child.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
#except:
|
||||
# pass
|
||||
|
||||
if style != None:
|
||||
b.get_style_context().add_class(style)
|
||||
|
||||
return b
|
||||
|
||||
def Dialog(self, screen, buttons, content, callback=None, *args):
|
||||
dialog = Gtk.Dialog()
|
||||
dialog.set_default_size(screen.width - 15, screen.height - 15)
|
||||
dialog.set_resizable(False)
|
||||
dialog.set_transient_for(screen)
|
||||
dialog.set_modal(True)
|
||||
|
||||
for button in buttons:
|
||||
dialog.add_button(button_text=button['name'], response_id=button['response'])
|
||||
|
||||
dialog.connect("response", callback, *args)
|
||||
dialog.get_style_context().add_class("dialog")
|
||||
|
||||
grid = Gtk.Grid()
|
||||
grid.set_size_request(screen.width - 60, -1)
|
||||
grid.set_vexpand(True)
|
||||
grid.set_halign(Gtk.Align.CENTER)
|
||||
grid.set_valign(Gtk.Align.CENTER)
|
||||
grid.add(content)
|
||||
|
||||
content_area = dialog.get_content_area()
|
||||
content_area.set_margin_start(15)
|
||||
content_area.set_margin_end(15)
|
||||
content_area.set_margin_top(15)
|
||||
content_area.set_margin_bottom(15)
|
||||
content_area.add(grid)
|
||||
|
||||
dialog.show_all()
|
||||
|
||||
return dialog, grid
|
||||
|
||||
|
||||
def ToggleButtonImage(self, image_name, label, style=False, width_scale=1, height_scale=1):
|
||||
filename = "%s/styles/z-bolt/images/%s.svg" % (klipperscreendir, str(image_name))
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
|
||||
filename,
|
||||
int(round(self.img_width * width_scale)),
|
||||
int(round(self.img_height * height_scale)),
|
||||
True
|
||||
)
|
||||
|
||||
img = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
b = Gtk.ToggleButton(label=label)
|
||||
#b.props.relief = Gtk.RELIEF_NONE
|
||||
b.set_image(img)
|
||||
b.set_hexpand(True)
|
||||
b.set_vexpand(True)
|
||||
b.set_can_focus(False)
|
||||
b.set_image_position(Gtk.PositionType.TOP)
|
||||
b.set_always_show_image(True)
|
||||
b.props.relief = Gtk.ReliefStyle.NONE
|
||||
|
||||
if style != False:
|
||||
ctx = b.get_style_context()
|
||||
ctx.add_class(style)
|
||||
|
||||
return b
|
||||
|
||||
def HomogeneousGrid(self, width=None, height=None):
|
||||
g = Gtk.Grid()
|
||||
g.set_row_homogeneous(True)
|
||||
g.set_column_homogeneous(True)
|
||||
if width != None and height != None:
|
||||
g.set_size_request(width, height)
|
||||
return g
|
||||
|
||||
def ToggleButton(self, text):
|
||||
b = Gtk.ToggleButton(text)
|
||||
b.props.relief = Gtk.ReliefStyle.NONE
|
||||
b.set_hexpand(True)
|
||||
b.set_vexpand(True)
|
||||
return b
|
||||
|
||||
def formatFileName(self, name):
|
||||
name = name.split('/')[-1] if "/" in name else name
|
||||
name = name.split('.gcod')[0] if ".gcode" in name else name
|
||||
if len(name) > 25:
|
||||
return name[0:25] + "\n" + name[25:50]
|
||||
return name
|
||||
|
||||
|
||||
def formatTimeString(self, seconds):
|
||||
time = int(seconds)
|
||||
text = ""
|
||||
if int(time/3600) !=0:
|
||||
text += str(int(time/3600))+"h "
|
||||
text += str(int(time/60)%60)+"m "+str(time%60)+"s"
|
||||
return text
|
||||
|
||||
def formatTemperatureString(self, temp, target):
|
||||
if (target > temp-2 and target < temp+2) or round(target,0) == 0:
|
||||
return str(round(temp,2)) + "°C" #°C →"
|
||||
return str(round(temp)) + " → " + str(round(target)) + "°C"
|
||||
@@ -0,0 +1,43 @@
|
||||
import json
|
||||
import requests
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.KlippyRest")
|
||||
|
||||
class KlippyRest:
|
||||
def __init__(self, ip, port=7125, api_key=False):
|
||||
self.ip = ip
|
||||
self.port = port
|
||||
self.api_key = api_key
|
||||
|
||||
def get_server_info(self):
|
||||
return self.send_request("server/info")
|
||||
|
||||
def get_oneshot_token(self):
|
||||
r = self.send_request("access/oneshot_token")
|
||||
if r == False:
|
||||
return False
|
||||
return r['result']
|
||||
|
||||
def get_printer_info(self):
|
||||
return self.send_request("printer/info")
|
||||
|
||||
def send_request(self, method):
|
||||
url = "http://%s:%s/%s" % (self.ip, self.port, method)
|
||||
logger.debug("Sending request to %s" % url)
|
||||
headers = {} if self.api_key == False else {"x-api-key":self.api_key}
|
||||
try:
|
||||
r = requests.get(url, headers=headers)
|
||||
except:
|
||||
return False
|
||||
if r.status_code != 200:
|
||||
return False
|
||||
|
||||
#TODO: Try/except
|
||||
try:
|
||||
data = json.loads(r.content)
|
||||
except:
|
||||
logger.exception("Unable to parse response from moonraker:\n %s" % r.content)
|
||||
return False
|
||||
|
||||
return data
|
||||
@@ -13,7 +13,7 @@ logger = logging.getLogger("KlipperScreen.KlipperWebsocket")
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
from KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
|
||||
#f = open("/home/pi/.moonraker_api_key", "r")
|
||||
api_key = "" #f.readline()
|
||||
@@ -35,27 +35,30 @@ api = {
|
||||
class KlippyWebsocket(threading.Thread):
|
||||
_req_id = 0
|
||||
connected = False
|
||||
|
||||
callback_table = {}
|
||||
timeout = None
|
||||
|
||||
def __init__(self, screen, callback):
|
||||
def __init__(self, screen, callback, host, port):
|
||||
threading.Thread.__init__(self)
|
||||
self._screen = screen
|
||||
self._callback = callback
|
||||
self.klippy = MoonrakerApi(self)
|
||||
self.closing = False
|
||||
|
||||
self._url = "127.0.0.1:7125"
|
||||
self._url = "%s:%s" % (host, port)
|
||||
|
||||
def initial_connect(self):
|
||||
# Enable a timeout so that way if moonraker is not running, it will attempt to reconnect
|
||||
if self.timeout == None:
|
||||
self.timeout = GLib.timeout_add(500, self.reconnect)
|
||||
|
||||
def connect (self):
|
||||
r = requests.get(
|
||||
"http://%s%s" % (self._url, api['oneshot_token']['url']),
|
||||
headers={"x-api-key":api_key}
|
||||
)
|
||||
if r.status_code != 200:
|
||||
logger.info("Failed to retrieve oneshot token")
|
||||
return
|
||||
try:
|
||||
token = self._screen.apiclient.get_oneshot_token()
|
||||
except:
|
||||
logger.debug("Unable to get oneshot token")
|
||||
return False
|
||||
|
||||
token = json.loads(r.content)['result']
|
||||
self.ws_url = "ws://%s/websocket?token=%s" % (self._url, token)
|
||||
self.ws = websocket.WebSocketApp(self.ws_url,
|
||||
on_message = lambda ws,msg: self.on_message(ws, msg),
|
||||
@@ -66,7 +69,13 @@ class KlippyWebsocket(threading.Thread):
|
||||
|
||||
self._wst = threading.Thread(target=self.ws.run_forever)
|
||||
self._wst.daemon = True
|
||||
self._wst.start()
|
||||
try:
|
||||
self._wst.start()
|
||||
except Exception:
|
||||
logger.debug("Error starting web socket")
|
||||
|
||||
def close(self):
|
||||
self.closing = True
|
||||
|
||||
def is_connected(self):
|
||||
return self.connected
|
||||
@@ -86,16 +95,19 @@ class KlippyWebsocket(threading.Thread):
|
||||
self.callback_table.pop(response['id'])
|
||||
return
|
||||
|
||||
if "method" in response:
|
||||
if "method" in response and "on_message" in self._callback:
|
||||
Gdk.threads_add_idle(
|
||||
GLib.PRIORITY_HIGH_IDLE,
|
||||
self._callback,
|
||||
self._callback['on_message'],
|
||||
response['method'],
|
||||
response['params'][0] if "params" in response else {}
|
||||
)
|
||||
return
|
||||
|
||||
def send_method(self, method, params={}, callback=None, *args):
|
||||
if self.is_connected() == False:
|
||||
return False
|
||||
|
||||
self._req_id += 1
|
||||
if callback != None:
|
||||
self.callback_table[self._req_id] = [callback, method, params, [*args]]
|
||||
@@ -107,42 +119,62 @@ class KlippyWebsocket(threading.Thread):
|
||||
"id": self._req_id
|
||||
}
|
||||
self.ws.send(json.dumps(data))
|
||||
return True
|
||||
|
||||
def on_open(self, ws):
|
||||
logger.info("### ws open ###")
|
||||
logger.info("Moonraker Websocket Open")
|
||||
logger.info("Self.connected = %s" % self.is_connected())
|
||||
self.connected = True
|
||||
self.timeout = None
|
||||
if "on_connect" in self._callback:
|
||||
Gdk.threads_add_idle(
|
||||
GLib.PRIORITY_HIGH_IDLE,
|
||||
self._callback['on_connect']
|
||||
)
|
||||
|
||||
def on_close(self, ws):
|
||||
logger.info("### ws closed ###")
|
||||
if self.is_connected() == False:
|
||||
logger.debug("Connection already closed")
|
||||
return
|
||||
|
||||
if self.closing == True:
|
||||
logger.debug("Closing websocket")
|
||||
self.ws.stop()
|
||||
return
|
||||
|
||||
logger.info("Moonraker Websocket Closed")
|
||||
self.connected = False
|
||||
if self.timeout == None:
|
||||
self.timeout = GLib.timeout_add(500, self.reconnect)
|
||||
|
||||
# TODO: Make non-blocking
|
||||
Gdk.threads_add_idle(
|
||||
GLib.PRIORITY_HIGH_IDLE,
|
||||
self._screen.printer_initializing,
|
||||
"Connecting to Moonraker..."
|
||||
)
|
||||
if "on_close" in self._callback:
|
||||
Gdk.threads_add_idle(
|
||||
GLib.PRIORITY_HIGH_IDLE,
|
||||
self._callback['on_close'],
|
||||
"Lost Connection to Moonraker"
|
||||
)
|
||||
|
||||
while (True == True):
|
||||
try:
|
||||
info = self._screen.apiclient.get_info()
|
||||
except Exception:
|
||||
continue
|
||||
if info != False:
|
||||
self.connect()
|
||||
if self.is_connected():
|
||||
break
|
||||
logger.info("### Waiting for websocket")
|
||||
time.sleep(.5)
|
||||
def reconnect(self):
|
||||
logger.debug("Attempting to reconnect")
|
||||
if self.is_connected():
|
||||
logger.debug("Reconnected")
|
||||
return False
|
||||
|
||||
Gdk.threads_add_idle(
|
||||
GLib.PRIORITY_HIGH_IDLE,
|
||||
self._screen.printer_ready
|
||||
)
|
||||
self.connect()
|
||||
return True
|
||||
|
||||
|
||||
def on_error(self, ws, error):
|
||||
print(error)
|
||||
logger.debug("Websocket error: %s" % error)
|
||||
if error.status_code == 401:
|
||||
# Check for any pending reconnects and remove. No amount of trying will help
|
||||
if self.timeout != None:
|
||||
GLib.source_remove(self.timeout)
|
||||
Gdk.threads_add_idle(
|
||||
GLib.PRIORITY_HIGH_IDLE,
|
||||
self._callback['on_close'],
|
||||
"Unable to authenticate with moonraker.\nCheck the API key"
|
||||
)
|
||||
|
||||
class MoonrakerApi:
|
||||
def __init__ (self, ws):
|
||||
@@ -150,13 +182,13 @@ class MoonrakerApi:
|
||||
|
||||
def emergency_stop(self):
|
||||
logger.info("Sending printer.emergency_stop")
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.emergency_stop"
|
||||
)
|
||||
|
||||
def gcode_script(self, script, callback=None, *args):
|
||||
logger.debug("Sending printer.gcode.script: %s", script)
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.gcode.script",
|
||||
{"script": script},
|
||||
callback,
|
||||
@@ -166,7 +198,7 @@ class MoonrakerApi:
|
||||
def get_file_list(self, callback=None, *args):
|
||||
#Commenting this log for being too noisy
|
||||
#logger.debug("Sending server.files.list")
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"server.files.list",
|
||||
{},
|
||||
callback,
|
||||
@@ -175,7 +207,7 @@ class MoonrakerApi:
|
||||
|
||||
def get_file_metadata(self, filename, callback=None, *args):
|
||||
logger.debug("Sending server.files.metadata: %s", filename)
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"server.files.metadata",
|
||||
{"filename": filename},
|
||||
callback,
|
||||
@@ -184,14 +216,32 @@ class MoonrakerApi:
|
||||
|
||||
def object_subscription(self, updates):
|
||||
logger.debug("Sending printer.objects.subscribe: %s", str(updates))
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.objects.subscribe",
|
||||
updates
|
||||
)
|
||||
|
||||
def power_device_off(self, device, callback=None, *args):
|
||||
logger.debug("Sending machine.device_power.off: %s" % device)
|
||||
return self._ws.send_method(
|
||||
"machine.device_power.off",
|
||||
{device: False},
|
||||
callback,
|
||||
*args
|
||||
)
|
||||
|
||||
def power_device_on(self, device, callback=None, *args):
|
||||
logger.debug("Sending machine.device_power.on %s" % device)
|
||||
return self._ws.send_method(
|
||||
"machine.device_power.on",
|
||||
{device: False},
|
||||
callback,
|
||||
*args
|
||||
)
|
||||
|
||||
def print_cancel(self, callback=None, *args):
|
||||
logger.debug("Sending printer.print.cancel")
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.print.cancel",
|
||||
{},
|
||||
callback,
|
||||
@@ -200,7 +250,7 @@ class MoonrakerApi:
|
||||
|
||||
def print_pause(self, callback=None, *args):
|
||||
logger.debug("Sending printer.print.pause")
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.print.pause",
|
||||
{},
|
||||
callback,
|
||||
@@ -209,7 +259,7 @@ class MoonrakerApi:
|
||||
|
||||
def print_resume(self, callback=None, *args):
|
||||
logger.debug("Sending printer.print.resume")
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.print.resume",
|
||||
{},
|
||||
callback,
|
||||
@@ -218,7 +268,7 @@ class MoonrakerApi:
|
||||
|
||||
def print_start(self, filename, callback=None, *args):
|
||||
logger.debug("Sending printer.print.start")
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.print.start",
|
||||
{
|
||||
"filename": filename
|
||||
@@ -230,7 +280,7 @@ class MoonrakerApi:
|
||||
def temperature_set(self, heater, target, callback=None, *args):
|
||||
if heater == "heater_bed":
|
||||
logger.debug("Sending printer.gcode.script: %s", KlippyGcodes.set_bed_temp(target))
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.gcode.script",
|
||||
{
|
||||
"script": KlippyGcodes.set_bed_temp(target)
|
||||
@@ -242,7 +292,7 @@ class MoonrakerApi:
|
||||
logger.debug("Sending printer.gcode.script: %s",
|
||||
KlippyGcodes.set_ext_temp(target, heater.replace("tool","")))
|
||||
#TODO: Add max/min limits
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.gcode.script",
|
||||
{
|
||||
"script": KlippyGcodes.set_ext_temp(target, heater.replace("tool",""))
|
||||
@@ -253,7 +303,7 @@ class MoonrakerApi:
|
||||
|
||||
def set_bed_temp(self, target, callback=None, *args):
|
||||
logger.debug("Sending set_bed_temp: %s", KlippyGcodes.set_bed_temp(target))
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.gcode.script",
|
||||
{
|
||||
"script": KlippyGcodes.set_bed_temp(target)
|
||||
@@ -264,7 +314,7 @@ class MoonrakerApi:
|
||||
|
||||
def set_tool_temp(self, tool, target, callback=None, *args):
|
||||
logger.debug("Sending set_tool_temp: %s", KlippyGcodes.set_ext_temp(target, tool))
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.gcode.script",
|
||||
{
|
||||
"script": KlippyGcodes.set_ext_temp(target, tool)
|
||||
@@ -275,12 +325,12 @@ class MoonrakerApi:
|
||||
|
||||
def restart(self):
|
||||
logger.debug("Sending printer.restart")
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.restart"
|
||||
)
|
||||
|
||||
def restart_firmware(self):
|
||||
logger.debug("Sending printer.firmware_restart")
|
||||
self._ws.send_method(
|
||||
return self._ws.send_method(
|
||||
"printer.firmware_restart"
|
||||
)
|
||||
@@ -0,0 +1,298 @@
|
||||
import configparser
|
||||
import os
|
||||
import logging
|
||||
import json
|
||||
import re
|
||||
|
||||
from io import StringIO
|
||||
|
||||
from os import path
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.config")
|
||||
|
||||
SCREEN_BLANKING_OPTIONS = [
|
||||
"300", #5 Minutes
|
||||
"900", #15 Minutes
|
||||
"1800", #30 Minutes
|
||||
"3600", #1 Hour
|
||||
"7200", #2 Hours
|
||||
"14400", #4 Hours
|
||||
]
|
||||
|
||||
class ConfigError(Exception):
|
||||
pass
|
||||
|
||||
class KlipperScreenConfig:
|
||||
config = None
|
||||
configfile_name = "KlipperScreen.conf"
|
||||
do_not_edit_line = "#~# --- Do not edit below this line. This section is auto generated --- #~#"
|
||||
do_not_edit_prefix = "#~#"
|
||||
|
||||
def __init__(self, configfile, lang=None, screen=None):
|
||||
_ = lang.gettext
|
||||
_n = lang.ngettext
|
||||
|
||||
self.configurable_options = [
|
||||
{"invert_x": {"section": "main", "name": _("Invert X"), "type": "binary", "value": "False"}},
|
||||
{"invert_y": {"section": "main", "name": _("Invert Y"), "type": "binary", "value": "False"}},
|
||||
{"invert_z": {"section": "main", "name": _("Invert Z"), "type": "binary", "value": "False"}},
|
||||
{"print_estimate_method": {"section": "main", "name": _("Estimated Time Method"), "type": "dropdown",
|
||||
"value": "file","options":[
|
||||
{"name": _("File Estimation (default)"), "value": "file"},
|
||||
{"name": _("Duration Only"), "value": "duration"},
|
||||
{"name": _("Filament Used"), "value": "filament"},
|
||||
{"name": _("Slicer"), "value": "slicer"}
|
||||
]}},
|
||||
{"screen_blanking": {"section": "main", "name": _("Screen Blanking Time"), "type": "dropdown",
|
||||
"value": "3600", "callback": screen.set_screenblanking_timeout, "options":[
|
||||
{"name": _("Off"), "value": "off"}
|
||||
]}}
|
||||
#{"": {"section": "main", "name": _(""), "type": ""}}
|
||||
]
|
||||
|
||||
index = self.configurable_options.index(
|
||||
[i for i in self.configurable_options if list(i)[0]=="screen_blanking"][0])
|
||||
for num in SCREEN_BLANKING_OPTIONS:
|
||||
hour = int(int(num)/3600)
|
||||
if hour > 0:
|
||||
name = str(hour) + " " + _n("hour","hours", hour)
|
||||
else:
|
||||
name = str(int(int(num)/60)) + " " + _("minutes")
|
||||
self.configurable_options[index]['screen_blanking']['options'].append({
|
||||
"name": name,
|
||||
"value": num
|
||||
})
|
||||
|
||||
self.default_config_path = "%s/ks_includes/%s" % (os.getcwd(), self.configfile_name)
|
||||
self.config = configparser.ConfigParser()
|
||||
self.config_path = self.get_config_file_location(configfile)
|
||||
logger.debug("Config path location: %s" % self.config_path)
|
||||
self.defined_config = None
|
||||
|
||||
try:
|
||||
self.config.read(self.default_config_path)
|
||||
if self.config_path != self.default_config_path:
|
||||
user_def, saved_def = self.separate_saved_config(self.config_path)
|
||||
self.defined_config = configparser.ConfigParser()
|
||||
self.defined_config.read_string(user_def)
|
||||
self.log_config(self.defined_config)
|
||||
self.config.read_string(user_def)
|
||||
if saved_def != None:
|
||||
self.config.read_string(saved_def)
|
||||
except KeyError:
|
||||
raise ConfigError(f"Error reading config: {self.config_path}")
|
||||
|
||||
printers = [i for i in self.config.sections() if i.startswith("printer ")]
|
||||
logger.debug("Printers: %s %s" % (len(printers), printers))
|
||||
self.printers = []
|
||||
for printer in printers:
|
||||
self.printers.append({
|
||||
printer[8:]: {
|
||||
"moonraker_host": self.config.get(printer, "moonraker_host", fallback="127.0.0.1"),
|
||||
"moonraker_port": self.config.get(printer, "moonraker_port", fallback="7125"),
|
||||
"moonraker_api_key": self.config.get(printer, "moonraker_api_key", fallback="")
|
||||
}
|
||||
})
|
||||
if len(printers) <= 0:
|
||||
self.printers.append({
|
||||
"Printer": {
|
||||
"moonraker_host": self.config.get("main", "moonraker_host", fallback="127.0.0.1"),
|
||||
"moonraker_port": self.config.get("main", "moonraker_port", fallback="7125"),
|
||||
"moonraker_api_key": self.config.get("main", "moonraker_api_key", fallback="")
|
||||
}
|
||||
})
|
||||
|
||||
logger.debug("Configured printers: %s" % json.dumps(self.printers, indent=2))
|
||||
|
||||
for item in self.configurable_options:
|
||||
name = list(item)[0]
|
||||
vals = item[name]
|
||||
if vals['section'] not in self.config.sections():
|
||||
self.config.add_section(vals['section'])
|
||||
if name not in list(self.config[vals['section']]):
|
||||
self.config.set(vals['section'], name, vals['value'])
|
||||
#self.build_main_menu(self.config)
|
||||
|
||||
def separate_saved_config(self, config_path):
|
||||
user_def = []
|
||||
saved_def = None
|
||||
found_saved = False
|
||||
if not path.exists(config_path):
|
||||
return [None, None]
|
||||
with open(config_path) as file:
|
||||
for line in file:
|
||||
line = line.replace('\n','')
|
||||
if line == self.do_not_edit_line:
|
||||
found_saved = True
|
||||
saved_def = []
|
||||
continue
|
||||
if found_saved == False:
|
||||
user_def.append(line.replace('\n',''))
|
||||
else:
|
||||
if line.startswith(self.do_not_edit_prefix):
|
||||
saved_def.append(line[(len(self.do_not_edit_prefix)+1):])
|
||||
return ["\n".join(user_def), None if saved_def == None else "\n".join(saved_def)]
|
||||
|
||||
def get_config_file_location(self, file):
|
||||
if not path.exists(file):
|
||||
file = "%s/%s" % (os.getcwd(), self.configfile_name)
|
||||
if not path.exists(file):
|
||||
file = self.default_config_path
|
||||
|
||||
logger.info("Found configuration file at: %s" % file)
|
||||
return file
|
||||
|
||||
def get_config(self):
|
||||
return self.config
|
||||
|
||||
def get_configurable_options(self):
|
||||
return self.configurable_options
|
||||
|
||||
def get_main_config(self):
|
||||
return self.config['main']
|
||||
|
||||
def get_main_config_option(self, option, default=None):
|
||||
return self.config['main'].get(option, default)
|
||||
|
||||
def get_menu_items(self, menu="__main", subsection=""):
|
||||
if subsection != "":
|
||||
subsection = subsection + " "
|
||||
index = "menu %s %s" % (menu, subsection)
|
||||
items = [i[len(index):] for i in self.config.sections() if i.startswith(index)]
|
||||
menu_items = []
|
||||
for item in items:
|
||||
split = item.split()
|
||||
if len(split) == 1:
|
||||
menu_items.append(self._build_menu_item(menu, index + item))
|
||||
|
||||
return menu_items
|
||||
|
||||
def get_menu_name(self, menu="__main", subsection=""):
|
||||
name = ("menu %s %s" % (menu, subsection)) if subsection != "" else ("menu %s" % menu)
|
||||
if name not in self.config:
|
||||
return False
|
||||
return self.config[name].get('name')
|
||||
|
||||
|
||||
def get_preheat_options(self):
|
||||
index = "preheat "
|
||||
items = [i[len(index):] for i in self.config.sections() if i.startswith(index)]
|
||||
|
||||
preheat_options = {}
|
||||
for item in items:
|
||||
preheat_options[item] = self._build_preheat_item(index + item)
|
||||
|
||||
return preheat_options
|
||||
|
||||
def get_printer_power_name(self):
|
||||
return self.config['settings'].get("printer_power_name", "printer")
|
||||
|
||||
def get_printers(self):
|
||||
return self.printers
|
||||
|
||||
def get_user_saved_config(self):
|
||||
if self.config_path != self.default_config_path:
|
||||
print("Get")
|
||||
|
||||
def save_user_config_options(self):
|
||||
save_config = configparser.ConfigParser()
|
||||
for item in self.configurable_options:
|
||||
name = list(item)[0]
|
||||
opt = item[name]
|
||||
curval = self.config[opt['section']].get(name)
|
||||
if curval != opt["value"] or (
|
||||
self.defined_config != None and opt['section'] in self.defined_config.sections() and
|
||||
self.defined_config[opt['section']].get(name,None) not in (None, curval)):
|
||||
if opt['section'] not in save_config.sections():
|
||||
save_config.add_section(opt['section'])
|
||||
save_config.set(opt['section'], name, str(curval))
|
||||
|
||||
if "displayed_macros" in self.config.sections():
|
||||
for item in self.config.options('displayed_macros'):
|
||||
value = self.config['displayed_macros'].getboolean(item, fallback=True)
|
||||
if value == False or (self.defined_config != None and
|
||||
"displayed_macros" in self.defined_config.sections() and
|
||||
self.defined_config['displayed_macros'].getboolean(item, fallback=True) == False and
|
||||
self.defined_config['displayed_macros'].getboolean(item, fallback=True) != value):
|
||||
if "displayed_macros" not in save_config.sections():
|
||||
save_config.add_section("displayed_macros")
|
||||
save_config.set("displayed_macros", item, str(value))
|
||||
|
||||
save_output = self._build_config_string(save_config).split("\n")
|
||||
for i in range(len(save_output)):
|
||||
save_output[i] = "%s %s" % (self.do_not_edit_prefix, save_output[i])
|
||||
|
||||
if self.config_path == self.default_config_path:
|
||||
user_def = ""
|
||||
saved_def = None
|
||||
else:
|
||||
user_def, saved_def = self.separate_saved_config(self.config_path)
|
||||
|
||||
extra_lb = "\n" if saved_def != None else ""
|
||||
contents = "%s\n%s%s\n%s\n%s\n%s\n" % (user_def, self.do_not_edit_line, extra_lb,
|
||||
self.do_not_edit_prefix, "\n".join(save_output), self.do_not_edit_prefix)
|
||||
|
||||
if self.config_path != self.default_config_path:
|
||||
path = self.config_path
|
||||
else:
|
||||
path = os.path.expanduser("~/KlipperScreen.conf")
|
||||
|
||||
try:
|
||||
file = open(path, 'w')
|
||||
file.write(contents)
|
||||
file.close()
|
||||
except:
|
||||
logger.error("Error writing configuration file")
|
||||
|
||||
def set(self, section, name, value):
|
||||
self.config.set(section, name, value)
|
||||
|
||||
def log_config(self, config):
|
||||
lines = [
|
||||
" "
|
||||
"===== Config File =====",
|
||||
re.sub(
|
||||
r'(moonraker_api_key\s*=\s*\S+)',
|
||||
'moonraker_api_key = [redacted]',
|
||||
self._build_config_string(config)
|
||||
),
|
||||
"======================="
|
||||
]
|
||||
logger.info("\n".join(lines))
|
||||
|
||||
def _build_config_string(self, config):
|
||||
sfile = StringIO()
|
||||
config.write(sfile)
|
||||
sfile.seek(0)
|
||||
return sfile.read().strip()
|
||||
|
||||
def _build_menu_item(self, menu, name):
|
||||
if name not in self.config:
|
||||
return False
|
||||
cfg = self.config[name]
|
||||
item = {
|
||||
"name": cfg.get("name"),
|
||||
"icon": cfg.get("icon"),
|
||||
"panel": cfg.get("panel", False),
|
||||
"method": cfg.get("method", False),
|
||||
"confirm": cfg.get("confirm", False),
|
||||
"enable": cfg.get("enable", True)
|
||||
}
|
||||
|
||||
try:
|
||||
item["params"] = json.loads(cfg.get("params", "{}"))
|
||||
except:
|
||||
logger.debug("Unable to parse parameters for [%s]" % name)
|
||||
item["params"] = {}
|
||||
|
||||
return {name[(len(menu) + 6):]: item}
|
||||
|
||||
def _build_preheat_item(self, name):
|
||||
if name not in self.config:
|
||||
return False
|
||||
cfg = self.config[name]
|
||||
item = {
|
||||
"extruder": cfg.getint("extruder", 0),
|
||||
"bed": cfg.getint("bed", 0)
|
||||
}
|
||||
return item
|
||||
@@ -0,0 +1,175 @@
|
||||
import logging
|
||||
import asyncio
|
||||
import json
|
||||
import os
|
||||
import base64
|
||||
|
||||
from contextlib import suppress
|
||||
from threading import Thread
|
||||
|
||||
import gi
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.KlippyFiles")
|
||||
|
||||
RESCAN_INTERVAL = 4
|
||||
|
||||
class KlippyFiles(Thread):
|
||||
callbacks = []
|
||||
filelist = []
|
||||
files = {}
|
||||
metadata_timeout = {}
|
||||
timeout = None
|
||||
thumbnail_dir = "/tmp/.KS-thumbnails"
|
||||
|
||||
def __init__(self, screen, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.loop = None
|
||||
self._poll_task = None
|
||||
self._screen = screen
|
||||
|
||||
if not os.path.exists(self.thumbnail_dir):
|
||||
os.makedirs(self.thumbnail_dir)
|
||||
|
||||
def run(self):
|
||||
self.loop = asyncio.new_event_loop()
|
||||
loop = self.loop
|
||||
asyncio.set_event_loop(loop)
|
||||
try:
|
||||
self._poll_task = asyncio.ensure_future(self._poll())
|
||||
loop.run_forever()
|
||||
loop.run_until_complete(loop.shutdown_asyncgens())
|
||||
|
||||
self._poll_task.cancel()
|
||||
with suppress(asyncio.CancelledError):
|
||||
loop.run_until_complete(self._poll_task)
|
||||
finally:
|
||||
loop.close()
|
||||
|
||||
def stop(self):
|
||||
self.loop.call_soon_threadsafe(self.loop.stop)
|
||||
|
||||
async def _poll(self):
|
||||
await self.ret_files()
|
||||
while True:
|
||||
try:
|
||||
await self.ret_files()
|
||||
except:
|
||||
logger.exception("Poll files error")
|
||||
await asyncio.sleep(4)
|
||||
|
||||
|
||||
def _callback(self, result, method, params):
|
||||
if method == "server.files.list":
|
||||
if "result" in result and isinstance(result['result'],list):
|
||||
newfiles = []
|
||||
deletedfiles = self.filelist.copy()
|
||||
for item in result['result']:
|
||||
if item['filename'] in self.files:
|
||||
deletedfiles.remove(item['filename'])
|
||||
else:
|
||||
newfiles.append(item['filename'])
|
||||
logger.debug("New file: %s", item['filename'])
|
||||
self.filelist.append(item['filename'])
|
||||
self.files[item['filename']] = {
|
||||
"size": item['size'],
|
||||
"modified": item['modified']
|
||||
}
|
||||
self.request_metadata(item['filename'])
|
||||
|
||||
if len(self.callbacks) > 0 and (len(newfiles) > 0 or len(deletedfiles) > 0):
|
||||
logger.debug("Running callbacks...")
|
||||
for cb in self.callbacks:
|
||||
cb(newfiles, deletedfiles, [])
|
||||
|
||||
if len(deletedfiles) > 0:
|
||||
logger.debug("Deleted files: %s", deletedfiles)
|
||||
for file in deletedfiles:
|
||||
self.filelist.remove(file)
|
||||
self.files.pop(file, None)
|
||||
|
||||
elif method == "server.files.metadata":
|
||||
if "error" in result.keys():
|
||||
logger.debug("Error in getting metadata for %s. Retrying in 6 seconds" %(params['filename']))
|
||||
return
|
||||
|
||||
logger.debug("Got metadata for %s" % (result['result']['filename']))
|
||||
|
||||
for x in result['result']:
|
||||
self.files[params['filename']][x] = result['result'][x]
|
||||
if "thumbnails" in self.files[params['filename']]:
|
||||
self.files[params['filename']]['thumbnails'].sort(key=lambda x: x['size'], reverse=True)
|
||||
|
||||
for thumbnail in self.files[params['filename']]['thumbnails']:
|
||||
f = open("%s/%s-%s" % (self.thumbnail_dir, params['filename'].split('/')[-1], thumbnail['size']),
|
||||
"wb")
|
||||
f.write(base64.b64decode(thumbnail['data']))
|
||||
f.close()
|
||||
for cb in self.callbacks:
|
||||
logger.debug("Running metadata callbacks")
|
||||
cb([], [], [params['filename']])
|
||||
|
||||
def add_file_callback(self, callback):
|
||||
try:
|
||||
self.callbacks.append(callback)
|
||||
except:
|
||||
logger.debug("Callback not found: %s" % callback)
|
||||
|
||||
def remove_file_callback(self, callback):
|
||||
if callback in self.callbacks:
|
||||
self.callbacks.pop(self.callbacks.index(callback))
|
||||
|
||||
def add_timeout(self):
|
||||
if self.timeout == None:
|
||||
self.timeout = GLib.timeout_add(4000, self.ret_files)
|
||||
|
||||
def file_exists(self, filename):
|
||||
return True if filename in self.filelist else False
|
||||
|
||||
def file_metadata_exists(self, filename):
|
||||
if not self.file_exists(filename):
|
||||
return False
|
||||
if "slicer" in self.files[filename]:
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_thumbnail_location(self, filename):
|
||||
if not self.has_thumbnail(filename):
|
||||
return None
|
||||
return "%s/%s-%s" % (self.thumbnail_dir, filename.split('/')[-1], self.files[filename]['thumbnails'][0]['size'])
|
||||
|
||||
def has_thumbnail(self, filename):
|
||||
if filename not in self.files:
|
||||
return False
|
||||
return "thumbnails" in self.files[filename] and len(self.files[filename]) > 0
|
||||
|
||||
def remove_timeout(self):
|
||||
if self.timeout != None:
|
||||
self.timeout = None
|
||||
|
||||
def request_metadata(self, filename):
|
||||
if filename not in self.filelist:
|
||||
return False
|
||||
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
|
||||
|
||||
async def ret_files(self, retval=True):
|
||||
logger.debug("Scanning for files")
|
||||
if not self._screen._ws.klippy.get_file_list(self._callback):
|
||||
self.timeout = None
|
||||
|
||||
def ret_file_data (self, filename):
|
||||
print("Getting file info for %s" % (filename))
|
||||
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
|
||||
|
||||
def get_file_list(self):
|
||||
return self.filelist
|
||||
|
||||
def get_file_info(self, filename):
|
||||
if filename not in self.files:
|
||||
return None
|
||||
|
||||
return self.files[filename]
|
||||
|
||||
def add_file(self, file_name, size, modified, old_file_name = None):
|
||||
print(file_name)
|
||||
@@ -0,0 +1,535 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:71
|
||||
msgid "Abort"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:68
|
||||
msgid "Accept"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:26
|
||||
msgid "Actions"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:33
|
||||
msgid "Add bed mesh profile"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:306
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:29
|
||||
msgid "Are you sure you wish to reboot the system?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:32
|
||||
msgid "Are you sure you wish to shutdown the system?"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:114
|
||||
msgid "Bed Level"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:119
|
||||
msgid "Bed Mesh"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:104
|
||||
msgid "Calibrate"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:45
|
||||
msgid "Cancel Change"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:301
|
||||
msgid "Cancel Print"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:305
|
||||
msgid ""
|
||||
"Check /tmp/KlipperScreen.log for more information.\n"
|
||||
"Please submit an issue on GitHub for help."
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:290 panels/temperature.py:150
|
||||
msgid "Close"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:30
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:492
|
||||
msgid "Continue"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:270
|
||||
msgid "Control"
|
||||
msgstr ""
|
||||
|
||||
#: panels/preheat.py:54
|
||||
msgid "Cooldown"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:24
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:53
|
||||
msgid "Decrease"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:122
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:108
|
||||
msgid "Disable Motors"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:107
|
||||
msgid "Disable XY"
|
||||
msgstr ""
|
||||
|
||||
#: panels/settings.py:28
|
||||
msgid "Displayed Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:64
|
||||
msgid "Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:42
|
||||
msgid "Duration Only"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:136
|
||||
msgid "Elapsed:"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:272
|
||||
msgid "Emergency Stop"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:39
|
||||
msgid "Estimated Time Method"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
|
||||
#: ks_includes/KlipperScreen.conf:174
|
||||
msgid "Extrude"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:57
|
||||
msgid "Extrusion +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:61
|
||||
msgid "Extrusion -"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
|
||||
msgid "Fan"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan Off"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:38
|
||||
msgid "Fan On"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Fast"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:43
|
||||
msgid "Filament Used"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:41
|
||||
msgid "File Estimation (default)"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:164
|
||||
msgid "Fine Tuning"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:64 panels/system.py:24
|
||||
msgid "Firmware Restart"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:300 panels/job_status.py:302
|
||||
msgid "Go Back"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
|
||||
msgid "Home All"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:45
|
||||
msgid "Home X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:63
|
||||
msgid "Home XY"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:51
|
||||
msgid "Home Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:57
|
||||
msgid "Home Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
|
||||
msgid "Homing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Increase"
|
||||
msgstr ""
|
||||
|
||||
#. self._load_panels()
|
||||
#: screen.py:149
|
||||
msgid "Initializing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:36
|
||||
msgid "Invert X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:37
|
||||
msgid "Invert Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:38
|
||||
msgid "Invert Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22
|
||||
msgid "Klipper Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:42
|
||||
msgid "Klipper Version"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:418
|
||||
msgid "Klipper has disconnected"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:429
|
||||
msgid ""
|
||||
"Klipper has encountered an error with the micro-controller.\n"
|
||||
"Please recompile and flash."
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:433
|
||||
msgid "Klipper has encountered an error."
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:425
|
||||
msgid ""
|
||||
"Klipper has encountered an error.\n"
|
||||
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:453
|
||||
msgid "Klipper has shutdown"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:449
|
||||
msgid "Klipper is attempting to start"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:148
|
||||
msgid "Klipper will reboot"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:46
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:124
|
||||
msgid "Left:"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:98
|
||||
msgid "Load"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:66
|
||||
msgid "Load Average"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:39
|
||||
msgid "Lower Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:96
|
||||
msgid "Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
|
||||
msgid "Main Menu"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Medium"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
|
||||
msgid "Menu"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:69
|
||||
msgid "Move"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:91
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:23
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
|
||||
#: ks_includes/KlipperScreen.conf:211
|
||||
msgid "Network"
|
||||
msgstr ""
|
||||
|
||||
#: panels/network.py:31
|
||||
msgid "Network Info"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:55
|
||||
msgid "Number Pad"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:48
|
||||
msgid "Off"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:276
|
||||
msgid "Pause"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:470
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
|
||||
#: ks_includes/KlipperScreen.conf:205
|
||||
msgid "Power"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:61
|
||||
msgid "Power On Printer"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:21
|
||||
msgid "Preheat"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
|
||||
msgid "Print"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:156
|
||||
msgid "Print Control"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:171
|
||||
msgid "Print Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:232
|
||||
msgid "Printing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:264
|
||||
msgid "Profile Name:"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:89
|
||||
msgid "Quad Gantry Level"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:37
|
||||
msgid "Raise Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:278 panels/splash_screen.py:62
|
||||
msgid "Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:280
|
||||
msgid "Resume"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:48
|
||||
msgid "Retract"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
|
||||
msgid "Save"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:141
|
||||
msgid "Save Config"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:146
|
||||
msgid "Save configuration."
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:46
|
||||
msgid "Screen Blanking Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:114
|
||||
msgid "Screws Adjust"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Set Speed"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:169
|
||||
msgid "Size"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:44
|
||||
msgid "Slicer"
|
||||
msgstr ""
|
||||
|
||||
#. This line for translations only
|
||||
#: panels/extrude.py:31
|
||||
msgid "Slow"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:39
|
||||
msgid "Sort by: "
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:47
|
||||
msgid "Speed +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:51
|
||||
msgid "Speed -"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
|
||||
#: ks_includes/KlipperScreen.conf:216
|
||||
msgid "System"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:27
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:30
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Shutdown"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
|
||||
#: ks_includes/KlipperScreen.conf:159
|
||||
msgid "Temperature"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:38
|
||||
msgid "Tool"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:167
|
||||
msgid "Uploaded"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:25
|
||||
msgid "X+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:27
|
||||
msgid "X-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:30
|
||||
msgid "Y+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:32
|
||||
msgid "Y-"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:125
|
||||
msgid "Z Calibrate"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:28
|
||||
msgid "Z Offset"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:36 panels/move.py:35
|
||||
msgid "Z+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:40 panels/move.py:37
|
||||
msgid "Z-"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:60
|
||||
msgid "minutes"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:38
|
||||
msgid "mm"
|
||||
msgstr ""
|
||||
@@ -0,0 +1,562 @@
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
#
|
||||
# Jakob Kais <schpuntik@freenet.de>, 2021.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
|
||||
"PO-Revision-Date: 2021-02-12 02:02+0100\n"
|
||||
"Last-Translator: Jakob Kais <schpuntik@freenet.de>\n"
|
||||
"Language-Team: Russian <kde-i18n-de@kde.org>\n"
|
||||
"Language: de_DE\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.3\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "?"
|
||||
msgstr "?"
|
||||
|
||||
#: panels/zcalibrate.py:71
|
||||
msgid "Abort"
|
||||
msgstr "Abbrechen"
|
||||
|
||||
#: panels/zcalibrate.py:68
|
||||
msgid "Accept"
|
||||
msgstr "OK"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:26
|
||||
msgid "Actions"
|
||||
msgstr "Aktionen"
|
||||
|
||||
#: panels/bed_mesh.py:33
|
||||
msgid "Add bed mesh profile"
|
||||
msgstr "Druckbett Mesh Profil hinzufügen"
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr "Möchten Sie wirklich drucken"
|
||||
|
||||
#: panels/job_status.py:306
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr "Möchten Sie diesen Druck wirklich abbrechen?"
|
||||
|
||||
#: panels/system.py:29
|
||||
msgid "Are you sure you wish to reboot the system?"
|
||||
msgstr "Möchten Sie das System wirklich neu starten?"
|
||||
|
||||
#: panels/system.py:32
|
||||
msgid "Are you sure you wish to shutdown the system?"
|
||||
msgstr "Möchten Sie das System wirklich herunterfahren?"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:114
|
||||
msgid "Bed Level"
|
||||
msgstr "Druckbett leveln"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:119
|
||||
msgid "Bed Mesh"
|
||||
msgstr "Druckbett Mesh-Level"
|
||||
|
||||
#: panels/bed_mesh.py:104
|
||||
msgid "Calibrate"
|
||||
msgstr "Kalibrieren"
|
||||
|
||||
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
|
||||
msgid "Cancel"
|
||||
msgstr "Abbruch"
|
||||
|
||||
#: panels/fan.py:45
|
||||
msgid "Cancel Change"
|
||||
msgstr "Änderung abbrechen"
|
||||
|
||||
#: panels/job_status.py:301
|
||||
msgid "Cancel Print"
|
||||
msgstr "Druck abbrechen"
|
||||
|
||||
#: screen.py:305
|
||||
msgid ""
|
||||
"Check /tmp/KlipperScreen.log for more information.\n"
|
||||
"Please submit an issue on GitHub for help."
|
||||
msgstr ""
|
||||
"Prüfe /tmp/KlipperScreen.log für weitere Informationen.\n"
|
||||
"Bitte eröffne einen Fehlerbericht auf https://git.io/JLNn4 für Hilfe."
|
||||
|
||||
#: panels/bed_mesh.py:290 panels/temperature.py:150
|
||||
msgid "Close"
|
||||
msgstr "Schließen"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:30
|
||||
msgid "Configuration"
|
||||
msgstr "Einstellungen"
|
||||
|
||||
#: screen.py:492
|
||||
msgid "Continue"
|
||||
msgstr "Fortsetzen"
|
||||
|
||||
#: panels/job_status.py:270
|
||||
msgid "Control"
|
||||
msgstr "Steuerung"
|
||||
|
||||
#: panels/preheat.py:54
|
||||
msgid "Cooldown"
|
||||
msgstr "Abkühlen"
|
||||
|
||||
#: panels/print.py:24
|
||||
msgid "Date"
|
||||
msgstr "Datum"
|
||||
|
||||
#: panels/temperature.py:53
|
||||
msgid "Decrease"
|
||||
msgstr "Verringern"
|
||||
|
||||
#: panels/bed_mesh.py:122
|
||||
msgid "Delete"
|
||||
msgstr "Löschen"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:108
|
||||
msgid "Disable Motors"
|
||||
msgstr "Motoren deaktivieren"
|
||||
|
||||
#: panels/bed_level.py:107
|
||||
msgid "Disable XY"
|
||||
msgstr "Achse XY deaktivieren"
|
||||
|
||||
#: panels/settings.py:28
|
||||
msgid "Displayed Macros"
|
||||
msgstr "Aktive Macros"
|
||||
|
||||
#: panels/zcalibrate.py:64
|
||||
msgid "Distance (mm)"
|
||||
msgstr "Entfernung (mm)"
|
||||
|
||||
#: ks_includes/config.py:42
|
||||
msgid "Duration Only"
|
||||
msgstr "Reine Druckzeit"
|
||||
|
||||
#: panels/job_status.py:136
|
||||
msgid "Elapsed:"
|
||||
msgstr "Verstrichene Zeit:"
|
||||
|
||||
#: panels/job_status.py:272
|
||||
msgid "Emergency Stop"
|
||||
msgstr "NOT-STOP"
|
||||
|
||||
#: ks_includes/config.py:39
|
||||
msgid "Estimated Time Method"
|
||||
msgstr "Druckzeit"
|
||||
|
||||
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
|
||||
#: ks_includes/KlipperScreen.conf:174
|
||||
msgid "Extrude"
|
||||
msgstr "Filament fördern"
|
||||
|
||||
#: panels/fine_tune.py:57
|
||||
msgid "Extrusion +"
|
||||
msgstr "Extrusion +"
|
||||
|
||||
#: panels/fine_tune.py:61
|
||||
msgid "Extrusion -"
|
||||
msgstr "Extrusion -"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
|
||||
msgid "Fan"
|
||||
msgstr "Lüfter"
|
||||
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan Off"
|
||||
msgstr "Lüfter Aus"
|
||||
|
||||
#: panels/fan.py:38
|
||||
msgid "Fan On"
|
||||
msgstr "Lüfter An"
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Fast"
|
||||
msgstr "Schnell"
|
||||
|
||||
#: ks_includes/config.py:43
|
||||
msgid "Filament Used"
|
||||
msgstr "Filamentverbrauch"
|
||||
|
||||
#: ks_includes/config.py:41
|
||||
msgid "File Estimation (default)"
|
||||
msgstr "Dateischätzung (Standard)"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:164
|
||||
msgid "Fine Tuning"
|
||||
msgstr "Feintuning"
|
||||
|
||||
#: panels/splash_screen.py:64 panels/system.py:24
|
||||
msgid "Firmware Restart"
|
||||
msgstr ""
|
||||
"Firmware\n"
|
||||
" neustarten"
|
||||
|
||||
#: screen.py:300 panels/job_status.py:302
|
||||
msgid "Go Back"
|
||||
msgstr "Zurück"
|
||||
|
||||
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
|
||||
msgid "Home All"
|
||||
msgstr ""
|
||||
"Alle Achsen\n"
|
||||
"zurücksetzen"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:45
|
||||
msgid "Home X"
|
||||
msgstr ""
|
||||
"Achse X\n"
|
||||
"zurücksetzen"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:63
|
||||
msgid "Home XY"
|
||||
msgstr ""
|
||||
"Achse XY\n"
|
||||
"zurücksetzen"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:51
|
||||
msgid "Home Y"
|
||||
msgstr ""
|
||||
"Achse Y\n"
|
||||
"zurücksetzen"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:57
|
||||
msgid "Home Z"
|
||||
msgstr ""
|
||||
"Achse Z\n"
|
||||
"zurücksetzen"
|
||||
|
||||
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
|
||||
msgid "Homing"
|
||||
msgstr "Grundposition"
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Increase"
|
||||
msgstr "Erhöhen"
|
||||
|
||||
#. self._load_panels()
|
||||
#: screen.py:149
|
||||
msgid "Initializing"
|
||||
msgstr "Startvorgang"
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr "Drucker wird initialisiert..."
|
||||
|
||||
#: ks_includes/config.py:36
|
||||
msgid "Invert X"
|
||||
msgstr "Achse X invertieren"
|
||||
|
||||
#: ks_includes/config.py:37
|
||||
msgid "Invert Y"
|
||||
msgstr "Achse Y invertieren"
|
||||
|
||||
#: ks_includes/config.py:38
|
||||
msgid "Invert Z"
|
||||
msgstr "Achse Z invertieren"
|
||||
|
||||
#: panels/system.py:22
|
||||
msgid "Klipper Restart"
|
||||
msgstr ""
|
||||
"Klipper\n"
|
||||
" neustarten"
|
||||
|
||||
#: panels/system.py:42
|
||||
msgid "Klipper Version"
|
||||
msgstr "Klipper Version"
|
||||
|
||||
#: screen.py:418
|
||||
msgid "Klipper has disconnected"
|
||||
msgstr "Klipper nicht verbunden"
|
||||
|
||||
#: screen.py:429
|
||||
msgid ""
|
||||
"Klipper has encountered an error with the micro-controller.\n"
|
||||
"Please recompile and flash."
|
||||
msgstr ""
|
||||
"Klipper hat einen Fehler mit dem Mainboard festgestellt.\n"
|
||||
"Bitte Mainboard neu programmieren."
|
||||
|
||||
#: screen.py:433
|
||||
msgid "Klipper has encountered an error."
|
||||
msgstr "Klipper hat einen Fehler festgestellt."
|
||||
|
||||
#: screen.py:425
|
||||
msgid ""
|
||||
"Klipper has encountered an error.\n"
|
||||
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
msgstr ""
|
||||
"Klipper hat einen Fehler festgestellt.\n"
|
||||
"Führe einen FIRMWARE_RESTART durch um den Fehler zu beheben."
|
||||
|
||||
#: screen.py:453
|
||||
msgid "Klipper has shutdown"
|
||||
msgstr "Klipper abgeschaltet"
|
||||
|
||||
#: screen.py:449
|
||||
msgid "Klipper is attempting to start"
|
||||
msgstr "Klipper ist startbereit"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:148
|
||||
msgid "Klipper will reboot"
|
||||
msgstr "Klipper startet neu"
|
||||
|
||||
#: panels/system.py:46
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr "KlipperScreen Version"
|
||||
|
||||
#: panels/job_status.py:124
|
||||
msgid "Left:"
|
||||
msgstr "Restzeit:"
|
||||
|
||||
#: panels/bed_mesh.py:98
|
||||
msgid "Load"
|
||||
msgstr "Belastung"
|
||||
|
||||
#: panels/system.py:66
|
||||
msgid "Load Average"
|
||||
msgstr "Durchschnittslast"
|
||||
|
||||
#: panels/zcalibrate.py:39
|
||||
msgid "Lower Nozzle"
|
||||
msgstr "Düse absenken"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:96
|
||||
msgid "Macros"
|
||||
msgstr "Makros"
|
||||
|
||||
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
|
||||
msgid "Main Menu"
|
||||
msgstr "Hauptmenü"
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Medium"
|
||||
msgstr "Mittel"
|
||||
|
||||
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
|
||||
msgid "Menu"
|
||||
msgstr "Menü"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:69
|
||||
msgid "Move"
|
||||
msgstr "Bewegen"
|
||||
|
||||
#: panels/move.py:91
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr "Bewegungsdistanz (mm)"
|
||||
|
||||
#: panels/print.py:23
|
||||
msgid "Name"
|
||||
msgstr "Name"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
|
||||
#: ks_includes/KlipperScreen.conf:211
|
||||
msgid "Network"
|
||||
msgstr "Netzwerk"
|
||||
|
||||
#: panels/network.py:31
|
||||
msgid "Network Info"
|
||||
msgstr "Netzwerkinfo"
|
||||
|
||||
#: panels/temperature.py:55
|
||||
msgid "Number Pad"
|
||||
msgstr "Nummernblock"
|
||||
|
||||
#: ks_includes/config.py:48
|
||||
msgid "Off"
|
||||
msgstr "Ausschalten"
|
||||
|
||||
#: panels/job_status.py:276
|
||||
msgid "Pause"
|
||||
msgstr "Pause"
|
||||
|
||||
#: panels/job_status.py:470
|
||||
msgid "Paused"
|
||||
msgstr "Pausiert"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
|
||||
#: ks_includes/KlipperScreen.conf:205
|
||||
msgid "Power"
|
||||
msgstr "Ein"
|
||||
|
||||
#: panels/splash_screen.py:61
|
||||
msgid "Power On Printer"
|
||||
msgstr "Drucker einschalten"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:21
|
||||
msgid "Preheat"
|
||||
msgstr "Vorheizen"
|
||||
|
||||
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
|
||||
msgid "Print"
|
||||
msgstr "Druck"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:156
|
||||
msgid "Print Control"
|
||||
msgstr "Druck Steuerung"
|
||||
|
||||
#: panels/print.py:171
|
||||
msgid "Print Time"
|
||||
msgstr "Druckzeit"
|
||||
|
||||
#: panels/job_status.py:232
|
||||
msgid "Printing"
|
||||
msgstr "Drucken"
|
||||
|
||||
#: panels/bed_mesh.py:264
|
||||
msgid "Profile Name:"
|
||||
msgstr "Profil Name:"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:89
|
||||
msgid "Quad Gantry Level"
|
||||
msgstr "Quad Gantry Level"
|
||||
|
||||
#: panels/zcalibrate.py:37
|
||||
msgid "Raise Nozzle"
|
||||
msgstr "Düse anheben"
|
||||
|
||||
#: panels/job_status.py:278 panels/splash_screen.py:62
|
||||
msgid "Restart"
|
||||
msgstr "Neustart"
|
||||
|
||||
#: panels/job_status.py:280
|
||||
msgid "Resume"
|
||||
msgstr "Fortsetzen"
|
||||
|
||||
#: panels/extrude.py:48
|
||||
msgid "Retract"
|
||||
msgstr "Zurückziehen"
|
||||
|
||||
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
|
||||
msgid "Save"
|
||||
msgstr "Speichern"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:141
|
||||
msgid "Save Config"
|
||||
msgstr "Einstellungen speichern"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:146
|
||||
msgid "Save configuration."
|
||||
msgstr "Speichere Einstellungen."
|
||||
|
||||
#: ks_includes/config.py:46
|
||||
msgid "Screen Blanking Time"
|
||||
msgstr "Bildschirm Ausblenden in"
|
||||
|
||||
#: panels/bed_level.py:114
|
||||
msgid "Screws Adjust"
|
||||
msgstr "Schrauben Einstellen"
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Set Speed"
|
||||
msgstr "Geschwindigkeit einstellen"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
|
||||
msgid "Settings"
|
||||
msgstr "Einstellungen"
|
||||
|
||||
#: panels/print.py:169
|
||||
msgid "Size"
|
||||
msgstr "Größe"
|
||||
|
||||
#: ks_includes/config.py:44
|
||||
msgid "Slicer"
|
||||
msgstr "Slicer"
|
||||
|
||||
#. This line for translations only
|
||||
#: panels/extrude.py:31
|
||||
msgid "Slow"
|
||||
msgstr "Langsam"
|
||||
|
||||
#: panels/print.py:39
|
||||
msgid "Sort by: "
|
||||
msgstr "Sortieren nach: "
|
||||
|
||||
#: panels/fine_tune.py:47
|
||||
msgid "Speed +"
|
||||
msgstr "Geschwindigkeit +"
|
||||
|
||||
#: panels/fine_tune.py:51
|
||||
msgid "Speed -"
|
||||
msgstr "Geschwindigkeit -"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
|
||||
#: ks_includes/KlipperScreen.conf:216
|
||||
msgid "System"
|
||||
msgstr "System"
|
||||
|
||||
#: panels/system.py:27
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Restart"
|
||||
msgstr ""
|
||||
"Drucker\n"
|
||||
"Neustarten"
|
||||
|
||||
#: panels/system.py:30
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Shutdown"
|
||||
msgstr ""
|
||||
"Drucker\n"
|
||||
"Ausschalten"
|
||||
|
||||
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
|
||||
#: ks_includes/KlipperScreen.conf:159
|
||||
msgid "Temperature"
|
||||
msgstr "Temperatur"
|
||||
|
||||
#: panels/extrude.py:38
|
||||
msgid "Tool"
|
||||
msgstr "Druckkopf"
|
||||
|
||||
#: panels/print.py:167
|
||||
msgid "Uploaded"
|
||||
msgstr "Hochgeladen"
|
||||
|
||||
#: panels/move.py:25
|
||||
msgid "X+"
|
||||
msgstr "X+"
|
||||
|
||||
#: panels/move.py:27
|
||||
msgid "X-"
|
||||
msgstr "X-"
|
||||
|
||||
#: panels/move.py:30
|
||||
msgid "Y+"
|
||||
msgstr "Y+"
|
||||
|
||||
#: panels/move.py:32
|
||||
msgid "Y-"
|
||||
msgstr "Y-"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:125
|
||||
msgid "Z Calibrate"
|
||||
msgstr "Höhe Kalibrieren"
|
||||
|
||||
#: panels/zcalibrate.py:28
|
||||
msgid "Z Offset"
|
||||
msgstr "Z Offset"
|
||||
|
||||
#: panels/fine_tune.py:36 panels/move.py:35
|
||||
msgid "Z+"
|
||||
msgstr "Z+"
|
||||
|
||||
#: panels/fine_tune.py:40 panels/move.py:37
|
||||
msgid "Z-"
|
||||
msgstr "Z-"
|
||||
|
||||
#: ks_includes/config.py:60
|
||||
msgid "minutes"
|
||||
msgstr "Minuten"
|
||||
|
||||
#: panels/fine_tune.py:38
|
||||
msgid "mm"
|
||||
msgstr "mm"
|
||||
|
||||
#~ msgid "Klipper"
|
||||
#~ msgstr "Klipper"
|
||||
@@ -0,0 +1,516 @@
|
||||
#: panels/print.py:247
|
||||
msgid "?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:71
|
||||
msgid "Abort"
|
||||
msgstr "Abort"
|
||||
|
||||
#: panels/zcalibrate.py:68
|
||||
msgid "Accept"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:26
|
||||
msgid "Actions"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:33
|
||||
msgid "Add bed mesh profile"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:306
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:29
|
||||
msgid "Are you sure you wish to reboot the system?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:32
|
||||
msgid "Are you sure you wish to shutdown the system?"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:114
|
||||
msgid "Bed Level"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:119
|
||||
msgid "Bed Mesh"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:104
|
||||
msgid "Calibrate"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:45
|
||||
msgid "Cancel Change"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:301
|
||||
msgid "Cancel Print"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:305
|
||||
msgid ""
|
||||
"Check /tmp/KlipperScreen.log for more information.\n"
|
||||
"Please submit an issue on GitHub for help."
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:290 panels/temperature.py:150
|
||||
msgid "Close"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:30
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:492
|
||||
msgid "Continue"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:270
|
||||
msgid "Control"
|
||||
msgstr ""
|
||||
|
||||
#: panels/preheat.py:54
|
||||
msgid "Cooldown"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:24
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:53
|
||||
msgid "Decrease"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:122
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:108
|
||||
msgid "Disable Motors"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:107
|
||||
msgid "Disable XY"
|
||||
msgstr ""
|
||||
|
||||
#: panels/settings.py:28
|
||||
msgid "Displayed Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:64
|
||||
msgid "Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:42
|
||||
msgid "Duration Only"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:136
|
||||
msgid "Elapsed:"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:272
|
||||
msgid "Emergency Stop"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:39
|
||||
msgid "Estimated Time Method"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
|
||||
#: ks_includes/KlipperScreen.conf:174
|
||||
msgid "Extrude"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:57
|
||||
msgid "Extrusion +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:61
|
||||
msgid "Extrusion -"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
|
||||
msgid "Fan"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan Off"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:38
|
||||
msgid "Fan On"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Fast"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:43
|
||||
msgid "Filament Used"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:41
|
||||
msgid "File Estimation (default)"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:164
|
||||
msgid "Fine Tuning"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:64 panels/system.py:24
|
||||
msgid "Firmware Restart"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:300 panels/job_status.py:302
|
||||
msgid "Go Back"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
|
||||
msgid "Home All"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:45
|
||||
msgid "Home X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:63
|
||||
msgid "Home XY"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:51
|
||||
msgid "Home Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:57
|
||||
msgid "Home Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
|
||||
msgid "Homing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Increase"
|
||||
msgstr ""
|
||||
|
||||
#. self._load_panels()
|
||||
#: screen.py:149
|
||||
msgid "Initializing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:36
|
||||
msgid "Invert X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:37
|
||||
msgid "Invert Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:38
|
||||
msgid "Invert Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22
|
||||
msgid "Klipper Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:42
|
||||
msgid "Klipper Version"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:418
|
||||
msgid "Klipper has disconnected"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:429
|
||||
msgid ""
|
||||
"Klipper has encountered an error with the micro-controller.\n"
|
||||
"Please recompile and flash."
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:433
|
||||
msgid "Klipper has encountered an error."
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:425
|
||||
msgid ""
|
||||
"Klipper has encountered an error.\n"
|
||||
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:453
|
||||
msgid "Klipper has shutdown"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:449
|
||||
msgid "Klipper is attempting to start"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:148
|
||||
msgid "Klipper will reboot"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:46
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:124
|
||||
msgid "Left:"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:98
|
||||
msgid "Load"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:66
|
||||
msgid "Load Average"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:39
|
||||
msgid "Lower Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:96
|
||||
msgid "Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
|
||||
msgid "Main Menu"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Medium"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
|
||||
msgid "Menu"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:69
|
||||
msgid "Move"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:91
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:23
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
|
||||
#: ks_includes/KlipperScreen.conf:211
|
||||
msgid "Network"
|
||||
msgstr ""
|
||||
|
||||
#: panels/network.py:31
|
||||
msgid "Network Info"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:55
|
||||
msgid "Number Pad"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:48
|
||||
msgid "Off"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:276
|
||||
msgid "Pause"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:470
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
|
||||
#: ks_includes/KlipperScreen.conf:205
|
||||
msgid "Power"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:61
|
||||
msgid "Power On Printer"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:21
|
||||
msgid "Preheat"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
|
||||
msgid "Print"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:156
|
||||
msgid "Print Control"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:171
|
||||
msgid "Print Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:232
|
||||
msgid "Printing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:264
|
||||
msgid "Profile Name:"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:89
|
||||
msgid "Quad Gantry Level"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:37
|
||||
msgid "Raise Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:278 panels/splash_screen.py:62
|
||||
msgid "Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:280
|
||||
msgid "Resume"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:48
|
||||
msgid "Retract"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
|
||||
msgid "Save"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:141
|
||||
msgid "Save Config"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:146
|
||||
msgid "Save configuration."
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:46
|
||||
msgid "Screen Blanking Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:114
|
||||
msgid "Screws Adjust"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Set Speed"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:169
|
||||
msgid "Size"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:44
|
||||
msgid "Slicer"
|
||||
msgstr ""
|
||||
|
||||
#. This line for translations only
|
||||
#: panels/extrude.py:31
|
||||
msgid "Slow"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:39
|
||||
msgid "Sort by: "
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:47
|
||||
msgid "Speed +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:51
|
||||
msgid "Speed -"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
|
||||
#: ks_includes/KlipperScreen.conf:216
|
||||
msgid "System"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:27
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:30
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Shutdown"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
|
||||
#: ks_includes/KlipperScreen.conf:159
|
||||
msgid "Temperature"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:38
|
||||
msgid "Tool"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:167
|
||||
msgid "Uploaded"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:25
|
||||
msgid "X+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:27
|
||||
msgid "X-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:30
|
||||
msgid "Y+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:32
|
||||
msgid "Y-"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:125
|
||||
msgid "Z Calibrate"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:28
|
||||
msgid "Z Offset"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:36 panels/move.py:35
|
||||
msgid "Z+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:40 panels/move.py:37
|
||||
msgid "Z-"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:60
|
||||
msgid "minutes"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:38
|
||||
msgid "mm"
|
||||
msgstr ""
|
||||
@@ -0,0 +1,579 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
|
||||
"PO-Revision-Date: 2021-01-03 23:18+0200\n"
|
||||
"Last-Translator: Emanuel Sharvit <manu7irl@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: fr_FR\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "?"
|
||||
msgstr "?"
|
||||
|
||||
#: panels/zcalibrate.py:71
|
||||
msgid "Abort"
|
||||
msgstr "Annuler"
|
||||
|
||||
#: panels/zcalibrate.py:68
|
||||
msgid "Accept"
|
||||
msgstr "Accepter"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:26
|
||||
msgid "Actions"
|
||||
msgstr "Actions"
|
||||
|
||||
#: panels/bed_mesh.py:33
|
||||
msgid "Add bed mesh profile"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr "Es tu sure de vouloir imprimer"
|
||||
|
||||
#: panels/job_status.py:306
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr "Es tu sure de vouloir annuler cette impression?"
|
||||
|
||||
#: panels/system.py:29
|
||||
#, fuzzy
|
||||
msgid "Are you sure you wish to reboot the system?"
|
||||
msgstr "Es tu sure de vouloir annuler cette impression?"
|
||||
|
||||
#: panels/system.py:32
|
||||
#, fuzzy
|
||||
msgid "Are you sure you wish to shutdown the system?"
|
||||
msgstr "Es tu sure de vouloir annuler cette impression?"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:114
|
||||
msgid "Bed Level"
|
||||
msgstr "Nivelage du plateau"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:119
|
||||
msgid "Bed Mesh"
|
||||
msgstr "Grille du plateau"
|
||||
|
||||
#: panels/bed_mesh.py:104
|
||||
#, fuzzy
|
||||
msgid "Calibrate"
|
||||
msgstr "Calibration Z"
|
||||
|
||||
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#: panels/fan.py:45
|
||||
msgid "Cancel Change"
|
||||
msgstr "Annuler le changement"
|
||||
|
||||
#: panels/job_status.py:301
|
||||
msgid "Cancel Print"
|
||||
msgstr "Annuler l'impression"
|
||||
|
||||
#: screen.py:305
|
||||
msgid ""
|
||||
"Check /tmp/KlipperScreen.log for more information.\n"
|
||||
"Please submit an issue on GitHub for help."
|
||||
msgstr ""
|
||||
"Verifier /tmp/KlipperScreen.log pour plus d'imformation.\n"
|
||||
"SVP envoie une requte sur GITHUB pour obtenir de l'aide"
|
||||
|
||||
#: panels/bed_mesh.py:290 panels/temperature.py:150
|
||||
msgid "Close"
|
||||
msgstr "Fermer"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:30
|
||||
msgid "Configuration"
|
||||
msgstr "Configuration"
|
||||
|
||||
#: screen.py:492
|
||||
msgid "Continue"
|
||||
msgstr "Continuer"
|
||||
|
||||
#: panels/job_status.py:270
|
||||
msgid "Control"
|
||||
msgstr "Controle"
|
||||
|
||||
#: panels/preheat.py:54
|
||||
msgid "Cooldown"
|
||||
msgstr "Refroidir"
|
||||
|
||||
#: panels/print.py:24
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:53
|
||||
msgid "Decrease"
|
||||
msgstr "Diminuer"
|
||||
|
||||
#: panels/bed_mesh.py:122
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:108
|
||||
msgid "Disable Motors"
|
||||
msgstr "Déactiver les moteurs"
|
||||
|
||||
#: panels/bed_level.py:107
|
||||
msgid "Disable XY"
|
||||
msgstr "Deactiver XY"
|
||||
|
||||
#: panels/settings.py:28
|
||||
msgid "Displayed Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:64
|
||||
msgid "Distance (mm)"
|
||||
msgstr "Distance (mm)"
|
||||
|
||||
#: ks_includes/config.py:42
|
||||
msgid "Duration Only"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:136
|
||||
msgid "Elapsed:"
|
||||
msgstr "Écoulé:"
|
||||
|
||||
#: panels/job_status.py:272
|
||||
msgid "Emergency Stop"
|
||||
msgstr "Arret d'urgence"
|
||||
|
||||
#: ks_includes/config.py:39
|
||||
msgid "Estimated Time Method"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
|
||||
#: ks_includes/KlipperScreen.conf:174
|
||||
msgid "Extrude"
|
||||
msgstr "Extruder"
|
||||
|
||||
#: panels/fine_tune.py:57
|
||||
msgid "Extrusion +"
|
||||
msgstr "Extrusion +"
|
||||
|
||||
#: panels/fine_tune.py:61
|
||||
msgid "Extrusion -"
|
||||
msgstr "Extrusion +"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
|
||||
msgid "Fan"
|
||||
msgstr "Ventilateur"
|
||||
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan Off"
|
||||
msgstr "ventilateur éteint"
|
||||
|
||||
#: panels/fan.py:38
|
||||
msgid "Fan On"
|
||||
msgstr "Ventilateur en marche"
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Fast"
|
||||
msgstr "Rapide"
|
||||
|
||||
#: ks_includes/config.py:43
|
||||
msgid "Filament Used"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:41
|
||||
msgid "File Estimation (default)"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:164
|
||||
msgid "Fine Tuning"
|
||||
msgstr "Fin réglage"
|
||||
|
||||
#: panels/splash_screen.py:64 panels/system.py:24
|
||||
msgid "Firmware Restart"
|
||||
msgstr "Redemarrer le FW"
|
||||
|
||||
#: screen.py:300 panels/job_status.py:302
|
||||
msgid "Go Back"
|
||||
msgstr "Retourner"
|
||||
|
||||
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
|
||||
msgid "Home All"
|
||||
msgstr "Réinitialiser XYZ"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:45
|
||||
msgid "Home X"
|
||||
msgstr "Réinitialiser X"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:63
|
||||
msgid "Home XY"
|
||||
msgstr "Réinitialiser XY"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:51
|
||||
msgid "Home Y"
|
||||
msgstr "Réinitialiser Y"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:57
|
||||
msgid "Home Z"
|
||||
msgstr "Réinitialiser Z"
|
||||
|
||||
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
|
||||
msgid "Homing"
|
||||
msgstr "Réinitialisation"
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Increase"
|
||||
msgstr "Augmenter"
|
||||
|
||||
#. self._load_panels()
|
||||
#: screen.py:149
|
||||
msgid "Initializing"
|
||||
msgstr "Initialisation"
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr "Initialisation l'imprimante"
|
||||
|
||||
#: ks_includes/config.py:36
|
||||
msgid "Invert X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:37
|
||||
msgid "Invert Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:38
|
||||
msgid "Invert Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22
|
||||
msgid "Klipper Restart"
|
||||
msgstr "Redémarrer klipper"
|
||||
|
||||
#: panels/system.py:42
|
||||
msgid "Klipper Version"
|
||||
msgstr "Version de klipper"
|
||||
|
||||
#: screen.py:418
|
||||
msgid "Klipper has disconnected"
|
||||
msgstr "Klipper s'est déconnecté"
|
||||
|
||||
#: screen.py:429
|
||||
msgid ""
|
||||
"Klipper has encountered an error with the micro-controller.\n"
|
||||
"Please recompile and flash."
|
||||
msgstr ""
|
||||
"Klipper a rencontré une erreur avec le microcontrôleur.\n"
|
||||
"Veuillez recompiler et reflasher."
|
||||
|
||||
#: screen.py:433
|
||||
msgid "Klipper has encountered an error."
|
||||
msgstr "Klipper a rencontré une erreur."
|
||||
|
||||
#: screen.py:425
|
||||
msgid ""
|
||||
"Klipper has encountered an error.\n"
|
||||
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
msgstr ""
|
||||
"Klipper a rencontré une erreur. Taper FIRMWARE_RESTART pour fixer l'erreur."
|
||||
|
||||
#: screen.py:453
|
||||
msgid "Klipper has shutdown"
|
||||
msgstr "Klipper s'est arrêté"
|
||||
|
||||
#: screen.py:449
|
||||
msgid "Klipper is attempting to start"
|
||||
msgstr "Klipper tente de démarrer"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:148
|
||||
msgid "Klipper will reboot"
|
||||
msgstr "Klipper va redémarrer"
|
||||
|
||||
#: panels/system.py:46
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr "Version de KlipperScreen"
|
||||
|
||||
#: panels/job_status.py:124
|
||||
msgid "Left:"
|
||||
msgstr "Gauche:"
|
||||
|
||||
#: panels/bed_mesh.py:98
|
||||
msgid "Load"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:66
|
||||
msgid "Load Average"
|
||||
msgstr "Charge moyenne"
|
||||
|
||||
#: panels/zcalibrate.py:39
|
||||
msgid "Lower Nozzle"
|
||||
msgstr "Rapprocher la buse"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:96
|
||||
msgid "Macros"
|
||||
msgstr "Macros"
|
||||
|
||||
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
|
||||
msgid "Main Menu"
|
||||
msgstr "Menu principal"
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Medium"
|
||||
msgstr "Moyen"
|
||||
|
||||
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
|
||||
#, fuzzy
|
||||
msgid "Menu"
|
||||
msgstr "Menu principal"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:69
|
||||
msgid "Move"
|
||||
msgstr "Mouvement"
|
||||
|
||||
#: panels/move.py:91
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr "Distance de mouvement (mm)"
|
||||
|
||||
#: panels/print.py:23
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
|
||||
#: ks_includes/KlipperScreen.conf:211
|
||||
msgid "Network"
|
||||
msgstr "Réseau"
|
||||
|
||||
#: panels/network.py:31
|
||||
msgid "Network Info"
|
||||
msgstr "Information réseau "
|
||||
|
||||
#: panels/temperature.py:55
|
||||
msgid "Number Pad"
|
||||
msgstr "Pad numerique"
|
||||
|
||||
#: ks_includes/config.py:48
|
||||
#, fuzzy
|
||||
msgid "Off"
|
||||
msgstr "ventilateur éteint"
|
||||
|
||||
#: panels/job_status.py:276
|
||||
msgid "Pause"
|
||||
msgstr "Pause"
|
||||
|
||||
#: panels/job_status.py:470
|
||||
msgid "Paused"
|
||||
msgstr "En pause"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
|
||||
#: ks_includes/KlipperScreen.conf:205
|
||||
msgid "Power"
|
||||
msgstr "Energie"
|
||||
|
||||
#: panels/splash_screen.py:61
|
||||
msgid "Power On Printer"
|
||||
msgstr "Allumer l'imrimante"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:21
|
||||
msgid "Preheat"
|
||||
msgstr "Préchauffer"
|
||||
|
||||
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
|
||||
msgid "Print"
|
||||
msgstr "Imprimer"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:156
|
||||
msgid "Print Control"
|
||||
msgstr "Controle de l'imprimante"
|
||||
|
||||
#: panels/print.py:171
|
||||
msgid "Print Time"
|
||||
msgstr "Temps d'impression"
|
||||
|
||||
#: panels/job_status.py:232
|
||||
msgid "Printing"
|
||||
msgstr "imprime"
|
||||
|
||||
#: panels/bed_mesh.py:264
|
||||
msgid "Profile Name:"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:89
|
||||
msgid "Quad Gantry Level"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:37
|
||||
msgid "Raise Nozzle"
|
||||
msgstr "Éloigner la buse"
|
||||
|
||||
#: panels/job_status.py:278 panels/splash_screen.py:62
|
||||
msgid "Restart"
|
||||
msgstr "Redémarrage"
|
||||
|
||||
#: panels/job_status.py:280
|
||||
msgid "Resume"
|
||||
msgstr "Resumer"
|
||||
|
||||
#: panels/extrude.py:48
|
||||
msgid "Retract"
|
||||
msgstr "Rétracter"
|
||||
|
||||
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
|
||||
msgid "Save"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:141
|
||||
msgid "Save Config"
|
||||
msgstr "Enregistrer la config"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:146
|
||||
msgid "Save configuration."
|
||||
msgstr "Enregistrer la configuration"
|
||||
|
||||
#: ks_includes/config.py:46
|
||||
msgid "Screen Blanking Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:114
|
||||
msgid "Screws Adjust"
|
||||
msgstr "Ajuster les vis"
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Set Speed"
|
||||
msgstr "Régler la vitesse"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
|
||||
#, fuzzy
|
||||
msgid "Settings"
|
||||
msgstr "Paramètres"
|
||||
|
||||
#: panels/print.py:169
|
||||
msgid "Size"
|
||||
msgstr "dimensions"
|
||||
|
||||
#: ks_includes/config.py:44
|
||||
msgid "Slicer"
|
||||
msgstr ""
|
||||
|
||||
#. This line for translations only
|
||||
#: panels/extrude.py:31
|
||||
msgid "Slow"
|
||||
msgstr "Lent"
|
||||
|
||||
#: panels/print.py:39
|
||||
msgid "Sort by: "
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:47
|
||||
msgid "Speed +"
|
||||
msgstr "Vitesse+"
|
||||
|
||||
#: panels/fine_tune.py:51
|
||||
msgid "Speed -"
|
||||
msgstr "Vitesse-"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
|
||||
#: ks_includes/KlipperScreen.conf:216
|
||||
msgid "System"
|
||||
msgstr "Systeme"
|
||||
|
||||
#: panels/system.py:27
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Restart"
|
||||
msgstr "Redémarrage"
|
||||
|
||||
#: panels/system.py:30
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Shutdown"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
|
||||
#: ks_includes/KlipperScreen.conf:159
|
||||
msgid "Temperature"
|
||||
msgstr "Temperature"
|
||||
|
||||
#: panels/extrude.py:38
|
||||
msgid "Tool"
|
||||
msgstr "outil"
|
||||
|
||||
#: panels/print.py:167
|
||||
msgid "Uploaded"
|
||||
msgstr "Telecharger"
|
||||
|
||||
#: panels/move.py:25
|
||||
msgid "X+"
|
||||
msgstr "X+"
|
||||
|
||||
#: panels/move.py:27
|
||||
msgid "X-"
|
||||
msgstr "X-"
|
||||
|
||||
#: panels/move.py:30
|
||||
msgid "Y+"
|
||||
msgstr "Y+"
|
||||
|
||||
#: panels/move.py:32
|
||||
msgid "Y-"
|
||||
msgstr "Y-"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:125
|
||||
msgid "Z Calibrate"
|
||||
msgstr "Calibration Z"
|
||||
|
||||
#: panels/zcalibrate.py:28
|
||||
msgid "Z Offset"
|
||||
msgstr "Décalage Z"
|
||||
|
||||
#: panels/fine_tune.py:36 panels/move.py:35
|
||||
msgid "Z+"
|
||||
msgstr "Z+"
|
||||
|
||||
#: panels/fine_tune.py:40 panels/move.py:37
|
||||
msgid "Z-"
|
||||
msgstr "Z-"
|
||||
|
||||
#: ks_includes/config.py:60
|
||||
msgid "minutes"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:38
|
||||
msgid "mm"
|
||||
msgstr "mm"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "Klipper"
|
||||
#~ msgstr "Redémarrer klipper"
|
||||
|
||||
#~ msgid "Back"
|
||||
#~ msgstr "Retour"
|
||||
|
||||
#~ msgid "Extrusion"
|
||||
#~ msgstr "Extrusion"
|
||||
|
||||
#~ msgid "Fan +"
|
||||
#~ msgstr "Ventilateur+"
|
||||
|
||||
#~ msgid "Fan -"
|
||||
#~ msgstr "Ventilateur-"
|
||||
|
||||
#~ msgid "Speed"
|
||||
#~ msgstr "Vitesse"
|
||||
|
||||
#~ msgid "System Information"
|
||||
#~ msgstr "Info systeme"
|
||||
|
||||
#~ msgid "Time Elapsed"
|
||||
#~ msgstr "Temps écoulé"
|
||||
|
||||
#~ msgid "Time Left"
|
||||
#~ msgstr "temps restant"
|
||||
|
||||
#~ msgid "Tool 1"
|
||||
#~ msgstr "Outil 1"
|
||||
@@ -0,0 +1,579 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Klipperscreen\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
|
||||
"PO-Revision-Date: 2021-01-08 08:21-0500\n"
|
||||
"Last-Translator: Emanuel Sharvit <manu7irl@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: he_IL\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.4.2\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : n==2 ? 1 : n>10 && n%10==0 ? "
|
||||
"2 : 3);\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "?"
|
||||
msgstr "?"
|
||||
|
||||
#: panels/zcalibrate.py:71
|
||||
msgid "Abort"
|
||||
msgstr "בטל"
|
||||
|
||||
#: panels/zcalibrate.py:68
|
||||
msgid "Accept"
|
||||
msgstr "אשר"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:26
|
||||
msgid "Actions"
|
||||
msgstr "פעולות"
|
||||
|
||||
#: panels/bed_mesh.py:33
|
||||
msgid "Add bed mesh profile"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr "האם אתה בטוח שברצונך להדפיס"
|
||||
|
||||
#: panels/job_status.py:306
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr "האם אתה בטוח שברצונך לבטל את ההדפסה?"
|
||||
|
||||
#: panels/system.py:29
|
||||
#, fuzzy
|
||||
msgid "Are you sure you wish to reboot the system?"
|
||||
msgstr "האם אתה בטוח שברצונך לבטל את ההדפסה?"
|
||||
|
||||
#: panels/system.py:32
|
||||
#, fuzzy
|
||||
msgid "Are you sure you wish to shutdown the system?"
|
||||
msgstr "האם אתה בטוח שברצונך לבטל את ההדפסה?"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:114
|
||||
msgid "Bed Level"
|
||||
msgstr "פילוס מיטה"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:119
|
||||
msgid "Bed Mesh"
|
||||
msgstr "מיפוי מיטה"
|
||||
|
||||
#: panels/bed_mesh.py:104
|
||||
#, fuzzy
|
||||
msgid "Calibrate"
|
||||
msgstr "כיול Z"
|
||||
|
||||
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
|
||||
msgid "Cancel"
|
||||
msgstr "ביטול"
|
||||
|
||||
#: panels/fan.py:45
|
||||
msgid "Cancel Change"
|
||||
msgstr "בטל שינוי"
|
||||
|
||||
#: panels/job_status.py:301
|
||||
msgid "Cancel Print"
|
||||
msgstr "בטל הדפסה"
|
||||
|
||||
#: screen.py:305
|
||||
msgid ""
|
||||
"Check /tmp/KlipperScreen.log for more information.\n"
|
||||
"Please submit an issue on GitHub for help."
|
||||
msgstr ""
|
||||
"בדוק KlipperScreen.log, בתיקית tmp ליותר פרטים.\n"
|
||||
"אנא שלח דוח תקלה ב- GITHUB, לעזרה."
|
||||
|
||||
#: panels/bed_mesh.py:290 panels/temperature.py:150
|
||||
msgid "Close"
|
||||
msgstr "סגור"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:30
|
||||
msgid "Configuration"
|
||||
msgstr "קונפיגורציה"
|
||||
|
||||
#: screen.py:492
|
||||
msgid "Continue"
|
||||
msgstr "המשך"
|
||||
|
||||
#: panels/job_status.py:270
|
||||
msgid "Control"
|
||||
msgstr "שליטה"
|
||||
|
||||
#: panels/preheat.py:54
|
||||
msgid "Cooldown"
|
||||
msgstr "קירור"
|
||||
|
||||
#: panels/print.py:24
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:53
|
||||
msgid "Decrease"
|
||||
msgstr "הקטן"
|
||||
|
||||
#: panels/bed_mesh.py:122
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:108
|
||||
msgid "Disable Motors"
|
||||
msgstr "בטל מנועים"
|
||||
|
||||
#: panels/bed_level.py:107
|
||||
msgid "Disable XY"
|
||||
msgstr "בטל XY"
|
||||
|
||||
#: panels/settings.py:28
|
||||
msgid "Displayed Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:64
|
||||
msgid "Distance (mm)"
|
||||
msgstr "מרחק (מ''מ)"
|
||||
|
||||
#: ks_includes/config.py:42
|
||||
msgid "Duration Only"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:136
|
||||
msgid "Elapsed:"
|
||||
msgstr "זמן שעבר:"
|
||||
|
||||
#: panels/job_status.py:272
|
||||
msgid "Emergency Stop"
|
||||
msgstr "עצירת חירום"
|
||||
|
||||
#: ks_includes/config.py:39
|
||||
msgid "Estimated Time Method"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
|
||||
#: ks_includes/KlipperScreen.conf:174
|
||||
msgid "Extrude"
|
||||
msgstr "אקסטרוזיה"
|
||||
|
||||
#: panels/fine_tune.py:57
|
||||
msgid "Extrusion +"
|
||||
msgstr "שיחול +"
|
||||
|
||||
#: panels/fine_tune.py:61
|
||||
msgid "Extrusion -"
|
||||
msgstr "שיחול -"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
|
||||
msgid "Fan"
|
||||
msgstr "מאוורר"
|
||||
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan Off"
|
||||
msgstr "כבה מאוורר"
|
||||
|
||||
#: panels/fan.py:38
|
||||
msgid "Fan On"
|
||||
msgstr "הפעל מאוורר"
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Fast"
|
||||
msgstr "מהיר"
|
||||
|
||||
#: ks_includes/config.py:43
|
||||
msgid "Filament Used"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:41
|
||||
msgid "File Estimation (default)"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:164
|
||||
msgid "Fine Tuning"
|
||||
msgstr "כיולים עדינים"
|
||||
|
||||
#: panels/splash_screen.py:64 panels/system.py:24
|
||||
msgid "Firmware Restart"
|
||||
msgstr "התחל קושחה"
|
||||
|
||||
#: screen.py:300 panels/job_status.py:302
|
||||
msgid "Go Back"
|
||||
msgstr "חזרה"
|
||||
|
||||
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
|
||||
msgid "Home All"
|
||||
msgstr "איפוס XYZ"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:45
|
||||
msgid "Home X"
|
||||
msgstr "איפוס X"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:63
|
||||
msgid "Home XY"
|
||||
msgstr "איפוס XY"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:51
|
||||
msgid "Home Y"
|
||||
msgstr "איפוס Y"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:57
|
||||
msgid "Home Z"
|
||||
msgstr "איפוס Z"
|
||||
|
||||
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
|
||||
msgid "Homing"
|
||||
msgstr "איפוס צירים"
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Increase"
|
||||
msgstr "הגדל"
|
||||
|
||||
#. self._load_panels()
|
||||
#: screen.py:149
|
||||
msgid "Initializing"
|
||||
msgstr "מאתחל"
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr "מאתחל מדפסת..."
|
||||
|
||||
#: ks_includes/config.py:36
|
||||
msgid "Invert X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:37
|
||||
msgid "Invert Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:38
|
||||
msgid "Invert Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22
|
||||
msgid "Klipper Restart"
|
||||
msgstr "אתחול קליפר"
|
||||
|
||||
#: panels/system.py:42
|
||||
msgid "Klipper Version"
|
||||
msgstr "גרסא של קליפר"
|
||||
|
||||
#: screen.py:418
|
||||
msgid "Klipper has disconnected"
|
||||
msgstr "קליפר התנתק"
|
||||
|
||||
#: screen.py:429
|
||||
msgid ""
|
||||
"Klipper has encountered an error with the micro-controller.\n"
|
||||
"Please recompile and flash."
|
||||
msgstr "בעיית תקשורת בין קליפר ללוח בקרה. אנא לקמפל קושחה ולצרובה מחדש. "
|
||||
|
||||
#: screen.py:433
|
||||
msgid "Klipper has encountered an error."
|
||||
msgstr "קילפר נתקל בבעיה."
|
||||
|
||||
#: screen.py:425
|
||||
msgid ""
|
||||
"Klipper has encountered an error.\n"
|
||||
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
msgstr ""
|
||||
"קליפר נתקל בבעיה. \n"
|
||||
"נסה להריץ firmware_restart, כדי לפתור את הבעיה."
|
||||
|
||||
#: screen.py:453
|
||||
msgid "Klipper has shutdown"
|
||||
msgstr "קליפר נכבה"
|
||||
|
||||
#: screen.py:449
|
||||
msgid "Klipper is attempting to start"
|
||||
msgstr "קליפר מנסה לרוץ"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:148
|
||||
msgid "Klipper will reboot"
|
||||
msgstr "קליפר יבצע אתחול"
|
||||
|
||||
#: panels/system.py:46
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr "גרסא של KlipperScreen"
|
||||
|
||||
#: panels/job_status.py:124
|
||||
msgid "Left:"
|
||||
msgstr "זמן שנותר:"
|
||||
|
||||
#: panels/bed_mesh.py:98
|
||||
msgid "Load"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:66
|
||||
msgid "Load Average"
|
||||
msgstr "עומס ממוצע"
|
||||
|
||||
#: panels/zcalibrate.py:39
|
||||
msgid "Lower Nozzle"
|
||||
msgstr "הנמך דיזה"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:96
|
||||
msgid "Macros"
|
||||
msgstr "מקרואים"
|
||||
|
||||
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
|
||||
msgid "Main Menu"
|
||||
msgstr "תפריט ראשי"
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Medium"
|
||||
msgstr "ממוצע"
|
||||
|
||||
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
|
||||
#, fuzzy
|
||||
msgid "Menu"
|
||||
msgstr "תפריט ראשי"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:69
|
||||
msgid "Move"
|
||||
msgstr "הזזת צירים"
|
||||
|
||||
#: panels/move.py:91
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr "מרחק הזזה (מ''מ)"
|
||||
|
||||
#: panels/print.py:23
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
|
||||
#: ks_includes/KlipperScreen.conf:211
|
||||
msgid "Network"
|
||||
msgstr "רשת"
|
||||
|
||||
#: panels/network.py:31
|
||||
msgid "Network Info"
|
||||
msgstr "מידע על הרשת"
|
||||
|
||||
#: panels/temperature.py:55
|
||||
msgid "Number Pad"
|
||||
msgstr "פד נומרי"
|
||||
|
||||
#: ks_includes/config.py:48
|
||||
#, fuzzy
|
||||
msgid "Off"
|
||||
msgstr "כבה מאוורר"
|
||||
|
||||
#: panels/job_status.py:276
|
||||
msgid "Pause"
|
||||
msgstr "השהיה"
|
||||
|
||||
#: panels/job_status.py:470
|
||||
msgid "Paused"
|
||||
msgstr "מושהה"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
|
||||
#: ks_includes/KlipperScreen.conf:205
|
||||
msgid "Power"
|
||||
msgstr "הפעלה"
|
||||
|
||||
#: panels/splash_screen.py:61
|
||||
msgid "Power On Printer"
|
||||
msgstr "הפעל מדפסת"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:21
|
||||
msgid "Preheat"
|
||||
msgstr "חימום מראש"
|
||||
|
||||
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
|
||||
msgid "Print"
|
||||
msgstr "הדפס"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:156
|
||||
msgid "Print Control"
|
||||
msgstr "שליטה בהדפסה"
|
||||
|
||||
#: panels/print.py:171
|
||||
msgid "Print Time"
|
||||
msgstr "זמן הדפסה"
|
||||
|
||||
#: panels/job_status.py:232
|
||||
msgid "Printing"
|
||||
msgstr "מדפיס"
|
||||
|
||||
#: panels/bed_mesh.py:264
|
||||
msgid "Profile Name:"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:89
|
||||
msgid "Quad Gantry Level"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:37
|
||||
msgid "Raise Nozzle"
|
||||
msgstr "הגבה"
|
||||
|
||||
#: panels/job_status.py:278 panels/splash_screen.py:62
|
||||
msgid "Restart"
|
||||
msgstr "אתחל"
|
||||
|
||||
#: panels/job_status.py:280
|
||||
msgid "Resume"
|
||||
msgstr "המשך"
|
||||
|
||||
#: panels/extrude.py:48
|
||||
msgid "Retract"
|
||||
msgstr "שיחול לאחור"
|
||||
|
||||
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
|
||||
msgid "Save"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:141
|
||||
msgid "Save Config"
|
||||
msgstr "שמור קונפיג"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:146
|
||||
msgid "Save configuration."
|
||||
msgstr "שמור קונפיגורציה"
|
||||
|
||||
#: ks_includes/config.py:46
|
||||
msgid "Screen Blanking Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:114
|
||||
msgid "Screws Adjust"
|
||||
msgstr "סידור ברגים"
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Set Speed"
|
||||
msgstr "קבע מהירות"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
|
||||
msgid "Settings"
|
||||
msgstr "הגדרות"
|
||||
|
||||
#: panels/print.py:169
|
||||
msgid "Size"
|
||||
msgstr "גודל"
|
||||
|
||||
#: ks_includes/config.py:44
|
||||
msgid "Slicer"
|
||||
msgstr ""
|
||||
|
||||
#. This line for translations only
|
||||
#: panels/extrude.py:31
|
||||
msgid "Slow"
|
||||
msgstr "האט"
|
||||
|
||||
#: panels/print.py:39
|
||||
msgid "Sort by: "
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:47
|
||||
msgid "Speed +"
|
||||
msgstr "מהירות +"
|
||||
|
||||
#: panels/fine_tune.py:51
|
||||
msgid "Speed -"
|
||||
msgstr "מהירות -"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
|
||||
#: ks_includes/KlipperScreen.conf:216
|
||||
msgid "System"
|
||||
msgstr "מערכת"
|
||||
|
||||
#: panels/system.py:27
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Restart"
|
||||
msgstr "אתחל"
|
||||
|
||||
#: panels/system.py:30
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Shutdown"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
|
||||
#: ks_includes/KlipperScreen.conf:159
|
||||
msgid "Temperature"
|
||||
msgstr "טמפרטורה"
|
||||
|
||||
#: panels/extrude.py:38
|
||||
msgid "Tool"
|
||||
msgstr "כלי"
|
||||
|
||||
#: panels/print.py:167
|
||||
msgid "Uploaded"
|
||||
msgstr "הועלה"
|
||||
|
||||
#: panels/move.py:25
|
||||
msgid "X+"
|
||||
msgstr "X+"
|
||||
|
||||
#: panels/move.py:27
|
||||
msgid "X-"
|
||||
msgstr "X-"
|
||||
|
||||
#: panels/move.py:30
|
||||
msgid "Y+"
|
||||
msgstr "Y+"
|
||||
|
||||
#: panels/move.py:32
|
||||
msgid "Y-"
|
||||
msgstr "Y-"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:125
|
||||
msgid "Z Calibrate"
|
||||
msgstr "כיול Z"
|
||||
|
||||
#: panels/zcalibrate.py:28
|
||||
msgid "Z Offset"
|
||||
msgstr "הפרז גובה Z"
|
||||
|
||||
#: panels/fine_tune.py:36 panels/move.py:35
|
||||
msgid "Z+"
|
||||
msgstr "Z+"
|
||||
|
||||
#: panels/fine_tune.py:40 panels/move.py:37
|
||||
msgid "Z-"
|
||||
msgstr "Z-"
|
||||
|
||||
#: ks_includes/config.py:60
|
||||
msgid "minutes"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:38
|
||||
msgid "mm"
|
||||
msgstr "מ''מ"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "Klipper"
|
||||
#~ msgstr "אתחול קליפר"
|
||||
|
||||
#~ msgid "Back"
|
||||
#~ msgstr "חזור"
|
||||
|
||||
#~ msgid "Extrusion"
|
||||
#~ msgstr "שיחול"
|
||||
|
||||
#~ msgid "Fan +"
|
||||
#~ msgstr "מאוורר +"
|
||||
|
||||
#~ msgid "Fan -"
|
||||
#~ msgstr "מאוורר -"
|
||||
|
||||
#~ msgid "Speed"
|
||||
#~ msgstr "מהירות"
|
||||
|
||||
#~ msgid "System Information"
|
||||
#~ msgstr "מידע אודות המערכת"
|
||||
|
||||
#~ msgid "Time Elapsed"
|
||||
#~ msgstr "זמן שעבר"
|
||||
|
||||
#~ msgid "Time Left"
|
||||
#~ msgstr "זמן שנשאר"
|
||||
|
||||
#~ msgid "Tool 1"
|
||||
#~ msgstr "כלי 1"
|
||||
@@ -0,0 +1,209 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<keyboard>
|
||||
|
||||
<options>
|
||||
<!-- not yet implemented -->
|
||||
</options>
|
||||
|
||||
<layout id="defualt keyboard">
|
||||
<row>
|
||||
<key obey-caps='true'>
|
||||
<default display="q" />
|
||||
<shifted display="Q" />
|
||||
<mod1 display="1" />
|
||||
<mod2 display="~" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="w" />
|
||||
<shifted display="W" />
|
||||
<mod1 display="2" />
|
||||
<mod2 display="`" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="e" />
|
||||
<shifted display="E" />
|
||||
<mod1 display="3" />
|
||||
<mod2 display="|" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="r" />
|
||||
<shifted display="R" />
|
||||
<mod1 display="4" />
|
||||
<mod2 display="•" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="t" />
|
||||
<shifted display="T" />
|
||||
<mod1 display="5" />
|
||||
<mod2 display="√" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="y" />
|
||||
<shifted display="Y" />
|
||||
<mod1 display="6" />
|
||||
<mod2 display="π" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="u" />
|
||||
<shifted display="U" />
|
||||
<mod1 display="7" />
|
||||
<mod2 display="÷" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="i" />
|
||||
<shifted display="I" />
|
||||
<mod1 display="8" />
|
||||
<mod2 display="×" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="o" />
|
||||
<shifted display="O" />
|
||||
<mod1 display="9" />
|
||||
<mod2 display="¶" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="p" />
|
||||
<shifted display="P" />
|
||||
<mod1 display="0" />
|
||||
<mod2 display="∆" />
|
||||
</key>
|
||||
</row>
|
||||
<row>
|
||||
<key obey-caps='true'>
|
||||
<default display="Caps" action="modifier:caps" />
|
||||
<shifted display="Caps" action="modifier:caps" />
|
||||
<mod1 display="@" />
|
||||
<mod2 display="£" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="a" />
|
||||
<shifted display="A" />
|
||||
<mod1 display="#" />
|
||||
<mod2 display="¢" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="s" />
|
||||
<shifted display="S" />
|
||||
<mod1 display="$" />
|
||||
<mod2 display="€" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="d" />
|
||||
<shifted display="D" />
|
||||
<mod1 display="_" />
|
||||
<mod2 display="¥" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="f" />
|
||||
<shifted display="F" />
|
||||
<mod1 display="&" />
|
||||
<mod2 display="^" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="g" />
|
||||
<shifted display="G" />
|
||||
<mod1 display="-" />
|
||||
<mod2 display="°" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="h" />
|
||||
<shifted display="H" />
|
||||
<mod1 display="+" />
|
||||
<mod2 display="=" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="j" />
|
||||
<shifted display="J" />
|
||||
<mod1 display="(" />
|
||||
<mod2 display="{" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="k" />
|
||||
<shifted display="K" />
|
||||
<mod1 display=")" />
|
||||
<mod2 display="}" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="l" />
|
||||
<shifted display="L" />
|
||||
<mod1 display="/" />
|
||||
<mod2 display="\" />
|
||||
</key>
|
||||
</row>
|
||||
<row>
|
||||
<key obey-caps='true'>
|
||||
<default display="↑" action="modifier:shift" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="z" />
|
||||
<shifted display="Z" />
|
||||
<mod1 display="*" />
|
||||
<mod2 display="%" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="x" />
|
||||
<shifted display="X" />
|
||||
<mod1 display='"' />
|
||||
<mod2 display="©" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="c" />
|
||||
<shifted display="C" />
|
||||
<mod1 display="'" />
|
||||
<mod2 display="®" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="v" />
|
||||
<shifted display="V" />
|
||||
<mod1 display=":" />
|
||||
<mod2 display="™" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="b" />
|
||||
<shifted display="B" />
|
||||
<mod1 display=";" />
|
||||
<mod2 display="✓" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="n" />
|
||||
<shifted display="N" />
|
||||
<mod1 display="!" />
|
||||
<mod2 display="[" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="m" />
|
||||
<shifted display="M" />
|
||||
<mod1 display="?" />
|
||||
<mod2 display="]" />
|
||||
</key>
|
||||
<key obey-caps='true'>
|
||||
<default display="⌫" action="backspace" />
|
||||
</key>
|
||||
</row>
|
||||
<row>
|
||||
<key>
|
||||
<default display="?123" action="modifier:mod1" />
|
||||
</key>
|
||||
<key>
|
||||
<default display="=\<" action="modifier:mod2" />
|
||||
</key>
|
||||
<key>
|
||||
<default display="," />
|
||||
<mod2 display="<" />
|
||||
</key>
|
||||
<key width="6000" fill="true">
|
||||
<default display=" " action="space" />
|
||||
</key>
|
||||
<key>
|
||||
<default display="." />
|
||||
<mod2 display=">" />
|
||||
</key>
|
||||
<key width="1000">
|
||||
<!-- <default display="◀┛" action="return"/> -->
|
||||
<default display="◀┛" action="return"/>
|
||||
</key>
|
||||
</row>
|
||||
</layout>
|
||||
|
||||
|
||||
</keyboard>
|
||||
@@ -0,0 +1,552 @@
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
#
|
||||
# Jakob Kais <schpuntik@freenet.de>, 2021.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
|
||||
"PO-Revision-Date: 2021-02-12 02:24+0100\n"
|
||||
"Last-Translator: Jakob Kais <schpuntik@freenet.de>\n"
|
||||
"Language-Team: Russian <kde-i18n-de@kde.org>\n"
|
||||
"Language: ru\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.3\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
|
||||
"%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
|
||||
"X-Poedit-Flags-xgettext: --add-comments\n"
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "?"
|
||||
msgstr "?"
|
||||
|
||||
#: panels/zcalibrate.py:71
|
||||
msgid "Abort"
|
||||
msgstr "Отменить"
|
||||
|
||||
#: panels/zcalibrate.py:68
|
||||
msgid "Accept"
|
||||
msgstr "Применить"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:26
|
||||
msgid "Actions"
|
||||
msgstr "Действия"
|
||||
|
||||
#: panels/bed_mesh.py:33
|
||||
msgid "Add bed mesh profile"
|
||||
msgstr "Добавить профиль сетки стола"
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr "Вы хотите это распечатать"
|
||||
|
||||
#: panels/job_status.py:306
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr "Вы хотите отменить эту печать?"
|
||||
|
||||
#: panels/system.py:29
|
||||
msgid "Are you sure you wish to reboot the system?"
|
||||
msgstr "Вы уверены что хотите перезагрузить систему?"
|
||||
|
||||
#: panels/system.py:32
|
||||
msgid "Are you sure you wish to shutdown the system?"
|
||||
msgstr "Вы хотите выключить принтер?"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:114
|
||||
msgid "Bed Level"
|
||||
msgstr "Уровень стола"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:119
|
||||
msgid "Bed Mesh"
|
||||
msgstr "Сетка стола"
|
||||
|
||||
#: panels/bed_mesh.py:104
|
||||
msgid "Calibrate"
|
||||
msgstr "Калибровка"
|
||||
|
||||
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
|
||||
msgid "Cancel"
|
||||
msgstr "Отменить"
|
||||
|
||||
#: panels/fan.py:45
|
||||
msgid "Cancel Change"
|
||||
msgstr "Отменить изменения"
|
||||
|
||||
#: panels/job_status.py:301
|
||||
msgid "Cancel Print"
|
||||
msgstr "Отменить печать"
|
||||
|
||||
#: screen.py:305
|
||||
msgid ""
|
||||
"Check /tmp/KlipperScreen.log for more information.\n"
|
||||
"Please submit an issue on GitHub for help."
|
||||
msgstr ""
|
||||
"Проверьте /tmp/KlipperScreen.log для дополнитольной информации.\n"
|
||||
"Создайте issues на GitHub что-бы получить помощь."
|
||||
|
||||
#: panels/bed_mesh.py:290 panels/temperature.py:150
|
||||
msgid "Close"
|
||||
msgstr "Закрыть"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:30
|
||||
msgid "Configuration"
|
||||
msgstr "Конфигурация"
|
||||
|
||||
#: screen.py:492
|
||||
msgid "Continue"
|
||||
msgstr "Продолжить"
|
||||
|
||||
#: panels/job_status.py:270
|
||||
msgid "Control"
|
||||
msgstr "Управление"
|
||||
|
||||
#: panels/preheat.py:54
|
||||
msgid "Cooldown"
|
||||
msgstr "Остудить"
|
||||
|
||||
#: panels/print.py:24
|
||||
msgid "Date"
|
||||
msgstr "Дата"
|
||||
|
||||
#: panels/temperature.py:53
|
||||
msgid "Decrease"
|
||||
msgstr "Уменьшить"
|
||||
|
||||
#: panels/bed_mesh.py:122
|
||||
msgid "Delete"
|
||||
msgstr "Удалить"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:108
|
||||
msgid "Disable Motors"
|
||||
msgstr "Отключить моторы"
|
||||
|
||||
#: panels/bed_level.py:107
|
||||
msgid "Disable XY"
|
||||
msgstr "Отключить XY"
|
||||
|
||||
#: panels/settings.py:28
|
||||
msgid "Displayed Macros"
|
||||
msgstr "Показать макросы"
|
||||
|
||||
#: panels/zcalibrate.py:64
|
||||
msgid "Distance (mm)"
|
||||
msgstr "Расстояние (mm)"
|
||||
|
||||
#: ks_includes/config.py:42
|
||||
msgid "Duration Only"
|
||||
msgstr "Продолжительность печати"
|
||||
|
||||
#: panels/job_status.py:136
|
||||
msgid "Elapsed:"
|
||||
msgstr "Прошло:"
|
||||
|
||||
#: panels/job_status.py:272
|
||||
msgid "Emergency Stop"
|
||||
msgstr "Аварийный стоп"
|
||||
|
||||
#: ks_includes/config.py:39
|
||||
msgid "Estimated Time Method"
|
||||
msgstr "Расчётное время"
|
||||
|
||||
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
|
||||
#: ks_includes/KlipperScreen.conf:174
|
||||
msgid "Extrude"
|
||||
msgstr "Заправить"
|
||||
|
||||
#: panels/fine_tune.py:57
|
||||
msgid "Extrusion +"
|
||||
msgstr "Экструзия +"
|
||||
|
||||
#: panels/fine_tune.py:61
|
||||
msgid "Extrusion -"
|
||||
msgstr "Экструзия -"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
|
||||
msgid "Fan"
|
||||
msgstr "Обдув"
|
||||
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan Off"
|
||||
msgstr "Вентилятор выкл"
|
||||
|
||||
#: panels/fan.py:38
|
||||
msgid "Fan On"
|
||||
msgstr "Вентилятор вкл"
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Fast"
|
||||
msgstr "Быстро"
|
||||
|
||||
#: ks_includes/config.py:43
|
||||
msgid "Filament Used"
|
||||
msgstr "Использование филамента"
|
||||
|
||||
#: ks_includes/config.py:41
|
||||
msgid "File Estimation (default)"
|
||||
msgstr "По файлу (по умолчанию)"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:164
|
||||
msgid "Fine Tuning"
|
||||
msgstr "Точная настройка"
|
||||
|
||||
#: panels/splash_screen.py:64 panels/system.py:24
|
||||
msgid "Firmware Restart"
|
||||
msgstr ""
|
||||
"Перезагрузка\n"
|
||||
"прошивки"
|
||||
|
||||
#: screen.py:300 panels/job_status.py:302
|
||||
msgid "Go Back"
|
||||
msgstr "Назад"
|
||||
|
||||
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
|
||||
msgid "Home All"
|
||||
msgstr "Парковать все"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:45
|
||||
msgid "Home X"
|
||||
msgstr "Парковать X"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:63
|
||||
msgid "Home XY"
|
||||
msgstr "Парковать XY"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:51
|
||||
msgid "Home Y"
|
||||
msgstr "Парковать Y"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:57
|
||||
msgid "Home Z"
|
||||
msgstr "Парковать Z"
|
||||
|
||||
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
|
||||
msgid "Homing"
|
||||
msgstr "Парковка"
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Increase"
|
||||
msgstr "Поднять"
|
||||
|
||||
#. self._load_panels()
|
||||
#: screen.py:149
|
||||
msgid "Initializing"
|
||||
msgstr "Запуск"
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr "Принтер стартует..."
|
||||
|
||||
#: ks_includes/config.py:36
|
||||
msgid "Invert X"
|
||||
msgstr "Инвертировать X"
|
||||
|
||||
#: ks_includes/config.py:37
|
||||
msgid "Invert Y"
|
||||
msgstr "Инвертировать Y"
|
||||
|
||||
#: ks_includes/config.py:38
|
||||
msgid "Invert Z"
|
||||
msgstr "Инвертировать Z"
|
||||
|
||||
#: panels/system.py:22
|
||||
msgid "Klipper Restart"
|
||||
msgstr ""
|
||||
"Перезагрузка\n"
|
||||
"Klipper"
|
||||
|
||||
#: panels/system.py:42
|
||||
msgid "Klipper Version"
|
||||
msgstr "Версия Klipper"
|
||||
|
||||
#: screen.py:418
|
||||
msgid "Klipper has disconnected"
|
||||
msgstr "Нет связи с Klipper"
|
||||
|
||||
#: screen.py:429
|
||||
msgid ""
|
||||
"Klipper has encountered an error with the micro-controller.\n"
|
||||
"Please recompile and flash."
|
||||
msgstr ""
|
||||
"Klipper определил ошибку в микроконтроллере.\n"
|
||||
"Прошейте заново."
|
||||
|
||||
#: screen.py:433
|
||||
msgid "Klipper has encountered an error."
|
||||
msgstr "Klipper обнаружил ошибку."
|
||||
|
||||
#: screen.py:425
|
||||
msgid ""
|
||||
"Klipper has encountered an error.\n"
|
||||
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
msgstr ""
|
||||
"Klipper обнаружил ошибку.\n"
|
||||
"Выполните перезагрузку прошивки, чтобы попытаться исправить проблему."
|
||||
|
||||
#: screen.py:453
|
||||
msgid "Klipper has shutdown"
|
||||
msgstr "Klipper отключился"
|
||||
|
||||
#: screen.py:449
|
||||
msgid "Klipper is attempting to start"
|
||||
msgstr "Klipper готов"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:148
|
||||
msgid "Klipper will reboot"
|
||||
msgstr "Klipper перезагружается"
|
||||
|
||||
#: panels/system.py:46
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr "Версия KlipperScreen"
|
||||
|
||||
#: panels/job_status.py:124
|
||||
msgid "Left:"
|
||||
msgstr "Осталось:"
|
||||
|
||||
#: panels/bed_mesh.py:98
|
||||
msgid "Load"
|
||||
msgstr "Загрузить"
|
||||
|
||||
#: panels/system.py:66
|
||||
msgid "Load Average"
|
||||
msgstr "Средняя нагрузка"
|
||||
|
||||
#: panels/zcalibrate.py:39
|
||||
msgid "Lower Nozzle"
|
||||
msgstr "Опустить сопло"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:96
|
||||
msgid "Macros"
|
||||
msgstr "Макросы"
|
||||
|
||||
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
|
||||
msgid "Main Menu"
|
||||
msgstr "Главное меню"
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Medium"
|
||||
msgstr "Среднее"
|
||||
|
||||
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
|
||||
msgid "Menu"
|
||||
msgstr "Меню"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:69
|
||||
msgid "Move"
|
||||
msgstr "Двигать"
|
||||
|
||||
#: panels/move.py:91
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr "Дистанция перемещения (mm)"
|
||||
|
||||
#: panels/print.py:23
|
||||
msgid "Name"
|
||||
msgstr "Имя"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
|
||||
#: ks_includes/KlipperScreen.conf:211
|
||||
msgid "Network"
|
||||
msgstr "Сеть"
|
||||
|
||||
#: panels/network.py:31
|
||||
msgid "Network Info"
|
||||
msgstr "Информация о сети"
|
||||
|
||||
#: panels/temperature.py:55
|
||||
msgid "Number Pad"
|
||||
msgstr "Номер блока"
|
||||
|
||||
#: ks_includes/config.py:48
|
||||
msgid "Off"
|
||||
msgstr "Выкл"
|
||||
|
||||
#: panels/job_status.py:276
|
||||
msgid "Pause"
|
||||
msgstr "Пауза"
|
||||
|
||||
#: panels/job_status.py:470
|
||||
msgid "Paused"
|
||||
msgstr "Приостановлено"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
|
||||
#: ks_includes/KlipperScreen.conf:205
|
||||
msgid "Power"
|
||||
msgstr "Включено"
|
||||
|
||||
#: panels/splash_screen.py:61
|
||||
msgid "Power On Printer"
|
||||
msgstr "Включить принтер"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:21
|
||||
msgid "Preheat"
|
||||
msgstr "Разогрев"
|
||||
|
||||
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
|
||||
msgid "Print"
|
||||
msgstr "Печать"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:156
|
||||
msgid "Print Control"
|
||||
msgstr "Управление печатью"
|
||||
|
||||
#: panels/print.py:171
|
||||
msgid "Print Time"
|
||||
msgstr "Время печати"
|
||||
|
||||
#: panels/job_status.py:232
|
||||
msgid "Printing"
|
||||
msgstr "Печатается"
|
||||
|
||||
#: panels/bed_mesh.py:264
|
||||
msgid "Profile Name:"
|
||||
msgstr "Имя профиля:"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:89
|
||||
msgid "Quad Gantry Level"
|
||||
msgstr "Уровень Quad Gantry"
|
||||
|
||||
#: panels/zcalibrate.py:37
|
||||
msgid "Raise Nozzle"
|
||||
msgstr "Поднять сопло"
|
||||
|
||||
#: panels/job_status.py:278 panels/splash_screen.py:62
|
||||
msgid "Restart"
|
||||
msgstr "Перезагрузка"
|
||||
|
||||
#: panels/job_status.py:280
|
||||
msgid "Resume"
|
||||
msgstr "Продолжить"
|
||||
|
||||
#: panels/extrude.py:48
|
||||
msgid "Retract"
|
||||
msgstr "Выгрузить"
|
||||
|
||||
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
|
||||
msgid "Save"
|
||||
msgstr "Сохранить"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:141
|
||||
msgid "Save Config"
|
||||
msgstr "Сохранить настройки"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:146
|
||||
msgid "Save configuration."
|
||||
msgstr "Настройки сохраняются."
|
||||
|
||||
#: ks_includes/config.py:46
|
||||
msgid "Screen Blanking Time"
|
||||
msgstr "Скрыть экран через"
|
||||
|
||||
#: panels/bed_level.py:114
|
||||
msgid "Screws Adjust"
|
||||
msgstr "Настроить винты"
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Set Speed"
|
||||
msgstr "Скорость"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
|
||||
msgid "Settings"
|
||||
msgstr "Настройки"
|
||||
|
||||
#: panels/print.py:169
|
||||
msgid "Size"
|
||||
msgstr "Размер"
|
||||
|
||||
#: ks_includes/config.py:44
|
||||
msgid "Slicer"
|
||||
msgstr "Slicer"
|
||||
|
||||
#. This line for translations only
|
||||
#: panels/extrude.py:31
|
||||
msgid "Slow"
|
||||
msgstr "Медленно"
|
||||
|
||||
#: panels/print.py:39
|
||||
msgid "Sort by: "
|
||||
msgstr "Сортировать по: "
|
||||
|
||||
#: panels/fine_tune.py:47
|
||||
msgid "Speed +"
|
||||
msgstr "Скорость +"
|
||||
|
||||
#: panels/fine_tune.py:51
|
||||
msgid "Speed -"
|
||||
msgstr "Скорость -"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
|
||||
#: ks_includes/KlipperScreen.conf:216
|
||||
msgid "System"
|
||||
msgstr "Система"
|
||||
|
||||
#: panels/system.py:27
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Restart"
|
||||
msgstr ""
|
||||
"Перегрузить\n"
|
||||
"Систему"
|
||||
|
||||
#: panels/system.py:30
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Shutdown"
|
||||
msgstr "Выключить"
|
||||
|
||||
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
|
||||
#: ks_includes/KlipperScreen.conf:159
|
||||
msgid "Temperature"
|
||||
msgstr "Температура"
|
||||
|
||||
#: panels/extrude.py:38
|
||||
msgid "Tool"
|
||||
msgstr "Инструмент"
|
||||
|
||||
#: panels/print.py:167
|
||||
msgid "Uploaded"
|
||||
msgstr "Загружено"
|
||||
|
||||
#: panels/move.py:25
|
||||
msgid "X+"
|
||||
msgstr "X+"
|
||||
|
||||
#: panels/move.py:27
|
||||
msgid "X-"
|
||||
msgstr "X-"
|
||||
|
||||
#: panels/move.py:30
|
||||
msgid "Y+"
|
||||
msgstr "Y+"
|
||||
|
||||
#: panels/move.py:32
|
||||
msgid "Y-"
|
||||
msgstr "Y-"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:125
|
||||
msgid "Z Calibrate"
|
||||
msgstr "Калибровка Z"
|
||||
|
||||
#: panels/zcalibrate.py:28
|
||||
msgid "Z Offset"
|
||||
msgstr "Офсет Z"
|
||||
|
||||
#: panels/fine_tune.py:36 panels/move.py:35
|
||||
msgid "Z+"
|
||||
msgstr "Z+"
|
||||
|
||||
#: panels/fine_tune.py:40 panels/move.py:37
|
||||
msgid "Z-"
|
||||
msgstr "Z-"
|
||||
|
||||
#: ks_includes/config.py:60
|
||||
msgid "minutes"
|
||||
msgstr "минут"
|
||||
|
||||
#: panels/fine_tune.py:38
|
||||
msgid "mm"
|
||||
msgstr "mm"
|
||||
|
||||
#~ msgid "Klipper"
|
||||
#~ msgstr "Klipper"
|
||||
@@ -0,0 +1,580 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
|
||||
"PO-Revision-Date: 2021-01-06 00:35+0200\n"
|
||||
"Last-Translator: Emanuel Sharvit <manu7irl@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.4.2\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "?"
|
||||
msgstr "?"
|
||||
|
||||
#: panels/zcalibrate.py:71
|
||||
msgid "Abort"
|
||||
msgstr "中止"
|
||||
|
||||
#: panels/zcalibrate.py:68
|
||||
msgid "Accept"
|
||||
msgstr "接受"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:26
|
||||
msgid "Actions"
|
||||
msgstr "动作"
|
||||
|
||||
#: panels/bed_mesh.py:33
|
||||
msgid "Add bed mesh profile"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:247
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr "您确定要打印吗"
|
||||
|
||||
#: panels/job_status.py:306
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr "您要取消此打印吗?"
|
||||
|
||||
#: panels/system.py:29
|
||||
#, fuzzy
|
||||
msgid "Are you sure you wish to reboot the system?"
|
||||
msgstr "您要取消此打印吗?"
|
||||
|
||||
#: panels/system.py:32
|
||||
#, fuzzy
|
||||
msgid "Are you sure you wish to shutdown the system?"
|
||||
msgstr "您要取消此打印吗?"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:114
|
||||
msgid "Bed Level"
|
||||
msgstr "床位"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:119
|
||||
msgid "Bed Mesh"
|
||||
msgstr "床网"
|
||||
|
||||
#: panels/bed_mesh.py:104
|
||||
#, fuzzy
|
||||
msgid "Calibrate"
|
||||
msgstr "Z校准"
|
||||
|
||||
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
|
||||
msgid "Cancel"
|
||||
msgstr "取消"
|
||||
|
||||
#: panels/fan.py:45
|
||||
msgid "Cancel Change"
|
||||
msgstr "取消变更"
|
||||
|
||||
#: panels/job_status.py:301
|
||||
msgid "Cancel Print"
|
||||
msgstr "取消列印"
|
||||
|
||||
#: screen.py:305
|
||||
msgid ""
|
||||
"Check /tmp/KlipperScreen.log for more information.\n"
|
||||
"Please submit an issue on GitHub for help."
|
||||
msgstr ""
|
||||
"检查/tmp/KlipperScreen.log以获取更多信息。\n"
|
||||
"请在GitHub上提交问题以寻求帮助。"
|
||||
|
||||
#: panels/bed_mesh.py:290 panels/temperature.py:150
|
||||
msgid "Close"
|
||||
msgstr "关"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:30
|
||||
msgid "Configuration"
|
||||
msgstr "组态"
|
||||
|
||||
#: screen.py:492
|
||||
msgid "Continue"
|
||||
msgstr "继续"
|
||||
|
||||
#: panels/job_status.py:270
|
||||
msgid "Control"
|
||||
msgstr "控制"
|
||||
|
||||
#: panels/preheat.py:54
|
||||
msgid "Cooldown"
|
||||
msgstr "冷却"
|
||||
|
||||
#: panels/print.py:24
|
||||
msgid "Date"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:53
|
||||
msgid "Decrease"
|
||||
msgstr "减少"
|
||||
|
||||
#: panels/bed_mesh.py:122
|
||||
msgid "Delete"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:108
|
||||
msgid "Disable Motors"
|
||||
msgstr "禁用马达"
|
||||
|
||||
#: panels/bed_level.py:107
|
||||
msgid "Disable XY"
|
||||
msgstr "禁用XY"
|
||||
|
||||
#: panels/settings.py:28
|
||||
msgid "Displayed Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:64
|
||||
msgid "Distance (mm)"
|
||||
msgstr "距离(毫米)"
|
||||
|
||||
#: ks_includes/config.py:42
|
||||
msgid "Duration Only"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:136
|
||||
msgid "Elapsed:"
|
||||
msgstr "过去"
|
||||
|
||||
#: panels/job_status.py:272
|
||||
msgid "Emergency Stop"
|
||||
msgstr "紧急停止"
|
||||
|
||||
#: ks_includes/config.py:39
|
||||
msgid "Estimated Time Method"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
|
||||
#: ks_includes/KlipperScreen.conf:174
|
||||
msgid "Extrude"
|
||||
msgstr "拉伸"
|
||||
|
||||
#: panels/fine_tune.py:57
|
||||
msgid "Extrusion +"
|
||||
msgstr "挤压+"
|
||||
|
||||
#: panels/fine_tune.py:61
|
||||
msgid "Extrusion -"
|
||||
msgstr "挤压-"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
|
||||
msgid "Fan"
|
||||
msgstr "风扇"
|
||||
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan Off"
|
||||
msgstr "散开"
|
||||
|
||||
#: panels/fan.py:38
|
||||
msgid "Fan On"
|
||||
msgstr "扇上"
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Fast"
|
||||
msgstr "快速"
|
||||
|
||||
#: ks_includes/config.py:43
|
||||
msgid "Filament Used"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:41
|
||||
msgid "File Estimation (default)"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:164
|
||||
msgid "Fine Tuning"
|
||||
msgstr "微调"
|
||||
|
||||
#: panels/splash_screen.py:64 panels/system.py:24
|
||||
msgid "Firmware Restart"
|
||||
msgstr "固件重启"
|
||||
|
||||
#: screen.py:300 panels/job_status.py:302
|
||||
msgid "Go Back"
|
||||
msgstr "回去"
|
||||
|
||||
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
|
||||
msgid "Home All"
|
||||
msgstr "全部回家"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:45
|
||||
msgid "Home X"
|
||||
msgstr "X家庭"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:63
|
||||
msgid "Home XY"
|
||||
msgstr "XY首页"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:51
|
||||
msgid "Home Y"
|
||||
msgstr "Y家"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:57
|
||||
msgid "Home Z"
|
||||
msgstr "Z家"
|
||||
|
||||
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
|
||||
msgid "Homing"
|
||||
msgstr "归巢"
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Increase"
|
||||
msgstr "增加"
|
||||
|
||||
#. self._load_panels()
|
||||
#: screen.py:149
|
||||
msgid "Initializing"
|
||||
msgstr "Initializing"
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr "初始化打印机..."
|
||||
|
||||
#: ks_includes/config.py:36
|
||||
msgid "Invert X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:37
|
||||
msgid "Invert Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:38
|
||||
msgid "Invert Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22
|
||||
msgid "Klipper Restart"
|
||||
msgstr "快闪重启"
|
||||
|
||||
#: panels/system.py:42
|
||||
msgid "Klipper Version"
|
||||
msgstr "快艇版本"
|
||||
|
||||
#: screen.py:418
|
||||
msgid "Klipper has disconnected"
|
||||
msgstr "Klipper已断开连接"
|
||||
|
||||
#: screen.py:429
|
||||
msgid ""
|
||||
"Klipper has encountered an error with the micro-controller.\n"
|
||||
"Please recompile and flash."
|
||||
msgstr ""
|
||||
"Klipper的微控制器出错。\n"
|
||||
"请重新编译并刷新。"
|
||||
|
||||
#: screen.py:433
|
||||
msgid "Klipper has encountered an error."
|
||||
msgstr "Klipper遇到错误。"
|
||||
|
||||
#: screen.py:425
|
||||
msgid ""
|
||||
"Klipper has encountered an error.\n"
|
||||
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
msgstr ""
|
||||
"Klipper遇到错误。\n"
|
||||
"发出FIRMWARE_RESTART尝试解决此问题。"
|
||||
|
||||
#: screen.py:453
|
||||
msgid "Klipper has shutdown"
|
||||
msgstr "Klipper已关闭"
|
||||
|
||||
#: screen.py:449
|
||||
msgid "Klipper is attempting to start"
|
||||
msgstr "Klipper正在尝试启动"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:148
|
||||
msgid "Klipper will reboot"
|
||||
msgstr "Klipper将重新启动"
|
||||
|
||||
#: panels/system.py:46
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr "KlipperScreen版本"
|
||||
|
||||
#: panels/job_status.py:124
|
||||
msgid "Left:"
|
||||
msgstr "剩下的时间"
|
||||
|
||||
#: panels/bed_mesh.py:98
|
||||
msgid "Load"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:66
|
||||
msgid "Load Average"
|
||||
msgstr "平均负载"
|
||||
|
||||
#: panels/zcalibrate.py:39
|
||||
msgid "Lower Nozzle"
|
||||
msgstr "下喷嘴"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:96
|
||||
msgid "Macros"
|
||||
msgstr "巨集"
|
||||
|
||||
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
|
||||
msgid "Main Menu"
|
||||
msgstr "主菜单"
|
||||
|
||||
#: panels/extrude.py:31
|
||||
msgid "Medium"
|
||||
msgstr "中"
|
||||
|
||||
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
|
||||
#, fuzzy
|
||||
msgid "Menu"
|
||||
msgstr "主菜单"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:69
|
||||
msgid "Move"
|
||||
msgstr "移动"
|
||||
|
||||
#: panels/move.py:91
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr "移动距离(mm)"
|
||||
|
||||
#: panels/print.py:23
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
|
||||
#: ks_includes/KlipperScreen.conf:211
|
||||
msgid "Network"
|
||||
msgstr "网络"
|
||||
|
||||
#: panels/network.py:31
|
||||
msgid "Network Info"
|
||||
msgstr "网络信息"
|
||||
|
||||
#: panels/temperature.py:55
|
||||
msgid "Number Pad"
|
||||
msgstr "数字键盘"
|
||||
|
||||
#: ks_includes/config.py:48
|
||||
#, fuzzy
|
||||
msgid "Off"
|
||||
msgstr "散开"
|
||||
|
||||
#: panels/job_status.py:276
|
||||
msgid "Pause"
|
||||
msgstr "暂停"
|
||||
|
||||
#: panels/job_status.py:470
|
||||
msgid "Paused"
|
||||
msgstr "已暂停"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
|
||||
#: ks_includes/KlipperScreen.conf:205
|
||||
msgid "Power"
|
||||
msgstr "功率"
|
||||
|
||||
#: panels/splash_screen.py:61
|
||||
msgid "Power On Printer"
|
||||
msgstr "开启打印机电源"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:21
|
||||
msgid "Preheat"
|
||||
msgstr "预热"
|
||||
|
||||
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
|
||||
msgid "Print"
|
||||
msgstr "打印"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:156
|
||||
msgid "Print Control"
|
||||
msgstr "打印控制"
|
||||
|
||||
#: panels/print.py:171
|
||||
msgid "Print Time"
|
||||
msgstr "打印时间"
|
||||
|
||||
#: panels/job_status.py:232
|
||||
msgid "Printing"
|
||||
msgstr "印刷"
|
||||
|
||||
#: panels/bed_mesh.py:264
|
||||
msgid "Profile Name:"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:89
|
||||
msgid "Quad Gantry Level"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:37
|
||||
msgid "Raise Nozzle"
|
||||
msgstr "升高喷嘴"
|
||||
|
||||
#: panels/job_status.py:278 panels/splash_screen.py:62
|
||||
msgid "Restart"
|
||||
msgstr "重新开始"
|
||||
|
||||
#: panels/job_status.py:280
|
||||
msgid "Resume"
|
||||
msgstr "恢复"
|
||||
|
||||
#: panels/extrude.py:48
|
||||
msgid "Retract"
|
||||
msgstr "缩回"
|
||||
|
||||
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
|
||||
msgid "Save"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:141
|
||||
msgid "Save Config"
|
||||
msgstr "保存配置"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:146
|
||||
msgid "Save configuration."
|
||||
msgstr "保存配置"
|
||||
|
||||
#: ks_includes/config.py:46
|
||||
msgid "Screen Blanking Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:114
|
||||
msgid "Screws Adjust"
|
||||
msgstr "螺丝调整"
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Set Speed"
|
||||
msgstr "设定速度"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
|
||||
#, fuzzy
|
||||
msgid "Settings"
|
||||
msgstr "设置"
|
||||
|
||||
#: panels/print.py:169
|
||||
msgid "Size"
|
||||
msgstr "尺寸"
|
||||
|
||||
#: ks_includes/config.py:44
|
||||
msgid "Slicer"
|
||||
msgstr ""
|
||||
|
||||
#. This line for translations only
|
||||
#: panels/extrude.py:31
|
||||
msgid "Slow"
|
||||
msgstr "慢"
|
||||
|
||||
#: panels/print.py:39
|
||||
msgid "Sort by: "
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:47
|
||||
msgid "Speed +"
|
||||
msgstr "速度 +"
|
||||
|
||||
#: panels/fine_tune.py:51
|
||||
msgid "Speed -"
|
||||
msgstr "速度 -"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
|
||||
#: ks_includes/KlipperScreen.conf:216
|
||||
msgid "System"
|
||||
msgstr "系统"
|
||||
|
||||
#: panels/system.py:27
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Restart"
|
||||
msgstr "重新开始"
|
||||
|
||||
#: panels/system.py:30
|
||||
msgid ""
|
||||
"System\n"
|
||||
"Shutdown"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
|
||||
#: ks_includes/KlipperScreen.conf:159
|
||||
msgid "Temperature"
|
||||
msgstr "温度"
|
||||
|
||||
#: panels/extrude.py:38
|
||||
msgid "Tool"
|
||||
msgstr "工具"
|
||||
|
||||
#: panels/print.py:167
|
||||
msgid "Uploaded"
|
||||
msgstr "已上传"
|
||||
|
||||
#: panels/move.py:25
|
||||
msgid "X+"
|
||||
msgstr "X+"
|
||||
|
||||
#: panels/move.py:27
|
||||
msgid "X-"
|
||||
msgstr "X-"
|
||||
|
||||
#: panels/move.py:30
|
||||
msgid "Y+"
|
||||
msgstr "Y ="
|
||||
|
||||
#: panels/move.py:32
|
||||
msgid "Y-"
|
||||
msgstr "Y-"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:125
|
||||
msgid "Z Calibrate"
|
||||
msgstr "Z校准"
|
||||
|
||||
#: panels/zcalibrate.py:28
|
||||
msgid "Z Offset"
|
||||
msgstr "Z偏移"
|
||||
|
||||
#: panels/fine_tune.py:36 panels/move.py:35
|
||||
msgid "Z+"
|
||||
msgstr "Z+"
|
||||
|
||||
#: panels/fine_tune.py:40 panels/move.py:37
|
||||
msgid "Z-"
|
||||
msgstr "Z-"
|
||||
|
||||
#: ks_includes/config.py:60
|
||||
msgid "minutes"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:38
|
||||
msgid "mm"
|
||||
msgstr "毫米"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid "Klipper"
|
||||
#~ msgstr "快闪重启"
|
||||
|
||||
#~ msgid "Back"
|
||||
#~ msgstr "背部"
|
||||
|
||||
#~ msgid "Extrusion"
|
||||
#~ msgstr "挤压"
|
||||
|
||||
#~ msgid "Fan +"
|
||||
#~ msgstr "风扇+"
|
||||
|
||||
#~ msgid "Fan -"
|
||||
#~ msgstr "风扇-"
|
||||
|
||||
#~ msgid "Speed"
|
||||
#~ msgstr "速度"
|
||||
|
||||
#~ msgid "System Information"
|
||||
#~ msgstr "系统信息"
|
||||
|
||||
#~ msgid "Time Elapsed"
|
||||
#~ msgstr "时间流逝"
|
||||
|
||||
#~ msgid "Time Left"
|
||||
#~ msgstr "剩下的时间"
|
||||
|
||||
#~ msgid "Tool 1"
|
||||
#~ msgstr "工具1"
|
||||
@@ -0,0 +1,254 @@
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.Printer")
|
||||
|
||||
class Printer:
|
||||
state_callbacks = {
|
||||
"disconnected": None,
|
||||
"error": None,
|
||||
"paused": None,
|
||||
"printing": None,
|
||||
"ready": None,
|
||||
"startup": None,
|
||||
"shutdown": None
|
||||
}
|
||||
|
||||
def __init__(self, printer_info, data):
|
||||
self.state = "disconnected"
|
||||
self.power_devices = {}
|
||||
|
||||
def reinit(self, printer_info, data):
|
||||
logger.debug("Moonraker object status: %s" % data)
|
||||
self.config = data['configfile']['config']
|
||||
self.toolcount = 0
|
||||
self.extrudercount = 0
|
||||
self.tools = []
|
||||
self.devices = {}
|
||||
self.data = data
|
||||
self.klipper = {}
|
||||
|
||||
self.klipper = {
|
||||
"version": printer_info['software_version']
|
||||
}
|
||||
|
||||
for x in self.config.keys():
|
||||
if x[0:8] == "extruder":
|
||||
if x.startswith('extruder_stepper'):
|
||||
continue
|
||||
|
||||
self.devices[x] = {
|
||||
"temperature": 0,
|
||||
"target": 0
|
||||
}
|
||||
self.tools.append(x)
|
||||
self.tools = sorted(self.tools)
|
||||
self.toolcount += 1
|
||||
if "shared_heater" in self.config[x]:
|
||||
continue
|
||||
self.extrudercount += 1
|
||||
if x.startswith('heater_bed'):
|
||||
self.devices[x] = {
|
||||
"temperature": 0,
|
||||
"target": 0
|
||||
}
|
||||
if x.startswith('bed_mesh '):
|
||||
r = self.config[x]
|
||||
r['x_count'] = int(r['x_count'])
|
||||
r['y_count'] = int(r['y_count'])
|
||||
r['max_x'] = float(r['max_x'])
|
||||
r['min_x'] = float(r['min_x'])
|
||||
r['max_y'] = float(r['max_y'])
|
||||
r['min_y'] = float(r['min_y'])
|
||||
r['points'] = [[float(j.strip()) for j in i.split(",")] for i in r['points'].strip().split("\n")]
|
||||
self.process_update(data)
|
||||
|
||||
logger.info("Klipper version: %s", self.klipper['version'])
|
||||
logger.info("### Toolcount: " + str(self.toolcount) + " Heaters: " + str(self.extrudercount))
|
||||
|
||||
def process_update(self, data):
|
||||
keys = [
|
||||
'bed_mesh',
|
||||
'fan',
|
||||
'gcode_move',
|
||||
'idle_timeout',
|
||||
'pause_resume',
|
||||
'print_stats',
|
||||
'toolhead',
|
||||
'virtual_sdcard',
|
||||
'webhooks'
|
||||
]
|
||||
for x in keys:
|
||||
if x in data:
|
||||
if x not in self.data:
|
||||
self.data[x] = {}
|
||||
|
||||
for y in data[x]:
|
||||
self.data[x][y] = data[x][y]
|
||||
|
||||
if "heater_bed" in data:
|
||||
d = data["heater_bed"]
|
||||
if "target" in d:
|
||||
self.set_dev_stat("heater_bed", "target", d["target"])
|
||||
if "temperature" in d:
|
||||
self.set_dev_stat("heater_bed", "temperature", d["temperature"])
|
||||
for x in self.get_tools():
|
||||
if x in data:
|
||||
d = data[x]
|
||||
if "target" in d:
|
||||
self.set_dev_stat(x, "target", d["target"])
|
||||
if "temperature" in d:
|
||||
self.set_dev_stat(x, "temperature", d["temperature"])
|
||||
|
||||
if "webhooks" in data or "idle_timeout" in data or "pause_resume" in data or "print_stats" in data:
|
||||
self.evaluate_state()
|
||||
|
||||
def evaluate_state(self):
|
||||
wh_state = self.data['webhooks']['state'].lower() # possible values: startup, ready, shutdown, error
|
||||
idle_state = self.data['idle_timeout']['state'].lower() # possible values: Idle, printing, ready
|
||||
print_state = self.data['print_stats']['state'].lower() # possible values: complete, paused, printing, standby
|
||||
|
||||
if wh_state == "ready":
|
||||
new_state = "ready"
|
||||
if print_state == "paused":
|
||||
new_state = "paused"
|
||||
elif idle_state == "printing" and print_state != "printing": # Not printing a file, toolhead moving
|
||||
new_state = "busy"
|
||||
elif idle_state == "printing":
|
||||
new_state = "printing"
|
||||
|
||||
if new_state != "busy":
|
||||
self.change_state(new_state)
|
||||
else:
|
||||
self.change_state(wh_state)
|
||||
|
||||
def process_power_update(self, data):
|
||||
if data['device'] in self.power_devices:
|
||||
self.power_devices[data['device']]['status'] = data['status']
|
||||
|
||||
def change_state(self, state):
|
||||
if state == self.state or state not in list(self.state_callbacks):
|
||||
return
|
||||
|
||||
logger.debug("Changing state from '%s' to '%s'" % (self.state, state))
|
||||
self.state = state
|
||||
if self.state_callbacks[state] != None:
|
||||
logger.debug("Running callback for state: %s" % state)
|
||||
self.state_callbacks[state]()
|
||||
|
||||
def configure_power_devices(self, data):
|
||||
self.power_devices = {}
|
||||
|
||||
logger.debug("Processing power devices: %s" % data)
|
||||
for x in data['devices']:
|
||||
self.power_devices[x['device']] = {
|
||||
"status": "on" if x['status'] == "on" else "off"
|
||||
}
|
||||
logger.debug("Power devices: %s" % self.power_devices)
|
||||
|
||||
def config_section_exists(self, section):
|
||||
return section in list(self.config)
|
||||
|
||||
def get_config_section_list(self, search=""):
|
||||
return [i for i in list(self.config) if i.startswith(search)]
|
||||
|
||||
def get_config_section(self, section):
|
||||
if section not in self.config:
|
||||
return False
|
||||
return self.config[section]
|
||||
|
||||
def get_data(self):
|
||||
return self.data
|
||||
|
||||
def get_gcode_macros(self):
|
||||
return self.get_config_section_list("gcode_macro ")
|
||||
|
||||
def get_printer_status_data(self):
|
||||
data = {
|
||||
"printer": {
|
||||
"bltouch": self.section_exists("bltouch"),
|
||||
"gcode_macros": {
|
||||
"count": len(self.get_gcode_macros())
|
||||
},
|
||||
"idle_timeout": self.get_stat("idle_timeout").copy(),
|
||||
"pause_resume": self.get_stat("pause_resume").copy(),
|
||||
"power_devices": {
|
||||
"count": len(self.get_power_devices())
|
||||
},
|
||||
"probe": self.section_exists("probe")
|
||||
}
|
||||
}
|
||||
|
||||
sections = ["bed_mesh","bltouch","probe","quad_gantry_level"]
|
||||
for section in sections:
|
||||
if self.config_section_exists(section):
|
||||
data["printer"][section] = self.get_config_section(section).copy()
|
||||
|
||||
return data
|
||||
|
||||
def get_klipper_version(self):
|
||||
return self.klipper['version']
|
||||
|
||||
def get_power_devices(self):
|
||||
return list(self.power_devices)
|
||||
|
||||
def get_power_device_status(self, device):
|
||||
if device not in self.power_devices:
|
||||
return
|
||||
return self.power_devices[device]['status']
|
||||
|
||||
def get_stat(self, stat, substat = None):
|
||||
if stat not in self.data:
|
||||
return None
|
||||
if substat != None:
|
||||
if substat in self.data[stat]:
|
||||
return self.data[stat][substat]
|
||||
return None
|
||||
return self.data[stat]
|
||||
|
||||
def get_state(self):
|
||||
return self.state
|
||||
|
||||
def set_dev_temps(self, dev, temp, target=None):
|
||||
if dev in self.devices:
|
||||
self.devices[dev]['temperature'] = temp
|
||||
if target != None:
|
||||
self.devices[dev]['target'] = target
|
||||
|
||||
def get_dev_stats(self, dev):
|
||||
if dev in self.devices:
|
||||
return self.devices[dev]
|
||||
return None
|
||||
|
||||
def get_dev_stat(self, dev, stat):
|
||||
if dev in self.devices and stat in self.devices[dev]:
|
||||
return self.devices[dev][stat]
|
||||
return None
|
||||
|
||||
def get_extruder_count(self):
|
||||
return self.extrudercount
|
||||
|
||||
def get_tools(self):
|
||||
return self.tools
|
||||
|
||||
def get_tool_number(self, tool):
|
||||
return self.tools.index(tool)
|
||||
|
||||
def has_heated_bed(self):
|
||||
if "heater_bed" in self.devices:
|
||||
return True
|
||||
|
||||
def section_exists(self, section):
|
||||
if section in self.get_config_section_list():
|
||||
return True
|
||||
return False
|
||||
|
||||
def set_callbacks(self, callbacks):
|
||||
for name, cb in callbacks.items():
|
||||
if name in list(self.state_callbacks):
|
||||
self.state_callbacks[name] = cb
|
||||
|
||||
def set_dev_stat(self, dev, stat, value):
|
||||
if dev not in self.devices:
|
||||
return
|
||||
|
||||
self.devices[dev][stat] = value
|
||||
@@ -0,0 +1,126 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
from jinja2 import Environment, Template
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
logger = logging.getLogger("KlipperScreen.ScreenPanel")
|
||||
|
||||
class ScreenPanel:
|
||||
title_spacing = 50
|
||||
control = {}
|
||||
|
||||
def __init__(self, screen, title, back=True):
|
||||
self._screen = screen
|
||||
self._config = screen._config
|
||||
self._files = screen.files
|
||||
self.lang = self._screen.lang
|
||||
self._printer = screen.printer
|
||||
self.labels = {}
|
||||
self._gtk = screen.gtk
|
||||
|
||||
self.layout = Gtk.Layout()
|
||||
self.layout.set_size(self._screen.width, self._screen.height)
|
||||
|
||||
action_bar_width = self._gtk.get_action_bar_width()
|
||||
|
||||
self.control_grid = self._gtk.HomogeneousGrid()
|
||||
self.control_grid.set_size_request(action_bar_width - 2, self._screen.height)
|
||||
self.control_grid.get_style_context().add_class('action_bar')
|
||||
|
||||
button_scale = self._gtk.get_header_image_scale()
|
||||
logger.debug("Button scale: %s" % button_scale)
|
||||
if back == True:
|
||||
self.control['back'] = self._gtk.ButtonImage('back', None, None, button_scale[0], button_scale[1])
|
||||
self.control['back'].connect("clicked", self._screen._menu_go_back)
|
||||
self.control_grid.attach(self.control['back'], 0, 0, 1, 1)
|
||||
|
||||
self.control['home'] = self._gtk.ButtonImage('home', None, None, button_scale[0], button_scale[1])
|
||||
self.control['home'].connect("clicked", self.menu_return, True)
|
||||
self.control_grid.attach(self.control['home'], 0, 1, 1, 1)
|
||||
|
||||
self.control['printer_select'] = Gtk.Label("")
|
||||
self.control_grid.attach(self.control['printer_select'], 0, 2, 1, 1)
|
||||
else:
|
||||
for i in range(3):
|
||||
self.control['space%s' % i] = Gtk.Label("")
|
||||
self.control_grid.attach(self.control['space%s' % i], 0, i, 1, 1)
|
||||
|
||||
self.control['estop'] = self._gtk.ButtonImage('emergency', None, None, button_scale[0], button_scale[1])
|
||||
self.control['estop'].connect("clicked", self.emergency_stop)
|
||||
self.control_grid.attach(self.control['estop'], 0, 3, 1, 1)
|
||||
#self.layout.put(self.control['estop'], int(self._screen.width/4*3 - button_scale[0]/2), 0)
|
||||
|
||||
try:
|
||||
env = Environment(extensions=["jinja2.ext.i18n"])
|
||||
env.install_gettext_translations(self.lang)
|
||||
j2_temp = env.from_string(title)
|
||||
title = j2_temp.render()
|
||||
except:
|
||||
logger.debug("Error parsing jinja for title: %s" % title)
|
||||
|
||||
self.title = Gtk.Label()
|
||||
self.title.set_size_request(self._screen.width - action_bar_width, self.title_spacing)
|
||||
self.title.set_hexpand(True)
|
||||
self.title.set_halign(Gtk.Align.CENTER)
|
||||
self.title.set_valign(Gtk.Align.CENTER)
|
||||
self.set_title(title)
|
||||
|
||||
|
||||
self.content = Gtk.Box(spacing=0)
|
||||
self.content.set_size_request(self._screen.width - action_bar_width, self._screen.height - self.title_spacing)
|
||||
|
||||
self.layout.put(self.control_grid, 0, 0)
|
||||
self.layout.put(self.title, action_bar_width, 0)
|
||||
self.layout.put(self.content, action_bar_width, self.title_spacing)
|
||||
|
||||
|
||||
def initialize(self, panel_name):
|
||||
# Create gtk items here
|
||||
return
|
||||
|
||||
def emergency_stop(self, widget):
|
||||
self._screen._ws.klippy.emergency_stop()
|
||||
|
||||
def get(self):
|
||||
return self.layout
|
||||
|
||||
def get_file_image(self, filename, width=1.6, height=1.6):
|
||||
if not self._files.has_thumbnail(filename):
|
||||
return None
|
||||
return self._gtk.PixbufFromFile(self._files.get_thumbnail_location(filename), None, width, height)
|
||||
|
||||
def home(self, widget):
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
|
||||
|
||||
def menu_item_clicked(self, widget, panel, item):
|
||||
print("### Creating panel "+ item['panel'] + " : %s %s" % (panel, item))
|
||||
if "items" in item:
|
||||
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + panel, item['panel'], item['name'],
|
||||
1, False, items=item['items'])
|
||||
return
|
||||
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + panel, item['panel'], item['name'],
|
||||
1, False)
|
||||
|
||||
def menu_return(self, widget, home=False):
|
||||
if home == False:
|
||||
self._screen._menu_go_back()
|
||||
return
|
||||
self._screen._menu_go_home()
|
||||
|
||||
def set_title(self, title):
|
||||
self.title.set_label(title)
|
||||
|
||||
def show_all(self):
|
||||
self._screen.show_all()
|
||||
|
||||
def update_image_text(self, label, text):
|
||||
if label in self.labels and 'l' in self.labels[label]:
|
||||
self.labels[label]['l'].set_text(text)
|
||||
|
||||
def update_temp(self, dev, temp, target):
|
||||
if dev in self.labels:
|
||||
self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
|
||||
@@ -0,0 +1,178 @@
|
||||
import asyncio
|
||||
import os, signal
|
||||
import json
|
||||
import logging
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
from contextlib import suppress
|
||||
from threading import Thread
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.WifiManager")
|
||||
|
||||
RESCAN_INTERVAL = 120
|
||||
|
||||
class WifiManager(Thread):
|
||||
iw_regexes = [
|
||||
re.compile(r"^ESSID:\"(?P<essid>.*)\"$"),
|
||||
re.compile(r"^Protocol:(?P<protocol>.+)$"),
|
||||
re.compile(r"^Mode:(?P<mode>.+)$"),
|
||||
re.compile(r"^Frequency:(?P<frequency>[\d.]+) (?P<frequency_units>.+) \(Channel (?P<channel>\d+)\)$"),
|
||||
re.compile(r"^Encryption key:(?P<encryption>.+)$"),
|
||||
re.compile(r"^Quality=(?P<signal_quality>\d+)/(?P<signal_total>\d+)\s+Signal level=(?P<signal_level_dBm>.+) d.+$"),
|
||||
re.compile(r"^Signal level=(?P<signal_quality>\d+)/(?P<signal_total>\d+).*$")
|
||||
]
|
||||
networks_in_supplicant = []
|
||||
wpa = {
|
||||
"wpa": re.compile(r"IE:\ WPA\ Version\ 1$"),
|
||||
"wpa2": re.compile(r"IE:\ IEEE\ 802\.11i/WPA2\ Version\ 1$")
|
||||
}
|
||||
connected = False
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.loop = None
|
||||
self._poll_task = None
|
||||
self._scanning = False
|
||||
self.networks = {}
|
||||
self.read_wpa_supplicant()
|
||||
|
||||
def run(self):
|
||||
logger.debug("Setting up wifi event loop")
|
||||
self.loop = asyncio.new_event_loop()
|
||||
loop = self.loop
|
||||
asyncio.set_event_loop(loop)
|
||||
try:
|
||||
self._poll_task = asyncio.ensure_future(self._poll())
|
||||
loop.run_forever()
|
||||
loop.run_until_complete(loop.shutdown_asyncgens())
|
||||
|
||||
self._poll_task.cancel()
|
||||
with suppress(asyncio.CancelledError):
|
||||
loop.run_until_complete(self._poll_task)
|
||||
finally:
|
||||
loop.close()
|
||||
|
||||
def stop(self):
|
||||
self.loop.call_soon_threadsafe(self.loop.stop)
|
||||
|
||||
def stop_loop(self):
|
||||
loop.stop()
|
||||
|
||||
async def _poll(self):
|
||||
while True:
|
||||
try:
|
||||
await self.scan()
|
||||
await asyncio.sleep(RESCAN_INTERVAL)
|
||||
except:
|
||||
logger.exception("Poll wifi error")
|
||||
|
||||
def get_current_wifi(self, interface="wlan0"):
|
||||
p = subprocess.Popen(["iwconfig",interface], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
content = p.stdout.read().decode('utf-8').split('\n')
|
||||
|
||||
essid = None
|
||||
mac = None
|
||||
for line in content:
|
||||
match = re.match(r'^.*ESSID:"(.*)"$', line.strip())
|
||||
if match:
|
||||
essid = match.group(1)
|
||||
continue
|
||||
match = re.match(r'^.*Access\s+Point:\s+([0-9A-Fa-f:]+)$', line.strip())
|
||||
if match:
|
||||
mac = match.group(1)
|
||||
break
|
||||
|
||||
if essid is None or mac is None:
|
||||
self.connected = False
|
||||
return None
|
||||
self.connected = True
|
||||
return [essid, mac]
|
||||
|
||||
def get_network_info(self, essid=None, mac=None):
|
||||
if essid is not None and essid in self.networks:
|
||||
return self.networks[essid]
|
||||
if mac is not None and essid is None:
|
||||
for net in self.networks:
|
||||
if mac == net['mac']:
|
||||
return net
|
||||
return None
|
||||
|
||||
def get_networks(self):
|
||||
return list(self.networks)
|
||||
|
||||
def is_connected(self):
|
||||
return self.connected
|
||||
|
||||
def parse(self, data):
|
||||
aps = []
|
||||
lines = data.split('\n')
|
||||
|
||||
for line in lines:
|
||||
line = line.strip()
|
||||
match = re.match(r'^Cell\s+([0-9]+)\s+-\s+Address:\s+(?P<mac>[0-9A-Fa-f:]+)$', line)
|
||||
if match:
|
||||
aps.append({"mac":match.group(2)})
|
||||
continue
|
||||
if len(aps) < 1:
|
||||
continue
|
||||
for w, wreg in self.wpa.items():
|
||||
t = wreg.search(line)
|
||||
if t is not None:
|
||||
aps[-1].update({'encryption': w})
|
||||
for exp in self.iw_regexes:
|
||||
result = exp.search(line)
|
||||
if result is not None:
|
||||
if "encryption" in result.groupdict():
|
||||
if result.groupdict()['encryption'] == 'on' :
|
||||
aps[-1].update({'encryption': 'wep'})
|
||||
else:
|
||||
aps[-1].update({'encryption': 'off'})
|
||||
else:
|
||||
aps[-1].update(result.groupdict())
|
||||
return aps
|
||||
|
||||
def read_wpa_supplicant(self):
|
||||
wpaconf = "/etc/wpa_supplicant/wpa_supplicant.conf"
|
||||
if not os.path.exists(wpaconf):
|
||||
return None
|
||||
|
||||
regexes = [
|
||||
re.compile(r'^ssid\s*=\s*"(?P<ssid>.*)"$'),
|
||||
re.compile(r'^psk\s*=\s*"(?P<psk>.*)"$')
|
||||
]
|
||||
networks = []
|
||||
p = subprocess.Popen(["sudo","cat",wpaconf], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
contents = p.stdout.read().decode('utf-8').split('\n')
|
||||
|
||||
for line in contents:
|
||||
if re.match(r'^network\s*=\s*{$', line.strip()):
|
||||
networks.append({})
|
||||
continue
|
||||
if len(networks) < 1:
|
||||
continue
|
||||
for exp in regexes:
|
||||
result = exp.search(line.strip())
|
||||
if result is not None:
|
||||
networks[-1].update(result.groupdict())
|
||||
|
||||
self.networks_in_supplicant = []
|
||||
for network in networks:
|
||||
self.networks_in_supplicant.append(network)
|
||||
|
||||
async def scan(self, interface='wlan0'):
|
||||
logger.debug("Scanning %s" % interface)
|
||||
p = subprocess.Popen(["sudo","iwlist",interface,"scan"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
aps = self.parse(p.stdout.read().decode('utf-8'))
|
||||
cur_info = self.get_current_wifi()
|
||||
|
||||
|
||||
self.networks = {}
|
||||
for ap in aps:
|
||||
self.networks[ap['essid']] = ap
|
||||
if cur_info is not None and cur_info[0] == ap['essid'] and cur_info[1] == ap['mac']:
|
||||
self.networks[ap['essid']]['connected'] = True
|
||||
for net in self.networks_in_supplicant:
|
||||
if ap['essid'] == net['ssid'] and "psk" in net:
|
||||
ap['psk'] = net['psk']
|
||||
break
|
||||
@@ -5,41 +5,64 @@ import re
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGcodes import KlippyGcodes
|
||||
from KlippyGtk import KlippyGtk
|
||||
from panels.screen_panel import ScreenPanel
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.BedLevelPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return BedLevelPanel(*args)
|
||||
|
||||
class BedLevelPanel(ScreenPanel):
|
||||
def initialize(self, menu):
|
||||
x_offset = 0
|
||||
y_offset = 0
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
self.panel_name = panel_name
|
||||
self.screws = None
|
||||
self.panel = KlippyGtk.HomogeneousGrid()
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
self.disabled_motors = False
|
||||
|
||||
screws = []
|
||||
if "bed_screws" in self._screen.printer.get_config_section_list():
|
||||
bed_screws = self._screen.printer.get_config_section("bed_screws")
|
||||
for item in bed_screws:
|
||||
if re.match(r"^[0-9\.]+,[0-9\.]+$", bed_screws[item]):
|
||||
screws.append(bed_screws[item].split(","))
|
||||
config_section_name = None
|
||||
if "screws_tilt_adjust" in self._screen.printer.get_config_section_list():
|
||||
config_section_name = "screws_tilt_adjust"
|
||||
elif "bed_screws" in self._screen.printer.get_config_section_list():
|
||||
config_section_name = "bed_screws"
|
||||
|
||||
if config_section_name != None:
|
||||
config_section = self._screen.printer.get_config_section(config_section_name)
|
||||
for item in config_section:
|
||||
logger.debug("Screws section: %s" % config_section[item])
|
||||
result = re.match(r"([0-9\.]+)\s*,\s*([0-9\.]+)", config_section[item])
|
||||
if result:
|
||||
screws.append([
|
||||
round(float(result.group(1)),2),
|
||||
round(float(result.group(2)),2)
|
||||
])
|
||||
|
||||
screws = sorted(screws, key=lambda x: (float(x[1]), float(x[0])))
|
||||
logger.debug("Bed screw locations [x,y]: %s", screws)
|
||||
if "bltouch" in self._screen.printer.get_config_section_list():
|
||||
if ("bltouch" in self._screen.printer.get_config_section_list() and
|
||||
config_section_name == "screws_tilt_adjust"):
|
||||
x_offset = 0
|
||||
y_offset = 0
|
||||
bltouch = self._screen.printer.get_config_section("bltouch")
|
||||
if "x_offset" in bltouch:
|
||||
x_offset = float(bltouch['x_offset'])
|
||||
self.x_offset = float(bltouch['x_offset'])
|
||||
if "y_offset" in bltouch:
|
||||
y_offset = float(bltouch['y_offset'])
|
||||
self.y_offset = float(bltouch['y_offset'])
|
||||
new_screws = []
|
||||
for screw in screws:
|
||||
new_screws.append([float(screw[0]) + x_offset, float(screw[1]) + y_offset])
|
||||
new_screws.append([
|
||||
round(float(screw[0]) + self.x_offset,2),
|
||||
round(float(screw[1]) + self.y_offset,2)
|
||||
])
|
||||
screws = new_screws
|
||||
|
||||
self.screws = screws
|
||||
logger.debug("Screws: %s" % screws)
|
||||
|
||||
if len(screws) < 4:
|
||||
logger.debug("bed_screws not configured, calculating locations")
|
||||
@@ -47,7 +70,7 @@ class BedLevelPanel(ScreenPanel):
|
||||
yconf = self._screen.printer.get_config_section("stepper_y")
|
||||
x = int(int(xconf['position_max'])/4)
|
||||
y = int(int(yconf['position_max'])/4)
|
||||
screws = [
|
||||
self.screws = [
|
||||
[x, y],
|
||||
[x*3, y],
|
||||
[x, y*3],
|
||||
@@ -58,36 +81,47 @@ class BedLevelPanel(ScreenPanel):
|
||||
logger.debug("Configured screw locations [x,y]: %s", screws)
|
||||
|
||||
|
||||
self.labels['tl'] = KlippyGtk.ButtonImage("bed-level-t-l")
|
||||
self.labels['tl'].connect("clicked", self.go_to_position, self.screws[2])
|
||||
self.labels['tr'] = KlippyGtk.ButtonImage("bed-level-t-r")
|
||||
self.labels['tr'].connect("clicked", self.go_to_position, self.screws[3])
|
||||
self.labels['bl'] = KlippyGtk.ButtonImage("bed-level-b-l")
|
||||
self.labels['bl'].connect("clicked", self.go_to_position, self.screws[0])
|
||||
self.labels['br'] = KlippyGtk.ButtonImage("bed-level-b-r")
|
||||
self.labels['br'].connect("clicked", self.go_to_position, self.screws[1])
|
||||
self.labels['bl'] = self._gtk.ButtonImage("bed-level-t-l", None, None, 3, 3)
|
||||
self.labels['bl'].connect("clicked", self.go_to_position, self.screws[2])
|
||||
self.labels['br'] = self._gtk.ButtonImage("bed-level-t-r", None, None, 3, 3)
|
||||
self.labels['br'].connect("clicked", self.go_to_position, self.screws[3])
|
||||
self.labels['fl'] = self._gtk.ButtonImage("bed-level-b-l", None, None, 3, 3)
|
||||
self.labels['fl'].connect("clicked", self.go_to_position, self.screws[0])
|
||||
self.labels['fr'] = self._gtk.ButtonImage("bed-level-b-r", None, None, 3, 3)
|
||||
self.labels['fr'].connect("clicked", self.go_to_position, self.screws[1])
|
||||
|
||||
self.panel.attach(self.labels['tl'], 1, 0, 1, 1)
|
||||
self.panel.attach(self.labels['tr'], 2, 0, 1, 1)
|
||||
self.panel.attach(self.labels['bl'], 1, 1, 1, 1)
|
||||
self.panel.attach(self.labels['br'], 2, 1, 1, 1)
|
||||
if self._screen.lang_ltr:
|
||||
grid.attach(self.labels['bl'], 1, 0, 1, 1)
|
||||
grid.attach(self.labels['br'], 2, 0, 1, 1)
|
||||
grid.attach(self.labels['fl'], 1, 1, 1, 1)
|
||||
grid.attach(self.labels['fr'], 2, 1, 1, 1)
|
||||
else:
|
||||
grid.attach(self.labels['bl'], 2, 0, 1, 1)
|
||||
grid.attach(self.labels['br'], 1, 0, 1, 1)
|
||||
grid.attach(self.labels['fl'], 2, 1, 1, 1)
|
||||
grid.attach(self.labels['fr'], 1, 1, 1, 1)
|
||||
|
||||
self.labels['home'] = KlippyGtk.ButtonImage("home","Home All","color2")
|
||||
self.labels['home'] = self._gtk.ButtonImage("home",_("Home All"),"color2")
|
||||
self.labels['home'].connect("clicked", self.home)
|
||||
|
||||
self.labels['dm'] = KlippyGtk.ButtonImage("motor-off", "Disable XY", "color3")
|
||||
self.labels['dm'] = self._gtk.ButtonImage("motor-off", _("Disable XY"), "color3")
|
||||
self.labels['dm'].connect("clicked", self.disable_motors)
|
||||
|
||||
self.panel.attach(self.labels['home'], 0, 0, 1, 1)
|
||||
self.panel.attach(self.labels['dm'], 0, 1, 1, 1)
|
||||
grid.attach(self.labels['home'], 0, 0, 1, 1)
|
||||
grid.attach(self.labels['dm'], 0, 1, 1, 1)
|
||||
|
||||
self.labels['estop'] = KlippyGtk.ButtonImage("decrease","Emergency Stop","color4")
|
||||
self.labels['estop'].connect("clicked", self.emergency_stop)
|
||||
self.panel.attach(self.labels['estop'], 3, 0, 1, 1)
|
||||
if self._printer.config_section_exists("screws_tilt_adjust"):
|
||||
self.labels['screws'] = self._gtk.ButtonImage("refresh",_("Screws Adjust"),"color4")
|
||||
self.labels['screws'].connect("clicked", self.screws_tilt_calculate)
|
||||
grid.attach(self.labels['screws'], 3, 0, 1, 1)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
self.panel.attach(b, 3, 1, 1, 1)
|
||||
self.content.add(grid)
|
||||
|
||||
def activate(self):
|
||||
self.labels['bl'].set_label("")
|
||||
self.labels['br'].set_label("")
|
||||
self.labels['fl'].set_label("")
|
||||
self.labels['fr'].set_label("")
|
||||
|
||||
def go_to_position(self, widget, position):
|
||||
logger.debug("Going to position: %s", position)
|
||||
@@ -111,10 +145,29 @@ class BedLevelPanel(ScreenPanel):
|
||||
"M18" # Disable motors
|
||||
)
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action == "notify_gcode_response":
|
||||
result = re.match(
|
||||
"^// (.*) : X ([0-9\.]+), Y ([0-9\.]+), Z [0-9\.]+ : Adjust -> ([CW]+ [0-9:]+)",
|
||||
data
|
||||
)
|
||||
if result:
|
||||
screw_labels = ['fl','fr','bl','br']
|
||||
x = int(float(result.group(2)) + self.x_offset)
|
||||
y = int(float(result.group(3)) + self.y_offset)
|
||||
logger.debug(data)
|
||||
logger.debug("X: %s Y: %s" % (x,y))
|
||||
for i in range(len(self.screws)):
|
||||
logger.debug(self.screws[i])
|
||||
if x == int(float(self.screws[i][0])) and y == int(float(self.screws[i][1])):
|
||||
break
|
||||
self.labels[screw_labels[i]].set_label(result.group(4))
|
||||
self.response_count += 1
|
||||
if self.response_count >= len(self.screws)-1:
|
||||
self._screen.remove_subscription(self.panel_name)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#for screw in screws:
|
||||
# sorted(screws.items(), key=lambda x: (float(x[1].split(",")[0]), float(x[1].split(",")[1])))
|
||||
def screws_tilt_calculate(self, widget):
|
||||
self.response_count = 0
|
||||
self._screen.add_subscription(self.panel_name)
|
||||
self._screen._ws.klippy.gcode_script("SCREWS_TILT_CALCULATE")
|
||||
@@ -0,0 +1,295 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.BedMeshPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return BedMeshPanel(*args)
|
||||
|
||||
class BedMeshPanel(ScreenPanel):
|
||||
active_mesh = None
|
||||
graphs = {}
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
self.show_create = False
|
||||
|
||||
scroll = Gtk.ScrolledWindow()
|
||||
scroll.set_property("overlay-scrolling", False)
|
||||
scroll.set_vexpand(True)
|
||||
|
||||
# Create a grid for all profiles
|
||||
self.labels['profiles'] = Gtk.Grid()
|
||||
scroll.add(self.labels['profiles'])
|
||||
|
||||
|
||||
addprofile = self._gtk.ButtonImage("increase"," %s" % _("Add bed mesh profile"),
|
||||
"color1", .5, .5, Gtk.PositionType.LEFT)
|
||||
addprofile.connect("clicked", self.show_create_profile)
|
||||
addprofile.set_size_request(60,0)
|
||||
addprofile.set_hexpand(False)
|
||||
addprofile.set_halign(Gtk.Align.END)
|
||||
abox = Gtk.Box(spacing=0)
|
||||
abox.set_vexpand(False)
|
||||
abox.add(addprofile)
|
||||
|
||||
# Create a box to contain all of the above
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||
box.set_vexpand(True)
|
||||
box.pack_start(abox, False, False, 0)
|
||||
box.pack_end(scroll, True, True, 0)
|
||||
|
||||
self.load_meshes()
|
||||
|
||||
self.labels['main_box'] = box
|
||||
self.control['back'].disconnect_by_func(self._screen._menu_go_back)
|
||||
self.control['back'].connect("clicked", self.back)
|
||||
self.content.add(self.labels['main_box'])
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def activate(self):
|
||||
for child in self.content.get_children():
|
||||
self.content.remove(child)
|
||||
self.content.add(self.labels['main_box'])
|
||||
|
||||
am = self._screen.printer.get_stat("bed_mesh","profile_name")
|
||||
self.activate_mesh(am)
|
||||
|
||||
def activate_mesh(self, profile):
|
||||
if profile == "":
|
||||
profile = None
|
||||
|
||||
logger.debug("Activating profile: %s %s" % (self.active_mesh, profile))
|
||||
if profile != self.active_mesh:
|
||||
if profile not in self.profiles:
|
||||
self.add_profile(profile)
|
||||
if self.active_mesh != None and self.active_mesh in self.profiles:
|
||||
a = self.profiles[self.active_mesh]
|
||||
a['buttons'].remove(a['refresh'])
|
||||
a['buttons'].pack_start(a['load'], False, False, 0)
|
||||
self.active_mesh = profile
|
||||
if self.active_mesh != None:
|
||||
a = self.profiles[profile]
|
||||
a['buttons'].remove(a['load'])
|
||||
a['buttons'].pack_start(a['refresh'], False, False, 0)
|
||||
self._screen.show_all()
|
||||
|
||||
def add_profile(self, profile):
|
||||
_ = self.lang.gettext
|
||||
|
||||
frame = Gtk.Frame()
|
||||
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
|
||||
|
||||
name = Gtk.Label()
|
||||
name.set_markup("<big><b>%s</b></big>" % (profile))
|
||||
name.set_hexpand(True)
|
||||
name.set_vexpand(True)
|
||||
name.set_halign(Gtk.Align.START)
|
||||
name.set_line_wrap(True)
|
||||
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
load = self._gtk.ButtonImage("load",_("Load"),"color2")
|
||||
load.connect("clicked", self.send_load_mesh, profile)
|
||||
load.set_size_request(60,0)
|
||||
load.set_hexpand(False)
|
||||
load.set_halign(Gtk.Align.END)
|
||||
|
||||
refresh = self._gtk.ButtonImage("refresh",_("Calibrate"),"color4")
|
||||
refresh.connect("clicked", self.calibrate_mesh)
|
||||
refresh.set_size_request(60,0)
|
||||
refresh.set_hexpand(False)
|
||||
refresh.set_halign(Gtk.Align.END)
|
||||
|
||||
info = self._gtk.ButtonImage("info",None,"color3")
|
||||
info.connect("clicked", self.show_mesh, profile)
|
||||
info.set_size_request(60,0)
|
||||
info.set_hexpand(False)
|
||||
info.set_halign(Gtk.Align.END)
|
||||
|
||||
save = self._gtk.ButtonImage("sd",_("Save"),"color3")
|
||||
save.connect("clicked", self.send_save_mesh, profile)
|
||||
save.set_size_request(60,0)
|
||||
save.set_hexpand(False)
|
||||
save.set_halign(Gtk.Align.END)
|
||||
|
||||
delete = self._gtk.ButtonImage("decrease",_("Delete"),"color3")
|
||||
delete.connect("clicked", self.send_remove_mesh, profile)
|
||||
delete.set_size_request(60,0)
|
||||
delete.set_hexpand(False)
|
||||
delete.set_halign(Gtk.Align.END)
|
||||
|
||||
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
labels.add(name)
|
||||
|
||||
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
dev.set_margin_top(10)
|
||||
dev.set_margin_end(15)
|
||||
dev.set_margin_start(15)
|
||||
dev.set_margin_bottom(10)
|
||||
dev.set_hexpand(True)
|
||||
dev.set_vexpand(False)
|
||||
dev.add(labels)
|
||||
|
||||
buttons = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
logger.debug("Profile compare: '%s' '%s'" % (self.active_mesh, profile))
|
||||
if self.active_mesh == profile:
|
||||
buttons.pack_start(refresh, False, False, 0)
|
||||
else:
|
||||
buttons.pack_start(load, False, False, 0)
|
||||
#buttons.pack_end(info, False, False, 0)
|
||||
|
||||
if profile != "default":
|
||||
buttons.pack_end(save, False, False, 0)
|
||||
buttons.pack_end(delete, False, False, 0)
|
||||
|
||||
dev.add(buttons)
|
||||
frame.add(dev)
|
||||
|
||||
self.profiles[profile] = {
|
||||
"box": dev,
|
||||
"buttons": buttons,
|
||||
"row": frame,
|
||||
"load": load,
|
||||
"refresh": refresh,
|
||||
"save": save
|
||||
}
|
||||
|
||||
l = list(self.profiles)
|
||||
if "default" in l:
|
||||
l.remove('default')
|
||||
profiles = sorted(l)
|
||||
pos = profiles.index(profile)+1 if profile != "default" else 0
|
||||
|
||||
self.labels['profiles'].insert_row(pos)
|
||||
self.labels['profiles'].attach(self.profiles[profile]['row'], 0, pos, 1, 1)
|
||||
self.labels['profiles'].show_all()
|
||||
|
||||
#Gdk.threads_add_idle(GLib.PRIORITY_LOW, self.create_graph, profile)
|
||||
|
||||
def back(self, widget):
|
||||
if self.show_create == True:
|
||||
self.remove_create()
|
||||
else:
|
||||
self._screen._menu_go_back()
|
||||
|
||||
def create_profile(self, widget):
|
||||
name = self.labels['profile_name'].get_text()
|
||||
if " " in name:
|
||||
name = '"%s"' % name
|
||||
|
||||
self._screen._ws.klippy.gcode_script("BED_MESH_PROFILE SAVE=%s" % name)
|
||||
self.remove_create()
|
||||
|
||||
def calibrate_mesh(self, widget):
|
||||
self._screen._ws.klippy.gcode_script(
|
||||
"BED_MESH_CALIBRATE"
|
||||
)
|
||||
|
||||
def load_meshes(self):
|
||||
bm_profiles = self._screen.printer.get_config_section_list("bed_mesh ")
|
||||
self.profiles = {}
|
||||
for prof in bm_profiles:
|
||||
self.add_profile(prof[9:])
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action == "notify_status_update":
|
||||
if "bed_mesh" in data and "profile_name" in data['bed_mesh']:
|
||||
if data['bed_mesh']['profile_name'] != self.active_mesh:
|
||||
self.activate_mesh(data['bed_mesh']['profile_name'])
|
||||
|
||||
def remove_create(self):
|
||||
if self.show_create == False:
|
||||
return
|
||||
|
||||
self._screen.remove_keyboard()
|
||||
for child in self.content.get_children():
|
||||
self.content.remove(child)
|
||||
|
||||
self.show_create = False
|
||||
self.content.add(self.labels['main_box'])
|
||||
self.content.show()
|
||||
|
||||
def remove_profile(self, profile):
|
||||
if profile not in self.profiles:
|
||||
return
|
||||
|
||||
l = list(self.profiles)
|
||||
if "default" in l:
|
||||
l.remove('default')
|
||||
profiles = sorted(l)
|
||||
pos = profiles.index(profile)+1 if profile != "default" else 0
|
||||
self.labels['profiles'].remove_row(pos)
|
||||
del self.profiles[profile]
|
||||
|
||||
def send_load_mesh(self, widget, profile):
|
||||
self._screen._ws.klippy.gcode_script(
|
||||
KlippyGcodes.bed_mesh_load(profile)
|
||||
)
|
||||
|
||||
def send_save_mesh(self, widget, profile):
|
||||
self._screen._ws.klippy.gcode_script(
|
||||
KlippyGcodes.bed_mesh_save(profile)
|
||||
)
|
||||
|
||||
def send_remove_mesh(self, widget, profile):
|
||||
self._screen._ws.klippy.gcode_script(
|
||||
KlippyGcodes.bed_mesh_remove(profile)
|
||||
)
|
||||
self.remove_profile(profile)
|
||||
|
||||
def show_create_profile(self, widget):
|
||||
_ = self.lang.gettext
|
||||
|
||||
for child in self.content.get_children():
|
||||
self.content.remove(child)
|
||||
|
||||
if "create_profile" not in self.labels:
|
||||
self.labels['create_profile'] = Gtk.VBox()
|
||||
self.labels['create_profile'].set_valign(Gtk.Align.START)
|
||||
|
||||
box = Gtk.Box(spacing=5)
|
||||
box.set_size_request(self._gtk.get_content_width(), self._gtk.get_content_height() -
|
||||
self._screen.keyboard_height - 20)
|
||||
box.set_hexpand(True)
|
||||
box.set_vexpand(False)
|
||||
self.labels['create_profile'].add(box)
|
||||
|
||||
l = self._gtk.Label(_("Profile Name:"))
|
||||
l.set_hexpand(False)
|
||||
entry = Gtk.Entry()
|
||||
entry.set_hexpand(True)
|
||||
|
||||
save = self._gtk.ButtonImage("sd",_("Save"),"color3")
|
||||
save.set_hexpand(False)
|
||||
save.connect("clicked", self.create_profile)
|
||||
|
||||
|
||||
self.labels['profile_name'] = entry
|
||||
box.pack_start(l, False, False, 5)
|
||||
box.pack_start(entry, True, True, 5)
|
||||
box.pack_start(save, False, False, 5)
|
||||
|
||||
self.show_create = True
|
||||
self.labels['profile_name'].set_text('')
|
||||
self.content.add(self.labels['create_profile'])
|
||||
self.content.show()
|
||||
self._screen.show_keyboard()
|
||||
self.labels['profile_name'].grab_focus_without_selecting()
|
||||
|
||||
def show_mesh(self, widget, profile):
|
||||
_ = self.lang.gettext
|
||||
|
||||
buttons = [
|
||||
{"name": _("Close"), "response": Gtk.ResponseType.CANCEL}
|
||||
]
|
||||
dialog = self._gtk.Dialog(self._screen, buttons, self.graphs[profile], self._close_dialog)
|
||||
|
||||
def _close_dialog(self, widget, response):
|
||||
widget.destroy()
|
||||
@@ -1,13 +1,20 @@
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from KlippyGcodes import KlippyGcodes
|
||||
from panels.screen_panel import ScreenPanel
|
||||
|
||||
class ExamplePanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
# Create gtk items here
|
||||
return
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.ExamplePanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return ExamplePanel(*args)
|
||||
|
||||
class ExamplePanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
# Create gtk items here
|
||||
|
||||
self.content.add(Gtk.Box())
|
||||
@@ -4,45 +4,55 @@ import logging
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from KlippyGcodes import KlippyGcodes
|
||||
from panels.screen_panel import ScreenPanel
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.ExtrudePanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return ExtrudePanel(*args)
|
||||
|
||||
class ExtrudePanel(ScreenPanel):
|
||||
distance = 1
|
||||
distances = ['1','5','10','25']
|
||||
speed = "Medium"
|
||||
speeds = ["Slow", "Medium", "Fast"]
|
||||
speed_trans = {
|
||||
"Slow": "300",
|
||||
"Medium": "800",
|
||||
"Fast": "1400"
|
||||
}
|
||||
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
self.speed = "Medium"
|
||||
self.speeds = ["Slow", "Medium", "Fast"]
|
||||
self.speed_trans = {
|
||||
"Slow": "300",
|
||||
"Medium": "800",
|
||||
"Fast": "1400"
|
||||
}
|
||||
|
||||
# This line for translations only
|
||||
speed_translations = [_("Slow"), _("Medium"), _("Fast")]
|
||||
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
i = 0
|
||||
self.current_extruder = self._printer.get_stat("toolhead","extruder")
|
||||
for extruder in self._printer.get_tools():
|
||||
self.labels[extruder] = self._gtk.ButtonImage("extruder-%s" % i,_("Tool") + " %s" %str(i),"color1")
|
||||
self.labels[extruder].connect("clicked", self.change_extruder, extruder)
|
||||
if extruder == self.current_extruder:
|
||||
self.labels[extruder].get_style_context().add_class("button_active")
|
||||
if i <= 3:
|
||||
grid.attach(self.labels[extruder], i, 0, 1, 1)
|
||||
i += 1
|
||||
|
||||
self.labels['tool0'] = KlippyGtk.ButtonImage("extruder-1","Tool 1","color1")
|
||||
self.labels['tool0'].get_style_context().add_class("button_active")
|
||||
self.labels['extrude'] = KlippyGtk.ButtonImage("extrude","Extrude","color3")
|
||||
self.labels['extrude'] = self._gtk.ButtonImage("extrude",_("Extrude"),"color3")
|
||||
self.labels['extrude'].connect("clicked", self.extrude, "+")
|
||||
self.labels['retract'] = KlippyGtk.ButtonImage("extrude","Retract","color2")
|
||||
self.labels['retract'] = self._gtk.ButtonImage("retract",_("Retract"),"color2")
|
||||
self.labels['retract'].connect("clicked", self.extrude, "-")
|
||||
self.labels['temperature'] = KlippyGtk.ButtonImage("heat-up","Temperature","color4")
|
||||
self.labels['temperature'] = self._gtk.ButtonImage("heat-up",_("Temperature"),"color4")
|
||||
self.labels['temperature'].connect("clicked", self.menu_item_clicked, "temperature", {
|
||||
"name": "Temperature",
|
||||
"panel": "temperature"
|
||||
})
|
||||
|
||||
|
||||
grid.attach(self.labels['tool0'], 0, 0, 1, 1)
|
||||
grid.attach(self.labels['extrude'], 0, 1, 1, 1)
|
||||
grid.attach(self.labels['retract'], 3, 1, 1, 1)
|
||||
grid.attach(self.labels['temperature'], 0, 2, 1, 1)
|
||||
@@ -51,12 +61,14 @@ class ExtrudePanel(ScreenPanel):
|
||||
distgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.distances:
|
||||
self.labels["dist"+str(i)] = KlippyGtk.ToggleButton(i)
|
||||
self.labels["dist"+str(i)] = self._gtk.ToggleButton(i)
|
||||
self.labels["dist"+str(i)].connect("clicked", self.change_distance, i)
|
||||
ctx = self.labels["dist"+str(i)].get_style_context()
|
||||
if j == 0:
|
||||
if ((self._screen.lang_ltr == True and j == 0) or
|
||||
(self._screen.lang_ltr == False and j == len(self.distances)-1)):
|
||||
ctx.add_class("distbutton_top")
|
||||
elif j == len(self.distances)-1:
|
||||
elif ((self._screen.lang_ltr == False and j == 0) or
|
||||
(self._screen.lang_ltr == True and j == len(self.distances)-1)):
|
||||
ctx.add_class("distbutton_bottom")
|
||||
else:
|
||||
ctx.add_class("distbutton")
|
||||
@@ -69,12 +81,14 @@ class ExtrudePanel(ScreenPanel):
|
||||
speedgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.speeds:
|
||||
self.labels["speed"+str(i)] = KlippyGtk.ToggleButton(i)
|
||||
self.labels["speed"+str(i)] = self._gtk.ToggleButton(_(i))
|
||||
self.labels["speed"+str(i)].connect("clicked", self.change_speed, i)
|
||||
ctx = self.labels["speed"+str(i)].get_style_context()
|
||||
if j == 0:
|
||||
if ((self._screen.lang_ltr == True and j == 0) or
|
||||
(self._screen.lang_ltr == False and j == len(self.speeds)-1)):
|
||||
ctx.add_class("distbutton_top")
|
||||
elif j == len(self.speeds)-1:
|
||||
elif ((self._screen.lang_ltr == False and j == 0) or
|
||||
(self._screen.lang_ltr == True and j == len(self.speeds)-1)):
|
||||
ctx.add_class("distbutton_bottom")
|
||||
else:
|
||||
ctx.add_class("distbutton")
|
||||
@@ -90,23 +104,26 @@ class ExtrudePanel(ScreenPanel):
|
||||
|
||||
grid.attach(box, 1, 2, 2, 1)
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage("back", "Back")
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b, 3, 2, 1, 1)
|
||||
|
||||
|
||||
|
||||
self.panel = grid
|
||||
self.content.add(grid)
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def process_update(self, data):
|
||||
def process_update(self, action, data):
|
||||
if action != "notify_status_update":
|
||||
return
|
||||
|
||||
for x in self._printer.get_tools():
|
||||
self.update_temp(x,
|
||||
self._printer.get_dev_stat(x,"temperature"),
|
||||
self._printer.get_dev_stat(x,"target")
|
||||
)
|
||||
|
||||
if ("toolhead" in data and "extruder" in data["toolhead"] and
|
||||
data["toolhead"]["extruder"] != self.current_extruder):
|
||||
for extruder in self._printer.get_tools():
|
||||
self.labels[extruder].get_style_context().remove_class("button_active")
|
||||
self.current_extruder = data["toolhead"]["extruder"]
|
||||
self.labels[self.current_extruder].get_style_context().add_class("button_active")
|
||||
|
||||
def change_distance(self, widget, distance):
|
||||
if self.distance == distance:
|
||||
return
|
||||
@@ -123,6 +140,12 @@ class ExtrudePanel(ScreenPanel):
|
||||
continue
|
||||
self.labels["dist"+str(i)].set_active(False)
|
||||
|
||||
def change_extruder(self, widget, extruder):
|
||||
if extruder == self.current_extruder:
|
||||
return
|
||||
|
||||
self._screen._ws.klippy.gcode_script("T%s" % self._printer.get_tool_number(extruder))
|
||||
|
||||
def change_speed(self, widget, speed):
|
||||
if self.speed == speed:
|
||||
return
|
||||
|
||||
@@ -4,18 +4,22 @@ import logging
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from KlippyGcodes import KlippyGcodes
|
||||
from panels.screen_panel import ScreenPanel
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.FanPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return FanPanel(*args)
|
||||
|
||||
class FanPanel(ScreenPanel):
|
||||
fan_speed = 0
|
||||
user_selecting = False
|
||||
|
||||
def initialize(self, panel_name):
|
||||
# Create gtk items here
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
||||
box.set_hexpand(True)
|
||||
@@ -28,17 +32,17 @@ class FanPanel(ScreenPanel):
|
||||
self.labels["scale"].get_style_context().add_class("fan_slider")
|
||||
box.add(self.labels["scale"])
|
||||
|
||||
self.labels["fanoff"] = KlippyGtk.ButtonImage("fan-off", "Fan Off")
|
||||
self.labels["fanoff"] = self._gtk.ButtonImage("fan-off", _("Fan Off"))
|
||||
self.labels["fanoff"].get_style_context().add_class("color1")
|
||||
self.labels["fanoff"].connect("clicked", self.set_fan_on, False)
|
||||
self.labels["fanon"] = KlippyGtk.ButtonImage("fan", "Fan On")
|
||||
self.labels["fanon"] = self._gtk.ButtonImage("fan", _("Fan On"))
|
||||
self.labels["fanon"].get_style_context().add_class("color3")
|
||||
self.labels["fanon"].connect("clicked", self.set_fan_on, True)
|
||||
|
||||
self.labels["apply"] = KlippyGtk.ButtonImage("resume", "Set Speed")
|
||||
self.labels["apply"] = self._gtk.ButtonImage("resume", _("Set Speed"))
|
||||
self.labels["apply"].get_style_context().add_class("color2")
|
||||
self.labels["apply"].connect("clicked", self.set_fan_speed)
|
||||
self.labels["cancel"] = KlippyGtk.ButtonImage("stop", "Cancel Change")
|
||||
self.labels["cancel"] = self._gtk.ButtonImage("stop", _("Cancel Change"))
|
||||
self.labels["cancel"].get_style_context().add_class("color4")
|
||||
self.labels["cancel"].connect("clicked", self.cancel_select_fan_speed)
|
||||
self.labels["cancel"].hide()
|
||||
@@ -46,34 +50,35 @@ class FanPanel(ScreenPanel):
|
||||
grid.attach(Gtk.Label(), 0, 0, 1, 1)
|
||||
grid.attach(box, 0, 1, 4, 1)
|
||||
grid.attach(self.labels["fanoff"], 0, 2, 1, 1)
|
||||
grid.attach(self.labels["fanon"], 1, 2, 1, 1)
|
||||
grid.attach(self.labels["fanon"], 3, 2, 1, 1)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b,3,2,1,1)
|
||||
|
||||
self.panel = grid
|
||||
self.grid = grid
|
||||
self.content.add(grid)
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def process_update(self, data):
|
||||
if "fan" in data and "speed" in data["fan"] and self.user_selecting == False:
|
||||
def process_update(self, action, data):
|
||||
if (action == "notify_status_update" and "fan" in data and "speed" in data["fan"] and
|
||||
self.user_selecting == False):
|
||||
self.fan_speed = float(int(float(data["fan"]["speed"]) * 100))
|
||||
self.labels["scale"].disconnect_by_func(self.select_fan_speed)
|
||||
self.labels["scale"].set_value(float(int(float(data["fan"]["speed"]) * 100)))
|
||||
self.labels["scale"].set_value(self.fan_speed)
|
||||
self.labels["scale"].connect("value-changed", self.select_fan_speed)
|
||||
|
||||
|
||||
def select_fan_speed(self, widget):
|
||||
if self.user_selecting == True:
|
||||
return
|
||||
|
||||
self.user_selecting = True
|
||||
self.panel.attach(self.labels["apply"], 3, 0, 1, 1)
|
||||
self.panel.attach(self.labels["cancel"], 0, 0, 1, 1)
|
||||
self.grid.attach(self.labels["apply"], 3, 0, 1, 1)
|
||||
self.grid.attach(self.labels["cancel"], 0, 0, 1, 1)
|
||||
self._screen.show_all()
|
||||
|
||||
def cancel_select_fan_speed(self, widget):
|
||||
self.labels["scale"].set_value(self.fan_speed)
|
||||
self.user_selecting = False
|
||||
self.panel.remove(self.labels["apply"])
|
||||
self.panel.remove(self.labels["cancel"])
|
||||
self.grid.remove(self.labels["apply"])
|
||||
self.grid.remove(self.labels["cancel"])
|
||||
|
||||
|
||||
def set_fan_speed(self, widget):
|
||||
@@ -82,7 +87,9 @@ class FanPanel(ScreenPanel):
|
||||
|
||||
def set_fan_on(self, widget, fanon):
|
||||
speed = 100 if fanon == True else 0
|
||||
self.labels["scale"].disconnect_by_func(self.select_fan_speed)
|
||||
self.labels["scale"].set_value(speed)
|
||||
self.labels["scale"].connect("value-changed", self.select_fan_speed)
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.set_fan_speed(speed))
|
||||
self.fan_speed = float(speed)
|
||||
self.labels["scale"].disconnect_by_func(self.select_fan_speed)
|
||||
self.labels["scale"].set_value(self.fan_speed)
|
||||
self.labels["scale"].connect("value-changed", self.select_fan_speed)
|
||||
self.cancel_select_fan_speed(widget)
|
||||
@@ -4,13 +4,15 @@ import logging
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from KlippyGcodes import KlippyGcodes
|
||||
from panels.screen_panel import ScreenPanel
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.FineTunePanel")
|
||||
|
||||
class FineTune(ScreenPanel):
|
||||
def create_panel(*args):
|
||||
return FineTunePanel(*args)
|
||||
|
||||
class FineTunePanel(ScreenPanel):
|
||||
user_selecting = False
|
||||
|
||||
bs = 0
|
||||
@@ -18,63 +20,56 @@ class FineTune(ScreenPanel):
|
||||
bs_deltas = ["0.01","0.05"]
|
||||
percent_delta = 1
|
||||
percent_deltas = ['1','5','10','25']
|
||||
fan = 100
|
||||
|
||||
extrusion = 0
|
||||
speed = 0
|
||||
|
||||
def initialize(self, panel_name):
|
||||
# Create gtk items here
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
grid.set_row_homogeneous(False)
|
||||
logger.debug("FineTunePanel")
|
||||
|
||||
|
||||
self.labels['z+'] = KlippyGtk.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['zoffset'] = Gtk.Label("Z Offset: 0.00mm")
|
||||
self.labels['zoffset'] = Gtk.Label("0.00" + _("mm"))
|
||||
self.labels['zoffset'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['z-'] = KlippyGtk.ButtonImage("move-z+", "Z-", "color1")
|
||||
self.labels['z-'] = self._gtk.ButtonImage("move-z+", _("Z-"), "color1")
|
||||
self.labels['z-'].connect("clicked", self.change_babystepping, "-")
|
||||
|
||||
grid.attach(self.labels['z+'], 0, 0, 1, 1)
|
||||
grid.attach(self.labels['zoffset'], 0, 1, 1, 1)
|
||||
grid.attach(self.labels['z-'], 0, 2, 1, 1)
|
||||
|
||||
self.labels['fan+'] = KlippyGtk.ButtonImage("fan-on", "Increase Fan", "color2")
|
||||
self.labels['fan+'].connect("clicked", self.change_fan, "+")
|
||||
self.labels['fanspeed'] = Gtk.Label("Fan: 100%")
|
||||
self.labels['fanspeed'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['fan-'] = KlippyGtk.ButtonImage("fan-off", "Decrease Fan", "color2")
|
||||
self.labels['fan-'].connect("clicked", self.change_fan, "-")
|
||||
grid.attach(self.labels['fan+'], 1, 0, 1, 1)
|
||||
grid.attach(self.labels['fanspeed'], 1, 1, 1, 1)
|
||||
grid.attach(self.labels['fan-'], 1, 2, 1, 1)
|
||||
|
||||
self.labels['speed+'] = KlippyGtk.ButtonImage("speed-step", "Increase Speed", "color3")
|
||||
self.labels['speed+'] = self._gtk.ButtonImage("speed-step", _("Speed +"), "color3")
|
||||
self.labels['speed+'].connect("clicked", self.change_speed, "+")
|
||||
self.labels['speedfactor'] = Gtk.Label("Speed: 100%")
|
||||
self.labels['speedfactor'] = Gtk.Label("100%")
|
||||
self.labels['speedfactor'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['speed-'] = KlippyGtk.ButtonImage("speed-step", "Decrease Speed", "color3")
|
||||
self.labels['speed-'] = self._gtk.ButtonImage("speed-step", _("Speed -"), "color3")
|
||||
self.labels['speed-'].connect("clicked", self.change_speed, "-")
|
||||
grid.attach(self.labels['speed+'], 2, 0, 1, 1)
|
||||
grid.attach(self.labels['speedfactor'], 2, 1, 1, 1)
|
||||
grid.attach(self.labels['speed-'], 2, 2, 1, 1)
|
||||
grid.attach(self.labels['speed+'], 1, 0, 1, 1)
|
||||
grid.attach(self.labels['speedfactor'], 1, 1, 1, 1)
|
||||
grid.attach(self.labels['speed-'], 1, 2, 1, 1)
|
||||
|
||||
self.labels['extrude+'] = KlippyGtk.ButtonImage("extrude", "Increase Extrusion", "color4")
|
||||
self.labels['extrude+'] = self._gtk.ButtonImage("extrude", _("Extrusion +"), "color4")
|
||||
self.labels['extrude+'].connect("clicked", self.change_extrusion, "+")
|
||||
self.labels['extrudefactor'] = Gtk.Label("Extrusion: 100%")
|
||||
self.labels['extrudefactor'] = Gtk.Label("100%")
|
||||
self.labels['extrudefactor'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['extrude-'] = KlippyGtk.ButtonImage("retract", "Decrease Extrusion", "color4")
|
||||
self.labels['extrude-'] = self._gtk.ButtonImage("retract", _("Extrusion -"), "color4")
|
||||
self.labels['extrude-'].connect("clicked", self.change_extrusion, "-")
|
||||
grid.attach(self.labels['extrude+'], 3, 0, 1, 1)
|
||||
grid.attach(self.labels['extrudefactor'], 3, 1, 1, 1)
|
||||
grid.attach(self.labels['extrude-'], 3, 2, 1, 1)
|
||||
grid.attach(self.labels['extrude+'], 2, 0, 1, 1)
|
||||
grid.attach(self.labels['extrudefactor'], 2, 1, 1, 1)
|
||||
grid.attach(self.labels['extrude-'], 2, 2, 1, 1)
|
||||
|
||||
|
||||
# babystepping grid
|
||||
bsgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.bs_deltas:
|
||||
self.labels[i] = KlippyGtk.ToggleButton(i)
|
||||
self.labels[i] = self._gtk.ToggleButton(i)
|
||||
self.labels[i].connect("clicked", self.change_bs_delta, i)
|
||||
ctx = self.labels[i].get_style_context()
|
||||
if j == 0:
|
||||
@@ -93,7 +88,7 @@ class FineTune(ScreenPanel):
|
||||
deltgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.percent_deltas:
|
||||
self.labels[i] = KlippyGtk.ToggleButton("%s%%" % i)
|
||||
self.labels[i] = self._gtk.ToggleButton("%s%%" % i)
|
||||
self.labels[i].connect("clicked", self.change_percent_delta, i)
|
||||
ctx = self.labels[i].get_style_context()
|
||||
if j == 0:
|
||||
@@ -111,30 +106,25 @@ class FineTune(ScreenPanel):
|
||||
|
||||
grid.attach(deltgrid, 1, 3, 2, 1)
|
||||
|
||||
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b,3,3,1,1)
|
||||
|
||||
self.panel = grid
|
||||
#self.panel = grid
|
||||
self.content.add(grid)
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def process_update(self, data):
|
||||
def process_update(self, action, data):
|
||||
_ = self.lang.gettext
|
||||
|
||||
if action != "notify_status_update":
|
||||
return
|
||||
|
||||
if "gcode_move" in data:
|
||||
if "homing_origin" in data["gcode_move"]:
|
||||
self.labels['zoffset'].set_text("Z Offset: %.2fmm" % data["gcode_move"]["homing_origin"][2])
|
||||
self.labels['zoffset'].set_text("%.2fmm" % data["gcode_move"]["homing_origin"][2])
|
||||
if "extrude_factor" in data["gcode_move"]:
|
||||
self.extrusion = int(data["gcode_move"]["extrude_factor"]*100)
|
||||
self.labels['extrudefactor'].set_text("Extrusion: %3d%%" % self.extrusion)
|
||||
self.labels['extrudefactor'].set_text("%3d%%" % self.extrusion)
|
||||
if "speed_factor" in data["gcode_move"]:
|
||||
self.speed = int(data["gcode_move"]["speed_factor"]*100)
|
||||
self.labels['speedfactor'].set_text("Speed: %3d%%" % self.speed)
|
||||
|
||||
if "fan" in data and "speed" in data['fan']:
|
||||
self.fan = int(round(data['fan']['speed'],2)*100)
|
||||
self.labels['fanspeed'].set_text("Fan: %3d%%" % self.fan)
|
||||
self.labels['speedfactor'].set_text("%3d%%" % self.speed)
|
||||
|
||||
def change_babystepping(self, widget, dir):
|
||||
if dir == "+":
|
||||
@@ -212,19 +202,3 @@ class FineTune(ScreenPanel):
|
||||
if i == self.percent_delta:
|
||||
continue
|
||||
self.labels[str(i)].set_active(False)
|
||||
|
||||
#def
|
||||
|
||||
def select_fan_speed(self, widget):
|
||||
if self.user_selecting == True:
|
||||
return
|
||||
|
||||
self.user_selecting = True
|
||||
self.panel.attach(self.labels["apply"], 3, 0, 1, 1)
|
||||
self.panel.attach(self.labels["cancel"], 0, 0, 1, 1)
|
||||
self._screen.show_all()
|
||||
|
||||
def cancel_select_fan_speed(self, widget):
|
||||
self.user_selecting = False
|
||||
self.panel.remove(self.labels["apply"])
|
||||
self.panel.remove(self.labels["cancel"])
|
||||
@@ -0,0 +1,111 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.Macro")
|
||||
|
||||
def create_panel(*args):
|
||||
return MacroPanel(*args)
|
||||
|
||||
class MacroPanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
self.macros = {}
|
||||
self.loaded_macros = []
|
||||
|
||||
# Create a scroll window for the macros
|
||||
scroll = Gtk.ScrolledWindow()
|
||||
scroll.set_property("overlay-scrolling", False)
|
||||
scroll.set_vexpand(True)
|
||||
|
||||
# Create a grid for all macros
|
||||
self.labels['macros'] = Gtk.Grid()
|
||||
scroll.add(self.labels['macros'])
|
||||
|
||||
# Create a box to contain all of the above
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||
box.set_vexpand(True)
|
||||
box.pack_start(scroll, True, True, 0)
|
||||
|
||||
self.content.add(box)
|
||||
|
||||
def activate(self):
|
||||
self.unload_gcode_macros()
|
||||
self.load_gcode_macros()
|
||||
|
||||
def add_gcode_macro(self, macro):
|
||||
|
||||
frame = Gtk.Frame()
|
||||
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
|
||||
frame.get_style_context().add_class("frame-item")
|
||||
|
||||
name = Gtk.Label()
|
||||
name.set_markup("<big><b>%s</b></big>" % (macro))
|
||||
name.set_hexpand(True)
|
||||
name.set_vexpand(True)
|
||||
name.set_halign(Gtk.Align.START)
|
||||
name.set_valign(Gtk.Align.CENTER)
|
||||
name.set_line_wrap(True)
|
||||
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
open = self._gtk.ButtonImage("open",None,"color3")
|
||||
open.connect("clicked", self.run_gcode_macro, macro)
|
||||
open.set_hexpand(False)
|
||||
open.set_halign(Gtk.Align.END)
|
||||
|
||||
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
labels.add(name)
|
||||
|
||||
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
dev.set_hexpand(True)
|
||||
dev.set_vexpand(False)
|
||||
|
||||
dev.add(labels)
|
||||
dev.add(open)
|
||||
frame.add(dev)
|
||||
|
||||
self.macros[macro] = {
|
||||
"row": frame
|
||||
}
|
||||
|
||||
macros = sorted(self.macros)
|
||||
pos = macros.index(macro)
|
||||
|
||||
self.loaded_macros.append(macro)
|
||||
self.labels['macros'].insert_row(pos)
|
||||
self.labels['macros'].attach(self.macros[macro]['row'], 0, pos, 1, 1)
|
||||
self.labels['macros'].show_all()
|
||||
|
||||
def load_gcode_macros(self):
|
||||
macros = self._screen.printer.get_gcode_macros()
|
||||
for x in macros:
|
||||
macro = x[12:].strip()
|
||||
|
||||
if macro in self.loaded_macros:
|
||||
continue
|
||||
|
||||
logger.debug("Evaluating '%s' value '%s'" % (macro.strip().lower(),
|
||||
self._config.get_config().getboolean("displayed_macros", macro.lower(), fallback=True)))
|
||||
|
||||
if ("displayed_macros" not in self._config.get_config().sections() or
|
||||
self._config.get_config().getboolean("displayed_macros", macro.lower(), fallback=True)):
|
||||
self.add_gcode_macro(macro)
|
||||
|
||||
def run_gcode_macro(self, widget, macro):
|
||||
self._screen._ws.klippy.gcode_script(macro)
|
||||
|
||||
def unload_gcode_macros(self):
|
||||
for macro in self.loaded_macros:
|
||||
logger.debug("Evaluating '%s' value '%s'" % (macro.strip().lower(),
|
||||
self._config.get_config().getboolean("displayed_macros", macro.lower(), fallback=True)))
|
||||
if ("displayed_macros" in self._config.get_config().sections() and
|
||||
not self._config.get_config().getboolean("displayed_macros", macro.lower(), fallback=True)):
|
||||
macros = sorted(self.macros)
|
||||
pos = macros.index(macro)
|
||||
self.labels['macros'].remove_row(pos)
|
||||
self.labels['macros'].show_all()
|
||||
@@ -1,201 +1,542 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from panels.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.JobStatusPanel")
|
||||
|
||||
class JobStatusPanel(ScreenPanel):
|
||||
is_paused = False
|
||||
filename = None
|
||||
|
||||
def initialize(self, panel_name):
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
self.labels['progress'] = KlippyGtk.ProgressBar("printing-progress-bar")
|
||||
#self.labels['progress'].set_vexpand(True)
|
||||
#self.labels['progress'].set_valign(Gtk.Align.CENTER)
|
||||
self.labels['progress'].set_show_text(False)
|
||||
#self.labels['progress'].set_margin_top(10)
|
||||
self.labels['progress'].set_margin_end(20)
|
||||
self.labels['progress_text'] = Gtk.Label()
|
||||
self.labels['progress_text'].get_style_context().add_class("printing-progress-text")
|
||||
overlay = Gtk.Overlay()
|
||||
overlay.add(self.labels['progress'])
|
||||
overlay.add_overlay(self.labels['progress_text'])
|
||||
|
||||
self.labels['file'] = KlippyGtk.ImageLabel("file","",20,"printing-status-label")
|
||||
self.labels['time_label'] = KlippyGtk.ImageLabel("speed-step","Time Elapsed",20,"printing-status-label")
|
||||
self.labels['time'] = KlippyGtk.Label("Time Elapsed","printing-status-label")
|
||||
self.labels['time_left_label'] = KlippyGtk.ImageLabel("speed-step","Time Left",20,"printing-status-label")
|
||||
self.labels['time_left'] = KlippyGtk.Label("Time Left","printing-status-label")
|
||||
timegrid = Gtk.Grid()
|
||||
timegrid.attach(self.labels['time_label']['b'], 0, 0, 1, 1)
|
||||
timegrid.attach(self.labels['time'], 0, 1, 1, 1)
|
||||
timegrid.attach(self.labels['time_left_label']['b'], 1, 0, 1, 1)
|
||||
timegrid.attach(self.labels['time_left'], 1, 1, 1, 1)
|
||||
info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
info.props.valign = Gtk.Align.CENTER
|
||||
info.set_hexpand(True)
|
||||
info.set_vexpand(True)
|
||||
#info.add(self.labels['file']['b'])
|
||||
#info.add(self.labels['time']['b'])
|
||||
#info.add(self.labels['time_left']['b'])
|
||||
|
||||
#grid.attach(info,2,0,2,1)
|
||||
|
||||
pbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
pbox.pack_start(self.labels['file']['b'], False, True, 0)
|
||||
pbox.pack_end(timegrid, False, False, 0)
|
||||
#pbox.pack_end(self.labels['progress'], False, False, 0)
|
||||
pbox.pack_end(overlay, False, False, 0)
|
||||
|
||||
grid.attach(pbox, 1, 0, 3, 2)
|
||||
|
||||
self.labels['extruder'] = KlippyGtk.ButtonImage("extruder-1", KlippyGtk.formatTemperatureString(0, 0))
|
||||
self.labels['extruder'].set_sensitive(False)
|
||||
grid.attach(self.labels['extruder'], 0, 0, 1, 1)
|
||||
|
||||
self.labels['heater_bed'] = KlippyGtk.ButtonImage("bed", KlippyGtk.formatTemperatureString(0, 0))
|
||||
self.labels['heater_bed'].set_sensitive(False)
|
||||
grid.attach(self.labels['heater_bed'], 0, 1, 1, 1)
|
||||
|
||||
self.labels['resume'] = KlippyGtk.ButtonImage("resume","Resume","color1")
|
||||
self.labels['resume'].connect("clicked",self.resume)
|
||||
self.labels['pause'] = KlippyGtk.ButtonImage("pause","Pause","color1" )
|
||||
self.labels['pause'].connect("clicked",self.pause)
|
||||
|
||||
if self._printer.get_stat('pause_resume','is_paused') == True:
|
||||
self.is_paused = True
|
||||
grid.attach(self.labels['resume'], 0, 2, 1, 1)
|
||||
else:
|
||||
grid.attach(self.labels['pause'], 0, 2, 1, 1)
|
||||
|
||||
self.labels['cancel'] = KlippyGtk.ButtonImage("stop","Cancel","color2")
|
||||
self.labels['cancel'].connect("clicked", self.cancel)
|
||||
grid.attach(self.labels['cancel'], 1, 2, 1, 1)
|
||||
self.labels['estop'] = KlippyGtk.ButtonImage("decrease","Emergency Stop","color4")
|
||||
self.labels['estop'].connect("clicked", self.emergency_stop)
|
||||
grid.attach(self.labels['estop'], 2, 2, 1, 1)
|
||||
self.labels['control'] = KlippyGtk.ButtonImage("control","Control","color3")
|
||||
self.labels['control'].connect("clicked", self._screen._go_to_submenu, "Control")
|
||||
grid.attach(self.labels['control'], 3, 2, 1, 1)
|
||||
|
||||
self.panel = grid
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def resume(self, widget):
|
||||
self.disable_button("pause","cancel")
|
||||
self._screen._ws.klippy.print_resume(self._response_callback, "enable_button", "pause", "cancel")
|
||||
self._screen.show_all()
|
||||
|
||||
def pause(self, widget):
|
||||
self.disable_button("resume","cancel")
|
||||
self._screen._ws.klippy.print_pause(self._response_callback, "enable_button", "resume", "cancel")
|
||||
self._screen.show_all()
|
||||
|
||||
def cancel(self, widget):
|
||||
dialog = KlippyGtk.ConfirmDialog(
|
||||
self._screen,
|
||||
"Are you sure you wish to cancel this print?",
|
||||
[
|
||||
{
|
||||
"name": "Cancel Print",
|
||||
"response": Gtk.ResponseType.OK
|
||||
},
|
||||
{
|
||||
"name": "Go Back",
|
||||
"response": Gtk.ResponseType.CANCEL
|
||||
}
|
||||
],
|
||||
self.cancel_confirm
|
||||
)
|
||||
self.disable_button("pause","cancel")
|
||||
|
||||
def cancel_confirm(self, widget, response_id):
|
||||
widget.destroy()
|
||||
|
||||
if response_id == Gtk.ResponseType.CANCEL:
|
||||
self.enable_button("pause","cancel")
|
||||
return
|
||||
|
||||
self._screen._ws.klippy.print_cancel(self._response_callback, "enable_button", "pause", "cancel")
|
||||
|
||||
def _response_callback(self, response, method, params, func, *args):
|
||||
if func == "enable_button":
|
||||
self.enable_button(*args)
|
||||
|
||||
def enable_button(self, *args):
|
||||
for arg in args:
|
||||
self.labels[arg].set_sensitive(True)
|
||||
|
||||
def disable_button(self, *args):
|
||||
for arg in args:
|
||||
self.labels[arg].set_sensitive(False)
|
||||
|
||||
|
||||
def process_update(self, data):
|
||||
self.update_temp("heater_bed",
|
||||
self._printer.get_dev_stat("heater_bed","temperature"),
|
||||
self._printer.get_dev_stat("heater_bed","target")
|
||||
)
|
||||
for x in self._printer.get_tools():
|
||||
self.update_temp(x,
|
||||
self._printer.get_dev_stat(x,"temperature"),
|
||||
self._printer.get_dev_stat(x,"target")
|
||||
)
|
||||
|
||||
vsd = self._printer.get_stat("print_stats")
|
||||
if "filename" in vsd and self.filename != vsd['filename']:
|
||||
if vsd['filename'] != "":
|
||||
self.filename = KlippyGtk.formatFileName(vsd['filename'])
|
||||
self.update_image_text("file", self.filename)
|
||||
else:
|
||||
file = "Unknown"
|
||||
self.update_image_text("file", "Unknown")
|
||||
|
||||
|
||||
progress = 0 if self._printer.get_stat('virtual_sdcard','progress') == 0 else (vsd['print_duration'] /
|
||||
self._printer.get_stat('virtual_sdcard','progress') - vsd['print_duration'])
|
||||
|
||||
self.update_text("time", str(KlippyGtk.formatTimeString(vsd['print_duration'])))
|
||||
self.update_text("time_left", str(KlippyGtk.formatTimeString(
|
||||
progress
|
||||
)))
|
||||
|
||||
self.update_progress(self._printer.get_stat('virtual_sdcard','progress'))
|
||||
|
||||
if "pause_resume" in data:
|
||||
if self.is_paused == True and data['pause_resume']['is_paused'] == False:
|
||||
self.is_paused = False
|
||||
self.panel.attach(self.labels['pause'], 0, 2, 1, 1)
|
||||
self.panel.remove(self.labels['resume'])
|
||||
self.panel.show_all()
|
||||
if self.is_paused == False and data['pause_resume']['is_paused'] == True:
|
||||
self.is_paused = True
|
||||
self.panel.attach(self.labels['resume'], 0, 2, 1, 1)
|
||||
self.panel.remove(self.labels['pause'])
|
||||
self.panel.show_all()
|
||||
|
||||
|
||||
|
||||
def update_image_text(self, label, text):
|
||||
if label in self.labels and 'l' in self.labels[label]:
|
||||
self.labels[label]['l'].set_text(text)
|
||||
|
||||
def update_text(self, label, text):
|
||||
if label in self.labels:
|
||||
self.labels[label].set_text(text)
|
||||
|
||||
def update_progress (self, progress):
|
||||
self.labels['progress'].set_fraction(progress)
|
||||
self.labels['progress_text'].set_text("%s%%" % (str(int(progress*100))))
|
||||
|
||||
def update_temp(self, dev, temp, target):
|
||||
if dev in self.labels:
|
||||
self.labels[dev].set_label(KlippyGtk.formatTemperatureString(temp, target))
|
||||
# -*- coding: utf-8 -*-
|
||||
import gi
|
||||
import logging
|
||||
import math
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.JobStatusPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return JobStatusPanel(*args)
|
||||
|
||||
class JobStatusPanel(ScreenPanel):
|
||||
is_paused = False
|
||||
filename = None
|
||||
file_metadata = {}
|
||||
progress = 0
|
||||
state = "printing"
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
self.layout = Gtk.Layout()
|
||||
self.layout.set_size(self._screen.width, self._screen.height)
|
||||
self.timeleft_type = "file"
|
||||
|
||||
self.create_buttons()
|
||||
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
grid.set_size_request(self._screen.width, self._screen.height)
|
||||
|
||||
fi_box = Gtk.VBox(spacing=0)
|
||||
fi_box.set_hexpand(True)
|
||||
fi_box.set_vexpand(False)
|
||||
fi_box.set_halign(Gtk.Align.START)
|
||||
|
||||
self.labels['file'] = Gtk.Label(label="file")
|
||||
self.labels['file'].set_halign(Gtk.Align.START)
|
||||
self.labels['file'].set_vexpand(False)
|
||||
self.labels['file'].get_style_context().add_class("printing-filename")
|
||||
self.labels['file'].set_line_wrap(True)
|
||||
self.labels['file'].set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
self.labels['status'] = Gtk.Label()
|
||||
self.labels['status'].set_halign(Gtk.Align.START)
|
||||
self.labels['status'].set_vexpand(False)
|
||||
self.labels['status'].get_style_context().add_class("printing-status")
|
||||
|
||||
fi_box.add(self.labels['file']) #, True, True, 0)
|
||||
fi_box.add(self.labels['status']) #, True, True, 0)
|
||||
fi_box.set_valign(Gtk.Align.CENTER)
|
||||
|
||||
info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
info.props.valign = Gtk.Align.CENTER
|
||||
info.set_hexpand(True)
|
||||
info.set_vexpand(True)
|
||||
#info.add(self.labels['file']['b'])
|
||||
#info.add(self.labels['time']['b'])
|
||||
#info.add(self.labels['time_left']['b'])
|
||||
|
||||
#grid.attach(info,2,0,2,1)
|
||||
|
||||
#pbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
#pbox.pack_start(self.labels['file']['b'], False, True, 0)
|
||||
#pbox.pack_end(timegrid, False, False, 0)
|
||||
#pbox.pack_end(self.labels['progress'], False, False, 0)
|
||||
#pbox.pack_end(overlay, False, False, 0)
|
||||
|
||||
#grid.attach(pbox, 0, 0, 4, 3)
|
||||
self.labels['darea'] = Gtk.DrawingArea()
|
||||
self.labels['darea'].connect("draw", self.on_draw)
|
||||
|
||||
box = Gtk.Box()
|
||||
box.set_hexpand(True)
|
||||
box.set_vexpand(True)
|
||||
box.set_halign(Gtk.Align.CENTER)
|
||||
self.labels['progress_text'] = Gtk.Label()
|
||||
self.labels['progress_text'].get_style_context().add_class("printing-progress-text")
|
||||
box.add(self.labels['progress_text'])
|
||||
|
||||
overlay = Gtk.Overlay()
|
||||
overlay.set_hexpand(True)
|
||||
overlay.set_vexpand(True)
|
||||
overlay.add(self.labels['darea'])
|
||||
overlay.add_overlay(box)
|
||||
|
||||
#self.labels['extruder'] = self._gtk.ButtonImage("extruder-1", self._gtk.formatTemperatureString(0, 0))
|
||||
#self.labels['extruder'].set_sensitive(False)
|
||||
#grid.attach(self.labels['extruder'], 0, 0, 1, 1)
|
||||
|
||||
#self.labels['heater_bed'] = self._gtk.ButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
|
||||
#self.labels['heater_bed'].set_sensitive(False)
|
||||
#grid.attach(self.labels['heater_bed'], 0, 1, 1, 1)
|
||||
|
||||
self.labels['thumbnail'] = self._gtk.Image("file.svg", False, 1.6, 1.6)
|
||||
|
||||
i = 0
|
||||
for extruder in self._printer.get_tools():
|
||||
self.labels[extruder + '_box'] = Gtk.Box(spacing=0)
|
||||
self.labels[extruder] = Gtk.Label(label="")
|
||||
self.labels[extruder].get_style_context().add_class("printing-info")
|
||||
if i <= 4:
|
||||
ext_img = self._gtk.Image("extruder-%s.svg" % i, None, .6, .6)
|
||||
self.labels[extruder + '_box'].add(ext_img)
|
||||
self.labels[extruder + '_box'].add(self.labels[extruder])
|
||||
i += 1
|
||||
|
||||
temp_grid = self._gtk.HomogeneousGrid()
|
||||
self.current_extruder = self._printer.get_stat("toolhead","extruder")
|
||||
temp_grid.attach(self.labels[self.current_extruder + '_box'], 0, 0, 1, 1)
|
||||
if self._printer.has_heated_bed():
|
||||
heater_bed = self._gtk.Image("bed.svg", None, .6, .6)
|
||||
self.labels['heater_bed'] = Gtk.Label(label="")
|
||||
self.labels['heater_bed'].get_style_context().add_class("printing-info")
|
||||
heater_bed_box = Gtk.Box(spacing=0)
|
||||
heater_bed_box.add(heater_bed)
|
||||
heater_bed_box.add(self.labels['heater_bed'])
|
||||
temp_grid.attach(heater_bed_box, 1, 0, 1, 1)
|
||||
self.labels['temp_grid'] = temp_grid
|
||||
|
||||
# Create time remaining items
|
||||
hourglass = self._gtk.Image("hourglass.svg", None, .6, .6)
|
||||
self.labels['left'] = Gtk.Label(label=_("Left:"))
|
||||
self.labels['left'].get_style_context().add_class("printing-info")
|
||||
self.labels['time_left'] = Gtk.Label(label="0s")
|
||||
self.labels['time_left'].get_style_context().add_class("printing-info")
|
||||
itl_box = Gtk.Box(spacing=0)
|
||||
itl_box.add(hourglass)
|
||||
itl_box.add(self.labels['left'])
|
||||
itl_box.add(self.labels['time_left'])
|
||||
self.labels['itl_box'] = itl_box
|
||||
|
||||
# Create overall items
|
||||
clock = self._gtk.Image("clock.svg", None, .6, .6)
|
||||
self.labels['elapsed'] = Gtk.Label(label=_("Elapsed:"))
|
||||
self.labels['elapsed'].get_style_context().add_class("printing-info")
|
||||
self.labels['duration'] = Gtk.Label(label="0s")
|
||||
self.labels['duration'].get_style_context().add_class("printing-info")
|
||||
self.labels['est_time'] = Gtk.Label(label="/ 0s")
|
||||
self.labels['est_time'].get_style_context().add_class("printing-info")
|
||||
it_box = Gtk.Box(spacing=0)
|
||||
it_box.add(clock)
|
||||
it_box.add(self.labels['elapsed'])
|
||||
it_box.add(self.labels['duration'])
|
||||
it_box.add(self.labels['est_time'])
|
||||
self.labels['it_box'] = it_box
|
||||
|
||||
position = self._gtk.Image("move.svg", None, .6, .6)
|
||||
self.labels['pos_x'] = Gtk.Label(label="X: 0")
|
||||
self.labels['pos_x'].get_style_context().add_class("printing-info")
|
||||
self.labels['pos_y'] = Gtk.Label(label="Y: 0")
|
||||
self.labels['pos_y'].get_style_context().add_class("printing-info")
|
||||
self.labels['pos_z'] = Gtk.Label(label="Z: 0")
|
||||
self.labels['pos_z'].get_style_context().add_class("printing-info")
|
||||
pos_box = Gtk.Box(spacing=0)
|
||||
posgrid = self._gtk.HomogeneousGrid()
|
||||
posgrid.set_hexpand(True)
|
||||
posgrid.attach(self.labels['pos_x'], 0, 0, 1, 1)
|
||||
posgrid.attach(self.labels['pos_y'], 1, 0, 1, 1)
|
||||
posgrid.attach(self.labels['pos_z'], 2, 0, 1, 1)
|
||||
pos_box.add(position)
|
||||
pos_box.add(posgrid)
|
||||
self.labels['pos_box'] = pos_box
|
||||
|
||||
speed = self._gtk.Image("speed-step.svg", None, .6, .6)
|
||||
self.labels['speed'] = Gtk.Label(label="")
|
||||
self.labels['speed'].get_style_context().add_class("printing-info")
|
||||
speed_box = Gtk.Box(spacing=0)
|
||||
speed_box.add(speed)
|
||||
speed_box.add(self.labels['speed'])
|
||||
extrusion = self._gtk.Image("extrude.svg", None, .6, .6)
|
||||
self.labels['extrusion'] = Gtk.Label(label="")
|
||||
self.labels['extrusion'].get_style_context().add_class("printing-info")
|
||||
extrusion_box = Gtk.Box(spacing=0)
|
||||
extrusion_box.add(extrusion)
|
||||
extrusion_box.add(self.labels['extrusion'])
|
||||
fan = self._gtk.Image("fan.svg", None, .6, .6)
|
||||
self.labels['fan'] = Gtk.Label(label="")
|
||||
self.labels['fan'].get_style_context().add_class("printing-info")
|
||||
fan_box = Gtk.Box(spacing=0)
|
||||
fan_box.add(fan)
|
||||
fan_box.add(self.labels['fan'])
|
||||
sfe_grid = self._gtk.HomogeneousGrid()
|
||||
sfe_grid.set_hexpand(True)
|
||||
sfe_grid.attach(speed_box, 0, 0, 1, 1)
|
||||
sfe_grid.attach(extrusion_box, 1, 0, 1, 1)
|
||||
sfe_grid.attach(fan_box, 2, 0, 1, 1)
|
||||
self.labels['sfe_grid'] = sfe_grid
|
||||
|
||||
self.labels['i1_box'] = Gtk.VBox(spacing=0)
|
||||
self.labels['i1_box'].get_style_context().add_class("printing-info-box")
|
||||
self.labels['i1_box'].set_valign(Gtk.Align.CENTER)
|
||||
self.labels['i2_box'] = Gtk.VBox(spacing=0)
|
||||
self.labels['i2_box'].get_style_context().add_class("printing-info-box")
|
||||
|
||||
grid.attach(overlay, 0, 0, 1, 1)
|
||||
grid.attach(fi_box, 1, 0, 3, 1)
|
||||
grid.attach(self.labels['i1_box'], 0, 1, 2, 2)
|
||||
grid.attach(self.labels['i2_box'], 2, 1, 2, 2)
|
||||
|
||||
self.add_labels()
|
||||
|
||||
self.grid = grid
|
||||
self.layout.put(grid, 0, 0)
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def on_draw(self, da, ctx):
|
||||
w = da.get_allocated_width()
|
||||
h = da.get_allocated_height()
|
||||
r = min(w,h)*.4
|
||||
|
||||
ctx.set_source_rgb(0.6, 0.6, 0.6)
|
||||
ctx.set_line_width(self._gtk.get_font_size() * .75)
|
||||
ctx.translate(w / 2, h / 2)
|
||||
ctx.arc(0, 0, r, 0, 2*math.pi)
|
||||
ctx.stroke()
|
||||
|
||||
ctx.set_source_rgb(1, 0, 0)
|
||||
ctx.arc(0, 0, r, 3/2*math.pi, 3/2*math.pi+(self.progress*2*math.pi))
|
||||
ctx.stroke()
|
||||
|
||||
|
||||
def activate(self):
|
||||
_ = self.lang.gettext
|
||||
self.progress = self._printer.get_stat('virtual_sdcard','progress')
|
||||
self.update_progress()
|
||||
self.enable_button("pause","cancel","resume")
|
||||
|
||||
state = "printing"
|
||||
self.update_text("status",_("Printing"))
|
||||
|
||||
self.filename = self._printer.get_stat('print_stats','filename')
|
||||
self.update_file_metadata()
|
||||
|
||||
self.grid.remove_row(3)
|
||||
self.grid.insert_row(3)
|
||||
|
||||
ps = self._printer.get_stat("print_stats")
|
||||
logger.debug("Act State: %s" % ps['state'])
|
||||
self.set_state(ps['state'])
|
||||
self.show_buttons_for_state()
|
||||
|
||||
def add_labels(self):
|
||||
for child in self.labels['i1_box'].get_children():
|
||||
self.labels['i1_box'].remove(child)
|
||||
for child in self.labels['i2_box'].get_children():
|
||||
self.labels['i2_box'].remove(child)
|
||||
|
||||
#if self.file_metadata == None:
|
||||
# self.labels['i1_box'].add(self.labels['temp_grid'])
|
||||
# self.labels['i1_box'].add(self.labels['pos_box'])
|
||||
# self.labels['i1_box'].add(self.labels['sfe_grid'])
|
||||
# self.labels['i2_box'].add(self.labels['it_box'])
|
||||
# self.labels['i2_box'].add(self.labels['itl_box'])
|
||||
#else:
|
||||
self.labels['i1_box'].add(self.labels['thumbnail'])
|
||||
self.labels['i2_box'].add(self.labels['temp_grid'])
|
||||
self.labels['i2_box'].add(self.labels['pos_box'])
|
||||
self.labels['i2_box'].add(self.labels['sfe_grid'])
|
||||
self.labels['i2_box'].add(self.labels['it_box'])
|
||||
self.labels['i2_box'].add(self.labels['itl_box'])
|
||||
|
||||
|
||||
def create_buttons(self):
|
||||
_ = self.lang.gettext
|
||||
self.labels['cancel'] = self._gtk.ButtonImage("stop",_("Cancel"),"color2")
|
||||
self.labels['cancel'].connect("clicked", self.cancel)
|
||||
self.labels['control'] = self._gtk.ButtonImage("control",_("Control"),"color3")
|
||||
self.labels['control'].connect("clicked", self._screen._go_to_submenu, "")
|
||||
self.labels['estop'] = self._gtk.ButtonImage("emergency",_("Emergency Stop"),"color4")
|
||||
self.labels['estop'].connect("clicked", self.emergency_stop)
|
||||
self.labels['menu'] = self._gtk.ButtonImage("complete",_("Main Menu"),"color4")
|
||||
self.labels['menu'].connect("clicked", self.close_panel)
|
||||
self.labels['pause'] = self._gtk.ButtonImage("pause",_("Pause"),"color1" )
|
||||
self.labels['pause'].connect("clicked",self.pause)
|
||||
self.labels['restart'] = self._gtk.ButtonImage("restart",_("Restart"),"color3")
|
||||
self.labels['restart'].connect("clicked", self.restart)
|
||||
self.labels['resume'] = self._gtk.ButtonImage("resume",_("Resume"),"color1")
|
||||
self.labels['resume'].connect("clicked",self.resume)
|
||||
|
||||
def restart(self, widget):
|
||||
if self.filename != "none":
|
||||
self._screen._ws.klippy.print_start(self.filename)
|
||||
|
||||
def resume(self, widget):
|
||||
#self.disable_button("resume","cancel")
|
||||
self._screen._ws.klippy.print_resume(self._response_callback, "enable_button", "pause", "cancel")
|
||||
self._screen.show_all()
|
||||
|
||||
def pause(self, widget):
|
||||
#self.disable_button("pause","cancel")
|
||||
self._screen._ws.klippy.print_pause(self._response_callback, "enable_button", "resume", "cancel")
|
||||
self._screen.show_all()
|
||||
|
||||
def cancel(self, widget):
|
||||
_ = self.lang.gettext
|
||||
|
||||
buttons = [
|
||||
{"name": _("Cancel Print"), "response": Gtk.ResponseType.OK},
|
||||
{"name": _("Go Back"), "response": Gtk.ResponseType.CANCEL}
|
||||
]
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_markup(_("Are you sure you wish to cancel this print?"))
|
||||
label.set_hexpand(True)
|
||||
label.set_halign(Gtk.Align.CENTER)
|
||||
label.set_line_wrap(True)
|
||||
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
dialog = self._gtk.Dialog(self._screen, buttons, label, self.cancel_confirm)
|
||||
self.disable_button("pause","cancel")
|
||||
|
||||
def cancel_confirm(self, widget, response_id):
|
||||
widget.destroy()
|
||||
|
||||
if response_id == Gtk.ResponseType.CANCEL:
|
||||
self.enable_button("pause","cancel")
|
||||
return
|
||||
|
||||
logger.debug("Canceling print")
|
||||
self.disable_button("pause","resume","cancel")
|
||||
self._screen._ws.klippy.print_cancel(self._response_callback)
|
||||
|
||||
def _response_callback(self, response, method, params, func=None, *args):
|
||||
if func == "enable_button":
|
||||
self.enable_button(*args)
|
||||
|
||||
def close_panel(self, widget=None):
|
||||
if self._screen.is_printing():
|
||||
self._screen.printer_ready()
|
||||
return False
|
||||
|
||||
def enable_button(self, *args):
|
||||
for arg in args:
|
||||
self.labels[arg].set_sensitive(True)
|
||||
|
||||
def disable_button(self, *args):
|
||||
for arg in args:
|
||||
self.labels[arg].set_sensitive(False)
|
||||
|
||||
def _callback_metadata(self, newfiles, deletedfiles, modifiedfiles):
|
||||
if self.file_metadata == None and self.filename in modifiedfiles:
|
||||
self.update_file_metadata()
|
||||
self._files.remove_file_callback(self._callback_metadata)
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action != "notify_status_update":
|
||||
return
|
||||
_ = self.lang.gettext
|
||||
|
||||
if self._printer.has_heated_bed():
|
||||
self.update_temp("heater_bed",
|
||||
self._printer.get_dev_stat("heater_bed","temperature"),
|
||||
self._printer.get_dev_stat("heater_bed","target")
|
||||
)
|
||||
for x in self._printer.get_tools():
|
||||
self.update_temp(x,
|
||||
self._printer.get_dev_stat(x,"temperature"),
|
||||
self._printer.get_dev_stat(x,"target")
|
||||
)
|
||||
|
||||
|
||||
if "toolhead" in data:
|
||||
if "extruder" in data["toolhead"]:
|
||||
if data["toolhead"]["extruder"] != self.current_extruder:
|
||||
self.labels['temp_grid'].remove_column(0)
|
||||
self.labels['temp_grid'].insert_column(0)
|
||||
self.current_extruder = data["toolhead"]["extruder"]
|
||||
self.labels['temp_grid'].attach(self.labels[self.current_extruder + '_box'], 0, 0, 1, 1)
|
||||
self._screen.show_all()
|
||||
if "position" in data["toolhead"]:
|
||||
self.labels['pos_x'].set_text("X: %.2f" % (data["toolhead"]["position"][0]))
|
||||
self.labels['pos_y'].set_text("Y: %.2f" % (data["toolhead"]["position"][1]))
|
||||
if "gcode_move" in data and "gcode_position" in data["gcode_move"]:
|
||||
self.labels['pos_z'].set_text("Z: %.2f" % (data["gcode_move"]["gcode_position"][2]))
|
||||
|
||||
if "gcode_move" in data:
|
||||
#if "homing_origin" in data["gcode_move"]:
|
||||
# self.labels['zoffset'].set_text("%.2fmm" % data["gcode_move"]["homing_origin"][2])
|
||||
if "extrude_factor" in data["gcode_move"]:
|
||||
self.extrusion = int(data["gcode_move"]["extrude_factor"]*100)
|
||||
self.labels['extrusion'].set_text("%3d%%" % self.extrusion)
|
||||
if "speed_factor" in data["gcode_move"]:
|
||||
self.speed = int(data["gcode_move"]["speed_factor"]*100)
|
||||
self.labels['speed'].set_text("%3d%%" % self.speed)
|
||||
if "fan" in data and "speed" in data['fan']:
|
||||
self.fan = int(round(data['fan']['speed'],2)*100)
|
||||
self.labels['fan'].set_text("%3d%%" % self.fan)
|
||||
|
||||
if "print_stats" in data or "virtual_sdcard" in data:
|
||||
ps = self._printer.get_stat("print_stats")
|
||||
vsd = self._printer.get_stat("virtual_sdcard")
|
||||
if ps['state'] == "printing" and self.state != "printing":
|
||||
self.set_state("printing")
|
||||
self.show_buttons_for_state()
|
||||
if ps['state'] == "complete" and self.state != "complete":
|
||||
self.progress = 1
|
||||
self.update_progress()
|
||||
self.set_state("complete")
|
||||
self.show_buttons_for_state()
|
||||
timeout = self._config.get_main_config().getint("job_complete_timeout", 30)
|
||||
if timeout != 0:
|
||||
GLib.timeout_add(timeout * 1000, self.close_panel)
|
||||
elif ps['state'] == "error" and self.state != "error":
|
||||
logger.debug("Error!")
|
||||
self.set_state("error")
|
||||
self.labels['status'].set_text("Error - %s" % ps['message'])
|
||||
self.show_buttons_for_state()
|
||||
timeout = self._config.get_main_config().getint("job_error_timeout", 0)
|
||||
if timeout != 0:
|
||||
GLib.timeout_add(timeout * 1000, self.close_panel)
|
||||
elif ps['state'] == "standby":
|
||||
self.close_panel()
|
||||
|
||||
if self.filename != ps['filename']:
|
||||
if ps['filename'] != "":
|
||||
self.filename = ps['filename']
|
||||
self.file_metadata = {}
|
||||
self.update_text("file", self.filename.split("/")[-1])
|
||||
else:
|
||||
file = "Unknown"
|
||||
self.update_text("file", "Unknown file")
|
||||
|
||||
if self.file_metadata != None:
|
||||
if "gcode_start_byte" in self.file_metadata:
|
||||
progress = (max(vsd['file_position'] - self.file_metadata['gcode_start_byte'],0) /
|
||||
(self.file_metadata['gcode_end_byte'] - self.file_metadata['gcode_start_byte']))
|
||||
else:
|
||||
progress = 0 if self._printer.get_stat('virtual_sdcard','progress') == 0 else (ps['print_duration']/
|
||||
self._printer.get_stat('virtual_sdcard','progress') - ps['print_duration'])
|
||||
progress = round(progress,2)
|
||||
|
||||
if progress != self.progress:
|
||||
self.progress = progress
|
||||
self.labels['darea'].queue_draw()
|
||||
|
||||
self.update_text("duration", str(self._gtk.formatTimeString(ps['print_duration'])))
|
||||
|
||||
timeleft_type = self._config.get_config()['main'].get('print_estimate_method','file')
|
||||
|
||||
if timeleft_type != self.timeleft_type:
|
||||
if self.timeleft_type == "duration":
|
||||
self.labels['it_box'].add(self.labels['est_time'])
|
||||
elif timeleft_type == "duration":
|
||||
self.labels['it_box'].remove(self.labels['est_time'])
|
||||
self.timeleft_type = timeleft_type
|
||||
|
||||
if timeleft_type in ['filament','file','slicer']:
|
||||
duration = ps['print_duration']
|
||||
if timeleft_type == "filament":
|
||||
estimated_filament = (self.file_metadata['filament_total'] if "filament_total" in self.file_metadata
|
||||
else 1)
|
||||
total_duration = duration / (max(ps['filament_used'],0.0001) / max(estimated_filament, 0.0001))
|
||||
elif timeleft_type == "file":
|
||||
total_duration = duration / max(self.progress, 0.0001)
|
||||
elif timeleft_type == "slicer":
|
||||
total_duration = (self.file_metadata['estimated_time'] if "estimated_time" in self.file_metadata
|
||||
else duration)
|
||||
|
||||
time_left = max(total_duration - duration, 0)
|
||||
self.update_text("time_left", str(self._gtk.formatTimeString(time_left)))
|
||||
|
||||
self.update_progress()
|
||||
|
||||
if "pause_resume" in data and self.state != "complete":
|
||||
if self.state == "paused" and data['pause_resume']['is_paused'] == False:
|
||||
self.set_state("printing")
|
||||
self.update_text("status",_("Paused"))
|
||||
self.grid.attach(self.labels['pause'], 0, 3, 1, 1)
|
||||
self.grid.remove(self.labels['resume'])
|
||||
self.grid.show_all()
|
||||
if self.state != "paused" and data['pause_resume']['is_paused'] == True:
|
||||
self.set_state("paused")
|
||||
self.grid.attach(self.labels['resume'], 0, 3, 1, 1)
|
||||
self.grid.remove(self.labels['pause'])
|
||||
self.grid.show_all()
|
||||
|
||||
def set_state(self, state):
|
||||
self.state = state
|
||||
self.update_text("status",state.capitalize())
|
||||
|
||||
def show_buttons_for_state(self):
|
||||
self.grid.remove_row(3)
|
||||
self.grid.insert_row(3)
|
||||
if self.state == "printing":
|
||||
self.grid.attach(self.labels['pause'], 0, 3, 1, 1)
|
||||
self.grid.attach(self.labels['cancel'], 1, 3, 1, 1)
|
||||
self.grid.attach(self.labels['estop'], 2, 3, 1, 1)
|
||||
self.grid.attach(self.labels['control'], 3, 3, 1, 1)
|
||||
elif self.state == "paused":
|
||||
self.grid.attach(self.labels['resume'], 0, 3, 1, 1)
|
||||
self.grid.attach(self.labels['cancel'], 1, 3, 1, 1)
|
||||
self.grid.attach(self.labels['estop'], 2, 3, 1, 1)
|
||||
self.grid.attach(self.labels['control'], 3, 3, 1, 1)
|
||||
elif self.state == "error" or self.state == "complete":
|
||||
self.grid.attach(self.labels['restart'], 2, 3, 1, 1)
|
||||
self.grid.attach(self.labels['menu'], 3, 3, 1, 1)
|
||||
self.show_all()
|
||||
|
||||
def show_file_thumbnail(self):
|
||||
if self._files.has_thumbnail(self.filename):
|
||||
pixbuf = self.get_file_image(self.filename, 7, 3.25)
|
||||
if pixbuf != None:
|
||||
self.labels['thumbnail'].set_from_pixbuf(pixbuf)
|
||||
|
||||
def update_file_metadata(self):
|
||||
if self._files.file_metadata_exists(self.filename):
|
||||
self.file_metadata = self._files.get_file_info(self.filename)
|
||||
logger.debug("Parsing file metadata: %s" % list(self.file_metadata))
|
||||
self.update_text("est_time","/ %s" % str(self._gtk.formatTimeString(self.file_metadata['estimated_time'])))
|
||||
if "thumbnails" in self.file_metadata:
|
||||
tmp = self.file_metadata['thumbnails'].copy()
|
||||
for i in tmp:
|
||||
i['data'] = ""
|
||||
logger.debug("Thumbnails: %s" % list(tmp))
|
||||
self.show_file_thumbnail()
|
||||
else:
|
||||
self.file_metadata = None
|
||||
logger.debug("Cannot find file metadata. Listening for updated metadata")
|
||||
self._screen.files.add_file_callback(self._callback_metadata)
|
||||
|
||||
def update_image_text(self, label, text):
|
||||
if label in self.labels and 'l' in self.labels[label]:
|
||||
self.labels[label]['l'].set_text(text)
|
||||
|
||||
def update_text(self, label, text):
|
||||
if label in self.labels:
|
||||
self.labels[label].set_text(text)
|
||||
|
||||
def update_progress (self):
|
||||
self.labels['progress_text'].set_text("%s%%" % (str( min(int(self.progress*100),100) )))
|
||||
|
||||
#def update_temp(self, dev, temp, target):
|
||||
# if dev in self.labels:
|
||||
# self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
|
||||
|
||||
def update_temp(self, x, temp, target):
|
||||
self.labels[x].set_markup(
|
||||
"%.1f<big>/</big>%.0f °C" % (temp, target)
|
||||
)
|
||||
@@ -1,63 +1,86 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from panels.menu import MenuPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.MainMenu")
|
||||
|
||||
class MainPanel(MenuPanel):
|
||||
|
||||
def initialize(self, panel_name, items, extrudercount):
|
||||
print("### Making MainMenu")
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
# Create Extruders and bed icons
|
||||
eq_grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
|
||||
i = 0
|
||||
for x in self._printer.get_tools():
|
||||
if i > 3:
|
||||
break
|
||||
self.labels[x] = KlippyGtk.ButtonImage("extruder-"+str(i+1), KlippyGtk.formatTemperatureString(0, 0))
|
||||
eq_grid.attach(self.labels[x], i%2, i/2, 1, 1)
|
||||
i += 1
|
||||
|
||||
self.labels['heater_bed'] = KlippyGtk.ButtonImage("bed", KlippyGtk.formatTemperatureString(0, 0))
|
||||
|
||||
width = 2 if i > 1 else 1
|
||||
eq_grid.attach(self.labels['heater_bed'], 0, i/2+1, width, 1)
|
||||
|
||||
grid.attach(eq_grid, 0, 0, 1, 1)
|
||||
grid.attach(self.arrangeMenuItems(items, 2, True), 1, 0, 1, 1)
|
||||
self.grid = grid
|
||||
|
||||
self.target_temps = {
|
||||
"heater_bed": 0,
|
||||
"extruder": 0
|
||||
}
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def get(self):
|
||||
return self.grid
|
||||
|
||||
def update_temp(self, dev, temp, target):
|
||||
if dev in self.labels:
|
||||
self.labels[dev].set_label(KlippyGtk.formatTemperatureString(temp, target))
|
||||
|
||||
def process_update(self, data):
|
||||
self.update_temp("heater_bed",
|
||||
self._printer.get_dev_stat("heater_bed","temperature"),
|
||||
self._printer.get_dev_stat("heater_bed","target")
|
||||
)
|
||||
for x in self._printer.get_tools():
|
||||
self.update_temp(x,
|
||||
self._printer.get_dev_stat(x,"temperature"),
|
||||
self._printer.get_dev_stat(x,"target")
|
||||
)
|
||||
return
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from panels.menu import MenuPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.MainMenu")
|
||||
|
||||
def create_panel(*args):
|
||||
return MainPanel(*args)
|
||||
|
||||
class MainPanel(MenuPanel):
|
||||
def __init__(self, screen, title, back=False):
|
||||
super().__init__(screen, title, False)
|
||||
|
||||
def initialize(self, panel_name, items, extrudercount):
|
||||
print("### Making MainMenu")
|
||||
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
grid.set_hexpand(True)
|
||||
grid.set_vexpand(True)
|
||||
|
||||
# Create Extruders and bed icons
|
||||
eq_grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
i = 0
|
||||
for x in self._printer.get_tools():
|
||||
if i > 3:
|
||||
break
|
||||
self.labels[x] = self._gtk.ButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0))
|
||||
col = 0 if len(self._printer.get_tools()) == 1 else i%2
|
||||
row = i/2
|
||||
eq_grid.attach(self.labels[x], col, row, 1, 1)
|
||||
i += 1
|
||||
|
||||
if self._printer.has_heated_bed():
|
||||
self.labels['heater_bed'] = self._gtk.ButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
|
||||
|
||||
width = 2 if i > 1 else 1
|
||||
eq_grid.attach(self.labels['heater_bed'], 0, i/2+1, width, 1)
|
||||
|
||||
self.items = items
|
||||
self.create_menu_items()
|
||||
|
||||
self.grid = Gtk.Grid()
|
||||
self.grid.set_row_homogeneous(True)
|
||||
self.grid.set_column_homogeneous(True)
|
||||
|
||||
grid.attach(eq_grid, 0, 0, 1, 1)
|
||||
grid.attach(self.arrangeMenuItems(items, 2, True), 1, 0, 1, 1)
|
||||
|
||||
self.grid = grid
|
||||
|
||||
self.target_temps = {
|
||||
"heater_bed": 0,
|
||||
"extruder": 0
|
||||
}
|
||||
|
||||
self.content.add(self.grid)
|
||||
self.layout.show_all()
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def activate(self):
|
||||
return
|
||||
|
||||
def update_temp(self, dev, temp, target):
|
||||
if dev in self.labels:
|
||||
self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action != "notify_status_update":
|
||||
return
|
||||
|
||||
self.update_temp("heater_bed",
|
||||
self._printer.get_dev_stat("heater_bed","temperature"),
|
||||
self._printer.get_dev_stat("heater_bed","target")
|
||||
)
|
||||
for x in self._printer.get_tools():
|
||||
self.update_temp(x,
|
||||
self._printer.get_dev_stat(x,"temperature"),
|
||||
self._printer.get_dev_stat(x,"target")
|
||||
)
|
||||
return
|
||||
@@ -1,53 +1,101 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from panels.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.MenuPanel")
|
||||
|
||||
class MenuPanel(ScreenPanel):
|
||||
def initialize(self, panel_name, items):
|
||||
print("### Making a new menu")
|
||||
|
||||
grid = self.arrangeMenuItems(items, 4)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b, 3, 1, 1, 1)
|
||||
|
||||
self.panel = grid
|
||||
|
||||
def arrangeMenuItems (self, items, columns, expandLast=False):
|
||||
grid = Gtk.Grid()
|
||||
grid.set_row_homogeneous(True)
|
||||
grid.set_column_homogeneous(True)
|
||||
|
||||
l = len(items)
|
||||
i = 0
|
||||
for i in range(l):
|
||||
col = i % columns
|
||||
row = int(i/columns)
|
||||
width = 1
|
||||
if expandLast == True and i+1 == l and l%2 == 1:
|
||||
width = 2
|
||||
b = KlippyGtk.ButtonImage(
|
||||
items[i]['icon'], items[i]['name'], "color"+str((i%4)+1)
|
||||
)
|
||||
|
||||
if "panel" in items[i]:
|
||||
b.connect("clicked", self.menu_item_clicked, items[i]['panel'], items[i])
|
||||
elif "items" in items[i]:
|
||||
b.connect("clicked", self._screen._go_to_submenu, items[i]['name'])
|
||||
elif "method" in items[i]:
|
||||
params = items[i]['params'] if "params" in items[i] else {}
|
||||
b.connect("clicked", self._screen._send_action, items[i]['method'], params)
|
||||
|
||||
grid.attach(b, col, row, width, 1)
|
||||
|
||||
i += 1
|
||||
|
||||
return grid
|
||||
import gettext
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
from jinja2 import Environment, Template
|
||||
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.MenuPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return MenuPanel(*args)
|
||||
|
||||
class MenuPanel(ScreenPanel):
|
||||
i = 0
|
||||
def initialize(self, panel_name, display_name, items):
|
||||
_ = self.lang.gettext
|
||||
|
||||
self.items = items
|
||||
self.create_menu_items()
|
||||
|
||||
self.grid = Gtk.Grid()
|
||||
self.grid.set_row_homogeneous(True)
|
||||
self.grid.set_column_homogeneous(True)
|
||||
self.content.add(self.grid)
|
||||
|
||||
def activate(self):
|
||||
self.j2_data = self._printer.get_printer_status_data()
|
||||
self.j2_data.update({
|
||||
'moonraker_connected': self._screen._ws.is_connected()
|
||||
})
|
||||
self.arrangeMenuItems(self.items, 4)
|
||||
|
||||
def arrangeMenuItems (self, items, columns, expandLast=False):
|
||||
for child in self.grid.get_children():
|
||||
self.grid.remove(child)
|
||||
|
||||
l = len(items)
|
||||
i = 0
|
||||
for item in items:
|
||||
key = list(item)[0]
|
||||
logger.debug("Evaluating item: %s" % key)
|
||||
if not self.evaluate_enable(item[key]['enable']):
|
||||
continue
|
||||
|
||||
col = i % columns
|
||||
row = int(i/columns)
|
||||
width = 1
|
||||
|
||||
if expandLast == True and i+1 == l and l%2 == 1:
|
||||
width = 2
|
||||
|
||||
self.grid.attach(self.labels[key], col, row, width, 1)
|
||||
i += 1
|
||||
|
||||
return self.grid
|
||||
|
||||
def create_menu_items(self):
|
||||
for i in range(len(self.items)):
|
||||
key = list(self.items[i])[0]
|
||||
item = self.items[i][key]
|
||||
|
||||
env = Environment(extensions=["jinja2.ext.i18n"])
|
||||
env.install_gettext_translations(self.lang)
|
||||
j2_temp = env.from_string(item['name'])
|
||||
parsed_name = j2_temp.render()
|
||||
|
||||
b = self._gtk.ButtonImage(
|
||||
item['icon'], parsed_name, "color"+str((i%4)+1)
|
||||
)
|
||||
if item['panel'] != False:
|
||||
b.connect("clicked", self.menu_item_clicked, item['panel'], item)
|
||||
elif item['method'] != False:
|
||||
params = item['params'] if item['params'] != False else {}
|
||||
if item['confirm'] != False:
|
||||
b.connect("clicked", self._screen._confirm_send_action, item['confirm'], item['method'], params)
|
||||
else:
|
||||
b.connect("clicked", self._screen._send_action, item['method'], params)
|
||||
else:
|
||||
b.connect("clicked", self._screen._go_to_submenu, key)
|
||||
self.labels[key] = b
|
||||
|
||||
def evaluate_enable(self, enable):
|
||||
if enable == True:
|
||||
return True
|
||||
if enable == False:
|
||||
return False
|
||||
|
||||
try:
|
||||
logger.debug("Template: '%s'" % enable)
|
||||
logger.debug("Data: %s" % self.j2_data)
|
||||
j2_temp = Template(enable)
|
||||
result = j2_temp.render(self.j2_data)
|
||||
if result == 'True':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
logger.debug("Error evaluating enable statement: %s", enable)
|
||||
return False
|
||||
@@ -1,131 +1,135 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from KlippyGcodes import KlippyGcodes
|
||||
from panels.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.MovePanel")
|
||||
|
||||
class MovePanel(ScreenPanel):
|
||||
distance = 1
|
||||
distances = ['.1','.5','1','5','10','25']
|
||||
|
||||
|
||||
def initialize(self, panel_name):
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
self.labels['x+'] = KlippyGtk.ButtonImage("move-x+", "X+", "color1")
|
||||
self.labels['x+'].connect("clicked", self.move, "X", "+")
|
||||
self.labels['x-'] = KlippyGtk.ButtonImage("move-x-", "X-", "color1")
|
||||
self.labels['x-'].connect("clicked", self.move, "X", "-")
|
||||
|
||||
self.labels['y+'] = KlippyGtk.ButtonImage("move-y+", "Y+", "color2")
|
||||
self.labels['y+'].connect("clicked", self.move, "Y", "+")
|
||||
self.labels['y-'] = KlippyGtk.ButtonImage("move-y-", "Y-", "color2")
|
||||
self.labels['y-'].connect("clicked", self.move, "Y", "-")
|
||||
|
||||
self.labels['z+'] = KlippyGtk.ButtonImage("move-z-", "Z+", "color3")
|
||||
self.labels['z+'].connect("clicked", self.move, "Z", "+")
|
||||
self.labels['z-'] = KlippyGtk.ButtonImage("move-z+", "Z-", "color3")
|
||||
self.labels['z-'].connect("clicked", self.move, "Z", "-")
|
||||
|
||||
self.labels['home'] = KlippyGtk.ButtonImage("home", "Home All")
|
||||
self.labels['home'].connect("clicked", self.home)
|
||||
|
||||
|
||||
grid.attach(self.labels['x+'], 2, 1, 1, 1)
|
||||
grid.attach(self.labels['x-'], 0, 1, 1, 1)
|
||||
grid.attach(self.labels['y+'], 1, 0, 1, 1)
|
||||
grid.attach(self.labels['y-'], 1, 1, 1, 1)
|
||||
grid.attach(self.labels['z+'], 3, 0, 1, 1)
|
||||
grid.attach(self.labels['z-'], 3, 1, 1, 1)
|
||||
|
||||
grid.attach(self.labels['home'], 0, 0, 1, 1)
|
||||
|
||||
distgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.distances:
|
||||
self.labels[i] = KlippyGtk.ToggleButton(i)
|
||||
self.labels[i].connect("clicked", self.change_distance, i)
|
||||
ctx = self.labels[i].get_style_context()
|
||||
if j == 0:
|
||||
ctx.add_class("distbutton_top")
|
||||
elif j == len(self.distances)-1:
|
||||
ctx.add_class("distbutton_bottom")
|
||||
else:
|
||||
ctx.add_class("distbutton")
|
||||
if i == "1":
|
||||
ctx.add_class("distbutton_active")
|
||||
distgrid.attach(self.labels[i], j, 0, 1, 1)
|
||||
j += 1
|
||||
|
||||
self.labels["1"].set_active(True)
|
||||
|
||||
#space_grid = KlippyGtk.HomogeneousGrid()
|
||||
#space_grid.attach(Gtk.Label("Distance (mm):"),0,0,1,1)
|
||||
#space_grid.attach(distgrid,0,1,1,1)
|
||||
#space_grid.attach(Gtk.Label(" "),0,2,1,1)
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
|
||||
bottomgrid = KlippyGtk.HomogeneousGrid()
|
||||
self.labels['pos_x'] = Gtk.Label("X: 0")
|
||||
self.labels['pos_y'] = Gtk.Label("Y: 0")
|
||||
self.labels['pos_z'] = Gtk.Label("Z: 0")
|
||||
self.labels['pos_x'].get_style_context().add_class("text")
|
||||
self.labels['pos_y'].get_style_context().add_class("text")
|
||||
self.labels['pos_z'].get_style_context().add_class("text")
|
||||
bottomgrid.attach(self.labels['pos_x'], 0, 0, 1, 1)
|
||||
bottomgrid.attach(self.labels['pos_y'], 1, 0, 1, 1)
|
||||
bottomgrid.attach(self.labels['pos_z'], 2, 0, 1, 1)
|
||||
box.pack_start(bottomgrid, True, True, 0)
|
||||
self.labels['move_dist'] = Gtk.Label("Move Distance (mm)")
|
||||
self.labels['move_dist'].get_style_context().add_class("text")
|
||||
box.pack_start(self.labels['move_dist'], True, True, 0)
|
||||
box.pack_start(distgrid, True, True, 0)
|
||||
|
||||
grid.attach(box, 0, 2, 3, 1)
|
||||
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b, 3, 2, 1, 1)
|
||||
|
||||
self.panel = grid
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def process_update(self, data):
|
||||
if "toolhead" in data and "position" in data["toolhead"]:
|
||||
self.labels['pos_x'].set_text("X: %.2f" % (data["toolhead"]["position"][0]))
|
||||
self.labels['pos_y'].set_text("Y: %.2f" % (data["toolhead"]["position"][1]))
|
||||
self.labels['pos_z'].set_text("Z: %.2f" % (data["toolhead"]["position"][2]))
|
||||
|
||||
def change_distance(self, widget, distance):
|
||||
if self.distance == distance:
|
||||
return
|
||||
logging.info("### Distance " + str(distance))
|
||||
|
||||
ctx = self.labels[str(self.distance)].get_style_context()
|
||||
ctx.remove_class("distbutton_active")
|
||||
|
||||
self.distance = distance
|
||||
ctx = self.labels[self.distance].get_style_context()
|
||||
ctx.add_class("distbutton_active")
|
||||
for i in self.distances:
|
||||
if i == self.distance:
|
||||
continue
|
||||
self.labels[str(i)].set_active(False)
|
||||
|
||||
def move(self, widget, axis, dir):
|
||||
dist = str(self.distance) if dir == "+" else "-" + str(self.distance)
|
||||
logging.info("# Moving " + axis + " " + dist + "mm")
|
||||
|
||||
print("%s\n%s %s%s" % (KlippyGcodes.MOVE_RELATIVE, KlippyGcodes.MOVE, axis, dist))
|
||||
self._screen._ws.klippy.gcode_script(
|
||||
"%s\n%s %s%s" % (KlippyGcodes.MOVE_RELATIVE, KlippyGcodes.MOVE, axis, dist)
|
||||
)
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.MovePanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return MovePanel(*args)
|
||||
|
||||
class MovePanel(ScreenPanel):
|
||||
distance = 1
|
||||
distances = ['.1','.5','1','5','10','25']
|
||||
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
self.labels['x+'] = self._gtk.ButtonImage("move-x+", _("X+"), "color1")
|
||||
self.labels['x+'].connect("clicked", self.move, "X", "+")
|
||||
self.labels['x-'] = self._gtk.ButtonImage("move-x-", _("X-"), "color1")
|
||||
self.labels['x-'].connect("clicked", self.move, "X", "-")
|
||||
|
||||
self.labels['y+'] = self._gtk.ButtonImage("move-y+", _("Y+"), "color2")
|
||||
self.labels['y+'].connect("clicked", self.move, "Y", "+")
|
||||
self.labels['y-'] = self._gtk.ButtonImage("move-y-", _("Y-"), "color2")
|
||||
self.labels['y-'].connect("clicked", self.move, "Y", "-")
|
||||
|
||||
self.labels['z+'] = self._gtk.ButtonImage("move-z-", _("Z+"), "color3")
|
||||
self.labels['z+'].connect("clicked", self.move, "Z", "+")
|
||||
self.labels['z-'] = self._gtk.ButtonImage("move-z+", _("Z-"), "color3")
|
||||
self.labels['z-'].connect("clicked", self.move, "Z", "-")
|
||||
|
||||
self.labels['home'] = self._gtk.ButtonImage("home", _("Home All"))
|
||||
self.labels['home'].connect("clicked", self.home)
|
||||
|
||||
if self._screen.lang_ltr:
|
||||
grid.attach(self.labels['x+'], 2, 1, 1, 1)
|
||||
grid.attach(self.labels['x-'], 0, 1, 1, 1)
|
||||
else:
|
||||
grid.attach(self.labels['x+'], 0, 1, 1, 1)
|
||||
grid.attach(self.labels['x-'], 2, 1, 1, 1)
|
||||
grid.attach(self.labels['y+'], 1, 0, 1, 1)
|
||||
grid.attach(self.labels['y-'], 1, 1, 1, 1)
|
||||
grid.attach(self.labels['z+'], 3, 0, 1, 1)
|
||||
grid.attach(self.labels['z-'], 3, 1, 1, 1)
|
||||
|
||||
grid.attach(self.labels['home'], 0, 0, 1, 1)
|
||||
|
||||
distgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.distances:
|
||||
self.labels[i] = self._gtk.ToggleButton(i)
|
||||
self.labels[i].set_direction(Gtk.TextDirection.LTR)
|
||||
self.labels[i].connect("clicked", self.change_distance, i)
|
||||
ctx = self.labels[i].get_style_context()
|
||||
if (self._screen.lang_ltr and j == 0) or (not self._screen.lang_ltr and j == len(self.distances)-1):
|
||||
ctx.add_class("distbutton_top")
|
||||
elif (not self._screen.lang_ltr and j == 0) or (self._screen.lang_ltr and j == len(self.distances)-1):
|
||||
ctx.add_class("distbutton_bottom")
|
||||
else:
|
||||
ctx.add_class("distbutton")
|
||||
if i == "1":
|
||||
ctx.add_class("distbutton_active")
|
||||
distgrid.attach(self.labels[i], j, 0, 1, 1)
|
||||
j += 1
|
||||
|
||||
self.labels["1"].set_active(True)
|
||||
|
||||
#space_grid = self._gtk.HomogeneousGrid()
|
||||
#space_grid.attach(Gtk.Label("Distance (mm):"),0,0,1,1)
|
||||
#space_grid.attach(distgrid,0,1,1,1)
|
||||
#space_grid.attach(Gtk.Label(" "),0,2,1,1)
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
|
||||
bottomgrid = self._gtk.HomogeneousGrid()
|
||||
bottomgrid.set_direction(Gtk.TextDirection.LTR)
|
||||
self.labels['pos_x'] = Gtk.Label("X: 0")
|
||||
self.labels['pos_y'] = Gtk.Label("Y: 0")
|
||||
self.labels['pos_z'] = Gtk.Label("Z: 0")
|
||||
bottomgrid.attach(self.labels['pos_x'], 0, 0, 1, 1)
|
||||
bottomgrid.attach(self.labels['pos_y'], 1, 0, 1, 1)
|
||||
bottomgrid.attach(self.labels['pos_z'], 2, 0, 1, 1)
|
||||
box.pack_start(bottomgrid, True, True, 0)
|
||||
self.labels['move_dist'] = Gtk.Label(_("Move Distance (mm)"))
|
||||
box.pack_start(self.labels['move_dist'], True, True, 0)
|
||||
box.pack_start(distgrid, True, True, 0)
|
||||
|
||||
grid.attach(box, 0, 2, 3, 1)
|
||||
|
||||
self.content.add(grid)
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action != "notify_status_update":
|
||||
return
|
||||
|
||||
if "toolhead" in data and "position" in data["toolhead"]:
|
||||
self.labels['pos_x'].set_text("X: %.2f" % (data["toolhead"]["position"][0]))
|
||||
self.labels['pos_y'].set_text("Y: %.2f" % (data["toolhead"]["position"][1]))
|
||||
self.labels['pos_z'].set_text("Z: %.2f" % (data["toolhead"]["position"][2]))
|
||||
|
||||
def change_distance(self, widget, distance):
|
||||
if self.distance == distance:
|
||||
return
|
||||
logging.info("### Distance " + str(distance))
|
||||
|
||||
ctx = self.labels[str(self.distance)].get_style_context()
|
||||
ctx.remove_class("distbutton_active")
|
||||
|
||||
self.distance = distance
|
||||
ctx = self.labels[self.distance].get_style_context()
|
||||
ctx.add_class("distbutton_active")
|
||||
for i in self.distances:
|
||||
if i == self.distance:
|
||||
continue
|
||||
self.labels[str(i)].set_active(False)
|
||||
|
||||
def move(self, widget, axis, dir):
|
||||
if self._config.get_config()['main'].getboolean("invert_%s" % axis.lower(), False):
|
||||
dir = "-" if dir == "+" else "+"
|
||||
|
||||
dist = str(self.distance) if dir == "+" else "-" + str(self.distance)
|
||||
logging.info("# Moving " + axis + " " + dist + "mm")
|
||||
|
||||
print("%s\n%s %s%s" % (KlippyGcodes.MOVE_RELATIVE, KlippyGcodes.MOVE, axis, dist))
|
||||
self._screen._ws.klippy.gcode_script(
|
||||
"%s\n%s %s%s" % (KlippyGcodes.MOVE_RELATIVE, KlippyGcodes.MOVE, axis, dist)
|
||||
)
|
||||
@@ -1,19 +1,27 @@
|
||||
import gi
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from panels.screen_panel import ScreenPanel
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.NetworkPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return NetworkPanel(*args)
|
||||
|
||||
class NetworkPanel(ScreenPanel):
|
||||
networks = {}
|
||||
network_list = []
|
||||
interface = "wlan0"
|
||||
|
||||
def initialize(self, menu):
|
||||
# Create gtk items here
|
||||
self.panel = KlippyGtk.HomogeneousGrid()
|
||||
_ = self.lang.gettext
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
grid.set_hexpand(True)
|
||||
|
||||
# Get Hostname
|
||||
stream = os.popen('hostname -A')
|
||||
@@ -22,15 +30,142 @@ class NetworkPanel(ScreenPanel):
|
||||
stream = os.popen('hostname -I')
|
||||
ip = stream.read()
|
||||
|
||||
self.labels['networks'] = {}
|
||||
|
||||
self.labels['interface'] = Gtk.Label()
|
||||
self.labels['interface'].set_text(" %s: %s" % (_("Interface"), self.interface))
|
||||
self.labels['disconnect'] = self._gtk.Button(_("Disconnect"), "color2")
|
||||
|
||||
|
||||
self.labels['networkinfo'] = Gtk.Label(
|
||||
"Network Info\n\n%s%s" % (hostname, ip)
|
||||
)
|
||||
self.labels['networkinfo'].get_style_context().add_class('temperature_entry')
|
||||
self.panel.attach(self.labels['networkinfo'], 1, 0, 1, 1)
|
||||
sbox = Gtk.Box()
|
||||
sbox.set_hexpand(True)
|
||||
sbox.set_vexpand(False)
|
||||
sbox.add(self.labels['interface'])
|
||||
#sbox.add(self.labels['disconnect'])
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
self.panel.attach(b, 1, 1, 1, 1)
|
||||
scroll = Gtk.ScrolledWindow()
|
||||
scroll.set_property("overlay-scrolling", False)
|
||||
scroll.set_vexpand(True)
|
||||
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||
box.set_vexpand(True)
|
||||
box.pack_start(sbox, False, False, 0)
|
||||
box.pack_start(scroll, True, True, 0)
|
||||
|
||||
self.labels['networklist'] = Gtk.Grid()
|
||||
self.files = {}
|
||||
|
||||
GLib.idle_add(self.load_networks)
|
||||
|
||||
scroll.add(self.labels['networklist'])
|
||||
|
||||
#self.labels['networkinfo'] = Gtk.Label(
|
||||
# _("Network Info") + "\n\n%s%s" % (hostname, ip)
|
||||
#)
|
||||
#self.labels['networkinfo'].get_style_context().add_class('temperature_entry')
|
||||
#grid.attach(self.labels['networkinfo'], 1, 0, 1, 1)
|
||||
|
||||
self.content.add(box)
|
||||
|
||||
def load_networks(self):
|
||||
networks = self._screen.wifi.get_networks()
|
||||
for net in networks:
|
||||
self.add_network(net, False)
|
||||
|
||||
self.content.show_all()
|
||||
|
||||
def add_network(self, essid, show=True):
|
||||
_ = self.lang.gettext
|
||||
|
||||
netinfo = self._screen.wifi.get_network_info(essid)
|
||||
if netinfo == None:
|
||||
return
|
||||
|
||||
# For now, only add connected network
|
||||
if "connected" not in netinfo:
|
||||
return
|
||||
|
||||
frame = Gtk.Frame()
|
||||
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
|
||||
frame.get_style_context().add_class("frame-item")
|
||||
|
||||
|
||||
name = Gtk.Label()
|
||||
name.set_markup("<big><b>%s</b></big>" % (essid))
|
||||
name.set_hexpand(True)
|
||||
name.set_halign(Gtk.Align.START)
|
||||
name.set_line_wrap(True)
|
||||
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
stream = os.popen('ip add show dev %s' % self.interface)
|
||||
content = stream.read()
|
||||
ipv4_re = re.compile(r'inet ([0-9\.]+)/[0-9]+', re.MULTILINE)
|
||||
ipv6_re = re.compile(r'inet6 ([a-fA-F0-9:\.]+)/[0-9+]', re.MULTILINE)
|
||||
match = ipv4_re.search(content)
|
||||
ipv4 = ""
|
||||
if match:
|
||||
ipv4 = "<b>%s:</b> %s " % (_("IPv4"), match.group(1))
|
||||
match = ipv6_re.search(content)
|
||||
ipv6 = ""
|
||||
if match:
|
||||
ipv6 = "<b>%s:</b> %s " % (_("IPv6"), match.group(1))
|
||||
|
||||
|
||||
stream = os.popen('hostname -f')
|
||||
hostname = stream.read().strip()
|
||||
|
||||
connected = ""
|
||||
if "connected" in netinfo:
|
||||
connected = "<b>%s</b>\n<b>%s:</b> %s\n%s%s\n" % (_("Connected"),_("Hostname"),hostname, ipv4, ipv6)
|
||||
elif "psk" in netinfo:
|
||||
connected = "Password saved."
|
||||
freq = "2.4 GHz" if netinfo['frequency'][0:1] == "2" else "5 Ghz"
|
||||
info = Gtk.Label()
|
||||
info.set_markup("%s%s <small>%s %s %s %s%s</small>" % ( connected,
|
||||
"" if netinfo['encryption'] == "off" else netinfo['encryption'].upper(),
|
||||
freq, _("Channel"), netinfo['channel'], netinfo['signal_level_dBm'], _("dBm")
|
||||
))
|
||||
info.set_halign(Gtk.Align.START)
|
||||
#info.set_markup(self.get_file_info_str(essid))
|
||||
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
labels.add(name)
|
||||
labels.add(info)
|
||||
labels.set_vexpand(True)
|
||||
labels.set_valign(Gtk.Align.CENTER)
|
||||
labels.set_halign(Gtk.Align.START)
|
||||
|
||||
actions = self._gtk.ButtonImage("print",None,"color3")
|
||||
#actions.connect("clicked", self.confirm_print, essid)
|
||||
actions.set_hexpand(False)
|
||||
actions.set_halign(Gtk.Align.END)
|
||||
|
||||
network = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
network.set_hexpand(True)
|
||||
network.set_vexpand(False)
|
||||
|
||||
network.add(labels)
|
||||
if not "connected" in netinfo:
|
||||
network.add(actions)
|
||||
|
||||
self.networks[essid] = frame
|
||||
frame.add(network)
|
||||
|
||||
reverse = False
|
||||
nets = sorted(self.networks, reverse=reverse)
|
||||
pos = nets.index(essid)
|
||||
if "connected" in netinfo:
|
||||
pos = 0
|
||||
elif self._screen.wifi.is_connected():
|
||||
pos += 1
|
||||
|
||||
self.labels['networks'][essid] = {
|
||||
"info": info,
|
||||
"name": name,
|
||||
"row": network
|
||||
}
|
||||
|
||||
self.labels['networklist'].insert_row(pos)
|
||||
self.labels['networklist'].attach(self.networks[essid], 0, pos, 1, 1)
|
||||
if show == True:
|
||||
self.labels['networklist'].show_all()
|
||||
@@ -0,0 +1,104 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.PowerPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return PowerPanel(*args)
|
||||
|
||||
class PowerPanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
self.devices = {}
|
||||
|
||||
# Create a scroll window for the power devices
|
||||
scroll = Gtk.ScrolledWindow()
|
||||
scroll.set_property("overlay-scrolling", False)
|
||||
scroll.set_vexpand(True)
|
||||
|
||||
# Create a grid for all devices
|
||||
self.labels['devices'] = Gtk.Grid()
|
||||
scroll.add(self.labels['devices'])
|
||||
|
||||
# Create a box to contain all of the above
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||
box.set_vexpand(True)
|
||||
box.pack_start(scroll, True, True, 0)
|
||||
|
||||
self.load_power_devices()
|
||||
|
||||
self.content.add(box)
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def add_device(self, device):
|
||||
frame = Gtk.Frame()
|
||||
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
|
||||
frame.get_style_context().add_class("frame-item")
|
||||
|
||||
name = Gtk.Label()
|
||||
name.set_markup("<big><b>%s</b></big>" % (device))
|
||||
name.set_hexpand(True)
|
||||
name.set_vexpand(True)
|
||||
name.set_halign(Gtk.Align.START)
|
||||
name.set_valign(Gtk.Align.CENTER)
|
||||
name.set_line_wrap(True)
|
||||
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
switch = Gtk.Switch()
|
||||
switch.set_hexpand(False)
|
||||
switch.set_active(True if self._screen.printer.get_power_device_status(device) == "on" else False)
|
||||
switch.connect("notify::active", self.on_switch, device)
|
||||
switch.set_property("width-request", round(self._gtk.get_image_width()*2.5))
|
||||
switch.set_property("height-request", round(self._gtk.get_image_height()*1.25))
|
||||
|
||||
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
labels.add(name)
|
||||
|
||||
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
dev.set_hexpand(True)
|
||||
dev.set_vexpand(False)
|
||||
dev.add(labels)
|
||||
dev.add(switch)
|
||||
frame.add(dev)
|
||||
|
||||
self.devices[device] = {
|
||||
"row": frame,
|
||||
"switch": switch
|
||||
}
|
||||
|
||||
devices = sorted(self.devices)
|
||||
pos = devices.index(device)
|
||||
|
||||
self.labels['devices'].insert_row(pos)
|
||||
self.labels['devices'].attach(self.devices[device]['row'], 0, pos, 1, 1)
|
||||
self.labels['devices'].show_all()
|
||||
|
||||
def load_power_devices(self):
|
||||
devices = self._screen.printer.get_power_devices()
|
||||
for x in devices:
|
||||
self.add_device(x)
|
||||
|
||||
def on_switch(self, switch, gparam, device):
|
||||
logger.debug("Power toggled %s" % device)
|
||||
if switch.get_active():
|
||||
self._screen._ws.klippy.power_device_on(device)
|
||||
else:
|
||||
self._screen._ws.klippy.power_device_off(device)
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action != "notify_power_changed":
|
||||
return
|
||||
|
||||
if data['device'] not in self.devices:
|
||||
return
|
||||
device = data['device']
|
||||
self.devices[device]['switch'].disconnect_by_func(self.on_switch)
|
||||
self.devices[device]['switch'].set_active(True if data['status'] == "on" else False)
|
||||
self.devices[device]['switch'].connect("notify::active", self.on_switch, device)
|
||||
@@ -4,41 +4,46 @@ import logging
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from panels.screen_panel import ScreenPanel
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.PreheatPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return PreheatPanel(*args)
|
||||
|
||||
class PreheatPanel(ScreenPanel):
|
||||
active_heaters = []
|
||||
|
||||
def initialize(self, panel_name):
|
||||
self.preheat_options = self._screen._config['preheat_options']
|
||||
_ = self.lang.gettext
|
||||
self.preheat_options = self._screen._config.get_preheat_options()
|
||||
logger.debug("Preheat options: %s" % self.preheat_options)
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
eq_grid = KlippyGtk.HomogeneousGrid()
|
||||
eq_grid = self._gtk.HomogeneousGrid()
|
||||
i = 0
|
||||
for x in self._printer.get_tools():
|
||||
if i > 3:
|
||||
break
|
||||
elif i == 0:
|
||||
primary_tool = x
|
||||
self.labels[x] = KlippyGtk.ToggleButtonImage("extruder-"+str(i+1), KlippyGtk.formatTemperatureString(0, 0))
|
||||
self.labels[x] = self._gtk.ToggleButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0))
|
||||
self.labels[x].connect('clicked', self.select_heater, x)
|
||||
eq_grid.attach(self.labels[x], i%2, i/2, 1, 1)
|
||||
i += 1
|
||||
|
||||
self.labels["heater_bed"] = KlippyGtk.ToggleButtonImage("bed", KlippyGtk.formatTemperatureString(0, 0))
|
||||
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
|
||||
width = 2 if i > 1 else 1
|
||||
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
|
||||
if self._printer.has_heated_bed():
|
||||
self.labels["heater_bed"] = self._gtk.ToggleButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
|
||||
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
|
||||
width = 2 if i > 1 else 1
|
||||
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
|
||||
|
||||
self.labels["control_grid"] = KlippyGtk.HomogeneousGrid()
|
||||
self.labels["control_grid"] = self._gtk.HomogeneousGrid()
|
||||
|
||||
i = 0
|
||||
for option in self.preheat_options:
|
||||
self.labels[option] = KlippyGtk.Button(option, "color%d" % ((i%4)+1))
|
||||
self.labels[option] = self._gtk.Button(option, "color%d" % ((i%4)+1))
|
||||
self.labels[option].connect("clicked", self.set_temperature, option)
|
||||
self.labels['control_grid'].attach(
|
||||
self.labels[option],
|
||||
@@ -46,24 +51,28 @@ class PreheatPanel(ScreenPanel):
|
||||
i += 1
|
||||
|
||||
|
||||
cooldown = KlippyGtk.ButtonImage('cool-down', 'Cooldown')
|
||||
cooldown = self._gtk.ButtonImage('cool-down', _('Cooldown'))
|
||||
cooldown.connect("clicked", self.set_temperature, "cooldown")
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
|
||||
row = int(i/2) if i%2 == 0 else int(i/2)+1
|
||||
self.labels["control_grid"].attach(cooldown, 0, row, 1, 1)
|
||||
self.labels["control_grid"].attach(b, 1, row, 1, 1)
|
||||
self.labels["control_grid"].attach(cooldown, i%2, int(i/2), 1, 1)
|
||||
|
||||
|
||||
grid.attach(eq_grid, 0, 0, 1, 1)
|
||||
grid.attach(self.labels["control_grid"], 1, 0, 1, 1)
|
||||
|
||||
self.panel = grid
|
||||
self.content.add(grid)
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def activate(self):
|
||||
for x in self._printer.get_tools():
|
||||
if x not in self.active_heaters:
|
||||
self.select_heater(None, x)
|
||||
|
||||
if self._printer.has_heated_bed() and "heater_bed" not in self.active_heaters:
|
||||
self.select_heater(None, "heater_bed")
|
||||
|
||||
def select_heater(self, widget, heater):
|
||||
if heater in self.active_heaters:
|
||||
self.active_heaters.pop(self.active_heaters.index(heater))
|
||||
@@ -91,15 +100,20 @@ class PreheatPanel(ScreenPanel):
|
||||
self._screen._ws.klippy.set_bed_temp(self.preheat_options[setting]["bed"])
|
||||
self._printer.set_dev_stat(heater,"target", int(self.preheat_options[setting]["bed"]))
|
||||
else:
|
||||
print ("Setting %s to %d" % (heater, self.preheat_options[setting]['tool']))
|
||||
self._screen._ws.klippy.set_tool_temp(heater, self.preheat_options[setting]["tool"])
|
||||
self._printer.set_dev_stat(heater,"target", int(self.preheat_options[setting]["tool"]))
|
||||
print ("Setting %s to %d" % (heater, self.preheat_options[setting]['extruder']))
|
||||
self._screen._ws.klippy.set_tool_temp(self._printer.get_tool_number(heater),
|
||||
self.preheat_options[setting]["extruder"])
|
||||
self._printer.set_dev_stat(heater,"target", int(self.preheat_options[setting]["extruder"]))
|
||||
|
||||
def process_update(self, data):
|
||||
self.update_temp("heater_bed",
|
||||
self._printer.get_dev_stat("heater_bed","temperature"),
|
||||
self._printer.get_dev_stat("heater_bed","target")
|
||||
)
|
||||
def process_update(self, action, data):
|
||||
if action != "notify_status_update":
|
||||
return
|
||||
|
||||
if self._printer.has_heated_bed():
|
||||
self.update_temp("heater_bed",
|
||||
self._printer.get_dev_stat("heater_bed","temperature"),
|
||||
self._printer.get_dev_stat("heater_bed","target")
|
||||
)
|
||||
for x in self._printer.get_tools():
|
||||
self.update_temp(x,
|
||||
self._printer.get_dev_stat(x,"temperature"),
|
||||
|
||||
@@ -1,82 +1,96 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import gi
|
||||
import humanize
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
from datetime import datetime
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from KlippyGcodes import KlippyGcodes
|
||||
from panels.screen_panel import ScreenPanel
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.PrintPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return PrintPanel(*args)
|
||||
|
||||
class PrintPanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
self.labels['files'] = {}
|
||||
self.sort_items = {
|
||||
"name": _("Name"),
|
||||
"date": _("Date")
|
||||
}
|
||||
self.sort_char = ["↑","↓"]
|
||||
|
||||
sortdir = self._config.get_main_config_option("print_sort_dir","name_asc")
|
||||
sortdir = sortdir.split('_')
|
||||
if sortdir[0] not in ["name","date"] or sortdir[1] not in ["asc","desc"]:
|
||||
sortdir = ["name","asc"]
|
||||
self.sort_current = [sortdir[0], 0 if sortdir[1] == "asc" else 1] # 0 for asc, 1 for desc
|
||||
|
||||
scroll = Gtk.ScrolledWindow()
|
||||
scroll.set_property("overlay-scrolling", False)
|
||||
scroll.set_vexpand(True)
|
||||
|
||||
sort = Gtk.Label()
|
||||
sort.set_text(_("Sort by: "))
|
||||
sbox = Gtk.Box(spacing=0)
|
||||
sbox.set_vexpand(False)
|
||||
sbox.add(sort)
|
||||
i = 1
|
||||
for name, val in self.sort_items.items():
|
||||
s = self._gtk.Button(val, "color%s" % (i%4))
|
||||
s.set_label(val)
|
||||
if name == sortdir[0]:
|
||||
s.set_label("%s %s" % (s.get_label(), self.sort_char[self.sort_current[1]]))
|
||||
s.connect("clicked", self.change_sort, name)
|
||||
self.labels['sort_%s' % name] = s
|
||||
sbox.add(s)
|
||||
i += 1
|
||||
sbox.set_hexpand(True)
|
||||
sbox.set_vexpand(False)
|
||||
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||
box.set_vexpand(True)
|
||||
box.pack_start(sbox, False, False, 0)
|
||||
box.pack_start(scroll, True, True, 0)
|
||||
|
||||
|
||||
bar = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
||||
bar.set_hexpand(True)
|
||||
bar.set_vexpand(False)
|
||||
bar.set_halign(Gtk.Align.END)
|
||||
bar.set_margin_top(5)
|
||||
bar.set_margin_bottom(5)
|
||||
bar.set_margin_end(5)
|
||||
refresh = KlippyGtk.ButtonImage('refresh', None, None, 60, 60)
|
||||
refresh.connect("clicked", self.reload_files)
|
||||
#bar.add(refresh)
|
||||
|
||||
back = KlippyGtk.ButtonImage('back', None, None, 60, 60)
|
||||
back.connect("clicked", self._screen._menu_go_back)
|
||||
bar.add(back)
|
||||
|
||||
box.pack_end(bar, False, False, 0)
|
||||
|
||||
self.labels['filelist'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
self.labels['filelist'].set_vexpand(True)
|
||||
|
||||
#self.labels['filelist'] = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL)
|
||||
#self.labels['filelist'].set_vexpand(True)
|
||||
self.labels['filelist'] = Gtk.Grid()
|
||||
|
||||
self.files = {}
|
||||
self.reload_files()
|
||||
|
||||
GLib.idle_add(self.reload_files)
|
||||
|
||||
scroll.add(self.labels['filelist'])
|
||||
|
||||
|
||||
self.panel = box
|
||||
|
||||
self.content.add(box)
|
||||
self._screen.files.add_file_callback(self._callback)
|
||||
|
||||
|
||||
return
|
||||
|
||||
def add_file(self, filename):
|
||||
def add_file(self, filename, show=True):
|
||||
fileinfo = self._screen.files.get_file_info(filename)
|
||||
if fileinfo == None:
|
||||
return
|
||||
|
||||
frame = Gtk.Frame()
|
||||
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
|
||||
frame.get_style_context().add_class("frame-item")
|
||||
|
||||
|
||||
name = Gtk.Label()
|
||||
#n = 50
|
||||
#name.set_markup("<big>%s</big>" % ("\n".join([filename[i:i+n] for i in range(0, len(filename), n)])))
|
||||
name.set_markup("<big>%s</big>" % (filename))
|
||||
name.set_markup("<big><b>%s</b></big>" % (filename))
|
||||
name.set_hexpand(True)
|
||||
name.set_halign(Gtk.Align.START)
|
||||
name.set_line_wrap(True)
|
||||
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
info = Gtk.Label("Uploaded: blah - Size: blah")
|
||||
info.set_halign(Gtk.Align.START)
|
||||
@@ -88,20 +102,16 @@ class PrintPanel(ScreenPanel):
|
||||
labels.set_valign(Gtk.Align.CENTER)
|
||||
labels.set_halign(Gtk.Align.START)
|
||||
|
||||
actions = KlippyGtk.ButtonImage("print",None,"color3")
|
||||
actions = self._gtk.ButtonImage("print",None,"color3")
|
||||
actions.connect("clicked", self.confirm_print, filename)
|
||||
actions.set_hexpand(False)
|
||||
actions.set_halign(Gtk.Align.END)
|
||||
|
||||
file = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
file.set_margin_top(1)
|
||||
file.set_margin_end(15)
|
||||
file.set_margin_start(15)
|
||||
file.set_margin_bottom(1)
|
||||
file.set_hexpand(True)
|
||||
file.set_vexpand(False)
|
||||
|
||||
icon = KlippyGtk.Image("file", False, 100, 100)
|
||||
icon = self._gtk.Image("file.svg", False, 1.6, 1.6)
|
||||
pixbuf = self.get_file_image(filename)
|
||||
if pixbuf != None:
|
||||
icon.set_from_pixbuf(pixbuf)
|
||||
@@ -112,7 +122,13 @@ class PrintPanel(ScreenPanel):
|
||||
frame.add(file)
|
||||
|
||||
self.files[filename] = frame
|
||||
files = sorted(self.files)
|
||||
|
||||
reverse = False if self.sort_current[1] == 0 else True
|
||||
if self.sort_current[0] == "date":
|
||||
files = sorted(self.files, reverse=reverse,
|
||||
key=lambda item: self._screen.files.get_file_info(item)['modified'])
|
||||
else:
|
||||
files = sorted(self.files, reverse=reverse)
|
||||
pos = files.index(filename)
|
||||
|
||||
self.labels['files'][filename] = {
|
||||
@@ -123,28 +139,36 @@ class PrintPanel(ScreenPanel):
|
||||
|
||||
self.labels['filelist'].insert_row(pos)
|
||||
self.labels['filelist'].attach(self.files[filename], 0, pos, 1, 1)
|
||||
self.labels['filelist'].show_all()
|
||||
if show == True:
|
||||
self.labels['filelist'].show_all()
|
||||
|
||||
def get_file_image(self, filename, width=100, height=100):
|
||||
fileinfo = self._screen.files.get_file_info(filename)
|
||||
if fileinfo == None:
|
||||
return None
|
||||
|
||||
if "thumbnails" in fileinfo and len(fileinfo["thumbnails"]) > 0:
|
||||
thumbnail = fileinfo['thumbnails'][0]
|
||||
return KlippyGtk.PixbufFromFile("/tmp/.KS-thumbnails/%s-%s" % (fileinfo['filename'], thumbnail['size']),
|
||||
None, width, height)
|
||||
return None
|
||||
def change_sort(self, widget, key):
|
||||
if self.sort_current[0] == key:
|
||||
self.sort_current[1] = (self.sort_current[1] + 1) % 2
|
||||
else:
|
||||
oldkey = self.sort_current[0]
|
||||
logger.info("Changing %s to %s" % ('sort_%s' % oldkey, self.sort_items[self.sort_current[0]]))
|
||||
self.labels['sort_%s' % oldkey].set_label("%s" % self.sort_items[oldkey])
|
||||
self.labels['sort_%s' % oldkey].show_all()
|
||||
self.sort_current = [key, 0]
|
||||
self.labels['sort_%s' % key].set_label("%s %s" % (self.sort_items[key], self.sort_char[self.sort_current[1]]))
|
||||
self.labels['sort_%s' % key].show()
|
||||
|
||||
GLib.idle_add(self.reload_files)
|
||||
|
||||
def get_file_info_str(self, filename):
|
||||
_ = self.lang.gettext
|
||||
|
||||
fileinfo = self._screen.files.get_file_info(filename)
|
||||
if fileinfo == None:
|
||||
return
|
||||
|
||||
return "<small>Uploaded: <b>%s</b> - Size: <b>%s</b> - Print Time: <b>%s</b></small>" % (
|
||||
return "<small>%s: <b>%s</b> - %s: <b>%s</b>\n%s: <b>%s</b></small>" % (
|
||||
_("Uploaded"),
|
||||
datetime.fromtimestamp(fileinfo['modified']).strftime("%Y-%m-%d %H:%M"),
|
||||
_("Size"),
|
||||
humanize.naturalsize(fileinfo['size']),
|
||||
_("Print Time"),
|
||||
self.get_print_time(filename)
|
||||
)
|
||||
|
||||
@@ -197,8 +221,9 @@ class PrintPanel(ScreenPanel):
|
||||
self.labels['filelist'].show_all()
|
||||
|
||||
for file in self._screen.files.get_file_list():
|
||||
#TODO: Change priority on this
|
||||
GLib.idle_add(self.add_file, file)
|
||||
self.add_file(file, False)
|
||||
|
||||
self.labels['filelist'].show_all()
|
||||
|
||||
def _callback(self, newfiles, deletedfiles, updatedfiles=[]):
|
||||
logger.debug("newfiles: %s", newfiles)
|
||||
@@ -212,47 +237,34 @@ class PrintPanel(ScreenPanel):
|
||||
self.update_file(file)
|
||||
|
||||
def confirm_print(self, widget, filename):
|
||||
dialog = Gtk.Dialog()
|
||||
#TODO: Factor other resolutions in
|
||||
dialog.set_default_size(984, 580)
|
||||
dialog.set_resizable(False)
|
||||
dialog.set_transient_for(self._screen)
|
||||
dialog.set_modal(True)
|
||||
|
||||
dialog.add_button(button_text="Print", response_id=Gtk.ResponseType.OK)
|
||||
dialog.add_button(button_text="Cancel", response_id=Gtk.ResponseType.CANCEL)
|
||||
|
||||
dialog.connect("response", self.confirm_print_response, filename)
|
||||
dialog.get_style_context().add_class("dialog")
|
||||
|
||||
content_area = dialog.get_content_area()
|
||||
content_area.set_margin_start(15)
|
||||
content_area.set_margin_end(15)
|
||||
content_area.set_margin_top(15)
|
||||
content_area.set_margin_bottom(15)
|
||||
_ = self.lang.gettext
|
||||
buttons = [
|
||||
{"name":_("Print"), "response": Gtk.ResponseType.OK},
|
||||
{"name":_("Cancel"),"response": Gtk.ResponseType.CANCEL}
|
||||
]
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_markup("%s <b>%s</b>%s" % (_("Are you sure you want to print"), filename, _("?")))
|
||||
label.set_hexpand(True)
|
||||
label.set_halign(Gtk.Align.CENTER)
|
||||
label.set_line_wrap(True)
|
||||
label.set_size_request(800, -1)
|
||||
label.set_markup("Are you sure you want to print <b>%s</b>?\n\n" % (filename))
|
||||
label.get_style_context().add_class("text")
|
||||
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
grid = Gtk.Grid()
|
||||
grid.add(label)
|
||||
grid.set_size_request(self._screen.width - 60, -1)
|
||||
|
||||
pixbuf = self.get_file_image(filename, 400, 350)
|
||||
pixbuf = self.get_file_image(filename, 8, 3.2)
|
||||
if pixbuf != None:
|
||||
image = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
grid.attach_next_to(image, label, Gtk.PositionType.BOTTOM, 1, 3)
|
||||
|
||||
#table.attach(label, 0, 1, 0, 1, Gtk.AttachOptions.SHRINK | Gtk.AttachOptions.FILL)
|
||||
grid.set_vexpand(True)
|
||||
grid.set_halign(Gtk.Align.CENTER)
|
||||
grid.set_valign(Gtk.Align.CENTER)
|
||||
content_area.add(grid)
|
||||
|
||||
dialog.show_all()
|
||||
dialog = self._gtk.Dialog(self._screen, buttons, grid, self.confirm_print_response, filename)
|
||||
|
||||
def confirm_print_response(self, widget, response_id, filename):
|
||||
widget.destroy()
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
import gi
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from KlippyGcodes import KlippyGcodes
|
||||
|
||||
class ScreenPanel:
|
||||
def __init__(self, screen):
|
||||
self._screen = screen
|
||||
self._printer = screen.printer
|
||||
self.labels = {}
|
||||
|
||||
|
||||
def initialize(self, panel_name):
|
||||
# Create gtk items here
|
||||
return
|
||||
|
||||
def emergency_stop(self, widget):
|
||||
self._screen._ws.klippy.emergency_stop()
|
||||
|
||||
def get(self):
|
||||
# Return gtk item
|
||||
return self.panel
|
||||
|
||||
def home(self, widget):
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
|
||||
|
||||
def menu_item_clicked(self, widget, panel, item):
|
||||
print("### Creating panel "+ item['panel'])
|
||||
if "items" in item:
|
||||
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + item['name'], item['panel'], 1, False, items=item['items'])
|
||||
return
|
||||
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + item['name'], item['panel'], 1, False)
|
||||
|
||||
def update_image_text(self, label, text):
|
||||
if label in self.labels and 'l' in self.labels[label]:
|
||||
self.labels[label]['l'].set_text(text)
|
||||
|
||||
def update_temp(self, dev, temp, target):
|
||||
if dev in self.labels:
|
||||
self.labels[dev].set_label(KlippyGtk.formatTemperatureString(temp, target))
|
||||
@@ -0,0 +1,210 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.Settings")
|
||||
|
||||
def create_panel(*args):
|
||||
return SettingsPanel(*args)
|
||||
|
||||
class SettingsPanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
self.settings = {}
|
||||
self.macros = {}
|
||||
self.menu_cur = 'main_box'
|
||||
self.menu = ['main_box']
|
||||
|
||||
self.labels['main_box'] = self.create_box('main')
|
||||
self.labels['macros_box'] = self.create_box('macros')
|
||||
|
||||
options = self._config.get_configurable_options().copy()
|
||||
options.append({"macros": {
|
||||
"name": _("Displayed Macros"),
|
||||
"type": "menu",
|
||||
"menu": "macros"}
|
||||
})
|
||||
|
||||
for option in options:
|
||||
name = list(option)[0]
|
||||
self.add_option('main', self.settings, name, option[name])
|
||||
|
||||
for macro in self._printer.get_config_section_list("gcode_macro "):
|
||||
macro = macro[12:]
|
||||
self.macros[macro] = {
|
||||
"name": macro,
|
||||
"section": "displayed_macros",
|
||||
"type": "macro"
|
||||
}
|
||||
|
||||
for macro in list(self.macros):
|
||||
self.add_option('macros', self.macros, macro, self.macros[macro])
|
||||
|
||||
logger.debug("Macros: %s" % self.macros)
|
||||
|
||||
self.control['back'].disconnect_by_func(self._screen._menu_go_back)
|
||||
self.control['back'].connect("clicked", self.back)
|
||||
self.content.add(self.labels['main_box'])
|
||||
|
||||
def activate(self):
|
||||
while len(self.menu) > 1:
|
||||
self.unload_menu()
|
||||
|
||||
def back(self, widget):
|
||||
if len(self.menu) > 1:
|
||||
self.unload_menu()
|
||||
else:
|
||||
self._screen._menu_go_back()
|
||||
|
||||
def create_box(self, name):
|
||||
# Create a scroll window for the macros
|
||||
scroll = Gtk.ScrolledWindow()
|
||||
scroll.set_property("overlay-scrolling", False)
|
||||
scroll.set_vexpand(True)
|
||||
|
||||
# Create a grid for all macros
|
||||
self.labels[name] = Gtk.Grid()
|
||||
scroll.add(self.labels[name])
|
||||
|
||||
# Create a box to contain all of the above
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||
box.set_vexpand(True)
|
||||
box.pack_start(scroll, True, True, 0)
|
||||
return box
|
||||
|
||||
def add_option(self, boxname, opt_array, opt_name, option):
|
||||
frame = Gtk.Frame()
|
||||
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
|
||||
frame.get_style_context().add_class("frame-item")
|
||||
|
||||
name = Gtk.Label()
|
||||
name.set_markup("<big><b>%s</b></big>" % (option['name']))
|
||||
name.set_hexpand(True)
|
||||
name.set_vexpand(True)
|
||||
name.set_halign(Gtk.Align.START)
|
||||
name.set_valign(Gtk.Align.CENTER)
|
||||
name.set_line_wrap(True)
|
||||
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
#open = self._gtk.ButtonImage("open",None,"color3")
|
||||
#open.connect("clicked", self.run_gcode_macro, macro)
|
||||
#open.set_hexpand(False)
|
||||
#open.set_halign(Gtk.Align.END)
|
||||
|
||||
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
labels.add(name)
|
||||
|
||||
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
dev.set_hexpand(True)
|
||||
dev.set_vexpand(False)
|
||||
dev.set_valign(Gtk.Align.CENTER)
|
||||
|
||||
dev.add(labels)
|
||||
if option['type'] == "binary" or option['type'] == "macro":
|
||||
box = Gtk.Box()
|
||||
box.set_vexpand(False)
|
||||
switch = Gtk.Switch()
|
||||
switch.set_hexpand(False)
|
||||
switch.set_vexpand(False)
|
||||
if option['type'] == "macro":
|
||||
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name, fallback=True))
|
||||
else:
|
||||
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name))
|
||||
switch.connect("notify::active", self.switch_config_option, option['section'], opt_name)
|
||||
switch.set_property("width-request", round(self._gtk.get_image_width()*2.5))
|
||||
switch.set_property("height-request", round(self._gtk.get_image_height()*1.25))
|
||||
box.add(switch)
|
||||
dev.add(box)
|
||||
elif option['type'] == "dropdown":
|
||||
dropdown = Gtk.ComboBoxText()
|
||||
i = 0
|
||||
for opt in option['options']:
|
||||
dropdown.append(opt['value'], opt['name'])
|
||||
if opt['value'] == self._config.get_config()[option['section']].get(opt_name, option['value']):
|
||||
dropdown.set_active(i)
|
||||
i += 1
|
||||
dropdown.connect("changed", self.on_dropdown_change, option['section'], opt_name,
|
||||
option['callback'] if "callback" in option else None)
|
||||
#dropdown.props.relief = Gtk.ReliefStyle.NONE
|
||||
dropdown.set_entry_text_column(0)
|
||||
dev.add(dropdown)
|
||||
logger.debug("Children: %s" % dropdown.get_children())
|
||||
elif option['type'] == "menu":
|
||||
open = self._gtk.ButtonImage("open",None,"color3")
|
||||
open.connect("clicked", self.load_menu, option['menu'])
|
||||
open.set_hexpand(False)
|
||||
open.set_halign(Gtk.Align.END)
|
||||
dev.add(open)
|
||||
|
||||
frame.add(dev)
|
||||
frame.show_all()
|
||||
|
||||
opt_array[opt_name] = {
|
||||
"name": option['name'],
|
||||
"row": frame
|
||||
}
|
||||
|
||||
opts = sorted(opt_array)
|
||||
opts = sorted(list(opt_array), key=lambda x: opt_array[x]['name'])
|
||||
pos = opts.index(opt_name)
|
||||
|
||||
self.labels[boxname].insert_row(pos)
|
||||
self.labels[boxname].attach(opt_array[opt_name]['row'], 0, pos, 1, 1)
|
||||
self.labels[boxname].show_all()
|
||||
|
||||
def load_menu(self, widget, name):
|
||||
if ("%s_box" % name) not in self.labels:
|
||||
return
|
||||
|
||||
for child in self.content.get_children():
|
||||
self.content.remove(child)
|
||||
|
||||
self.menu.append('%s_box' % name)
|
||||
self.content.add(self.labels[self.menu[-1]])
|
||||
self.content.show_all()
|
||||
|
||||
def unload_menu(self, widget=None):
|
||||
logger.debug("self.menu: %s" % self.menu)
|
||||
if len(self.menu) <= 1 or self.menu[-2] not in self.labels:
|
||||
return
|
||||
|
||||
self.menu.pop()
|
||||
for child in self.content.get_children():
|
||||
self.content.remove(child)
|
||||
self.content.add(self.labels[self.menu[-1]])
|
||||
self.content.show_all()
|
||||
|
||||
def on_dropdown_change(self, combo, section, option, callback=None):
|
||||
tree_iter = combo.get_active_iter()
|
||||
if tree_iter is not None:
|
||||
model = combo.get_model()
|
||||
value = model[tree_iter][1]
|
||||
logger.debug("[%s] %s changed to %s" % (section, option, value))
|
||||
self._config.set(section, option, value)
|
||||
self._config.save_user_config_options()
|
||||
if callback is not None:
|
||||
callback(value)
|
||||
|
||||
|
||||
def switch_config_option(self, switch, gparam, section, option):
|
||||
logger.debug("[%s] %s toggled %s" % (section, option, switch.get_active()))
|
||||
if section not in self._config.get_config().sections():
|
||||
self._config.get_config().add_section(section)
|
||||
self._config.set(section, option, "True" if switch.get_active() else "False")
|
||||
self._config.save_user_config_options()
|
||||
|
||||
def add_gcode_option(self):
|
||||
macros = self._screen.printer.get_gcode_macros()
|
||||
for x in macros:
|
||||
self.add_gcode_macro("macros", self.macros, x, {
|
||||
"name": x[12:],
|
||||
"type": binary
|
||||
})
|
||||
|
||||
def run_gcode_macro(self, widget, macro):
|
||||
self._screen._ws.klippy.gcode_script(macro)
|
||||
@@ -1,67 +1,89 @@
|
||||
import gi
|
||||
import logging
|
||||
import os
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from panels.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.SplashScreenPanel")
|
||||
|
||||
class SplashScreenPanel(ScreenPanel):
|
||||
box = None
|
||||
|
||||
def initialize(self, panel_name):
|
||||
image = Gtk.Image()
|
||||
#TODO: update file reference
|
||||
image.set_from_file(os.getcwd() + "/styles/z-bolt/images/klipper.png")
|
||||
|
||||
self.labels['text'] = Gtk.Label("Initializing printer...")
|
||||
self.labels['text'].get_style_context().add_class("text")
|
||||
|
||||
|
||||
self.labels['actions'] = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
||||
self.labels['actions'].set_hexpand(True)
|
||||
self.labels['actions'].set_vexpand(False)
|
||||
self.labels['actions'].set_halign(Gtk.Align.END)
|
||||
self.labels['actions'].set_margin_end(20)
|
||||
|
||||
|
||||
main = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=15)
|
||||
main.pack_start(image, True, True, 10)
|
||||
main.pack_end(self.labels['actions'], False, False, 10)
|
||||
main.pack_end(self.labels['text'], True, True, 10)
|
||||
|
||||
|
||||
box = Gtk.VBox()
|
||||
box.add(main)
|
||||
|
||||
self.panel = box
|
||||
|
||||
def update_text(self, text):
|
||||
self.labels['text'].set_text(text)
|
||||
self.clear_action_bar()
|
||||
|
||||
def clear_action_bar(self):
|
||||
for child in self.labels['actions'].get_children():
|
||||
self.labels['actions'].remove(child)
|
||||
|
||||
def show_restart_buttons(self):
|
||||
if "firmware_restart" not in self.labels:
|
||||
self.labels['restart'] = KlippyGtk.ButtonImage("reboot","Restart","color1")
|
||||
self.labels['restart'].connect("clicked", self.restart)
|
||||
self.labels['firmware_restart'] = KlippyGtk.ButtonImage("restart","Firmware Restart","color2")
|
||||
self.labels['firmware_restart'].connect("clicked", self.firmware_restart)
|
||||
|
||||
self.clear_action_bar()
|
||||
|
||||
self.labels['actions'].add(self.labels['restart'])
|
||||
self.labels['actions'].add(self.labels['firmware_restart'])
|
||||
|
||||
def firmware_restart(self, widget):
|
||||
self._screen._ws.klippy.restart_firmware()
|
||||
|
||||
def restart(self, widget):
|
||||
self._screen._ws.klippy.restart()
|
||||
import gi
|
||||
import logging
|
||||
import os
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.SplashScreenPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return SplashScreenPanel(*args)
|
||||
|
||||
class SplashScreenPanel(ScreenPanel):
|
||||
box = None
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
image = self._gtk.Image("klipper.png", None, 4, 3)
|
||||
|
||||
self.labels['text'] = Gtk.Label(_("Initializing printer..."))
|
||||
self.labels['text'].set_line_wrap(True)
|
||||
self.labels['text'].set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
self.labels['text'].set_halign(Gtk.Align.CENTER)
|
||||
|
||||
|
||||
self.labels['actions'] = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
||||
self.labels['actions'].set_hexpand(True)
|
||||
self.labels['actions'].set_vexpand(False)
|
||||
self.labels['actions'].set_halign(Gtk.Align.END)
|
||||
self.labels['actions'].set_margin_end(20)
|
||||
|
||||
|
||||
main = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=15)
|
||||
main.pack_start(image, True, True, 10)
|
||||
main.pack_end(self.labels['actions'], False, False, 10)
|
||||
main.pack_end(self.labels['text'], True, True, 10)
|
||||
|
||||
|
||||
box = Gtk.VBox()
|
||||
box.add(main)
|
||||
|
||||
self.layout = box
|
||||
|
||||
def update_text(self, text):
|
||||
self.labels['text'].set_text(text)
|
||||
self.clear_action_bar()
|
||||
|
||||
def clear_action_bar(self):
|
||||
for child in self.labels['actions'].get_children():
|
||||
self.labels['actions'].remove(child)
|
||||
|
||||
def show_restart_buttons(self):
|
||||
_ = self.lang.gettext
|
||||
|
||||
if "firmware_restart" not in self.labels:
|
||||
self.labels['menu'] = self._gtk.ButtonImage("control",_("Menu"),"color4")
|
||||
self.labels['menu'].connect("clicked", self._screen._go_to_submenu, "")
|
||||
self.labels['power'] = self._gtk.ButtonImage("reboot",_("Power On Printer"),"color3")
|
||||
self.labels['restart'] = self._gtk.ButtonImage("reboot",_("Restart"),"color1")
|
||||
self.labels['restart'].connect("clicked", self.restart)
|
||||
self.labels['firmware_restart'] = self._gtk.ButtonImage("restart",_("Firmware Restart"),"color2")
|
||||
self.labels['firmware_restart'].connect("clicked", self.firmware_restart)
|
||||
|
||||
self.clear_action_bar()
|
||||
|
||||
devices = [i for i in self._printer.get_power_devices() if i.lower().startswith('printer')] if (
|
||||
self._printer is not None) else []
|
||||
logger.debug("Power devices: %s" % devices)
|
||||
if len(devices) > 0:
|
||||
logger.debug("Adding power button")
|
||||
self.labels['power'].connect("clicked", self.power_on, devices[0])
|
||||
self.labels['actions'].add(self.labels['power'])
|
||||
|
||||
self.labels['actions'].add(self.labels['restart'])
|
||||
self.labels['actions'].add(self.labels['firmware_restart'])
|
||||
self.labels['actions'].add(self.labels['menu'])
|
||||
self.labels['actions'].show()
|
||||
|
||||
def firmware_restart(self, widget):
|
||||
self._screen._ws.klippy.restart_firmware()
|
||||
|
||||
def power_on(self, widget, device):
|
||||
self._screen._ws.klippy.power_device_on(device)
|
||||
|
||||
def restart(self, widget):
|
||||
self._screen._ws.klippy.restart()
|
||||
@@ -5,61 +5,71 @@ import os
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from KlippyGcodes import KlippyGcodes
|
||||
from panels.screen_panel import ScreenPanel
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.SystemPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return SystemPanel(*args)
|
||||
|
||||
class SystemPanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
# Create gtk items here
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
restart = KlippyGtk.ButtonImage('reboot','Klipper Restart','color1')
|
||||
restart = self._gtk.ButtonImage('reboot',"\n".join(_('Klipper Restart').split(' ')),'color1')
|
||||
restart.connect("clicked", self.restart_klippy)
|
||||
firmrestart = KlippyGtk.ButtonImage('restart','Firmware Restart','color2')
|
||||
firmrestart = self._gtk.ButtonImage('restart',"\n".join(_('Firmware Restart').split(' ')),'color2')
|
||||
firmrestart.connect("clicked", self.restart_klippy, "firmware")
|
||||
back = KlippyGtk.ButtonImage('back', 'Back')
|
||||
back.connect("clicked", self._screen._menu_go_back)
|
||||
|
||||
reboot = self._gtk.ButtonImage('reboot',_('System\nRestart'),'color3')
|
||||
reboot.connect("clicked", self._screen._confirm_send_action,
|
||||
_("Are you sure you wish to reboot the system?"), "machine.reboot")
|
||||
shutdown = self._gtk.ButtonImage('shutdown',_('System\nShutdown'),'color4')
|
||||
shutdown.connect("clicked", self._screen._confirm_send_action,
|
||||
_("Are you sure you wish to shutdown the system?"), "machine.shutdown")
|
||||
|
||||
info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
info.set_vexpand(True)
|
||||
|
||||
title = Gtk.Label("System Information")
|
||||
title.set_margin_bottom(5)
|
||||
title.set_margin_top(15)
|
||||
|
||||
self.labels['loadavg'] = Gtk.Label("temp")
|
||||
self.update_system_load()
|
||||
|
||||
self.system_timeout = GLib.timeout_add(1000, self.update_system_load)
|
||||
|
||||
title.get_style_context().add_class('temperature_entry')
|
||||
self.labels['loadavg'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['klipper_version'] = Gtk.Label(_("Klipper Version") +
|
||||
(": %s" % self._screen.printer.get_klipper_version()))
|
||||
self.labels['klipper_version'].set_margin_top(15)
|
||||
|
||||
self.labels['ks_version'] = Gtk.Label(_("KlipperScreen Version") + (": %s" % self._screen.version))
|
||||
self.labels['ks_version'].set_margin_top(15)
|
||||
|
||||
info.add(title)
|
||||
info.add(self.labels['loadavg'])
|
||||
info.add(self.labels['klipper_version'])
|
||||
info.add(self.labels['ks_version'])
|
||||
|
||||
|
||||
grid.attach(info, 0, 0, 4, 2)
|
||||
grid.attach(info, 0, 0, 5, 2)
|
||||
grid.attach(restart, 0, 2, 1, 1)
|
||||
grid.attach(firmrestart, 1, 2, 1, 1)
|
||||
grid.attach(back, 3, 2, 1, 1)
|
||||
grid.attach(reboot, 3, 2, 1, 1)
|
||||
grid.attach(shutdown, 4, 2, 1, 1)
|
||||
|
||||
self.panel = grid
|
||||
self.content.add(grid)
|
||||
|
||||
def update_system_load(self):
|
||||
_ = self.lang.gettext
|
||||
lavg = os.getloadavg()
|
||||
self.labels['loadavg'].set_text(
|
||||
"Load Average: %.2f %.2f %.2f" % (lavg[0], lavg[1], lavg[2])
|
||||
_("Load Average") + (": %.2f %.2f %.2f" % (lavg[0], lavg[1], lavg[2]))
|
||||
)
|
||||
|
||||
#TODO: Shouldn't need this
|
||||
self.system_timeout = GLib.timeout_add(1000, self.update_system_load)
|
||||
|
||||
def restart_klippy(self, type=None):
|
||||
def restart_klippy(self, widget, type=None):
|
||||
if type == "firmware":
|
||||
self._screen._ws.klippy.restart_firmware()
|
||||
else:
|
||||
|
||||
@@ -1,236 +1,245 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from KlippyGcodes import KlippyGcodes
|
||||
from panels.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.TemperaturePanel")
|
||||
|
||||
class TemperaturePanel(ScreenPanel):
|
||||
active_heater = "extruder"
|
||||
tempdeltas = ["1","5","10","25"]
|
||||
tempdelta = "10"
|
||||
|
||||
def initialize(self, panel_name):
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
eq_grid = KlippyGtk.HomogeneousGrid()
|
||||
i = 0
|
||||
for x in self._printer.get_tools():
|
||||
if i > 3:
|
||||
break
|
||||
elif i == 0:
|
||||
primary_tool = x
|
||||
self.labels[x] = KlippyGtk.ToggleButtonImage("extruder-"+str(i+1), KlippyGtk.formatTemperatureString(0, 0))
|
||||
self.labels[x].connect('clicked', self.select_heater, x)
|
||||
if i == 0:
|
||||
self.labels[x].set_active(True)
|
||||
eq_grid.attach(self.labels[x], i%2, i/2, 1, 1)
|
||||
i += 1
|
||||
|
||||
print ("Primary tool: " + primary_tool)
|
||||
self.labels[primary_tool].get_style_context().add_class('button_active')
|
||||
|
||||
self.labels["heater_bed"] = KlippyGtk.ToggleButtonImage("bed", KlippyGtk.formatTemperatureString(0, 0))
|
||||
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
|
||||
width = 2 if i > 1 else 1
|
||||
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
|
||||
|
||||
self.labels["control_grid"] = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
self.labels["increase"] = KlippyGtk.ButtonImage("increase", "Increase", "color1")
|
||||
self.labels["increase"].connect("clicked",self.change_target_temp, "+")
|
||||
self.labels["decrease"] = KlippyGtk.ButtonImage("decrease", "Decrease", "color3")
|
||||
self.labels["decrease"].connect("clicked",self.change_target_temp, "-")
|
||||
self.labels["npad"] = KlippyGtk.ButtonImage("settings", "Number Pad", "color2")
|
||||
self.labels["npad"].connect("clicked", self.show_numpad)
|
||||
|
||||
tempgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.tempdeltas:
|
||||
self.labels['deg'+ i] = KlippyGtk.ToggleButton(i)
|
||||
self.labels['deg'+ i].connect("clicked", self.change_temp_delta, i)
|
||||
ctx = self.labels['deg'+ i].get_style_context()
|
||||
if j == 0:
|
||||
ctx.add_class("tempbutton_top")
|
||||
elif j == len(self.tempdeltas)-1:
|
||||
ctx.add_class("tempbutton_bottom")
|
||||
else:
|
||||
ctx.add_class("tempbutton")
|
||||
if i == "10":
|
||||
ctx.add_class("distbutton_active")
|
||||
tempgrid.attach(self.labels['deg'+ i], 0, j, 1, 1)
|
||||
j += 1
|
||||
|
||||
self.labels["deg" + self.tempdelta].set_active(True)
|
||||
|
||||
self.labels["control_grid"].attach(tempgrid, 2, 0, 1, 2)
|
||||
self.labels["control_grid"].attach(self.labels["increase"], 3, 0, 1, 1)
|
||||
self.labels["control_grid"].attach(self.labels["decrease"], 3, 1, 1, 1)
|
||||
self.labels["control_grid"].attach(self.labels["npad"], 2, 2, 1, 1)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
self.labels["control_grid"].attach(b, 3, 2, 1, 1)
|
||||
|
||||
|
||||
grid.attach(eq_grid, 0, 0, 1, 1)
|
||||
grid.attach(self.labels["control_grid"], 1, 0, 1, 1)
|
||||
|
||||
self.panel = grid
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
self.update_temp("heater_bed",35,40)
|
||||
|
||||
def change_temp_delta(self, widget, tempdelta):
|
||||
if self.tempdelta == tempdelta:
|
||||
return
|
||||
logging.info("### tempdelta " + str(tempdelta))
|
||||
|
||||
ctx = self.labels["deg" + str(self.tempdelta)].get_style_context()
|
||||
ctx.remove_class("distbutton_active")
|
||||
|
||||
self.tempdelta = tempdelta
|
||||
ctx = self.labels["deg" + self.tempdelta].get_style_context()
|
||||
ctx.add_class("distbutton_active")
|
||||
for i in self.tempdeltas:
|
||||
if i == self.tempdeltas:
|
||||
continue
|
||||
self.labels["deg" + str(i)].set_active(False)
|
||||
|
||||
def show_numpad(self, widget):
|
||||
numpad = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
keys = [
|
||||
['1','numpad_tleft'],
|
||||
['2','numpad_top'],
|
||||
['3','numpad_tright'],
|
||||
['4','numpad_left'],
|
||||
['5','numpad_button'],
|
||||
['6','numpad_right'],
|
||||
['7','numpad_left'],
|
||||
['8','numpad_button'],
|
||||
['9','numpad_right'],
|
||||
['B','numpad_bleft'],
|
||||
['0','numpad_bottom'],
|
||||
['E','numpad_bright']
|
||||
]
|
||||
for i in range(len(keys)):
|
||||
id = 'button_' + str(keys[i][0])
|
||||
if keys[i][0] == "B":
|
||||
self.labels[id] = KlippyGtk.ButtonImage("backspace")
|
||||
elif keys[i][0] == "E":
|
||||
self.labels[id] = KlippyGtk.ButtonImage("complete", None, None, 40, 40)
|
||||
else:
|
||||
self.labels[id] = Gtk.Button(keys[i][0])
|
||||
self.labels[id].connect('clicked', self.update_entry, keys[i][0])
|
||||
ctx=self.labels[id].get_style_context()
|
||||
ctx.add_class(keys[i][1])
|
||||
numpad.attach(self.labels[id], i%3, i/3, 1, 1)
|
||||
|
||||
self.labels["keypad"] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=3)
|
||||
self.labels['entry'] = Gtk.Entry()
|
||||
self.labels['entry'].props.xalign = 0.5
|
||||
ctx = self.labels['entry'].get_style_context()
|
||||
ctx.add_class('temperature_entry')
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Close')
|
||||
b.connect("clicked", self.hide_numpad)
|
||||
|
||||
#numpad.attach(b, 0, 5, 3, 1)
|
||||
#numpad.attach(self.labels['entry'], 0, 0, 3, 1)
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
box.add(self.labels['entry'])
|
||||
box.add(numpad)
|
||||
box.add(b)
|
||||
|
||||
self.labels["keypad"] = numpad
|
||||
|
||||
self.panel.remove_column(1)
|
||||
#self.panel.attach(self.labels["keypad"], 1, 0, 1, 1)
|
||||
self.panel.attach(box, 1, 0, 1, 1)
|
||||
self.panel.show_all()
|
||||
|
||||
def hide_numpad(self, widget):
|
||||
self.panel.remove_column(1)
|
||||
self.panel.attach(self.labels["control_grid"], 1, 0, 1, 1)
|
||||
self.panel.show_all()
|
||||
|
||||
|
||||
def select_heater (self, widget, heater):
|
||||
if self.active_heater == heater:
|
||||
return
|
||||
|
||||
|
||||
self.labels[self.active_heater].get_style_context().remove_class('button_active')
|
||||
self.active_heater = heater
|
||||
self.labels[heater].get_style_context().add_class("button_active")
|
||||
|
||||
if "entry" in self.labels:
|
||||
self.labels['entry'].set_text("")
|
||||
logging.info("### Active heater " + self.active_heater)
|
||||
|
||||
def process_update(self, data):
|
||||
self.update_temp("heater_bed",
|
||||
self._printer.get_dev_stat("heater_bed","temperature"),
|
||||
self._printer.get_dev_stat("heater_bed","target")
|
||||
)
|
||||
for x in self._printer.get_tools():
|
||||
self.update_temp(x,
|
||||
self._printer.get_dev_stat(x,"temperature"),
|
||||
self._printer.get_dev_stat(x,"target")
|
||||
)
|
||||
return
|
||||
|
||||
def change_target_temp(self, widget, dir):
|
||||
target = self._printer.get_dev_stat(self.active_heater, "target")
|
||||
if dir == "+":
|
||||
target += int(self.tempdelta)
|
||||
if target > KlippyGcodes.MAX_EXT_TEMP:
|
||||
target = KlippyGcodes.MAX_EXT_TEMP
|
||||
else:
|
||||
target -= int(self.tempdelta)
|
||||
if target < 0:
|
||||
target = 0
|
||||
|
||||
self._printer.set_dev_stat(self.active_heater, "target", target)
|
||||
|
||||
if self.active_heater == "heater_bed":
|
||||
self._screen._ws.klippy.gcode_script( KlippyGcodes.set_bed_temp(
|
||||
target
|
||||
))
|
||||
else:
|
||||
self._screen._ws.klippy.gcode_script( KlippyGcodes.set_ext_temp(
|
||||
target,
|
||||
self._printer.get_tool_number(self.active_heater)
|
||||
))
|
||||
|
||||
def update_entry(self, widget, digit):
|
||||
text = self.labels['entry'].get_text()
|
||||
if digit == 'B':
|
||||
if len(text) < 1:
|
||||
return
|
||||
self.labels['entry'].set_text(text[0:-1])
|
||||
elif digit == 'E':
|
||||
if self.active_heater == "heater_bed":
|
||||
temp = int(text)
|
||||
temp = 0 if temp < 0 or temp > KlippyGcodes.MAX_BED_TEMP else temp
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.set_bed_temp(temp))
|
||||
else:
|
||||
temp = int(text)
|
||||
temp = 0 if temp < 0 or temp > KlippyGcodes.MAX_EXT_TEMP else temp
|
||||
self._screen._ws.klippy.gcode_script( KlippyGcodes.set_ext_temp(
|
||||
temp,
|
||||
self._printer.get_tool_number(self.active_heater)
|
||||
))
|
||||
self._printer.set_dev_stat(self.active_heater, "target", temp)
|
||||
self.labels['entry'].set_text("")
|
||||
else:
|
||||
if len(text) >= 3:
|
||||
return
|
||||
self.labels['entry'].set_text(text + digit)
|
||||
# -*- coding: utf-8 -*-
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.TemperaturePanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return TemperaturePanel(*args)
|
||||
|
||||
class TemperaturePanel(ScreenPanel):
|
||||
active_heater = "extruder"
|
||||
tempdeltas = ["1","5","10","25"]
|
||||
tempdelta = "10"
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
eq_grid = self._gtk.HomogeneousGrid()
|
||||
i = 0
|
||||
for x in self._printer.get_tools():
|
||||
if i > 3:
|
||||
break
|
||||
elif i == 0:
|
||||
primary_tool = x
|
||||
self.labels[x] = self._gtk.ToggleButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0))
|
||||
self.labels[x].connect('clicked', self.select_heater, x)
|
||||
if i == 0:
|
||||
self.labels[x].set_active(True)
|
||||
eq_grid.attach(self.labels[x], i%2, i/2, 1, 1)
|
||||
i += 1
|
||||
|
||||
print ("Primary tool: " + primary_tool)
|
||||
self.labels[primary_tool].get_style_context().add_class('button_active')
|
||||
|
||||
if self._printer.has_heated_bed():
|
||||
self.labels["heater_bed"] = self._gtk.ToggleButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
|
||||
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
|
||||
width = 2 if i > 1 else 1
|
||||
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
|
||||
|
||||
self.labels["control_grid"] = self._gtk.HomogeneousGrid()
|
||||
|
||||
self.labels["increase"] = self._gtk.ButtonImage("increase", _("Increase"), "color1")
|
||||
self.labels["increase"].connect("clicked",self.change_target_temp, "+")
|
||||
self.labels["decrease"] = self._gtk.ButtonImage("decrease", _("Decrease"), "color3")
|
||||
self.labels["decrease"].connect("clicked",self.change_target_temp, "-")
|
||||
self.labels["npad"] = self._gtk.ButtonImage("settings", _("Number Pad"), "color2")
|
||||
self.labels["npad"].connect("clicked", self.show_numpad)
|
||||
|
||||
tempgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.tempdeltas:
|
||||
self.labels['deg'+ i] = self._gtk.ToggleButton(i)
|
||||
self.labels['deg'+ i].connect("clicked", self.change_temp_delta, i)
|
||||
ctx = self.labels['deg'+ i].get_style_context()
|
||||
if j == 0:
|
||||
ctx.add_class("tempbutton_top")
|
||||
elif j == len(self.tempdeltas)-1:
|
||||
ctx.add_class("tempbutton_bottom")
|
||||
else:
|
||||
ctx.add_class("tempbutton")
|
||||
if i == "10":
|
||||
ctx.add_class("distbutton_active")
|
||||
tempgrid.attach(self.labels['deg'+ i], 0, j, 1, 1)
|
||||
j += 1
|
||||
|
||||
self.labels["deg" + self.tempdelta].set_active(True)
|
||||
|
||||
vbox = Gtk.VBox()
|
||||
vbox.pack_start(Gtk.Label("Temp °C"), False, False, 4)
|
||||
vbox.pack_end(tempgrid, True, True, 0)
|
||||
|
||||
self.labels["control_grid"].attach(vbox, 2, 0, 1, 3)
|
||||
self.labels["control_grid"].attach(self.labels["increase"], 3, 0, 1, 1)
|
||||
self.labels["control_grid"].attach(self.labels["decrease"], 3, 1, 1, 1)
|
||||
self.labels["control_grid"].attach(self.labels["npad"], 3, 2, 1, 1)
|
||||
|
||||
grid.attach(eq_grid, 0, 0, 1, 1)
|
||||
grid.attach(self.labels["control_grid"], 1, 0, 1, 1)
|
||||
|
||||
self.grid = grid
|
||||
self.content.add(grid)
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
self.update_temp("heater_bed",35,40)
|
||||
|
||||
def change_temp_delta(self, widget, tempdelta):
|
||||
if self.tempdelta == tempdelta:
|
||||
return
|
||||
logging.info("### tempdelta " + str(tempdelta))
|
||||
|
||||
ctx = self.labels["deg" + str(self.tempdelta)].get_style_context()
|
||||
ctx.remove_class("distbutton_active")
|
||||
|
||||
self.tempdelta = tempdelta
|
||||
ctx = self.labels["deg" + self.tempdelta].get_style_context()
|
||||
ctx.add_class("distbutton_active")
|
||||
for i in self.tempdeltas:
|
||||
if i == self.tempdeltas:
|
||||
continue
|
||||
self.labels["deg" + str(i)].set_active(False)
|
||||
|
||||
def show_numpad(self, widget):
|
||||
_ = self.lang.gettext
|
||||
|
||||
numpad = self._gtk.HomogeneousGrid()
|
||||
numpad.set_direction(Gtk.TextDirection.LTR)
|
||||
|
||||
keys = [
|
||||
['1','numpad_tleft'],
|
||||
['2','numpad_top'],
|
||||
['3','numpad_tright'],
|
||||
['4','numpad_left'],
|
||||
['5','numpad_button'],
|
||||
['6','numpad_right'],
|
||||
['7','numpad_left'],
|
||||
['8','numpad_button'],
|
||||
['9','numpad_right'],
|
||||
['B','numpad_bleft'],
|
||||
['0','numpad_bottom'],
|
||||
['E','numpad_bright']
|
||||
]
|
||||
for i in range(len(keys)):
|
||||
id = 'button_' + str(keys[i][0])
|
||||
if keys[i][0] == "B":
|
||||
self.labels[id] = Gtk.Button("B") #self._gtk.ButtonImage("backspace")
|
||||
elif keys[i][0] == "E":
|
||||
self.labels[id] = Gtk.Button("E") #self._gtk.ButtonImage("complete", None, None, .675, .675)
|
||||
else:
|
||||
self.labels[id] = Gtk.Button(keys[i][0])
|
||||
self.labels[id].connect('clicked', self.update_entry, keys[i][0])
|
||||
ctx=self.labels[id].get_style_context()
|
||||
ctx.add_class(keys[i][1])
|
||||
numpad.attach(self.labels[id], i%3, i/3, 1, 1)
|
||||
|
||||
self.labels["keypad"] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
self.labels['entry'] = Gtk.Entry()
|
||||
self.labels['entry'].props.xalign = 0.5
|
||||
ctx = self.labels['entry'].get_style_context()
|
||||
|
||||
b = self._gtk.ButtonImage('back', _('Close'))
|
||||
b.connect("clicked", self.hide_numpad)
|
||||
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
box.add(self.labels['entry'])
|
||||
box.add(numpad)
|
||||
box.add(b)
|
||||
|
||||
self.labels["keypad"] = numpad
|
||||
|
||||
self.grid.remove_column(1)
|
||||
self.grid.attach(box, 1, 0, 1, 1)
|
||||
self.grid.show_all()
|
||||
|
||||
def hide_numpad(self, widget):
|
||||
self.grid.remove_column(1)
|
||||
self.grid.attach(self.labels["control_grid"], 1, 0, 1, 1)
|
||||
self.grid.show_all()
|
||||
|
||||
|
||||
def select_heater (self, widget, heater):
|
||||
if self.active_heater == heater:
|
||||
return
|
||||
|
||||
|
||||
self.labels[self.active_heater].get_style_context().remove_class('button_active')
|
||||
self.active_heater = heater
|
||||
self.labels[heater].get_style_context().add_class("button_active")
|
||||
|
||||
if "entry" in self.labels:
|
||||
self.labels['entry'].set_text("")
|
||||
logging.info("### Active heater " + self.active_heater)
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action != "notify_status_update":
|
||||
return
|
||||
|
||||
if self._printer.has_heated_bed():
|
||||
self.update_temp("heater_bed",
|
||||
self._printer.get_dev_stat("heater_bed","temperature"),
|
||||
self._printer.get_dev_stat("heater_bed","target")
|
||||
)
|
||||
for x in self._printer.get_tools():
|
||||
self.update_temp(x,
|
||||
self._printer.get_dev_stat(x,"temperature"),
|
||||
self._printer.get_dev_stat(x,"target")
|
||||
)
|
||||
return
|
||||
|
||||
def change_target_temp(self, widget, dir):
|
||||
target = self._printer.get_dev_stat(self.active_heater, "target")
|
||||
if dir == "+":
|
||||
target += int(self.tempdelta)
|
||||
if target > KlippyGcodes.MAX_EXT_TEMP:
|
||||
target = KlippyGcodes.MAX_EXT_TEMP
|
||||
else:
|
||||
target -= int(self.tempdelta)
|
||||
if target < 0:
|
||||
target = 0
|
||||
|
||||
self._printer.set_dev_stat(self.active_heater, "target", target)
|
||||
|
||||
if self.active_heater == "heater_bed":
|
||||
self._screen._ws.klippy.gcode_script( KlippyGcodes.set_bed_temp(
|
||||
target
|
||||
))
|
||||
else:
|
||||
self._screen._ws.klippy.gcode_script( KlippyGcodes.set_ext_temp(
|
||||
target,
|
||||
self._printer.get_tool_number(self.active_heater)
|
||||
))
|
||||
|
||||
def update_entry(self, widget, digit):
|
||||
text = self.labels['entry'].get_text()
|
||||
if digit == 'B':
|
||||
if len(text) < 1:
|
||||
return
|
||||
self.labels['entry'].set_text(text[0:-1])
|
||||
elif digit == 'E':
|
||||
if self.active_heater == "heater_bed":
|
||||
temp = int(text)
|
||||
temp = 0 if temp < 0 or temp > KlippyGcodes.MAX_BED_TEMP else temp
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.set_bed_temp(temp))
|
||||
else:
|
||||
temp = int(text)
|
||||
temp = 0 if temp < 0 or temp > KlippyGcodes.MAX_EXT_TEMP else temp
|
||||
self._screen._ws.klippy.gcode_script( KlippyGcodes.set_ext_temp(
|
||||
temp,
|
||||
self._printer.get_tool_number(self.active_heater)
|
||||
))
|
||||
self._printer.set_dev_stat(self.active_heater, "target", temp)
|
||||
self.labels['entry'].set_text("")
|
||||
else:
|
||||
if len(text) >= 3:
|
||||
return
|
||||
self.labels['entry'].set_text(text + digit)
|
||||
@@ -3,47 +3,52 @@ import gi
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from KlippyGtk import KlippyGtk
|
||||
from KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
import logging
|
||||
logger = logging.getLogger("KlipperScreen.ZCalibratePanel")
|
||||
|
||||
class ZCalibratePanel:
|
||||
def create_panel(*args):
|
||||
return ZCalibratePanel(*args)
|
||||
|
||||
class ZCalibratePanel(ScreenPanel):
|
||||
_screen = None
|
||||
labels = {}
|
||||
distance = 1
|
||||
distances = ['.01','.05','.1','.5','1','5']
|
||||
|
||||
def __init__(self, screen):
|
||||
self._screen = screen
|
||||
def __init__(self, screen, title, back=True):
|
||||
super().__init__(screen, title, False)
|
||||
|
||||
def initialize(self, panel_name):
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
_ = self.lang.gettext
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
label = Gtk.Label("Z Offset: ")
|
||||
label.get_style_context().add_class('temperature_entry')
|
||||
self.labels['zpos'] = Gtk.Label("Homing")
|
||||
self.labels['zpos'].get_style_context().add_class('temperature_entry')
|
||||
box = Gtk.Box()
|
||||
label = Gtk.Label(_("Z Offset") + ": \n")
|
||||
self.labels['zposition'] = Gtk.Label(_("Homing"))
|
||||
box = Gtk.VBox()
|
||||
box.set_vexpand(False)
|
||||
box.set_valign(Gtk.Align.CENTER)
|
||||
|
||||
box.add(label)
|
||||
box.add(self.labels['zpos'])
|
||||
box.add(self.labels['zposition'])
|
||||
|
||||
zpos = KlippyGtk.ButtonImage('z-offset-decrease',"Raise Nozzle")
|
||||
zpos = self._gtk.ButtonImage('z-offset-decrease',_("Raise Nozzle"))
|
||||
zpos.connect("clicked", self.move, "+")
|
||||
zneg = KlippyGtk.ButtonImage('z-offset-increase',"Lower Nozzle")
|
||||
zneg = self._gtk.ButtonImage('z-offset-increase',_("Lower Nozzle"))
|
||||
zneg.connect("clicked", self.move, "-")
|
||||
|
||||
distgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.distances:
|
||||
self.labels[i] = KlippyGtk.ToggleButton(i)
|
||||
self.labels[i] = self._gtk.ToggleButton(i)
|
||||
self.labels[i].set_direction(Gtk.TextDirection.LTR)
|
||||
self.labels[i].connect("clicked", self.change_distance, i)
|
||||
ctx = self.labels[i].get_style_context()
|
||||
if j == 0:
|
||||
if (self._screen.lang_ltr and j == 0) or (not self._screen.lang_ltr and j == len(self.distances)-1):
|
||||
ctx.add_class("distbutton_top")
|
||||
elif j == len(self.distances)-1:
|
||||
elif (not self._screen.lang_ltr and j == 0) or (self._screen.lang_ltr and j == len(self.distances)-1):
|
||||
ctx.add_class("distbutton_bottom")
|
||||
else:
|
||||
ctx.add_class("distbutton")
|
||||
@@ -54,45 +59,49 @@ class ZCalibratePanel:
|
||||
|
||||
self.labels["1"].set_active(True)
|
||||
|
||||
space_grid = KlippyGtk.HomogeneousGrid()
|
||||
space_grid.attach(Gtk.Label("Distance (mm):"),0,0,1,1)
|
||||
space_grid = self._gtk.HomogeneousGrid()
|
||||
space_grid.set_row_homogeneous(False)
|
||||
space_grid.attach(Gtk.Label(_("Distance (mm)") + ":"),0,0,1,1)
|
||||
space_grid.attach(distgrid,0,1,1,1)
|
||||
space_grid.attach(Gtk.Label(" "),0,2,1,1)
|
||||
|
||||
complete = KlippyGtk.ButtonImage('complete','Accept','color2')
|
||||
complete = self._gtk.ButtonImage('complete',_('Accept'),'color2')
|
||||
complete.connect("clicked", self.accept)
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Abort')
|
||||
b = self._gtk.ButtonImage('back', _('Abort'))
|
||||
b.connect("clicked", self.abort)
|
||||
|
||||
|
||||
grid.attach(zpos, 1, 0, 1, 1)
|
||||
grid.attach(box, 0, 1, 2, 1)
|
||||
grid.attach(zneg, 1, 1, 1, 1)
|
||||
grid.attach(complete, 3, 1, 1, 1)
|
||||
#grid.set_row_homogeneous(False)
|
||||
grid.attach(zpos, 0, 0, 1, 1)
|
||||
grid.attach(box, 1, 0, 2, 2)
|
||||
grid.attach(zneg, 0, 1, 1, 1)
|
||||
grid.attach(complete, 3, 0, 1, 1)
|
||||
grid.attach(space_grid, 0, 2, 3, 1)
|
||||
grid.attach(b, 3, 2, 1, 1)
|
||||
|
||||
|
||||
self.grid = grid
|
||||
self.content.add(grid)
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def activate(self):
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
|
||||
if self._screen.printer.get_stat("toolhead","homed_axes") != "xyz":
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.PROBE_CALIBRATE)
|
||||
|
||||
def process_update(self, data):
|
||||
def process_update(self, action, data):
|
||||
if action != "notify_status_update":
|
||||
return
|
||||
|
||||
if "toolhead" in data and "position" in data['toolhead']:
|
||||
self.updatePosition(data['toolhead']['position'])
|
||||
|
||||
def updatePosition(self, position):
|
||||
self.labels['zpos'].set_text(str(round(position[2],2)))
|
||||
self.labels['zposition'].set_text(str(round(position[2],2)))
|
||||
|
||||
def change_distance(self, widget, distance):
|
||||
if self.distance == distance:
|
||||
return
|
||||
print("### Distance " + str(distance))
|
||||
|
||||
ctx = self.labels[str(self.distance)].get_style_context()
|
||||
ctx.remove_class("distbutton_active")
|
||||
@@ -113,9 +122,9 @@ class ZCalibratePanel:
|
||||
def abort(self, widget):
|
||||
logger.info("Aborting Z calibrate")
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.PROBE_ABORT)
|
||||
self._screen._menu_go_back(widget)
|
||||
self.menu_return(widget)
|
||||
|
||||
def accept(self, widget):
|
||||
logger.info("Accepting Z calibrate")
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.PROBE_ACCEPT)
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.SAVE_CONFIG)
|
||||
self.menu_return(widget)
|
||||
@@ -1,105 +0,0 @@
|
||||
import logging
|
||||
|
||||
class Printer:
|
||||
|
||||
def __init__(self, data):
|
||||
self.config = data['configfile']['config']
|
||||
|
||||
logging.info("### Reading printer config")
|
||||
self.toolcount = 0
|
||||
self.extrudercount = 0
|
||||
self.tools = []
|
||||
self.devices = {}
|
||||
self.state = data['print_stats']['state']
|
||||
self.data = data
|
||||
|
||||
for x in self.config.keys():
|
||||
if x.startswith('extruder'):
|
||||
if x.startswith('extruder_stepper'):
|
||||
continue
|
||||
|
||||
self.devices[x] = {
|
||||
"temperature": 0,
|
||||
"target": 0
|
||||
}
|
||||
self.tools.append(x)
|
||||
if "shared_heater" in self.config[x]:
|
||||
self.toolcount += 1
|
||||
continue
|
||||
self.extrudercount += 1
|
||||
if x.startswith('heater_bed'):
|
||||
self.devices[x] = {
|
||||
"temperature": 0,
|
||||
"target": 0
|
||||
}
|
||||
|
||||
logging.info("### Toolcount: " + str(self.toolcount) + " Heaters: " + str(self.extrudercount))
|
||||
|
||||
def process_update(self, data):
|
||||
keys = ['virtual_sdcard','pause_resume','idle_timeout','print_stats']
|
||||
keys = ['fan','gcode_move','idle_timeout','pause_resume','print_stats','toolhead','virtual_sdcard']
|
||||
for x in keys:
|
||||
if x in data:
|
||||
for y in data[x]:
|
||||
self.data[x][y] = data[x][y]
|
||||
|
||||
if "heater_bed" in data:
|
||||
d = data["heater_bed"]
|
||||
if "target" in d:
|
||||
self.set_dev_stat("heater_bed", "target", d["target"])
|
||||
if "temperature" in d:
|
||||
self.set_dev_stat("heater_bed", "temperature", d["temperature"])
|
||||
for x in self.get_tools():
|
||||
if x in data:
|
||||
d = data[x]
|
||||
if "target" in d:
|
||||
self.set_dev_stat(x, "target", d["target"])
|
||||
if "temperature" in d:
|
||||
self.set_dev_stat(x, "temperature", d["temperature"])
|
||||
|
||||
def get_config_section_list(self):
|
||||
return list(self.config)
|
||||
|
||||
def get_config_section(self, section):
|
||||
if section not in self.config:
|
||||
return False
|
||||
return self.config[section]
|
||||
|
||||
def get_data(self):
|
||||
return self.data
|
||||
|
||||
def get_stat(self, stat, substat = None):
|
||||
if substat != None:
|
||||
return self.data[stat][substat]
|
||||
return self.data[stat]
|
||||
|
||||
def set_dev_temps(self, dev, temp, target=None):
|
||||
if dev in self.devices:
|
||||
self.devices[dev]['temperature'] = temp
|
||||
if target != None:
|
||||
self.devices[dev]['target'] = target
|
||||
|
||||
def get_dev_stats(self, dev):
|
||||
if dev in self.devices:
|
||||
return self.devices[dev]
|
||||
return None
|
||||
|
||||
def get_dev_stat(self, dev, stat):
|
||||
if dev in self.devices and stat in self.devices[dev]:
|
||||
return self.devices[dev][stat]
|
||||
return None
|
||||
|
||||
def get_extruder_count(self):
|
||||
return self.extrudercount
|
||||
|
||||
def get_tools(self):
|
||||
return self.tools
|
||||
|
||||
def get_tool_number(self, tool):
|
||||
return self.tools.index(tool)
|
||||
|
||||
def set_dev_stat(self, dev, stat, value):
|
||||
if dev not in self.devices:
|
||||
return
|
||||
|
||||
self.devices[dev][stat] = value
|
||||
@@ -1,45 +1,56 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import argparse
|
||||
import gi
|
||||
import gettext
|
||||
import time
|
||||
import threading
|
||||
|
||||
import json
|
||||
import requests
|
||||
import websocket
|
||||
import importlib
|
||||
import logging
|
||||
import os
|
||||
import asyncio
|
||||
import re
|
||||
import signal
|
||||
import subprocess
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
from jinja2 import Environment, Template
|
||||
|
||||
from KlippyWebsocket import KlippyWebsocket
|
||||
from KlippyRest import KlippyRest
|
||||
from files import KlippyFiles
|
||||
from KlippyGtk import KlippyGtk
|
||||
from printer import Printer
|
||||
from ks_includes.KlippyWebsocket import KlippyWebsocket
|
||||
from ks_includes.KlippyRest import KlippyRest
|
||||
from ks_includes.files import KlippyFiles
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.printer import Printer
|
||||
from ks_includes.wifi import WifiManager
|
||||
|
||||
# Do this better in the future
|
||||
from panels.screen_panel import *
|
||||
from panels.bed_level import *
|
||||
from panels.extrude import *
|
||||
from panels.fan import *
|
||||
from panels.fine_tune import *
|
||||
from panels.job_status import *
|
||||
from panels.main_menu import *
|
||||
from panels.menu import *
|
||||
from panels.move import *
|
||||
from panels.network import *
|
||||
from panels.preheat import *
|
||||
from panels.print import *
|
||||
from panels.splash_screen import *
|
||||
from panels.system import *
|
||||
from panels.temperature import *
|
||||
from panels.zcalibrate import *
|
||||
from ks_includes.config import KlipperScreenConfig
|
||||
|
||||
PRINTER_BASE_STATUS_OBJECTS = [
|
||||
'bed_mesh',
|
||||
'idle_timeout',
|
||||
'configfile',
|
||||
'gcode_move',
|
||||
'fan',
|
||||
'toolhead',
|
||||
'virtual_sdcard',
|
||||
'print_stats',
|
||||
'heater_bed',
|
||||
'extruder',
|
||||
'pause_resume',
|
||||
'webhooks'
|
||||
]
|
||||
|
||||
# Create logging
|
||||
for h in logging.getLogger().handlers:
|
||||
logging.getLogger().removeHandler(h)
|
||||
|
||||
logger = logging.getLogger('KlipperScreen')
|
||||
logger.setLevel(logging.DEBUG)
|
||||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
|
||||
@@ -48,35 +59,109 @@ fh = logging.FileHandler('/tmp/KlipperScreen.log')
|
||||
fh.setLevel(logging.DEBUG)
|
||||
fh.setFormatter(formatter)
|
||||
|
||||
ch = logging.StreamHandler()
|
||||
ch.setLevel(logging.ERROR)
|
||||
ch = logging.StreamHandler(sys.stdout)
|
||||
ch.setLevel(logging.DEBUG)
|
||||
ch.setFormatter(formatter)
|
||||
|
||||
logger.addHandler(fh)
|
||||
logger.addHandler(ch)
|
||||
|
||||
def logging_exception_handler(type, value, tb):
|
||||
logger.exception("Uncaught exception %s: %s\nTraceback: %s" % (type, value, "\n".join(traceback.format_tb(tb))))
|
||||
sys.excepthook = logging_exception_handler
|
||||
|
||||
klipperscreendir = os.getcwd()
|
||||
config = klipperscreendir + "/KlipperScreen.config"
|
||||
logger.info("Config file: " + config)
|
||||
|
||||
class KlipperScreen(Gtk.Window):
|
||||
""" Class for creating a screen for Klipper via HDMI """
|
||||
currentPanel = None
|
||||
bed_temp_label = None
|
||||
number_tools = 1
|
||||
|
||||
panels = {}
|
||||
_cur_panels = []
|
||||
bed_temp_label = None
|
||||
connected_printer = None
|
||||
currentPanel = None
|
||||
files = None
|
||||
filename = ""
|
||||
subscriptions = []
|
||||
keyboard = None
|
||||
keyboard_height = 200
|
||||
last_update = {}
|
||||
shutdown = True
|
||||
load_panel = {}
|
||||
number_tools = 1
|
||||
panels = {}
|
||||
popup_message = None
|
||||
printer = None
|
||||
rtl_languages = ['he_il']
|
||||
subscriptions = []
|
||||
shutdown = True
|
||||
_ws = None
|
||||
|
||||
def __init__(self):
|
||||
self.read_config()
|
||||
self.version = get_software_version()
|
||||
logger.info("KlipperScreen version: %s" % self.version)
|
||||
|
||||
parser = argparse.ArgumentParser(description="KlipperScreen - A GUI for Klipper")
|
||||
parser.add_argument(
|
||||
"-c","--configfile", default="~/KlipperScreen.conf", metavar='<configfile>',
|
||||
help="Location of KlipperScreen configuration file"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
configfile = os.path.normpath(os.path.expanduser(args.configfile))
|
||||
|
||||
self.lang = gettext.translation('KlipperScreen', localedir='ks_includes/locales', fallback=True)
|
||||
self._config = KlipperScreenConfig(configfile, self.lang, self)
|
||||
|
||||
self.wifi = WifiManager()
|
||||
self.wifi.start()
|
||||
|
||||
logger.debug("OS Language: %s" % os.getenv('LANG'))
|
||||
|
||||
self.lang_ltr = True
|
||||
for lang in self.rtl_languages:
|
||||
if os.getenv('LANG').lower().startswith(lang):
|
||||
self.lang_ltr = False
|
||||
Gtk.Widget.set_default_direction(Gtk.TextDirection.RTL)
|
||||
logger.debug("Enabling RTL mode")
|
||||
break
|
||||
|
||||
_ = self.lang.gettext
|
||||
|
||||
Gtk.Window.__init__(self)
|
||||
self.width = self._config.get_main_config().getint("width", Gdk.Screen.get_width(Gdk.Screen.get_default()))
|
||||
self.height = self._config.get_main_config().getint("height", Gdk.Screen.get_height(Gdk.Screen.get_default()))
|
||||
self.set_default_size(self.width, self.height)
|
||||
self.set_resizable(False)
|
||||
logger.info("Screen resolution: %sx%s" % (self.width, self.height))
|
||||
|
||||
self.gtk = KlippyGtk(self.width, self.height)
|
||||
self.init_style()
|
||||
|
||||
self.printer_initializing(_("Initializing"))
|
||||
|
||||
# Disable DPMS
|
||||
os.system("/usr/bin/xset -display :0 -dpms")
|
||||
self.set_screenblanking_timeout(self._config.get_main_config_option('screen_blanking'))
|
||||
|
||||
# Change cursor to blank
|
||||
#self.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR))
|
||||
pname = list(self._config.get_printers()[0])[0]
|
||||
self.connect_printer(pname, self._config.get_printers()[0][pname])
|
||||
|
||||
def connect_printer(self, name, data):
|
||||
_ = self.lang.gettext
|
||||
|
||||
if self.connected_printer == name:
|
||||
return
|
||||
|
||||
if self.files is not None:
|
||||
self.files.stop()
|
||||
|
||||
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_api_key", False))
|
||||
|
||||
self.printer = Printer({
|
||||
"software_version": "Unknown"
|
||||
}, {
|
||||
'configfile': {
|
||||
'config': {}
|
||||
},
|
||||
@@ -88,164 +173,208 @@ class KlipperScreen(Gtk.Window):
|
||||
}
|
||||
})
|
||||
|
||||
self.apiclient = KlippyRest("127.0.0.1",7125)
|
||||
Gtk.Window.__init__(self)
|
||||
self._remove_all_panels()
|
||||
panels = list(self.panels)
|
||||
for panel in panels:
|
||||
del self.panels[panel]
|
||||
self.printer_initializing(_("Connecting to %s") % name)
|
||||
|
||||
self.set_default_size(Gdk.Screen.get_width(Gdk.Screen.get_default()), Gdk.Screen.get_height(Gdk.Screen.get_default()))
|
||||
self.set_resizable(False)
|
||||
logger.info("Screen resolution: %s", str(Gdk.Screen.get_width(Gdk.Screen.get_default()))+"x"+str(Gdk.Screen.get_height(Gdk.Screen.get_default())))
|
||||
self.printer.set_callbacks({
|
||||
"disconnected": self.state_disconnected,
|
||||
"error": self.state_error,
|
||||
"printing": self.state_printing,
|
||||
"ready": self.state_ready,
|
||||
"startup": self.state_startup,
|
||||
"shutdown": self.state_shutdown
|
||||
})
|
||||
|
||||
self.printer_initializing("Connecting to Moonraker")
|
||||
powerdevs = self.apiclient.send_request("machine/device_power/devices")
|
||||
logger.debug("Found power devices: %s" % powerdevs)
|
||||
if powerdevs != False:
|
||||
self.printer.configure_power_devices(powerdevs['result'])
|
||||
self.panels['splash_screen'].show_restart_buttons()
|
||||
|
||||
# Disable DPMS
|
||||
os.system("/usr/bin/xset -display :0 s off")
|
||||
os.system("/usr/bin/xset -display :0 -dpms")
|
||||
os.system("/usr/bin/xset -display :0 s noblank")
|
||||
if self._ws is not None:
|
||||
self._ws.close
|
||||
|
||||
ready = False
|
||||
|
||||
try:
|
||||
info = self.apiclient.get_info()
|
||||
except Exception:
|
||||
return
|
||||
|
||||
if info == False:
|
||||
return
|
||||
|
||||
if not hasattr(self, "_ws"):
|
||||
self.create_websocket()
|
||||
|
||||
print(info)
|
||||
if info['result']['klippy_state'] == "disconnected":
|
||||
self.printer_initializing("Klipper is not connected to moonraker")
|
||||
return
|
||||
if info['result']['klippy_state'] == "error":
|
||||
logger.warning("Printer is emergency stopped")
|
||||
self.printer_initializing("Shutdown due to Emergency Stop")
|
||||
return
|
||||
|
||||
status_objects = [
|
||||
'idle_timeout',
|
||||
'configfile',
|
||||
'gcode_move',
|
||||
'fan',
|
||||
'toolhead',
|
||||
'virtual_sdcard',
|
||||
'print_stats',
|
||||
'heater_bed',
|
||||
'extruder',
|
||||
'pause_resume'
|
||||
]
|
||||
r = requests.get("http://127.0.0.1:7125/printer/objects/query?" + "&".join(status_objects))
|
||||
|
||||
#TODO: Check that we get good data
|
||||
#print (r.content)
|
||||
try:
|
||||
data = json.loads(r.content)
|
||||
except:
|
||||
logger.info("Not able to load data. Klippy is most likely offline")
|
||||
return
|
||||
data = data['result']['status']
|
||||
for x in data:
|
||||
self.last_update[x] = data[x]
|
||||
|
||||
self.printer_config = data['configfile']['config']
|
||||
#logger.debug("Printer config: %s" % json.dumps(self.printer_config, indent=2))
|
||||
self.printer.__init__(data)
|
||||
|
||||
# Initialize target values. TODO: methodize this
|
||||
self.printer.set_dev_stat("heater_bed", "target", data['heater_bed']['target'])
|
||||
self.printer.set_dev_stat("extruder", "target", data['extruder']['target'])
|
||||
|
||||
print (info)
|
||||
if (data['print_stats']['state'] == "printing" or data['print_stats']['state'] == "paused"):
|
||||
self.printer_printing()
|
||||
elif info['result']['klippy_state'] == "ready":
|
||||
self.printer_ready()
|
||||
self._ws = KlippyWebsocket(self,
|
||||
{
|
||||
"on_connect": self.init_printer,
|
||||
"on_message": self._websocket_callback,
|
||||
"on_close": self.printer_initializing
|
||||
},
|
||||
self._config.get_main_config_option("moonraker_host"),
|
||||
self._config.get_main_config_option("moonraker_port")
|
||||
)
|
||||
self._ws.initial_connect()
|
||||
|
||||
self.files = KlippyFiles(self)
|
||||
self.files.start()
|
||||
|
||||
self.connected_printer = name
|
||||
logger.debug("Connected to printer: %s" % name)
|
||||
|
||||
def ws_subscribe(self):
|
||||
requested_updates = {
|
||||
"objects": {
|
||||
"bed_mesh": ["profile_name","mesh_max","mesh_min","probed_matrix"],
|
||||
"configfile": ["config"],
|
||||
"extruder": ["target","temperature","pressure_advance","smooth_time"],
|
||||
"fan": ["speed"],
|
||||
"gcode_move": ["homing_origin","extrude_factor","speed_factor"],
|
||||
"gcode_move": ["extrude_factor","gcode_position","homing_origin","speed_factor"],
|
||||
"heater_bed": ["target","temperature"],
|
||||
"idle_timeout": ["state"],
|
||||
"pause_resume": ["is_paused"],
|
||||
"print_stats": ["print_duration","total_duration","filament_used","filename","state","message"],
|
||||
"toolhead": ["homed_axes","estimated_print_time","print_time","position","extruder"],
|
||||
"virtual_sdcard": ["file_position","is_active","progress"]
|
||||
"virtual_sdcard": ["file_position","is_active","progress"],
|
||||
"webhooks": ["state","state_message"]
|
||||
}
|
||||
}
|
||||
for extruder in self.printer.get_tools():
|
||||
requested_updates['objects'][extruder] = ["target","temperature","pressure_advance","smooth_time"]
|
||||
|
||||
self._ws.klippy.object_subscription(requested_updates)
|
||||
|
||||
def show_panel(self, panel_name, type, remove=None, pop=True, **kwargs):
|
||||
if remove == 2:
|
||||
self._remove_all_panels()
|
||||
elif remove == 1:
|
||||
self._remove_current_panel(pop)
|
||||
def _load_panel(self, panel, *args):
|
||||
if not panel in self.load_panel:
|
||||
logger.debug("Loading panel: %s" % panel)
|
||||
panel_path = os.path.join(os.path.dirname(__file__), 'panels', "%s.py" % panel)
|
||||
logger.info("Panel path: %s" % panel_path)
|
||||
if not os.path.exists(panel_path):
|
||||
msg = f"Panel {panel} does not exist"
|
||||
logger.info(msg)
|
||||
raise Exception(msg)
|
||||
|
||||
module = importlib.import_module("panels.%s" % panel)
|
||||
if not hasattr(module, "create_panel"):
|
||||
msg = f"Cannot locate create_panel function for {panel}"
|
||||
logger.info(msg)
|
||||
raise Exception(msg)
|
||||
self.load_panel[panel] = getattr(module, "create_panel")
|
||||
|
||||
try:
|
||||
return self.load_panel[panel](*args)
|
||||
except Exception:
|
||||
msg = f"Unable to create panel {panel}"
|
||||
logger.exception(msg)
|
||||
raise Exception(msg)
|
||||
|
||||
def show_panel(self, panel_name, type, title, remove=None, pop=True, **kwargs):
|
||||
if panel_name not in self.panels:
|
||||
if type == "SplashScreenPanel":
|
||||
self.panels[panel_name] = SplashScreenPanel(self)
|
||||
elif type == "MainPanel":
|
||||
self.panels[panel_name] = MainPanel(self)
|
||||
elif type == "menu":
|
||||
self.panels[panel_name] = MenuPanel(self)
|
||||
elif type == "bed_level":
|
||||
self.panels[panel_name] = BedLevelPanel(self)
|
||||
elif type == "extrude":
|
||||
self.panels[panel_name] = ExtrudePanel(self)
|
||||
elif type == "finetune":
|
||||
self.panels[panel_name] = FineTune(self)
|
||||
elif type == "JobStatusPanel":
|
||||
self.panels[panel_name] = JobStatusPanel(self)
|
||||
elif type == "move":
|
||||
self.panels[panel_name] = MovePanel(self)
|
||||
elif type == "network":
|
||||
self.panels[panel_name] = NetworkPanel(self)
|
||||
elif type == "preheat":
|
||||
self.panels[panel_name] = PreheatPanel(self)
|
||||
elif type == "print":
|
||||
self.panels[panel_name] = PrintPanel(self)
|
||||
elif type == "temperature":
|
||||
self.panels[panel_name] = TemperaturePanel(self)
|
||||
elif type == "fan":
|
||||
self.panels[panel_name] = FanPanel(self)
|
||||
elif type == "system":
|
||||
self.panels[panel_name] = SystemPanel(self)
|
||||
elif type == "zcalibrate":
|
||||
self.panels[panel_name] = ZCalibratePanel(self)
|
||||
#Temporary for development
|
||||
else:
|
||||
self.panels[panel_name] = MovePanel(self)
|
||||
self.panels[panel_name] = self._load_panel(type, self, title)
|
||||
|
||||
if kwargs != {}:
|
||||
self.panels[panel_name].initialize(panel_name, **kwargs)
|
||||
else:
|
||||
self.panels[panel_name].initialize(panel_name)
|
||||
try:
|
||||
if kwargs != {}:
|
||||
self.panels[panel_name].initialize(panel_name, **kwargs)
|
||||
else:
|
||||
self.panels[panel_name].initialize(panel_name)
|
||||
except:
|
||||
del self.panels[panel_name]
|
||||
logger.exception("Unable to load panel %s" % type)
|
||||
self.show_error_modal("Unable to load panel %s" % type)
|
||||
return
|
||||
|
||||
if hasattr(self.panels[panel_name],"process_update"):
|
||||
self.panels[panel_name].process_update(self.printer.get_data())
|
||||
self.panels[panel_name].process_update("notify_status_update", self.printer.get_data())
|
||||
|
||||
if hasattr(self.panels[panel_name],"activate"):
|
||||
self.panels[panel_name].activate()
|
||||
try:
|
||||
if remove == 2:
|
||||
self._remove_all_panels()
|
||||
elif remove == 1:
|
||||
self._remove_current_panel(pop)
|
||||
|
||||
logger.debug("Attaching panel %s" % panel_name)
|
||||
|
||||
self.add(self.panels[panel_name].get())
|
||||
self.show_all()
|
||||
|
||||
if hasattr(self.panels[panel_name],"activate"):
|
||||
self.panels[panel_name].activate()
|
||||
self.show_all()
|
||||
except:
|
||||
logger.exception("Error attaching panel")
|
||||
|
||||
self.add(self.panels[panel_name].get())
|
||||
self.show_all()
|
||||
self._cur_panels.append(panel_name)
|
||||
logger.debug("Current panel hierarchy: %s", str(self._cur_panels))
|
||||
|
||||
def show_popup_message(self, message):
|
||||
if self.popup_message != None:
|
||||
self.close_popup_message()
|
||||
|
||||
def read_config (self):
|
||||
with open(config) as config_file:
|
||||
self._config = json.load(config_file)
|
||||
box = Gtk.Box()
|
||||
box.get_style_context().add_class("message_popup")
|
||||
box.set_size_request(self.width, self.gtk.get_header_size())
|
||||
label = Gtk.Label()
|
||||
if "must home axis first" in message.lower():
|
||||
message = "Must home all axis first."
|
||||
label.set_text(message)
|
||||
|
||||
close = Gtk.Button.new_with_label("X")
|
||||
close.set_can_focus(False)
|
||||
close.props.relief = Gtk.ReliefStyle.NONE
|
||||
close.connect("clicked", self.close_popup_message)
|
||||
|
||||
box.pack_start(label, True, True, 0)
|
||||
box.pack_end(close, False, False, 0)
|
||||
box.set_halign(Gtk.Align.CENTER)
|
||||
|
||||
cur_panel = self.panels[self._cur_panels[-1]]
|
||||
for i in ['back','estop','home']:
|
||||
if i in cur_panel.control:
|
||||
cur_panel.control[i].set_sensitive(False)
|
||||
cur_panel.get().put(box, 0,0)
|
||||
|
||||
self.show_all()
|
||||
self.popup_message = box
|
||||
|
||||
GLib.timeout_add(10000, self.close_popup_message)
|
||||
|
||||
return False
|
||||
|
||||
def close_popup_message(self, widget=None):
|
||||
if self.popup_message == None:
|
||||
return
|
||||
|
||||
cur_panel = self.panels[self._cur_panels[-1]]
|
||||
for i in ['back','estop','home']:
|
||||
if i in cur_panel.control:
|
||||
cur_panel.control[i].set_sensitive(True)
|
||||
cur_panel.get().remove(self.popup_message)
|
||||
self.popup_message = None
|
||||
self.show_all()
|
||||
|
||||
def show_error_modal(self, err):
|
||||
_ = self.lang.gettext
|
||||
logger.exception("Showing error modal: %s", err)
|
||||
|
||||
buttons = [
|
||||
{"name":_("Go Back"),"response": Gtk.ResponseType.CANCEL}
|
||||
]
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_markup(("%s \n\n" % err) +
|
||||
_("Check /tmp/KlipperScreen.log for more information.\nPlease submit an issue on GitHub for help."))
|
||||
label.set_hexpand(True)
|
||||
label.set_halign(Gtk.Align.CENTER)
|
||||
label.set_line_wrap(True)
|
||||
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
dialog = self.gtk.Dialog(self, buttons, label, self.error_modal_response)
|
||||
|
||||
def error_modal_response(self, widget, response_id):
|
||||
widget.destroy()
|
||||
|
||||
def init_style(self):
|
||||
style_provider = Gtk.CssProvider()
|
||||
style_provider.load_from_path(klipperscreendir + "/style.css")
|
||||
#style_provider.load_from_path(klipperscreendir + "/style.css")
|
||||
|
||||
css = open(klipperscreendir + "/styles/style.css")
|
||||
css_data = css.read()
|
||||
css.close()
|
||||
css_data = css_data.replace("KS_FONT_SIZE",str(self.gtk.get_font_size()))
|
||||
|
||||
style_provider = Gtk.CssProvider()
|
||||
style_provider.load_from_data(css_data.encode())
|
||||
|
||||
Gtk.StyleContext.add_provider_for_screen(
|
||||
Gdk.Screen.get_default(),
|
||||
@@ -253,11 +382,8 @@ class KlipperScreen(Gtk.Window):
|
||||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
|
||||
)
|
||||
|
||||
def create_websocket(self):
|
||||
self._ws = KlippyWebsocket(self, self._websocket_callback)
|
||||
self._ws.connect()
|
||||
self._curr = 0
|
||||
|
||||
def is_printing(self):
|
||||
return "job_status" in self._cur_panels
|
||||
|
||||
def _go_to_submenu(self, widget, name):
|
||||
logger.info("#### Go to submenu " + str(name))
|
||||
@@ -265,60 +391,48 @@ class KlipperScreen(Gtk.Window):
|
||||
|
||||
# Find current menu item
|
||||
panels = list(self._cur_panels)
|
||||
if "job_status" not in self._cur_panels:
|
||||
cur_item = self._find_current_menu_item(name, self._config['mainmenu'], panels.pop(0))
|
||||
menu = cur_item['items']
|
||||
if "main_panel" in self._cur_panels:
|
||||
menu = "__main"
|
||||
elif "splash_screen" in self._cur_panels:
|
||||
menu = "__splashscreen"
|
||||
else:
|
||||
menu = self._config['printmenu']
|
||||
menu = "__print"
|
||||
|
||||
logger.info("#### Menu " + str(menu))
|
||||
#self.show_panel("_".join(self._cur_panels) + '_' + name, "menu", 1, False, menu=menu)
|
||||
disname = self._config.get_menu_name(menu, name)
|
||||
menuitems = self._config.get_menu_items(menu, name)
|
||||
if len(menuitems) == 0:
|
||||
logger.info("No items in menu, returning.")
|
||||
return
|
||||
|
||||
self.show_panel(self._cur_panels[-1] + '_' + name, "menu", 1, False, items=menu)
|
||||
return
|
||||
|
||||
grid = self.arrangeMenuItems(menu, 4)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b.connect("clicked", self._menu_go_back)
|
||||
grid.attach(b, 4, 2, 1, 1)
|
||||
|
||||
self._cur_panels.append(cur_item['name']) #str(cur_item['name']))
|
||||
self.panels[cur_item['name']] = grid
|
||||
self.add(self.panels[cur_item['name']])
|
||||
self.show_all()
|
||||
|
||||
|
||||
|
||||
def _find_current_menu_item(self, menu, items, names):
|
||||
for item in items:
|
||||
if item['name'] == menu:
|
||||
return item
|
||||
#TODO: Add error check
|
||||
self.show_panel(self._cur_panels[-1] + '_' + name, "menu", disname, 1, False, display_name=disname,
|
||||
items=menuitems)
|
||||
|
||||
def _remove_all_panels(self):
|
||||
while len(self._cur_panels) > 0:
|
||||
self._remove_current_panel()
|
||||
self._remove_current_panel(True, False)
|
||||
self.show_all()
|
||||
|
||||
|
||||
|
||||
def _remove_current_panel(self, pop=True):
|
||||
def _remove_current_panel(self, pop=True, show=True):
|
||||
if len(self._cur_panels) > 0:
|
||||
self.remove(
|
||||
self.panels[
|
||||
self._cur_panels[-1]
|
||||
].get()
|
||||
)
|
||||
self.remove(self.panels[self._cur_panels[-1]].get())
|
||||
if pop == True:
|
||||
self._cur_panels.pop()
|
||||
if len(self._cur_panels) > 0:
|
||||
self.add(self.panels[self._cur_panels[-1]].get())
|
||||
self.show_all()
|
||||
if show == True:
|
||||
self.show_all()
|
||||
|
||||
def _menu_go_back (self, widget):
|
||||
def _menu_go_back (self, widget=None):
|
||||
logger.info("#### Menu go back")
|
||||
self.remove_keyboard()
|
||||
self._remove_current_panel()
|
||||
|
||||
def _menu_go_home(self):
|
||||
logger.info("#### Menu go home")
|
||||
self.remove_keyboard()
|
||||
while len(self._cur_panels) > 1:
|
||||
self._remove_current_panel()
|
||||
|
||||
def add_subscription (self, panel_name):
|
||||
add = True
|
||||
@@ -334,88 +448,231 @@ class KlipperScreen(Gtk.Window):
|
||||
self.subscriptions.pop(i)
|
||||
return
|
||||
|
||||
def set_screenblanking_timeout(self, time):
|
||||
logger.debug("Changing screenblanking to: %s" % time)
|
||||
if time == "off":
|
||||
os.system("/usr/bin/xset -display :0 s off")
|
||||
os.system("/usr/bin/xset -display :0 s noblank")
|
||||
return
|
||||
|
||||
time = int(time)
|
||||
if time < 0:
|
||||
return
|
||||
|
||||
os.system("/usr/bin/xset -display :0 s on")
|
||||
os.system("/usr/bin/xset -display :0 s %s" % time)
|
||||
|
||||
def state_disconnected(self):
|
||||
_ = self.lang.gettext
|
||||
logger.debug("### Going to disconnected")
|
||||
self.printer_initializing(_("Klipper has disconnected"))
|
||||
|
||||
def state_error(self):
|
||||
_ = self.lang.gettext
|
||||
msg = self.printer.get_stat("webhooks","state_message")
|
||||
if "FIRMWARE_RESTART" in msg:
|
||||
self.printer_initializing(
|
||||
_("Klipper has encountered an error.\nIssue a FIRMWARE_RESTART to attempt fixing the issue.")
|
||||
)
|
||||
elif "micro-controller" in msg:
|
||||
self.printer_initializing(
|
||||
_("Klipper has encountered an error with the micro-controller.\nPlease recompile and flash.")
|
||||
)
|
||||
else:
|
||||
self.printer_initializing(
|
||||
_("Klipper has encountered an error.")
|
||||
)
|
||||
|
||||
def state_printing(self):
|
||||
if "job_status" in self._cur_panels:
|
||||
return
|
||||
self.printer_printing()
|
||||
|
||||
def state_ready(self):
|
||||
# Do not return to main menu if completing a job, timeouts/user input will return
|
||||
if "job_status" in self._cur_panels or "main_menu" in self._cur_panels:
|
||||
return
|
||||
self.printer_ready()
|
||||
|
||||
def state_startup(self):
|
||||
_ = self.lang.gettext
|
||||
self.printer_initializing(_("Klipper is attempting to start"))
|
||||
|
||||
def state_shutdown(self):
|
||||
_ = self.lang.gettext
|
||||
self.printer_initializing(_("Klipper has shutdown"))
|
||||
|
||||
def _websocket_callback(self, action, data):
|
||||
#print(json.dumps([action, data], indent=2))
|
||||
_ = self.lang.gettext
|
||||
|
||||
if action == "notify_klippy_disconnected":
|
||||
logger.info("### Going to disconnected state")
|
||||
self.printer_initializing("Klipper has shutdown")
|
||||
logger.debug("Received notify_klippy_disconnected")
|
||||
self.printer.change_state("disconnected")
|
||||
return
|
||||
elif action == "notify_klippy_ready":
|
||||
logger.info("### Going to ready state")
|
||||
self.printer_ready()
|
||||
elif action == "notify_status_update":
|
||||
self.printer.change_state("ready")
|
||||
elif action == "notify_status_update" and self.printer.get_state() != "shutdown":
|
||||
self.printer.process_update(data)
|
||||
if "webhooks" in data and "state" in data['webhooks']:
|
||||
if data['webhooks']['state'] == "ready":
|
||||
logger.info("### Going to ready state")
|
||||
self.printer_ready()
|
||||
else:
|
||||
active = self.printer.get_stat('virtual_sdcard','is_active')
|
||||
paused = self.printer.get_stat('pause_resume','is_paused')
|
||||
if "job_status" in self._cur_panels:
|
||||
if active == False and paused == False:
|
||||
self.printer_ready()
|
||||
else:
|
||||
if active == True or paused == True:
|
||||
self.printer_printing()
|
||||
elif action == "notify_filelist_changed":
|
||||
logger.debug("Filelist changed: %s", json.dumps(data,indent=2))
|
||||
#self.files.add_file()
|
||||
elif action == "notify_metadata_update":
|
||||
self.files.update_metadata(data['filename'])
|
||||
else:
|
||||
logger.debug(json.dumps([action, data], indent=2))
|
||||
self.files.request_metadata(data['filename'])
|
||||
elif action == "notify_power_changed":
|
||||
logger.debug("Power status changed: %s", data)
|
||||
self.printer.process_power_update(data)
|
||||
elif self.printer.get_state() not in ["error","shutdown"] and action == "notify_gcode_response":
|
||||
if "Klipper state: Shutdown" in data:
|
||||
logger.debug("Shutdown in gcode response, changing state to shutdown")
|
||||
self.printer.change_state("shutdown")
|
||||
|
||||
if not (data.startswith("B:") and
|
||||
re.search(r'B:[0-9\.]+\s/[0-9\.]+\sT[0-9]+:[0-9\.]+', data)):
|
||||
if data.startswith("!! "):
|
||||
self.show_popup_message(data[3:])
|
||||
logger.debug(json.dumps([action, data], indent=2))
|
||||
|
||||
for sub in self.subscriptions:
|
||||
self.panels[sub].process_update(data)
|
||||
self.panels[sub].process_update(action, data)
|
||||
|
||||
def _confirm_send_action(self, widget, text, method, params={}):
|
||||
_ = self.lang.gettext
|
||||
|
||||
buttons = [
|
||||
{"name":_("Continue"), "response": Gtk.ResponseType.OK},
|
||||
{"name":_("Cancel"),"response": Gtk.ResponseType.CANCEL}
|
||||
]
|
||||
|
||||
try:
|
||||
env = Environment(extensions=["jinja2.ext.i18n"])
|
||||
env.install_gettext_translations(self.lang)
|
||||
j2_temp = env.from_string(text)
|
||||
text = j2_temp.render()
|
||||
except:
|
||||
logger.debug("Error parsing jinja for confirm_send_action")
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_markup(text)
|
||||
label.set_hexpand(True)
|
||||
label.set_halign(Gtk.Align.CENTER)
|
||||
label.set_line_wrap(True)
|
||||
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
dialog = self.gtk.Dialog(self, buttons, label, self._confirm_send_action_response, method, params)
|
||||
|
||||
def _confirm_send_action_response(self, widget, response_id, method, params):
|
||||
if response_id == Gtk.ResponseType.OK:
|
||||
self._send_action(widget, method, params)
|
||||
|
||||
widget.destroy()
|
||||
|
||||
def _send_action(self, widget, method, params):
|
||||
self._ws.send_method(method, params)
|
||||
|
||||
def printer_initializing(self, text=None):
|
||||
self.shutdown = True
|
||||
self.show_panel('splash_screen',"SplashScreenPanel", 2)
|
||||
self.close_popup_message()
|
||||
self.show_panel('splash_screen',"splash_screen", "Splash Screen", 2)
|
||||
if text != None:
|
||||
self.panels['splash_screen'].update_text(text)
|
||||
self.panels['splash_screen'].show_restart_buttons()
|
||||
|
||||
def printer_ready(self):
|
||||
self.shutdown = False
|
||||
def init_printer(self):
|
||||
_ = self.lang.gettext
|
||||
|
||||
status_objects = [
|
||||
'idle_timeout',
|
||||
'configfile',
|
||||
'toolhead',
|
||||
'virtual_sdcard',
|
||||
'print_stats',
|
||||
'heater_bed',
|
||||
'extruder',
|
||||
'pause_resume'
|
||||
]
|
||||
r = requests.get("http://127.0.0.1:7125/printer/objects/query?" + "&".join(status_objects))
|
||||
|
||||
#TODO: Check that we get good data
|
||||
data = json.loads(r.content)
|
||||
self.printer_config = data['result']['status']['configfile']['config']
|
||||
#logger.debug("Printer config: %s" % json.dumps(self.printer_config, indent=2))
|
||||
printer_info = self.apiclient.get_printer_info()
|
||||
data = self.apiclient.send_request("printer/objects/query?" + "&".join(PRINTER_BASE_STATUS_OBJECTS))
|
||||
powerdevs = self.apiclient.send_request("machine/device_power/devices")
|
||||
data = data['result']['status']
|
||||
|
||||
# Reinitialize printer, in case the printer was shut down and anything has changed.
|
||||
self.printer.__init__(data['result']['status'])
|
||||
self.printer.reinit(printer_info['result'], data)
|
||||
self.ws_subscribe()
|
||||
|
||||
#logger.debug("Config sections: %s", self.printer.get_config_section_list())
|
||||
#logger.debug("Bed_screws: %s", self.printer.get_config_section("bed_screws"))
|
||||
if powerdevs != False:
|
||||
self.printer.configure_power_devices(powerdevs['result'])
|
||||
|
||||
self.show_panel('main_panel', "MainPanel", 2, items=self._config['mainmenu'], extrudercount=self.printer.get_extruder_count())
|
||||
def printer_ready(self):
|
||||
self.close_popup_message()
|
||||
# Force update to printer webhooks state in case the update is missed due to websocket subscribe not yet sent
|
||||
self.printer.process_update({"webhooks":{"state":"ready","state_message": "Printer is ready"}})
|
||||
self.show_panel('main_panel', "main_menu", self.connected_printer, 2,
|
||||
items=self._config.get_menu_items("__main"), extrudercount=self.printer.get_extruder_count())
|
||||
self.ws_subscribe()
|
||||
if "job_status" in self.panels:
|
||||
self.remove_subscription("job_status")
|
||||
del self.panels["job_status"]
|
||||
|
||||
def printer_printing(self):
|
||||
self.ws_subscribe()
|
||||
self.show_panel('job_status',"JobStatusPanel", 2)
|
||||
self.close_popup_message()
|
||||
self.show_panel('job_status',"job_status", "Print Status", 2)
|
||||
|
||||
def show_keyboard(self, widget=None):
|
||||
if self.keyboard is not None:
|
||||
return
|
||||
|
||||
env = os.environ.copy()
|
||||
env["MB_KBD_CONFIG"] = "/home/pi/.matchbox/keyboard.xml"
|
||||
env["MB_KBD_CONFIG"] = "ks_includes/locales/keyboard.xml"
|
||||
p = subprocess.Popen(["matchbox-keyboard", "--xid"], stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, env=env)
|
||||
#p = subprocess.Popen(["onboard", "--xid"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
xid = int(p.stdout.readline())
|
||||
logger.debug("XID %s" % xid)
|
||||
logger.debug("PID %s" % p.pid)
|
||||
keyboard = Gtk.Socket()
|
||||
#keyboard.connect("plug-added", self.plug_added)
|
||||
|
||||
action_bar_width = self.gtk.get_action_bar_width()
|
||||
|
||||
box = Gtk.VBox()
|
||||
box.set_size_request(self.width - action_bar_width, self.keyboard_height)
|
||||
box.add(keyboard)
|
||||
|
||||
cur_panel = self.panels[self._cur_panels[-1]]
|
||||
#for i in ['back','estop','home']:
|
||||
# if i in cur_panel.control:
|
||||
# cur_panel.control[i].set_sensitive(False)
|
||||
cur_panel.get().put(box, action_bar_width, self.height - 200)
|
||||
self.show_all()
|
||||
keyboard.add_id(xid)
|
||||
keyboard.show()
|
||||
|
||||
self.keyboard = {
|
||||
"box": box,
|
||||
"panel": cur_panel.get(),
|
||||
"process": p,
|
||||
"socket": keyboard
|
||||
}
|
||||
|
||||
def remove_keyboard(self, widget=None):
|
||||
if self.keyboard is None:
|
||||
return
|
||||
|
||||
self.keyboard['panel'].remove(self.keyboard['box'])
|
||||
os.kill(self.keyboard['process'].pid, signal.SIGTERM)
|
||||
self.keyboard = None
|
||||
|
||||
def get_software_version():
|
||||
prog = ('git', '-C', os.path.dirname(__file__), 'describe', '--always',
|
||||
'--tags', '--long', '--dirty')
|
||||
try:
|
||||
process = subprocess.Popen(prog, stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE)
|
||||
ver, err = process.communicate()
|
||||
retcode = process.wait()
|
||||
if retcode == 0:
|
||||
version = ver.strip()
|
||||
if isinstance(version, bytes):
|
||||
version = version.decode()
|
||||
return version
|
||||
else:
|
||||
logger.debug(f"Error getting git version: {err}")
|
||||
except OSError:
|
||||
logger.exception("Error runing git describe")
|
||||
return "?"
|
||||
|
||||
def main():
|
||||
|
||||
win = KlipperScreen()
|
||||
win.connect("destroy", Gtk.main_quit)
|
||||
win.show_all()
|
||||
@@ -423,4 +680,7 @@ def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
try:
|
||||
main()
|
||||
except:
|
||||
logger.exception("Fatal error in main loop")
|
||||
@@ -20,7 +20,8 @@ install_packages()
|
||||
python3-gi-cairo \
|
||||
python3-virtualenv \
|
||||
gir1.2-gtk-3.0 \
|
||||
virtualenv
|
||||
virtualenv \
|
||||
matchbox-keyboard
|
||||
}
|
||||
|
||||
create_virtualenv()
|
||||
@@ -41,25 +42,39 @@ install_systemd_service()
|
||||
KSPATH_ESC=$(sed "s/\//\\\\\//g" <<< $KSPATH)
|
||||
KSENV_ESC=$(sed "s/\//\\\\\//g" <<< $KSENV)
|
||||
|
||||
SERVICE=$(sed "s/KS_USER/$USER/g" <<< $SERVICE)
|
||||
SERVICE=$(sed "s/KS_ENV/$KSENV_ESC/g" <<< $SERVICE)
|
||||
SERVICE=$(sed "s/KS_DIR/$KSPATH_ESC/g" <<< $SERVICE)
|
||||
|
||||
echo "$SERVICE" | sudo tee /etc/systemd/system/KlipperScreen.service > /dev/null
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable KlipperScreen
|
||||
}
|
||||
|
||||
modify_user()
|
||||
{
|
||||
sudo usermod -a -G tty $USER
|
||||
}
|
||||
|
||||
update_x11()
|
||||
{
|
||||
echo "Updating X11 configuration"
|
||||
sudo sed -i 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
|
||||
if [ -e /etc/X11/Xwrapper.conf ]
|
||||
then
|
||||
echo "Updating X11 Xwrapper"
|
||||
sudo sed -i 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
|
||||
else
|
||||
echo "Adding X11 Xwrapper"
|
||||
echo 'allowed_users=anybody' | sudo tee /etc/X11/Xwrapper.config
|
||||
fi
|
||||
}
|
||||
|
||||
start_KlipperScreen() {
|
||||
sudo systemctl start KlipperScreen
|
||||
}
|
||||
|
||||
#install_packages
|
||||
install_packages
|
||||
create_virtualenv
|
||||
modify_user
|
||||
install_systemd_service
|
||||
update_x11
|
||||
start_KlipperScreen
|
||||
@@ -1,5 +1,5 @@
|
||||
websocket==0.2.1
|
||||
requests==2.24.0
|
||||
requests==2.25.1
|
||||
vext==0.7.4
|
||||
websocket-client==0.57.0
|
||||
humanize==2.5.0
|
||||
humanize==3.2.0
|
||||
jinja2==2.11.2
|
||||
@@ -7,10 +7,9 @@ StartLimitIntervalSec=0
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
User=pi
|
||||
User=KS_USER
|
||||
WorkingDirectory=KS_DIR
|
||||
ExecStart=/usr/bin/xinit KS_ENV/bin/python KS_DIR/screen.py
|
||||
ExecStartPost=KS_DIR/scripts/disablescreenblank.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,47 +1,47 @@
|
||||
|
||||
#
|
||||
import re
|
||||
import base64
|
||||
|
||||
dir = "/home/pi/sdcard/"
|
||||
file = "square_tower_0.2mm_PLA_ENDER3_46m.gcode"
|
||||
#f = f.open(file, 'r')
|
||||
|
||||
thumbnails = []
|
||||
cur_thumbnail = {}
|
||||
state = 0
|
||||
with open(dir + file, 'r') as f:
|
||||
for line in f:
|
||||
if state == 0:
|
||||
match = re.match(r'^; thumbnail begin ([0-9]+)x([0-9]+) ([0-9]+)', line)
|
||||
if match:
|
||||
cur_thumbnail = {
|
||||
"width": match.group(1),
|
||||
"height": match.group(2),
|
||||
"size": match.group(3),
|
||||
"data": ""
|
||||
}
|
||||
state = 1
|
||||
continue
|
||||
elif state == 1:
|
||||
if re.match (r'^; thumbnail end', line):
|
||||
state = 0
|
||||
thumbnails.append(cur_thumbnail)
|
||||
continue
|
||||
match = re.match(r'^; (\S+)$', line)
|
||||
if match:
|
||||
cur_thumbnail['data'] += match.group(1)
|
||||
|
||||
if len(thumbnails) > 0:
|
||||
biggest = 0
|
||||
for i in range(len(thumbnails)):
|
||||
if i == 0:
|
||||
continue
|
||||
if thumbnails[i]['width'] > thumbnails[biggest]['width']:
|
||||
biggest = i
|
||||
|
||||
image = base64.decodestring(thumbnails[biggest]['data'])
|
||||
name = file.split('.gcod')[0] + ".png"
|
||||
f = open(dir + name, 'wb')
|
||||
f.write(image)
|
||||
f.close()
|
||||
|
||||
#
|
||||
import re
|
||||
import base64
|
||||
|
||||
dir = "/home/pi/sdcard/"
|
||||
file = "square_tower_0.2mm_PLA_ENDER3_46m.gcode"
|
||||
#f = f.open(file, 'r')
|
||||
|
||||
thumbnails = []
|
||||
cur_thumbnail = {}
|
||||
state = 0
|
||||
with open(dir + file, 'r') as f:
|
||||
for line in f:
|
||||
if state == 0:
|
||||
match = re.match(r'^; thumbnail begin ([0-9]+)x([0-9]+) ([0-9]+)', line)
|
||||
if match:
|
||||
cur_thumbnail = {
|
||||
"width": match.group(1),
|
||||
"height": match.group(2),
|
||||
"size": match.group(3),
|
||||
"data": ""
|
||||
}
|
||||
state = 1
|
||||
continue
|
||||
elif state == 1:
|
||||
if re.match (r'^; thumbnail end', line):
|
||||
state = 0
|
||||
thumbnails.append(cur_thumbnail)
|
||||
continue
|
||||
match = re.match(r'^; (\S+)$', line)
|
||||
if match:
|
||||
cur_thumbnail['data'] += match.group(1)
|
||||
|
||||
if len(thumbnails) > 0:
|
||||
biggest = 0
|
||||
for i in range(len(thumbnails)):
|
||||
if i == 0:
|
||||
continue
|
||||
if thumbnails[i]['width'] > thumbnails[biggest]['width']:
|
||||
biggest = i
|
||||
|
||||
image = base64.decodestring(thumbnails[biggest]['data'])
|
||||
name = file.split('.gcod')[0] + ".png"
|
||||
f = open(dir + name, 'wb')
|
||||
f.write(image)
|
||||
f.close()
|
||||
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
KSPATH=$(sed 's/\/scripts//g' <<< $SCRIPTPATH)
|
||||
KSENV="${HOME}/.KlipperScreen-env"
|
||||
|
||||
update_virtualenv()
|
||||
{
|
||||
echo "Creating virtual environment"
|
||||
[ ! -d ${KSENV} ] && virtualenv -p /usr/bin/python3 ${KSENV}
|
||||
|
||||
${KSENV}/bin/pip install -r ${KSPATH}/scripts/KlipperScreen-requirements.txt
|
||||
${KSENV}/bin/pip install --no-binary ":all" "vext.gi==0.7.4"
|
||||
${KSENV}/bin/vext -e
|
||||
}
|
||||
|
||||
update_virtualenv
|
||||
@@ -0,0 +1,13 @@
|
||||
xgettext --keyword=_ --language=Python --add-comments --sort-output \
|
||||
-o ks_includes/locales/KlipperScreen.pot \
|
||||
*.py \
|
||||
ks_includes/*.py \
|
||||
panels/*.py \
|
||||
ks_includes/KlipperScreen.conf
|
||||
|
||||
langs=(de_DE en fr_FR he_IL ru_RU zh_CN)
|
||||
for lang in ${langs[@]}; do
|
||||
msgmerge ks_includes/locales/$lang/LC_MESSAGES/KlipperScreen.po \
|
||||
ks_includes/locales/KlipperScreen.pot \
|
||||
-o ks_includes/locales/$lang/LC_MESSAGES/KlipperScreen.po
|
||||
done
|
||||
@@ -1,301 +0,0 @@
|
||||
/* * {
|
||||
|
||||
} */
|
||||
|
||||
window {
|
||||
background-color: #13181C;
|
||||
-gtk-icon-shadow: none;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
scrollbar, scrollbar button, scrollbar trough {
|
||||
border: none;
|
||||
background-color: #13181C;
|
||||
}
|
||||
|
||||
scrollbar slider {
|
||||
min-width: 60px;
|
||||
border-radius: 15px;
|
||||
background-color: #404E57;
|
||||
}
|
||||
|
||||
frame {
|
||||
color: #fff;
|
||||
border-bottom: 1px solid #444;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
progress, trough {
|
||||
min-height: 40px;
|
||||
/*font-size: 50px;*/
|
||||
background-color: #404E57;
|
||||
color: #fff;
|
||||
border: #000 1px solid;
|
||||
}
|
||||
|
||||
progress {
|
||||
background-color: #d47b00;
|
||||
font-size: 50px;
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
.printing-progress-bar {
|
||||
font-size: 25px;
|
||||
color: #00C9B4;
|
||||
}
|
||||
|
||||
.printing-progress-text {
|
||||
font-size: 25px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.printing-state {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
button {
|
||||
background-image: none;
|
||||
background-color: #13181C;
|
||||
margin: 5px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 0;
|
||||
border: 0px solid #000;
|
||||
color: #fff;
|
||||
-gtk-icon-shadow: none;
|
||||
}
|
||||
|
||||
button:active {
|
||||
background-color: #304C62;
|
||||
}
|
||||
|
||||
.button_active {
|
||||
background-color: #20303D;
|
||||
}
|
||||
|
||||
button.color1 {
|
||||
border-bottom: 8px solid #ED6500;
|
||||
}
|
||||
|
||||
button.color2 {
|
||||
border-bottom: 8px solid #B10080;
|
||||
}
|
||||
|
||||
button.color3 {
|
||||
border-bottom: 8px solid #009384;
|
||||
}
|
||||
|
||||
button.color4 {
|
||||
border-bottom: 8px solid #A7E100;
|
||||
}
|
||||
|
||||
button.active {
|
||||
background-color: #20303D;
|
||||
}
|
||||
|
||||
button.file-list {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.distbutton_top {
|
||||
border: 3px solid #fff;
|
||||
border-right: 0px;
|
||||
border-top-left-radius: 15px;
|
||||
border-bottom-left-radius: 15px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
.distbutton {
|
||||
border: 3px solid #fff;
|
||||
border-left: 3px solid #ccc;
|
||||
border-right: 0px;
|
||||
margin-left: 0;
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
.distbutton_bottom {
|
||||
border: 3px solid #fff;
|
||||
border-left: 3px solid #ccc;
|
||||
border-top-right-radius: 15px;
|
||||
border-bottom-right-radius: 15px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.tempbutton_top {
|
||||
border: 3px solid #fff;
|
||||
border-bottom: 0px;
|
||||
border-top-left-radius: 15px;
|
||||
border-top-right-radius: 15px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.tempbutton {
|
||||
border: 3px solid #fff;
|
||||
border-top: 3px solid #ccc;
|
||||
border-bottom: 0px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.tempbutton_bottom {
|
||||
border: 3px solid #fff;
|
||||
border-top: 3px solid #ccc;
|
||||
border-bottom-left-radius: 15px;
|
||||
border-bottom-right-radius: 15px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.distbutton_active {
|
||||
background-color: #20303D;
|
||||
}
|
||||
|
||||
entry {
|
||||
font-size: 30px;
|
||||
background-color: #20292F;
|
||||
border-radius: 0;
|
||||
padding-left: 1em;
|
||||
margin-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
button.keyboard {
|
||||
font-size: 30px;
|
||||
margin: 0px;
|
||||
/* margin-bottom:10px; */
|
||||
}
|
||||
|
||||
.dialog {
|
||||
border: 2px solid black;
|
||||
font-size: 20px;
|
||||
padding: 50px;
|
||||
background-color: #000;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.dialog button {
|
||||
padding: 30px 50px 30px 50px;
|
||||
border-bottom: 8px solid #009384;
|
||||
}
|
||||
|
||||
.message {
|
||||
border: 2px solid #981E1F;
|
||||
font-size: 20px;
|
||||
padding: 50px;
|
||||
color: #FFF;
|
||||
background-color: #981E1F;
|
||||
}
|
||||
|
||||
.message button {
|
||||
background-color: #FFF;
|
||||
color: #000;
|
||||
padding: 40px 50px 40px 50px;
|
||||
}
|
||||
|
||||
.notification {
|
||||
background-clip: padding-box;
|
||||
padding: 5px;
|
||||
border-radius: 0 0 5px 5px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.warning {
|
||||
background-color: rgba(30, 204, 39, 0.7);
|
||||
}
|
||||
|
||||
.error {
|
||||
background-color: rgba(204, 30, 30, 0.7);
|
||||
}
|
||||
|
||||
.printing-status-label {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 3px;
|
||||
color: #ccc;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
|
||||
.temperature_entry {
|
||||
border: 0px;
|
||||
color: #fff;
|
||||
margin: 10px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.numpad_tleft {
|
||||
border-left: 3px solid #fff;
|
||||
border-top: 3px solid #fff;
|
||||
border-top-left-radius: 15px;
|
||||
margin: 3px 0 0 3px;
|
||||
}
|
||||
|
||||
.numpad_top {
|
||||
border-left: 3px solid #ccc;
|
||||
border-top: 3px solid #fff;
|
||||
margin: 3px 0 0 0;
|
||||
}
|
||||
|
||||
.numpad_tright {
|
||||
border-left: 3px solid #fff;
|
||||
border-right: 3px solid #fff;
|
||||
border-top: 3px solid #fff;
|
||||
border-top-right-radius: 15px;
|
||||
margin: 3px 3px 0 0;
|
||||
}
|
||||
|
||||
.numpad_left {
|
||||
border-left: 3px solid #fff;
|
||||
border-top: 3px solid #ccc;
|
||||
margin: 0 0 0 3px;
|
||||
}
|
||||
|
||||
.numpad_button {
|
||||
border-left: 3px solid #ccc;
|
||||
border-top: 3px solid #ccc;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.numpad_right {
|
||||
border-right: 3px solid #fff;
|
||||
border-left: 3px solid #ccc;
|
||||
border-top: 3px solid #ccc;
|
||||
margin: 0 3px 0 0;
|
||||
}
|
||||
|
||||
.numpad_bleft {
|
||||
border-left: 3px solid #fff;
|
||||
border-bottom: 3px solid #fff;
|
||||
border-top: 3px solid #ccc;
|
||||
border-bottom-left-radius: 15px;
|
||||
margin: 0 0 3px 3px;
|
||||
}
|
||||
|
||||
.numpad_bottom {
|
||||
border-left: 3px solid #ccc;
|
||||
border-bottom: 3px solid #fff;
|
||||
border-top: 3px solid #ccc;
|
||||
margin: 0 0 3px 0;
|
||||
}
|
||||
|
||||
.numpad_bright {
|
||||
border-left: 3px solid #ccc;
|
||||
border-bottom: 3px solid #fff;
|
||||
border-top: 3px solid #ccc;
|
||||
border-right: 3px solid #ccc;
|
||||
border-bottom-right-radius: 15px;
|
||||
margin: 0 3px 3px 0;
|
||||
}
|
||||
|
||||
.fan_slider {
|
||||
margin: 20px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
scale mark {
|
||||
margin-top: 20px;
|
||||
color: #fff;
|
||||
}
|
||||
@@ -0,0 +1,343 @@
|
||||
* {
|
||||
color: #fff;
|
||||
font-size: KS_FONT_SIZEpx;
|
||||
-GtkComboBox-appears-as-list: 0;
|
||||
}
|
||||
|
||||
window {
|
||||
background-color: #13181C;
|
||||
-gtk-icon-shadow: none;
|
||||
}
|
||||
|
||||
button {
|
||||
background-image: none;
|
||||
background-color: #13181C;
|
||||
margin: .25em;
|
||||
margin-bottom: .5em;
|
||||
border-radius: 0;
|
||||
border: 0 solid #000;
|
||||
-gtk-icon-shadow: none;
|
||||
}
|
||||
|
||||
button:active {
|
||||
background-color: #304C62;
|
||||
}
|
||||
|
||||
.button_active {
|
||||
background-color: #20303D;
|
||||
}
|
||||
|
||||
button.color1 {
|
||||
border-bottom: .4em solid #ED6500;
|
||||
}
|
||||
|
||||
button.color2 {
|
||||
border-bottom: .4em solid #B10080;
|
||||
}
|
||||
|
||||
button.color3 {
|
||||
border-bottom: .4em solid #009384;
|
||||
}
|
||||
|
||||
button.color4 {
|
||||
border-bottom: .4em solid #A7E100;
|
||||
}
|
||||
|
||||
button.active {
|
||||
background-color: #20303D;
|
||||
}
|
||||
|
||||
button.file-list {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
combobox box button {
|
||||
border: .05em solid #cccccc;
|
||||
padding: .5em 1em;
|
||||
}
|
||||
|
||||
entry {
|
||||
font-size: 1em;
|
||||
background-color: #20292F;
|
||||
border: 0;
|
||||
padding: .25em;
|
||||
}
|
||||
|
||||
frame {
|
||||
color: #fff;
|
||||
border-bottom: 1px solid #444;
|
||||
}
|
||||
|
||||
label {
|
||||
color: white;
|
||||
}
|
||||
|
||||
menu {
|
||||
background-color: #13181C;
|
||||
border: .1em solid #cccccc;
|
||||
}
|
||||
|
||||
menuitem {
|
||||
background-color: #13181C;
|
||||
border: .1em solid #cccccc;
|
||||
border-bottom: 0;
|
||||
border-top: 0;
|
||||
}
|
||||
|
||||
progress, trough {
|
||||
min-height: 2em;
|
||||
background-color: #404E57;
|
||||
color: #fff;
|
||||
border: #000 1px solid;
|
||||
}
|
||||
|
||||
progress {
|
||||
background-color: #d47b00;
|
||||
}
|
||||
|
||||
scale mark {
|
||||
margin-top: 1em;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
scrollbar, scrollbar button, scrollbar trough {
|
||||
border: none;
|
||||
background-color: #13181C;
|
||||
}
|
||||
|
||||
scrollbar slider {
|
||||
min-width: 3em;
|
||||
border-radius: .7em;
|
||||
background-color: #404E57;
|
||||
}
|
||||
|
||||
trough {
|
||||
margin: .5em 1em;
|
||||
}
|
||||
|
||||
.popup {
|
||||
background-color: #0000ff;
|
||||
}
|
||||
|
||||
.action_bar {
|
||||
border-right: 2px solid #444;
|
||||
}
|
||||
|
||||
.dialog {
|
||||
border: .1em solid black;
|
||||
padding: 2.5em;
|
||||
background-color: #000;
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
.dialog button {
|
||||
padding: 1.5em 2.5em 1.5em 2.5em;
|
||||
border-bottom: .4em solid #009384;
|
||||
}
|
||||
|
||||
.distbutton_active {
|
||||
background-color: #20303D;
|
||||
}
|
||||
|
||||
.distbutton_top {
|
||||
border: .15em solid #fff;
|
||||
border-right: 0;
|
||||
border-top-left-radius: .75em;
|
||||
border-bottom-left-radius: .75em;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.distbutton {
|
||||
border: .15em solid #fff;
|
||||
border-left: .15em solid #ccc;
|
||||
border-right: 0;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.distbutton_bottom {
|
||||
border: .15em solid #fff;
|
||||
border-left: .15em solid #ccc;
|
||||
border-top-right-radius: .7em;
|
||||
border-bottom-right-radius: .7em;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.fan_slider {
|
||||
margin: 1em;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.frame-item {
|
||||
min-height: 4.5em;
|
||||
padding: .1em .75em;
|
||||
}
|
||||
|
||||
.message_popup {
|
||||
background-color: #367554;
|
||||
border-bottom: .1em solid #fff;
|
||||
}
|
||||
|
||||
.message_popup button {
|
||||
background-color: #367554;
|
||||
}
|
||||
|
||||
.numpad_tleft {
|
||||
border-left: .15em solid #fff;
|
||||
border-top: .15em solid #fff;
|
||||
border-top-left-radius: .7em;
|
||||
margin: .15em 0 0 .15em;
|
||||
}
|
||||
|
||||
.numpad_top {
|
||||
border-left: .15em solid #ccc;
|
||||
border-top: .15em solid #fff;
|
||||
margin: .15em 0 0 0;
|
||||
}
|
||||
|
||||
.numpad_tright {
|
||||
border-left: .15em solid #fff;
|
||||
border-right: .15em solid #fff;
|
||||
border-top: .15em solid #fff;
|
||||
border-top-right-radius: .7em;
|
||||
margin: .15em .15em 0 0;
|
||||
}
|
||||
|
||||
.numpad_left {
|
||||
border-left: .15em solid #fff;
|
||||
border-top: .15em solid #ccc;
|
||||
margin: 0 0 0 .15em;
|
||||
}
|
||||
|
||||
.numpad_button {
|
||||
border-left: .15em solid #ccc;
|
||||
border-top: .15em solid #ccc;
|
||||
margin: 0;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.numpad_right {
|
||||
border-right: .15em solid #fff;
|
||||
border-left: .15em solid #ccc;
|
||||
border-top: .15em solid #ccc;
|
||||
margin: 0 .15em 0 0;
|
||||
}
|
||||
|
||||
.numpad_bleft {
|
||||
border-left: .15em solid #fff;
|
||||
border-bottom: .15em solid #fff;
|
||||
border-top: .15em solid #ccc;
|
||||
border-bottom-left-radius: .7em;
|
||||
margin: 0 0 .15em .15em;
|
||||
}
|
||||
|
||||
.numpad_bottom {
|
||||
border-left: .15em solid #ccc;
|
||||
border-bottom: .15em solid #fff;
|
||||
border-top: .15em solid #ccc;
|
||||
margin: 0 0 .15em 0;
|
||||
}
|
||||
|
||||
.numpad_bright {
|
||||
border-left: .15em solid #ccc;
|
||||
border-bottom: .15em solid #fff;
|
||||
border-top: .15em solid #ccc;
|
||||
border-right: .15em solid #ccc;
|
||||
border-bottom-right-radius: .7em;
|
||||
margin: 0 .15em .15em 0;
|
||||
}
|
||||
|
||||
.printing-filename {
|
||||
font-size: 1.75em;
|
||||
font-weight: bold;
|
||||
margin: .25em .25em 0 0;
|
||||
}
|
||||
|
||||
.printing-info {
|
||||
font-size: 1.2em;
|
||||
margin-left: .25em;
|
||||
}
|
||||
|
||||
.printing-info-box {
|
||||
padding-left: .25em;
|
||||
}
|
||||
|
||||
.printing-info-box box {
|
||||
margin-bottom: .5em;
|
||||
}
|
||||
|
||||
.printing-status {
|
||||
color: #f0f0f0;
|
||||
font-style: italic;
|
||||
margin: 0 0 0 0;
|
||||
}
|
||||
|
||||
.printing-progress-bar {
|
||||
color: #00C9B4;
|
||||
}
|
||||
|
||||
.printing-progress-text {
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.printing-status-label {
|
||||
padding-top: .25em;
|
||||
padding-bottom: .15em;
|
||||
color: #ccc;
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
.tempbutton_top {
|
||||
border: .15em solid #fff;
|
||||
border-bottom: 0;
|
||||
border-top-left-radius: .75em;
|
||||
border-top-right-radius: .75em;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.tempbutton {
|
||||
border: .15em solid #fff;
|
||||
border-top: .15em solid #ccc;
|
||||
border-bottom: 0;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.tempbutton_bottom {
|
||||
border: .15em solid #fff;
|
||||
border-top: .15em solid #ccc;
|
||||
border-bottom-left-radius: .7em;
|
||||
border-bottom-right-radius: .7em;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.message {
|
||||
border: .1em solid #981E1F;
|
||||
font-size: 1em;
|
||||
padding: 2.5em;
|
||||
color: #FFF;
|
||||
background-color: #981E1F;
|
||||
}
|
||||
|
||||
.message button {
|
||||
background-color: #FFF;
|
||||
color: #000;
|
||||
padding: 2em 2.5em 2em 2.5em;
|
||||
}
|
||||
|
||||
.notification {
|
||||
background-clip: padding-box;
|
||||
padding: .25em;
|
||||
border-radius: 0 0 .25em .25em;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.warning {
|
||||
background-color: rgba(30, 204, 39, 0.7);
|
||||
}
|
||||
|
||||
.error {
|
||||
background-color: rgba(204, 30, 30, 0.7);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" ?><svg data-name="Layer 1" id="Layer_1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title/><path style="fill:#FFFFFF" d="M12,2A10,10,0,1,0,22,12,10,10,0,0,0,12,2Zm0,18a8,8,0,1,1,8-8A8,8,0,0,1,12,20ZM13,6H11v7h6V11H13Z"/></svg>
|
||||
|
After Width: | Height: | Size: 259 B |
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true" class="v-icon__svg" style="color: #ff0000;">
|
||||
<path style="fill:#ff0000;" d="M11,15H13V17H11V15M11,7H13V13H11V7M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M12,19C8.14,19 5,15.86 5,12C5,8.14 8.14,5 12,5C15.86,5 19,8.14 19,12C19,15.86 15.86,19 12,19M20.5,20.5C22.66,18.31 24,15.31 24,12C24,8.69 22.66,5.69 20.5,3.5L19.42,4.58C21.32,6.5 22.5,9.11 22.5,12C22.5,14.9 21.32,17.5 19.42,19.42L20.5,20.5M4.58,19.42C2.68,17.5 1.5,14.9 1.5,12C1.5,9.11 2.68,6.5 4.58,4.58L3.5,3.5C1.34,5.69 0,8.69 0,12C0,15.31 1.34,18.31 3.5,20.5L4.58,19.42Z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 718 B |
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="77px" height="80px" viewBox="0 0 77 80" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 52.5 (67469) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>extruder1</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Artboard" transform="translate(-62.000000, -173.000000)">
|
||||
<g id="extruder-1" transform="translate(62.000000, 173.000000)">
|
||||
<g id="Group" transform="translate(10.000000, 6.000000)" fill="#FFFFFF" stroke="#FFFFFF" stroke-linecap="round" stroke-width="2">
|
||||
<path d="M0.5,3.5 L6,0.5" id="Line"></path>
|
||||
<path d="M6,0.5 L14.5,0.5" id="Line-2"></path>
|
||||
<path d="M14.5,0.5 L17.5,4.5" id="Line-3" stroke-linejoin="round"></path>
|
||||
<path d="M0.5,3.5 L0.5,15.5" id="Line-5"></path>
|
||||
<path d="M17.5,4.5 L29.5,4.5" id="Line-4"></path>
|
||||
<path d="M0.5,15.5 L4,21.5" id="Line-6"></path>
|
||||
<path d="M4,47.5 L0.5,52.5" id="Line-8"></path>
|
||||
<path d="M0.5,52.5 L0.5,66.5" id="Line-9"></path>
|
||||
<path d="M4,21.5 L4,47.5" id="Line-7"></path>
|
||||
<path d="M0.5,66.5 L13.5,69" id="Line-10"></path>
|
||||
<path d="M13.5,69 L17.5,64.5" id="Line-11"></path>
|
||||
<path d="M17.5,64.5 L29.5,64.5" id="Line-12"></path>
|
||||
</g>
|
||||
<g id="Group" transform="translate(52.000000, 40.500000) scale(-1, 1) translate(-52.000000, -40.500000) translate(37.000000, 6.000000)" stroke="#FFFFFF" stroke-linecap="round" stroke-width="2">
|
||||
<path d="M0.5,3.5 L6,0.5" id="Line"></path>
|
||||
<path d="M6,0.5 L14.5,0.5" id="Line-2"></path>
|
||||
<path d="M14.5,0.5 L17.5,4.5" id="Line-3" stroke-linejoin="round"></path>
|
||||
<path d="M0.5,3.5 L0.5,15.5" id="Line-5"></path>
|
||||
<path d="M17.5,4.5 L29.5,4.5" id="Line-4"></path>
|
||||
<path d="M0.5,15.5 L4,21.5" id="Line-6"></path>
|
||||
<path d="M4,47.5 L0.5,52.5" id="Line-8"></path>
|
||||
<path d="M0.5,52.5 L0.5,66.5" id="Line-9"></path>
|
||||
<path d="M4,21.5 L4,47.5" id="Line-7"></path>
|
||||
<path d="M0.5,66.5 L13.5,69" id="Line-10"></path>
|
||||
<path d="M13.5,69 L17.5,64.5" id="Line-11"></path>
|
||||
<path d="M17.5,64.5 L29.5,64.5" id="Line-12"></path>
|
||||
</g>
|
||||
<circle id="Oval" stroke="#FFFFFF" stroke-width="2" cx="38.5" cy="35.5" r="19.5"></circle>
|
||||
<circle id="Oval" stroke="#000000" stroke-width="0.5" fill="#FFFFFF" cx="55" cy="22" r="21"></circle>
|
||||
<text id="1" font-family="OpenSans-SemiBold, Open Sans" font-size="26" font-weight="500" fill="#000000">
|
||||
<tspan x="47.6188697" y="31">0</tspan>
|
||||
</text>
|
||||
<path d="M35.5,73.5 L38.5,77.5" id="Line-16" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
|
||||
<path d="M38.5,77.5 L41.5,73.5" id="Line-17" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
|
||||
<path d="M29.5,73.5 L47.5,73.5" id="Line-14" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" ?><svg data-name="Layer 1" id="Layer_1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title/><path style="fill:#FFFFFF" d="M19,6.76V2H6V6.76A4,4,0,0,0,7.17,9.59L9.59,12,7.17,14.41A4.06,4.06,0,0,0,6,17.24V22H19V17.24a4.06,4.06,0,0,0-1.17-2.83L15.41,12l2.42-2.41A4,4,0,0,0,19,6.76ZM8,4h9V6H8Zm8.41,11.83A2,2,0,0,1,17,17.24V20H8V17.24a2,2,0,0,1,.59-1.41l2.76-2.77L11.4,13h2.2l.05.06Zm-2.76-4.89L13.6,11H11.4l-.05-.06L8.59,8.17A1.22,1.22,0,0,1,8.44,8h8.12a1.22,1.22,0,0,1-.15.17Z"/></svg>
|
||||
|
After Width: | Height: | Size: 515 B |