Compare commits

...
136 Commits
Author SHA1 Message Date
Thomas Malkewitz 5d12addbba Xserver-XSDL cmd args to stop screen blanking (#794)
Added documentation to stop Xserver-XSDL from enabling its 5 minute default screen saver and blanking the screen.  In this scenario even after enabling the 'stay away' option in the debugging or developer options of the android device, the screen will still go black, but leave the back light on.  To stop this this, you must disable the Xserver screen saver option in the start up arguments of the server app itself.  I spend more than a few hours looking for and figuring this out, when this little bit of info would have saved me a lot of time.

Not sure if where I placed it is the best place in the doc, but the info is sound.  I am using my android over USB, FYI.
2022-11-18 13:38:55 -03:00
alfrix 92e899cf56 scripts: update naming and remove unused 2022-11-18 13:38:20 -03:00
mattlalumiere 6cb18816e2 Fixed Xclient scripts and added some examples (#717) 2022-11-18 13:31:41 -03:00
alfrix 6ca35ffab0 log: reduce max log size 2022-11-18 13:29:12 -03:00
alfrix 7ca37c56b6 websocket: refactor how the connection is handled 2022-11-18 12:56:05 -03:00
alfrix 675f28b318 Use GLib.idle_add instead of Gdk.threads_add_idle 2022-11-18 02:51:41 -03:00
alfrix cfa35ba8e4 screen: init_printer change how the timeout functions 2022-11-18 01:46:15 -03:00
alfrix 380df961e5 cleanup dead code 2022-11-18 01:17:57 -03:00
alfrix 8dc12bea2c screen: import traceback 2022-11-18 01:17:57 -03:00
alfrix 5215c8f985 menu: less logging 2022-11-18 01:17:57 -03:00
alfrix 45b172f85c files: reset 2022-11-18 01:17:57 -03:00
alfrix 2c30bdeddf printer: cleanup 2022-11-18 01:17:57 -03:00
alfrix 09f992d3b5 screen: cleanup unused vars 2022-11-18 01:17:57 -03:00
alfrix 128fee5e96 screen: cleanup panel subscriptions 2022-11-18 01:17:57 -03:00
alfrix 529b111fce screen: call close_screensaver on remove_all_panels 2022-11-18 00:53:53 -03:00
alfrix d55bc160ac docs: update config location 2022-11-18 00:53:53 -03:00
alfrix 7a71fa75f7 input_shaper: refactor process_update 2022-11-18 00:53:53 -03:00
alfrix 1db6388798 menu: use None 2022-11-18 00:53:53 -03:00
alfrix bdafb31522 menu: simplify enable 2022-11-18 00:53:53 -03:00
alfrix bd82d211f5 screen: raise more specific errors if panels cannot load 2022-11-18 00:53:53 -03:00
alfrix 45ab86204b panels: remove initialize from the panels that do not have a menu 2022-11-18 00:53:53 -03:00
alfrix 972a09df41 config: fix None appearing in config if the file doesn't exist close #777 2022-11-18 00:53:53 -03:00
alfrix 9b1b9593e8 ws: add 7130 as default for wss close #786 2022-11-18 00:53:53 -03:00
alfrix dd33ee04bb docs: android: show script directly with example close #791 2022-11-18 00:53:53 -03:00
alfrix 04f3c5b7a5 settings: cleanup printer list 2022-11-18 00:53:53 -03:00
alfrix 18d8f835a9 always reinit printer on state changes 2022-11-18 00:53:53 -03:00
alfrix b68cfa40fd refactor ws reconnect/retry 2022-11-18 00:53:53 -03:00
alfrix 86c52dece8 move connect_printer_widget to printer_select 2022-11-18 00:53:53 -03:00
alfrix 4272109a27 use screen printer_initializing method instead of direct calls 2022-11-18 00:53:53 -03:00
alfrix c5fe8b02a4 exclude: fix list width if no polygons are provided 2022-11-18 00:53:53 -03:00
alfrix fdf13102fe screen: remove shutdown variable and change on_close to disconnect 2022-11-18 00:53:53 -03:00
alfrix e1ea41f147 screen: refactor panel removal 2022-11-18 00:53:53 -03:00
alfrix 6b1fd23e35 screen: reduce the complexity of the status changes close #792 2022-11-18 00:53:53 -03:00
alfrix 9020d0b0ea screen: set_cursor new_for_display 2022-11-18 00:53:53 -03:00
alfrix 022954918c create ks_printer_cfg 2022-11-18 00:53:53 -03:00
alfrix e4ff009ef6 main_menu: init left_panel 2022-11-18 00:53:53 -03:00
alfrix f7cbff3ed8 heater_graph: better max value selection 2022-11-18 00:53:53 -03:00
alfrix f80c2687c5 screen: simplify panel subscription add-remove 2022-11-18 00:53:53 -03:00
alfrix 0bfbe90dcd screen: show_panel no need to differentiate if there are kwargs 2022-11-18 00:53:53 -03:00
alfrix 04e060c43c screen_panel: cleanup menu_item_clicked 2022-11-18 00:53:53 -03:00
alfrix 6083248dfa menu: simplify back and prevent a situation with no panels 2022-11-18 00:53:53 -03:00
alfrix df401d4924 main_menu: remove unused argument 2022-11-18 00:53:53 -03:00
alfrix 731a78b2f2 ws_cb: first check if there are panels 2022-11-18 00:53:53 -03:00
alfrix 1e6a9ec8ae log: cleanup logs for files, system and bed_mesh
functions: log if DPMS fails to load
screen: log send_action
2022-11-18 00:52:55 -03:00
alfrix 300eed4d29 translations: update 2022-11-12 11:23:01 -03:00
alfrix 7bef1d45c8 exclude: adjust vertical mode 2022-11-12 10:18:31 -03:00
alfrix 2aec78ff4c bed_mesh: adjust vertical mode 2022-11-12 10:11:09 -03:00
alfrix 4d0edf3c0b move: cleanup and move stuff out of screen_panel 2022-11-12 09:56:09 -03:00
alfrix a695c68a25 screen: simplify cursor changes 2022-11-12 09:30:43 -03:00
alfrix 6ca80baea8 job_status: remove glib timers that could cause issues 2022-11-12 09:25:37 -03:00
alfrix 260d4b16e5 --amend 2022-11-11 10:46:45 -03:00
alfrix 67dc2c9fdf --amend 2022-11-11 10:38:59 -03:00
alfrix 8b55d2f2b1 splash_screen: limit reconnections, clear log, add reconnect button 2022-11-11 10:25:55 -03:00
alfrix f05cbe9f0b job_status: fix layer info sometimes causing issues close #788 2022-11-10 23:10:44 -03:00
alfrix 3bbefd8bd5 lang: make set_text_direction a function 2022-11-10 07:15:04 -03:00
alfrix b8e819629a log: reduce spam 2022-11-10 07:15:04 -03:00
alfrix f5b8ae1002 screen: remove matplotlib from preload close #787 2022-11-10 07:12:29 -03:00
alfrix 78f76d659c menu: log a more descriptive item enable status 2022-11-09 10:37:30 -03:00
alfrix ce6158ad91 bed_mesh: improvements an changes:
use current profiles instead of the ones saved in the config file
remove matplotlib and numpy, caused many intall issues, graph was slow and not great for small screens
create a custom 2D graph to show the probed matrix
2022-11-09 10:25:52 -03:00
alfrix 0ca410acba zcalibrate: use sample_retract_dist if available close #748 2022-11-09 10:25:37 -03:00
alfrix 02c043eece zcalibrate: add dockable_probe #750 2022-11-09 08:51:59 -03:00
alfrix 88461910c9 job_status: remove numpy dependency 2022-11-08 17:33:38 -03:00
dependabot[bot] 19506292b5 build(deps): bump websocket-client from 1.4.1 to 1.4.2 (#781)
Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/websocket-client/websocket-client/releases)
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog)
- [Commits](https://github.com/websocket-client/websocket-client/compare/v1.4.1...v1.4.2)

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

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-08 17:33:09 -03:00
marcin-koziolandMarcin Kozioł 1dc3433e02 Set distance and speed variables after config is loaded (#782)
Co-authored-by: Marcin Kozioł <marcin.koziol@outi.pl>
2022-11-08 17:32:54 -03:00
alfrix ca7143f776 base_panel: estop set not sensitive instead of hiding 2022-11-06 13:21:52 -03:00
alfrix 26d10a949b job_status: use the new print_stats layer info 2022-11-06 13:04:07 -03:00
alfrix 8855d9b98f screensaver: change calls to close instead of wake 2022-11-05 00:25:11 -03:00
alfrix df195a0135 zcalibrate: use a tiny movement to detect state, need status 2022-11-04 19:27:08 -03:00
alfrix 23b64b1625 zcalibrate: use safe_z z_hop if defined close #748 2022-11-04 18:27:16 -03:00
alfrix 44623b44d1 menu: reduce logging 2022-11-04 18:13:06 -03:00
alfrix 6e4d0ff962 config: add lang list to init, reduce logging 2022-11-04 18:12:39 -03:00
alfrix 2fef5660cb base_panel: change how it shows controls and heaters to avoid issues 2022-11-04 10:30:14 -03:00
alfrix 3be65a686a docs: xserver-xorg-legacy is installed by default 2022-11-04 10:30:14 -03:00
alfrix 9c4f4c5fe7 config: try to save in printer_data first 2022-11-04 10:30:14 -03:00
alfrix ba392d75b9 docs: explain logfile location with images 2022-11-04 10:30:14 -03:00
jordanruthe 39b786c198 Update Hardware.md
Add BTT HDMI5/7
2022-11-04 08:27:07 -04:00
alfrix e36cf78e40 zcalirbrate: fix e225 2022-11-03 23:51:44 -03:00
alfrix 11dd95b939 functions: do not rotate logs at startup, it's useful to see old logs when users attach them 2022-11-03 23:44:17 -03:00
alfrix e0950247d2 zcalibrate: use safe_z_home if available 2022-11-03 23:40:30 -03:00
alfrix 8d1ca4eba1 fix E741 2022-11-03 23:29:11 -03:00
alfrix 6c66ccada7 job_status: remove menu button delay 2022-11-03 23:06:12 -03:00
alfrix 01fde5a1e9 keyboard: fix sometimes not changing language 2022-11-03 22:50:01 -03:00
alfrix 64745c8578 fix codestyle issues 2022-11-03 22:40:36 -03:00
Selim b77321ce28 Update Turkish Language (#771) 2022-11-03 22:35:02 -03:00
AntoszHUN f4a0b0f8b1 Update Hungarian Language (#774) 2022-11-03 22:33:54 -03:00
alfrix 7ee162092c fix #775 2022-11-03 22:20:03 -03:00
alfrix 2fc01c07b6 base_panel: allow to have no title 2022-11-03 22:07:45 -03:00
alfrix 73e4645df0 installer: add input drivers by default close #772 2022-11-02 11:13:16 -03:00
alfrix 5e4760771d screen: set to fullscreen unless overrided with size #773 2022-11-02 11:13:16 -03:00
alfrix 38d006c8a7 job_status and splash: fixup image size on ultrawide 2022-11-02 11:13:16 -03:00
alfrix 79c858ded6 functions: logging: use printer_data 2022-11-01 21:22:07 -03:00
alfrix 03e4681aa6 functions: logging changes, rotate based on filesize and on startup, print a warning in if log is not created 2022-11-01 15:36:52 -03:00
alfrix 5154e41fed windowed: add title and icon 2022-11-01 15:36:52 -03:00
alfrix 371968b458 base_panel: hide estop 2022-11-01 15:36:52 -03:00
alfrix c3128ef508 base_panel: always hide macro shortcut on splash_screen 2022-11-01 15:36:49 -03:00
alfrix 09ccd46528 keyboard: add spanish and german, change backscpace, clear and accept to icons 2022-11-01 07:36:07 -03:00
alfrix 874212e166 lang: fix widgets close #768 2022-10-28 13:22:47 -03:00
alfrix f749969c07 config: fix default en if system lang not found 2022-10-28 06:25:20 -03:00
alfrix f6e4e231b1 translation: update all translations 2022-10-27 23:42:23 -03:00
alfrix d536b054b8 translation: update hebrew (Tal Rahav) close #766 2022-10-27 23:40:59 -03:00
alfrix 5d539d0059 translation: update spanish 2022-10-27 23:36:30 -03:00
AntoszHUN 8a82590829 Update Hungarian Language (#762) 2022-10-27 23:19:21 -03:00
alfrix f588571bdd fix PEP E303 2022-10-27 23:18:21 -03:00
northcoastam d27227aede Update fine_tune.py (#765)
Fix for custom z_babystep_values from KlipperScreen.conf not respected
2022-10-27 23:15:45 -03:00
alfrix 7666a91872 splash_screen and job_status title translation 2022-10-27 22:47:01 -03:00
alfrix 51ddee28c3 printer_select: hide action_bar on startup and translate name 2022-10-27 21:24:23 -03:00
alfrix 0620d660f5 Change how the printer state is handled 2022-10-27 20:54:13 -03:00
alfrix b988c3c8c9 limits: fix sliders rescaling and not restoring values when set lower than the max configured value 2022-10-27 12:15:18 -03:00
alfrix d3d7104ec4 languages: refactor
- No full restart requirement just reload
- Fix some systems not loading the language
- Fix RTL not applied if the lang was not set by the system
2022-10-26 22:36:52 -03:00
alfrix 93457b2961 temperature: select all extruders while not printing and the active extruder if printing 2022-10-26 22:36:52 -03:00
alfrix b36e75ec1a temperature: fix #763 2022-10-26 22:36:52 -03:00
alfrix d6e4ad0a35 base_panel: fix macro shorcut not hiding at startup if configured to off 2022-10-26 22:36:52 -03:00
alfrix 0de49ee0cd base_panel: calculate the amount of titlebar items to be shown 2022-10-26 22:36:52 -03:00
alfrix 8cc86dfd7c config: add width and height for development purposes
Do not use this when KS is meant to be fullscreen, this should be used for window size on a desktop
2022-10-26 22:36:52 -03:00
alfrix da9051a9b2 base_panel: create get_icon for show_heaters 2022-10-26 22:36:52 -03:00
alfrix 32fab0482f gtk: add .png icons support close #733 2022-10-26 22:36:52 -03:00
alfrix 792e1bf8bf print: improve initialization performance with async. load of images 2022-10-26 22:36:52 -03:00
alfrix b346d765a2 base_panel: clock simplify also increase margin 2022-10-26 22:36:52 -03:00
alfrix c5413e51c9 config: add printer_data to default config search locations
close #759
2022-10-26 22:36:52 -03:00
alfrix 2121d4a6aa system: updater: hide the end button until the update completes
it's already not sensitive but that is not intuitive sometimes
2022-10-26 22:36:52 -03:00
alfrix 17e4bb704e exclude: fix vertical mode, fix last object cancel and make it exit 2022-10-26 22:36:52 -03:00
alfrix d3281379ee gtk: change scaling of images
This reduces the amount of magic numbers used, some images will scale to bigger sizes, most of the icons and images in vertical mode will be bigger, thumbnails should be bigger in both modes.
2022-10-26 22:36:52 -03:00
alfrix 62fd6b96f8 job_status: change filename max characters
now it's more consistent and takes into account font size
2022-10-26 22:36:52 -03:00
alfrix b9effb5447 screensaver: fix dialogs not hiding 2022-10-26 22:36:52 -03:00
alfrix 70b5532695 bed_mesh: fix issues and improve
Fix sometimes not showing the current mesh
Remove calibrate from the list, (use the top bar)
Minimum Zscale is now -1 to 1 mm
Colorscale is now -0.2 to 0.2 mm tends to clip less on the usable range
Code cleanup and de-duplication
2022-10-21 14:58:07 -03:00
alfrix 1332045128 installer: the workaround for pip 22 should not be needed by now 2022-10-15 18:56:05 -03:00
alfrix 1305b40c41 refactors and cleanup 2022-10-14 13:27:01 -03:00
alfrix e208873e46 temperature: merge nested ifs 2022-10-14 10:19:44 -03:00
alfrix 723662074e Change togglebuttons to regular buttons to simplify code 2022-10-14 10:19:44 -03:00
alfrix 4b7fda9ba0 zcalibrate: fix XY offset not applied if one of them is not defined 2022-10-14 10:19:44 -03:00
alfrix 2e026aef56 extrude: make the speed and distance configurable close #673 2022-10-14 10:19:44 -03:00
alfrix 28fe1bf6d8 Update Locales: Thanks Tal Rahav for the Hebrew translation 2022-10-14 10:19:44 -03:00
alfrix 4076e6349a limits and retraction: infinite sliders 2022-10-14 10:19:44 -03:00
alfrix d0d171e676 print: hide files and directories starting with . 2022-10-14 10:19:44 -03:00
alfrix 978bb72e20 Fix: Printer not connecting if [pause_resume] is missing
fix #752
2022-10-14 10:19:44 -03:00
Ben Konsemüller 74dee10d39 Fix: Heaters not showing their respective power percentages (#747) 2022-10-08 09:52:46 -03:00
88 changed files with 2075 additions and 2034 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
screen.py
+12 -3
View File
@@ -28,7 +28,7 @@ search "how to enable android debugging on device-model-and-brand"
```bash ```bash
cd ~/KlipperScreen/scripts cd ~/KlipperScreen/scripts
cp android-adb.sh launch_KlipperScreen.sh cp sample-android-adb.sh launch_KlipperScreen.sh
chmod +x launch_KlipperScreen.sh chmod +x launch_KlipperScreen.sh
``` ```
@@ -45,9 +45,9 @@ chmod +x launch_KlipperScreen.sh
nano launch_KlipperScreen.sh nano launch_KlipperScreen.sh
``` ```
* Paste this into the script (edit the IP for example: 192.168.1.2:0) * Paste this into the script (replace the example IP)
```bash ```bash
DISPLAY=(ip address from blue screen):0 $KS_XCLIENT DISPLAY=192.168.150.122:0 $KS_XCLIENT
``` ```
!!! important !!! important
@@ -73,6 +73,15 @@ sudo service KlipperScreen stop
sudo service KlipperScreen start sudo service KlipperScreen start
``` ```
## Stop Screen Blanking in Xserver-XSDL
Even after enabling the "Stay Awake" option in the Developer/USB Debugging options of your Android device, the Xserver-XSDL may still go to a black screen but keep the backlight of your device on. To keep the screen always active, upon start up of Xserver-XSDL app, select the `Change Device Configuration` at the top of the splash screen and then select the `Command line parameters, one argument per line` option. Append the following argument (must be on seperate lines):
```
-s
0
```
This will disable the screen-saver in Xserver and keep KlipperScreen always active.
## Migration from other tutorials ## Migration from other tutorials
KlipperScreen says error option "service" is not supported anymore. KlipperScreen says error option "service" is not supported anymore.
+7 -2
View File
@@ -1,7 +1,7 @@
# Configuration # Configuration
Usually you don't need to create a configuration file, but if you need to change something that is not changeable in the UI Usually you don't need to create a configuration file, but if you need to change something that is not changeable in the UI
create a blank file in `~/klipper_config/KlipperScreen.conf`, if the file already exist then just edit it. create a blank file in `~/printer_data/config/KlipperScreen.conf`, if the file already exist then just edit it.
Write in the file only the options that need to be changed, and restart KlipperScreen. Write in the file only the options that need to be changed, and restart KlipperScreen.
@@ -81,6 +81,10 @@ screw_positions: ""
# Rotation is useful if the screen is not directly in front of the machine. # Rotation is useful if the screen is not directly in front of the machine.
# Valid values are 0 90 180 270 # Valid values are 0 90 180 270
screw_rotation: 0 screw_rotation: 0
# Define distances and speeds for the extrude panel. CSV list 2 to 4 integers
extrude_distances: 5, 10, 15, 25
extrude_speeds: 1, 2, 5, 25
``` ```
## Preheat Options ## Preheat Options
@@ -188,7 +192,8 @@ KlipperScreen will search for a configuration file in the following order:
1. _~/KlipperScreen.conf_ 1. _~/KlipperScreen.conf_
2. _${KlipperScreen_Directory}/KlipperScreen.conf_ 2. _${KlipperScreen_Directory}/KlipperScreen.conf_
3. _~/klipper_config/KlipperScreen.conf_ 3. _~/printer_data/config/KlipperScreen.conf_
4. _~/klipper_config/KlipperScreen.conf_
If you need a custom location for the configuration file, you can add -c or --configfile to the systemd file and specify 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. the location of your configuration file.
+1
View File
@@ -5,6 +5,7 @@ There are no recommended screens, but the minimum supported resolution is 480x32
#### Hardware known to work #### Hardware known to work
* [BTT PI TFT50](https://www.biqu.equipment/collections/lcd/products/bigtreetech-pi-tft50-v1-0-tft-display-for-raspberry-pi-3d-printer-part) * [BTT PI TFT50](https://www.biqu.equipment/collections/lcd/products/bigtreetech-pi-tft50-v1-0-tft-display-for-raspberry-pi-3d-printer-part)
* [BTT HDMI5/7](https://biqu.equipment/products/bigtreetech-hdmi5-v1-0-hdmi7-v1-0)
* [Raspberry PI 7" Touchscreen](https://www.raspberrypi.org/products/raspberry-pi-touch-display/) * [Raspberry PI 7" Touchscreen](https://www.raspberrypi.org/products/raspberry-pi-touch-display/)
* [Hyperpixel 4](https://shop.pimoroni.com/products/hyperpixel-4) * [Hyperpixel 4](https://shop.pimoroni.com/products/hyperpixel-4)
* [3.5" Elegoo](https://www.elegoo.com/de/products/elegoo-3-5-inch-tft-lcd-screen) * [3.5" Elegoo](https://www.elegoo.com/de/products/elegoo-3-5-inch-tft-lcd-screen)
+14 -9
View File
@@ -5,12 +5,22 @@ This page will have common problems and common solutions to those problems.
The first step to troubleshooting any problem is getting the cause of the error. The first step to troubleshooting any problem is getting the cause of the error.
* Check for the file `/tmp/KlipperScreen.log` * Find KlipperScreen.log:
look at the contents by running `cat /tmp/KlipperScreen.log` or grab the file over WinSCP or another sftp program. !!! important
This is the most important file, and should be provided if you ask for support. This log file should be provided if you ask for support.
If that file is non-existent, run `journalctl -xe -u KlipperScreen` Depending on your setup the file could be accesible from the web interface alongside other logs
Mainsail | Fluidd
:-:|:-:
![m_logs](img/troubleshooting/logs_mainsail.png) | ![f_logs](img/troubleshooting/logs_fluidd.png)
if you can't find it in the web interface, use sftp to grab the log (for example Filezilla, WinSCP)
Located at `~/printer_data/logs`or in `/tmp/` if the former doesn't exists.
If KlipperScreen.log doesn't exist, run `systemctl status KlipperScreen`<br>
(or `journalctl -xe -u KlipperScreen`)
Check the file `/var/log/Xorg.0.log` where you can find issues with the X server. Check the file `/var/log/Xorg.0.log` where you can find issues with the X server.
@@ -33,11 +43,6 @@ usermod -a -G tty pi
``` ```
(if your username is not 'pi' change 'pi' to your username) (if your username is not 'pi' change 'pi' to your username)
You may also need:
```sh
sudo apt install xserver-xorg-legacy
```
Restart KlipperScreen: Restart KlipperScreen:
```sh ```sh
sudo service KlipperScreen restart sudo service KlipperScreen restart
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

+34 -57
View File
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import contextlib
import gi import gi
import logging import logging
import os import os
@@ -10,8 +11,6 @@ from gi.repository import Gdk, GdkPixbuf, Gio, Gtk, Pango
class KlippyGtk: class KlippyGtk:
labels = {} labels = {}
width_ratio = 16
height_ratio = 9.375
def __init__(self, screen, width, height, theme, cursor, fontsize_type): def __init__(self, screen, width, height, theme, cursor, fontsize_type):
self.screen = screen self.screen = screen
@@ -28,10 +27,10 @@ class KlippyGtk:
self.font_size = round(self.font_size * 0.91) 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.font_size = round(self.font_size * 1.09)
self.header_size = int(round((self.width / self.width_ratio) / 1.33))
self.titlebar_height = self.font_size * 2 self.titlebar_height = self.font_size * 2
self.img_width = int(round(self.width / self.width_ratio)) self.img_scale = self.font_size * 2.5
self.img_height = int(round(self.height / self.height_ratio)) self.img_width = self.font_size * 3
self.img_height = self.font_size * 3
if self.screen.vertical_mode: if self.screen.vertical_mode:
self.action_bar_width = int(self.width) self.action_bar_width = int(self.width)
self.action_bar_height = int(self.height * .1) self.action_bar_height = int(self.height * .1)
@@ -70,15 +69,6 @@ class KlippyGtk:
def get_titlebar_height(self): def get_titlebar_height(self):
return self.titlebar_height return self.titlebar_height
def get_header_size(self):
return self.header_size
def get_image_width(self):
return self.img_width
def get_image_height(self):
return self.img_height
def get_keyboard_height(self): def get_keyboard_height(self):
if (self.height / self.width) >= 3: if (self.height / self.width) >= 3:
# Ultra-tall # Ultra-tall
@@ -119,37 +109,32 @@ class KlippyGtk:
la.get_style_context().add_class(style) la.get_style_context().add_class(style)
return la return la
def Image(self, image_name, scale=1.0): def Image(self, image_name=None, width=None, height=None):
filename = os.path.join(self.themedir, f"{image_name}.svg") if image_name is None:
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(f"Unable to find image {filename}")
return Gtk.Image() return Gtk.Image()
width = width if width is not None else self.img_width
height = height if height is not None else self.img_height
filename = os.path.join(self.themedir, image_name)
for ext in ["svg", "png"]:
with contextlib.suppress(Exception):
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size(f"{filename}.{ext}", int(width), int(height))
if pixbuf is not None:
return Gtk.Image.new_from_pixbuf(pixbuf)
logging.error(f"Unable to find image {filename}.{ext}")
return Gtk.Image()
def PixbufFromFile(self, filename, width_scale=1, height_scale=1): @staticmethod
return GdkPixbuf.Pixbuf.new_from_file_at_scale( def PixbufFromFile(filename, width=-1, height=-1):
filename, return GdkPixbuf.Pixbuf.new_from_file_at_size(filename, int(width), int(height))
int(round(self.img_width * width_scale)),
int(round(self.img_height * height_scale)),
True
)
def PixbufFromHttp(self, resource, width_scale=1, height_scale=1): def PixbufFromHttp(self, resource, width=-1, height=-1):
response = self.screen.apiclient.get_thumbnail_stream(resource) response = self.screen.apiclient.get_thumbnail_stream(resource)
if response is False: if response is False:
return None return None
stream = Gio.MemoryInputStream.new_from_data(response, None) stream = Gio.MemoryInputStream.new_from_data(response, None)
return GdkPixbuf.Pixbuf.new_from_stream_at_scale( pixbuf = GdkPixbuf.Pixbuf.new_from_stream_at_scale(stream, int(width), int(height), True)
stream, stream.close_async(2)
int(round(self.img_width * width_scale)), return pixbuf
int(round(self.img_height * height_scale)),
True
)
def Button(self, label=None, style=None): def Button(self, label=None, style=None):
b = Gtk.Button(label=label) b = Gtk.Button(label=label)
@@ -171,7 +156,8 @@ class KlippyGtk:
b.set_vexpand(True) b.set_vexpand(True)
b.set_can_focus(False) b.set_can_focus(False)
if image_name is not None: if image_name is not None:
b.set_image(self.Image(image_name, scale)) width = height = self.img_scale * scale
b.set_image(self.Image(image_name, width, height))
b.set_image_position(position) b.set_image_position(position)
b.set_always_show_image(True) b.set_always_show_image(True)
@@ -212,6 +198,8 @@ class KlippyGtk:
button.get_child().set_line_wrap(True) 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", self.screen.reset_screensaver_timeout)
dialog.connect("response", self.remove_dialog, dialog)
dialog.connect("response", callback, *args) dialog.connect("response", callback, *args)
dialog.get_style_context().add_class("dialog") dialog.get_style_context().add_class("dialog")
@@ -225,29 +213,18 @@ class KlippyGtk:
dialog.show_all() dialog.show_all()
# Change cursor to blank # Change cursor to blank
if self.cursor: if self.cursor:
dialog.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.ARROW)) dialog.get_window().set_cursor(
Gdk.Cursor.new_for_display(Gdk.Display.get_default(), Gdk.CursorType.ARROW))
else: else:
dialog.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR)) dialog.get_window().set_cursor(
Gdk.Cursor.new_for_display(Gdk.Display.get_default(), Gdk.CursorType.BLANK_CURSOR))
self.screen.dialogs.append(dialog) self.screen.dialogs.append(dialog)
return dialog return dialog
def ToggleButtonImage(self, image_name, label, style=None, scale=1.38): def remove_dialog(self, widget, response_id, dialog):
logging.info("Removing Dialog")
b = Gtk.ToggleButton(label=label) self.screen.dialogs.remove(dialog)
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)
if style is not None:
ctx = b.get_style_context()
ctx.add_class(style)
b.connect("clicked", self.screen.reset_screensaver_timeout)
return b
@staticmethod @staticmethod
def HomogeneousGrid(width=None, height=None): def HomogeneousGrid(width=None, height=None):
+2 -4
View File
@@ -44,17 +44,15 @@ class KlippyRest:
try: try:
r = requests.get(url, headers=headers) r = requests.get(url, headers=headers)
except Exception as e: except Exception as e:
logging.critical(e, exc_info=True) logging.error(e)
return False return False
if r.status_code != 200: if r.status_code != 200:
return False return False
# TODO: Try/except
try: try:
data = json.loads(r.content) data = json.loads(r.content)
except Exception as e: except Exception as e:
logging.critical(e, exc_info=True) logging.error(f"Unable to parse response from moonraker:\n {r.content}")
logging.exception(f"Unable to parse response from moonraker:\n {r.content}")
return False return False
return data return data
+46 -76
View File
@@ -8,7 +8,7 @@ import websocket
import logging import logging
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import GLib, Gdk from gi.repository import GLib
from ks_includes.KlippyGcodes import KlippyGcodes from ks_includes.KlippyGcodes import KlippyGcodes
api_key = "" api_key = ""
@@ -30,9 +30,10 @@ api = {
class KlippyWebsocket(threading.Thread): class KlippyWebsocket(threading.Thread):
_req_id = 0 _req_id = 0
connected = False connected = False
connecting = True
callback_table = {} callback_table = {}
reconnect_timeout = None
reconnect_count = 0 reconnect_count = 0
max_retries = 4
def __init__(self, screen, callback, host, port): def __init__(self, screen, callback, host, port):
threading.Thread.__init__(self) threading.Thread.__init__(self)
@@ -53,36 +54,30 @@ class KlippyWebsocket(threading.Thread):
@property @property
def ws_proto(self): def ws_proto(self):
if int(self.port) == 443: if int(self.port) in {443, 7130}:
return "wss" return "wss"
return "ws" return "ws"
def retry(self):
self.reconnect_count = 0
self.connecting = True
self.initial_connect()
def initial_connect(self): def initial_connect(self):
# Enable a timeout so that way if moonraker is not running, it will attempt to reconnect # Enable a timeout so that way if moonraker is not running, it will attempt to reconnect
if self.reconnect_timeout is None:
self.reconnect_timeout = GLib.timeout_add_seconds(6, self.reconnect)
self.connect() self.connect()
if self.connecting:
GLib.timeout_add_seconds(6, self.reconnect)
def connect(self): def connect(self):
_ = self._screen.lang.gettext if self.connected:
return
def ws_on_close(ws, a=None, b=None): self.reconnect_count += 1
self.on_close(ws)
def ws_on_error(ws, msg):
self.on_error(ws, msg)
def ws_on_message(ws, msg):
self.on_message(ws, msg)
def ws_on_open(ws):
self.on_open(ws)
try: try:
state = self._screen.apiclient.get_server_info() state = self._screen.apiclient.get_server_info()
if state is False: if state is False:
if self.reconnect_count > 3: if self.reconnect_count > 2:
self._screen.panels['splash_screen'].update_text( self._screen.printer_initializing(
_("Cannot connect to Moonraker") _("Cannot connect to Moonraker")
+ f'\n\n{self._url}\n\n' + f'\n\n{self._url}\n\n'
+ _("Retrying") + f' #{self.reconnect_count}' + _("Retrying") + f' #{self.reconnect_count}'
@@ -96,8 +91,9 @@ class KlippyWebsocket(threading.Thread):
self.ws_url = f"{self.ws_proto}://{self._url}/websocket?token={token}" self.ws_url = f"{self.ws_proto}://{self._url}/websocket?token={token}"
self.ws = websocket.WebSocketApp( self.ws = websocket.WebSocketApp(
self.ws_url, on_close=ws_on_close, on_error=ws_on_error, on_message=ws_on_message, on_open=ws_on_open) self.ws_url,
on_close=self.on_close, on_error=self.on_error, on_message=self.on_message, on_open=self.on_open
)
self._wst = threading.Thread(target=self.ws.run_forever, daemon=True) self._wst = threading.Thread(target=self.ws.run_forever, daemon=True)
try: try:
logging.debug("Starting websocket thread") logging.debug("Starting websocket thread")
@@ -108,40 +104,32 @@ class KlippyWebsocket(threading.Thread):
def close(self): def close(self):
self.closing = True self.closing = True
self.connecting = False
if self.ws is not None: if self.ws is not None:
logging.debug("Closing websocket")
self.ws.close() self.ws.close()
def is_connected(self):
return self.connected
def on_message(self, ws, message): def on_message(self, ws, message):
response = json.loads(message) response = json.loads(message)
if "id" in response and response['id'] in self.callback_table: if "id" in response and response['id'] in self.callback_table:
Gdk.threads_add_idle( args = (response,
GLib.PRIORITY_HIGH_IDLE, self.callback_table[response['id']][1],
self.callback_table[response['id']][0], self.callback_table[response['id']][2],
response, *self.callback_table[response['id']][3])
self.callback_table[response['id']][1], GLib.idle_add(self.callback_table[response['id']][0], *args)
self.callback_table[response['id']][2],
*self.callback_table[response['id']][3]
)
self.callback_table.pop(response['id']) self.callback_table.pop(response['id'])
return return
if "method" in response and "on_message" in self._callback: if "method" in response and "on_message" in self._callback:
Gdk.threads_add_idle( args = response['method'], response['params'][0] if "params" in response else {}
GLib.PRIORITY_HIGH_IDLE, GLib.idle_add(self._callback['on_message'], *args)
self._callback['on_message'],
response['method'],
response['params'][0] if "params" in response else {}
)
return return
def send_method(self, method, params=None, callback=None, *args): def send_method(self, method, params=None, callback=None, *args):
if not self.connected:
return False
if params is None: if params is None:
params = {} params = {}
if self.is_connected() is False:
return False
self._req_id += 1 self._req_id += 1
if callback is not None: if callback is not None:
@@ -158,53 +146,35 @@ class KlippyWebsocket(threading.Thread):
def on_open(self, ws): def on_open(self, ws):
logging.info("Moonraker Websocket Open") logging.info("Moonraker Websocket Open")
logging.info(f"Self.connected = {self.is_connected()}")
self.connected = True self.connected = True
self.reconnect_count = 0 self.reconnect_count = 0
if self.reconnect_timeout is not None:
GLib.source_remove(self.reconnect_timeout)
self.reconnect_timeout = None
if "on_connect" in self._callback: if "on_connect" in self._callback:
Gdk.threads_add_idle( GLib.idle_add(self._callback['on_connect'])
GLib.PRIORITY_HIGH_IDLE,
self._callback['on_connect']
)
def on_close(self, ws): def on_close(self, ws, status, message):
if self.is_connected() is False: if message is not None:
logging.info(f"{status} {message}")
if not self.connected:
logging.debug("Connection already closed") logging.debug("Connection already closed")
if self.reconnect_timeout is not None:
GLib.source_remove(self.reconnect_timeout)
self.reconnect_timeout = None
return return
if self.closing is True: if "on_close" in self._callback:
logging.debug("Closing websocket") GLib.idle_add(self._callback['on_close'], "Lost Connection to Moonraker")
self.ws.keep_running = False
self.close()
self.closing = False
return
logging.info("Moonraker Websocket Closed") logging.info("Moonraker Websocket Closed")
self.connected = False self.connected = False
if self.reconnect_timeout is None:
self.reconnect_timeout = GLib.timeout_add_seconds(9, self.reconnect)
if "on_close" in self._callback:
Gdk.threads_add_idle(
GLib.PRIORITY_HIGH_IDLE,
self._callback['on_close'],
"Lost Connection to Moonraker",
True
)
def reconnect(self): def reconnect(self):
if self.is_connected(): if self.connected:
logging.debug("Reconnected") return False
if self.reconnect_count > self.max_retries:
logging.debug("Stopping reconnections")
self.connecting = False
self._screen.printer_initializing(
_("Cannot connect to Moonraker")
+ f'\n\n{self._url}')
return False return False
logging.debug("Attempting to reconnect") logging.debug("Attempting to reconnect")
self.reconnect_count += 1
self.connect() self.connect()
return True return True
@@ -259,7 +229,7 @@ class MoonrakerApi:
) )
def object_subscription(self, updates): def object_subscription(self, updates):
logging.debug(f"Sending printer.objects.subscribe: {updates}") logging.debug("Sending printer.objects.subscribe")
return self._ws.send_method( return self._ws.send_method(
"printer.objects.subscribe", "printer.objects.subscribe",
updates updates
+80 -49
View File
@@ -34,12 +34,15 @@ class KlipperScreenConfig:
do_not_edit_prefix = "#~#" do_not_edit_prefix = "#~#"
def __init__(self, configfile, screen=None): def __init__(self, configfile, screen=None):
self.lang_list = None
self.errors = [] self.errors = []
self.default_config_path = os.path.join(klipperscreendir, "ks_includes", "defaults.conf") self.default_config_path = os.path.join(klipperscreendir, "ks_includes", "defaults.conf")
self.config = configparser.ConfigParser() self.config = configparser.ConfigParser()
self.config_path = self.get_config_file_location(configfile) self.config_path = self.get_config_file_location(configfile)
logging.debug(f"Config path location: {self.config_path}") logging.debug(f"Config path location: {self.config_path}")
self.defined_config = None self.defined_config = None
self.lang = None
self.langs = {}
try: try:
self.config.read(self.default_config_path) self.config.read(self.default_config_path)
@@ -101,15 +104,34 @@ class KlipperScreenConfig:
item[name]['moonraker_api_key'] = "redacted" item[name]['moonraker_api_key'] = "redacted"
logging.debug(f"Configured printers: {json.dumps(conf_printers_debug, indent=2)}") logging.debug(f"Configured printers: {json.dumps(conf_printers_debug, indent=2)}")
lang = self.get_main_config().get("language", None) self.create_translations()
lang = [lang] if lang is not None and lang != "default" else None
logging.info(f"Detected language: {lang}")
self.lang = gettext.translation('KlipperScreen', localedir='ks_includes/locales', languages=lang,
fallback=True)
self.lang.install(names=['gettext', 'ngettext'])
self._create_configurable_options(screen) self._create_configurable_options(screen)
def create_translations(self):
lang_path = os.path.join(klipperscreendir, "ks_includes", "locales")
self.lang_list = [d for d in os.listdir(lang_path) if not os.path.isfile(os.path.join(lang_path, d))]
self.lang_list.sort()
for lng in self.lang_list:
self.langs[lng] = gettext.translation('KlipperScreen', localedir=lang_path, languages=[lng], fallback=True)
lang = self.get_main_config().get("language", None)
logging.debug(f"Selected lang: {lang} OS lang: {os.getenv('LANG')}")
self.install_language(lang)
def install_language(self, lang):
if lang is None or lang == "system_lang":
for language in self.lang_list:
if os.getenv('LANG').lower().startswith(language):
logging.debug("Using system lang")
lang = language
if lang not in self.lang_list:
logging.error(f"lang: {lang} not found")
logging.info(f"Available lang list {self.lang_list}")
lang = "en"
logging.info(f"Using lang {lang}")
self.lang = self.langs[lang]
self.lang.install(names=['gettext', 'ngettext'])
def validate_config(self): def validate_config(self):
valid = True valid = True
for section in self.config: for section in self.config:
@@ -129,15 +151,16 @@ class KlipperScreenConfig:
) )
numbers = ( numbers = (
'job_complete_timeout', 'job_error_timeout', 'move_speed_xy', 'move_speed_z', 'job_complete_timeout', 'job_error_timeout', 'move_speed_xy', 'move_speed_z',
'print_estimate_compensation' 'print_estimate_compensation', 'width', 'height',
) )
elif section.startswith('printer '): elif section.startswith('printer '):
bools = ( bools = (
'invert_x', 'invert_y', 'invert_z', 'invert_x', 'invert_y', 'invert_z',
) )
strs = ( strs = (
'moonraker_api_key', 'moonraker_host', 'language', 'titlebar_name_type', 'moonraker_api_key', 'moonraker_host', 'titlebar_name_type',
'screw_positions', 'power_devices', 'titlebar_items', 'z_babystep_values', 'screw_positions', 'power_devices', 'titlebar_items', 'z_babystep_values',
'extrude_distances', "extrude_speeds",
) )
numbers = ( numbers = (
'moonraker_port', 'move_speed_xy', 'move_speed_z', 'moonraker_port', 'move_speed_xy', 'move_speed_z',
@@ -191,7 +214,7 @@ class KlipperScreenConfig:
self.configurable_options = [ self.configurable_options = [
{"language": { {"language": {
"section": "main", "name": _("Language"), "type": "dropdown", "value": "system_lang", "section": "main", "name": _("Language"), "type": "dropdown", "value": "system_lang",
"callback": screen.restart_warning, "options": [ "callback": screen.change_language, "options": [
{"name": _("System") + " " + _("(default)"), "value": "system_lang"}]}}, {"name": _("System") + " " + _("(default)"), "value": "system_lang"}]}},
{"theme": { {"theme": {
"section": "main", "name": _("Icon Theme"), "type": "dropdown", "section": "main", "name": _("Icon Theme"), "type": "dropdown",
@@ -207,7 +230,7 @@ class KlipperScreenConfig:
{"screen_blanking": { {"screen_blanking": {
"section": "main", "name": _("Screen Power Off Time"), "type": "dropdown", "section": "main", "name": _("Screen Power Off Time"), "type": "dropdown",
"value": "3600", "callback": screen.set_screenblanking_timeout, "options": [ "value": "3600", "callback": screen.set_screenblanking_timeout, "options": [
{"name": _("Off"), "value": "off"}] {"name": _("Never"), "value": "off"}]
}}, }},
{"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary", "value": "True"}}, {"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary", "value": "True"}},
{"side_macro_shortcut": { {"side_macro_shortcut": {
@@ -247,12 +270,8 @@ class KlipperScreenConfig:
self.configurable_options.extend(panel_options) 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[0]['language']['options'] lang_opt = self.configurable_options[0]['language']['options']
for lang in self.lang_list:
for lang in langs:
lang_opt.append({"name": lang, "value": lang}) lang_opt.append({"name": lang, "value": lang})
t_path = os.path.join(klipperscreendir, 'styles') t_path = os.path.join(klipperscreendir, 'styles')
@@ -332,7 +351,7 @@ class KlipperScreenConfig:
saved_def = [] saved_def = []
found_saved = False found_saved = False
if not path.exists(config_path): if not path.exists(config_path):
return [None, None] return ["", None]
with open(config_path) as file: with open(config_path) as file:
for line in file: for line in file:
line = line.replace('\n', '') line = line.replace('\n', '')
@@ -347,21 +366,36 @@ class KlipperScreenConfig:
return ["\n".join(user_def), None if saved_def is None else "\n".join(saved_def)] return ["\n".join(user_def), None if saved_def is None else "\n".join(saved_def)]
def get_config_file_location(self, file): def get_config_file_location(self, file):
logging.info(f"Passed config file: {file}") # Passed config (-c) by default is ~/KlipperScreen.conf
if not path.exists(file): if path.exists(file):
file = os.path.join(klipperscreendir, self.configfile_name) return file
if not path.exists(file):
file = self.configfile_name.lower()
if not path.exists(file):
klipper_config = os.path.join(os.path.expanduser("~/"), "klipper_config")
file = os.path.join(klipper_config, self.configfile_name)
if not path.exists(file):
file = os.path.join(klipper_config, self.configfile_name.lower())
if not path.exists(file):
file = self.default_config_path
logging.info(f"Found configuration file at: {file}") file = os.path.join(klipperscreendir, self.configfile_name)
return file if path.exists(file):
return file
file = os.path.join(klipperscreendir, self.configfile_name.lower())
if path.exists(file):
return file
klipper_config = os.path.join(os.path.expanduser("~/"), "printer_data", "config")
file = os.path.join(klipper_config, self.configfile_name)
if path.exists(file):
return file
file = os.path.join(klipper_config, self.configfile_name.lower())
if path.exists(file):
return file
# OLD config folder
klipper_config = os.path.join(os.path.expanduser("~/"), "klipper_config")
file = os.path.join(klipper_config, self.configfile_name)
if path.exists(file):
return file
file = os.path.join(klipper_config, self.configfile_name.lower())
if path.exists(file):
return file
# fallback
return self.default_config_path
def get_config(self): def get_config(self):
return self.config return self.config
@@ -390,9 +424,7 @@ class KlipperScreenConfig:
def get_menu_name(self, menu="__main", subsection=""): def get_menu_name(self, menu="__main", subsection=""):
name = f"menu {menu} {subsection}" if subsection != "" else f"menu {menu}" name = f"menu {menu} {subsection}" if subsection != "" else f"menu {menu}"
if name not in self.config: return False if name not in self.config else self.config[name].get('name')
return False
return self.config[name].get('name')
def get_preheat_options(self): def get_preheat_options(self):
index = "preheat " index = "preheat "
@@ -409,12 +441,7 @@ class KlipperScreenConfig:
if not name.startswith("printer "): if not name.startswith("printer "):
name = f"printer {name}" name = f"printer {name}"
if name not in self.config: return None if name not in self.config else self.config[name]
return None
return self.config[name]
def get_printer_power_name(self):
return self.config['settings'].get("printer_power_name", "printer")
def get_printers(self): def get_printers(self):
return self.printers return self.printers
@@ -455,16 +482,20 @@ class KlipperScreenConfig:
else: else:
user_def, saved_def = self.separate_saved_config(self.config_path) user_def, saved_def = self.separate_saved_config(self.config_path)
extra_lb = "\n" if saved_def is not None else "" contents = (f"{user_def}\n"
contents = "%s\n%s%s\n%s\n%s\n%s\n" % ( f"{self.do_not_edit_line}\n"
user_def, self.do_not_edit_line, extra_lb, self.do_not_edit_prefix, "\n".join(save_output), f"{self.do_not_edit_prefix}\n"
self.do_not_edit_prefix) + '\n'.join(save_output) + f"\n"
f"{self.do_not_edit_prefix}\n")
if self.config_path != self.default_config_path: if self.config_path != self.default_config_path:
filepath = self.config_path filepath = self.config_path
else: else:
filepath = os.path.expanduser("~/") filepath = os.path.expanduser("~/")
klipper_config = os.path.join(filepath, "klipper_config") klipper_config = os.path.join(filepath, "klipper_config")
if os.path.exists(klipper_config):
filepath = os.path.join(klipper_config, "KlipperScreen.conf")
klipper_config = os.path.join(filepath, "printer_data", "config")
if os.path.exists(klipper_config): if os.path.exists(klipper_config):
filepath = os.path.join(klipper_config, "KlipperScreen.conf") filepath = os.path.join(klipper_config, "KlipperScreen.conf")
else: else:
@@ -505,11 +536,11 @@ class KlipperScreenConfig:
cfg = self.config[name] cfg = self.config[name]
item = { item = {
"name": cfg.get("name"), "name": cfg.get("name"),
"icon": cfg.get("icon"), "icon": cfg.get("icon", None),
"panel": cfg.get("panel", False), "panel": cfg.get("panel", None),
"method": cfg.get("method", False), "method": cfg.get("method", None),
"confirm": cfg.get("confirm", False), "confirm": cfg.get("confirm", None),
"enable": cfg.get("enable", True) "enable": cfg.get("enable", "True")
} }
try: try:
+11 -12
View File
@@ -16,7 +16,6 @@ class KlippyFiles:
self.gcodes_path = None self.gcodes_path = None
def initialize(self): def initialize(self):
self.gcodes_path = None
if "virtual_sdcard" in self._screen.printer.get_config_section_list(): if "virtual_sdcard" in self._screen.printer.get_config_section_list():
vsd = self._screen.printer.get_config_section("virtual_sdcard") vsd = self._screen.printer.get_config_section("virtual_sdcard")
if "path" in vsd: if "path" in vsd:
@@ -24,7 +23,11 @@ class KlippyFiles:
logging.info(f"Gcodes path: {self.gcodes_path}") logging.info(f"Gcodes path: {self.gcodes_path}")
def reset(self): def reset(self):
self.__init__(self._screen) self._screen = None
self.callbacks = None
self.files = None
self.filelist = None
self.gcodes_path = None
def _callback(self, result, method, params): def _callback(self, result, method, params):
if method == "server.files.list": if method == "server.files.list":
@@ -92,7 +95,8 @@ class KlippyFiles:
if filename in self.filelist: if filename in self.filelist:
logging.info(f"File already exists: {filename}") logging.info(f"File already exists: {filename}")
self.request_metadata(filename) self.request_metadata(filename)
GLib.timeout_add_seconds(1, self.run_callbacks, mods=[filename]) args = None, None, [filename]
GLib.idle_add(self.run_callbacks, *args)
return return
self.filelist.append(filename) self.filelist.append(filename)
@@ -135,10 +139,8 @@ class KlippyFiles:
return filename in self.filelist return filename in self.filelist
def file_metadata_exists(self, filename): def file_metadata_exists(self, filename):
if not self.file_exists(filename): if self.file_exists(filename):
return False return "slicer" in self.files[filename]
if "slicer" in self.files[filename]:
return True
return False return False
def get_thumbnail_location(self, filename, small=False): def get_thumbnail_location(self, filename, small=False):
@@ -174,10 +176,6 @@ class KlippyFiles:
if notify is True: if notify is True:
self.run_callbacks(deletedfiles=[filename]) self.run_callbacks(deletedfiles=[filename])
def ret_file_data(self, filename):
logging.info(f"Getting file info for {filename}")
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
def run_callbacks(self, newfiles=None, deletedfiles=None, mods=None): def run_callbacks(self, newfiles=None, deletedfiles=None, mods=None):
if mods is None: if mods is None:
mods = [] mods = []
@@ -188,7 +186,8 @@ class KlippyFiles:
if len(self.callbacks) <= 0: if len(self.callbacks) <= 0:
return False return False
for cb in self.callbacks: for cb in self.callbacks:
GLib.idle_add(cb, newfiles, deletedfiles, mods) args = newfiles, deletedfiles, mods
GLib.idle_add(cb, *args)
return False return False
def get_file_list(self): def get_file_list(self):
+18 -15
View File
@@ -47,8 +47,8 @@ try:
return state return state
dpms_loaded = True dpms_loaded = True
except Exception: except Exception as msg:
pass logging.error(f"Couldn't load DPMS: {msg}")
def get_network_interfaces(): def get_network_interfaces():
@@ -123,8 +123,8 @@ def patch_threading_excepthook():
threading.Thread.__init__ = new_init threading.Thread.__init__ = new_init
# Timed rotating file handler based on Klipper and Moonraker's implementation # Rotating file handler based on Klipper and Moonraker's implementation
class KlipperScreenLoggingHandler(logging.handlers.TimedRotatingFileHandler): class KlipperScreenLoggingHandler(logging.handlers.RotatingFileHandler):
def __init__(self, software_version, filename, **kwargs): def __init__(self, software_version, filename, **kwargs):
super(KlipperScreenLoggingHandler, self).__init__(filename, **kwargs) super(KlipperScreenLoggingHandler, self).__init__(filename, **kwargs)
self.rollover_info = { self.rollover_info = {
@@ -157,18 +157,21 @@ def setup_logging(log_file, software_version):
stdout_fmt = logging.Formatter( stdout_fmt = logging.Formatter(
'%(asctime)s [%(filename)s:%(funcName)s()] - %(message)s') '%(asctime)s [%(filename)s:%(funcName)s()] - %(message)s')
stdout_hdlr.setFormatter(stdout_fmt) stdout_hdlr.setFormatter(stdout_fmt)
fh = listener = None
fh = None try:
if log_file: fh = KlipperScreenLoggingHandler(software_version, log_file, maxBytes=4194304, backupCount=1)
fh = KlipperScreenLoggingHandler(software_version, log_file, when='midnight', backupCount=2) formatter = logging.Formatter('%(asctime)s [%(filename)s:%(funcName)s()] - %(message)s')
formatter = logging.Formatter(
'%(asctime)s [%(filename)s:%(funcName)s()] - %(message)s')
fh.setFormatter(formatter) fh.setFormatter(formatter)
listener = logging.handlers.QueueListener( listener = logging.handlers.QueueListener(queue, fh, stdout_hdlr)
queue, fh, stdout_hdlr) except Exception as e:
else: print(
listener = logging.handlers.QueueListener( f"Unable to create log file at '{os.path.normpath(log_file)}'.\n"
queue, stdout_hdlr) f"Make sure that the folder '{os.path.dirname(log_file)}' exists\n"
f"and KlipperScreen has Read/Write access to the folder.\n"
f"{e}\n"
)
if listener is None:
listener = logging.handlers.QueueListener(queue, stdout_hdlr)
listener.start() listener.start()
def logging_exception_handler(ex_type, value, tb, thread_identifier=None): def logging_exception_handler(ex_type, value, tb, thread_identifier=None):
+25 -19
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -63,6 +63,9 @@ msgstr ""
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "" msgstr ""
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "" msgstr ""
@@ -178,9 +181,6 @@ msgstr ""
msgid "Decrease" msgid "Decrease"
msgstr "" msgstr ""
msgid "Delete"
msgstr ""
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr ""
@@ -287,9 +287,6 @@ msgstr ""
msgid "Hide temp." msgid "Hide temp."
msgstr "" msgstr ""
msgid "Home"
msgstr ""
msgid "Home All" msgid "Home All"
msgstr "" msgstr ""
@@ -383,9 +380,6 @@ msgstr ""
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "" msgstr ""
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "" msgstr ""
@@ -422,6 +416,9 @@ msgstr ""
msgid "Menu" msgid "Menu"
msgstr "" msgstr ""
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "" msgstr ""
@@ -440,6 +437,9 @@ msgstr ""
msgid "Network" msgid "Network"
msgstr "" msgstr ""
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "" msgstr ""
@@ -451,9 +451,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "" msgstr ""
msgid "Off"
msgstr ""
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "" msgstr ""
@@ -505,9 +502,15 @@ msgstr ""
msgid "Print Time" msgid "Print Time"
msgstr "" msgstr ""
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "" msgstr ""
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "" msgstr ""
@@ -553,6 +556,9 @@ msgstr ""
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "" msgstr ""
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "" msgstr ""
@@ -607,6 +613,12 @@ msgstr ""
msgid "Show" msgid "Show"
msgstr "" msgstr ""
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "" msgstr ""
@@ -622,9 +634,6 @@ msgstr ""
msgid "Small" msgid "Small"
msgstr "" msgstr ""
msgid "Sort by: "
msgstr ""
msgid "Sort:" msgid "Sort:"
msgstr "" msgstr ""
@@ -704,9 +713,6 @@ msgstr ""
msgid "Uploaded" msgid "Uploaded"
msgstr "" msgstr ""
msgid "View Mesh"
msgstr ""
msgid "X+" msgid "X+"
msgstr "" msgstr ""
Binary file not shown.
@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KlipperScreen\n" "Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: SRBJ\n" "Last-Translator: SRBJ\n"
"Language-Team: \n" "Language-Team: \n"
@@ -58,6 +58,9 @@ msgstr ""
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "" msgstr ""
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "Er du sikker på, at du vil køre nødstop?" msgstr "Er du sikker på, at du vil køre nødstop?"
@@ -173,9 +176,6 @@ msgstr "Dato"
msgid "Decrease" msgid "Decrease"
msgstr "Formindsk" msgstr "Formindsk"
msgid "Delete"
msgstr "Slet"
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr ""
@@ -282,9 +282,6 @@ msgstr "Skjul sensorer i Temp."
msgid "Hide temp." msgid "Hide temp."
msgstr "" msgstr ""
msgid "Home"
msgstr "Home"
msgid "Home All" msgid "Home All"
msgstr "Home alle" msgstr "Home alle"
@@ -378,9 +375,6 @@ msgstr "Indlæs"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "Sænk Nozzle" msgstr "Sænk Nozzle"
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "Makrogenvej på sidelinjen" msgstr "Makrogenvej på sidelinjen"
@@ -417,6 +411,9 @@ msgstr "Mellem"
msgid "Menu" msgid "Menu"
msgstr "Menu" msgstr "Menu"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "Ændret" msgstr "Ændret"
@@ -435,6 +432,9 @@ msgstr "Navn"
msgid "Network" msgid "Network"
msgstr "Netværk" msgstr "Netværk"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "Ny" msgstr "Ny"
@@ -446,9 +446,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Intet valgt" msgstr "Intet valgt"
msgid "Off"
msgstr "Sluk"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "Forældet med %d" msgstr "Forældet med %d"
@@ -500,9 +497,15 @@ msgstr "Print styring"
msgid "Print Time" msgid "Print Time"
msgstr "Printtid" msgstr "Printtid"
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "Printer forbindelser" msgstr "Printer forbindelser"
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "Printer" msgstr "Printer"
@@ -548,6 +551,9 @@ msgstr ""
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "" msgstr ""
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Prøv igen #%s" msgstr "Prøv igen #%s"
@@ -602,6 +608,12 @@ msgstr "Indstillinger"
msgid "Show" msgid "Show"
msgstr "At vise" msgstr "At vise"
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "Størrelse" msgstr "Størrelse"
@@ -617,9 +629,6 @@ msgstr ""
msgid "Small" msgid "Small"
msgstr "Lille" msgstr "Lille"
msgid "Sort by: "
msgstr "Sortér efter: "
msgid "Sort:" msgid "Sort:"
msgstr "Sortere: " msgstr "Sortere: "
@@ -699,9 +708,6 @@ msgstr "Opdatering"
msgid "Uploaded" msgid "Uploaded"
msgstr "Uploadet" msgstr "Uploadet"
msgid "View Mesh"
msgstr "Vis mesh"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -766,6 +772,21 @@ msgstr "mm/s"
msgid "mm/s²" msgid "mm/s²"
msgstr "mm/s²" msgstr "mm/s²"
#~ msgid "Delete"
#~ msgstr "Slet"
#~ msgid "Home"
#~ msgstr "Home"
#~ msgid "Off"
#~ msgstr "Sluk"
#~ msgid "View Mesh"
#~ msgstr "Vis mesh"
#~ msgid "Sort by: "
#~ msgstr "Sortér efter: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Bltouch fundet anvendt offset" #~ msgstr "Bltouch fundet anvendt offset"
@@ -794,9 +815,6 @@ msgstr "mm/s²"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Unknown Heater "
#~ msgstr "Ukendt varmelegeme "
#~ msgid "Disconnect" #~ msgid "Disconnect"
#~ msgstr "Afbryd forbindelse" #~ msgstr "Afbryd forbindelse"
@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KlipperScreen\n" "Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: 2022-03-31 10:43-0300\n" "PO-Revision-Date: 2022-03-31 10:43-0300\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@@ -63,6 +63,9 @@ msgstr ""
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "" msgstr ""
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "Sind Sie sicher, dass Sie Not-Aus ausführen möchten?" msgstr "Sind Sie sicher, dass Sie Not-Aus ausführen möchten?"
@@ -178,9 +181,6 @@ msgstr "Datum"
msgid "Decrease" msgid "Decrease"
msgstr "Verringern" msgstr "Verringern"
msgid "Delete"
msgstr "Löschen"
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr ""
@@ -287,9 +287,6 @@ msgstr "Sensoren in Temp ausblenden."
msgid "Hide temp." msgid "Hide temp."
msgstr "" msgstr ""
msgid "Home"
msgstr "Grundposition"
msgid "Home All" msgid "Home All"
msgstr "Alle Achsen zurücksetzen" msgstr "Alle Achsen zurücksetzen"
@@ -383,9 +380,6 @@ msgstr "Laden"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "Düse absenken" msgstr "Düse absenken"
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "Makro Verknüpfung in Sidebar" msgstr "Makro Verknüpfung in Sidebar"
@@ -422,6 +416,9 @@ msgstr "Mittel"
msgid "Menu" msgid "Menu"
msgstr "Menü" msgstr "Menü"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "Modifiziert" msgstr "Modifiziert"
@@ -440,6 +437,9 @@ msgstr "Name"
msgid "Network" msgid "Network"
msgstr "Netzwerk" msgstr "Netzwerk"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "Neu" msgstr "Neu"
@@ -451,9 +451,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Nichts ausgewählt" msgstr "Nichts ausgewählt"
msgid "Off"
msgstr "Aus"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "Veraltet von %d" msgstr "Veraltet von %d"
@@ -505,9 +502,15 @@ msgstr "Druck Steuerung"
msgid "Print Time" msgid "Print Time"
msgstr "Druckzeit" msgstr "Druckzeit"
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "Drucker Verbindungen" msgstr "Drucker Verbindungen"
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "Drucken" msgstr "Drucken"
@@ -553,6 +556,9 @@ msgstr "Rückzugslänge"
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "Rückzugsgeschwindigkeit" msgstr "Rückzugsgeschwindigkeit"
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Wiederholen #%s" msgstr "Wiederholen #%s"
@@ -607,6 +613,12 @@ msgstr "Einstellungen"
msgid "Show" msgid "Show"
msgstr "Zeigen" msgstr "Zeigen"
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "Größe" msgstr "Größe"
@@ -622,9 +634,6 @@ msgstr ""
msgid "Small" msgid "Small"
msgstr "Klein" msgstr "Klein"
msgid "Sort by: "
msgstr "Sortierung: "
msgid "Sort:" msgid "Sort:"
msgstr "Sortieren: " msgstr "Sortieren: "
@@ -706,9 +715,6 @@ msgstr "Aktualisierung"
msgid "Uploaded" msgid "Uploaded"
msgstr "Hochgeladen" msgstr "Hochgeladen"
msgid "View Mesh"
msgstr "Mesh anzeigen"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -773,6 +779,21 @@ msgstr "mm/s"
msgid "mm/s²" msgid "mm/s²"
msgstr "mm/s²" msgstr "mm/s²"
#~ msgid "Delete"
#~ msgstr "Löschen"
#~ msgid "Home"
#~ msgstr "Grundposition"
#~ msgid "Off"
#~ msgstr "Aus"
#~ msgid "View Mesh"
#~ msgstr "Mesh anzeigen"
#~ msgid "Sort by: "
#~ msgstr "Sortierung: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Bltouch hat angewendeten Offset gefunden" #~ msgstr "Bltouch hat angewendeten Offset gefunden"
@@ -801,9 +822,6 @@ msgstr "mm/s²"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Unknown Heater "
#~ msgstr "Unbekannte Heizung "
#~ msgid "Disconnect" #~ msgid "Disconnect"
#~ msgstr "Nicht verbunden" #~ msgstr "Nicht verbunden"
@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KlipperScreen\n" "Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@@ -58,6 +58,9 @@ msgstr ""
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "" msgstr ""
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "" msgstr ""
@@ -173,9 +176,6 @@ msgstr ""
msgid "Decrease" msgid "Decrease"
msgstr "" msgstr ""
msgid "Delete"
msgstr ""
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr ""
@@ -282,9 +282,6 @@ msgstr ""
msgid "Hide temp." msgid "Hide temp."
msgstr "" msgstr ""
msgid "Home"
msgstr ""
msgid "Home All" msgid "Home All"
msgstr "" msgstr ""
@@ -378,9 +375,6 @@ msgstr ""
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "" msgstr ""
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "" msgstr ""
@@ -417,6 +411,9 @@ msgstr ""
msgid "Menu" msgid "Menu"
msgstr "" msgstr ""
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "" msgstr ""
@@ -435,6 +432,9 @@ msgstr ""
msgid "Network" msgid "Network"
msgstr "" msgstr ""
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "" msgstr ""
@@ -446,9 +446,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "" msgstr ""
msgid "Off"
msgstr ""
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "" msgstr ""
@@ -500,9 +497,15 @@ msgstr ""
msgid "Print Time" msgid "Print Time"
msgstr "" msgstr ""
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "" msgstr ""
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "" msgstr ""
@@ -548,6 +551,9 @@ msgstr ""
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "" msgstr ""
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "" msgstr ""
@@ -602,6 +608,12 @@ msgstr ""
msgid "Show" msgid "Show"
msgstr "" msgstr ""
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "" msgstr ""
@@ -617,9 +629,6 @@ msgstr ""
msgid "Small" msgid "Small"
msgstr "" msgstr ""
msgid "Sort by: "
msgstr ""
msgid "Sort:" msgid "Sort:"
msgstr "" msgstr ""
@@ -699,9 +708,6 @@ msgstr ""
msgid "Uploaded" msgid "Uploaded"
msgstr "" msgstr ""
msgid "View Mesh"
msgstr ""
msgid "X+" msgid "X+"
msgstr "" msgstr ""
Binary file not shown.
@@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KlipperScreen\n" "Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: 2022-08-10 12:01-0300\n" "PO-Revision-Date: 2022-11-12 11:20-0300\n"
"Last-Translator: alfrix\n" "Last-Translator: alfrix\n"
"Language-Team: \n" "Language-Team: \n"
"Language: es\n" "Language: es\n"
@@ -16,7 +16,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.1\n" "X-Generator: Poedit 3.1.1\n"
#, python-format #, python-format
msgid "%s will be updated to version" msgid "%s will be updated to version"
@@ -63,6 +63,9 @@ msgstr "Aplicar %.2f desfase al final de carrera?"
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "Aplicar %s%.2f desfase al sensor?" msgstr "Aplicar %s%.2f desfase al sensor?"
msgid "Are you sure do you want to exclude the object?"
msgstr "¿Está seguro de excluir este objeto?"
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "¿Parada de emergencia?" msgstr "¿Parada de emergencia?"
@@ -178,9 +181,6 @@ msgstr "Fecha"
msgid "Decrease" msgid "Decrease"
msgstr "Disminuir" msgstr "Disminuir"
msgid "Delete"
msgstr "Borrar"
msgid "Delete File?" msgid "Delete File?"
msgstr "¿Borrar archivo?" msgstr "¿Borrar archivo?"
@@ -287,9 +287,6 @@ msgstr "Ocultar sensores en Temp."
msgid "Hide temp." msgid "Hide temp."
msgstr "Ocultar temp." msgstr "Ocultar temp."
msgid "Home"
msgstr "Inicio"
msgid "Home All" msgid "Home All"
msgstr "Origen XYZ" msgstr "Origen XYZ"
@@ -383,9 +380,6 @@ msgstr "Cargar"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "Bajar Boquilla" msgstr "Bajar Boquilla"
msgid "Machine"
msgstr "Máquina"
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "Atajo a Macros en el lateral" msgstr "Atajo a Macros en el lateral"
@@ -422,6 +416,9 @@ msgstr "Medio"
msgid "Menu" msgid "Menu"
msgstr "Menú" msgstr "Menú"
msgid "Mesh calibrate"
msgstr "Calibrar Malla"
msgid "Modified" msgid "Modified"
msgstr "Modificado" msgstr "Modificado"
@@ -440,6 +437,9 @@ msgstr "Nombre"
msgid "Network" msgid "Network"
msgstr "Red" msgstr "Red"
msgid "Never"
msgstr "Nunca"
msgid "New" msgid "New"
msgstr "Nuevo" msgstr "Nuevo"
@@ -453,9 +453,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Nada seleccionado" msgstr "Nada seleccionado"
msgid "Off"
msgstr "Apagar"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "Desactualizado por %d" msgstr "Desactualizado por %d"
@@ -507,9 +504,15 @@ msgstr "Control de impresión"
msgid "Print Time" msgid "Print Time"
msgstr "Tiempo de impresión" msgstr "Tiempo de impresión"
msgid "Printer"
msgstr "Impresora"
msgid "Printer Connections" msgid "Printer Connections"
msgstr "Conexiones a impresoras" msgstr "Conexiones a impresoras"
msgid "Printer Select"
msgstr "Seleccionar Impresora"
msgid "Printing" msgid "Printing"
msgstr "Imprimiendo" msgstr "Imprimiendo"
@@ -555,6 +558,9 @@ msgstr "Largo de Retracción"
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "Velocidad de Retracción" msgstr "Velocidad de Retracción"
msgid "Retry"
msgstr "Reintentar"
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Intento #%s" msgstr "Intento #%s"
@@ -609,6 +615,12 @@ msgstr "Opciones"
msgid "Show" msgid "Show"
msgstr "Mostrar" msgstr "Mostrar"
msgid "Show Heater Power"
msgstr "Mostrar potencia del calentador"
msgid "Shutdown"
msgstr "Apagar"
msgid "Size" msgid "Size"
msgstr "Tamaño" msgstr "Tamaño"
@@ -624,9 +636,6 @@ msgstr "Slicer:"
msgid "Small" msgid "Small"
msgstr "Pequeño" msgstr "Pequeño"
msgid "Sort by: "
msgstr "Ordenar por: "
msgid "Sort:" msgid "Sort:"
msgstr "Ordenar:" msgstr "Ordenar:"
@@ -706,9 +715,6 @@ msgstr "Actualizando"
msgid "Uploaded" msgid "Uploaded"
msgstr "Subido" msgstr "Subido"
msgid "View Mesh"
msgstr "Ver Malla"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -773,6 +779,24 @@ msgstr "mm/s"
msgid "mm/s²" msgid "mm/s²"
msgstr "mm/s²" msgstr "mm/s²"
#~ msgid "Delete"
#~ msgstr "Borrar"
#~ msgid "Home"
#~ msgstr "Inicio"
#~ msgid "Off"
#~ msgstr "Apagar"
#~ msgid "View Mesh"
#~ msgstr "Ver Malla"
#~ msgid "Machine"
#~ msgstr "Máquina"
#~ msgid "Sort by: "
#~ msgstr "Ordenar por: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Encontrado Bltouch aplicado desfase" #~ msgstr "Encontrado Bltouch aplicado desfase"
@@ -801,9 +825,6 @@ msgstr "mm/s²"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Unknown Heater "
#~ msgstr "Calentador Desconocido "
#~ msgid "Disconnect" #~ msgid "Disconnect"
#~ msgstr "Desconectar" #~ msgstr "Desconectar"
@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KlipperScreen\n" "Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: 2022-03-31 10:50-0300\n" "PO-Revision-Date: 2022-03-31 10:50-0300\n"
"Last-Translator: O. Robardet\n" "Last-Translator: O. Robardet\n"
"Language-Team: \n" "Language-Team: \n"
@@ -63,6 +63,9 @@ msgstr ""
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "" msgstr ""
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "Êtes-vous sûr de vouloir exécuter l'arrêt d'urgence?" msgstr "Êtes-vous sûr de vouloir exécuter l'arrêt d'urgence?"
@@ -178,9 +181,6 @@ msgstr "Date"
msgid "Decrease" msgid "Decrease"
msgstr "Diminuer" msgstr "Diminuer"
msgid "Delete"
msgstr "Effacer"
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr ""
@@ -287,9 +287,6 @@ msgstr "Masquer les capteurs dans Temp."
msgid "Hide temp." msgid "Hide temp."
msgstr "" msgstr ""
msgid "Home"
msgstr "Accueil"
msgid "Home All" msgid "Home All"
msgstr "Origine XYZ" msgstr "Origine XYZ"
@@ -383,9 +380,6 @@ msgstr "Charger"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "Rapprocher la buse" msgstr "Rapprocher la buse"
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "Raccourci macro sur la barre latérale" msgstr "Raccourci macro sur la barre latérale"
@@ -422,6 +416,9 @@ msgstr "Moyen"
msgid "Menu" msgid "Menu"
msgstr "Menu" msgstr "Menu"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "Modifié" msgstr "Modifié"
@@ -440,6 +437,9 @@ msgstr "Nom"
msgid "Network" msgid "Network"
msgstr "Réseau" msgstr "Réseau"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "Nouveau" msgstr "Nouveau"
@@ -451,9 +451,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Rien de sélectionné" msgstr "Rien de sélectionné"
msgid "Off"
msgstr "Éteindre"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "Obsolète de %d" msgstr "Obsolète de %d"
@@ -505,9 +502,15 @@ msgstr "Contrôle de l'impression"
msgid "Print Time" msgid "Print Time"
msgstr "Temps d'impression" msgstr "Temps d'impression"
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "Connexions aux imprimantes" msgstr "Connexions aux imprimantes"
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "Impression" msgstr "Impression"
@@ -553,6 +556,9 @@ msgstr "Longueur de rétraction"
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "Vitesse de rétraction" msgstr "Vitesse de rétraction"
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Réessayez #%s" msgstr "Réessayez #%s"
@@ -607,6 +613,12 @@ msgstr "Paramètres"
msgid "Show" msgid "Show"
msgstr "Montrer" msgstr "Montrer"
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "Dimension" msgstr "Dimension"
@@ -622,9 +634,6 @@ msgstr ""
msgid "Small" msgid "Small"
msgstr "Petit" msgstr "Petit"
msgid "Sort by: "
msgstr "Trier par: "
msgid "Sort:" msgid "Sort:"
msgstr "Trier:" msgstr "Trier:"
@@ -704,9 +713,6 @@ msgstr "Mise à jour"
msgid "Uploaded" msgid "Uploaded"
msgstr "Téléchargé" msgstr "Téléchargé"
msgid "View Mesh"
msgstr "Voir le maillage"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -771,6 +777,21 @@ msgstr "mm/s"
msgid "mm/s²" msgid "mm/s²"
msgstr "mm/s²" msgstr "mm/s²"
#~ msgid "Delete"
#~ msgstr "Effacer"
#~ msgid "Home"
#~ msgstr "Accueil"
#~ msgid "Off"
#~ msgstr "Éteindre"
#~ msgid "View Mesh"
#~ msgstr "Voir le maillage"
#~ msgid "Sort by: "
#~ msgstr "Trier par: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Bltouch a trouvé le décalage appliqué" #~ msgstr "Bltouch a trouvé le décalage appliqué"
@@ -799,9 +820,6 @@ msgstr "mm/s²"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Unknown Heater "
#~ msgstr "Chauffage inconnu "
#~ msgid "Disconnect" #~ msgid "Disconnect"
#~ msgstr "Déconnecter" #~ msgstr "Déconnecter"
@@ -7,9 +7,9 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Klipperscreen\n" "Project-Id-Version: Klipperscreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: 2022-03-31 10:54-0300\n" "PO-Revision-Date: 2022-03-31 10:54-0300\n"
"Last-Translator: Emanuel Sharvit <manu7irl@gmail.com>\n" "Last-Translator: Tal Rahav <talrhv1@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: he_IL\n" "Language: he_IL\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -25,7 +25,7 @@ msgid "%s will be updated to version"
msgstr "%s יעודכן לגרסה" msgstr "%s יעודכן לגרסה"
msgid "(default)" msgid "(default)"
msgstr "(בְּרִירַת מֶחדָל)" msgstr "(ברירת מחדל)"
msgid "24 Hour Time" msgid "24 Hour Time"
msgstr "זמן 24 שעות" msgstr "זמן 24 שעות"
@@ -34,13 +34,13 @@ msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "FIRMWARE_RESTART עשוי לפתור את הבעיה." msgstr "FIRMWARE_RESTART עשוי לפתור את הבעיה."
msgid "ADXL Not Configured" msgid "ADXL Not Configured"
msgstr "" msgstr "ADXL אינו מוגדר"
msgid "Abort" msgid "Abort"
msgstr "בטל" msgstr "בטל"
msgid "Acceleration:" msgid "Acceleration:"
msgstr "" msgstr "האצה"
msgid "Accept" msgid "Accept"
msgstr "אשר" msgstr "אשר"
@@ -52,22 +52,24 @@ msgid "Add Printer"
msgstr "הוסף מדפסת" msgstr "הוסף מדפסת"
msgid "Add profile" msgid "Add profile"
msgstr "" msgstr "הוסף פרופיל"
msgid "Apply" msgid "Apply"
msgstr "" msgstr "החל"
#, python-format #, python-format
msgid "Apply %.2f offset to Endstop?" msgid "Apply %.2f offset to Endstop?"
msgstr "" msgstr "הוסף %.2f לתחנת קצה?"
#, python-format #, python-format
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "הוסף %.2f לפרוב (בודק)?"
msgid "Are you sure do you want to exclude the object?"
msgstr "" msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "" msgstr "האם אתה בטוח שאתה רוצה לבצע עצירת חירום?"
"האם אתה בטוח שברצונך להדפיסהאם אתה בטוח שברצונך להפעיל את עצירת החירום?"
msgid "Are you sure you wish to cancel this print?" msgid "Are you sure you wish to cancel this print?"
msgstr "האם אתה בטוח שברצונך לבטל את ההדפסה?" msgstr "האם אתה בטוח שברצונך לבטל את ההדפסה?"
@@ -79,16 +81,16 @@ msgid "Are you sure you wish to reboot the system?"
msgstr "האם אתה בטוח שברצונך לאתחל את המערכת?" msgstr "האם אתה בטוח שברצונך לאתחל את המערכת?"
msgid "Are you sure you wish to shutdown the system?" msgid "Are you sure you wish to shutdown the system?"
msgstr "האם אתה בטוח שברצונך לסגור את המערכת?" msgstr "האם אתה בטוח שברצונך לכבות את המערכת?"
msgid "Auto" msgid "Auto"
msgstr "אוטומטי" msgstr "אוטומטי"
msgid "Auto-calibrate" msgid "Auto-calibrate"
msgstr "" msgstr "כיול אוטומטי"
msgid "Auto-close notifications" msgid "Auto-close notifications"
msgstr "" msgstr "סגירת התראות אוטומטית"
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "גלילה אוטומטית" msgstr "גלילה אוטומטית"
@@ -100,22 +102,22 @@ msgid "Bed Mesh"
msgstr "מיפוי מיטה" msgstr "מיפוי מיטה"
msgid "Bed screw configuration:" msgid "Bed screw configuration:"
msgstr "" msgstr "הגדרת בורג מיטה"
msgid "Calibrate" msgid "Calibrate"
msgstr "לְדַרֵג" msgstr "לכייל"
msgid "Calibrated" msgid "Calibrated"
msgstr "" msgstr "מכויל"
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "מכויל, שמור את התצורה כדי שהיא תהיה קבועה" msgstr "מכויל, שמור את התצורה כדי שהיא תהיה קבועה"
msgid "Calibrating" msgid "Calibrating"
msgstr "" msgstr "מכייל"
msgid "Calibrating..." msgid "Calibrating..."
msgstr "" msgstr "מכייל..."
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "לא ניתן להגדיר מעל המקסימום:" msgstr "לא ניתן להגדיר מעל המקסימום:"
@@ -136,22 +138,22 @@ msgid "Cannot connect to Moonraker"
msgstr "לא ניתן להתחבר ל-Moonraker" msgstr "לא ניתן להתחבר ל-Moonraker"
msgid "Channel" msgid "Channel"
msgstr "עָרוּץ" msgstr "ערוץ"
msgid "Check ADXL Wiring" msgid "Check ADXL Wiring"
msgstr "" msgstr "בדוק את החיווט של ה ADXL"
msgid "Checking for updates, please wait..." msgid "Checking for updates, please wait..."
msgstr "" msgstr "בודק עדכונים, אנא המתן"
msgid "Clear" msgid "Clear"
msgstr "" msgstr "נקה"
msgid "Close" msgid "Close"
msgstr "סגור" msgstr "סגור"
msgid "Complete" msgid "Complete"
msgstr "לְהַשְׁלִים" msgstr "הסתיים"
msgid "Configuration" msgid "Configuration"
msgstr "קונפיגורציה" msgstr "קונפיגורציה"
@@ -160,32 +162,29 @@ msgid "Confirm Emergency Stop"
msgstr "אשר עצירת חירום" msgstr "אשר עצירת חירום"
msgid "Connected" msgid "Connected"
msgstr "מְחוּבָּר" msgstr "מחובר"
#, python-format #, python-format
msgid "Connecting to %s" msgid "Connecting to %s"
msgstr "מתחבר ל- %s" msgstr "מתחבר ל- %s"
msgid "Console" msgid "Console"
msgstr "לְנַחֵם" msgstr "קונסול"
msgid "Continue" msgid "Continue"
msgstr "לְהַמשִׁיך" msgstr "המשך"
msgid "Cooldown" msgid "Cooldown"
msgstr "תירגע" msgstr "הפעל קירור"
msgid "Date" msgid "Date"
msgstr "תַאֲרִיך" msgstr "תאריך"
msgid "Decrease" msgid "Decrease"
msgstr "לְהַקְטִין" msgstr "הורד"
msgid "Delete"
msgstr "לִמְחוֹק"
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr "מחק קובץ"
msgid "Deselect" msgid "Deselect"
msgstr "בטל את הבחירה" msgstr "בטל את הבחירה"
@@ -207,16 +206,16 @@ msgid "Elapsed:"
msgstr "זמן שעבר:" msgstr "זמן שעבר:"
msgid "Error" msgid "Error"
msgstr "שְׁגִיאָה" msgstr "שגיאה"
msgid "Estimated Time Method" msgid "Estimated Time Method"
msgstr "שיטת זמן משוערת" msgstr "שיטת זמן משוערת"
msgid "Exclude Object" msgid "Exclude Object"
msgstr "" msgstr "ביטול אובייקט"
msgid "Extrude" msgid "Extrude"
msgstr "אקסטרוזיה" msgstr "הוצא חומר"
msgid "Extrusion +" msgid "Extrusion +"
msgstr "שיחול +" msgstr "שיחול +"
@@ -231,25 +230,25 @@ msgid "Fan"
msgstr "מאוורר" msgstr "מאוורר"
msgid "Filament Used" msgid "Filament Used"
msgstr "נימה בשימוש" msgstr "חומר ששומש"
msgid "Filament total:" msgid "Filament total:"
msgstr "" msgstr "חומר כולל"
msgid "Filament used:" msgid "Filament used:"
msgstr "" msgstr "חומר ששומש:"
msgid "Filament:" msgid "Filament:"
msgstr "" msgstr "חומר גלם"
msgid "File" msgid "File"
msgstr "קוֹבֶץ" msgstr "קובץ"
msgid "File:" msgid "File:"
msgstr "" msgstr ""
msgid "Finding ADXL" msgid "Finding ADXL"
msgstr "" msgstr "מחפש ADXL"
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "כוונון עדין" msgstr "כוונון עדין"
@@ -258,44 +257,37 @@ msgid "Finish"
msgstr "סיים" msgstr "סיים"
msgid "Firmware Restart" msgid "Firmware Restart"
msgstr "" msgstr "אתחול קושחה"
"קושחה\n"
"איתחול"
msgid "Flow:" msgid "Flow:"
msgstr "" msgstr "זרם"
msgid "Flowrate:" msgid "Flowrate:"
msgstr "" msgstr "קצב זרימה"
msgid "Font Size" msgid "Font Size"
msgstr "גודל טקסט" msgstr "גודל טקסט"
msgid "Full Update" msgid "Full Update"
msgstr "" msgstr "עדכון מלא"
"מלא\n"
"עדכון"
msgid "Go Back" msgid "Go Back"
msgstr "חזרה" msgstr "חזרה"
msgid "Height:" msgid "Height:"
msgstr "" msgstr "גובה"
msgid "Hidden" msgid "Hidden"
msgstr "מוּסתָר" msgstr "מוסתר"
msgid "Hide" msgid "Hide"
msgstr "להתחבא" msgstr "הסתר"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "הסתר חיישנים בטמפ'." msgstr "הסתר חיישנים בטמפ'."
msgid "Hide temp." msgid "Hide temp."
msgstr "" msgstr "הסתר טמפרטורה"
msgid "Home"
msgstr "איפוס"
msgid "Home All" msgid "Home All"
msgstr "איפוס XYZ" msgstr "איפוס XYZ"
@@ -316,13 +308,13 @@ msgid "Homing"
msgstr "איפוס צירים" msgstr "איפוס צירים"
msgid "Host" msgid "Host"
msgstr "" msgstr "שרת"
msgid "Hostname" msgid "Hostname"
msgstr "Hostname" msgstr "שם שרת"
msgid "Icon Theme" msgid "Icon Theme"
msgstr "נושא אייקון" msgstr "ערכת נושא"
msgid "Increase" msgid "Increase"
msgstr "הגדל" msgstr "הגדל"
@@ -334,10 +326,10 @@ msgid "Initializing printer..."
msgstr "מאתחל מדפסת..." msgstr "מאתחל מדפסת..."
msgid "Input Shaper" msgid "Input Shaper"
msgstr "" msgstr "מעצב גימור"
msgid "Interface" msgid "Interface"
msgstr "מִמְשָׁק" msgstr "ממשק"
msgid "Invalid" msgid "Invalid"
msgstr "לא חוקי" msgstr "לא חוקי"
@@ -352,9 +344,7 @@ msgid "Invert Z"
msgstr "הפוך את Z" msgstr "הפוך את Z"
msgid "Klipper Restart" msgid "Klipper Restart"
msgstr "" msgstr "אתחול קליפר"
"קליפר\n"
"איתחול"
msgid "Klipper has disconnected" msgid "Klipper has disconnected"
msgstr "קליפר התנתק" msgstr "קליפר התנתק"
@@ -363,10 +353,10 @@ msgid "Klipper has encountered an error."
msgstr "קילפר נתקל בבעיה." msgstr "קילפר נתקל בבעיה."
msgid "Klipper has shutdown" msgid "Klipper has shutdown"
msgstr "קליפר נכבה" msgstr "קליפר כבה"
msgid "Klipper is attempting to start" msgid "Klipper is attempting to start"
msgstr "קליפר מנסה לרוץ" msgstr "קליפר מנסה לעלות"
msgid "Klipper will reboot" msgid "Klipper will reboot"
msgstr "קליפר יבצע אתחול" msgstr "קליפר יבצע אתחול"
@@ -375,10 +365,10 @@ msgid "Language"
msgstr "שפה" msgstr "שפה"
msgid "Large" msgid "Large"
msgstr "גָדוֹל" msgstr "גדול"
msgid "Layer:" msgid "Layer:"
msgstr "" msgstr "שכבה"
msgid "Left:" msgid "Left:"
msgstr "זמן שנותר:" msgstr "זמן שנותר:"
@@ -387,14 +377,11 @@ msgid "Limits"
msgstr "גבולות" msgstr "גבולות"
msgid "Load" msgid "Load"
msgstr "לִטעוֹן" msgstr "טעינה"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "הנמך דיזה" msgstr "הנמך דיזה"
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "קיצור מקרו בסרגל הצד" msgstr "קיצור מקרו בסרגל הצד"
@@ -405,10 +392,10 @@ msgid "Main Menu"
msgstr "תפריט ראשי" msgstr "תפריט ראשי"
msgid "Max" msgid "Max"
msgstr "" msgstr "מקסימום"
msgid "Max Acceleration" msgid "Max Acceleration"
msgstr "" msgstr "מקסימום תאוצה"
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
msgstr "האצה מרבית להאטה" msgstr "האצה מרבית להאטה"
@@ -417,19 +404,22 @@ msgid "Max Velocity"
msgstr "מהירות מרבית" msgstr "מהירות מרבית"
msgid "Measure Both" msgid "Measure Both"
msgstr "" msgstr "מדוד את שניהם"
msgid "Measure X" msgid "Measure X"
msgstr "" msgstr "מדוד X"
msgid "Measure Y" msgid "Measure Y"
msgstr "" msgstr "מדוד Y"
msgid "Medium" msgid "Medium"
msgstr "ממוצע" msgstr "בינוני"
msgid "Menu" msgid "Menu"
msgstr "תַפרִיט" msgstr "תפריט"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "שונה" msgstr "שונה"
@@ -444,25 +434,25 @@ msgid "Move Distance (mm)"
msgstr "מרחק הזזה (מ''מ)" msgstr "מרחק הזזה (מ''מ)"
msgid "Name" msgid "Name"
msgstr "שֵׁם" msgstr "שם"
msgid "Network" msgid "Network"
msgstr "רשת" msgstr "רשת"
msgid "New" msgid "Never"
msgstr "" msgstr ""
msgid "New"
msgstr "חדש"
msgid "" msgid ""
"Not supported for auto-detection, it needs to be configured in klipperscreen." "Not supported for auto-detection, it needs to be configured in klipperscreen."
"conf" "conf"
msgstr "" msgstr "איתור אוטומטי אינו נתמך, זה צריך להיות מוגדר ב klipperscreen"
msgid "Nothing selected" msgid "Nothing selected"
msgstr "שום דבר לא נבחר" msgstr "שום דבר לא נבחר"
msgid "Off"
msgstr "כבוי"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "מיושן על ידי %d" msgstr "מיושן על ידי %d"
@@ -478,7 +468,7 @@ msgstr[2] "חבילות יעודכנו"
msgstr[3] "חבילות יעודכנו" msgstr[3] "חבילות יעודכנו"
msgid "Part Fan" msgid "Part Fan"
msgstr "" msgstr "מאוורר חומר"
msgid "Password saved" msgid "Password saved"
msgstr "הסיסמה נשמרה" msgstr "הסיסמה נשמרה"
@@ -493,10 +483,10 @@ msgid "Perform a full upgrade?"
msgstr "לבצע שדרוג מלא?" msgstr "לבצע שדרוג מלא?"
msgid "Pins" msgid "Pins"
msgstr "" msgstr "פינים"
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "אנא הידור מחדש והבזק את המיקרו-בקר." msgstr "אנא הדר (קמפל) מחדש ובצע פלאש למיקרו-בקר."
msgid "Power" msgid "Power"
msgstr "הפעלה" msgstr "הפעלה"
@@ -505,10 +495,10 @@ msgid "Power On Printer"
msgstr "הפעל מדפסת" msgstr "הפעל מדפסת"
msgid "Pressure Advance:" msgid "Pressure Advance:"
msgstr "" msgstr "פרשר אדוונס"
msgid "Print" msgid "Print"
msgstr "הדפס" msgstr "הדפסה"
msgid "Print Control" msgid "Print Control"
msgstr "שליטה בהדפסה" msgstr "שליטה בהדפסה"
@@ -516,35 +506,41 @@ msgstr "שליטה בהדפסה"
msgid "Print Time" msgid "Print Time"
msgstr "זמן הדפסה" msgstr "זמן הדפסה"
msgid "Printer"
msgstr "מדפסת"
msgid "Printer Connections" msgid "Printer Connections"
msgstr "חיבורי מדפסת" msgstr "חיבורי מדפסת"
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "מדפיס" msgstr "מדפיס"
msgid "Probe Offset" msgid "Probe Offset"
msgstr "" msgstr "פרוב אוף-סט"
msgid "Profile Name:" msgid "Profile Name:"
msgstr "שם פרופיל:" msgstr "שם פרופיל:"
msgid "Quad Gantry Level" msgid "Quad Gantry Level"
msgstr "רמת מרפסת גנטרי" msgstr "יישור הגנטרי הריבועי"
msgid "Raise Nozzle" msgid "Raise Nozzle"
msgstr "הגבה" msgstr "הגבה דיזה"
msgid "Recover Hard" msgid "Recover Hard"
msgstr "לְהַחלִים Hard" msgstr "שחזור מלא"
msgid "Recover Soft" msgid "Recover Soft"
msgstr "לְהַחלִים Soft" msgstr "שחזור עדין"
msgid "Reference" msgid "Reference"
msgstr "התייחסות" msgstr "התייחסות"
msgid "Refresh" msgid "Refresh"
msgstr "" msgstr "רענון"
msgid "Restart" msgid "Restart"
msgstr "אתחל" msgstr "אתחל"
@@ -556,12 +552,15 @@ msgid "Retract"
msgstr "שיחול לאחור" msgstr "שיחול לאחור"
msgid "Retraction" msgid "Retraction"
msgstr "" msgstr "משיכה"
msgid "Retraction Length" msgid "Retraction Length"
msgstr "" msgstr "מרחק משיכה"
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "מהירות משיכה"
msgid "Retry"
msgstr "" msgstr ""
#, python-format #, python-format
@@ -569,26 +568,26 @@ msgid "Retry #%s"
msgstr "נסה שוב #%s" msgstr "נסה שוב #%s"
msgid "Retrying" msgid "Retrying"
msgstr "" msgstr "מנסה שוב"
msgid "Save" msgid "Save"
msgstr "להציל" msgstr "לשמור"
msgid "Save Config" msgid "Save Config"
msgstr "שמור קונפיג" msgstr "שמור קונפיג"
msgid "Save Z" msgid "Save Z"
msgstr "" msgstr "שמור Z"
msgid "Save configuration?" msgid "Save configuration?"
msgstr "" msgstr "שמור קונפיגרציה?"
msgid "Saved" msgid "Saved"
msgstr "" msgstr "נשמר"
#, python-format #, python-format
msgid "Saved offset: %s" msgid "Saved offset: %s"
msgstr "" msgstr "שמור אופ-סט %s"
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "DPMS מסך" msgstr "DPMS מסך"
@@ -603,7 +602,7 @@ msgid "Select"
msgstr "בחר" msgstr "בחר"
msgid "Send" msgid "Send"
msgstr "לִשְׁלוֹחַ" msgstr "שליחה"
#, python-format #, python-format
msgid "Sending Power ON signal to: %s" msgid "Sending Power ON signal to: %s"
@@ -616,13 +615,19 @@ msgid "Settings"
msgstr "הגדרות" msgstr "הגדרות"
msgid "Show" msgid "Show"
msgstr "הופעה" msgstr "הצג"
msgid "Show Heater Power"
msgstr "הצג זרם מיטה"
msgid "Shutdown"
msgstr "כיבוי"
msgid "Size" msgid "Size"
msgstr "גודל" msgstr "גודל"
msgid "Slicer" msgid "Slicer"
msgstr "Slicer" msgstr "סלייסר"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "תיקון זמן פריסה (%)" msgstr "תיקון זמן פריסה (%)"
@@ -631,13 +636,10 @@ msgid "Slicer:"
msgstr "" msgstr ""
msgid "Small" msgid "Small"
msgstr "קָטָן" msgstr "קטן"
msgid "Sort by: "
msgstr "מיין לפי: "
msgid "Sort:" msgid "Sort:"
msgstr "" msgstr "מיין"
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "מהירות (מ\"מ/שניות)" msgstr "מהירות (מ\"מ/שניות)"
@@ -649,13 +651,13 @@ msgid "Speed -"
msgstr "מהירות -" msgstr "מהירות -"
msgid "Speed:" msgid "Speed:"
msgstr "" msgstr "מהירות"
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "מהירות פינה מרובעת" msgstr "מהירות פינה מרובעת"
msgid "Start" msgid "Start"
msgstr "הַתחָלָה" msgstr "התחל"
msgid "Starting WiFi Association" msgid "Starting WiFi Association"
msgstr "מתחיל איגוד WiFi" msgstr "מתחיל איגוד WiFi"
@@ -670,14 +672,10 @@ msgid "System"
msgstr "מערכת" msgstr "מערכת"
msgid "System Restart" msgid "System Restart"
msgstr "" msgstr "אתחול מערכת"
"מערכת\n"
"אתחול"
msgid "System Shutdown" msgid "System Shutdown"
msgstr "" msgstr "כיבוי מערכת"
"מערכת\n"
"לכבות"
msgid "Temp (°C)" msgid "Temp (°C)"
msgstr "טמפ' (°C)" msgstr "טמפ' (°C)"
@@ -696,10 +694,10 @@ msgid "Unknown Heater"
msgstr "מחמם לא ידוע" msgstr "מחמם לא ידוע"
msgid "Unknown screw position" msgid "Unknown screw position"
msgstr "" msgstr "מיקום בורג לא ידוע"
msgid "Unload" msgid "Unload"
msgstr "לִפְרוֹק" msgstr "העלה"
msgid "Unretract Extra Length" msgid "Unretract Extra Length"
msgstr "" msgstr ""
@@ -714,14 +712,11 @@ msgid "Update"
msgstr "עדכון" msgstr "עדכון"
msgid "Updating" msgid "Updating"
msgstr "עִדכּוּן" msgstr "מעדכן"
msgid "Uploaded" msgid "Uploaded"
msgstr "הועלה" msgstr "הועלה"
msgid "View Mesh"
msgstr "צפה ברשת"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -732,7 +727,7 @@ msgid "XY Move Speed (mm/s)"
msgstr "מהירות תנועה XY (מ\"מ/שנייה)" msgstr "מהירות תנועה XY (מ\"מ/שנייה)"
msgid "XY Speed (mm/s)" msgid "XY Speed (mm/s)"
msgstr "" msgstr "מהירות XY (mm/s)"
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr "Y+"
@@ -747,13 +742,13 @@ msgid "Z Move Speed (mm/s)"
msgstr "מהירות תנועה Z (מ\"מ/שניות)" msgstr "מהירות תנועה Z (מ\"מ/שניות)"
msgid "Z Speed (mm/s)" msgid "Z Speed (mm/s)"
msgstr "" msgstr "מהירות Z (mm/s)"
msgid "Z Tilt" msgid "Z Tilt"
msgstr "הטיה Z" msgstr "הטיה Z"
msgid "Z offset:" msgid "Z offset:"
msgstr "" msgstr "Z אוף-סט"
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr "Z+"
@@ -790,6 +785,30 @@ msgstr "מ\"מ/ש"
msgid "mm/s²" msgid "mm/s²"
msgstr "mm/s²" msgstr "mm/s²"
#~ msgid "Delete"
#~ msgstr "מחק"
#~ msgid "Home"
#~ msgstr "איפוס"
#~ msgid "Off"
#~ msgstr "כבוי"
#~ msgid "View Mesh"
#~ msgstr "צפה ברשת"
#~ msgid "Machine"
#~ msgstr "מכונה"
#~ msgid "Manual Calibration"
#~ msgstr "כיול ידני"
#~ msgid "Auto Calibration"
#~ msgstr "כיול אוטומטי"
#~ msgid "Sort by: "
#~ msgstr "מיין לפי: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Bltouch נמצא היסט מוחל" #~ msgstr "Bltouch נמצא היסט מוחל"
@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KlipperScreen\n" "Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-09-11 11:38-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: AntoszHUN\n" "Last-Translator: AntoszHUN\n"
"Language-Team: \n" "Language-Team: \n"
@@ -52,26 +52,29 @@ msgstr "Alkalmaz"
#, python-format #, python-format
msgid "Apply %.2f offset to Endstop?" msgid "Apply %.2f offset to Endstop?"
msgstr "Alkalmaz %.2f eltolást az Endstopra?" msgstr "Alkalmazod %.2f eltolást az Endstopra?"
#, python-format #, python-format
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "Alkalmaz %s%.2f eltolást a szondára?" msgstr "Alkalmazod %s%.2f eltolást a szondára?"
msgid "Are you sure do you want to exclude the object?"
msgstr "Biztosan kizárod az objektumot?"
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "Biztosan Vészleállítást végez?" msgstr "Biztosan Vészleállítást szeretnél?"
msgid "Are you sure you wish to cancel this print?" msgid "Are you sure you wish to cancel this print?"
msgstr "Biztosan megszakítja ezt a nyomtatást?" msgstr "Biztosan megszakítod ezt a nyomtatást?"
msgid "Are you sure you wish to disable motors?" msgid "Are you sure you wish to disable motors?"
msgstr "Biztos benne, hogy le szeretné tiltani a motorokat?" msgstr "Biztosan le szeretnéd tiltani a motorokat?"
msgid "Are you sure you wish to reboot the system?" msgid "Are you sure you wish to reboot the system?"
msgstr "Biztos benne, hogy újra akarja indítani a rendszert?" msgstr "Biztos, hogy újra akarod indítani a rendszert?"
msgid "Are you sure you wish to shutdown the system?" msgid "Are you sure you wish to shutdown the system?"
msgstr "Biztos, hogy le szeretné állítani a rendszert?" msgstr "Biztos, hogy le szeretnéd állítani a rendszert?"
msgid "Auto" msgid "Auto"
msgstr "Auto" msgstr "Auto"
@@ -101,7 +104,7 @@ msgid "Calibrated"
msgstr "Kalibrálva" msgstr "Kalibrálva"
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "Kalibrálva! Mentse el a konfigurációt, hogy az állandó legyen" msgstr "Kalibrálva! Mentsd el a konfigurációt, hogy az állandó legyen"
msgid "Calibrating" msgid "Calibrating"
msgstr "Kalibrálás" msgstr "Kalibrálás"
@@ -131,10 +134,10 @@ msgid "Channel"
msgstr "Csatorna" msgstr "Csatorna"
msgid "Check ADXL Wiring" msgid "Check ADXL Wiring"
msgstr "Ellenőrizze az ADXL kábelezést" msgstr "Ellenőrizd az ADXL kábelezést"
msgid "Checking for updates, please wait..." msgid "Checking for updates, please wait..."
msgstr "Frissítések keresése, kérjük, várjon..." msgstr "Frissítések keresése, kérjük, várj..."
msgid "Clear" msgid "Clear"
msgstr "Tiszta" msgstr "Tiszta"
@@ -149,7 +152,7 @@ msgid "Configuration"
msgstr "Konfiguráció" msgstr "Konfiguráció"
msgid "Confirm Emergency Stop" msgid "Confirm Emergency Stop"
msgstr "Erősítse meg a vészleállítást" msgstr "Vészleállítás megerősítése"
msgid "Connected" msgid "Connected"
msgstr "Csatlakoztatva" msgstr "Csatlakoztatva"
@@ -173,9 +176,6 @@ msgstr "Dátum"
msgid "Decrease" msgid "Decrease"
msgstr "Csökkent" msgstr "Csökkent"
msgid "Delete"
msgstr "Töröl"
msgid "Delete File?" msgid "Delete File?"
msgstr "Fájl törlése?" msgstr "Fájl törlése?"
@@ -193,7 +193,7 @@ msgstr "Távolság (mm)"
#, python-format #, python-format
msgid "Do you want to recover %s?" msgid "Do you want to recover %s?"
msgstr "Vissza akarja állítani %s-t?" msgstr "Vissza akarod állítani %s-t?"
msgid "Elapsed:" msgid "Elapsed:"
msgstr "Eltelt:" msgstr "Eltelt:"
@@ -277,14 +277,11 @@ msgid "Hide"
msgstr "Elrejt" msgstr "Elrejt"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "Szenzorok elrejtése Hőfok." msgstr "Hőfok szenzorok elrejtése."
msgid "Hide temp." msgid "Hide temp."
msgstr "Hőfok elrejtése" msgstr "Hőfok elrejtése"
msgid "Home"
msgstr "Kezdőpontok"
msgid "Home All" msgid "Home All"
msgstr "X-Y-Z kezdőpont" msgstr "X-Y-Z kezdőpont"
@@ -304,7 +301,7 @@ msgid "Homing"
msgstr "Kezdőpont" msgstr "Kezdőpont"
msgid "Host" msgid "Host"
msgstr "Gazda" msgstr "Gazdagép"
msgid "Hostname" msgid "Hostname"
msgstr "Gazdanév" msgstr "Gazdanév"
@@ -378,9 +375,6 @@ msgstr "Betöltés"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "Fúvóka le" msgstr "Fúvóka le"
msgid "Machine"
msgstr "Gép"
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "Makró parancsikon az oldalsávon" msgstr "Makró parancsikon az oldalsávon"
@@ -417,6 +411,9 @@ msgstr "Közepes"
msgid "Menu" msgid "Menu"
msgstr "Menü" msgstr "Menü"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "Módosított" msgstr "Módosított"
@@ -435,6 +432,9 @@ msgstr "Név"
msgid "Network" msgid "Network"
msgstr "Hálózat" msgstr "Hálózat"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "Új" msgstr "Új"
@@ -448,9 +448,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Nincs kiválasztva" msgstr "Nincs kiválasztva"
msgid "Off"
msgstr "Ki"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "%d által elavult" msgstr "%d által elavult"
@@ -476,13 +473,13 @@ msgid "Paused"
msgstr "Szüneteltetve" msgstr "Szüneteltetve"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "Teljes frissítést hajt végre?" msgstr "Teljes frissítést hajtasz végre?"
msgid "Pins" msgid "Pins"
msgstr "Kimenetek" msgstr "Kimenetek"
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "Fordítsa újra és frissítse a mikrovezérlőt." msgstr "Fordítsd újra és frissítsd a mikrovezérlőt."
msgid "Power" msgid "Power"
msgstr "Bekapcsolás" msgstr "Bekapcsolás"
@@ -502,9 +499,15 @@ msgstr "Nyomtatásvezérlés"
msgid "Print Time" msgid "Print Time"
msgstr "Nyomtatási idő" msgstr "Nyomtatási idő"
msgid "Printer"
msgstr "Nyomtató"
msgid "Printer Connections" msgid "Printer Connections"
msgstr "Nyomtató csatlakozások" msgstr "Nyomtató csatlakozások"
msgid "Printer Select"
msgstr "Nyomtató kiválasztása"
msgid "Printing" msgid "Printing"
msgstr "Nyomtatás" msgstr "Nyomtatás"
@@ -550,6 +553,9 @@ msgstr "Visszahúzási hossz"
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "Visszahúzási sebesség" msgstr "Visszahúzási sebesség"
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Újra #%s" msgstr "Újra #%s"
@@ -567,7 +573,7 @@ msgid "Save Z"
msgstr "Z mentése" msgstr "Z mentése"
msgid "Save configuration?" msgid "Save configuration?"
msgstr "Menti a konfigurációt?" msgstr "Mented a konfigurációt?"
msgid "Saved" msgid "Saved"
msgstr "Mentve" msgstr "Mentve"
@@ -604,6 +610,12 @@ msgstr "Beállítások"
msgid "Show" msgid "Show"
msgstr "Mutat" msgstr "Mutat"
msgid "Show Heater Power"
msgstr "A fűtésteljesítmény megjelenítése"
msgid "Shutdown"
msgstr "Leállítás"
msgid "Size" msgid "Size"
msgstr "Méret" msgstr "Méret"
@@ -619,9 +631,6 @@ msgstr "Szeletelő:"
msgid "Small" msgid "Small"
msgstr "Kicsi" msgstr "Kicsi"
msgid "Sort by: "
msgstr "Sorrend: "
msgid "Sort:" msgid "Sort:"
msgstr "Fajta:" msgstr "Fajta:"
@@ -701,9 +710,6 @@ msgstr "Frissítés"
msgid "Uploaded" msgid "Uploaded"
msgstr "Feltöltve" msgstr "Feltöltve"
msgid "View Mesh"
msgstr "Háló nézet"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -768,6 +774,24 @@ msgstr "mm/s"
msgid "mm/s²" msgid "mm/s²"
msgstr "mm/s²" msgstr "mm/s²"
#~ msgid "Delete"
#~ msgstr "Töröl"
#~ msgid "Home"
#~ msgstr "Kezdőpontok"
#~ msgid "Off"
#~ msgstr "Ki"
#~ msgid "View Mesh"
#~ msgstr "Háló nézet"
#~ msgid "Machine"
#~ msgstr "Gép"
#~ msgid "Sort by: "
#~ msgstr "Sorrend: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "A Bltouch alkalmazott eltolást talált" #~ msgstr "A Bltouch alkalmazott eltolást talált"
Binary file not shown.
@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KlipperScreen\n" "Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: pappicio\n" "Last-Translator: pappicio\n"
"Language-Team: \n" "Language-Team: \n"
@@ -58,6 +58,9 @@ msgstr ""
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "" msgstr ""
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "Sei sicuro di voler eseguire l'arresto di emergenza?" msgstr "Sei sicuro di voler eseguire l'arresto di emergenza?"
@@ -173,9 +176,6 @@ msgstr "Data"
msgid "Decrease" msgid "Decrease"
msgstr "Diminuisci" msgstr "Diminuisci"
msgid "Delete"
msgstr "Elimina"
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr ""
@@ -282,9 +282,6 @@ msgstr "Nascondi sensori in Temp."
msgid "Hide temp." msgid "Hide temp."
msgstr "" msgstr ""
msgid "Home"
msgstr "Inizio"
msgid "Home All" msgid "Home All"
msgstr "Home XYZ" msgstr "Home XYZ"
@@ -378,9 +375,6 @@ msgstr "Carica"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "Abbassa ugello" msgstr "Abbassa ugello"
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "Macros sulla barra laterale" msgstr "Macros sulla barra laterale"
@@ -417,6 +411,9 @@ msgstr "Medio"
msgid "Menu" msgid "Menu"
msgstr "Menù" msgstr "Menù"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "Modificato" msgstr "Modificato"
@@ -435,6 +432,9 @@ msgstr "Nome"
msgid "Network" msgid "Network"
msgstr "Rete" msgstr "Rete"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "" msgstr ""
@@ -446,9 +446,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Niente selezionato" msgstr "Niente selezionato"
msgid "Off"
msgstr "Off"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "Obsoleto di %d" msgstr "Obsoleto di %d"
@@ -500,9 +497,15 @@ msgstr "Controllo Stampa"
msgid "Print Time" msgid "Print Time"
msgstr "Tempo di Stampa" msgstr "Tempo di Stampa"
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "Connessioni Stampante" msgstr "Connessioni Stampante"
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "In Stampa" msgstr "In Stampa"
@@ -548,6 +551,9 @@ msgstr ""
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "" msgstr ""
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Riprova #%s" msgstr "Riprova #%s"
@@ -602,6 +608,12 @@ msgstr "Impostazioni"
msgid "Show" msgid "Show"
msgstr "Mostrare" msgstr "Mostrare"
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "Grandezza" msgstr "Grandezza"
@@ -617,9 +629,6 @@ msgstr ""
msgid "Small" msgid "Small"
msgstr "Piccola" msgstr "Piccola"
msgid "Sort by: "
msgstr "Ordine: "
msgid "Sort:" msgid "Sort:"
msgstr "" msgstr ""
@@ -699,9 +708,6 @@ msgstr "In aggiornamento"
msgid "Uploaded" msgid "Uploaded"
msgstr "Caricato" msgstr "Caricato"
msgid "View Mesh"
msgstr "Visual. Mesh"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -766,6 +772,21 @@ msgstr "mm/s"
msgid "mm/s²" msgid "mm/s²"
msgstr "mm/s²" msgstr "mm/s²"
#~ msgid "Delete"
#~ msgstr "Elimina"
#~ msgid "Home"
#~ msgstr "Inizio"
#~ msgid "Off"
#~ msgstr "Off"
#~ msgid "View Mesh"
#~ msgstr "Visual. Mesh"
#~ msgid "Sort by: "
#~ msgstr "Ordine: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Bltouch ha trovato l'offset applicato" #~ msgstr "Bltouch ha trovato l'offset applicato"
@@ -794,9 +815,6 @@ msgstr "mm/s²"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Unknown Heater "
#~ msgstr "Riscaldatore sconosciuto "
#~ msgid "Disconnect" #~ msgid "Disconnect"
#~ msgstr "Sconnetti" #~ msgstr "Sconnetti"
@@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KlipperScreen\n" "Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: NSteven\n" "Last-Translator: NSteven\n"
"Language-Team: NSteven\n" "Language-Team: NSteven\n"
@@ -58,6 +58,9 @@ msgstr "엔드스탑 높이 기준을 %.2f 높이의 옵셋으로 설정 하시
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "프로브 높이 기준을 %s%.2f 높이의 옵셋으로 설정 하시겠습니까?" msgstr "프로브 높이 기준을 %s%.2f 높이의 옵셋으로 설정 하시겠습니까?"
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "비상정지 시킬까요?" msgstr "비상정지 시킬까요?"
@@ -173,9 +176,6 @@ msgstr "날짜"
msgid "Decrease" msgid "Decrease"
msgstr "낮추기" msgstr "낮추기"
msgid "Delete"
msgstr "삭제"
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr ""
@@ -282,9 +282,6 @@ msgstr "온도 섹션에서 센서 항목 숨김."
msgid "Hide temp." msgid "Hide temp."
msgstr "온도 숨김" msgstr "온도 숨김"
msgid "Home"
msgstr "홈"
msgid "Home All" msgid "Home All"
msgstr "전체 홈" msgstr "전체 홈"
@@ -378,9 +375,6 @@ msgstr "필라 넣기"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "노즐 낮춤" msgstr "노즐 낮춤"
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "사이드바에 매크로 아이콘 표시" msgstr "사이드바에 매크로 아이콘 표시"
@@ -417,6 +411,9 @@ msgstr "중간"
msgid "Menu" msgid "Menu"
msgstr "메뉴" msgstr "메뉴"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "수정됨" msgstr "수정됨"
@@ -435,6 +432,9 @@ msgstr "이름"
msgid "Network" msgid "Network"
msgstr "네트워크" msgstr "네트워크"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "신규" msgstr "신규"
@@ -446,9 +446,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "아무것도 선택하지 않ㅇ" msgstr "아무것도 선택하지 않ㅇ"
msgid "Off"
msgstr "끄기"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "%d 보다 오래됨" msgstr "%d 보다 오래됨"
@@ -499,9 +496,15 @@ msgstr "출력 제어"
msgid "Print Time" msgid "Print Time"
msgstr "출력 시간" msgstr "출력 시간"
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "프린터 연결" msgstr "프린터 연결"
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "출력중" msgstr "출력중"
@@ -547,6 +550,9 @@ msgstr "퇴추 길이"
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "퇴출 속도" msgstr "퇴출 속도"
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "재시도 #%s" msgstr "재시도 #%s"
@@ -601,6 +607,12 @@ msgstr "설정"
msgid "Show" msgid "Show"
msgstr "보기" msgstr "보기"
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "크기" msgstr "크기"
@@ -616,9 +628,6 @@ msgstr "슬라이서:"
msgid "Small" msgid "Small"
msgstr "작은" msgstr "작은"
msgid "Sort by: "
msgstr "분류 기준: "
msgid "Sort:" msgid "Sort:"
msgstr "종류:" msgstr "종류:"
@@ -698,9 +707,6 @@ msgstr "업데이트 중.."
msgid "Uploaded" msgid "Uploaded"
msgstr "업로드됨" msgstr "업로드됨"
msgid "View Mesh"
msgstr "메쉬 프로파일 보기"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -763,6 +769,21 @@ msgstr "mm/s"
msgid "mm/s²" msgid "mm/s²"
msgstr "mm/s²" msgstr "mm/s²"
#~ msgid "Delete"
#~ msgstr "삭제"
#~ msgid "Home"
#~ msgstr "홈"
#~ msgid "Off"
#~ msgstr "끄기"
#~ msgid "View Mesh"
#~ msgstr "메쉬 프로파일 보기"
#~ msgid "Sort by: "
#~ msgstr "분류 기준: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Bltouch가 적용된 오프셋" #~ msgstr "Bltouch가 적용된 오프셋"
@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KlipperScreen\n" "Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: 2022-03-31 11:06-0300\n" "PO-Revision-Date: 2022-03-31 11:06-0300\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@@ -64,6 +64,9 @@ msgstr ""
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "" msgstr ""
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "Czy na pewno chcesz Awaryjnie Zatrzymać?" msgstr "Czy na pewno chcesz Awaryjnie Zatrzymać?"
@@ -179,9 +182,6 @@ msgstr "Data"
msgid "Decrease" msgid "Decrease"
msgstr "Obniż" msgstr "Obniż"
msgid "Delete"
msgstr "Skasuj"
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr ""
@@ -288,9 +288,6 @@ msgstr "Ukryj czujniki w Temp."
msgid "Hide temp." msgid "Hide temp."
msgstr "" msgstr ""
msgid "Home"
msgstr "Baza"
msgid "Home All" msgid "Home All"
msgstr "Baza Wszystkich" msgstr "Baza Wszystkich"
@@ -384,9 +381,6 @@ msgstr "Ładuj"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "Obniż dyszę" msgstr "Obniż dyszę"
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "Skrót do makr na pasku bocznym" msgstr "Skrót do makr na pasku bocznym"
@@ -423,6 +417,9 @@ msgstr "Średni"
msgid "Menu" msgid "Menu"
msgstr "Menu" msgstr "Menu"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "Zmodyfikowane" msgstr "Zmodyfikowane"
@@ -441,6 +438,9 @@ msgstr "Nazwa"
msgid "Network" msgid "Network"
msgstr "Sieć" msgstr "Sieć"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "" msgstr ""
@@ -452,9 +452,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Nic nie wybrano" msgstr "Nic nie wybrano"
msgid "Off"
msgstr "Wyłącz"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "Nieaktualne przez %d" msgstr "Nieaktualne przez %d"
@@ -507,9 +504,15 @@ msgstr "Kontrola Druku"
msgid "Print Time" msgid "Print Time"
msgstr "Czas Druku" msgstr "Czas Druku"
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "Połączenia Drukarki" msgstr "Połączenia Drukarki"
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "Drukujemy" msgstr "Drukujemy"
@@ -555,6 +558,9 @@ msgstr ""
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "" msgstr ""
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Spróbuj ponownie #%s" msgstr "Spróbuj ponownie #%s"
@@ -609,6 +615,12 @@ msgstr "Ustawienia"
msgid "Show" msgid "Show"
msgstr "Pokaż" msgstr "Pokaż"
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "Rozmiar" msgstr "Rozmiar"
@@ -624,9 +636,6 @@ msgstr ""
msgid "Small" msgid "Small"
msgstr "Mały" msgstr "Mały"
msgid "Sort by: "
msgstr "Sortuj wg: "
msgid "Sort:" msgid "Sort:"
msgstr "" msgstr ""
@@ -706,9 +715,6 @@ msgstr "Aktualizacja"
msgid "Uploaded" msgid "Uploaded"
msgstr "Przesłane" msgstr "Przesłane"
msgid "View Mesh"
msgstr "Wyświetl siatkę"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -775,6 +781,21 @@ msgstr "mm/s²"
msgid "mm/s²" msgid "mm/s²"
msgstr "mm/s²" msgstr "mm/s²"
#~ msgid "Delete"
#~ msgstr "Skasuj"
#~ msgid "Home"
#~ msgstr "Baza"
#~ msgid "Off"
#~ msgstr "Wyłącz"
#~ msgid "View Mesh"
#~ msgstr "Wyświetl siatkę"
#~ msgid "Sort by: "
#~ msgstr "Sortuj wg: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Bltouch znalazł zastosowane przesunięcie" #~ msgstr "Bltouch znalazł zastosowane przesunięcie"
@@ -803,9 +824,6 @@ msgstr "mm/s²"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Unknown Heater "
#~ msgstr "Nieznany Podgrzewacz "
#~ msgid "Disconnect" #~ msgid "Disconnect"
#~ msgstr "Rozłącz" #~ msgstr "Rozłącz"
@@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KlipperScreen\n" "Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: 2022-06-03 20:25-0500\n" "PO-Revision-Date: 2022-06-03 20:25-0500\n"
"Last-Translator: Jakob Kais <schpuntik@freenet.de>\n" "Last-Translator: Jakob Kais <schpuntik@freenet.de>\n"
"Language-Team: \n" "Language-Team: \n"
@@ -14,8 +14,8 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" "n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
"X-Generator: Poedit 3.0.1\n" "X-Generator: Poedit 3.0.1\n"
"X-Poedit-Flags-xgettext: --add-comments\n" "X-Poedit-Flags-xgettext: --add-comments\n"
@@ -64,6 +64,9 @@ msgstr "Применить смещение %.2f к Endstop?"
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "Применить смещение %s%.2f к зонду?" msgstr "Применить смещение %s%.2f к зонду?"
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "Вы уверены, что хотите запустить аварийную остановку?" msgstr "Вы уверены, что хотите запустить аварийную остановку?"
@@ -179,9 +182,6 @@ msgstr "Дата"
msgid "Decrease" msgid "Decrease"
msgstr "Уменьшить" msgstr "Уменьшить"
msgid "Delete"
msgstr "Удалить"
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr ""
@@ -288,9 +288,6 @@ msgstr "Скрыть датчики в Temp."
msgid "Hide temp." msgid "Hide temp."
msgstr "Скрыть температуру." msgstr "Скрыть температуру."
msgid "Home"
msgstr "Парковка"
msgid "Home All" msgid "Home All"
msgstr "Парковать все" msgstr "Парковать все"
@@ -384,9 +381,6 @@ msgstr "Загрузить"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "Опустить сопло" msgstr "Опустить сопло"
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "Показать макросы в панели" msgstr "Показать макросы в панели"
@@ -423,6 +417,9 @@ msgstr "Среднее"
msgid "Menu" msgid "Menu"
msgstr "Меню" msgstr "Меню"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "Изменено" msgstr "Изменено"
@@ -441,6 +438,9 @@ msgstr "Имя"
msgid "Network" msgid "Network"
msgstr "Сеть" msgstr "Сеть"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "Новый" msgstr "Новый"
@@ -452,9 +452,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Ничего не выбрано" msgstr "Ничего не выбрано"
msgid "Off"
msgstr "Выкл"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "Устарело на %d" msgstr "Устарело на %d"
@@ -507,9 +504,15 @@ msgstr "Управление печатью"
msgid "Print Time" msgid "Print Time"
msgstr "Время печати" msgstr "Время печати"
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "Подключение принтера" msgstr "Подключение принтера"
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "Печатается" msgstr "Печатается"
@@ -555,6 +558,9 @@ msgstr "Длина ретракта"
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "Скорость ретракта" msgstr "Скорость ретракта"
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Повторить #%s" msgstr "Повторить #%s"
@@ -609,6 +615,12 @@ msgstr "Настройки"
msgid "Show" msgid "Show"
msgstr "Показывать" msgstr "Показывать"
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "Размер" msgstr "Размер"
@@ -624,9 +636,6 @@ msgstr ""
msgid "Small" msgid "Small"
msgstr "Маленький" msgstr "Маленький"
msgid "Sort by: "
msgstr "Орден: "
msgid "Sort:" msgid "Sort:"
msgstr "Сортировать:" msgstr "Сортировать:"
@@ -706,9 +715,6 @@ msgstr "Обновление"
msgid "Uploaded" msgid "Uploaded"
msgstr "Дата" msgstr "Дата"
msgid "View Mesh"
msgstr "Смотреть сетку"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -775,6 +781,21 @@ msgstr "мм/с"
msgid "mm/s²" msgid "mm/s²"
msgstr "мм/с²" msgstr "мм/с²"
#~ msgid "Delete"
#~ msgstr "Удалить"
#~ msgid "Home"
#~ msgstr "Парковка"
#~ msgid "Off"
#~ msgstr "Выкл"
#~ msgid "View Mesh"
#~ msgstr "Смотреть сетку"
#~ msgid "Sort by: "
#~ msgstr "Орден: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Bltouch обнаружил примененное смещение" #~ msgstr "Bltouch обнаружил примененное смещение"
@@ -803,9 +824,6 @@ msgstr "мм/с²"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Unknown Heater "
#~ msgstr "Неизвестный обогреватель "
#~ msgid "Disconnect" #~ msgid "Disconnect"
#~ msgstr "Отключить" #~ msgstr "Отключить"
@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: 2022-04-15 17:25+0200\n" "PO-Revision-Date: 2022-04-15 17:25+0200\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@@ -63,6 +63,9 @@ msgstr ""
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "" msgstr ""
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "Är du säker på att du vill köra Nödstopp?" msgstr "Är du säker på att du vill köra Nödstopp?"
@@ -178,9 +181,6 @@ msgstr "Datum"
msgid "Decrease" msgid "Decrease"
msgstr "Minska" msgstr "Minska"
msgid "Delete"
msgstr "Radera"
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr ""
@@ -287,9 +287,6 @@ msgstr "Dölj sensorer i Temp."
msgid "Hide temp." msgid "Hide temp."
msgstr "" msgstr ""
msgid "Home"
msgstr "Hem"
msgid "Home All" msgid "Home All"
msgstr "Hem Alla" msgstr "Hem Alla"
@@ -383,9 +380,6 @@ msgstr "Ladda"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "Sänk munstycket" msgstr "Sänk munstycket"
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "Makro genväg på sidofältet" msgstr "Makro genväg på sidofältet"
@@ -422,6 +416,9 @@ msgstr "Medium"
msgid "Menu" msgid "Menu"
msgstr "Meny" msgstr "Meny"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "Ändrad" msgstr "Ändrad"
@@ -440,6 +437,9 @@ msgstr "Namn"
msgid "Network" msgid "Network"
msgstr "Nätverk" msgstr "Nätverk"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "" msgstr ""
@@ -451,9 +451,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Inget valt" msgstr "Inget valt"
msgid "Off"
msgstr "Avstängd"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "" msgstr ""
@@ -505,9 +502,15 @@ msgstr "Utskriftskontroll"
msgid "Print Time" msgid "Print Time"
msgstr "" msgstr ""
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "" msgstr ""
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "Skriver ut" msgstr "Skriver ut"
@@ -553,6 +556,9 @@ msgstr ""
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "" msgstr ""
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "" msgstr ""
@@ -607,6 +613,12 @@ msgstr "Inställningar"
msgid "Show" msgid "Show"
msgstr "Visa" msgstr "Visa"
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "Storlek" msgstr "Storlek"
@@ -622,9 +634,6 @@ msgstr ""
msgid "Small" msgid "Small"
msgstr "Liten" msgstr "Liten"
msgid "Sort by: "
msgstr "Sortera efter: "
msgid "Sort:" msgid "Sort:"
msgstr "" msgstr ""
@@ -704,9 +713,6 @@ msgstr "Uppdaterar"
msgid "Uploaded" msgid "Uploaded"
msgstr "Uppladdad" msgstr "Uppladdad"
msgid "View Mesh"
msgstr ""
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -771,6 +777,18 @@ msgstr "mm/s"
msgid "mm/s²" msgid "mm/s²"
msgstr "mm/s²" msgstr "mm/s²"
#~ msgid "Delete"
#~ msgstr "Radera"
#~ msgid "Home"
#~ msgstr "Hem"
#~ msgid "Off"
#~ msgstr "Avstängd"
#~ msgid "Sort by: "
#~ msgstr "Sortera efter: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Bltouch hittade tillämpad offset" #~ msgstr "Bltouch hittade tillämpad offset"
@@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: 2022-09-21 19:32+0300\n" "PO-Revision-Date: 2022-10-30 16:54+0300\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: tr_TR\n" "Language: tr_TR\n"
@@ -63,6 +63,9 @@ msgstr "Sonlandırıcı için %.2f ofset uygula?"
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "Prob için %s%.2f ofset uygula?" msgstr "Prob için %s%.2f ofset uygula?"
msgid "Are you sure do you want to exclude the object?"
msgstr "Nesneyi hariç tutmak istediğinizden emin misiniz?"
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "Acil Durdurma'yı çalıştırmak istediğinizden emin misiniz?" msgstr "Acil Durdurma'yı çalıştırmak istediğinizden emin misiniz?"
@@ -178,9 +181,6 @@ msgstr "Tarih"
msgid "Decrease" msgid "Decrease"
msgstr "Azalt" msgstr "Azalt"
msgid "Delete"
msgstr "Sil"
msgid "Delete File?" msgid "Delete File?"
msgstr "Dosyayı Sil?" msgstr "Dosyayı Sil?"
@@ -287,9 +287,6 @@ msgstr "Sıcaklıktaki sensörleri gizleyin."
msgid "Hide temp." msgid "Hide temp."
msgstr "Sıcaklığı gizle." msgstr "Sıcaklığı gizle."
msgid "Home"
msgstr "Ana Ekran"
msgid "Home All" msgid "Home All"
msgstr "Eksenleri Sıfırla" msgstr "Eksenleri Sıfırla"
@@ -383,9 +380,6 @@ msgstr "Yükle"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "Nozzle düşür" msgstr "Nozzle düşür"
msgid "Machine"
msgstr "Makine"
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "Kenar çubuğunda makro kısayolu" msgstr "Kenar çubuğunda makro kısayolu"
@@ -422,6 +416,9 @@ msgstr "Orta"
msgid "Menu" msgid "Menu"
msgstr "Menü" msgstr "Menü"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "Değiştirilmiş" msgstr "Değiştirilmiş"
@@ -440,6 +437,9 @@ msgstr "İsim"
msgid "Network" msgid "Network"
msgstr "Ağ" msgstr "Ağ"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "Yeni" msgstr "Yeni"
@@ -453,9 +453,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Hiçbir şey seçilmedi" msgstr "Hiçbir şey seçilmedi"
msgid "Off"
msgstr "Kapa"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "Güncelliğini yitiren %d" msgstr "Güncelliğini yitiren %d"
@@ -507,9 +504,15 @@ msgstr "Yazdırma Kontrolü"
msgid "Print Time" msgid "Print Time"
msgstr "Yazdırma Süresi" msgstr "Yazdırma Süresi"
msgid "Printer"
msgstr "Yazıcı"
msgid "Printer Connections" msgid "Printer Connections"
msgstr "Yazıcı Bağlantıları" msgstr "Yazıcı Bağlantıları"
msgid "Printer Select"
msgstr "Yazıcı Seçimi"
msgid "Printing" msgid "Printing"
msgstr "Yazdırılıyor" msgstr "Yazdırılıyor"
@@ -555,6 +558,9 @@ msgstr "Geri Çekme Uzunluğu"
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "Geri Çekme Hızı" msgstr "Geri Çekme Hızı"
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Yeniden Dene #%s" msgstr "Yeniden Dene #%s"
@@ -609,6 +615,12 @@ msgstr "Ayarlar"
msgid "Show" msgid "Show"
msgstr "Göster" msgstr "Göster"
msgid "Show Heater Power"
msgstr "Isıtıcı Gücünü Göster"
msgid "Shutdown"
msgstr "Kapat"
msgid "Size" msgid "Size"
msgstr "Boyut" msgstr "Boyut"
@@ -624,9 +636,6 @@ msgstr "Dilimleyici:"
msgid "Small" msgid "Small"
msgstr "Küçük" msgstr "Küçük"
msgid "Sort by: "
msgstr "Sırala: "
msgid "Sort:" msgid "Sort:"
msgstr "Sırala:" msgstr "Sırala:"
@@ -706,9 +715,6 @@ msgstr "Yükleniyor"
msgid "Uploaded" msgid "Uploaded"
msgstr "Yüklendi" msgstr "Yüklendi"
msgid "View Mesh"
msgstr "Örgüyü Görüntüle"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -773,6 +779,24 @@ msgstr "mm/s"
msgid "mm/s²" msgid "mm/s²"
msgstr "mm/s²" msgstr "mm/s²"
#~ msgid "Delete"
#~ msgstr "Sil"
#~ msgid "Home"
#~ msgstr "Ana Ekran"
#~ msgid "Off"
#~ msgstr "Kapa"
#~ msgid "View Mesh"
#~ msgstr "Örgüyü Görüntüle"
#~ msgid "Machine"
#~ msgstr "Makine"
#~ msgid "Sort by: "
#~ msgstr "Sırala: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Bltouch uygulanmış ofseti buldu" #~ msgstr "Bltouch uygulanmış ofseti buldu"
@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: 2022-09-04 14:53-0300\n" "Project-Id-Version: 2022-09-04 14:53-0300\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-09-04 13:01+0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: 2022-09-16 21:40+0300\n" "PO-Revision-Date: 2022-09-16 21:40+0300\n"
"Last-Translator: Andrii Komarovskyi\n" "Last-Translator: Andrii Komarovskyi\n"
"Language-Team: Andrii Komarovskyi\n" "Language-Team: Andrii Komarovskyi\n"
@@ -15,8 +15,8 @@ msgstr ""
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && "
"%100<12 || n%100>14) ? 1 : 2);\n" "n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
"X-Generator: Poedit 3.1\n" "X-Generator: Poedit 3.1\n"
#, python-format #, python-format
@@ -64,6 +64,9 @@ msgstr "Застосувати зміщення %.2f до кінцевика?"
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "Застосувати зміщення %s%.2f до зонда?" msgstr "Застосувати зміщення %s%.2f до зонда?"
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "Ви впевнені, що хочете зробити аварійну зупинку?" msgstr "Ви впевнені, що хочете зробити аварійну зупинку?"
@@ -179,9 +182,6 @@ msgstr "Дата"
msgid "Decrease" msgid "Decrease"
msgstr "Зменшити" msgstr "Зменшити"
msgid "Delete"
msgstr "Видалити"
msgid "Delete File?" msgid "Delete File?"
msgstr "Видалити файл?" msgstr "Видалити файл?"
@@ -292,9 +292,6 @@ msgstr "Сховати датчик t°."
msgid "Hide temp." msgid "Hide temp."
msgstr "Приховати темп." msgstr "Приховати темп."
msgid "Home"
msgstr "Домашня сторінка"
msgid "Home All" msgid "Home All"
msgstr "Дім Всі" msgstr "Дім Всі"
@@ -390,9 +387,6 @@ msgstr "Завантажити"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "Опустити сопло" msgstr "Опустити сопло"
msgid "Machine"
msgstr "Машина"
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "Ярлик макросу на бічній панелі" msgstr "Ярлик макросу на бічній панелі"
@@ -429,6 +423,9 @@ msgstr "Середній"
msgid "Menu" msgid "Menu"
msgstr "Меню" msgstr "Меню"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "Змінено" msgstr "Змінено"
@@ -447,19 +444,22 @@ msgstr "Ім'я"
msgid "Network" msgid "Network"
msgstr "Сітка" msgstr "Сітка"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "Новий" msgstr "Новий"
msgid "Not supported for auto-detection, it needs to be configured in klipperscreen.conf" msgid ""
"Not supported for auto-detection, it needs to be configured in klipperscreen."
"conf"
msgstr "" msgstr ""
"Автоматичне визначення не підтримується, його потрібно налаштувати у klipperscreen.conf" "Автоматичне визначення не підтримується, його потрібно налаштувати у "
"klipperscreen.conf"
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Не обрано" msgstr "Не обрано"
msgid "Off"
msgstr "Вимк"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "Застаріло на %d" msgstr "Застаріло на %d"
@@ -514,9 +514,15 @@ msgstr "Контроль друку"
msgid "Print Time" msgid "Print Time"
msgstr "Час друку" msgstr "Час друку"
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "Підключення принтера" msgstr "Підключення принтера"
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "Друк" msgstr "Друк"
@@ -564,6 +570,9 @@ msgstr "Довжина втягування"
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "Швидкість втягування" msgstr "Швидкість втягування"
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Повторіть #%s" msgstr "Повторіть #%s"
@@ -618,6 +627,12 @@ msgstr "Налаштування"
msgid "Show" msgid "Show"
msgstr "Показати" msgstr "Показати"
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "Розмір" msgstr "Розмір"
@@ -633,9 +648,6 @@ msgstr "Слайсер:"
msgid "Small" msgid "Small"
msgstr "Малий" msgstr "Малий"
msgid "Sort by: "
msgstr "Сортувати за: "
msgid "Sort:" msgid "Sort:"
msgstr "Сортувати:" msgstr "Сортувати:"
@@ -715,9 +727,6 @@ msgstr "Оновлення"
msgid "Uploaded" msgid "Uploaded"
msgstr "Завантажено" msgstr "Завантажено"
msgid "View Mesh"
msgstr "Показати сітку"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -784,11 +793,31 @@ msgstr "мм/с"
msgid "mm/s²" msgid "mm/s²"
msgstr "мм/с²" msgstr "мм/с²"
msgid "Auto Calibration" #~ msgid "Delete"
msgstr "Автоматичне калібрування" #~ msgstr "Видалити"
msgid "Manual Calibration" #~ msgid "Home"
msgstr "Ручне калібрування" #~ msgstr "Домашня сторінка"
msgid "NOTE: Edit your printer.cfg to save manual calibration changes." #~ msgid "Off"
msgstr "ПРИМІТКА. Відредагуйте файл printer.cfg, щоб зберегти зміни калібрування вручну." #~ msgstr "Вимк"
#~ msgid "View Mesh"
#~ msgstr "Показати сітку"
#~ msgid "Machine"
#~ msgstr "Машина"
#~ msgid "Sort by: "
#~ msgstr "Сортувати за: "
#~ msgid "Auto Calibration"
#~ msgstr "Автоматичне калібрування"
#~ msgid "Manual Calibration"
#~ msgstr "Ручне калібрування"
#~ msgid "NOTE: Edit your printer.cfg to save manual calibration changes."
#~ msgstr ""
#~ "ПРИМІТКА. Відредагуйте файл printer.cfg, щоб зберегти зміни калібрування "
#~ "вручну."
@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KlipperScreen\n" "Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: 2022-07-16 23:03+0800\n" "PO-Revision-Date: 2022-07-16 23:03+0800\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@@ -63,6 +63,9 @@ msgstr "对Endstop应用%.2f的偏移量?"
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "将%s%.2f的偏移量应用于探针?" msgstr "将%s%.2f的偏移量应用于探针?"
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "您确定要紧急停止吗?" msgstr "您确定要紧急停止吗?"
@@ -178,9 +181,6 @@ msgstr "日期"
msgid "Decrease" msgid "Decrease"
msgstr "减少" msgstr "减少"
msgid "Delete"
msgstr "删除"
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr ""
@@ -287,9 +287,6 @@ msgstr "隐藏温度传感器。"
msgid "Hide temp." msgid "Hide temp."
msgstr "隐藏温度。" msgstr "隐藏温度。"
msgid "Home"
msgstr "首页"
msgid "Home All" msgid "Home All"
msgstr "全部归零" msgstr "全部归零"
@@ -383,9 +380,6 @@ msgstr "载入耗材"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "降低喷嘴" msgstr "降低喷嘴"
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "显示侧边栏宏快捷方式" msgstr "显示侧边栏宏快捷方式"
@@ -422,6 +416,9 @@ msgstr "中"
msgid "Menu" msgid "Menu"
msgstr "菜单" msgstr "菜单"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "修改时间" msgstr "修改时间"
@@ -440,6 +437,9 @@ msgstr "文件名称"
msgid "Network" msgid "Network"
msgstr "网络" msgstr "网络"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "" msgstr ""
@@ -451,9 +451,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "未选择任何内容" msgstr "未选择任何内容"
msgid "Off"
msgstr "关闭"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "已过时 %d" msgstr "已过时 %d"
@@ -504,9 +501,15 @@ msgstr "打印控制"
msgid "Print Time" msgid "Print Time"
msgstr "打印用时" msgstr "打印用时"
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "龙门架调平" msgstr "龙门架调平"
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "打印中" msgstr "打印中"
@@ -552,6 +555,9 @@ msgstr "回抽长度"
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "回抽速度" msgstr "回抽速度"
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "重试 #%s" msgstr "重试 #%s"
@@ -606,6 +612,12 @@ msgstr "设置"
msgid "Show" msgid "Show"
msgstr "显示" msgstr "显示"
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "大小" msgstr "大小"
@@ -621,9 +633,6 @@ msgstr "切片:"
msgid "Small" msgid "Small"
msgstr "小" msgstr "小"
msgid "Sort by: "
msgstr "排序: "
msgid "Sort:" msgid "Sort:"
msgstr "排序:" msgstr "排序:"
@@ -703,9 +712,6 @@ msgstr "更新中"
msgid "Uploaded" msgid "Uploaded"
msgstr "上传时间" msgstr "上传时间"
msgid "View Mesh"
msgstr "查看热床网格"
msgid "X+" msgid "X+"
msgstr "" msgstr ""
@@ -768,6 +774,21 @@ msgstr ""
msgid "mm/s²" msgid "mm/s²"
msgstr "" msgstr ""
#~ msgid "Delete"
#~ msgstr "删除"
#~ msgid "Home"
#~ msgstr "首页"
#~ msgid "Off"
#~ msgstr "关闭"
#~ msgid "View Mesh"
#~ msgstr "查看热床网格"
#~ msgid "Sort by: "
#~ msgstr "排序: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Bltouch 发现应用的偏移量" #~ msgstr "Bltouch 发现应用的偏移量"
@@ -796,9 +817,6 @@ msgstr ""
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6 地址" #~ msgstr "IPv6 地址"
#~ msgid "Unknown Heater "
#~ msgstr "未知加热器 "
#~ msgid "Disconnect" #~ msgid "Disconnect"
#~ msgstr "断开" #~ msgstr "断开"
@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: KlipperScreen\n" "Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-18 23:05-0300\n" "POT-Creation-Date: 2022-11-12 11:20-0300\n"
"PO-Revision-Date: 2022-03-31 11:25-0300\n" "PO-Revision-Date: 2022-03-31 11:25-0300\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@@ -63,6 +63,9 @@ msgstr ""
msgid "Apply %s%.2f offset to Probe?" msgid "Apply %s%.2f offset to Probe?"
msgstr "" msgstr ""
msgid "Are you sure do you want to exclude the object?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "您確定要運行緊急停止嗎?" msgstr "您確定要運行緊急停止嗎?"
@@ -178,9 +181,6 @@ msgstr "日期"
msgid "Decrease" msgid "Decrease"
msgstr "減少" msgstr "減少"
msgid "Delete"
msgstr "刪除"
msgid "Delete File?" msgid "Delete File?"
msgstr "" msgstr ""
@@ -287,9 +287,6 @@ msgstr "在溫度中隱藏傳感器。"
msgid "Hide temp." msgid "Hide temp."
msgstr "" msgstr ""
msgid "Home"
msgstr "首頁"
msgid "Home All" msgid "Home All"
msgstr "歸零全部" msgstr "歸零全部"
@@ -383,9 +380,6 @@ msgstr "載入"
msgid "Lower Nozzle" msgid "Lower Nozzle"
msgstr "降低噴嘴" msgstr "降低噴嘴"
msgid "Machine"
msgstr ""
msgid "Macro shortcut on sidebar" msgid "Macro shortcut on sidebar"
msgstr "在側邊欄上顯示巨集快捷鍵" msgstr "在側邊欄上顯示巨集快捷鍵"
@@ -422,6 +416,9 @@ msgstr "中"
msgid "Menu" msgid "Menu"
msgstr "選單" msgstr "選單"
msgid "Mesh calibrate"
msgstr ""
msgid "Modified" msgid "Modified"
msgstr "修改" msgstr "修改"
@@ -440,6 +437,9 @@ msgstr "名稱"
msgid "Network" msgid "Network"
msgstr "網路" msgstr "網路"
msgid "Never"
msgstr ""
msgid "New" msgid "New"
msgstr "" msgstr ""
@@ -451,9 +451,6 @@ msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "未選擇任何內容" msgstr "未選擇任何內容"
msgid "Off"
msgstr "關閉"
#, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "已過時 %d" msgstr "已過時 %d"
@@ -504,9 +501,15 @@ msgstr "列印控制"
msgid "Print Time" msgid "Print Time"
msgstr "列印時間" msgstr "列印時間"
msgid "Printer"
msgstr ""
msgid "Printer Connections" msgid "Printer Connections"
msgstr "連接列印機" msgstr "連接列印機"
msgid "Printer Select"
msgstr ""
msgid "Printing" msgid "Printing"
msgstr "列印中" msgstr "列印中"
@@ -552,6 +555,9 @@ msgstr ""
msgid "Retraction Speed" msgid "Retraction Speed"
msgstr "" msgstr ""
msgid "Retry"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "重試 #%s" msgstr "重試 #%s"
@@ -606,6 +612,12 @@ msgstr "設定"
msgid "Show" msgid "Show"
msgstr "展示" msgstr "展示"
msgid "Show Heater Power"
msgstr ""
msgid "Shutdown"
msgstr ""
msgid "Size" msgid "Size"
msgstr "大小" msgstr "大小"
@@ -621,9 +633,6 @@ msgstr ""
msgid "Small" msgid "Small"
msgstr "小的" msgstr "小的"
msgid "Sort by: "
msgstr "排序: "
msgid "Sort:" msgid "Sort:"
msgstr "" msgstr ""
@@ -703,9 +712,6 @@ msgstr "更新"
msgid "Uploaded" msgid "Uploaded"
msgstr "上傳時間" msgstr "上傳時間"
msgid "View Mesh"
msgstr "檢視網格"
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -768,6 +774,21 @@ msgstr "mm/s"
msgid "mm/s²" msgid "mm/s²"
msgstr "mm/s²" msgstr "mm/s²"
#~ msgid "Delete"
#~ msgstr "刪除"
#~ msgid "Home"
#~ msgstr "首頁"
#~ msgid "Off"
#~ msgstr "關閉"
#~ msgid "View Mesh"
#~ msgstr "檢視網格"
#~ msgid "Sort by: "
#~ msgstr "排序: "
#~ msgid "Bltouch found applied offset" #~ msgid "Bltouch found applied offset"
#~ msgstr "Bltouch 發現應用的偏移量" #~ msgstr "Bltouch 發現應用的偏移量"
@@ -796,9 +817,6 @@ msgstr "mm/s²"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Unknown Heater "
#~ msgstr "未知加熱器 "
#~ msgid "Disconnect" #~ msgid "Disconnect"
#~ msgstr "斷開" #~ msgstr "斷開"
+38 -116
View File
@@ -6,69 +6,51 @@ from gi.repository import Gdk, GLib
class Printer: class Printer:
def __init__(self, printer_info, data, state_execute_cb): def __init__(self, state_cb):
self.klipper = {"version": printer_info['software_version']}
self.tempstore = None
self.config = None self.config = None
self.data = None
self.state = "disconnected" self.state = "disconnected"
self.state_cb = state_execute_cb self.state_cb = state_cb
self.power_devices = {} self.state_callbacks = None
self.store_timeout = False
self.data = data
self.devices = {} self.devices = {}
self.power_devices = {} self.power_devices = {}
self.state_callbacks = {
"disconnected": None,
"error": None,
"paused": None,
"printing": None,
"ready": None,
"startup": None,
"shutdown": None
}
self.tools = [] self.tools = []
self.extrudercount = 0 self.extrudercount = 0
self.tempdevcount = 0 self.tempdevcount = 0
self.fancount = 0 self.fancount = 0
self.output_pin_count = 0 self.output_pin_count = 0
self.store_timeout = None
self.tempstore = {}
def reset(self): def reset(self):
GLib.source_remove(self.store_timeout) self.config = None
self.store_timeout = None self.data = None
self.state = None self.state = None
self.state_cb = None self.state_cb = None
self.data = None self.state_callbacks = None
self.devices = None self.devices = None
self.power_devices = None self.power_devices = None
self.state_callbacks = None
self.tools = None self.tools = None
self.extrudercount = None self.extrudercount = None
self.tempdevcount = None self.tempdevcount = None
self.fancount = None self.fancount = None
self.config = None
self.klipper = None
self.tempstore = None
self.output_pin_count = None self.output_pin_count = None
self.store_timeout = None
self.tempstore = None
def reinit(self, printer_info, data): def reinit(self, printer_info, data):
logging.debug(f"Moonraker object status: {data}")
self.config = data['configfile']['config'] self.config = data['configfile']['config']
self.data = data
self.devices = {}
self.tools = []
self.extrudercount = 0 self.extrudercount = 0
self.tempdevcount = 0 self.tempdevcount = 0
self.fancount = 0 self.fancount = 0
self.output_pin_count = 0 self.output_pin_count = 0
self.tools = []
self.devices = {}
self.data = data
self.klipper = {}
self.tempstore = {} self.tempstore = {}
if not self.store_timeout: if not self.store_timeout:
self.store_timeout = GLib.timeout_add_seconds(1, self._update_temp_store) self.store_timeout = GLib.timeout_add_seconds(1, self._update_temp_store)
self.klipper = {
"version": printer_info['software_version']
}
for x in self.config.keys(): for x in self.config.keys():
if x[:8] == "extruder": if x[:8] == "extruder":
self.tools.append(x) self.tools.append(x)
@@ -100,22 +82,11 @@ class Printer:
name = x.split()[1] if len(x.split()) > 1 else x name = x.split()[1] if len(x.split()) > 1 else x
if not name.startswith("_"): if not name.startswith("_"):
self.fancount += 1 self.fancount += 1
if x.startswith('output_pin '): if x.startswith('output_pin ') and not x.split()[1].startswith("_"):
# Support for hiding devices by name self.output_pin_count += 1
if not x.split()[1].startswith("_"):
self.output_pin_count += 1
if x.startswith('bed_mesh '):
r = self.config[x]
r['x_count'] = int(r['x_count'])
r['y_count'] = int(r['y_count'])
r['max_x'] = float(r['max_x'])
r['min_x'] = float(r['min_x'])
r['max_y'] = float(r['max_y'])
r['min_y'] = float(r['min_y'])
r['points'] = [[float(j.strip()) for j in i.split(",")] for i in r['points'].strip().split("\n")]
self.process_update(data) self.process_update(data)
logging.info(f"Klipper version: {self.klipper['version']}") logging.info(f"Klipper version: {printer_info['software_version']}")
logging.info(f"# Extruders: {self.extrudercount}") logging.info(f"# Extruders: {self.extrudercount}")
logging.info(f"# Temperature devices: {self.tempdevcount}") logging.info(f"# Temperature devices: {self.tempdevcount}")
logging.info(f"# Fans: {self.fancount}") logging.info(f"# Fans: {self.fancount}")
@@ -134,59 +105,37 @@ class Printer:
self.data[x] = {} self.data[x] = {}
self.data[x].update(data[x]) self.data[x].update(data[x])
if "webhooks" in data or "idle_timeout" in data or "print_stats" in data or "pause_resume" in data: if "webhooks" in data or "print_stats" in data:
self.evaluate_state() self.process_status_update()
def get_updates(self):
updates = self.data.copy()
updates.update(self.devices)
return updates
def evaluate_state(self): def evaluate_state(self):
wh_state = self.data['webhooks']['state'].lower() # possible values: startup, ready, shutdown, error # webhooks states: startup, ready, shutdown, error
# print_stats: standby, printing, paused, error, complete
if self.data['webhooks']['state'] == "ready" and self.data['print_stats']:
if self.data['print_stats']['state'] == 'paused' or self.data.get('pause_resume').get('is_paused'):
return "paused"
if self.data['print_stats']['state'] == 'printing':
return "printing"
return self.data['webhooks']['state']
if wh_state == "ready": def process_status_update(self):
new_state = "ready" state = self.evaluate_state()
if self.data['pause_resume']['is_paused']: if state != self.state:
new_state = "paused" self.change_state(state)
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"
if self.data['idle_timeout']:
idle_state = self.data['idle_timeout']['state'].lower() # idle, printing, ready
if idle_state == "printing":
if print_state == "complete":
new_state = "ready"
elif print_state != "printing": # Not printing a file, toolhead moving
new_state = "busy"
else:
new_state = "printing"
if new_state != "busy":
self.change_state(new_state)
else:
self.change_state(wh_state)
def process_power_update(self, data): def process_power_update(self, data):
if data['device'] in self.power_devices: if data['device'] in self.power_devices:
self.power_devices[data['device']]['status'] = data['status'] self.power_devices[data['device']]['status'] = data['status']
def change_state(self, state): def change_state(self, state):
if state == self.state or state not in list(self.state_callbacks): if state not in list(self.state_callbacks): # disconnected, startup, ready, shutdown, error, paused, printing
return return
if state != self.state:
logging.debug(f"Changing state from '{self.state}' to '{state}'") logging.debug(f"Changing state from '{self.state}' to '{state}'")
prev_state = self.state self.state = state
self.state = state
if self.state_callbacks[state] is not None: if self.state_callbacks[state] is not None:
logging.debug(f"Adding callback for state: {state}") logging.debug(f"Adding callback for state: {state}")
Gdk.threads_add_idle( GLib.idle_add(self.state_cb, self.state_callbacks[state])
GLib.PRIORITY_HIGH_IDLE,
self.state_cb,
self.state_callbacks[state],
prev_state
)
def configure_power_devices(self, data): def configure_power_devices(self, data):
self.power_devices = {} self.power_devices = {}
@@ -206,9 +155,6 @@ class Printer:
def get_config_section(self, section): def get_config_section(self, section):
return self.config[section] if section in self.config else False return self.config[section] if section in self.config else False
def get_data(self):
return self.data
def get_fans(self): def get_fans(self):
fans = [] fans = []
if self.config_section_exists("fan"): if self.config_section_exists("fan"):
@@ -221,7 +167,6 @@ class Printer:
def get_output_pins(self): def get_output_pins(self):
output_pins = [] output_pins = []
output_pins.extend(iter(self.get_config_section_list("output_pin "))) output_pins.extend(iter(self.get_config_section_list("output_pin ")))
logging.debug(f"{output_pins}")
return output_pins return output_pins
def get_gcode_macros(self): def get_gcode_macros(self):
@@ -266,9 +211,6 @@ class Printer:
return data return data
def get_klipper_version(self):
return self.klipper['version']
def get_power_devices(self): def get_power_devices(self):
return list(self.power_devices) return list(self.power_devices)
@@ -284,20 +226,6 @@ class Printer:
return self.data[stat][substat] if substat in self.data[stat] else {} return self.data[stat][substat] if substat in self.data[stat] else {}
return self.data[stat] return self.data[stat]
def get_state(self):
return self.state
def set_dev_temps(self, dev, temp, target=None, power=None):
if dev in self.devices:
self.devices[dev]['temperature'] = temp
if target is not None:
self.devices[dev]['target'] = target
if power is not None:
self.devices[dev]['power'] = power
def get_dev_stats(self, dev):
return self.devices[dev] if dev in self.devices else None
def get_dev_stat(self, dev, stat): def get_dev_stat(self, dev, stat):
if dev in self.devices and stat in self.devices[dev]: if dev in self.devices and stat in self.devices[dev]:
return self.devices[dev][stat] return self.devices[dev][stat]
@@ -326,9 +254,6 @@ class Printer:
return self.config[pin]["value"] return self.config[pin]["value"]
return 0 return 0
def get_extruder_count(self):
return self.extrudercount
def get_temp_store_devices(self): def get_temp_store_devices(self):
if self.tempstore is not None: if self.tempstore is not None:
return list(self.tempstore) return list(self.tempstore)
@@ -376,11 +301,6 @@ class Printer:
def config_section_exists(self, section): def config_section_exists(self, section):
return section in self.get_config_section_list() return section in self.get_config_section_list()
def set_callbacks(self, callbacks):
for name, cb in callbacks.items():
if name in list(self.state_callbacks):
self.state_callbacks[name] = cb
def set_dev_stat(self, dev, stat, value): def set_dev_stat(self, dev, stat, value):
if dev not in self.devices: if dev not in self.devices:
return return
@@ -388,6 +308,8 @@ class Printer:
self.devices[dev][stat] = value self.devices[dev][stat] = value
def _update_temp_store(self): def _update_temp_store(self):
if self.tempstore is None:
return False
for device in self.tempstore: for device in self.tempstore:
for x in self.tempstore[device]: for x in self.tempstore[device]:
if len(self.tempstore[device][x]) >= 1200: if len(self.tempstore[device][x]) >= 1200:
+4 -31
View File
@@ -4,8 +4,6 @@ import logging
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk from gi.repository import Gtk
from ks_includes.KlippyGcodes import KlippyGcodes
class ScreenPanel: class ScreenPanel:
@@ -14,7 +12,6 @@ class ScreenPanel:
self._screen = screen self._screen = screen
self._config = screen._config self._config = screen._config
self._files = screen.files self._files = screen.files
self.lang = self._screen.lang
self._printer = screen.printer self._printer = screen.printer
self.labels = {} self.labels = {}
self._gtk = screen.gtk self._gtk = screen.gtk
@@ -22,6 +19,7 @@ class ScreenPanel:
self.title = title self.title = title
self.devices = {} self.devices = {}
self.active_heaters = [] self.active_heaters = []
self.ks_printer_cfg = None
self.layout = Gtk.Layout() self.layout = Gtk.Layout()
self.layout.set_size(self._screen.width, self._screen.height) self.layout.set_size(self._screen.width, self._screen.height)
@@ -33,12 +31,7 @@ class ScreenPanel:
self._show_heater_power = self._config.get_main_config().getboolean('show_heater_power', False) self._show_heater_power = self._config.get_main_config().getboolean('show_heater_power', False)
def initialize(self, panel_name):
# Create gtk items here
return
def emergency_stop(self, widget): def emergency_stop(self, widget):
if self._config.get_main_config().getboolean('confirm_estop', False): if self._config.get_main_config().getboolean('confirm_estop', False):
self._screen._confirm_send_action(widget, _("Are you sure you want to run Emergency Stop?"), self._screen._confirm_send_action(widget, _("Are you sure you want to run Emergency Stop?"),
"printer.emergency_stop") "printer.emergency_stop")
@@ -51,10 +44,11 @@ class ScreenPanel:
def get_content(self): def get_content(self):
return self.content return self.content
def get_file_image(self, filename, width=1, height=1, small=False): def get_file_image(self, filename, width=None, height=None, small=False):
if not self._files.has_thumbnail(filename): if not self._files.has_thumbnail(filename):
return None return None
width = width if width is not None else self._gtk.img_width
height = height if height is not None else self._gtk.img_height
loc = self._files.get_thumbnail_location(filename, small) loc = self._files.get_thumbnail_location(filename, small)
if loc is None: if loc is None:
return None return None
@@ -67,24 +61,7 @@ class ScreenPanel:
def get_title(self): def get_title(self):
return self.title return self.title
def home(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
def homexy(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME_XY)
def z_tilt(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.Z_TILT)
def quad_gantry_level(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.QUAD_GANTRY_LEVEL)
def menu_item_clicked(self, widget, panel, item): def menu_item_clicked(self, widget, panel, item):
logging.info(f"### Creating panel {item['panel']} : {panel} {item}")
if "items" in item:
self._screen.show_panel(f'{self._screen._cur_panels[-1]}_{panel}',
item['panel'], item['name'], 1, False, items=item['items'])
return
self._screen.show_panel(f'{self._screen._cur_panels[-1]}_{panel}', item['panel'], item['name'], 1, False) self._screen.show_panel(f'{self._screen._cur_panels[-1]}_{panel}', item['panel'], item['name'], 1, False)
def menu_return(self, widget, home=False): def menu_return(self, widget, home=False):
@@ -99,10 +76,6 @@ class ScreenPanel:
def show_all(self): def show_all(self):
self._screen.show_all() self._screen.show_all()
def update_image_text(self, label, text):
if label in self.labels and 'l' in self.labels[label]:
self.labels[label]['l'].set_text(text)
def load_menu(self, widget, name): def load_menu(self, widget, name):
if f"{name}_menu" not in self.labels: if f"{name}_menu" not in self.labels:
return return
+65
View File
@@ -0,0 +1,65 @@
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
class BedMap(Gtk.DrawingArea):
def __init__(self, font_size, bm):
super().__init__()
self.set_hexpand(True)
self.set_vexpand(True)
self.connect('draw', self.draw_graph)
self.font_size = font_size
self.font_spacing = round(self.font_size * 1.5)
self.bm = list(reversed(bm)) if bm is not None else None
def update_bm(self, bm):
self.bm = list(reversed(bm)) if bm is not None else None
def draw_graph(self, da, ctx):
width = da.get_allocated_width()
height = da.get_allocated_height()
# Styling
ctx.set_line_width(1)
ctx.set_font_size(self.font_size)
if self.bm is None:
ctx.move_to(self.font_spacing, height / 2)
ctx.set_source_rgb(0.5, 0.5, 0.5)
ctx.show_text(_("No mesh has been loaded"))
ctx.stroke()
return
rows = len(self.bm)
columns = len(self.bm[0])
for i, row in enumerate(self.bm):
ty = height / rows * i
by = ty + height / rows
for j, column in enumerate(row):
lx = width / columns * j
rx = lx + width / columns
# Colors
ctx.set_source_rgb(*self.colorbar(column))
ctx.move_to(lx, ty)
ctx.line_to(lx, by)
ctx.line_to(rx, by)
ctx.line_to(rx, ty)
ctx.close_path()
ctx.fill()
ctx.stroke()
# Numbers
ctx.set_source_rgb(0, 0, 0)
ctx.move_to((lx + rx) / 2 - self.font_size, (ty + by + self.font_size) / 2)
ctx.show_text(f"{column:.2f}")
ctx.stroke()
@staticmethod
def colorbar(value):
rmax = 0.25
color = min(1, max(0, 1 - 1 / rmax * abs(value)))
if value > 0:
return [1, color, color]
if value < 0:
return [color, color, 1]
return [1, 1, 1]
+9 -3
View File
@@ -47,9 +47,15 @@ class HeaterGraph(Gtk.DrawingArea):
for name in self.store if "temperatures" in self.store[name]) for name in self.store if "temperatures" in self.store[name])
def get_max_num(self, data_points=0): def get_max_num(self, data_points=0):
mnum = [] mnum = [0]
for x in self.store: for device in self.store:
mnum.extend(max(self.printer.get_temp_store(x, t, data_points)) for t in self.store[x] if t != "show") if self.store[device]['show']:
temp = self.printer.get_temp_store(device, "temperatures", data_points)
if temp:
mnum.append(max(temp))
target = self.printer.get_temp_store(device, "targets", data_points)
if target:
mnum.append(max(target))
return max(mnum) return max(mnum)
def draw_graph(self, da, ctx): def draw_graph(self, da, ctx):
+84 -37
View File
@@ -1,3 +1,5 @@
import logging
import os
import gi import gi
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
@@ -5,63 +7,108 @@ from gi.repository import Gtk, GLib
class Keyboard(Gtk.Box): class Keyboard(Gtk.Box):
langs = ["de", "en", "es"]
def __init__(self, screen, close_cb, entry=None): def __init__(self, screen, close_cb, entry=None):
super().__init__(orientation=Gtk.Orientation.VERTICAL) super().__init__(orientation=Gtk.Orientation.VERTICAL)
_ = screen.lang.gettext
self._gtk = screen.gtk
self.close_cb = close_cb self.close_cb = close_cb
self.keyboard = Gtk.Grid() self.keyboard = Gtk.Grid()
self.keyboard.set_direction(Gtk.TextDirection.LTR) self.keyboard.set_direction(Gtk.TextDirection.LTR)
self.timeout = self.clear_timeout = None self.timeout = self.clear_timeout = None
self.entry = entry self.entry = entry
self.keys = [ language = self.detect_language(screen._config.get_main_config().get("language", None))
[["q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "⌫"], logging.info(f"Keyboard {language}")
["a", "s", "d", "f", "g", "h", "j", "k", "l", "'"],
["ABC", "z", "x", "c", "v", "b", "n", "m", ",", ".", "?123"],
["✕", " ", "✔"]
],
[["Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "⌫"],
["A", "S", "D", "F", "G", "H", "J", "K", "L", "'"],
["?123", "Z", "X", "C", "V", "B", "N", "M", ",", ".", "abc"],
["✕", " ", "✔"]
],
[["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "⌫"],
["=", "-", "+", "*", "/", "\\", ":", ";", "'", "\""],
["abc", "(", ")", "#", "$", "!", "?", "@", "_", ",", "ABC"],
["✕", " ", "✔"]
]
]
self.labels = self.keys.copy() if language == "de":
self.keys = [
[
["q", "w", "e", "r", "t", "z", "u", "i", "o", "p", "ü", "⌫"],
["a", "s", "d", "f", "g", "h", "j", "k", "l", "ö", "ä"],
["ABC", "y", "x", "c", "v", "b", "n", "m", ",", ".", "?123"],
],
[
["Q", "W", "E", "R", "T", "Z", "U", "I", "O", "P", "Ü", "⌫"],
["A", "S", "D", "F", "G", "H", "J", "K", "L", "Ö", "Ä"],
["?123", "Y", "X", "C", "V", "B", "N", "M", ",", ".", "abc"],
],
[
["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "ß", "⌫"],
["=", "-", "+", "*", "/", "\\", ":", ";", "'", "\"", "ẞ"],
["abc", "(", ")", "#", "$", "!", "?", "@", "_", ",", "ABC"],
]
]
else:
self.keys = [
[
["q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "⌫"],
["a", "s", "d", "f", "g", "h", "j", "k", "l", "'"],
["ABC", "z", "x", "c", "v", "b", "n", "m", ",", ".", "?123"],
],
[
["Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P", "⌫"],
["A", "S", "D", "F", "G", "H", "J", "K", "L", "'"],
["?123", "Z", "X", "C", "V", "B", "N", "M", ",", ".", "abc"],
],
[
["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "⌫"],
["=", "-", "+", "*", "/", "\\", ":", ";", "'", "\""],
["abc", "(", ")", "#", "$", "!", "?", "@", "_", ",", "ABC"],
]
]
if language == "es":
self.keys[0][1].remove("'")
self.keys[0][1].append("ñ")
self.keys[1][1].remove("'")
self.keys[1][1].append("Ñ")
for pallet in self.keys:
pallet.append(["✕", " ", "✔"])
self.buttons = self.keys.copy()
for p, pallet in enumerate(self.keys): for p, pallet in enumerate(self.keys):
for r, row in enumerate(pallet): for r, row in enumerate(pallet):
for k, key in enumerate(row): for k, key in enumerate(row):
self.labels[p][r][k] = self._gtk.Button(key) if key == "⌫":
self.labels[p][r][k].set_hexpand(True) self.buttons[p][r][k] = screen.gtk.ButtonImage("backspace", scale=.6)
self.labels[p][r][k].set_vexpand(True) elif key == "✕":
self.labels[p][r][k].connect('button-press-event', self.repeat, key) self.buttons[p][r][k] = screen.gtk.ButtonImage("cancel", scale=.6)
self.labels[p][r][k].connect('button-release-event', self.release) elif key == "✔":
self.labels[p][r][k].get_style_context().add_class("keyboard_pad") self.buttons[p][r][k] = screen.gtk.ButtonImage("complete", scale=.6)
else:
self.buttons[p][r][k] = screen.gtk.Button(key)
self.buttons[p][r][k].set_hexpand(True)
self.buttons[p][r][k].set_vexpand(True)
self.buttons[p][r][k].connect('button-press-event', self.repeat, key)
self.buttons[p][r][k].connect('button-release-event', self.release)
self.buttons[p][r][k].get_style_context().add_class("keyboard_pad")
self.pallet_nr = 0 self.pallet_nr = 0
self.set_pallet(self.pallet_nr) self.set_pallet(self.pallet_nr)
self.add(self.keyboard) self.add(self.keyboard)
def detect_language(self, language):
if language is None or language == "system_lang":
for language in self.langs:
if os.getenv('LANG').lower().startswith(language):
return language
for _ in self.langs:
if language.startswith(_):
return _
return "en"
def set_pallet(self, p): def set_pallet(self, p):
pallet = self.keys[p] for _ in range(len(self.keys[self.pallet_nr]) + 1):
span = 2 self.keyboard.remove_row(0)
for r, row in enumerate(pallet[:-1]): self.pallet_nr = p
for r, row in enumerate(self.keys[p][:-1]):
for k, key in enumerate(row): for k, key in enumerate(row):
x = k * 2 + 1 if r == 1 else k * 2 x = k * 2 + 1 if r == 1 else k * 2
old = self.keyboard.get_child_at(x, r) self.keyboard.attach(self.buttons[p][r][k], x, r, 2, 1)
if old: self.keyboard.attach(self.buttons[p][3][0], 0, 4, 3, 1) # ✕
self.keyboard.remove(old) self.keyboard.attach(self.buttons[p][3][1], 3, 4, 16, 1) # Space
self.keyboard.attach(self.labels[p][r][k], x, r, span, 1) self.keyboard.attach(self.buttons[p][3][2], 19, 4, 3, 1) # ✔
if not self.keyboard.get_child_at(0, 4):
self.keyboard.attach(self.labels[p][3][0], 0, 4, 3, 1)
self.keyboard.attach(self.labels[p][3][1], 3, 4, 16, 1)
self.keyboard.attach(self.labels[p][3][2], 19, 4, 3, 1)
self.show_all() self.show_all()
def repeat(self, widget, event, key): def repeat(self, widget, event, key):
-1
View File
@@ -8,7 +8,6 @@ class Keypad(Gtk.Box):
def __init__(self, screen, change_temp, close_function): def __init__(self, screen, change_temp, close_function):
super().__init__(orientation=Gtk.Orientation.VERTICAL) super().__init__(orientation=Gtk.Orientation.VERTICAL)
_ = screen.lang.gettext
self.labels = {} self.labels = {}
self.change_temp = change_temp self.change_temp = change_temp
self.screen = screen self.screen = screen
+12 -19
View File
@@ -11,7 +11,7 @@ from queue import Queue
import gi import gi
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import GLib, Gdk from gi.repository import GLib
class WifiManager: class WifiManager:
@@ -103,10 +103,7 @@ class WifiManager:
def callback(self, cb_type, msg): def callback(self, cb_type, msg):
if cb_type in self._callbacks: if cb_type in self._callbacks:
for cb in self._callbacks[cb_type]: for cb in self._callbacks[cb_type]:
Gdk.threads_add_idle( GLib.idle_add(cb, msg)
GLib.PRIORITY_DEFAULT_IDLE,
cb,
msg)
def connect(self, ssid): def connect(self, ssid):
netid = None netid = None
@@ -164,9 +161,8 @@ class WifiManager:
self.networks[ssid]['connected'] = ssid == con_ssid self.networks[ssid]['connected'] = ssid == con_ssid
if prev_ssid != self.connected_ssid: if prev_ssid != self.connected_ssid:
for cb in self._callbacks['connected']: for cb in self._callbacks['connected']:
Gdk.threads_add_idle( args = self.connected_ssid, prev_ssid
GLib.PRIORITY_DEFAULT_IDLE, GLib.idle_add(cb, *args)
cb, self.connected_ssid, prev_ssid)
return [con_ssid, con_bssid] return [con_ssid, con_bssid]
elif "ssid" in variables and "bssid" in variables: elif "ssid" in variables and "bssid" in variables:
self.connected = True self.connected = True
@@ -175,9 +171,8 @@ class WifiManager:
self.networks[ssid]['connected'] = ssid == variables['ssid'] self.networks[ssid]['connected'] = ssid == variables['ssid']
if prev_ssid != self.connected_ssid: if prev_ssid != self.connected_ssid:
for cb in self._callbacks['connected']: for cb in self._callbacks['connected']:
Gdk.threads_add_idle( args = self.connected_ssid, prev_ssid
GLib.PRIORITY_DEFAULT_IDLE, GLib.idle_add(cb, *args)
cb, self.connected_ssid, prev_ssid)
return [variables['ssid'], variables['bssid']] return [variables['ssid'], variables['bssid']]
else: else:
logging.info("Resetting connected_ssid") logging.info("Resetting connected_ssid")
@@ -187,9 +182,8 @@ class WifiManager:
self.networks[ssid]['connected'] = False self.networks[ssid]['connected'] = False
if prev_ssid != self.connected_ssid: if prev_ssid != self.connected_ssid:
for cb in self._callbacks['connected']: for cb in self._callbacks['connected']:
Gdk.threads_add_idle( args = self.connected_ssid, prev_ssid
GLib.PRIORITY_DEFAULT_IDLE, GLib.idle_add(cb, *args)
cb, self.connected_ssid, prev_ssid)
return None return None
def get_current_wifi_idle_add(self): def get_current_wifi_idle_add(self):
@@ -289,9 +283,8 @@ class WifiManager:
new_networks.append(net) new_networks.append(net)
if new_networks or deleted_networks: if new_networks or deleted_networks:
for cb in self._callbacks['scan_results']: for cb in self._callbacks['scan_results']:
Gdk.threads_add_idle( args = new_networks, deleted_networks
GLib.PRIORITY_DEFAULT_IDLE, GLib.idle_add(cb, *args)
cb, new_networks, deleted_networks)
def wpa_cli(self, command, wait=True): def wpa_cli(self, command, wait=True):
if wait is False: if wait is False:
@@ -326,7 +319,7 @@ class WpaSocket(Thread):
continue continue
if msg.startswith("<"): if msg.startswith("<"):
if "CTRL-EVENT-SCAN-RESULTS" in msg: if "CTRL-EVENT-SCAN-RESULTS" in msg:
Gdk.threads_add_idle(GLib.PRIORITY_DEFAULT_IDLE, self.wm.scan_results) GLib.idle_add(self.wm.scan_results)
elif "CTRL-EVENT-DISCONNECTED" in msg: elif "CTRL-EVENT-DISCONNECTED" in msg:
self.callback("connecting_status", msg) self.callback("connecting_status", msg)
match = re.match('<3>CTRL-EVENT-DISCONNECTED bssid=(\\S+) reason=3 locally_generated=1', msg) match = re.match('<3>CTRL-EVENT-DISCONNECTED bssid=(\\S+) reason=3 locally_generated=1', msg)
@@ -338,7 +331,7 @@ class WpaSocket(Thread):
elif "Trying to associate" in msg or "CTRL-EVENT-REGDOM-CHANGE" in msg: elif "Trying to associate" in msg or "CTRL-EVENT-REGDOM-CHANGE" in msg:
self.callback("connecting_status", msg) self.callback("connecting_status", msg)
elif "CTRL-EVENT-CONNECTED" in msg: elif "CTRL-EVENT-CONNECTED" in msg:
Gdk.threads_add_idle(GLib.PRIORITY_DEFAULT_IDLE, self.wm.get_current_wifi_idle_add) GLib.idle_add(self.wm.get_current_wifi_idle_add)
self.callback("connecting_status", msg) self.callback("connecting_status", msg)
elif self.skip_commands > 0: elif self.skip_commands > 0:
self.skip_commands = self.skip_commands - 1 self.skip_commands = self.skip_commands - 1
+100 -90
View File
@@ -1,12 +1,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import contextlib import contextlib
import datetime
import gi import gi
import logging import logging
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import GLib, Gtk, Pango from gi.repository import GLib, Gtk, Pango
from jinja2 import Environment from jinja2 import Environment
from datetime import datetime
from math import log
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
@@ -18,11 +19,13 @@ class BasePanel(ScreenPanel):
self.time_min = -1 self.time_min = -1
self.time_format = self._config.get_main_config().getboolean("24htime", True) self.time_format = self._config.get_main_config().getboolean("24htime", True)
self.time_update = None self.time_update = None
self.titlebar_items = []
self.titlebar_name_type = None self.titlebar_name_type = None
self.buttons_showing = { self.buttons_showing = {
'back': not back, 'back': not back,
'macros_shortcut': False, 'macros_shortcut': False,
'printer_select': False 'printer_select': False,
'estop': False,
} }
self.current_extruder = None self.current_extruder = None
# Action bar buttons # Action bar buttons
@@ -64,7 +67,7 @@ class BasePanel(ScreenPanel):
self.action_bar.add(self.control['home']) self.action_bar.add(self.control['home'])
if len(self._config.get_printers()) > 1: if len(self._config.get_printers()) > 1:
self.action_bar.add(self.control['printer_select']) self.action_bar.add(self.control['printer_select'])
self.action_bar.add(self.control['macros_shortcut']) self.show_macro_shortcut(self._config.get_main_config().getboolean('side_macro_shortcut', True))
self.action_bar.add(self.control['estop']) self.action_bar.add(self.control['estop'])
# Titlebar # Titlebar
@@ -81,7 +84,7 @@ class BasePanel(ScreenPanel):
self.control['time'] = Gtk.Label("00:00 AM") self.control['time'] = Gtk.Label("00:00 AM")
self.control['time_box'] = Gtk.Box() self.control['time_box'] = Gtk.Box()
self.control['time_box'].set_halign(Gtk.Align.END) self.control['time_box'].set_halign(Gtk.Align.END)
self.control['time_box'].pack_end(self.control['time'], True, True, 5) self.control['time_box'].pack_end(self.control['time'], True, True, 10)
self.titlebar = Gtk.Box(spacing=5) self.titlebar = Gtk.Box(spacing=5)
self.titlebar.set_size_request(0, self._gtk.get_titlebar_height()) self.titlebar.set_size_request(0, self._gtk.get_titlebar_height())
@@ -109,99 +112,82 @@ class BasePanel(ScreenPanel):
# Layout is and content are on screen_panel # Layout is and content are on screen_panel
self.layout.add(self.main_grid) self.layout.add(self.main_grid)
def initialize(self, panel_name):
self.update_time() self.update_time()
return
def show_heaters(self, show=True): def show_heaters(self, show=True):
printer_cfg = self._config.get_printer_config(self._screen.connected_printer) try:
if printer_cfg is not None: for child in self.control['temp_box'].get_children():
self.titlebar_name_type = printer_cfg.get("titlebar_name_type", None) self.control['temp_box'].remove(child)
else: if not show or self._screen.printer.get_temp_store_devices() is None:
self.titlebar_name_type = None return
logging.info(f"Titlebar name type: {self.titlebar_name_type}")
for child in self.control['temp_box'].get_children(): img_size = self._gtk.img_scale * .5
self.control['temp_box'].remove(child) for device in self._screen.printer.get_temp_store_devices():
self.labels[device] = Gtk.Label(label="100º")
self.labels[device].set_ellipsize(Pango.EllipsizeMode.START)
if not show or self._screen.printer.get_temp_store_devices() is None: self.labels[f'{device}_box'] = Gtk.Box()
return icon = self.get_icon(device, img_size)
if icon is not None:
self.labels[f'{device}_box'].pack_start(icon, False, False, 3)
self.labels[f'{device}_box'].pack_start(self.labels[device], False, False, 0)
for device in self._screen.printer.get_temp_store_devices(): # Limit the number of items according to resolution
if device.startswith("extruder"): nlimit = int(round(log(self._screen.width, 10) * 5 - 10.5))
if self._screen.printer.extrudercount > 1:
if device == "extruder":
icon = self._gtk.Image("extruder-0", .5)
else:
icon = self._gtk.Image(f"extruder-{device[8:]}", .5)
else:
icon = self._gtk.Image("extruder", .5)
elif device.startswith("heater_bed"):
icon = self._gtk.Image("bed", .5)
# Extra items
elif self.titlebar_name_type is not None:
# The item has a name, do not use an icon
icon = None
elif device.startswith("temperature_fan"):
icon = self._gtk.Image("fan", .5)
elif device.startswith("heater_generic"):
icon = self._gtk.Image("heater", .5)
else:
icon = self._gtk.Image("heat-up", .5)
self.labels[device] = Gtk.Label(label="100º") n = 0
self.labels[device].set_ellipsize(Pango.EllipsizeMode.START) if self._screen.printer.get_tools():
self.current_extruder = self._screen.printer.get_stat("toolhead", "extruder")
if self.current_extruder and f"{self.current_extruder}_box" in self.labels:
self.control['temp_box'].add(self.labels[f"{self.current_extruder}_box"])
n += 1
self.labels[f'{device}_box'] = Gtk.Box() if self._screen.printer.has_heated_bed():
if icon is not None: self.control['temp_box'].add(self.labels['heater_bed_box'])
self.labels[f'{device}_box'].pack_start(icon, False, False, 3)
self.labels[f'{device}_box'].pack_start(self.labels[device], False, False, 0)
# Limit the number of items according to resolution
if self._screen.width <= 480:
nlimit = 3
elif self._screen.width <= 800:
nlimit = 4
else:
nlimit = 5
n = 0
if self._screen.printer.get_tools():
self.current_extruder = self._screen.printer.get_stat("toolhead", "extruder")
if self.current_extruder:
self.control['temp_box'].add(self.labels[f"{self.current_extruder}_box"])
n += 1 n += 1
if self._screen.printer.has_heated_bed(): # Options in the config have priority
self.control['temp_box'].add(self.labels['heater_bed_box']) for device in self._screen.printer.get_temp_store_devices():
n += 1 # Users can fill the bar if they want
if n >= nlimit + 1:
# Options in the config have priority break
if printer_cfg is not None: name = device.split()[1] if len(device.split()) > 1 else device
titlebar_items = printer_cfg.get("titlebar_items", None) for item in self.titlebar_items:
if titlebar_items is not None: if name == item:
titlebar_items = [str(i.strip()) for i in titlebar_items.split(',')] self.control['temp_box'].add(self.labels[f"{device}_box"])
logging.info(f"Titlebar items: {titlebar_items}") n += 1
for device in self._screen.printer.get_temp_store_devices():
# Users can fill the bar if they want
if n >= nlimit + 1:
break break
name = device.split()[1] if len(device.split()) > 1 else device
for item in titlebar_items:
if name == item:
self.control['temp_box'].add(self.labels[f"{device}_box"])
n += 1
break
# If there is enough space fill with heater_generic # If there is enough space fill with heater_generic
for device in self._screen.printer.get_temp_store_devices(): for device in self._screen.printer.get_temp_store_devices():
if n >= nlimit: if n >= nlimit:
break break
if device.startswith("heater_generic"): if device.startswith("heater_generic"):
self.control['temp_box'].add(self.labels[f"{device}_box"]) self.control['temp_box'].add(self.labels[f"{device}_box"])
n += 1 n += 1
self.control['temp_box'].show_all() self.control['temp_box'].show_all()
except Exception as e:
logging.debug(f"Couldn't create heaters box: {e}")
def get_icon(self, device, img_size):
if device.startswith("extruder"):
if self._screen.printer.extrudercount > 1:
if device == "extruder":
device = "extruder0"
return self._gtk.Image(f"extruder-{device[8:]}", img_size, img_size)
return self._gtk.Image("extruder", img_size, img_size)
elif device.startswith("heater_bed"):
return self._gtk.Image("bed", img_size, img_size)
# Extra items
elif self.titlebar_name_type is not None:
# The item has a name, do not use an icon
return None
elif device.startswith("temperature_fan"):
return self._gtk.Image("fan", img_size, img_size)
elif device.startswith("heater_generic"):
return self._gtk.Image("heater", img_size, img_size)
else:
return self._gtk.Image("heat-up", img_size, img_size)
def activate(self): def activate(self):
if self.time_update is None: if self.time_update is None:
@@ -270,11 +256,11 @@ class BasePanel(ScreenPanel):
self.action_bar.reorder_child(self.control['macros_shortcut'], 2) self.action_bar.reorder_child(self.control['macros_shortcut'], 2)
else: else:
self.action_bar.reorder_child(self.control['macros_shortcut'], 3) self.action_bar.reorder_child(self.control['macros_shortcut'], 3)
self.control['macros_shortcut'].show()
self.buttons_showing['macros_shortcut'] = True self.buttons_showing['macros_shortcut'] = True
elif show is False and self.buttons_showing['macros_shortcut'] is True: elif show is False and self.buttons_showing['macros_shortcut'] is True:
self.action_bar.remove(self.control['macros_shortcut']) self.action_bar.remove(self.control['macros_shortcut'])
self.buttons_showing['macros_shortcut'] = False self.buttons_showing['macros_shortcut'] = False
self._screen.show_all()
def show_printer_select(self, show=True): def show_printer_select(self, show=True):
if len(self._config.get_printers()) <= 1: if len(self._config.get_printers()) <= 1:
@@ -283,15 +269,18 @@ class BasePanel(ScreenPanel):
self.action_bar.add(self.control['printer_select']) self.action_bar.add(self.control['printer_select'])
self.action_bar.reorder_child(self.control['printer_select'], 2) self.action_bar.reorder_child(self.control['printer_select'], 2)
self.buttons_showing['printer_select'] = True self.buttons_showing['printer_select'] = True
self.control['printer_select'].show()
elif show is False and self.buttons_showing['printer_select']: elif show is False and self.buttons_showing['printer_select']:
self.action_bar.remove(self.control['printer_select']) self.action_bar.remove(self.control['printer_select'])
self.buttons_showing['printer_select'] = False self.buttons_showing['printer_select'] = False
self._screen.show_all()
def set_title(self, title): def set_title(self, title):
if not title:
self.titlelbl.set_label(f"{self._screen.connecting_to_printer}")
return
try: try:
env = Environment(extensions=["jinja2.ext.i18n"], autoescape=True) env = Environment(extensions=["jinja2.ext.i18n"], autoescape=True)
env.install_gettext_translations(self.lang) env.install_gettext_translations(self._config.get_lang())
j2_temp = env.from_string(title) j2_temp = env.from_string(title)
title = j2_temp.render() title = j2_temp.render()
except Exception as e: except Exception as e:
@@ -300,11 +289,32 @@ class BasePanel(ScreenPanel):
self.titlelbl.set_label(f"{self._screen.connecting_to_printer} | {title}") self.titlelbl.set_label(f"{self._screen.connecting_to_printer} | {title}")
def update_time(self): def update_time(self):
now = datetime.datetime.now() now = datetime.now()
confopt = self._config.get_main_config().getboolean("24htime", True) confopt = self._config.get_main_config().getboolean("24htime", True)
if now.minute != self.time_min or self.time_format != confopt: if now.minute != self.time_min or self.time_format != confopt:
if confopt: if confopt:
self.control['time'].set_text(f'{now:%H:%M}') self.control['time'].set_text(f'{now:%H:%M }')
else: else:
self.control['time'].set_text(f'{now:%I:%M %p}') self.control['time'].set_text(f'{now:%I:%M %p}')
self.time_min = now.minute
self.time_format = confopt
return True return True
def show_estop(self, show=True):
if show and self.buttons_showing['estop'] is False:
self.control['estop'].set_sensitive(True)
self.buttons_showing['estop'] = True
elif show is False and self.buttons_showing['estop']:
self.control['estop'].set_sensitive(False)
self.buttons_showing['estop'] = False
def set_ks_printer_cfg(self, printer):
self.ks_printer_cfg = self._config.get_printer_config(printer)
if self.ks_printer_cfg is not None:
self.titlebar_name_type = self.ks_printer_cfg.get("titlebar_name_type", None)
titlebar_items = self.ks_printer_cfg.get("titlebar_items", None)
if titlebar_items is not None:
self.titlebar_items = [str(i.strip()) for i in titlebar_items.split(',')]
logging.info(f"Titlebar name type: {self.titlebar_name_type} items: {self.titlebar_items}")
else:
self.titlebar_items = []
-4
View File
@@ -18,16 +18,12 @@ class BedLevelPanel(ScreenPanel):
def __init__(self, screen, title, back=True): def __init__(self, screen, title, back=True):
super().__init__(screen, title, back) super().__init__(screen, title, back)
self.response_count = 0 self.response_count = 0
self.panel_name = ""
self.screw_dict = {} self.screw_dict = {}
self.screws = [] self.screws = []
self.y_cnt = 0 self.y_cnt = 0
self.x_cnt = 0 self.x_cnt = 0
self.x_offset = 0 self.x_offset = 0
self.y_offset = 0 self.y_offset = 0
def initialize(self, panel_name):
self.panel_name = panel_name
self.labels['dm'] = self._gtk.ButtonImage("motor-off", _("Disable XY"), "color3") self.labels['dm'] = self._gtk.ButtonImage("motor-off", _("Disable XY"), "color3")
self.labels['dm'].connect("clicked", self.disable_motors) self.labels['dm'].connect("clicked", self.disable_motors)
screw_positions = [] screw_positions = []
+92 -198
View File
@@ -1,20 +1,13 @@
import gi import gi
import logging import logging
import contextlib import contextlib
import numpy as np
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Pango from gi.repository import Gtk, Pango
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import rc
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigureCanvas
from matplotlib.ticker import LinearLocator
from ks_includes.KlippyGcodes import KlippyGcodes from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
from ks_includes.widgets.bedmap import BedMap
def create_panel(*args): def create_panel(*args):
@@ -25,28 +18,26 @@ class BedMeshPanel(ScreenPanel):
def __init__(self, screen, title, back=True): def __init__(self, screen, title, back=True):
super().__init__(screen, title, back) super().__init__(screen, title, back)
self.clear = None
self.profiles = {} self.profiles = {}
self.show_create = False self.show_create = False
self.active_mesh = None self.active_mesh = None
def initialize(self, panel_name):
addprofile = self._gtk.ButtonImage("increase", " " + _("Add profile"), "color1", .66, Gtk.PositionType.LEFT, 1) addprofile = self._gtk.ButtonImage("increase", " " + _("Add profile"), "color1", .66, Gtk.PositionType.LEFT, 1)
addprofile.connect("clicked", self.show_create_profile) addprofile.connect("clicked", self.show_create_profile)
addprofile.set_hexpand(True) addprofile.set_hexpand(True)
clear = self._gtk.ButtonImage("cancel", " " + _("Clear"), "color2", .66, Gtk.PositionType.LEFT, 1) self.clear = self._gtk.ButtonImage("cancel", " " + _("Clear"), "color2", .66, Gtk.PositionType.LEFT, 1)
clear.connect("clicked", self._clear_mesh) self.clear.connect("clicked", self.send_clear_mesh)
clear.set_hexpand(True) self.clear.set_hexpand(True)
top_calibrate = self._gtk.ButtonImage("refresh", " " + _("Calibrate"), "color3", .66, Gtk.PositionType.LEFT, 1) calibrate = self._gtk.ButtonImage("refresh", " " + _("Calibrate"), "color3", .66, Gtk.PositionType.LEFT, 1)
top_calibrate.connect("clicked", self._send_calibrate) calibrate.connect("clicked", self.calibrate_mesh)
top_calibrate.set_hexpand(True) calibrate.set_hexpand(True)
topbar = Gtk.Box(spacing=5) topbar = Gtk.Box(spacing=5)
topbar.set_hexpand(True) topbar.set_hexpand(True)
topbar.set_vexpand(False) topbar.set_vexpand(False)
topbar.add(addprofile) topbar.add(addprofile)
topbar.add(clear) topbar.add(self.clear)
topbar.add(top_calibrate) topbar.add(calibrate)
# Create a grid for all profiles # Create a grid for all profiles
self.labels['profiles'] = Gtk.Grid() self.labels['profiles'] = Gtk.Grid()
@@ -57,76 +48,87 @@ class BedMeshPanel(ScreenPanel):
scroll.add(self.labels['profiles']) scroll.add(self.labels['profiles'])
scroll.set_vexpand(True) scroll.set_vexpand(True)
# Create a box to contain all of the above
self.labels['main_box'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['main_box'].set_vexpand(True)
self.labels['main_box'].pack_start(topbar, False, False, 0)
self.labels['main_box'].pack_end(scroll, True, True, 0)
self.load_meshes() self.load_meshes()
self.content.add(self.labels['main_box']) grid = self._gtk.HomogeneousGrid()
grid.set_row_homogeneous(False)
grid.attach(topbar, 0, 0, 2, 1)
self.labels['map'] = BedMap(self._gtk.get_font_size(), self.active_mesh)
if self._screen.vertical_mode:
grid.attach(self.labels['map'], 0, 2, 2, 1)
grid.attach(scroll, 0, 3, 2, 1)
self.labels['map'].set_size_request(self._gtk.get_content_width(), self._gtk.get_content_height() * .4)
else:
grid.attach(self.labels['map'], 0, 2, 1, 1)
grid.attach(scroll, 1, 2, 1, 1)
self.labels['main_grid'] = grid
self.content.add(self.labels['main_grid'])
def activate(self): def activate(self):
for child in self.content.get_children(): self.load_meshes()
self.content.remove(child) with contextlib.suppress(KeyError):
self.content.add(self.labels['main_box']) self.activate_mesh(self._screen.printer.get_stat("bed_mesh", "profile_name"))
self.activate_mesh(
self._screen.printer.get_stat("bed_mesh", "profile_name")
)
def activate_mesh(self, profile): def activate_mesh(self, profile):
if self.active_mesh is not None:
self.profiles[self.active_mesh]['name'].set_sensitive(True)
self.profiles[self.active_mesh]['name'].get_style_context().remove_class("button_active")
if profile == "": if profile == "":
profile = "default" logging.info("Clearing active profile")
self.active_mesh = None
logging.debug(f"Activating profile: {profile} Current: {self.active_mesh}") self.update_graph()
self.clear.set_sensitive(False)
return
if profile not in self.profiles: if profile not in self.profiles:
self.add_profile(profile) self.add_profile(profile)
if self.active_mesh is not None and self.active_mesh in self.profiles: if self.active_mesh != profile:
a = self.profiles[self.active_mesh] logging.info(f"Active {self.active_mesh} changing to {profile}")
with contextlib.suppress(KeyError): self.profiles[profile]['name'].set_sensitive(False)
a['button_box'].remove(a['calibrate']) self.profiles[profile]['name'].get_style_context().add_class("button_active")
a['button_box'].pack_start(a['load'], False, False, 0)
logging.info(f"Active {self.active_mesh} changing to {profile}")
self.active_mesh = profile self.active_mesh = profile
self.update_graph(profile=profile)
self.clear.set_sensitive(True)
if self.active_mesh is not None: def retrieve_bm(self, profile):
a = self.profiles[profile] if profile is None:
with contextlib.suppress(KeyError): return None
a['button_box'].remove(a['load']) if profile == self.active_mesh:
with contextlib.suppress(KeyError): bm = self._printer.get_stat("bed_mesh")
a['button_box'].remove(a['view']) if bm is None:
a['button_box'].pack_start(a['calibrate'], False, False, 0) logging.info(f"Unable to load active mesh: {profile}")
if self._printer.get_config_section(f"bed_mesh {profile}"): return None
a['button_box'].pack_end(a["view"], False, False, 0) matrix = 'probed_matrix'
self._screen.show_all() else:
bm = self._printer.get_config_section(f"bed_mesh {profile}")
if bm is False:
logging.info(f"Unable to load profile: {profile}")
self.remove_profile(profile)
return None
matrix = 'points'
return bm[matrix]
def update_graph(self, widget=None, profile=None):
self.labels['map'].update_bm(self.retrieve_bm(profile))
self.labels['map'].queue_draw()
def add_profile(self, profile): def add_profile(self, profile):
logging.debug(f"Adding Profile: {profile}")
logging.debug(f"Adding Profile: {profile} Current: {self.active_mesh}") name = self._gtk.Button(f"<big><b>{profile}</b></big>")
name = Gtk.Label() name.get_children()[0].set_use_markup(True)
name.set_markup(f"<big><b>{profile}</b></big>") name.get_children()[0].set_line_wrap(True)
name.set_hexpand(True) name.get_children()[0].set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
name.set_vexpand(False) name.set_vexpand(False)
name.set_halign(Gtk.Align.START) name.set_halign(Gtk.Align.START)
name.set_line_wrap(True) name.connect("clicked", self.send_load_mesh, profile)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) name.connect("clicked", self.update_graph, profile)
buttons = { buttons = {
"calibrate": self._gtk.ButtonImage("refresh", _("Calibrate"), "color4"), "save": self._gtk.ButtonImage("complete", None, "color4", .75),
"load": self._gtk.ButtonImage("load", _("Load"), "color2"), "delete": self._gtk.ButtonImage("cancel", None, "color2", .75),
"save": self._gtk.ButtonImage("complete", _("Save"), "color3"),
"delete": self._gtk.ButtonImage("cancel", _("Delete"), "color3"),
"view": self._gtk.ButtonImage("bed-level", _("View Mesh"), "color1"),
} }
buttons["calibrate"].connect("clicked", self.calibrate_mesh)
buttons["load"].connect("clicked", self.send_load_mesh, profile)
buttons["save"].connect("clicked", self.send_save_mesh, profile) buttons["save"].connect("clicked", self.send_save_mesh, profile)
buttons["delete"].connect("clicked", self.send_remove_mesh, profile) buttons["delete"].connect("clicked", self.send_remove_mesh, profile)
buttons["view"].connect("clicked", self.show_mesh, profile)
for b in buttons.values(): for b in buttons.values():
b.set_hexpand(False) b.set_hexpand(False)
@@ -134,13 +136,9 @@ class BedMeshPanel(ScreenPanel):
b.set_halign(Gtk.Align.END) b.set_halign(Gtk.Align.END)
button_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5) button_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
button_box.add(buttons["calibrate"])
if profile != "default": if profile != "default":
button_box.add(buttons["save"]) button_box.add(buttons["save"])
button_box.add(buttons["delete"]) button_box.add(buttons["delete"])
if self._printer.get_config_section(f"bed_mesh {profile}"):
button_box.add(buttons["load"])
button_box.add(buttons["view"])
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5) box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
box.pack_start(name, True, True, 0) box.pack_start(name, True, True, 0)
@@ -151,13 +149,11 @@ class BedMeshPanel(ScreenPanel):
frame.add(box) frame.add(box)
self.profiles[profile] = { self.profiles[profile] = {
"name": name,
"button_box": button_box, "button_box": button_box,
"row": frame, "row": frame,
"calibrate": buttons["calibrate"],
"load": buttons["load"],
"save": buttons["save"], "save": buttons["save"],
"delete": buttons["delete"], "delete": buttons["delete"],
"view": buttons["view"],
} }
pl = list(self.profiles) pl = list(self.profiles)
@@ -177,10 +173,13 @@ class BedMeshPanel(ScreenPanel):
return False return False
def load_meshes(self): def load_meshes(self):
bm_profiles = self._screen.printer.get_config_section_list("bed_mesh ") bm_profiles = self._printer.get_stat("bed_mesh", "profiles")
logging.info(f"Bed profiles: {bm_profiles}")
for prof in bm_profiles: for prof in bm_profiles:
self.add_profile(prof[9:]) if prof not in self.profiles:
self.add_profile(prof)
for prof in self.profiles:
if prof not in bm_profiles:
self.remove_profile(prof)
def process_update(self, action, data): def process_update(self, action, data):
if action == "notify_status_update": if action == "notify_status_update":
@@ -196,7 +195,7 @@ class BedMeshPanel(ScreenPanel):
self.content.remove(child) self.content.remove(child)
self.show_create = False self.show_create = False
self.content.add(self.labels['main_box']) self.content.add(self.labels['main_grid'])
self.content.show() self.content.show()
def remove_profile(self, profile): def remove_profile(self, profile):
@@ -210,6 +209,10 @@ class BedMeshPanel(ScreenPanel):
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) self.labels['profiles'].remove_row(pos)
del self.profiles[profile] del self.profiles[profile]
if not self.profiles:
self.active_mesh = None
self.update_graph()
self.clear.set_sensitive(False)
def show_create_profile(self, widget): def show_create_profile(self, widget):
@@ -248,101 +251,10 @@ class BedMeshPanel(ScreenPanel):
def _show_keyboard(self, widget=None, event=None): def _show_keyboard(self, widget=None, event=None):
self._screen.show_keyboard(entry=self.labels['profile_name']) self._screen.show_keyboard(entry=self.labels['profile_name'])
def show_mesh(self, widget, profile):
bm = self._printer.get_config_section(f"bed_mesh {profile}")
if bm is False:
logging.info(f"Unable to load profile: {profile}")
return
if profile == self.active_mesh:
abm = self._printer.get_stat("bed_mesh")
if abm is None:
logging.info(f"Unable to load active mesh: {profile}")
return
x_range = [int(abm['mesh_min'][0]), int(abm['mesh_max'][0])]
y_range = [int(abm['mesh_min'][1]), int(abm['mesh_max'][1])]
minz_mesh = min(min(abm['mesh_matrix']))
maxz_mesh = max(max(abm['mesh_matrix']))
# Do not use a very small zscale, because that could be misleading
minz_mesh = min(minz_mesh, -0.5)
maxz_mesh = max(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])]
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'])]
x, y = np.meshgrid(x, y)
z = np.asarray(bm['points'])
rc('axes', edgecolor="#e2e2e2", labelcolor="#e2e2e2")
rc(('xtick', 'ytick'), color="#e2e2e2")
fig = plt.figure(facecolor='#12121277')
ax = Axes3D(fig, azim=245, elev=23)
ax.set(title=profile, xlabel="X", ylabel="Y", facecolor='none')
ax.spines['bottom'].set_color("#e2e2e2")
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])
ax.set_zlim(z_range[0], z_range[1])
ax.zaxis.set_major_locator(LinearLocator(5))
# A StrMethodFormatter is used automatically
ax.zaxis.set_major_formatter('{x:.02f}')
fig.colorbar(surf, shrink=0.7, aspect=5, pad=0.25)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.set_hexpand(True)
box.set_vexpand(True)
title = Gtk.Label()
title.set_markup(f"<b>{profile}</b>")
title.set_hexpand(True)
title.set_halign(Gtk.Align.CENTER)
canvas_box = Gtk.Box()
canvas_box.set_hexpand(True)
canvas_box.set_vexpand(True)
box.add(title)
box.add(canvas_box)
buttons = [
{"name": _("Close"), "response": Gtk.ResponseType.CANCEL}
]
self._gtk.Dialog(self._screen, buttons, box, self._close_dialog)
alloc = canvas_box.get_allocation()
canvas = FigureCanvas(fig)
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.
# https://github.com/matplotlib/matplotlib/commit/3c832377fb4c4b32fcbdbc60fdfedb57296bc8c0
style_ctx = canvas.get_style_context()
for css_class in style_ctx.list_classes():
style_ctx.remove_class(css_class)
@staticmethod
def _close_dialog(widget, response):
widget.destroy()
def create_profile(self, widget): def create_profile(self, widget):
name = self.labels['profile_name'].get_text() name = self.labels['profile_name'].get_text()
if " " in name: if self.active_mesh is None:
name = f'"{name}"' self.calibrate_mesh(None)
self._screen._ws.klippy.gcode_script(f"BED_MESH_PROFILE SAVE={name}") self._screen._ws.klippy.gcode_script(f"BED_MESH_PROFILE SAVE={name}")
self.remove_create() self.remove_create()
@@ -352,39 +264,21 @@ class BedMeshPanel(ScreenPanel):
if self._screen.printer.get_stat("toolhead", "homed_axes") != "xyz": if self._screen.printer.get_stat("toolhead", "homed_axes") != "xyz":
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME) self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
self._screen._ws.klippy.gcode_script( self._screen._ws.klippy.gcode_script("BED_MESH_CALIBRATE")
"BED_MESH_CALIBRATE"
)
# Load zcalibrate to do a manual mesh # Load zcalibrate to do a manual mesh
if not (self._printer.config_section_exists("probe") or self._printer.config_section_exists("bltouch")): if not (self._printer.config_section_exists("probe") or self._printer.config_section_exists("bltouch")):
self.menu_item_clicked(widget, "refresh", {"name": "Mesh calibrate", "panel": "zcalibrate"}) self.menu_item_clicked(widget, "refresh", {"name": _("Mesh calibrate"), "panel": "zcalibrate"})
def _clear_mesh(self, widget): def send_clear_mesh(self, widget):
self._screen._ws.klippy.gcode_script( self._screen._ws.klippy.gcode_script("BED_MESH_CLEAR")
"BED_MESH_CLEAR"
)
def _send_calibrate(self, widget):
if self._screen.printer.get_stat("toolhead", "homed_axes") != "xyz":
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
self._screen._ws.klippy.gcode_script(
"BED_MESH_CALIBRATE"
)
def send_load_mesh(self, widget, profile): def send_load_mesh(self, widget, profile):
self._screen._ws.klippy.gcode_script( self._screen._ws.klippy.gcode_script(KlippyGcodes.bed_mesh_load(profile))
KlippyGcodes.bed_mesh_load(profile)
)
def send_save_mesh(self, widget, profile): def send_save_mesh(self, widget, profile):
self._screen._ws.klippy.gcode_script( self._screen._ws.klippy.gcode_script(KlippyGcodes.bed_mesh_save(profile))
KlippyGcodes.bed_mesh_save(profile)
)
def send_remove_mesh(self, widget, profile): def send_remove_mesh(self, widget, profile):
self._screen._ws.klippy.gcode_script( self._screen._ws.klippy.gcode_script(KlippyGcodes.bed_mesh_remove(profile))
KlippyGcodes.bed_mesh_remove(profile)
)
self.remove_profile(profile) self.remove_profile(profile)
-2
View File
@@ -27,8 +27,6 @@ class ConsolePanel(ScreenPanel):
super().__init__(screen, title, back) super().__init__(screen, title, back)
self.autoscroll = True self.autoscroll = True
self.hidetemps = True self.hidetemps = True
def initialize(self, panel_name):
self._screen._ws.send_method("server.gcode_store", {"count": 100}, self.gcode_response) self._screen._ws.send_method("server.gcode_store", {"count": 100}, self.gcode_response)
o1_lbl = Gtk.Label(_("Auto-scroll")) o1_lbl = Gtk.Label(_("Auto-scroll"))
+2 -1
View File
@@ -11,7 +11,8 @@ def create_panel(*args):
class ExamplePanel(ScreenPanel): class ExamplePanel(ScreenPanel):
def initialize(self, panel_name): def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
# Create gtk items here # Create gtk items here
+15 -10
View File
@@ -29,8 +29,6 @@ class ExcludeObjectPanel(ScreenPanel):
logging.info(f'Excluded: {self.excluded_objects}') logging.info(f'Excluded: {self.excluded_objects}')
self.objects = self._printer.get_stat("exclude_object", "objects") self.objects = self._printer.get_stat("exclude_object", "objects")
self.labels['map'] = None self.labels['map'] = None
def initialize(self, panel_name):
for obj in self.objects: for obj in self.objects:
logging.info(f"Adding {obj['name']}") logging.info(f"Adding {obj['name']}")
self.add_object(obj["name"]) self.add_object(obj["name"])
@@ -38,19 +36,25 @@ class ExcludeObjectPanel(ScreenPanel):
scroll = self._gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.add(self.object_list) scroll.add(self.object_list)
scroll.set_halign(Gtk.Align.CENTER) scroll.set_halign(Gtk.Align.CENTER)
scroll.set_size_request(self._gtk.get_content_width() // 2, 0)
grid = Gtk.Grid() grid = self._gtk.HomogeneousGrid()
grid.set_row_homogeneous(False)
grid.attach(self.current_object, 0, 0, 2, 1) grid.attach(self.current_object, 0, 0, 2, 1)
grid.attach(Gtk.Separator(), 0, 1, 2, 1) grid.attach(Gtk.Separator(), 0, 1, 2, 1)
if self.objects and "polygon" in self.objects[0]: if self.objects and "polygon" in self.objects[0]:
self.labels['map'] = ObjectMap(self._screen, self._printer, self._gtk.get_font_size()) self.labels['map'] = ObjectMap(self._screen, self._printer, self._gtk.get_font_size())
self.labels['map'].set_size_request(self._gtk.get_content_width() // 2, 0) if self._screen.vertical_mode:
grid.attach(self.labels['map'], 0, 2, 1, 1) grid.attach(self.labels['map'], 0, 2, 2, 1)
grid.attach(scroll, 1, 2, 1, 1) grid.attach(scroll, 0, 3, 2, 1)
scroll.set_size_request(self._screen.width, -1)
else:
grid.attach(self.labels['map'], 0, 2, 1, 1)
grid.attach(scroll, 1, 2, 1, 1)
scroll.set_size_request((self._screen.width * .9) // 2, -1)
else: else:
grid.attach(scroll, 0, 2, 2, 1) grid.attach(scroll, 0, 2, 2, 1)
scroll.set_size_request(self._gtk.get_content_width(), -1)
self.content.add(grid) self.content.add(grid)
self.content.show_all() self.content.show_all()
@@ -58,15 +62,14 @@ class ExcludeObjectPanel(ScreenPanel):
def add_object(self, name): def add_object(self, name):
if name not in self.buttons and name not in self.excluded_objects: if name not in self.buttons and name not in self.excluded_objects:
self.buttons[name] = self._gtk.Button(name.replace("_", " ")) self.buttons[name] = self._gtk.Button(name.replace("_", " "))
self.buttons[name].get_children()[0].set_line_wrap_mode(Pango.WrapMode.CHAR) self.buttons[name].get_children()[0].set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
self.buttons[name].get_children()[0].set_line_wrap(True) self.buttons[name].get_children()[0].set_line_wrap(True)
self.buttons[name].connect("clicked", self.exclude_object, name) self.buttons[name].connect("clicked", self.exclude_object, name)
self.buttons[name].set_hexpand(True)
self.buttons[name].get_style_context().add_class("frame-item") self.buttons[name].get_style_context().add_class("frame-item")
self.object_list.add(self.buttons[name]) self.object_list.add(self.buttons[name])
def exclude_object(self, widget, name): def exclude_object(self, widget, name):
if len(self.buttons) == 1: if len(self.excluded_objects) == len(self.objects) - 1:
# Do not exclude the last object, this is a workaround for a bug of klipper that starts # Do not exclude the last object, this is a workaround for a bug of klipper that starts
# to move the toolhead really fast skipping gcode until the file ends # to move the toolhead really fast skipping gcode until the file ends
# Remove this if they fix it. # Remove this if they fix it.
@@ -112,6 +115,8 @@ class ExcludeObjectPanel(ScreenPanel):
if name in self.buttons: if name in self.buttons:
self.object_list.remove(self.buttons[name]) self.object_list.remove(self.buttons[name])
self.update_graph() self.update_graph()
if len(self.excluded_objects) == len(self.objects):
self.menu_return(False)
elif action == "notify_gcode_response" and "Excluding object" in data: elif action == "notify_gcode_response" and "Excluding object" in data:
self._screen.show_popup_message(data, level=1) self._screen.show_popup_message(data, level=1)
self.update_graph() self.update_graph()
+25 -32
View File
@@ -1,5 +1,6 @@
import gi import gi
import logging import logging
import re
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Pango from gi.repository import Gtk, Pango
@@ -17,15 +18,27 @@ class ExtrudePanel(ScreenPanel):
def __init__(self, screen, title, back=True): def __init__(self, screen, title, back=True):
super().__init__(screen, title, back) super().__init__(screen, title, back)
self.current_extruder = self._printer.get_stat("toolhead", "extruder") self.current_extruder = self._printer.get_stat("toolhead", "extruder")
self.speeds = ['1', '2', '5', '25']
self.speed = 1
self.distances = ['5', '10', '15', '25']
self.distance = 5
macros = self._screen.printer.get_gcode_macros() macros = self._screen.printer.get_gcode_macros()
self.load_filament = any("LOAD_FILAMENT" in macro.upper() for macro in macros) self.load_filament = any("LOAD_FILAMENT" in macro.upper() for macro in macros)
self.unload_filament = any("UNLOAD_FILAMENT" in macro.upper() for macro in macros) self.unload_filament = any("UNLOAD_FILAMENT" in macro.upper() for macro in macros)
def initialize(self, panel_name): self.speeds = ['1', '2', '5', '25']
self.distances = ['5', '10', '15', '25']
print_cfg = self._config.get_printer_config(self._screen.connected_printer)
if print_cfg is not None:
dis = print_cfg.get("extrude_distances", '5, 10, 15, 25')
if re.match(r'^[0-9,\s]+$', dis):
dis = [str(i.strip()) for i in dis.split(',')]
if 1 < len(dis) < 5:
self.distances = dis
vel = print_cfg.get("extrude_speeds", '1, 2, 5, 25')
if re.match(r'^[0-9,\s]+$', vel):
vel = [str(i.strip()) for i in vel.split(',')]
if 1 < len(vel) < 5:
self.speeds = vel
self.distance = int(self.distances[1])
self.speed = int(self.speeds[1])
self.labels['extrude'] = self._gtk.ButtonImage("extrude", _("Extrude"), "color4") self.labels['extrude'] = self._gtk.ButtonImage("extrude", _("Extrude"), "color4")
self.labels['extrude'].connect("clicked", self.extrude, "+") self.labels['extrude'].connect("clicked", self.extrude, "+")
self.labels['load'] = self._gtk.ButtonImage("arrow-down", _("Load"), "color3") self.labels['load'] = self._gtk.ButtonImage("arrow-down", _("Load"), "color3")
@@ -62,7 +75,7 @@ class ExtrudePanel(ScreenPanel):
distgrid = Gtk.Grid() distgrid = Gtk.Grid()
for j, i in enumerate(self.distances): for j, i in enumerate(self.distances):
self.labels[f"dist{i}"] = self._gtk.ToggleButton(i) self.labels[f"dist{i}"] = self._gtk.Button(i)
self.labels[f"dist{i}"].connect("clicked", self.change_distance, int(i)) self.labels[f"dist{i}"].connect("clicked", self.change_distance, int(i))
ctx = self.labels[f"dist{i}"].get_style_context() ctx = self.labels[f"dist{i}"].get_style_context()
if ((self._screen.lang_ltr is True and j == 0) or if ((self._screen.lang_ltr is True and j == 0) or
@@ -73,14 +86,13 @@ class ExtrudePanel(ScreenPanel):
ctx.add_class("distbutton_bottom") ctx.add_class("distbutton_bottom")
else: else:
ctx.add_class("distbutton") ctx.add_class("distbutton")
if i == "5": if int(i) == self.distance:
ctx.add_class("distbutton_active") ctx.add_class("distbutton_active")
distgrid.attach(self.labels[f"dist{i}"], j, 0, 1, 1) distgrid.attach(self.labels[f"dist{i}"], j, 0, 1, 1)
self.labels["dist5"].set_active(True)
speedgrid = Gtk.Grid() speedgrid = Gtk.Grid()
for j, i in enumerate(self.speeds): for j, i in enumerate(self.speeds):
self.labels[f"speed{i}"] = self._gtk.ToggleButton(_(i)) self.labels[f"speed{i}"] = self._gtk.Button(i)
self.labels[f"speed{i}"].connect("clicked", self.change_speed, int(i)) self.labels[f"speed{i}"].connect("clicked", self.change_speed, int(i))
ctx = self.labels[f"speed{i}"].get_style_context() ctx = self.labels[f"speed{i}"].get_style_context()
if ((self._screen.lang_ltr is True and j == 0) or if ((self._screen.lang_ltr is True and j == 0) or
@@ -91,10 +103,9 @@ class ExtrudePanel(ScreenPanel):
ctx.add_class("distbutton_bottom") ctx.add_class("distbutton_bottom")
else: else:
ctx.add_class("distbutton") ctx.add_class("distbutton")
if i == "2": if int(i) == self.speed:
ctx.add_class("distbutton_active") ctx.add_class("distbutton_active")
speedgrid.attach(self.labels[f"speed{i}"], j, 0, 1, 1) speedgrid.attach(self.labels[f"speed{i}"], j, 0, 1, 1)
self.labels["speed2"].set_active(True)
distbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) distbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['extrude_dist'] = Gtk.Label(_("Distance (mm)")) self.labels['extrude_dist'] = Gtk.Label(_("Distance (mm)"))
@@ -197,20 +208,10 @@ class ExtrudePanel(ScreenPanel):
logging.info(f"{x}: Filament detected: {data[x]['filament_detected']}") logging.info(f"{x}: Filament detected: {data[x]['filament_detected']}")
def change_distance(self, widget, distance): def change_distance(self, widget, distance):
if self.distance == distance:
return
logging.info(f"### Distance {distance}") logging.info(f"### Distance {distance}")
self.labels[f"dist{self.distance}"].get_style_context().remove_class("distbutton_active")
ctx = self.labels[f"dist{self.distance}"].get_style_context() self.labels[f"dist{distance}"].get_style_context().add_class("distbutton_active")
ctx.remove_class("distbutton_active")
self.distance = distance self.distance = distance
ctx = self.labels[f"dist{self.distance}"].get_style_context()
ctx.add_class("distbutton_active")
for i in self.distances:
if i == self.distance:
continue
self.labels[f"dist{i}"].set_active(False)
def change_extruder(self, widget, extruder): def change_extruder(self, widget, extruder):
logging.info(f"Changing extruder to {extruder}") logging.info(f"Changing extruder to {extruder}")
@@ -221,18 +222,10 @@ class ExtrudePanel(ScreenPanel):
self._screen._ws.klippy.gcode_script(f"T{self._printer.get_tool_number(extruder)}") self._screen._ws.klippy.gcode_script(f"T{self._printer.get_tool_number(extruder)}")
def change_speed(self, widget, speed): def change_speed(self, widget, speed):
if self.speed == speed:
return
logging.info(f"### Speed {speed}") logging.info(f"### Speed {speed}")
self.labels[f"speed{self.speed}"].get_style_context().remove_class("distbutton_active") self.labels[f"speed{self.speed}"].get_style_context().remove_class("distbutton_active")
self.labels[f"speed{speed}"].get_style_context().add_class("distbutton_active")
self.speed = speed self.speed = speed
self.labels[f"speed{self.speed}"].get_style_context().add_class("distbutton_active")
for i in self.speeds:
if i == self.speed:
continue
self.labels[f"speed{i}"].set_active(False)
def extrude(self, widget, direction): def extrude(self, widget, direction):
self._screen._ws.klippy.gcode_script(KlippyGcodes.EXTRUDE_REL) self._screen._ws.klippy.gcode_script(KlippyGcodes.EXTRUDE_REL)
+2 -3
View File
@@ -16,10 +16,9 @@ CHANGEABLE_FANS = ["fan", "fan_generic"]
class FanPanel(ScreenPanel): class FanPanel(ScreenPanel):
def __init__(self, screen, title, back=True):
def initialize(self, panel_name): super().__init__(screen, title, back)
self.fan_speed = {} self.fan_speed = {}
self.user_selecting = False
self.devices = {} self.devices = {}
# Create a grid for all devices # Create a grid for all devices
self.labels['devices'] = Gtk.Grid() self.labels['devices'] = Gtk.Grid()
+23 -49
View File
@@ -15,34 +15,29 @@ def create_panel(*args):
class FineTunePanel(ScreenPanel): class FineTunePanel(ScreenPanel):
user_selecting = False
bs = 0
bs_delta = "0.05"
bs_deltas = ["0.01", "0.05"] bs_deltas = ["0.01", "0.05"]
percent_delta = 1 bs_delta = bs_deltas[-1]
percent_deltas = ['1', '5', '10', '25'] percent_deltas = ['1', '5', '10', '25']
extrusion = 100 percent_delta = percent_deltas[-2]
speed = 100 speed = extrusion = 100
def initialize(self, panel_name):
logging.debug("FineTunePanel")
def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
print_cfg = self._config.get_printer_config(self._screen.connected_printer) print_cfg = self._config.get_printer_config(self._screen.connected_printer)
if print_cfg is not None: if print_cfg is not None:
bs = print_cfg.get("z_babystep_values", "0.01, 0.05") bs = print_cfg.get("z_babystep_values", "0.01, 0.05")
if re.match(r'^[0-9,\.\s]+$', bs): if re.match(r'^[0-9,\.\s]+$', bs):
bs = [str(i.strip()) for i in bs.split(',')] bs = [str(i.strip()) for i in bs.split(',')]
self.bs_deltas = bs if len(bs) <= 2 else [bs[0], bs[-1]] if 1 < len(bs) < 3:
self.bs_delta = self.bs_deltas[0] self.bs_deltas = bs
self.bs_delta = self.bs_deltas[-1]
# babystepping grid # babystepping grid
bsgrid = Gtk.Grid() bsgrid = Gtk.Grid()
for j, i in enumerate(self.bs_deltas): for j, i in enumerate(self.bs_deltas):
self.labels[i] = self._gtk.ToggleButton(i) self.labels[f"bdelta{i}"] = self._gtk.Button(i)
self.labels[i].connect("clicked", self.change_bs_delta, i) self.labels[f"bdelta{i}"].connect("clicked", self.change_bs_delta, float(i))
ctx = self.labels[i].get_style_context() ctx = self.labels[f"bdelta{i}"].get_style_context()
if j == 0: if j == 0:
ctx.add_class("distbutton_top") ctx.add_class("distbutton_top")
elif j == len(self.bs_deltas) - 1: elif j == len(self.bs_deltas) - 1:
@@ -51,23 +46,22 @@ class FineTunePanel(ScreenPanel):
ctx.add_class("distbutton") ctx.add_class("distbutton")
if i == self.bs_delta: if i == self.bs_delta:
ctx.add_class("distbutton_active") ctx.add_class("distbutton_active")
bsgrid.attach(self.labels[i], j, 0, 1, 1) bsgrid.attach(self.labels[f"bdelta{i}"], j, 0, 1, 1)
# Grid for percentage # Grid for percentage
deltgrid = Gtk.Grid() deltgrid = Gtk.Grid()
for j, i in enumerate(self.percent_deltas): for j, i in enumerate(self.percent_deltas):
self.labels[i] = self._gtk.ToggleButton(f"{i}%") self.labels[f"pdelta{i}"] = self._gtk.Button(f"{i}%")
self.labels[i].connect("clicked", self.change_percent_delta, i) self.labels[f"pdelta{i}"].connect("clicked", self.change_percent_delta, int(i))
ctx = self.labels[i].get_style_context() ctx = self.labels[f"pdelta{i}"].get_style_context()
if j == 0: if j == 0:
ctx.add_class("distbutton_top") ctx.add_class("distbutton_top")
elif j == len(self.percent_deltas) - 1: elif j == len(self.percent_deltas) - 1:
ctx.add_class("distbutton_bottom") ctx.add_class("distbutton_bottom")
else: else:
ctx.add_class("distbutton") ctx.add_class("distbutton")
if i == "1": if i == self.percent_delta:
ctx.add_class("distbutton_active") ctx.add_class("distbutton_active")
deltgrid.attach(self.labels[i], j, 0, 1, 1) deltgrid.attach(self.labels[f"pdelta{i}"], j, 0, 1, 1)
self.labels["1"].set_active(True)
grid = self._gtk.HomogeneousGrid() grid = self._gtk.HomogeneousGrid()
grid.set_row_homogeneous(False) grid.set_row_homogeneous(False)
@@ -169,26 +163,16 @@ class FineTunePanel(ScreenPanel):
self._screen._ws.klippy.gcode_script(f"SET_GCODE_OFFSET Z_ADJUST={direction}{self.bs_delta} MOVE=1") self._screen._ws.klippy.gcode_script(f"SET_GCODE_OFFSET Z_ADJUST={direction}{self.bs_delta} MOVE=1")
def change_bs_delta(self, widget, bs): def change_bs_delta(self, widget, bs):
if self.bs_delta == bs:
return
logging.info(f"### BabyStepping {bs}") logging.info(f"### BabyStepping {bs}")
self.labels[f"bdelta{self.bs_delta}"].get_style_context().remove_class("distbutton_active")
ctx = self.labels[f"{self.bs_delta}"].get_style_context() self.labels[f"bdelta{bs}"].get_style_context().add_class("distbutton_active")
ctx.remove_class("distbutton_active")
self.bs_delta = bs self.bs_delta = bs
ctx = self.labels[self.bs_delta].get_style_context()
ctx.add_class("distbutton_active")
for i in self.bs_deltas:
if i == self.bs_delta:
continue
self.labels[i].set_active(False)
def change_extrusion(self, widget, direction): def change_extrusion(self, widget, direction):
if direction == "+": if direction == "+":
self.extrusion += int(self.percent_delta) self.extrusion += self.percent_delta
elif direction == "-": elif direction == "-":
self.extrusion -= int(self.percent_delta) self.extrusion -= self.percent_delta
elif direction == "reset": elif direction == "reset":
self.extrusion = 100 self.extrusion = 100
@@ -209,17 +193,7 @@ class FineTunePanel(ScreenPanel):
self._screen._ws.klippy.gcode_script(KlippyGcodes.set_speed_rate(self.speed)) self._screen._ws.klippy.gcode_script(KlippyGcodes.set_speed_rate(self.speed))
def change_percent_delta(self, widget, delta): def change_percent_delta(self, widget, delta):
if self.percent_delta == delta:
return
logging.info(f"### Delta {delta}") logging.info(f"### Delta {delta}")
self.labels[f"pdelta{self.percent_delta}"].get_style_context().remove_class("distbutton_active")
ctx = self.labels[f"{self.percent_delta}"].get_style_context() self.labels[f"pdelta{delta}"].get_style_context().add_class("distbutton_active")
ctx.remove_class("distbutton_active")
self.percent_delta = delta self.percent_delta = delta
ctx = self.labels[self.percent_delta].get_style_context()
ctx.add_class("distbutton_active")
for i in self.percent_deltas:
if i == self.percent_delta:
continue
self.labels[f"{i}"].set_active(False)
+2 -4
View File
@@ -23,8 +23,6 @@ class MacroPanel(ScreenPanel):
self.loaded_macros = [] self.loaded_macros = []
self.macros = {} self.macros = {}
self.menu = ['macros_menu'] self.menu = ['macros_menu']
def initialize(self, panel_name):
sort = Gtk.Label(_("Sort:")) sort = Gtk.Label(_("Sort:"))
sort.set_hexpand(False) sort.set_hexpand(False)
@@ -104,9 +102,9 @@ class MacroPanel(ScreenPanel):
def change_sort(self, widget): def change_sort(self, widget):
self.sort_reverse ^= True self.sort_reverse ^= True
if self.sort_reverse: if self.sort_reverse:
self.sort_btn.set_image(self._gtk.Image("arrow-down", .5)) self.sort_btn.set_image(self._gtk.Image("arrow-down", self._gtk.img_scale * .5))
else: else:
self.sort_btn.set_image(self._gtk.Image("arrow-up", .5)) self.sort_btn.set_image(self._gtk.Image("arrow-up", self._gtk.img_scale * .5))
self.sort_btn.show() self.sort_btn.show()
GLib.idle_add(self.reload_macros) GLib.idle_add(self.reload_macros)
+29 -36
View File
@@ -34,11 +34,6 @@ class InputShaperPanel(ScreenPanel):
self.status.set_halign(Gtk.Align.START) self.status.set_halign(Gtk.Align.START)
self.status.set_ellipsize(Pango.EllipsizeMode.END) self.status.set_ellipsize(Pango.EllipsizeMode.END)
self.calibrating_axis = None self.calibrating_axis = None
self.has_sensor = False
def initialize(self, panel_name):
self.has_sensor = False
self.calibrating_axis = None self.calibrating_axis = None
auto_calibration_label = Gtk.Label() auto_calibration_label = Gtk.Label()
@@ -127,7 +122,7 @@ class InputShaperPanel(ScreenPanel):
if method == "both": if method == "both":
self._screen._ws.klippy.gcode_script('SHAPER_CALIBRATE') self._screen._ws.klippy.gcode_script('SHAPER_CALIBRATE')
self.calibrate_btn.set_label(self.lang.gettext('Calibrating...')) self.calibrate_btn.set_label(_('Calibrating...'))
self.calibrate_btn.set_sensitive(False) self.calibrate_btn.set_sensitive(False)
def set_opt_value(self, widget, opt, *args): def set_opt_value(self, widget, opt, *args):
@@ -169,34 +164,32 @@ class InputShaperPanel(ScreenPanel):
) )
def process_update(self, action, data): def process_update(self, action, data):
if action != "notify_gcode_response":
if action == "notify_gcode_response": return
self.status.set_text(f"{data.replace('shaper_', '').replace('damping_', '')}") self.status.set_text(f"{data.replace('shaper_', '').replace('damping_', '')}")
data = data.lower() data = data.lower()
if 'got 0' in data: if 'got 0' in data:
self.calibrate_btn.set_label(_('Check ADXL Wiring')) self.calibrate_btn.set_label(_('Check ADXL Wiring'))
self.calibrate_btn.set_sensitive(False) self.calibrate_btn.set_sensitive(False)
if 'unknown command:"accelerometer_query"' in data: if 'unknown command:"accelerometer_query"' in data:
self.calibrate_btn.set_label(_('ADXL Not Configured')) self.calibrate_btn.set_label(_('ADXL Not Configured'))
self.calibrate_btn.set_sensitive(False) self.calibrate_btn.set_sensitive(False)
if 'adxl345 values' in data or 'axes noise' in data: 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'] or (self.calibrating_axis == "both" and results['axis'] == 'y'):
self.calibrate_btn.set_sensitive(True) self.calibrate_btn.set_sensitive(True)
self.calibrate_btn.set_label(_('Auto-calibrate')) self.calibrate_btn.set_label(_('Calibrated'))
# Recommended shaper_type_y = ei, shaper_freq_y = 48.4 Hz self.save_config()
if 'recommended shaper_type_' in data: # shaper_type_y:ei shaper_freq_y:48.400 damping_ratio_y:0.100000
results = re.search(r'shaper_type_(?P<axis>[xy])\s*=\s*(?P<shaper_type>.*?), shaper_freq_.\s*=\s*(' if 'shaper_type_' in data:
r'?P<shaper_freq>[0-9.]+)', data).groupdict() results = re.search(r'shaper_type_(?P<axis>[xy]):(?P<shaper_type>.*?) shaper_freq_.:('
self.freq_xy_adj['shaper_freq_' + results['axis']].set_value(float(results['shaper_freq'])) r'?P<shaper_freq>[0-9.]+)', data).groupdict()
self.freq_xy_combo['shaper_type_' + results['axis']].set_active(SHAPERS.index(results['shaper_type'])) self.freq_xy_adj['shaper_freq_' + results['axis']].set_value(float(results['shaper_freq']))
if self.calibrating_axis == results['axis'] \ self.freq_xy_combo['shaper_type_' + results['axis']].set_active(SHAPERS.index(results['shaper_type']))
or (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']))
+52 -58
View File
@@ -7,8 +7,9 @@ import contextlib
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import GLib, Gtk, Pango from gi.repository import GLib, Gtk, Pango
from numpy import sqrt, pi, dot, array, median
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
from math import pi, sqrt
from statistics import median
def create_panel(*args): def create_panel(*args):
@@ -18,6 +19,14 @@ def create_panel(*args):
class JobStatusPanel(ScreenPanel): class JobStatusPanel(ScreenPanel):
def __init__(self, screen, title, back=False): def __init__(self, screen, title, back=False):
super().__init__(screen, title, False) super().__init__(screen, title, False)
self.extrusion_button = None
self.elapsed_button = None
self.left_button = None
self.fan_button = None
self.speed_button = None
self.z_button = None
self.heater_button = None
self.extruder_button = None
self.grid = self._gtk.HomogeneousGrid() self.grid = self._gtk.HomogeneousGrid()
self.grid.set_row_homogeneous(False) self.grid.set_row_homogeneous(False)
self.pos_z = 0 self.pos_z = 0
@@ -29,10 +38,9 @@ class JobStatusPanel(ScreenPanel):
self.oheight = 0 self.oheight = 0
self.current_extruder = None self.current_extruder = None
self.fila_section = 0 self.fila_section = 0
self.buttons = None self.buttons = {}
self.is_paused = False
self.filename_label = self.filename = self.prev_pos = self.prev_gpos = None self.filename_label = self.filename = self.prev_pos = self.prev_gpos = None
self.state_timeout = self.close_timeout = self.vel_timeout = self.animation_timeout = None self.close_timeout = self.vel_timeout = self.animation_timeout = None
self.file_metadata = self.fans = {} self.file_metadata = self.fans = {}
self.state = "standby" self.state = "standby"
self.timeleft_type = "auto" self.timeleft_type = "auto"
@@ -40,8 +48,6 @@ class JobStatusPanel(ScreenPanel):
self.main_status_displayed = True self.main_status_displayed = True
self.velstore = self.flowstore = [] self.velstore = self.flowstore = []
def initialize(self, panel_name):
data = ['pos_x', 'pos_y', 'pos_z', 'time_left', 'duration', 'slicer_time', 'file_time', data = ['pos_x', 'pos_y', 'pos_z', 'time_left', 'duration', 'slicer_time', 'file_time',
'filament_time', 'est_time', 'speed_factor', 'req_speed', 'max_accel', 'extrude_factor', 'zoffset', 'filament_time', 'est_time', 'speed_factor', 'req_speed', 'max_accel', 'extrude_factor', 'zoffset',
'zoffset', 'filament_used', 'filament_total', 'advance', 'fan', 'layer', 'total_layers', 'height', 'zoffset', 'filament_used', 'filament_total', 'advance', 'fan', 'layer', 'total_layers', 'height',
@@ -119,12 +125,7 @@ class JobStatusPanel(ScreenPanel):
overlay.add(self.labels['darea']) overlay.add(self.labels['darea'])
overlay.add_overlay(box) overlay.add_overlay(box)
self.labels['thumbnail'] = self._gtk.Image("file", 2) self.labels['thumbnail'] = self._gtk.Image("file", self._screen.width / 4, self._screen.height / 4)
if self._screen.vertical_mode:
self.labels['thumbnail'].set_size_request(0, self._screen.height / 4)
else:
self.labels['thumbnail'].set_size_request(self._screen.width / 3, 0)
self.labels['info_grid'] = Gtk.Grid() self.labels['info_grid'] = Gtk.Grid()
self.labels['info_grid'].attach(self.labels['thumbnail'], 0, 0, 1, 1) self.labels['info_grid'].attach(self.labels['thumbnail'], 0, 0, 1, 1)
if self._screen.printer.get_tools(): if self._screen.printer.get_tools():
@@ -139,7 +140,6 @@ class JobStatusPanel(ScreenPanel):
self.grid.attach(self.buttons['button_grid'], 0, 3, 4, 1) self.grid.attach(self.buttons['button_grid'], 0, 3, 4, 1)
self.content.add(self.grid) self.content.add(self.grid)
self._screen.wake_screen()
def create_status_grid(self, widget=None): def create_status_grid(self, widget=None):
self.main_status_displayed = True self.main_status_displayed = True
@@ -365,11 +365,10 @@ class JobStatusPanel(ScreenPanel):
def activate(self): def activate(self):
ps = self._printer.get_stat("print_stats") ps = self._printer.get_stat("print_stats")
self.set_state(ps['state']) self.set_state(ps['state'])
if self.state_timeout is None:
self.state_timeout = GLib.timeout_add_seconds(1, self.state_check)
self.create_status_grid() self.create_status_grid()
if self.vel_timeout is None: if self.vel_timeout is None:
self.vel_timeout = GLib.timeout_add_seconds(1, self.update_velocity) self.vel_timeout = GLib.timeout_add_seconds(1, self.update_velocity)
self._screen.base_panel_show_all()
def deactivate(self): def deactivate(self):
if self.vel_timeout is not None: if self.vel_timeout is not None:
@@ -401,7 +400,6 @@ class JobStatusPanel(ScreenPanel):
self.buttons['save_offset_endstop'].connect("clicked", self.save_offset, "endstop") self.buttons['save_offset_endstop'].connect("clicked", self.save_offset, "endstop")
def save_offset(self, widget, device): def save_offset(self, widget, device):
saved_z_offset = 0 saved_z_offset = 0
if self._printer.config_section_exists("probe"): if self._printer.config_section_exists("probe"):
saved_z_offset = float(self._screen.printer.get_config_section("probe")['z_offset']) saved_z_offset = float(self._screen.printer.get_config_section("probe")['z_offset'])
@@ -454,7 +452,6 @@ class JobStatusPanel(ScreenPanel):
self._screen.show_all() self._screen.show_all()
def cancel(self, widget): def cancel(self, widget):
buttons = [ buttons = [
{"name": _("Cancel Print"), "response": Gtk.ResponseType.OK}, {"name": _("Cancel Print"), "response": Gtk.ResponseType.OK},
{"name": _("Go Back"), "response": Gtk.ResponseType.CANCEL} {"name": _("Go Back"), "response": Gtk.ResponseType.CANCEL}
@@ -471,7 +468,6 @@ class JobStatusPanel(ScreenPanel):
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
self._gtk.Dialog(self._screen, buttons, label, self.cancel_confirm) self._gtk.Dialog(self._screen, buttons, label, self.cancel_confirm)
self.disable_button("pause", "cancel")
def cancel_confirm(self, widget, response_id): def cancel_confirm(self, widget, response_id):
widget.destroy() widget.destroy()
@@ -497,8 +493,9 @@ class JobStatusPanel(ScreenPanel):
logging.debug("Closing job_status panel") logging.debug("Closing job_status panel")
self.remove_close_timeout() self.remove_close_timeout()
self.state_check() self.state_check()
if self.state not in ["printing", "paused"]: if self.state not in ["printing", "paused", "cancelling"]:
self._screen.printer_ready() self._screen.printer_ready()
self._printer.change_state("ready")
return False return False
def remove_close_timeout(self): def remove_close_timeout(self):
@@ -521,9 +518,7 @@ class JobStatusPanel(ScreenPanel):
def new_print(self): def new_print(self):
self.remove_close_timeout() self.remove_close_timeout()
if self.state_timeout is None: self._screen.close_screensaver()
self.state_timeout = GLib.timeout_add_seconds(1, self.state_check)
self._screen.wake_screen()
self.state_check() self.state_check()
def process_update(self, action, data): def process_update(self, action, data):
@@ -584,11 +579,12 @@ class JobStatusPanel(ScreenPanel):
if self.prev_gpos is not None: if self.prev_gpos is not None:
interval = now - self.prev_gpos[1] interval = now - self.prev_gpos[1]
# Calculate Velocity # Calculate Velocity
vel = [(pos[0] - self.prev_gpos[0][0]), vel = sqrt(sum([
(pos[1] - self.prev_gpos[0][1]), (pos[0] - self.prev_gpos[0][0]) ** 2,
(pos[2] - self.prev_gpos[0][2])] (pos[1] - self.prev_gpos[0][1]) ** 2,
vel = array(vel) (pos[2] - self.prev_gpos[0][2]) ** 2]
self.velstore.append(sqrt(vel.dot(vel)) / interval) )) / interval
self.velstore.append(vel)
self.prev_gpos = [pos, now] self.prev_gpos = [pos, now]
with contextlib.suppress(KeyError): with contextlib.suppress(KeyError):
self.extrusion = int(round(data["gcode_move"]["extrude_factor"] * 100)) self.extrusion = int(round(data["gcode_move"]["extrude_factor"] * 100))
@@ -614,11 +610,12 @@ class JobStatusPanel(ScreenPanel):
evelocity = (pos[3] - self.prev_pos[0][3]) / interval evelocity = (pos[3] - self.prev_pos[0][3]) / interval
self.flowstore.append(self.fila_section * evelocity) self.flowstore.append(self.fila_section * evelocity)
# Calculate Velocity # Calculate Velocity
vel = [(pos[0] - self.prev_pos[0][0]), vel = sqrt(sum([
(pos[1] - self.prev_pos[0][1]), (pos[0] - self.prev_pos[0][0]) ** 2,
(pos[2] - self.prev_pos[0][2])] (pos[1] - self.prev_pos[0][1]) ** 2,
vel = array(vel) (pos[2] - self.prev_pos[0][2]) ** 2]
self.velstore.append(sqrt(vel.dot(vel)) / interval) )) / interval
self.velstore.append(vel)
self.prev_pos = [pos, now] self.prev_pos = [pos, now]
with contextlib.suppress(KeyError): with contextlib.suppress(KeyError):
self.velstore.append(float(data["motion_report"]["live_velocity"])) self.velstore.append(float(data["motion_report"]["live_velocity"]))
@@ -634,12 +631,6 @@ class JobStatusPanel(ScreenPanel):
if fan_label: if fan_label:
self.labels['fan'].set_text(fan_label[:12]) self.labels['fan'].set_text(fan_label[:12])
if "layer_height" in self.file_metadata and "object_height" in self.file_metadata:
layer_label = (
f"{1 + round((self.pos_z - self.f_layer_h) / self.layer_h)} / {self.labels['total_layers'].get_text()}"
)
self.labels['layer'].set_label(layer_label)
self.state_check() self.state_check()
if self.state not in ["printing", "paused"]: if self.state not in ["printing", "paused"]:
return return
@@ -650,6 +641,14 @@ class JobStatusPanel(ScreenPanel):
self.update_filename() self.update_filename()
else: else:
self.update_percent_complete() self.update_percent_complete()
if 'info' in ps and 'total_layer' in ps['info'] and ps['info']['total_layer'] is not None:
self.labels['total_layers'].set_label(f"{ps['info']['total_layer']}")
if 'info' in ps and 'current_layer' in ps['info'] and ps['info']['current_layer'] is not None:
self.labels['layer'].set_label(f"{ps['info']['current_layer']} / {self.labels['total_layers'].get_text()}")
elif "layer_height" in self.file_metadata and "object_height" in self.file_metadata:
self.labels['layer'].set_label(
f"{1 + round((self.pos_z - self.f_layer_h) / self.layer_h)} / {self.labels['total_layers'].get_text()}")
if 'print_duration' in ps: if 'print_duration' in ps:
if int(ps['print_duration']) == 0 and self.progress > 0.001: if int(ps['print_duration']) == 0 and self.progress > 0.001:
# Print duration remains at 0 when using No-extusion tests # Print duration remains at 0 when using No-extusion tests
@@ -674,8 +673,8 @@ class JobStatusPanel(ScreenPanel):
self.velstore.append(0) self.velstore.append(0)
if not self.flowstore: if not self.flowstore:
self.flowstore.append(0) self.flowstore.append(0)
self.flowrate = median(array(self.flowstore)) self.flowrate = median(self.flowstore)
self.vel = median(array(self.velstore)) self.vel = median(self.velstore)
self.velstore = [] self.velstore = []
self.flowstore = [] self.flowstore = []
self.labels['flowrate'].set_label(f"{self.flowrate:.1f} mm³/s") self.labels['flowrate'].set_label(f"{self.flowrate:.1f} mm³/s")
@@ -748,13 +747,11 @@ class JobStatusPanel(ScreenPanel):
self.set_state("complete") self.set_state("complete")
return self._add_timeout("job_complete_timeout") return self._add_timeout("job_complete_timeout")
elif ps['state'] == "error": elif ps['state'] == "error":
logging.debug("Error!")
self.set_state("error") self.set_state("error")
self.labels['status'].set_text(_("Error")) self.labels['status'].set_text(_("Error"))
self._screen.show_popup_message(ps['message']) self._screen.show_popup_message(ps['message'])
return self._add_timeout("job_error_timeout") return self._add_timeout("job_error_timeout")
elif ps['state'] == "cancelled": elif ps['state'] == "cancelled":
# Print was cancelled
self.set_state("cancelled") self.set_state("cancelled")
return self._add_timeout("job_cancelled_timeout") return self._add_timeout("job_cancelled_timeout")
elif ps['state'] == "paused": elif ps['state'] == "paused":
@@ -764,7 +761,7 @@ class JobStatusPanel(ScreenPanel):
return True return True
def _add_timeout(self, job_timeout): def _add_timeout(self, job_timeout):
self._screen.wake_screen() self._screen.close_screensaver()
self.remove_close_timeout() self.remove_close_timeout()
timeout = self._config.get_main_config().getint(job_timeout, 0) timeout = self._config.get_main_config().getint(job_timeout, 0)
if timeout != 0: if timeout != 0:
@@ -772,7 +769,6 @@ class JobStatusPanel(ScreenPanel):
return False return False
def set_state(self, state): def set_state(self, state):
if self.state != state: if self.state != state:
logging.debug(f"Changing job_status state from '{self.state}' to '{state}'") logging.debug(f"Changing job_status state from '{self.state}' to '{state}'")
if state == "paused": if state == "paused":
@@ -821,12 +817,19 @@ class JobStatusPanel(ScreenPanel):
if self.filename is not None: if self.filename is not None:
self.buttons['button_grid'].attach(self.buttons['restart'], 2, 0, 1, 1) self.buttons['button_grid'].attach(self.buttons['restart'], 2, 0, 1, 1)
self.buttons['button_grid'].attach(self.buttons['menu'], 3, 0, 1, 1) if self.state != "cancelling":
self.buttons['button_grid'].attach(self.buttons['menu'], 3, 0, 1, 1)
self.show_all() self.show_all()
def show_file_thumbnail(self): def show_file_thumbnail(self):
if self._files.has_thumbnail(self.filename): if self._files.has_thumbnail(self.filename):
pixbuf = self.get_file_image(self.filename, 5, 4) if self._screen.vertical_mode:
width = self._screen.width * 0.9
height = self._screen.height / 4
else:
width = self._screen.width / 3
height = self._gtk.get_content_height() * 0.47
pixbuf = self.get_file_image(self.filename, width, height)
if pixbuf is not None: if pixbuf is not None:
self.labels['thumbnail'].set_from_pixbuf(pixbuf) self.labels['thumbnail'].set_from_pixbuf(pixbuf)
@@ -837,11 +840,9 @@ class JobStatusPanel(ScreenPanel):
"complete": self.labels['file'].get_label(), "complete": self.labels['file'].get_label(),
"current": self.labels['file'].get_label(), "current": self.labels['file'].get_label(),
"position": 0, "position": 0,
"limit": 0.8 * (self._gtk.get_content_width() - self.labels[ "limit": (self._screen.width * 24 / 480) // (self._gtk.get_font_size() / 11),
'darea'].get_allocated_width()) // self._gtk.get_font_size(),
"length": len(self.labels['file'].get_label()) "length": len(self.labels['file'].get_label())
} }
if self.animation_timeout is None and (self.filename_label['length'] - self.filename_label['limit']) > 0: if self.animation_timeout is None and (self.filename_label['length'] - self.filename_label['limit']) > 0:
self.animation_timeout = GLib.timeout_add_seconds(1, self.animate_label) self.animation_timeout = GLib.timeout_add_seconds(1, self.animate_label)
self.update_percent_complete() self.update_percent_complete()
@@ -849,14 +850,11 @@ class JobStatusPanel(ScreenPanel):
def animate_label(self): def animate_label(self):
pos = self.filename_label['position'] pos = self.filename_label['position']
current = self.filename_label['current']
complete = self.filename_label['complete']
if pos > (self.filename_label['length'] - self.filename_label['limit']): if pos > (self.filename_label['length'] - self.filename_label['limit']):
self.filename_label['position'] = 0 self.filename_label['position'] = 0
self.labels['file'].set_label(complete) self.labels['file'].set_label(self.filename_label['complete'])
else: else:
self.labels['file'].set_label(current[pos:self.filename_label['length']]) self.labels['file'].set_label(self.filename_label['current'][pos:self.filename_label['length']])
self.filename_label['position'] += 1 self.filename_label['position'] += 1
return True return True
@@ -884,10 +882,6 @@ class JobStatusPanel(ScreenPanel):
logging.debug("Cannot find file metadata. Listening for updated metadata") logging.debug("Cannot find file metadata. Listening for updated metadata")
self._screen.files.add_file_callback(self._callback_metadata) self._screen.files.add_file_callback(self._callback_metadata)
def update_image_text(self, label, text):
if label in self.labels and 'l' in self.labels[label]:
self.labels[label]['l'].set_text(text)
def update_percent_complete(self): def update_percent_complete(self):
if self.state not in ["printing", "paused"]: if self.state not in ["printing", "paused"]:
return return
+10 -8
View File
@@ -16,14 +16,9 @@ class LimitsPanel(ScreenPanel):
def __init__(self, screen, title, back=True): def __init__(self, screen, title, back=True):
super().__init__(screen, title, back) super().__init__(screen, title, back)
self.limits = {} self.limits = {}
self.grid = Gtk.Grid()
self.options = None self.options = None
self.values = {} self.values = {}
self.grid = Gtk.Grid()
def initialize(self, panel_name):
scroll = self._gtk.ScrolledWindow()
scroll.add(self.grid)
conf = self._printer.get_config_section("printer") conf = self._printer.get_config_section("printer")
self.options = [ self.options = [
@@ -42,6 +37,8 @@ class LimitsPanel(ScreenPanel):
for opt in self.options: for opt in self.options:
self.add_option(opt['option'], opt['name'], opt['units'], opt['max']) self.add_option(opt['option'], opt['name'], opt['units'], opt['max'])
scroll = self._gtk.ScrolledWindow()
scroll.add(self.grid)
self.content.add(scroll) self.content.add(scroll)
self.content.show_all() self.content.show_all()
@@ -67,8 +64,11 @@ class LimitsPanel(ScreenPanel):
if opt["option"] == option: if opt["option"] == option:
if self.values[option] > opt["max"]: if self.values[option] > opt["max"]:
self.limits[option]['scale'].get_style_context().add_class("option_slider_max") self.limits[option]['scale'].get_style_context().add_class("option_slider_max")
# Infinite scale
self.limits[option]['adjustment'].set_upper(self.values[option] * 1.5)
else: else:
self.limits[option]['scale'].get_style_context().remove_class("option_slider_max") self.limits[option]['scale'].get_style_context().remove_class("option_slider_max")
self.limits[option]['adjustment'].set_upper(opt["max"] * 1.5)
self.limits[option]['scale'].connect("button-release-event", self.set_opt_value, option) self.limits[option]['scale'].connect("button-release-event", self.set_opt_value, option)
def add_option(self, option, optname, units, value): def add_option(self, option, optname, units, value):
@@ -83,8 +83,9 @@ class LimitsPanel(ScreenPanel):
name.set_line_wrap(True) name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
scale = Gtk.Scale.new_with_range(orientation=Gtk.Orientation.HORIZONTAL, min=0, max=value * 1.5, step=1) # adj (value, lower, upper, step_increment, page_increment, page_size)
scale.set_value(value) adj = Gtk.Adjustment(value, 1, (value * 1.5), 1, 5, 0)
scale = Gtk.Scale.new(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj)
scale.set_digits(0) scale.set_digits(0)
scale.set_hexpand(True) scale.set_hexpand(True)
scale.set_has_origin(True) scale.set_has_origin(True)
@@ -108,6 +109,7 @@ class LimitsPanel(ScreenPanel):
self.limits[option] = { self.limits[option] = {
"row": frame, "row": frame,
"scale": scale, "scale": scale,
"adjustment": adj,
} }
limits = sorted(self.limits) limits = sorted(self.limits)
+10 -6
View File
@@ -2,7 +2,7 @@ import gi
import logging import logging
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GLib, Pango from gi.repository import Gtk, GLib
from panels.menu import MenuPanel from panels.menu import MenuPanel
from ks_includes.widgets.graph import HeaterGraph from ks_includes.widgets.graph import HeaterGraph
@@ -16,16 +16,17 @@ def create_panel(*args):
class MainPanel(MenuPanel): class MainPanel(MenuPanel):
def __init__(self, screen, title, back=False): def __init__(self, screen, title, back=False):
super().__init__(screen, title, False) super().__init__(screen, title, False)
self.left_panel = None
self.items = None self.items = None
self.grid = self._gtk.HomogeneousGrid()
self.grid.set_hexpand(True)
self.grid.set_vexpand(True)
self.devices = {} self.devices = {}
self.graph_update = None self.graph_update = None
self.active_heater = None self.active_heater = None
self.h = 1 self.h = 1
self.grid = self._gtk.HomogeneousGrid()
self.grid.set_hexpand(True)
self.grid.set_vexpand(True)
def initialize(self, panel_name, items, extrudercount): def initialize(self, items):
logging.info("### Making MainMenu") logging.info("### Making MainMenu")
self.items = items self.items = items
@@ -48,6 +49,8 @@ class MainPanel(MenuPanel):
self.layout.show_all() self.layout.show_all()
def update_graph_visibility(self): def update_graph_visibility(self):
if self.left_panel is None:
return
count = 0 count = 0
for device in self.devices: for device in self.devices:
visible = self._config.get_config().getboolean(f"graph {self._screen.connected_printer}", visible = self._config.get_config().getboolean(f"graph {self._screen.connected_printer}",
@@ -74,6 +77,7 @@ class MainPanel(MenuPanel):
# This has a high impact on load # This has a high impact on load
self.graph_update = GLib.timeout_add_seconds(5, self.update_graph) self.graph_update = GLib.timeout_add_seconds(5, self.update_graph)
self.update_graph_visibility() self.update_graph_visibility()
self._screen.base_panel_show_all()
def deactivate(self): def deactivate(self):
if self.graph_update: if self.graph_update:
@@ -251,7 +255,7 @@ class MainPanel(MenuPanel):
h, h,
self._printer.get_dev_stat(h, "temperature"), self._printer.get_dev_stat(h, "temperature"),
self._printer.get_dev_stat(h, "target"), self._printer.get_dev_stat(h, "target"),
self._printer.get_dev_stat(x, "power"), self._printer.get_dev_stat(h, "power"),
) )
return return
+15 -23
View File
@@ -16,23 +16,23 @@ class MenuPanel(ScreenPanel):
i = 0 i = 0
j2_data = None j2_data = None
def initialize(self, panel_name, display_name, items): def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
self.items = items self.items = None
self.create_menu_items()
self.grid = self._gtk.HomogeneousGrid() self.grid = self._gtk.HomogeneousGrid()
def initialize(self, items):
self.items = items
self.create_menu_items()
scroll = self._gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.add(self.grid) scroll.add(self.grid)
self.content.add(scroll) self.content.add(scroll)
def activate(self): def activate(self):
self.j2_data = self._printer.get_printer_status_data() self.j2_data = self._printer.get_printer_status_data()
self.j2_data.update({ self.j2_data.update({
'moonraker_connected': self._screen._ws.is_connected() 'moonraker_connected': self._screen._ws.connected
}) })
if self._screen.vertical_mode: if self._screen.vertical_mode:
self.arrangeMenuItems(self.items, 3) self.arrangeMenuItems(self.items, 3)
@@ -47,8 +47,8 @@ class MenuPanel(ScreenPanel):
i = 0 i = 0
for item in items: for item in items:
key = list(item)[0] key = list(item)[0]
logging.debug(f"Evaluating item: {key}")
if not self.evaluate_enable(item[key]['enable']): if not self.evaluate_enable(item[key]['enable']):
logging.debug(f"X > {key}")
continue continue
if columns == 4: if columns == 4:
@@ -77,16 +77,16 @@ class MenuPanel(ScreenPanel):
item = self.items[i][key] item = self.items[i][key]
env = Environment(extensions=["jinja2.ext.i18n"], autoescape=True) env = Environment(extensions=["jinja2.ext.i18n"], autoescape=True)
env.install_gettext_translations(self.lang) env.install_gettext_translations(self._config.get_lang())
j2_temp = env.from_string(item['name']) j2_temp = env.from_string(item['name'])
parsed_name = j2_temp.render() parsed_name = j2_temp.render()
b = self._gtk.ButtonImage(item['icon'], parsed_name, f"color{(i % 4) + 1}") b = self._gtk.ButtonImage(item['icon'], parsed_name, f"color{(i % 4) + 1}")
if item['panel'] is not False: if item['panel'] is not None:
b.connect("clicked", self.menu_item_clicked, item['panel'], item) b.connect("clicked", self.menu_item_clicked, item['panel'], item)
elif item['method'] is not False: elif item['method'] is not None:
params = item['params'] if item['params'] is not False else {} params = item['params'] if item['params'] is not False else {}
if item['confirm'] is not False: if item['confirm'] is not None:
b.connect("clicked", self._screen._confirm_send_action, item['confirm'], item['method'], params) b.connect("clicked", self._screen._confirm_send_action, item['confirm'], item['method'], params)
else: else:
b.connect("clicked", self._screen._send_action, item['method'], params) b.connect("clicked", self._screen._send_action, item['method'], params)
@@ -95,23 +95,15 @@ class MenuPanel(ScreenPanel):
self.labels[key] = b self.labels[key] = b
def evaluate_enable(self, enable): def evaluate_enable(self, enable):
if enable is True:
return True
if enable is False:
return False
if enable == "{{ moonraker_connected }}": if enable == "{{ moonraker_connected }}":
logging.info("moonraker is_connected %s", self._screen._ws.is_connected()) logging.info(f"moonraker connected {self._screen._ws.connected}")
return self._screen._ws.is_connected() return self._screen._ws.connected
self.j2_data = self._printer.get_printer_status_data() self.j2_data = self._printer.get_printer_status_data()
try: try:
logging.debug(f"Template: '{enable}'")
j2_temp = Template(enable, autoescape=True) j2_temp = Template(enable, autoescape=True)
result = j2_temp.render(self.j2_data) result = j2_temp.render(self.j2_data)
if result == 'True': return result == 'True'
return True
return False
except Exception as e: except Exception as e:
logging.debug(f"Error evaluating enable statement: {enable}\n{e}") logging.debug(f"Error evaluating enable statement: {enable}\n{e}")
return False return False
+26 -34
View File
@@ -7,41 +7,34 @@ from gi.repository import Gtk, Pango
from ks_includes.KlippyGcodes import KlippyGcodes from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
AXIS_X = "X"
AXIS_Y = "Y"
AXIS_Z = "Z"
def create_panel(*args): def create_panel(*args):
return MovePanel(*args) return MovePanel(*args)
class MovePanel(ScreenPanel): class MovePanel(ScreenPanel):
distance = 1
distances = ['.1', '.5', '1', '5', '10', '25', '50'] distances = ['.1', '.5', '1', '5', '10', '25', '50']
distance = distances[-2]
def __init__(self, screen, title, back=True): def __init__(self, screen, title, back=True):
super().__init__(screen, title, back) super().__init__(screen, title, back)
self.settings = {} self.settings = {}
self.menu = ['move_menu'] self.menu = ['move_menu']
def initialize(self, panel_name):
grid = self._gtk.HomogeneousGrid()
self.labels['x+'] = self._gtk.ButtonImage("arrow-right", _("X+"), "color1") self.labels['x+'] = self._gtk.ButtonImage("arrow-right", _("X+"), "color1")
self.labels['x+'].connect("clicked", self.move, AXIS_X, "+") self.labels['x+'].connect("clicked", self.move, "X", "+")
self.labels['x-'] = self._gtk.ButtonImage("arrow-left", _("X-"), "color1") self.labels['x-'] = self._gtk.ButtonImage("arrow-left", _("X-"), "color1")
self.labels['x-'].connect("clicked", self.move, AXIS_X, "-") self.labels['x-'].connect("clicked", self.move, "X", "-")
self.labels['y+'] = self._gtk.ButtonImage("arrow-up", _("Y+"), "color2") self.labels['y+'] = self._gtk.ButtonImage("arrow-up", _("Y+"), "color2")
self.labels['y+'].connect("clicked", self.move, AXIS_Y, "+") self.labels['y+'].connect("clicked", self.move, "Y", "+")
self.labels['y-'] = self._gtk.ButtonImage("arrow-down", _("Y-"), "color2") self.labels['y-'] = self._gtk.ButtonImage("arrow-down", _("Y-"), "color2")
self.labels['y-'].connect("clicked", self.move, AXIS_Y, "-") self.labels['y-'].connect("clicked", self.move, "Y", "-")
self.labels['z+'] = self._gtk.ButtonImage("z-farther", _("Z+"), "color3") self.labels['z+'] = self._gtk.ButtonImage("z-farther", _("Z+"), "color3")
self.labels['z+'].connect("clicked", self.move, AXIS_Z, "+") self.labels['z+'].connect("clicked", self.move, "Z", "+")
self.labels['z-'] = self._gtk.ButtonImage("z-closer", _("Z-"), "color3") self.labels['z-'] = self._gtk.ButtonImage("z-closer", _("Z-"), "color3")
self.labels['z-'].connect("clicked", self.move, AXIS_Z, "-") self.labels['z-'].connect("clicked", self.move, "Z", "-")
self.labels['home'] = self._gtk.ButtonImage("home", _("Home All"), "color4") self.labels['home'] = self._gtk.ButtonImage("home", _("Home All"), "color4")
self.labels['home'].connect("clicked", self.home) self.labels['home'].connect("clicked", self.home)
@@ -61,6 +54,7 @@ class MovePanel(ScreenPanel):
_("Are you sure you wish to disable motors?"), _("Are you sure you wish to disable motors?"),
"printer.gcode.script", script) "printer.gcode.script", script)
grid = self._gtk.HomogeneousGrid()
if self._screen.vertical_mode: if self._screen.vertical_mode:
if self._screen.lang_ltr: if self._screen.lang_ltr:
grid.attach(self.labels['x+'], 2, 1, 1, 1) grid.attach(self.labels['x+'], 2, 1, 1, 1)
@@ -100,7 +94,7 @@ class MovePanel(ScreenPanel):
distgrid = Gtk.Grid() distgrid = Gtk.Grid()
for j, i in enumerate(self.distances): for j, i in enumerate(self.distances):
self.labels[i] = self._gtk.ToggleButton(i) self.labels[i] = self._gtk.Button(i)
self.labels[i].set_direction(Gtk.TextDirection.LTR) self.labels[i].set_direction(Gtk.TextDirection.LTR)
self.labels[i].connect("clicked", self.change_distance, i) self.labels[i].connect("clicked", self.change_distance, i)
ctx = self.labels[i].get_style_context() ctx = self.labels[i].get_style_context()
@@ -110,10 +104,9 @@ class MovePanel(ScreenPanel):
ctx.add_class("distbutton_bottom") ctx.add_class("distbutton_bottom")
else: else:
ctx.add_class("distbutton") ctx.add_class("distbutton")
if i == "1": if i == self.distance:
ctx.add_class("distbutton_active") ctx.add_class("distbutton_active")
distgrid.attach(self.labels[i], j, 0, 1, 1) distgrid.attach(self.labels[i], j, 0, 1, 1)
self.labels["1"].set_active(True)
self.labels['pos_x'] = Gtk.Label("X: 0") self.labels['pos_x'] = Gtk.Label("X: 0")
self.labels['pos_y'] = Gtk.Label("Y: 0") self.labels['pos_y'] = Gtk.Label("Y: 0")
@@ -194,34 +187,21 @@ class MovePanel(ScreenPanel):
self.labels['pos_z'].set_text("Z: ?") self.labels['pos_z'].set_text("Z: ?")
def change_distance(self, widget, distance): def change_distance(self, widget, distance):
if self.distance == distance:
return
logging.info(f"### Distance {distance}") logging.info(f"### Distance {distance}")
self.labels[f"{self.distance}"].get_style_context().remove_class("distbutton_active")
ctx = self.labels[f"{self.distance}"].get_style_context() self.labels[f"{distance}"].get_style_context().add_class("distbutton_active")
ctx.remove_class("distbutton_active")
self.distance = distance self.distance = distance
ctx = self.labels[self.distance].get_style_context()
ctx.add_class("distbutton_active")
for i in self.distances:
if i == self.distance:
continue
self.labels[f"{i}"].set_active(False)
def move(self, widget, axis, direction): def move(self, widget, axis, direction):
speed = None
if self._config.get_config()['main'].getboolean(f"invert_{axis.lower()}", False): if self._config.get_config()['main'].getboolean(f"invert_{axis.lower()}", False):
direction = "-" if direction == "+" else "+" direction = "-" if direction == "+" else "+"
dist = f"{direction}{self.distance}" dist = f"{direction}{self.distance}"
config_key = "move_speed_z" if axis == AXIS_Z else "move_speed_xy" config_key = "move_speed_z" if axis == "Z" else "move_speed_xy"
printer_cfg = self._config.get_printer_config(self._screen.connected_printer) printer_cfg = self._config.get_printer_config(self._screen.connected_printer)
if printer_cfg is not None: speed = None if printer_cfg is None else printer_cfg.getint(config_key, None)
speed = printer_cfg.getint(config_key, None)
if speed is None: if speed is None:
speed = self._config.get_config()['main'].getint(config_key, 20) speed = self._config.get_config()['main'].getint(config_key, 20)
speed = 60 * max(1, speed) speed = 60 * max(1, speed)
self._screen._ws.klippy.gcode_script(f"{KlippyGcodes.MOVE_RELATIVE}\n{KlippyGcodes.MOVE} {axis}{dist} F{speed}") self._screen._ws.klippy.gcode_script(f"{KlippyGcodes.MOVE_RELATIVE}\n{KlippyGcodes.MOVE} {axis}{dist} F{speed}")
@@ -288,3 +268,15 @@ class MovePanel(ScreenPanel):
self.unload_menu() self.unload_menu()
return True return True
return False return False
def home(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
def homexy(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME_XY)
def z_tilt(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.Z_TILT)
def quad_gantry_level(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.QUAD_GANTRY_LEVEL)
-6
View File
@@ -30,10 +30,6 @@ class NetworkPanel(ScreenPanel):
logging.info(f"Found wireless interfaces: {self.wireless_interfaces}") logging.info(f"Found wireless interfaces: {self.wireless_interfaces}")
self.wifi = WifiManager(self.wireless_interfaces[0]) self.wifi = WifiManager(self.wireless_interfaces[0])
def initialize(self, menu):
grid = self._gtk.HomogeneousGrid()
grid.set_hexpand(True)
# Get IP Address # Get IP Address
gws = netifaces.gateways() gws = netifaces.gateways()
if "default" in gws and netifaces.AF_INET in gws["default"]: if "default" in gws and netifaces.AF_INET in gws["default"]:
@@ -118,7 +114,6 @@ class NetworkPanel(ScreenPanel):
def add_network(self, ssid, show=True): def add_network(self, ssid, show=True):
if ssid is None: if ssid is None:
logging.info("SSID is None")
return return
ssid = ssid.strip() ssid = ssid.strip()
if ssid in list(self.networks): if ssid in list(self.networks):
@@ -314,7 +309,6 @@ class NetworkPanel(ScreenPanel):
def remove_network(self, ssid, show=True): def remove_network(self, ssid, show=True):
if ssid not in list(self.networks): if ssid not in list(self.networks):
return return
logging.info(self.labels['networklist'])
for i in range(len(self.labels['networklist'])): for i in range(len(self.labels['networklist'])):
if self.networks[ssid] == self.labels['networklist'].get_child_at(0, i): if self.networks[ssid] == self.labels['networklist'].get_child_at(0, i):
self.labels['networklist'].remove_row(i) self.labels['networklist'].remove_row(i)
+2 -2
View File
@@ -13,8 +13,8 @@ def create_panel(*args):
class OutputPinPanel(ScreenPanel): class OutputPinPanel(ScreenPanel):
def initialize(self, panel_name): def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
self.devices = {} self.devices = {}
# Create a grid for all devices # Create a grid for all devices
self.labels['devices'] = Gtk.Grid() self.labels['devices'] = Gtk.Grid()
+2 -2
View File
@@ -12,8 +12,8 @@ def create_panel(*args):
class PowerPanel(ScreenPanel): class PowerPanel(ScreenPanel):
def initialize(self, panel_name): def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
self.devices = {} self.devices = {}
# Create a grid for all devices # Create a grid for all devices
+30 -28
View File
@@ -36,8 +36,6 @@ class PrintPanel(ScreenPanel):
self.directories = {} self.directories = {}
self.labels['directories'] = {} self.labels['directories'] = {}
self.labels['files'] = {} self.labels['files'] = {}
def initialize(self, panel_name):
sort = Gtk.Label(_("Sort:")) sort = Gtk.Label(_("Sort:"))
sbox = Gtk.Box(spacing=0) sbox = Gtk.Box(spacing=0)
sbox.set_vexpand(False) sbox.set_vexpand(False)
@@ -45,7 +43,7 @@ class PrintPanel(ScreenPanel):
for i, (name, val) in enumerate(self.sort_items.items(), start=1): for i, (name, val) in enumerate(self.sort_items.items(), start=1):
s = self._gtk.ButtonImage(None, val, f"color{i % 4}", .5, Gtk.PositionType.RIGHT, 1) s = self._gtk.ButtonImage(None, val, f"color{i % 4}", .5, Gtk.PositionType.RIGHT, 1)
if name == self.sort_current[0]: if name == self.sort_current[0]:
s.set_image(self._gtk.Image(self.sort_icon[self.sort_current[1]], .5)) s.set_image(self._gtk.Image(self.sort_icon[self.sort_current[1]], self._gtk.img_scale * .5))
s.connect("clicked", self.change_sort, name) s.connect("clicked", self.change_sort, name)
self.labels[f'sort_{name}'] = s self.labels[f'sort_{name}'] = s
sbox.add(s) sbox.add(s)
@@ -110,10 +108,14 @@ class PrintPanel(ScreenPanel):
d = f"gcodes/{filepath}".split('/')[:-1] d = f"gcodes/{filepath}".split('/')[:-1]
directory = '/'.join(d) directory = '/'.join(d)
filename = filepath.split('/')[-1] filename = filepath.split('/')[-1]
if filename.startswith("."):
return
for i in range(1, len(d)): for i in range(1, len(d)):
curdir = "/".join(d[:i]) curdir = "/".join(d[:i])
newdir = "/".join(d[:i + 1]) newdir = "/".join(d[:i + 1])
if newdir not in self.filelist[curdir]['directories']: if newdir not in self.filelist[curdir]['directories']:
if d[i].startswith("."):
return
self.add_directory(newdir) self.add_directory(newdir)
if filename not in self.filelist[directory]['files']: if filename not in self.filelist[directory]['files']:
@@ -122,7 +124,7 @@ class PrintPanel(ScreenPanel):
if curdir != "gcodes" and fileinfo['modified'] > self.filelist[curdir]['modified']: if curdir != "gcodes" and fileinfo['modified'] > self.filelist[curdir]['modified']:
self.filelist[curdir]['modified'] = fileinfo['modified'] self.filelist[curdir]['modified'] = fileinfo['modified']
self.labels['directories'][curdir]['info'].set_markup( self.labels['directories'][curdir]['info'].set_markup(
f'<small>' + _("Modified") '<small>' + _("Modified")
+ f' <b>{datetime.fromtimestamp(fileinfo["modified"]):%Y-%m-%d %H:%M}</b></small>' + f' <b>{datetime.fromtimestamp(fileinfo["modified"]):%Y-%m-%d %H:%M}</b></small>'
) )
@@ -175,7 +177,7 @@ class PrintPanel(ScreenPanel):
file.set_hexpand(True) file.set_hexpand(True)
file.set_vexpand(False) file.set_vexpand(False)
icon = self._gtk.Image("folder", 1) icon = self._gtk.Image("folder")
file.add(icon) file.add(icon)
file.add(labels) file.add(labels)
@@ -185,7 +187,6 @@ class PrintPanel(ScreenPanel):
self.directories[directory] = frame self.directories[directory] = frame
self.labels['directories'][directory] = { self.labels['directories'][directory] = {
"icon": icon,
"info": info, "info": info,
"name": name "name": name
} }
@@ -222,18 +223,11 @@ class PrintPanel(ScreenPanel):
file.set_hexpand(True) file.set_hexpand(True)
file.set_vexpand(False) file.set_vexpand(False)
icon = Gtk.Image() icon = Gtk.Button()
pixbuf = self.get_file_image(filepath, small=True) GLib.idle_add(self.image_load, filepath)
if pixbuf is not None: icon.connect("clicked", self.confirm_delete_file, f"gcodes/{filepath}")
icon.set_from_pixbuf(pixbuf)
else:
icon = self._gtk.Image("file", 1.6)
img = Gtk.Button() file.add(icon)
img.set_image(icon)
img.connect("clicked", self.confirm_delete_file, f"gcodes/{filepath}")
file.add(img)
file.add(labels) file.add(labels)
if os.path.splitext(filename)[1] in [".gcode", ".g", ".gco"]: if os.path.splitext(filename)[1] in [".gcode", ".g", ".gco"]:
file.add(actions) file.add(actions)
@@ -246,6 +240,13 @@ class PrintPanel(ScreenPanel):
"name": name "name": name
} }
def image_load(self, filepath):
pixbuf = self.get_file_image(filepath, small=True)
if pixbuf is not None:
self.labels['files'][filepath]['icon'].set_image(Gtk.Image.new_from_pixbuf(pixbuf))
else:
self.labels['files'][filepath]['icon'].set_image(self._gtk.Image("file"))
def confirm_delete_file(self, widget, filepath): def confirm_delete_file(self, widget, filepath):
logging.debug(f"Sending delete_file {filepath}") logging.debug(f"Sending delete_file {filepath}")
params = {"path": f"{filepath}"} params = {"path": f"{filepath}"}
@@ -284,7 +285,8 @@ class PrintPanel(ScreenPanel):
self.labels[f'sort_{oldkey}'].set_image(None) self.labels[f'sort_{oldkey}'].set_image(None)
self.labels[f'sort_{oldkey}'].show_all() self.labels[f'sort_{oldkey}'].show_all()
self.sort_current = [key, 0] self.sort_current = [key, 0]
self.labels[f'sort_{key}'].set_image(self._gtk.Image(self.sort_icon[self.sort_current[1]], .5)) self.labels[f'sort_{key}'].set_image(self._gtk.Image(self.sort_icon[self.sort_current[1]],
self._gtk.img_scale * .5))
self.labels[f'sort_{key}'].show() self.labels[f'sort_{key}'].show()
GLib.idle_add(self.reload_files) GLib.idle_add(self.reload_files)
@@ -308,16 +310,16 @@ class PrintPanel(ScreenPanel):
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
grid = Gtk.Grid() grid = Gtk.Grid()
grid.add(label)
pixbuf = self.get_file_image(filename, 8, 3.2)
if pixbuf is not None:
image = Gtk.Image.new_from_pixbuf(pixbuf)
grid.attach_next_to(image, label, Gtk.PositionType.BOTTOM, 1, 3)
grid.set_vexpand(True) grid.set_vexpand(True)
grid.set_halign(Gtk.Align.CENTER) grid.set_halign(Gtk.Align.CENTER)
grid.set_valign(Gtk.Align.CENTER) grid.set_valign(Gtk.Align.CENTER)
grid.add(label)
pixbuf = self.get_file_image(filename, self._screen.width * .9, self._screen.height * .6)
if pixbuf is not None:
image = Gtk.Image.new_from_pixbuf(pixbuf)
image.set_vexpand(False)
grid.attach_next_to(image, label, Gtk.PositionType.BOTTOM, 1, 1)
self._gtk.Dialog(self._screen, buttons, grid, self.confirm_print_response, filename) self._gtk.Dialog(self._screen, buttons, grid, self.confirm_print_response, filename)
@@ -333,6 +335,8 @@ class PrintPanel(ScreenPanel):
def delete_file(self, filename): def delete_file(self, filename):
dir_parts = f"gcodes/{filename}".split('/')[:-1] dir_parts = f"gcodes/{filename}".split('/')[:-1]
directory = '/'.join(dir_parts) directory = '/'.join(dir_parts)
if directory not in self.filelist or filename.split('/')[-1].startswith("."):
return
self.filelist[directory]["files"].pop(self.filelist[directory]["files"].index(filename.split('/')[-1])) self.filelist[directory]["files"].pop(self.filelist[directory]["files"].index(filename.split('/')[-1]))
i = len(dir_parts) i = len(dir_parts)
while i > 1: while i > 1:
@@ -390,9 +394,7 @@ class PrintPanel(ScreenPanel):
self.labels['files'][filename]['info'].set_markup(self.get_file_info_str(filename)) self.labels['files'][filename]['info'].set_markup(self.get_file_info_str(filename))
# Update icon # Update icon
pixbuf = self.get_file_image(filename) GLib.idle_add(self.image_load, filename)
if pixbuf is not None:
self.labels['files'][filename]['icon'].set_from_pixbuf(pixbuf)
def _callback(self, newfiles, deletedfiles, updatedfiles=None): def _callback(self, newfiles, deletedfiles, updatedfiles=None):
logging.debug(f"newfiles: {newfiles}") logging.debug(f"newfiles: {newfiles}")
+10 -8
View File
@@ -1,12 +1,9 @@
import gi import gi
import logging
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk from gi.repository import Gtk, GLib
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.PrinterSelect")
def create_panel(*args): def create_panel(*args):
return PrinterSelect(*args) return PrinterSelect(*args)
@@ -15,9 +12,6 @@ def create_panel(*args):
class PrinterSelect(ScreenPanel): class PrinterSelect(ScreenPanel):
def __init__(self, screen, title, back=True): def __init__(self, screen, title, back=True):
super().__init__(screen, title, False) super().__init__(screen, title, False)
def initialize(self, panel_name):
printers = self._config.get_printers() printers = self._config.get_printers()
grid = self._gtk.HomogeneousGrid() grid = self._gtk.HomogeneousGrid()
@@ -39,7 +33,7 @@ class PrinterSelect(ScreenPanel):
for i, printer in enumerate(printers): for i, printer in enumerate(printers):
name = list(printer)[0] name = list(printer)[0]
self.labels[name] = self._gtk.ButtonImage("extruder", name, f"color{1 + i % 4}") self.labels[name] = self._gtk.ButtonImage("extruder", name, f"color{1 + i % 4}")
self.labels[name].connect("clicked", self._screen.connect_printer_widget, name) self.labels[name].connect("clicked", self.connect_printer, name)
if self._screen.vertical_mode: if self._screen.vertical_mode:
row = i % columns row = i % columns
col = int(i / columns) col = int(i / columns)
@@ -47,3 +41,11 @@ class PrinterSelect(ScreenPanel):
col = i % columns col = i % columns
row = int(i / columns) row = int(i / columns)
grid.attach(self.labels[name], col, row, 1, 1) grid.attach(self.labels[name], col, row, 1, 1)
def connect_printer(self, widget, name):
self._screen.connect_printer(name)
def activate(self):
self._screen.base_panel.action_bar.hide()
self._screen._ws.connecting = False
GLib.timeout_add(100, self._screen.base_panel.action_bar.hide)
+12 -5
View File
@@ -20,9 +20,6 @@ class FWRetractionPanel(ScreenPanel):
self.grid = Gtk.Grid() self.grid = Gtk.Grid()
self.values = {} self.values = {}
self.list = {} self.list = {}
def initialize(self, panel_name):
conf = self._printer.get_config_section("firmware_retraction") conf = self._printer.get_config_section("firmware_retraction")
retract_length = float(conf['retract_length']) if 'retract_length' in conf else 0 retract_length = float(conf['retract_length']) if 'retract_length' in conf else 0
@@ -102,6 +99,14 @@ class FWRetractionPanel(ScreenPanel):
self.list[option]['scale'].disconnect_by_func(self.set_opt_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'].set_value(self.values[option])
self.list[option]['scale'].connect("button-release-event", self.set_opt_value, option) self.list[option]['scale'].connect("button-release-event", self.set_opt_value, option)
# Infinite scale
for opt in self.options:
if opt['option'] == option:
if self.values[option] > opt["maxval"] * .75:
self.list[option]['adjustment'].set_upper(self.values[option] * 1.5)
else:
self.list[option]['adjustment'].set_upper(opt["maxval"])
break
def add_option(self, option, optname, units, value, digits, maxval): def add_option(self, option, optname, units, value, digits, maxval):
logging.info(f"Adding option: {option}") logging.info(f"Adding option: {option}")
@@ -116,8 +121,9 @@ class FWRetractionPanel(ScreenPanel):
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
minimum = 1 if option in ["retract_speed", "unretract_speed"] else 0 minimum = 1 if option in ["retract_speed", "unretract_speed"] else 0
self.values[option] = value self.values[option] = value
scale = Gtk.Scale.new_with_range(orientation=Gtk.Orientation.HORIZONTAL, min=minimum, max=maxval, step=1) # adj (value, lower, upper, step_increment, page_increment, page_size)
scale.set_value(self.values[option]) adj = Gtk.Adjustment(value, minimum, maxval, 1, 5, 0)
scale = Gtk.Scale.new(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj)
scale.set_digits(digits) scale.set_digits(digits)
scale.set_hexpand(True) scale.set_hexpand(True)
scale.set_has_origin(True) scale.set_has_origin(True)
@@ -140,6 +146,7 @@ class FWRetractionPanel(ScreenPanel):
self.list[option] = { self.list[option] = {
"row": frame, "row": frame,
"scale": scale, "scale": scale,
"adjustment": adj,
} }
pos = sorted(self.list).index(option) pos = sorted(self.list).index(option)
+2 -12
View File
@@ -16,11 +16,6 @@ class SettingsPanel(ScreenPanel):
super().__init__(screen, title, back) super().__init__(screen, title, back)
self.printers = self.settings = {} self.printers = self.settings = {}
self.menu = ['settings_menu'] self.menu = ['settings_menu']
def initialize(self, panel_name):
self.labels['add_printer_button'] = self._gtk.Button(_("Add Printer"), "color1")
options = self._config.get_configurable_options().copy() options = self._config.get_configurable_options().copy()
options.append({"printers": { options.append({"printers": {
"name": _("Printer Connections"), "name": _("Printer Connections"),
@@ -102,12 +97,10 @@ class SettingsPanel(ScreenPanel):
dev.add(box) dev.add(box)
elif option['type'] == "dropdown": elif option['type'] == "dropdown":
dropdown = Gtk.ComboBoxText() dropdown = Gtk.ComboBoxText()
i = 0 for i, opt in enumerate(option['options']):
for opt in option['options']:
dropdown.append(opt['value'], opt['name']) dropdown.append(opt['value'], opt['name'])
if opt['value'] == self._config.get_config()[option['section']].get(opt_name, option['value']): if opt['value'] == self._config.get_config()[option['section']].get(opt_name, option['value']):
dropdown.set_active(i) dropdown.set_active(i)
i += 1
dropdown.connect("changed", self.on_dropdown_change, option['section'], opt_name, dropdown.connect("changed", self.on_dropdown_change, option['section'], opt_name,
option['callback'] if "callback" in option else None) option['callback'] if "callback" in option else None)
dropdown.set_entry_text_column(0) dropdown.set_entry_text_column(0)
@@ -122,12 +115,9 @@ class SettingsPanel(ScreenPanel):
scale.connect("button-release-event", self.scale_moved, option['section'], opt_name) scale.connect("button-release-event", self.scale_moved, option['section'], opt_name)
dev.add(scale) dev.add(scale)
elif option['type'] == "printer": elif option['type'] == "printer":
logging.debug(f"Option: {option}")
box = Gtk.Box() box = Gtk.Box()
box.set_vexpand(False) box.set_vexpand(False)
label = Gtk.Label() label = Gtk.Label(f"{option['moonraker_host']}:{option['moonraker_port']}")
url = f"{option['moonraker_host']}:{option['moonraker_port']}"
label.set_markup(f"<big>{option['name']}</big>\n{url}")
box.add(label) box.add(label)
dev.add(box) dev.add(box)
elif option['type'] == "menu": elif option['type'] == "menu":
+22 -19
View File
@@ -3,7 +3,7 @@ import logging
import os import os
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gdk, Gtk, Pango from gi.repository import Gtk, Pango
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
@@ -13,15 +13,10 @@ def create_panel(*args):
class SplashScreenPanel(ScreenPanel): class SplashScreenPanel(ScreenPanel):
box = None
def __init__(self, screen, title, back=True): def __init__(self, screen, title, back=True):
super().__init__(screen, title, back) super().__init__(screen, title, back)
image = self._gtk.Image("klipper", self._screen.width / 5, self._screen.height * .5)
def initialize(self, panel_name):
image = self._gtk.Image("klipper", 3.2)
self.labels['text'] = Gtk.Label(_("Initializing printer...")) self.labels['text'] = Gtk.Label(_("Initializing printer..."))
self.labels['text'].set_line_wrap(True) self.labels['text'].set_line_wrap(True)
self.labels['text'].set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) self.labels['text'].set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
@@ -38,6 +33,8 @@ class SplashScreenPanel(ScreenPanel):
self.labels['restart_system'].connect("clicked", self.restart_system) self.labels['restart_system'].connect("clicked", self.restart_system)
self.labels['shutdown'] = self._gtk.ButtonImage("shutdown", _('System Shutdown'), "color2") self.labels['shutdown'] = self._gtk.ButtonImage("shutdown", _('System Shutdown'), "color2")
self.labels['shutdown'].connect("clicked", self.shutdown) self.labels['shutdown'].connect("clicked", self.shutdown)
self.labels['retry'] = self._gtk.ButtonImage("load", _('Retry'), "color3")
self.labels['retry'].connect("clicked", self.retry)
self.labels['actions'] = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL) self.labels['actions'] = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.labels['actions'].set_hexpand(True) self.labels['actions'].set_hexpand(True)
@@ -46,13 +43,9 @@ class SplashScreenPanel(ScreenPanel):
self.labels['actions'].set_homogeneous(True) self.labels['actions'].set_homogeneous(True)
self.labels['actions'].set_size_request(self._screen.base_panel.content.get_allocation().width, 0) self.labels['actions'].set_size_request(self._screen.base_panel.content.get_allocation().width, 0)
scroll = Gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True) scroll.set_hexpand(True)
scroll.set_vexpand(True)
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) 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['text']) scroll.add(self.labels['text'])
info = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0) info = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0)
@@ -79,21 +72,24 @@ class SplashScreenPanel(ScreenPanel):
self.clear_action_bar() self.clear_action_bar()
printer = self._screen.connected_printer printer = self._screen.connected_printer
if printer is not None and not self._screen.shutdown: if printer is not None and self._screen._ws.connected:
printer_cfg = self._config.get_printer_config(printer) printer_cfg = self._config.get_printer_config(printer)
if printer_cfg is not None: if printer_cfg is not None:
power_devices = printer_cfg.get("power_devices", "") power_devices = printer_cfg.get("power_devices", "")
power_devices = [str(i.strip()) for i in power_devices.split(',')] power_devices = [str(i.strip()) for i in power_devices.split(',')]
logging.info(f"Associated power devices: {power_devices}") if power_devices[0]:
self.add_power_button(self._screen.search_power_devices(power_devices)) logging.info(f"Associated power devices: {power_devices}")
self.add_power_button(self._screen.search_power_devices(power_devices))
if self._screen.printer is not None and self._screen.printer.state != "disconnected": if self._screen._ws and self._screen._ws.connected:
self.labels['actions'].add(self.labels['restart']) self.labels['actions'].add(self.labels['restart'])
self.labels['actions'].add(self.labels['firmware_restart']) self.labels['actions'].add(self.labels['firmware_restart'])
else: else:
self.labels['actions'].add(self.labels['restart_system']) self.labels['actions'].add(self.labels['restart_system'])
self.labels['actions'].add(self.labels['shutdown']) self.labels['actions'].add(self.labels['shutdown'])
self.labels['actions'].add(self.labels['menu']) self.labels['actions'].add(self.labels['menu'])
if self._screen._ws and not self._screen._ws.connecting:
self.labels['actions'].add(self.labels['retry'])
self.labels['actions'].show_all() self.labels['actions'].show_all()
def add_power_button(self, powerdevs): def add_power_button(self, powerdevs):
@@ -105,6 +101,9 @@ class SplashScreenPanel(ScreenPanel):
def activate(self): def activate(self):
self.check_power_status() self.check_power_status()
self._screen.base_panel.show_macro_shortcut(False)
self._screen.base_panel.show_heaters(False)
self._screen.base_panel.show_estop(False)
def check_power_status(self): def check_power_status(self):
if 'power' in self.labels: if 'power' in self.labels:
@@ -124,8 +123,7 @@ class SplashScreenPanel(ScreenPanel):
self._screen._ws.klippy.restart() self._screen._ws.klippy.restart()
def shutdown(self, widget): def shutdown(self, widget):
if self._screen._ws.connected:
if self._screen._ws.is_connected():
self._screen._confirm_send_action(widget, self._screen._confirm_send_action(widget,
_("Are you sure you wish to shutdown the system?"), _("Are you sure you wish to shutdown the system?"),
"machine.shutdown") "machine.shutdown")
@@ -135,10 +133,15 @@ class SplashScreenPanel(ScreenPanel):
def restart_system(self, widget): def restart_system(self, widget):
if self._screen._ws.is_connected(): if self._screen._ws.connected:
self._screen._confirm_send_action(widget, self._screen._confirm_send_action(widget,
_("Are you sure you wish to reboot the system?"), _("Are you sure you wish to reboot the system?"),
"machine.reboot") "machine.reboot")
else: else:
logging.info("OS Reboot") logging.info("OS Reboot")
os.system("systemctl reboot") os.system("systemctl reboot")
def retry(self, widget):
self.update_text((_("Connecting to %s") % self._screen.connecting_to_printer))
self._screen._ws.retry()
self.show_restart_buttons()
+10 -13
View File
@@ -32,10 +32,6 @@ class SystemPanel(ScreenPanel):
self.refresh = None self.refresh = None
self.update_status = None self.update_status = None
self.update_dialog = None self.update_dialog = None
self.update_prog = None
def initialize(self, panel_name):
grid = self._gtk.HomogeneousGrid() grid = self._gtk.HomogeneousGrid()
grid.set_row_homogeneous(False) grid.set_row_homogeneous(False)
@@ -83,7 +79,6 @@ class SystemPanel(ScreenPanel):
infogrid.attach(self.labels[f"{prog}_restart"], 0, i, 1, 1) infogrid.attach(self.labels[f"{prog}_restart"], 0, i, 1, 1)
infogrid.attach(self.labels[f"{prog}_status"], 2, i, 1, 1) infogrid.attach(self.labels[f"{prog}_status"], 2, i, 1, 1)
logging.info(f"Updating program: {prog} ")
self.update_program_info(prog) self.update_program_info(prog)
infogrid.attach(self.labels[prog], 1, i, 1, 1) infogrid.attach(self.labels[prog], 1, i, 1, 1)
@@ -135,6 +130,7 @@ class SystemPanel(ScreenPanel):
) )
if data['complete']: if data['complete']:
self.update_dialog.set_response_sensitive(Gtk.ResponseType.CANCEL, True) self.update_dialog.set_response_sensitive(Gtk.ResponseType.CANCEL, True)
self.update_dialog.get_widget_for_response(Gtk.ResponseType.CANCEL).show()
def restart(self, widget, program): def restart(self, widget, program):
if program not in ALLOWED_SERVICES: if program not in ALLOWED_SERVICES:
@@ -276,8 +272,8 @@ class SystemPanel(ScreenPanel):
dialog = self._gtk.Dialog(self._screen, buttons, scroll, self.finish_updating) dialog = self._gtk.Dialog(self._screen, buttons, scroll, self.finish_updating)
dialog.set_response_sensitive(Gtk.ResponseType.CANCEL, False) dialog.set_response_sensitive(Gtk.ResponseType.CANCEL, False)
dialog.get_widget_for_response(Gtk.ResponseType.CANCEL).hide()
self.update_prog = program
self.update_dialog = dialog self.update_dialog = dialog
logging.info(f"Sending machine.update.recover name: {program}") logging.info(f"Sending machine.update.recover name: {program}")
@@ -321,8 +317,8 @@ class SystemPanel(ScreenPanel):
dialog = self._gtk.Dialog(self._screen, buttons, scroll, self.finish_updating) dialog = self._gtk.Dialog(self._screen, buttons, scroll, self.finish_updating)
dialog.set_response_sensitive(Gtk.ResponseType.CANCEL, False) dialog.set_response_sensitive(Gtk.ResponseType.CANCEL, False)
dialog.get_widget_for_response(Gtk.ResponseType.CANCEL).hide()
self.update_prog = program
self.update_dialog = dialog self.update_dialog = dialog
if program in ['klipper', 'moonraker', 'system', 'full']: if program in ['klipper', 'moonraker', 'system', 'full']:
@@ -335,12 +331,11 @@ class SystemPanel(ScreenPanel):
def update_program_info(self, p): def update_program_info(self, p):
logging.info(f"Updating program: {p} ")
if 'version_info' not in self.update_status or p not in self.update_status['version_info']: if 'version_info' not in self.update_status or p not in self.update_status['version_info']:
logging.info(f"Unknown version: {p}")
return return
info = self.update_status['version_info'][p] info = self.update_status['version_info'][p]
logging.info(f"{p}: {info}")
if p == "system": if p == "system":
self.labels[p].set_markup("<b>System</b>") self.labels[p].set_markup("<b>System</b>")
@@ -349,7 +344,7 @@ class SystemPanel(ScreenPanel):
self.labels[f"{p}_status"].get_style_context().remove_class('update') self.labels[f"{p}_status"].get_style_context().remove_class('update')
self.labels[f"{p}_status"].set_sensitive(False) self.labels[f"{p}_status"].set_sensitive(False)
else: else:
self._needs_update(p) self._needs_update(p, local="", remote=info['package_count'])
elif 'configured_type' in info and info['configured_type'] == 'git_repo': elif 'configured_type' in info and info['configured_type'] == 'git_repo':
if info['is_valid'] and not info['is_dirty']: if info['is_valid'] and not info['is_dirty']:
@@ -358,7 +353,7 @@ class SystemPanel(ScreenPanel):
self.labels[f"{p}_status"].get_style_context().remove_class('invalid') self.labels[f"{p}_status"].get_style_context().remove_class('invalid')
else: else:
self.labels[p].set_markup(f"<b>{p}</b>\n{info['version']} -> {info['remote_version']}") self.labels[p].set_markup(f"<b>{p}</b>\n{info['version']} -> {info['remote_version']}")
self._needs_update(p) self._needs_update(p, info['version'], info['remote_version'])
else: else:
self.labels[p].set_markup(f"<b>{p}</b>\n{info['version']}") self.labels[p].set_markup(f"<b>{p}</b>\n{info['version']}")
self.labels[f"{p}_status"].set_label(_("Invalid")) self.labels[f"{p}_status"].set_label(_("Invalid"))
@@ -368,15 +363,17 @@ class SystemPanel(ScreenPanel):
self._already_updated(p, info) self._already_updated(p, info)
else: else:
self.labels[p].set_markup(f"<b>{p}</b>\n{info['version']} -> {info['remote_version']}") self.labels[p].set_markup(f"<b>{p}</b>\n{info['version']} -> {info['remote_version']}")
self._needs_update(p) self._needs_update(p, info['version'], info['remote_version'])
def _already_updated(self, p, info): def _already_updated(self, p, info):
logging.info(f"{p} {info['version']}")
self.labels[p].set_markup(f"<b>{p}</b>\n{info['version']}") self.labels[p].set_markup(f"<b>{p}</b>\n{info['version']}")
self.labels[f"{p}_status"].set_label(_("Up To Date")) self.labels[f"{p}_status"].set_label(_("Up To Date"))
self.labels[f"{p}_status"].get_style_context().remove_class('update') self.labels[f"{p}_status"].get_style_context().remove_class('update')
self.labels[f"{p}_status"].set_sensitive(False) self.labels[f"{p}_status"].set_sensitive(False)
def _needs_update(self, p): def _needs_update(self, p, local="", remote=""):
logging.info(f"{p} {local} -> {remote}")
self.labels[f"{p}_status"].set_label(_("Update")) self.labels[f"{p}_status"].set_label(_("Update"))
self.labels[f"{p}_status"].get_style_context().add_class('update') self.labels[f"{p}_status"].get_style_context().add_class('update')
self.labels[f"{p}_status"].set_sensitive(True) self.labels[f"{p}_status"].set_sensitive(True)
+25 -34
View File
@@ -25,25 +25,27 @@ class TemperaturePanel(ScreenPanel):
self.popover_device = None self.popover_device = None
self.h = 1 self.h = 1
self.tempdeltas = ["1", "5", "10", "25"] self.tempdeltas = ["1", "5", "10", "25"]
self.tempdelta = "10" self.tempdelta = self.tempdeltas[-2]
self.show_preheat = False self.show_preheat = False
self.preheat_options = self._screen._config.get_preheat_options() self.preheat_options = self._screen._config.get_preheat_options()
logging.debug(f"Preheat options: {self.preheat_options}") logging.debug(f"Preheat options: {self.preheat_options}")
self.grid = self._gtk.HomogeneousGrid() self.grid = self._gtk.HomogeneousGrid()
def initialize(self, panel_name):
self._gtk.reset_temp_color() self._gtk.reset_temp_color()
self.grid.attach(self.create_left_panel(), 0, 0, 1, 1) self.grid.attach(self.create_left_panel(), 0, 0, 1, 1)
# When printing start in temp_delta mode and only select tools # When printing start in temp_delta mode and only select tools
state = self._printer.get_state() state = self._printer.state
logging.info(state) logging.info(state)
selection = [] selection = []
if "extruder" in self._printer.get_tools():
selection.append("extruder")
if state not in ["printing", "paused"]: if state not in ["printing", "paused"]:
for extruder in self._printer.get_tools():
selection.append(extruder)
self.show_preheat = True self.show_preheat = True
selection.extend(self._printer.get_heaters()) selection.extend(self._printer.get_heaters())
else:
current_extruder = self._screen.printer.get_stat("toolhead", "extruder")
if current_extruder:
selection.append(current_extruder)
# Select heaters # Select heaters
for h in selection: for h in selection:
@@ -115,7 +117,7 @@ class TemperaturePanel(ScreenPanel):
tempgrid = Gtk.Grid() tempgrid = Gtk.Grid()
for j, i in enumerate(self.tempdeltas): for j, i in enumerate(self.tempdeltas):
self.labels[f'deg{i}'] = self._gtk.ToggleButton(i) self.labels[f'deg{i}'] = self._gtk.Button(i)
self.labels[f'deg{i}'].connect("clicked", self.change_temp_delta, i) self.labels[f'deg{i}'].connect("clicked", self.change_temp_delta, i)
ctx = self.labels[f'deg{i}'].get_style_context() ctx = self.labels[f'deg{i}'].get_style_context()
if j == 0: if j == 0:
@@ -124,10 +126,9 @@ class TemperaturePanel(ScreenPanel):
ctx.add_class("distbutton_bottom") ctx.add_class("distbutton_bottom")
else: else:
ctx.add_class("distbutton") ctx.add_class("distbutton")
if i == "10": if i == self.tempdelta:
ctx.add_class("distbutton_active") ctx.add_class("distbutton_active")
tempgrid.attach(self.labels[f'deg{i}'], j, 0, 1, 1) tempgrid.attach(self.labels[f'deg{i}'], j, 0, 1, 1)
self.labels[f"deg{self.tempdelta}"].set_active(True)
vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
vbox.pack_start(Gtk.Label(_("Temperature") + " (°C)"), False, False, 8) vbox.pack_start(Gtk.Label(_("Temperature") + " (°C)"), False, False, 8)
@@ -140,20 +141,10 @@ class TemperaturePanel(ScreenPanel):
return deltagrid return deltagrid
def change_temp_delta(self, widget, tempdelta): def change_temp_delta(self, widget, tempdelta):
if self.tempdelta == tempdelta:
return
logging.info(f"### tempdelta {tempdelta}") logging.info(f"### tempdelta {tempdelta}")
self.labels[f"deg{self.tempdelta}"].get_style_context().remove_class("distbutton_active")
ctx = self.labels[f"deg{self.tempdelta}"].get_style_context() self.labels[f"deg{tempdelta}"].get_style_context().add_class("distbutton_active")
ctx.remove_class("distbutton_active")
self.tempdelta = tempdelta self.tempdelta = tempdelta
ctx = self.labels[f"deg{self.tempdelta}"].get_style_context()
ctx.add_class("distbutton_active")
for i in self.tempdeltas:
if i == self.tempdeltas:
continue
self.labels[f"deg{i}"].set_active(False)
def change_target_temp_incremental(self, widget, direction): def change_target_temp_incremental(self, widget, direction):
@@ -222,18 +213,17 @@ class TemperaturePanel(ScreenPanel):
self.hide_numpad() self.hide_numpad()
def select_heater(self, widget, device): def select_heater(self, widget, device):
if self.active_heater is None: if self.active_heater is None and device in self.devices and self.devices[device]["can_target"]:
if self.devices[device]["can_target"]: if device in self.active_heaters:
if device in self.active_heaters: self.active_heaters.pop(self.active_heaters.index(device))
self.active_heaters.pop(self.active_heaters.index(device)) self.devices[device]['name'].get_style_context().remove_class("button_active")
self.devices[device]['name'].get_style_context().remove_class("button_active") self.devices[device]['select'].set_label(_("Select"))
self.devices[device]['select'].set_label(_("Select")) logging.info(f"Deselecting {device}")
logging.info(f"Deselecting {device}") return
return self.active_heaters.append(device)
self.active_heaters.append(device) self.devices[device]['name'].get_style_context().add_class("button_active")
self.devices[device]['name'].get_style_context().add_class("button_active") self.devices[device]['select'].set_label(_("Deselect"))
self.devices[device]['select'].set_label(_("Deselect")) logging.info(f"Seselecting {device}")
logging.info(f"Seselecting {device}")
return return
def set_temperature(self, widget, setting): def set_temperature(self, widget, setting):
@@ -289,6 +279,7 @@ class TemperaturePanel(ScreenPanel):
elif target > max_temp: elif target > max_temp:
self._screen.show_popup_message(_("Can't set above the maximum:") + f' {max_temp}') self._screen.show_popup_message(_("Can't set above the maximum:") + f' {max_temp}')
return False return False
logging.debug(f"Invalid {heater} Target:{target}/{max_temp}")
return False return False
def preheat_gcode(self, setting): def preheat_gcode(self, setting):
@@ -527,7 +518,7 @@ class TemperaturePanel(ScreenPanel):
h, h,
self._printer.get_dev_stat(h, "temperature"), self._printer.get_dev_stat(h, "temperature"),
self._printer.get_dev_stat(h, "target"), self._printer.get_dev_stat(h, "target"),
self._printer.get_dev_stat(x, "power"), self._printer.get_dev_stat(h, "power"),
) )
return return
+66 -53
View File
@@ -16,24 +16,18 @@ def create_panel(*args):
class ZCalibratePanel(ScreenPanel): class ZCalibratePanel(ScreenPanel):
_screen = None _screen = None
widgets = {} widgets = {}
distance = 1
distances = ['.01', '.05', '.1', '.5', '1', '5'] distances = ['.01', '.05', '.1', '.5', '1', '5']
distance = distances[-2]
probe_types = ["probe", "bltouch", "smart_effector", "dockable_probe"]
def __init__(self, screen, title, back=True): def __init__(self, screen, title, back=True):
super().__init__(screen, title, False) super().__init__(screen, title, False)
self.z_offset = None self.z_offset = None
for probe_type in self.probe_types:
def initialize(self, panel_name): if self._printer.config_section_exists(probe_type):
self.z_offset = float(self._screen.printer.get_config_section(probe_type)['z_offset'])
if self._printer.config_section_exists("probe"): logging.info(f"Using: {probe_type} Z offset: {self.z_offset}")
self.z_offset = float(self._screen.printer.get_config_section("probe")['z_offset']) break
elif self._printer.config_section_exists("bltouch"):
self.z_offset = float(self._screen.printer.get_config_section("bltouch")['z_offset'])
elif self._printer.config_section_exists("smart_effector"):
self.z_offset = float(self._screen.printer.get_config_section("smart_effector")['z_offset'])
else:
self.z_offset = None
self.widgets['zposition'] = Gtk.Label("Z: ?") self.widgets['zposition'] = Gtk.Label("Z: ?")
pos = self._gtk.HomogeneousGrid() pos = self._gtk.HomogeneousGrid()
@@ -62,9 +56,11 @@ class ZCalibratePanel(ScreenPanel):
and not self._screen.printer.get_config_section("stepper_z")['endstop_pin'].startswith("probe"): and not self._screen.printer.get_config_section("stepper_z")['endstop_pin'].startswith("probe"):
self._add_button("Endstop", "endstop", pobox) self._add_button("Endstop", "endstop", pobox)
functions.append("endstop") functions.append("endstop")
if self._printer.config_section_exists("probe") or self._printer.config_section_exists("bltouch"): for probe_type in self.probe_types:
self._add_button("Probe", "probe", pobox) if self._printer.config_section_exists(probe_type):
functions.append("probe") self._add_button("Probe", "probe", pobox)
functions.append("probe")
break
if self._printer.config_section_exists("bed_mesh") and "probe" not in functions: if self._printer.config_section_exists("bed_mesh") and "probe" not in functions:
# This is used to do a manual bed mesh if there is no probe # This is used to do a manual bed mesh if there is no probe
self._add_button("Bed mesh", "mesh", pobox) self._add_button("Bed mesh", "mesh", pobox)
@@ -90,7 +86,7 @@ class ZCalibratePanel(ScreenPanel):
distgrid = Gtk.Grid() distgrid = Gtk.Grid()
for j, i in enumerate(self.distances): for j, i in enumerate(self.distances):
self.widgets[i] = self._gtk.ToggleButton(i) self.widgets[i] = self._gtk.Button(i)
self.widgets[i].set_direction(Gtk.TextDirection.LTR) self.widgets[i].set_direction(Gtk.TextDirection.LTR)
self.widgets[i].connect("clicked", self.change_distance, i) self.widgets[i].connect("clicked", self.change_distance, i)
ctx = self.widgets[i].get_style_context() ctx = self.widgets[i].get_style_context()
@@ -100,10 +96,9 @@ class ZCalibratePanel(ScreenPanel):
ctx.add_class("distbutton_bottom") ctx.add_class("distbutton_bottom")
else: else:
ctx.add_class("distbutton") ctx.add_class("distbutton")
if i == "1": if i == self.distance:
ctx.add_class("distbutton_active") ctx.add_class("distbutton_active")
distgrid.attach(self.widgets[i], j, 0, 1, 1) distgrid.attach(self.widgets[i], j, 0, 1, 1)
self.widgets["1"].set_active(True)
self.widgets['move_dist'] = Gtk.Label(_("Move Distance (mm)")) self.widgets['move_dist'] = Gtk.Label(_("Move Distance (mm)"))
distances = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) distances = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
@@ -158,10 +153,10 @@ class ZCalibratePanel(ScreenPanel):
self._screen._ws.klippy.gcode_script(KlippyGcodes.Z_ENDSTOP_CALIBRATE) self._screen._ws.klippy.gcode_script(KlippyGcodes.Z_ENDSTOP_CALIBRATE)
def _move_to_position(self): def _move_to_position(self):
# Get position from config
x_position = y_position = None x_position = y_position = None
z_hop = speed = None
# Get position from config
printer_cfg = self._config.get_printer_config(self._screen.connected_printer) printer_cfg = self._config.get_printer_config(self._screen.connected_printer)
logging.info(printer_cfg)
if printer_cfg is not None: if printer_cfg is not None:
x_position = printer_cfg.getfloat("calibrate_x_position", None) x_position = printer_cfg.getfloat("calibrate_x_position", None)
y_position = printer_cfg.getfloat("calibrate_y_position", None) y_position = printer_cfg.getfloat("calibrate_y_position", None)
@@ -170,6 +165,35 @@ class ZCalibratePanel(ScreenPanel):
x_position = self._config.get_config()['z_calibrate_position'].getfloat("calibrate_x_position", None) x_position = self._config.get_config()['z_calibrate_position'].getfloat("calibrate_x_position", None)
y_position = self._config.get_config()['z_calibrate_position'].getfloat("calibrate_y_position", None) y_position = self._config.get_config()['z_calibrate_position'].getfloat("calibrate_y_position", None)
klipper_cfg = self._screen.printer.get_config_section_list()
for probe_type in self.probe_types:
if probe_type in klipper_cfg:
probe = self._screen.printer.get_config_section(probe_type)
if "sample_retract_dist" in probe:
z_hop = probe['sample_retract_dist']
if "speed" in probe:
speed = probe['speed']
# Use safe_z_home position
if "safe_z_home" in self._screen.printer.get_config_section_list():
safe_z = self._screen.printer.get_config_section("safe_z_home")
safe_z_xy = safe_z['home_xy_position']
safe_z_xy = [str(i.strip()) for i in safe_z_xy.split(',')]
if x_position is None:
x_position = float(safe_z_xy[0])
logging.debug(f"Using safe_z x:{x_position}")
if y_position is None:
y_position = float(safe_z_xy[1])
logging.debug(f"Using safe_z y:{y_position}")
if 'z_hop' in safe_z:
z_hop = safe_z['z_hop']
if 'z_hop_speed' in safe_z:
speed = safe_z['z_hop_speed']
speed = 15 if speed is None else speed
z_hop = 5 if z_hop is None else z_hop
self._screen._ws.klippy.gcode_script(f"G0 Z{z_hop} F{float(speed) * 60}")
if x_position is not None and y_position is not None: if x_position is not None and y_position is not None:
logging.debug(f"Configured probing position X: {x_position} Y: {y_position}") logging.debug(f"Configured probing position X: {x_position} Y: {y_position}")
self._screen._ws.klippy.gcode_script(f'G0 X{x_position} Y{y_position} F3000') self._screen._ws.klippy.gcode_script(f'G0 X{x_position} Y{y_position} F3000')
@@ -177,9 +201,9 @@ class ZCalibratePanel(ScreenPanel):
logging.info("Detected delta kinematics calibrating at 0,0") logging.info("Detected delta kinematics calibrating at 0,0")
self._screen._ws.klippy.gcode_script('G0 X0 Y0 F3000') self._screen._ws.klippy.gcode_script('G0 X0 Y0 F3000')
else: else:
self._calculate_position() self._calculate_position(klipper_cfg)
def _calculate_position(self): def _calculate_position(self, klipper_cfg):
logging.debug("Position not configured, probing the middle of the bed") logging.debug("Position not configured, probing the middle of the bed")
try: try:
xmax = float(self._screen.printer.get_config_section("stepper_x")['position_max']) xmax = float(self._screen.printer.get_config_section("stepper_x")['position_max'])
@@ -192,23 +216,19 @@ class ZCalibratePanel(ScreenPanel):
logging.info(f"Center position X:{x_position} Y:{y_position}") logging.info(f"Center position X:{x_position} Y:{y_position}")
# Find probe offset # Find probe offset
klipper_cfg = self._screen.printer.get_config_section_list()
x_offset = y_offset = None x_offset = y_offset = None
if "bltouch" in klipper_cfg: for probe_type in self.probe_types:
bltouch = self._screen.printer.get_config_section("bltouch") if probe_type in klipper_cfg:
if "x_offset" in bltouch: probe = self._screen.printer.get_config_section(probe_type)
x_offset = float(bltouch['x_offset']) if "x_offset" in probe:
if "y_offset" in bltouch: x_offset = float(probe['x_offset'])
y_offset = float(bltouch['y_offset']) if "y_offset" in probe:
elif "probe" in klipper_cfg: y_offset = float(probe['y_offset'])
probe = self._screen.printer.get_config_section("probe") break
if "x_offset" in probe: logging.info(f"Offset X:{x_offset} Y:{y_offset}")
x_offset = float(probe['x_offset']) if x_offset is not None:
if "y_offset" in probe:
y_offset = float(probe['y_offset'])
if x_offset is not None and y_offset is not None:
logging.info(f"Probe offset X:{x_offset} Y:{y_offset}")
x_position = x_position - x_offset x_position = x_position - x_offset
if y_offset is not None:
y_position = y_position - y_offset y_position = y_position - y_offset
logging.info(f"Moving to X:{x_position} Y:{y_position}") logging.info(f"Moving to X:{x_position} Y:{y_position}")
@@ -247,24 +267,13 @@ class ZCalibratePanel(ScreenPanel):
self.widgets['zoffset'].set_text(f"{-position[2] + self.z_offset:.2f}") self.widgets['zoffset'].set_text(f"{-position[2] + self.z_offset:.2f}")
def change_distance(self, widget, distance): def change_distance(self, widget, distance):
if self.distance == distance: logging.info(f"### Distance {distance}")
return self.widgets[f"{self.distance}"].get_style_context().remove_class("distbutton_active")
self.widgets[f"{distance}"].get_style_context().add_class("distbutton_active")
ctx = self.widgets[f'{self.distance}'].get_style_context()
ctx.remove_class("distbutton_active")
self.distance = distance self.distance = distance
ctx = self.widgets[self.distance].get_style_context()
ctx.add_class("distbutton_active")
for i in self.distances:
if i == self.distance:
continue
self.widgets[f"{i}"].set_active(False)
def move(self, widget, direction): def move(self, widget, direction):
dist = f"{direction}{self.distance}" self._screen._ws.klippy.gcode_script(KlippyGcodes.testz_move(f"{direction}{self.distance}"))
logging.info(f"# Moving {KlippyGcodes.testz_move(dist)}")
self._screen._ws.klippy.gcode_script(KlippyGcodes.testz_move(dist))
def abort(self, widget): def abort(self, widget):
logging.info("Aborting calibration") logging.info("Aborting calibration")
@@ -301,3 +310,7 @@ class ZCalibratePanel(ScreenPanel):
self.widgets['complete'].get_style_context().remove_class('color3') self.widgets['complete'].get_style_context().remove_class('color3')
self.widgets['cancel'].set_sensitive(False) self.widgets['cancel'].set_sensitive(False)
self.widgets['cancel'].get_style_context().remove_class('color2') self.widgets['cancel'].get_style_context().remove_class('color2')
def activate(self):
# This is only here because klipper doesn't provide a method to detect if it's calibrating
self._screen._ws.klippy.gcode_script(KlippyGcodes.testz_move("+0.001"))
+180 -326
View File
@@ -1,13 +1,13 @@
#!/usr/bin/python #!/usr/bin/python
import argparse import argparse
import gi import gi
import json import json
import importlib import importlib
import logging import logging
import os import os
import re
import signal import signal
import subprocess import subprocess
import pathlib import pathlib
@@ -28,9 +28,6 @@ from ks_includes.config import KlipperScreenConfig
from panels.base_panel import BasePanel from panels.base_panel import BasePanel
logging.getLogger("urllib3").setLevel(logging.WARNING) logging.getLogger("urllib3").setLevel(logging.WARNING)
logging.getLogger('matplotlib').setLevel(logging.WARNING)
# This is here to avoid performance issues opening bed_mesh
import matplotlib.pyplot # noqa
PRINTER_BASE_STATUS_OBJECTS = [ PRINTER_BASE_STATUS_OBJECTS = [
'bed_mesh', 'bed_mesh',
@@ -54,33 +51,38 @@ PRINTER_BASE_STATUS_OBJECTS = [
klipperscreendir = pathlib.Path(__file__).parent.resolve() klipperscreendir = pathlib.Path(__file__).parent.resolve()
def set_text_direction(lang=None):
rtl_languages = ['he_IL']
if lang is None:
for lng in rtl_languages:
if os.getenv('LANG').startswith(lng):
lang = lng
break
if lang in rtl_languages:
Gtk.Widget.set_default_direction(Gtk.TextDirection.RTL)
logging.debug("Enabling RTL mode")
return False
Gtk.Widget.set_default_direction(Gtk.TextDirection.LTR)
return True
class KlipperScreen(Gtk.Window): class KlipperScreen(Gtk.Window):
""" Class for creating a screen for Klipper via HDMI """ """ Class for creating a screen for Klipper via HDMI """
_cur_panels = [] _cur_panels = []
bed_temp_label = None
connecting = False connecting = False
connecting_to_printer = None connecting_to_printer = None
connected_printer = None connected_printer = None
currentPanel = None
files = None files = None
filename = ""
keyboard = None keyboard = None
last_update = {}
load_panel = {} load_panel = {}
number_tools = 1
panels = {} panels = {}
popup_message = None popup_message = None
screensaver = None screensaver = None
printer = None printer = None
printer_select_callbacks = []
printer_select_prepanel = None
rtl_languages = ['he_il']
subscriptions = [] subscriptions = []
shutdown = True
updating = False updating = False
update_queue = [] update_queue = []
_ws = None _ws = None
init_printer_timeout = None
dpms_timeout = None dpms_timeout = None
screensaver_timeout = None screensaver_timeout = None
reinit_count = 0 reinit_count = 0
@@ -96,47 +98,44 @@ class KlipperScreen(Gtk.Window):
configfile = os.path.normpath(os.path.expanduser(args.configfile)) configfile = os.path.normpath(os.path.expanduser(args.configfile))
self._config = KlipperScreenConfig(configfile, self) self._config = KlipperScreenConfig(configfile, self)
self.lang = self._config.get_lang() self.lang_ltr = set_text_direction(self._config.get_main_config().get("language", None))
logging.debug(f"OS Language: {os.getenv('LANG')}")
self.lang_ltr = True
for lang in self.rtl_languages:
if os.getenv('LANG').lower().startswith(lang):
self.lang_ltr = False
Gtk.Widget.set_default_direction(Gtk.TextDirection.RTL)
logging.debug("Enabling RTL mode")
break
Gtk.Window.__init__(self) Gtk.Window.__init__(self)
self.set_title("KlipperScreen")
monitor = Gdk.Display.get_default().get_primary_monitor() monitor = Gdk.Display.get_default().get_primary_monitor()
self.width = self._config.get_main_config().getint("width", monitor.get_geometry().width) self.width = self._config.get_main_config().getint("width", monitor.get_geometry().width)
self.height = self._config.get_main_config().getint("height", monitor.get_geometry().height) self.height = self._config.get_main_config().getint("height", monitor.get_geometry().height)
self.set_default_size(self.width, self.height) self.set_default_size(self.width, self.height)
self.set_resizable(False) self.set_resizable(False)
if not (self._config.get_main_config().get("width") or self._config.get_main_config().get("height")):
self.fullscreen()
self.vertical_mode = self.width < self.height self.vertical_mode = self.width < self.height
logging.info(f"Screen resolution: {self.width}x{self.height}") logging.info(f"Screen resolution: {self.width}x{self.height}")
self.theme = self._config.get_main_config().get('theme') self.theme = self._config.get_main_config().get('theme')
self.show_cursor = self._config.get_main_config().getboolean("show_cursor", fallback=False) show_cursor = self._config.get_main_config().getboolean("show_cursor", fallback=False)
self.gtk = KlippyGtk(self, self.width, self.height, self.theme, self.show_cursor, self.gtk = KlippyGtk(self, self.width, self.height, self.theme, show_cursor,
self._config.get_main_config().get("font_size", "medium")) self._config.get_main_config().get("font_size", "medium"))
self.init_style() self.init_style()
self.set_icon_from_file(os.path.join(klipperscreendir, "styles", "icon.svg"))
self.base_panel = BasePanel(self, title="Base Panel", back=False) self.base_panel = BasePanel(self, title="Base Panel", back=False)
self.add(self.base_panel.get()) self.add(self.base_panel.get())
self.show_all() self.show_all()
if show_cursor:
self.get_window().set_cursor(
Gdk.Cursor.new_for_display(Gdk.Display.get_default(), Gdk.CursorType.ARROW))
os.system("xsetroot -cursor_name arrow")
else:
self.get_window().set_cursor(
Gdk.Cursor.new_for_display(Gdk.Display.get_default(), Gdk.CursorType.BLANK_CURSOR))
os.system("xsetroot -cursor ks_includes/emptyCursor.xbm ks_includes/emptyCursor.xbm")
self.base_panel.activate() self.base_panel.activate()
self.printer_initializing(_("Initializing"))
if self._config.errors: if self._config.errors:
self.show_error_modal("Invalid config file", self._config.get_errors()) self.show_error_modal("Invalid config file", self._config.get_errors())
# Prevent this dialog from being destroyed # Prevent this dialog from being destroyed
self.dialogs = [] self.dialogs = []
self.set_screenblanking_timeout(self._config.get_main_config().get('screen_blanking')) self.set_screenblanking_timeout(self._config.get_main_config().get('screen_blanking'))
# Move mouse to 0,0
os.system("/usr/bin/xdotool mousemove 0 0")
self.change_cursor()
self.initial_connection() self.initial_connection()
def initial_connection(self): def initial_connection(self):
@@ -149,83 +148,32 @@ class KlipperScreen(Gtk.Window):
pname = list(printers[0])[0] pname = list(printers[0])[0]
self.connect_printer(pname) self.connect_printer(pname)
else: else:
self.show_panel("printer_select", "printer_select", "Printer Select", 2) self.base_panel.show_printer_select(True)
self.show_printer_select()
def connect_printer_widget(self, widget, name):
self.connect_printer(name)
def connect_printer(self, name): def connect_printer(self, name):
self.connecting_to_printer = name
if self._ws is not None and self._ws.connected:
self._ws.close()
return
data = { data = {
"moonraker_host": "127.0.0.1", "moonraker_host": "127.0.0.1",
"moonraker_port": "7125", "moonraker_port": "7125",
"moonraker_api_key": False "moonraker_api_key": False
} }
self.connecting_to_printer = name logging.info(f"Connecting to printer: {name}")
if self.connected_printer == name:
if self.printer_select_prepanel is not None:
self.show_panel(self.printer_select_prepanel, "", "", 2)
self.printer_select_prepanel = None
while len(self.printer_select_callbacks) > 0:
i = self.printer_select_callbacks.pop(0)
i()
if self.printer.get_state() not in ["disconnected", "error", "startup", "shutdown"]:
self.base_panel.show_heaters(True)
self.base_panel.show_printer_select(True)
self.base_panel.show_macro_shortcut(self._config.get_main_config().getboolean('side_macro_shortcut', True))
return
# Cleanup
self.printer_select_callbacks = []
self.printer_select_prepanel = None
if self.files is not None:
self.files.reset()
self.files = None
if self.printer is not None:
self.printer.reset()
self.printer = None
for printer in self._config.get_printers(): for printer in self._config.get_printers():
pname = list(printer)[0] pname = list(printer)[0]
if pname != name: if pname != name:
continue continue
data = printer[pname] data = printer[pname]
break break
if self._ws is not None:
self._ws.close()
self.connecting = True
logging.info(f"Connecting to printer: {name}")
self.apiclient = KlippyRest(data["moonraker_host"], data["moonraker_port"], data["moonraker_api_key"]) self.apiclient = KlippyRest(data["moonraker_host"], data["moonraker_port"], data["moonraker_api_key"])
self.printer = Printer(self.state_execute)
self.printer = Printer({ self.printer.state_callbacks = {
"software_version": "Unknown"
}, {
'configfile': {
'config': {}
},
'print_stats': {
'state': 'disconnected'
},
'virtual_sdcard': {
'is_active': False
}
}, self.state_execute)
self._remove_all_panels()
self.subscriptions = []
for panel in list(self.panels):
if panel not in ["printer_select", "splash_screen"]:
del self.panels[panel]
for dialog in self.dialogs:
dialog.destroy()
self.base_panel.show_printer_select(True)
self.printer_initializing(_("Connecting to %s") % name)
self.printer.set_callbacks({
"disconnected": self.state_disconnected, "disconnected": self.state_disconnected,
"error": self.state_error, "error": self.state_error,
"paused": self.state_paused, "paused": self.state_paused,
@@ -233,13 +181,15 @@ class KlipperScreen(Gtk.Window):
"ready": self.state_ready, "ready": self.state_ready,
"startup": self.state_startup, "startup": self.state_startup,
"shutdown": self.state_shutdown "shutdown": self.state_shutdown
}) }
self._remove_all_panels()
self.printer_initializing(_("Connecting to %s") % name)
self._ws = KlippyWebsocket(self, self._ws = KlippyWebsocket(self,
{ {
"on_connect": self.init_printer, "on_connect": self.init_printer,
"on_message": self._websocket_callback, "on_message": self._websocket_callback,
"on_close": self.printer_initializing "on_close": self.websocket_disconnected
}, },
data["moonraker_host"], data["moonraker_host"],
data["moonraker_port"] data["moonraker_port"]
@@ -247,22 +197,19 @@ class KlipperScreen(Gtk.Window):
self.files = KlippyFiles(self) self.files = KlippyFiles(self)
self._ws.initial_connect() self._ws.initial_connect()
self.connecting = False
self.connected_printer = name
logging.debug(f"Connected to printer: {name}")
def ws_subscribe(self): def ws_subscribe(self):
requested_updates = { requested_updates = {
"objects": { "objects": {
"bed_mesh": ["profile_name", "mesh_max", "mesh_min", "probed_matrix"], "bed_mesh": ["profile_name", "mesh_max", "mesh_min", "probed_matrix", "profiles"],
"configfile": ["config"], "configfile": ["config"],
"display_status": ["progress", "message"], "display_status": ["progress", "message"],
"fan": ["speed"], "fan": ["speed"],
"gcode_move": ["extrude_factor", "gcode_position", "homing_origin", "speed_factor", "speed"], "gcode_move": ["extrude_factor", "gcode_position", "homing_origin", "speed_factor", "speed"],
"idle_timeout": ["state"], "idle_timeout": ["state"],
"pause_resume": ["is_paused"], "pause_resume": ["is_paused"],
"print_stats": ["print_duration", "total_duration", "filament_used", "filename", "state", "message"], "print_stats": ["print_duration", "total_duration", "filament_used", "filename", "state", "message",
"info"],
"toolhead": ["homed_axes", "estimated_print_time", "print_time", "position", "extruder", "toolhead": ["homed_axes", "estimated_print_time", "print_time", "position", "extruder",
"max_accel", "max_accel_to_decel", "max_velocity", "square_corner_velocity"], "max_accel", "max_accel_to_decel", "max_velocity", "square_corner_velocity"],
"virtual_sdcard": ["file_position", "is_active", "progress"], "virtual_sdcard": ["file_position", "is_active", "progress"],
@@ -292,61 +239,45 @@ class KlipperScreen(Gtk.Window):
panel_path = os.path.join(os.path.dirname(__file__), 'panels', f"{panel}.py") panel_path = os.path.join(os.path.dirname(__file__), 'panels', f"{panel}.py")
logging.info(f"Panel path: {panel_path}") logging.info(f"Panel path: {panel_path}")
if not os.path.exists(panel_path): if not os.path.exists(panel_path):
msg = f"Panel {panel} does not exist" logging.error(f"Panel {panel} does not exist")
logging.info(msg) raise FileNotFoundError(os.strerror(2), "\n" + panel_path)
raise Exception(msg)
module = importlib.import_module(f"panels.{panel}") module = importlib.import_module(f"panels.{panel}")
if not hasattr(module, "create_panel"): if not hasattr(module, "create_panel"):
msg = f"Cannot locate create_panel function for {panel}" raise ImportError(f"Cannot locate create_panel function for {panel}")
logging.info(msg)
raise Exception(msg)
self.load_panel[panel] = getattr(module, "create_panel") self.load_panel[panel] = getattr(module, "create_panel")
try: try:
return self.load_panel[panel](*args) return self.load_panel[panel](*args)
except Exception as e: except Exception as e:
msg = f"Unable to create panel {panel}\n{e}" raise RuntimeError(f"Unable to create panel: {panel}\n{e}") from e
logging.exception(msg)
raise Exception(msg) from e
def show_panel(self, panel_name, panel_type, title, remove=None, pop=True, **kwargs): def show_panel(self, panel_name, panel_type, title, remove=None, pop=True, **kwargs):
if panel_name not in self.panels:
try:
self.panels[panel_name] = self._load_panel(panel_type, self, title)
if kwargs != {}:
self.panels[panel_name].initialize(panel_name, **kwargs)
else:
self.panels[panel_name].initialize(panel_name)
except Exception as e:
if panel_name in self.panels:
del self.panels[panel_name]
logging.exception(f"Unable to load panel {panel_type}")
self.show_error_modal(f"Unable to load panel {panel_type}", f"{e}")
return
if hasattr(self.panels[panel_name], "process_update"):
self.panels[panel_name].process_update("notify_status_update", self.printer.get_data())
try: try:
if remove == 2: if remove == 2:
self._remove_all_panels() self._remove_all_panels()
elif remove == 1: elif remove == 1:
self._remove_current_panel(pop) self._remove_current_panel(pop)
if panel_name not in self.panels:
try:
self.panels[panel_name] = self._load_panel(panel_type, self, title)
if hasattr(self.panels[panel_name], "initialize"):
self.panels[panel_name].initialize(**kwargs)
except Exception as e:
if panel_name in self.panels:
del self.panels[panel_name]
logging.exception(f"Unable to load panel {panel_type}")
self.show_error_modal(f"Unable to load panel {panel_type}", f"{e}")
return
logging.debug(f"Attaching panel {panel_name}") logging.debug(f"Attaching panel {panel_name}")
self.base_panel.add_content(self.panels[panel_name]) self.base_panel.add_content(self.panels[panel_name])
logging.debug(f"Showing back. count: {len(self._cur_panels)}") self.base_panel.show_back(len(self._cur_panels) > 0)
if len(self._cur_panels) == 0:
self.base_panel.show_back(False)
else:
self.base_panel.show_back(True)
self.show_all() self.show_all()
if hasattr(self.panels[panel_name], "process_update"): if hasattr(self.panels[panel_name], "process_update"):
self.panels[panel_name].process_update("notify_status_update", self.printer.get_updates())
self.add_subscription(panel_name) self.add_subscription(panel_name)
if hasattr(self.panels[panel_name], "activate"): if hasattr(self.panels[panel_name], "activate"):
self.panels[panel_name].activate() self.panels[panel_name].activate()
@@ -355,11 +286,10 @@ class KlipperScreen(Gtk.Window):
logging.exception(f"Error attaching panel:\n{e}") logging.exception(f"Error attaching panel:\n{e}")
self._cur_panels.append(panel_name) self._cur_panels.append(panel_name)
logging.debug(f"Current panel hierarchy: {self._cur_panels}") logging.debug(f"Current panel hierarchy: {' > '.join(self._cur_panels)}")
def show_popup_message(self, message, level=3): def show_popup_message(self, message, level=3):
if self.screensaver is not None: self.close_screensaver()
self.wake_screen()
if self.popup_message is not None: if self.popup_message is not None:
self.close_popup_message() self.close_popup_message()
@@ -409,7 +339,7 @@ class KlipperScreen(Gtk.Window):
self.popup_message = None self.popup_message = None
def show_error_modal(self, err, e=""): def show_error_modal(self, err, e=""):
logging.exception(f"Showing error modal: {err}") logging.error(f"Showing error modal: {err}")
title = Gtk.Label() title = Gtk.Label()
title.set_markup(f"<b>{err}</b>\n") title.set_markup(f"<b>{err}</b>\n")
@@ -441,12 +371,11 @@ class KlipperScreen(Gtk.Window):
] ]
self.gtk.Dialog(self, buttons, grid, self.error_modal_response) self.gtk.Dialog(self, buttons, grid, self.error_modal_response)
@staticmethod def error_modal_response(self, widget, response_id):
def error_modal_response(widget, response_id):
widget.destroy() widget.destroy()
self.reload_panels()
def restart_warning(self, value): def restart_warning(self, value):
logging.debug(f"Showing restart warning because: {value}") logging.debug(f"Showing restart warning because: {value}")
buttons = [ buttons = [
@@ -526,16 +455,11 @@ class KlipperScreen(Gtk.Window):
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
) )
def is_printing(self):
return self.printer.get_state() == "printing"
def is_updating(self): def is_updating(self):
return self.updating return self.updating
def _go_to_submenu(self, widget, name): def _go_to_submenu(self, widget, name):
logging.info(f"#### Go to submenu {name}") logging.info(f"#### Go to submenu {name}")
# self._remove_current_panel(False)
# Find current menu item # Find current menu item
if "main_panel" in self._cur_panels: if "main_panel" in self._cur_panels:
menu = "__main" menu = "__main"
@@ -551,21 +475,29 @@ class KlipperScreen(Gtk.Window):
logging.info("No items in menu, returning.") logging.info("No items in menu, returning.")
return return
self.show_panel(f'{self._cur_panels[-1]}_{name}', self.show_panel(f'{self._cur_panels[-1]}_{name}', "menu", disname, 1, False, items=menuitems)
"menu", disname, 1, False, display_name=disname, items=menuitems)
def _remove_all_panels(self): def _remove_all_panels(self):
while len(self._cur_panels) > 0: self.subscriptions = []
self._remove_current_panel(True, False) self._cur_panels = []
self.show_all() for _ in self.base_panel.content.get_children():
self.base_panel.content.remove(_)
for panel in list(self.panels):
if panel not in ["printer_select", "splash_screen"]:
del self.panels[panel]
for dialog in self.dialogs:
dialog.destroy()
self.close_screensaver()
def _remove_current_panel(self, pop=True, show=True): def _remove_current_panel(self, pop=True):
if len(self._cur_panels) <= 0: if len(self._cur_panels) <= 0:
self.reload_panels()
return return
self.base_panel.remove(self.panels[self._cur_panels[-1]].get_content()) self.base_panel.remove(self.panels[self._cur_panels[-1]].get_content())
if hasattr(self.panels[self._cur_panels[-1]], "deactivate"): if hasattr(self.panels[self._cur_panels[-1]], "deactivate"):
self.panels[self._cur_panels[-1]].deactivate() self.panels[self._cur_panels[-1]].deactivate()
self.remove_subscription(self._cur_panels[-1]) if self._cur_panels[-1] in self.subscriptions:
self.subscriptions.remove(self._cur_panels[-1])
if pop is True: if pop is True:
self._cur_panels.pop() self._cur_panels.pop()
if len(self._cur_panels) > 0: if len(self._cur_panels) > 0:
@@ -574,11 +506,8 @@ class KlipperScreen(Gtk.Window):
if hasattr(self.panels[self._cur_panels[-1]], "activate"): if hasattr(self.panels[self._cur_panels[-1]], "activate"):
self.panels[self._cur_panels[-1]].activate() self.panels[self._cur_panels[-1]].activate()
if hasattr(self.panels[self._cur_panels[-1]], "process_update"): if hasattr(self.panels[self._cur_panels[-1]], "process_update"):
self.panels[self._cur_panels[-1]].process_update("notify_status_update",
self.printer.get_updates())
self.add_subscription(self._cur_panels[-1]) self.add_subscription(self._cur_panels[-1])
if show is True: self.show_all()
self.show_all()
def _menu_go_back(self, widget=None): def _menu_go_back(self, widget=None):
logging.info("#### Menu go back") logging.info("#### Menu go back")
@@ -595,19 +524,10 @@ class KlipperScreen(Gtk.Window):
self._remove_current_panel() self._remove_current_panel()
def add_subscription(self, panel_name): def add_subscription(self, panel_name):
for sub in self.subscriptions: if panel_name not in self.subscriptions:
if sub == panel_name: self.subscriptions.append(panel_name)
return
self.subscriptions.append(panel_name) def reset_screensaver_timeout(self, *args):
def remove_subscription(self, panel_name):
for i in range(len(self.subscriptions)):
if self.subscriptions[i] == panel_name:
self.subscriptions.pop(i)
return
def reset_screensaver_timeout(self, widget=None):
if self.screensaver_timeout is not None: if self.screensaver_timeout is not None:
GLib.source_remove(self.screensaver_timeout) GLib.source_remove(self.screensaver_timeout)
self.screensaver_timeout = GLib.timeout_add_seconds(self.blanking_time, self.show_screensaver) self.screensaver_timeout = GLib.timeout_add_seconds(self.blanking_time, self.show_screensaver)
@@ -617,6 +537,8 @@ class KlipperScreen(Gtk.Window):
if self.screensaver is not None: if self.screensaver is not None:
self.close_screensaver() self.close_screensaver()
self.remove_keyboard() self.remove_keyboard()
for dialog in self.dialogs:
dialog.hide()
close = Gtk.Button() close = Gtk.Button()
close.connect("clicked", self.close_screensaver) close.connect("clicked", self.close_screensaver)
@@ -626,12 +548,12 @@ class KlipperScreen(Gtk.Window):
box.pack_start(close, True, True, 0) box.pack_start(close, True, True, 0)
box.set_halign(Gtk.Align.CENTER) box.set_halign(Gtk.Align.CENTER)
box.get_style_context().add_class("screensaver") box.get_style_context().add_class("screensaver")
self.base_panel.get().put(box, 0, 0) self.base_panel.get().put(box, 0, 0)
self.show_all()
# Avoid leaving a cursor-handle # Avoid leaving a cursor-handle
close.grab_focus() close.grab_focus()
self.screensaver = box self.screensaver = box
self.screensaver.show_all()
return False return False
def close_screensaver(self, widget=None): def close_screensaver(self, widget=None):
@@ -644,6 +566,8 @@ class KlipperScreen(Gtk.Window):
self.wake_screen() self.wake_screen()
else: else:
self.screensaver_timeout = GLib.timeout_add_seconds(self.blanking_time, self.show_screensaver) self.screensaver_timeout = GLib.timeout_add_seconds(self.blanking_time, self.show_screensaver)
for dialog in self.dialogs:
dialog.show()
self.show_all() self.show_all()
return False return False
@@ -665,7 +589,6 @@ class KlipperScreen(Gtk.Window):
if self._config.get_main_config().get('screen_blanking') != "off": if self._config.get_main_config().get('screen_blanking') != "off":
logging.debug("Screen wake up") logging.debug("Screen wake up")
os.system("xset -display :0 dpms force on") os.system("xset -display :0 dpms force on")
self.close_screensaver()
def set_dpms(self, use_dpms): def set_dpms(self, use_dpms):
self.use_dpms = use_dpms self.use_dpms = use_dpms
@@ -714,49 +637,37 @@ class KlipperScreen(Gtk.Window):
if self.updating is True and updating is False and len(self.update_queue) > 0: if self.updating is True and updating is False and len(self.update_queue) > 0:
i = self.update_queue.pop() i = self.update_queue.pop()
self.update_queue = [] self.update_queue = []
i[0](i[1]) i[0]()
self.updating = updating self.updating = updating
def show_printer_select(self, widget=None): def show_printer_select(self, widget=None):
logging.debug(f"Saving panel: {self._cur_panels[0]}")
self.printer_select_prepanel = self._cur_panels[0]
self.base_panel.show_heaters(False) self.base_panel.show_heaters(False)
self.base_panel.show_macro_shortcut(False) self.show_panel("printer_select", "printer_select", _("Printer Select"), 2)
self.base_panel.show_printer_select(False)
self.show_panel("printer_select", "printer_select", "Printer Select", 2)
self.show_all()
self.base_panel.action_bar.hide()
def state_execute(self, callback, prev_state): def state_execute(self, callback):
if self.is_updating(): if self.is_updating():
self.update_queue.append([callback, prev_state]) self.update_queue.append([callback])
else: else:
callback(prev_state) self.init_printer()
callback()
def state_disconnected(self, prev_state): def websocket_disconnected(self, msg):
if "printer_select" in self._cur_panels: self.printer_initializing(msg)
self.printer_select_callbacks = [self.state_disconnected] self.connecting = True
return self.connected_printer = None
self.files.reset()
self.files = None
self.printer.reset()
self.printer = None
self.connect_printer(self.connecting_to_printer)
def state_disconnected(self):
logging.debug("### Going to disconnected") logging.debug("### Going to disconnected")
self.base_panel.show_macro_shortcut(False) self.close_screensaver()
self.wake_screen()
self.printer_initializing(_("Klipper has disconnected")) self.printer_initializing(_("Klipper has disconnected"))
if self.connected_printer is not None:
self.connected_printer = None
# Try to reconnect
self.connect_printer(self.connecting_to_printer)
else:
self.initial_connection()
def state_error(self, prev_state): def state_error(self):
if "printer_select" in self._cur_panels: self.close_screensaver()
self.printer_select_callbacks = [self.state_error]
return
self.base_panel.show_macro_shortcut(False)
self.wake_screen()
msg = self.printer.get_stat("webhooks", "state_message") msg = self.printer.get_stat("webhooks", "state_message")
if "FIRMWARE_RESTART" in msg: if "FIRMWARE_RESTART" in msg:
self.printer_initializing("<b>" + _("Klipper has encountered an error.") + "\n" + self.printer_initializing("<b>" + _("Klipper has encountered an error.") + "\n" +
@@ -770,93 +681,58 @@ class KlipperScreen(Gtk.Window):
self.printer_initializing("<b>" + _("Klipper has encountered an error.") + self.printer_initializing("<b>" + _("Klipper has encountered an error.") +
"</b>" + "\n\n" + msg) "</b>" + "\n\n" + msg)
for panel in list(self.panels): def state_paused(self):
if panel not in ["printer_select", "splash_screen"]:
del self.panels[panel]
for dialog in self.dialogs:
dialog.destroy()
def state_paused(self, prev_state):
if "job_status" not in self._cur_panels: if "job_status" not in self._cur_panels:
self.printer_printing() self.printer_printing()
def state_printing(self, prev_state): def state_printing(self):
if "printer_select" in self._cur_panels:
self.printer_select_callbacks = [self.state_printing]
return
if "job_status" not in self._cur_panels: if "job_status" not in self._cur_panels:
self.printer_printing() self.printer_printing()
else: else:
self.panels["job_status"].new_print() self.panels["job_status"].new_print()
def state_ready(self, prev_state): def state_ready(self):
if "printer_select" in self._cur_panels:
self.printer_select_callbacks = [self.state_ready]
return
self.base_panel.show_macro_shortcut(self._config.get_main_config().getboolean('side_macro_shortcut', True))
self.base_panel.show_heaters(True)
# Do not return to main menu if completing a job, timeouts/user input will return # Do not return to main menu if completing a job, timeouts/user input will return
if "job_status" in self._cur_panels or "main_menu" in self._cur_panels: if "job_status" in self._cur_panels:
return return
if prev_state not in ['paused', 'printing']:
self.init_printer()
self.base_panel._printer = self.printer
self.printer_ready() self.printer_ready()
def state_startup(self, prev_state): def state_startup(self):
if "printer_select" in self._cur_panels:
self.printer_select_callbacks = [self.state_startup]
return
self.printer_initializing(_("Klipper is attempting to start")) self.printer_initializing(_("Klipper is attempting to start"))
def state_shutdown(self, prev_state): def state_shutdown(self):
if "printer_select" in self._cur_panels: self.close_screensaver()
self.printer_select_callbacks = [self.state_shutdown]
return
self.base_panel.show_macro_shortcut(False)
self.wake_screen()
msg = self.printer.get_stat("webhooks", "state_message") msg = self.printer.get_stat("webhooks", "state_message")
if "ready" in msg: msg = msg if "ready" not in msg else ""
msg = ""
self.printer_initializing("<b>" + _("Klipper has shutdown") + self.printer_initializing("<b>" + _("Klipper has shutdown") +
"</b>" + "\n\n" + msg) "</b>" + "\n\n" + msg)
def toggle_macro_shortcut(self, value): def toggle_macro_shortcut(self, value):
self.base_panel.show_macro_shortcut(value) self.base_panel.show_macro_shortcut(value)
def change_language(self, lang):
self._config.install_language(lang)
self.lang_ltr = set_text_direction(lang)
self._config._create_configurable_options(self)
self.reload_panels()
def reload_panels(self, *args): def reload_panels(self, *args):
self._remove_all_panels() self._remove_all_panels()
for panel in list(self.panels): self.printer.change_state(self.printer.state)
if panel not in ["printer_select", "splash_screen"]:
del self.panels[panel]
for dialog in self.dialogs:
dialog.destroy()
state = self.printer.state
self.printer.state = None
self.printer.change_state(state)
def _websocket_callback(self, action, data): def _websocket_callback(self, action, data):
if self.connecting:
if self.connecting is True:
return return
if action == "notify_klippy_disconnected": if action == "notify_klippy_disconnected":
logging.debug("Received notify_klippy_disconnected")
self.printer.change_state("disconnected") self.printer.change_state("disconnected")
return return
elif action == "notify_klippy_shutdown":
self.printer.change_state("shutdown")
elif action == "notify_klippy_ready": elif action == "notify_klippy_ready":
self.printer.change_state("ready") self.printer.change_state("ready")
elif action == "notify_status_update" and self.printer.get_state() != "shutdown": elif action == "notify_status_update" and self.printer.state != "shutdown":
self.printer.process_update(data) self.printer.process_update(data)
elif action == "notify_filelist_changed": elif action == "notify_filelist_changed":
logging.debug("Filelist changed: %s", json.dumps(data, indent=2))
if self.files is not None: if self.files is not None:
self.files.process_update(data) self.files.process_update(data)
elif action == "notify_metadata_update": elif action == "notify_metadata_update":
@@ -867,19 +743,13 @@ class KlipperScreen(Gtk.Window):
logging.debug("Power status changed: %s", data) logging.debug("Power status changed: %s", data)
self.printer.process_power_update(data) self.printer.process_power_update(data)
self.panels['splash_screen'].check_power_status() self.panels['splash_screen'].check_power_status()
elif self.printer.get_state() not in ["error", "shutdown"] and action == "notify_gcode_response": elif action == "notify_gcode_response" and self.printer.state not in ["error", "shutdown"]:
if "Klipper state: Shutdown" in data: if not (data.startswith("B:") or data.startswith("T:")):
logging.debug("Shutdown in gcode response, changing state to shutdown")
self.printer.change_state("shutdown")
if not (data.startswith("B:") and
re.search(r'B:[0-9\.]+\s/[0-9\.]+\sT[0-9]+:[0-9\.]+', data)):
if data.startswith("echo: "): if data.startswith("echo: "):
self.show_popup_message(data[6:], 1) self.show_popup_message(data[6:], 1)
elif data.startswith("!! "): elif data.startswith("!! "):
self.show_popup_message(data[3:], 3) self.show_popup_message(data[3:], 3)
logging.debug(json.dumps([action, data], indent=2)) if "SAVE_CONFIG" in data and self.printer.state == "ready":
if "SAVE_CONFIG" in data and self.printer.get_state() == "ready":
script = {"script": "SAVE_CONFIG"} script = {"script": "SAVE_CONFIG"}
self._confirm_send_action( self._confirm_send_action(
None, None,
@@ -887,15 +757,11 @@ class KlipperScreen(Gtk.Window):
"printer.gcode.script", "printer.gcode.script",
script script
) )
self.base_panel.process_update(action, data) self.base_panel.process_update(action, data)
if self._cur_panels[-1] in self.subscriptions: if self._cur_panels and self._cur_panels[-1] in self.subscriptions:
self.panels[self._cur_panels[-1]].process_update(action, data) self.panels[self._cur_panels[-1]].process_update(action, data)
def _confirm_send_action(self, widget, text, method, params=None): def _confirm_send_action(self, widget, text, method, params=None):
if params is None:
params = {}
buttons = [ buttons = [
{"name": _("Continue"), "response": Gtk.ResponseType.OK}, {"name": _("Continue"), "response": Gtk.ResponseType.OK},
{"name": _("Cancel"), "response": Gtk.ResponseType.CANCEL} {"name": _("Cancel"), "response": Gtk.ResponseType.CANCEL}
@@ -903,7 +769,7 @@ class KlipperScreen(Gtk.Window):
try: try:
env = Environment(extensions=["jinja2.ext.i18n"], autoescape=True) env = Environment(extensions=["jinja2.ext.i18n"], autoescape=True)
env.install_gettext_translations(self.lang) env.install_gettext_translations(self._config.get_lang())
j2_temp = env.from_string(text) j2_temp = env.from_string(text)
text = j2_temp.render() text = j2_temp.render()
except Exception as e: except Exception as e:
@@ -929,19 +795,17 @@ class KlipperScreen(Gtk.Window):
widget.destroy() widget.destroy()
def _send_action(self, widget, method, params): def _send_action(self, widget, method, params):
logging.info(f"{method}: {params}")
self._ws.send_method(method, params) self._ws.send_method(method, params)
def printer_initializing(self, text=None, disconnect=False): def printer_initializing(self, msg):
self.close_popup_message() self.close_popup_message()
self.show_panel('splash_screen', "splash_screen", "Splash Screen", 2) if 'splash_screen' not in self.panels or 'printer_select' not in self._cur_panels:
if disconnect is True and self.printer is not None: self.show_panel('splash_screen', "splash_screen", None, 2)
self.shutdown = True self.panels['splash_screen'].update_text(msg)
self.printer.state = "disconnected"
if text is not None:
self.panels['splash_screen'].update_text(text)
def search_power_devices(self, power_devices): def search_power_devices(self, power_devices):
if self.connected_printer is None: if self.connected_printer is None or not power_devices:
return return
found_devices = [] found_devices = []
devices = self.printer.get_power_devices() devices = self.printer.get_power_devices()
@@ -955,11 +819,10 @@ class KlipperScreen(Gtk.Window):
logging.info("Found %s", found_devices) logging.info("Found %s", found_devices)
return found_devices return found_devices
else: else:
logging.info("Power devices not found") logging.info("Associated power devices not found")
return None return None
def power_on(self, widget, devices): def power_on(self, widget, devices):
for device in devices: for device in devices:
if self.printer.get_power_device_status(device) == "off": if self.printer.get_power_device_status(device) == "off":
self.show_popup_message(_("Sending Power ON signal to: %s") % devices, level=1) self.show_popup_message(_("Sending Power ON signal to: %s") % devices, level=1)
@@ -969,38 +832,42 @@ class KlipperScreen(Gtk.Window):
logging.info("%s is ON", device) logging.info("%s is ON", device)
def init_printer(self): def init_printer(self):
state = self.apiclient.get_server_info() state = self.apiclient.get_server_info()
if state is False: if state is False:
return False logging.info("Moonraker not connected")
return
self.connecting = not self._ws.connected
self.connected_printer = self.connecting_to_printer
self.base_panel.set_ks_printer_cfg(self.connected_printer)
# Moonraker is ready, set a loop to init the printer # Moonraker is ready, set a loop to init the printer
self.reinit_count += 1 self.reinit_count += 1
self.init_printer_timeout = GLib.timeout_add_seconds(3, self.init_printer)
self.shutdown = False
powerdevs = self.apiclient.send_request("machine/device_power/devices") powerdevs = self.apiclient.send_request("machine/device_power/devices")
if powerdevs is not False: if powerdevs is not False:
self.printer.configure_power_devices(powerdevs['result']) self.printer.configure_power_devices(powerdevs['result'])
if state['result']['klippy_connected'] is False: if state['result']['klippy_connected'] is False:
self.panels['splash_screen'].update_text( logging.info("Klipper not connected")
self.printer_initializing(
_("Moonraker: connected") _("Moonraker: connected")
+ f"\n\nKlipper: {state['result']['klippy_state']}\n\n" + f"\n\nKlipper: {state['result']['klippy_state']}\n\n"
+ _("Retry #%s") % self.reinit_count + _("Retry #%s") % self.reinit_count
) )
return False GLib.timeout_add_seconds(3, self.init_printer)
return
printer_info = self.apiclient.get_printer_info() printer_info = self.apiclient.get_printer_info()
if printer_info is False: if printer_info is False:
return self._update_splash_screen("Unable to get printer info from moonraker") self.printer_initializing("Unable to get printer info from moonraker")
GLib.timeout_add_seconds(3, self.init_printer)
data = self.apiclient.send_request("printer/objects/query?" + "&".join(PRINTER_BASE_STATUS_OBJECTS)) return
if data is False:
return self._update_splash_screen("Error getting printer object data")
config = self.apiclient.send_request("printer/objects/query?configfile") config = self.apiclient.send_request("printer/objects/query?configfile")
if config is False: if config is False:
return self._update_splash_screen("Error getting printer config data") self.printer_initializing("Error getting printer configuration")
GLib.timeout_add_seconds(3, self.init_printer)
return
# Reinitialize printer, in case the printer was shut down and anything has changed. # Reinitialize printer, in case the printer was shut down and anything has changed.
self.printer.reinit(printer_info['result'], config['result']['status']) self.printer.reinit(printer_info['result'], config['result']['status'])
@@ -1016,7 +883,9 @@ class KlipperScreen(Gtk.Window):
data = self.apiclient.send_request("printer/objects/query?" + "&".join(PRINTER_BASE_STATUS_OBJECTS + data = self.apiclient.send_request("printer/objects/query?" + "&".join(PRINTER_BASE_STATUS_OBJECTS +
extra_items)) extra_items))
if data is False: if data is False:
return self._update_splash_screen("Error getting printer object data with extra items") self.printer_initializing("Error getting printer object data with extra items")
GLib.timeout_add_seconds(3, self.init_printer)
return
tempstore = self.apiclient.send_request("server/temperature_store") tempstore = self.apiclient.send_request("server/temperature_store")
if tempstore is not False: if tempstore is not False:
@@ -1027,32 +896,23 @@ class KlipperScreen(Gtk.Window):
self.files.refresh_files() self.files.refresh_files()
logging.info("Printer initialized") logging.info("Printer initialized")
GLib.source_remove(self.init_printer_timeout)
self.reinit_count = 0 self.reinit_count = 0
return False
def _update_splash_screen(self, msg): def base_panel_show_all(self):
logging.info(msg) self.base_panel.show_macro_shortcut(self._config.get_main_config().getboolean('side_macro_shortcut', True))
self.panels['splash_screen'].update_text(msg) self.base_panel.show_heaters(True)
return False self.base_panel.show_estop(True)
def printer_ready(self): def printer_ready(self):
self.close_popup_message() self.close_popup_message()
# Force an update to printer webhooks state in case the update is missed due to websocket subscribe not yet sent self.show_panel('main_panel', "main_menu", None, 2, items=self._config.get_menu_items("__main"))
self.printer.process_update({"webhooks": {"state": "ready", "state_message": "Printer is ready"}}) self.base_panel_show_all()
self.show_panel('main_panel', "main_menu", _("Home"), 2,
items=self._config.get_menu_items("__main"), extrudercount=self.printer.get_extruder_count())
self.ws_subscribe()
if "job_status" in self.panels:
self.remove_subscription("job_status")
del self.panels["job_status"]
def printer_printing(self): def printer_printing(self):
self.close_screensaver()
self.close_popup_message() self.close_popup_message()
self.show_panel('job_status', "job_status", "Print Status", 2) self.show_panel('job_status', "job_status", _("Printing"), 2)
self.base_panel.show_heaters(True) self.base_panel_show_all()
self.base_panel.show_macro_shortcut(self._config.get_main_config().getboolean('side_macro_shortcut', True))
for dialog in self.dialogs: for dialog in self.dialogs:
dialog.destroy() dialog.destroy()
@@ -1111,27 +971,21 @@ class KlipperScreen(Gtk.Window):
self.base_panel.get_content().remove(self.keyboard['box']) self.base_panel.get_content().remove(self.keyboard['box'])
self.keyboard = None self.keyboard = None
def change_cursor(self, cursortype=None):
if cursortype == "watch":
os.system("xsetroot -cursor_name watch")
elif self.show_cursor:
self.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.ARROW))
os.system("xsetroot -cursor_name arrow")
else:
self.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR))
os.system("xsetroot -cursor ks_includes/emptyCursor.xbm ks_includes/emptyCursor.xbm")
return
def main(): def main():
version = functions.get_software_version() version = functions.get_software_version()
parser = argparse.ArgumentParser(description="KlipperScreen - A GUI for Klipper") parser = argparse.ArgumentParser(description="KlipperScreen - A GUI for Klipper")
homedir = os.path.expanduser("~")
parser.add_argument( parser.add_argument(
"-c", "--configfile", default="~/KlipperScreen.conf", metavar='<configfile>', "-c", "--configfile", default=os.path.join(homedir, "KlipperScreen.conf"), metavar='<configfile>',
help="Location of KlipperScreen configuration file" help="Location of KlipperScreen configuration file"
) )
logdir = os.path.join(homedir, "printer_data", "logs")
if not os.path.exists(logdir):
logdir = "/tmp"
parser.add_argument( parser.add_argument(
"-l", "--logfile", default="/tmp/KlipperScreen.log", metavar='<logfile>', "-l", "--logfile", default=os.path.join(logdir, "KlipperScreen.log"), metavar='<logfile>',
help="Location of KlipperScreen logfile output" help="Location of KlipperScreen logfile output"
) )
args = parser.parse_args() args = parser.parse_args()
+7 -6
View File
@@ -4,7 +4,7 @@ SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
KSPATH=$(sed 's/\/scripts//g' <<< $SCRIPTPATH) KSPATH=$(sed 's/\/scripts//g' <<< $SCRIPTPATH)
KSENV="${KLIPPERSCREEN_VENV:-${HOME}/.KlipperScreen-env}" KSENV="${KLIPPERSCREEN_VENV:-${HOME}/.KlipperScreen-env}"
XSERVER="xinit xinput x11-xserver-utils xdotool" XSERVER="xinit xinput x11-xserver-utils xserver-xorg-input-evdev xserver-xorg-input-libinput"
FBTURBO="xserver-xorg-video-fbturbo" FBTURBO="xserver-xorg-video-fbturbo"
FBDEV="xserver-xorg-video-fbdev" FBDEV="xserver-xorg-video-fbdev"
PYTHON="python3-virtualenv virtualenv python3-distutils" PYTHON="python3-virtualenv virtualenv python3-distutils"
@@ -105,11 +105,12 @@ create_virtualenv()
{ {
echo_text "Creating virtual environment" echo_text "Creating virtual environment"
if [ ! -d ${KSENV} ]; then if [ ! -d ${KSENV} ]; then
GET_PIP="${HOME}/get-pip.py" virtualenv -p /usr/bin/python3 ${KSENV}
virtualenv --no-pip -p /usr/bin/python3 ${KSENV} # GET_PIP="${HOME}/get-pip.py"
curl https://bootstrap.pypa.io/pip/3.6/get-pip.py -o ${GET_PIP} # virtualenv --no-pip -p /usr/bin/python3 ${KSENV}
${KSENV}/bin/python ${GET_PIP} # curl https://bootstrap.pypa.io/pip/3.6/get-pip.py -o ${GET_PIP}
rm ${GET_PIP} # ${KSENV}/bin/python ${GET_PIP}
# rm ${GET_PIP}
fi fi
source ${KSENV}/bin/activate source ${KSENV}/bin/activate
+1 -3
View File
@@ -1,8 +1,6 @@
numpy==1.21.4
jinja2==3.1.2 jinja2==3.1.2
matplotlib==3.5.0
netifaces==0.11.0 netifaces==0.11.0
requests==2.28.1 requests==2.28.1
websocket-client==1.4.1 websocket-client==1.4.2
pycairo==1.21.0 pycairo==1.21.0
PyGObject==3.42.2 PyGObject==3.42.2
-13
View File
@@ -1,13 +0,0 @@
#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
IMGDIR=$SCRIPTPATH/../docs/img
for file in $IMGDIR/*
do
res=$(identify $file | cut -d ' ' -f 3)
if [ "$res" != "1532x898" ]; then
echo "Converting $file"
convert $file -crop 1532x898+2+48 $file
fi
done
File renamed without changes.
+53
View File
@@ -0,0 +1,53 @@
#!/bin/bash
# Change XCLIENT and/or display to your destination xserver (XSDL platform).
# Example: export DISPLAY=192.168.1.101:0
# Note: You will likely want to reserve a DHCP address or set a static IP of the
# Xserver clientso that your IP does not change and require reconfiguration.
export XCLIENT=change_me
export DISPLAY=change_me
if [ $XCLIENT == "change_me" ]; then
echo "launch_klipperscreen.sh for XSDL/XServer Clients has not been cofigured properly. Please edit this file to point to your XServer Client"
exit
fi
# Send script to daemon process so that it does not fail when tty closes.
#
export PYKLIPPERSCREEN=~/.KlipperScreen-env/bin/python
export PYKLIPPERSCREENPARAM=~/KlipperScreen/screen.py
if [ -f $PYKLIPPERSCREEN ]; then
echo "Testing $PYKLIPPERSCREEN"
test -x $PYKLIPPERSCREEN || echo "$PYKLIPPERSCREEN is Not Executable"
fi
if [ -f $PYKLIPPERSCREENPARAM ]; then
echo "Testing $PYKLIPPERSCREENPARAM"
test -f $PYKLIPPERSCREENPARAM || echo "$PYKLIPPERSCREENPARAM is not a file"
fi
case "$1" in
start)
echo -n "Starting Klipper Screen Xclient Deamon .... "
setsid "$PYKLIPPERSCREEN" "$PYKLIPPERPARAM" #>/dev/null 2>&1 < /dev/null &
echo "running"
;;
stop)
echo -n "Stopping Klipper Screen Xclient Deamon .... "
PID=`ps -ef|grep KlipperScreen-env/bin/python|awk '{print $2}'`
kill -9 $PID
echo "stopping"
;;
*)
echo "Usage: $0 start"
exit 1
;;
esac
-17
View File
@@ -1,17 +0,0 @@
#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
KSPATH=$(sed 's/\/scripts//g' <<< $SCRIPTPATH)
KSENV="${HOME}/.KlipperScreen-env"
update_virtualenv()
{
echo "Creating virtual environment"
[ ! -d ${KSENV} ] && virtualenv -p /usr/bin/python3 ${KSENV}
${KSENV}/bin/pip install -r ${KSPATH}/scripts/KlipperScreen-requirements.txt
${KSENV}/bin/pip install --no-binary ":all" "vext.gi==0.7.4"
${KSENV}/bin/vext -e
}
update_virtualenv
+6 -1
View File
@@ -4,7 +4,12 @@
# Keeps the process alive while the server is active # Keeps the process alive while the server is active
# to mimic default X's behaviour and keep the service happy # to mimic default X's behaviour and keep the service happy
./lauch_klipperscreen.sh if [ -f $PWD/launch_klipperscreen.sh ]; then
exec $PWD/launch_klipperscreen.sh
elif [ ! -f $PWD/launch_klipperscreen.sh ]; then
echo "launch_klipperscreen.sh does not exist"
exit
fi
ret=1 ret=1
timeout=0 timeout=0
+1 -1
View File
@@ -16,7 +16,7 @@ button {
background-image: none; background-image: none;
background-color: #13181C; background-color: #13181C;
margin: .25em; margin: .25em;
padding: 0 .5em; padding: .2em .5em 0;
border-radius: 0; border-radius: 0;
border: 0; border: 0;
-gtk-icon-shadow: none; -gtk-icon-shadow: none;