Compare commits

...
73 Commits
Author SHA1 Message Date
dependabot[bot] 6b432c167f build(deps): bump pygobject from 3.42.0 to 3.42.1 (#589)
Bumps [pygobject](https://pygobject.readthedocs.io) from 3.42.0 to 3.42.1.

---
updated-dependencies:
- dependency-name: pygobject
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-31 11:43:43 -03:00
dependabot[bot] 9d25836df4 build(deps): bump jinja2 from 3.1.1 to 3.1.2 (#605)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.1.1...3.1.2)

---
updated-dependencies:
- dependency-name: jinja2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-31 11:43:25 -03:00
alfrix 54fc0458e0 KlippyGtk: fix style arguments 2022-05-31 11:14:42 -03:00
alfrix 3361c243b7 docs: hardware fix links 2022-05-31 11:14:42 -03:00
alfrix 2da5a4df32 docs: improve install instructions 2022-05-31 11:14:42 -03:00
alfrix 0f4f56bb9f Fix paused state
close #607
fix #611
2022-05-31 11:14:42 -03:00
alfrix 33195f203f Simplify code 2022-05-31 11:14:42 -03:00
alfrix 3889fdbe4c console: remove // 2022-05-31 11:14:42 -03:00
alfrix 7b4a24d079 job_status: simplify timeouts because sometimes it didn't work, also do not autoclose by default because there may be offsets to be saved 2022-05-31 11:14:42 -03:00
alfrix c91deda220 settings: wider scale slider 2022-05-31 11:14:42 -03:00
alfrix cc755edeb2 wider scrollbar because it's hard to use on small screens 2022-05-31 11:14:42 -03:00
alfrix 5a36729b76 PEP8, typos and warnings fixes 2022-05-31 11:14:42 -03:00
alfrix fd2a717ece settings: remove options that are directly on the panels 2022-05-31 11:14:42 -03:00
alfrix 48860159e9 move: add options to the panel 2022-05-31 11:14:42 -03:00
alfrix 4ff63798c8 job_status: ask for confirmation, and show saved offset 2022-05-31 11:14:42 -03:00
alfrix ea3e7ad3d1 splash_screen: use moonraker for actions if connected, hide system panel if it isn't connected
use systemctl if moonraker isn't available close #615
2022-05-31 11:14:42 -03:00
alfrix 562e49b8d2 logging: exceptions can log more info 2022-05-31 11:14:42 -03:00
alfrix 7c8d4ea4d7 extrude: add filament sensor support 2022-05-31 11:14:42 -03:00
alfrix b77b7c0976 job_status: M117 without text clears the label fix #614 2022-05-31 11:14:42 -03:00
alfrix 8550cbcab6 retraction: add reset 2022-05-31 11:14:42 -03:00
alfrix ade8911ba6 limits: add reset, allow to set above the configured maximum but turn the slider red 2022-05-31 11:14:42 -03:00
alfrix b9036901e7 job_status: animate filename if it's too long 2022-05-31 11:14:42 -03:00
alfrix f88a5c8440 macros: put the hide options on the panel 2022-05-31 11:14:42 -03:00
alfrix 53bc6f25ff macros: allow reverse sorting 2022-05-31 11:14:42 -03:00
alfrix 21633b9302 files: fix local thumbnails 2022-05-31 11:14:42 -03:00
alfrix a0a222c386 print: use the smaller thumb for the list if available 2022-05-31 11:14:42 -03:00
Mikko Gozaloandalfrix fa0d696120 Add Input Shaper panel
Original panel by Mikko Gozalo

Modified layour to fit 16:9 screens
Auto-home
Ability to measure X and Y independently
Get the current active values not the values from the config
Ask for save
Other minor tweaks

close #301

Co-authored-by: alfrix <alfredomonclus@gmail.com>
2022-05-31 11:14:42 -03:00
alfrix 7e988b3f35 zcalibrate: show the saved offset and offset to be saved 2022-05-31 11:14:42 -03:00
alfrix f98ac0bfe4 Move korean fonts to the optional category 2022-05-31 11:13:56 -03:00
NStevenU a29da7e76c Add Korean language support (#625)
* Add Korean language support

* Add Korean Language Support Font Installation
2022-05-31 11:12:20 -03:00
Ruslan Sayfutdinov 794dbea14e Allow setting 0 in preheat options (#612) 2022-05-31 11:10:27 -03:00
Selim 432b12d67e Turkish Language (#610) 2022-05-16 18:39:14 -03:00
alfrix 8accce00a9 job_status: fix thumbnail issue #608 2022-05-04 09:56:24 -03:00
alfrix 35381beeb6 limits: fix typo in label 2022-05-03 08:38:58 -03:00
alfrix 1eaa82ba2d config: fix print estimate default 2022-05-02 14:08:03 -03:00
alfrix 35c4136bd5 Job_status: fix speed label, fix estimate default 2022-05-02 12:09:12 -03:00
Alfredo Monclus 31546f0020 Improve Job status (#592)
Adds heater_generic and/or temp_sensors besides extruder/bed (because of the limited space maybe only 1)
Temps are now buttons and act as a shortcut to the temp panel
Adds fan_generic to the fan label and it's now a shortcut to the fan panel
The colors and size of the progress circle were changed to be more subtle.
Margins between items were augmented, because they are buttons now
Adds 3 information pages: move, extrusion and time:

    move can be opened with speed or z buttons
    time with elapsed/remaining buttons
    extrusion with the extrude_factor / flowrate button
2022-05-01 12:22:58 -03:00
AntoszHUN aac58bd885 Update Hungarian Language 2022-04-30 23:14:31 -03:00
alfrix 7ca118de86 console: limit length close #602 2022-04-30 23:13:43 -03:00
Alfredo Monclus 7420f38b15 installer improvements (#601)
The installer now catchs apt errors
FBturbo is now optional and FBdev is used as fallback
install xserver-xorg-legacy but do not force it, it's usually required for a lot of screens, but not 100%
hide pip update warnings, the new version broke stuff.
more granularity and steps to what's being installed, should make it easier to debug if something goes wrong
2022-04-29 12:12:00 -03:00
alfrix 6aa7f56231 extruder: fix temp overlap multi-extruder 2022-04-25 13:33:20 -03:00
alfrix 504d395661 temperature: fix issue with the new cooldown preheat setting 2022-04-23 11:57:52 -03:00
alfrix a77134d63b fan: prevent crash when using unicode characters 2022-04-23 10:46:19 -03:00
alfrix c763bd5a5b fans: fix for machines without [fan] 2022-04-20 14:54:47 -03:00
eltacoloco 228994b2f2 Swedish locale (#588)
Created sv_SE (Swedish) locales
2022-04-17 17:33:14 -03:00
alfrix 3a5427c7f0 console: add top margin and make it easier to read 2022-04-17 06:20:09 -03:00
alfrix b42043bc79 job_status fix issue with delta printers fixes #587 2022-04-13 20:06:02 -03:00
alfrix b3268223bb base_panel: fix titlebar items not showing if ks is started while printing 2022-04-12 16:21:35 -03:00
alfrix 430284b7a1 limits: add units 2022-04-11 23:32:07 -03:00
alfrix 8ad21ab7cb zcalibrate: fix vertical mode not working fixes #576 2022-04-11 23:24:15 -03:00
alfrixandtonywright 8ba28fde1c Add firmware retraction panel close #101
Co-authored-by: tonywright
2022-04-11 23:04:29 -03:00
alfrix 7078e52a4f zcalibrate: fix issue with delta kinematics fix #583 2022-04-11 22:46:13 -03:00
alfrix b555768980 safeguard against trying to load a missing theme 2022-04-11 09:08:07 -03:00
alfrix 2c6a853a80 docs: add preheat cooldown 2022-04-11 08:35:45 -03:00
Julien Kohler 3ea0b09863 Add possibility to define custom code for cooling (#579)
These changes allow to define custom code to be run when using the cooldown preset.

Here an example in the configuration:
```
[preheat cooldown]
gcode: M107
```
2022-04-11 08:25:07 -03:00
alfrix 618c9ac0e8 docs: add note about octoprint 2022-04-11 08:09:06 -03:00
alfrix a84cb63f8b readme: add docs build status 2022-04-11 08:02:31 -03:00
alfrix 0a8e757054 docs: add requirements file to fix docs 2022-04-08 19:16:09 -03:00
alfrix 0fb2046615 docs: add another fix to Cannot open virtual console close #580 2022-04-08 14:03:19 -03:00
alfrix 583397ebeb job_status: add save z button to save babystepping 2022-04-06 08:20:22 -03:00
alfrix 4bace34847 zcalibrate: add manual delta_calibrate fix #575 2022-04-05 20:02:28 -03:00
alfrix dd72e7d46a base_panel: fix #572 2022-04-05 19:57:38 -03:00
alfrix 013b50985f network: remove duplicate netifaces close #571 2022-04-05 19:50:35 -03:00
alfrix dc9cf760db Splash_screen: fix power on button dissapearing 2022-04-05 18:12:48 -03:00
alfrix 979217502d console: hide temps, clear button, button icons 2022-04-05 17:22:07 -03:00
alfrix 1ff0616457 zcalibrate: fix issue when position is not defined 2022-04-03 06:15:22 -03:00
alfrix e09d72f12d main and temp: fix same color for heater_generics and sensors 2022-04-02 14:29:31 -03:00
alfrix ab38dab291 style: add heater_generic icon 2022-04-02 14:29:31 -03:00
alfrix c33659c6f7 gtk: cleanup andoptimize image handling, incomplete themes should now work 2022-04-02 09:59:12 -03:00
alfrix c81836542a dependencies: keep numpy 1.21.4, 1.21.5 should be the last version that supports python 3.7 but somehow on some system doesn't work
fixes #569
2022-04-02 09:56:30 -03:00
alfrix cdb57f73bb v0.2.1
Screen:
* The no DPMS option should now protect from the first touch,
and it should provide a way for screens that turn all white/random colors/no-signal to just be all black
Zcalibrate:
* Add selector if multiple options can be used
* Go to the middle of the bed if position is not configured
* Add an option to set the custom position per printer
Fine_tune:
* Add reset button for each of the 3 options
Network:
* Add reload button
* Show hidden SSIDs as Hidden instead of x00
System:
* Add full update option to update all items at once
Mesh:
* Fix graph getting a bit out of screen in vertical mode
Menu:
* Use scrollbars when there are too many items
* Fix vertical mode not arranging items correctly
Move:
* Show ??? if not homed
* Hide originXY for delta kinematics
Splash:
* Change buttons to local commands if not connected to moonraker
* Fix issues with power button if klipper is not connected
Misc:
* Keyboard now works on all the entry boxes, you can press enter on them to confirm.
* If there is only 1 extruder, then the nozzle icon is shown instead of the number
2022-04-01 20:16:41 -03:00
AntoszHUN 1e7c065ce4 Update Hungarian language (#562) 2022-03-28 16:51:26 -03:00
alfrix b7d58a7ffb docs: fix xwrapper extension 2022-03-25 15:55:52 -03:00
64 changed files with 4453 additions and 1143 deletions

No files matched your search

+3 -6
View File
@@ -2,17 +2,14 @@
KlipperScreen is a touchscreen GUI that interfaces with [Klipper](https://github.com/kevinOConnor/klipper) via [Moonraker](https://github.com/arksine/moonraker). It can switch between multiple printers to access them from a single location, and it doesn't even need to run on the same host, you can install it on another device and configure the IP address to access the printer.
### Documentation
### Documentation [![Documentation Status](https://readthedocs.org/projects/klipperscreen/badge/?version=latest)](https://klipperscreen.readthedocs.io/en/latest/?badge=latest)
[Click here to access the documentation.](https://klipperscreen.readthedocs.io/en/latest/)
### Inspiration
KlipperScreen was inspired by [OctoScreen](https://github.com/Z-Bolt/OctoScreen/) and the need for a touchscreen GUI that
will natively work with [Klipper](https://github.com/kevinOConnor/klipper) and [Moonraker](https://github.com/arksine/moonraker).
[![Main Menu](docs/img/panels/main_panel.png)](https://klipperscreen.readthedocs.io/en/latest/Panels/)
![Main Menu](docs/img/panels/main_panel.png)
[More Screenshots](https://klipperscreen.readthedocs.io/en/latest/Panels/)
[More Screenshots](https://klipperscreen.readthedocs.io/en/latest/Panels/)
+12 -4
View File
@@ -20,11 +20,11 @@ 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 in seconds before the Job Status page closes itself after a successful job/print
# 0 means disabled
job_complete_timeout: 0
# 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.
# Time in seconds before the Job Status closes itself if an error is encountered
job_error_timeout: 0
# Specify the language
@@ -106,6 +106,14 @@ temperature_fan: 40
gcode: MY_HEATSOAK_MACRO
```
There is a special preheat setting named cooldown to do additional things when the _cooldown_ button is pressed
for example:
```
[preheat cooldown]
gcode: M107
```
## Bed Screws
```
[bed_screws]
+2 -2
View File
@@ -64,5 +64,5 @@ ACTION=="add", ATTRS{name}=="<device name>", ENV{LIBINPUT_CALIBRATION_MATRIX}="<
```
More info about input transformation can be found in:
* [Ubuntu wiki InputCoordinateTransformation]("https://wiki.ubuntu.com/X/InputCoordinateTransformation")
* [Libinput docs]("https://wayland.freedesktop.org/libinput/doc/1.9.0/absolute_axes.html")
* [Ubuntu wiki InputCoordinateTransformation](https://wiki.ubuntu.com/X/InputCoordinateTransformation)
* [Libinput docs](https://wayland.freedesktop.org/libinput/doc/1.9.0/absolute_axes.html)
+37 -12
View File
@@ -1,31 +1,57 @@
# Installation
#### First steps
Install the screen, following the instructions provided by the manufacturer, Some screens don't neeed extra software but some need to be installed with a script.
It's strongly recommended to test it and ensure your hardware is working with Raspbian, Ubuntu or any distro you like.
Once you stablished that the screen is working, then proceed installing KlipperScreen.
#### Setup Raspberry Pi
This install process is meant for Raspbian non-desktop version aka Raspbian Lite.
This install process is meant for Raspbian non-desktop version aka Raspbian Lite, but it works on other versions.
If you have installed it on the GUI version, then use `sudo raspi-config` to set boot to console by choosing the following options in order:
If you want to use it on Raspbian desktop (GUI version), then 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
```
1System Options
└──S5 Boot / Auto Login
└──B1 Console
```
Note: Other distros will be different on how to boot to console.
### Auto install
#### Installing KlipperScreen with KIAUH
[KIAUH](https://github.com/th33xitus/kiauh) is a tool that helps you install or upgrade Klipper, Moonraker, Mainsail, and other extensions.
![Screenshot](img/install/KIAUH.png)
You can visit [KIAUH on GitHub](https://github.com/th33xitus/kiauh) to learn more and view its documentation.
### Manual Install
#### Klipper and Moonraker Installation
Follow the instructions to install Klipper and Moonraker.
* klipper: https://www.klipper3d.org/Installation.html
* moonraker: https://moonraker.readthedocs.io/en/latest/installation/
In moonraker.conf ensure that 127.0.0.1 is a trusted client for moonraker, such as in this example:
#### Moonraker configuration
In moonraker.conf ensure that 127.0.0.1 is a trusted client:
```
[authorization]
trusted_clients:
127.0.0.1
```
Note: `force_logins: true` requires the moonraker api key in [KlipperScreen.conf](Configuration.md)
If you wish to use the update manager feature of moonraker for KlipperScreen, add the following block into the moonraker
configuration:
If you wish to use the update manager feature of moonraker for KlipperScreen, add the following block to the moonraker.conf:
```
[update_manager KlipperScreen]
type: git_repo
@@ -35,9 +61,11 @@ env: ~/.KlipperScreen-env/bin/python
requirements: scripts/KlipperScreen-requirements.txt
install_script: scripts/KlipperScreen-install.sh
```
Note: you may receive warnings in other UIs since KlipperScreen is not installed yet, you can safely ignore them at this point.
#### KlipperScreen Installation
Execute the following commands:
```
cd ~/
git clone https://github.com/jordanruthe/KlipperScreen.git
@@ -51,7 +79,4 @@ This script will install packages that are listed under manual install, create a
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.
If your screen needs additional software, proceed with the manufacturer instructions if they are provided
and check out the [hardware page](Hardware.md)
At this point KlipperScreen should be working, if it doesn't start then go to the [troubleshooting page](Troubleshooting.md)
+1 -1
View File
@@ -1,6 +1,6 @@
## Create Translations
You can use a editor such as [poedit](https://poedit.net/) to assist in translations. This guide will assume that you
You can use an 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
+9 -6
View File
@@ -19,13 +19,11 @@ Check the file `/var/log/Xorg.0.log` where you can find issues with the X server
xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
```
* Check /etc/X11/Xwrapper.conf
Run `cat /etc/X11/Xwrapper.conf`
* Run `cat /etc/X11/Xwrapper.config`
This should have the line `allowed_users=anybody` in it
* Check /etc/group
Run `cat /etc/group | grep tty`
* Run `cat /etc/group | grep tty`
If your username is not listed under that line, you need to add it with the following command:
@@ -33,6 +31,7 @@ If your username is not listed under that line, you need to add it with the foll
If it's still failing, try: `sudo apt install xserver-xorg-legacy`
As a last resort add `needs_root_rights=yes` to `/etc/X11/Xwrapper.config`
## Screen shows console instead of KlipperScreen
@@ -48,7 +47,7 @@ If you have another fb, try changing it:
for example: change `/dev/fb0` to `/dev/fb1`
Once you have saved that file, restart KlipperScreen and it should show up on your display.
Once you have saved that file, restart KlipperScreen.
## Screen is all white or blank or no signal
@@ -75,7 +74,11 @@ to:
and reboot, that should make the touch work, if your screen is rotated 180 degrees, then you may need to adjust
[the touch rotation](Hardware.md) as described in the Hardware page.
## OctoPrint
KlipperScreen was never intended to be used with OctoPrint, and there is no support for it.
## Other issues
If you found an issue not listed here, or can't make it work, please provide all the log files
a description of your hw, and a description of the issue when asking for support.
a description of your hw, and a description of the issue when asking for support.
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

+2
View File
@@ -0,0 +1,2 @@
jinja2<3.2
mkdocs
+1 -3
View File
@@ -1,5 +1,4 @@
class KlippyGcodes:
HOME = "G28"
HOME_X = "G28 X"
HOME_Y = "G28 Y"
@@ -33,7 +32,6 @@ class KlippyGcodes:
RESTART = "RESTART"
FIRMWARE_RESTART = "FIRMWARE_RESTART"
@staticmethod
def set_bed_temp(temp):
return "%s S%s" % (KlippyGcodes.SET_BED_TEMP, str(temp))
@@ -52,7 +50,7 @@ class KlippyGcodes:
@staticmethod
def set_fan_speed(speed):
speed = str(int(float(int(speed) % 101)/100*255))
speed = str(int(float(int(speed) % 101) / 100 * 255))
return "%s S%s" % (KlippyGcodes.SET_FAN_SPEED, speed)
@staticmethod
+52 -109
View File
@@ -7,7 +7,6 @@ import pathlib
gi.require_version("Gtk", "3.0")
from gi.repository import Gdk, GdkPixbuf, Gio, Gtk, Pango
klipperscreendir = pathlib.Path(__file__).parent.resolve().parent
class KlippyGtk:
labels = {}
@@ -19,7 +18,8 @@ class KlippyGtk:
self.screen = screen
self.width = width
self.height = height
self.theme = theme
self.themedir = os.path.join(pathlib.Path(__file__).parent.resolve().parent, "styles", theme, "images")
if self.screen.vertical_mode:
self.font_ratio = [33, 49]
else:
@@ -30,7 +30,7 @@ class KlippyGtk:
))
if fontsize_type == "small":
self.font_size = round(self.font_size * 0.91)
elif (fontsize_type == "large"):
elif fontsize_type == "large":
self.font_size = round(self.font_size * 1.09)
self.header_size = int(round((self.width / self.width_ratio) / 1.33))
self.img_width = int(round(self.width / self.width_ratio))
@@ -47,7 +47,7 @@ class KlippyGtk:
for key in self.color_list:
if "base" in self.color_list[key]:
rgb = [int(self.color_list[key]['base'][i:i+2], 16) for i in range(0, 6, 2)]
rgb = [int(self.color_list[key]['base'][i:i + 2], 16) for i in range(0, 6, 2)]
self.color_list[key]['rgb'] = rgb
logging.debug("img width: %s height: %s" % (self.img_width, self.img_height))
@@ -90,14 +90,14 @@ class KlippyGtk:
rgb[1] = rgb[1] + self.color_list[device]['hsplit'] * self.color_list[device]['state']
self.color_list[device]['state'] += 1
color = '{:02X}{:02X}{:02X}'.format(rgb[0], rgb[1], rgb[2])
rgb = [x/255 for x in rgb]
rgb = [x / 255 for x in rgb]
# logging.debug("Assigning color: %s %s %s" % (device, rgb, color))
else:
colors = self.color_list[device]['colors']
if self.color_list[device]['state'] >= len(colors):
self.color_list[device]['state'] = 0
color = colors[self.color_list[device]['state'] % len(colors)]
rgb = [int(color[i:i+2], 16)/255 for i in range(0, 6, 2)]
rgb = [int(color[i:i + 2], 16) / 255 for i in range(0, 6, 2)]
self.color_list[device]['state'] += 1
# logging.debug("Assigning color: %s %s %s" % (device, rgb, color))
@@ -107,84 +107,46 @@ class KlippyGtk:
for key in self.color_list:
self.color_list[key]['state'] = 0
def Label(self, label, style=None):
la = Gtk.Label(label)
if style is not None and style is not False:
if style is not None:
la.get_style_context().add_class(style)
return la
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(
os.path.join(klipperscreendir, "styles", self.theme, "images", str(image_name) + ".svg"),
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_markup(text)
box1.add(image)
box1.add(label)
if style is not False:
ctx = box1.get_style_context()
ctx.add_class(style)
return {"l": label, "b": box1}
def ImageMenuButton(self, image_name, text, size=20, style=False, width_scale=.32, height_scale=.32, popover=False):
box1 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=15)
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
os.path.join(klipperscreendir, "styles", self.theme, "images", str(image_name) + ".svg"),
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
image = Gtk.Image.new_from_pixbuf(pixbuf)
mb = Gtk.MenuButton(label="", popover=popover)
label = mb.get_label()
box1.add(image)
box1.add(mb)
if style is not False:
ctx = box1.get_style_context()
ctx.add_class(style)
return {"l": label, "mb": mb, "b": box1}
def Image(self, image_name, style=False, width_scale=1, height_scale=1):
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
os.path.join(klipperscreendir, "styles", self.theme, "images", 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)
def Image(self, image_name, scale=1.0):
filename = os.path.join(self.themedir, str(image_name) + ".svg")
if os.path.exists(filename):
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename,
int(round(self.img_width * scale)),
int(round(self.img_height * scale)),
True)
return Gtk.Image.new_from_pixbuf(pixbuf)
else:
logging.error("Unable to find image %s", filename)
return Gtk.Image()
def PixbufFromFile(self, filename, 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 PixbufFromHttp(self, resource, style=False, width_scale=1, height_scale=1):
def PixbufFromHttp(self, resource, width_scale=1, height_scale=1):
response = self.screen.apiclient.get_thumbnail_stream(resource)
if response is False:
return None
stream = Gio.MemoryInputStream.new_from_data(response, None)
pixbuf = GdkPixbuf.Pixbuf.new_from_stream_at_scale(
stream, int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
pixbuf = GdkPixbuf.Pixbuf.new_from_stream_at_scale(stream,
int(round(self.img_width * width_scale)),
int(round(self.img_height * height_scale)),
True)
return pixbuf
def ProgressBar(self, style=False):
def ProgressBar(self, style=None):
bar = Gtk.ProgressBar()
if style is not False:
if style is not None:
ctx = bar.get_style_context()
ctx.add_class(style)
@@ -202,31 +164,16 @@ class KlippyGtk:
b.connect("clicked", self.screen.reset_screensaver_timeout)
return b
def ButtonImage(self, image_name, label=None, style=None, width_scale=1.38, height_scale=1.38,
def ButtonImage(self, image_name, label=None, style=None, scale=1.38,
position=Gtk.PositionType.TOP, word_wrap=True):
filename = os.path.join(klipperscreendir, "styles", self.theme, "images", str(image_name) + ".svg")
if not os.path.exists(filename):
logging.error("Unable to find button image (theme, image): (%s, %s)" % (self.theme, str(image_name)))
filename = os.path.join(klipperscreendir, "styles", self.theme, "images", "warning.svg")
b = Gtk.Button(label=label)
if os.path.exists(filename):
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.set_image(img)
b.set_hexpand(True)
b.set_vexpand(True)
b.set_can_focus(False)
b.set_image(self.Image(image_name, scale))
b.set_image_position(position)
b.set_always_show_image(True)
b.props.relief = Gtk.ReliefStyle.NONE
if word_wrap is True:
try:
@@ -254,7 +201,7 @@ class KlippyGtk:
button = dialog.get_children()[0].get_children()[0].get_children()[0].get_children()[i]
button.get_child().set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
button.get_child().set_line_wrap(True)
button.set_size_request((screen.width-30)/3, screen.height/5)
button.set_size_request((screen.width - 30) / 3, screen.height / 5)
dialog.connect("response", callback, *args)
dialog.get_style_context().add_class("dialog")
@@ -275,28 +222,17 @@ class KlippyGtk:
return dialog
def ToggleButtonImage(self, image_name, label, style=False, width_scale=1.38, height_scale=1.38):
filename = os.path.join(klipperscreendir, "styles", self.theme, "images", str(image_name) + ".svg")
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)
def ToggleButtonImage(self, image_name, label, style=None, scale=1.38):
b = Gtk.ToggleButton(label=label)
b.set_image(img)
b.set_hexpand(True)
b.set_vexpand(True)
b.set_can_focus(False)
b.set_image(self.Image(image_name, scale))
b.set_image_position(Gtk.PositionType.TOP)
b.set_always_show_image(True)
b.props.relief = Gtk.ReliefStyle.NONE
if style is not False:
if style is not None:
ctx = b.get_style_context()
ctx.add_class(style)
@@ -319,6 +255,14 @@ class KlippyGtk:
b.connect("clicked", self.screen.reset_screensaver_timeout)
return b
def ScrolledWindow(self):
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
return scroll
def formatFileName(self, name):
name = name.split('/')[-1] if "/" in name else name
name = name.split('.gcod')[0] if ".gcode" in name else name
@@ -326,21 +270,20 @@ class KlippyGtk:
return name[0:25] + "\n" + name[25:50]
return name
def formatTimeString(self, seconds):
time = int(seconds)
text = ""
if int(time/86400) != 0:
text += str(int(time/86400))+"d "
if int(time/3600) != 0:
text += str(int(time/3600) % 24)+"h "
if int(time/60) != 0:
text += str(int(time/60) % 60)+"m "
if int(time / 86400) != 0:
text += str(int(time / 86400)) + "d "
if int(time / 3600) != 0:
text += str(int(time / 3600) % 24) + "h "
if int(time / 60) != 0:
text += str(int(time / 60) % 60) + "m "
else:
text = str(time % 60)+"s"
text = str(time % 60) + "s"
return text
def formatTemperatureString(self, temp, target):
if (target > temp-2 and target < temp+2) or round(target, 0) == 0:
if (temp - 2 < target < temp + 2) or round(target, 0) == 0:
return str(round(temp, 1)) + "°C" # °C →"
return str(round(temp)) + " °C\n(" + str(round(target)) + ")"
+5 -2
View File
@@ -2,6 +2,7 @@ import json
import requests
import logging
class KlippyRest:
def __init__(self, ip, port=7125, api_key=False):
self.ip = ip
@@ -34,7 +35,8 @@ class KlippyRest:
headers = {} if self.api_key is False else {"x-api-key": self.api_key}
try:
r = requests.get(url, headers=headers)
except Exception:
except Exception as e:
logging.critical(e, exc_info=True)
return False
if r.status_code != 200:
return False
@@ -42,7 +44,8 @@ class KlippyRest:
# TODO: Try/except
try:
data = json.loads(r.content)
except Exception:
except Exception as e:
logging.critical(e, exc_info=True)
logging.exception("Unable to parse response from moonraker:\n %s" % r.content)
return False
+7 -3
View File
@@ -26,6 +26,7 @@ api = {
}
}
class KlippyWebsocket(threading.Thread):
_req_id = 0
connected = False
@@ -70,11 +71,12 @@ class KlippyWebsocket(threading.Thread):
if self.reconnect_count > 3:
self._screen.panels['splash_screen'].update_text(
_("Cannot connect to Moonraker") +
("\n\n%s\n\n") % self._url +
"\n\n%s\n\n" % self._url +
_("Retry #%s") % self.reconnect_count)
return False
token = self._screen.apiclient.get_oneshot_token()
except Exception:
except Exception as e:
logging.critical(e, exc_info=True)
logging.debug("Unable to get oneshot token")
return False
@@ -86,7 +88,8 @@ class KlippyWebsocket(threading.Thread):
try:
logging.debug("Starting websocket thread")
self._wst.start()
except Exception:
except Exception as e:
logging.critical(e, exc_info=True)
logging.debug("Error starting web socket")
def close(self):
@@ -193,6 +196,7 @@ class KlippyWebsocket(threading.Thread):
def on_error(self, ws, error):
logging.debug("Websocket error: %s" % error)
class MoonrakerApi:
def __init__(self, ws):
self._ws = ws
+38 -34
View File
@@ -12,19 +12,21 @@ from io import StringIO
from os import path
SCREEN_BLANKING_OPTIONS = [
"300", # 5 Minutes
"900", # 15 Minutes
"1800", # 30 Minutes
"3600", # 1 Hour
"7200", # 2 Hours
"300", # 5 Minutes
"900", # 15 Minutes
"1800", # 30 Minutes
"3600", # 1 Hour
"7200", # 2 Hours
"14400", # 4 Hours
]
klipperscreendir = pathlib.Path(__file__).parent.resolve().parent
class ConfigError(Exception):
pass
class KlipperScreenConfig:
config = None
configfile_name = "KlipperScreen.conf"
@@ -103,23 +105,17 @@ class KlipperScreenConfig:
_n = self.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"}},
{"language": {"section": "main", "name": _("Language"), "type": "dropdown", "value": "system_lang",
"callback": screen.restart_warning, "options": [
{"name": _("System") + " " + _("(default)"), "value": "system_lang"}
]}},
{"move_speed_xy": {
"section": "main", "name": _("XY Move Speed (mm/s)"), "type": "scale", "value": "20",
"range": [5, 200], "step": 1}},
{"move_speed_z": {
"section": "main", "name": _("Z Move Speed (mm/s)"), "type": "scale", "value": "20",
"range": [5, 200], "step": 1}},
{"print_sort_dir": {"section": "main", "type": None, "value": "name_asc"}},
{"language": {
"section": "main", "name": _("Language"), "type": "dropdown", "value": "system_lang",
"callback": screen.restart_warning, "options": [
{"name": _("System") + " " + _("(default)"), "value": "system_lang"}]}},
{"theme": {
"section": "main", "name": _("Icon Theme"), "type": "dropdown",
"value": "z-bolt", "callback": screen.restart_warning, "options": [
{"name": "Z-bolt" + " " + _("(default)"), "value": "z-bolt"}]}},
{"print_estimate_method": {
"section": "main", "name": _("Estimated Time Method"), "type": "dropdown",
"value": "file", "options": [
"value": "auto", "options": [
{"name": _("Auto") + " " + _("(default)"), "value": "auto"},
{"name": _("File"), "value": "file"},
{"name": _("Filament Used"), "value": "filament"},
@@ -129,10 +125,6 @@ class KlipperScreenConfig:
"value": "3600", "callback": screen.set_screenblanking_timeout, "options": [
{"name": _("Off"), "value": "off"}]
}},
{"theme": {
"section": "main", "name": _("Icon Theme"), "type": "dropdown",
"value": "z-bolt", "callback": screen.restart_warning, "options": [
{"name": "Z-bolt" + " " + _("(default)"), "value": "z-bolt"}]}},
{"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary", "value": "True"}},
{"side_macro_shortcut": {
"section": "main", "name": _("Macro shortcut on sidebar"), "type": "binary",
@@ -152,13 +144,26 @@ class KlipperScreenConfig:
{"print_estimate_compensation": {
"section": "main", "name": _("Slicer Time correction (%)"), "type": "scale", "value": "100",
"range": [50, 150], "step": 1}},
# {"": {"section": "main", "name": _(""), "type": ""}}
]
# Options that are in panels and shouldn't be added to the main settings
panel_options = [
{"invert_x": {"section": "main", "name": _("Invert X"), "type": None, "value": "False"}},
{"invert_y": {"section": "main", "name": _("Invert Y"), "type": None, "value": "False"}},
{"invert_z": {"section": "main", "name": _("Invert Z"), "type": None, "value": "False"}},
{"move_speed_xy": {"section": "main", "name": _("XY Move Speed (mm/s)"), "type": None, "value": "50"}},
{"move_speed_z": {"section": "main", "name": _("Z Move Speed (mm/s)"), "type": None, "value": "10"}},
{"print_sort_dir": {"section": "main", "type": None, "value": "name_asc"}},
]
self.configurable_options.extend(panel_options)
lang_path = os.path.join(klipperscreendir, "ks_includes", "locales")
langs = [d for d in os.listdir(lang_path) if not os.path.isfile(os.path.join(lang_path, d))]
langs.sort()
lang_opt = self.configurable_options[3]['language']['options']
lang_opt = self.configurable_options[0]['language']['options']
for lang in langs:
lang_opt.append({"name": lang, "value": lang})
@@ -166,7 +171,7 @@ class KlipperScreenConfig:
t_path = os.path.join(klipperscreendir, 'styles')
themes = [d for d in os.listdir(t_path) if (not os.path.isfile(os.path.join(t_path, d)) and d != "z-bolt")]
themes.sort()
theme_opt = self.configurable_options[9]['theme']['options']
theme_opt = self.configurable_options[1]['theme']['options']
for theme in themes:
theme_opt.append({"name": theme, "value": theme})
@@ -174,11 +179,11 @@ class KlipperScreenConfig:
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)
hour = int(int(num) / 3600)
if hour > 0:
name = str(hour) + " " + _n("hour", "hours", hour)
else:
name = str(int(int(num)/60)) + " " + _("minutes")
name = str(int(int(num) / 60)) + " " + _("minutes")
self.configurable_options[index]['screen_blanking']['options'].append({
"name": name,
"value": num
@@ -255,7 +260,7 @@ class KlipperScreenConfig:
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):])
saved_def.append(line[(len(self.do_not_edit_prefix) + 1):])
return ["\n".join(user_def), None if saved_def is None else "\n".join(saved_def)]
def get_config_file_location(self, file):
@@ -309,7 +314,6 @@ class KlipperScreenConfig:
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)]
@@ -443,10 +447,10 @@ class KlipperScreenConfig:
return False
cfg = self.config[name]
item = {
"extruder": cfg.getint("extruder", 0),
"bed": cfg.getint("bed", 0),
"heater_generic": cfg.getint("heater_generic", 0),
"temperature_fan": cfg.getint("temperature_fan", 0),
"extruder": cfg.getint("extruder", None),
"bed": cfg.getint("bed", None),
"heater_generic": cfg.getint("heater_generic", None),
"temperature_fan": cfg.getint("temperature_fan", None),
"gcode": cfg.get("gcode", None)
}
return item
+26 -1
View File
@@ -154,6 +154,12 @@ name: {{ gettext('Network') }}
icon: network
panel: network
[menu __main config retraction]
name: {{ gettext('Retraction') }}
icon: retract
panel: retraction
enable: {{ printer.firmware_retraction }}
[menu __main config system]
name: {{ gettext('System') }}
icon: info
@@ -165,7 +171,7 @@ icon: complete
method: printer.gcode.script
params: {"script":"SAVE_CONFIG"}
confirm:
{{ gettext('Save configuration') }}
{{ gettext('Save configuration?') }}
{{ gettext('Klipper will reboot') }}
@@ -174,6 +180,12 @@ name: {{ gettext('Settings') }}
icon: settings
panel: settings
[menu __main config input_shaper]
name: {{ gettext('Input Shaper') }}
icon: move
panel: input_shaper
enable: {{ printer.input_shaper }}
[menu __print]
name: {{ gettext('Print Control') }}
@@ -189,6 +201,12 @@ icon: fan
panel: fan
enable: {{ printer.fans.count > 0 }}
[menu __print move]
name: {{ gettext('Move') }}
icon: move
panel: move
enable: {{ (printer.pause_resume.is_paused == True) }}
[menu __print extrude]
name: {{ gettext('Extrude') }}
icon: filament
@@ -222,6 +240,12 @@ name: {{ gettext('Network') }}
icon: network
panel: network
[menu __print retraction]
name: {{ gettext('Retraction') }}
icon: retract
panel: retraction
enable: {{ printer.firmware_retraction }}
[menu __print system]
name: {{ gettext('System') }}
icon: info
@@ -250,6 +274,7 @@ panel: network
name: {{ gettext('System') }}
icon: info
panel: system
enable: {{ moonraker_connected }}
[menu __splashscreen settings]
name: {{ gettext('Settings') }}
+9 -13
View File
@@ -2,20 +2,17 @@ import logging
import os
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import GLib
class KlippyFiles():
class KlippyFiles:
def __init__(self, screen):
self._screen = screen
self.callbacks = []
self.files = {}
self.filelist = []
self.thumbnail_dir = "/tmp/.KS-thumbnails"
if not os.path.exists(self.thumbnail_dir):
os.makedirs(self.thumbnail_dir)
self.gcodes_path = None
def initialize(self):
@@ -23,7 +20,7 @@ class KlippyFiles():
if "virtual_sdcard" in self._screen.printer.get_config_section_list():
vsd = self._screen.printer.get_config_section("virtual_sdcard")
if "path" in vsd:
self.gcodes_path = vsd['path']
self.gcodes_path = os.path.expanduser(vsd['path'])
logging.info("Gcodes path: %s" % self.gcodes_path)
def reset(self):
@@ -31,7 +28,6 @@ class KlippyFiles():
self.callbacks = None
self.files = None
self.filelist = None
self.thumbnail_dir = None
self.gcodes_path = None
self._screen = None
@@ -150,11 +146,11 @@ class KlippyFiles():
return True
return False
def get_thumbnail_location(self, filename):
if not self.has_thumbnail(filename):
return None
def get_thumbnail_location(self, filename, small=False):
thumb = self.files[filename]['thumbnails'][0]
if small and len(self.files[filename]['thumbnails']) > 1:
if self.files[filename]['thumbnails'][0]['width'] > self.files[filename]['thumbnails'][1]['width']:
thumb = self.files[filename]['thumbnails'][1]
if thumb['local'] is False:
return ['http', thumb['path']]
return ['file', thumb['path']]
@@ -183,7 +179,7 @@ class KlippyFiles():
self.run_callbacks(deletedfiles=[filename])
def ret_file_data(self, filename):
print("Getting file info for %s" % (filename))
print("Getting file info for %s" % filename)
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
def run_callbacks(self, newfiles=[], deletedfiles=[], mods=[]):
+18 -4
View File
@@ -17,6 +17,7 @@ try:
ctypes.cdll.LoadLibrary('libXext.so.6')
libXext = ctypes.CDLL('libXext.so.6')
class DPMS_State:
Fail = -1
On = 0
@@ -24,6 +25,7 @@ try:
Suspend = 2
Off = 3
def get_DPMS_state(display_name_in_byte_string=b':0'):
state = DPMS_State.Fail
if not isinstance(display_name_in_byte_string, bytes):
@@ -35,8 +37,8 @@ try:
dummy1_i_p = ctypes.create_string_buffer(8)
dummy2_i_p = ctypes.create_string_buffer(8)
if display.value:
if libXext.DPMSQueryExtension(display, dummy1_i_p, dummy2_i_p)\
and libXext.DPMSCapable(display):
if libXext.DPMSQueryExtension(display, dummy1_i_p, dummy2_i_p) \
and libXext.DPMSCapable(display):
onoff_p = ctypes.create_string_buffer(1)
state_p = ctypes.create_string_buffer(2)
if libXext.DPMSInfo(display, state_p, onoff_p):
@@ -45,14 +47,18 @@ try:
state = struct.unpack('H', state_p.raw)[0]
libXext.XCloseDisplay(display)
return state
dpms_loaded = True
except Exception:
pass
def get_network_interfaces():
stream = os.popen("ip addr | grep ^'[0-9]' | cut -d ' ' -f 2 | grep -o '[a-zA-Z0-9\\.]*'")
return [i for i in stream.read().strip().split('\n') if not i.startswith('lo')]
def get_wireless_interfaces():
p = subprocess.Popen(["which", "iwconfig"], stdout=subprocess.PIPE)
@@ -64,7 +70,8 @@ def get_wireless_interfaces():
try:
p = subprocess.Popen(["iwconfig"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result = p.stdout.read().decode('ascii').split('\n')
except Exception:
except Exception as e:
logging.critical(e, exc_info=True)
logging.info("Error with running iwconfig command")
return None
interfaces = []
@@ -75,6 +82,7 @@ def get_wireless_interfaces():
return interfaces
def get_software_version():
prog = ('git', '-C', os.path.dirname(__file__), 'describe', '--always',
'--tags', '--long', '--dirty')
@@ -94,6 +102,7 @@ def get_software_version():
logging.exception("Error runing git describe")
return "?"
def patch_threading_excepthook():
"""Installs our exception handler into the threading modules Thread object
Inspired by https://bugs.python.org/issue1230540
@@ -111,15 +120,18 @@ def patch_threading_excepthook():
raise
except Exception:
sys.excepthook(*sys.exc_info(), thread_identifier=threading.get_ident())
self.run = run_with_excepthook
threading.Thread.__init__ = new_init
# Timed rotating file handler based on Klipper and Moonraker's implementation
class KlipperScreenLoggingHandler(logging.handlers.TimedRotatingFileHandler):
def __init__(self, software_version, filename, **kwargs):
super(KlipperScreenLoggingHandler, self).__init__(filename, **kwargs)
self.rollover_info = {
'header': f"{'-'*20}KlipperScreen Log Start{'-'*20}",
'header': f"{'-' * 20}KlipperScreen Log Start{'-' * 20}",
'version': f"Git Version: {software_version}",
}
lines = [line for line in self.rollover_info.values() if line]
@@ -135,6 +147,7 @@ class KlipperScreenLoggingHandler(logging.handlers.TimedRotatingFileHandler):
if self.stream is not None:
self.stream.write("\n".join(lines) + "\n")
# Logging based on Arksine's logging setup
def setup_logging(log_file, software_version):
root_logger = logging.getLogger()
@@ -164,6 +177,7 @@ def setup_logging(log_file, software_version):
def logging_exception_handler(type, value, tb, thread_identifier=None):
logging.exception(
"Uncaught exception %s: %s\nTraceback: %s" % (type, value, "\n".join(traceback.format_tb(tb))))
sys.excepthook = logging_exception_handler
logging.captureWarnings(True)
+1 -1
View File
@@ -323,7 +323,7 @@ msgstr ""
msgid "Main Menu"
msgstr ""
msgid "Max Accelation"
msgid "Max Acceleration"
msgstr ""
msgid "Max Acceleration to Deceleration"
@@ -202,7 +202,7 @@ msgid ""
"Restart"
msgstr ""
"Firmware\n"
"Újrakezd"
"Újraindítása"
msgid "Font Size"
msgstr "Betűméret"
@@ -215,7 +215,7 @@ msgstr ""
"Frissítés"
msgid "Go Back"
msgstr "Menj vissza"
msgstr "Visszalépés"
msgid "Hidden"
msgstr "Rejtett"
@@ -282,7 +282,7 @@ msgid ""
"Restart"
msgstr ""
"Klipper\n"
"Újrakezd"
"Újraindítása"
msgid "Klipper has disconnected"
msgstr "Klipper szétkapcsolt"
@@ -491,7 +491,7 @@ msgid "Slicer"
msgstr "Szeletelő"
msgid "Slicer Time correction (%)"
msgstr "Szeletelő idő korrekciója (%)"
msgstr "Szeletelő idő javítása (%)"
msgid "Small"
msgstr "Kicsi"
@@ -566,9 +566,8 @@ msgid "Up To Date"
msgstr "Naprakész"
msgid "Update"
msgstr "Frissítés"
msgstr "Frissít"
#, fuzzy
msgid "Updating"
msgstr "Frissítés"
@@ -603,7 +602,7 @@ msgid "Z Position"
msgstr "Z Pozíció"
msgid "Z Tilt"
msgstr "Z Dönt"
msgstr "Z Dőlés"
msgid "Z+"
msgstr "Z+"
@@ -0,0 +1,633 @@
msgid ""
msgstr ""
"Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-03-31 11:25-0300\n"
"PO-Revision-Date: \n"
"Last-Translator: NSteven\n"
"Language-Team: NSteven\n"
"Language: ko_KR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.0.1\n"
#, python-format
msgid "%s will be updated to version"
msgstr "%s 버전으로 업데이트될 것입니다"
msgid "(default)"
msgstr "(기본)"
msgid "24 Hour Time"
msgstr "24시간제"
msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "펌웨어 재시작을 사용하여 문제를 해결할 수 있습니다."
msgid "Abort"
msgstr "중단"
msgid "Accept"
msgstr "수락"
msgid "Actions"
msgstr "동작"
msgid "Add Printer"
msgstr "프린터 추가"
msgid "Add bed mesh profile"
msgstr "배드 메시 프로필 추가"
msgid "Are you sure you want to run Emergency Stop?"
msgstr "비상정지를 실행하시겠습니까?"
msgid "Are you sure you wish to cancel this print?"
msgstr "이 출력을 취소하시겠습니까?"
msgid "Are you sure you wish to disable motors?"
msgstr "모터를 비활성화하시겠습니까?"
msgid "Are you sure you wish to reboot the system?"
msgstr "시스템을 재시작하시겠습니까?"
msgid "Are you sure you wish to shutdown the system?"
msgstr "시스템을 종료하시겠습니까?"
msgid "Auto"
msgstr "자동"
msgid "Auto-scroll"
msgstr "자동스크롤"
msgid "Bed Level"
msgstr "배드 레벨"
msgid "Bed Mesh"
msgstr "배드 메시"
msgid "Bltouch found applied offset"
msgstr "Bltouch가 오프셋을 찾음"
msgid "Calibrate"
msgstr "교정"
msgid "Calibrated, save configuration to make it permanent"
msgstr "교정됨, 설정을 영구적으로 저장합니다"
msgid "Can't set above the maximum:"
msgstr "최대값보다 높게 설정할 수 없습니다:"
msgid "Cancel"
msgstr "취소"
msgid "Cancel Print"
msgstr "출력 취소"
msgid "Cancelled"
msgstr "취소됨"
msgid "Cancelling"
msgstr "취소중"
msgid "Cannot connect to Moonraker"
msgstr "Moonraker에 연결할 수 없음"
msgid "Channel"
msgstr "채널"
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
"자세한 내용은 /tmp/KlipperScreen.log를 참조하십시오.\n"
"GitHub에 현재 발생한 이슈를 제출하여 도움을 요청하십시오."
msgid "Close"
msgstr "닫기"
msgid "Complete"
msgstr "완료"
msgid "Configuration"
msgstr "환경설정"
msgid "Confirm Emergency Stop"
msgstr "비상정지 확인"
msgid "Connected"
msgstr "연결됨"
#, python-format
msgid "Connecting to %s"
msgstr "%s에 연결중"
msgid "Console"
msgstr "콘솔"
msgid "Continue"
msgstr "계속"
msgid "Cooldown"
msgstr "냉각"
msgid "Date"
msgstr "날짜"
msgid "Decrease"
msgstr "감소"
msgid "Delete"
msgstr "삭제"
msgid "Deselect"
msgstr "선택해제"
msgid "Disable Motors"
msgstr "모터 비활성화"
msgid "Disable XY"
msgstr "XY 비활성화"
msgid "Displayed Macros"
msgstr "표시할 매크로"
msgid "Distance (mm)"
msgstr "거리 (mm)"
#, python-format
msgid "Do you want to recover %s?"
msgstr "%s을(를) 복구하시겠습니까?"
msgid "Elapsed:"
msgstr "경과:"
msgid "Error"
msgstr "오류"
msgid "Estimated Time Method"
msgstr "예상시간 표기"
msgid "Extrude"
msgstr "압출"
msgid "Extrusion +"
msgstr "압출 +"
msgid "Extrusion -"
msgstr "압출 -"
msgid "Failed, adjust position first"
msgstr "실패, 먼저 위치를 조정하십시오."
msgid "Fan"
msgstr "팬"
msgid "Filament Used"
msgstr "필라멘트 사용된 양"
msgid "File"
msgstr "파일"
msgid "Fine Tuning"
msgstr "미세 조정"
msgid "Finish"
msgstr "완료됨"
msgid ""
"Firmware\n"
"Restart"
msgstr ""
"펌웨어\n"
"재시작"
msgid "Font Size"
msgstr "폰트 크기"
msgid ""
"Full\n"
"Update"
msgstr ""
"전체\n"
"업데이트"
msgid "Go Back"
msgstr "뒤로"
msgid "Hidden"
msgstr "숨김"
msgid "Hide"
msgstr "가리기"
msgid "Hide sensors in Temp."
msgstr "온도에서 센서들 가리기"
msgid "Home"
msgstr "홈"
msgid "Home All"
msgstr "전체 홈"
msgid "Home X"
msgstr "X축 홈"
msgid "Home XY"
msgstr "XY축 홈"
msgid "Home Y"
msgstr "Y축 홈"
msgid "Home Z"
msgstr "Z축 홈"
msgid "Homing"
msgstr "호밍"
msgid "Hostname"
msgstr "호스트 이름"
msgid "Icon Theme"
msgstr "아이콘 테마"
msgid "Increase"
msgstr "증가"
msgid "Initializing"
msgstr "초기화중"
msgid "Initializing printer..."
msgstr "프린터 초기화중…"
msgid "Interface"
msgstr "인터페이스"
msgid "Invalid"
msgstr "올바르지 않음"
msgid "Invert X"
msgstr "X축 반전"
msgid "Invert Y"
msgstr "Y축 반전"
msgid "Invert Z"
msgstr "Z축 반전"
msgid ""
"Klipper\n"
"Restart"
msgstr ""
"Klipper\n"
"재시작"
msgid "Klipper has disconnected"
msgstr "Klipper와 연결이 끊어졌습니다"
msgid "Klipper has encountered an error."
msgstr "Klipper에 오류가 발생했습니다."
msgid "Klipper has shutdown"
msgstr "Klipper가 종료되었습니다"
msgid "Klipper is attempting to start"
msgstr "Klipper 시작하는 중"
msgid "Klipper will reboot"
msgstr "Klipper를 다시 시작합니다"
msgid "Language"
msgstr "언어"
msgid "Large"
msgstr "크게"
msgid "Left:"
msgstr "남음:"
msgid "Limits"
msgstr "제한"
msgid "Load"
msgstr "로드"
msgid "Lower Nozzle"
msgstr "노즐 낮춤"
msgid "Macro shortcut on sidebar"
msgstr "사이드바 매크로 바로가기"
msgid "Macros"
msgstr "매크로"
msgid "Main Menu"
msgstr "메인메뉴"
msgid "Max Accelation"
msgstr "최대 가속"
msgid "Max Acceleration to Deceleration"
msgstr "최대 가속에서 감속까지"
msgid "Max Velocity"
msgstr "최대 속도"
msgid "Medium"
msgstr "중간"
msgid "Menu"
msgstr "메뉴"
msgid "Modified"
msgstr "수정됨"
msgid "Moonraker: connected"
msgstr "Moonraker: 연결됨"
msgid "Move"
msgstr "이동"
msgid "Move Distance (mm)"
msgstr "이동 거리 (mm)"
msgid "Name"
msgstr "이름"
msgid "Network"
msgstr "네트워크"
msgid "Nothing selected"
msgstr "아무것도 선택되지않음"
msgid "Off"
msgstr "끔"
#, python-format
msgid "Outdated by %d"
msgstr "%d에 의해 오래된 커밋"
msgid "PSK for"
msgstr "PSK 비번:"
msgid "Package will be updated"
msgid_plural "Packages will be updated"
msgstr[0] "패키지가 업데이트됩니다"
msgid "Password saved"
msgstr "비번 저장됨"
msgid "Pause"
msgstr "일시정지"
msgid "Paused"
msgstr "일시정지됨"
msgid "Perform a full upgrade?"
msgstr "전체 업그레이드를 수행하겠습니까?"
msgid "Please recompile and flash the micro-controller."
msgstr "마이크로 컨트롤러를 다시 컴파일하고 플래시하십시오."
msgid "Power"
msgstr "전"
msgid "Power On Printer"
msgstr "프린터 전원 켜기"
msgid "Print"
msgstr "출력"
msgid "Print Control"
msgstr "출력 제어"
msgid "Print Time"
msgstr "출력 시간"
msgid "Printer Connections"
msgstr "프린터 연결"
msgid "Printing"
msgstr "출력중"
msgid "Probe found applied offset"
msgstr "프로브가 오프셋을 찾았습니다"
msgid "Profile Name:"
msgstr "프로파일 이름:"
msgid "Quad Gantry Level"
msgstr "쿼드 갠트리 레벨"
msgid "Raise Nozzle"
msgstr "노즐 높임"
msgid "Recover Hard"
msgstr "하드하게 복원"
msgid "Recover Soft"
msgstr "부드럽게 복원"
msgid "Reference"
msgstr "레퍼런스"
msgid "Restart"
msgstr "재시작"
msgid "Resume"
msgstr "재개"
msgid "Retract"
msgstr "철회"
#, python-format
msgid "Retry #%s"
msgstr "재시도 #%s"
msgid "Save"
msgstr "저장"
msgid "Save Config"
msgstr "설정 저장"
msgid "Save configuration"
msgstr "설\b정을 저장합니다"
msgid "Screen DPMS"
msgstr "화면 DPMS"
msgid "Screen Power Off Time"
msgstr "화면이 꺼지는 시간"
msgid "Screws Adjust"
msgstr "스크류 조정"
msgid "Select"
msgstr "선택"
msgid "Send"
msgstr "보내기"
#, python-format
msgid "Sending Power ON signal to: %s"
msgstr "전원 켜기 신호를 보내는 중: %s"
msgid "Set Temp"
msgstr "온도 설정"
msgid "Settings"
msgstr "설정"
msgid "Show"
msgstr "보기"
msgid "Size"
msgstr "크기"
msgid "Slicer"
msgstr "슬라이서"
msgid "Slicer Time correction (%)"
msgstr "슬라이서 시간 보정(%)"
msgid "Small"
msgstr "작은"
msgid "Sort by: "
msgstr "분류 기준:"
msgid "Speed (mm/s)"
msgstr "속도 (mm/s)"
msgid "Speed +"
msgstr "속도 +"
msgid "Speed -"
msgstr "속도 -"
msgid "Square Corner Velocity"
msgstr "사각 모서리 속도"
msgid "Start"
msgstr "시작"
msgid "Starting WiFi Association"
msgstr "WiFi 연결을 시작하는 중"
msgid "Starting recovery for"
msgstr "복구 시작 중:"
msgid "Starting update for"
msgstr "업데이트 시작 중:"
msgid "System"
msgstr "시스템"
msgid ""
"System\n"
"Restart"
msgstr ""
"시스템\n"
"재시작"
msgid ""
"System\n"
"Shutdown"
msgstr ""
"시스템\n"
"종료"
msgid "Temp (°C)"
msgstr "온도 (°C)"
msgid "Temperature"
msgstr "온도"
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "%s을(를) 적용하려면 KlipperScreen을(를) 다시 시작해야 합니다."
msgid "Tool"
msgstr "툴"
msgid "Total:"
msgstr "총:"
msgid "Unknown Heater"
msgstr "알 수 없는 히터"
msgid "Unload"
msgstr "언로드"
msgid "Up To Date"
msgstr "최신버전"
msgid "Update"
msgstr "업데이트"
msgid "Updating"
msgstr "업데이트중"
msgid "Uploaded"
msgstr "업로드됨"
msgid "View Mesh"
msgstr "메쉬 보기"
msgid "X+"
msgstr "X+"
msgid "X-"
msgstr "X-"
msgid "XY Move Speed (mm/s)"
msgstr "XY 이동 속도 (mm/s)"
msgid "Y+"
msgstr "Y+"
msgid "Y-"
msgstr "Y-"
msgid "Z Calibrate"
msgstr "Z 교정"
msgid "Z Move Speed (mm/s)"
msgstr "Z 이동 속도 (mm/s)"
msgid "Z Position"
msgstr "Z 위치"
msgid "Z Tilt"
msgstr "Z 기울기"
msgid "Z+"
msgstr "Z+"
msgid "Z-"
msgstr "Z-"
msgid "commit"
msgid_plural "commits"
msgstr[0] "결정"
msgid "dBm"
msgstr "dBm"
msgid "hour"
msgid_plural "hours"
msgstr[0] "시간"
msgid "minutes"
msgstr "분"
msgid "mm"
msgstr "mm"
msgid "mm/s"
msgstr "mm/s"
msgid "mm/s^2"
msgstr "mm/s^2"
@@ -0,0 +1,673 @@
# 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: 2022-03-31 11:25-0300\n"
"PO-Revision-Date: 2022-04-15 17:25+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: sv_SE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.0.1\n"
#, python-format
msgid "%s will be updated to version"
msgstr "%s uppdateras till version"
msgid "(default)"
msgstr "(standard)"
msgid "24 Hour Time"
msgstr "24 timmars tid"
msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "En FIRMWARE_RESTART kan lösa problemet."
msgid "Abort"
msgstr "Avbryt"
msgid "Accept"
msgstr "Godkänn"
msgid "Actions"
msgstr "Åtgärder"
msgid "Add Printer"
msgstr "Lägg till skrivare"
msgid "Add bed mesh profile"
msgstr "Lägg till mesh profil"
msgid "Are you sure you want to run Emergency Stop?"
msgstr "Är du säker på att du vill köra Nödstopp?"
msgid "Are you sure you wish to cancel this print?"
msgstr "Är du säker på att du vill avbryta denna utskrift?"
msgid "Are you sure you wish to disable motors?"
msgstr "Är du säker på att du vill inaktivera motorer?"
msgid "Are you sure you wish to reboot the system?"
msgstr "Är du säker på att du vill starta om systemet?"
msgid "Are you sure you wish to shutdown the system?"
msgstr "Är du säker på att du vill stänga av systemet?"
msgid "Auto"
msgstr "Automatisk"
msgid "Auto-scroll"
msgstr "Auto-scrolla"
#, fuzzy
msgid "Bed Level"
msgstr "Bed Level"
#, fuzzy
msgid "Bed Mesh"
msgstr "Bed Mesh"
msgid "Bltouch found applied offset"
msgstr "Bltouch hittade tillämpad offset"
msgid "Calibrate"
msgstr "Kalibrera"
msgid "Calibrated, save configuration to make it permanent"
msgstr "Kalibrerad, spara konfiguration för att göra den permanent"
msgid "Can't set above the maximum:"
msgstr "Kan inte ställa in över maxgränsen:"
msgid "Cancel"
msgstr "Avbryt"
msgid "Cancel Print"
msgstr "Avbryt utskrift"
msgid "Cancelled"
msgstr "Avbruten"
msgid "Cancelling"
msgstr "Avbryter"
msgid "Cannot connect to Moonraker"
msgstr "Kan inte ansluta till Moonraker"
#, fuzzy
msgid "Channel"
msgstr "Kanal"
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
"Kontrollera /tmp/KlipperScreen.log för mer information.\n"
"Skicka in ett problem på GitHub för hjälp."
msgid "Close"
msgstr "Stäng"
msgid "Complete"
msgstr "Färdig"
msgid "Configuration"
msgstr "Konfiguration"
msgid "Confirm Emergency Stop"
msgstr "Bekräfta nödstopp"
msgid "Connected"
msgstr "Ansluten"
#, python-format
msgid "Connecting to %s"
msgstr "Ansluter till %s"
msgid "Console"
msgstr "Konsol"
msgid "Continue"
msgstr "Fortsätt"
msgid "Cooldown"
msgstr "Nedkylning"
msgid "Date"
msgstr "Datum"
msgid "Decrease"
msgstr "Minska"
msgid "Delete"
msgstr "Radera"
msgid "Deselect"
msgstr "Avmarkera"
msgid "Disable Motors"
msgstr "Inaktivera motorer"
msgid "Disable XY"
msgstr "Inaktivera XY"
msgid "Displayed Macros"
msgstr "Makron visas"
msgid "Distance (mm)"
msgstr "Avstånd (mm)"
#, python-format
msgid "Do you want to recover %s?"
msgstr "Vill du återställa %s?"
msgid "Elapsed:"
msgstr "Förfluten:"
msgid "Error"
msgstr "Fel"
#, fuzzy
msgid "Estimated Time Method"
msgstr "Uppskattad tid metod"
msgid "Extrude"
msgstr "Extrudera"
msgid "Extrusion +"
msgstr "Extrudering +"
msgid "Extrusion -"
msgstr "Extrudering -"
msgid "Failed, adjust position first"
msgstr "Misslyckades, justera positionen först"
msgid "Fan"
msgstr "Fläkt"
#, fuzzy
msgid "Filament Used"
msgstr "Filament använt"
msgid "File"
msgstr "Fil"
msgid "Fine Tuning"
msgstr "Finjustering"
msgid "Finish"
msgstr "Slutför"
msgid ""
"Firmware\n"
"Restart"
msgstr ""
"Firmware\n"
"Omstart"
msgid "Font Size"
msgstr "Textstorlek"
msgid ""
"Full\n"
"Update"
msgstr ""
"Fullständig\n"
"Uppdatering"
msgid "Go Back"
msgstr "Gå tillbaka"
msgid "Hidden"
msgstr "Dold"
msgid "Hide"
msgstr "Dölj"
msgid "Hide sensors in Temp."
msgstr "Dölj sensorer i Temp."
msgid "Home"
msgstr "Hem"
msgid "Home All"
msgstr "Hem Alla"
msgid "Home X"
msgstr "Hem X"
msgid "Home XY"
msgstr "Hem XY"
msgid "Home Y"
msgstr "Hem Y"
msgid "Home Z"
msgstr "Hem Z"
#, fuzzy
msgid "Homing"
msgstr "Homing"
msgid "Hostname"
msgstr "Värdnamn"
msgid "Icon Theme"
msgstr "Ikon tema"
msgid "Increase"
msgstr "Öka"
msgid "Initializing"
msgstr "Initierar"
msgid "Initializing printer..."
msgstr "Initierar skrivaren..."
msgid "Interface"
msgstr "Gränssnitt"
msgid "Invalid"
msgstr "Ogiltig"
msgid "Invert X"
msgstr "Invertera X"
msgid "Invert Y"
msgstr "Invertera Y"
msgid "Invert Z"
msgstr "Invertera Z"
msgid ""
"Klipper\n"
"Restart"
msgstr ""
"Klipper\n"
"Omstart"
#, fuzzy
msgid "Klipper has disconnected"
msgstr "Klipper har kopplat från"
msgid "Klipper has encountered an error."
msgstr "Klipper har stött på ett fel."
msgid "Klipper has shutdown"
msgstr "Klipper har stängts av"
msgid "Klipper is attempting to start"
msgstr "Klipper försöker starta"
msgid "Klipper will reboot"
msgstr "Klipper kommer att starta om"
msgid "Language"
msgstr "Språk"
msgid "Large"
msgstr "Stor"
msgid "Left:"
msgstr "Återstående:"
msgid "Limits"
msgstr "Begränsningar"
msgid "Load"
msgstr "Ladda"
msgid "Lower Nozzle"
msgstr "Sänk munstycket"
msgid "Macro shortcut on sidebar"
msgstr "Makro genväg på sidofältet"
msgid "Macros"
msgstr "Makron"
msgid "Main Menu"
msgstr "Huvudmeny"
#, fuzzy
msgid "Max Accelation"
msgstr "Maximal acceleration"
#, fuzzy
msgid "Max Acceleration to Deceleration"
msgstr "Maximal acceleration till inbromsning"
#, fuzzy
msgid "Max Velocity"
msgstr "Maximal hastighet"
msgid "Medium"
msgstr "Medium"
msgid "Menu"
msgstr "Meny"
msgid "Modified"
msgstr "Ändrad"
msgid "Moonraker: connected"
msgstr "Moonraker: ansluten"
msgid "Move"
msgstr "Flytta"
msgid "Move Distance (mm)"
msgstr "Förflyttningsavstånd (mm)"
msgid "Name"
msgstr "Namn"
msgid "Network"
msgstr "Nätverk"
msgid "Nothing selected"
msgstr "Inget valt"
msgid "Off"
msgstr "Avstängd"
#, fuzzy, python-format
msgid "Outdated by %d"
msgstr "Föråldrad med %d"
msgid "PSK for"
msgstr "PSK för"
msgid "Package will be updated"
msgid_plural "Packages will be updated"
msgstr[0] "Paketet kommer att uppdateras"
msgstr[1] "Paketen kommer att uppdateras"
msgid "Password saved"
msgstr "Lösenordet har sparats"
msgid "Pause"
msgstr "Pausa"
msgid "Paused"
msgstr "Pausad"
msgid "Perform a full upgrade?"
msgstr "Utför en fullständig uppgradering?"
msgid "Please recompile and flash the micro-controller."
msgstr "Vänligen kompilera om och flasha mikrokontrollern."
msgid "Power"
msgstr "Ström"
msgid "Power On Printer"
msgstr "Slå på skrivaren"
msgid "Print"
msgstr "Skriv ut"
msgid "Print Control"
msgstr "Utskriftskontroll"
#, fuzzy
msgid "Print Time"
msgstr "Tid för utskrift"
#, fuzzy
msgid "Printer Connections"
msgstr "Skrivaranslutningar"
msgid "Printing"
msgstr "Skriver ut"
#, fuzzy
msgid "Probe found applied offset"
msgstr "Sond hittat tillämpad offset"
msgid "Profile Name:"
msgstr "Profilens namn:"
#, fuzzy
msgid "Quad Gantry Level"
msgstr "Quad Gantry nivå"
#, fuzzy
msgid "Raise Nozzle"
msgstr "Höj munstycket"
#, fuzzy
msgid "Recover Hard"
msgstr "Återhämta Hårt"
#, fuzzy
msgid "Recover Soft"
msgstr "Återhämta Mjukt"
msgid "Reference"
msgstr "Referens"
msgid "Restart"
msgstr "Starta om"
msgid "Resume"
msgstr "Återuppta"
#, fuzzy
msgid "Retract"
msgstr "Dra tillbaka"
#, fuzzy, python-format
msgid "Retry #%s"
msgstr "Försök #%s"
msgid "Save"
msgstr "Spara"
msgid "Save Config"
msgstr "Spara konfiguration"
msgid "Save configuration"
msgstr "Spara konfigurationen"
#, fuzzy
msgid "Screen DPMS"
msgstr "DPMS för skärm"
msgid "Screen Power Off Time"
msgstr "Avstängningstid för skärmen"
#, fuzzy
msgid "Screws Adjust"
msgstr "Justera skruvar"
msgid "Select"
msgstr "Välj"
msgid "Send"
msgstr "Skicka"
#, python-format
msgid "Sending Power ON signal to: %s"
msgstr "Skickar ström PÅ-signal till: %s"
#, fuzzy
msgid "Set Temp"
msgstr "Ställ in temp"
msgid "Settings"
msgstr "Inställningar"
msgid "Show"
msgstr "Visa"
msgid "Size"
msgstr "Storlek"
#, fuzzy
msgid "Slicer"
msgstr "Slicer"
#, fuzzy
msgid "Slicer Time correction (%)"
msgstr "Slicer Tidskorrigering (%)"
msgid "Small"
msgstr "Liten"
msgid "Sort by: "
msgstr "Sortera efter: "
msgid "Speed (mm/s)"
msgstr "Hastighet (mm/s)"
msgid "Speed +"
msgstr "Hastighet +"
msgid "Speed -"
msgstr "Hastighet -"
#, fuzzy
msgid "Square Corner Velocity"
msgstr "Fyrkantig hörnhastighet"
msgid "Start"
msgstr "Starta"
#, fuzzy
msgid "Starting WiFi Association"
msgstr "Startar WiFi Association"
#, fuzzy
msgid "Starting recovery for"
msgstr "Startar återhämtning för"
#, fuzzy
msgid "Starting update for"
msgstr "Startar uppdatering för"
msgid "System"
msgstr "System"
msgid ""
"System\n"
"Restart"
msgstr ""
"System\n"
"Omstart"
msgid ""
"System\n"
"Shutdown"
msgstr ""
"System\n"
"Avstängning"
msgid "Temp (°C)"
msgstr "Temperatur (°C)"
msgid "Temperature"
msgstr "Temperatur"
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "För att tillämpa %s måste KlipperScreen startas om"
msgid "Tool"
msgstr "Verktyg"
#, fuzzy
msgid "Total:"
msgstr "Sammanlagt:"
msgid "Unknown Heater"
msgstr "Okänt värmeelement"
#, fuzzy
msgid "Unload"
msgstr "Lasta av"
msgid "Up To Date"
msgstr "Aktuellt"
msgid "Update"
msgstr "Uppdatera"
msgid "Updating"
msgstr "Uppdaterar"
msgid "Uploaded"
msgstr "Uppladdad"
#, fuzzy
msgid "View Mesh"
msgstr "Visa Mesh"
msgid "X+"
msgstr "X+"
msgid "X-"
msgstr "X-"
msgid "XY Move Speed (mm/s)"
msgstr "XY rörelsehastighet (mm/s)"
msgid "Y+"
msgstr "Y+"
msgid "Y-"
msgstr "Y-"
msgid "Z Calibrate"
msgstr "Z Kalibrering"
msgid "Z Move Speed (mm/s)"
msgstr "Z rörelsehastighet (mm/s)"
msgid "Z Position"
msgstr "Z Position"
#, fuzzy
msgid "Z Tilt"
msgstr "Z Lutning"
msgid "Z+"
msgstr "Z+"
msgid "Z-"
msgstr "Z-"
#, fuzzy
msgid "commit"
msgid_plural "commits"
msgstr[0] "commit"
msgstr[1] "commits"
msgid "dBm"
msgstr "dBm"
msgid "hour"
msgid_plural "hours"
msgstr[0] "timme"
msgstr[1] "timmar"
msgid "minutes"
msgstr "minuter"
msgid "mm"
msgstr "mm"
msgid "mm/s"
msgstr "mm/s"
msgid "mm/s^2"
msgstr "mm/s^2"
@@ -0,0 +1,641 @@
# 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: 2022-03-31 11:25-0300\n"
"PO-Revision-Date: 2022-05-06 21:48+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: tr_TR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.0.1\n"
#, python-format
msgid "%s will be updated to version"
msgstr "%s sürüme güncellenecektir"
msgid "(default)"
msgstr "(varsayılan)"
msgid "24 Hour Time"
msgstr "24 Saat Zaman"
msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "Bir FIRMWARE_RESTART sorunu çözebilir."
msgid "Abort"
msgstr "İptal et"
msgid "Accept"
msgstr "Kabul et"
msgid "Actions"
msgstr "Eylemler"
msgid "Add Printer"
msgstr "Yazıcı Ekle"
msgid "Add bed mesh profile"
msgstr "Yatak Örgüsü profili ekle"
msgid "Are you sure you want to run Emergency Stop?"
msgstr "Acil Durdurma'yı çalıştırmak istediğinizden emin misiniz?"
msgid "Are you sure you wish to cancel this print?"
msgstr "Bu baskıyı iptal etmek istediğinizden emin misiniz?"
msgid "Are you sure you wish to disable motors?"
msgstr "Motorları devre dışı bırakmak istediğinizden emin misiniz?"
msgid "Are you sure you wish to reboot the system?"
msgstr "Sistemi yeniden başlatmak istediğinizden emin misiniz?"
msgid "Are you sure you wish to shutdown the system?"
msgstr "Sistemi kapatmak istediğinizden emin misiniz?"
msgid "Auto"
msgstr "Otomatik"
msgid "Auto-scroll"
msgstr "Otomatik kaydırma"
msgid "Bed Level"
msgstr "Yatak Ayarı"
msgid "Bed Mesh"
msgstr "Yatak Örgüsü"
msgid "Bltouch found applied offset"
msgstr "Bltouch uygulanmış ofseti buldu"
msgid "Calibrate"
msgstr "Kalibre et"
msgid "Calibrated, save configuration to make it permanent"
msgstr "Kalibre edildi, kalıcı hale getirmek için yapılandırmayı kaydedin"
msgid "Can't set above the maximum:"
msgstr "Maksimumun üzerine ayarlanamaz:"
msgid "Cancel"
msgstr "İptal"
msgid "Cancel Print"
msgstr "Baskıyı iptal et"
msgid "Cancelled"
msgstr "İptal edildi"
msgid "Cancelling"
msgstr "İptal ediliyor"
msgid "Cannot connect to Moonraker"
msgstr "Moonraker'a bağlanılamıyor"
msgid "Channel"
msgstr "Kanal"
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
"Daha fazla bilgi için /tmp/KlipperScreen.log'a bakın.\n"
"Lütfen yardım için GitHub'da bir sorun gönderin."
msgid "Close"
msgstr "Kapat"
msgid "Complete"
msgstr "Tamamlandı"
msgid "Configuration"
msgstr "Yapılandırma"
msgid "Confirm Emergency Stop"
msgstr "Acil Durdurmayı Onaylayın"
msgid "Connected"
msgstr "Bağlandı"
#, python-format
msgid "Connecting to %s"
msgstr "%s'e Bağlanılıyor"
msgid "Console"
msgstr "Konsol"
msgid "Continue"
msgstr "Devam et"
msgid "Cooldown"
msgstr "Soğutma"
msgid "Date"
msgstr "Tarih"
msgid "Decrease"
msgstr "Azalt"
msgid "Delete"
msgstr "Sil"
msgid "Deselect"
msgstr "Seçimi kaldır"
msgid "Disable Motors"
msgstr "Motorları Devre Dışı Bırak"
msgid "Disable XY"
msgstr "XY Devre dışı bırak"
msgid "Displayed Macros"
msgstr "Görüntülenen Makrolar"
msgid "Distance (mm)"
msgstr "Uzaklık (mm)"
#, python-format
msgid "Do you want to recover %s?"
msgstr "%s Kurtarmak istiyor musunuz?"
msgid "Elapsed:"
msgstr "Geçen:"
msgid "Error"
msgstr "Hata"
msgid "Estimated Time Method"
msgstr "Tahmini Zaman Metodu"
msgid "Extrude"
msgstr "Ekstrüzyon"
msgid "Extrusion +"
msgstr "Ekstrüzyon +"
msgid "Extrusion -"
msgstr "Ekstrüzyon -"
msgid "Failed, adjust position first"
msgstr "Başarısız, önce konumu ayarlayın"
msgid "Fan"
msgstr "Fan"
msgid "Filament Used"
msgstr "Kullanılan Filament"
msgid "File"
msgstr "Dosya"
msgid "Fine Tuning"
msgstr "İnce Ayar"
msgid "Finish"
msgstr "Bitir"
msgid ""
"Firmware\n"
"Restart"
msgstr ""
"Firmware\n"
"Yeniden Başlat"
msgid "Font Size"
msgstr "Yazı boyutu"
msgid ""
"Full\n"
"Update"
msgstr ""
"Tam\n"
"Güncelleme"
msgid "Go Back"
msgstr "Geri git"
msgid "Hidden"
msgstr "Gizli"
msgid "Hide"
msgstr "Gizle"
msgid "Hide sensors in Temp."
msgstr "Sıcaklıktaki sensörleri gizleyin."
msgid "Home"
msgstr "Ana Ekran"
msgid "Home All"
msgstr "Eksenleri Sıfırla"
msgid "Home X"
msgstr "X Sıfırla"
msgid "Home XY"
msgstr "XY Sıfırla"
msgid "Home Y"
msgstr "Y Sıfırla"
msgid "Home Z"
msgstr "Z Sıfırla"
msgid "Homing"
msgstr "Eksen Sıfırlama"
msgid "Hostname"
msgstr "Ana bilgisayar adı"
msgid "Icon Theme"
msgstr "Simge Teması"
msgid "Increase"
msgstr "Artır"
msgid "Initializing"
msgstr "Başlatılıyor"
msgid "Initializing printer..."
msgstr "Yazıcı başlatılıyor..."
msgid "Interface"
msgstr "Arayüz"
msgid "Invalid"
msgstr "Geçersiz"
msgid "Invert X"
msgstr "X Ters çevir"
msgid "Invert Y"
msgstr "Y Ters çevir"
msgid "Invert Z"
msgstr "Z Ters çevir"
msgid ""
"Klipper\n"
"Restart"
msgstr ""
"Klipper\n"
"Yeniden başlat"
msgid "Klipper has disconnected"
msgstr "Klipper bağlantısı kesildi"
msgid "Klipper has encountered an error."
msgstr "Klipper bir hatayla karşılaştı."
msgid "Klipper has shutdown"
msgstr "Klipper Kapandı"
msgid "Klipper is attempting to start"
msgstr "Klipper başlatılmaya çalışılıyor"
msgid "Klipper will reboot"
msgstr "Klipper yeniden başlayacak"
msgid "Language"
msgstr "Dil"
msgid "Large"
msgstr "Büyük"
msgid "Left:"
msgstr "Kalan:"
msgid "Limits"
msgstr "Limitler"
msgid "Load"
msgstr "Yükle"
msgid "Lower Nozzle"
msgstr "Nozzle düşür"
msgid "Macro shortcut on sidebar"
msgstr "Kenar çubuğunda makro kısayolu"
msgid "Macros"
msgstr "Makrolar"
msgid "Main Menu"
msgstr "Ana Menü"
msgid "Max Accelation"
msgstr "Maksimum Hızlanma"
msgid "Max Acceleration to Deceleration"
msgstr "Maksimum Hızlanma ve Yavaşlama"
msgid "Max Velocity"
msgstr "Maksimum Hız"
msgid "Medium"
msgstr "Orta"
msgid "Menu"
msgstr "Menü"
msgid "Modified"
msgstr "Değiştirilmiş"
msgid "Moonraker: connected"
msgstr "Moonraker: bağlandı"
msgid "Move"
msgstr "Hareket"
msgid "Move Distance (mm)"
msgstr "Hareket Mesafesi (mm)"
msgid "Name"
msgstr "İsim"
msgid "Network"
msgstr "Ağ"
msgid "Nothing selected"
msgstr "Hiçbir şey seçilmedi"
msgid "Off"
msgstr "Kapa"
#, python-format
msgid "Outdated by %d"
msgstr "Güncelliğini yitiren %d"
msgid "PSK for"
msgstr "PSK için"
msgid "Package will be updated"
msgid_plural "Packages will be updated"
msgstr[0] "Paket yükseltilecek"
msgstr[1] "Paketler yükseltilecek"
msgid "Password saved"
msgstr "Şifre kaydedildi"
msgid "Pause"
msgstr "Duraklat"
msgid "Paused"
msgstr "Duraklatıldı"
msgid "Perform a full upgrade?"
msgstr "Tam yükseltme yap?"
msgid "Please recompile and flash the micro-controller."
msgstr "Lütfen mikro denetleyiciyi yeniden derleyin ve flaşlayın."
msgid "Power"
msgstr "Güç"
msgid "Power On Printer"
msgstr "Yazıcıya Güç Ver (aç)"
msgid "Print"
msgstr "Yazdır"
msgid "Print Control"
msgstr "Yazdırma Kontrolü"
msgid "Print Time"
msgstr "Yazdırma Süresi"
msgid "Printer Connections"
msgstr "Yazıcı Bağlantıları"
msgid "Printing"
msgstr "Yazdırılıyor"
msgid "Probe found applied offset"
msgstr "Prob uygulanmış ofset bulundu"
msgid "Profile Name:"
msgstr "Profil ismi:"
msgid "Quad Gantry Level"
msgstr "Dörtlü Köprü Seviyesi"
msgid "Raise Nozzle"
msgstr "Nozzle yükselt"
msgid "Recover Hard"
msgstr "Zorla Kurtar"
msgid "Recover Soft"
msgstr "Yumuşak Kurtar"
msgid "Reference"
msgstr "Referans"
msgid "Restart"
msgstr "Yeniden Başlat"
msgid "Resume"
msgstr "Devam Et"
msgid "Retract"
msgstr "Geri çek"
#, python-format
msgid "Retry #%s"
msgstr "Yeniden Dene #%s"
msgid "Save"
msgstr "Kaydet"
msgid "Save Config"
msgstr "Yapılandırma Kayıt"
msgid "Save configuration"
msgstr "Yapılandırmayı kaydet"
msgid "Screen DPMS"
msgstr "Ekran DPMS"
msgid "Screen Power Off Time"
msgstr "Ekran kapatma zamanı"
msgid "Screws Adjust"
msgstr "Vida Ayarı"
msgid "Select"
msgstr "Seç"
msgid "Send"
msgstr "Gönder"
#, python-format
msgid "Sending Power ON signal to: %s"
msgstr "Güç AÇ sinyalı gönderilen: %s"
msgid "Set Temp"
msgstr "Sıcaklık Ayarla"
msgid "Settings"
msgstr "Ayarlar"
msgid "Show"
msgstr "Göster"
msgid "Size"
msgstr "Boyut"
msgid "Slicer"
msgstr "Dilimleme"
msgid "Slicer Time correction (%)"
msgstr "Dilimleme Zamanı doğrulama (%)"
msgid "Small"
msgstr "Küçük"
msgid "Sort by: "
msgstr "Sırala: "
msgid "Speed (mm/s)"
msgstr "Hız (mm/s)"
msgid "Speed +"
msgstr "Hız +"
msgid "Speed -"
msgstr "Hız -"
msgid "Square Corner Velocity"
msgstr "Kare Köşe Hızı"
msgid "Start"
msgstr "Başlat"
msgid "Starting WiFi Association"
msgstr "WiFi Bağlantısı başlatılıyor"
msgid "Starting recovery for"
msgstr "Kurtarma başlatılıyor"
msgid "Starting update for"
msgstr "Güncelleme başlatılıyor"
msgid "System"
msgstr "Sistem"
msgid ""
"System\n"
"Restart"
msgstr ""
"Sistem\n"
"Yeniden Başlat"
msgid ""
"System\n"
"Shutdown"
msgstr ""
"Sistem\n"
"Kapat"
msgid "Temp (°C)"
msgstr "Sıcaklık (°C)"
msgid "Temperature"
msgstr "Sıcaklık"
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Uygulamak için %s KlipperScreen yeniden başlatılmalı"
msgid "Tool"
msgstr "Araç"
msgid "Total:"
msgstr "Toplam:"
msgid "Unknown Heater"
msgstr "Bilinmeyen Isıtıcı"
msgid "Unload"
msgstr "Boşalt"
msgid "Up To Date"
msgstr "Güncel"
msgid "Update"
msgstr "Güncelle"
msgid "Updating"
msgstr "Yükleniyor"
msgid "Uploaded"
msgstr "Yüklendi"
msgid "View Mesh"
msgstr "Örgüyü Görüntüle"
msgid "X+"
msgstr "X+"
msgid "X-"
msgstr "X-"
msgid "XY Move Speed (mm/s)"
msgstr "XY Hareket hızı (mm/s)"
msgid "Y+"
msgstr "Y+"
msgid "Y-"
msgstr "Y-"
msgid "Z Calibrate"
msgstr "Z Kalibrasyonu"
msgid "Z Move Speed (mm/s)"
msgstr "Z Hareket hızı (mm/s)"
msgid "Z Position"
msgstr "Z Pozisyonu"
msgid "Z Tilt"
msgstr "Z Eğim"
msgid "Z+"
msgstr "Z+"
msgid "Z-"
msgstr "Z-"
msgid "commit"
msgid_plural "commits"
msgstr[0] "commit"
msgstr[1] "commits"
msgid "dBm"
msgstr "dBm"
msgid "hour"
msgid_plural "hours"
msgstr[0] "saat"
msgstr[1] "saatler"
msgid "minutes"
msgstr "dakika"
msgid "mm"
msgstr "mm"
msgid "mm/s"
msgstr "mm/s"
msgid "mm/s^2"
msgstr "mm/s^2"
+26 -13
View File
@@ -120,10 +120,12 @@ class Printer:
'print_stats',
'toolhead',
'virtual_sdcard',
'webhooks'
'webhooks',
'fimware_retraction',
'motion_report'
]
for x in (self.get_tools() + self.get_heaters()):
for x in (self.get_tools() + self.get_heaters() + self.get_filament_sensors()):
if x in data:
for i in data[x]:
self.set_dev_stat(x, i, data[x][i])
@@ -135,7 +137,7 @@ class Printer:
self.data[x] = {}
self.data[x].update(data[x])
if "webhooks" in data or "idle_timeout" in data or "print_stats" in data:
if "webhooks" in data or "idle_timeout" in data or "print_stats" in data or "pause_resume" in data:
self.evaluate_state()
def get_updates(self):
@@ -148,7 +150,9 @@ class Printer:
if wh_state == "ready":
new_state = "ready"
if self.data['print_stats']:
if self.data['pause_resume']['is_paused']:
new_state = "paused"
elif self.data['print_stats']:
print_state = self.data['print_stats']['state'].lower() # complete, error, paused, printing, standby
if print_state == "paused":
new_state = "paused"
@@ -207,16 +211,13 @@ class Printer:
return self.config[section]
return False
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_fans(self):
fans = ["fan"] if len(self.get_config_section_list("fan")) > 0 else []
fans = []
if self.config_section_exists("fan"):
fans.append("fan")
fan_types = ["controller_fan", "fan_generic", "heater_fan"]
for type in fan_types:
for f in self.get_config_section_list("%s " % type):
@@ -238,6 +239,14 @@ class Printer:
heaters.append(h)
return heaters
def get_filament_sensors(self):
sensors = []
for s in self.get_config_section_list("filament_switch_sensor "):
sensors.append(s)
for s in self.get_config_section_list("filament_motion_sensor "):
sensors.append(s)
return sensors
def get_printer_status_data(self):
data = {
"printer": {
@@ -255,11 +264,15 @@ class Printer:
"count": len(self.get_gcode_macros())
},
"idle_timeout": self.get_stat("idle_timeout").copy(),
"pause_resume": self.get_stat("pause_resume").copy(),
"pause_resume": {
"is_paused": True if self.state == "paused" else False
},
"power_devices": {
"count": len(self.get_power_devices())
},
"probe": self.config_section_exists("probe")
"probe": self.config_section_exists("probe"),
"firmware_retraction": self.config_section_exists("firmware_retraction"),
"input_shaper": self.config_section_exists("input_shaper")
}
}
@@ -310,7 +323,7 @@ class Printer:
return None
def get_fan_speed(self, fan="fan", speed=None):
if fan not in self.config:
if fan not in self.config or fan not in self.data:
logging.debug("Error getting %s config", fan)
return speed if speed is not None else 0
if speed is None and "speed" in self.data[fan]:
+56 -5
View File
@@ -1,10 +1,12 @@
import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from ks_includes.KlippyGcodes import KlippyGcodes
class ScreenPanel:
def __init__(self, screen, title, back=True, action_bar=True, printer_name=True):
@@ -42,7 +44,7 @@ class ScreenPanel:
if temp <= 0:
return ""
else:
return ("(%s)" % str(int(temp)))
return "(%s)" % str(int(temp))
def format_temp(self, temp, places=1):
if places == 0:
@@ -57,17 +59,17 @@ class ScreenPanel:
def get_content(self):
return self.content
def get_file_image(self, filename, width=1.6, height=1.6):
def get_file_image(self, filename, width=1, height=1, small=False):
if not self._files.has_thumbnail(filename):
return None
loc = self._files.get_thumbnail_location(filename)
loc = self._files.get_thumbnail_location(filename, small)
if loc is None:
return None
if loc[0] == "file":
return self._gtk.PixbufFromFile(loc[1], None, width, height)
return self._gtk.PixbufFromFile(loc[1], width, height)
if loc[0] == "http":
return self._gtk.PixbufFromHttp(loc[1], None, width, height)
return self._gtk.PixbufFromHttp(loc[1], width, height)
return None
def get_title(self):
@@ -116,3 +118,52 @@ class ScreenPanel:
self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
else:
self.labels[dev].set_label("%s\n%s" % (name, self._gtk.formatTemperatureString(temp, target)))
def load_menu(self, widget, name):
if ("%s_menu" % name) not in self.labels:
return
for child in self.content.get_children():
self.content.remove(child)
self.menu.append('%s_menu' % name)
self.content.add(self.labels[self.menu[-1]])
self.content.show_all()
def unload_menu(self, widget=None):
logging.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]
logging.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 scale_moved(self, widget, event, section, option):
logging.debug("[%s] %s changed to %s" % (section, option, widget.get_value()))
if section not in self._config.get_config().sections():
self._config.get_config().add_section(section)
self._config.set(section, option, str(int(widget.get_value())))
self._config.save_user_config_options()
def switch_config_option(self, switch, gparam, section, option, callback=None):
logging.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()
if callback is not None:
callback(switch.get_active())
+6 -7
View File
@@ -91,7 +91,6 @@ class HeaterGraph(Gtk.DrawingArea):
max_num = math.ceil(self.get_max_num(data_points) * 1.1 / 10) * 10
d_width = 1 / points_per_pixel
d_height_scale = self.graph_lines(ctx, gsize, max_num)
self.graph_time(ctx, gsize, points_per_pixel)
@@ -115,10 +114,10 @@ class HeaterGraph(Gtk.DrawingArea):
ctx.set_dash([1, 0])
d_len = len(data) - 1
for d in data:
p_x = i*swidth + gsize[0][0] if i != d_len else gsize[1][0] - 1
p_y = gsize[1][1] - 1 - (d*hscale)
p_x = i * swidth + gsize[0][0] if i != d_len else gsize[1][0] - 1
p_y = gsize[1][1] - 1 - (d * hscale)
if i == 0:
ctx.move_to(gsize[0][0]+1, p_y)
ctx.move_to(gsize[0][0] + 1, p_y)
i += 1
continue
ctx.line_to(p_x, p_y)
@@ -139,15 +138,15 @@ class HeaterGraph(Gtk.DrawingArea):
while (max_num / nscale) > 5:
nscale += 10
# nscale = math.floor((max_num / 10) / 4) * 10
r = int(max_num/nscale) + 1
r = int(max_num / nscale) + 1
hscale = (gsize[1][1] - gsize[0][1]) / (r * nscale)
for i in range(r):
ctx.set_source_rgb(.5, .5, .5)
lheight = gsize[1][1] - nscale*i*hscale
lheight = gsize[1][1] - nscale * i * hscale
ctx.move_to(6, lheight + 3)
ctx.set_font_size(self.font_size)
ctx.show_text(str(nscale*i).rjust(3, " "))
ctx.show_text(str(nscale * i).rjust(3, " "))
ctx.stroke()
ctx.set_source_rgba(.5, .5, .5, .2)
ctx.move_to(gsize[0][0], lheight)
+3 -3
View File
@@ -34,9 +34,9 @@ class Keypad(Gtk.Box):
for i in range(len(keys)):
id = 'button_' + str(keys[i][0])
if keys[i][0] == "B":
self.labels[id] = self._gtk.ButtonImage("backspace", None, None, 1, 1)
self.labels[id] = self._gtk.ButtonImage("backspace", None, None, 1)
elif keys[i][0] == "E":
self.labels[id] = self._gtk.ButtonImage("complete", None, None, 1, 1)
self.labels[id] = self._gtk.ButtonImage("complete", None, None, 1)
else:
self.labels[id] = Gtk.Button(keys[i][0])
self.labels[id].connect('clicked', self.update_entry, keys[i][0])
@@ -48,7 +48,7 @@ class Keypad(Gtk.Box):
self.labels['entry'].props.xalign = 0.5
self.labels['entry'].connect("activate", self.update_entry, "E")
b = self._gtk.ButtonImage('cancel', _('Close'), None, 1, 1)
b = self._gtk.ButtonImage('cancel', _('Close'), None, 1)
b.connect("clicked", close_function)
self.add(self.labels['entry'])
+66 -62
View File
@@ -9,10 +9,12 @@ from threading import Thread
from queue import Queue
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import GLib, Gdk
class WifiManager():
class WifiManager:
networks_in_supplicant = []
connected = False
_stop_loop = False
@@ -50,8 +52,9 @@ class WifiManager():
self.soc = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
self.soc.bind(KS_SOCKET_FILE)
self.soc.connect("/var/run/wpa_supplicant/%s" % interface)
except Exception:
logging.info("Error connecting to wifi socket: %s" % interface)
except Exception as e:
logging.critical(e, exc_info=True)
logging.error("Error connecting to wifi socket: %s" % interface)
return
self.wpa_thread = WpaSocket(self, self.queue, self.callback)
@@ -76,7 +79,7 @@ class WifiManager():
# TODO: Add wpa_cli error checking
network_id = self.wpa_cli("ADD_NETWORK")
commands = [
'ENABLE_NETWORK %s' % (network_id),
'ENABLE_NETWORK %s' % network_id,
'SET_NETWORK %s ssid "%s"' % (network_id, ssid.replace('"', '\"')),
'SET_NETWORK %s psk "%s"' % (network_id, psk.replace('"', '\"'))
]
@@ -324,7 +327,8 @@ class WpaSocket(Thread):
while self._stop_loop is False:
try:
msg = self.soc.recv(4096).decode().strip()
except Exception:
except Exception as e:
logging.critical(e, exc_info=True)
# TODO: Socket error
continue
if msg.startswith("<"):
@@ -363,117 +367,117 @@ class WifiChannels:
@staticmethod
def lookup(freq):
if freq == "2412":
return ("2.4", "1")
return "2.4", "1"
if freq == "2417":
return ("2.4", "2")
return "2.4", "2"
if freq == "2422":
return ("2.4", "3")
return "2.4", "3"
if freq == "2427":
return ("2.4", "4")
return "2.4", "4"
if freq == "2432":
return ("2.4", "5")
return "2.4", "5"
if freq == "2437":
return ("2.4", "6")
return "2.4", "6"
if freq == "2442":
return ("2.4", "7")
return "2.4", "7"
if freq == "2447":
return ("2.4", "8")
return "2.4", "8"
if freq == "2452":
return ("2.4", "9")
return "2.4", "9"
if freq == "2457":
return ("2.4", "10")
return "2.4", "10"
if freq == "2462":
return ("2.4", "11")
return "2.4", "11"
if freq == "2467":
return ("2.4", "12")
return "2.4", "12"
if freq == "2472":
return ("2.4", "13")
return "2.4", "13"
if freq == "2484":
return ("2.4", "14")
return "2.4", "14"
if freq == "5035":
return ("5", "7")
return "5", "7"
if freq == "5040":
return ("5", "8")
return "5", "8"
if freq == "5045":
return ("5", "9")
return "5", "9"
if freq == "5055":
return ("5", "11")
return "5", "11"
if freq == "5060":
return ("5", "12")
return "5", "12"
if freq == "5080":
return ("5", "16")
return "5", "16"
if freq == "5170":
return ("5", "34")
return "5", "34"
if freq == "5180":
return ("5", "36")
return "5", "36"
if freq == "5190":
return ("5", "38")
return "5", "38"
if freq == "5200":
return ("5", "40")
return "5", "40"
if freq == "5210":
return ("5", "42")
return "5", "42"
if freq == "5220":
return ("5", "44")
return "5", "44"
if freq == "5230":
return ("5", "46")
return "5", "46"
if freq == "5240":
return ("5", "48")
return "5", "48"
if freq == "5260":
return ("5", "52")
return "5", "52"
if freq == "5280":
return ("5", "56")
return "5", "56"
if freq == "5300":
return ("5", "60")
return "5", "60"
if freq == "5320":
return ("5", "64")
return "5", "64"
if freq == "5500":
return ("5", "100")
return "5", "100"
if freq == "5520":
return ("5", "104")
return "5", "104"
if freq == "5540":
return ("5", "108")
return "5", "108"
if freq == "5560":
return ("5", "112")
return "5", "112"
if freq == "5580":
return ("5", "116")
return "5", "116"
if freq == "5600":
return ("5", "120")
return "5", "120"
if freq == "5620":
return ("5", "124")
return "5", "124"
if freq == "5640":
return ("5", "128")
return "5", "128"
if freq == "5660":
return ("5", "132")
return "5", "132"
if freq == "5680":
return ("5", "136")
return "5", "136"
if freq == "5700":
return ("5", "140")
return "5", "140"
if freq == "5720":
return ("5", "144")
return "5", "144"
if freq == "5745":
return ("5", "149")
return "5", "149"
if freq == "5765":
return ("5", "153")
return "5", "153"
if freq == "5785":
return ("5", "157")
return "5", "157"
if freq == "5805":
return ("5", "161")
return "5", "161"
if freq == "5825":
return ("5", "165")
return "5", "165"
if freq == "4915":
return ("5", "183")
return "5", "183"
if freq == "4920":
return ("5", "184")
return "5", "184"
if freq == "4925":
return ("5", "185")
return "5", "185"
if freq == "4935":
return ("5", "187")
return "5", "187"
if freq == "4940":
return ("5", "188")
return "5", "188"
if freq == "4945":
return ("5", "189")
return "5", "189"
if freq == "4960":
return ("5", "192")
return "5", "192"
if freq == "4980":
return ("5", "196")
return "5", "196"
return None
+30 -29
View File
@@ -9,6 +9,7 @@ from jinja2 import Environment
from ks_includes.screen_panel import ScreenPanel
class BasePanel(ScreenPanel):
def __init__(self, screen, title, back=True, action_bar=True, printer_name=True):
super().__init__(screen, title, back, action_bar, printer_name)
@@ -34,24 +35,22 @@ class BasePanel(ScreenPanel):
self.control_grid.set_size_request(action_bar_width, action_bar_height)
self.control_grid.get_style_context().add_class('action_bar')
self.control['back'] = self._gtk.ButtonImage('back', None, None, 1, 1)
self.control['back'] = self._gtk.ButtonImage('back', None, None, 1)
self.control['back'].connect("clicked", self.back)
self.control['home'] = self._gtk.ButtonImage('main', None, None, 1, 1)
self.control['home'] = self._gtk.ButtonImage('main', None, None, 1)
self.control['home'].connect("clicked", self.menu_return, True)
if len(self._config.get_printers()) > 1:
self.control['printer_select'] = self._gtk.ButtonImage(
'shuffle', None, None, 1, 1)
self.control['printer_select'] = self._gtk.ButtonImage('shuffle', None, None, 1)
self.control['printer_select'].connect("clicked", self._screen.show_printer_select)
self.control['macro_shortcut'] = self._gtk.ButtonImage(
'custom-script', None, None, 1, 1)
self.control['macro_shortcut'] = self._gtk.ButtonImage('custom-script', None, None, 1)
self.control['macro_shortcut'].connect("clicked", self.menu_item_clicked, "gcode_macros", {
"name": "Macros",
"panel": "gcode_macros"
})
self.control['estop'] = self._gtk.ButtonImage('emergency', None, None, 1, 1)
self.control['estop'] = self._gtk.ButtonImage('emergency', None, None, 1)
self.control['estop'].connect("clicked", self.emergency_stop)
self.locations = {
@@ -87,7 +86,6 @@ class BasePanel(ScreenPanel):
self.titlelbl.set_hexpand(True)
self.titlelbl.set_vexpand(True)
self.titlelbl.set_halign(Gtk.Align.CENTER)
self.titlelbl.set_ellipsize(True)
self.titlelbl.set_ellipsize(Pango.EllipsizeMode.END)
self.set_title(title)
@@ -131,7 +129,6 @@ class BasePanel(ScreenPanel):
self.layout.put(self.titlebar, action_bar_width, 0)
self.layout.put(self.content, action_bar_width + self.hmargin, self.title_spacing)
def initialize(self, panel_name):
self.update_time()
return
@@ -140,31 +137,34 @@ class BasePanel(ScreenPanel):
for child in self.control['temp_box'].get_children():
self.control['temp_box'].remove(child)
if show is False or self._printer.get_temp_store_devices() is None:
if not show or self._screen.printer.get_temp_store_devices() is None:
return
for device in self._printer.get_temp_store_devices():
for device in self._screen.printer.get_temp_store_devices():
logging.info(device)
self.labels[device + '_box'] = Gtk.Box(spacing=0)
self.labels[device] = Gtk.Label(label="100º")
self.labels[device].set_ellipsize(True)
self.labels[device].set_ellipsize(Pango.EllipsizeMode.START)
if device.startswith("extruder"):
if self._printer.extrudercount > 1:
if self._screen.printer.extrudercount > 1:
if device == "extruder":
ext_img = self._gtk.Image("extruder-0.svg", None, .5, .5)
ext_img = self._gtk.Image("extruder-0", .5)
else:
ext_img = self._gtk.Image("extruder-%s.svg" % device[8:], None, .5, .5)
ext_img = self._gtk.Image("extruder-%s" % device[8:], .5)
else:
ext_img = self._gtk.Image("extruder.svg", None, .5, .5)
ext_img = self._gtk.Image("extruder", .5)
self.labels[device + '_box'].pack_start(ext_img, True, True, 3)
elif device.startswith("heater_bed"):
bed_img = self._gtk.Image("bed.svg", None, .5, .5)
bed_img = self._gtk.Image("bed", .5)
self.labels[device + '_box'].pack_start(bed_img, True, True, 3)
elif device.startswith("temperature_fan"):
fan_img = self._gtk.Image("fan.svg", None, .5, .5)
fan_img = self._gtk.Image("fan", .5)
self.labels[device + '_box'].pack_start(fan_img, True, True, 3)
elif device.startswith("heater_generic"):
heat_img = self._gtk.Image("heater", .5)
self.labels[device + '_box'].pack_start(heat_img, True, True, 3)
else:
temp_img = self._gtk.Image("heat-up.svg", None, .5, .5)
temp_img = self._gtk.Image("heat-up", .5)
self.labels[device + '_box'].pack_start(temp_img, True, True, 3)
self.labels[device + '_box'].pack_start(self.labels[device], True, True, 0)
@@ -176,12 +176,12 @@ class BasePanel(ScreenPanel):
nlimit = 5
n = 0
if self._printer.get_tools():
self.current_extruder = self._printer.get_stat("toolhead", "extruder")
if self._screen.printer.get_tools():
self.current_extruder = self._screen.printer.get_stat("toolhead", "extruder")
self.control['temp_box'].pack_start(self.labels["%s_box" % self.current_extruder], True, True, 3)
n += 1
if self._printer.has_heated_bed():
if self._screen.printer.has_heated_bed():
self.control['temp_box'].pack_start(self.labels['heater_bed_box'], True, True, 3)
n += 1
@@ -194,7 +194,7 @@ class BasePanel(ScreenPanel):
logging.info("Titlebar items: %s", titlebar_items)
self.titlebar_name_type = printer_cfg.get("titlebar_name_type", None)
logging.info("Titlebar name type: %s", self.titlebar_name_type)
for device in self._printer.get_temp_store_devices():
for device in self._screen.printer.get_temp_store_devices():
# Users can fill the bar if they want
if n >= nlimit + 1:
break
@@ -209,12 +209,13 @@ class BasePanel(ScreenPanel):
break
# If there is enough space fill with heater_generic
for device in self._printer.get_temp_store_devices():
for device in self._screen.printer.get_temp_store_devices():
if n >= nlimit:
break
if device.startswith("heater_generic"):
self.control['temp_box'].pack_start(self.labels["%s_box" % device], True, True, 3)
n += 1
self.control['temp_box'].show_all()
def activate(self):
if self.time_update is None:
@@ -242,10 +243,10 @@ class BasePanel(ScreenPanel):
return self.layout
def process_update(self, action, data):
if action != "notify_status_update" or self._printer is None:
if action != "notify_status_update" or self._screen.printer is None:
return
devices = self._printer.get_temp_store_devices()
devices = self._screen.printer.get_temp_store_devices()
if devices is not None:
for device in devices:
name = ""
@@ -254,8 +255,9 @@ class BasePanel(ScreenPanel):
name = device.split(" ")[1:][0].capitalize().replace("_", " ") + ": "
elif self.titlebar_name_type == "short":
name = device.split(" ")[1:][0][:1].upper() + ": "
self.labels[device].set_label("%s%d°" % (name,
round(self._printer.get_dev_stat(device, "temperature"))))
temp = self._screen.printer.get_dev_stat(device, "temperature")
if temp is not None:
self.labels[device].set_label("%s%d°" % (name, round(temp)))
if "toolhead" in data and "extruder" in data["toolhead"]:
if data["toolhead"]["extruder"] != self.current_extruder:
@@ -265,7 +267,6 @@ class BasePanel(ScreenPanel):
self.control['temp_box'].reorder_child(self.labels["%s_box" % self.current_extruder], 0)
self.control['temp_box'].show_all()
def remove(self, widget):
self.content.remove(widget)
+17 -15
View File
@@ -8,9 +8,11 @@ from gi.repository import Gtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return BedLevelPanel(*args)
class BedLevelPanel(ScreenPanel):
x_offset = 0
y_offset = 0
@@ -47,19 +49,19 @@ class BedLevelPanel(ScreenPanel):
logging.debug("%d bed_screws not supported: calculating 4 locations", nscrews)
xconf = self._screen.printer.get_config_section("stepper_x")
yconf = self._screen.printer.get_config_section("stepper_y")
x = int(int(xconf['position_max'])/4)
y = int(int(yconf['position_max'])/4)
x = int(int(xconf['position_max']) / 4)
y = int(int(yconf['position_max']) / 4)
self.screws = [
[x, y],
[x*3, y],
[x, y*3],
[x*3, y*3],
[x * 3, y],
[x, y * 3],
[x * 3, y * 3],
]
else:
self.screws = screws
if (("bltouch" in self._screen.printer.get_config_section_list() or
"probe" in self._screen.printer.get_config_section_list()) and
"probe" in self._screen.printer.get_config_section_list()) and
config_section_name == "screws_tilt_adjust"):
if "bltouch" in self._screen.printer.get_config_section_list():
bltouch = self._screen.printer.get_config_section("bltouch")
@@ -114,14 +116,14 @@ class BedLevelPanel(ScreenPanel):
logging.debug("Using %d-screw locations [x,y] [%dx%d]", len(self.screws), self.x_cnt, self.y_cnt)
self.labels['bl'] = self._gtk.ButtonImage("bed-level-t-l", None, None, 2.5, 2.5)
self.labels['br'] = self._gtk.ButtonImage("bed-level-t-r", None, None, 2.5, 2.5)
self.labels['fl'] = self._gtk.ButtonImage("bed-level-b-l", None, None, 2.5, 2.5)
self.labels['fr'] = self._gtk.ButtonImage("bed-level-b-r", None, None, 2.5, 2.5)
self.labels['lm'] = self._gtk.ButtonImage("bed-level-l-m", None, None, 2.5, 2.5)
self.labels['rm'] = self._gtk.ButtonImage("bed-level-r-m", None, None, 2.5, 2.5)
self.labels['fm'] = self._gtk.ButtonImage("bed-level-b-m", None, None, 2.5, 2.5)
self.labels['bm'] = self._gtk.ButtonImage("bed-level-t-m", None, None, 2.5, 2.5)
self.labels['bl'] = self._gtk.ButtonImage("bed-level-t-l", None, None, 2.5)
self.labels['br'] = self._gtk.ButtonImage("bed-level-t-r", None, None, 2.5)
self.labels['fl'] = self._gtk.ButtonImage("bed-level-b-l", None, None, 2.5)
self.labels['fr'] = self._gtk.ButtonImage("bed-level-b-r", None, None, 2.5)
self.labels['lm'] = self._gtk.ButtonImage("bed-level-l-m", None, None, 2.5)
self.labels['rm'] = self._gtk.ButtonImage("bed-level-r-m", None, None, 2.5)
self.labels['fm'] = self._gtk.ButtonImage("bed-level-b-m", None, None, 2.5)
self.labels['bm'] = self._gtk.ButtonImage("bed-level-t-m", None, None, 2.5)
bedgrid = Gtk.Grid()
bedgrid.attach(self.labels['bl'], 1, 0, 1, 1)
@@ -307,7 +309,7 @@ class BedLevelPanel(ScreenPanel):
self.labels[key].set_label(result.group(5))
break
self.response_count += 1
if self.response_count >= len(self.screws)-1:
if self.response_count >= len(self.screws) - 1:
self.labels['screws'].set_sensitive(True)
else:
result = re.match(
+17 -22
View File
@@ -15,9 +15,11 @@ from matplotlib.ticker import LinearLocator
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return BedMeshPanel(*args)
class BedMeshPanel(ScreenPanel):
active_mesh = None
graphs = {}
@@ -27,19 +29,14 @@ class BedMeshPanel(ScreenPanel):
self.show_create = False
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
scroll = self._gtk.ScrolledWindow()
# 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, False)
"color1", .5, Gtk.PositionType.LEFT, False)
addprofile.connect("clicked", self.show_create_profile)
addprofile.set_size_request(60, 0)
addprofile.set_hexpand(False)
@@ -92,7 +89,7 @@ class BedMeshPanel(ScreenPanel):
frame = Gtk.Frame()
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (profile))
name.set_markup("<big><b>%s</b></big>" % profile)
name.set_hexpand(True)
name.set_vexpand(True)
name.set_halign(Gtk.Align.START)
@@ -177,7 +174,7 @@ class BedMeshPanel(ScreenPanel):
if "default" in pl:
pl.remove('default')
profiles = sorted(pl)
pos = profiles.index(profile)+1 if profile != "default" else 0
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)
@@ -240,7 +237,7 @@ class BedMeshPanel(ScreenPanel):
if "default" in pl:
pl.remove('default')
profiles = sorted(pl)
pos = profiles.index(profile)+1 if profile != "default" else 0
pos = profiles.index(profile) + 1 if profile != "default" else 0
self.labels['profiles'].remove_row(pos)
del self.profiles[profile]
@@ -287,7 +284,6 @@ class BedMeshPanel(ScreenPanel):
save.set_hexpand(False)
save.connect("clicked", self.create_profile)
self.labels['profile_name'] = entry
box.pack_start(pl, False, False, 5)
box.pack_start(entry, True, True, 5)
@@ -324,19 +320,19 @@ class BedMeshPanel(ScreenPanel):
maxz_mesh = 0.5
z_range = [minz_mesh, maxz_mesh]
counts = [len(abm['mesh_matrix'][0]), len(abm['mesh_matrix'])]
deltas = [(x_range[1] - x_range[0]) / (counts[0]-1), (y_range[1] - y_range[0]) / (counts[1]-1)]
x = [(i*deltas[0])+x_range[0] for i in range(counts[0])]
y = [(i*deltas[0])+y_range[0] for i in range(counts[1])]
deltas = [(x_range[1] - x_range[0]) / (counts[0] - 1), (y_range[1] - y_range[0]) / (counts[1] - 1)]
x = [(i * deltas[0]) + x_range[0] for i in range(counts[0])]
y = [(i * deltas[0]) + y_range[0] for i in range(counts[1])]
x, y = np.meshgrid(x, y)
z = np.asarray(abm['mesh_matrix'])
else:
x_range = [int(bm['min_x']), int(bm['max_x'])]
y_range = [int(bm['min_y']), int(bm['max_y'])]
z_range = [min(min(bm['points'])), max(max(bm['points']))]
deltas = [(x_range[1] - x_range[0]) / (int(bm['x_count'])-1),
(y_range[1] - y_range[0]) / (int(bm['y_count'])-1)]
x = [(i*deltas[0])+x_range[0] for i in range(bm['x_count'])]
y = [(i*deltas[0])+y_range[0] for i in range(bm['y_count'])]
deltas = [(x_range[1] - x_range[0]) / (int(bm['x_count']) - 1),
(y_range[1] - y_range[0]) / (int(bm['y_count']) - 1)]
x = [(i * deltas[0]) + x_range[0] for i in range(bm['x_count'])]
y = [(i * deltas[0]) + y_range[0] for i in range(bm['y_count'])]
x, y = np.meshgrid(x, y)
z = np.asarray(bm['points'])
@@ -349,8 +345,8 @@ class BedMeshPanel(ScreenPanel):
fig.add_axes(ax)
surf = ax.plot_surface(x, y, z, cmap=cm.coolwarm, vmin=-0.1, vmax=0.1)
chartBox = ax.get_position()
ax.set_position([chartBox.x0, chartBox.y0+0.1, chartBox.width*.92, chartBox.height])
chartbox = ax.get_position()
ax.set_position([chartbox.x0, chartbox.y0 + 0.1, chartbox.width * .92, chartbox.height])
ax.set_zlim(z_range[0], z_range[1])
ax.zaxis.set_major_locator(LinearLocator(5))
@@ -381,7 +377,7 @@ class BedMeshPanel(ScreenPanel):
alloc = canvas_box.get_allocation()
canvas = FigureCanvas(fig)
canvas.set_size_request(alloc.width, self._screen.height/3*2)
canvas.set_size_request(alloc.width, self._screen.height / 3 * 2)
canvas_box.add(canvas)
canvas_box.show_all()
# Remove the "matplotlib-canvas" class which forces a white background.
@@ -390,6 +386,5 @@ class BedMeshPanel(ScreenPanel):
for css_class in style_ctx.list_classes():
style_ctx.remove_class(css_class)
def _close_dialog(self, widget, response):
widget.destroy()
+36 -8
View File
@@ -1,6 +1,7 @@
import gi
import logging
import time
import re
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
@@ -8,6 +9,7 @@ from gi.repository import Gtk
from datetime import datetime
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return ConsolePanel(*args)
@@ -20,26 +22,42 @@ COLORS = {
"warning": "#c9c9c9"
}
class ConsolePanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
self.autoscroll = True
self.hidetemps = True
gcodes = self._screen._ws.send_method("server.gcode_store", {"count": 100}, self.gcode_response)
o1_lbl = Gtk.Label(_("Auto-scroll"))
o1_lbl.set_halign(Gtk.Align.END)
o1_switch = Gtk.Switch()
o1_switch.set_property("width-request", round(self._gtk.get_font_size()*6))
o1_switch.set_property("height-request", round(self._gtk.get_font_size()*3))
o1_switch.set_property("width-request", round(self._gtk.get_font_size() * 5))
o1_switch.set_property("height-request", round(self._gtk.get_font_size() * 2.5))
o1_switch.set_active(self.autoscroll)
o1_switch.connect("notify::active", self.set_autoscroll)
o2_lbl = Gtk.Label(_("Hide temp."))
o2_lbl.set_halign(Gtk.Align.END)
o2_switch = Gtk.Switch()
o2_switch.set_property("width-request", round(self._gtk.get_font_size() * 5))
o2_switch.set_property("height-request", round(self._gtk.get_font_size() * 2.5))
o2_switch.set_active(self.hidetemps)
o2_switch.connect("notify::active", self.hide_temps)
o3_button = self._gtk.ButtonImage("refresh", _('Clear') + " ", None, .66, Gtk.PositionType.RIGHT, False)
o3_button.connect("clicked", self.clear)
options = Gtk.HBox()
options.set_hexpand(True)
options.set_vexpand(False)
options.add(o1_lbl)
options.pack_start(o1_switch, False, 0, 5)
options.add(o2_lbl)
options.pack_start(o2_switch, False, 0, 5)
options.add(o3_button)
sw = Gtk.ScrolledWindow()
sw.set_hexpand(True)
@@ -65,11 +83,10 @@ class ConsolePanel(ScreenPanel):
entry.connect("focus-out-event", self._remove_keyboard)
entry.connect("activate", self._send_command)
enter = self._gtk.Button(_("Send"))
enter = self._gtk.ButtonImage("resume", " " + _('Send') + " ", None, .66, Gtk.PositionType.RIGHT, False)
enter.set_hexpand(False)
enter.connect("clicked", self._send_command)
ebox.add(entry)
ebox.add(enter)
@@ -81,23 +98,29 @@ class ConsolePanel(ScreenPanel):
})
content_box = Gtk.VBox()
content_box.pack_start(options, False, 0, 0)
content_box.pack_start(options, False, 0, 5)
content_box.add(sw)
content_box.pack_end(ebox, False, 0, 0)
self.content.add(content_box)
def clear(self, widget):
self.labels['tb'].set_text("")
def add_gcode(self, type, time, message):
if type == "command":
color = COLORS['command']
message = '$ %s' % message
elif message.startswith("!!"):
color = COLORS['error']
message = message.replace("!! ", "")
elif message.startswith("//"):
color = COLORS['warning']
message = message.replace("// ", "")
elif self.hidetemps and re.match('^(?:ok\\s+)?(B|C|T\\d*):', message):
return
else:
color = COLORS['response']
message = '<span color="%s">%s</span>' % (color, message)
message = '<span color="%s"><b>%s</b></span>' % (color, message)
message = message.replace('\n', '\n ')
@@ -106,6 +129,9 @@ class ConsolePanel(ScreenPanel):
'\n<span color="%s">%s</span> %s' % (COLORS['time'], datetime.fromtimestamp(time).strftime("%H:%M:%S"),
message), -1
)
# Limit the length
if self.labels['tb'].get_line_count() > 999:
self.labels['tb'].delete(self.labels['tb'].get_iter_at_line(0), self.labels['tb'].get_iter_at_line(1))
def gcode_response(self, result, method, params):
if method != "server.gcode_store":
@@ -118,9 +144,11 @@ class ConsolePanel(ScreenPanel):
if action == "notify_gcode_response":
self.add_gcode("response", time.time(), data)
def hide_temps(self, *args):
self.hidetemps ^= True
def set_autoscroll(self, *args):
self.autoscroll ^= True
logging.debug(self.autoscroll)
def _autoscroll(self, *args):
if self.autoscroll:
+2
View File
@@ -5,9 +5,11 @@ from gi.repository import Gtk
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return ExamplePanel(*args)
class ExamplePanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
+98 -35
View File
@@ -2,14 +2,16 @@ import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from gi.repository import Gtk, Pango
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return ExtrudePanel(*args)
class ExtrudePanel(ScreenPanel):
distance = 5
distances = ['5', '10', '15', '25']
@@ -22,8 +24,6 @@ class ExtrudePanel(ScreenPanel):
self.speed = 1
self.speeds = ['1', '2', '5', '25']
grid = Gtk.Grid()
self.labels['extrude'] = self._gtk.ButtonImage("extrude", _("Extrude"), "color4")
self.labels['extrude'].connect("clicked", self.extrude, "+")
if not self.load_filament:
@@ -46,6 +46,7 @@ class ExtrudePanel(ScreenPanel):
extgrid = self._gtk.HomogeneousGrid()
self.current_extruder = self._printer.get_stat("toolhead", "extruder")
limit = 5
for i, extruder in enumerate(self._printer.get_tools()):
if self._printer.extrudercount > 1:
self.labels[extruder] = self._gtk.ButtonImage("extruder-%s" % i, _("Tool") + " %s" % str(i))
@@ -54,55 +55,43 @@ class ExtrudePanel(ScreenPanel):
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 < 5:
if i < limit:
extgrid.attach(self.labels[extruder], i, 0, 1, 1)
if i < 3:
extgrid.attach(self.labels['temperature'], i+1, 0, 1, 1)
grid.attach(extgrid, 0, 0, 4, 1)
if self._screen.vertical_mode:
grid.attach(self.labels['extrude'], 0, 1, 2, 1)
grid.attach(self.labels['retract'], 2, 1, 2, 1)
grid.attach(self.labels['load'], 0, 2, 2, 1)
grid.attach(self.labels['unload'], 2, 2, 2, 1)
else:
grid.attach(self.labels['extrude'], 0, 1, 1, 1)
grid.attach(self.labels['load'], 1, 1, 1, 1)
grid.attach(self.labels['unload'], 2, 1, 1, 1)
grid.attach(self.labels['retract'], 3, 1, 1, 1)
if i < (limit - 1):
extgrid.attach(self.labels['temperature'], i + 1, 0, 1, 1)
i += 1
distgrid = Gtk.Grid()
j = 0
for i in self.distances:
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()
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 ((self._screen.lang_ltr is True and j == 0) or
(self._screen.lang_ltr is False and j == len(self.distances)-1)):
(self._screen.lang_ltr is False and j == len(self.distances) - 1)):
ctx.add_class("distbutton_top")
elif ((self._screen.lang_ltr is False and j == 0) or
(self._screen.lang_ltr is True and j == len(self.distances)-1)):
(self._screen.lang_ltr is True and j == len(self.distances) - 1)):
ctx.add_class("distbutton_bottom")
else:
ctx.add_class("distbutton")
if i == "5":
ctx.add_class("distbutton_active")
distgrid.attach(self.labels["dist"+str(i)], j, 0, 1, 1)
distgrid.attach(self.labels["dist" + str(i)], j, 0, 1, 1)
j += 1
self.labels["dist5"].set_active(True)
speedgrid = Gtk.Grid()
j = 0
for i in self.speeds:
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()
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 ((self._screen.lang_ltr is True and j == 0) or
(self._screen.lang_ltr is False and j == len(self.speeds)-1)):
(self._screen.lang_ltr is False and j == len(self.speeds) - 1)):
ctx.add_class("distbutton_top")
elif ((self._screen.lang_ltr is False and j == 0) or
(self._screen.lang_ltr is True and j == len(self.speeds)-1)):
(self._screen.lang_ltr is True and j == len(self.speeds) - 1)):
ctx.add_class("distbutton_bottom")
else:
ctx.add_class("distbutton")
@@ -121,13 +110,61 @@ class ExtrudePanel(ScreenPanel):
speedbox.pack_start(self.labels['extrude_speed'], True, True, 0)
speedbox.add(speedgrid)
filament_sensors = self._printer.get_filament_sensors()
if len(filament_sensors) > 0:
sensors = Gtk.Grid()
sensors.set_column_spacing(5)
sensors.set_row_spacing(5)
sensors.set_halign(Gtk.Align.CENTER)
sensors.set_valign(Gtk.Align.CENTER)
for s, x in enumerate(filament_sensors):
if s > limit:
break
name = x[23:].strip()
self.labels[x] = {
'label': Gtk.Label(name.capitalize().replace('_', ' ')),
'switch': Gtk.Switch(),
'box': Gtk.Box()
}
self.labels[x]['label'].set_halign(Gtk.Align.CENTER)
self.labels[x]['label'].set_hexpand(True)
self.labels[x]['label'].set_ellipsize(Pango.EllipsizeMode.END)
self.labels[x]['switch'].set_property("width-request", round(self._gtk.get_font_size() * 2))
self.labels[x]['switch'].set_property("height-request", round(self._gtk.get_font_size()))
self.labels[x]['switch'].set_active(self._printer.get_dev_stat(x, "enabled"))
self.labels[x]['switch'].connect("notify::active", self.enable_disable_fs, name, x)
self.labels[x]['box'].pack_start(self.labels[x]['label'], True, True, 5)
self.labels[x]['box'].pack_start(self.labels[x]['switch'], False, False, 5)
self.labels[x]['box'].get_style_context().add_class("filament_sensor")
self.labels[x]['box'].set_hexpand(True)
if self._printer.get_dev_stat(x, "filament_detected"):
self.labels[x]['box'].get_style_context().add_class("filament_sensor_detected")
else:
self.labels[x]['box'].get_style_context().add_class("filament_sensor_empty")
sensors.attach(self.labels[x]['box'], s, 0, 1, 1)
grid = Gtk.Grid()
grid.set_column_homogeneous(True)
grid.attach(extgrid, 0, 0, 4, 1)
if self._screen.vertical_mode:
grid.attach(self.labels['extrude'], 0, 1, 2, 1)
grid.attach(self.labels['retract'], 2, 1, 2, 1)
grid.attach(self.labels['load'], 0, 2, 2, 1)
grid.attach(self.labels['unload'], 2, 2, 2, 1)
grid.attach(distbox, 0, 3, 4, 1)
grid.attach(speedbox, 0, 4, 4, 1)
if len(filament_sensors) > 0:
grid.attach(sensors, 0, 5, 4, 1)
else:
grid.attach(distbox, 0, 2, 2, 1)
grid.attach(speedbox, 2, 2, 2, 1)
grid.attach(self.labels['extrude'], 0, 2, 1, 1)
grid.attach(self.labels['load'], 1, 2, 1, 1)
grid.attach(self.labels['unload'], 2, 2, 1, 1)
grid.attach(self.labels['retract'], 3, 2, 1, 1)
grid.attach(distbox, 0, 3, 2, 1)
grid.attach(speedbox, 2, 3, 2, 1)
if len(filament_sensors) > 0:
grid.attach(sensors, 0, 4, 4, 1)
self.content.add(grid)
@@ -149,21 +186,37 @@ class ExtrudePanel(ScreenPanel):
self.current_extruder = data["toolhead"]["extruder"]
self.labels[self.current_extruder].get_style_context().add_class("button_active")
for x in self._printer.get_filament_sensors():
if x in data:
if 'enabled' in data[x]:
self._printer.set_dev_stat(x, "enabled", data[x]['enabled'])
self.labels[x]['switch'].set_active(data[x]['enabled'])
logging.info("%s Enabled: %s" % (x, data[x]['enabled']))
if 'filament_detected' in data[x]:
self._printer.set_dev_stat(x, "filament_detected", data[x]['filament_detected'])
if data[x]['filament_detected']:
self.labels[x]['box'].get_style_context().remove_class("filament_sensor_empty")
self.labels[x]['box'].get_style_context().add_class("filament_sensor_detected")
else:
self.labels[x]['box'].get_style_context().remove_class("filament_sensor_detected")
self.labels[x]['box'].get_style_context().add_class("filament_sensor_empty")
logging.info("%s: Filament detected: %s" % (x, data[x]['filament_detected']))
def change_distance(self, widget, distance):
if self.distance == distance:
return
logging.info("### Distance " + str(distance))
ctx = self.labels["dist"+str(self.distance)].get_style_context()
ctx = self.labels["dist" + str(self.distance)].get_style_context()
ctx.remove_class("distbutton_active")
self.distance = distance
ctx = self.labels["dist"+self.distance].get_style_context()
ctx = self.labels["dist" + self.distance].get_style_context()
ctx.add_class("distbutton_active")
for i in self.distances:
if i == self.distance:
continue
self.labels["dist"+str(i)].set_active(False)
self.labels["dist" + str(i)].set_active(False)
def change_extruder(self, widget, extruder):
if extruder == self.current_extruder:
@@ -216,3 +269,13 @@ class ExtrudePanel(ScreenPanel):
if macro == "UNLOAD_FILAMENT":
logging.info("Found %s" % macro)
self.unload_filament = True
def enable_disable_fs(self, switch, gparams, name, x):
if switch.get_active():
self._printer.set_dev_stat(x, "enabled", True)
self._screen._ws.klippy.gcode_script("SET_FILAMENT_SENSOR SENSOR=" + name + " ENABLE=1")
else:
self._printer.set_dev_stat(x, "enabled", False)
self._screen._ws.klippy.gcode_script("SET_FILAMENT_SENSOR SENSOR=" + name + " ENABLE=0")
self.labels[x]['box'].get_style_context().remove_class("filament_sensor_empty")
self.labels[x]['box'].get_style_context().remove_class("filament_sensor_detected")
+6 -8
View File
@@ -7,12 +7,14 @@ from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return FanPanel(*args)
CHANGEABLE_FANS = ["fan", "fan_generic"]
class FanPanel(ScreenPanel):
fan_speed = {}
user_selecting = False
@@ -21,11 +23,7 @@ class FanPanel(ScreenPanel):
_ = self.lang.gettext
self.devices = {}
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
scroll = self._gtk.ScrolledWindow()
# Create a grid for all devices
self.labels['devices'] = Gtk.Grid()
@@ -41,7 +39,7 @@ class FanPanel(ScreenPanel):
self.content.add(box)
def process_update(self, action, data):
if (action != "notify_status_update"):
if action != "notify_status_update":
return
for fan in self.devices:
@@ -80,7 +78,7 @@ class FanPanel(ScreenPanel):
fan_name = "Part Fan"
else:
fan_name = " ".join(fan.split(" ")[1:])
name.set_markup("<big><b>%s</b></big>" % (fan_name))
name.set_markup("<big><b>%s</b></big>" % fan_name)
name.set_hexpand(True)
name.set_vexpand(True)
name.set_halign(Gtk.Align.START)
@@ -150,7 +148,7 @@ class FanPanel(ScreenPanel):
self._screen._ws.klippy.gcode_script(KlippyGcodes.set_fan_speed(value))
else:
f = " ".join(fan.split(" ")[1:])
self._screen._ws.klippy.gcode_script("SET_FAN_SPEED FAN=%s SPEED=%s" % (f, float(value)/100))
self._screen._ws.klippy.gcode_script("SET_FAN_SPEED FAN=%s SPEED=%s" % (f, float(value) / 100))
# Check the speed in case it wasn't applied
GLib.timeout_add_seconds(1, self.check_fan_speed, fan)
+21 -19
View File
@@ -8,9 +8,11 @@ from gi.repository import Gtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return FineTunePanel(*args)
class FineTunePanel(ScreenPanel):
user_selecting = False
@@ -47,7 +49,7 @@ class FineTunePanel(ScreenPanel):
ctx = self.labels[i].get_style_context()
if j == 0:
ctx.add_class("distbutton_top")
elif j == len(self.bs_deltas)-1:
elif j == len(self.bs_deltas) - 1:
ctx.add_class("distbutton_bottom")
else:
ctx.add_class("distbutton")
@@ -65,7 +67,7 @@ class FineTunePanel(ScreenPanel):
ctx = self.labels[i].get_style_context()
if j == 0:
ctx.add_class("distbutton_top")
elif j == len(self.percent_deltas)-1:
elif j == len(self.percent_deltas) - 1:
ctx.add_class("distbutton_bottom")
else:
ctx.add_class("distbutton")
@@ -82,17 +84,17 @@ class FineTunePanel(ScreenPanel):
self.labels['z+'] = self._gtk.ButtonImage("z-farther", _("Z+"), "color1")
self.labels['z-'] = self._gtk.ButtonImage("z-closer", _("Z-"), "color1")
self.labels['zoffset'] = self._gtk.ButtonImage("refresh", " 0.00" + _("mm"),
"color1", .6, .6, Gtk.PositionType.LEFT, False)
"color1", .6, Gtk.PositionType.LEFT, False)
self.labels['speed+'] = self._gtk.ButtonImage("speed+", _("Speed +"), "color3")
self.labels['speed-'] = self._gtk.ButtonImage("speed-", _("Speed -"), "color3")
self.labels['speedfactor'] = self._gtk.ButtonImage("refresh", " 100%",
"color3", .6, .6, Gtk.PositionType.LEFT, False)
"color3", .6, Gtk.PositionType.LEFT, False)
self.labels['extrude+'] = self._gtk.ButtonImage("flow+", _("Extrusion +"), "color4")
self.labels['extrude-'] = self._gtk.ButtonImage("flow-", _("Extrusion -"), "color4")
self.labels['extrudefactor'] = self._gtk.ButtonImage("refresh", " 100%",
"color4", .6, .6, Gtk.PositionType.LEFT, False)
"color4", .6, Gtk.PositionType.LEFT, False)
grid.attach(self.labels['z+'], 0, 0, 1, 1)
grid.attach(self.labels['z-'], 1, 0, 1, 1)
@@ -110,17 +112,17 @@ class FineTunePanel(ScreenPanel):
else:
self.labels['z+'] = self._gtk.ButtonImage("z-farther", _("Z+"), "color1")
self.labels['zoffset'] = self._gtk.ButtonImage("refresh", " 0.00" + _("mm"),
"color1", .6, .6, Gtk.PositionType.LEFT, False)
"color1", .6, Gtk.PositionType.LEFT, False)
self.labels['z-'] = self._gtk.ButtonImage("z-closer", _("Z-"), "color1")
self.labels['speed+'] = self._gtk.ButtonImage("speed+", _("Speed +"), "color3")
self.labels['speedfactor'] = self._gtk.ButtonImage("refresh", " 100%",
"color3", .6, .6, Gtk.PositionType.LEFT, False)
"color3", .6, Gtk.PositionType.LEFT, False)
self.labels['speed-'] = self._gtk.ButtonImage("speed-", _("Speed -"), "color3")
self.labels['extrude+'] = self._gtk.ButtonImage("flow+", _("Extrusion +"), "color4")
self.labels['extrudefactor'] = self._gtk.ButtonImage("refresh", " 100%",
"color4", .6, .6, Gtk.PositionType.LEFT, False)
"color4", .6, Gtk.PositionType.LEFT, False)
self.labels['extrude-'] = self._gtk.ButtonImage("flow-", _("Extrusion -"), "color4")
grid.attach(self.labels['zoffset'], 0, 0, 1, 1)
grid.attach(self.labels['z+'], 0, 1, 1, 1)
@@ -134,15 +136,15 @@ class FineTunePanel(ScreenPanel):
grid.attach(self.labels['extrude-'], 2, 2, 1, 1)
grid.attach(deltgrid, 1, 3, 2, 1)
self.labels['z+'].connect("clicked", self.change_babystepping, "+")
self.labels['zoffset'].connect("clicked", self.change_babystepping, "reset")
self.labels['z-'].connect("clicked", self.change_babystepping, "-")
self.labels['speed+'].connect("clicked", self.change_speed, "+")
self.labels['speedfactor'].connect("clicked", self.change_speed, "reset")
self.labels['speed-'].connect("clicked", self.change_speed, "-")
self.labels['extrude+'].connect("clicked", self.change_extrusion, "+")
self.labels['extrudefactor'].connect("clicked", self.change_extrusion, "reset")
self.labels['extrude-'].connect("clicked", self.change_extrusion, "-")
self.labels['z+'].connect("clicked", self.change_babystepping, "+")
self.labels['zoffset'].connect("clicked", self.change_babystepping, "reset")
self.labels['z-'].connect("clicked", self.change_babystepping, "-")
self.labels['speed+'].connect("clicked", self.change_speed, "+")
self.labels['speedfactor'].connect("clicked", self.change_speed, "reset")
self.labels['speed-'].connect("clicked", self.change_speed, "-")
self.labels['extrude+'].connect("clicked", self.change_extrusion, "+")
self.labels['extrudefactor'].connect("clicked", self.change_extrusion, "reset")
self.labels['extrude-'].connect("clicked", self.change_extrusion, "-")
self.content.add(grid)
@@ -156,10 +158,10 @@ class FineTunePanel(ScreenPanel):
if "homing_origin" in data["gcode_move"]:
self.labels['zoffset'].set_label(" %.2fmm" % data["gcode_move"]["homing_origin"][2])
if "extrude_factor" in data["gcode_move"]:
self.extrusion = int(round(data["gcode_move"]["extrude_factor"]*100))
self.extrusion = int(round(data["gcode_move"]["extrude_factor"] * 100))
self.labels['extrudefactor'].set_label(" %3d%%" % self.extrusion)
if "speed_factor" in data["gcode_move"]:
self.speed = int(round(data["gcode_move"]["speed_factor"]*100))
self.speed = int(round(data["gcode_move"]["speed_factor"] * 100))
self.labels['speedfactor'].set_label(" %3d%%" % self.speed)
def change_babystepping(self, widget, dir):
+131 -42
View File
@@ -2,50 +2,66 @@ import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gdk, Gtk, Pango
from gi.repository import Gdk, Gtk, GLib, Pango
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return MacroPanel(*args)
class MacroPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
self.macros = {}
self.loaded_macros = []
self.sort_char = [" ↑", " ↓"]
self.sort_reverse = False
self.menu = ['macros_menu']
# Create a scroll window for the macros
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
sort = Gtk.Label(_("Sort:"))
sort.set_hexpand(False)
self.sort_lbl = _("Name")
self.sort_btn = self._gtk.Button(self.sort_lbl + self.sort_char[0], "color1")
self.sort_btn.connect("clicked", self.change_sort)
self.sort_btn.set_hexpand(True)
adjust = self._gtk.ButtonImage("settings", None, "color2", 1, Gtk.PositionType.LEFT, False)
adjust.connect("clicked", self.load_menu, 'options')
adjust.set_hexpand(False)
# Create a grid for all macros
sbox = Gtk.HBox()
sbox.set_vexpand(False)
sbox.pack_start(sort, False, False, 5)
sbox.pack_start(self.sort_btn, True, True, 5)
sbox.pack_start(adjust, True, True, 5)
self.labels['macros_list'] = self._gtk.ScrolledWindow()
self.labels['macros'] = Gtk.Grid()
scroll.add(self.labels['macros'])
self.labels['macros_list'].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.labels['macros_menu'] = Gtk.VBox()
self.labels['macros_menu'].set_vexpand(True)
self.labels['macros_menu'].pack_start(sbox, False, False, 0)
self.labels['macros_menu'].pack_start(self.labels['macros_list'], True, True, 0)
self.content.add(box)
self.content.add(self.labels['macros_menu'])
self.labels['options_menu'] = self._gtk.ScrolledWindow()
self.labels['options'] = Gtk.Grid()
self.labels['options_menu'].add(self.labels['options'])
def activate(self):
self.unload_gcode_macros()
self.load_gcode_macros()
while len(self.menu) > 1:
self.unload_menu()
self.reload_macros()
def add_gcode_macro(self, macro):
# Support for hiding macros by name
if macro.startswith("_"):
return
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (macro))
name.set_markup("<big><b>%s</b></big>" % macro)
name.set_hexpand(True)
name.set_vexpand(True)
name.set_halign(Gtk.Align.START)
@@ -53,33 +69,53 @@ class MacroPanel(ScreenPanel):
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
open = self._gtk.ButtonImage("resume", None, "color3")
open.connect("clicked", self.run_gcode_macro, macro)
open.set_hexpand(False)
open.set_halign(Gtk.Align.END)
btn = self._gtk.ButtonImage("resume", None, "color3")
btn.connect("clicked", self.run_gcode_macro, macro)
btn.set_hexpand(False)
btn.set_halign(Gtk.Align.END)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels = Gtk.VBox()
labels.add(name)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev = Gtk.HBox(spacing=5)
dev.add(labels)
dev.add(open)
dev.add(btn)
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
frame.add(dev)
self.macros[macro] = {
"row": frame
}
macros = sorted(self.macros)
macros = sorted(self.macros, reverse=self.sort_reverse, key=str.casefold)
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 run_gcode_macro(self, widget, macro):
self._screen._ws.klippy.gcode_script(macro)
def change_sort(self, widget):
self.sort_reverse ^= True
if self.sort_reverse:
self.sort_btn.set_label(self.sort_lbl + self.sort_char[1])
else:
self.sort_btn.set_label(self.sort_lbl + self.sort_char[0])
self.sort_btn.show()
GLib.idle_add(self.reload_macros)
def reload_macros(self):
self.labels['macros'].remove_column(0)
self.macros = {}
self.loaded_macros = []
self.allmacros = {}
self.labels['options'].remove_column(0)
self.load_gcode_macros()
def load_gcode_macros(self):
macros = self._screen.printer.get_gcode_macros()
@@ -96,15 +132,68 @@ class MacroPanel(ScreenPanel):
self._config.get_config().getboolean(section_name, macro.lower(), fallback=True)):
self.add_gcode_macro(macro)
def run_gcode_macro(self, widget, macro):
self._screen._ws.klippy.gcode_script(macro)
for macro in self._printer.get_config_section_list("gcode_macro "):
macro = macro[12:]
# Support for hiding macros by name
if macro.startswith("_"):
continue
def unload_gcode_macros(self):
section_name = "displayed_macros %s" % self._screen.connected_printer
for macro in self.loaded_macros:
if (section_name in self._config.get_config().sections() and
not self._config.get_config().getboolean(section_name, macro.lower(), fallback=True)):
macros = sorted(self.macros)
pos = macros.index(macro)
self.labels['macros'].remove_row(pos)
self.labels['macros'].show_all()
self.allmacros[macro] = {
"name": macro,
"section": "displayed_macros %s" % self._screen.connected_printer,
}
for macro in list(self.allmacros):
self.add_option('options', self.allmacros, macro, self.allmacros[macro])
self.labels['macros'].show_all()
def add_option(self, boxname, opt_array, opt_name, option):
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)
box = Gtk.Box()
box.set_vexpand(False)
switch = Gtk.Switch()
switch.set_hexpand(False)
switch.set_vexpand(False)
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name, fallback=True))
switch.connect("notify::active", self.switch_config_option, option['section'], opt_name)
switch.set_property("width-request", round(self._gtk.get_font_size() * 7))
switch.set_property("height-request", round(self._gtk.get_font_size() * 3.5))
box.add(switch)
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(name)
dev.add(box)
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
frame.add(dev)
frame.show_all()
opt_array[opt_name] = {
"name": option['name'],
"row": frame
}
opts = sorted(self.allmacros, key=str.casefold)
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 back(self):
if len(self.menu) > 1:
self.unload_menu()
self.reload_macros()
return True
return False
+200
View File
@@ -0,0 +1,200 @@
import gi
import re
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Pango
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return InputShaperPanel(*args)
# X and Y frequencies
XY_FREQ = [
{'name': 'X', 'config': 'shaper_freq_x', 'min': 0, 'max': 133},
{'name': 'Y', 'config': 'shaper_freq_y', 'min': 0, 'max': 133},
]
SHAPERS = ['zv', 'mzv', 'zvd', 'ei', '2hump_ei', '3hump_ei']
class InputShaperPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
self.has_sensor = False
self.calibrating_axis = None
auto_calibration_label = Gtk.Label()
auto_calibration_label.set_markup('<big><b>Auto Calibration</b></big>')
auto_calibration_label.set_hexpand(True)
self.calibrate_btn = self._gtk.ButtonImage("move", _('Finding ADXL'), "color1", word_wrap=False)
self.calibrate_btn.connect("clicked", self.on_popover_clicked)
self.calibrate_btn.set_sensitive(False)
auto_grid = Gtk.Grid()
auto_grid.attach(auto_calibration_label, 0, 0, 1, 1)
auto_grid.attach(self.calibrate_btn, 1, 0, 1, 1)
manual_calibration_label = Gtk.Label()
manual_calibration_label.set_markup('<big><b>Manual Calibration</b></big>')
manual_calibration_label.set_vexpand(True)
disclaimer = Gtk.Label()
disclaimer.set_markup('<small>NOTE: Edit your printer.cfg to save manual calibration changes.</small>')
disclaimer.set_line_wrap(True)
disclaimer.set_halign(Gtk.Align.CENTER)
input_grid = Gtk.Grid()
input_grid.attach(manual_calibration_label, 0, 0, 3, 1)
input_grid.attach(disclaimer, 0, 1, 3, 1)
self.freq_xy_adj = {}
self.freq_xy_combo = {}
for i, dim_freq in enumerate(XY_FREQ):
axis_lbl = Gtk.Label()
axis_lbl.set_markup("<b>{}</b>".format(dim_freq['name']))
axis_lbl.set_hexpand(False)
axis_lbl.set_vexpand(True)
axis_lbl.set_halign(Gtk.Align.START)
axis_lbl.set_valign(Gtk.Align.CENTER)
axis_lbl.set_line_wrap(True)
self.freq_xy_adj[dim_freq['config']] = Gtk.Adjustment(0, dim_freq['min'], dim_freq['max'], 0.1)
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=self.freq_xy_adj[dim_freq['config']])
scale.set_digits(1)
scale.set_hexpand(True)
scale.set_valign(Gtk.Align.END)
scale.set_has_origin(True)
scale.get_style_context().add_class("option_slider")
scale.connect("button-release-event", self.set_opt_value, dim_freq['config'])
shaper_slug = dim_freq['config'].replace('_freq_', '_type_')
self.freq_xy_combo[shaper_slug] = Gtk.ComboBoxText()
for shaper in SHAPERS:
self.freq_xy_combo[shaper_slug].append(shaper, shaper)
self.freq_xy_combo[shaper_slug].set_active(0)
input_grid.attach(axis_lbl, 0, i + 2, 1, 1)
input_grid.attach(scale, 1, i + 2, 1, 1)
input_grid.attach(self.freq_xy_combo[shaper_slug], 2, i + 2, 1, 1)
self.status = Gtk.Label("")
self.status.set_hexpand(True)
self.status.set_vexpand(False)
self.status.set_halign(Gtk.Align.START)
self.status.set_ellipsize(Pango.EllipsizeMode.END)
box = Gtk.VBox()
box.add(auto_grid)
box.add(input_grid)
box.add(self.status)
self.content.add(box)
pobox = Gtk.VBox()
test_x = self._gtk.Button(_("Measure X"))
test_x.connect("clicked", self.start_calibration, "x")
pobox.pack_start(test_x, True, True, 5)
test_y = self._gtk.Button(_("Measure Y"))
test_y.connect("clicked", self.start_calibration, "y")
pobox.pack_start(test_y, True, True, 5)
test_both = self._gtk.Button(_("Measure Both"))
test_both.connect("clicked", self.start_calibration, "both")
pobox.pack_start(test_both, True, True, 5)
self.labels['popover'] = Gtk.Popover()
self.labels['popover'].add(pobox)
self.labels['popover'].set_position(Gtk.PositionType.LEFT)
def on_popover_clicked(self, widget):
self.labels['popover'].set_relative_to(widget)
self.labels['popover'].show_all()
def start_calibration(self, widget, method):
self.labels['popover'].popdown()
if self._screen.printer.get_stat("toolhead", "homed_axes") != "xyz":
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
self.calibrating_axis = method
if method == "x":
self._screen._ws.klippy.gcode_script('SHAPER_CALIBRATE AXIS=X')
if method == "y":
self._screen._ws.klippy.gcode_script('SHAPER_CALIBRATE AXIS=Y')
if method == "both":
self._screen._ws.klippy.gcode_script('SHAPER_CALIBRATE')
self.calibrate_btn.set_label(self.lang.gettext('Calibrating...'))
self.calibrate_btn.set_sensitive(False)
def set_opt_value(self, widget, opt, *args):
shaper_freq_x = self.freq_xy_adj['shaper_freq_x'].get_value()
shaper_freq_y = self.freq_xy_adj['shaper_freq_y'].get_value()
shaper_type_x = self.freq_xy_combo['shaper_type_x'].get_active_text()
shaper_type_y = self.freq_xy_combo['shaper_type_y'].get_active_text()
self._screen._ws.klippy.gcode_script(
'SET_INPUT_SHAPER SHAPER_FREQ_X={} SHAPER_TYPE_X={} SHAPER_FREQ_Y={} SHAPER_TYPE_Y={}'.format(
shaper_freq_x, shaper_type_x, shaper_freq_y, shaper_type_y
)
)
def save_config(self):
_ = self.lang.gettext
script = {"script": "SAVE_CONFIG"}
self._screen._confirm_send_action(
None,
_("Save configuration?") + "\n\n" + _("Klipper will reboot"),
"printer.gcode.script",
script
)
def activate(self):
# This will return the current values
self._screen._ws.klippy.gcode_script(
'SET_INPUT_SHAPER'
)
# Check for the accelerometer
self._screen._ws.klippy.gcode_script(
'ACCELEROMETER_QUERY'
)
# Send at least two commands, with my accelerometer the first command after a reboot will fail
self._screen._ws.klippy.gcode_script(
'MEASURE_AXES_NOISE'
)
def process_update(self, action, data):
_ = self.lang.gettext
if action == "notify_gcode_response":
self.status.set_text('{}'.format(data.replace('shaper_', '').replace('damping_', '')))
data = data.lower()
if 'got 0' in data:
self.calibrate_btn.set_label(_('Check ADXL Wiring'))
self.calibrate_btn.set_sensitive(False)
if 'unknown command:"accelerometer_query"' in data:
self.calibrate_btn.set_label(_('ADXL Not Configured'))
self.calibrate_btn.set_sensitive(False)
if 'adxl345 values' in data or 'axes noise' in data:
self.has_sensor = True
self.calibrate_btn.set_sensitive(True)
self.calibrate_btn.set_label(_('Auto-calibrate'))
# Recommended shaper_type_y = ei, shaper_freq_y = 48.4 Hz
if 'recommended shaper_type_' in data:
results = re.search(r'shaper_type_(?P<axis>[xy])\s*=\s*(?P<shaper_type>.*?), shaper_freq_.\s*=\s*('
r'?P<shaper_freq>[0-9.]+)', data).groupdict()
self.freq_xy_adj['shaper_freq_' + results['axis']].set_value(float(results['shaper_freq']))
self.freq_xy_combo['shaper_type_' + results['axis']].set_active(SHAPERS.index(results['shaper_type']))
if self.calibrating_axis == results['axis']:
self.calibrate_btn.set_sensitive(True)
self.calibrate_btn.set_label(_('Calibrated'))
self.save_config()
elif self.calibrating_axis == "both" and results['axis'] == 'y':
self.calibrate_btn.set_sensitive(True)
self.calibrate_btn.set_label(_('Calibrated'))
self.save_config()
# shaper_type_y:ei shaper_freq_y:48.400 damping_ratio_y:0.100000
if 'shaper_type_' in data:
results = re.search(r'shaper_type_(?P<axis>[xy]):(?P<shaper_type>.*?) shaper_freq_.:('
r'?P<shaper_freq>[0-9.]+)', data).groupdict()
self.freq_xy_adj['shaper_freq_' + results['axis']].set_value(float(results['shaper_freq']))
self.freq_xy_combo['shaper_type_' + results['axis']].set_active(SHAPERS.index(results['shaper_type']))
+592 -273
View File
File diff suppressed because it is too large. Load diff
+57 -53
View File
@@ -6,6 +6,7 @@ from gi.repository import Gdk, Gtk, Pango
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return LimitsPanel(*args)
@@ -15,73 +16,67 @@ class LimitsPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
self.devices = {}
self.limits = {}
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
scroll = self._gtk.ScrolledWindow()
# 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)
# Create a grid for all limits
self.grid = Gtk.Grid()
scroll.add(self.grid)
conf = self._printer.get_config_section("printer")
self.options = [
{"name": _("Max Accelation"), "units": _("mm/s^2"), "option": "max_accel",
"value": self.stn(conf['max_accel'])},
{"name": _("Max Acceleration"), "units": _("mm/s^2"), "option": "max_accel",
"max": self.stn(conf['max_accel'])},
{"name": _("Max Acceleration to Deceleration"), "units": _("mm/s^2"), "option": "max_accel_to_decel",
"value": self.stn(conf['max_accel_to_decel']) if "max_accel_to_decel" in conf else
round(self.stn(conf['max_accel'])/2)},
"max": self.stn(conf['max_accel_to_decel']) if "max_accel_to_decel" in conf else
round(self.stn(conf['max_accel']) / 2)},
{"name": _("Max Velocity"), "units": _("mm/s"), "option": "max_velocity",
"value": self.stn(conf["max_velocity"])},
"max": self.stn(conf["max_velocity"])},
{"name": _("Square Corner Velocity"), "units": _("mm/s"), "option": "square_corner_velocity",
"value": self.stn(conf['square_corner_velocity']) if "square_corner_velocity" in conf else 5}
"max": self.stn(conf['square_corner_velocity']) if "square_corner_velocity" in conf else 5}
]
for opt in self.options:
self.add_option(opt['option'], opt['name'], opt['units'], opt['value'])
self.add_option(opt['option'], opt['name'], opt['units'], opt['max'])
self.content.add(box)
self.content.add(scroll)
self.content.show_all()
def stn(self, str):
return int(float(str))
def process_update(self, action, data):
if (action != "notify_status_update"):
if action != "notify_status_update":
return
for opt in self.devices:
for opt in self.limits:
if "toolhead" in data and opt in data["toolhead"]:
self.update_option(opt, data["toolhead"][opt])
def update_option(self, option, value):
if option not in self.devices:
if option not in self.limits:
return
if self.devices[option]['scale'].has_grab():
if self.limits[option]['scale'].has_grab():
return
self.values[option] = int(value)
self.devices[option]['scale'].disconnect_by_func(self.set_opt_value)
self.devices[option]['scale'].set_value(self.values[option])
self.devices[option]['scale'].connect("button-release-event", self.set_opt_value, option)
self.limits[option]['scale'].disconnect_by_func(self.set_opt_value)
self.limits[option]['scale'].set_value(self.values[option])
for opt in self.options:
if opt["option"] == option:
if self.values[option] > opt["max"]:
self.limits[option]['scale'].get_style_context().add_class("option_slider_max")
else:
self.limits[option]['scale'].get_style_context().remove_class("option_slider_max")
self.limits[option]['scale'].connect("button-release-event", self.set_opt_value, option)
def add_option(self, option, optname, units, value):
logging.info("Adding option: %s" % option)
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (optname))
name.set_markup("<big><b>%s</b></big> (%s)" % (optname, units))
name.set_hexpand(True)
name.set_vexpand(True)
name.set_halign(Gtk.Align.START)
@@ -89,7 +84,7 @@ class LimitsPanel(ScreenPanel):
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
adj = Gtk.Adjustment(0, 0, value, 1, 5, 0)
adj = Gtk.Adjustment(0, 1, (value * 1.5), 1, 5, 0)
self.values[option] = value
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj)
scale.set_value(self.values[option])
@@ -99,36 +94,45 @@ class LimitsPanel(ScreenPanel):
scale.get_style_context().add_class("option_slider")
scale.connect("button-release-event", self.set_opt_value, option)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
labels.add(scale)
reset = self._gtk.ButtonImage("refresh", None, "color1")
reset.connect("clicked", self.reset_value, option)
reset.set_hexpand(False)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev.add(labels)
frame.add(dev)
item = Gtk.Grid()
item.attach(name, 0, 0, 2, 1)
item.attach(scale, 0, 1, 1, 1)
item.attach(reset, 1, 1, 1, 1)
self.devices[option] = {
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
frame.add(item)
self.limits[option] = {
"row": frame,
"scale": scale,
}
devices = sorted(self.devices)
pos = devices.index(option)
limits = sorted(self.limits)
pos = limits.index(option)
self.labels['devices'].insert_row(pos)
self.labels['devices'].attach(self.devices[option]['row'], 0, pos, 1, 1)
self.labels['devices'].show_all()
self.grid.insert_row(pos)
self.grid.attach(self.limits[option]['row'], 0, pos, 1, 1)
self.grid.show_all()
def reset_value(self, widget, option):
for x in self.options:
if x["option"] == option:
self.update_option(option, x["max"])
self.set_opt_value(None, None, option)
def set_opt_value(self, widget, event, opt):
value = self.devices[opt]['scale'].get_value()
value = self.limits[opt]['scale'].get_value()
if opt == "max_accel":
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT ACCEL=%s" % (value))
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT ACCEL=%s" % value)
elif opt == "max_accel_to_decel":
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT ACCEL_TO_DECEL=%s" % (value))
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT ACCEL_TO_DECEL=%s" % value)
elif opt == "max_velocity":
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT VELOCITY=%s" % (value))
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT VELOCITY=%s" % value)
elif opt == "square_corner_velocity":
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=%s" % (value))
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=%s" % value)
+9 -14
View File
@@ -8,9 +8,11 @@ from panels.menu import MenuPanel
from ks_includes.widgets.graph import HeaterGraph
from ks_includes.widgets.keypad import Keypad
def create_panel(*args):
return MainPanel(*args)
class MainPanel(MenuPanel):
def __init__(self, screen, title, back=False):
super().__init__(screen, title, False)
@@ -91,12 +93,12 @@ class MainPanel(MenuPanel):
class_name = "graph_label_heater_bed"
type = "bed"
elif device.startswith("heater_generic"):
h = 1
self.h = 1
for d in self.devices:
if "heater_generic" in d:
h += 1
image = "heat-up"
class_name = "graph_label_sensor_%s" % h
self.h += 1
image = "heater"
class_name = "graph_label_sensor_%s" % self.h
type = "sensor"
elif device.startswith("temperature_fan"):
f = 1
@@ -111,7 +113,7 @@ class MainPanel(MenuPanel):
else:
s = 1
try:
s += h
s += self.h
except Exception:
pass
for d in self.devices:
@@ -130,12 +132,11 @@ class MainPanel(MenuPanel):
text = "<span underline='double' underline_color='#%s'>%s</span>" % (color, devname.capitalize())
name = self._gtk.ButtonImage(image, devname.capitalize().replace("_", " "),
None, .5, .5, Gtk.PositionType.LEFT, False)
None, .5, Gtk.PositionType.LEFT, False)
name.connect('clicked', self.on_popover_clicked, device)
name.set_alignment(0, .5)
name.get_style_context().add_class(class_name)
child = name.get_children()[0].get_children()[0].get_children()[1]
child.set_ellipsize(True)
child.set_ellipsize(Pango.EllipsizeMode.END)
temp = self._gtk.Button("")
@@ -211,12 +212,7 @@ class MainPanel(MenuPanel):
da.set_vexpand(True)
self.labels['da'] = da
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
scroll = self._gtk.ScrolledWindow()
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.add(self.labels['devices'])
@@ -225,7 +221,6 @@ class MainPanel(MenuPanel):
box.add(scroll)
box.add(self.labels['da'])
self.labels['graph_settemp'] = self._gtk.Button(label=_("Set Temp"))
self.labels['graph_settemp'].connect("clicked", self.show_numpad)
self.labels['graph_hide'] = self._gtk.Button(label=_("Hide"))
+14 -12
View File
@@ -7,12 +7,15 @@ from jinja2 import Environment, Template
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return MenuPanel(*args)
class MenuPanel(ScreenPanel):
i = 0
j2_data = None
def initialize(self, panel_name, display_name, items):
_ = self.lang.gettext
@@ -21,18 +24,14 @@ class MenuPanel(ScreenPanel):
self.grid = self._gtk.HomogeneousGrid()
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True)
scroll.set_vexpand(True)
scroll = self._gtk.ScrolledWindow()
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.add(self.grid)
self.content.add(scroll)
def activate(self):
if not self.j2_data:
self.j2_data = self._printer.get_printer_status_data()
self.j2_data = self._printer.get_printer_status_data()
self.j2_data.update({
'moonraker_connected': self._screen._ws.is_connected()
})
@@ -57,15 +56,15 @@ class MenuPanel(ScreenPanel):
if length <= 4:
# Arrange 2 x 2
columns = 2
elif length > 4 and length <= 6:
elif 4 < length <= 6:
# Arrange 3 x 2
columns = 3
col = i % columns
row = int(i/columns)
row = int(i / columns)
width = height = 1
if expandLast is True and i+1 == length and length % 2 == 1:
if expandLast is True and i + 1 == length and length % 2 == 1:
width = 2
self.grid.attach(self.labels[key], col, row, width, height)
@@ -84,7 +83,7 @@ class MenuPanel(ScreenPanel):
parsed_name = j2_temp.render()
b = self._gtk.ButtonImage(
item['icon'], parsed_name, "color"+str((i % 4)+1)
item['icon'], parsed_name, "color" + str((i % 4) + 1)
)
if item['panel'] is not False:
b.connect("clicked", self.menu_item_clicked, item['panel'], item)
@@ -104,8 +103,11 @@ class MenuPanel(ScreenPanel):
if enable is False:
return False
if not self.j2_data:
self.j2_data = self._printer.get_printer_status_data()
if enable == "{{ moonraker_connected }}":
logging.info("moonraker is_connected %s", self._screen._ws.is_connected())
return self._screen._ws.is_connected()
self.j2_data = self._printer.get_printer_status_data()
try:
logging.debug("Template: '%s'" % enable)
logging.debug("Data: %s" % self.j2_data)
+112 -14
View File
@@ -2,7 +2,7 @@ import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
from gi.repository import Gdk, Gtk, Pango
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
@@ -11,16 +11,19 @@ AXIS_X = "X"
AXIS_Y = "Y"
AXIS_Z = "Z"
def create_panel(*args):
return MovePanel(*args)
class MovePanel(ScreenPanel):
distance = 1
distances = ['.1', '.5', '1', '5', '10', '25', '50']
def initialize(self, panel_name):
_ = self.lang.gettext
self.settings = {}
self.menu = ['move_menu']
grid = self._gtk.HomogeneousGrid()
@@ -102,9 +105,9 @@ class MovePanel(ScreenPanel):
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):
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):
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")
@@ -115,23 +118,55 @@ class MovePanel(ScreenPanel):
self.labels["1"].set_active(True)
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")
adjust = self._gtk.ButtonImage("settings", None, "color2", 1, Gtk.PositionType.LEFT, False)
adjust.connect("clicked", self.load_menu, 'options')
adjust.set_hexpand(False)
self.labels['move_dist'] = Gtk.Label(_("Move Distance (mm)"))
bottomgrid = self._gtk.HomogeneousGrid()
bottomgrid.set_direction(Gtk.TextDirection.LTR)
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)
self.labels['move_dist'] = Gtk.Label(_("Move Distance (mm)"))
bottomgrid.attach(self.labels['move_dist'], 0, 1, 3, 1)
bottomgrid.attach(adjust, 3, 0, 1, 2)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.pack_start(grid, True, True, 0)
box.pack_start(bottomgrid, True, True, 0)
box.pack_start(self.labels['move_dist'], True, True, 0)
box.pack_start(distgrid, True, True, 0)
self.labels['move_menu'] = Gtk.VBox()
self.labels['move_menu'].set_vexpand(True)
self.labels['move_menu'].pack_start(grid, True, True, 0)
self.labels['move_menu'].pack_start(bottomgrid, True, True, 0)
self.labels['move_menu'].pack_start(distgrid, True, True, 0)
self.content.add(box)
self.content.add(self.labels['move_menu'])
printer_cfg = self._printer.get_config_section("printer")
max_velocity = int(float(printer_cfg["max_velocity"]))
if "max_z_velocity" in printer_cfg:
max_z_velocity = int(float(printer_cfg["max_z_velocity"]))
else:
max_z_velocity = max_velocity
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"}},
{"move_speed_xy": {
"section": "main", "name": _("XY Speed (mm/s)"), "type": "scale", "value": "50",
"range": [1, max_velocity], "step": 1}},
{"move_speed_z": {
"section": "main", "name": _("Z Speed (mm/s)"), "type": "scale", "value": "10",
"range": [1, max_z_velocity], "step": 1}}
]
self.labels['options_menu'] = self._gtk.ScrolledWindow()
self.labels['options'] = Gtk.Grid()
self.labels['options_menu'].add(self.labels['options'])
for option in configurable_options:
name = list(option)[0]
self.add_option('options', self.settings, name, option[name])
def process_update(self, action, data):
if action != "notify_status_update":
@@ -196,7 +231,70 @@ class MovePanel(ScreenPanel):
self._screen._ws.klippy.gcode_script(
"%s\n%s %s%s F%s%s" % (
KlippyGcodes.MOVE_RELATIVE, KlippyGcodes.MOVE, axis, dist, speed*60,
KlippyGcodes.MOVE_RELATIVE, KlippyGcodes.MOVE, axis, dist, speed * 60,
"\nG90" if self._printer.get_stat("gcode_move", "absolute_coordinates") is True else ""
)
)
def add_option(self, boxname, opt_array, opt_name, option):
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)
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(name)
if option['type'] == "binary":
box = Gtk.Box()
box.set_vexpand(False)
switch = Gtk.Switch()
switch.set_hexpand(False)
switch.set_vexpand(False)
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_font_size() * 7))
switch.set_property("height-request", round(self._gtk.get_font_size() * 3.5))
box.add(switch)
dev.add(box)
elif option['type'] == "scale":
dev.set_orientation(Gtk.Orientation.VERTICAL)
val = int(self._config.get_config().get(option['section'], opt_name, fallback=option['value']))
adj = Gtk.Adjustment(val, option['range'][0], option['range'][1], option['step'], option['step'] * 5)
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj)
scale.set_hexpand(True)
scale.set_digits(0)
scale.connect("button-release-event", self.scale_moved, option['section'], opt_name)
scale.set_property("width-request", round(self._screen.width / 2.2))
dev.add(scale)
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
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 back(self):
if len(self.menu) > 1:
self.unload_menu()
return True
return False
+6 -11
View File
@@ -2,16 +2,17 @@ import gi
import logging
import netifaces
import os
import netifaces
from ks_includes.wifi import WifiManager
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return NetworkPanel(*args)
class NetworkPanel(ScreenPanel):
initialized = False
@@ -39,7 +40,7 @@ class NetworkPanel(ScreenPanel):
ints = netifaces.interfaces()
if 'lo' in ints:
ints.pop(ints.index('lo'))
if (len(ints) > 0):
if len(ints) > 0:
self.interface = ints[0]
else:
self.interface = 'lo'
@@ -70,12 +71,7 @@ class NetworkPanel(ScreenPanel):
sbox.add(self.labels['ip'])
sbox.add(reload_networks)
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
scroll = self._gtk.ScrolledWindow()
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
@@ -152,7 +148,7 @@ class NetworkPanel(ScreenPanel):
display_name += " (" + _("Connected") + ")"
name = Gtk.Label("")
name.set_markup("<big><b>%s</b></big>" % (display_name))
name.set_markup("<big><b>%s</b></big>" % display_name)
name.set_hexpand(True)
name.set_halign(Gtk.Align.START)
name.set_line_wrap(True)
@@ -373,7 +369,6 @@ class NetworkPanel(ScreenPanel):
save.set_hexpand(False)
save.connect("clicked", self.add_new_network, ssid, True)
self.labels['network_psk'] = entry
box.pack_start(label, False, False, 5)
box.pack_start(entry, True, True, 5)
@@ -429,7 +424,7 @@ class NetworkPanel(ScreenPanel):
lvl = netinfo['signal_level_dBm'] + " " + _("dBm")
self.labels['networks'][ssid]['info'].set_markup("%s <small>%s %s %s %s</small>" % (
info, encr, freq, chan, lvl))
info, encr, freq, chan, lvl))
self.labels['networks'][ssid]['info'].show_all()
def update_single_network_info(self):
+6 -8
View File
@@ -6,20 +6,18 @@ from gi.repository import Gdk, Gtk, Pango
from ks_includes.screen_panel import ScreenPanel
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)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
scroll = self._gtk.ScrolledWindow()
# Create a grid for all devices
self.labels['devices'] = Gtk.Grid()
@@ -47,7 +45,7 @@ class PowerPanel(ScreenPanel):
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (device))
name.set_markup("<big><b>%s</b></big>" % device)
name.set_hexpand(True)
name.set_vexpand(True)
name.set_halign(Gtk.Align.START)
@@ -59,8 +57,8 @@ class PowerPanel(ScreenPanel):
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_font_size()*7))
switch.set_property("height-request", round(self._gtk.get_font_size()*3.5))
switch.set_property("width-request", round(self._gtk.get_font_size() * 7))
switch.set_property("height-request", round(self._gtk.get_font_size() * 3.5))
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
+15 -17
View File
@@ -9,9 +9,11 @@ from datetime import datetime
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return PrintPanel(*args)
class PrintPanel(ScreenPanel):
cur_directory = "gcodes"
dir_panels = {}
@@ -33,11 +35,7 @@ class PrintPanel(ScreenPanel):
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)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
scroll = self._gtk.ScrolledWindow()
sort = Gtk.Label()
sort.set_text(_("Sort by: "))
@@ -55,7 +53,7 @@ class PrintPanel(ScreenPanel):
sbox.add(s)
i += 1
refresh = self._gtk.ButtonImage("refresh", None, None, .5, .5)
refresh = self._gtk.ButtonImage("refresh", None, None, .5)
refresh.connect('clicked', self._refresh_files)
sbox.add(refresh)
sbox.set_hexpand(True)
@@ -125,7 +123,7 @@ class PrintPanel(ScreenPanel):
file.set_hexpand(True)
file.set_vexpand(False)
icon = self._gtk.Image("folder.svg", False, 1, 1)
icon = self._gtk.Image("folder", 1)
file.add(icon)
file.add(labels)
@@ -167,13 +165,13 @@ class PrintPanel(ScreenPanel):
filename = filepath.split('/')[-1]
for i in range(1, len(dir)):
curdir = "/".join(dir[0:i])
newdir = "/".join(dir[0:i+1])
newdir = "/".join(dir[0:i + 1])
if newdir not in self.filelist[curdir]['directories']:
self.add_directory(newdir)
if filename not in self.filelist[directory]['files']:
for i in range(1, len(dir)):
curdir = "/".join(dir[0:i+1])
curdir = "/".join(dir[0:i + 1])
if curdir != "gcodes" and fileinfo['modified'] > self.filelist[curdir]['modified']:
self.filelist[curdir]['modified'] = fileinfo['modified']
self.labels['directories'][curdir]['info'].set_markup(
@@ -212,11 +210,11 @@ class PrintPanel(ScreenPanel):
file.set_vexpand(False)
icon = Gtk.Image()
pixbuf = self.get_file_image(filepath)
pixbuf = self.get_file_image(filepath, small=True)
if pixbuf is not None:
icon.set_from_pixbuf(pixbuf)
else:
icon = self._gtk.Image("file.svg", False, 1.6, 1.6)
icon = self._gtk.Image("file", 1.6)
file.add(icon)
file.add(labels)
@@ -290,7 +288,7 @@ class PrintPanel(ScreenPanel):
]
label = Gtk.Label()
label.set_markup("<b>%s</b>\n" % (filename))
label.set_markup("<b>%s</b>\n" % filename)
label.set_hexpand(True)
label.set_halign(Gtk.Align.CENTER)
label.set_vexpand(True)
@@ -319,7 +317,7 @@ class PrintPanel(ScreenPanel):
if response_id == Gtk.ResponseType.CANCEL:
return
logging.info("Starting print: %s" % (filename))
logging.info("Starting print: %s" % filename)
self._screen._ws.klippy.print_start(filename)
def delete_file(self, filename):
@@ -370,7 +368,7 @@ class PrintPanel(ScreenPanel):
for i, suffix in enumerate(suffixes, start=2):
unit = 1024 ** i
if size < unit:
return ("%.1f %s") % ((1024 * size / unit), suffix)
return "%.1f %s" % ((1024 * size / unit), suffix)
def get_print_time(self, filename):
fileinfo = self._screen.files.get_file_info(filename)
@@ -382,16 +380,16 @@ class PrintPanel(ScreenPanel):
print_str = ""
# Figure out how many days
print_val = int(print_time/86400)
print_val = int(print_time / 86400)
if print_val > 0:
print_str = "%sd " % print_val
# Take remainder from days and divide by hours
print_val = int((print_time % 86400)/3600)
print_val = int((print_time % 86400) / 3600)
if print_val > 0:
print_str = "%s%sh " % (print_str, print_val)
print_val = int(((print_time % 86400) % 3600)/60)
print_val = int(((print_time % 86400) % 3600) / 60)
print_str = "%s%sm" % (print_str, print_val)
return print_str
return "Unavailable"
+6 -7
View File
@@ -7,9 +7,11 @@ from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.PrinterSelect")
def create_panel(*args):
return PrinterSelect(*args)
class PrinterSelect(ScreenPanel):
def __init__(self, screen, title, back=True, action_bar=True, printer_name=True):
super().__init__(screen, title, False, False, False)
@@ -20,10 +22,7 @@ class PrinterSelect(ScreenPanel):
printers = self._config.get_printers()
grid = self._gtk.HomogeneousGrid()
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True)
scroll.set_vexpand(True)
scroll = self._gtk.ScrolledWindow()
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.add(grid)
self.content.add(scroll)
@@ -32,7 +31,7 @@ class PrinterSelect(ScreenPanel):
if length == 4:
# Arrange 2 x 2
columns = 2
elif length > 4 and length <= 6:
elif 4 < length <= 6:
# Arrange 3 x 2
columns = 3
else:
@@ -44,8 +43,8 @@ class PrinterSelect(ScreenPanel):
self.labels[name].connect("clicked", self._screen.connect_printer_widget, name)
if self._screen.vertical_mode:
row = i % columns
col = int(i/columns)
col = int(i / columns)
else:
col = i % columns
row = int(i/columns)
row = int(i / columns)
grid.attach(self.labels[name], col, row, 1, 1)
+158
View File
@@ -0,0 +1,158 @@
import gi
import logging
import re
gi.require_version("Gtk", "3.0")
from gi.repository import Gdk, Gtk, Pango
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return FWRetractionPanel(*args)
class FWRetractionPanel(ScreenPanel):
values = {}
list = {}
def initialize(self, panel_name):
_ = self.lang.gettext
self.grid = Gtk.Grid()
conf = self._printer.get_config_section("firmware_retraction")
self.options = [
{"name": _("Retraction Length"),
"units": _("mm"),
"option": "retract_length",
"value": float(conf['retract_length']) if 'retract_length' in conf else 0,
"digits": 2,
"maxval": 4},
{"name": _("Retraction Speed"),
"units": _("mm/s"),
"option": "retract_speed",
"value": int(float((conf['retract_speed']))) if 'retract_speed' in conf else 20,
"digits": 0,
"maxval": 100},
{"name": _("Unretract Extra Length"),
"units": _("mm"),
"option": "unretract_extra_length",
"value": float(conf['unretract_extra_length']) if 'unretract_extra_length' in conf else 0,
"digits": 2,
"maxval": 15},
{"name": _("Unretract Speed"),
"units": _("mm/s"),
"option": "unretract_speed",
"value": int(float((conf['unretract_speed']))) if 'unretract_speed' in conf else 10,
"digits": 0,
"maxval": 60}
]
for opt in self.options:
self.add_option(opt['option'], opt['name'], opt['units'], opt['value'], opt['digits'], opt["maxval"])
scroll = self._gtk.ScrolledWindow()
scroll.add(self.grid)
self.content.add(scroll)
self.content.show_all()
def activate(self):
self._screen._ws.klippy.gcode_script("GET_RETRACTION")
def process_update(self, action, data):
if action == "notify_status_update" and "firmware_retraction" in data:
for opt in self.list:
if opt in data["firmware_retraction"]:
self.update_option(opt, data["firmware_retraction"][opt])
elif action == "notify_gcode_response":
# // RETRACT_LENGTH=0.00000 RETRACT_SPEED=20.00000 UNRETRACT_EXTRA_LENGTH=0.00000 UNRETRACT_SPEED=10.00000
result = re.match(
"^// [RETRACT_LENGTH= ]+([\\-0-9\\.]+)" +
"[RETRACT_SPEED= ]+([\\-0-9\\.]+)" +
"[UNRETRACT_EXTRA_LENGTH= ]+([\\-0-9\\.]+)" +
"[UNRETRACT_SPEED= ]+([\\-0-9\\.]+)",
data
)
if result:
self.update_option('retract_length', result.group(1))
self.update_option('retract_speed', result.group(2))
self.update_option('unretract_extra_length', result.group(3))
self.update_option('unretract_speed', result.group(4))
def update_option(self, option, value):
if option not in self.list:
return
if self.list[option]['scale'].has_grab():
return
self.values[option] = float(value)
self.list[option]['scale'].disconnect_by_func(self.set_opt_value)
self.list[option]['scale'].set_value(self.values[option])
self.list[option]['scale'].connect("button-release-event", self.set_opt_value, option)
def add_option(self, option, optname, units, value, digits, maxval):
logging.info("Adding option: %s" % option)
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big> (%s)" % (optname, units))
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)
if option in ["retract_speed", "unretract_speed"]:
adj = Gtk.Adjustment(0, 1, maxval, 1, 5, 0)
else:
adj = Gtk.Adjustment(0, 0, maxval, 1, 5, 0)
self.values[option] = value
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj)
scale.set_value(self.values[option])
scale.set_digits(digits)
scale.set_hexpand(True)
scale.set_has_origin(True)
scale.get_style_context().add_class("option_slider")
scale.connect("button-release-event", self.set_opt_value, option)
reset = self._gtk.ButtonImage("refresh", None, "color1")
reset.connect("clicked", self.reset_value, option)
reset.set_hexpand(False)
item = Gtk.Grid()
item.attach(name, 0, 0, 2, 1)
item.attach(scale, 0, 1, 1, 1)
item.attach(reset, 1, 1, 1, 1)
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
frame.add(item)
self.list[option] = {
"row": frame,
"scale": scale,
}
pos = sorted(self.list).index(option)
self.grid.attach(self.list[option]['row'], 0, pos, 1, 1)
self.grid.show_all()
def reset_value(self, widget, option):
for x in self.options:
if x["option"] == option:
self.update_option(option, x["value"])
self.set_opt_value(None, None, option)
def set_opt_value(self, widget, event, opt):
value = self.list[opt]['scale'].get_value()
if opt == "retract_speed":
self._screen._ws.klippy.gcode_script("SET_RETRACTION RETRACT_SPEED=%s" % value)
elif opt == "retract_length":
self._screen._ws.klippy.gcode_script("SET_RETRACTION RETRACT_LENGTH=%s" % value)
elif opt == "unretract_extra_length":
self._screen._ws.klippy.gcode_script("SET_RETRACTION UNRETRACT_EXTRA_LENGTH=%s" % value)
elif opt == "unretract_speed":
self._screen._ws.klippy.gcode_script("SET_RETRACTION UNRETRACT_SPEED=%s" % value)
+18 -119
View File
@@ -6,55 +6,36 @@ from gi.repository import Gdk, Gtk, Pango
from ks_includes.screen_panel import ScreenPanel
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.menu = ['settings_menu']
self.labels['main_box'] = self.create_box('main')
self.labels['macros_box'] = self.create_box('macros')
printbox = Gtk.Box(spacing=0)
printbox.set_vexpand(False)
self.labels['add_printer_button'] = self._gtk.Button(_("Add Printer"), "color1")
self.labels['printers_box'] = self.create_box('printers', printbox)
options = self._config.get_configurable_options().copy()
options.append({"macros": {
"name": _("Displayed Macros"),
"type": "menu",
"menu": "macros"}
})
options.append({"printers": {
"name": _("Printer Connections"),
"type": "menu",
"menu": "printers"
}})
self.labels['settings_menu'] = self._gtk.ScrolledWindow()
self.labels['settings'] = Gtk.Grid()
self.labels['settings_menu'].add(self.labels['settings'])
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:]
# Support for hiding macros by name
if macro.startswith("_"):
continue
self.macros[macro] = {
"name": macro,
"section": "displayed_macros %s" % self._screen.connected_printer,
"type": "macro"
}
for macro in list(self.macros):
self.add_option('macros', self.macros, macro, self.macros[macro])
self.add_option('settings', self.settings, name, option[name])
self.labels['printers_menu'] = self._gtk.ScrolledWindow()
self.labels['printers'] = Gtk.Grid()
self.labels['printers_menu'].add(self.labels['printers'])
self.printers = {}
for printer in self._config.get_printers():
logging.debug("Printer: %s" % printer)
@@ -68,7 +49,7 @@ class SettingsPanel(ScreenPanel):
}
self.add_option("printers", self.printers, pname, self.printers[pname])
self.content.add(self.labels['main_box'])
self.content.add(self.labels['settings_menu'])
def activate(self):
while len(self.menu) > 1:
@@ -80,26 +61,6 @@ class SettingsPanel(ScreenPanel):
return True
return False
def create_box(self, name, insert=None):
# Create a scroll window for the macros
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
# 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)
if insert is not None:
box.pack_start(insert, False, False, 0)
box.pack_start(scroll, True, True, 0)
return box
def add_option(self, boxname, opt_array, opt_name, option):
if option['type'] is None:
return
@@ -125,20 +86,17 @@ class SettingsPanel(ScreenPanel):
dev.set_valign(Gtk.Align.CENTER)
dev.add(labels)
if option['type'] == "binary" or option['type'] == "macro":
if option['type'] == "binary":
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.set_active(self._config.get_config().getboolean(option['section'], opt_name))
switch.connect("notify::active", self.switch_config_option, option['section'], opt_name,
option['callback'] if "callback" in option else None)
switch.set_property("width-request", round(self._gtk.get_font_size()*7))
switch.set_property("height-request", round(self._gtk.get_font_size()*3.5))
switch.set_property("width-request", round(self._gtk.get_font_size() * 7))
switch.set_property("height-request", round(self._gtk.get_font_size() * 3.5))
box.add(switch)
dev.add(box)
elif option['type'] == "dropdown":
@@ -154,13 +112,14 @@ class SettingsPanel(ScreenPanel):
dropdown.set_entry_text_column(0)
dev.add(dropdown)
elif option['type'] == "scale":
dev.set_orientation(Gtk.Orientation.VERTICAL)
val = int(self._config.get_config().get(option['section'], opt_name, fallback=option['value']))
adj = Gtk.Adjustment(val, option['range'][0], option['range'][1], option['step'], option['step']*5)
adj = Gtk.Adjustment(val, option['range'][0], option['range'][1], option['step'], option['step'] * 5)
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj)
scale.set_hexpand(True)
scale.set_digits(0)
scale.connect("button-release-event", self.scale_moved, option['section'], opt_name)
scale.set_property("width-request", round(self._screen.width/2.2))
scale.set_property("width-request", round(self._screen.width / 2.2))
dev.add(scale)
elif option['type'] == "printer":
logging.debug("Option: %s" % option)
@@ -193,63 +152,3 @@ class SettingsPanel(ScreenPanel):
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):
logging.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]
logging.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 scale_moved(self, widget, event, section, option):
logging.debug("[%s] %s changed to %s" % (section, option, widget.get_value()))
if section not in self._config.get_config().sections():
self._config.get_config().add_section(section)
self._config.set(section, option, str(int(widget.get_value())))
self._config.save_user_config_options()
def switch_config_option(self, switch, gparam, section, option, callback=None):
logging.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()
if callback is not None:
callback(switch.get_active())
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)
+19 -4
View File
@@ -7,9 +7,11 @@ from gi.repository import Gdk, Gtk, Pango
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return SplashScreenPanel(*args)
class SplashScreenPanel(ScreenPanel):
box = None
@@ -22,7 +24,7 @@ class SplashScreenPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
image = self._gtk.Image("klipper.svg", None, 3.2, 3.2)
image = self._gtk.Image("klipper", 3.2)
self.labels['text'] = Gtk.Label(_("Initializing printer..."))
self.labels['text'].set_line_wrap(True)
@@ -129,9 +131,22 @@ class SplashScreenPanel(ScreenPanel):
def restart(self, widget):
self._screen._ws.klippy.restart()
def shutdown(self, widget):
os.system("sudo shutdown -P now")
_ = self.lang.gettext
if self._screen._ws.is_connected():
self._screen._confirm_send_action(widget,
_("Are you sure you wish to shutdown the system?"),
"machine.shutdown")
else:
logging.info("OS Shutdown")
os.system("systemctl poweroff")
def restart_system(self, widget):
os.system("sudo reboot now")
_ = self.lang.gettext
if self._screen._ws.is_connected():
self._screen._confirm_send_action(widget,
_("Are you sure you wish to reboot the system?"),
"machine.reboot")
else:
logging.info("OS Reboot")
os.system("systemctl reboot")
+5 -10
View File
@@ -8,12 +8,14 @@ from datetime import datetime
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return SystemPanel(*args)
ALLOWED_SERVICES = ["KlipperScreen", "MoonCord", "klipper", "moonraker"]
class SystemPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
@@ -37,12 +39,8 @@ class SystemPanel(ScreenPanel):
_("Are you sure you wish to shutdown the system?"), "machine.shutdown")
shutdown.set_vexpand(False)
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll = self._gtk.ScrolledWindow()
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
infogrid = Gtk.Grid()
infogrid.get_style_context().add_class("system-program-grid")
@@ -74,7 +72,6 @@ class SystemPanel(ScreenPanel):
logging.info("Updating program: %s " % prog)
self.update_program_info(prog)
infogrid.attach(self.labels[prog], 1, i, 1, 1)
self.labels[prog].get_style_context().add_class('updater-item')
i = i + 1
@@ -116,7 +113,6 @@ class SystemPanel(ScreenPanel):
if 'application' in data:
self.labels['update_progress'].set_text(self.labels['update_progress'].get_text().strip() + "\n" +
data['message'] + "\n")
self.labels['update_progress'].set_ellipsize(True)
self.labels['update_progress'].set_ellipsize(Pango.EllipsizeMode.END)
adjustment = self.labels['update_scroll'].get_vadjustment()
adjustment.set_value(adjustment.get_upper() - adjustment.get_page_size())
@@ -199,7 +195,7 @@ class SystemPanel(ScreenPanel):
grid.attach(label, 0, i, 1, 1)
i = i + 1
details = Gtk.Label(label=c['message']+"\n\n\n")
details = Gtk.Label(label=c['message'] + "\n\n\n")
details.set_line_wrap(True)
details.set_halign(Gtk.Align.START)
grid.attach(details, 0, i, 1, 1)
@@ -216,12 +212,11 @@ class SystemPanel(ScreenPanel):
label = Gtk.Label()
label.set_markup(" %s " % c)
label.set_halign(Gtk.Align.START)
label.set_ellipsize(True)
label.set_ellipsize(Pango.EllipsizeMode.END)
pos = (j % 3)
grid.attach(label, pos, i, 1, 1)
j = j + 1
if (pos == 2):
if pos == 2:
i = i + 1
elif "full" in info:
label.set_markup("<b>" + _("Perform a full upgrade?") + "</b>")
+47 -51
View File
@@ -8,9 +8,11 @@ from ks_includes.screen_panel import ScreenPanel
from ks_includes.widgets.graph import HeaterGraph
from ks_includes.widgets.keypad import Keypad
def create_panel(*args):
return TemperaturePanel(*args)
class TemperaturePanel(ScreenPanel):
graph_update = None
active_heater = None
@@ -54,8 +56,8 @@ class TemperaturePanel(ScreenPanel):
def create_right_panel(self):
_ = self.lang.gettext
cooldown = self._gtk.ButtonImage('cool-down', _('Cooldown'), "color4", 1, 1, Gtk.PositionType.LEFT, False)
adjust = self._gtk.ButtonImage('fine-tune', '', "color3", 1, 1, Gtk.PositionType.LEFT, False)
cooldown = self._gtk.ButtonImage('cool-down', _('Cooldown'), "color4", 1, Gtk.PositionType.LEFT, False)
adjust = self._gtk.ButtonImage('fine-tune', '', "color3", 1, Gtk.PositionType.LEFT, False)
right = self._gtk.HomogeneousGrid()
right.attach(cooldown, 0, 0, 2, 1)
@@ -83,16 +85,12 @@ class TemperaturePanel(ScreenPanel):
def preheat(self):
self.labels["preheat_grid"] = self._gtk.HomogeneousGrid()
for i, option in enumerate(self.preheat_options):
self.labels[option] = self._gtk.Button(option, "color%d" % ((i % 4)+1))
self.labels[option].connect("clicked", self.set_temperature, option)
self.labels['preheat_grid'].attach(self.labels[option], (i % 2), int(i/2), 1, 1)
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True)
scroll.set_vexpand(True)
if option != "cooldown":
self.labels[option] = self._gtk.Button(option, "color%d" % ((i % 4) + 1))
self.labels[option].connect("clicked", self.set_temperature, option)
self.labels['preheat_grid'].attach(self.labels[option], (i % 2), int(i / 2), 1, 1)
scroll = self._gtk.ScrolledWindow()
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
scroll.add(self.labels["preheat_grid"])
return scroll
@@ -115,7 +113,7 @@ class TemperaturePanel(ScreenPanel):
ctx = self.labels['deg' + i].get_style_context()
if j == 0:
ctx.add_class("distbutton_top")
elif j == len(self.tempdeltas)-1:
elif j == len(self.tempdeltas) - 1:
ctx.add_class("distbutton_bottom")
else:
ctx.add_class("distbutton")
@@ -226,36 +224,37 @@ class TemperaturePanel(ScreenPanel):
self._screen._ws.klippy.set_heater_temp(" ".join(heater.split(" ")[1:]), 0)
logging.info("Setting %s to %d" % (heater, 0))
self._printer.set_dev_stat(heater, "target", 0)
return
for heater in self.active_heaters:
MAX_TEMP = int(float(self._printer.get_config_section(heater)['max_temp']))
if heater.startswith('extruder'):
target = self.preheat_options[setting]["extruder"]
if target > 0 and target <= MAX_TEMP:
self._screen._ws.klippy.set_tool_temp(self._printer.get_tool_number(heater), target)
elif heater.startswith('heater_bed'):
target = self.preheat_options[setting]["bed"]
if target > 0 and target <= MAX_TEMP:
self._screen._ws.klippy.set_bed_temp(target)
elif heater.startswith('heater_generic '):
target = self.preheat_options[setting]["heater_generic"]
if target > 0 and target <= MAX_TEMP:
self._screen._ws.klippy.set_heater_temp(" ".join(heater.split(" ")[1:]), target)
elif heater.startswith('temperature_fan '):
target = self.preheat_options[setting]["temperature_fan"]
if target > 0 and target <= MAX_TEMP:
self._screen._ws.klippy.set_temp_fan_temp(" ".join(heater.split(" ")[1:]), target)
else:
logging.info("Unknown heater: %s" % heater)
self._screen.show_popup_message(_("Unknown Heater") + " " + heater)
if target <= MAX_TEMP:
if target > 0:
self._printer.set_dev_stat(heater, "target", int(target))
logging.info("Setting %s to %d" % (heater, target))
else:
self._screen.show_popup_message(_("Can't set above the maximum:") + (" %s" % MAX_TEMP))
if self.preheat_options[setting]['gcode']:
else:
for heater in self.active_heaters:
MAX_TEMP = int(float(self._printer.get_config_section(heater)['max_temp']))
if heater.startswith('extruder'):
target = self.preheat_options[setting]["extruder"]
if target is not None and target >= 0 and target <= MAX_TEMP:
self._screen._ws.klippy.set_tool_temp(self._printer.get_tool_number(heater), target)
elif heater.startswith('heater_bed'):
target = self.preheat_options[setting]["bed"]
if target is not None and target >= 0 and target <= MAX_TEMP:
self._screen._ws.klippy.set_bed_temp(target)
elif heater.startswith('heater_generic '):
target = self.preheat_options[setting]["heater_generic"]
if target is not None and target >= 0 and target <= MAX_TEMP:
self._screen._ws.klippy.set_heater_temp(" ".join(heater.split(" ")[1:]), target)
elif heater.startswith('temperature_fan '):
target = self.preheat_options[setting]["temperature_fan"]
if target is not None and target >= 0 and target <= MAX_TEMP:
self._screen._ws.klippy.set_temp_fan_temp(" ".join(heater.split(" ")[1:]), target)
else:
logging.info("Unknown heater: %s" % heater)
self._screen.show_popup_message(_("Unknown Heater") + " " + heater)
if target is None:
continue
if target <= MAX_TEMP:
if target >= 0:
self._printer.set_dev_stat(heater, "target", target)
logging.info("Setting %s to %d" % (heater, target))
else:
self._screen.show_popup_message(_("Can't set above the maximum:") + (" %s" % MAX_TEMP))
if setting in self.preheat_options and self.preheat_options[setting]['gcode']:
# This small delay is needed to properly update the target if the user configured something above
# and then changed the target again using the preheat gcode
GLib.timeout_add(250, self.preheat_gcode, setting)
@@ -297,12 +296,12 @@ class TemperaturePanel(ScreenPanel):
class_name = "graph_label_heater_bed"
type = "bed"
elif device.startswith("heater_generic"):
h = 1
self.h = 1
for d in self.devices:
if "heater_generic" in d:
h += 1
image = "heat-up"
class_name = "graph_label_sensor_%s" % h
self.h += 1
image = "heater"
class_name = "graph_label_sensor_%s" % self.h
type = "sensor"
elif device.startswith("temperature_fan"):
f = 1
@@ -317,7 +316,7 @@ class TemperaturePanel(ScreenPanel):
else:
s = 1
try:
s += h
s += self.h
except Exception:
pass
for d in self.devices:
@@ -336,12 +335,11 @@ class TemperaturePanel(ScreenPanel):
text = "<span underline='double' underline_color='#%s'>%s</span>" % (color, devname.capitalize())
name = self._gtk.ButtonImage(image, devname.capitalize().replace("_", " "),
None, .5, .5, Gtk.PositionType.LEFT, False)
None, .5, Gtk.PositionType.LEFT, False)
name.connect('clicked', self.on_popover_clicked, device)
name.set_alignment(0, .5)
name.get_style_context().add_class(class_name)
child = name.get_children()[0].get_children()[0].get_children()[1]
child.set_ellipsize(True)
child.set_ellipsize(Pango.EllipsizeMode.END)
temp = self._gtk.Button("")
@@ -433,7 +431,6 @@ class TemperaturePanel(ScreenPanel):
box.add(scroll)
box.add(self.labels['da'])
self.labels['graph_settemp'] = self._gtk.Button(label=_("Set Temp"))
self.labels['graph_settemp'].connect("clicked", self.show_numpad)
self.labels['graph_hide'] = self._gtk.Button(label=_("Hide"))
@@ -459,7 +456,6 @@ class TemperaturePanel(ScreenPanel):
self.labels['da'].set_size_request(0, graph_height)
return box
def graph_show_device(self, widget, show=True):
logging.info("Graph show: %s %s" % (self.popover_device, show))
self.labels['da'].set_showing(self.popover_device, show)
+57 -25
View File
@@ -8,9 +8,11 @@ from ks_includes.screen_panel import ScreenPanel
import logging
def create_panel(*args):
return ZCalibratePanel(*args)
class ZCalibratePanel(ScreenPanel):
_screen = None
widgets = {}
@@ -22,15 +24,27 @@ class ZCalibratePanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
grid = Gtk.Grid()
pos_label = Gtk.Label(_("Z Position") + ": \n")
self.widgets['zposition'] = Gtk.Label("?")
pos = Gtk.VBox()
pos.set_vexpand(False)
pos.set_valign(Gtk.Align.CENTER)
pos.add(pos_label)
pos.add(self.widgets['zposition'])
if self._printer.config_section_exists("probe"):
self.z_offset = self._screen.printer.get_config_section("probe")['z_offset']
elif self._printer.config_section_exists("bltouch"):
self.z_offset = self._screen.printer.get_config_section("bltouch")['z_offset']
elif self._printer.config_section_exists("smart_effector"):
self.z_offset = self._screen.printer.get_config_section("smart_effector")['z_offset']
else:
self.z_offset = None
self.widgets['zposition'] = Gtk.Label("Z: ?")
pos = self._gtk.HomogeneousGrid()
pos.attach(self.widgets['zposition'], 0, 1, 2, 1)
if self.z_offset is not None:
self.widgets['zoffset'] = Gtk.Label("?")
pos.attach(Gtk.Label(_("Probe Offset") + ": "), 0, 2, 2, 1)
pos.attach(Gtk.Label(_("Saved")), 0, 3, 1, 1)
pos.attach(Gtk.Label(_("New")), 1, 3, 1, 1)
pos.attach(Gtk.Label(str(round(float(self.z_offset), 2))), 0, 4, 1, 1)
pos.attach(self.widgets['zoffset'], 1, 4, 1, 1)
self.widgets['zpos'] = self._gtk.ButtonImage('z-farther', _("Raise Nozzle"), 'color4')
self.widgets['zpos'].connect("clicked", self.move, "+")
@@ -42,16 +56,18 @@ class ZCalibratePanel(ScreenPanel):
self.widgets['cancel'] = self._gtk.ButtonImage('cancel', _('Abort'), 'color2')
self.widgets['cancel'].connect("clicked", self.abort)
functions = ["endstop", "probe", "mesh", "delta"]
functions = ["endstop", "probe", "mesh", "delta", "delta_manual"]
pobox = Gtk.VBox()
if not self._screen.printer.get_config_section("stepper_z")['endstop_pin'].startswith("probe"):
endstop = (self._printer.config_section_exists("stepper_z") and
not self._screen.printer.get_config_section("stepper_z")['endstop_pin'].startswith("probe"))
if endstop:
endstop = self._gtk.Button(label="Endstop")
endstop.connect("clicked", self.start_calibration, "endstop")
pobox.pack_start(endstop, True, True, 5)
else:
functions.remove("endstop")
if (self._printer.config_section_exists("probe") or self._printer.config_section_exists("bltouch")):
if self._printer.config_section_exists("probe") or self._printer.config_section_exists("bltouch"):
probe = self._gtk.Button(label="Probe")
probe.connect("clicked", self.start_calibration, "probe")
pobox.pack_start(probe, True, True, 5)
@@ -67,11 +83,19 @@ class ZCalibratePanel(ScreenPanel):
functions.remove("mesh")
if "delta" in self._screen.printer.get_config_section("printer")['kinematics']:
delta = self._gtk.Button(label="Delta")
delta.connect("clicked", self.start_calibration, "delta")
pobox.pack_start(delta, True, True, 5)
if self._printer.config_section_exists("probe") or self._printer.config_section_exists("bltouch"):
delta = self._gtk.Button(label="Delta Automatic")
delta.connect("clicked", self.start_calibration, "delta")
pobox.pack_start(delta, True, True, 5)
else:
functions.remove("delta")
delta_manual = self._gtk.Button(label="Delta Manual")
delta_manual.connect("clicked", self.start_calibration, "delta_manual")
pobox.pack_start(delta_manual, True, True, 5)
else:
functions.remove("delta")
functions.remove("delta_manual")
logging.info("Available functions: %s" % functions)
self.labels['popover'] = Gtk.Popover()
@@ -90,9 +114,9 @@ class ZCalibratePanel(ScreenPanel):
self.widgets[i].set_direction(Gtk.TextDirection.LTR)
self.widgets[i].connect("clicked", self.change_distance, i)
ctx = self.widgets[i].get_style_context()
if (self._screen.lang_ltr and j == 0) or (not self._screen.lang_ltr and j == len(self.distances)-1):
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):
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")
@@ -108,6 +132,7 @@ class ZCalibratePanel(ScreenPanel):
distances.pack_start(self.widgets['move_dist'], True, True, 0)
distances.pack_start(distgrid, True, True, 0)
grid = Gtk.Grid()
grid.set_column_homogeneous(True)
if self._screen.vertical_mode:
grid.attach(self.widgets['zpos'], 0, 1, 1, 1)
@@ -135,6 +160,7 @@ class ZCalibratePanel(ScreenPanel):
self.labels['popover'].show_all()
def start_calibration(self, widget, method):
x_position = y_position = 0
self.labels['popover'].popdown()
if self._screen.printer.get_stat("toolhead", "homed_axes") != "xyz":
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
@@ -160,8 +186,8 @@ class ZCalibratePanel(ScreenPanel):
self._screen._ws.klippy.gcode_script('G0 X%d Y%d F3000' % (0, 0))
else:
logging.debug("Position not configured, probing the middle of the bed")
x_position = int(int(self._screen.printer.get_config_section("stepper_x")['position_max'])/2)
y_position = int(int(self._screen.printer.get_config_section("stepper_y")['position_max'])/2)
x_position = int(int(self._screen.printer.get_config_section("stepper_x")['position_max']) / 2)
y_position = int(int(self._screen.printer.get_config_section("stepper_y")['position_max']) / 2)
# Find probe offset
klipper_cfg = self._screen.printer.get_config_section_list()
@@ -190,6 +216,8 @@ class ZCalibratePanel(ScreenPanel):
self._screen._ws.klippy.gcode_script("BED_MESH_CALIBRATE")
elif method == "delta":
self._screen._ws.klippy.gcode_script("DELTA_CALIBRATE")
elif method == "delta_manual":
self._screen._ws.klippy.gcode_script("DELTA_CALIBRATE METHOD=manual")
elif method == "endstop":
self._screen._ws.klippy.gcode_script(KlippyGcodes.Z_ENDSTOP_CALIBRATE)
@@ -201,27 +229,31 @@ class ZCalibratePanel(ScreenPanel):
if action == "notify_status_update":
if self._screen.printer.get_stat("toolhead", "homed_axes") != "xyz":
self.widgets['zposition'].set_text("?")
self.widgets['zposition'].set_text("Z: ?")
elif "toolhead" in data and "position" in data['toolhead']:
self.updatePosition(data['toolhead']['position'])
elif action == "notify_gcode_response":
if "unknown" in data.lower():
data = data.lower()
logging.info(data)
if "unknown" in data:
self.buttons_not_calibrating()
elif "save_config" in data.lower():
elif "save_config" in data:
self.buttons_not_calibrating()
self._screen.show_popup_message(_("Calibrated, save configuration to make it permanent"), level=1)
elif "out of range" in data.lower():
elif "out of range" in data:
self._screen.show_popup_message("%s" % data)
self.buttons_not_calibrating()
elif "fail" in data.lower() and "use testz" in data.lower():
elif "fail" in data and "use testz" in data:
self._screen.show_popup_message(_("Failed, adjust position first"))
self.buttons_not_calibrating()
elif "use testz" in data.lower() or "use abort" in data.lower() or "z position" in data.lower():
elif "use testz" in data or "use abort" in data or "z position" in data:
self.buttons_calibrating()
return
def updatePosition(self, position):
self.widgets['zposition'].set_text(str(round(position[2], 2)))
self.widgets['zposition'].set_text("Z: " + str(round(position[2], 2)))
if self.z_offset is not None:
self.widgets['zoffset'].set_text(str(round(position[2] + float(self.z_offset), 2)))
def change_distance(self, widget, distance):
if self.distance == distance:
+34 -27
View File
@@ -45,11 +45,13 @@ PRINTER_BASE_STATUS_OBJECTS = [
'print_stats',
'toolhead',
'virtual_sdcard',
'webhooks'
'webhooks',
'motion_report'
]
klipperscreendir = pathlib.Path(__file__).parent.resolve()
class KlipperScreen(Gtk.Window):
""" Class for creating a screen for Klipper via HDMI """
_cur_panels = []
@@ -250,14 +252,16 @@ class KlipperScreen(Gtk.Window):
"configfile": ["config"],
"display_status": ["progress", "message"],
"fan": ["speed"],
"gcode_move": ["extrude_factor", "gcode_position", "homing_origin", "speed_factor"],
"gcode_move": ["extrude_factor", "gcode_position", "homing_origin", "speed_factor", "speed"],
"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",
"max_accel", "max_accel_to_decel", "max_velocity", "square_corner_velocity"],
"virtual_sdcard": ["file_position", "is_active", "progress"],
"webhooks": ["state", "state_message"]
"webhooks": ["state", "state_message"],
"firmware_retraction": ["retract_length", "retract_speed", "unretract_extra_length", "unretract_speed"],
"motion_report": ["live_position", "live_velocity", "live_extruder_velocity"]
}
}
for extruder in self.printer.get_tools():
@@ -266,6 +270,8 @@ class KlipperScreen(Gtk.Window):
requested_updates['objects'][h] = ["target", "temperature"]
for f in self.printer.get_fans():
requested_updates['objects'][f] = ["speed"]
for f in self.printer.get_filament_sensors():
requested_updates['objects'][f] = ["enabled", "filament_detected"]
self._ws.klippy.object_subscription(requested_updates)
@@ -435,19 +441,22 @@ class KlipperScreen(Gtk.Window):
widget.destroy()
def init_style(self):
style_provider = Gtk.CssProvider()
css = open(os.path.join(klipperscreendir, "styles", "base.css"))
css_base_data = css.read()
css_data = css.read()
css.close()
css = open(os.path.join(klipperscreendir, "styles", self.theme, "style.css"))
css_data = css_base_data + css.read()
css.close()
f = open(os.path.join(klipperscreendir, "styles", "base.conf"))
style_options = json.load(f)
f.close()
theme_style_conf = os.path.join(klipperscreendir, "styles", self.theme, "style.conf")
# Load custom theme
theme = os.path.join(klipperscreendir, "styles", self.theme)
theme_style = os.path.join(theme, "style.css")
theme_style_conf = os.path.join(theme, "style.conf")
if os.path.exists(theme_style):
css = open(theme_style)
css_data += css.read()
css.close()
if os.path.exists(theme_style_conf):
try:
f = open(theme_style_conf)
@@ -466,17 +475,17 @@ class KlipperScreen(Gtk.Window):
)
for i in range(len(style_options['graph_colors']['bed']['colors'])):
css_data += "\n.graph_label_heater_bed%s {border-left-color: #%s}" % (
"" if i+1 == 1 else i+1,
"" if i + 1 == 1 else i + 1,
style_options['graph_colors']['bed']['colors'][i]
)
for i in range(len(style_options['graph_colors']['fan']['colors'])):
css_data += "\n.graph_label_fan_%s {border-left-color: #%s}" % (
i+1,
i + 1,
style_options['graph_colors']['fan']['colors'][i]
)
for i in range(len(style_options['graph_colors']['sensor']['colors'])):
css_data += "\n.graph_label_sensor_%s {border-left-color: #%s}" % (
i+1,
i + 1,
style_options['graph_colors']['sensor']['colors'][i]
)
@@ -768,7 +777,7 @@ class KlipperScreen(Gtk.Window):
if prev_state not in ['paused', 'printing']:
self.init_printer()
self.base_panel._printer = self.printer
self.base_panel.show_heaters()
self.base_panel.show_heaters(True)
self.printer_ready()
@@ -880,10 +889,10 @@ class KlipperScreen(Gtk.Window):
self._ws.send_method(method, params)
def printer_initializing(self, text=None, disconnect=False):
self.shutdown = True
self.close_popup_message()
self.show_panel('splash_screen', "splash_screen", "Splash Screen", 2)
if disconnect is True and self.printer is not None:
self.shutdown = True
self.printer.state = "disconnected"
if text is not None:
self.panels['splash_screen'].update_text(text)
@@ -934,7 +943,7 @@ class KlipperScreen(Gtk.Window):
if state['result']['klippy_connected'] is False:
self.panels['splash_screen'].update_text(
_("Moonraker: connected") +
("\n\nKlipper: %s\n\n") % state['result']['klippy_state'] +
"\n\nKlipper: %s\n\n" % state['result']['klippy_state'] +
_("Retry #%s") % self.reinit_count)
return False
@@ -963,16 +972,14 @@ class KlipperScreen(Gtk.Window):
self.printer.reinit(printer_info['result'], config['result']['status'])
self.ws_subscribe()
extra_items = []
for extruder in self.printer.get_tools():
extra_items.append(extruder)
for h in self.printer.get_heaters():
extra_items.append(h)
for f in self.printer.get_fans():
extra_items.append(f)
extra_items = (self.printer.get_tools()
+ self.printer.get_heaters()
+ self.printer.get_fans()
+ self.printer.get_filament_sensors()
)
data = self.apiclient.send_request("printer/objects/query?" + "&".join(PRINTER_BASE_STATUS_OBJECTS +
extra_items))
extra_items))
if data is False:
msg = "Error getting printer object data with extra items"
logging.info(msg)
@@ -995,7 +1002,7 @@ class KlipperScreen(Gtk.Window):
def printer_ready(self):
_ = self.lang.gettext
self.close_popup_message()
# Force update to printer webhooks state in case the update is missed due to websocket subscribe not yet sent
# Force an 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", _("Home"), 2,
items=self._config.get_menu_items("__main"), extrudercount=self.printer.get_extruder_count())
@@ -1007,6 +1014,7 @@ class KlipperScreen(Gtk.Window):
def printer_printing(self):
self.close_popup_message()
self.show_panel('job_status', "job_status", "Print Status", 2)
self.base_panel.show_heaters(True)
def show_keyboard(self, widget=None):
if self.keyboard is not None:
@@ -1065,8 +1073,8 @@ class KlipperScreen(Gtk.Window):
os.system("xsetroot -cursor ks_includes/emptyCursor.xbm ks_includes/emptyCursor.xbm")
return
def main():
def main():
version = functions.get_software_version()
parser = argparse.ArgumentParser(description="KlipperScreen - A GUI for Klipper")
parser.add_argument(
@@ -1088,7 +1096,6 @@ def main():
logging.info("KlipperScreen version: %s" % version)
win = KlipperScreen(args, version)
win.connect("destroy", Gtk.main_quit)
win.show_all()
+53 -8
View File
@@ -4,10 +4,13 @@ SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
KSPATH=$(sed 's/\/scripts//g' <<< $SCRIPTPATH)
KSENV="${HOME}/.KlipperScreen-env"
PKGLIST="xserver-xorg-video-fbturbo xdotool xinit xinput x11-xserver-utils libopenjp2-7 python3-distutils"
PKGLIST="${PKGLIST} python3-virtualenv virtualenv matchbox-keyboard wireless-tools"
PKGLIST="${PKGLIST} libatlas-base-dev fonts-freefont-ttf"
PKGLIST="${PKGLIST} libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0"
XSERVER="xinit xinput x11-xserver-utils xdotool"
FBTURBO="xserver-xorg-video-fbturbo"
FBDEV="xserver-xorg-video-fbdev"
PYTHON="python3-virtualenv virtualenv python3-distutils"
PYGOBJECT="libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0"
MISC="libopenjp2-7 libatlas-base-dev fonts-freefont-ttf matchbox-keyboard wireless-tools"
OPTIONAL="xserver-xorg-legacy fonts-nanum"
Red='\033[0;31m'
Green='\033[0;32m'
@@ -49,7 +52,49 @@ install_packages()
fi
echo_text "Installing KlipperScreen dependencies"
sudo apt-get install -y $PKGLIST
sudo apt-get install -y $XSERVER
if [ $? -eq 0 ]; then
echo_ok "Installed X"
else
echo_error "Installation of X-server dependencies failed ($XSERVER)"
exit 1
fi
sudo apt-get install -y $OPTIONAL
sudo apt-get install -y $FBTURBO
if [ $? -eq 0 ]; then
echo_ok "Installed FBturbo driver"
else
echo $_
echo_error "Installation of $FBTURBO failed, trying $FBDEV"
sudo apt-get install -y $FBDEV
if [ $? -eq 0 ]; then
echo_ok "Installed FBdev"
else
echo_error "Installation of FBdev failed ($FBDEV)"
exit 1
fi
fi
sudo apt-get install -y $PYTHON
if [ $? -eq 0 ]; then
echo_ok "Installed Python dependincies"
else
echo_error "Installation of Python dependincies failed ($PYTHON)"
exit 1
fi
sudo apt-get install -y $PYGOBJECT
if [ $? -eq 0 ]; then
echo_ok "Installed PyGobject dependincies"
else
echo_error "Installation of PyGobject dependincies failed ($PYGOBJECT)"
exit 1
fi
sudo apt-get install -y $MISC
if [ $? -eq 0 ]; then
echo_ok "Installed Misc packages"
else
echo_error "Installation of Misc packages failed ($MISC)"
exit 1
fi
}
create_virtualenv()
@@ -65,12 +110,12 @@ create_virtualenv()
source ${KSENV}/bin/activate
while read requirements; do
pip install $requirements
pip --disable-pip-version-check install $requirements
if [ $? -gt 0 ]; then
echo "Error: pip install exited with status code $?"
echo "Unable to install dependencies, aborting install."
deactivate
exit
exit 1
fi
done < ${KSPATH}/scripts/KlipperScreen-requirements.txt
deactivate
@@ -125,7 +170,7 @@ start_KlipperScreen()
}
if [ "$EUID" == 0 ]
then echo_error "Plaease do not run this script as root"
exit
exit 1
fi
install_packages
create_virtualenv
+3 -3
View File
@@ -1,8 +1,8 @@
numpy==1.21.5
jinja2==3.1.1
numpy==1.21.4
jinja2==3.1.2
matplotlib==3.5.0
netifaces==0.11.0
requests==2.27.1
websocket-client==1.3.2
pycairo==1.21.0
PyGObject==3.42.0
PyGObject==3.42.1
+30 -11
View File
@@ -54,6 +54,10 @@ button.color4 {
min-height: 3em;
}
button.status {
background-color: #13181C;
}
button.active {
background-color: #20303D;
}
@@ -156,7 +160,7 @@ scrollbar, scrollbar button, scrollbar trough {
}
scrollbar slider {
min-width: 1.5em;
min-width: 2em;
border-radius: .7em;
background-color: #404E57;
}
@@ -171,7 +175,7 @@ textview .time {
}
trough {
margin: .5em 1em;
margin: .5em .5em;
}
.popup {
@@ -354,16 +358,16 @@ trough {
}
.printing-info {
font-size: 1.2em;
margin-left: .25em;
margin-right: .25em;
}
.printing-info button {
margin: .15em;
background-color: rgba(0, 0, 0, 0.1);
border-radius: .5em;
}
.printing-info-box {
padding-left: .25em;
}
.printing-info-box box {
margin-bottom: .25em;
.printing-info-secondary label {
margin-left: .75em;
}
.printing-status {
@@ -377,7 +381,7 @@ trough {
}
.printing-progress-text {
font-size: 1.5em;
font-size: 1.25em;
font-weight: bold;
color: white;
}
@@ -469,6 +473,21 @@ popover button {
background-color: rgba(0, 0, 0, 0.5);
}
.option_slider_max trough highlight, trough progress {
background-color: darkred;
}
.filament_sensor {
border-radius: 3em;
}
.filament_sensor_detected {
background-color: darkgreen;
}
.filament_sensor_empty {
background-color: darkred;
}
/* Hardcoded values until creation of dynamic CSS updates */
.graph_label_hidden {padding-left: .9em;} /* .4em on top of normal button padding */
.graph_label_extruder {border-left-width: .4em; border-left-style: solid;}
+160
View File
@@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
width="24"
height="24"
viewBox="0 0 24 24"
id="svg4"
sodipodi:docname="heater.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8">
<linearGradient
id="linearGradient11869">
<stop
style="stop-color:#dc322f;stop-opacity:1"
offset="0"
id="stop11861" />
<stop
style="stop-color:#cc4a17;stop-opacity:1"
offset="0.5"
id="stop11863" />
<stop
style="stop-color:#c65a11;stop-opacity:1"
offset="0.75"
id="stop11865" />
<stop
style="stop-color:#cc4f1a;stop-opacity:1"
offset="1"
id="stop11867" />
</linearGradient>
<linearGradient
id="linearGradient10815">
<stop
style="stop-color:#dc322f;stop-opacity:1"
offset="0"
id="stop10976" />
<stop
style="stop-color:#cb4b16;stop-opacity:0.49803922"
offset="0.5"
id="stop10978" />
<stop
style="stop-color:#b58900;stop-opacity:0.24705882"
offset="0.75"
id="stop10980" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop10982" />
</linearGradient>
<linearGradient
id="linearGradient10815-0">
<stop
style="stop-color:#dc322f;stop-opacity:1"
offset="0"
id="stop10807" />
<stop
style="stop-color:#cb4b16;stop-opacity:0.49803922"
offset="0.5"
id="stop10809" />
<stop
style="stop-color:#b58900;stop-opacity:0.24705882"
offset="0.75"
id="stop10811" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop10813" />
</linearGradient>
<linearGradient
xlink:href="#linearGradient955"
id="linearGradient858"
gradientUnits="userSpaceOnUse"
x1="51"
y1="40"
x2="50.862003"
y2="5.8426123"
gradientTransform="translate(-17.440011,-17.717467)" />
<linearGradient
id="linearGradient955">
<stop
style="stop-color:#dc322f;stop-opacity:1"
offset="0"
id="stop959" />
<stop
style="stop-color:#cb4b16;stop-opacity:0.49803922"
offset="0.5"
id="stop964" />
<stop
style="stop-color:#b58900;stop-opacity:0.24705882"
offset="0.75"
id="stop966" />
<stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="1"
id="stop961" />
</linearGradient>
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient11869"
id="linearGradient23766"
gradientUnits="userSpaceOnUse"
x1="22.234701"
y1="-2.0497832"
x2="22.32369"
y2="-24.29283" />
<linearGradient
inkscape:collect="always"
xlink:href="#linearGradient11869"
id="linearGradient52625"
gradientUnits="userSpaceOnUse"
x1="22.234701"
y1="-2.0497832"
x2="22.32369"
y2="-24.29283"
gradientTransform="translate(-29.396505,4.4638806)" />
</defs>
<sodipodi:namedview
id="namedview6"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="9.2807765"
inkscape:cx="20.095301"
inkscape:cy="18.101934"
inkscape:window-width="1600"
inkscape:window-height="826"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="g9896-8-2" />
<g
id="g9896-8-2"
transform="translate(-9.9548858,25.191409)"
style="fill:url(#linearGradient23766);fill-opacity:1">
<path
style="fill:#b58900;fill-opacity:1;stroke:none;stroke-width:1.13193px;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1"
d="m 15.69011,-17.263086 c -4.487409,11.9654156 -0.139808,15.1120916 7.544051,15.1730386 7.035044,-0.13069 7.514856,-6.2599622 6.248739,-8.1545626 -1.266117,-1.8946 -4.44543,-5.619714 -3.604206,-10.643828 -0.01115,-0.0836 -1.640743,1.661933 -2.319128,5.289429 -1.880183,-1.235083 -2.330164,-4.351196 -1.235747,-8.693878 -2.833889,2.722088 -5.343487,6.296638 -3.767371,13.238197 -1.870903,-1.776468 -2.466748,-3.103138 -2.866338,-6.208396 z"
id="path52470-7-3"
sodipodi:nodetypes="cczccccc" />
<path
id="path52470"
style="fill:#cb4b16;fill-opacity:1;stroke:none;stroke-width:1.13193px;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1"
d="M 12.369141 0.8984375 C 9.5352516 3.6205255 7.0254465 7.1951598 8.6015625 14.136719 C 6.7306595 12.360251 6.133965 11.032992 5.734375 7.9277344 C 2.1108644 17.589615 4.2511435 21.499524 9.2539062 22.679688 C 8.3996528 21.663235 6.8337462 19.278951 8.7070312 16.720703 C 8.8633072 17.793829 8.2338216 19.287219 10.416016 19.5 C 11.635509 19.274169 10.428073 16.860088 12.517578 12.847656 C 11.516847 15.884583 13.244872 16.381157 13.417969 20.189453 C 14.465654 20.282155 15.661704 17.944526 15.449219 16.148438 C 17.318957 19.101322 15.690304 21.066932 14.587891 22.998047 C 20.368873 22.177487 20.709817 16.716702 19.527344 14.947266 C 18.261227 13.052666 15.082604 9.3268484 15.923828 4.3027344 C 15.912678 4.2191344 14.283854 5.9643009 13.605469 9.5917969 C 11.725286 8.3567139 11.274724 5.2411195 12.369141 0.8984375 z "
transform="translate(9.9548858,-25.191409)" />
<path
style="fill:url(#linearGradient52625);fill-opacity:1;stroke:none;stroke-width:1.13193px;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1"
d="m -13.706523,-12.799147 c -4.487409,11.96541524 -0.139808,15.1120912 7.5440508,15.1730382 7.03504397,-0.13069 7.514856,-6.2599622 6.24873897,-8.1545626 -1.26611697,-1.8946 -4.44542997,-5.6197136 -3.60420597,-10.6438276 -0.01115,-0.0836 -1.640743,1.661933 -2.319128,5.289429 -1.880183,-1.235083 -2.330164,-4.351196 -1.235747,-8.693878 -2.833889,2.722088 -5.3434868,6.296638 -3.7673708,13.2381966 -1.870903,-1.776468 -2.466748,-3.103138 -2.866338,-6.2083956 z"
id="path52470-7"
sodipodi:nodetypes="cczccccc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.4 KiB

+38
View File
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
width="24"
height="24"
viewBox="0 0 24 24"
id="svg4"
sodipodi:docname="heater.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="26.25"
inkscape:cx="12.019048"
inkscape:cy="12"
inkscape:window-width="1600"
inkscape:window-height="826"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z"
id="path2"
style="fill:#e2e2e2;fill-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

+38
View File
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
version="1.1"
width="24"
height="24"
viewBox="0 0 24 24"
id="svg4"
sodipodi:docname="heater.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#505050"
bordercolor="#eeeeee"
borderopacity="1"
inkscape:pageshadow="0"
inkscape:pageopacity="0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="26.25"
inkscape:cx="12.019048"
inkscape:cy="12"
inkscape:window-width="1600"
inkscape:window-height="826"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z"
id="path2"
style="fill:#e2e2e2;fill-opacity:1" />
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z" /></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+84
View File
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="64"
height="64"
viewBox="0 0 64 64"
version="1.1"
id="svg10"
sodipodi:docname="heater.svg"
inkscape:version="1.1.2 (0a00cf5339, 2022-02-04, custom)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata
id="metadata16">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title>folder</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs14">
<linearGradient
id="linearGradient11869">
<stop
style="stop-color:#dc322f;stop-opacity:1"
offset="0"
id="stop11861" />
<stop
style="stop-color:#cc4a17;stop-opacity:1"
offset="0.5"
id="stop11863" />
<stop
style="stop-color:#c65a11;stop-opacity:1"
offset="0.75"
id="stop11865" />
<stop
style="stop-color:#cc4f1a;stop-opacity:1"
offset="1"
id="stop11867" />
</linearGradient>
</defs>
<sodipodi:namedview
pagecolor="#bfbfbf"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1600"
inkscape:window-height="826"
id="namedview12"
showgrid="false"
inkscape:pagecheckerboard="false"
inkscape:zoom="5.413793"
inkscape:cx="36.296179"
inkscape:cy="43.777071"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg10"
inkscape:snap-bbox="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:document-rotation="0" />
<!-- Generator: Sketch 52.5 (67469) - http://www.bohemiancoding.com/sketch -->
<title
id="title2">folder</title>
<desc
id="desc4">Created with Sketch.</desc>
<path
id="path52470"
style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;-inkscape-stroke:none;stop-color:#000000;stop-opacity:1"
d="M 32.951247,2.9998603 C 25.51376,10.143927 18.926825,19.525488 23.063308,37.743476 18.153162,33.08117 16.587148,29.597804 15.538431,21.448114 6.0285967,46.805535 11.645718,57.067011 24.775373,60.164331 22.533402,57.496671 18.423709,51.239164 23.34011,44.525092 c 0.410143,2.816398 -1.241928,6.735772 4.485198,7.294211 3.200536,-0.592689 0.03165,-6.928398 5.515509,-17.458948 -2.626399,7.970356 1.908769,9.273605 2.363059,19.268404 2.749629,0.24329 5.888639,-5.891767 5.330976,-10.605566 4.907091,7.749787 0.632723,12.908488 -2.260539,17.976668 15.172074,-2.15354 16.066874,-16.48527 12.963494,-21.12912 -3.322894,-4.972342 -11.665129,-14.750679 -9.457353,-27.936369 -0.02926,-0.219407 -4.30408,4.36075 -6.084488,13.881044 C 31.261462,22.573964 30.07897,14.397145 32.951247,2.9998603 Z" />
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB