Compare commits

...
131 Commits
Author SHA1 Message Date
alfrix 6fee87fb18 Update translations 2022-08-01 12:34:11 -03:00
Franklyn Tackitt 4e701c88ad Make installation configurable
```sh
KLIPPERSCREEN_VENV=$HOME/.venvs/klipperscreen ./scripts/KlipperScreen-install.sh
```
2022-08-01 12:24:18 -03:00
alfrix a68a3df2e6 docs: use_dpms must be in main not in printer 2022-08-01 12:23:40 -03:00
alfrix af1ae9a0ec system: Add check for updates close #681 2022-08-01 12:23:40 -03:00
alfrix de84bd6597 only allow 1 confirm dialog 2022-08-01 12:23:40 -03:00
alfrix d5bc271788 close dialogs on klippy restart 2022-08-01 12:23:40 -03:00
alfrix e8e4555d46 temperature: Support specific preheat items close #428 2022-08-01 12:23:40 -03:00
alfrix af158a4279 bed_level: support 3 screws close #606 2022-08-01 12:23:40 -03:00
alfrix ad614e6734 fix macros shortcut not showing in the action_bar 2022-08-01 12:23:40 -03:00
alfrix eb17bb58ad screen_panel: remove unused parameters 2022-08-01 12:23:40 -03:00
alfrix 9c2b52009a built-in keyboard 2022-08-01 12:23:40 -03:00
alfrix 0d8746d3e3 bed_mesh: clear button calibrate button, fixed sizes cleanups 2022-08-01 12:23:40 -03:00
alfrix a0cff7ec56 simplify name spliting 2022-08-01 12:23:40 -03:00
alfrix 317f9df4b5 job_status: now works without extruders or fans 2022-08-01 12:23:40 -03:00
alfrix 422f5619be system: add webcamd to allowed services to restart 2022-08-01 12:23:40 -03:00
alfrix 88ca902a4b popups: wrap long messages, increase margins, touch anywhere to close 2022-08-01 12:23:40 -03:00
alfrix c047bed518 bed_level: hide the panel if bed_screws or screws_tilt_calculate are not defined
there are printers with fixed beds that don't need this panel
2022-08-01 12:23:40 -03:00
alfrix aa2bfcbaee print: add delete file
this is temporary, to delete a file click the thumbnail
TODO: context menu or other solution to be decided
2022-08-01 12:23:40 -03:00
alfrix 752e53ff56 screen: popups can be configured to not close #456 2022-08-01 12:23:40 -03:00
alfrix 5234a5dc15 main_menu: don't show the graph if there are no available devices 2022-08-01 12:23:40 -03:00
alfrix 3bae1a4da8 menu: show temp if there are only extruders, heater_pin in klipper is mandatory for extruders 2022-08-01 12:23:40 -03:00
alfrix fda5589531 screen: Always ask to save config if we detect it on responses 2022-08-01 12:23:40 -03:00
alfrix f9e6ac62b7 main menu and temp cleanups and tweaks 2022-08-01 12:23:40 -03:00
alfrix fcbe264d1a network: panel tweaks 2022-08-01 12:23:40 -03:00
alfrix 25e6110dab output_pin panel close #546 2022-08-01 12:23:40 -03:00
alfrix aa5f91a548 Wait more time to initialize 2022-08-01 12:23:40 -03:00
alfrix 6510b2ec6b Refactor
Use f-strings
Avoid unnecessary casts to str()bool()int()
Ensure file closure
Merge nested ifs
Simplify for-assigns-appends with comprehensions and internal functions
Avoid shadowing internal function names
Initialize variables
Return value directly instead of assign then return
Make some methods static
2022-08-01 12:23:40 -03:00
alfrix 68d4f9c534 keyboard: fix for long vertical screens 2022-08-01 12:23:40 -03:00
alfrix a44f8f7b13 job_status: fix issue with thumbnails in some resolutions 2022-07-19 11:39:13 -03:00
alfrix e1961db6e9 docs: add an alternative way of booting to console 2022-07-18 18:49:03 -03:00
alfrix 41f0a4c4ce fix matchbox-keyboard not opening on Buster fix #674 2022-07-18 18:42:04 -03:00
AntoszHUN fedb0a3387 Update Hungarian Language (#675) 2022-07-17 17:29:22 -03:00
fengz41 d69b0ac66a Update Chinese Translation (#676) 2022-07-17 17:29:07 -03:00
Selim 020e20db44 Turkish_update (#672) 2022-07-12 14:59:01 -03:00
AntoszHUN 050cc13e57 Update Hungarian Language (#669) 2022-07-08 08:45:16 -03:00
alfrix 37c10fc8b3 keyboard: fix for long vertical screens 2022-07-04 16:33:26 -03:00
alfrix e70c9d37e9 layout: fixes for long vertical screens
KS is not optimized for this aspect-ratio, but at least it shouldn't be broken
2022-07-04 16:23:21 -03:00
alfrix fd221bde86 docs: fix location of rotation guide 2022-07-04 14:39:20 -03:00
alfrix e616c842ed docs: add a screen rotation guide 2022-07-04 14:16:26 -03:00
alfrix f97bed826b style: deprecate active_device class 2022-07-04 13:46:04 -03:00
alfrix 9833b887ad screen: fix restart #667 2022-07-04 13:30:16 -03:00
alfrix 92335b78a0 docs: fix links 2022-07-04 10:58:53 -03:00
alfrix 6b88ac0558 base_panel: fix #666 2022-07-03 18:04:57 -03:00
alfrix 3babd0e02c job_status: fix issue with layer height 2022-07-03 15:57:02 -03:00
alfrix d295129fa0 docs: fix missing extension 2022-07-03 12:18:43 -03:00
dependabot[bot] a00d5a074c build(deps): bump requests from 2.27.1 to 2.28.1 (#663)
Bumps [requests](https://github.com/psf/requests) from 2.27.1 to 2.28.1.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.27.1...v2.28.1)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-03 12:08:48 -03:00
Alfredo Monclus 314379e2af Use moonraker to restart KS (#656) 2022-07-03 12:08:36 -03:00
dependabot[bot] 3b73acec37 build(deps): bump websocket-client from 1.3.2 to 1.3.3 (#653)
Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.3.2 to 1.3.3.
- [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.3.2...v1.3.3)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-03 12:04:25 -03:00
alfrix d3cd4008a8 job_status and base_panel: safeguard against possible issues with temps 2022-07-03 12:03:50 -03:00
alfrix 784253ca77 extrude: use macro naming when there is no temp 2022-07-03 12:03:50 -03:00
alfrix 0feffff2ac translations: update all 2022-07-03 12:03:50 -03:00
alfrix bde7e8a886 docs: create an adb script 2022-07-03 12:03:50 -03:00
alfrix 71360b44ee docs: update Android guide to use the launcher 2022-07-03 12:03:50 -03:00
alfrix c20149ac25 docs: create an android guide 2022-07-03 12:03:50 -03:00
alfrix 92254942ef installer: restart KS if it's running 2022-07-03 12:03:50 -03:00
alfrix 3ed8142ab9 installer: overwrite the service unit 2022-07-03 12:03:50 -03:00
xcasxcursex 2fd5e6e89f Enable users to inject a custom script to start KlipperScreen (#660)
A helper script is included to ease migration
for the common Android XSDL use-case
2022-07-03 12:03:50 -03:00
alfrix 5e73fb03b5 base_panel: all action bar buttons should close the keyboard 2022-07-03 12:03:50 -03:00
alfrix 5ad82a64d4 Translations: install _() 2022-07-03 12:03:50 -03:00
alfrix 3bb470ded4 Fix keyboard size after being converted to a oriented Box 2022-07-03 12:03:50 -03:00
alfrix 831db2403d Fix potential issues with variables 2022-07-03 12:03:50 -03:00
alfrix b611491997 Optimize imports 2022-07-03 12:03:50 -03:00
alfrix 5c17656567 Remove some unneeded complexity in the macro shortcut 2022-07-03 12:03:50 -03:00
alfrix 06fceec84a Change the deprecated VBox and HBox to oriented Boxes 2022-07-03 12:03:50 -03:00
alfrix 12d90bcffa docs: keep the reqs updated 2022-07-03 12:03:50 -03:00
alfrix a445b89f13 config: deprecate get_main_config_option 2022-07-03 12:03:50 -03:00
alfrix 88ea416110 zcalibrate: fix issue with offset being a float 2022-07-03 12:03:50 -03:00
alfrix 5f1d239211 performance: do not use transparency 2022-07-03 12:03:50 -03:00
alfrix 312d131db5 use images for the sort order, drop freefont dependency 2022-07-03 12:03:50 -03:00
alfrix 5a02ac75ae basic support for extruder_stepper 2022-07-03 12:03:50 -03:00
alfrix c6df1b667c base_panel: fix keyboard not closing when clicking on macro shortcut 2022-07-03 12:03:50 -03:00
alfrix c18e2d148e layout: content margins in css
close #558 (use .action_bar{} and .content{} in a custom theme)
2022-07-03 12:03:50 -03:00
alfrix b76953ebfe theme: material darker use elevation and fix some colors 2022-07-03 12:03:50 -03:00
alfrix c4780fa56e performance: remove the background on default themes it can cause severe performance degradation and scrolling issues 2022-07-03 12:03:50 -03:00
alfrix faf997c7ae keyboard: improve layout and interactions on panels with entry 2022-07-03 12:03:50 -03:00
alfrix bd03a66dde screensaver: fix not having coverage in some situations 2022-07-03 12:03:50 -03:00
alfrix 431eb0058c system: remove unused function 2022-07-03 12:03:50 -03:00
Alfredo Monclus 6051e51f0e fan: add max and stop buttons 2022-07-03 12:03:50 -03:00
alfrix d3ce521bb0 keyboard: fix size while vertical 2022-07-03 12:03:50 -03:00
alfrix da26bf3143 base_panel: layout simplification 2022-07-03 12:03:50 -03:00
ZISQO 05b25cda15 Update ko_KR localization (#659) 2022-06-25 17:50:31 -03:00
alfrix eedf5448a0 docs: add another solution to seeing only console 2022-06-09 13:28:54 -03:00
Selim 8d83801b0e Turkish update (#637) 2022-06-05 23:30:39 -03:00
Adam Shanks 61c5bea9a0 Superscript (#635)
* Use superscript 2 and 3 as appropriate
2022-06-05 09:55:52 -03:00
alfrix 3775dbd44e extruder: fix issue with filament_sensors fixes #634 2022-06-04 11:43:52 -03:00
alfrix 880d4740e6 docs: moonraker update_manager needs managed_services 2022-06-04 11:00:13 -03:00
alfrix 511f715f7e retraction: allow higher limits fix #630 2022-06-03 14:39:15 -03:00
alfrix 9e800dd008 installer: add librsvg2-common as dependency fix #629 2022-06-03 13:38:22 -03:00
Andriy 6869514004 Update Ukrainian (#632) 2022-06-03 13:29:19 -03:00
Alfredo Monclus c6243e37fb Update issue templates 2022-06-03 13:26:45 -03:00
alfrix 73dbae7871 docs: update screenshots and add new panels 2022-06-02 16:20:37 -03:00
alfrix 2568a9262f docs: add DPMS to troubleshooting 2022-06-02 15:31:32 -03:00
alfrix 6bb712f970 Update translation files 2022-06-02 15:07:52 -03:00
Selim b8cf60bd2c Turkish Update (#631) 2022-06-02 12:14:59 -03:00
alfrix 5437eaead0 docs: fix build, re-skin and improve 2022-06-01 16:21:56 -03:00
dependabot[bot] 6b432c167f build(deps): bump pygobject from 3.42.0 to 3.42.1 (#589)
Bumps [pygobject](https://pygobject.readthedocs.io) from 3.42.0 to 3.42.1.

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

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

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

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

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

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

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

close #301

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

* Add Korean Language Support Font Installation
2022-05-31 11:12:20 -03:00
Ruslan Sayfutdinov 794dbea14e Allow setting 0 in preheat options (#612) 2022-05-31 11:10:27 -03:00
Selim 432b12d67e Turkish Language (#610) 2022-05-16 18:39:14 -03:00
alfrix 8accce00a9 job_status: fix thumbnail issue #608 2022-05-04 09:56:24 -03:00
alfrix 35381beeb6 limits: fix typo in label 2022-05-03 08:38:58 -03:00
alfrix 1eaa82ba2d config: fix print estimate default 2022-05-02 14:08:03 -03:00
alfrix 35c4136bd5 Job_status: fix speed label, fix estimate default 2022-05-02 12:09:12 -03:00
117 changed files with 8209 additions and 4168 deletions

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Logfile**
Attach your [klipperscreen.log](https://klipperscreen.readthedocs.io/en/latest/Troubleshooting/)
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FR]"
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+94
View File
@@ -0,0 +1,94 @@
# Android
This article describes how to use KlipperScreen from an android device
!!! important
The experience may not be equal to run KlipperScreen natively,
depending on the device there maybe performance degradation or other issues
1. [First installl KlipperScreen on the Pi](Installation.md)
2. Install [XServer-XSDL](https://play.google.com/store/apps/details?id=x.org.server) on the android device
3. Choose [USB(ADB)](#adb) or [WIFI](#wifi)
### ADB
!!! warning
Leaving the phone always connected it's not recommended, remove the battery to avoid issues.
* Install ADB on the Pi
```bash
sudo apt-get install android-tools-adb
```
* Put your Android phone/tablet in Debug mode.
Usually it involves enabling developer mode and "USB debugging" but this varies on different vendors and versions of the device
search "how to enable android debugging on device-model-and-brand"
* Copy the launcher script
```bash
cd ~/KlipperScreen/scripts
cp android-adb.sh launch_KlipperScreen.sh
chmod +x launch_KlipperScreen.sh
```
* Go to [Startup](#startup)
### WIFI
* Create a launcher script
```bash
cd ~/KlipperScreen/scripts
touch launch_KlipperScreen.sh
chmod +x launch_KlipperScreen.sh
nano launch_KlipperScreen.sh
```
* Paste this into the script (edit the IP for example: 192.168.1.2:0)
```bash
DISPLAY=(ip address from blue screen):0 $KS_XCLIENT
```
!!! important
It's recommended to use a static address, because if the address changes your connection will stop working.
* Go to [Startup](#startup)
## Startup
Start Xserver-XSDL On the android device
On the splash-screen of the app go to:
```
“CHANGE DEVICE CONFIGURATION”
└──Mouse Emulation Modde
└──Desktop, No Emulation
```
if you missed it, restart the app.
on the Pi
```bash
sudo service KlipperScreen stop
sudo service KlipperScreen start
```
## Migration from other tutorials
KlipperScreen says error option "service" is not supported anymore.
Stop the other service and Remove it, for example if the service is `KlippyScreenAndroid`:
```bash
sudo service KlippyScreenAndroid stop
sudo rm /etc/systemd/system/KlippyScreenAndroid.service
```
Follow this guide on how to setup the new launcher script with [USB(ADB)](#adb) or [WIFI](#wifi) and restart KS.
## Help
[The Discourse thread has old instructions but you may get some help if needed](https://klipper.discourse.group/t/how-to-klipperscreen-on-android-smart-phones/1196)
[#klipper-screen channel on Discord](https://discord.klipper3d.org/)
+38 -32
View File
@@ -6,27 +6,30 @@ create a blank file in `~/klipper_config/KlipperScreen.conf`, if the file alread
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.
## Include files ## Include files
``` ```py
[include conf.d/*.conf] [include conf.d/*.conf]
# Include another configuration file. Wildcards (*) will expand to match anything. # Include another configuration file. Wildcards (*) will expand to match anything.
``` ```
## Main Options ## Main Options
``` ```py
[main] [main]
# Invert axis in move panel. Default is False. Change to true to invert # Invert axis in move panel. Default is False. Change to true to invert
invert_x: False invert_x: False
invert_y: False invert_y: False
invert_z: False invert_z: False
# Time (seconds) before the Job Status page reverts to main menu after a successful job # Time in seconds before the Job Status page closes itself after a successful job/print
job_complete_timeout: 30 # 0 means disabled
job_complete_timeout: 0
# Time (seconds) before the Job Status page reverts to main menu after a successful job. # Time in seconds before the Job Status closes itself if an error is encountered
# If this option is 0, the user must click on a button to go back to the main menu.
job_error_timeout: 0 job_error_timeout: 0
# Autoclose popups, this includes various notifications and M118
autoclose_popups: True
# Specify the language # Specify the language
# The language can be specified here instead of using the system default language. # The language can be specified here instead of using the system default language.
language: en language: en
@@ -44,11 +47,16 @@ default_printer: Ender 3 Pro
# set this to False. See Menu section below. # set this to False. See Menu section below.
use_default_menu: True use_default_menu: True
# Screen DPMS
# By default DPMS is used to turn off the screen, this should prevent burn-in and save power.
# However if you find that your screen doesn't turn off because it doesn't support it
# Setting this to false will just turn the screen black.
use_dpms: True
``` ```
## Printer Options ## Printer Options
Multiple printers can be defined Multiple printers can be defined
``` ```py
# Define printer and name. Name is anything after the first printer word # Define printer and name. Name is anything after the first printer word
[printer Ender 3 Pro] [printer Ender 3 Pro]
# Define the moonraker host/port if different from 127.0.0.1 and 7125 # Define the moonraker host/port if different from 127.0.0.1 and 7125
@@ -84,44 +92,42 @@ titlebar_name_type: None
calibrate_x_position: 100 calibrate_x_position: 100
calibrate_y_position: 100 calibrate_y_position: 100
# Screen DPMS # Bed Screws
# By default DPMS is used to turn off the screen, this should prevent burn-in and save power. # define the screw positons required for odd number of screws in a comma separated list
# However if you find that your screen doesn't turn off because it doesn't support it # possible values are: bl, br, bm, fl, fr, fm, lm, rm
# Setting this to false will just turn the screen black. # they correspond to back-left, back-right, back-middle, front-left, front-right, front-middle, left-middle, left-right
use_dpms: True screw_positions: ""
# Rotation is useful if the screen is not directly in front of the machine.
# Valid values are 0 90 180 270
screw_rotation: 0
``` ```
## Preheat Options ## Preheat Options
``` ```py
[preheat my_temp_setting] [preheat my_temp_setting]
# Temperature for the heated bed
bed: 40
# Temperature for the tools
extruder: 195 extruder: 195
# Temperature for generic heaters extruder1: 60
heater_generic: 40 heater_bed: 40
# Temperature controlled fans (temperature_fan in klipper config) # Use the name
chamber: 60
# or the full name
heater_generic chamber: 60
# or for example apply the same temp to devices of the same type
temperature_fan: 40 temperature_fan: 40
heater_generic: 60
# optional GCode to run when the option is selected # optional GCode to run when the option is selected
gcode: MY_HEATSOAK_MACRO gcode: MY_HEATSOAK_MACRO
``` ```
There is an special preheat setting named cooldown to do additional things when the _cooldown_ button is pressed There is a special preheat setting named cooldown to do additional things when the _cooldown_ button is pressed
for example: for example:
``` ```py
[preheat cooldown] [preheat cooldown]
gcode: M107 gcode: M107
``` ```
## Bed Screws
```
[bed_screws]
# Rotation is useful if the screen is not directly in front of the machine.
# Valid values are 0 90 180 270
rotation: 0
```
## Menu ## Menu
This allows a custom configuration for the menu displayed while the printer is idle. You can use sub-menus to group This allows a custom configuration for the menu displayed while the printer is idle. You can use sub-menus to group
different items and there are several panel options available. It is possible to have a gcode script run on a menu different items and there are several panel options available. It is possible to have a gcode script run on a menu
@@ -129,7 +135,7 @@ button press. There are two menus available in KlipperScreen, __main and __print
printer is idle. The __print menu is accessible from the printing status page. printer is idle. The __print menu is accessible from the printing status page.
A menu item is configured as follows: A menu item is configured as follows:
``` ```py
[menu __main my_menu_item] [menu __main my_menu_item]
# To build a sub-menu of this menu item, you would next use [menu __main my_menu_item sub_menu_item] # To build a sub-menu of this menu item, you would next use [menu __main my_menu_item sub_menu_item]
name: Item Name name: Item Name
@@ -148,7 +154,7 @@ enable: {{ printer.power_devices.count > 0 }}
Available panels are listed here: [docs/panels.md](Panels.md) Available panels are listed here: [docs/panels.md](Panels.md)
Certain variables are available for conditional testing of the enable statement: Certain variables are available for conditional testing of the enable statement:
``` ```py
printer.bltouch # Available if bltouch section defined in config printer.bltouch # Available if bltouch section defined in config
printer.gcode_macros.count # Number of gcode macros printer.gcode_macros.count # Number of gcode macros
printer.idle_timeout # Idle timeout section printer.idle_timeout # Idle timeout section
@@ -159,7 +165,7 @@ printer.power_devices.count # Number of power devices configured in Moonraker
A sample configuration of a main menu would be as follows: A sample configuration of a main menu would be as follows:
``` ```py
[menu __main homing] [menu __main homing]
name: Homing name: Homing
icon: home icon: home
+1 -3
View File
@@ -8,6 +8,4 @@ You may submit a GitHub issue request for any problems you are having.
## Klipper Community Discord ## Klipper Community Discord
The invite link: https://discord.klipper3d.org/ [Look for the channel `#klipper-screen`](https://discord.klipper3d.org/)
Look for the channel `#klipper-screen`
+51 -13
View File
@@ -11,27 +11,61 @@ There are no recommended screens, but the minimum supported resolution is 480x32
* [3.5" RPi Display](http://www.lcdwiki.com/3.5inch_RPi_Display) * [3.5" RPi Display](http://www.lcdwiki.com/3.5inch_RPi_Display)
* [5" HDMI Display-B](http://lcdwiki.com/5inch_HDMI_Display-B) * [5" HDMI Display-B](http://lcdwiki.com/5inch_HDMI_Display-B)
* [VoCore](https://klipper.discourse.group/t/hardware-known-to-work-with-klipperscreen/35/7) * [VoCore](https://klipper.discourse.group/t/hardware-known-to-work-with-klipperscreen/35/7)
* [Android Phone](https://klipper.discourse.group/t/how-to-klipperscreen-on-android-smart-phones/1196)
* [WAVESHARE 4.3 inch DSI LCD](https://www.waveshare.com/4.3inch-dsi-lcd.htm) * [WAVESHARE 4.3 inch DSI LCD](https://www.waveshare.com/4.3inch-dsi-lcd.htm)
* [DFrobot DFR0550](https://wiki.dfrobot.com/5%27%27TFT-Display_with_Touchscreen_V1.0_SKU_DFR0550) * [DFrobot DFR0550](https://wiki.dfrobot.com/5%27%27TFT-Display_with_Touchscreen_V1.0_SKU_DFR0550)
* [Android phone](Android.md)
* [More known hardware in the klipper discourse](https://klipper.discourse.group/t/hardware-known-to-work-with-klipperscreen/35) * [More known hardware in the klipper discourse](https://klipper.discourse.group/t/hardware-known-to-work-with-klipperscreen/35)
#### Configuration ### Configuration
Follow the manufacturer instructions on how to install your screen. In general if you see a white screen, then it's not properly installed, ensure that you at least see a console, Then ![install](Installation.md) KlipperScreen, if you are having troubles refer to the ![troubleshooting page](Troubleshooting.md) for further information. Follow the manufacturer instructions on how to install your screen. In general if you see a white screen, then it's not properly installed, ensure that you at least see a console, Then [install](Installation.md) KlipperScreen, if you are having troubles refer to the [troubleshooting page](Troubleshooting.md) for further information.
## Screen rotation
Currently there is no support for rotation at runtime, do not use xrandr to rotate the screen.
Configure the server to start in the desired orientation, there are many ways to achieve this, here is one:
#### Touchscreen touch rotation Create /usr/share/X11/xorg.conf.d/90-monitor.conf
```bash
sudo nano /usr/share/X11/xorg.conf.d/90-monitor.conf
```
Paste this section modifying the options to suit your needs:
```
Section "Monitor"
Identifier "DPI-1"
# This identifier would be the same as the name of the connector printed by xrandr.
# it can be "HDMI-0" "DisplayPort-0", "DSI-0", "DVI-0", "DPI-0" etc
Option "Rotate" "left"
# Valid rotation options are normal,inverted,left,right
Option "PreferredMode" "1920x1080"
# May be necesary if you are not getting your prefered resolution.
EndSection
```
Save the file and restart KlipperScreen.
```bash
sudo service KlipperScreen restart
```
## Touchscreen touch rotation
If your touchscreen isn't registering touches properly after the screen has been rotated, you will need to apply a If your touchscreen isn't registering touches properly after the screen has been rotated, you will need to apply a
transformation matrix. transformation matrix.
First you will need your device name. First you will need your device name, on a terminal run:
Run: `DISPLAY=:0 xinput` ```sh
DISPLAY=:0 xinput
Output
``` ```
Output:
```sh
⎡ Virtual core pointer id=2 [master pointer (3)] ⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ ADS7846 Touchscreen id=6 [slave pointer (2)] ⎜ ↳ ADS7846 Touchscreen id=6 [slave pointer (2)]
@@ -42,7 +76,9 @@ In this case the device is the ADS7846 Touchscreen, yours may be different
You can test a change by running: You can test a change by running:
`DISPLAY=:0 xinput set-prop "<device name>" 'Coordinate Transformation Matrix' <matrix>` ```sh
DISPLAY=:0 xinput set-prop "<device name>" 'Coordinate Transformation Matrix' <matrix>
```
Where the matrix can be one of the following options: Where the matrix can be one of the following options:
@@ -55,14 +91,16 @@ Where the matrix can be one of the following options:
For example: For example:
`DISPLAY=:0 xinput set-prop "ADS7846 Touchscreen" 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1` ```sh
DISPLAY=:0 xinput set-prop "ADS7846 Touchscreen" 'Coordinate Transformation Matrix' -1 0 1 0 -1 1 0 0 1
```
To make this permanent, modify the file `/etc/udev/rules.d/51-touchscreen.rules` and add following line: To make this permanent, modify the file `/etc/udev/rules.d/51-touchscreen.rules` and add following line:
``` ```sh
ACTION=="add", ATTRS{name}=="<device name>", ENV{LIBINPUT_CALIBRATION_MATRIX}="<matrix>" ACTION=="add", ATTRS{name}=="<device name>", ENV{LIBINPUT_CALIBRATION_MATRIX}="<matrix>"
``` ```
More info about input transformation can be found in: More info about input transformation can be found in:
* [Ubuntu wiki InputCoordinateTransformation]("https://wiki.ubuntu.com/X/InputCoordinateTransformation") * [Ubuntu wiki InputCoordinateTransformation](https://wiki.ubuntu.com/X/InputCoordinateTransformation)
* [Libinput docs]("https://wayland.freedesktop.org/libinput/doc/1.9.0/absolute_axes.html") * [Libinput docs](https://wayland.freedesktop.org/libinput/doc/1.9.0/absolute_axes.html)
+54 -34
View File
@@ -1,44 +1,40 @@
# Installation # Installation
#### Setup Raspberry Pi ## First steps
This install process is meant for Raspbian non-desktop version aka Raspbian Lite.
If you have installed it on the GUI version, then use `sudo raspi-config` to set boot to console by choosing the following options in order: Install the screen, following the instructions provided by the manufacturer, Some screens don't neeed extra software but some need to be installed with a script.
It's strongly recommended to test it and ensure your hardware is working with Raspbian, Ubuntu or any distro you like.
Once you stablished that the screen is working, then proceed installing KlipperScreen.
* 1 System Options ## Setup
* S5 Boot / Auto Login This install process is meant for a non-desktop version of the OS for example Raspbian Lite, but it should work on other versions.
* B1 Console
#### Klipper and Moonraker Installation If you want to use it on a desktop (GUI version), then do `sudo systemctl set-default multi-user.target`
if it's a Raspberry Pi, you can use `sudo raspi-config` to set boot to console by choosing the following options in order:
Follow the instructions to install Klipper and Moonraker. ```sh
* klipper: https://www.klipper3d.org/Installation.html 1System Options
* moonraker: https://moonraker.readthedocs.io/en/latest/installation/ └──S5 Boot / Auto Login
└──B1 Console
In moonraker.conf ensure that 127.0.0.1 is a trusted client for moonraker, such as in this example:
```
[authorization]
trusted_clients:
127.0.0.1
``` ```
Note: `force_logins: true` requires the moonraker api key in [KlipperScreen.conf](Configuration.md) ## Auto install
If you wish to use the update manager feature of moonraker for KlipperScreen, add the following block into the moonraker [KIAUH](https://github.com/th33xitus/kiauh) is a tool that helps you install or upgrade Klipper, Moonraker, Mainsail, and other extensions.
configuration:
```
[update_manager KlipperScreen]
type: git_repo
path: ~/KlipperScreen
origin: https://github.com/jordanruthe/KlipperScreen.git
env: ~/.KlipperScreen-env/bin/python
requirements: scripts/KlipperScreen-requirements.txt
install_script: scripts/KlipperScreen-install.sh
```
#### KlipperScreen Installation ![Screenshot](img/install/KIAUH.png)
You can visit [KIAUH on GitHub](https://github.com/th33xitus/kiauh) to learn more and view its documentation.
## Manual Install
First install [Klipper](https://www.klipper3d.org/Installation.html) and [Moonraker](https://moonraker.readthedocs.io/en/latest/installation/).
### KlipperScreen Installation
Execute the following commands: Execute the following commands:
```
```sh
cd ~/ cd ~/
git clone https://github.com/jordanruthe/KlipperScreen.git git clone https://github.com/jordanruthe/KlipperScreen.git
cd ~/KlipperScreen cd ~/KlipperScreen
@@ -46,12 +42,36 @@ cd ~/KlipperScreen
``` ```
This script will install packages that are listed under manual install, create a python virtual environment at This script will install packages that are listed under manual install, create a python virtual environment at
~/.KlipperScreen-env and install a systemd service file. `~/.KlipperScreen-env` and install a systemd service file.
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.
If your screen needs additional software, proceed with the manufacturer instructions if they are provided
and check out the [hardware page](Hardware.md)
At this point KlipperScreen should be working, if it doesn't start then go to the [troubleshooting page](Troubleshooting.md) At this point KlipperScreen should be working, if it doesn't start then go to the [troubleshooting page](Troubleshooting.md)
## Moonraker configuration
In moonraker.conf ensure that 127.0.0.1 is a trusted client:
```py
[authorization]
trusted_clients:
127.0.0.1
```
!!! warning
`force_logins: true` requires the moonraker api key in [KlipperScreen.conf](Configuration.md)
If you wish to use the update manager feature of moonraker for KlipperScreen, add the following block to the moonraker.conf:
```py
[update_manager KlipperScreen]
type: git_repo
path: ~/KlipperScreen
origin: https://github.com/jordanruthe/KlipperScreen.git
env: ~/.KlipperScreen-env/bin/python
requirements: scripts/KlipperScreen-requirements.txt
install_script: scripts/KlipperScreen-install.sh
managed_services: KlipperScreen
```
!!! note
If you see warnings in other UIs ignore them until KlipperScreen finishes installing.
+65 -37
View File
@@ -4,11 +4,15 @@
![Main Menu](img/panels/main_panel.png) ![Main Menu](img/panels/main_panel.png)
### Job Status ### Job Status
```py
panel: job_status
```
![Job Status](img/panels/job_status.png) ![Job Status](img/panels/job_status.png)
### Bed Level ### Bed Level
type: bed_level ```py
panel: bed_level
```
![Bed Level](img/panels/bed_level.png) ![Bed Level](img/panels/bed_level.png)
The bed level panel has the ability to have preset locations from Klipper. Please see documentation on the following The bed level panel has the ability to have preset locations from Klipper. Please see documentation on the following
@@ -16,84 +20,108 @@ Klipper Sections:
* [bed_screws](https://www.klipper3d.org/Config_Reference.html#bed_screws) * [bed_screws](https://www.klipper3d.org/Config_Reference.html#bed_screws)
* [screws_tilt_adjust](https://www.klipper3d.org/Config_Reference.html#screws_tilt_adjust) * [screws_tilt_adjust](https://www.klipper3d.org/Config_Reference.html#screws_tilt_adjust)
_Important Note: Due to Klipper using the bltouch/probe offsets in screws_tilt_adjust, if a bltouch/probe is enabled_ !!! important:
_KlipperScreen will add the offset to the defined screw values. This will not occur if bed_screws section is used._ `[bed_screws]` uses Nozzle positions and `[screws_tilt_adjust]` uses Probe positions
This panel will favor screws_tilt_adjust over the bed_screws section. If screws_tilt_adjust is defined, an extra button This panel will use `[bed_screws]` if `[screws_tilt_adjust]` is not defined,
for _Screws Calibrate_ will appear. This button runs the SCREWS_TILT_CALCULATE command and shows the results on the the probe offset will be applied to the defined screw values in `[screws_tilt_adjust]`
panel. so the buttons will move the nozzle above the screws like in `[bed_screws]`
### Bed Mesh ### Bed Mesh
type: bed_mesh theme:material-dark ```py
panel: bed_mesh
```
![Bed Mesh](img/panels/bed_mesh.png) ![Bed Mesh](img/panels/bed_mesh.png)
### Extrude ### Extrude
type: extrude theme:material-dark ```py
panel: extrude theme:material-dark
```
![Extrude](img/panels/extrude.png) ![Extrude](img/panels/extrude.png)
### Fan ### Fan
type: fan ```py
panel: fan
```
![Fan](img/panels/fan.png) ![Fan](img/panels/fan.png)
### Fine Tune ### Fine Tune
type: fine_tune theme:custom ```py
panel: fine_tune
```
![Fine Tune Panel](img/panels/fine_tune.png) ![Fine Tune Panel](img/panels/fine_tune.png)
### Gcode Macros ### Gcode Macros
type: gcode_macros theme: material-darker ```py
panel: gcode_macros
```
![Gcode Macros Panel](img/panels/gcode_macros.png) ![Gcode Macros Panel](img/panels/gcode_macros.png)
### Menu ### Menu
type: menu
![Menu Panel](img/panels/menu.png) ![Menu Panel](img/panels/menu.png)
### Move ### Move
type: move ```py
panel: move
```
![Move Panel](img/panels/move.png) ![Move Panel](img/panels/move.png)
### Network ### Network
type: network ```py
panel: network
```
![Network Panel](img/panels/network.png) ![Network Panel](img/panels/network.png)
### Power ### Power
type: power ```py
panel: power
```
![Power](img/panels/power.png) ![Power](img/panels/power.png)
### Print ### Print
type: print ```py
panel: print
```
![Print Panel](img/panels/print.png) ![Print Panel](img/panels/print.png)
### Settings ### Settings
type: settings theme:colorized ```py
panel: settings
```
![Settings](img/panels/settings.png) ![Settings](img/panels/settings.png)
### System ### System
type: system ```py
panel: system
```
![System Panel](img/panels/system.png) ![System Panel](img/panels/system.png)
### Temperature ### Temperature
type: temperature theme:custom ```py
panel: temperature
```
![Temperature](img/panels/temperature.png) ![Temperature](img/panels/temperature.png)
### Z Calibrate ### Z Calibrate
type: zcalibrate ```py
panel: zcalibrate
```
![Z Calibrate](img/panels/zcalibrate.png) ![Z Calibrate](img/panels/zcalibrate.png)
### Limits ### Limits
type: limits theme: material-dark ```py
panel: limits
```
![Limits](img/panels/limits.png) ![Limits](img/panels/limits.png)
### Retraction
```py
panel: retraction
```
![Limits](img/panels/retraction.png)
### Input Shapers
```py
panel: input_shaper
```
![Limits](img/panels/input_shaper.png)
+2 -2
View File
@@ -6,7 +6,7 @@ quick tips, without much explanation
As you probably already noticed, you can show and hide the gcode macros in the interface settings, As you probably already noticed, you can show and hide the gcode macros in the interface settings,
but you can also hide gcode macros by prefixing the name with an underscore. but you can also hide gcode macros by prefixing the name with an underscore.
``` ```py
[gcode_macro MY_AWESOME_GCODE] [gcode_macro MY_AWESOME_GCODE]
gcode: gcode:
_MY_HELPER_CODE _MY_HELPER_CODE
@@ -21,7 +21,7 @@ Another example:
Lets hide a temperature_fan: Lets hide a temperature_fan:
``` ```py
[temperature_fan fan1] [temperature_fan fan1]
[temperature_fan _fan2] [temperature_fan _fan2]
``` ```
+2 -2
View File
@@ -8,7 +8,7 @@ To edit colors and styles, create a css file named `style.css` you can use the c
### Example 1 ### Example 1
``` ```sh
cd ~/KlipperScreen/styles cd ~/KlipperScreen/styles
mkdir -p mytheme/images mkdir -p mytheme/images
cd mytheme cd mytheme
@@ -24,7 +24,7 @@ At this point `mytheme` should be on the list of themes, and when you select it
Creating a custom background from Mainsail sidebar and this css using Z-bolt icons Creating a custom background from Mainsail sidebar and this css using Z-bolt icons
``` ```css
window { background-image: url("/home/pi/mainsail/img/background.svg");} window { background-image: url("/home/pi/mainsail/img/background.svg");}
button {background-color: rgba(0,0,0,0); border-radius:2em;} button {background-color: rgba(0,0,0,0); border-radius:2em;}
``` ```
+1 -1
View File
@@ -1,6 +1,6 @@
## Create Translations ## Create Translations
You can use a editor such as [poedit](https://poedit.net/) to assist in translations. This guide will assume that you You can use an editor such as [poedit](https://poedit.net/) to assist in translations. This guide will assume that you
will be using poedit. will be using poedit.
This guide will refer to `language designation`. This can be found from running `echo $LANG` on your pi, as long as you This guide will refer to `language designation`. This can be found from running `echo $LANG` on your pi, as long as you
+51 -18
View File
@@ -15,7 +15,8 @@ If that file is non-existent, run `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.
## Cannot open virtual Console ## Cannot open virtual Console
``` If you see this line in the logs:
```sh
xf86OpenConsole: Cannot open virtual console 2 (Permission denied) xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
``` ```
@@ -27,33 +28,61 @@ This should have the line `allowed_users=anybody` in it
If your username is not listed under that line, you need to add it with the following command: If your username is not listed under that line, you need to add it with the following command:
`usermod -a -G tty pi` (if your username is not 'pi' change 'pi' to your username) ```sh
usermod -a -G tty pi
```
(if your username is not 'pi' change 'pi' to your username)
If it's still failing, try: `sudo apt install xserver-xorg-legacy` You may also need:
```sh
sudo apt install xserver-xorg-legacy
```
As a last resort add `needs_root_rights=yes` to `/etc/X11/Xwrapper.config` Restart KlipperScreen:
```sh
sudo service KlipperScreen restart
```
If it's still failing as a last resort add `needs_root_rights=yes` to `/etc/X11/Xwrapper.config`:
```sh
sudo echo needs_root_rights=yes>>/etc/X11/Xwrapper.config
```
restart KS.
## Screen shows console instead of KlipperScreen ## Screen shows console instead of KlipperScreen
If you have multiple framebuffers, you may need to fix the X11 configuration. If you have multiple framebuffers, you may need to fix the X11 configuration,
list the available framebuffers and check the current one:
```sh
ls /dev/fb*
cat /usr/share/X11/xorg.conf.d/99-fbturbo.conf | grep /dev/fb
```
`ls /dev/fb*` will list the available framebuffers If you more than one, try changing it:
```sh
`cat /usr/share/X11/xorg.conf.d/99-fbturbo.conf | grep /dev/fb` will show you the current one sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf
```
If you have another fb, try changing it:
`sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf`
for example: change `/dev/fb0` to `/dev/fb1` for example: change `/dev/fb0` to `/dev/fb1`
Once you have saved that file, restart KlipperScreen and it should show up on your display. Once you have saved that file, restart KlipperScreen.
```sh
sudo service KlipperScreen restart
```
If you have multiple hdmi ports try the other one
## Screen is all white or blank or no signal ## Screen is all white or blank or no signal
If the screen never shows the console even during startup, Then it's tipically an improperly installed screen, If the screen never shows the console even during startup, Then it's tipically an improperly installed screen,
follow the manufacturer instructions on how to physically connect the screen and install the proper drivers. follow the manufacturer instructions on how to physically connect the screen and install the proper drivers.
## The screen starts flashing colors or stays all blue/white or shows 'No signal' when idle
In KliperScreen settings find 'Screen DPMS' and turn it off.
Your screen doesn't seem to support turning off via software, the best you can do is to turn it all black.
## Touch not working on debian Bullseye ## Touch not working on debian Bullseye
Some dsi screens have issues where touch doesn't work with debian bullseye, the current fix Some dsi screens have issues where touch doesn't work with debian bullseye, the current fix
@@ -63,14 +92,18 @@ Run `raspi-config` > go to Advanced > GL Driver > select G2 and reboot.
![config](img/troubleshooting/gldriver.png) ![config](img/troubleshooting/gldriver.png)
Or manually edit `/boot/config.txt` and change: *Or*:
`dtoverlay=vc4-kms-v3d` manually edit `/boot/config.txt` and change:
```sh
dtoverlay=vc4-kms-v3d
```
to: to:
```sh
`dtoverlay=vc4-fkms-v3d` dtoverlay=vc4-fkms-v3d
```
and reboot, that should make the touch work, if your screen is rotated 180 degrees, then you may need to adjust and reboot, that should make the touch work, if your screen is rotated 180 degrees, then you may need to adjust
[the touch rotation](Hardware.md) as described in the Hardware page. [the touch rotation](Hardware.md) as described in the Hardware page.
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

+1 -1
View File
@@ -6,7 +6,7 @@ KlipperScreen is a touchscreen GUI that interfaces with [Klipper](https://github
KlipperScreen should run on any touchscreen that you can connect to a host (Raspberry, PC, Tablet), but not screens that connect directly to the printer MCU board. KlipperScreen should run on any touchscreen that you can connect to a host (Raspberry, PC, Tablet), but not screens that connect directly to the printer MCU board.
A physical touchscreen is not strictly required, for example you may install a remote desktop server like tigervnc-scraping-server and connect from a client device, ![check out the hardware page for further information.](Hardware.md) A physical touchscreen is not strictly required, for example you may install a remote desktop server like tigervnc-scraping-server and connect from a client device, [check out the hardware page for further information.](Hardware.md)
### Sample Panels ### Sample Panels
+4 -4
View File
@@ -7,7 +7,7 @@ Load and Unload Filament macros are used in the Extrude-Panel if it is available
The selected speed is transferred to this macro. The selected speed is transferred to this macro.
The following example macros show how this can be used in the macro. The following example macros show how this can be used in the macro.
``` ```py
[gcode_macro LOAD_FILAMENT] [gcode_macro LOAD_FILAMENT]
gcode: gcode:
{% set speed = params.SPEED|default(500) %} {% set speed = params.SPEED|default(500) %}
@@ -16,7 +16,7 @@ gcode:
G1 E50 F{speed} G1 E50 F{speed}
G92 G92
``` ```
``` ```py
[gcode_macro UNLOAD_FILAMENT] [gcode_macro UNLOAD_FILAMENT]
gcode: gcode:
{% set speed = params.SPEED|default(500) %} {% set speed = params.SPEED|default(500) %}
@@ -28,7 +28,7 @@ gcode:
this could be interesting to tweak the purge speed, this would be one Example Macro from alfrix: this could be interesting to tweak the purge speed, this would be one Example Macro from alfrix:
``` ```py
[gcode_macro LOAD_FILAMENT] [gcode_macro LOAD_FILAMENT]
gcode: gcode:
{% set speed = params.SPEED|default(300) %} {% set speed = params.SPEED|default(300) %}
@@ -42,7 +42,7 @@ gcode:
M300 M300
``` ```
``` ```py
[gcode_macro UNLOAD_FILAMENT] [gcode_macro UNLOAD_FILAMENT]
gcode: gcode:
{% set speed = params.SPEED|default(300) %} {% set speed = params.SPEED|default(300) %}
+2 -2
View File
@@ -1,2 +1,2 @@
jinja2<3.1 mkdocs>=1.3.0
mkdocs mkdocs-material>=8.2.16
+11 -14
View File
@@ -1,5 +1,4 @@
class KlippyGcodes: class KlippyGcodes:
HOME = "G28" HOME = "G28"
HOME_X = "G28 X" HOME_X = "G28 X"
HOME_Y = "G28 Y" HOME_Y = "G28 Y"
@@ -33,35 +32,33 @@ class KlippyGcodes:
RESTART = "RESTART" RESTART = "RESTART"
FIRMWARE_RESTART = "FIRMWARE_RESTART" FIRMWARE_RESTART = "FIRMWARE_RESTART"
@staticmethod @staticmethod
def set_bed_temp(temp): def set_bed_temp(temp):
return "%s S%s" % (KlippyGcodes.SET_BED_TEMP, str(temp)) return f"{KlippyGcodes.SET_BED_TEMP} S{temp}"
@staticmethod @staticmethod
def set_ext_temp(temp, tool=0): def set_ext_temp(temp, tool=0):
return "%s T%s S%s" % (KlippyGcodes.SET_EXT_TEMP, str(tool), str(temp)) return f"{KlippyGcodes.SET_EXT_TEMP} T{tool} S{temp}"
@staticmethod @staticmethod
def set_heater_temp(heater, temp): def set_heater_temp(heater, temp):
return 'SET_HEATER_TEMPERATURE heater="%s" target=%s' % (heater, str(temp)) return f'SET_HEATER_TEMPERATURE heater="{heater}" target={temp}'
@staticmethod @staticmethod
def set_temp_fan_temp(temp_fan, temp): def set_temp_fan_temp(temp_fan, temp):
return 'SET_TEMPERATURE_FAN_TARGET temperature_fan="%s" target=%s' % (temp_fan, str(temp)) return f'SET_TEMPERATURE_FAN_TARGET temperature_fan="{temp_fan}" target={temp}'
@staticmethod @staticmethod
def set_fan_speed(speed): def set_fan_speed(speed):
speed = str(int(float(int(speed) % 101)/100*255)) return f"{KlippyGcodes.SET_FAN_SPEED} S{speed * 2.55:.0f}"
return "%s S%s" % (KlippyGcodes.SET_FAN_SPEED, speed)
@staticmethod @staticmethod
def set_extrusion_rate(rate): def set_extrusion_rate(rate):
return "%s S%s" % (KlippyGcodes.SET_EXT_FACTOR, rate) return f"{KlippyGcodes.SET_EXT_FACTOR} S{rate}"
@staticmethod @staticmethod
def set_speed_rate(rate): def set_speed_rate(rate):
return "%s S%s" % (KlippyGcodes.SET_SPD_FACTOR, rate) return f"{KlippyGcodes.SET_SPD_FACTOR} S{rate}"
@staticmethod @staticmethod
def testz_move(dist): def testz_move(dist):
@@ -69,16 +66,16 @@ class KlippyGcodes:
@staticmethod @staticmethod
def extrude(dist, speed=500): def extrude(dist, speed=500):
return "%s E%s F%s" % (KlippyGcodes.MOVE, dist, speed) return f"{KlippyGcodes.MOVE} E{dist} F{speed}"
@staticmethod @staticmethod
def bed_mesh_load(profile): def bed_mesh_load(profile):
return "BED_MESH_PROFILE LOAD='%s'" % profile return f"BED_MESH_PROFILE LOAD='{profile}'"
@staticmethod @staticmethod
def bed_mesh_remove(profile): def bed_mesh_remove(profile):
return "BED_MESH_PROFILE REMOVE='%s'" % profile return f"BED_MESH_PROFILE REMOVE='{profile}'"
@staticmethod @staticmethod
def bed_mesh_save(profile): def bed_mesh_save(profile):
return "BED_MESH_PROFILE SAVE='%s'" % profile return f"BED_MESH_PROFILE SAVE='{profile}'"
+62 -80
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
@@ -7,9 +8,9 @@ import pathlib
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gdk, GdkPixbuf, Gio, Gtk, Pango from gi.repository import Gdk, GdkPixbuf, Gio, Gtk, Pango
class KlippyGtk: class KlippyGtk:
labels = {} labels = {}
keyboard_ratio = .22
width_ratio = 16 width_ratio = 16
height_ratio = 9.375 height_ratio = 9.375
@@ -19,19 +20,17 @@ class KlippyGtk:
self.height = height self.height = height
self.themedir = os.path.join(pathlib.Path(__file__).parent.resolve().parent, "styles", theme, "images") self.themedir = os.path.join(pathlib.Path(__file__).parent.resolve().parent, "styles", theme, "images")
if self.screen.vertical_mode: self.font_ratio = [33, 49] if self.screen.vertical_mode else [43, 29]
self.font_ratio = [33, 49]
else:
self.font_ratio = [43, 29]
self.font_size = int(min( self.font_size = int(min(
self.width / self.font_ratio[0], self.width / self.font_ratio[0],
self.height / self.font_ratio[1] self.height / self.font_ratio[1]
)) ))
if fontsize_type == "small": if fontsize_type == "small":
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.header_size = int(round((self.width / self.width_ratio) / 1.33))
self.titlebar_height = self.font_size * 2
self.img_width = int(round(self.width / self.width_ratio)) self.img_width = int(round(self.width / self.width_ratio))
self.img_height = int(round(self.height / self.height_ratio)) self.img_height = int(round(self.height / self.height_ratio))
if self.screen.vertical_mode: if self.screen.vertical_mode:
@@ -46,10 +45,10 @@ class KlippyGtk:
for key in self.color_list: for key in self.color_list:
if "base" in self.color_list[key]: if "base" in self.color_list[key]:
rgb = [int(self.color_list[key]['base'][i:i+2], 16) for i in range(0, 6, 2)] rgb = [int(self.color_list[key]['base'][i:i + 2], 16) for i in range(0, 6, 2)]
self.color_list[key]['rgb'] = rgb self.color_list[key]['rgb'] = rgb
logging.debug("img width: %s height: %s" % (self.img_width, self.img_height)) logging.debug(f"img width: {self.img_width} height: {self.img_height}")
def get_action_bar_width(self): def get_action_bar_width(self):
return self.action_bar_width return self.action_bar_width
@@ -61,11 +60,17 @@ class KlippyGtk:
return self.width - self.action_bar_width return self.width - self.action_bar_width
def get_content_height(self): def get_content_height(self):
return self.height - self.header_size if self.screen.vertical_mode:
return self.height - self.titlebar_height - self.action_bar_height
else:
return self.height - self.titlebar_height
def get_font_size(self): def get_font_size(self):
return self.font_size return self.font_size
def get_titlebar_height(self):
return self.titlebar_height
def get_header_size(self): def get_header_size(self):
return self.header_size return self.header_size
@@ -76,7 +81,11 @@ class KlippyGtk:
return self.img_height return self.img_height
def get_keyboard_height(self): def get_keyboard_height(self):
return (self.width - self.get_action_bar_width()) * self.keyboard_ratio if (self.height / self.width) >= 3:
# Ultra-tall
return self.get_content_height() * 0.25
else:
return self.get_content_height() * 0.5
def get_temp_color(self, device): def get_temp_color(self, device):
# logging.debug("Color list %s" % self.color_list) # logging.debug("Color list %s" % self.color_list)
@@ -88,33 +97,31 @@ class KlippyGtk:
if self.color_list[device]['state'] > 0: if self.color_list[device]['state'] > 0:
rgb[1] = rgb[1] + self.color_list[device]['hsplit'] * self.color_list[device]['state'] rgb[1] = rgb[1] + self.color_list[device]['hsplit'] * self.color_list[device]['state']
self.color_list[device]['state'] += 1 self.color_list[device]['state'] += 1
color = '{:02X}{:02X}{:02X}'.format(rgb[0], rgb[1], rgb[2]) rgb = [x / 255 for x in rgb]
rgb = [x/255 for x in rgb] # logging.debug(f"Assigning color: {device} {rgb}")
# logging.debug("Assigning color: %s %s %s" % (device, rgb, color))
else: else:
colors = self.color_list[device]['colors'] colors = self.color_list[device]['colors']
if self.color_list[device]['state'] >= len(colors): if self.color_list[device]['state'] >= len(colors):
self.color_list[device]['state'] = 0 self.color_list[device]['state'] = 0
color = colors[self.color_list[device]['state'] % len(colors)] color = colors[self.color_list[device]['state'] % len(colors)]
rgb = [int(color[i:i+2], 16)/255 for i in range(0, 6, 2)] rgb = [int(color[i:i + 2], 16) / 255 for i in range(0, 6, 2)]
self.color_list[device]['state'] += 1 self.color_list[device]['state'] += 1
# logging.debug("Assigning color: %s %s %s" % (device, rgb, color)) # logging.debug(f"Assigning color: {device} {rgb} {color}")
return rgb
return rgb, color
def reset_temp_color(self): def reset_temp_color(self):
for key in self.color_list: for key in self.color_list:
self.color_list[key]['state'] = 0 self.color_list[key]['state'] = 0
@staticmethod
def Label(self, label, style=None): def Label(label, style=None):
la = Gtk.Label(label) la = Gtk.Label(label)
if style is not None and style is not False: if style is not None:
la.get_style_context().add_class(style) la.get_style_context().add_class(style)
return la return la
def Image(self, image_name, scale=1): def Image(self, image_name, scale=1.0):
filename = os.path.join(self.themedir, str(image_name) + ".svg") filename = os.path.join(self.themedir, f"{image_name}.svg")
if os.path.exists(filename): if os.path.exists(filename):
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename,
int(round(self.img_width * scale)), int(round(self.img_width * scale)),
@@ -122,35 +129,28 @@ class KlippyGtk:
True) True)
return Gtk.Image.new_from_pixbuf(pixbuf) return Gtk.Image.new_from_pixbuf(pixbuf)
else: else:
logging.error("Unable to find image %s", filename) logging.error(f"Unable to find image {filename}")
return Gtk.Image() return Gtk.Image()
def PixbufFromFile(self, filename, style=False, width_scale=1, height_scale=1): def PixbufFromFile(self, filename, width_scale=1, height_scale=1):
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, return GdkPixbuf.Pixbuf.new_from_file_at_scale(
int(round(self.img_width * width_scale)), filename,
int(round(self.img_height * height_scale)), int(round(self.img_width * width_scale)),
True) int(round(self.img_height * height_scale)),
return pixbuf True
)
def PixbufFromHttp(self, resource, style=False, width_scale=1, height_scale=1): def PixbufFromHttp(self, resource, width_scale=1, height_scale=1):
response = self.screen.apiclient.get_thumbnail_stream(resource) 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)
pixbuf = GdkPixbuf.Pixbuf.new_from_stream_at_scale(stream, return GdkPixbuf.Pixbuf.new_from_stream_at_scale(
int(round(self.img_width * width_scale)), stream,
int(round(self.img_height * height_scale)), int(round(self.img_width * width_scale)),
True) int(round(self.img_height * height_scale)),
return pixbuf True
)
def ProgressBar(self, style=False):
bar = Gtk.ProgressBar()
if style is not False:
ctx = bar.get_style_context()
ctx.add_class(style)
return bar
def Button(self, label=None, style=None): def Button(self, label=None, style=None):
b = Gtk.Button(label=label) b = Gtk.Button(label=label)
@@ -164,26 +164,24 @@ class KlippyGtk:
b.connect("clicked", self.screen.reset_screensaver_timeout) b.connect("clicked", self.screen.reset_screensaver_timeout)
return b return b
def ButtonImage(self, image_name, label=None, style=None, scale=1.38, def ButtonImage(self, image_name=None, label=None, style=None, scale=1.38,
position=Gtk.PositionType.TOP, word_wrap=True): position=Gtk.PositionType.TOP, word_wrap=True):
b = Gtk.Button(label=label) b = Gtk.Button(label=label)
b.set_hexpand(True) b.set_hexpand(True)
b.set_vexpand(True) b.set_vexpand(True)
b.set_can_focus(False) b.set_can_focus(False)
b.set_image(self.Image(image_name, scale)) if image_name is not None:
b.set_image(self.Image(image_name, scale))
b.set_image_position(position) b.set_image_position(position)
b.set_always_show_image(True) b.set_always_show_image(True)
if word_wrap is True: if word_wrap is True:
try: with contextlib.suppress(Exception):
# Get the label object # Get the label object
child = b.get_children()[0].get_children()[0].get_children()[1] child = b.get_children()[0].get_children()[0].get_children()[1]
child.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) child.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
child.set_line_wrap(True) child.set_line_wrap(True)
except Exception:
pass
if style is not None: if style is not None:
b.get_style_context().add_class(style) b.get_style_context().add_class(style)
b.connect("clicked", self.screen.reset_screensaver_timeout) b.connect("clicked", self.screen.reset_screensaver_timeout)
@@ -201,7 +199,7 @@ class KlippyGtk:
button = dialog.get_children()[0].get_children()[0].get_children()[0].get_children()[i] button = dialog.get_children()[0].get_children()[0].get_children()[0].get_children()[i]
button.get_child().set_line_wrap_mode(Pango.WrapMode.WORD_CHAR) button.get_child().set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
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", callback, *args) dialog.connect("response", callback, *args)
dialog.get_style_context().add_class("dialog") dialog.get_style_context().add_class("dialog")
@@ -220,10 +218,10 @@ class KlippyGtk:
else: else:
dialog.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR)) dialog.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR))
self.screen.dialogs.append(dialog)
return dialog return dialog
def ToggleButtonImage(self, image_name, label, style=None, scale=1.38):
def ToggleButtonImage(self, image_name, label, style=False, scale=1.38):
b = Gtk.ToggleButton(label=label) b = Gtk.ToggleButton(label=label)
b.set_hexpand(True) b.set_hexpand(True)
@@ -233,14 +231,15 @@ class KlippyGtk:
b.set_image_position(Gtk.PositionType.TOP) b.set_image_position(Gtk.PositionType.TOP)
b.set_always_show_image(True) b.set_always_show_image(True)
if style is not False: if style is not None:
ctx = b.get_style_context() ctx = b.get_style_context()
ctx.add_class(style) ctx.add_class(style)
b.connect("clicked", self.screen.reset_screensaver_timeout) b.connect("clicked", self.screen.reset_screensaver_timeout)
return b return b
def HomogeneousGrid(self, width=None, height=None): @staticmethod
def HomogeneousGrid(width=None, height=None):
g = Gtk.Grid() g = Gtk.Grid()
g.set_row_homogeneous(True) g.set_row_homogeneous(True)
g.set_column_homogeneous(True) g.set_column_homogeneous(True)
@@ -256,28 +255,11 @@ class KlippyGtk:
b.connect("clicked", self.screen.reset_screensaver_timeout) b.connect("clicked", self.screen.reset_screensaver_timeout)
return b return b
def formatFileName(self, name): @staticmethod
name = name.split('/')[-1] if "/" in name else name def ScrolledWindow():
name = name.split('.gcod')[0] if ".gcode" in name else name scroll = Gtk.ScrolledWindow()
if len(name) > 25: scroll.set_property("overlay-scrolling", False)
return name[0:25] + "\n" + name[25:50] scroll.set_vexpand(True)
return name scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
return scroll
def formatTimeString(self, seconds):
time = int(seconds)
text = ""
if int(time/86400) != 0:
text += str(int(time/86400))+"d "
if int(time/3600) != 0:
text += str(int(time/3600) % 24)+"h "
if int(time/60) != 0:
text += str(int(time/60) % 60)+"m "
else:
text = str(time % 60)+"s"
return text
def formatTemperatureString(self, temp, target):
if (target > temp-2 and target < temp+2) or round(target, 0) == 0:
return str(round(temp, 1)) + "°C" # °C →"
return str(round(temp)) + " °C\n(" + str(round(target)) + ")"
+9 -6
View File
@@ -2,6 +2,7 @@ import json
import requests import requests
import logging import logging
class KlippyRest: class KlippyRest:
def __init__(self, ip, port=7125, api_key=False): def __init__(self, ip, port=7125, api_key=False):
self.ip = ip self.ip = ip
@@ -21,7 +22,7 @@ class KlippyRest:
return self.send_request("printer/info") return self.send_request("printer/info")
def get_thumbnail_stream(self, thumbnail): def get_thumbnail_stream(self, thumbnail):
url = "http://%s:%s/server/files/gcodes/%s" % (self.ip, self.port, thumbnail) url = f"http://{self.ip}:{self.port}/server/files/gcodes/{thumbnail}"
response = requests.get(url, stream=True) response = requests.get(url, stream=True)
if response.status_code == 200: if response.status_code == 200:
response.raw.decode_content = True response.raw.decode_content = True
@@ -29,12 +30,13 @@ class KlippyRest:
return False return False
def send_request(self, method): def send_request(self, method):
url = "http://%s:%s/%s" % (self.ip, self.port, method) url = f"http://{self.ip}:{self.port}/{method}"
logging.debug("Sending request to %s" % url) logging.debug(f"Sending request to {url}")
headers = {} if self.api_key is False else {"x-api-key": self.api_key} headers = {} if self.api_key is False else {"x-api-key": self.api_key}
try: try:
r = requests.get(url, headers=headers) r = requests.get(url, headers=headers)
except Exception: except Exception as e:
logging.critical(e, exc_info=True)
return False return False
if r.status_code != 200: if r.status_code != 200:
return False return False
@@ -42,8 +44,9 @@ class KlippyRest:
# TODO: Try/except # TODO: Try/except
try: try:
data = json.loads(r.content) data = json.loads(r.content)
except Exception: except Exception as e:
logging.exception("Unable to parse response from moonraker:\n %s" % r.content) logging.critical(e, exc_info=True)
logging.exception(f"Unable to parse response from moonraker:\n {r.content}")
return False return False
return data return data
+44 -36
View File
@@ -26,6 +26,7 @@ api = {
} }
} }
class KlippyWebsocket(threading.Thread): class KlippyWebsocket(threading.Thread):
_req_id = 0 _req_id = 0
connected = False connected = False
@@ -35,18 +36,20 @@ class KlippyWebsocket(threading.Thread):
def __init__(self, screen, callback, host, port): def __init__(self, screen, callback, host, port):
threading.Thread.__init__(self) threading.Thread.__init__(self)
self._wst = None
self.ws_url = None
self._screen = screen self._screen = screen
self._callback = callback self._callback = callback
self.klippy = MoonrakerApi(self) self.klippy = MoonrakerApi(self)
self.closing = False self.closing = False
self.ws = None self.ws = None
self._url = "%s:%s" % (host, port) self._url = f"{host}:{port}"
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: if self.reconnect_timeout is None:
self.reconnect_timeout = GLib.timeout_add_seconds(3, self.reconnect) self.reconnect_timeout = GLib.timeout_add_seconds(6, self.reconnect)
self.connect() self.connect()
def connect(self): def connect(self):
@@ -69,16 +72,18 @@ class KlippyWebsocket(threading.Thread):
if state is False: if state is False:
if self.reconnect_count > 3: if self.reconnect_count > 3:
self._screen.panels['splash_screen'].update_text( self._screen.panels['splash_screen'].update_text(
_("Cannot connect to Moonraker") + _("Cannot connect to Moonraker")
("\n\n%s\n\n") % self._url + + f'\n\n{self._url}\n\n'
_("Retry #%s") % self.reconnect_count) + _("Retrying") + f' #{self.reconnect_count}'
)
return False return False
token = self._screen.apiclient.get_oneshot_token() token = self._screen.apiclient.get_oneshot_token()
except Exception: except Exception as e:
logging.critical(e, exc_info=True)
logging.debug("Unable to get oneshot token") logging.debug("Unable to get oneshot token")
return False return False
self.ws_url = "ws://%s/websocket?token=%s" % (self._url, token) self.ws_url = f"ws://{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=ws_on_close, on_error=ws_on_error, on_message=ws_on_message, on_open=ws_on_open)
@@ -86,7 +91,8 @@ class KlippyWebsocket(threading.Thread):
try: try:
logging.debug("Starting websocket thread") logging.debug("Starting websocket thread")
self._wst.start() self._wst.start()
except Exception: except Exception as e:
logging.critical(e, exc_info=True)
logging.debug("Error starting web socket") logging.debug("Error starting web socket")
def close(self): def close(self):
@@ -99,18 +105,17 @@ class KlippyWebsocket(threading.Thread):
def on_message(self, ws, message): def on_message(self, ws, message):
response = json.loads(message) response = json.loads(message)
if "id" in response: if "id" in response and response['id'] in self.callback_table:
if response['id'] in self.callback_table: Gdk.threads_add_idle(
Gdk.threads_add_idle( GLib.PRIORITY_HIGH_IDLE,
GLib.PRIORITY_HIGH_IDLE, self.callback_table[response['id']][0],
self.callback_table[response['id']][0], response,
response, self.callback_table[response['id']][1],
self.callback_table[response['id']][1], self.callback_table[response['id']][2],
self.callback_table[response['id']][2], *self.callback_table[response['id']][3]
*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( Gdk.threads_add_idle(
@@ -121,7 +126,9 @@ class KlippyWebsocket(threading.Thread):
) )
return return
def send_method(self, method, params={}, callback=None, *args): def send_method(self, method, params=None, callback=None, *args):
if params is None:
params = {}
if self.is_connected() is False: if self.is_connected() is False:
return False return False
@@ -140,7 +147,7 @@ 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("Self.connected = %s" % self.is_connected()) 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: if self.reconnect_timeout is not None:
@@ -170,7 +177,7 @@ class KlippyWebsocket(threading.Thread):
logging.info("Moonraker Websocket Closed") logging.info("Moonraker Websocket Closed")
self.connected = False self.connected = False
if self.reconnect_timeout is None: if self.reconnect_timeout is None:
self.reconnect_timeout = GLib.timeout_add_seconds(3, self.reconnect) self.reconnect_timeout = GLib.timeout_add_seconds(9, self.reconnect)
if "on_close" in self._callback: if "on_close" in self._callback:
Gdk.threads_add_idle( Gdk.threads_add_idle(
@@ -190,8 +197,10 @@ class KlippyWebsocket(threading.Thread):
self.connect() self.connect()
return True return True
def on_error(self, ws, error): @staticmethod
logging.debug("Websocket error: %s" % error) def on_error(ws, error):
logging.debug(f"Websocket error: {error}")
class MoonrakerApi: class MoonrakerApi:
def __init__(self, ws): def __init__(self, ws):
@@ -204,7 +213,7 @@ class MoonrakerApi:
) )
def gcode_script(self, script, callback=None, *args): def gcode_script(self, script, callback=None, *args):
logging.debug("Sending printer.gcode.script: %s", script) logging.debug(f"Sending printer.gcode.script: {script}")
return self._ws.send_method( return self._ws.send_method(
"printer.gcode.script", "printer.gcode.script",
{"script": script}, {"script": script},
@@ -239,14 +248,14 @@ class MoonrakerApi:
) )
def object_subscription(self, updates): def object_subscription(self, updates):
logging.debug("Sending printer.objects.subscribe: %s", str(updates)) logging.debug(f"Sending printer.objects.subscribe: {updates}")
return self._ws.send_method( return self._ws.send_method(
"printer.objects.subscribe", "printer.objects.subscribe",
updates updates
) )
def power_device_off(self, device, callback=None, *args): def power_device_off(self, device, callback=None, *args):
logging.debug("Sending machine.device_power.off: %s" % device) logging.debug(f"Sending machine.device_power.off: {device}")
return self._ws.send_method( return self._ws.send_method(
"machine.device_power.off", "machine.device_power.off",
{device: False}, {device: False},
@@ -255,7 +264,7 @@ class MoonrakerApi:
) )
def power_device_on(self, device, callback=None, *args): def power_device_on(self, device, callback=None, *args):
logging.debug("Sending machine.device_power.on %s" % device) logging.debug("Sending machine.device_power.on {device}")
return self._ws.send_method( return self._ws.send_method(
"machine.device_power.on", "machine.device_power.on",
{device: False}, {device: False},
@@ -303,7 +312,7 @@ class MoonrakerApi:
def temperature_set(self, heater, target, callback=None, *args): def temperature_set(self, heater, target, callback=None, *args):
if heater == "heater_bed": if heater == "heater_bed":
logging.debug("Sending printer.gcode.script: %s", KlippyGcodes.set_bed_temp(target)) logging.debug(f"Sending printer.gcode.script: {KlippyGcodes.set_bed_temp(target)}")
return self._ws.send_method( return self._ws.send_method(
"printer.gcode.script", "printer.gcode.script",
{ {
@@ -314,8 +323,7 @@ class MoonrakerApi:
) )
else: else:
logging.debug( logging.debug(
"Sending printer.gcode.script: %s", f'Sending printer.gcode.script: {KlippyGcodes.set_ext_temp(target, heater.replace("tool", ""))}')
KlippyGcodes.set_ext_temp(target, heater.replace("tool", "")))
# TODO: Add max/min limits # TODO: Add max/min limits
return self._ws.send_method( return self._ws.send_method(
"printer.gcode.script", "printer.gcode.script",
@@ -327,7 +335,7 @@ class MoonrakerApi:
) )
def set_bed_temp(self, target, callback=None, *args): def set_bed_temp(self, target, callback=None, *args):
logging.debug("Sending set_bed_temp: %s", KlippyGcodes.set_bed_temp(target)) logging.debug(f"Sending set_bed_temp: {KlippyGcodes.set_bed_temp(target)}")
return self._ws.send_method( return self._ws.send_method(
"printer.gcode.script", "printer.gcode.script",
{ {
@@ -338,7 +346,7 @@ class MoonrakerApi:
) )
def set_heater_temp(self, heater, target, callback=None, *args): def set_heater_temp(self, heater, target, callback=None, *args):
logging.debug("Sending heater %s to temp: %s", heater, target) logging.debug(f"Sending heater {heater} to temp: {target}")
return self._ws.send_method( return self._ws.send_method(
"printer.gcode.script", "printer.gcode.script",
{ {
@@ -349,7 +357,7 @@ class MoonrakerApi:
) )
def set_temp_fan_temp(self, temp_fan, target, callback=None, *args): def set_temp_fan_temp(self, temp_fan, target, callback=None, *args):
logging.debug("Sending temperature fan %s to temp: %s", temp_fan, target) logging.debug(f"Sending temperature fan {temp_fan} to temp: {target}")
return self._ws.send_method( return self._ws.send_method(
"printer.gcode.script", "printer.gcode.script",
{ {
@@ -360,7 +368,7 @@ class MoonrakerApi:
) )
def set_tool_temp(self, tool, target, callback=None, *args): def set_tool_temp(self, tool, target, callback=None, *args):
logging.debug("Sending set_tool_temp: %s", KlippyGcodes.set_ext_temp(target, tool)) logging.debug(f"Sending set_tool_temp: {KlippyGcodes.set_ext_temp(target, tool)}")
return self._ws.send_method( return self._ws.send_method(
"printer.gcode.script", "printer.gcode.script",
{ {
+89 -108
View File
@@ -12,19 +12,21 @@ from io import StringIO
from os import path from os import path
SCREEN_BLANKING_OPTIONS = [ SCREEN_BLANKING_OPTIONS = [
"300", # 5 Minutes 300, # 5 Minutes
"900", # 15 Minutes 900, # 15 Minutes
"1800", # 30 Minutes 1800, # 30 Minutes
"3600", # 1 Hour 3600, # 1 Hour
"7200", # 2 Hours 7200, # 2 Hours
"14400", # 4 Hours 14400, # 4 Hours
] ]
klipperscreendir = pathlib.Path(__file__).parent.resolve().parent klipperscreendir = pathlib.Path(__file__).parent.resolve().parent
class ConfigError(Exception): class ConfigError(Exception):
pass pass
class KlipperScreenConfig: class KlipperScreenConfig:
config = None config = None
configfile_name = "KlipperScreen.conf" configfile_name = "KlipperScreen.conf"
@@ -35,7 +37,7 @@ class KlipperScreenConfig:
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("Config path location: %s" % self.config_path) logging.debug(f"Config path location: {self.config_path}")
self.defined_config = None self.defined_config = None
try: try:
@@ -55,24 +57,22 @@ class KlipperScreenConfig:
self.config.read_string(user_def) self.config.read_string(user_def)
if saved_def is not None: if saved_def is not None:
self.config.read_string(saved_def) self.config.read_string(saved_def)
logging.info("====== Saved Def ======\n%s\n=======================" % saved_def) logging.info(f"====== Saved Def ======\n{saved_def}\n=======================")
# This is the final config # This is the final config
# self.log_config(self.config) # self.log_config(self.config)
except KeyError: except KeyError as e:
raise ConfigError(f"Error reading config: {self.config_path}") raise ConfigError(f"Error reading config: {self.config_path}") from e
except Exception: except Exception:
logging.exception("Unknown error with config") logging.exception("Unknown error with config")
printers = sorted([i for i in self.config.sections() if i.startswith("printer ")]) printers = sorted([i for i in self.config.sections() if i.startswith("printer ")])
self.printers = [] self.printers = [
for printer in printers: {printer[8:]: {
self.printers.append({ "moonraker_host": self.config.get(printer, "moonraker_host", fallback="127.0.0.1"),
printer[8:]: { "moonraker_port": self.config.get(printer, "moonraker_port", fallback="7125"),
"moonraker_host": self.config.get(printer, "moonraker_host", fallback="127.0.0.1"), "moonraker_api_key": self.config.get(printer, "moonraker_api_key", fallback=False)
"moonraker_port": self.config.get(printer, "moonraker_port", fallback="7125"), }} for printer in printers]
"moonraker_api_key": self.config.get(printer, "moonraker_api_key", fallback=False)
}
})
if len(printers) <= 0: if len(printers) <= 0:
self.printers.append({ self.printers.append({
"Printer": { "Printer": {
@@ -88,38 +88,31 @@ class KlipperScreenConfig:
item = conf_printers_debug[conf_printers_debug.index(printer)] item = conf_printers_debug[conf_printers_debug.index(printer)]
if item[name]['moonraker_api_key'] != "": if item[name]['moonraker_api_key'] != "":
item[name]['moonraker_api_key'] = "redacted" item[name]['moonraker_api_key'] = "redacted"
logging.debug("Configured printers: %s" % json.dumps(conf_printers_debug, indent=2)) logging.debug(f"Configured printers: {json.dumps(conf_printers_debug, indent=2)}")
lang = self.get_main_config_option("language", None) lang = self.get_main_config().get("language", None)
lang = [lang] if lang is not None and lang != "default" else None lang = [lang] if lang is not None and lang != "default" else None
logging.info("Detected language: %s" % lang) logging.info(f"Detected language: {lang}")
self.lang = gettext.translation('KlipperScreen', localedir='ks_includes/locales', languages=lang, self.lang = gettext.translation('KlipperScreen', localedir='ks_includes/locales', languages=lang,
fallback=True) fallback=True)
self.lang.install(names=['gettext', 'ngettext'])
self._create_configurable_options(screen) self._create_configurable_options(screen)
def _create_configurable_options(self, screen): def _create_configurable_options(self, screen):
_ = self.lang.gettext
_n = self.lang.ngettext
self.configurable_options = [ self.configurable_options = [
{"invert_x": {"section": "main", "name": _("Invert X"), "type": "binary", "value": "False"}}, {"language": {
{"invert_y": {"section": "main", "name": _("Invert Y"), "type": "binary", "value": "False"}}, "section": "main", "name": _("Language"), "type": "dropdown", "value": "system_lang",
{"invert_z": {"section": "main", "name": _("Invert Z"), "type": "binary", "value": "False"}}, "callback": screen.restart_warning, "options": [
{"language": {"section": "main", "name": _("Language"), "type": "dropdown", "value": "system_lang", {"name": _("System") + " " + _("(default)"), "value": "system_lang"}]}},
"callback": screen.restart_warning, "options": [ {"theme": {
{"name": _("System") + " " + _("(default)"), "value": "system_lang"} "section": "main", "name": _("Icon Theme"), "type": "dropdown",
]}}, "value": "z-bolt", "callback": screen.restart_warning, "options": [
{"move_speed_xy": { {"name": "Z-bolt" + " " + _("(default)"), "value": "z-bolt"}]}},
"section": "main", "name": _("XY Move Speed (mm/s)"), "type": "scale", "value": "20",
"range": [5, 200], "step": 1}},
{"move_speed_z": {
"section": "main", "name": _("Z Move Speed (mm/s)"), "type": "scale", "value": "20",
"range": [5, 200], "step": 1}},
{"print_sort_dir": {"section": "main", "type": None, "value": "name_asc"}},
{"print_estimate_method": { {"print_estimate_method": {
"section": "main", "name": _("Estimated Time Method"), "type": "dropdown", "section": "main", "name": _("Estimated Time Method"), "type": "dropdown",
"value": "file", "options": [ "value": "auto", "options": [
{"name": _("Auto") + " " + _("(default)"), "value": "auto"}, {"name": _("Auto") + " " + _("(default)"), "value": "auto"},
{"name": _("File"), "value": "file"}, {"name": _("File"), "value": "file"},
{"name": _("Filament Used"), "value": "filament"}, {"name": _("Filament Used"), "value": "filament"},
@@ -129,10 +122,6 @@ class KlipperScreenConfig:
"value": "3600", "callback": screen.set_screenblanking_timeout, "options": [ "value": "3600", "callback": screen.set_screenblanking_timeout, "options": [
{"name": _("Off"), "value": "off"}] {"name": _("Off"), "value": "off"}]
}}, }},
{"theme": {
"section": "main", "name": _("Icon Theme"), "type": "dropdown",
"value": "z-bolt", "callback": screen.restart_warning, "options": [
{"name": "Z-bolt" + " " + _("(default)"), "value": "z-bolt"}]}},
{"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary", "value": "True"}}, {"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary", "value": "True"}},
{"side_macro_shortcut": { {"side_macro_shortcut": {
"section": "main", "name": _("Macro shortcut on sidebar"), "type": "binary", "section": "main", "name": _("Macro shortcut on sidebar"), "type": "binary",
@@ -152,13 +141,28 @@ class KlipperScreenConfig:
{"print_estimate_compensation": { {"print_estimate_compensation": {
"section": "main", "name": _("Slicer Time correction (%)"), "type": "scale", "value": "100", "section": "main", "name": _("Slicer Time correction (%)"), "type": "scale", "value": "100",
"range": [50, 150], "step": 1}}, "range": [50, 150], "step": 1}},
{"autoclose_popups": {"section": "main", "name": _("Auto-close notifications"), "type": "binary",
"value": "True"}},
# {"": {"section": "main", "name": _(""), "type": ""}} # {"": {"section": "main", "name": _(""), "type": ""}}
] ]
# Options that are in panels and shouldn't be added to the main settings
panel_options = [
{"invert_x": {"section": "main", "name": _("Invert X"), "type": None, "value": "False"}},
{"invert_y": {"section": "main", "name": _("Invert Y"), "type": None, "value": "False"}},
{"invert_z": {"section": "main", "name": _("Invert Z"), "type": None, "value": "False"}},
{"move_speed_xy": {"section": "main", "name": _("XY Move Speed (mm/s)"), "type": None, "value": "50"}},
{"move_speed_z": {"section": "main", "name": _("Z Move Speed (mm/s)"), "type": None, "value": "10"}},
{"print_sort_dir": {"section": "main", "type": None, "value": "name_asc"}},
]
self.configurable_options.extend(panel_options)
lang_path = os.path.join(klipperscreendir, "ks_includes", "locales") 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 = [d for d in os.listdir(lang_path) if not os.path.isfile(os.path.join(lang_path, d))]
langs.sort() langs.sort()
lang_opt = self.configurable_options[3]['language']['options'] lang_opt = self.configurable_options[0]['language']['options']
for lang in langs: for lang in langs:
lang_opt.append({"name": lang, "value": lang}) lang_opt.append({"name": lang, "value": lang})
@@ -166,7 +170,7 @@ class KlipperScreenConfig:
t_path = os.path.join(klipperscreendir, 'styles') t_path = os.path.join(klipperscreendir, 'styles')
themes = [d for d in os.listdir(t_path) if (not os.path.isfile(os.path.join(t_path, d)) and d != "z-bolt")] themes = [d for d in os.listdir(t_path) if (not os.path.isfile(os.path.join(t_path, d)) and d != "z-bolt")]
themes.sort() themes.sort()
theme_opt = self.configurable_options[9]['theme']['options'] theme_opt = self.configurable_options[1]['theme']['options']
for theme in themes: for theme in themes:
theme_opt.append({"name": theme, "value": theme}) theme_opt.append({"name": theme, "value": theme})
@@ -174,14 +178,14 @@ class KlipperScreenConfig:
index = self.configurable_options.index( index = self.configurable_options.index(
[i for i in self.configurable_options if list(i)[0] == "screen_blanking"][0]) [i for i in self.configurable_options if list(i)[0] == "screen_blanking"][0])
for num in SCREEN_BLANKING_OPTIONS: for num in SCREEN_BLANKING_OPTIONS:
hour = int(int(num)/3600) hour = num // 3600
if hour > 0: if hour > 0:
name = str(hour) + " " + _n("hour", "hours", hour) name = f'{hour} ' + ngettext("hour", "hours", hour)
else: else:
name = str(int(int(num)/60)) + " " + _("minutes") name = f'{num / 60:.0f} ' + _("minutes")
self.configurable_options[index]['screen_blanking']['options'].append({ self.configurable_options[index]['screen_blanking']['options'].append({
"name": name, "name": name,
"value": num "value": f"{num}"
}) })
for item in self.configurable_options: for item in self.configurable_options:
@@ -196,9 +200,7 @@ class KlipperScreenConfig:
exclude_list = ['preheat'] exclude_list = ['preheat']
if not self.defined_config.getboolean('main', "use_default_menu", fallback=True): if not self.defined_config.getboolean('main', "use_default_menu", fallback=True):
logging.info("Using custom menu, removing default menu entries.") logging.info("Using custom menu, removing default menu entries.")
exclude_list.append('menu __main') exclude_list.extend(('menu __main', 'menu __print', 'menu __splashscreen'))
exclude_list.append('menu __print')
exclude_list.append('menu __splashscreen')
for i in exclude_list: for i in exclude_list:
for j in config.sections(): for j in config.sections():
if j.startswith(i): if j.startswith(i):
@@ -206,28 +208,27 @@ class KlipperScreenConfig:
if k.startswith(i): if k.startswith(i):
del self.config[k] del self.config[k]
def _include_config(self, dir, path): def _include_config(self, directory, filepath):
full_path = path if path[0] == "/" else "%s/%s" % (dir, path) full_path = filepath if filepath[0] == "/" else f"{directory}/{filepath}"
parse_files = [] parse_files = []
if "*" in full_path: if "*" in full_path:
parent_dir = "/".join(full_path.split("/")[:-1]) parent_dir = "/".join(full_path.split("/")[:-1])
file = full_path.split("/")[-1] file = full_path.split("/")[-1]
if not os.path.exists(parent_dir): if not os.path.exists(parent_dir):
logging.info("Config Error: Directory %s does not exist" % parent_dir) logging.info(f"Config Error: Directory {parent_dir} does not exist")
return return
files = os.listdir(parent_dir) files = os.listdir(parent_dir)
regex = "^%s$" % file.replace('*', '.*') regex = f"^{file.replace('*', '.*')}$"
for file in files: parse_files.extend(os.path.join(parent_dir, file) for file in files if re.match(regex, file))
if re.match(regex, file):
parse_files.append(os.path.join(parent_dir, file))
else: else:
if not os.path.exists(os.path.join(full_path)): if not os.path.exists(os.path.join(full_path)):
logging.info("Config Error: %s does not exist" % full_path) logging.info(f"Config Error: {full_path} does not exist")
return return
parse_files.append(full_path) parse_files.append(full_path)
logging.info("Parsing files: %s" % parse_files) logging.info(f"Parsing files: {parse_files}")
for file in parse_files: for file in parse_files:
config = configparser.ConfigParser() config = configparser.ConfigParser()
config.read(file) config.read(file)
@@ -240,7 +241,7 @@ class KlipperScreenConfig:
def separate_saved_config(self, config_path): def separate_saved_config(self, config_path):
user_def = [] user_def = []
saved_def = None 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, None]
@@ -253,13 +254,12 @@ class KlipperScreenConfig:
continue continue
if found_saved is False: if found_saved is False:
user_def.append(line.replace('\n', '')) user_def.append(line.replace('\n', ''))
else: elif line.startswith(self.do_not_edit_prefix):
if line.startswith(self.do_not_edit_prefix): saved_def.append(line[(len(self.do_not_edit_prefix) + 1):])
saved_def.append(line[(len(self.do_not_edit_prefix)+1):])
return ["\n".join(user_def), None if saved_def is None else "\n".join(saved_def)] 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("Passed config file: %s" % file) logging.info(f"Passed config file: {file}")
if not path.exists(file): if not path.exists(file):
file = os.path.join(klipperscreendir, self.configfile_name) file = os.path.join(klipperscreendir, self.configfile_name)
if not path.exists(file): if not path.exists(file):
@@ -272,7 +272,7 @@ class KlipperScreenConfig:
if not path.exists(file): if not path.exists(file):
file = self.default_config_path file = self.default_config_path
logging.info("Found configuration file at: %s" % file) logging.info(f"Found configuration file at: {file}")
return file return file
def get_config(self): def get_config(self):
@@ -287,13 +287,10 @@ class KlipperScreenConfig:
def get_main_config(self): def get_main_config(self):
return self.config['main'] return self.config['main']
def get_main_config_option(self, option, default=None):
return self.config['main'].get(option, default)
def get_menu_items(self, menu="__main", subsection=""): def get_menu_items(self, menu="__main", subsection=""):
if subsection != "": if subsection != "":
subsection = subsection + " " subsection = f"{subsection} "
index = "menu %s %s" % (menu, subsection) index = f"menu {menu} {subsection}"
items = [i[len(index):] for i in self.config.sections() if i.startswith(index)] items = [i[len(index):] for i in self.config.sections() if i.startswith(index)]
menu_items = [] menu_items = []
for item in items: for item in items:
@@ -304,25 +301,26 @@ class KlipperScreenConfig:
return menu_items return menu_items
def get_menu_name(self, menu="__main", subsection=""): def get_menu_name(self, menu="__main", subsection=""):
name = ("menu %s %s" % (menu, subsection)) if subsection != "" else ("menu %s" % menu) name = f"menu {menu} {subsection}" if subsection != "" else f"menu {menu}"
if name not in self.config: if name not in self.config:
return False return False
return self.config[name].get('name') return self.config[name].get('name')
def get_preheat_options(self): def get_preheat_options(self):
index = "preheat " index = "preheat "
items = [i[len(index):] for i in self.config.sections() if i.startswith(index)] items = [i[len(index):] for i in self.config.sections() if i.startswith(index)]
return {item: self._build_preheat_item(index + item) for item in items}
preheat_options = {} def _build_preheat_item(self, name):
for item in items: if name not in self.config:
preheat_options[item] = self._build_preheat_item(index + item) return False
cfg = self.config[name]
return {opt: cfg.get("gcode", None) if opt == "gcode" else cfg.getint(opt, None) for opt in cfg}
return preheat_options
def get_printer_config(self, name): def get_printer_config(self, name):
if not name.startswith("printer "): if not name.startswith("printer "):
name = "printer %s" % name name = f"printer {name}"
if name not in self.config: if name not in self.config:
return None return None
@@ -334,10 +332,6 @@ class KlipperScreenConfig:
def get_printers(self): def get_printers(self):
return self.printers return self.printers
def get_user_saved_config(self):
if self.config_path != self.default_config_path:
print("Get")
def save_user_config_options(self): def save_user_config_options(self):
save_config = configparser.ConfigParser() save_config = configparser.ConfigParser()
for item in self.configurable_options: for item in self.configurable_options:
@@ -365,7 +359,7 @@ class KlipperScreenConfig:
save_output = self._build_config_string(save_config).split("\n") save_output = self._build_config_string(save_config).split("\n")
for i in range(len(save_output)): for i in range(len(save_output)):
save_output[i] = "%s %s" % (self.do_not_edit_prefix, save_output[i]) save_output[i] = f"{self.do_not_edit_prefix} {save_output[i]}"
if self.config_path == self.default_config_path: if self.config_path == self.default_config_path:
user_def = "" user_def = ""
@@ -379,21 +373,20 @@ class KlipperScreenConfig:
self.do_not_edit_prefix) self.do_not_edit_prefix)
if self.config_path != self.default_config_path: if self.config_path != self.default_config_path:
path = self.config_path filepath = self.config_path
else: else:
path = os.path.expanduser("~/") filepath = os.path.expanduser("~/")
klipper_config = os.path.join(path, "klipper_config") klipper_config = os.path.join(filepath, "klipper_config")
if os.path.exists(klipper_config): if os.path.exists(klipper_config):
path = os.path.join(klipper_config, "KlipperScreen.conf") filepath = os.path.join(klipper_config, "KlipperScreen.conf")
else: else:
path = os.path.join(path, "KlipperScreen.conf") filepath = os.path.join(filepath, "KlipperScreen.conf")
try: try:
file = open(path, 'w') with open(filepath, 'w') as file:
file.write(contents) file.write(contents)
file.close()
except Exception: except Exception:
logging.error("Error writing configuration file in %s" % path) logging.error(f"Error writing configuration file in {filepath}")
def set(self, section, name, value): def set(self, section, name, value):
self.config.set(section, name, value) self.config.set(section, name, value)
@@ -411,7 +404,8 @@ class KlipperScreenConfig:
] ]
logging.info("\n".join(lines)) logging.info("\n".join(lines))
def _build_config_string(self, config): @staticmethod
def _build_config_string(config):
sfile = StringIO() sfile = StringIO()
config.write(sfile) config.write(sfile)
sfile.seek(0) sfile.seek(0)
@@ -433,20 +427,7 @@ class KlipperScreenConfig:
try: try:
item["params"] = json.loads(cfg.get("params", "{}")) item["params"] = json.loads(cfg.get("params", "{}"))
except Exception: except Exception:
logging.debug("Unable to parse parameters for [%s]" % name) logging.debug(f"Unable to parse parameters for [{name}]")
item["params"] = {} item["params"] = {}
return {name[(len(menu) + 6):]: item} return {name[(len(menu) + 6):]: item}
def _build_preheat_item(self, name):
if name not in self.config:
return False
cfg = self.config[name]
item = {
"extruder": cfg.getint("extruder", 0),
"bed": cfg.getint("bed", 0),
"heater_generic": cfg.getint("heater_generic", 0),
"temperature_fan": cfg.getint("temperature_fan", 0),
"gcode": cfg.get("gcode", None)
}
return item
+23 -4
View File
@@ -1,5 +1,4 @@
[main] [main]
service: KlipperScreen
[preheat PLA] [preheat PLA]
bed = 40 bed = 40
@@ -28,7 +27,7 @@ icon: home
name: {{ gettext('Temperature') }} name: {{ gettext('Temperature') }}
icon: heat-up icon: heat-up
panel: temperature panel: temperature
enable: {{ printer.temperature_devices.count > 0 }} enable: {{ (printer.temperature_devices.count > 0) or (printer.extruders.count > 0)}}
[menu __main actions] [menu __main actions]
name: {{ gettext('Actions') }} name: {{ gettext('Actions') }}
@@ -111,6 +110,12 @@ icon: custom-script
panel: gcode_macros panel: gcode_macros
enable: {{ printer.gcode_macros.count > 0 }} enable: {{ printer.gcode_macros.count > 0 }}
[menu __main actions pins]
name: {{ gettext('Pins') }}
icon: fine-tune
panel: pins
enable: {{ printer.output_pins.count > 0 }}
[menu __main actions power] [menu __main actions power]
name: {{ gettext('Power') }} name: {{ gettext('Power') }}
icon: shutdown icon: shutdown
@@ -132,6 +137,7 @@ panel: console
name: {{ gettext('Bed Level') }} name: {{ gettext('Bed Level') }}
icon: bed-level icon: bed-level
panel: bed_level panel: bed_level
enable: {{ printer.bed_screws or printer.screws_tilt_adjust}}
[menu __main config bedmesh] [menu __main config bedmesh]
name: {{ gettext('Bed Mesh') }} name: {{ gettext('Bed Mesh') }}
@@ -171,7 +177,7 @@ icon: complete
method: printer.gcode.script method: printer.gcode.script
params: {"script":"SAVE_CONFIG"} params: {"script":"SAVE_CONFIG"}
confirm: confirm:
{{ gettext('Save configuration') }} {{ gettext('Save configuration?') }}
{{ gettext('Klipper will reboot') }} {{ gettext('Klipper will reboot') }}
@@ -180,6 +186,12 @@ name: {{ gettext('Settings') }}
icon: settings icon: settings
panel: settings panel: settings
[menu __main config input_shaper]
name: {{ gettext('Input Shaper') }}
icon: move
panel: input_shaper
enable: {{ printer.input_shaper }}
[menu __print] [menu __print]
name: {{ gettext('Print Control') }} name: {{ gettext('Print Control') }}
@@ -187,7 +199,7 @@ name: {{ gettext('Print Control') }}
name: {{ gettext('Temperature') }} name: {{ gettext('Temperature') }}
icon: heat-up icon: heat-up
panel: temperature panel: temperature
enable: {{ printer.temperature_devices.count > 0 }} enable: {{ (printer.temperature_devices.count > 0) or (printer.extruders.count > 0)}}
[menu __print fan] [menu __print fan]
name: {{ gettext('Fan') }} name: {{ gettext('Fan') }}
@@ -195,6 +207,12 @@ icon: fan
panel: fan panel: fan
enable: {{ printer.fans.count > 0 }} enable: {{ printer.fans.count > 0 }}
[menu __print move]
name: {{ gettext('Move') }}
icon: move
panel: move
enable: {{ (printer.pause_resume.is_paused == True) }}
[menu __print extrude] [menu __print extrude]
name: {{ gettext('Extrude') }} name: {{ gettext('Extrude') }}
icon: filament icon: filament
@@ -262,6 +280,7 @@ panel: network
name: {{ gettext('System') }} name: {{ gettext('System') }}
icon: info icon: info
panel: system panel: system
enable: {{ moonraker_connected }}
[menu __splashscreen settings] [menu __splashscreen settings]
name: {{ gettext('Settings') }} name: {{ gettext('Settings') }}
+32 -36
View File
@@ -2,20 +2,17 @@ import logging
import os import os
import gi import gi
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import GLib from gi.repository import GLib
class KlippyFiles():
class KlippyFiles:
def __init__(self, screen): def __init__(self, screen):
self._screen = screen self._screen = screen
self.callbacks = [] self.callbacks = []
self.files = {} self.files = {}
self.filelist = [] self.filelist = []
self.thumbnail_dir = "/tmp/.KS-thumbnails"
if not os.path.exists(self.thumbnail_dir):
os.makedirs(self.thumbnail_dir)
self.gcodes_path = None self.gcodes_path = None
def initialize(self): def initialize(self):
@@ -23,15 +20,14 @@ class KlippyFiles():
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:
self.gcodes_path = vsd['path'] self.gcodes_path = os.path.expanduser(vsd['path'])
logging.info("Gcodes path: %s" % self.gcodes_path) logging.info(f"Gcodes path: {self.gcodes_path}")
def reset(self): def reset(self):
self.run_callbacks() self.run_callbacks()
self.callbacks = None self.callbacks = None
self.files = None self.files = None
self.filelist = None self.filelist = None
self.thumbnail_dir = None
self.gcodes_path = None self.gcodes_path = None
self._screen = None self._screen = None
@@ -48,7 +44,7 @@ class KlippyFiles():
newfiles.append(file) newfiles.append(file)
self.add_file(item, False) self.add_file(item, False)
if len(newfiles) > 0 or len(deletedfiles) > 0: if newfiles or len(deletedfiles) > 0:
self.run_callbacks(newfiles, deletedfiles) self.run_callbacks(newfiles, deletedfiles)
if len(deletedfiles) > 0: if len(deletedfiles) > 0:
@@ -56,27 +52,27 @@ class KlippyFiles():
self.remove_file(file) self.remove_file(file)
elif method == "server.files.directory": elif method == "server.files.directory":
if "result" in result: if "result" in result:
dir = params['path'][7:] if params['path'].startswith('gcodes/') else params['path'] directory = params['path'][7:] if params['path'].startswith('gcodes/') else params['path']
if dir[-1] == '/': if directory[-1] == '/':
dir = dir[:-1] directory = directory[:-1]
newfiles = [] newfiles = []
for file in result['result']['files']: for file in result['result']['files']:
fullpath = "%s/%s" % (dir, file['filename']) fullpath = f"{directory}/{file['filename']}"
if fullpath not in self.filelist: if fullpath not in self.filelist:
newfiles.append(fullpath) newfiles.append(fullpath)
if len(newfiles) > 0: if newfiles:
self.run_callbacks(newfiles) self.run_callbacks(newfiles)
elif method == "server.files.metadata": elif method == "server.files.metadata":
if "error" in result.keys(): if "error" in result.keys():
logging.debug("Error in getting metadata for %s. Retrying in 6 seconds" % (params['filename'])) logging.debug(f"Error in getting metadata for {params['filename']}. Retrying in 6 seconds")
return return
for x in result['result']: for x in result['result']:
self.files[params['filename']][x] = result['result'][x] self.files[params['filename']][x] = result['result'][x]
if "thumbnails" in self.files[params['filename']]: if "thumbnails" in self.files[params['filename']]:
self.files[params['filename']]['thumbnails'].sort(key=lambda x: x['size'], reverse=True) self.files[params['filename']]['thumbnails'].sort(key=lambda y: y['size'], reverse=True)
for thumbnail in self.files[params['filename']]['thumbnails']: for thumbnail in self.files[params['filename']]['thumbnails']:
thumbnail['local'] = False thumbnail['local'] = False
@@ -94,12 +90,12 @@ class KlippyFiles():
def add_file(self, item, notify=True): def add_file(self, item, notify=True):
if 'filename' not in item and 'path' not in item: if 'filename' not in item and 'path' not in item:
logging.info("Error adding item, unknown filename or path: %s" % item) logging.info(f"Error adding item, unknown filename or path: {item}")
return return
filename = item['path'] if "path" in item else item['filename'] filename = item['path'] if "path" in item else item['filename']
if filename in self.filelist: if filename in self.filelist:
logging.info("File already exists: %s" % 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]) GLib.timeout_add_seconds(1, self.run_callbacks, mods=[filename])
return return
@@ -117,14 +113,14 @@ class KlippyFiles():
try: try:
self.callbacks.append(callback) self.callbacks.append(callback)
except Exception: except Exception:
logging.debug("Callback not found: %s" % callback) logging.debug(f"Callback not found: {callback}")
def process_update(self, data): def process_update(self, data):
if 'item' in data and data['item']['root'] != 'gcodes': if 'item' in data and data['item']['root'] != 'gcodes':
return return
if data['action'] == "create_dir": if data['action'] == "create_dir":
self._screen._ws.klippy.get_file_dir("gcodes/%s" % data['item']['path'], self._callback) self._screen._ws.klippy.get_file_dir(f"gcodes/{data['item']['path']}", self._callback)
elif data['action'] == "create_file": elif data['action'] == "create_file":
self.add_file(data['item']) self.add_file(data['item'])
elif data['action'] == "delete_file": elif data['action'] == "delete_file":
@@ -141,7 +137,7 @@ class KlippyFiles():
self.callbacks.pop(self.callbacks.index(callback)) self.callbacks.pop(self.callbacks.index(callback))
def file_exists(self, filename): def file_exists(self, filename):
return True if filename in self.filelist else False return filename in self.filelist
def file_metadata_exists(self, filename): def file_metadata_exists(self, filename):
if not self.file_exists(filename): if not self.file_exists(filename):
@@ -150,22 +146,16 @@ class KlippyFiles():
return True return True
return False return False
def get_thumbnail_location(self, filename): def get_thumbnail_location(self, filename, small=False):
thumb = self.files[filename]['thumbnails'][0] if small and len(self.files[filename]['thumbnails']) > 1 \
and self.files[filename]['thumbnails'][0]['width'] > self.files[filename]['thumbnails'][1]['width']:
thumb = self.files[filename]['thumbnails'][1]
else:
thumb = self.files[filename]['thumbnails'][0]
if thumb['local'] is False: if thumb['local'] is False:
return ['http', thumb['path']] return ['http', thumb['path']]
return ['file', thumb['path']] return ['file', thumb['path']]
def get_thumbnail_scale(self, filename):
width = self.files[filename]['thumbnails'][0]['width']
height = self.files[filename]['thumbnails'][0]['height']
logging.info("Thumb size: %d %d" % (width, height))
w = 400 / width
h = 300 / height
factor = min(w, h)
logging.info("Thumb scale w:%.2f h:%.2f final:%.2f" % (w, h, factor))
return factor
def has_thumbnail(self, filename): def has_thumbnail(self, filename):
if filename not in self.files: if filename not in self.files:
return False return False
@@ -190,10 +180,16 @@ class KlippyFiles():
self.run_callbacks(deletedfiles=[filename]) self.run_callbacks(deletedfiles=[filename])
def ret_file_data(self, filename): def ret_file_data(self, filename):
print("Getting file info for %s" % (filename)) logging.info(f"Getting file info for {filename}")
self._screen._ws.klippy.get_file_metadata(filename, self._callback) self._screen._ws.klippy.get_file_metadata(filename, self._callback)
def run_callbacks(self, newfiles=[], deletedfiles=[], mods=[]): def run_callbacks(self, newfiles=None, deletedfiles=None, mods=None):
if mods is None:
mods = []
if deletedfiles is None:
deletedfiles = []
if newfiles is None:
newfiles = []
if len(self.callbacks) <= 0: if len(self.callbacks) <= 0:
return False return False
for cb in self.callbacks: for cb in self.callbacks:
+23 -7
View File
@@ -17,6 +17,7 @@ try:
ctypes.cdll.LoadLibrary('libXext.so.6') ctypes.cdll.LoadLibrary('libXext.so.6')
libXext = ctypes.CDLL('libXext.so.6') libXext = ctypes.CDLL('libXext.so.6')
class DPMS_State: class DPMS_State:
Fail = -1 Fail = -1
On = 0 On = 0
@@ -24,6 +25,7 @@ try:
Suspend = 2 Suspend = 2
Off = 3 Off = 3
def get_DPMS_state(display_name_in_byte_string=b':0'): def get_DPMS_state(display_name_in_byte_string=b':0'):
state = DPMS_State.Fail state = DPMS_State.Fail
if not isinstance(display_name_in_byte_string, bytes): if not isinstance(display_name_in_byte_string, bytes):
@@ -35,8 +37,8 @@ try:
dummy1_i_p = ctypes.create_string_buffer(8) dummy1_i_p = ctypes.create_string_buffer(8)
dummy2_i_p = ctypes.create_string_buffer(8) dummy2_i_p = ctypes.create_string_buffer(8)
if display.value: if display.value:
if libXext.DPMSQueryExtension(display, dummy1_i_p, dummy2_i_p)\ if libXext.DPMSQueryExtension(display, dummy1_i_p, dummy2_i_p) \
and libXext.DPMSCapable(display): and libXext.DPMSCapable(display):
onoff_p = ctypes.create_string_buffer(1) onoff_p = ctypes.create_string_buffer(1)
state_p = ctypes.create_string_buffer(2) state_p = ctypes.create_string_buffer(2)
if libXext.DPMSInfo(display, state_p, onoff_p): if libXext.DPMSInfo(display, state_p, onoff_p):
@@ -45,14 +47,18 @@ try:
state = struct.unpack('H', state_p.raw)[0] state = struct.unpack('H', state_p.raw)[0]
libXext.XCloseDisplay(display) libXext.XCloseDisplay(display)
return state return state
dpms_loaded = True dpms_loaded = True
except Exception: except Exception:
pass pass
def get_network_interfaces(): def get_network_interfaces():
stream = os.popen("ip addr | grep ^'[0-9]' | cut -d ' ' -f 2 | grep -o '[a-zA-Z0-9\\.]*'") stream = os.popen("ip addr | grep ^'[0-9]' | cut -d ' ' -f 2 | grep -o '[a-zA-Z0-9\\.]*'")
return [i for i in stream.read().strip().split('\n') if not i.startswith('lo')] return [i for i in stream.read().strip().split('\n') if not i.startswith('lo')]
def get_wireless_interfaces(): def get_wireless_interfaces():
p = subprocess.Popen(["which", "iwconfig"], stdout=subprocess.PIPE) p = subprocess.Popen(["which", "iwconfig"], stdout=subprocess.PIPE)
@@ -64,17 +70,19 @@ def get_wireless_interfaces():
try: try:
p = subprocess.Popen(["iwconfig"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) p = subprocess.Popen(["iwconfig"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result = p.stdout.read().decode('ascii').split('\n') result = p.stdout.read().decode('ascii').split('\n')
except Exception: except Exception as e:
logging.critical(e, exc_info=True)
logging.info("Error with running iwconfig command") logging.info("Error with running iwconfig command")
return None return None
interfaces = [] interfaces = []
for line in result: for line in result:
match = re.search('^(\\S+)\\s+.*$', line) match = re.search('^(\\S+)\\s+.*$', line)
if match: if match:
interfaces.append(match.group(1)) interfaces.append(match[1])
return interfaces return interfaces
def get_software_version(): def get_software_version():
prog = ('git', '-C', os.path.dirname(__file__), 'describe', '--always', prog = ('git', '-C', os.path.dirname(__file__), 'describe', '--always',
'--tags', '--long', '--dirty') '--tags', '--long', '--dirty')
@@ -94,6 +102,7 @@ def get_software_version():
logging.exception("Error runing git describe") logging.exception("Error runing git describe")
return "?" return "?"
def patch_threading_excepthook(): def patch_threading_excepthook():
"""Installs our exception handler into the threading modules Thread object """Installs our exception handler into the threading modules Thread object
Inspired by https://bugs.python.org/issue1230540 Inspired by https://bugs.python.org/issue1230540
@@ -111,15 +120,18 @@ def patch_threading_excepthook():
raise raise
except Exception: except Exception:
sys.excepthook(*sys.exc_info(), thread_identifier=threading.get_ident()) sys.excepthook(*sys.exc_info(), thread_identifier=threading.get_ident())
self.run = run_with_excepthook self.run = run_with_excepthook
threading.Thread.__init__ = new_init threading.Thread.__init__ = new_init
# Timed rotating file handler based on Klipper and Moonraker's implementation # Timed rotating file handler based on Klipper and Moonraker's implementation
class KlipperScreenLoggingHandler(logging.handlers.TimedRotatingFileHandler): class KlipperScreenLoggingHandler(logging.handlers.TimedRotatingFileHandler):
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 = {
'header': f"{'-'*20}KlipperScreen Log Start{'-'*20}", 'header': f"{'-' * 20}KlipperScreen Log Start{'-' * 20}",
'version': f"Git Version: {software_version}", 'version': f"Git Version: {software_version}",
} }
lines = [line for line in self.rollover_info.values() if line] lines = [line for line in self.rollover_info.values() if line]
@@ -135,6 +147,7 @@ class KlipperScreenLoggingHandler(logging.handlers.TimedRotatingFileHandler):
if self.stream is not None: if self.stream is not None:
self.stream.write("\n".join(lines) + "\n") self.stream.write("\n".join(lines) + "\n")
# Logging based on Arksine's logging setup # Logging based on Arksine's logging setup
def setup_logging(log_file, software_version): def setup_logging(log_file, software_version):
root_logger = logging.getLogger() root_logger = logging.getLogger()
@@ -161,9 +174,12 @@ def setup_logging(log_file, software_version):
queue, stdout_hdlr) queue, stdout_hdlr)
listener.start() listener.start()
def logging_exception_handler(type, value, tb, thread_identifier=None): def logging_exception_handler(ex_type, value, tb, thread_identifier=None):
logging.exception( logging.exception(
"Uncaught exception %s: %s\nTraceback: %s" % (type, value, "\n".join(traceback.format_tb(tb)))) f'Uncaught exception {ex_type}: {value}\n'
f'Traceback: {traceback.format_tb(tb)}'
)
sys.excepthook = logging_exception_handler sys.excepthook = logging_exception_handler
logging.captureWarnings(True) logging.captureWarnings(True)
+140 -11
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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-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"
@@ -31,9 +31,15 @@ msgstr ""
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "" msgstr ""
msgid "ADXL Not Configured"
msgstr ""
msgid "Abort" msgid "Abort"
msgstr "" msgstr ""
msgid "Acceleration:"
msgstr ""
msgid "Accept" msgid "Accept"
msgstr "" msgstr ""
@@ -46,6 +52,17 @@ msgstr ""
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "" msgstr ""
msgid "Apply"
msgstr ""
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr ""
#, python-format
msgid "Apply %s%.2f offset to Probe?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "" msgstr ""
@@ -64,6 +81,9 @@ msgstr ""
msgid "Auto" msgid "Auto"
msgstr "" msgstr ""
msgid "Auto-calibrate"
msgstr ""
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "" msgstr ""
@@ -79,9 +99,15 @@ msgstr ""
msgid "Calibrate" msgid "Calibrate"
msgstr "" msgstr ""
msgid "Calibrated"
msgstr ""
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "" msgstr ""
msgid "Calibrating..."
msgstr ""
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "" msgstr ""
@@ -108,6 +134,12 @@ msgid ""
"Please submit an issue on GitHub for help." "Please submit an issue on GitHub for help."
msgstr "" msgstr ""
msgid "Check ADXL Wiring"
msgstr ""
msgid "Clear"
msgstr ""
msgid "Close" msgid "Close"
msgstr "" msgstr ""
@@ -154,9 +186,6 @@ msgstr ""
msgid "Disable XY" msgid "Disable XY"
msgstr "" msgstr ""
msgid "Displayed Macros"
msgstr ""
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "" msgstr ""
@@ -191,9 +220,24 @@ msgstr ""
msgid "Filament Used" msgid "Filament Used"
msgstr "" msgstr ""
msgid "Filament total:"
msgstr ""
msgid "Filament used:"
msgstr ""
msgid "Filament:"
msgstr ""
msgid "File" msgid "File"
msgstr "" msgstr ""
msgid "File:"
msgstr ""
msgid "Finding ADXL"
msgstr ""
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "" msgstr ""
@@ -205,6 +249,12 @@ msgid ""
"Restart" "Restart"
msgstr "" msgstr ""
msgid "Flow:"
msgstr ""
msgid "Flowrate:"
msgstr ""
msgid "Font Size" msgid "Font Size"
msgstr "" msgstr ""
@@ -216,6 +266,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "" msgstr ""
msgid "Height:"
msgstr ""
msgid "Hidden" msgid "Hidden"
msgstr "" msgstr ""
@@ -225,6 +278,9 @@ msgstr ""
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "" msgstr ""
msgid "Hide temp."
msgstr ""
msgid "Home" msgid "Home"
msgstr "" msgstr ""
@@ -261,6 +317,9 @@ msgstr ""
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "" msgstr ""
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "" msgstr ""
@@ -302,6 +361,9 @@ msgstr ""
msgid "Large" msgid "Large"
msgstr "" msgstr ""
msgid "Layer:"
msgstr ""
msgid "Left:" msgid "Left:"
msgstr "" msgstr ""
@@ -323,7 +385,10 @@ msgstr ""
msgid "Main Menu" msgid "Main Menu"
msgstr "" msgstr ""
msgid "Max Accelation" msgid "Max"
msgstr ""
msgid "Max Acceleration"
msgstr "" msgstr ""
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
@@ -332,6 +397,15 @@ msgstr ""
msgid "Max Velocity" msgid "Max Velocity"
msgstr "" msgstr ""
msgid "Measure Both"
msgstr ""
msgid "Measure X"
msgstr ""
msgid "Measure Y"
msgstr ""
msgid "Medium" msgid "Medium"
msgstr "" msgstr ""
@@ -356,6 +430,9 @@ msgstr ""
msgid "Network" msgid "Network"
msgstr "" msgstr ""
msgid "New"
msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "" msgstr ""
@@ -374,6 +451,9 @@ msgid_plural "Packages will be updated"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "" msgstr ""
@@ -386,6 +466,9 @@ msgstr ""
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "" msgstr ""
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "" msgstr ""
@@ -395,6 +478,9 @@ msgstr ""
msgid "Power On Printer" msgid "Power On Printer"
msgstr "" msgstr ""
msgid "Pressure Advance:"
msgstr ""
msgid "Print" msgid "Print"
msgstr "" msgstr ""
@@ -410,6 +496,9 @@ msgstr ""
msgid "Printing" msgid "Printing"
msgstr "" msgstr ""
msgid "Probe Offset"
msgstr ""
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "" msgstr ""
@@ -440,17 +529,39 @@ msgstr ""
msgid "Retract" msgid "Retract"
msgstr "" msgstr ""
msgid "Retraction"
msgstr ""
msgid "Retraction Length"
msgstr ""
msgid "Retraction Speed"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "" msgstr ""
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "" msgstr ""
msgid "Save Config" msgid "Save Config"
msgstr "" msgstr ""
msgid "Save configuration" msgid "Save Z"
msgstr ""
msgid "Save configuration?"
msgstr ""
msgid "Saved"
msgstr ""
#, python-format
msgid "Saved offset: %s"
msgstr "" msgstr ""
msgid "Screen DPMS" msgid "Screen DPMS"
@@ -490,12 +601,18 @@ msgstr ""
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "" msgstr ""
msgid "Slicer:"
msgstr ""
msgid "Small" msgid "Small"
msgstr "" msgstr ""
msgid "Sort by: " msgid "Sort by: "
msgstr "" msgstr ""
msgid "Sort:"
msgstr ""
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "" msgstr ""
@@ -505,6 +622,9 @@ msgstr ""
msgid "Speed -" msgid "Speed -"
msgstr "" msgstr ""
msgid "Speed:"
msgstr ""
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "" msgstr ""
@@ -543,9 +663,6 @@ msgstr ""
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "" msgstr ""
msgid "Tool"
msgstr ""
msgid "Total:" msgid "Total:"
msgstr "" msgstr ""
@@ -555,6 +672,12 @@ msgstr ""
msgid "Unload" msgid "Unload"
msgstr "" msgstr ""
msgid "Unretract Extra Length"
msgstr ""
msgid "Unretract Speed"
msgstr ""
msgid "Up To Date" msgid "Up To Date"
msgstr "" msgstr ""
@@ -579,6 +702,9 @@ msgstr ""
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "" msgstr ""
msgid "XY Speed (mm/s)"
msgstr ""
msgid "Y+" msgid "Y+"
msgstr "" msgstr ""
@@ -591,12 +717,15 @@ msgstr ""
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "" msgstr ""
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "" msgstr ""
msgid "Z Tilt" msgid "Z Tilt"
msgstr "" msgstr ""
msgid "Z offset:"
msgstr ""
msgid "Z+" msgid "Z+"
msgstr "" msgstr ""
@@ -625,5 +754,5 @@ msgstr ""
msgid "mm/s" msgid "mm/s"
msgstr "" msgstr ""
msgid "mm/s^2" msgid "mm/s²"
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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-0300\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: SRBJ\n" "Last-Translator: SRBJ\n"
"Language-Team: \n" "Language-Team: \n"
@@ -26,9 +26,15 @@ msgstr "24-timers visning"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "En FIRMWARE_RESTART kan løse problemet." msgstr "En FIRMWARE_RESTART kan løse problemet."
msgid "ADXL Not Configured"
msgstr ""
msgid "Abort" msgid "Abort"
msgstr "Annuller" msgstr "Annuller"
msgid "Acceleration:"
msgstr "Acceleration:"
msgid "Accept" msgid "Accept"
msgstr "OK" msgstr "OK"
@@ -41,6 +47,17 @@ msgstr "Tilføj printer"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "Tilføj \"bed-mesh\" profil" msgstr "Tilføj \"bed-mesh\" profil"
msgid "Apply"
msgstr ""
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr ""
#, python-format
msgid "Apply %s%.2f offset to Probe?"
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?"
@@ -59,6 +76,9 @@ msgstr "Er du sikker på du vil lukke systemet?"
msgid "Auto" msgid "Auto"
msgstr "Auto" msgstr "Auto"
msgid "Auto-calibrate"
msgstr "Automatisk kalibrering"
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "Auto-scroll" msgstr "Auto-scroll"
@@ -74,9 +94,15 @@ msgstr "Bltouch fundet anvendt offset"
msgid "Calibrate" msgid "Calibrate"
msgstr "Kalibrér" msgstr "Kalibrér"
msgid "Calibrated"
msgstr "Kalibreret"
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "Kalibreret, gem konfiguration for at gøre den permanent" msgstr "Kalibreret, gem konfiguration for at gøre den permanent"
msgid "Calibrating..."
msgstr "Kalibrerer..."
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "Kan ikke indstilles over maksimum:" msgstr "Kan ikke indstilles over maksimum:"
@@ -105,6 +131,12 @@ msgstr ""
"Tjek /tmp/KlipperScreen.log for mere information.\n" "Tjek /tmp/KlipperScreen.log for mere information.\n"
"Indsend venligst et \"Issue\" på GitHub for hjælp." "Indsend venligst et \"Issue\" på GitHub for hjælp."
msgid "Check ADXL Wiring"
msgstr ""
msgid "Clear"
msgstr ""
msgid "Close" msgid "Close"
msgstr "Luk" msgstr "Luk"
@@ -151,9 +183,6 @@ msgstr "Deaktivér motorer"
msgid "Disable XY" msgid "Disable XY"
msgstr "Deaktivér XY" msgstr "Deaktivér XY"
msgid "Displayed Macros"
msgstr "Viste makroer"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "Længde (mm)" msgstr "Længde (mm)"
@@ -188,9 +217,24 @@ msgstr "Blæser"
msgid "Filament Used" msgid "Filament Used"
msgstr "Filament forbrug" msgstr "Filament forbrug"
msgid "Filament total:"
msgstr "Filament i alt:"
msgid "Filament used:"
msgstr "Filament brugt:"
msgid "Filament:"
msgstr "Filament:"
msgid "File" msgid "File"
msgstr "Fil" msgstr "Fil"
msgid "File:"
msgstr "Fil:"
msgid "Finding ADXL"
msgstr "At finde ADXL"
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "Finjustering" msgstr "Finjustering"
@@ -204,6 +248,12 @@ msgstr ""
"Firmware\n" "Firmware\n"
"Genstart" "Genstart"
msgid "Flow:"
msgstr ""
msgid "Flowrate:"
msgstr ""
msgid "Font Size" msgid "Font Size"
msgstr "Skriftstørrelse" msgstr "Skriftstørrelse"
@@ -217,6 +267,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "Gå tilbage" msgstr "Gå tilbage"
msgid "Height:"
msgstr ""
msgid "Hidden" msgid "Hidden"
msgstr "Skjult" msgstr "Skjult"
@@ -226,6 +279,9 @@ msgstr "Skjule"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "Skjul sensorer i Temp." msgstr "Skjul sensorer i Temp."
msgid "Hide temp."
msgstr ""
msgid "Home" msgid "Home"
msgstr "Home" msgstr "Home"
@@ -262,6 +318,9 @@ msgstr "Initialiserer"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "Initialiserer printer..." msgstr "Initialiserer printer..."
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "Interface" msgstr "Interface"
@@ -305,6 +364,9 @@ msgstr "Sprog"
msgid "Large" msgid "Large"
msgstr "Stor" msgstr "Stor"
msgid "Layer:"
msgstr ""
msgid "Left:" msgid "Left:"
msgstr "Resterende:" msgstr "Resterende:"
@@ -326,8 +388,11 @@ msgstr "Makroer"
msgid "Main Menu" msgid "Main Menu"
msgstr "Hovedmenu" msgstr "Hovedmenu"
msgid "Max Accelation" msgid "Max"
msgstr "Maks. acceleration" msgstr ""
msgid "Max Acceleration"
msgstr "Maks. Acceleration"
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
msgstr "Maks. acceleration til decceleration" msgstr "Maks. acceleration til decceleration"
@@ -335,6 +400,15 @@ msgstr "Maks. acceleration til decceleration"
msgid "Max Velocity" msgid "Max Velocity"
msgstr "Maks. hastighed" msgstr "Maks. hastighed"
msgid "Measure Both"
msgstr ""
msgid "Measure X"
msgstr ""
msgid "Measure Y"
msgstr ""
msgid "Medium" msgid "Medium"
msgstr "Mellem" msgstr "Mellem"
@@ -359,6 +433,9 @@ msgstr "Navn"
msgid "Network" msgid "Network"
msgstr "Netværk" msgstr "Netværk"
msgid "New"
msgstr "Ny"
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Intet valgt" msgstr "Intet valgt"
@@ -377,6 +454,9 @@ msgid_plural "Packages will be updated"
msgstr[0] "Pakken vil blive opdateret" msgstr[0] "Pakken vil blive opdateret"
msgstr[1] "Pakker vil blive opdateret" msgstr[1] "Pakker vil blive opdateret"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "Adgangskode gemt" msgstr "Adgangskode gemt"
@@ -389,6 +469,9 @@ msgstr "På pause"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "Vil du udføre en fuld opgradering?" msgstr "Vil du udføre en fuld opgradering?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "Genkompilér og flash mikrocontrolleren." msgstr "Genkompilér og flash mikrocontrolleren."
@@ -398,6 +481,9 @@ msgstr "Strømstyring"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "Tænd printer" msgstr "Tænd printer"
msgid "Pressure Advance:"
msgstr ""
msgid "Print" msgid "Print"
msgstr "Print" msgstr "Print"
@@ -413,6 +499,9 @@ msgstr "Printer forbindelser"
msgid "Printing" msgid "Printing"
msgstr "Printer" msgstr "Printer"
msgid "Probe Offset"
msgstr ""
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "Probe fundet anvendt offset" msgstr "Probe fundet anvendt offset"
@@ -443,19 +532,41 @@ msgstr "Genoptag"
msgid "Retract" msgid "Retract"
msgstr "Retract" msgstr "Retract"
msgid "Retraction"
msgstr ""
msgid "Retraction Length"
msgstr ""
msgid "Retraction Speed"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Prøv igen #%s" msgstr "Prøv igen #%s"
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "Gem" msgstr "Gem"
msgid "Save Config" msgid "Save Config"
msgstr "Gem Konfiguration" msgstr "Gem Konfiguration"
msgid "Save configuration" msgid "Save Z"
msgstr "Gem Z"
msgid "Save configuration?"
msgstr "Gem Konfiguration" msgstr "Gem Konfiguration"
msgid "Saved"
msgstr "Gemt"
#, python-format
msgid "Saved offset: %s"
msgstr ""
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "Skærm DPMS" msgstr "Skærm DPMS"
@@ -493,12 +604,18 @@ msgstr "Slicer"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "Slicer Tidskorrektion (%)" msgstr "Slicer Tidskorrektion (%)"
msgid "Slicer:"
msgstr ""
msgid "Small" msgid "Small"
msgstr "Lille" msgstr "Lille"
msgid "Sort by: " msgid "Sort by: "
msgstr "Sortér efter: " msgstr "Sortér efter: "
msgid "Sort:"
msgstr "Sortere: "
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "Hastighed (mm/s)" msgstr "Hastighed (mm/s)"
@@ -508,6 +625,9 @@ msgstr "Hastighed +"
msgid "Speed -" msgid "Speed -"
msgstr "Hastighed -" msgstr "Hastighed -"
msgid "Speed:"
msgstr "Hastighed"
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "Hastighed for 90° hjørne" msgstr "Hastighed for 90° hjørne"
@@ -550,9 +670,6 @@ msgstr "Temperatur"
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "KlipperScreen skal genstartes for at anvende %s" msgstr "KlipperScreen skal genstartes for at anvende %s"
msgid "Tool"
msgstr "Ekstruder"
msgid "Total:" msgid "Total:"
msgstr "Total:" msgstr "Total:"
@@ -562,6 +679,12 @@ msgstr "Ukendt varmelegeme"
msgid "Unload" msgid "Unload"
msgstr "Tilbagetræk" msgstr "Tilbagetræk"
msgid "Unretract Extra Length"
msgstr ""
msgid "Unretract Speed"
msgstr ""
msgid "Up To Date" msgid "Up To Date"
msgstr "Up-to-Date" msgstr "Up-to-Date"
@@ -586,6 +709,9 @@ msgstr "X-"
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "XY Flyt hastighed (mm/s)" msgstr "XY Flyt hastighed (mm/s)"
msgid "XY Speed (mm/s)"
msgstr "XY Hastighed (mm/s)"
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr "Y+"
@@ -598,12 +724,15 @@ msgstr "Kalibrér Z"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "Z Flyt hastighed (mm/s)" msgstr "Z Flyt hastighed (mm/s)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "Z-position" msgstr "Z Hastighed (mm/s)"
msgid "Z Tilt" msgid "Z Tilt"
msgstr "Z-tilt" msgstr "Z-tilt"
msgid "Z offset:"
msgstr ""
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr "Z+"
@@ -632,8 +761,17 @@ msgstr "mm"
msgid "mm/s" msgid "mm/s"
msgstr "mm/s" msgstr "mm/s"
msgid "mm/s^2" msgid "mm/s²"
msgstr "mm/s^2" msgstr "mm/s²"
#~ msgid "Tool"
#~ msgstr "Ekstruder"
#~ msgid "Displayed Macros"
#~ msgstr "Viste makroer"
#~ msgid "Z Position"
#~ msgstr "Z-position"
#~ msgid "IPv4" #~ msgid "IPv4"
#~ msgstr "IPv4" #~ msgstr "IPv4"
@@ -641,9 +779,6 @@ msgstr "mm/s^2"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Z Offset"
#~ msgstr "Z-offset"
#~ msgid "Unknown Heater " #~ msgid "Unknown Heater "
#~ msgstr "Ukendt varmelegeme " #~ msgstr "Ukendt varmelegeme "
@@ -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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-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"
@@ -31,9 +31,15 @@ msgstr "24h-Zeit"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "Ein FIRMWARE_RESTART kann das Problem beheben." msgstr "Ein FIRMWARE_RESTART kann das Problem beheben."
msgid "ADXL Not Configured"
msgstr ""
msgid "Abort" msgid "Abort"
msgstr "Abbrechen" msgstr "Abbrechen"
msgid "Acceleration:"
msgstr "Beschleunigung:"
msgid "Accept" msgid "Accept"
msgstr "OK" msgstr "OK"
@@ -46,6 +52,17 @@ msgstr "Drucker hinzufügen"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "Mesh-Level Profil hinzufügen" msgstr "Mesh-Level Profil hinzufügen"
msgid "Apply"
msgstr ""
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr ""
#, python-format
msgid "Apply %s%.2f offset to Probe?"
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?"
@@ -64,6 +81,9 @@ msgstr "Möchten Sie das System wirklich herunterfahren?"
msgid "Auto" msgid "Auto"
msgstr "Auto" msgstr "Auto"
msgid "Auto-calibrate"
msgstr "Automatisch kalibrieren"
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "Auto-scroll" msgstr "Auto-scroll"
@@ -79,9 +99,15 @@ msgstr "Bltouch hat angewendeten Offset gefunden"
msgid "Calibrate" msgid "Calibrate"
msgstr "Höheneinstellung" msgstr "Höheneinstellung"
msgid "Calibrated"
msgstr "Kalibriert"
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "Kalibriert, Konfiguration speichern, um sie dauerhaft zu machen" msgstr "Kalibriert, Konfiguration speichern, um sie dauerhaft zu machen"
msgid "Calibrating..."
msgstr "Kalibrieren..."
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "Kann nicht über dem Maximum eingestellt werden:" msgstr "Kann nicht über dem Maximum eingestellt werden:"
@@ -110,6 +136,12 @@ msgstr ""
"Prüfe /tmp/KlipperScreen.log für weitere Informationen.\n" "Prüfe /tmp/KlipperScreen.log für weitere Informationen.\n"
"Bitte eröffne einen Fehlerbericht auf https://git.io/JLNn4 für Hilfe." "Bitte eröffne einen Fehlerbericht auf https://git.io/JLNn4 für Hilfe."
msgid "Check ADXL Wiring"
msgstr ""
msgid "Clear"
msgstr ""
msgid "Close" msgid "Close"
msgstr "Schließen" msgstr "Schließen"
@@ -156,9 +188,6 @@ msgstr "Motoren deaktivieren"
msgid "Disable XY" msgid "Disable XY"
msgstr "Achse XY deaktivieren" msgstr "Achse XY deaktivieren"
msgid "Displayed Macros"
msgstr "Aktive Macros"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "Entfernung (mm)" msgstr "Entfernung (mm)"
@@ -193,9 +222,24 @@ msgstr "Lüfter"
msgid "Filament Used" msgid "Filament Used"
msgstr "Filamentverbrauch" msgstr "Filamentverbrauch"
msgid "Filament total:"
msgstr "Filament insgesamt:"
msgid "Filament used:"
msgstr "Filamentverbrauch:"
msgid "Filament:"
msgstr "Filament:"
msgid "File" msgid "File"
msgstr "Datei" msgstr "Datei"
msgid "File:"
msgstr "Datei:"
msgid "Finding ADXL"
msgstr "ADXL finden"
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "Feintuning" msgstr "Feintuning"
@@ -209,6 +253,12 @@ msgstr ""
"Firmware\n" "Firmware\n"
"Neu starten" "Neu starten"
msgid "Flow:"
msgstr ""
msgid "Flowrate:"
msgstr ""
msgid "Font Size" msgid "Font Size"
msgstr "Schriftgröße" msgstr "Schriftgröße"
@@ -222,6 +272,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "Zurück" msgstr "Zurück"
msgid "Height:"
msgstr ""
msgid "Hidden" msgid "Hidden"
msgstr "Versteckt" msgstr "Versteckt"
@@ -231,6 +284,9 @@ msgstr "Verstecken"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "Sensoren in Temp ausblenden." msgstr "Sensoren in Temp ausblenden."
msgid "Hide temp."
msgstr ""
msgid "Home" msgid "Home"
msgstr "Grundposition" msgstr "Grundposition"
@@ -277,6 +333,9 @@ msgstr "Startvorgang"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "Drucker wird initialisiert..." msgstr "Drucker wird initialisiert..."
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "Interface" msgstr "Interface"
@@ -320,6 +379,9 @@ msgstr "Sprache"
msgid "Large" msgid "Large"
msgstr "Groß" msgstr "Groß"
msgid "Layer:"
msgstr ""
msgid "Left:" msgid "Left:"
msgstr "Restzeit:" msgstr "Restzeit:"
@@ -341,7 +403,10 @@ msgstr "Makros"
msgid "Main Menu" msgid "Main Menu"
msgstr "Hauptmenü" msgstr "Hauptmenü"
msgid "Max Accelation" msgid "Max"
msgstr ""
msgid "Max Acceleration"
msgstr "Max Beschleunigung" msgstr "Max Beschleunigung"
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
@@ -350,6 +415,15 @@ msgstr "Max Verzögerung"
msgid "Max Velocity" msgid "Max Velocity"
msgstr "Max Geschwindigkeit" msgstr "Max Geschwindigkeit"
msgid "Measure Both"
msgstr ""
msgid "Measure X"
msgstr ""
msgid "Measure Y"
msgstr ""
msgid "Medium" msgid "Medium"
msgstr "Mittel" msgstr "Mittel"
@@ -374,6 +448,9 @@ msgstr "Name"
msgid "Network" msgid "Network"
msgstr "Netzwerk" msgstr "Netzwerk"
msgid "New"
msgstr "Neu"
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Nichts ausgewählt" msgstr "Nichts ausgewählt"
@@ -392,6 +469,9 @@ msgid_plural "Packages will be updated"
msgstr[0] "Paket wird aktualisiert" msgstr[0] "Paket wird aktualisiert"
msgstr[1] "Pakete werden aktualisiert" msgstr[1] "Pakete werden aktualisiert"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "Passwort gespeichert" msgstr "Passwort gespeichert"
@@ -404,6 +484,9 @@ msgstr "Pausiert"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "Vollständiges Upgrade durchführen?" msgstr "Vollständiges Upgrade durchführen?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "Please recompile and flash the micro-controller." msgstr "Please recompile and flash the micro-controller."
@@ -413,6 +496,9 @@ msgstr "Ein"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "Drucker einschalten" msgstr "Drucker einschalten"
msgid "Pressure Advance:"
msgstr ""
msgid "Print" msgid "Print"
msgstr "Druck" msgstr "Druck"
@@ -428,6 +514,9 @@ msgstr "Drucker Verbindungen"
msgid "Printing" msgid "Printing"
msgstr "Drucken" msgstr "Drucken"
msgid "Probe Offset"
msgstr ""
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "Probe hat angewendeten Offset gefunden" msgstr "Probe hat angewendeten Offset gefunden"
@@ -440,13 +529,9 @@ msgstr "Quad Gantry Level"
msgid "Raise Nozzle" msgid "Raise Nozzle"
msgstr "Düse anheben" msgstr "Düse anheben"
# Respect the number of characters!
# english text barely fits in small screens
msgid "Recover Hard" msgid "Recover Hard"
msgstr "Rücksetzen Hard" msgstr "Rücksetzen Hard"
# Respect the number of characters!
# english text barely fits in small screens
msgid "Recover Soft" msgid "Recover Soft"
msgstr "Rücksetzen Soft" msgstr "Rücksetzen Soft"
@@ -462,18 +547,40 @@ msgstr "Fortsetzen"
msgid "Retract" msgid "Retract"
msgstr "Zurückziehen" msgstr "Zurückziehen"
msgid "Retraction"
msgstr "Rückzug"
msgid "Retraction Length"
msgstr "Rückzugslänge"
msgid "Retraction Speed"
msgstr "Rückzugsgeschwindigkeit"
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Wiederholen #%s" msgstr "Wiederholen #%s"
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "Speichern" msgstr "Speichern"
msgid "Save Config" msgid "Save Config"
msgstr "Einstellungen speichern" msgstr "Einstellungen speichern"
msgid "Save configuration" msgid "Save Z"
msgstr "Speichere Einstellungen" msgstr "Speichern Sie Z"
msgid "Save configuration?"
msgstr "Konfiguration speichern?"
msgid "Saved"
msgstr "Gerettet"
#, python-format
msgid "Saved offset: %s"
msgstr ""
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "Bildschirm-DPMS" msgstr "Bildschirm-DPMS"
@@ -512,12 +619,18 @@ msgstr "Slicer"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "Slicer-Zeitkorrektur (%)" msgstr "Slicer-Zeitkorrektur (%)"
msgid "Slicer:"
msgstr ""
msgid "Small" msgid "Small"
msgstr "Klein" msgstr "Klein"
msgid "Sort by: " msgid "Sort by: "
msgstr "Sortierung: " msgstr "Sortierung: "
msgid "Sort:"
msgstr "Sortieren: "
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "Geschwindigkeit (mm/s)" msgstr "Geschwindigkeit (mm/s)"
@@ -527,6 +640,9 @@ msgstr "Geschwindigkeit +"
msgid "Speed -" msgid "Speed -"
msgstr "Geschwindigkeit -" msgstr "Geschwindigkeit -"
msgid "Speed:"
msgstr "Geschwindigkeit:"
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "Eckgeschwindigkeit" msgstr "Eckgeschwindigkeit"
@@ -569,9 +685,6 @@ msgstr "Temperatur"
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Zum Übernehmen von %s benötigt Klipperscreen einen Neustart" msgstr "Zum Übernehmen von %s benötigt Klipperscreen einen Neustart"
msgid "Tool"
msgstr "Druckkopf"
msgid "Total:" msgid "Total:"
msgstr "Gesamt:" msgstr "Gesamt:"
@@ -581,6 +694,12 @@ msgstr "Unbekannte Heizung"
msgid "Unload" msgid "Unload"
msgstr "Entladen" msgstr "Entladen"
msgid "Unretract Extra Length"
msgstr ""
msgid "Unretract Speed"
msgstr ""
# Respect the number of characters # Respect the number of characters
# english text barely fits in small screens # english text barely fits in small screens
msgid "Up To Date" msgid "Up To Date"
@@ -607,6 +726,9 @@ msgstr "X-"
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "XY Bewegungsgeschwindigkeit (mm/s)" msgstr "XY Bewegungsgeschwindigkeit (mm/s)"
msgid "XY Speed (mm/s)"
msgstr "XY Geschwindigkeit (mm/s)"
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr "Y+"
@@ -619,12 +741,15 @@ msgstr "Höhe Kalibrieren"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "Z Bewegungsgeschwindigkeit (mm/s)" msgstr "Z Bewegungsgeschwindigkeit (mm/s)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "Z-Position" msgstr "Z Geschwindigkeit (mm/s)"
msgid "Z Tilt" msgid "Z Tilt"
msgstr "Z-Achse ausrichten" msgstr "Z-Achse ausrichten"
msgid "Z offset:"
msgstr "Z Offset:"
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr "Z+"
@@ -653,8 +778,17 @@ msgstr "mm"
msgid "mm/s" msgid "mm/s"
msgstr "mm/s" msgstr "mm/s"
msgid "mm/s^2" msgid "mm/s²"
msgstr "mm/s^2" msgstr "mm/s²"
#~ msgid "Tool"
#~ msgstr "Druckkopf"
#~ msgid "Displayed Macros"
#~ msgstr "Aktive Macros"
#~ msgid "Z Position"
#~ msgstr "Z-Position"
#~ msgid "IPv4" #~ msgid "IPv4"
#~ msgstr "IPv4" #~ msgstr "IPv4"
@@ -662,9 +796,6 @@ msgstr "mm/s^2"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Z Offset"
#~ msgstr "Z Offset"
#~ msgid "Unknown Heater " #~ msgid "Unknown Heater "
#~ msgstr "Unbekannte Heizung " #~ msgstr "Unbekannte Heizung "
@@ -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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-0300\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@@ -26,9 +26,15 @@ msgstr ""
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "" msgstr ""
msgid "ADXL Not Configured"
msgstr ""
msgid "Abort" msgid "Abort"
msgstr "" msgstr ""
msgid "Acceleration:"
msgstr ""
msgid "Accept" msgid "Accept"
msgstr "" msgstr ""
@@ -41,6 +47,17 @@ msgstr ""
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "" msgstr ""
msgid "Apply"
msgstr ""
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr ""
#, python-format
msgid "Apply %s%.2f offset to Probe?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "" msgstr ""
@@ -59,6 +76,9 @@ msgstr ""
msgid "Auto" msgid "Auto"
msgstr "" msgstr ""
msgid "Auto-calibrate"
msgstr ""
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "" msgstr ""
@@ -74,9 +94,15 @@ msgstr ""
msgid "Calibrate" msgid "Calibrate"
msgstr "" msgstr ""
msgid "Calibrated"
msgstr ""
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "" msgstr ""
msgid "Calibrating..."
msgstr ""
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "" msgstr ""
@@ -103,6 +129,12 @@ msgid ""
"Please submit an issue on GitHub for help." "Please submit an issue on GitHub for help."
msgstr "" msgstr ""
msgid "Check ADXL Wiring"
msgstr ""
msgid "Clear"
msgstr ""
msgid "Close" msgid "Close"
msgstr "" msgstr ""
@@ -149,9 +181,6 @@ msgstr ""
msgid "Disable XY" msgid "Disable XY"
msgstr "" msgstr ""
msgid "Displayed Macros"
msgstr ""
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "" msgstr ""
@@ -186,9 +215,24 @@ msgstr ""
msgid "Filament Used" msgid "Filament Used"
msgstr "" msgstr ""
msgid "Filament total:"
msgstr ""
msgid "Filament used:"
msgstr ""
msgid "Filament:"
msgstr ""
msgid "File" msgid "File"
msgstr "" msgstr ""
msgid "File:"
msgstr ""
msgid "Finding ADXL"
msgstr ""
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "" msgstr ""
@@ -200,6 +244,12 @@ msgid ""
"Restart" "Restart"
msgstr "" msgstr ""
msgid "Flow:"
msgstr ""
msgid "Flowrate:"
msgstr ""
msgid "Font Size" msgid "Font Size"
msgstr "" msgstr ""
@@ -211,6 +261,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "" msgstr ""
msgid "Height:"
msgstr ""
msgid "Hidden" msgid "Hidden"
msgstr "" msgstr ""
@@ -220,6 +273,9 @@ msgstr ""
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "" msgstr ""
msgid "Hide temp."
msgstr ""
msgid "Home" msgid "Home"
msgstr "" msgstr ""
@@ -256,6 +312,9 @@ msgstr ""
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "" msgstr ""
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "" msgstr ""
@@ -297,6 +356,9 @@ msgstr ""
msgid "Large" msgid "Large"
msgstr "" msgstr ""
msgid "Layer:"
msgstr ""
msgid "Left:" msgid "Left:"
msgstr "" msgstr ""
@@ -318,7 +380,10 @@ msgstr ""
msgid "Main Menu" msgid "Main Menu"
msgstr "" msgstr ""
msgid "Max Accelation" msgid "Max"
msgstr ""
msgid "Max Acceleration"
msgstr "" msgstr ""
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
@@ -327,6 +392,15 @@ msgstr ""
msgid "Max Velocity" msgid "Max Velocity"
msgstr "" msgstr ""
msgid "Measure Both"
msgstr ""
msgid "Measure X"
msgstr ""
msgid "Measure Y"
msgstr ""
msgid "Medium" msgid "Medium"
msgstr "" msgstr ""
@@ -351,6 +425,9 @@ msgstr ""
msgid "Network" msgid "Network"
msgstr "" msgstr ""
msgid "New"
msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "" msgstr ""
@@ -369,6 +446,9 @@ msgid_plural "Packages will be updated"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "" msgstr ""
@@ -381,6 +461,9 @@ msgstr ""
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "" msgstr ""
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "" msgstr ""
@@ -390,6 +473,9 @@ msgstr ""
msgid "Power On Printer" msgid "Power On Printer"
msgstr "" msgstr ""
msgid "Pressure Advance:"
msgstr ""
msgid "Print" msgid "Print"
msgstr "" msgstr ""
@@ -405,6 +491,9 @@ msgstr ""
msgid "Printing" msgid "Printing"
msgstr "" msgstr ""
msgid "Probe Offset"
msgstr ""
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "" msgstr ""
@@ -435,17 +524,39 @@ msgstr ""
msgid "Retract" msgid "Retract"
msgstr "" msgstr ""
msgid "Retraction"
msgstr ""
msgid "Retraction Length"
msgstr ""
msgid "Retraction Speed"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "" msgstr ""
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "" msgstr ""
msgid "Save Config" msgid "Save Config"
msgstr "" msgstr ""
msgid "Save configuration" msgid "Save Z"
msgstr ""
msgid "Save configuration?"
msgstr ""
msgid "Saved"
msgstr ""
#, python-format
msgid "Saved offset: %s"
msgstr "" msgstr ""
msgid "Screen DPMS" msgid "Screen DPMS"
@@ -485,12 +596,18 @@ msgstr ""
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "" msgstr ""
msgid "Slicer:"
msgstr ""
msgid "Small" msgid "Small"
msgstr "" msgstr ""
msgid "Sort by: " msgid "Sort by: "
msgstr "" msgstr ""
msgid "Sort:"
msgstr ""
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "" msgstr ""
@@ -500,6 +617,9 @@ msgstr ""
msgid "Speed -" msgid "Speed -"
msgstr "" msgstr ""
msgid "Speed:"
msgstr ""
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "" msgstr ""
@@ -538,9 +658,6 @@ msgstr ""
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "" msgstr ""
msgid "Tool"
msgstr ""
msgid "Total:" msgid "Total:"
msgstr "" msgstr ""
@@ -550,6 +667,12 @@ msgstr ""
msgid "Unload" msgid "Unload"
msgstr "" msgstr ""
msgid "Unretract Extra Length"
msgstr ""
msgid "Unretract Speed"
msgstr ""
msgid "Up To Date" msgid "Up To Date"
msgstr "" msgstr ""
@@ -574,6 +697,9 @@ msgstr ""
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "" msgstr ""
msgid "XY Speed (mm/s)"
msgstr ""
msgid "Y+" msgid "Y+"
msgstr "" msgstr ""
@@ -586,12 +712,15 @@ msgstr ""
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "" msgstr ""
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "" msgstr ""
msgid "Z Tilt" msgid "Z Tilt"
msgstr "" msgstr ""
msgid "Z offset:"
msgstr ""
msgid "Z+" msgid "Z+"
msgstr "" msgstr ""
@@ -620,5 +749,5 @@ msgstr ""
msgid "mm/s" msgid "mm/s"
msgstr "" msgstr ""
msgid "mm/s^2" msgid "mm/s²"
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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-0300\n"
"PO-Revision-Date: 2022-03-31 10:46-0300\n" "PO-Revision-Date: 2022-06-02 13:54-0300\n"
"Last-Translator: alfrix\n" "Last-Translator: alfrix\n"
"Language-Team: \n" "Language-Team: \n"
"Language: es\n" "Language: es\n"
@@ -31,9 +31,15 @@ msgstr "Formato 24 Horas"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "Un FIRMWARE_RESTART puede solucionar el problema." msgstr "Un FIRMWARE_RESTART puede solucionar el problema."
msgid "ADXL Not Configured"
msgstr "ADXL No Configurado"
msgid "Abort" msgid "Abort"
msgstr "Cancelar" msgstr "Cancelar"
msgid "Acceleration:"
msgstr "Aceleración:"
msgid "Accept" msgid "Accept"
msgstr "Aceptar" msgstr "Aceptar"
@@ -46,6 +52,17 @@ msgstr "Agregar impresora"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "Agregar pefil de malla de cama" msgstr "Agregar pefil de malla de cama"
msgid "Apply"
msgstr "Aplicar"
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr "Aplicar %.2f desfase al final de carrera?"
#, python-format
msgid "Apply %s%.2f offset to Probe?"
msgstr "Aplicar %s%.2f desfase al sensor?"
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?"
@@ -64,6 +81,9 @@ msgstr "Está seguro que desea apagar el sistema?"
msgid "Auto" msgid "Auto"
msgstr "Auto" msgstr "Auto"
msgid "Auto-calibrate"
msgstr "Auto-Calibrar"
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "Auto-scroll" msgstr "Auto-scroll"
@@ -79,9 +99,15 @@ msgstr "Encontrado Bltouch aplicado desfase"
msgid "Calibrate" msgid "Calibrate"
msgstr "Calibrar" msgstr "Calibrar"
msgid "Calibrated"
msgstr "Calibrado"
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "Calibrado, guarde su configuración para hacerlo permanente" msgstr "Calibrado, guarde su configuración para hacerlo permanente"
msgid "Calibrating..."
msgstr "Calibrando..."
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "Error: Valor sobre el máximo:" msgstr "Error: Valor sobre el máximo:"
@@ -110,6 +136,12 @@ msgstr ""
"Revise /tmp/KlipperScreen.log para mas información.\n" "Revise /tmp/KlipperScreen.log para mas información.\n"
"Por favor crear un 'issue' en GitHub para ser ayudado." "Por favor crear un 'issue' en GitHub para ser ayudado."
msgid "Check ADXL Wiring"
msgstr "Verificar cableado del ADXL"
msgid "Clear"
msgstr "Limpiar"
msgid "Close" msgid "Close"
msgstr "Cerrar" msgstr "Cerrar"
@@ -156,9 +188,6 @@ msgstr "Desactivar Motores"
msgid "Disable XY" msgid "Disable XY"
msgstr "Desactivar XY" msgstr "Desactivar XY"
msgid "Displayed Macros"
msgstr "Macros mostrados"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "Distancia (mm)" msgstr "Distancia (mm)"
@@ -167,7 +196,7 @@ msgid "Do you want to recover %s?"
msgstr "Desea recuperar %s?" msgstr "Desea recuperar %s?"
msgid "Elapsed:" msgid "Elapsed:"
msgstr "Tiempo:" msgstr "Transcurrido:"
msgid "Error" msgid "Error"
msgstr "Error" msgstr "Error"
@@ -193,9 +222,24 @@ msgstr "Ventilador"
msgid "Filament Used" msgid "Filament Used"
msgstr "Filamento Usado" msgstr "Filamento Usado"
msgid "Filament total:"
msgstr "Filamento total:"
msgid "Filament used:"
msgstr "Filamento usado:"
msgid "Filament:"
msgstr "Filamento:"
msgid "File" msgid "File"
msgstr "Archivo" msgstr "Archivo"
msgid "File:"
msgstr "Archivo:"
msgid "Finding ADXL"
msgstr "Buscando ADXL"
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "Ajuste Fino" msgstr "Ajuste Fino"
@@ -209,6 +253,12 @@ msgstr ""
"Reiniciar\n" "Reiniciar\n"
"Firmware" "Firmware"
msgid "Flow:"
msgstr "Flujo:"
msgid "Flowrate:"
msgstr "Flujo:"
msgid "Font Size" msgid "Font Size"
msgstr "Tamaño del texto" msgstr "Tamaño del texto"
@@ -222,6 +272,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "Volver" msgstr "Volver"
msgid "Height:"
msgstr "Alto:"
msgid "Hidden" msgid "Hidden"
msgstr "Oculto" msgstr "Oculto"
@@ -231,6 +284,9 @@ msgstr "Ocultar"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "Ocultar sensores en Temp." msgstr "Ocultar sensores en Temp."
msgid "Hide temp."
msgstr "Ocultar temp."
msgid "Home" msgid "Home"
msgstr "Inicio" msgstr "Inicio"
@@ -267,6 +323,9 @@ msgstr "Iniciando"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "Iniciando Impresora..." msgstr "Iniciando Impresora..."
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "Interfaz" msgstr "Interfaz"
@@ -310,6 +369,9 @@ msgstr "Idioma"
msgid "Large" msgid "Large"
msgstr "Grande" msgstr "Grande"
msgid "Layer:"
msgstr "Capa:"
msgid "Left:" msgid "Left:"
msgstr "Restante:" msgstr "Restante:"
@@ -331,8 +393,11 @@ msgstr "Macros"
msgid "Main Menu" msgid "Main Menu"
msgstr "Menú" msgstr "Menú"
msgid "Max Accelation" msgid "Max"
msgstr "Max. Aceleración" msgstr ""
msgid "Max Acceleration"
msgstr "Aceleración Max."
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
msgstr "Max. Aceleración a Desaceleración" msgstr "Max. Aceleración a Desaceleración"
@@ -340,6 +405,15 @@ msgstr "Max. Aceleración a Desaceleración"
msgid "Max Velocity" msgid "Max Velocity"
msgstr "Max. Velocidad" msgstr "Max. Velocidad"
msgid "Measure Both"
msgstr "Medir Ambos"
msgid "Measure X"
msgstr "Medir X"
msgid "Measure Y"
msgstr "Medir Y"
msgid "Medium" msgid "Medium"
msgstr "Medio" msgstr "Medio"
@@ -364,6 +438,9 @@ msgstr "Nombre"
msgid "Network" msgid "Network"
msgstr "Red" msgstr "Red"
msgid "New"
msgstr "Nuevo"
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Nada seleccionado" msgstr "Nada seleccionado"
@@ -382,6 +459,9 @@ msgid_plural "Packages will be updated"
msgstr[0] "Paquete será actualizado" msgstr[0] "Paquete será actualizado"
msgstr[1] "Paquetes serán actualizados" msgstr[1] "Paquetes serán actualizados"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "Contraseña guardada" msgstr "Contraseña guardada"
@@ -392,7 +472,10 @@ msgid "Paused"
msgstr "Pausado" msgstr "Pausado"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr " ¿Actualizar Todo?" msgstr "¿Actualizar Todo?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "Por favor recompile y flashee el micro-controlador." msgstr "Por favor recompile y flashee el micro-controlador."
@@ -403,6 +486,9 @@ msgstr "Energía"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "Encender Impresora" msgstr "Encender Impresora"
msgid "Pressure Advance:"
msgstr "Avance de presión:"
msgid "Print" msgid "Print"
msgstr "Imprimir" msgstr "Imprimir"
@@ -418,6 +504,9 @@ msgstr "Conexiones a impresoras"
msgid "Printing" msgid "Printing"
msgstr "Imprimiendo" msgstr "Imprimiendo"
msgid "Probe Offset"
msgstr "Desfase del sensor"
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "Encontrado Probe aplicado desfase" msgstr "Encontrado Probe aplicado desfase"
@@ -448,18 +537,40 @@ msgstr "Continuar"
msgid "Retract" msgid "Retract"
msgstr "Retraer" msgstr "Retraer"
msgid "Retraction"
msgstr "Retracción"
msgid "Retraction Length"
msgstr "Largo de Retracción"
msgid "Retraction Speed"
msgstr "Velocidad de Retracción"
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Intento #%s" msgstr "Intento #%s"
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "Guardar" msgstr "Guardar"
msgid "Save Config" msgid "Save Config"
msgstr "Guardar Config" msgstr "Guardar Config"
msgid "Save configuration" msgid "Save Z"
msgstr "Guardar Configuración" msgstr "Guardar Z"
msgid "Save configuration?"
msgstr "Guardar Configuración?"
msgid "Saved"
msgstr "Guardado"
#, python-format
msgid "Saved offset: %s"
msgstr "Desfase Guardado: %s"
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "Pantalla DPMS" msgstr "Pantalla DPMS"
@@ -498,12 +609,18 @@ msgstr "Slicer"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "Corrección del tiempo del Slicer (%)" msgstr "Corrección del tiempo del Slicer (%)"
msgid "Slicer:"
msgstr "Slicer:"
msgid "Small" msgid "Small"
msgstr "Pequeño" msgstr "Pequeño"
msgid "Sort by: " msgid "Sort by: "
msgstr "Ordenar por: " msgstr "Ordenar por: "
msgid "Sort:"
msgstr "Ordenar:"
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "Velocidad (mm/s)" msgstr "Velocidad (mm/s)"
@@ -513,6 +630,9 @@ msgstr "Velocidad +"
msgid "Speed -" msgid "Speed -"
msgstr "Velocidad -" msgstr "Velocidad -"
msgid "Speed:"
msgstr "Velocidad:"
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "Velocidad de esquina" msgstr "Velocidad de esquina"
@@ -555,9 +675,6 @@ msgstr "Temperatura"
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Para aplicar %s KlipperScreen necesita reiniciarse" msgstr "Para aplicar %s KlipperScreen necesita reiniciarse"
msgid "Tool"
msgstr "Herrmienta"
msgid "Total:" msgid "Total:"
msgstr "Total:" msgstr "Total:"
@@ -567,6 +684,12 @@ msgstr "Calentador Desconocido"
msgid "Unload" msgid "Unload"
msgstr "Descargar" msgstr "Descargar"
msgid "Unretract Extra Length"
msgstr "Distancia extra al desretraer"
msgid "Unretract Speed"
msgstr "Velocidad de Desretracción"
msgid "Up To Date" msgid "Up To Date"
msgstr "Actualizado" msgstr "Actualizado"
@@ -591,6 +714,9 @@ msgstr "X-"
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "Velocidad XY (mm/s)" msgstr "Velocidad XY (mm/s)"
msgid "XY Speed (mm/s)"
msgstr "XY Velocidad (mm/s)"
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr "Y+"
@@ -603,12 +729,15 @@ msgstr "Calibrar Z"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "Velocidad Z (mm/s)" msgstr "Velocidad Z (mm/s)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "Posición Z" msgstr "Z Velocidad (mm/s)"
msgid "Z Tilt" msgid "Z Tilt"
msgstr "Inclinación Z" msgstr "Inclinación Z"
msgid "Z offset:"
msgstr "Desfase Z:"
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr "Z+"
@@ -637,8 +766,17 @@ msgstr "mm"
msgid "mm/s" msgid "mm/s"
msgstr "mm/s" msgstr "mm/s"
msgid "mm/s^2" msgid "mm/s²"
msgstr "mm/s^2" msgstr "mm/s²"
#~ msgid "Tool"
#~ msgstr "Herrmienta"
#~ msgid "Displayed Macros"
#~ msgstr "Macros mostrados"
#~ msgid "Z Position"
#~ msgstr "Posición Z"
#~ msgid "IPv4" #~ msgid "IPv4"
#~ msgstr "IPv4" #~ msgstr "IPv4"
@@ -646,9 +784,6 @@ msgstr "mm/s^2"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Z Offset"
#~ msgstr "Desfase Z"
#~ msgid "Unknown Heater " #~ msgid "Unknown Heater "
#~ msgstr "Calentador Desconocido " #~ msgstr "Calentador Desconocido "
@@ -717,9 +852,6 @@ msgstr "mm/s^2"
#~ msgid "Fast" #~ msgid "Fast"
#~ msgstr "Rápido" #~ msgstr "Rápido"
#~ msgid "Set Speed"
#~ msgstr "Establecer"
#~ msgid "Slow" #~ msgid "Slow"
#~ msgstr "Lento" #~ msgstr "Lento"
@@ -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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-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"
@@ -31,9 +31,15 @@ msgstr "Format 24 heures"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "Un FIRMWARE_RESTART peut résoudre le problème." msgstr "Un FIRMWARE_RESTART peut résoudre le problème."
msgid "ADXL Not Configured"
msgstr ""
msgid "Abort" msgid "Abort"
msgstr "Annuler" msgstr "Annuler"
msgid "Acceleration:"
msgstr "Accélération:"
msgid "Accept" msgid "Accept"
msgstr "Accepter" msgstr "Accepter"
@@ -46,6 +52,17 @@ msgstr "Ajouter une imprimante"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "Ajouter un profil de maillage" msgstr "Ajouter un profil de maillage"
msgid "Apply"
msgstr ""
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr ""
#, python-format
msgid "Apply %s%.2f offset to Probe?"
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?"
@@ -64,6 +81,9 @@ msgstr "Êtes-vous sûr de vouloir arrêter le système?"
msgid "Auto" msgid "Auto"
msgstr "Auto" msgstr "Auto"
msgid "Auto-calibrate"
msgstr "Calibrage automatique"
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "Auto-scroll" msgstr "Auto-scroll"
@@ -79,9 +99,15 @@ msgstr "Bltouch a trouvé le décalage appliqué"
msgid "Calibrate" msgid "Calibrate"
msgstr "Étalonner" msgstr "Étalonner"
msgid "Calibrated"
msgstr "Calibré"
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "Calibré, enregistrez la configuration pour la rendre permanente" msgstr "Calibré, enregistrez la configuration pour la rendre permanente"
msgid "Calibrating..."
msgstr "Calibrage..."
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "Impossible de définir au-dessus du maximum:" msgstr "Impossible de définir au-dessus du maximum:"
@@ -110,6 +136,12 @@ msgstr ""
"Vérifiez /tmp/KlipperScreen.log pour plus d'informations.\n" "Vérifiez /tmp/KlipperScreen.log pour plus d'informations.\n"
"SVP envoyez une requête sur GitHub pour obtenir de l'aide." "SVP envoyez une requête sur GitHub pour obtenir de l'aide."
msgid "Check ADXL Wiring"
msgstr ""
msgid "Clear"
msgstr ""
msgid "Close" msgid "Close"
msgstr "Fermer" msgstr "Fermer"
@@ -156,9 +188,6 @@ msgstr "Désactiver les moteurs"
msgid "Disable XY" msgid "Disable XY"
msgstr "Désactiver XY" msgstr "Désactiver XY"
msgid "Displayed Macros"
msgstr "Macros affichées"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "Distance (mm)" msgstr "Distance (mm)"
@@ -193,9 +222,24 @@ msgstr "Ventilateur"
msgid "Filament Used" msgid "Filament Used"
msgstr "Filament utilisé" msgstr "Filament utilisé"
msgid "Filament total:"
msgstr "Total de filaments:"
msgid "Filament used:"
msgstr "Filament utilisé:"
msgid "Filament:"
msgstr "Filament:"
msgid "File" msgid "File"
msgstr "Fichier" msgstr "Fichier"
msgid "File:"
msgstr "Fichier:"
msgid "Finding ADXL"
msgstr ""
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "Réglages fins" msgstr "Réglages fins"
@@ -209,6 +253,12 @@ msgstr ""
"Micrologiciel\n" "Micrologiciel\n"
"Redémarrage" "Redémarrage"
msgid "Flow:"
msgstr ""
msgid "Flowrate:"
msgstr ""
msgid "Font Size" msgid "Font Size"
msgstr "Taille de police" msgstr "Taille de police"
@@ -222,6 +272,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "Retourner" msgstr "Retourner"
msgid "Height:"
msgstr ""
msgid "Hidden" msgid "Hidden"
msgstr "Caché" msgstr "Caché"
@@ -231,6 +284,9 @@ msgstr "Cacher"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "Masquer les capteurs dans Temp." msgstr "Masquer les capteurs dans Temp."
msgid "Hide temp."
msgstr ""
msgid "Home" msgid "Home"
msgstr "Accueil" msgstr "Accueil"
@@ -267,6 +323,9 @@ msgstr "Initialisation"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "Démarrage de l'imprimante..." msgstr "Démarrage de l'imprimante..."
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "Interface" msgstr "Interface"
@@ -310,6 +369,9 @@ msgstr "Langue"
msgid "Large" msgid "Large"
msgstr "Grand" msgstr "Grand"
msgid "Layer:"
msgstr ""
msgid "Left:" msgid "Left:"
msgstr "Restant:" msgstr "Restant:"
@@ -331,8 +393,11 @@ msgstr "Macros"
msgid "Main Menu" msgid "Main Menu"
msgstr "Menu principal" msgstr "Menu principal"
msgid "Max Accelation" msgid "Max"
msgstr "Accélération maximale" msgstr ""
msgid "Max Acceleration"
msgstr "Accélération Max"
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
msgstr "Accélération maximale à décélération" msgstr "Accélération maximale à décélération"
@@ -340,6 +405,15 @@ msgstr "Accélération maximale à décélération"
msgid "Max Velocity" msgid "Max Velocity"
msgstr "Vélocité maximale" msgstr "Vélocité maximale"
msgid "Measure Both"
msgstr ""
msgid "Measure X"
msgstr ""
msgid "Measure Y"
msgstr ""
msgid "Medium" msgid "Medium"
msgstr "Moyen" msgstr "Moyen"
@@ -364,6 +438,9 @@ msgstr "Nom"
msgid "Network" msgid "Network"
msgstr "Réseau" msgstr "Réseau"
msgid "New"
msgstr "Nouveau"
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Rien de sélectionné" msgstr "Rien de sélectionné"
@@ -382,6 +459,9 @@ msgid_plural "Packages will be updated"
msgstr[0] "Le paquet sera mis à jour" msgstr[0] "Le paquet sera mis à jour"
msgstr[1] "Forfaits seront mis à jour" msgstr[1] "Forfaits seront mis à jour"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "Mot de passe enregistré" msgstr "Mot de passe enregistré"
@@ -394,6 +474,9 @@ msgstr "En pause"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "Effectuer une mise à jour complète ?" msgstr "Effectuer une mise à jour complète ?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "Veuillez recompiler et flasher le microcontrôleur." msgstr "Veuillez recompiler et flasher le microcontrôleur."
@@ -403,6 +486,9 @@ msgstr "Alimentation"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "Allumer l'imprimante" msgstr "Allumer l'imprimante"
msgid "Pressure Advance:"
msgstr ""
msgid "Print" msgid "Print"
msgstr "Imprimer" msgstr "Imprimer"
@@ -418,6 +504,9 @@ msgstr "Connexions aux imprimantes"
msgid "Printing" msgid "Printing"
msgstr "Impression" msgstr "Impression"
msgid "Probe Offset"
msgstr ""
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "Probe a trouvé le décalage appliqué" msgstr "Probe a trouvé le décalage appliqué"
@@ -448,18 +537,40 @@ msgstr "Reprendre"
msgid "Retract" msgid "Retract"
msgstr "Rétracter" msgstr "Rétracter"
msgid "Retraction"
msgstr "Rétraction"
msgid "Retraction Length"
msgstr "Longueur de rétraction"
msgid "Retraction Speed"
msgstr "Vitesse de rétraction"
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Réessayez #%s" msgstr "Réessayez #%s"
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "Enregistrer" msgstr "Enregistrer"
msgid "Save Config" msgid "Save Config"
msgstr "Enregistrer la config" msgstr "Enregistrer la config"
msgid "Save configuration" msgid "Save Z"
msgstr "Enregistrer la configuration" msgstr "Enregistrer Z"
msgid "Save configuration?"
msgstr "Enregistrer la configuration?"
msgid "Saved"
msgstr "Enregistré"
#, python-format
msgid "Saved offset: %s"
msgstr ""
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "Écran DPMS" msgstr "Écran DPMS"
@@ -498,12 +609,18 @@ msgstr "Trancheur"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "Correction du temps de trancheuse (%)" msgstr "Correction du temps de trancheuse (%)"
msgid "Slicer:"
msgstr ""
msgid "Small" msgid "Small"
msgstr "Petit" msgstr "Petit"
msgid "Sort by: " msgid "Sort by: "
msgstr "Trier par: " msgstr "Trier par: "
msgid "Sort:"
msgstr "Trier:"
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "Vitesse de déplacement (mm/s)" msgstr "Vitesse de déplacement (mm/s)"
@@ -513,6 +630,9 @@ msgstr "Vitesse +"
msgid "Speed -" msgid "Speed -"
msgstr "Vitesse -" msgstr "Vitesse -"
msgid "Speed:"
msgstr "Vitesse:"
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "Vélocité des angles droits" msgstr "Vélocité des angles droits"
@@ -553,9 +673,6 @@ msgstr "Température"
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Pour appliquer %s KlipperScreen doit être redémarré" msgstr "Pour appliquer %s KlipperScreen doit être redémarré"
msgid "Tool"
msgstr "Outil"
msgid "Total:" msgid "Total:"
msgstr "Total:" msgstr "Total:"
@@ -565,13 +682,18 @@ msgstr "Chauffage inconnu"
msgid "Unload" msgid "Unload"
msgstr "Décharger" msgstr "Décharger"
msgid "Unretract Extra Length"
msgstr ""
msgid "Unretract Speed"
msgstr ""
msgid "Up To Date" msgid "Up To Date"
msgstr "À jour" msgstr "À jour"
msgid "Update" msgid "Update"
msgstr "Mise à jour" msgstr "Mise à jour"
#, fuzzy
msgid "Updating" msgid "Updating"
msgstr "Mise à jour" msgstr "Mise à jour"
@@ -590,6 +712,9 @@ msgstr "X-"
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "Vitesse de déplacement XY (mm/s)" msgstr "Vitesse de déplacement XY (mm/s)"
msgid "XY Speed (mm/s)"
msgstr "Vitesse XY (mm/s)"
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr "Y+"
@@ -602,12 +727,15 @@ msgstr "Calibration Z"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "Vitesse de déplacement Z (mm/s)" msgstr "Vitesse de déplacement Z (mm/s)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "Position Z" msgstr "Vitesse Z (mm/s)"
msgid "Z Tilt" msgid "Z Tilt"
msgstr "Z Tilt" msgstr "Z Tilt"
msgid "Z offset:"
msgstr "Décalage Z"
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr "Z+"
@@ -636,8 +764,17 @@ msgstr "mm"
msgid "mm/s" msgid "mm/s"
msgstr "mm/s" msgstr "mm/s"
msgid "mm/s^2" msgid "mm/s²"
msgstr "mm/s^2" msgstr "mm/s²"
#~ msgid "Tool"
#~ msgstr "Outil"
#~ msgid "Displayed Macros"
#~ msgstr "Macros affichées"
#~ msgid "Z Position"
#~ msgstr "Position Z"
#~ msgid "IPv4" #~ msgid "IPv4"
#~ msgstr "IPv4" #~ msgstr "IPv4"
@@ -645,9 +782,6 @@ msgstr "mm/s^2"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Z Offset"
#~ msgstr "Décalage Z"
#~ msgid "Unknown Heater " #~ msgid "Unknown Heater "
#~ msgstr "Chauffage inconnu " #~ msgstr "Chauffage inconnu "
@@ -716,9 +850,6 @@ msgstr "mm/s^2"
#~ msgid "Fast" #~ msgid "Fast"
#~ msgstr "Rapide" #~ msgstr "Rapide"
#~ msgid "Set Speed"
#~ msgstr "Définir"
#~ msgid "Slow" #~ msgid "Slow"
#~ msgstr "Lent" #~ msgstr "Lent"
@@ -749,9 +880,6 @@ msgstr "mm/s^2"
#~ msgid "Fan -" #~ msgid "Fan -"
#~ msgstr "Ventilateur-" #~ msgstr "Ventilateur-"
#~ msgid "Speed"
#~ msgstr "Vitesse"
#~ msgid "System Information" #~ msgid "System Information"
#~ msgstr "Info systeme" #~ msgstr "Info systeme"
@@ -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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-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: Emanuel Sharvit <manu7irl@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@@ -33,9 +33,15 @@ msgstr "זמן 24 שעות"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "FIRMWARE_RESTART עשוי לפתור את הבעיה." msgstr "FIRMWARE_RESTART עשוי לפתור את הבעיה."
msgid "ADXL Not Configured"
msgstr ""
msgid "Abort" msgid "Abort"
msgstr "בטל" msgstr "בטל"
msgid "Acceleration:"
msgstr ""
msgid "Accept" msgid "Accept"
msgstr "אשר" msgstr "אשר"
@@ -48,6 +54,17 @@ msgstr "הוסף מדפסת"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "הוסף פרופיל רשת למיטה" msgstr "הוסף פרופיל רשת למיטה"
msgid "Apply"
msgstr ""
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr ""
#, python-format
msgid "Apply %s%.2f offset to Probe?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "" msgstr ""
"האם אתה בטוח שברצונך להדפיסהאם אתה בטוח שברצונך להפעיל את עצירת החירום?" "האם אתה בטוח שברצונך להדפיסהאם אתה בטוח שברצונך להפעיל את עצירת החירום?"
@@ -67,6 +84,9 @@ msgstr "האם אתה בטוח שברצונך לסגור את המערכת?"
msgid "Auto" msgid "Auto"
msgstr "אוטומטי" msgstr "אוטומטי"
msgid "Auto-calibrate"
msgstr ""
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "גלילה אוטומטית" msgstr "גלילה אוטומטית"
@@ -82,9 +102,15 @@ msgstr "Bltouch נמצא היסט מוחל"
msgid "Calibrate" msgid "Calibrate"
msgstr "לְדַרֵג" msgstr "לְדַרֵג"
msgid "Calibrated"
msgstr ""
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "מכויל, שמור את התצורה כדי שהיא תהיה קבועה" msgstr "מכויל, שמור את התצורה כדי שהיא תהיה קבועה"
msgid "Calibrating..."
msgstr ""
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "לא ניתן להגדיר מעל המקסימום:" msgstr "לא ניתן להגדיר מעל המקסימום:"
@@ -113,6 +139,12 @@ msgstr ""
"בדוק KlipperScreen.log, בתיקית tmp ליותר פרטים.\n" "בדוק KlipperScreen.log, בתיקית tmp ליותר פרטים.\n"
"אנא שלח דוח תקלה ב- GITHUB, לעזרה." "אנא שלח דוח תקלה ב- GITHUB, לעזרה."
msgid "Check ADXL Wiring"
msgstr ""
msgid "Clear"
msgstr ""
msgid "Close" msgid "Close"
msgstr "סגור" msgstr "סגור"
@@ -159,9 +191,6 @@ msgstr "השבת מנועים"
msgid "Disable XY" msgid "Disable XY"
msgstr "השבת את XY" msgstr "השבת את XY"
msgid "Displayed Macros"
msgstr "מוצגים מאקרו"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "מרחק (מ\"מ)" msgstr "מרחק (מ\"מ)"
@@ -196,9 +225,24 @@ msgstr "מאוורר"
msgid "Filament Used" msgid "Filament Used"
msgstr "נימה בשימוש" msgstr "נימה בשימוש"
msgid "Filament total:"
msgstr ""
msgid "Filament used:"
msgstr ""
msgid "Filament:"
msgstr ""
msgid "File" msgid "File"
msgstr "קוֹבֶץ" msgstr "קוֹבֶץ"
msgid "File:"
msgstr ""
msgid "Finding ADXL"
msgstr ""
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "כוונון עדין" msgstr "כוונון עדין"
@@ -212,6 +256,12 @@ msgstr ""
"קושחה\n" "קושחה\n"
"איתחול" "איתחול"
msgid "Flow:"
msgstr ""
msgid "Flowrate:"
msgstr ""
msgid "Font Size" msgid "Font Size"
msgstr "גודל טקסט" msgstr "גודל טקסט"
@@ -225,6 +275,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "חזרה" msgstr "חזרה"
msgid "Height:"
msgstr ""
msgid "Hidden" msgid "Hidden"
msgstr "מוּסתָר" msgstr "מוּסתָר"
@@ -234,6 +287,9 @@ msgstr "להתחבא"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "הסתר חיישנים בטמפ'." msgstr "הסתר חיישנים בטמפ'."
msgid "Hide temp."
msgstr ""
msgid "Home" msgid "Home"
msgstr "איפוס" msgstr "איפוס"
@@ -270,6 +326,9 @@ msgstr "מאתחל"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "מאתחל מדפסת..." msgstr "מאתחל מדפסת..."
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "מִמְשָׁק" msgstr "מִמְשָׁק"
@@ -313,6 +372,9 @@ msgstr "שפה"
msgid "Large" msgid "Large"
msgstr "גָדוֹל" msgstr "גָדוֹל"
msgid "Layer:"
msgstr ""
msgid "Left:" msgid "Left:"
msgstr "זמן שנותר:" msgstr "זמן שנותר:"
@@ -334,8 +396,11 @@ msgstr "מקרואים"
msgid "Main Menu" msgid "Main Menu"
msgstr "תפריט ראשי" msgstr "תפריט ראשי"
msgid "Max Accelation" msgid "Max"
msgstr "האצה מרבית" msgstr ""
msgid "Max Acceleration"
msgstr ""
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
msgstr "האצה מרבית להאטה" msgstr "האצה מרבית להאטה"
@@ -343,6 +408,15 @@ msgstr "האצה מרבית להאטה"
msgid "Max Velocity" msgid "Max Velocity"
msgstr "מהירות מרבית" msgstr "מהירות מרבית"
msgid "Measure Both"
msgstr ""
msgid "Measure X"
msgstr ""
msgid "Measure Y"
msgstr ""
msgid "Medium" msgid "Medium"
msgstr "ממוצע" msgstr "ממוצע"
@@ -367,6 +441,9 @@ msgstr "שֵׁם"
msgid "Network" msgid "Network"
msgstr "רשת" msgstr "רשת"
msgid "New"
msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "שום דבר לא נבחר" msgstr "שום דבר לא נבחר"
@@ -387,6 +464,9 @@ msgstr[1] "חבילות יעודכנו"
msgstr[2] "חבילות יעודכנו" msgstr[2] "חבילות יעודכנו"
msgstr[3] "חבילות יעודכנו" msgstr[3] "חבילות יעודכנו"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "הסיסמה נשמרה" msgstr "הסיסמה נשמרה"
@@ -399,6 +479,9 @@ msgstr "מושהה"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "לבצע שדרוג מלא?" msgstr "לבצע שדרוג מלא?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "אנא הידור מחדש והבזק את המיקרו-בקר." msgstr "אנא הידור מחדש והבזק את המיקרו-בקר."
@@ -408,6 +491,9 @@ msgstr "הפעלה"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "הפעל מדפסת" msgstr "הפעל מדפסת"
msgid "Pressure Advance:"
msgstr ""
msgid "Print" msgid "Print"
msgstr "הדפס" msgstr "הדפס"
@@ -423,6 +509,9 @@ msgstr "חיבורי מדפסת"
msgid "Printing" msgid "Printing"
msgstr "מדפיס" msgstr "מדפיס"
msgid "Probe Offset"
msgstr ""
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "Probe נמצא היסט מוחל" msgstr "Probe נמצא היסט מוחל"
@@ -453,18 +542,40 @@ msgstr "המשך"
msgid "Retract" msgid "Retract"
msgstr "שיחול לאחור" msgstr "שיחול לאחור"
msgid "Retraction"
msgstr ""
msgid "Retraction Length"
msgstr ""
msgid "Retraction Speed"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "נסה שוב #%s" msgstr "נסה שוב #%s"
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "להציל" msgstr "להציל"
msgid "Save Config" msgid "Save Config"
msgstr "שמור קונפיג" msgstr "שמור קונפיג"
msgid "Save configuration" msgid "Save Z"
msgstr "שמור תצורה" msgstr ""
msgid "Save configuration?"
msgstr ""
msgid "Saved"
msgstr ""
#, python-format
msgid "Saved offset: %s"
msgstr ""
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "DPMS מסך" msgstr "DPMS מסך"
@@ -503,12 +614,18 @@ msgstr "Slicer"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "תיקון זמן פריסה (%)" msgstr "תיקון זמן פריסה (%)"
msgid "Slicer:"
msgstr ""
msgid "Small" msgid "Small"
msgstr "קָטָן" msgstr "קָטָן"
msgid "Sort by: " msgid "Sort by: "
msgstr "מיין לפי: " msgstr "מיין לפי: "
msgid "Sort:"
msgstr ""
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "מהירות (מ\"מ/שניות)" msgstr "מהירות (מ\"מ/שניות)"
@@ -518,6 +635,9 @@ msgstr "מהירות +"
msgid "Speed -" msgid "Speed -"
msgstr "מהירות -" msgstr "מהירות -"
msgid "Speed:"
msgstr ""
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "מהירות פינה מרובעת" msgstr "מהירות פינה מרובעת"
@@ -560,9 +680,6 @@ msgstr "טמפרטורה"
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "כדי ליישם %s צריך להפעיל מחדש את KlipperScreen" msgstr "כדי ליישם %s צריך להפעיל מחדש את KlipperScreen"
msgid "Tool"
msgstr "כלי"
msgid "Total:" msgid "Total:"
msgstr "סך הכל:" msgstr "סך הכל:"
@@ -572,6 +689,12 @@ msgstr "מחמם לא ידוע"
msgid "Unload" msgid "Unload"
msgstr "לִפְרוֹק" msgstr "לִפְרוֹק"
msgid "Unretract Extra Length"
msgstr ""
msgid "Unretract Speed"
msgstr ""
msgid "Up To Date" msgid "Up To Date"
msgstr "עדכני" msgstr "עדכני"
@@ -596,6 +719,9 @@ msgstr "X-"
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "מהירות תנועה XY (מ\"מ/שנייה)" msgstr "מהירות תנועה XY (מ\"מ/שנייה)"
msgid "XY Speed (mm/s)"
msgstr ""
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr "Y+"
@@ -608,12 +734,15 @@ msgstr "כיול Z"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "מהירות תנועה Z (מ\"מ/שניות)" msgstr "מהירות תנועה Z (מ\"מ/שניות)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "מיקום Z" msgstr ""
msgid "Z Tilt" msgid "Z Tilt"
msgstr "הטיה Z" msgstr "הטיה Z"
msgid "Z offset:"
msgstr ""
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr "Z+"
@@ -646,8 +775,17 @@ msgstr "מ''מ"
msgid "mm/s" msgid "mm/s"
msgstr "מ\"מ/ש" msgstr "מ\"מ/ש"
msgid "mm/s^2" msgid "mm/s²"
msgstr "mm/s^2" msgstr "mm/s²"
#~ msgid "Tool"
#~ msgstr "כלי"
#~ msgid "Displayed Macros"
#~ msgstr "מוצגים מאקרו"
#~ msgid "Z Position"
#~ msgstr "מיקום Z"
#~ msgid "IPv4" #~ msgid "IPv4"
#~ msgstr "IPv4" #~ msgstr "IPv4"
@@ -655,9 +793,6 @@ msgstr "mm/s^2"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Z Offset"
#~ msgstr "הפרז גובה Z"
#~ msgid "Unknown Heater " #~ msgid "Unknown Heater "
#~ msgstr "מחמם לא ידוע " #~ msgstr "מחמם לא ידוע "
@@ -720,9 +855,6 @@ msgstr "mm/s^2"
#~ msgid "Fast" #~ msgid "Fast"
#~ msgstr "מהיר" #~ msgstr "מהיר"
#~ msgid "Set Speed"
#~ msgstr "קבע מהירות"
#~ msgid "Slow" #~ msgid "Slow"
#~ msgstr "האט" #~ msgstr "האט"
@@ -753,9 +885,6 @@ msgstr "mm/s^2"
#~ msgid "Fan -" #~ msgid "Fan -"
#~ msgstr "מאוורר -" #~ msgstr "מאוורר -"
#~ msgid "Speed"
#~ msgstr "מהירות"
#~ msgid "System Information" #~ msgid "System Information"
#~ msgstr "מידע אודות המערכת" #~ msgstr "מידע אודות המערכת"
@@ -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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-0300\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: AntoszHUN\n" "Last-Translator: AntoszHUN\n"
"Language-Team: \n" "Language-Team: \n"
@@ -26,9 +26,15 @@ msgstr "24 Órás Idő"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "A FIRMWARE_RESTART javíthatja a problémát." msgstr "A FIRMWARE_RESTART javíthatja a problémát."
msgid "ADXL Not Configured"
msgstr "ADXL nincs konfigurálva"
msgid "Abort" msgid "Abort"
msgstr "Megszakít" msgstr "Megszakít"
msgid "Acceleration:"
msgstr "Gyorsulás:"
msgid "Accept" msgid "Accept"
msgstr "Elfogad" msgstr "Elfogad"
@@ -41,6 +47,17 @@ msgstr "Nyomtató hozzáadása"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "Ágyháló profil hozzáadása" msgstr "Ágyháló profil hozzáadása"
msgid "Apply"
msgstr "Alkalmaz"
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr "Alkalmaz %.2f eltolást az Endstopra?"
#, python-format
msgid "Apply %s%.2f offset to Probe?"
msgstr "Alkalmaz %s%.2f eltolást a szondára?"
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 végez?"
@@ -59,6 +76,9 @@ msgstr "Biztos, hogy le szeretné állítani a rendszert?"
msgid "Auto" msgid "Auto"
msgstr "Auto" msgstr "Auto"
msgid "Auto-calibrate"
msgstr "Automatikus kalibrálás"
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "Automatikus görgetés" msgstr "Automatikus görgetés"
@@ -74,9 +94,15 @@ msgstr "A Bltouch alkalmazott eltolást talált"
msgid "Calibrate" msgid "Calibrate"
msgstr "Kalibrálás" msgstr "Kalibrálás"
msgid "Calibrated"
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! Mentse el a konfigurációt, hogy az állandó legyen"
msgid "Calibrating..."
msgstr "Kalibrálás..."
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "Nem állítható a maximum fölé:" msgstr "Nem állítható a maximum fölé:"
@@ -105,6 +131,12 @@ msgstr ""
"Nézd a /tmp/KlipperScreen.log további információért.\n" "Nézd a /tmp/KlipperScreen.log további információért.\n"
"Segítségért küldj be egy hibajegyet a GitHubon." "Segítségért küldj be egy hibajegyet a GitHubon."
msgid "Check ADXL Wiring"
msgstr "Ellenőrizze az ADXL kábelezést"
msgid "Clear"
msgstr "Egyértelmű"
msgid "Close" msgid "Close"
msgstr "Bezárás" msgstr "Bezárás"
@@ -151,9 +183,6 @@ msgstr "Motorok letiltása"
msgid "Disable XY" msgid "Disable XY"
msgstr "XY Letiltása" msgstr "XY Letiltása"
msgid "Displayed Macros"
msgstr "Megjelenített makrók"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "Távolság (mm)" msgstr "Távolság (mm)"
@@ -188,9 +217,24 @@ msgstr "Hűtés"
msgid "Filament Used" msgid "Filament Used"
msgstr "Használt nyomtatószál" msgstr "Használt nyomtatószál"
msgid "Filament total:"
msgstr "Összes nyomtatószál:"
msgid "Filament used:"
msgstr "Használt nyomtatószál:"
msgid "Filament:"
msgstr "Nyomtatószál:"
msgid "File" msgid "File"
msgstr "Fájl" msgstr "Fájl"
msgid "File:"
msgstr "Fájl:"
msgid "Finding ADXL"
msgstr "ADXL keresése"
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "Finomhangolás" msgstr "Finomhangolás"
@@ -204,6 +248,12 @@ msgstr ""
"Firmware\n" "Firmware\n"
"Újraindítása" "Újraindítása"
msgid "Flow:"
msgstr "Folyam:"
msgid "Flowrate:"
msgstr "Áramlás:"
msgid "Font Size" msgid "Font Size"
msgstr "Betűméret" msgstr "Betűméret"
@@ -217,6 +267,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "Visszalépés" msgstr "Visszalépés"
msgid "Height:"
msgstr "Magasság:"
msgid "Hidden" msgid "Hidden"
msgstr "Rejtett" msgstr "Rejtett"
@@ -226,6 +279,9 @@ msgstr "Elrejt"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "Szenzorok elrejtése Hőfok." msgstr "Szenzorok elrejtése Hőfok."
msgid "Hide temp."
msgstr "Hőfok elrejtése"
msgid "Home" msgid "Home"
msgstr "Kezdőpontok" msgstr "Kezdőpontok"
@@ -262,6 +318,9 @@ msgstr "Inicializálás"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "Nyomtató inicializálása..." msgstr "Nyomtató inicializálása..."
msgid "Input Shaper"
msgstr "Bemeneti alakító"
msgid "Interface" msgid "Interface"
msgstr "Felület" msgstr "Felület"
@@ -305,6 +364,9 @@ msgstr "Nyelv"
msgid "Large" msgid "Large"
msgstr "Nagy" msgstr "Nagy"
msgid "Layer:"
msgstr "Réteg:"
msgid "Left:" msgid "Left:"
msgstr "Bal:" msgstr "Bal:"
@@ -326,7 +388,10 @@ msgstr "Makrók"
msgid "Main Menu" msgid "Main Menu"
msgstr "Főmenü" msgstr "Főmenü"
msgid "Max Accelation" msgid "Max"
msgstr "Max"
msgid "Max Acceleration"
msgstr "Max gyorsulás" msgstr "Max gyorsulás"
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
@@ -335,6 +400,15 @@ msgstr "Lassulás max gyorsulása"
msgid "Max Velocity" msgid "Max Velocity"
msgstr "Max sebesség" msgstr "Max sebesség"
msgid "Measure Both"
msgstr "Mindkettő mérése"
msgid "Measure X"
msgstr "X mérése"
msgid "Measure Y"
msgstr "Y mérése"
msgid "Medium" msgid "Medium"
msgstr "Közepes" msgstr "Közepes"
@@ -359,6 +433,9 @@ msgstr "Név"
msgid "Network" msgid "Network"
msgstr "Hálózat" msgstr "Hálózat"
msgid "New"
msgstr "Új"
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Nincs kiválasztva" msgstr "Nincs kiválasztva"
@@ -377,6 +454,9 @@ msgid_plural "Packages will be updated"
msgstr[0] "A csomag frissítésre kerül" msgstr[0] "A csomag frissítésre kerül"
msgstr[1] "Csomag frissül" msgstr[1] "Csomag frissül"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "Jelszó mentve" msgstr "Jelszó mentve"
@@ -389,6 +469,9 @@ 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 hajt végre?"
msgid "Pins"
msgstr ""
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ítsa újra és frissítse a mikrovezérlőt."
@@ -398,6 +481,9 @@ msgstr "Bekapcsolás"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "Nyomtató bekapcsolása" msgstr "Nyomtató bekapcsolása"
msgid "Pressure Advance:"
msgstr "Nyomás előtolás:"
msgid "Print" msgid "Print"
msgstr "Nyomtatás" msgstr "Nyomtatás"
@@ -413,6 +499,9 @@ msgstr "Nyomtató csatlakozások"
msgid "Printing" msgid "Printing"
msgstr "Nyomtatás" msgstr "Nyomtatás"
msgid "Probe Offset"
msgstr "Szonda eltolás"
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "A szonda alkalmazott eltolást talált" msgstr "A szonda alkalmazott eltolást talált"
@@ -443,18 +532,40 @@ msgstr "Folytat"
msgid "Retract" msgid "Retract"
msgstr "Visszahúz" msgstr "Visszahúz"
msgid "Retraction"
msgstr "Visszahúzás"
msgid "Retraction Length"
msgstr "Visszahúzási hossz"
msgid "Retraction Speed"
msgstr "Visszahúzási sebesség"
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Újra #%s" msgstr "Újra #%s"
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "Mentés" msgstr "Mentés"
msgid "Save Config" msgid "Save Config"
msgstr "Konfiguráció mentése" msgstr "Konfiguráció mentése"
msgid "Save configuration" msgid "Save Z"
msgstr "Konfiguráció mentése" msgstr "Z mentése"
msgid "Save configuration?"
msgstr "Menti a konfigurációt?"
msgid "Saved"
msgstr "Mentve"
#, python-format
msgid "Saved offset: %s"
msgstr "Eltolás mentve: %s"
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "Képernyő DPMS" msgstr "Képernyő DPMS"
@@ -493,12 +604,18 @@ msgstr "Szeletelő"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "Szeletelő idő javítása (%)" msgstr "Szeletelő idő javítása (%)"
msgid "Slicer:"
msgstr "Szeletelő:"
msgid "Small" msgid "Small"
msgstr "Kicsi" msgstr "Kicsi"
msgid "Sort by: " msgid "Sort by: "
msgstr "Sorrend: " msgstr "Sorrend: "
msgid "Sort:"
msgstr "Fajta:"
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "Sebesség (mm/s)" msgstr "Sebesség (mm/s)"
@@ -508,6 +625,9 @@ msgstr "Sebesség +"
msgid "Speed -" msgid "Speed -"
msgstr "Sebesség -" msgstr "Sebesség -"
msgid "Speed:"
msgstr "Sebesség:"
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "Sebesség a sarkokban" msgstr "Sebesség a sarkokban"
@@ -550,9 +670,6 @@ msgstr "Hőfok"
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "A %s KlipperScreen alkalmazásához újra kell indítani" msgstr "A %s KlipperScreen alkalmazásához újra kell indítani"
msgid "Tool"
msgstr "Eszköz"
msgid "Total:" msgid "Total:"
msgstr "Teljes:" msgstr "Teljes:"
@@ -562,6 +679,12 @@ msgstr "Ismeretlen melegítő"
msgid "Unload" msgid "Unload"
msgstr "Kiadás" msgstr "Kiadás"
msgid "Unretract Extra Length"
msgstr "Extra hossz visszahúzása"
msgid "Unretract Speed"
msgstr "Visszahúzási sebesség"
msgid "Up To Date" msgid "Up To Date"
msgstr "Naprakész" msgstr "Naprakész"
@@ -586,6 +709,9 @@ msgstr "X-"
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "XY Mozgási seb. (mm/s)" msgstr "XY Mozgási seb. (mm/s)"
msgid "XY Speed (mm/s)"
msgstr "XY Sebesség (mm/s)"
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr "Y+"
@@ -598,12 +724,15 @@ msgstr "Z Kalibrálás"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "Z Mozgási seb. (mm/s)" msgstr "Z Mozgási seb. (mm/s)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "Z Pozíció" msgstr "Z Sebesség (mm/s)"
msgid "Z Tilt" msgid "Z Tilt"
msgstr "Z Dőlés" msgstr "Z Dőlés"
msgid "Z offset:"
msgstr "Z eltolás:"
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr "Z+"
@@ -612,8 +741,8 @@ msgstr "Z-"
msgid "commit" msgid "commit"
msgid_plural "commits" msgid_plural "commits"
msgstr[0] "változás" msgstr[0] "ajánlás"
msgstr[1] "változás" msgstr[1] "ajánlások"
msgid "dBm" msgid "dBm"
msgstr "dBm" msgstr "dBm"
@@ -621,7 +750,7 @@ msgstr "dBm"
msgid "hour" msgid "hour"
msgid_plural "hours" msgid_plural "hours"
msgstr[0] "óra" msgstr[0] "óra"
msgstr[1] "óra" msgstr[1] "órák"
msgid "minutes" msgid "minutes"
msgstr "perc" msgstr "perc"
@@ -632,43 +761,5 @@ msgstr "mm"
msgid "mm/s" msgid "mm/s"
msgstr "mm/s" msgstr "mm/s"
msgid "mm/s^2" msgid "mm/s²"
msgstr "mm/s^2" msgstr "mm/s²"
#~ msgid "IPv4"
#~ msgstr "IPv4"
#~ msgid "IPv6"
#~ msgstr "IPv6"
#~ msgid "Z Offset"
#~ msgstr "Z Eltolás"
#~ msgid "Unknown Heater "
#~ msgstr "Ismeretlen melegítő "
#~ msgid "Disconnect"
#~ msgstr "Leválasztás"
#~ msgid "Duration Only"
#~ msgstr "Csak időtartam"
#~ msgid "Klipper Version"
#~ msgstr "Klipper verzió"
#~ msgid ""
#~ "Klipper has encountered an error with the micro-controller.\n"
#~ "Please recompile and flash."
#~ msgstr ""
#~ "A Klipper hibát észlelt a mikrovezérlővel kapcsolatban.\n"
#~ "Fordítsa újra és töltse fel."
#~ msgid ""
#~ "Klipper has encountered an error.\n"
#~ "Issue a FIRMWARE_RESTART to attempt fixing the issue."
#~ msgstr ""
#~ "A Klipper hibát észlelt.\n"
#~ "A probléma megoldásához küldjön ki egy FIRMWARE_RESTART-ot."
#~ msgid "KlipperScreen Version"
#~ msgstr "KlipperScreen verzió"
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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-0300\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: pappicio\n" "Last-Translator: pappicio\n"
"Language-Team: \n" "Language-Team: \n"
@@ -26,9 +26,15 @@ msgstr "24H"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "Un FIRMWARE_RESTART potrebbe risolvere il problema." msgstr "Un FIRMWARE_RESTART potrebbe risolvere il problema."
msgid "ADXL Not Configured"
msgstr ""
msgid "Abort" msgid "Abort"
msgstr "Annulla" msgstr "Annulla"
msgid "Acceleration:"
msgstr ""
msgid "Accept" msgid "Accept"
msgstr "Accetta" msgstr "Accetta"
@@ -41,6 +47,17 @@ msgstr "Aggiungi Stampante"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "Aggiungi Profilo Mesh" msgstr "Aggiungi Profilo Mesh"
msgid "Apply"
msgstr ""
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr ""
#, python-format
msgid "Apply %s%.2f offset to Probe?"
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?"
@@ -59,6 +76,9 @@ msgstr "Spegnere il Sistema?"
msgid "Auto" msgid "Auto"
msgstr "Auto" msgstr "Auto"
msgid "Auto-calibrate"
msgstr ""
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "Auto-scroll" msgstr "Auto-scroll"
@@ -74,9 +94,15 @@ msgstr "Bltouch ha trovato l'offset applicato"
msgid "Calibrate" msgid "Calibrate"
msgstr "Calibra" msgstr "Calibra"
msgid "Calibrated"
msgstr ""
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "Calibrato, salva la configurazione per renderla permanente" msgstr "Calibrato, salva la configurazione per renderla permanente"
msgid "Calibrating..."
msgstr ""
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "Impossibile impostare al di sopra del massimo:" msgstr "Impossibile impostare al di sopra del massimo:"
@@ -105,6 +131,12 @@ msgstr ""
"Verifica /tmp/KlipperScreen.log per info.\n" "Verifica /tmp/KlipperScreen.log per info.\n"
"Aggiungi un problema sul GitHub." "Aggiungi un problema sul GitHub."
msgid "Check ADXL Wiring"
msgstr ""
msgid "Clear"
msgstr ""
msgid "Close" msgid "Close"
msgstr "Chiudi" msgstr "Chiudi"
@@ -151,9 +183,6 @@ msgstr "Disab. Motori"
msgid "Disable XY" msgid "Disable XY"
msgstr "Disab. XY" msgstr "Disab. XY"
msgid "Displayed Macros"
msgstr "Mostra/Nascondi Macros"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "Distanza (mm)" msgstr "Distanza (mm)"
@@ -188,9 +217,24 @@ msgstr "Ventola"
msgid "Filament Used" msgid "Filament Used"
msgstr "Filamento Usato" msgstr "Filamento Usato"
msgid "Filament total:"
msgstr ""
msgid "Filament used:"
msgstr ""
msgid "Filament:"
msgstr ""
msgid "File" msgid "File"
msgstr "File" msgstr "File"
msgid "File:"
msgstr ""
msgid "Finding ADXL"
msgstr ""
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "Messa a Punto" msgstr "Messa a Punto"
@@ -204,6 +248,12 @@ msgstr ""
"Firmware\n" "Firmware\n"
"Riavvio" "Riavvio"
msgid "Flow:"
msgstr ""
msgid "Flowrate:"
msgstr ""
msgid "Font Size" msgid "Font Size"
msgstr "Dimensione del testo" msgstr "Dimensione del testo"
@@ -217,6 +267,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "Indietro" msgstr "Indietro"
msgid "Height:"
msgstr ""
msgid "Hidden" msgid "Hidden"
msgstr "Nascosto" msgstr "Nascosto"
@@ -226,6 +279,9 @@ msgstr "Nascondere"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "Nascondi sensori in Temp." msgstr "Nascondi sensori in Temp."
msgid "Hide temp."
msgstr ""
msgid "Home" msgid "Home"
msgstr "Inizio" msgstr "Inizio"
@@ -262,6 +318,9 @@ msgstr "Inizializzo"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "Inizializzo stampante..." msgstr "Inizializzo stampante..."
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "Interfaccia" msgstr "Interfaccia"
@@ -305,6 +364,9 @@ msgstr "Lingua"
msgid "Large" msgid "Large"
msgstr "Grande" msgstr "Grande"
msgid "Layer:"
msgstr ""
msgid "Left:" msgid "Left:"
msgstr "Restante:" msgstr "Restante:"
@@ -326,8 +388,11 @@ msgstr "Macros"
msgid "Main Menu" msgid "Main Menu"
msgstr "Menu Principale" msgstr "Menu Principale"
msgid "Max Accelation" msgid "Max"
msgstr "Acceleraz. Massima" msgstr ""
msgid "Max Acceleration"
msgstr ""
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
msgstr "Da acceleraz. Massima a Deceleraz. Massima" msgstr "Da acceleraz. Massima a Deceleraz. Massima"
@@ -335,6 +400,15 @@ msgstr "Da acceleraz. Massima a Deceleraz. Massima"
msgid "Max Velocity" msgid "Max Velocity"
msgstr "Velocità Massima" msgstr "Velocità Massima"
msgid "Measure Both"
msgstr ""
msgid "Measure X"
msgstr ""
msgid "Measure Y"
msgstr ""
msgid "Medium" msgid "Medium"
msgstr "Medio" msgstr "Medio"
@@ -359,6 +433,9 @@ msgstr "Nome"
msgid "Network" msgid "Network"
msgstr "Rete" msgstr "Rete"
msgid "New"
msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Niente selezionato" msgstr "Niente selezionato"
@@ -377,6 +454,9 @@ msgid_plural "Packages will be updated"
msgstr[0] "Pacchetto verrà aggiornato" msgstr[0] "Pacchetto verrà aggiornato"
msgstr[1] "I pacchetti verranno aggiornati" msgstr[1] "I pacchetti verranno aggiornati"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "Password salvata" msgstr "Password salvata"
@@ -389,6 +469,9 @@ msgstr "In Pausa"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "Eseguire un aggiornamento completo?" msgstr "Eseguire un aggiornamento completo?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "Si prega di ricompilare e flashare il microcontrollore." msgstr "Si prega di ricompilare e flashare il microcontrollore."
@@ -398,6 +481,9 @@ msgstr "Power"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "Accendi Stampante" msgstr "Accendi Stampante"
msgid "Pressure Advance:"
msgstr ""
msgid "Print" msgid "Print"
msgstr "Stampa" msgstr "Stampa"
@@ -413,6 +499,9 @@ msgstr "Connessioni Stampante"
msgid "Printing" msgid "Printing"
msgstr "In Stampa" msgstr "In Stampa"
msgid "Probe Offset"
msgstr ""
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "Probe ha trovato l'offset applicato" msgstr "Probe ha trovato l'offset applicato"
@@ -443,18 +532,40 @@ msgstr "Riprendi"
msgid "Retract" msgid "Retract"
msgstr "Ritrai" msgstr "Ritrai"
msgid "Retraction"
msgstr ""
msgid "Retraction Length"
msgstr ""
msgid "Retraction Speed"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Riprova #%s" msgstr "Riprova #%s"
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "Salva" msgstr "Salva"
msgid "Save Config" msgid "Save Config"
msgstr "Salva Config" msgstr "Salva Config"
msgid "Save configuration" msgid "Save Z"
msgstr "Salva configurazione" msgstr ""
msgid "Save configuration?"
msgstr ""
msgid "Saved"
msgstr ""
#, python-format
msgid "Saved offset: %s"
msgstr ""
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "Schermo DPMS" msgstr "Schermo DPMS"
@@ -493,12 +604,18 @@ msgstr "Slicer"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "Affettatrice Correzione del tempo (%)" msgstr "Affettatrice Correzione del tempo (%)"
msgid "Slicer:"
msgstr ""
msgid "Small" msgid "Small"
msgstr "Piccola" msgstr "Piccola"
msgid "Sort by: " msgid "Sort by: "
msgstr "Ordine: " msgstr "Ordine: "
msgid "Sort:"
msgstr ""
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "Velocità (mm/s)" msgstr "Velocità (mm/s)"
@@ -508,6 +625,9 @@ msgstr "Velocità+"
msgid "Speed -" msgid "Speed -"
msgstr "Velocità-" msgstr "Velocità-"
msgid "Speed:"
msgstr ""
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "Velocità Square Corner" msgstr "Velocità Square Corner"
@@ -550,9 +670,6 @@ msgstr "Temperatura"
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Riavvia KlipperScreen per applicare %s" msgstr "Riavvia KlipperScreen per applicare %s"
msgid "Tool"
msgstr "Strumenti"
msgid "Total:" msgid "Total:"
msgstr "Totale:" msgstr "Totale:"
@@ -562,6 +679,12 @@ msgstr "Riscaldatore sconosciuto"
msgid "Unload" msgid "Unload"
msgstr "Scaricare" msgstr "Scaricare"
msgid "Unretract Extra Length"
msgstr ""
msgid "Unretract Speed"
msgstr ""
msgid "Up To Date" msgid "Up To Date"
msgstr "Aggiornato" msgstr "Aggiornato"
@@ -586,6 +709,9 @@ msgstr "X-"
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "Velocità di spostamento XY (mm/s)" msgstr "Velocità di spostamento XY (mm/s)"
msgid "XY Speed (mm/s)"
msgstr ""
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr "Y+"
@@ -598,12 +724,15 @@ msgstr "Calibra Z"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "Velocità di spostamento Z (mm/s)" msgstr "Velocità di spostamento Z (mm/s)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "Posizione Z" msgstr ""
msgid "Z Tilt" msgid "Z Tilt"
msgstr "Z Tilt" msgstr "Z Tilt"
msgid "Z offset:"
msgstr ""
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr "Z+"
@@ -632,8 +761,17 @@ msgstr "mm"
msgid "mm/s" msgid "mm/s"
msgstr "mm/s" msgstr "mm/s"
msgid "mm/s^2" msgid "mm/s²"
msgstr "mm/s^2" msgstr "mm/s²"
#~ msgid "Tool"
#~ msgstr "Strumenti"
#~ msgid "Displayed Macros"
#~ msgstr "Mostra/Nascondi Macros"
#~ msgid "Z Position"
#~ msgstr "Posizione Z"
#~ msgid "IPv4" #~ msgid "IPv4"
#~ msgstr "IPv4" #~ msgstr "IPv4"
@@ -641,9 +779,6 @@ msgstr "mm/s^2"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Z Offset"
#~ msgstr "Offset Z"
#~ msgid "Unknown Heater " #~ msgid "Unknown Heater "
#~ msgstr "Riscaldatore sconosciuto " #~ msgstr "Riscaldatore sconosciuto "
+16 -20
View File
@@ -69,12 +69,6 @@
</key> </key>
</row> </row>
<row> <row>
<key obey-caps='true'>
<default display="Caps" action="modifier:caps" />
<shifted display="Caps" action="modifier:caps" />
<mod1 display="@" />
<mod2 display="£" />
</key>
<key obey-caps='true'> <key obey-caps='true'>
<default display="a" /> <default display="a" />
<shifted display="A" /> <shifted display="A" />
@@ -129,10 +123,16 @@
<mod1 display="/" /> <mod1 display="/" />
<mod2 display="\" /> <mod2 display="\" />
</key> </key>
<key obey-caps='true'>
<default display="ñ" />
<shifted display="Ñ" />
<mod1 display="@" />
<mod2 display="£" />
</key>
</row> </row>
<row> <row>
<key obey-caps='true'> <key obey-caps='true' fill="true">
<default display="↑" action="modifier:shift" /> <default display="Shift" action="modifier:shift" />
</key> </key>
<key obey-caps='true'> <key obey-caps='true'>
<default display="z" /> <default display="z" />
@@ -162,7 +162,7 @@
<default display="b" /> <default display="b" />
<shifted display="B" /> <shifted display="B" />
<mod1 display=";" /> <mod1 display=";" />
<mod2 display="✓" /> <mod2 display="¿" />
</key> </key>
<key obey-caps='true'> <key obey-caps='true'>
<default display="n" /> <default display="n" />
@@ -177,31 +177,27 @@
<mod2 display="]" /> <mod2 display="]" />
</key> </key>
<key obey-caps='true'> <key obey-caps='true'>
<default display="⌫" action="backspace" /> <default display="&lt;x" action="backspace" />
</key> </key>
</row> </row>
<row> <row>
<key> <key width="2000" fill="false">
<default display="?123" action="modifier:mod1" /> <default display="123" action="modifier:mod1" />
</key> </key>
<key> <key width="2000" fill="false">
<default display="=\&lt;" action="modifier:mod2" /> <default display="=\&lt;" action="modifier:mod2" />
</key> </key>
<key> <key fill="false">
<default display="," /> <default display="," />
<mod2 display="&lt;" /> <mod2 display="&lt;" />
</key> </key>
<key width="6000" fill="true"> <key width="3000" fill="true">
<default display=" " action="space" /> <default display=" " action="space" />
</key> </key>
<key> <key fill="false">
<default display="." /> <default display="." />
<mod2 display="&gt;" /> <mod2 display="&gt;" />
</key> </key>
<key width="1000">
<!-- <default display="◀┛" action="return"/> -->
<default display="◀┛" action="return"/>
</key>
</row> </row>
</layout> </layout>
@@ -0,0 +1,771 @@
msgid ""
msgstr ""
"Project-Id-Version: KlipperScreen\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-12 22:17-0300\n"
"PO-Revision-Date: \n"
"Last-Translator: NSteven\n"
"Language-Team: NSteven\n"
"Language: ko_KR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.1\n"
#, python-format
msgid "%s will be updated to version"
msgstr "%s 버전으로 업데이트 됩니다"
msgid "(default)"
msgstr "(기본)"
msgid "24 Hour Time"
msgstr "24시간"
msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "펌웨어를 재시작해 문제를 해결할 수 있습니다"
msgid "ADXL Not Configured"
msgstr "가속도계 설정이 없습니다"
msgid "Abort"
msgstr "취소"
msgid "Acceleration:"
msgstr "가속도:"
msgid "Accept"
msgstr "확인"
msgid "Actions"
msgstr "툴 헤드 제어"
msgid "Add Printer"
msgstr "프린터 추가"
msgid "Add bed mesh profile"
msgstr "베드 메시 프로파일 추가"
msgid "Apply"
msgstr "확인"
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr "엔드스탑 높이 기준을 %.2f 높이의 옵셋으로 설정 하시겠습니까?"
#, python-format
msgid "Apply %s%.2f offset to Probe?"
msgstr "프로브 높이 기준을 %s%.2f 높이의 옵셋으로 설정 하시겠습니까?"
msgid "Are you sure you want to run Emergency Stop?"
msgstr "비상정지 시킬까요?"
msgid "Are you sure you wish to cancel this print?"
msgstr "지금 출력을 취소 하시겠습니까?"
msgid "Are you sure you wish to disable motors?"
msgstr "모터 전원을 끄시겠습니까?"
msgid "Are you sure you wish to reboot the system?"
msgstr "시스템을 재시작 하시겠습니까?"
msgid "Are you sure you wish to shutdown the system?"
msgstr "시스템을 종료 하시겠습니까?"
msgid "Auto"
msgstr "오토"
msgid "Auto-calibrate"
msgstr "자동 교정"
msgid "Auto-scroll"
msgstr "오토 스크롤"
msgid "Bed Level"
msgstr "베드 레베"
msgid "Bed Mesh"
msgstr "배드 메시"
msgid "Bltouch found applied offset"
msgstr "Bltouch가 적용된 오프셋"
msgid "Calibrate"
msgstr "교정"
msgid "Calibrated"
msgstr "교정됨"
msgid "Calibrated, save configuration to make it permanent"
msgstr "교정됨, 설정을 저장합니다"
msgid "Calibrating..."
msgstr "교정 중.."
msgid "Can't set above the maximum:"
msgstr "최대 값을 초과하는 설정은 할 수 없습니다:"
msgid "Cancel"
msgstr "취소"
msgid "Cancel Print"
msgstr "출력 취소"
msgid "Cancelled"
msgstr "취소됨"
msgid "Cancelling"
msgstr "취소중"
msgid "Cannot connect to Moonraker"
msgstr "문래커에 연결할 수 없음"
msgid "Channel"
msgstr "채널"
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
"자세한 내용은 /tmp/KlipperScreen.log를 참조하십시오.\n"
"GitHub에 현재 발생한 이슈를 제출하여 도움을 요청해 주세요"
msgid "Check ADXL Wiring"
msgstr "가속도계 배선을 확인해 주세요"
msgid "Clear"
msgstr "초기화"
msgid "Close"
msgstr "닫기"
msgid "Complete"
msgstr "완료"
msgid "Configuration"
msgstr "환경 설정"
msgid "Confirm Emergency Stop"
msgstr "비상정지 확인창 표시"
msgid "Connected"
msgstr "연결됨"
#, python-format
msgid "Connecting to %s"
msgstr "%s에 연결 중.."
msgid "Console"
msgstr "콘솔 제어 명령"
msgid "Continue"
msgstr "계속"
msgid "Cooldown"
msgstr "가열 중단"
msgid "Date"
msgstr "날짜"
msgid "Decrease"
msgstr "낮추기"
msgid "Delete"
msgstr "삭제"
msgid "Deselect"
msgstr "선택 해제"
msgid "Disable Motors"
msgstr "모터 전원 끄기"
msgid "Disable XY"
msgstr "XY 비활성화"
msgid "Distance (mm)"
msgstr "거리 (mm)"
#, python-format
msgid "Do you want to recover %s?"
msgstr "%s을(를) 복구하시겠습니까?"
msgid "Elapsed:"
msgstr "경과:"
msgid "Error"
msgstr "오류"
msgid "Estimated Time Method"
msgstr "예상시간 옵션"
msgid "Extrude"
msgstr "압출 "
msgid "Extrusion +"
msgstr "압출 +"
msgid "Extrusion -"
msgstr "압출 -"
msgid "Failed, adjust position first"
msgstr "실패, 먼저 위치를 조정해 주세요"
msgid "Fan"
msgstr "쿨링 팬 제어"
msgid "Filament Used"
msgstr "사용된 필라멘트"
msgid "Filament total:"
msgstr "필라멘트 총계:"
msgid "Filament used:"
msgstr "사용된 필라멘트:"
msgid "Filament:"
msgstr "필라멘트:"
msgid "File"
msgstr "파일"
msgid "File:"
msgstr "파일:"
msgid "Finding ADXL"
msgstr "가속도계 찾는 중.."
msgid "Fine Tuning"
msgstr "미세 조정"
msgid "Finish"
msgstr "완료됨"
msgid ""
"Firmware\n"
"Restart"
msgstr ""
"펌웨어\n"
"재시작"
msgid "Flow:"
msgstr "유량:"
msgid "Flowrate:"
msgstr "유량:"
msgid "Font Size"
msgstr "글꼴 크기"
msgid ""
"Full\n"
"Update"
msgstr ""
"전체\n"
"업데이트"
msgid "Go Back"
msgstr "뒤로"
msgid "Height:"
msgstr "높이:"
msgid "Hidden"
msgstr "숨김"
msgid "Hide"
msgstr "가리기"
msgid "Hide sensors in Temp."
msgstr "온도 섹션에서 센서 항목 숨김."
msgid "Hide temp."
msgstr "온도 숨김"
msgid "Home"
msgstr "홈"
msgid "Home All"
msgstr "전체 홈"
msgid "Home X"
msgstr "X축 홈"
msgid "Home XY"
msgstr "XY축 홈"
msgid "Home Y"
msgstr "Y축 홈"
msgid "Home Z"
msgstr "Z축 홈"
msgid "Homing"
msgstr "툴 헤드 위치 초기화"
msgid "Hostname"
msgstr "호스트 이름"
msgid "Icon Theme"
msgstr "아이콘 테마"
msgid "Increase"
msgstr "높이기"
msgid "Initializing"
msgstr "초기화 중.."
msgid "Initializing printer..."
msgstr "프린터 초기화 중.."
msgid "Input Shaper"
msgstr "인풋 셰이퍼"
msgid "Interface"
msgstr "인터페이스"
msgid "Invalid"
msgstr "존재하지 않음"
msgid "Invert X"
msgstr "X축 반전"
msgid "Invert Y"
msgstr "Y축 반전"
msgid "Invert Z"
msgstr "Z축 반전"
msgid ""
"Klipper\n"
"Restart"
msgstr ""
"클리퍼\n"
"재시작"
msgid "Klipper has disconnected"
msgstr "클리퍼와 연결이 끊어졌습니다"
msgid "Klipper has encountered an error."
msgstr "클리퍼에 오류가 발생했습니다"
msgid "Klipper has shutdown"
msgstr "클리퍼가 종료되었습니다"
msgid "Klipper is attempting to start"
msgstr "클리퍼 시작하는 중"
msgid "Klipper will reboot"
msgstr "클리퍼를 다시 시작합니다"
msgid "Language"
msgstr "언어"
msgid "Large"
msgstr "크게"
msgid "Layer:"
msgstr "레이어:"
msgid "Left:"
msgstr "남음:"
msgid "Limits"
msgstr "가속도 설정"
msgid "Load"
msgstr "필라 넣기"
msgid "Lower Nozzle"
msgstr "노즐 낮춤"
msgid "Macro shortcut on sidebar"
msgstr "사이드바에 매크로 아이콘 표시"
msgid "Macros"
msgstr "매크로"
msgid "Main Menu"
msgstr "메인 메뉴"
msgid "Max"
msgstr ""
msgid "Max Acceleration"
msgstr "최대 가속"
msgid "Max Acceleration to Deceleration"
msgstr "감속을 위한 최대 가속"
msgid "Max Velocity"
msgstr "출력 속도"
msgid "Measure Both"
msgstr "XY축 모두 측정"
msgid "Measure X"
msgstr "X축 측정"
msgid "Measure Y"
msgstr "Y축 측정"
msgid "Medium"
msgstr "중간"
msgid "Menu"
msgstr "메뉴"
msgid "Modified"
msgstr "수정됨"
msgid "Moonraker: connected"
msgstr "문래커: 연결됨"
msgid "Move"
msgstr "툴 헤드 이동"
msgid "Move Distance (mm)"
msgstr "이동 거리 (mm)"
msgid "Name"
msgstr "이름"
msgid "Network"
msgstr "네트워크"
msgid "New"
msgstr "신규"
msgid "Nothing selected"
msgstr "아무것도 선택하지 않ㅇ"
msgid "Off"
msgstr "끄기"
#, python-format
msgid "Outdated by %d"
msgstr "%d 보다 오래됨"
msgid "PSK for"
msgstr "PSK 키 값(비밀번호)"
msgid "Package will be updated"
msgid_plural "Packages will be updated"
msgstr[0] "패키지가 업데이트 됩니다"
msgid "Part Fan"
msgstr ""
msgid "Password saved"
msgstr "비밀번호 저장됨"
msgid "Pause"
msgstr "일시정지"
msgid "Paused"
msgstr "일시정지됨"
msgid "Perform a full upgrade?"
msgstr "전체 업그레이드를 실행합니까?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller."
msgstr "MCU 펌웨어를 다시 컴파일 한 다음 플래싱 해주세요"
msgid "Power"
msgstr "전원"
msgid "Power On Printer"
msgstr "프린터 전원 켜기"
msgid "Pressure Advance:"
msgstr "모서리 압출 제어"
msgid "Print"
msgstr "출력"
msgid "Print Control"
msgstr "출력 제어"
msgid "Print Time"
msgstr "출력 시간"
msgid "Printer Connections"
msgstr "프린터 연결"
msgid "Printing"
msgstr "출력중"
msgid "Probe Offset"
msgstr "프로브 오프셋"
msgid "Probe found applied offset"
msgstr "프로브가 오프셋을 찾았습니다"
msgid "Profile Name:"
msgstr "프로파일 이름:"
msgid "Quad Gantry Level"
msgstr "쿼드 갠트리 레벨"
msgid "Raise Nozzle"
msgstr "노즐 높임"
msgid "Recover Hard"
msgstr "강화 복구 모드"
msgid "Recover Soft"
msgstr "일반 복구 모드"
msgid "Reference"
msgstr "참조"
msgid "Restart"
msgstr "재시작"
msgid "Resume"
msgstr "재개"
msgid "Retract"
msgstr "퇴출"
msgid "Retraction"
msgstr "필라 퇴출"
msgid "Retraction Length"
msgstr "퇴추 길이"
msgid "Retraction Speed"
msgstr "퇴출 속도"
#, python-format
msgid "Retry #%s"
msgstr "재시도 #%s"
msgid "Retrying"
msgstr ""
msgid "Save"
msgstr "저장"
msgid "Save Config"
msgstr "설정 저장"
msgid "Save Z"
msgstr "Z 옵셋 저장"
msgid "Save configuration?"
msgstr "구성을 저장하시겠습니까?"
msgid "Saved"
msgstr "저장됨"
#, python-format
msgid "Saved offset: %s"
msgstr "저장된 옵세: %s"
msgid "Screen DPMS"
msgstr "화면 DPMS"
msgid "Screen Power Off Time"
msgstr "화면 절전 시간"
msgid "Screws Adjust"
msgstr "베드 스크류 조정"
msgid "Select"
msgstr "선택"
msgid "Send"
msgstr "보내기"
#, python-format
msgid "Sending Power ON signal to: %s"
msgstr "전원 켜기 신호 송신 ㅈ: %s"
msgid "Set Temp"
msgstr "온도 설정"
msgid "Settings"
msgstr "설정"
msgid "Show"
msgstr "보기"
msgid "Size"
msgstr "크기"
msgid "Slicer"
msgstr "슬라이서"
msgid "Slicer Time correction (%)"
msgstr "슬라이서 시간 보정(%)"
msgid "Slicer:"
msgstr "슬라이서:"
msgid "Small"
msgstr "작은"
msgid "Sort by: "
msgstr "분류 기준: "
msgid "Sort:"
msgstr "종류:"
msgid "Speed (mm/s)"
msgstr "속도 (mm/s)"
msgid "Speed +"
msgstr "속도 +"
msgid "Speed -"
msgstr "속도 -"
msgid "Speed:"
msgstr "속도:"
msgid "Square Corner Velocity"
msgstr "모서리 통과 속도"
msgid "Start"
msgstr "시작"
msgid "Starting WiFi Association"
msgstr "WiFi 연결을 시작하는 중"
msgid "Starting recovery for"
msgstr "에 대한 복구 시작"
msgid "Starting update for"
msgstr "업데이트 시작 중"
msgid "System"
msgstr "시스템"
msgid ""
"System\n"
"Restart"
msgstr ""
"시스템\n"
"재시작"
msgid ""
"System\n"
"Shutdown"
msgstr ""
"시스템\n"
"종료"
msgid "Temp (°C)"
msgstr "온도 (°C)"
msgid "Temperature"
msgstr "온도 제어"
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "%s을(를) 적용하려면 클리퍼 스크린을 다시 시작해야 합니다"
msgid "Total:"
msgstr "총:"
msgid "Unknown Heater"
msgstr "알 수 없는 히터"
msgid "Unload"
msgstr "필라 꺼내기"
msgid "Unretract Extra Length"
msgstr "필라멘트 퇴출 길이"
msgid "Unretract Speed"
msgstr "필라멘트 퇴출 속도"
msgid "Up To Date"
msgstr "최신 버전 유지 중"
msgid "Update"
msgstr "업데이트"
msgid "Updating"
msgstr "업데이트 중.."
msgid "Uploaded"
msgstr "업로드됨"
msgid "View Mesh"
msgstr "메쉬 프로파일 보기"
msgid "X+"
msgstr "X+"
msgid "X-"
msgstr "X-"
msgid "XY Move Speed (mm/s)"
msgstr "XY 이동 속도 (mm/s)"
msgid "XY Speed (mm/s)"
msgstr "XY 속도 (mm/s)"
msgid "Y+"
msgstr "Y+"
msgid "Y-"
msgstr "Y-"
msgid "Z Calibrate"
msgstr "Z 옵셋 교정"
msgid "Z Move Speed (mm/s)"
msgstr "Z 이동 속도 (mm/s)"
msgid "Z Speed (mm/s)"
msgstr "Z 속도 (mm/s)"
msgid "Z Tilt"
msgstr "Z 기울기"
msgid "Z offset:"
msgstr "Z 옵셋:"
msgid "Z+"
msgstr "Z+"
msgid "Z-"
msgstr "Z-"
msgid "commit"
msgid_plural "commits"
msgstr[0] "커밋"
msgid "dBm"
msgstr "dBm"
msgid "hour"
msgid_plural "hours"
msgstr[0] "시간"
msgid "minutes"
msgstr "분"
msgid "mm"
msgstr "mm"
msgid "mm/s"
msgstr "mm/s"
msgid "mm/s²"
msgstr "mm/s²"
#~ msgid "Tool"
#~ msgstr "툴"
#~ msgid "Displayed Macros"
#~ msgstr "표시할 매크로"
#~ msgid "Z Position"
#~ msgstr "Z 위치"
@@ -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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-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"
@@ -32,9 +32,15 @@ msgstr "Zegar 24-godzinny"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "FIRMWARE_RESTART może rozwiązać problem." msgstr "FIRMWARE_RESTART może rozwiązać problem."
msgid "ADXL Not Configured"
msgstr ""
msgid "Abort" msgid "Abort"
msgstr "Odwołaj" msgstr "Odwołaj"
msgid "Acceleration:"
msgstr ""
msgid "Accept" msgid "Accept"
msgstr "Akceptuj" msgstr "Akceptuj"
@@ -47,6 +53,17 @@ msgstr "Dodaj drukarkę"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "Dodaj profil siatki stołu" msgstr "Dodaj profil siatki stołu"
msgid "Apply"
msgstr ""
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr ""
#, python-format
msgid "Apply %s%.2f offset to Probe?"
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ć?"
@@ -65,6 +82,9 @@ msgstr "Czy na pewno chcesz wyłączyć system?"
msgid "Auto" msgid "Auto"
msgstr "Automatyczny" msgstr "Automatyczny"
msgid "Auto-calibrate"
msgstr ""
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "Auto-scroll" msgstr "Auto-scroll"
@@ -80,9 +100,15 @@ msgstr "Bltouch znalazł zastosowane przesunięcie"
msgid "Calibrate" msgid "Calibrate"
msgstr "Kalibracja" msgstr "Kalibracja"
msgid "Calibrated"
msgstr ""
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "Skalibrowano, zapisz konfigurację aby została na stałe" msgstr "Skalibrowano, zapisz konfigurację aby została na stałe"
msgid "Calibrating..."
msgstr ""
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "Nie można ustawić powyżej maksymum:" msgstr "Nie można ustawić powyżej maksymum:"
@@ -111,6 +137,12 @@ msgstr ""
"Sprawdź /tmp/KlipperScreen.log aby uzyskać więcej informacji.\n" "Sprawdź /tmp/KlipperScreen.log aby uzyskać więcej informacji.\n"
"Proszę zgłosić usterkę na GitHub by uzyskać pomoc." "Proszę zgłosić usterkę na GitHub by uzyskać pomoc."
msgid "Check ADXL Wiring"
msgstr ""
msgid "Clear"
msgstr ""
msgid "Close" msgid "Close"
msgstr "Zamknij" msgstr "Zamknij"
@@ -157,9 +189,6 @@ msgstr "Wyłącz Silniki"
msgid "Disable XY" msgid "Disable XY"
msgstr "Odłącz XY" msgstr "Odłącz XY"
msgid "Displayed Macros"
msgstr "Wyświetlone Makra"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "Dystans (mm)" msgstr "Dystans (mm)"
@@ -194,20 +223,40 @@ msgstr "Wentylator"
msgid "Filament Used" msgid "Filament Used"
msgstr "Filament w Użytku" msgstr "Filament w Użytku"
msgid "Filament total:"
msgstr ""
msgid "Filament used:"
msgstr ""
msgid "Filament:"
msgstr ""
msgid "File" msgid "File"
msgstr "Plik" msgstr "Plik"
msgid "File:"
msgstr ""
msgid "Finding ADXL"
msgstr ""
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "Regulacja Precyzyjna" msgstr "Regulacja Precyzyjna"
msgid "Finish" msgid "Finish"
msgstr "Zakończ" msgstr "Zakończ"
#, fuzzy
msgid "" msgid ""
"Firmware\n" "Firmware\n"
"Restart" "Restart"
msgstr "Firmware Restart" msgstr ""
msgid "Flow:"
msgstr ""
msgid "Flowrate:"
msgstr ""
msgid "Font Size" msgid "Font Size"
msgstr "Rozmiar trzcionki" msgstr "Rozmiar trzcionki"
@@ -222,6 +271,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "Powróć" msgstr "Powróć"
msgid "Height:"
msgstr ""
msgid "Hidden" msgid "Hidden"
msgstr "Ukryty" msgstr "Ukryty"
@@ -231,6 +283,9 @@ msgstr "Schowaj"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "Ukryj czujniki w Temp." msgstr "Ukryj czujniki w Temp."
msgid "Hide temp."
msgstr ""
msgid "Home" msgid "Home"
msgstr "Baza" msgstr "Baza"
@@ -267,6 +322,9 @@ msgstr "Startowanie"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "Drukarka Startuje..." msgstr "Drukarka Startuje..."
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "Interfejs" msgstr "Interfejs"
@@ -282,11 +340,10 @@ msgstr "Odwróć Y"
msgid "Invert Z" msgid "Invert Z"
msgstr "Odwróć Z" msgstr "Odwróć Z"
#, fuzzy
msgid "" msgid ""
"Klipper\n" "Klipper\n"
"Restart" "Restart"
msgstr "Restart Klippera" msgstr ""
msgid "Klipper has disconnected" msgid "Klipper has disconnected"
msgstr "Klipper się rozłączył" msgstr "Klipper się rozłączył"
@@ -309,6 +366,9 @@ msgstr "Język"
msgid "Large" msgid "Large"
msgstr "Duży" msgstr "Duży"
msgid "Layer:"
msgstr ""
msgid "Left:" msgid "Left:"
msgstr "Lewo:" msgstr "Lewo:"
@@ -330,8 +390,11 @@ msgstr "Makro"
msgid "Main Menu" msgid "Main Menu"
msgstr "Główne Menu" msgstr "Główne Menu"
msgid "Max Accelation" msgid "Max"
msgstr "Maks akceleracja" msgstr ""
msgid "Max Acceleration"
msgstr ""
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
msgstr "Maks Przyśpieszenie i Opóźnienie" msgstr "Maks Przyśpieszenie i Opóźnienie"
@@ -339,6 +402,15 @@ msgstr "Maks Przyśpieszenie i Opóźnienie"
msgid "Max Velocity" msgid "Max Velocity"
msgstr "Maks Prędkość" msgstr "Maks Prędkość"
msgid "Measure Both"
msgstr ""
msgid "Measure X"
msgstr ""
msgid "Measure Y"
msgstr ""
msgid "Medium" msgid "Medium"
msgstr "Średni" msgstr "Średni"
@@ -363,6 +435,9 @@ msgstr "Nazwa"
msgid "Network" msgid "Network"
msgstr "Sieć" msgstr "Sieć"
msgid "New"
msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Nic nie wybrano" msgstr "Nic nie wybrano"
@@ -382,6 +457,9 @@ msgstr[0] "Pakiet zostanie zaktualizowany"
msgstr[1] "Pakiety zostaną zaktualizowane" msgstr[1] "Pakiety zostaną zaktualizowane"
msgstr[2] "Pakiety zostaną zaktualizowane" msgstr[2] "Pakiety zostaną zaktualizowane"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "Hasło zostało zapisane" msgstr "Hasło zostało zapisane"
@@ -394,6 +472,9 @@ msgstr "Zapauzowane"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "Przeprowadzić pełną aktualizację?" msgstr "Przeprowadzić pełną aktualizację?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "Proszę przekompilować i sflashować mikrokontroler." msgstr "Proszę przekompilować i sflashować mikrokontroler."
@@ -403,6 +484,9 @@ msgstr "Zasilanie"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "Zasilanie włączone" msgstr "Zasilanie włączone"
msgid "Pressure Advance:"
msgstr ""
msgid "Print" msgid "Print"
msgstr "Drukuj" msgstr "Drukuj"
@@ -418,6 +502,9 @@ msgstr "Połączenia Drukarki"
msgid "Printing" msgid "Printing"
msgstr "Drukujemy" msgstr "Drukujemy"
msgid "Probe Offset"
msgstr ""
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "Probe znalazł zastosowane przesunięcie" msgstr "Probe znalazł zastosowane przesunięcie"
@@ -448,18 +535,40 @@ msgstr "Dokończ"
msgid "Retract" msgid "Retract"
msgstr "Cofnij" msgstr "Cofnij"
msgid "Retraction"
msgstr ""
msgid "Retraction Length"
msgstr ""
msgid "Retraction Speed"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Spróbuj ponownie #%s" msgstr "Spróbuj ponownie #%s"
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "Zapisz" msgstr "Zapisz"
msgid "Save Config" msgid "Save Config"
msgstr "Zapisz Konfigurację" msgstr "Zapisz Konfigurację"
msgid "Save configuration" msgid "Save Z"
msgstr "Zapisz konfigurację" msgstr ""
msgid "Save configuration?"
msgstr ""
msgid "Saved"
msgstr ""
#, python-format
msgid "Saved offset: %s"
msgstr ""
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "Ekran DPMS" msgstr "Ekran DPMS"
@@ -498,12 +607,18 @@ msgstr "Slicer"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "Korekta czasu krajalnicy (%)" msgstr "Korekta czasu krajalnicy (%)"
msgid "Slicer:"
msgstr ""
msgid "Small" msgid "Small"
msgstr "Mały" msgstr "Mały"
msgid "Sort by: " msgid "Sort by: "
msgstr "Sortuj wg: " msgstr "Sortuj wg: "
msgid "Sort:"
msgstr ""
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "Prędkość (mm/s)" msgstr "Prędkość (mm/s)"
@@ -513,6 +628,9 @@ msgstr "Prędkość +"
msgid "Speed -" msgid "Speed -"
msgstr "Prędkość -" msgstr "Prędkość -"
msgid "Speed:"
msgstr ""
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "Prędkość w narożniku kwadratowym" msgstr "Prędkość w narożniku kwadratowym"
@@ -555,9 +673,6 @@ msgstr "Temperatura"
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Aby zastosować %s KlipperScreen musi zostać ponownie uruchomiony" msgstr "Aby zastosować %s KlipperScreen musi zostać ponownie uruchomiony"
msgid "Tool"
msgstr "Narzędzie"
msgid "Total:" msgid "Total:"
msgstr "Całkowity:" msgstr "Całkowity:"
@@ -567,6 +682,12 @@ msgstr "Nieznany Podgrzewacz"
msgid "Unload" msgid "Unload"
msgstr "Wyładuj" msgstr "Wyładuj"
msgid "Unretract Extra Length"
msgstr ""
msgid "Unretract Speed"
msgstr ""
msgid "Up To Date" msgid "Up To Date"
msgstr "Aktualne" msgstr "Aktualne"
@@ -591,6 +712,9 @@ msgstr "X-"
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "Prędkość ruchu XY (mm/s)" msgstr "Prędkość ruchu XY (mm/s)"
msgid "XY Speed (mm/s)"
msgstr ""
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr "Y+"
@@ -603,12 +727,15 @@ msgstr "Kalibracja Z"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "Prędkość ruchu Z (mm/s)" msgstr "Prędkość ruchu Z (mm/s)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "Pozycja Z" msgstr ""
msgid "Z Tilt" msgid "Z Tilt"
msgstr "Przechył Z" msgstr "Przechył Z"
msgid "Z offset:"
msgstr ""
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr "Z+"
@@ -637,10 +764,19 @@ msgid "mm"
msgstr "mm" msgstr "mm"
msgid "mm/s" msgid "mm/s"
msgstr "mm/s^2" msgstr "mm/s²"
msgid "mm/s^2" msgid "mm/s²"
msgstr "mm/s^2" msgstr "mm/s²"
#~ msgid "Tool"
#~ msgstr "Narzędzie"
#~ msgid "Displayed Macros"
#~ msgstr "Wyświetlone Makra"
#~ msgid "Z Position"
#~ msgstr "Pozycja Z"
#~ msgid "IPv4" #~ msgid "IPv4"
#~ msgstr "IPv4" #~ msgstr "IPv4"
@@ -648,9 +784,6 @@ msgstr "mm/s^2"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Z Offset"
#~ msgstr "Przesunięcie Z"
#~ msgid "Unknown Heater " #~ msgid "Unknown Heater "
#~ msgstr "Nieznany Podgrzewacz " #~ msgstr "Nieznany Podgrzewacz "
@@ -6,8 +6,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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-0300\n"
"PO-Revision-Date: 2022-03-31 11:10-0300\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"
"Language: ru_RU\n" "Language: ru_RU\n"
@@ -32,9 +32,15 @@ msgstr "24-часовой формат"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "FIRMWARE_RESTART может решить проблему." msgstr "FIRMWARE_RESTART может решить проблему."
msgid "ADXL Not Configured"
msgstr ""
msgid "Abort" msgid "Abort"
msgstr "Отменить" msgstr "Отменить"
msgid "Acceleration:"
msgstr ""
msgid "Accept" msgid "Accept"
msgstr "Применить" msgstr "Применить"
@@ -47,6 +53,17 @@ msgstr "Добавить принтер"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "Добавить профиль сетки стола" msgstr "Добавить профиль сетки стола"
msgid "Apply"
msgstr ""
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr ""
#, python-format
msgid "Apply %s%.2f offset to Probe?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "Вы уверены, что хотите запустить аварийную остановку?" msgstr "Вы уверены, что хотите запустить аварийную остановку?"
@@ -65,6 +82,9 @@ msgstr "Вы хотите выключить принтер?"
msgid "Auto" msgid "Auto"
msgstr "Авто" msgstr "Авто"
msgid "Auto-calibrate"
msgstr ""
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "Автопрокрутка" msgstr "Автопрокрутка"
@@ -80,9 +100,15 @@ msgstr "Bltouch обнаружил примененное смещение"
msgid "Calibrate" msgid "Calibrate"
msgstr "Калибровка" msgstr "Калибровка"
msgid "Calibrated"
msgstr ""
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "Откалибровано, сохраните конфигурацию, чтобы сделать ее постоянной" msgstr "Откалибровано, сохраните конфигурацию, чтобы сделать ее постоянной"
msgid "Calibrating..."
msgstr ""
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "Невозможно установить выше максимума:" msgstr "Невозможно установить выше максимума:"
@@ -111,6 +137,12 @@ msgstr ""
"Проверьте /tmp/KlipperScreen.log для дополнитольной информации.\n" "Проверьте /tmp/KlipperScreen.log для дополнитольной информации.\n"
"Создайте issues на GitHub что-бы получить помощь." "Создайте issues на GitHub что-бы получить помощь."
msgid "Check ADXL Wiring"
msgstr ""
msgid "Clear"
msgstr ""
msgid "Close" msgid "Close"
msgstr "Закрыть" msgstr "Закрыть"
@@ -157,9 +189,6 @@ msgstr "Откл. моторы"
msgid "Disable XY" msgid "Disable XY"
msgstr "Отключить XY" msgstr "Отключить XY"
msgid "Displayed Macros"
msgstr "Показать макросы"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "Расстояние (mm)" msgstr "Расстояние (mm)"
@@ -194,9 +223,24 @@ msgstr "Обдув"
msgid "Filament Used" msgid "Filament Used"
msgstr "Использование филамента" msgstr "Использование филамента"
msgid "Filament total:"
msgstr ""
msgid "Filament used:"
msgstr ""
msgid "Filament:"
msgstr ""
msgid "File" msgid "File"
msgstr "Файл" msgstr "Файл"
msgid "File:"
msgstr ""
msgid "Finding ADXL"
msgstr ""
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "Точная настройка" msgstr "Точная настройка"
@@ -210,6 +254,12 @@ msgstr ""
"Прошивка\n" "Прошивка\n"
"Рестарт" "Рестарт"
msgid "Flow:"
msgstr ""
msgid "Flowrate:"
msgstr ""
msgid "Font Size" msgid "Font Size"
msgstr "Размер шрифта" msgstr "Размер шрифта"
@@ -223,6 +273,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "Назад" msgstr "Назад"
msgid "Height:"
msgstr ""
msgid "Hidden" msgid "Hidden"
msgstr "Скрытый" msgstr "Скрытый"
@@ -232,6 +285,9 @@ msgstr "Скрывать"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "Скрыть датчики в Temp." msgstr "Скрыть датчики в Temp."
msgid "Hide temp."
msgstr ""
msgid "Home" msgid "Home"
msgstr "Парковка" msgstr "Парковка"
@@ -268,6 +324,9 @@ msgstr "Запуск"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "Принтер стартует..." msgstr "Принтер стартует..."
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "Интерфейс" msgstr "Интерфейс"
@@ -311,6 +370,9 @@ msgstr "Язык"
msgid "Large" msgid "Large"
msgstr "Большой" msgstr "Большой"
msgid "Layer:"
msgstr ""
msgid "Left:" msgid "Left:"
msgstr "Осталось:" msgstr "Осталось:"
@@ -332,8 +394,11 @@ msgstr "Макросы"
msgid "Main Menu" msgid "Main Menu"
msgstr "Главное меню" msgstr "Главное меню"
msgid "Max Accelation" msgid "Max"
msgstr "Ускорения" msgstr ""
msgid "Max Acceleration"
msgstr ""
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
msgstr "Ускорения торможения" msgstr "Ускорения торможения"
@@ -341,6 +406,15 @@ msgstr "Ускорения торможения"
msgid "Max Velocity" msgid "Max Velocity"
msgstr "Скорость" msgstr "Скорость"
msgid "Measure Both"
msgstr ""
msgid "Measure X"
msgstr ""
msgid "Measure Y"
msgstr ""
msgid "Medium" msgid "Medium"
msgstr "Среднее" msgstr "Среднее"
@@ -365,6 +439,9 @@ msgstr "Имя"
msgid "Network" msgid "Network"
msgstr "Сеть" msgstr "Сеть"
msgid "New"
msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Ничего не выбрано" msgstr "Ничего не выбрано"
@@ -384,6 +461,9 @@ msgstr[0] "Пакет будет обновлен"
msgstr[1] "Пакеты будут обновляться" msgstr[1] "Пакеты будут обновляться"
msgstr[2] "Пакеты будут обновляться" msgstr[2] "Пакеты будут обновляться"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "Пароль сохранен" msgstr "Пароль сохранен"
@@ -396,6 +476,9 @@ msgstr "Приостановлено"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "Выполнить полное обновление?" msgstr "Выполнить полное обновление?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "Пожалуйста, перекомпилируйте и прошейте микроконтроллер." msgstr "Пожалуйста, перекомпилируйте и прошейте микроконтроллер."
@@ -405,6 +488,9 @@ msgstr "Включено"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "Включить принтер" msgstr "Включить принтер"
msgid "Pressure Advance:"
msgstr ""
msgid "Print" msgid "Print"
msgstr "Печать" msgstr "Печать"
@@ -420,6 +506,9 @@ msgstr "Подключение принтера"
msgid "Printing" msgid "Printing"
msgstr "Печатается" msgstr "Печатается"
msgid "Probe Offset"
msgstr ""
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "Probe обнаружил примененное смещение" msgstr "Probe обнаружил примененное смещение"
@@ -450,18 +539,40 @@ msgstr "Продолжить"
msgid "Retract" msgid "Retract"
msgstr "Втянуть" msgstr "Втянуть"
msgid "Retraction"
msgstr ""
msgid "Retraction Length"
msgstr ""
msgid "Retraction Speed"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Повторить #%s" msgstr "Повторить #%s"
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "Сохранить" msgstr "Сохранить"
msgid "Save Config" msgid "Save Config"
msgstr "Сохр. Конфиг" msgstr "Сохр. Конфиг"
msgid "Save configuration" msgid "Save Z"
msgstr "Настройки сохраняются" msgstr ""
msgid "Save configuration?"
msgstr ""
msgid "Saved"
msgstr ""
#, python-format
msgid "Saved offset: %s"
msgstr ""
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "Экран DPMS" msgstr "Экран DPMS"
@@ -500,12 +611,18 @@ msgstr "Слайсер"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "Коррекция времени слайсера (%)" msgstr "Коррекция времени слайсера (%)"
msgid "Slicer:"
msgstr ""
msgid "Small" msgid "Small"
msgstr "Маленький" msgstr "Маленький"
msgid "Sort by: " msgid "Sort by: "
msgstr "Орден: " msgstr "Орден: "
msgid "Sort:"
msgstr ""
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "Скорость (мм/с)" msgstr "Скорость (мм/с)"
@@ -515,6 +632,9 @@ msgstr "Скорость +"
msgid "Speed -" msgid "Speed -"
msgstr "Скорость -" msgstr "Скорость -"
msgid "Speed:"
msgstr ""
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "Квадратная угловая скорость" msgstr "Квадратная угловая скорость"
@@ -555,9 +675,6 @@ msgstr "Tемпература"
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Чтобы применить %s необходимо перезапустить KlipperScreen" msgstr "Чтобы применить %s необходимо перезапустить KlipperScreen"
msgid "Tool"
msgstr "Инструмент"
msgid "Total:" msgid "Total:"
msgstr "Всего:" msgstr "Всего:"
@@ -567,6 +684,12 @@ msgstr "Неизвестный обогреватель"
msgid "Unload" msgid "Unload"
msgstr "Загружено" msgstr "Загружено"
msgid "Unretract Extra Length"
msgstr ""
msgid "Unretract Speed"
msgstr ""
msgid "Up To Date" msgid "Up To Date"
msgstr "Обновлено" msgstr "Обновлено"
@@ -591,6 +714,9 @@ msgstr "X-"
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "Скорость перемещения по осям XY (мм/с)" msgstr "Скорость перемещения по осям XY (мм/с)"
msgid "XY Speed (mm/s)"
msgstr ""
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr "Y+"
@@ -603,12 +729,15 @@ msgstr "Калибр. Z"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "Скорость перемещения по оси Z (мм/с)" msgstr "Скорость перемещения по оси Z (мм/с)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "Позиция Z" msgstr ""
msgid "Z Tilt" msgid "Z Tilt"
msgstr "Z Наклон" msgstr "Z Наклон"
msgid "Z offset:"
msgstr ""
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr "Z+"
@@ -639,8 +768,17 @@ msgstr "мм"
msgid "mm/s" msgid "mm/s"
msgstr "мм/с" msgstr "мм/с"
msgid "mm/s^2" msgid "mm/s²"
msgstr "мм/с^2" msgstr "мм/с²"
#~ msgid "Tool"
#~ msgstr "Инструмент"
#~ msgid "Displayed Macros"
#~ msgstr "Показать макросы"
#~ msgid "Z Position"
#~ msgstr "Позиция Z"
#~ msgid "IPv4" #~ msgid "IPv4"
#~ msgstr "IPv4" #~ msgstr "IPv4"
@@ -648,9 +786,6 @@ msgstr "мм/с^2"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Z Offset"
#~ msgstr "Офсет Z"
#~ msgid "Unknown Heater " #~ msgid "Unknown Heater "
#~ msgstr "Неизвестный обогреватель " #~ msgstr "Неизвестный обогреватель "
@@ -719,9 +854,6 @@ msgstr "мм/с^2"
#~ msgid "Fast" #~ msgid "Fast"
#~ msgstr "Быстро" #~ msgstr "Быстро"
#~ msgid "Set Speed"
#~ msgstr "Скорость"
#~ msgid "Slow" #~ msgid "Slow"
#~ msgstr "Mедленно" #~ msgstr "Mедленно"
@@ -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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-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"
@@ -31,9 +31,15 @@ msgstr "24 timmars tid"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "En FIRMWARE_RESTART kan lösa problemet." msgstr "En FIRMWARE_RESTART kan lösa problemet."
msgid "ADXL Not Configured"
msgstr ""
msgid "Abort" msgid "Abort"
msgstr "Avbryt" msgstr "Avbryt"
msgid "Acceleration:"
msgstr ""
msgid "Accept" msgid "Accept"
msgstr "Godkänn" msgstr "Godkänn"
@@ -46,6 +52,17 @@ msgstr "Lägg till skrivare"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "Lägg till mesh profil" msgstr "Lägg till mesh profil"
msgid "Apply"
msgstr ""
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr ""
#, python-format
msgid "Apply %s%.2f offset to Probe?"
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?"
@@ -64,16 +81,17 @@ msgstr "Är du säker på att du vill stänga av systemet?"
msgid "Auto" msgid "Auto"
msgstr "Automatisk" msgstr "Automatisk"
msgid "Auto-calibrate"
msgstr ""
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "Auto-scrolla" msgstr "Auto-scrolla"
#, fuzzy
msgid "Bed Level" msgid "Bed Level"
msgstr "Bed Level" msgstr ""
#, fuzzy
msgid "Bed Mesh" msgid "Bed Mesh"
msgstr "Bed Mesh" msgstr ""
msgid "Bltouch found applied offset" msgid "Bltouch found applied offset"
msgstr "Bltouch hittade tillämpad offset" msgstr "Bltouch hittade tillämpad offset"
@@ -81,9 +99,15 @@ msgstr "Bltouch hittade tillämpad offset"
msgid "Calibrate" msgid "Calibrate"
msgstr "Kalibrera" msgstr "Kalibrera"
msgid "Calibrated"
msgstr ""
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "Kalibrerad, spara konfiguration för att göra den permanent" msgstr "Kalibrerad, spara konfiguration för att göra den permanent"
msgid "Calibrating..."
msgstr ""
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "Kan inte ställa in över maxgränsen:" msgstr "Kan inte ställa in över maxgränsen:"
@@ -102,9 +126,8 @@ msgstr "Avbryter"
msgid "Cannot connect to Moonraker" msgid "Cannot connect to Moonraker"
msgstr "Kan inte ansluta till Moonraker" msgstr "Kan inte ansluta till Moonraker"
#, fuzzy
msgid "Channel" msgid "Channel"
msgstr "Kanal" msgstr ""
msgid "" msgid ""
"Check /tmp/KlipperScreen.log for more information.\n" "Check /tmp/KlipperScreen.log for more information.\n"
@@ -113,6 +136,12 @@ msgstr ""
"Kontrollera /tmp/KlipperScreen.log för mer information.\n" "Kontrollera /tmp/KlipperScreen.log för mer information.\n"
"Skicka in ett problem på GitHub för hjälp." "Skicka in ett problem på GitHub för hjälp."
msgid "Check ADXL Wiring"
msgstr ""
msgid "Clear"
msgstr ""
msgid "Close" msgid "Close"
msgstr "Stäng" msgstr "Stäng"
@@ -159,9 +188,6 @@ msgstr "Inaktivera motorer"
msgid "Disable XY" msgid "Disable XY"
msgstr "Inaktivera XY" msgstr "Inaktivera XY"
msgid "Displayed Macros"
msgstr "Makron visas"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "Avstånd (mm)" msgstr "Avstånd (mm)"
@@ -175,9 +201,8 @@ msgstr "Förfluten:"
msgid "Error" msgid "Error"
msgstr "Fel" msgstr "Fel"
#, fuzzy
msgid "Estimated Time Method" msgid "Estimated Time Method"
msgstr "Uppskattad tid metod" msgstr ""
msgid "Extrude" msgid "Extrude"
msgstr "Extrudera" msgstr "Extrudera"
@@ -194,13 +219,27 @@ msgstr "Misslyckades, justera positionen först"
msgid "Fan" msgid "Fan"
msgstr "Fläkt" msgstr "Fläkt"
#, fuzzy
msgid "Filament Used" msgid "Filament Used"
msgstr "Filament använt" msgstr ""
msgid "Filament total:"
msgstr ""
msgid "Filament used:"
msgstr ""
msgid "Filament:"
msgstr ""
msgid "File" msgid "File"
msgstr "Fil" msgstr "Fil"
msgid "File:"
msgstr ""
msgid "Finding ADXL"
msgstr ""
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "Finjustering" msgstr "Finjustering"
@@ -214,6 +253,12 @@ msgstr ""
"Firmware\n" "Firmware\n"
"Omstart" "Omstart"
msgid "Flow:"
msgstr ""
msgid "Flowrate:"
msgstr ""
msgid "Font Size" msgid "Font Size"
msgstr "Textstorlek" msgstr "Textstorlek"
@@ -227,6 +272,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "Gå tillbaka" msgstr "Gå tillbaka"
msgid "Height:"
msgstr ""
msgid "Hidden" msgid "Hidden"
msgstr "Dold" msgstr "Dold"
@@ -236,6 +284,9 @@ msgstr "Dölj"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "Dölj sensorer i Temp." msgstr "Dölj sensorer i Temp."
msgid "Hide temp."
msgstr ""
msgid "Home" msgid "Home"
msgstr "Hem" msgstr "Hem"
@@ -254,9 +305,8 @@ msgstr "Hem Y"
msgid "Home Z" msgid "Home Z"
msgstr "Hem Z" msgstr "Hem Z"
#, fuzzy
msgid "Homing" msgid "Homing"
msgstr "Homing" msgstr ""
msgid "Hostname" msgid "Hostname"
msgstr "Värdnamn" msgstr "Värdnamn"
@@ -273,6 +323,9 @@ msgstr "Initierar"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "Initierar skrivaren..." msgstr "Initierar skrivaren..."
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "Gränssnitt" msgstr "Gränssnitt"
@@ -295,9 +348,8 @@ msgstr ""
"Klipper\n" "Klipper\n"
"Omstart" "Omstart"
#, fuzzy
msgid "Klipper has disconnected" msgid "Klipper has disconnected"
msgstr "Klipper har kopplat från" msgstr ""
msgid "Klipper has encountered an error." msgid "Klipper has encountered an error."
msgstr "Klipper har stött på ett fel." msgstr "Klipper har stött på ett fel."
@@ -317,6 +369,9 @@ msgstr "Språk"
msgid "Large" msgid "Large"
msgstr "Stor" msgstr "Stor"
msgid "Layer:"
msgstr ""
msgid "Left:" msgid "Left:"
msgstr "Återstående:" msgstr "Återstående:"
@@ -338,17 +393,26 @@ msgstr "Makron"
msgid "Main Menu" msgid "Main Menu"
msgstr "Huvudmeny" msgstr "Huvudmeny"
#, fuzzy msgid "Max"
msgid "Max Accelation" msgstr ""
msgstr "Maximal acceleration"
msgid "Max Acceleration"
msgstr ""
#, fuzzy
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
msgstr "Maximal acceleration till inbromsning" msgstr ""
#, fuzzy
msgid "Max Velocity" msgid "Max Velocity"
msgstr "Maximal hastighet" msgstr ""
msgid "Measure Both"
msgstr ""
msgid "Measure X"
msgstr ""
msgid "Measure Y"
msgstr ""
msgid "Medium" msgid "Medium"
msgstr "Medium" msgstr "Medium"
@@ -374,15 +438,18 @@ msgstr "Namn"
msgid "Network" msgid "Network"
msgstr "Nätverk" msgstr "Nätverk"
msgid "New"
msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Inget valt" msgstr "Inget valt"
msgid "Off" msgid "Off"
msgstr "Avstängd" msgstr "Avstängd"
#, fuzzy, python-format #, python-format
msgid "Outdated by %d" msgid "Outdated by %d"
msgstr "Föråldrad med %d" msgstr ""
msgid "PSK for" msgid "PSK for"
msgstr "PSK för" msgstr "PSK för"
@@ -392,6 +459,9 @@ msgid_plural "Packages will be updated"
msgstr[0] "Paketet kommer att uppdateras" msgstr[0] "Paketet kommer att uppdateras"
msgstr[1] "Paketen kommer att uppdateras" msgstr[1] "Paketen kommer att uppdateras"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "Lösenordet har sparats" msgstr "Lösenordet har sparats"
@@ -404,6 +474,9 @@ msgstr "Pausad"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "Utför en fullständig uppgradering?" msgstr "Utför en fullständig uppgradering?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "Vänligen kompilera om och flasha mikrokontrollern." msgstr "Vänligen kompilera om och flasha mikrokontrollern."
@@ -413,45 +486,44 @@ msgstr "Ström"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "Slå på skrivaren" msgstr "Slå på skrivaren"
msgid "Pressure Advance:"
msgstr ""
msgid "Print" msgid "Print"
msgstr "Skriv ut" msgstr "Skriv ut"
msgid "Print Control" msgid "Print Control"
msgstr "Utskriftskontroll" msgstr "Utskriftskontroll"
#, fuzzy
msgid "Print Time" msgid "Print Time"
msgstr "Tid för utskrift" msgstr ""
#, fuzzy
msgid "Printer Connections" msgid "Printer Connections"
msgstr "Skrivaranslutningar" msgstr ""
msgid "Printing" msgid "Printing"
msgstr "Skriver ut" msgstr "Skriver ut"
#, fuzzy msgid "Probe Offset"
msgstr ""
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "Sond hittat tillämpad offset" msgstr ""
msgid "Profile Name:" msgid "Profile Name:"
msgstr "Profilens namn:" msgstr "Profilens namn:"
#, fuzzy
msgid "Quad Gantry Level" msgid "Quad Gantry Level"
msgstr "Quad Gantry nivå" msgstr ""
#, fuzzy
msgid "Raise Nozzle" msgid "Raise Nozzle"
msgstr "Höj munstycket" msgstr ""
#, fuzzy
msgid "Recover Hard" msgid "Recover Hard"
msgstr "Återhämta Hårt" msgstr ""
#, fuzzy
msgid "Recover Soft" msgid "Recover Soft"
msgstr "Återhämta Mjukt" msgstr ""
msgid "Reference" msgid "Reference"
msgstr "Referens" msgstr "Referens"
@@ -462,13 +534,24 @@ msgstr "Starta om"
msgid "Resume" msgid "Resume"
msgstr "Återuppta" msgstr "Återuppta"
#, fuzzy
msgid "Retract" msgid "Retract"
msgstr "Dra tillbaka" msgstr ""
#, fuzzy, python-format msgid "Retraction"
msgstr ""
msgid "Retraction Length"
msgstr ""
msgid "Retraction Speed"
msgstr ""
#, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Försök #%s" msgstr ""
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "Spara" msgstr "Spara"
@@ -476,19 +559,27 @@ msgstr "Spara"
msgid "Save Config" msgid "Save Config"
msgstr "Spara konfiguration" msgstr "Spara konfiguration"
msgid "Save configuration" msgid "Save Z"
msgstr "Spara konfigurationen" msgstr ""
msgid "Save configuration?"
msgstr ""
msgid "Saved"
msgstr ""
#, python-format
msgid "Saved offset: %s"
msgstr ""
#, fuzzy
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "DPMS för skärm" msgstr ""
msgid "Screen Power Off Time" msgid "Screen Power Off Time"
msgstr "Avstängningstid för skärmen" msgstr "Avstängningstid för skärmen"
#, fuzzy
msgid "Screws Adjust" msgid "Screws Adjust"
msgstr "Justera skruvar" msgstr ""
msgid "Select" msgid "Select"
msgstr "Välj" msgstr "Välj"
@@ -500,9 +591,8 @@ msgstr "Skicka"
msgid "Sending Power ON signal to: %s" msgid "Sending Power ON signal to: %s"
msgstr "Skickar ström PÅ-signal till: %s" msgstr "Skickar ström PÅ-signal till: %s"
#, fuzzy
msgid "Set Temp" msgid "Set Temp"
msgstr "Ställ in temp" msgstr ""
msgid "Settings" msgid "Settings"
msgstr "Inställningar" msgstr "Inställningar"
@@ -513,13 +603,14 @@ msgstr "Visa"
msgid "Size" msgid "Size"
msgstr "Storlek" msgstr "Storlek"
#, fuzzy
msgid "Slicer" msgid "Slicer"
msgstr "Slicer" msgstr ""
#, fuzzy
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "Slicer Tidskorrigering (%)" msgstr ""
msgid "Slicer:"
msgstr ""
msgid "Small" msgid "Small"
msgstr "Liten" msgstr "Liten"
@@ -527,6 +618,9 @@ msgstr "Liten"
msgid "Sort by: " msgid "Sort by: "
msgstr "Sortera efter: " msgstr "Sortera efter: "
msgid "Sort:"
msgstr ""
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "Hastighet (mm/s)" msgstr "Hastighet (mm/s)"
@@ -536,24 +630,23 @@ msgstr "Hastighet +"
msgid "Speed -" msgid "Speed -"
msgstr "Hastighet -" msgstr "Hastighet -"
#, fuzzy msgid "Speed:"
msgstr ""
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "Fyrkantig hörnhastighet" msgstr ""
msgid "Start" msgid "Start"
msgstr "Starta" msgstr "Starta"
#, fuzzy
msgid "Starting WiFi Association" msgid "Starting WiFi Association"
msgstr "Startar WiFi Association" msgstr ""
#, fuzzy
msgid "Starting recovery for" msgid "Starting recovery for"
msgstr "Startar återhämtning för" msgstr ""
#, fuzzy
msgid "Starting update for" msgid "Starting update for"
msgstr "Startar uppdatering för" msgstr ""
msgid "System" msgid "System"
msgstr "System" msgstr "System"
@@ -582,19 +675,20 @@ msgstr "Temperatur"
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "För att tillämpa %s måste KlipperScreen startas om" msgstr "För att tillämpa %s måste KlipperScreen startas om"
msgid "Tool"
msgstr "Verktyg"
#, fuzzy
msgid "Total:" msgid "Total:"
msgstr "Sammanlagt:" msgstr ""
msgid "Unknown Heater" msgid "Unknown Heater"
msgstr "Okänt värmeelement" msgstr "Okänt värmeelement"
#, fuzzy
msgid "Unload" msgid "Unload"
msgstr "Lasta av" msgstr ""
msgid "Unretract Extra Length"
msgstr ""
msgid "Unretract Speed"
msgstr ""
msgid "Up To Date" msgid "Up To Date"
msgstr "Aktuellt" msgstr "Aktuellt"
@@ -608,9 +702,8 @@ msgstr "Uppdaterar"
msgid "Uploaded" msgid "Uploaded"
msgstr "Uppladdad" msgstr "Uppladdad"
#, fuzzy
msgid "View Mesh" msgid "View Mesh"
msgstr "Visa Mesh" msgstr ""
msgid "X+" msgid "X+"
msgstr "X+" msgstr "X+"
@@ -621,6 +714,9 @@ msgstr "X-"
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "XY rörelsehastighet (mm/s)" msgstr "XY rörelsehastighet (mm/s)"
msgid "XY Speed (mm/s)"
msgstr ""
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr "Y+"
@@ -633,12 +729,14 @@ msgstr "Z Kalibrering"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "Z rörelsehastighet (mm/s)" msgstr "Z rörelsehastighet (mm/s)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "Z Position" msgstr ""
#, fuzzy
msgid "Z Tilt" msgid "Z Tilt"
msgstr "Z Lutning" msgstr ""
msgid "Z offset:"
msgstr ""
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr "Z+"
@@ -646,11 +744,10 @@ msgstr "Z+"
msgid "Z-" msgid "Z-"
msgstr "Z-" msgstr "Z-"
#, fuzzy
msgid "commit" msgid "commit"
msgid_plural "commits" msgid_plural "commits"
msgstr[0] "commit" msgstr[0] ""
msgstr[1] "commits" msgstr[1] ""
msgid "dBm" msgid "dBm"
msgstr "dBm" msgstr "dBm"
@@ -669,5 +766,14 @@ msgstr "mm"
msgid "mm/s" msgid "mm/s"
msgstr "mm/s" msgstr "mm/s"
msgid "mm/s^2" msgid "mm/s²"
msgstr "mm/s^2" msgstr "mm/s²"
#~ msgid "Tool"
#~ msgstr "Verktyg"
#~ msgid "Displayed Macros"
#~ msgstr "Makron visas"
#~ msgid "Z Position"
#~ msgstr "Z Position"
@@ -0,0 +1,779 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-12 22:17-0300\n"
"PO-Revision-Date: 2022-07-12 00:18+0300\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: tr_TR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.0.1\n"
#, python-format
msgid "%s will be updated to version"
msgstr "%s sürüme güncellenecektir"
msgid "(default)"
msgstr "(varsayılan)"
msgid "24 Hour Time"
msgstr "24 Saat Zaman"
msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "Bir FIRMWARE_RESTART sorunu çözebilir."
msgid "ADXL Not Configured"
msgstr "ADXL Yapılandırılmadı"
msgid "Abort"
msgstr "İptal et"
msgid "Acceleration:"
msgstr "Hızlanma:"
msgid "Accept"
msgstr "Kabul et"
msgid "Actions"
msgstr "Eylemler"
msgid "Add Printer"
msgstr "Yazıcı Ekle"
msgid "Add bed mesh profile"
msgstr "Tabla Örgüsü profili ekle"
msgid "Apply"
msgstr "Uygula"
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr "Sonlandırıcı için %.2f ofset uygula?"
#, python-format
msgid "Apply %s%.2f offset to Probe?"
msgstr "Prob için %s%.2f ofset uygula?"
msgid "Are you sure you want to run Emergency Stop?"
msgstr "Acil Durdurma'yı çalıştırmak istediğinizden emin misiniz?"
msgid "Are you sure you wish to cancel this print?"
msgstr "Bu baskıyı iptal etmek istediğinizden emin misiniz?"
msgid "Are you sure you wish to disable motors?"
msgstr "Motorları devre dışı bırakmak istediğinizden emin misiniz?"
msgid "Are you sure you wish to reboot the system?"
msgstr "Sistemi yeniden başlatmak istediğinizden emin misiniz?"
msgid "Are you sure you wish to shutdown the system?"
msgstr "Sistemi kapatmak istediğinizden emin misiniz?"
msgid "Auto"
msgstr "Otomatik"
msgid "Auto-calibrate"
msgstr "Otomatik-Kalibrasyon"
msgid "Auto-scroll"
msgstr "Otomatik kaydırma"
msgid "Bed Level"
msgstr "Tabla Ayarı"
msgid "Bed Mesh"
msgstr "Tabla Örgüsü"
msgid "Bltouch found applied offset"
msgstr "Bltouch uygulanmış ofseti buldu"
msgid "Calibrate"
msgstr "Kalibre et"
msgid "Calibrated"
msgstr "Kalibre Edildi"
msgid "Calibrated, save configuration to make it permanent"
msgstr "Kalibre edildi, kalıcı hale getirmek için yapılandırmayı kaydedin"
msgid "Calibrating..."
msgstr "Kalibre Ediliyor..."
msgid "Can't set above the maximum:"
msgstr "Maksimumun üzerine ayarlanamaz:"
msgid "Cancel"
msgstr "İptal"
msgid "Cancel Print"
msgstr "Baskıyı iptal et"
msgid "Cancelled"
msgstr "İptal edildi"
msgid "Cancelling"
msgstr "İptal ediliyor"
msgid "Cannot connect to Moonraker"
msgstr "Moonraker'a bağlanılamıyor"
msgid "Channel"
msgstr "Kanal"
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
"Daha fazla bilgi için /tmp/KlipperScreen.log'a bakın.\n"
"Lütfen yardım için GitHub'da bir sorun gönderin."
msgid "Check ADXL Wiring"
msgstr "ADXL Bağlantılarını Kontrol Et"
msgid "Clear"
msgstr "Temizle"
msgid "Close"
msgstr "Kapat"
msgid "Complete"
msgstr "Tamamlandı"
msgid "Configuration"
msgstr "Yapılandırma"
msgid "Confirm Emergency Stop"
msgstr "Acil Durdurmayı Onaylayın"
msgid "Connected"
msgstr "Bağlandı"
#, python-format
msgid "Connecting to %s"
msgstr "%s'e Bağlanılıyor"
msgid "Console"
msgstr "Konsol"
msgid "Continue"
msgstr "Devam et"
msgid "Cooldown"
msgstr "Soğutma"
msgid "Date"
msgstr "Tarih"
msgid "Decrease"
msgstr "Azalt"
msgid "Delete"
msgstr "Sil"
msgid "Deselect"
msgstr "Seçimi kaldır"
msgid "Disable Motors"
msgstr "Motorları Devre Dışı Bırak"
msgid "Disable XY"
msgstr "XY Devre dışı bırak"
msgid "Distance (mm)"
msgstr "Uzaklık (mm)"
#, python-format
msgid "Do you want to recover %s?"
msgstr "%s Kurtarmak istiyor musunuz?"
msgid "Elapsed:"
msgstr "Geçen:"
msgid "Error"
msgstr "Hata"
msgid "Estimated Time Method"
msgstr "Tahmini Zaman Metodu"
msgid "Extrude"
msgstr "Ekstrüzyon"
msgid "Extrusion +"
msgstr "Ekstrüzyon +"
msgid "Extrusion -"
msgstr "Ekstrüzyon -"
msgid "Failed, adjust position first"
msgstr "Başarısız, önce konumu ayarlayın"
msgid "Fan"
msgstr "Fan"
msgid "Filament Used"
msgstr "Kullanılan Filament"
msgid "Filament total:"
msgstr "Toplam Filament:"
msgid "Filament used:"
msgstr "Kullanılan Filament:"
msgid "Filament:"
msgstr "Filament:"
msgid "File"
msgstr "Dosya"
msgid "File:"
msgstr "Dosya:"
msgid "Finding ADXL"
msgstr "ADXL Bulunuyor"
msgid "Fine Tuning"
msgstr "İnce Ayar"
msgid "Finish"
msgstr "Bitir"
msgid ""
"Firmware\n"
"Restart"
msgstr ""
"Firmware\n"
"Yeniden Başlat"
msgid "Flow:"
msgstr "Akış:"
msgid "Flowrate:"
msgstr "Akış oranı:"
msgid "Font Size"
msgstr "Yazı boyutu"
msgid ""
"Full\n"
"Update"
msgstr ""
"Tam\n"
"Güncelleme"
msgid "Go Back"
msgstr "Geri git"
msgid "Height:"
msgstr "Yükseklik:"
msgid "Hidden"
msgstr "Gizli"
msgid "Hide"
msgstr "Gizle"
msgid "Hide sensors in Temp."
msgstr "Sıcaklıktaki sensörleri gizleyin."
msgid "Hide temp."
msgstr "Sıcaklığı gizle."
msgid "Home"
msgstr "Ana Ekran"
msgid "Home All"
msgstr "Eksenleri Sıfırla"
msgid "Home X"
msgstr "X Sıfırla"
msgid "Home XY"
msgstr "XY Sıfırla"
msgid "Home Y"
msgstr "Y Sıfırla"
msgid "Home Z"
msgstr "Z Sıfırla"
msgid "Homing"
msgstr "Eksen Sıfırlama"
msgid "Hostname"
msgstr "Ana bilgisayar adı"
msgid "Icon Theme"
msgstr "Simge Teması"
msgid "Increase"
msgstr "Artır"
msgid "Initializing"
msgstr "Başlatılıyor"
msgid "Initializing printer..."
msgstr "Yazıcı başlatılıyor..."
msgid "Input Shaper"
msgstr "İvme Düzenleyicisi"
msgid "Interface"
msgstr "Arayüz"
msgid "Invalid"
msgstr "Geçersiz"
msgid "Invert X"
msgstr "X Ters çevir"
msgid "Invert Y"
msgstr "Y Ters çevir"
msgid "Invert Z"
msgstr "Z Ters çevir"
msgid ""
"Klipper\n"
"Restart"
msgstr ""
"Klipper\n"
"Yeniden başlat"
msgid "Klipper has disconnected"
msgstr "Klipper bağlantısı kesildi"
msgid "Klipper has encountered an error."
msgstr "Klipper bir hatayla karşılaştı."
msgid "Klipper has shutdown"
msgstr "Klipper Kapandı"
msgid "Klipper is attempting to start"
msgstr "Klipper başlatılmaya çalışılıyor"
msgid "Klipper will reboot"
msgstr "Klipper yeniden başlayacak"
msgid "Language"
msgstr "Dil"
msgid "Large"
msgstr "Büyük"
msgid "Layer:"
msgstr "Katman:"
msgid "Left:"
msgstr "Kalan:"
msgid "Limits"
msgstr "Limitler"
msgid "Load"
msgstr "Yükle"
msgid "Lower Nozzle"
msgstr "Nozzle düşür"
msgid "Macro shortcut on sidebar"
msgstr "Kenar çubuğunda makro kısayolu"
msgid "Macros"
msgstr "Makrolar"
msgid "Main Menu"
msgstr "Ana Menü"
msgid "Max"
msgstr "Maks"
msgid "Max Acceleration"
msgstr "Maksimum Hızlanma"
msgid "Max Acceleration to Deceleration"
msgstr "Maksimum Hızlanma ve Yavaşlama"
msgid "Max Velocity"
msgstr "Maksimum Hız"
msgid "Measure Both"
msgstr "İkisini de ölçüle"
msgid "Measure X"
msgstr "X Ölçüle"
msgid "Measure Y"
msgstr "Y Ölçüle"
msgid "Medium"
msgstr "Orta"
msgid "Menu"
msgstr "Menü"
msgid "Modified"
msgstr "Değiştirilmiş"
msgid "Moonraker: connected"
msgstr "Moonraker: bağlandı"
msgid "Move"
msgstr "Hareket"
msgid "Move Distance (mm)"
msgstr "Hareket Mesafesi (mm)"
msgid "Name"
msgstr "İsim"
msgid "Network"
msgstr "Ağ"
msgid "New"
msgstr "Yeni"
msgid "Nothing selected"
msgstr "Hiçbir şey seçilmedi"
msgid "Off"
msgstr "Kapa"
#, python-format
msgid "Outdated by %d"
msgstr "Güncelliğini yitiren %d"
msgid "PSK for"
msgstr "PSK için"
msgid "Package will be updated"
msgid_plural "Packages will be updated"
msgstr[0] "Paket yükseltilecek"
msgstr[1] "Paketler yükseltilecek"
msgid "Part Fan"
msgstr ""
msgid "Password saved"
msgstr "Şifre kaydedildi"
msgid "Pause"
msgstr "Duraklat"
msgid "Paused"
msgstr "Duraklatıldı"
msgid "Perform a full upgrade?"
msgstr "Tam yükseltme yap?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller."
msgstr "Lütfen mikro denetleyiciyi yeniden derleyin ve flaşlayın."
msgid "Power"
msgstr "Güç"
msgid "Power On Printer"
msgstr "Yazıcıya Güç Ver (aç)"
msgid "Pressure Advance:"
msgstr "Akış Dengeleme:"
msgid "Print"
msgstr "Yazdır"
msgid "Print Control"
msgstr "Yazdırma Kontrolü"
msgid "Print Time"
msgstr "Yazdırma Süresi"
msgid "Printer Connections"
msgstr "Yazıcı Bağlantıları"
msgid "Printing"
msgstr "Yazdırılıyor"
msgid "Probe Offset"
msgstr "Prob ofseti"
msgid "Probe found applied offset"
msgstr "Prob uygulanmış ofset bulundu"
msgid "Profile Name:"
msgstr "Profil ismi:"
msgid "Quad Gantry Level"
msgstr "Dörtlü Köprü Seviyesi"
msgid "Raise Nozzle"
msgstr "Nozzle yükselt"
msgid "Recover Hard"
msgstr "Zorla Kurtar"
msgid "Recover Soft"
msgstr "Yumuşak Kurtar"
msgid "Reference"
msgstr "Referans"
msgid "Restart"
msgstr "Yeniden Başlat"
msgid "Resume"
msgstr "Devam Et"
msgid "Retract"
msgstr "Geri çek"
msgid "Retraction"
msgstr "Geri Çekme"
msgid "Retraction Length"
msgstr "Geri Çekme Uzunluğu"
msgid "Retraction Speed"
msgstr "Geri Çekme Hızı"
#, python-format
msgid "Retry #%s"
msgstr "Yeniden Dene #%s"
msgid "Retrying"
msgstr ""
msgid "Save"
msgstr "Kaydet"
msgid "Save Config"
msgstr "Yapılandırma Kayıt"
msgid "Save Z"
msgstr "Z Kaydet"
msgid "Save configuration?"
msgstr "Yapılandırmayı kaydet?"
msgid "Saved"
msgstr "Kaydedildi"
#, python-format
msgid "Saved offset: %s"
msgstr "Kaydedilen ofset: %s"
msgid "Screen DPMS"
msgstr "Ekran DPMS"
msgid "Screen Power Off Time"
msgstr "Ekran kapatma zamanı"
msgid "Screws Adjust"
msgstr "Vida Ayarı"
msgid "Select"
msgstr "Seç"
msgid "Send"
msgstr "Gönder"
#, python-format
msgid "Sending Power ON signal to: %s"
msgstr "Güç AÇ sinyalı gönderilen: %s"
msgid "Set Temp"
msgstr "Sıcaklık Ayarla"
msgid "Settings"
msgstr "Ayarlar"
msgid "Show"
msgstr "Göster"
msgid "Size"
msgstr "Boyut"
msgid "Slicer"
msgstr "Dilimleme"
msgid "Slicer Time correction (%)"
msgstr "Dilimleme Zamanı doğrulama (%)"
msgid "Slicer:"
msgstr "Dilimleyici:"
msgid "Small"
msgstr "Küçük"
msgid "Sort by: "
msgstr "Sırala: "
msgid "Sort:"
msgstr "Sırala:"
msgid "Speed (mm/s)"
msgstr "Hız (mm/s)"
msgid "Speed +"
msgstr "Hız +"
msgid "Speed -"
msgstr "Hız -"
msgid "Speed:"
msgstr "Hız:"
msgid "Square Corner Velocity"
msgstr "Kare Köşe Hızı"
msgid "Start"
msgstr "Başlat"
msgid "Starting WiFi Association"
msgstr "WiFi Bağlantısı başlatılıyor"
msgid "Starting recovery for"
msgstr "Kurtarma başlatılıyor"
msgid "Starting update for"
msgstr "Güncelleme başlatılıyor"
msgid "System"
msgstr "Sistem"
msgid ""
"System\n"
"Restart"
msgstr ""
"Sistem\n"
"Yeniden Başlat"
msgid ""
"System\n"
"Shutdown"
msgstr ""
"Sistem\n"
"Kapat"
msgid "Temp (°C)"
msgstr "Sıcaklık (°C)"
msgid "Temperature"
msgstr "Sıcaklık"
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Uygulamak için %s KlipperScreen yeniden başlatılmalı"
msgid "Total:"
msgstr "Toplam:"
msgid "Unknown Heater"
msgstr "Bilinmeyen Isıtıcı"
msgid "Unload"
msgstr "Boşalt"
msgid "Unretract Extra Length"
msgstr "İleri İtme Ekstra Uzunluk"
msgid "Unretract Speed"
msgstr "İleri itme Hızı"
msgid "Up To Date"
msgstr "Güncel"
msgid "Update"
msgstr "Güncelle"
msgid "Updating"
msgstr "Yükleniyor"
msgid "Uploaded"
msgstr "Yüklendi"
msgid "View Mesh"
msgstr "Örgüyü Görüntüle"
msgid "X+"
msgstr "X+"
msgid "X-"
msgstr "X-"
msgid "XY Move Speed (mm/s)"
msgstr "XY Hareket hızı (mm/s)"
msgid "XY Speed (mm/s)"
msgstr "XY Hızı (mm/s)"
msgid "Y+"
msgstr "Y+"
msgid "Y-"
msgstr "Y-"
msgid "Z Calibrate"
msgstr "Z Kalibrasyonu"
msgid "Z Move Speed (mm/s)"
msgstr "Z Hareket hızı (mm/s)"
msgid "Z Speed (mm/s)"
msgstr "Z Hızı (mm/s)"
msgid "Z Tilt"
msgstr "Z Eğim"
msgid "Z offset:"
msgstr "Z ofset:"
msgid "Z+"
msgstr "Z+"
msgid "Z-"
msgstr "Z-"
msgid "commit"
msgid_plural "commits"
msgstr[0] "commit"
msgstr[1] "commits"
msgid "dBm"
msgstr "dBm"
msgid "hour"
msgid_plural "hours"
msgstr[0] "saat"
msgstr[1] "saatler"
msgid "minutes"
msgstr "dakika"
msgid "mm"
msgstr "mm"
msgid "mm/s"
msgstr "mm/s"
msgid "mm/s²"
msgstr "mm/s²"
#~ msgid "Tool"
#~ msgstr "Araç"
#~ msgid "Displayed Macros"
#~ msgstr "Görüntülenen Makrolar"
#~ msgid "Z Position"
#~ msgstr "Z Pozisyonu"
@@ -5,19 +5,20 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: 2022-06-02 14:53-0300\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-0300\n"
"PO-Revision-Date: 2022-03-31 11:18-0300\n" "PO-Revision-Date: 2022-06-03 10:02+0300\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: Andrii Komarovskiy\n" "Language-Team: Andrii Komarovskyi\n"
"Language: uk_UA\n" "Language: uk\n"
"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 && n"
"%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\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-SourceCharset: UTF-8\n"
#, python-format #, python-format
msgid "%s will be updated to version" msgid "%s will be updated to version"
@@ -32,9 +33,15 @@ msgstr "24-годинний час"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "РЕСТАРТ ПРОШИВКИ може вирішити проблему." msgstr "РЕСТАРТ ПРОШИВКИ може вирішити проблему."
msgid "ADXL Not Configured"
msgstr "ADXL не налаштовано"
msgid "Abort" msgid "Abort"
msgstr "Перервати" msgstr "Перервати"
msgid "Acceleration:"
msgstr "Прискорення:"
msgid "Accept" msgid "Accept"
msgstr "Прийняти" msgstr "Прийняти"
@@ -47,6 +54,17 @@ msgstr "Додати принтер"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "Додати сітку столу" msgstr "Додати сітку столу"
msgid "Apply"
msgstr "Застосувати"
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr "Застосувати зміщення %.2f до кінцевика?"
#, python-format
msgid "Apply %s%.2f offset to Probe?"
msgstr "Застосувати зміщення %s%.2f до зонда?"
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "Ви впевнені, що хочете запустити аварійну зупинку?" msgstr "Ви впевнені, що хочете запустити аварійну зупинку?"
@@ -54,7 +72,7 @@ msgid "Are you sure you wish to cancel this print?"
msgstr "Ви впевнені, що хочете скасувати цей друк?" msgstr "Ви впевнені, що хочете скасувати цей друк?"
msgid "Are you sure you wish to disable motors?" msgid "Are you sure you wish to disable motors?"
msgstr "Ви впевнені, що хочете відключити двигуни?" msgstr "Ви дійсно бажаєте вимкнути двигуни?"
msgid "Are you sure you wish to reboot the system?" msgid "Are you sure you wish to reboot the system?"
msgstr "Ви впевнені, що хочете перезавантажити систему?" msgstr "Ви впевнені, що хочете перезавантажити систему?"
@@ -65,6 +83,9 @@ msgstr "Ви впевнені, що хочете вимкнути систему
msgid "Auto" msgid "Auto"
msgstr "Автоматично" msgstr "Автоматично"
msgid "Auto-calibrate"
msgstr "Автоматичне калібрування"
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "Автоматична прокрутка" msgstr "Автоматична прокрутка"
@@ -80,14 +101,20 @@ msgstr "Зонд знайшов застосоване зміщення"
msgid "Calibrate" msgid "Calibrate"
msgstr "Калібрування" msgstr "Калібрування"
msgid "Calibrated"
msgstr "Відкалібрований"
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "Відкалібровано, збережіть конфігурацію, щоб зробити її постійною" msgstr "Відкалібровано, збережіть конфігурацію, щоб зробити її постійною"
msgid "Calibrating..."
msgstr "Калібрування..."
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "Не встановити вище макс.:" msgstr "Не встановити вище макс.:"
msgid "Cancel" msgid "Cancel"
msgstr "Скасувати" msgstr "СКАСУВАТИ"
msgid "Cancel Print" msgid "Cancel Print"
msgstr "Скасувати друк" msgstr "Скасувати друк"
@@ -111,6 +138,12 @@ msgstr ""
"Перевірте /tmp/KlipperScreen.log для отримання додаткової інформації.\n" "Перевірте /tmp/KlipperScreen.log для отримання додаткової інформації.\n"
"Будь ласка, надішліть проблему на GitHub, щоб отримати допомогу." "Будь ласка, надішліть проблему на GitHub, щоб отримати допомогу."
msgid "Check ADXL Wiring"
msgstr "Перевірте підключення ADXL"
msgid "Clear"
msgstr "Очистити"
msgid "Close" msgid "Close"
msgstr "Закрити" msgstr "Закрити"
@@ -157,9 +190,6 @@ msgstr "Вимкнути мотори"
msgid "Disable XY" msgid "Disable XY"
msgstr "Вимкнути XY" msgstr "Вимкнути XY"
msgid "Displayed Macros"
msgstr "Відображення Макросів"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "Відстань (мм)" msgstr "Відстань (мм)"
@@ -194,9 +224,24 @@ msgstr "Вентилятор"
msgid "Filament Used" msgid "Filament Used"
msgstr "Філамент" msgstr "Філамент"
msgid "Filament total:"
msgstr "Загальна кількість прутка:"
msgid "Filament used:"
msgstr "Використано прутка:"
msgid "Filament:"
msgstr "Пруток:"
msgid "File" msgid "File"
msgstr "Файл" msgstr "Файл"
msgid "File:"
msgstr "Файл:"
msgid "Finding ADXL"
msgstr "Знаходження ADXL"
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "Підправити" msgstr "Підправити"
@@ -207,8 +252,14 @@ msgid ""
"Firmware\n" "Firmware\n"
"Restart" "Restart"
msgstr "" msgstr ""
"Firmware\n" "Перезапуск\n"
"Перезавантажте" "Прошивки"
msgid "Flow:"
msgstr "Потік:"
msgid "Flowrate:"
msgstr "Швидкість потоку:"
msgid "Font Size" msgid "Font Size"
msgstr "Розмір шрифту" msgstr "Розмір шрифту"
@@ -217,20 +268,26 @@ msgid ""
"Full\n" "Full\n"
"Update" "Update"
msgstr "" msgstr ""
"Повний\n" "Повне\n"
"Оновлення" "Оновлення"
msgid "Go Back" msgid "Go Back"
msgstr "Назад" msgstr "Назад"
msgid "Height:"
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 "Сховати датчик t°."
msgid "Hide temp."
msgstr "Приховати темп."
msgid "Home" msgid "Home"
msgstr "Домашня сторінка" msgstr "Домашня сторінка"
@@ -268,6 +325,9 @@ msgstr "Ініціалізація"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "Ініціалізація принтера..." msgstr "Ініціалізація принтера..."
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "Інтерфейс" msgstr "Інтерфейс"
@@ -287,8 +347,8 @@ msgid ""
"Klipper\n" "Klipper\n"
"Restart" "Restart"
msgstr "" msgstr ""
"Klipper\n" "Перезапуск\n"
"Перезавантажте" "Кліппера"
msgid "Klipper has disconnected" msgid "Klipper has disconnected"
msgstr "Klipper відключився" msgstr "Klipper відключився"
@@ -311,6 +371,9 @@ msgstr "Мова"
msgid "Large" msgid "Large"
msgstr "Великий" msgstr "Великий"
msgid "Layer:"
msgstr "Шар:"
msgid "Left:" msgid "Left:"
msgstr "Залишилось:" msgstr "Залишилось:"
@@ -332,7 +395,10 @@ msgstr "Макрос"
msgid "Main Menu" msgid "Main Menu"
msgstr "Main Menu" msgstr "Main Menu"
msgid "Max Accelation" msgid "Max"
msgstr ""
msgid "Max Acceleration"
msgstr "Макс. прискорення" msgstr "Макс. прискорення"
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
@@ -341,6 +407,15 @@ msgstr "Макс. прискорення до гальмування"
msgid "Max Velocity" msgid "Max Velocity"
msgstr "Макс. швидкість" msgstr "Макс. швидкість"
msgid "Measure Both"
msgstr "Виміряти все"
msgid "Measure X"
msgstr "Виміряти X"
msgid "Measure Y"
msgstr "Виміряти Y"
msgid "Medium" msgid "Medium"
msgstr "Середній" msgstr "Середній"
@@ -365,6 +440,9 @@ msgstr "Ім'я"
msgid "Network" msgid "Network"
msgstr "Сітка" msgstr "Сітка"
msgid "New"
msgstr "Новий"
msgid "Nothing selected" msgid "Nothing selected"
msgstr "Не вибрано" msgstr "Не вибрано"
@@ -381,21 +459,27 @@ msgstr "PSK для"
msgid "Package will be updated" msgid "Package will be updated"
msgid_plural "Packages will be updated" msgid_plural "Packages will be updated"
msgstr[0] "Пакет буде оновлено" msgstr[0] "Пакет буде оновлено"
msgstr[1] "Пакет буде оновлено" msgstr[1] "Пакет оновлено"
msgstr[2] "Пакет буде оновлено" msgstr[2] "Пакет оновлено"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "Пароль збережено" msgstr "Пароль збережено"
msgid "Pause" msgid "Pause"
msgstr "Пауза" msgstr "ПАУЗА"
msgid "Paused" msgid "Paused"
msgstr "Пауза" msgstr "ПАУЗА"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "Виконати повне оновлення?" msgstr "Виконати повне оновлення?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "Будь ласка, перекомпілюйте та перепрошійте мікроконтролер." msgstr "Будь ласка, перекомпілюйте та перепрошійте мікроконтролер."
@@ -405,6 +489,9 @@ msgstr "Живлення"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "Увімкнути принтер" msgstr "Увімкнути принтер"
msgid "Pressure Advance:"
msgstr "Випередження тиску:"
msgid "Print" msgid "Print"
msgstr "Друк" msgstr "Друк"
@@ -420,6 +507,9 @@ msgstr "Підключення принтера"
msgid "Printing" msgid "Printing"
msgstr "Друк" msgstr "Друк"
msgid "Probe Offset"
msgstr "Зміщення зонда"
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "Зонд знайшов застосоване зміщення" msgstr "Зонд знайшов застосоване зміщення"
@@ -445,23 +535,45 @@ msgid "Restart"
msgstr "Перезапуск" msgstr "Перезапуск"
msgid "Resume" msgid "Resume"
msgstr "Відновити" msgstr "ВІДНОВИТИ"
msgid "Retract" msgid "Retract"
msgstr "Ретракт" msgstr "Ретракт"
msgid "Retraction"
msgstr "Втягнення"
msgid "Retraction Length"
msgstr "Довжина втягування"
msgid "Retraction Speed"
msgstr "Швидкість втягування"
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "Повторіть #%s" msgstr "Повторіть #%s"
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "Зберегти" msgstr "Зберегти"
msgid "Save Config" msgid "Save Config"
msgstr "Зберегти конфіг" msgstr "Зберегти конфіг"
msgid "Save configuration" msgid "Save Z"
msgstr "Зберегти конфігурацію" msgstr "Зберегти Z"
msgid "Save configuration?"
msgstr "Зберегти конфігурацію?"
msgid "Saved"
msgstr "Збережено"
#, python-format
msgid "Saved offset: %s"
msgstr "Збережено зміщення: %s"
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "Екран DPMS" msgstr "Екран DPMS"
@@ -500,12 +612,18 @@ msgstr "Слайсер"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "Виправлення часу слайсера (%)" msgstr "Виправлення часу слайсера (%)"
msgid "Slicer:"
msgstr "Слайсер:"
msgid "Small" msgid "Small"
msgstr "Малий" msgstr "Малий"
msgid "Sort by: " msgid "Sort by: "
msgstr "Сортувати за: " msgstr "Сортувати за: "
msgid "Sort:"
msgstr "Сортувати:"
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "Швидкість (мм/с)" msgstr "Швидкість (мм/с)"
@@ -515,11 +633,14 @@ msgstr "Швидкість +"
msgid "Speed -" msgid "Speed -"
msgstr "Швидкість -" msgstr "Швидкість -"
msgid "Speed:"
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"
@@ -557,9 +678,6 @@ msgstr "Температура"
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Щоб застосувати %s, потрібно перезапустити KlipperScreen" msgstr "Щоб застосувати %s, потрібно перезапустити KlipperScreen"
msgid "Tool"
msgstr "Інструмент"
msgid "Total:" msgid "Total:"
msgstr "Всього:" msgstr "Всього:"
@@ -569,13 +687,18 @@ msgstr "Невідомий нагрівач"
msgid "Unload" msgid "Unload"
msgstr "Вийняти" msgstr "Вийняти"
msgid "Unretract Extra Length"
msgstr "Додаткова довжина втягування"
msgid "Unretract Speed"
msgstr "Швидкість повернення"
msgid "Up To Date" msgid "Up To Date"
msgstr "Оновити" msgstr "Оновити"
msgid "Update" msgid "Update"
msgstr "Оновлення" msgstr "Оновлення"
#, fuzzy
msgid "Updating" msgid "Updating"
msgstr "Оновлення" msgstr "Оновлення"
@@ -592,6 +715,9 @@ msgid "X-"
msgstr "X-" msgstr "X-"
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "Швидкість переміщення XY (мм/с)"
msgid "XY Speed (mm/s)"
msgstr "Швидкість XY (мм/с)" msgstr "Швидкість XY (мм/с)"
msgid "Y+" msgid "Y+"
@@ -604,14 +730,17 @@ msgid "Z Calibrate"
msgstr "Калібровка Z" msgstr "Калібровка Z"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "Швидкість Z (мм/с)" msgstr "Швидкість переміщення Z (мм/с)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "Позиція Z" msgstr "Швидкість Z (мм/с)"
msgid "Z Tilt" msgid "Z Tilt"
msgstr "Z Нахил" msgstr "Z Нахил"
msgid "Z offset:"
msgstr "Зміщення по Z:"
msgid "Z+" msgid "Z+"
msgstr "Бебістеп Z+" msgstr "Бебістеп Z+"
@@ -621,8 +750,8 @@ msgstr "Бебістеп Z-"
msgid "commit" msgid "commit"
msgid_plural "commits" msgid_plural "commits"
msgstr[0] "коментар" msgstr[0] "коментар"
msgstr[1] "коментар" msgstr[1] "коментарі"
msgstr[2] "коментар" msgstr[2] "коментарі"
msgid "dBm" msgid "dBm"
msgstr "dBm" msgstr "dBm"
@@ -631,7 +760,7 @@ msgid "hour"
msgid_plural "hours" msgid_plural "hours"
msgstr[0] "година" msgstr[0] "година"
msgstr[1] "години" msgstr[1] "години"
msgstr[2] "годин" msgstr[2] "години"
msgid "minutes" msgid "minutes"
msgstr "хвилин" msgstr "хвилин"
@@ -642,14 +771,8 @@ msgstr "мм"
msgid "mm/s" msgid "mm/s"
msgstr "мм/с" msgstr "мм/с"
msgid "mm/s^2" msgid "mm/s²"
msgstr "мм/с²" msgstr "мм/с²"
#~ msgid "IPv4" #~ msgid "Tool"
#~ msgstr "IPv4" #~ msgstr "Інструмент"
#~ msgid "IPv6"
#~ msgstr "IPv6"
#~ msgid "Z Offset"
#~ msgstr "Зміщення Z"
@@ -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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-0300\n"
"PO-Revision-Date: 2022-03-31 11:21-0300\n" "PO-Revision-Date: 2022-07-16 23:03+0800\n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
"Language: zh_CN\n" "Language: zh_CN\n"
@@ -16,29 +16,35 @@ 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=1; plural=0;\n" "Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.0.1\n" "X-Generator: Poedit 3.0\n"
#, python-format #, python-format
msgid "%s will be updated to version" 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 小时制"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "FIRMWARE_RESTART 可能会解决此问题。" msgstr "\"FIRMWARE_RESTART\" 可能会解决这个问题。"
msgid "ADXL Not Configured"
msgstr "未配置ADXL"
msgid "Abort" msgid "Abort"
msgstr "终止" msgstr "取消"
msgid "Acceleration:"
msgstr "加速度:"
msgid "Accept" msgid "Accept"
msgstr "接受" msgstr "应用"
msgid "Actions" msgid "Actions"
msgstr "工具" msgstr "控制"
msgid "Add Printer" msgid "Add Printer"
msgstr "添加打印机" msgstr "添加打印机"
@@ -46,6 +52,17 @@ msgstr "添加打印机"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "添加热床网格" msgstr "添加热床网格"
msgid "Apply"
msgstr "应用"
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr "对Endstop应用%.2f的偏移量?"
#, python-format
msgid "Apply %s%.2f offset to Probe?"
msgstr "将%s%.2f的偏移量应用于探针?"
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "您确定要紧急停止吗?" msgstr "您确定要紧急停止吗?"
@@ -53,16 +70,19 @@ msgid "Are you sure you wish to cancel this print?"
msgstr "您确定要取消打印吗?" msgstr "您确定要取消打印吗?"
msgid "Are you sure you wish to disable motors?" msgid "Are you sure you wish to disable motors?"
msgstr "您确定要禁用电机吗?" msgstr "您确定要关闭电机吗?"
msgid "Are you sure you wish to reboot the system?" 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"
msgstr "自动校准"
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "自动滚屏" msgstr "自动滚屏"
@@ -79,9 +99,15 @@ msgstr "Bltouch 发现应用的偏移量"
msgid "Calibrate" msgid "Calibrate"
msgstr "校准" msgstr "校准"
msgid "Calibrated"
msgstr "已校准"
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "已校准,保存配置后生效" msgstr "已校准,保存配置后生效"
msgid "Calibrating..."
msgstr "校准中..."
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "设置值超出最大值:" msgstr "设置值超出最大值:"
@@ -98,7 +124,7 @@ msgid "Cancelling"
msgstr "正在取消" msgstr "正在取消"
msgid "Cannot connect to Moonraker" msgid "Cannot connect to Moonraker"
msgstr "无法连接到 Moonraker" msgstr "无法连接到Moonraker"
msgid "Channel" msgid "Channel"
msgstr "更新通道" msgstr "更新通道"
@@ -110,6 +136,12 @@ msgstr ""
"检查/tmp/KlipperScreen.log以获取更多信息。\n" "检查/tmp/KlipperScreen.log以获取更多信息。\n"
"请在GitHub上提交问题以寻求帮助。" "请在GitHub上提交问题以寻求帮助。"
msgid "Check ADXL Wiring"
msgstr "检查ADXL的接线"
msgid "Clear"
msgstr "清楚"
msgid "Close" msgid "Close"
msgstr "关闭" msgstr "关闭"
@@ -117,7 +149,7 @@ msgid "Complete"
msgstr "完成" msgstr "完成"
msgid "Configuration" msgid "Configuration"
msgstr "配置" msgstr "设置"
msgid "Confirm Emergency Stop" msgid "Confirm Emergency Stop"
msgstr "确认紧急停止" msgstr "确认紧急停止"
@@ -136,10 +168,10 @@ msgid "Continue"
msgstr "继续" msgstr "继续"
msgid "Cooldown" msgid "Cooldown"
msgstr "降温" msgstr "冷却"
msgid "Date" msgid "Date"
msgstr "上传日期" msgstr "日期"
msgid "Decrease" msgid "Decrease"
msgstr "减少" msgstr "减少"
@@ -151,23 +183,20 @@ msgid "Deselect"
msgstr "取消选择" msgstr "取消选择"
msgid "Disable Motors" msgid "Disable Motors"
msgstr "禁用步进电机" msgstr "关闭电机"
msgid "Disable XY" msgid "Disable XY"
msgstr "关闭 XY 电机" msgstr "关闭 XY 轴电机"
msgid "Displayed Macros"
msgstr "宏命令显示开关"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "挤出距离(mm)" msgstr "挤出长度(mm)"
#, python-format #, python-format
msgid "Do you want to recover %s?" msgid "Do you want to recover %s?"
msgstr "您想恢复 %s 吗?" msgstr "您想恢复 %s 吗?"
msgid "Elapsed:" msgid "Elapsed:"
msgstr "已用时间:" msgstr "已用时间:"
msgid "Error" msgid "Error"
msgstr "错误" msgstr "错误"
@@ -176,7 +205,7 @@ msgid "Estimated Time Method"
msgstr "估算剩余时间方式" msgstr "估算剩余时间方式"
msgid "Extrude" msgid "Extrude"
msgstr "挤出" msgstr "挤出机"
msgid "Extrusion +" msgid "Extrusion +"
msgstr "挤出流量 +" msgstr "挤出流量 +"
@@ -193,9 +222,24 @@ msgstr "风扇"
msgid "Filament Used" msgid "Filament Used"
msgstr "已用耗材" msgstr "已用耗材"
msgid "Filament total:"
msgstr "使用耗材总数:"
msgid "Filament used:"
msgstr "使用耗材:"
msgid "Filament:"
msgstr "耗材:"
msgid "File" msgid "File"
msgstr "文件" msgstr "文件"
msgid "File:"
msgstr "文件:"
msgid "Finding ADXL"
msgstr "寻找ADXL"
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "微调" msgstr "微调"
@@ -209,6 +253,12 @@ msgstr ""
"重启\n" "重启\n"
"Firmware" "Firmware"
msgid "Flow:"
msgstr "流量:"
msgid "Flowrate:"
msgstr "流量:"
msgid "Font Size" msgid "Font Size"
msgstr "字体大小" msgstr "字体大小"
@@ -216,38 +266,44 @@ msgid ""
"Full\n" "Full\n"
"Update" "Update"
msgstr "" msgstr ""
"满的\n" "全部\n"
"更新" "更新"
msgid "Go Back" msgid "Go Back"
msgstr "返回" msgstr "返回"
msgid "Height:"
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."
msgstr "隐藏温度。"
msgid "Home" msgid "Home"
msgstr "归零" msgstr "首页"
msgid "Home All" msgid "Home All"
msgstr "全部归零" msgstr "全部归零"
msgid "Home X" msgid "Home X"
msgstr "归零 X" msgstr "X轴归零"
msgid "Home XY" msgid "Home XY"
msgstr "归零 XY" msgstr "XY轴归零"
msgid "Home Y" msgid "Home Y"
msgstr "归零 Y" msgstr "Y轴归零"
msgid "Home Z" msgid "Home Z"
msgstr "归零 Z" msgstr "Z轴归零"
msgid "Homing" msgid "Homing"
msgstr "归零" msgstr "归零"
@@ -262,11 +318,14 @@ msgid "Increase"
msgstr "增加" msgstr "增加"
msgid "Initializing" msgid "Initializing"
msgstr "初始化中" msgstr "初始化"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "初始化打印机中..." msgstr "初始化打印机中..."
msgid "Input Shaper"
msgstr "共振补偿"
msgid "Interface" msgid "Interface"
msgstr "接口" msgstr "接口"
@@ -274,13 +333,13 @@ msgid "Invalid"
msgstr "无效" msgstr "无效"
msgid "Invert X" msgid "Invert X"
msgstr "反转 X" msgstr "反转X轴"
msgid "Invert Y" msgid "Invert Y"
msgstr "反转 Y" msgstr "反转Y轴"
msgid "Invert Z" msgid "Invert Z"
msgstr "反转 Z" msgstr "反转Z轴"
msgid "" msgid ""
"Klipper\n" "Klipper\n"
@@ -299,17 +358,20 @@ msgid "Klipper has shutdown"
msgstr "Klipper 已关闭" msgstr "Klipper 已关闭"
msgid "Klipper is attempting to start" msgid "Klipper is attempting to start"
msgstr "Klipper 正在尝试启动" msgstr "Klipper正在启动"
msgid "Klipper will reboot" msgid "Klipper will reboot"
msgstr "并重新启动Klipper" msgstr "Klipper将重新启动"
msgid "Language" msgid "Language"
msgstr "界面语言" msgstr "语言"
msgid "Large" msgid "Large"
msgstr "大" msgstr "大"
msgid "Layer:"
msgstr "层:"
msgid "Left:" msgid "Left:"
msgstr "剩余时间:" msgstr "剩余时间:"
@@ -331,14 +393,26 @@ msgstr "宏"
msgid "Main Menu" msgid "Main Menu"
msgstr "主菜单" msgstr "主菜单"
msgid "Max Accelation" msgid "Max"
msgstr "加速度" msgstr "最大"
msgid "Max Acceleration"
msgstr "最大加速度"
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
msgstr "加速到减速度" msgstr "最大加速至减速"
msgid "Max Velocity" msgid "Max Velocity"
msgstr "速度" msgstr "最大速度"
msgid "Measure Both"
msgstr ""
msgid "Measure X"
msgstr ""
msgid "Measure Y"
msgstr ""
msgid "Medium" msgid "Medium"
msgstr "中" msgstr "中"
@@ -347,7 +421,7 @@ msgid "Menu"
msgstr "菜单" msgstr "菜单"
msgid "Modified" msgid "Modified"
msgstr "修改" msgstr "修改时间"
msgid "Moonraker: connected" msgid "Moonraker: connected"
msgstr "Moonraker:已连接" msgstr "Moonraker:已连接"
@@ -364,6 +438,9 @@ msgstr "文件名称"
msgid "Network" msgid "Network"
msgstr "网络" msgstr "网络"
msgid "New"
msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "未选择任何内容" msgstr "未选择任何内容"
@@ -381,6 +458,9 @@ msgid "Package will be updated"
msgid_plural "Packages will be updated" msgid_plural "Packages will be updated"
msgstr[0] "包将被更新" msgstr[0] "包将被更新"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "密码已保存" msgstr "密码已保存"
@@ -391,17 +471,23 @@ msgid "Paused"
msgstr "已暂停" msgstr "已暂停"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "执行全面升级?" msgstr "是否全部升级?"
msgid "Pins"
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 "电源"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "启动打印机" msgstr "启动打印机"
msgid "Pressure Advance:"
msgstr "压力推进:"
msgid "Print" msgid "Print"
msgstr "打印" msgstr "打印"
@@ -412,13 +498,16 @@ msgid "Print Time"
msgstr "打印用时" msgstr "打印用时"
msgid "Printer Connections" msgid "Printer Connections"
msgstr "打印机列表" msgstr "龙门架调平"
msgid "Printing" msgid "Printing"
msgstr "印刷" msgstr "打印中"
msgid "Probe Offset"
msgstr "探头偏移"
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "Probe 发现应用的偏移量" msgstr "找到探头偏移"
msgid "Profile Name:" msgid "Profile Name:"
msgstr "配置文件名称:" msgstr "配置文件名称:"
@@ -442,32 +531,54 @@ msgid "Restart"
msgstr "重启Klipper" msgstr "重启Klipper"
msgid "Resume" msgid "Resume"
msgstr "恢复" msgstr "继续"
msgid "Retract" msgid "Retract"
msgstr "退回"
msgid "Retraction"
msgstr "回抽" msgstr "回抽"
msgid "Retraction Length"
msgstr "回抽长度"
msgid "Retraction Speed"
msgstr "回抽速度"
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "重试 #%s" msgstr "重试 #%s"
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "保存" msgstr "保存"
msgid "Save Config" msgid "Save Config"
msgstr "保存配置" msgstr "保存配置"
msgid "Save configuration" msgid "Save Z"
msgstr "即将保存配置文件" msgstr "保存Z轴"
msgid "Save configuration?"
msgstr "是否保存设置?"
msgid "Saved"
msgstr "保存"
#, python-format
msgid "Saved offset: %s"
msgstr "保存偏移: %s"
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "屏幕DPMS" msgstr "屏幕DPMS"
msgid "Screen Power Off Time" msgid "Screen Power Off Time"
msgstr "关闭屏幕" msgstr "关闭屏幕时间"
msgid "Screws Adjust" msgid "Screws Adjust"
msgstr "平台螺丝调整" msgstr "调平"
msgid "Select" msgid "Select"
msgstr "选择" msgstr "选择"
@@ -477,7 +588,7 @@ msgstr "发送"
#, python-format #, python-format
msgid "Sending Power ON signal to: %s" msgid "Sending Power ON signal to: %s"
msgstr "正在发送通电信号到:%s" msgstr "打开: %s"
msgid "Set Temp" msgid "Set Temp"
msgstr "设定温度" msgstr "设定温度"
@@ -489,13 +600,16 @@ msgid "Show"
msgstr "显示" msgstr "显示"
msgid "Size" msgid "Size"
msgstr "文件大小" msgstr "大小"
msgid "Slicer" msgid "Slicer"
msgstr "切片软件" msgstr "切片"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "切片器时间校正 (%)" msgstr "切片软件时间校正(%)"
msgid "Slicer:"
msgstr "切片:"
msgid "Small" msgid "Small"
msgstr "小" msgstr "小"
@@ -503,8 +617,11 @@ msgstr "小"
msgid "Sort by: " msgid "Sort by: "
msgstr "排序: " msgstr "排序: "
msgid "Sort:"
msgstr "排序:"
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "速度(mm/s)" msgstr "速度(mm/s)"
msgid "Speed +" msgid "Speed +"
msgstr "速度 +" msgstr "速度 +"
@@ -512,6 +629,9 @@ msgstr "速度 +"
msgid "Speed -" msgid "Speed -"
msgstr "速度 -" msgstr "速度 -"
msgid "Speed:"
msgstr "速度:"
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "转角速度" msgstr "转角速度"
@@ -519,7 +639,7 @@ msgid "Start"
msgstr "开始" msgstr "开始"
msgid "Starting WiFi Association" msgid "Starting WiFi Association"
msgstr "启动 WiFi 关联" msgstr "启动wifi连接"
msgid "Starting recovery for" msgid "Starting recovery for"
msgstr "开始恢复" msgstr "开始恢复"
@@ -533,44 +653,50 @@ msgstr "系统"
msgid "" msgid ""
"System\n" "System\n"
"Restart" "Restart"
msgstr "重启系统" msgstr ""
"重启\n"
"系统"
msgid "" msgid ""
"System\n" "System\n"
"Shutdown" "Shutdown"
msgstr "关闭系统" msgstr ""
"关闭\n"
"系统"
msgid "Temp (°C)" msgid "Temp (°C)"
msgstr "温度 (°C)" msgstr "温度 (°C)"
msgid "Temperature" msgid "Temperature"
msgstr "设置温度" msgstr "温度控制"
#, python-format #, python-format
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "要应用 %s 主题,需要重新启动 KlipperScreen" msgstr "要应用%s请重新启动KlipperScreen"
msgid "Tool"
msgstr "工具"
msgid "Total:" msgid "Total:"
msgstr "全部的:" msgstr "总:"
msgid "Unknown Heater" msgid "Unknown Heater"
msgstr "未知加热器" msgstr "未知加热器"
msgid "Unload" msgid "Unload"
msgstr "退出耗材" msgstr "卸载"
msgid "Unretract Extra Length"
msgstr ""
msgid "Unretract Speed"
msgstr ""
msgid "Up To Date" msgid "Up To Date"
msgstr "最新" msgstr "最新的"
msgid "Update" msgid "Update"
msgstr "更新" msgstr "更新"
#, fuzzy
msgid "Updating" msgid "Updating"
msgstr "更新" msgstr "更新中"
msgid "Uploaded" msgid "Uploaded"
msgstr "上传时间" msgstr "上传时间"
@@ -579,44 +705,50 @@ msgid "View Mesh"
msgstr "查看热床网格" msgstr "查看热床网格"
msgid "X+" msgid "X+"
msgstr "X+" msgstr ""
msgid "X-" msgid "X-"
msgstr "X-" msgstr ""
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "XY 移动速度 (mm/s)" msgstr "XY轴移动速度(mm/s)"
msgid "XY Speed (mm/s)"
msgstr "XY轴速度(mm/s)"
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr ""
msgid "Y-" msgid "Y-"
msgstr "Y-" msgstr ""
msgid "Z Calibrate" msgid "Z Calibrate"
msgstr "Z 校准" msgstr "Z轴校准"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "Z 移动速度 (mm/s)" msgstr "Z轴移动速度(mm/s)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "Z 位置" msgstr "Z轴速度(mm/s)"
msgid "Z Tilt" msgid "Z Tilt"
msgstr "Z 倾斜校准" msgstr "Z 倾斜校准"
msgid "Z offset:"
msgstr "Z轴偏移:"
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr ""
msgid "Z-" msgid "Z-"
msgstr "Z-" msgstr ""
msgid "commit" msgid "commit"
msgid_plural "commits" msgid_plural "commits"
msgstr[0] "改变" msgstr[0] "更改"
msgid "dBm" msgid "dBm"
msgstr "dBm" msgstr ""
msgid "hour" msgid "hour"
msgid_plural "hours" msgid_plural "hours"
@@ -626,13 +758,22 @@ msgid "minutes"
msgstr "分钟" msgstr "分钟"
msgid "mm" msgid "mm"
msgstr "mm" msgstr ""
msgid "mm/s" msgid "mm/s"
msgstr "mm/s" msgstr ""
msgid "mm/s^2" msgid "mm/s²"
msgstr "mm/s^2" msgstr ""
#~ msgid "Tool"
#~ msgstr "工具"
#~ msgid "Displayed Macros"
#~ msgstr "宏命令显示开关"
#~ msgid "Z Position"
#~ msgstr "Z 位置"
#~ msgid "IPv4" #~ msgid "IPv4"
#~ msgstr "IPv4 地址" #~ msgstr "IPv4 地址"
@@ -640,9 +781,6 @@ msgstr "mm/s^2"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6 地址" #~ msgstr "IPv6 地址"
#~ msgid "Z Offset"
#~ msgstr "Z 偏移"
#~ msgid "Unknown Heater " #~ msgid "Unknown Heater "
#~ msgstr "未知加热器 " #~ msgstr "未知加热器 "
@@ -667,13 +805,13 @@ msgstr "mm/s^2"
#~ "Issue a FIRMWARE_RESTART to attempt fixing the issue." #~ "Issue a FIRMWARE_RESTART to attempt fixing the issue."
#~ msgstr "" #~ msgstr ""
#~ "Klipper 遇到错误。\n" #~ "Klipper 遇到错误。\n"
#~ "使用 重启Firmware 命令尝试解决此问题。" #~ "使用”FIRMWARE_RESTART“命令尝试解决此问题。"
#~ msgid "KlipperScreen Version" #~ msgid "KlipperScreen Version"
#~ msgstr "KlipperScreen 版本" #~ msgstr "KlipperScreen 版本"
#~ msgid "Show Only Heaters in Temp." #~ msgid "Show Only Heaters in Temp."
#~ msgstr "仅显示使用中的加热器" #~ msgstr "仅显示使用中的加热器."
#~ msgid "Target" #~ msgid "Target"
#~ msgstr "目标" #~ msgstr "目标"
@@ -705,9 +843,6 @@ msgstr "mm/s^2"
#~ msgid "Fast" #~ msgid "Fast"
#~ msgstr "加速" #~ msgstr "加速"
#~ msgid "Set Speed"
#~ msgstr "设置速度"
#~ msgid "Slow" #~ msgid "Slow"
#~ msgstr "减速" #~ msgstr "减速"
@@ -715,7 +850,7 @@ msgstr "mm/s^2"
#~ msgstr "?" #~ msgstr "?"
#~ msgid "Cancel Change" #~ msgid "Cancel Change"
#~ msgstr "取消改动" #~ msgstr "取消更改"
#~ msgid "Control" #~ msgid "Control"
#~ msgstr "控制" #~ msgstr "控制"
@@ -727,4 +862,4 @@ msgstr "mm/s^2"
#~ msgstr "网络信息" #~ msgstr "网络信息"
#~ msgid "Screen Blanking Time" #~ msgid "Screen Blanking Time"
#~ 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-03-31 11:25-0300\n" "POT-Creation-Date: 2022-07-12 22:17-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"
@@ -31,9 +31,15 @@ msgstr "24 小時制"
msgid "A FIRMWARE_RESTART may fix the issue." msgid "A FIRMWARE_RESTART may fix the issue."
msgstr "" msgstr ""
msgid "ADXL Not Configured"
msgstr ""
msgid "Abort" msgid "Abort"
msgstr "中止" msgstr "中止"
msgid "Acceleration:"
msgstr ""
msgid "Accept" msgid "Accept"
msgstr "接受" msgstr "接受"
@@ -46,6 +52,17 @@ msgstr "新增列印機"
msgid "Add bed mesh profile" msgid "Add bed mesh profile"
msgstr "新增網床輪廓" msgstr "新增網床輪廓"
msgid "Apply"
msgstr ""
#, python-format
msgid "Apply %.2f offset to Endstop?"
msgstr ""
#, python-format
msgid "Apply %s%.2f offset to Probe?"
msgstr ""
msgid "Are you sure you want to run Emergency Stop?" msgid "Are you sure you want to run Emergency Stop?"
msgstr "您確定要運行緊急停止嗎?" msgstr "您確定要運行緊急停止嗎?"
@@ -64,6 +81,9 @@ msgstr "您確定要關閉系統嗎?"
msgid "Auto" msgid "Auto"
msgstr "汽車" msgstr "汽車"
msgid "Auto-calibrate"
msgstr ""
msgid "Auto-scroll" msgid "Auto-scroll"
msgstr "自動滾屏" msgstr "自動滾屏"
@@ -79,9 +99,15 @@ msgstr "Bltouch 發現應用的偏移量"
msgid "Calibrate" msgid "Calibrate"
msgstr "校正" msgstr "校正"
msgid "Calibrated"
msgstr ""
msgid "Calibrated, save configuration to make it permanent" msgid "Calibrated, save configuration to make it permanent"
msgstr "校準,保存配置以使其永久化" msgstr "校準,保存配置以使其永久化"
msgid "Calibrating..."
msgstr ""
msgid "Can't set above the maximum:" msgid "Can't set above the maximum:"
msgstr "不能設置超過最大值:" msgstr "不能設置超過最大值:"
@@ -110,6 +136,12 @@ msgstr ""
"檢查/tmp/KlipperScreen.log 日誌檔以了解更多訊息。\n" "檢查/tmp/KlipperScreen.log 日誌檔以了解更多訊息。\n"
"請在GitHub上提交問題以尋求幫助。" "請在GitHub上提交問題以尋求幫助。"
msgid "Check ADXL Wiring"
msgstr ""
msgid "Clear"
msgstr ""
msgid "Close" msgid "Close"
msgstr "關閉" msgstr "關閉"
@@ -156,9 +188,6 @@ msgstr "禁用步進電機"
msgid "Disable XY" msgid "Disable XY"
msgstr "禁用 XY" msgstr "禁用 XY"
msgid "Displayed Macros"
msgstr "顯示巨集"
msgid "Distance (mm)" msgid "Distance (mm)"
msgstr "距離(mm)" msgstr "距離(mm)"
@@ -193,9 +222,24 @@ msgstr "風扇"
msgid "Filament Used" msgid "Filament Used"
msgstr "已消耗的耗材" msgstr "已消耗的耗材"
msgid "Filament total:"
msgstr ""
msgid "Filament used:"
msgstr ""
msgid "Filament:"
msgstr ""
msgid "File" msgid "File"
msgstr "檔案" msgstr "檔案"
msgid "File:"
msgstr ""
msgid "Finding ADXL"
msgstr ""
msgid "Fine Tuning" msgid "Fine Tuning"
msgstr "微調" msgstr "微調"
@@ -209,6 +253,12 @@ msgstr ""
"Firmware\n" "Firmware\n"
"重新啟動" "重新啟動"
msgid "Flow:"
msgstr ""
msgid "Flowrate:"
msgstr ""
msgid "Font Size" msgid "Font Size"
msgstr "字體大小" msgstr "字體大小"
@@ -222,6 +272,9 @@ msgstr ""
msgid "Go Back" msgid "Go Back"
msgstr "返回" msgstr "返回"
msgid "Height:"
msgstr ""
msgid "Hidden" msgid "Hidden"
msgstr "隱" msgstr "隱"
@@ -231,6 +284,9 @@ msgstr "隱藏"
msgid "Hide sensors in Temp." msgid "Hide sensors in Temp."
msgstr "在溫度中隱藏傳感器。" msgstr "在溫度中隱藏傳感器。"
msgid "Hide temp."
msgstr ""
msgid "Home" msgid "Home"
msgstr "首頁" msgstr "首頁"
@@ -267,6 +323,9 @@ msgstr "初始化中"
msgid "Initializing printer..." msgid "Initializing printer..."
msgstr "初始化列印機中.." msgstr "初始化列印機中.."
msgid "Input Shaper"
msgstr ""
msgid "Interface" msgid "Interface"
msgstr "介面" msgstr "介面"
@@ -310,6 +369,9 @@ msgstr "語言"
msgid "Large" msgid "Large"
msgstr "大的" msgstr "大的"
msgid "Layer:"
msgstr ""
msgid "Left:" msgid "Left:"
msgstr "剩下時間:" msgstr "剩下時間:"
@@ -331,8 +393,11 @@ msgstr "巨集"
msgid "Main Menu" msgid "Main Menu"
msgstr "主選單" msgstr "主選單"
msgid "Max Accelation" msgid "Max"
msgstr "最大加速度" msgstr ""
msgid "Max Acceleration"
msgstr ""
msgid "Max Acceleration to Deceleration" msgid "Max Acceleration to Deceleration"
msgstr "最大加速到減速" msgstr "最大加速到減速"
@@ -340,6 +405,15 @@ msgstr "最大加速到減速"
msgid "Max Velocity" msgid "Max Velocity"
msgstr "最大速度" msgstr "最大速度"
msgid "Measure Both"
msgstr ""
msgid "Measure X"
msgstr ""
msgid "Measure Y"
msgstr ""
msgid "Medium" msgid "Medium"
msgstr "中" msgstr "中"
@@ -364,6 +438,9 @@ msgstr "名稱"
msgid "Network" msgid "Network"
msgstr "網路" msgstr "網路"
msgid "New"
msgstr ""
msgid "Nothing selected" msgid "Nothing selected"
msgstr "未選擇任何內容" msgstr "未選擇任何內容"
@@ -381,6 +458,9 @@ msgid "Package will be updated"
msgid_plural "Packages will be updated" msgid_plural "Packages will be updated"
msgstr[0] "包將被更新" msgstr[0] "包將被更新"
msgid "Part Fan"
msgstr ""
msgid "Password saved" msgid "Password saved"
msgstr "密碼已保存" msgstr "密碼已保存"
@@ -393,6 +473,9 @@ msgstr "已暫停"
msgid "Perform a full upgrade?" msgid "Perform a full upgrade?"
msgstr "執行全面升級?" msgstr "執行全面升級?"
msgid "Pins"
msgstr ""
msgid "Please recompile and flash the micro-controller." msgid "Please recompile and flash the micro-controller."
msgstr "請重新編譯並刷寫微控制器。" msgstr "請重新編譯並刷寫微控制器。"
@@ -402,6 +485,9 @@ msgstr "電源"
msgid "Power On Printer" msgid "Power On Printer"
msgstr "啟動列印機" msgstr "啟動列印機"
msgid "Pressure Advance:"
msgstr ""
msgid "Print" msgid "Print"
msgstr "列印" msgstr "列印"
@@ -417,6 +503,9 @@ msgstr "連接列印機"
msgid "Printing" msgid "Printing"
msgstr "列印中" msgstr "列印中"
msgid "Probe Offset"
msgstr ""
msgid "Probe found applied offset" msgid "Probe found applied offset"
msgstr "Probe 發現應用的偏移量" msgstr "Probe 發現應用的偏移量"
@@ -447,18 +536,40 @@ msgstr "恢復"
msgid "Retract" msgid "Retract"
msgstr "回抽" msgstr "回抽"
msgid "Retraction"
msgstr ""
msgid "Retraction Length"
msgstr ""
msgid "Retraction Speed"
msgstr ""
#, python-format #, python-format
msgid "Retry #%s" msgid "Retry #%s"
msgstr "重試 #%s" msgstr "重試 #%s"
msgid "Retrying"
msgstr ""
msgid "Save" msgid "Save"
msgstr "儲存" msgstr "儲存"
msgid "Save Config" msgid "Save Config"
msgstr "儲存設定" msgstr "儲存設定"
msgid "Save configuration" msgid "Save Z"
msgstr "儲存設定檔案" msgstr ""
msgid "Save configuration?"
msgstr ""
msgid "Saved"
msgstr ""
#, python-format
msgid "Saved offset: %s"
msgstr ""
msgid "Screen DPMS" msgid "Screen DPMS"
msgstr "屏幕DPMS" msgstr "屏幕DPMS"
@@ -497,12 +608,18 @@ msgstr "切片"
msgid "Slicer Time correction (%)" msgid "Slicer Time correction (%)"
msgstr "切片器時間校正 (%)" msgstr "切片器時間校正 (%)"
msgid "Slicer:"
msgstr ""
msgid "Small" msgid "Small"
msgstr "小的" msgstr "小的"
msgid "Sort by: " msgid "Sort by: "
msgstr "排序: " msgstr "排序: "
msgid "Sort:"
msgstr ""
msgid "Speed (mm/s)" msgid "Speed (mm/s)"
msgstr "速度(mm/s)" msgstr "速度(mm/s)"
@@ -512,6 +629,9 @@ msgstr "速度 +"
msgid "Speed -" msgid "Speed -"
msgstr "速度 -" msgstr "速度 -"
msgid "Speed:"
msgstr ""
msgid "Square Corner Velocity" msgid "Square Corner Velocity"
msgstr "方角速度" msgstr "方角速度"
@@ -550,9 +670,6 @@ msgstr "溫度"
msgid "To apply %s KlipperScreen needs to be restarted" msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "要應用 %s,需要重新啟動 KlipperScreen" msgstr "要應用 %s,需要重新啟動 KlipperScreen"
msgid "Tool"
msgstr "工具"
msgid "Total:" msgid "Total:"
msgstr "全部的:" msgstr "全部的:"
@@ -562,6 +679,12 @@ msgstr "未知加熱器"
msgid "Unload" msgid "Unload"
msgstr "卸載" msgstr "卸載"
msgid "Unretract Extra Length"
msgstr ""
msgid "Unretract Speed"
msgstr ""
msgid "Up To Date" msgid "Up To Date"
msgstr "最新" msgstr "最新"
@@ -586,6 +709,9 @@ msgstr "X-"
msgid "XY Move Speed (mm/s)" msgid "XY Move Speed (mm/s)"
msgstr "XY 移動速度 (mm/s)" msgstr "XY 移動速度 (mm/s)"
msgid "XY Speed (mm/s)"
msgstr ""
msgid "Y+" msgid "Y+"
msgstr "Y+" msgstr "Y+"
@@ -598,12 +724,15 @@ msgstr "Z 校準"
msgid "Z Move Speed (mm/s)" msgid "Z Move Speed (mm/s)"
msgstr "Z 移動速度 (mm/s)" msgstr "Z 移動速度 (mm/s)"
msgid "Z Position" msgid "Z Speed (mm/s)"
msgstr "Z 位置" msgstr ""
msgid "Z Tilt" msgid "Z Tilt"
msgstr "Z 傾斜" msgstr "Z 傾斜"
msgid "Z offset:"
msgstr ""
msgid "Z+" msgid "Z+"
msgstr "Z+" msgstr "Z+"
@@ -630,8 +759,17 @@ msgstr "mm"
msgid "mm/s" msgid "mm/s"
msgstr "mm/s" msgstr "mm/s"
msgid "mm/s^2" msgid "mm/s²"
msgstr "mm/s^2" msgstr "mm/s²"
#~ msgid "Tool"
#~ msgstr "工具"
#~ msgid "Displayed Macros"
#~ msgstr "顯示巨集"
#~ msgid "Z Position"
#~ msgstr "Z 位置"
#~ msgid "IPv4" #~ msgid "IPv4"
#~ msgstr "IPv4" #~ msgstr "IPv4"
@@ -639,9 +777,6 @@ msgstr "mm/s^2"
#~ msgid "IPv6" #~ msgid "IPv6"
#~ msgstr "IPv6" #~ msgstr "IPv6"
#~ msgid "Z Offset"
#~ msgstr "Z 間隙"
#~ msgid "Unknown Heater " #~ msgid "Unknown Heater "
#~ msgstr "未知加熱器 " #~ msgstr "未知加熱器 "
+101 -118
View File
@@ -6,31 +6,35 @@ from gi.repository import Gdk, GLib
class Printer: class Printer:
data = {}
devices = {}
power_devices = {}
state_callbacks = {
"disconnected": None,
"error": None,
"paused": None,
"printing": None,
"ready": None,
"startup": None,
"shutdown": None
}
tools = []
toolcount = 0
extrudercount = 0
tempdevcount = 0
fancount = 0
def __init__(self, printer_info, data, state_execute_cb): def __init__(self, printer_info, data, state_execute_cb):
self.klipper = {"version": printer_info['software_version']}
self.tempstore = None
self.config = None
self.state = "disconnected" self.state = "disconnected"
self.state_cb = state_execute_cb self.state_cb = state_execute_cb
self.power_devices = {} self.power_devices = {}
self.store_timeout = False self.store_timeout = False
self.data = data
self.devices = {}
self.power_devices = {}
self.state_callbacks = {
"disconnected": None,
"error": None,
"paused": None,
"printing": None,
"ready": None,
"startup": None,
"shutdown": None
}
self.tools = []
self.extrudercount = 0
self.tempdevcount = 0
self.fancount = 0
self.output_pin_count = 0
def reset(self): def reset(self):
GLib.source_remove(self.store_timeout)
self.store_timeout = None
self.state = None self.state = None
self.state_cb = None self.state_cb = None
self.data = None self.data = None
@@ -38,29 +42,27 @@ class Printer:
self.power_devices = None self.power_devices = None
self.state_callbacks = None self.state_callbacks = None
self.tools = None self.tools = None
self.toolcount = None
self.extrudercount = None self.extrudercount = None
self.tempdevcount = None self.tempdevcount = None
self.fancount = None self.fancount = None
GLib.source_remove(self.store_timeout)
self.store_timeout = None
self.config = None self.config = None
self.klipper = None self.klipper = None
self.tempstore = None self.tempstore = None
self.output_pin_count = None
def reinit(self, printer_info, data): def reinit(self, printer_info, data):
logging.debug("Moonraker object status: %s" % data) logging.debug(f"Moonraker object status: {data}")
self.config = data['configfile']['config'] self.config = data['configfile']['config']
self.toolcount = 0
self.extrudercount = 0 self.extrudercount = 0
self.tempdevcount = 0 self.tempdevcount = 0
self.fancount = 0 self.fancount = 0
self.output_pin_count = 0
self.tools = [] self.tools = []
self.devices = {} self.devices = {}
self.data = data self.data = data
self.klipper = {} self.klipper = {}
self.tempstore = {} self.tempstore = {}
if self.store_timeout is False: 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 = { self.klipper = {
@@ -68,30 +70,40 @@ class Printer:
} }
for x in self.config.keys(): for x in self.config.keys():
if x[0:8] == "extruder": if x[:8] == "extruder":
self.tools.append(x)
self.tools = sorted(self.tools)
self.extrudercount += 1
if x.startswith('extruder_stepper'): if x.startswith('extruder_stepper'):
continue continue
self.devices[x] = { self.devices[x] = {
"temperature": 0, "temperature": 0,
"target": 0 "target": 0
} }
self.tools.append(x) if x == 'heater_bed' \
self.tools = sorted(self.tools) or x.startswith('heater_generic ') \
self.toolcount += 1 or x.startswith('temperature_sensor ') \
if "shared_heater" in self.config[x]:
continue
self.extrudercount += 1
if x == 'heater_bed' or x.startswith('heater_generic ') or x.startswith('temperature_sensor ') \
or x.startswith('temperature_fan '): or x.startswith('temperature_fan '):
self.devices[x] = { self.devices[x] = {
"temperature": 0, "temperature": 0,
"target": 0 "target": 0
} }
self.tempdevcount += 1 # Support for hiding devices by name
if x == 'fan' or x.startswith('controller_fan ') or x.startswith('heater_fan ') \ name = x.split()[1] if len(x.split()) > 1 else x
if not name.startswith("_"):
self.tempdevcount += 1
if x == 'fan' \
or x.startswith('controller_fan ') \
or x.startswith('heater_fan ') \
or x.startswith('fan_generic '): or x.startswith('fan_generic '):
self.fancount += 1 # Support for hiding devices by name
name = x.split()[1] if len(x.split()) > 1 else x
if not name.startswith("_"):
self.fancount += 1
if x.startswith('output_pin '):
# Support for hiding devices by name
if not x.split()[1].startswith("_"):
self.output_pin_count += 1
if x.startswith('bed_mesh '): if x.startswith('bed_mesh '):
r = self.config[x] r = self.config[x]
r['x_count'] = int(r['x_count']) r['x_count'] = int(r['x_count'])
@@ -103,29 +115,14 @@ class Printer:
r['points'] = [[float(j.strip()) for j in i.split(",")] for i in r['points'].strip().split("\n")] 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("Klipper version: %s", self.klipper['version']) logging.info(f"Klipper version: {self.klipper['version']}")
logging.info("# Toolcount: %s", str(self.toolcount)) logging.info(f"# Extruders: {self.extrudercount}")
logging.info("# Extruders: %s", str(self.extrudercount)) logging.info(f"# Temperature devices: {self.tempdevcount}")
logging.info("# Temperature devices: %s", str(self.tempdevcount)) logging.info(f"# Fans: {self.fancount}")
logging.info("# Fans: %s", str(self.fancount)) logging.info(f"# Output pins: {self.output_pin_count}")
def process_update(self, data): def process_update(self, data):
keys = [ for x in (self.get_tools() + self.get_heaters() + self.get_filament_sensors()):
'bed_mesh',
'display_status',
'fan',
'gcode_move',
'idle_timeout',
'pause_resume',
'print_stats',
'toolhead',
'virtual_sdcard',
'webhooks',
'fimware_retraction',
'motion_report'
]
for x in (self.get_tools() + self.get_heaters()):
if x in data: if x in data:
for i in data[x]: for i in data[x]:
self.set_dev_stat(x, i, data[x][i]) self.set_dev_stat(x, i, data[x][i])
@@ -137,7 +134,7 @@ 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: if "webhooks" in data or "idle_timeout" in data or "print_stats" in data or "pause_resume" in data:
self.evaluate_state() self.evaluate_state()
def get_updates(self): def get_updates(self):
@@ -150,7 +147,9 @@ class Printer:
if wh_state == "ready": if wh_state == "ready":
new_state = "ready" new_state = "ready"
if self.data['print_stats']: if self.data['pause_resume']['is_paused']:
new_state = "paused"
elif self.data['print_stats']:
print_state = self.data['print_stats']['state'].lower() # complete, error, paused, printing, standby print_state = self.data['print_stats']['state'].lower() # complete, error, paused, printing, standby
if print_state == "paused": if print_state == "paused":
new_state = "paused" new_state = "paused"
@@ -177,11 +176,11 @@ class Printer:
if state == self.state or state not in list(self.state_callbacks): if state == self.state or state not in list(self.state_callbacks):
return return
logging.debug("Changing state from '%s' to '%s'" % (self.state, state)) logging.debug(f"Changing state from '{self.state}' to '{state}'")
prev_state = self.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("Adding callback for state: %s" % state) logging.debug(f"Adding callback for state: {state}")
Gdk.threads_add_idle( Gdk.threads_add_idle(
GLib.PRIORITY_HIGH_IDLE, GLib.PRIORITY_HIGH_IDLE,
self.state_cb, self.state_cb,
@@ -192,27 +191,18 @@ class Printer:
def configure_power_devices(self, data): def configure_power_devices(self, data):
self.power_devices = {} self.power_devices = {}
logging.debug("Processing power devices: %s" % data) logging.debug(f"Processing power devices: {data}")
for x in data['devices']: for x in data['devices']:
self.power_devices[x['device']] = { self.power_devices[x['device']] = {
"status": "on" if x['status'] == "on" else "off" "status": "on" if x['status'] == "on" else "off"
} }
logging.debug("Power devices: %s" % self.power_devices) logging.debug(f"Power devices: {self.power_devices}")
def get_config_section_list(self, search=""): def get_config_section_list(self, search=""):
if not hasattr(self, "config"): return [i for i in list(self.config) if i.startswith(search)] if hasattr(self, "config") else []
return []
return [i for i in list(self.config) if i.startswith(search)]
def get_config_section(self, section): def get_config_section(self, section):
if section in self.config: return self.config[section] if section in self.config else False
return self.config[section]
return False
def get_config_section(self, section):
if section not in self.config:
return False
return self.config[section]
def get_data(self): def get_data(self):
return self.data return self.data
@@ -222,11 +212,16 @@ class Printer:
if self.config_section_exists("fan"): if self.config_section_exists("fan"):
fans.append("fan") fans.append("fan")
fan_types = ["controller_fan", "fan_generic", "heater_fan"] fan_types = ["controller_fan", "fan_generic", "heater_fan"]
for type in fan_types: for fan_type in fan_types:
for f in self.get_config_section_list("%s " % type): fans.extend(iter(self.get_config_section_list(f"{fan_type} ")))
fans.append(f)
return fans return fans
def get_output_pins(self):
output_pins = []
output_pins.extend(iter(self.get_config_section_list("output_pin ")))
logging.debug(f"{output_pins}")
return output_pins
def get_gcode_macros(self): def get_gcode_macros(self):
return self.get_config_section_list("gcode_macro ") return self.get_config_section_list("gcode_macro ")
@@ -234,37 +229,27 @@ class Printer:
heaters = [] heaters = []
if self.has_heated_bed(): if self.has_heated_bed():
heaters.append("heater_bed") heaters.append("heater_bed")
for h in self.get_config_section_list("heater_generic "): heaters.extend(iter(self.get_config_section_list("heater_generic ")))
heaters.append(h) heaters.extend(iter(self.get_config_section_list("temperature_sensor ")))
for h in self.get_config_section_list("temperature_sensor "): heaters.extend(iter(self.get_config_section_list("temperature_fan ")))
heaters.append(h)
for h in self.get_config_section_list("temperature_fan "):
heaters.append(h)
return heaters return heaters
def get_filament_sensors(self):
sensors = list(self.get_config_section_list("filament_switch_sensor "))
sensors.extend(iter(self.get_config_section_list("filament_motion_sensor ")))
return sensors
def get_printer_status_data(self): def get_printer_status_data(self):
data = { data = {
"printer": { "printer": {
"extruders": { "extruders": {"count": self.extrudercount},
"count": self.extrudercount "temperature_devices": {"count": self.tempdevcount},
}, "fans": {"count": self.fancount},
"temperature_devices": { "output_pins": {"count": self.output_pin_count},
"count": self.tempdevcount "gcode_macros": {"count": len(self.get_gcode_macros())},
},
"fans": {
"count": self.fancount
},
"bltouch": self.config_section_exists("bltouch"),
"gcode_macros": {
"count": len(self.get_gcode_macros())
},
"idle_timeout": self.get_stat("idle_timeout").copy(), "idle_timeout": self.get_stat("idle_timeout").copy(),
"pause_resume": self.get_stat("pause_resume").copy(), "pause_resume": {"is_paused": self.state == "paused"},
"power_devices": { "power_devices": {"count": len(self.get_power_devices())},
"count": len(self.get_power_devices())
},
"probe": self.config_section_exists("probe"),
"firmware_retraction": self.config_section_exists("firmware_retraction")
} }
} }
@@ -273,6 +258,10 @@ class Printer:
if self.config_section_exists(section): if self.config_section_exists(section):
data["printer"][section] = self.get_config_section(section).copy() data["printer"][section] = self.get_config_section(section).copy()
sections = ["firmware_retraction", "input_shaper", "bed_screws", "screws_tilt_adjust"]
for section in sections:
data["printer"][section] = self.config_section_exists(section)
return data return data
def get_klipper_version(self): def get_klipper_version(self):
@@ -287,12 +276,10 @@ class Printer:
return self.power_devices[device]['status'] return self.power_devices[device]['status']
def get_stat(self, stat, substat=None): def get_stat(self, stat, substat=None):
if stat not in self.data: if self.data is None or stat not in self.data:
return {} return {}
if substat is not None: if substat is not None:
if substat in self.data[stat]: return self.data[stat][substat] if substat in self.data[stat] else {}
return self.data[stat][substat]
return {}
return self.data[stat] return self.data[stat]
def get_state(self): def get_state(self):
@@ -305,9 +292,7 @@ class Printer:
self.devices[dev]['target'] = target self.devices[dev]['target'] = target
def get_dev_stats(self, dev): def get_dev_stats(self, dev):
if dev in self.devices: return self.devices[dev] if dev in self.devices else None
return self.devices[dev]
return 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]:
@@ -316,7 +301,7 @@ class Printer:
def get_fan_speed(self, fan="fan", speed=None): def get_fan_speed(self, fan="fan", speed=None):
if fan not in self.config or fan not in self.data: if fan not in self.config or fan not in self.data:
logging.debug("Error getting %s config", fan) logging.debug(f"Error getting {fan} config")
return speed if speed is not None else 0 return speed if speed is not None else 0
if speed is None and "speed" in self.data[fan]: if speed is None and "speed" in self.data[fan]:
speed = self.data[fan]["speed"] speed = self.data[fan]["speed"]
@@ -330,6 +315,9 @@ class Printer:
speed = 0 speed = 0
return speed return speed
def get_pin_value(self, pin):
return self.data[pin]["value"] if pin in self.data else 0
def get_extruder_count(self): def get_extruder_count(self):
return self.extrudercount return self.extrudercount
@@ -338,10 +326,7 @@ class Printer:
return list(self.tempstore) return list(self.tempstore)
def get_temp_store_device_has_target(self, device): def get_temp_store_device_has_target(self, device):
if device in self.tempstore: return device in self.tempstore and "targets" in self.tempstore[device]
if "targets" in self.tempstore[device]:
return True
return False
def get_temp_store(self, device, section=False, results=0): def get_temp_store(self, device, section=False, results=0):
if device not in self.tempstore: if device not in self.tempstore:
@@ -378,12 +363,10 @@ class Printer:
self.tempstore[dev]["targets"] = result[dev]["targets"] self.tempstore[dev]["targets"] = result[dev]["targets"]
if "temperatures" in result[dev]: if "temperatures" in result[dev]:
self.tempstore[dev]["temperatures"] = result[dev]["temperatures"] self.tempstore[dev]["temperatures"] = result[dev]["temperatures"]
logging.info("Temp store: %s" % list(self.tempstore)) logging.info(f"Temp store: {list(self.tempstore)}")
def config_section_exists(self, section): def config_section_exists(self, section):
if section in self.get_config_section_list(): return section in self.get_config_section_list()
return True
return False
def set_callbacks(self, callbacks): def set_callbacks(self, callbacks):
for name, cb in callbacks.items(): for name, cb in callbacks.items():
+90 -32
View File
@@ -1,13 +1,16 @@
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
from ks_includes.KlippyGcodes import KlippyGcodes from ks_includes.KlippyGcodes import KlippyGcodes
class ScreenPanel: class ScreenPanel:
def __init__(self, screen, title, back=True, action_bar=True, printer_name=True): def __init__(self, screen, title, back=True):
self.menu = None
self._screen = screen self._screen = screen
self._config = screen._config self._config = screen._config
self._files = screen.files self._files = screen.files
@@ -23,51 +26,40 @@ class ScreenPanel:
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)
self.content = Gtk.Box(spacing=0) self.content = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.content.get_style_context().add_class("content")
self.content.set_hexpand(True)
self.content.set_vexpand(True)
def initialize(self, panel_name): def initialize(self, panel_name):
# Create gtk items here # Create gtk items here
return return
def emergency_stop(self, widget): def emergency_stop(self, widget):
_ = self.lang.gettext
if self._config.get_main_config_option('confirm_estop') == "True": if self._config.get_main_config().getboolean('confirm_estop'):
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")
else: else:
self._screen._ws.klippy.emergency_stop() self._screen._ws.klippy.emergency_stop()
def format_target(self, temp):
if temp <= 0:
return ""
else:
return ("(%s)" % str(int(temp)))
def format_temp(self, temp, places=1):
if places == 0:
n = int(temp)
else:
n = round(temp, places)
return "%s<small>°C</small>" % str(n)
def get(self): def get(self):
return self.layout return self.layout
def get_content(self): def get_content(self):
return self.content return self.content
def get_file_image(self, filename, width=1.6, height=1.6): def get_file_image(self, filename, width=1, height=1, small=False):
if not self._files.has_thumbnail(filename): if not self._files.has_thumbnail(filename):
return None return None
loc = self._files.get_thumbnail_location(filename) loc = self._files.get_thumbnail_location(filename, small)
if loc is None: if loc is None:
return None return None
if loc[0] == "file": if loc[0] == "file":
return self._gtk.PixbufFromFile(loc[1], None, width, height) return self._gtk.PixbufFromFile(loc[1], width, height)
if loc[0] == "http": if loc[0] == "http":
return self._gtk.PixbufFromHttp(loc[1], None, width, height) return self._gtk.PixbufFromHttp(loc[1], width, height)
return None return None
def get_title(self): def get_title(self):
@@ -86,13 +78,12 @@ class ScreenPanel:
self._screen._ws.klippy.gcode_script(KlippyGcodes.QUAD_GANTRY_LEVEL) 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):
print("### Creating panel " + item['panel'] + " : %s %s" % (panel, item)) logging.info(f"### Creating panel {item['panel']} : {panel} {item}")
if "items" in item: if "items" in item:
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + panel, item['panel'], item['name'], self._screen.show_panel(f'{self._screen._cur_panels[-1]}_{panel}',
1, False, items=item['items']) item['panel'], item['name'], 1, False, items=item['items'])
return return
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + panel, item['panel'], item['name'], self._screen.show_panel(f'{self._screen._cur_panels[-1]}_{panel}', item['panel'], item['name'], 1, False)
1, False)
def menu_return(self, widget, home=False): def menu_return(self, widget, home=False):
if home is False: if home is False:
@@ -110,9 +101,76 @@ class ScreenPanel:
if label in self.labels and 'l' in self.labels[label]: if label in self.labels and 'l' in self.labels[label]:
self.labels[label]['l'].set_text(text) self.labels[label]['l'].set_text(text)
def update_temp(self, dev, temp, target, name=None): def load_menu(self, widget, name):
if dev in self.labels: if f"{name}_menu" not in self.labels:
if name is None: return
self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
else: for child in self.content.get_children():
self.labels[dev].set_label("%s\n%s" % (name, self._gtk.formatTemperatureString(temp, target))) self.content.remove(child)
self.menu.append(f'{name}_menu')
self.content.add(self.labels[self.menu[-1]])
self.content.show_all()
def unload_menu(self, widget=None):
logging.debug(f"self.menu: {self.menu}")
if len(self.menu) <= 1 or self.menu[-2] not in self.labels:
return
self.menu.pop()
for child in self.content.get_children():
self.content.remove(child)
self.content.add(self.labels[self.menu[-1]])
self.content.show_all()
def on_dropdown_change(self, combo, section, option, callback=None):
tree_iter = combo.get_active_iter()
if tree_iter is not None:
model = combo.get_model()
value = model[tree_iter][1]
logging.debug(f"[{section}] {option} changed to {value}")
self._config.set(section, option, value)
self._config.save_user_config_options()
if callback is not None:
callback(value)
def scale_moved(self, widget, event, section, option):
logging.debug(f"[{section}] {option} changed to {widget.get_value()}")
if section not in self._config.get_config().sections():
self._config.get_config().add_section(section)
self._config.set(section, option, str(int(widget.get_value())))
self._config.save_user_config_options()
def switch_config_option(self, switch, gparam, section, option, callback=None):
logging.debug(f"[{section}] {option} toggled {switch.get_active()}")
if section not in self._config.get_config().sections():
self._config.get_config().add_section(section)
self._config.set(section, option, "True" if switch.get_active() else "False")
self._config.save_user_config_options()
if callback is not None:
callback(switch.get_active())
@staticmethod
def format_time(seconds):
if seconds is None or seconds <= 0:
return "-"
seconds = int(seconds)
days = seconds // 86400
seconds %= 86400
hours = seconds // 3600
seconds %= 3600
minutes = seconds // 60
seconds %= 60
return f"{f'{days:2.0f}d ' if days > 0 else ''}" \
f"{f'{hours:2.0f}h ' if hours > 0 else ''}" \
f"{f'{minutes:2.0f}m ' if minutes > 0 else ''}" \
f"{f'{seconds:2.0f}s' if days == 0 and hours == 0 and minutes == 0 else ''}"
@staticmethod
def format_size(size):
size = float(size)
suffixes = ["kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
for i, suffix in enumerate(suffixes, start=2):
unit = 1024 ** i
if size < unit:
return f"{(1024 * size / unit):.1f} {suffix}"
+34 -43
View File
@@ -23,37 +23,33 @@ class HeaterGraph(Gtk.DrawingArea):
self.connect('button_press_event', self.event_cb) self.connect('button_press_event', self.event_cb)
self.font_size = round(font_size * 0.75) self.font_size = round(font_size * 0.75)
def add_object(self, name, type, rgb=[0, 0, 0], dashed=False, fill=False): def add_object(self, name, ev_type, rgb=None, dashed=False, fill=False):
if rgb is None:
rgb = [0, 0, 0]
if name not in self.store: if name not in self.store:
self.store.update({name: {"show": True}}) self.store.update({name: {"show": True}})
self.store[name].update({type: { self.store[name].update({ev_type: {
"dashed": dashed, "dashed": dashed,
"fill": fill, "fill": fill,
"rgb": rgb "rgb": rgb
}}) }})
self.max_length = max(self.max_length, len(self.printer.get_temp_store(name, type))) self.max_length = max(self.max_length, len(self.printer.get_temp_store(name, ev_type)))
def event_cb(self, da, ev): @staticmethod
if ev.type == Gdk.EventType.BUTTON_PRESS: def event_cb(da, ev):
if ev.ev_type == Gdk.EventType.BUTTON_PRESS:
x = ev.x x = ev.x
y = ev.y y = ev.y
logging.info("Graph area: %s %s" % (x, y)) logging.info(f"Graph area: {x} {y}")
def get_max_length(self): def get_max_length(self):
n = [] return min(len(self.printer.get_temp_store(name, "temperatures"))
for name in self.store: for name in self.store if "temperatures" in self.store[name])
if "temperatures" not in self.store[name]:
continue
n.append(len(self.printer.get_temp_store(name, "temperatures")))
return min(n)
def get_max_num(self, data_points=0): def get_max_num(self, data_points=0):
mnum = [] mnum = []
for x in self.store: for x in self.store:
for t in self.store[x]: mnum.extend(max(self.printer.get_temp_store(x, t, data_points)) for t in self.store[x] if t != "show")
if t == "show":
continue
mnum.append(max(self.printer.get_temp_store(x, t, data_points)))
return max(mnum) return max(mnum)
def draw_graph(self, da, ctx): def draw_graph(self, da, ctx):
@@ -91,21 +87,21 @@ class HeaterGraph(Gtk.DrawingArea):
max_num = math.ceil(self.get_max_num(data_points) * 1.1 / 10) * 10 max_num = math.ceil(self.get_max_num(data_points) * 1.1 / 10) * 10
d_width = 1 / points_per_pixel d_width = 1 / points_per_pixel
d_height_scale = self.graph_lines(ctx, gsize, max_num) d_height_scale = self.graph_lines(ctx, gsize, max_num)
self.graph_time(ctx, gsize, points_per_pixel) self.graph_time(ctx, gsize, points_per_pixel)
for name in self.store: for name in self.store:
if not self.store[name]['show']: if not self.store[name]['show']:
continue continue
for type in self.store[name]: for dev_type in self.store[name]:
d = self.printer.get_temp_store(name, type, data_points) d = self.printer.get_temp_store(name, dev_type, data_points)
if d is False: if d is False:
continue continue
self.graph_data(ctx, d, gsize, d_height_scale, d_width, self.store[name][type]["rgb"], self.graph_data(ctx, d, gsize, d_height_scale, d_width, self.store[name][dev_type]["rgb"],
self.store[name][type]["dashed"], self.store[name][type]["fill"]) self.store[name][dev_type]["dashed"], self.store[name][dev_type]["fill"])
def graph_data(self, ctx, data, gsize, hscale, swidth, rgb, dashed=False, fill=False): @staticmethod
def graph_data(ctx, data, gsize, hscale, swidth, rgb, dashed=False, fill=False):
i = 0 i = 0
ctx.set_source_rgba(rgb[0], rgb[1], rgb[2], 1) ctx.set_source_rgba(rgb[0], rgb[1], rgb[2], 1)
ctx.move_to(gsize[0][0] + 1, gsize[0][1] - 1) ctx.move_to(gsize[0][0] + 1, gsize[0][1] - 1)
@@ -115,10 +111,10 @@ class HeaterGraph(Gtk.DrawingArea):
ctx.set_dash([1, 0]) ctx.set_dash([1, 0])
d_len = len(data) - 1 d_len = len(data) - 1
for d in data: for d in data:
p_x = i*swidth + gsize[0][0] if i != d_len else gsize[1][0] - 1 p_x = i * swidth + gsize[0][0] if i != d_len else gsize[1][0] - 1
p_y = gsize[1][1] - 1 - (d*hscale) p_y = gsize[1][1] - 1 - (d * hscale)
if i == 0: if i == 0:
ctx.move_to(gsize[0][0]+1, p_y) ctx.move_to(gsize[0][0] + 1, p_y)
i += 1 i += 1
continue continue
ctx.line_to(p_x, p_y) ctx.line_to(p_x, p_y)
@@ -139,15 +135,15 @@ class HeaterGraph(Gtk.DrawingArea):
while (max_num / nscale) > 5: while (max_num / nscale) > 5:
nscale += 10 nscale += 10
# nscale = math.floor((max_num / 10) / 4) * 10 # nscale = math.floor((max_num / 10) / 4) * 10
r = int(max_num/nscale) + 1 r = int(max_num / nscale) + 1
hscale = (gsize[1][1] - gsize[0][1]) / (r * nscale) hscale = (gsize[1][1] - gsize[0][1]) / (r * nscale)
for i in range(r): for i in range(r):
ctx.set_source_rgb(.5, .5, .5) ctx.set_source_rgb(.5, .5, .5)
lheight = gsize[1][1] - nscale*i*hscale lheight = gsize[1][1] - nscale * i * hscale
ctx.move_to(6, lheight + 3) ctx.move_to(6, lheight + 3)
ctx.set_font_size(self.font_size) ctx.set_font_size(self.font_size)
ctx.show_text(str(nscale*i).rjust(3, " ")) ctx.show_text(str(nscale * i).rjust(3, " "))
ctx.stroke() ctx.stroke()
ctx.set_source_rgba(.5, .5, .5, .2) ctx.set_source_rgba(.5, .5, .5, .2)
ctx.move_to(gsize[0][0], lheight) ctx.move_to(gsize[0][0], lheight)
@@ -174,25 +170,20 @@ class HeaterGraph(Gtk.DrawingArea):
ctx.set_source_rgb(.5, .5, .5) ctx.set_source_rgb(.5, .5, .5)
ctx.move_to(x - round(self.font_size * 1.5), gsize[1][1] + round(self.font_size * 1.5)) ctx.move_to(x - round(self.font_size * 1.5), gsize[1][1] + round(self.font_size * 1.5))
hour = now.hour h = now.hour
min = now.minute - (now.minute % 2) - i * 2 m = now.minute - (now.minute % 2) - i * 2
if min < 0: if m < 0:
hour -= 1 h -= 1
min = 60 + min m += 60
if hour < 0: if h < 0:
hour += 24 h += 24
ctx.set_font_size(self.font_size) ctx.set_font_size(self.font_size)
ctx.show_text("%02d:%02d" % (hour, min)) ctx.show_text(f"{h:2}:{m:02}")
ctx.stroke() ctx.stroke()
if self.max_length < 600: i += 1 if self.max_length < 600 else 2
i += 1
else:
i += 2
def is_showing(self, device): def is_showing(self, device):
if device not in self.store: return False if device not in self.store else self.store[device]['show']
return False
return self.store[device]['show']
def set_showing(self, device, show=True): def set_showing(self, device, show=True):
if device not in self.store: if device not in self.store:
+110
View File
@@ -0,0 +1,110 @@
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GLib
class Keyboard(Gtk.Box):
def __init__(self, screen, close_cb, entry=None):
super().__init__(orientation=Gtk.Orientation.VERTICAL)
_ = screen.lang.gettext
self._gtk = screen.gtk
self.close_cb = close_cb
self.keyboard = Gtk.Grid()
self.keyboard.set_direction(Gtk.TextDirection.LTR)
self.timeout = self.clear_timeout = None
self.entry = entry
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"],
["✕", " ", "✔"]
]
]
self.labels = self.keys.copy()
for p, pallet in enumerate(self.keys):
for r, row in enumerate(pallet):
for k, key in enumerate(row):
self.labels[p][r][k] = self._gtk.Button(key)
self.labels[p][r][k].set_hexpand(True)
self.labels[p][r][k].set_vexpand(True)
self.labels[p][r][k].connect('button-press-event', self.repeat, key)
self.labels[p][r][k].connect('button-release-event', self.release)
self.labels[p][r][k].get_style_context().add_class("keyboard_pad")
self.pallet_nr = 0
self.set_pallet(self.pallet_nr)
self.add(self.keyboard)
def set_pallet(self, p):
pallet = self.keys[p]
span = 2
for r, row in enumerate(pallet[:-1]):
for k, key in enumerate(row):
x = k * 2 + 1 if r == 1 else k * 2
old = self.keyboard.get_child_at(x, r)
if old:
self.keyboard.remove(old)
self.keyboard.attach(self.labels[p][r][k], x, r, span, 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()
def repeat(self, widget, event, key):
# Button-press
self.update_entry(widget, key)
if self.timeout is None and key == "⌫":
# Hold for repeat, hold longer to clear the field
self.clear_timeout = GLib.timeout_add_seconds(3, self.clear, widget)
# This can be used to repeat all the keys,
# but I don't find it useful on the console
self.timeout = GLib.timeout_add(400, self.repeat, widget, None, key)
return True
def release(self, widget, event):
# Button-release
if self.timeout is not None:
GLib.source_remove(self.timeout)
self.timeout = None
if self.clear_timeout is not None:
GLib.source_remove(self.clear_timeout)
self.clear_timeout = None
def clear(self, widget=None):
self.entry.set_text("")
if self.clear_timeout is not None:
GLib.source_remove(self.clear_timeout)
self.clear_timeout = None
def update_entry(self, widget, key):
if key == "⌫":
Gtk.Entry.do_backspace(self.entry)
elif key == "✔":
self.close_cb()
return
elif key == "✕":
self.clear()
self.close_cb()
return
elif key == "abc":
self.set_pallet(0)
elif key == "ABC":
self.set_pallet(1)
elif key == "?123":
self.set_pallet(2)
else:
Gtk.Entry.do_insert_at_cursor(self.entry, key)
+12 -11
View File
@@ -16,6 +16,7 @@ class Keypad(Gtk.Box):
numpad = self._gtk.HomogeneousGrid() numpad = self._gtk.HomogeneousGrid()
numpad.set_direction(Gtk.TextDirection.LTR) numpad.set_direction(Gtk.TextDirection.LTR)
numpad.get_style_context().add_class('numpad')
keys = [ keys = [
['1', 'numpad_tleft'], ['1', 'numpad_tleft'],
@@ -32,23 +33,23 @@ class Keypad(Gtk.Box):
['E', 'numpad_bright'] ['E', 'numpad_bright']
] ]
for i in range(len(keys)): for i in range(len(keys)):
id = 'button_' + str(keys[i][0]) k_id = f'button_{str(keys[i][0])}'
if keys[i][0] == "B": if keys[i][0] == "B":
self.labels[id] = self._gtk.ButtonImage("backspace", None, None, 1) self.labels[k_id] = self._gtk.ButtonImage("backspace", None, None, 1)
elif keys[i][0] == "E": elif keys[i][0] == "E":
self.labels[id] = self._gtk.ButtonImage("complete", None, None, 1) self.labels[k_id] = self._gtk.ButtonImage("complete", None, None, 1)
else: else:
self.labels[id] = Gtk.Button(keys[i][0]) self.labels[k_id] = Gtk.Button(keys[i][0])
self.labels[id].connect('clicked', self.update_entry, keys[i][0]) self.labels[k_id].connect('clicked', self.update_entry, keys[i][0])
self.labels[id].get_style_context().add_class(keys[i][1]) self.labels[k_id].get_style_context().add_class(keys[i][1])
numpad.attach(self.labels[id], i % 3, i/3, 1, 1) numpad.attach(self.labels[k_id], i % 3, i / 3, 1, 1)
self.labels["keypad"] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) self.labels["keypad"] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['entry'] = Gtk.Entry() self.labels['entry'] = Gtk.Entry()
self.labels['entry'].props.xalign = 0.5 self.labels['entry'].props.xalign = 0.5
self.labels['entry'].connect("activate", self.update_entry, "E") self.labels['entry'].connect("activate", self.update_entry, "E")
b = self._gtk.ButtonImage('cancel', _('Close'), None, 1) b = self._gtk.ButtonImage('cancel', _('Close'), None, .66, Gtk.PositionType.LEFT, False)
b.connect("clicked", close_function) b.connect("clicked", close_function)
self.add(self.labels['entry']) self.add(self.labels['entry'])
@@ -65,7 +66,7 @@ class Keypad(Gtk.Box):
if digit == 'B': if digit == 'B':
if len(text) < 1: if len(text) < 1:
return return
self.labels['entry'].set_text(text[0:-1]) self.labels['entry'].set_text(text[:-1])
elif digit == 'E': elif digit == 'E':
try: try:
temp = int(text) temp = int(text)
@@ -73,7 +74,7 @@ class Keypad(Gtk.Box):
temp = 0 temp = 0
self.change_temp(temp) self.change_temp(temp)
self.labels['entry'].set_text("") self.labels['entry'].set_text("")
elif len(text) >= 3:
return
else: else:
if len(text) >= 3:
return
self.labels['entry'].set_text(text + digit) self.labels['entry'].set_text(text + digit)
+116 -122
View File
@@ -9,10 +9,12 @@ from threading import Thread
from queue import Queue 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, Gdk
class WifiManager():
class WifiManager:
networks_in_supplicant = [] networks_in_supplicant = []
connected = False connected = False
_stop_loop = False _stop_loop = False
@@ -42,16 +44,17 @@ class WifiManager():
self.timeout = None self.timeout = None
self.scan_time = 0 self.scan_time = 0
KS_SOCKET_FILE = "/tmp/.KS_wpa_supplicant" ks_socket_file = "/tmp/.KS_wpa_supplicant"
if os.path.exists(KS_SOCKET_FILE): if os.path.exists(ks_socket_file):
os.remove(KS_SOCKET_FILE) os.remove(ks_socket_file)
try: try:
self.soc = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) self.soc = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
self.soc.bind(KS_SOCKET_FILE) self.soc.bind(ks_socket_file)
self.soc.connect("/var/run/wpa_supplicant/%s" % interface) self.soc.connect(f"/var/run/wpa_supplicant/{interface}")
except Exception: except Exception as e:
logging.info("Error connecting to wifi socket: %s" % interface) logging.critical(e, exc_info=True)
logging.error(f"Error connecting to wifi socket: {interface}")
return return
self.wpa_thread = WpaSocket(self, self.queue, self.callback) self.wpa_thread = WpaSocket(self, self.queue, self.callback)
@@ -68,73 +71,74 @@ class WifiManager():
self._callbacks[name].append(callback) self._callbacks[name].append(callback)
def add_network(self, ssid, psk): def add_network(self, ssid, psk):
for id in list(self.supplicant_networks): for netid in list(self.supplicant_networks):
if self.supplicant_networks[id]['ssid'] == ssid: if self.supplicant_networks[netid]['ssid'] == ssid:
# Modify network # Modify network
return return
# TODO: Add wpa_cli error checking # TODO: Add wpa_cli error checking
network_id = self.wpa_cli("ADD_NETWORK") network_id = self.wpa_cli("ADD_NETWORK")
commands = [ commands = [
'ENABLE_NETWORK %s' % (network_id), f'ENABLE_NETWORK {network_id}',
'SET_NETWORK %s ssid "%s"' % (network_id, ssid.replace('"', '\"')), 'SET_NETWORK %s ssid "%s"' % (network_id, ssid.replace('"', '\"')),
'SET_NETWORK %s psk "%s"' % (network_id, psk.replace('"', '\"')) 'SET_NETWORK %s psk "%s"' % (network_id, psk.replace('"', '\"'))
] ]
self.wpa_cli_batch(commands) self.wpa_cli_batch(commands)
self.read_wpa_supplicant() self.read_wpa_supplicant()
id = None netid = None
for i in list(self.supplicant_networks): for i in list(self.supplicant_networks):
if self.supplicant_networks[i]['ssid'] == ssid: if self.supplicant_networks[i]['ssid'] == ssid:
id = i netid = i
break break
if id is None: if netid is None:
logging.info("Error adding network") logging.info("Error adding network")
return False return False
self.save_wpa_conf() self.save_wpa_conf()
return True return True
def callback(self, type, msg): def callback(self, cb_type, msg):
if type in self._callbacks: if cb_type in self._callbacks:
for cb in self._callbacks[type]: for cb in self._callbacks[cb_type]:
Gdk.threads_add_idle( Gdk.threads_add_idle(
GLib.PRIORITY_DEFAULT_IDLE, GLib.PRIORITY_DEFAULT_IDLE,
cb, cb,
msg) msg)
def connect(self, ssid): def connect(self, ssid):
id = None netid = None
for netid, net in self.supplicant_networks.items(): for nid, net in self.supplicant_networks.items():
if net['ssid'] == ssid: if net['ssid'] == ssid:
id = netid netid = nid
break break
if id is None: if netid is None:
logging.info("Wifi network is not defined in wpa_supplicant") logging.info("Wifi network is not defined in wpa_supplicant")
return False return False
logging.info("Attempting to connect to wifi: %s" % id) logging.info(f"Attempting to connect to wifi: {netid}")
self.connecting_info = ["Attempting to connect to %s" % ssid] self.connecting_info = [f"Attempting to connect to {ssid}"]
self.wpa_cli("SELECT_NETWORK %s" % id) self.wpa_cli(f"SELECT_NETWORK {id}")
self.save_wpa_conf() self.save_wpa_conf()
def delete_network(self, ssid): def delete_network(self, ssid):
id = None netid = None
for i in list(self.supplicant_networks): for i in list(self.supplicant_networks):
if self.supplicant_networks[i]['ssid'] == ssid: if self.supplicant_networks[i]['ssid'] == ssid:
id = i netid = i
break break
if id is None: if netid is None:
logging.debug("Unable to find network in wpa_supplicant") logging.debug("Unable to find network in wpa_supplicant")
return return
self.wpa_cli("REMOVE_NETWORK %s" % id) self.wpa_cli(f"REMOVE_NETWORK {netid}")
for id in list(self.supplicant_networks): for netid in list(self.supplicant_networks):
if self.supplicant_networks[id]['ssid'] == ssid: if self.supplicant_networks[netid]['ssid'] == ssid:
del self.supplicant_networks[id] del self.supplicant_networks[netid]
break break
self.save_wpa_conf() self.save_wpa_conf()
@@ -142,45 +146,39 @@ class WifiManager():
def get_connected_ssid(self): def get_connected_ssid(self):
return self.connected_ssid return self.connected_ssid
def get_current_wifi(self, interface="wlan0"): def get_current_wifi(self):
con_ssid = os.popen("sudo iwgetid -r").read().strip() con_ssid = os.popen("sudo iwgetid -r").read().strip()
con_bssid = os.popen("sudo iwgetid -r -a").read().strip() con_bssid = os.popen("sudo iwgetid -r -a").read().strip()
# wpa_cli status output is unstable use it as backup only # wpa_cli status output is unstable use it as backup only
status = self.wpa_cli("STATUS").split('\n') status = self.wpa_cli("STATUS").split('\n')
vars = {} variables = {}
for line in status: for line in status:
arr = line.split('=') arr = line.split('=')
vars[arr[0]] = "=".join(arr[1:]) variables[arr[0]] = "=".join(arr[1:])
prev_ssid = self.connected_ssid prev_ssid = self.connected_ssid
if con_ssid != "": if con_ssid != "":
self.connected = True self.connected = True
self.connected_ssid = con_ssid self.connected_ssid = con_ssid
for ssid, val in self.networks.items(): for ssid, val in self.networks.items():
if ssid == con_ssid: self.networks[ssid]['connected'] = ssid == con_ssid
self.networks[ssid]['connected'] = True
else:
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( Gdk.threads_add_idle(
GLib.PRIORITY_DEFAULT_IDLE, GLib.PRIORITY_DEFAULT_IDLE,
cb, self.connected_ssid, prev_ssid) cb, self.connected_ssid, prev_ssid)
return [con_ssid, con_bssid] return [con_ssid, con_bssid]
elif "ssid" in vars and "bssid" in vars: elif "ssid" in variables and "bssid" in variables:
self.connected = True self.connected = True
self.connected_ssid = vars['ssid'] self.connected_ssid = variables['ssid']
for ssid, val in self.networks.items(): for ssid, val in self.networks.items():
if ssid == vars['ssid']: self.networks[ssid]['connected'] = ssid == variables['ssid']
self.networks[ssid]['connected'] = True
else:
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( Gdk.threads_add_idle(
GLib.PRIORITY_DEFAULT_IDLE, GLib.PRIORITY_DEFAULT_IDLE,
cb, self.connected_ssid, prev_ssid) cb, self.connected_ssid, prev_ssid)
return [vars['ssid'], vars['bssid']] return [variables['ssid'], variables['bssid']]
else: else:
logging.info("Resetting connected_ssid") logging.info("Resetting connected_ssid")
self.connected = False self.connected = False
@@ -244,7 +242,7 @@ class WifiManager():
logging.info("Saving WPA config") logging.info("Saving WPA config")
self.wpa_cli("SAVE_CONFIG") self.wpa_cli("SAVE_CONFIG")
def scan_results(self, interface='wlan0'): def scan_results(self):
new_networks = [] new_networks = []
deleted_networks = list(self.networks) deleted_networks = list(self.networks)
@@ -256,14 +254,14 @@ class WifiManager():
match = re.match("^([a-f0-9:]+)\\s+([0-9]+)\\s+([\\-0-9]+)\\s+(\\S+)\\s+(.+)?", res) match = re.match("^([a-f0-9:]+)\\s+([0-9]+)\\s+([\\-0-9]+)\\s+(\\S+)\\s+(.+)?", res)
if match: if match:
net = { net = {
"mac": match.group(1), "mac": match[1],
"channel": WifiChannels.lookup(match.group(2))[1], "channel": WifiChannels.lookup(match[2])[1],
"connected": False, "connected": False,
"configured": False, "configured": False,
"frequency": match.group(2), "frequency": match[2],
"flags": match.group(4), "flags": match[4],
"signal_level_dBm": match.group(3), "signal_level_dBm": match[3],
"ssid": match.group(5) "ssid": match[5]
} }
if "WPA2" in net['flags']: if "WPA2" in net['flags']:
@@ -289,7 +287,7 @@ class WifiManager():
deleted_networks.remove(net) deleted_networks.remove(net)
else: else:
new_networks.append(net) new_networks.append(net)
if len(new_networks) > 0 or len(deleted_networks) > 0: if new_networks or deleted_networks:
for cb in self._callbacks['scan_results']: for cb in self._callbacks['scan_results']:
Gdk.threads_add_idle( Gdk.threads_add_idle(
GLib.PRIORITY_DEFAULT_IDLE, GLib.PRIORITY_DEFAULT_IDLE,
@@ -300,8 +298,7 @@ class WifiManager():
self.wpa_thread.skip_command() self.wpa_thread.skip_command()
self.soc.send(command.encode()) self.soc.send(command.encode())
if wait is True: if wait is True:
resp = self.queue.get() return self.queue.get()
return resp
def wpa_cli_batch(self, commands): def wpa_cli_batch(self, commands):
for cmd in commands: for cmd in commands:
@@ -319,12 +316,12 @@ class WpaSocket(Thread):
self.wm = wm self.wm = wm
def run(self): def run(self):
event = threading.Event()
logging.debug("Setting up wifi event loop") logging.debug("Setting up wifi event loop")
while self._stop_loop is False: while self._stop_loop is False:
try: try:
msg = self.soc.recv(4096).decode().strip() msg = self.soc.recv(4096).decode().strip()
except Exception: except Exception as e:
logging.critical(e, exc_info=True)
# TODO: Socket error # TODO: Socket error
continue continue
if msg.startswith("<"): if msg.startswith("<"):
@@ -335,21 +332,18 @@ class WpaSocket(Thread):
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)
if match: if match:
for net in self.wm.networks: for net in self.wm.networks:
if self.wm.networks[net]['mac'] == match.group(1): if self.wm.networks[net]['mac'] == match[1]:
self.wm.networks[net]['connected'] = False self.wm.networks[net]['connected'] = False
break break
elif "Trying to associate" in msg: elif "Trying to associate" in msg or "CTRL-EVENT-REGDOM-CHANGE" in msg:
self.callback("connecting_status", msg)
elif "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) Gdk.threads_add_idle(GLib.PRIORITY_DEFAULT_IDLE, self.wm.get_current_wifi_idle_add)
self.callback("connecting_status", msg) self.callback("connecting_status", msg)
elif self.skip_commands > 0:
self.skip_commands = self.skip_commands - 1
else: else:
if self.skip_commands > 0: self.queue.put(msg)
self.skip_commands = self.skip_commands - 1
else:
self.queue.put(msg)
logging.info("Wifi event loop ended") logging.info("Wifi event loop ended")
def skip_command(self): def skip_command(self):
@@ -363,117 +357,117 @@ class WifiChannels:
@staticmethod @staticmethod
def lookup(freq): def lookup(freq):
if freq == "2412": if freq == "2412":
return ("2.4", "1") return "2.4", "1"
if freq == "2417": if freq == "2417":
return ("2.4", "2") return "2.4", "2"
if freq == "2422": if freq == "2422":
return ("2.4", "3") return "2.4", "3"
if freq == "2427": if freq == "2427":
return ("2.4", "4") return "2.4", "4"
if freq == "2432": if freq == "2432":
return ("2.4", "5") return "2.4", "5"
if freq == "2437": if freq == "2437":
return ("2.4", "6") return "2.4", "6"
if freq == "2442": if freq == "2442":
return ("2.4", "7") return "2.4", "7"
if freq == "2447": if freq == "2447":
return ("2.4", "8") return "2.4", "8"
if freq == "2452": if freq == "2452":
return ("2.4", "9") return "2.4", "9"
if freq == "2457": if freq == "2457":
return ("2.4", "10") return "2.4", "10"
if freq == "2462": if freq == "2462":
return ("2.4", "11") return "2.4", "11"
if freq == "2467": if freq == "2467":
return ("2.4", "12") return "2.4", "12"
if freq == "2472": if freq == "2472":
return ("2.4", "13") return "2.4", "13"
if freq == "2484": if freq == "2484":
return ("2.4", "14") return "2.4", "14"
if freq == "5035": if freq == "5035":
return ("5", "7") return "5", "7"
if freq == "5040": if freq == "5040":
return ("5", "8") return "5", "8"
if freq == "5045": if freq == "5045":
return ("5", "9") return "5", "9"
if freq == "5055": if freq == "5055":
return ("5", "11") return "5", "11"
if freq == "5060": if freq == "5060":
return ("5", "12") return "5", "12"
if freq == "5080": if freq == "5080":
return ("5", "16") return "5", "16"
if freq == "5170": if freq == "5170":
return ("5", "34") return "5", "34"
if freq == "5180": if freq == "5180":
return ("5", "36") return "5", "36"
if freq == "5190": if freq == "5190":
return ("5", "38") return "5", "38"
if freq == "5200": if freq == "5200":
return ("5", "40") return "5", "40"
if freq == "5210": if freq == "5210":
return ("5", "42") return "5", "42"
if freq == "5220": if freq == "5220":
return ("5", "44") return "5", "44"
if freq == "5230": if freq == "5230":
return ("5", "46") return "5", "46"
if freq == "5240": if freq == "5240":
return ("5", "48") return "5", "48"
if freq == "5260": if freq == "5260":
return ("5", "52") return "5", "52"
if freq == "5280": if freq == "5280":
return ("5", "56") return "5", "56"
if freq == "5300": if freq == "5300":
return ("5", "60") return "5", "60"
if freq == "5320": if freq == "5320":
return ("5", "64") return "5", "64"
if freq == "5500": if freq == "5500":
return ("5", "100") return "5", "100"
if freq == "5520": if freq == "5520":
return ("5", "104") return "5", "104"
if freq == "5540": if freq == "5540":
return ("5", "108") return "5", "108"
if freq == "5560": if freq == "5560":
return ("5", "112") return "5", "112"
if freq == "5580": if freq == "5580":
return ("5", "116") return "5", "116"
if freq == "5600": if freq == "5600":
return ("5", "120") return "5", "120"
if freq == "5620": if freq == "5620":
return ("5", "124") return "5", "124"
if freq == "5640": if freq == "5640":
return ("5", "128") return "5", "128"
if freq == "5660": if freq == "5660":
return ("5", "132") return "5", "132"
if freq == "5680": if freq == "5680":
return ("5", "136") return "5", "136"
if freq == "5700": if freq == "5700":
return ("5", "140") return "5", "140"
if freq == "5720": if freq == "5720":
return ("5", "144") return "5", "144"
if freq == "5745": if freq == "5745":
return ("5", "149") return "5", "149"
if freq == "5765": if freq == "5765":
return ("5", "153") return "5", "153"
if freq == "5785": if freq == "5785":
return ("5", "157") return "5", "157"
if freq == "5805": if freq == "5805":
return ("5", "161") return "5", "161"
if freq == "5825": if freq == "5825":
return ("5", "165") return "5", "165"
if freq == "4915": if freq == "4915":
return ("5", "183") return "5", "183"
if freq == "4920": if freq == "4920":
return ("5", "184") return "5", "184"
if freq == "4925": if freq == "4925":
return ("5", "185") return "5", "185"
if freq == "4935": if freq == "4935":
return ("5", "187") return "5", "187"
if freq == "4940": if freq == "4940":
return ("5", "188") return "5", "188"
if freq == "4945": if freq == "4945":
return ("5", "189") return "5", "189"
if freq == "4960": if freq == "4960":
return ("5", "192") return "5", "192"
if freq == "4980": if freq == "4980":
return ("5", "196") return "5", "196"
return None return None
+54 -12
View File
@@ -1,16 +1,58 @@
site_name: KlipperScreen site_name: KlipperScreen
nav: site_url: https://klipperscreen.readthedocs.io
- Hardware.md site_description: >-
- Installation.md KlipperScreen documentation.
- Configuration.md
- Quicktips.md repo_name: jordanruthe/KlipperScreen/
- Theming.md
- Troubleshooting.md
- Translations.md
- Changelog.md
- Panels.md
- Contact.md
theme: readthedocs
repo_url: https://github.com/jordanruthe/KlipperScreen/ repo_url: https://github.com/jordanruthe/KlipperScreen/
nav:
- Home: index.md
- Setup:
- Hardware.md
- Installation.md
- Configuration.md
- Quicktips.md
- Macros: macros.md
- Android.md
- Troubleshooting.md
- Theming.md
- Translations.md
- Breaking Changes: Changelog.md
- Screenshots: Panels.md
- Contact.md
theme:
name: material
language: en
features:
- content.code.annotate
- content.tooltips
- navigation.indexes
- navigation.sections
- navigation.top
- navigation.tracking
- search.highlight
- search.share
- search.suggest
- toc.follow
palette:
- scheme: slate
primary: deep purple
plugins: plugins:
- search - search
markdown_extensions:
- admonition
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/jordanruthe/klipperScreen/
- icon: fontawesome/brands/discord
link: https://discord.klipper3d.org/
- icon: fontawesome/brands/python
+129 -220
View File
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import contextlib
import datetime import datetime
import gi import gi
import logging import logging
@@ -9,31 +10,22 @@ from jinja2 import Environment
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
class BasePanel(ScreenPanel): class BasePanel(ScreenPanel):
def __init__(self, screen, title, back=True, action_bar=True, printer_name=True): def __init__(self, screen, title, back=True):
super().__init__(screen, title, back, action_bar, printer_name) super().__init__(screen, title, back)
self.current_panel = None self.current_panel = None
self.time_min = -1 self.time_min = -1
self.time_format = self._config.get_main_config_option("24htime") self.time_format = self._config.get_main_config().getboolean("24htime", True)
self.title_spacing = self._gtk.font_size * 2
self.time_update = None self.time_update = None
self.titlebar_name_type = None self.titlebar_name_type = None
self.buttons_showing = { self.buttons_showing = {
'back': False if back else True, 'back': not back,
'macros_shortcut': False, 'macros_shortcut': False,
'printer_select': False 'printer_select': False
} }
self.current_extruder = None
self.layout = Gtk.Layout() # Action bar buttons
self.layout.set_size(self._screen.width, self._screen.height)
action_bar_width = self._gtk.get_action_bar_width() if action_bar is True else 0
action_bar_height = self._gtk.get_action_bar_height() if action_bar is True else 0
self.control_grid = self._gtk.HomogeneousGrid()
self.control_grid.set_size_request(action_bar_width, action_bar_height)
self.control_grid.get_style_context().add_class('action_bar')
self.control['back'] = self._gtk.ButtonImage('back', None, None, 1) self.control['back'] = self._gtk.ButtonImage('back', None, None, 1)
self.control['back'].connect("clicked", self.back) self.control['back'].connect("clicked", self.back)
self.control['home'] = self._gtk.ButtonImage('main', None, None, 1) self.control['home'] = self._gtk.ButtonImage('main', None, None, 1)
@@ -43,8 +35,8 @@ class BasePanel(ScreenPanel):
self.control['printer_select'] = self._gtk.ButtonImage('shuffle', None, None, 1) self.control['printer_select'] = self._gtk.ButtonImage('shuffle', None, None, 1)
self.control['printer_select'].connect("clicked", self._screen.show_printer_select) self.control['printer_select'].connect("clicked", self._screen.show_printer_select)
self.control['macro_shortcut'] = self._gtk.ButtonImage('custom-script', None, None, 1) self.control['macros_shortcut'] = self._gtk.ButtonImage('custom-script', None, None, 1)
self.control['macro_shortcut'].connect("clicked", self.menu_item_clicked, "gcode_macros", { self.control['macros_shortcut'].connect("clicked", self.menu_item_clicked, "gcode_macros", {
"name": "Macros", "name": "Macros",
"panel": "gcode_macros" "panel": "gcode_macros"
}) })
@@ -52,124 +44,121 @@ class BasePanel(ScreenPanel):
self.control['estop'] = self._gtk.ButtonImage('emergency', None, None, 1) self.control['estop'] = self._gtk.ButtonImage('emergency', None, None, 1)
self.control['estop'].connect("clicked", self.emergency_stop) self.control['estop'].connect("clicked", self.emergency_stop)
self.locations = { # Any action bar button should close the keyboard
'macro_shortcut': 2, for item in self.control:
'printer_select': 2 self.control[item].connect("clicked", self._screen.remove_keyboard)
}
button_range = 3
if len(self._config.get_printers()) > 1:
self.locations['macro_shortcut'] = 3
if self._config.get_main_config_option('side_macro_shortcut') == "True":
button_range = 4
for i in range(button_range): # Action bar
self.control['space%s' % i] = Gtk.Label("") self.action_bar = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=5)
if self._screen.vertical_mode:
self.control_grid.attach(self.control['space%s' % i], i, 0, 1, 1)
else:
self.control_grid.attach(self.control['space%s' % i], 0, i, 1, 1)
if self._screen.vertical_mode: if self._screen.vertical_mode:
self.control_grid.attach(self.control['estop'], 4, 0, 1, 1) self.action_bar.set_hexpand(True)
self.action_bar.set_vexpand(False)
self.action_bar.set_size_request(0, self._gtk.get_action_bar_height())
else: else:
self.control_grid.attach(self.control['estop'], 0, 4, 1, 1) self.action_bar.set_hexpand(False)
self.action_bar.set_vexpand(True)
self.action_bar.set_size_request(self._gtk.get_action_bar_width(), 0)
try: self.action_bar.get_style_context().add_class('action_bar')
env = Environment(extensions=["jinja2.ext.i18n"]) self.action_bar.add(self.control['back'])
env.install_gettext_translations(self.lang) self.action_bar.add(self.control['home'])
j2_temp = env.from_string(title) if len(self._config.get_printers()) > 1:
title = j2_temp.render() self.action_bar.add(self.control['printer_select'])
except Exception: self.action_bar.add(self.control['macros_shortcut'])
logging.debug("Error parsing jinja for title: %s" % title) self.action_bar.add(self.control['estop'])
# Titlebar
# This box will be populated by show_heaters
self.control['temp_box'] = Gtk.Box(spacing=10)
self.titlelbl = Gtk.Label() self.titlelbl = Gtk.Label()
self.titlelbl.set_hexpand(True) self.titlelbl.set_hexpand(True)
self.titlelbl.set_vexpand(True)
self.titlelbl.set_halign(Gtk.Align.CENTER) self.titlelbl.set_halign(Gtk.Align.CENTER)
self.titlelbl.set_ellipsize(True)
self.titlelbl.set_ellipsize(Pango.EllipsizeMode.END) self.titlelbl.set_ellipsize(Pango.EllipsizeMode.END)
self.set_title(title) self.set_title(title)
self.hmargin = 5 self.control['time'] = Gtk.Label("00:00 AM")
self.content = Gtk.VBox(spacing=0)
if self._screen.vertical_mode:
self.content.set_size_request(self._screen.width - self.hmargin * 2,
self._screen.height - self.title_spacing - action_bar_height)
else:
self.content.set_size_request(self._screen.width - action_bar_width - self.hmargin,
self._screen.height - self.title_spacing)
if action_bar is True:
if self._screen.vertical_mode:
self.layout.put(self.control_grid, 0, self._screen.height - action_bar_height)
else:
self.layout.put(self.control_grid, 0, 0)
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'] = Gtk.Label("00:00 AM") self.control['time_box'].pack_end(self.control['time'], True, True, 5)
self.control['time_box'].pack_end(self.control['time'], True, True, self.hmargin)
self.control['temp_box'] = Gtk.Box() self.titlebar = Gtk.Box(spacing=5)
self.titlebar.set_size_request(0, self._gtk.get_titlebar_height())
self.titlebar = Gtk.Grid()
self.titlebar.set_valign(Gtk.Align.CENTER) self.titlebar.set_valign(Gtk.Align.CENTER)
self.titlebar.set_property("column-spacing", 5) self.titlebar.add(self.control['temp_box'])
if self._screen.vertical_mode: self.titlebar.add(self.titlelbl)
self.titlebar.set_size_request(self._screen.width, self.title_spacing) self.titlebar.add(self.control['time_box'])
else:
self.titlebar.set_size_request(self._screen.width - action_bar_width, self.title_spacing) # Main layout
self.titlebar.attach(self.control['temp_box'], 0, 0, 1, 1) self.main_grid = Gtk.Grid()
self.titlebar.attach(self.titlelbl, 1, 0, 1, 1) # To achieve rezisability this needs to be removed
self.titlebar.attach(self.control['time_box'], 2, 0, 1, 1) # The main issue is that currently the content doesn't expand correctly
self.main_grid.set_size_request(self._screen.width, self._screen.height)
if self._screen.vertical_mode: if self._screen.vertical_mode:
self.layout.put(self.titlebar, 0, 0) self.main_grid.attach(self.titlebar, 0, 0, 1, 1)
self.layout.put(self.content, self.hmargin, self.title_spacing) self.main_grid.attach(self.content, 0, 1, 1, 1)
self.main_grid.attach(self.action_bar, 0, 2, 1, 1)
self.action_bar.set_orientation(orientation=Gtk.Orientation.HORIZONTAL)
else: else:
self.layout.put(self.titlebar, action_bar_width, 0) self.main_grid.attach(self.action_bar, 0, 0, 1, 2)
self.layout.put(self.content, action_bar_width + self.hmargin, self.title_spacing) self.action_bar.set_orientation(orientation=Gtk.Orientation.VERTICAL)
self.main_grid.attach(self.titlebar, 1, 0, 1, 1)
self.main_grid.attach(self.content, 1, 1, 1, 1)
# Layout is and content are on screen_panel
self.layout.add(self.main_grid)
def initialize(self, panel_name): def initialize(self, panel_name):
self.update_time() self.update_time()
return return
def show_heaters(self, show=True): def show_heaters(self, show=True):
printer_cfg = self._config.get_printer_config(self._screen.connected_printer)
if printer_cfg is not None:
self.titlebar_name_type = printer_cfg.get("titlebar_name_type", None)
else:
self.titlebar_name_type = None
logging.info(f"Titlebar name type: {self.titlebar_name_type}")
for child in self.control['temp_box'].get_children(): for child in self.control['temp_box'].get_children():
self.control['temp_box'].remove(child) self.control['temp_box'].remove(child)
if (not show or self._screen.printer.get_temp_store_devices() is None): if not show or self._screen.printer.get_temp_store_devices() is None:
return return
for device in self._screen.printer.get_temp_store_devices(): for device in self._screen.printer.get_temp_store_devices():
logging.info(device)
self.labels[device + '_box'] = Gtk.Box(spacing=0)
self.labels[device] = Gtk.Label(label="100º")
self.labels[device].set_ellipsize(True)
self.labels[device].set_ellipsize(Pango.EllipsizeMode.START)
if device.startswith("extruder"): if device.startswith("extruder"):
if self._screen.printer.extrudercount > 1: if self._screen.printer.extrudercount > 1:
if device == "extruder": if device == "extruder":
ext_img = self._gtk.Image("extruder-0", .5) icon = self._gtk.Image("extruder-0", .5)
else: else:
ext_img = self._gtk.Image("extruder-%s" % device[8:], .5) icon = self._gtk.Image(f"extruder-{device[8:]}", .5)
else: else:
ext_img = self._gtk.Image("extruder", .5) icon = self._gtk.Image("extruder", .5)
self.labels[device + '_box'].pack_start(ext_img, True, True, 3)
elif device.startswith("heater_bed"): elif device.startswith("heater_bed"):
bed_img = self._gtk.Image("bed", .5) icon = self._gtk.Image("bed", .5)
self.labels[device + '_box'].pack_start(bed_img, True, True, 3) # 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"): elif device.startswith("temperature_fan"):
fan_img = self._gtk.Image("fan", .5) icon = self._gtk.Image("fan", .5)
self.labels[device + '_box'].pack_start(fan_img, True, True, 3)
elif device.startswith("heater_generic"): elif device.startswith("heater_generic"):
heat_img = self._gtk.Image("heater", .5) icon = self._gtk.Image("heater", .5)
self.labels[device + '_box'].pack_start(heat_img, True, True, 3)
else: else:
temp_img = self._gtk.Image("heat-up", .5) icon = self._gtk.Image("heat-up", .5)
self.labels[device + '_box'].pack_start(temp_img, True, True, 3)
self.labels[device + '_box'].pack_start(self.labels[device], True, True, 0)
self.labels[device] = Gtk.Label(label="100º")
self.labels[device].set_ellipsize(Pango.EllipsizeMode.START)
self.labels[f'{device}_box'] = Gtk.Box()
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)
# Limit the number of items according to resolution
if self._screen.width <= 480: if self._screen.width <= 480:
nlimit = 3 nlimit = 3
elif self._screen.width <= 800: elif self._screen.width <= 800:
@@ -180,33 +169,27 @@ class BasePanel(ScreenPanel):
n = 0 n = 0
if self._screen.printer.get_tools(): if self._screen.printer.get_tools():
self.current_extruder = self._screen.printer.get_stat("toolhead", "extruder") self.current_extruder = self._screen.printer.get_stat("toolhead", "extruder")
self.control['temp_box'].pack_start(self.labels["%s_box" % self.current_extruder], True, True, 3) self.control['temp_box'].add(self.labels[f"{self.current_extruder}_box"])
n += 1 n += 1
if self._screen.printer.has_heated_bed(): if self._screen.printer.has_heated_bed():
self.control['temp_box'].pack_start(self.labels['heater_bed_box'], True, True, 3) self.control['temp_box'].add(self.labels['heater_bed_box'])
n += 1 n += 1
# Options in the config have priority # Options in the config have priority
printer_cfg = self._config.get_printer_config(self._screen.connected_printer)
if printer_cfg is not None: if printer_cfg is not None:
titlebar_items = printer_cfg.get("titlebar_items", "") titlebar_items = printer_cfg.get("titlebar_items", "")
if titlebar_items is not None: if titlebar_items is not None:
titlebar_items = [str(i.strip()) for i in titlebar_items.split(',')] titlebar_items = [str(i.strip()) for i in titlebar_items.split(',')]
logging.info("Titlebar items: %s", titlebar_items) logging.info(f"Titlebar items: {titlebar_items}")
self.titlebar_name_type = printer_cfg.get("titlebar_name_type", None)
logging.info("Titlebar name type: %s", self.titlebar_name_type)
for device in self._screen.printer.get_temp_store_devices(): for device in self._screen.printer.get_temp_store_devices():
# Users can fill the bar if they want # Users can fill the bar if they want
if n >= nlimit + 1: if n >= nlimit + 1:
break break
if not (device.startswith("extruder") or device.startswith("heater_bed")): name = device.split()[1] if len(device.split()) > 1 else device
name = device.split(" ")[1:][0]
else:
name = device
for item in titlebar_items: for item in titlebar_items:
if name == item: if name == item:
self.control['temp_box'].pack_start(self.labels["%s_box" % device], True, True, 3) self.control['temp_box'].add(self.labels[f"{device}_box"])
n += 1 n += 1
break break
@@ -215,7 +198,7 @@ class BasePanel(ScreenPanel):
if n >= nlimit: if n >= nlimit:
break break
if device.startswith("heater_generic"): if device.startswith("heater_generic"):
self.control['temp_box'].pack_start(self.labels["%s_box" % device], True, True, 3) 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()
@@ -232,18 +215,13 @@ class BasePanel(ScreenPanel):
if self.current_panel is None: if self.current_panel is None:
return return
if self._screen.is_keyboard_showing(): self._screen.remove_keyboard()
self._screen.remove_keyboard()
if hasattr(self.current_panel, "back"): if hasattr(self.current_panel, "back") \
if not self.current_panel.back(): and not self.current_panel.back() \
self._screen._menu_go_back() or not hasattr(self.current_panel, "back"):
else:
self._screen._menu_go_back() self._screen._menu_go_back()
def get(self):
return self.layout
def process_update(self, action, data): def process_update(self, action, data):
if action != "notify_status_update" or self._screen.printer is None: if action != "notify_status_update" or self._screen.printer is None:
return return
@@ -251,150 +229,81 @@ class BasePanel(ScreenPanel):
devices = self._screen.printer.get_temp_store_devices() devices = self._screen.printer.get_temp_store_devices()
if devices is not None: if devices is not None:
for device in devices: for device in devices:
name = ""
if not (device.startswith("extruder") or device.startswith("heater_bed")):
if self.titlebar_name_type == "full":
name = device.split(" ")[1:][0].capitalize().replace("_", " ") + ": "
elif self.titlebar_name_type == "short":
name = device.split(" ")[1:][0][:1].upper() + ": "
temp = self._screen.printer.get_dev_stat(device, "temperature") temp = self._screen.printer.get_dev_stat(device, "temperature")
if temp is not None: if temp is not None and device in self.labels:
self.labels[device].set_label("%s%d°" % (name, round(temp))) name = ""
if not (device.startswith("extruder") or device.startswith("heater_bed")):
if self.titlebar_name_type == "full":
name = device.split()[1] if len(device.split()) > 1 else device
name = f'{name.capitalize().replace("_", " ")}: '
elif self.titlebar_name_type == "short":
name = device.split()[1] if len(device.split()) > 1 else device
name = f"{name[:1].upper()}: "
self.labels[device].set_label(f"{name}{int(temp)}°")
if "toolhead" in data and "extruder" in data["toolhead"]: with contextlib.suppress(KeyError):
if data["toolhead"]["extruder"] != self.current_extruder: if data["toolhead"]["extruder"] != self.current_extruder:
self.control['temp_box'].remove(self.labels["%s_box" % self.current_extruder]) self.control['temp_box'].remove(self.labels[f"{self.current_extruder}_box"])
self.current_extruder = data["toolhead"]["extruder"] self.current_extruder = data["toolhead"]["extruder"]
self.control['temp_box'].pack_start(self.labels["%s_box" % self.current_extruder], True, True, 3) self.control['temp_box'].pack_start(self.labels[f"{self.current_extruder}_box"], True, True, 3)
self.control['temp_box'].reorder_child(self.labels["%s_box" % self.current_extruder], 0) self.control['temp_box'].reorder_child(self.labels[f"{self.current_extruder}_box"], 0)
self.control['temp_box'].show_all() self.control['temp_box'].show_all()
def remove(self, widget): def remove(self, widget):
self.content.remove(widget) self.content.remove(widget)
def show_back(self, show=True): def show_back(self, show=True):
if show is True and self.buttons_showing['back'] is False: if show is True and self.buttons_showing['back'] is False:
self.control_grid.remove(self.control_grid.get_child_at(0, 0)) self.control['back'].set_sensitive(True)
self.control_grid.attach(self.control['back'], 0, 0, 1, 1) self.control['home'].set_sensitive(True)
if self._screen.vertical_mode:
self.control_grid.remove(self.control_grid.get_child_at(1, 0))
self.control_grid.attach(self.control['home'], 1, 0, 1, 1)
else:
self.control_grid.remove(self.control_grid.get_child_at(0, 1))
self.control_grid.attach(self.control['home'], 0, 1, 1, 1)
self.buttons_showing['back'] = True self.buttons_showing['back'] = True
elif show is False and self.buttons_showing['back'] is True: elif show is False and self.buttons_showing['back'] is True:
for i in range(0, 2): self.control['back'].set_sensitive(False)
if self._screen.vertical_mode: self.control['home'].set_sensitive(False)
self.control_grid.remove(self.control_grid.get_child_at(i, 0))
self.control_grid.attach(self.control['space%s' % i], i, 0, 1, 1)
else:
self.control_grid.remove(self.control_grid.get_child_at(0, i))
self.control_grid.attach(self.control['space%s' % i], 0, i, 1, 1)
self.buttons_showing['back'] = False self.buttons_showing['back'] = False
self.control_grid.show()
def show_macro_shortcut(self, show=True, mod_row=False):
if show == "True":
show = True
def show_macro_shortcut(self, show=True):
if show is True and self.buttons_showing['macros_shortcut'] is False: if show is True and self.buttons_showing['macros_shortcut'] is False:
if len(self._config.get_printers()) > 1 and mod_row is True: self.action_bar.add(self.control['macros_shortcut'])
if self._screen.vertical_mode: if self.buttons_showing['printer_select'] is False:
self.control_grid.insert_column(self.locations['macro_shortcut']) self.action_bar.reorder_child(self.control['macros_shortcut'], 2)
else:
self.control_grid.insert_row(self.locations['macro_shortcut'])
else: else:
if self._screen.vertical_mode: self.action_bar.reorder_child(self.control['macros_shortcut'], 3)
self.control_grid.remove(self.control_grid.get_child_at(self.locations['macro_shortcut'], 0))
else:
self.control_grid.remove(self.control_grid.get_child_at(0, self.locations['macro_shortcut']))
if 'space%s' % self.locations['macro_shortcut'] in self.control:
self.control_grid.remove(self.control['space%s' % self.locations['macro_shortcut']])
if self._screen.vertical_mode:
self.control_grid.attach(self.control['macro_shortcut'], self.locations['macro_shortcut'], 0, 1, 1)
else:
self.control_grid.attach(self.control['macro_shortcut'], 0, self.locations['macro_shortcut'], 1, 1)
self.buttons_showing['macros_shortcut'] = True self.buttons_showing['macros_shortcut'] = True
elif show is not True and self.buttons_showing['macros_shortcut'] is True: elif show is False and self.buttons_showing['macros_shortcut'] is True:
if ('space%s' % self.locations['macro_shortcut']) not in self.control: self.action_bar.remove(self.control['macros_shortcut'])
self.control['space%s' % self.locations['macro_shortcut']] = Gtk.Label("")
if len(self._config.get_printers()) > 1 and mod_row is True:
if self._screen.vertical_mode:
self.control_grid.remove(self.control_grid.get_child_at(self.locations['macro_shortcut'], 0))
self.control_grid.remove_column(self.locations['macro_shortcut'])
else:
self.control_grid.remove(self.control_grid.get_child_at(0, self.locations['macro_shortcut']))
self.control_grid.remove_row(self.locations['macro_shortcut'])
self.control_grid.remove(self.control['macro_shortcut'])
else:
if self._screen.vertical_mode:
self.control_grid.remove(self.control_grid.get_child_at(self.locations['macro_shortcut'], 0))
else:
self.control_grid.remove(self.control_grid.get_child_at(0, self.locations['macro_shortcut']))
if ('space%s' % self.locations['macro_shortcut']) not in self.control:
self.control['space%s' % self.locations['macro_shortcut']] = Gtk.Label("")
if self._screen.vertical_mode:
self.control_grid.attach(self.control['space%s' % self.locations['macro_shortcut']],
self.locations['macro_shortcut'], 0, 1, 1)
else:
self.control_grid.attach(self.control['space%s' % self.locations['macro_shortcut']],
0, self.locations['macro_shortcut'], 1, 1)
self.buttons_showing['macros_shortcut'] = False self.buttons_showing['macros_shortcut'] = False
self._screen.show_all() 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:
return return
if show and self.buttons_showing['printer_select'] is False: if show and self.buttons_showing['printer_select'] is False:
logging.info("Turning on printer_select button") self.action_bar.add(self.control['printer_select'])
if self._screen.vertical_mode: self.action_bar.reorder_child(self.control['printer_select'], 2)
self.control_grid.remove(self.control_grid.get_child_at(self.locations['printer_select'], 0))
self.control_grid.attach(self.control['printer_select'], self.locations['printer_select'], 0, 1, 1)
else:
self.control_grid.remove(self.control_grid.get_child_at(0, self.locations['printer_select']))
self.control_grid.attach(self.control['printer_select'], 0, self.locations['printer_select'], 1, 1)
self.buttons_showing['printer_select'] = True self.buttons_showing['printer_select'] = True
elif show is False and self.buttons_showing['printer_select']: elif show is False and self.buttons_showing['printer_select']:
logging.info("Turning off printer_select button") self.action_bar.remove(self.control['printer_select'])
if self._screen.vertical_mode:
self.control_grid.remove(self.control_grid.get_child_at(self.locations['printer_select'], 0))
self.control_grid.attach(self.control['space%s' % self.locations['printer_select']],
self.locations['printer_select'], 0, 1, 1)
else:
self.control_grid.remove(self.control_grid.get_child_at(0, self.locations['printer_select']))
self.control_grid.attach(self.control['space%s' % self.locations['printer_select']],
0, self.locations['printer_select'], 1, 1)
self.buttons_showing['printer_select'] = False self.buttons_showing['printer_select'] = False
self._screen.show_all() self._screen.show_all()
def set_title(self, title): def set_title(self, title):
try: try:
env = Environment(extensions=["jinja2.ext.i18n"]) env = Environment(extensions=["jinja2.ext.i18n"], autoescape=True)
env.install_gettext_translations(self.lang) env.install_gettext_translations(self.lang)
j2_temp = env.from_string(title) j2_temp = env.from_string(title)
title = j2_temp.render() title = j2_temp.render()
except Exception: except Exception:
logging.debug("Error parsing jinja for title: %s" % title) logging.debug(f"Error parsing jinja for title: {title}")
self.titlelbl.set_label("%s | %s" % (self._screen.connecting_to_printer, title)) self.titlelbl.set_label(f"{self._screen.connecting_to_printer} | {title}")
def show_back_buttons(self):
self.control_grid.attach(self.control['back'], 0, 0, 1, 1)
if self._screen.vertical_mode:
self.control_grid.attach(self.control['home'], 1, 0, 1, 1)
else:
self.control_grid.attach(self.control['home'], 0, 1, 1, 1)
def update_time(self): def update_time(self):
now = datetime.datetime.now() now = datetime.datetime.now()
confopt = self._config.get_main_config_option("24htime") 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 == "True": if confopt:
self.control['time'].set_text(now.strftime("%H:%M")) self.control['time'].set_text(f'{now:%H:%M}')
else: else:
self.control['time'].set_text(now.strftime("%I:%M %p")) self.control['time'].set_text(f'{now:%I:%M %p}')
return True return True
+159 -143
View File
@@ -8,91 +8,68 @@ from gi.repository import Gtk
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
def create_panel(*args): def create_panel(*args):
return BedLevelPanel(*args) return BedLevelPanel(*args)
class BedLevelPanel(ScreenPanel): class BedLevelPanel(ScreenPanel):
x_offset = 0
y_offset = 0 def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
self.response_count = 0
self.panel_name = ""
self.screw_dict = {}
self.screws = []
self.y_cnt = 0
self.x_cnt = 0
self.x_offset = 0
self.y_offset = 0
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
self.panel_name = panel_name self.panel_name = panel_name
self.screws = None self.labels['dm'] = self._gtk.ButtonImage("motor-off", _("Disable XY"), "color3")
self.labels['dm'].connect("clicked", self.disable_motors)
screw_positions = []
rotation = None
grid = self._gtk.HomogeneousGrid() grid = self._gtk.HomogeneousGrid()
grid.attach(self.labels['dm'], 0, 0, 1, 1)
screws = []
config_section_name = None
if "screws_tilt_adjust" in self._screen.printer.get_config_section_list(): if "screws_tilt_adjust" in self._screen.printer.get_config_section_list():
config_section_name = "screws_tilt_adjust" self.labels['screws'] = self._gtk.ButtonImage("refresh", _("Screws Adjust"), "color4")
elif "bed_screws" in self._screen.printer.get_config_section_list(): self.labels['screws'].connect("clicked", self.screws_tilt_calculate)
config_section_name = "bed_screws" grid.attach(self.labels['screws'], 0, 1, 1, 1)
if config_section_name is not None: self.screws = self._get_screws("screws_tilt_adjust")
config_section = self._screen.printer.get_config_section(config_section_name) logging.info(f"screws_tilt_adjust: {self.screws}")
for item in config_section:
logging.debug("Screws section: %s" % config_section[item])
result = re.match(r"([\-0-9\.]+)\s*,\s*([\-0-9\.]+)", config_section[item])
if result:
screws.append([
round(float(result.group(1)), 2),
round(float(result.group(2)), 2)
])
screws = sorted(screws, key=lambda x: (float(x[1]), float(x[0])))
supported = [4, 6, 8]
nscrews = len(screws)
if nscrews not in supported:
logging.debug("%d bed_screws not supported: calculating 4 locations", nscrews)
xconf = self._screen.printer.get_config_section("stepper_x")
yconf = self._screen.printer.get_config_section("stepper_y")
x = int(int(xconf['position_max'])/4)
y = int(int(yconf['position_max'])/4)
self.screws = [
[x, y],
[x*3, y],
[x, y*3],
[x*3, y*3],
]
else:
self.screws = screws
if (("bltouch" in self._screen.printer.get_config_section_list() or
"probe" in self._screen.printer.get_config_section_list()) and
config_section_name == "screws_tilt_adjust"):
if "bltouch" in self._screen.printer.get_config_section_list(): if "bltouch" in self._screen.printer.get_config_section_list():
bltouch = self._screen.printer.get_config_section("bltouch") self._get_offsets("bltouch")
if "x_offset" in bltouch:
self.x_offset = float(bltouch['x_offset'])
if "y_offset" in bltouch:
self.y_offset = float(bltouch['y_offset'])
logging.debug("Bltouch found substracted offset X: %.0f Y: %.0f", self.x_offset, self.y_offset)
self._screen.show_popup_message(_("Bltouch found applied offset"), level=1)
elif "probe" in self._screen.printer.get_config_section_list(): elif "probe" in self._screen.printer.get_config_section_list():
probe = self._screen.printer.get_config_section("probe") self._get_offsets("probe")
if "x_offset" in probe:
self.x_offset = float(probe['x_offset'])
if "y_offset" in probe:
self.y_offset = float(probe['y_offset'])
logging.debug("Probe found substracting offset X: %.0f Y: %.0f", self.x_offset, self.y_offset)
self._screen.show_popup_message(_("Probe found applied offset"), level=1)
new_screws = [] new_screws = []
# bed_screws uses NOZZLE positions
# screws_tilt_adjust uses PROBE positions and to be offseted for the buttons to work equal to bed_screws
for screw in self.screws: for screw in self.screws:
new_screws.append([ new_screws.append([screw[0] + self.x_offset, screw[1] + self.y_offset])
self.apply_offset(screw[0], self.x_offset),
self.apply_offset(screw[1], self.y_offset)
])
self.screws = new_screws self.screws = new_screws
logging.info(f"screws with offset: {self.screws}")
elif "bed_screws" in self._screen.printer.get_config_section_list():
self.screws = self._get_screws("bed_screws")
logging.info(f"bed_screws: {self.screws}")
# get dimensions # get dimensions
self.x_cnt = len(list(dict.fromkeys([int(x[0]) for x in self.screws]))) x_positions = {x[0] for x in self.screws}
self.y_cnt = len(list(dict.fromkeys([int(x[1]) for x in self.screws]))) y_positions = {y[1] for y in self.screws}
logging.info(f"X: {x_positions}\nY: {y_positions}")
self.x_cnt = len(x_positions)
self.y_cnt = len(y_positions)
min_x = min(dict(self.screws).keys()) min_x = min(x_positions)
max_x = max(dict(self.screws).keys()) max_x = max(x_positions)
min_y = min(dict(self.screws[::-1]).values()) min_y = min(y_positions)
max_y = max(dict(self.screws).values()) max_y = max(y_positions)
fl = [min_x, min_y] fl = [min_x, min_y]
bl = [min_x, max_y] bl = [min_x, max_y]
@@ -112,7 +89,7 @@ class BedLevelPanel(ScreenPanel):
else: else:
lm = rm = None lm = rm = None
logging.debug("Using %d-screw locations [x,y] [%dx%d]", len(self.screws), self.x_cnt, self.y_cnt) logging.debug(f"Using {len(self.screws)}-screw locations [x,y] [{self.x_cnt}x{self.y_cnt}]")
self.labels['bl'] = self._gtk.ButtonImage("bed-level-t-l", None, None, 2.5) self.labels['bl'] = self._gtk.ButtonImage("bed-level-t-l", None, None, 2.5)
self.labels['br'] = self._gtk.ButtonImage("bed-level-t-r", None, None, 2.5) self.labels['br'] = self._gtk.ButtonImage("bed-level-t-r", None, None, 2.5)
@@ -123,26 +100,71 @@ class BedLevelPanel(ScreenPanel):
self.labels['fm'] = self._gtk.ButtonImage("bed-level-b-m", None, None, 2.5) self.labels['fm'] = self._gtk.ButtonImage("bed-level-b-m", None, None, 2.5)
self.labels['bm'] = self._gtk.ButtonImage("bed-level-t-m", None, None, 2.5) self.labels['bm'] = self._gtk.ButtonImage("bed-level-t-m", None, None, 2.5)
bedgrid = Gtk.Grid() valid_positions = True
bedgrid.attach(self.labels['bl'], 1, 0, 1, 1) printer_cfg = self._config.get_printer_config(self._screen.connected_printer)
bedgrid.attach(self.labels['fl'], 1, 2, 1, 1) if printer_cfg is not None:
bedgrid.attach(self.labels['fr'], 3, 2, 1, 1) logging.info(f"printer {printer_cfg}")
bedgrid.attach(self.labels['br'], 3, 0, 1, 1) screw_positions = printer_cfg.get("screw_positions", "")
screw_positions = [str(i.strip()) for i in screw_positions.split(',')]
rotation = 0 logging.info(f"Positions: {screw_positions}")
for screw in screw_positions:
if screw not in ("bl", "fl", "fr", "br", "bm", "fm", "lm", "rm", ""):
logging.error(f"Unknown screw: {screw}")
self._screen.show_popup_message(_("Unknown screw position") + ": %s" % screw)
valid_positions = False
if not(3 <= len(screw_positions) <= 8):
valid_positions = False
rotation = printer_cfg.getint("screw_rotation", 0)
logging.info(f"Rotation: {rotation}")
if 'bed_screws' in self._config.get_config(): if 'bed_screws' in self._config.get_config():
rotation = self._config.get_config()['bed_screws'].getint("rotation", 0) rotation = self._config.get_config()['bed_screws'].getint("rotation", 0)
logging.debug("Rotation: %d", rotation) logging.debug(f"Rotation: {rotation}")
bedgrid = Gtk.Grid()
nscrews = len(self.screws)
if valid_positions:
if "bl" in screw_positions:
bedgrid.attach(self.labels['bl'], 1, 0, 1, 1)
if "fl" in screw_positions:
bedgrid.attach(self.labels['fl'], 1, 2, 1, 1)
if "fr" in screw_positions:
bedgrid.attach(self.labels['fr'], 3, 2, 1, 1)
if "br" in screw_positions:
bedgrid.attach(self.labels['br'], 3, 0, 1, 1)
if "bm" in screw_positions:
bedgrid.attach(self.labels['bm'], 2, 0, 1, 1)
if "fm" in screw_positions:
bedgrid.attach(self.labels['fm'], 2, 2, 1, 1)
if "lm" in screw_positions:
bedgrid.attach(self.labels['lm'], 1, 1, 1, 1)
if "rm" in screw_positions:
bedgrid.attach(self.labels['rm'], 3, 1, 1, 1)
elif nscrews in (4, 6, 8):
bedgrid.attach(self.labels['bl'], 1, 0, 1, 1)
bedgrid.attach(self.labels['fl'], 1, 2, 1, 1)
bedgrid.attach(self.labels['fr'], 3, 2, 1, 1)
bedgrid.attach(self.labels['br'], 3, 0, 1, 1)
if self.x_cnt == 3:
bedgrid.attach(self.labels['bm'], 2, 0, 1, 1)
bedgrid.attach(self.labels['fm'], 2, 2, 1, 1)
if self.y_cnt == 3:
bedgrid.attach(self.labels['lm'], 1, 1, 1, 1)
bedgrid.attach(self.labels['rm'], 3, 1, 1, 1)
else:
label = Gtk.Label(
_("Bed screw configuration:") + f" {nscrews}\n\n"
+ _("Not supported for auto-detection, it needs to be configured in klipperscreen.conf")
)
grid.attach(label, 1, 0, 3, 2)
self.content.add(grid)
return
if rotation == 90: if rotation == 90:
# fl lm bl # fl lm bl
# fm bm # fm bm
# fr rm br # fr rm br
if self.y_cnt == 3:
bedgrid.attach(self.labels['bm'], 2, 0, 1, 1)
bedgrid.attach(self.labels['fm'], 2, 2, 1, 1)
if self.x_cnt == 3:
bedgrid.attach(self.labels['lm'], 1, 1, 1, 1)
bedgrid.attach(self.labels['rm'], 3, 1, 1, 1)
self.labels['bl'].connect("clicked", self.go_to_position, fl) self.labels['bl'].connect("clicked", self.go_to_position, fl)
self.labels['bm'].connect("clicked", self.go_to_position, lm) self.labels['bm'].connect("clicked", self.go_to_position, lm)
self.labels['br'].connect("clicked", self.go_to_position, bl) self.labels['br'].connect("clicked", self.go_to_position, bl)
@@ -165,12 +187,6 @@ class BedLevelPanel(ScreenPanel):
# fr fm fl # fr fm fl
# rm lm # rm lm
# br bm bl # br bm bl
if self.x_cnt == 3:
bedgrid.attach(self.labels['bm'], 2, 0, 1, 1)
bedgrid.attach(self.labels['fm'], 2, 2, 1, 1)
if self.y_cnt == 3:
bedgrid.attach(self.labels['lm'], 1, 1, 1, 1)
bedgrid.attach(self.labels['rm'], 3, 1, 1, 1)
self.labels['bl'].connect("clicked", self.go_to_position, fr) self.labels['bl'].connect("clicked", self.go_to_position, fr)
self.labels['bm'].connect("clicked", self.go_to_position, fm) self.labels['bm'].connect("clicked", self.go_to_position, fm)
self.labels['br'].connect("clicked", self.go_to_position, fl) self.labels['br'].connect("clicked", self.go_to_position, fl)
@@ -193,12 +209,6 @@ class BedLevelPanel(ScreenPanel):
# br rm fr # br rm fr
# bm fm # bm fm
# bl lm fl # bl lm fl
if self.y_cnt == 3:
bedgrid.attach(self.labels['bm'], 2, 0, 1, 1)
bedgrid.attach(self.labels['fm'], 2, 2, 1, 1)
if self.x_cnt == 3:
bedgrid.attach(self.labels['lm'], 1, 1, 1, 1)
bedgrid.attach(self.labels['rm'], 3, 1, 1, 1)
self.labels['bl'].connect("clicked", self.go_to_position, br) self.labels['bl'].connect("clicked", self.go_to_position, br)
self.labels['bm'].connect("clicked", self.go_to_position, rm) self.labels['bm'].connect("clicked", self.go_to_position, rm)
self.labels['br'].connect("clicked", self.go_to_position, fr) self.labels['br'].connect("clicked", self.go_to_position, fr)
@@ -239,25 +249,8 @@ class BedLevelPanel(ScreenPanel):
'fl': fl, 'fl': fl,
'lm': lm 'lm': lm
} }
if self.x_cnt == 3:
bedgrid.attach(self.labels['bm'], 2, 0, 1, 1)
bedgrid.attach(self.labels['fm'], 2, 2, 1, 1)
if self.y_cnt == 3:
bedgrid.attach(self.labels['lm'], 1, 1, 1, 1)
bedgrid.attach(self.labels['rm'], 3, 1, 1, 1)
grid.attach(bedgrid, 1, 0, 3, 2) grid.attach(bedgrid, 1, 0, 3, 2)
self.labels['dm'] = self._gtk.ButtonImage("motor-off", _("Disable XY"), "color3")
self.labels['dm'].connect("clicked", self.disable_motors)
grid.attach(self.labels['dm'], 0, 0, 1, 1)
if self._printer.config_section_exists("screws_tilt_adjust"):
self.labels['screws'] = self._gtk.ButtonImage("refresh", _("Screws Adjust"), "color4")
self.labels['screws'].connect("clicked", self.screws_tilt_calculate)
grid.attach(self.labels['screws'], 0, 1, 1, 1)
self.content.add(grid) self.content.add(grid)
def activate(self): def activate(self):
@@ -269,11 +262,11 @@ class BedLevelPanel(ScreenPanel):
def go_to_position(self, widget, position): def go_to_position(self, widget, position):
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)
logging.debug("Going to position: %s", position) logging.debug(f"Going to position: {position}")
script = [ script = [
"%s" % KlippyGcodes.MOVE_ABSOLUTE, f"{KlippyGcodes.MOVE_ABSOLUTE}",
"G1 Z7 F800\n", "G1 Z7 F800\n",
"G1 X%s Y%s F3600\n" % (position[0], position[1]), f"G1 X{position[0]} Y{position[1]} F3600\n",
"G1 Z.1 F300\n" "G1 Z.1 F300\n"
] ]
@@ -287,44 +280,67 @@ class BedLevelPanel(ScreenPanel):
) )
def process_update(self, action, data): def process_update(self, action, data):
_ = self.lang.gettext
if action == "notify_gcode_response": if action != "notify_gcode_response":
if data.startswith('!!'): return
self.response_count = 0 if data.startswith('!!'):
self.response_count = 0
self.labels['screws'].set_sensitive(True)
return
result = re.match(
"^// (.*) : [xX= ]+([\\-0-9\\.]+), [yY= ]+([\\-0-9\\.]+), [zZ= ]+[\\-0-9\\.]+ :" +
" (Adjust ->|adjust) ([CW]+ [0-9:]+)",
data
)
# screws_tilt_adjust uses PROBE positions and was offseted for the buttons to work equal to bed_screws
# for the result we need to undo the offset
if result:
x = float(result[2]) + self.x_offset
y = float(result[3]) + self.y_offset
for key, value in self.screw_dict.items():
if value and x == value[0] and y == value[1]:
logging.debug(f"X: {x} Y: {y} Adjust: {result[5]} Pos: {key}")
self.labels[key].set_label(result[5])
break
self.response_count += 1
if self.response_count >= len(self.screws) - 1:
self.labels['screws'].set_sensitive(True) self.labels['screws'].set_sensitive(True)
return else:
result = re.match( result = re.match(
"^// (.*) : [xX= ]+([\\-0-9\\.]+), [yY= ]+([\\-0-9\\.]+), [zZ= ]+[\\-0-9\\.]+ :" + "^// (.*) : [xX= ]+([\\-0-9\\.]+), [yY= ]+([\\-0-9\\.]+), [zZ= ]+[\\-0-9\\.]",
" (Adjust ->|adjust) ([CW]+ [0-9:]+)",
data data
) )
if result: # screws_tilt_adjust uses PROBE positions and was offseted for the buttons to work equal to bed_screws
x = self.apply_offset(result.group(2), self.x_offset) # for the result we need to undo the offset
y = self.apply_offset(result.group(3), self.y_offset) if result and re.search('base', result[1]):
x = float(result[2]) + self.x_offset
y = float(result[3]) + self.y_offset
logging.debug(f"X: {x} Y: {y} is the reference")
for key, value in self.screw_dict.items(): for key, value in self.screw_dict.items():
if value and x == value[0] and y == value[1]: if value and x == value[0] and y == value[1]:
logging.debug("X: %s Y: %s Adjust: %s Pos: %s" % (x, y, result.group(5), key)) logging.debug(f"X: {x} Y: {y} Pos: {key}")
self.labels[key].set_label(result.group(5)) self.labels[key].set_label(_("Reference"))
break
self.response_count += 1
if self.response_count >= len(self.screws)-1:
self.labels['screws'].set_sensitive(True)
else:
result = re.match(
"^// (.*) : [xX= ]+([\\-0-9\\.]+), [yY= ]+([\\-0-9\\.]+), [zZ= ]+[\\-0-9\\.]",
data
)
if result and re.search('base', result.group(1)):
x = self.apply_offset(result.group(2), self.x_offset)
y = self.apply_offset(result.group(3), self.y_offset)
logging.debug("X: %s Y: %s is the reference" % (x, y))
for key, value in self.screw_dict.items():
if value and x == value[0] and y == value[1]:
logging.debug("X: %s Y: %s Pos: %s" % (x, y, key))
self.labels[key].set_label(_("Reference"))
def apply_offset(self, pos, offset): def _get_screws(self, config_section_name):
return max(0, int(float(pos) - offset)) screws = []
config_section = self._screen.printer.get_config_section(config_section_name)
for item in config_section:
logging.debug(f"{config_section_name}: {config_section[item]}")
result = re.match(r"([\-0-9\.]+)\s*,\s*([\-0-9\.]+)", config_section[item])
if result:
screws.append([
round(float(result[1]), 2),
round(float(result[2]), 2)
])
return sorted(screws, key=lambda s: (float(s[1]), float(s[0])))
def _get_offsets(self, section):
probe = self._screen.printer.get_config_section(section)
if "x_offset" in probe:
self.x_offset = float(probe['x_offset'])
if "y_offset" in probe:
self.y_offset = float(probe['y_offset'])
logging.debug(f"{section} offset X: {self.x_offset} Y: {self.y_offset}")
def screws_tilt_calculate(self, widget): def screws_tilt_calculate(self, widget):
if self._screen.printer.get_stat("toolhead", "homed_axes") != "xyz": if self._screen.printer.get_stat("toolhead", "homed_axes") != "xyz":
+197 -198
View File
@@ -1,9 +1,10 @@
import gi import gi
import logging import logging
import contextlib
import numpy as np import numpy as np
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
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from matplotlib import cm from matplotlib import cm
@@ -15,48 +16,57 @@ 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
def create_panel(*args): def create_panel(*args):
return BedMeshPanel(*args) return BedMeshPanel(*args)
class BedMeshPanel(ScreenPanel): class BedMeshPanel(ScreenPanel):
active_mesh = None
graphs = {} def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
self.profiles = {}
self.show_create = False
self.active_mesh = None
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
self.show_create = False addprofile = self._gtk.ButtonImage("increase", " " + _("Add profile"),
"color1", .66, Gtk.PositionType.LEFT, False)
addprofile.connect("clicked", self.show_create_profile)
addprofile.set_hexpand(True)
clear = self._gtk.ButtonImage("cancel", " " + _("Clear"), "color2", .66, Gtk.PositionType.LEFT, False)
clear.connect("clicked", self._clear_mesh)
clear.set_hexpand(True)
top_calibrate = self._gtk.ButtonImage("refresh", " " + _("Calibrate"),
"color3", .66, Gtk.PositionType.LEFT, False)
top_calibrate.connect("clicked", self._send_calibrate)
top_calibrate.set_hexpand(True)
scroll = Gtk.ScrolledWindow() topbar = Gtk.Box(spacing=5)
scroll.set_property("overlay-scrolling", False) topbar.set_hexpand(True)
scroll.set_vexpand(True) topbar.set_vexpand(False)
scroll.add_events(Gdk.EventMask.TOUCH_MASK) topbar.add(addprofile)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK) topbar.add(clear)
topbar.add(top_calibrate)
# Create a grid for all profiles # Create a grid for all profiles
self.labels['profiles'] = Gtk.Grid() self.labels['profiles'] = Gtk.Grid()
self.labels['profiles'].get_style_context().add_class("frame-item")
self.labels['profiles'].set_valign(Gtk.Align.CENTER)
scroll = self._gtk.ScrolledWindow()
scroll.add(self.labels['profiles']) scroll.add(self.labels['profiles'])
scroll.set_vexpand(True)
addprofile = self._gtk.ButtonImage("increase", " %s" % _("Add bed mesh profile"),
"color1", .5, Gtk.PositionType.LEFT, False)
addprofile.connect("clicked", self.show_create_profile)
addprofile.set_size_request(60, 0)
addprofile.set_hexpand(False)
addprofile.set_halign(Gtk.Align.END)
abox = Gtk.Box(spacing=0)
abox.set_vexpand(False)
abox.add(addprofile)
# Create a box to contain all of the above # Create a box to contain all of the above
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0) self.labels['main_box'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.set_vexpand(True) self.labels['main_box'].set_vexpand(True)
box.pack_start(abox, False, False, 0) self.labels['main_box'].pack_start(topbar, False, False, 0)
box.pack_end(scroll, True, True, 0) self.labels['main_box'].pack_end(scroll, True, True, 0)
self.load_meshes() self.load_meshes()
self.labels['main_box'] = box
self.content.add(self.labels['main_box']) self.content.add(self.labels['main_box'])
def activate(self): def activate(self):
@@ -64,120 +74,100 @@ class BedMeshPanel(ScreenPanel):
self.content.remove(child) self.content.remove(child)
self.content.add(self.labels['main_box']) self.content.add(self.labels['main_box'])
am = self._screen.printer.get_stat("bed_mesh", "profile_name") self.activate_mesh(
self.activate_mesh(am) self._screen.printer.get_stat("bed_mesh", "profile_name")
)
def activate_mesh(self, profile): def activate_mesh(self, profile):
if profile == "": if profile == "":
profile = "default" profile = "default"
logging.debug("Activating profile: %s %s" % (self.active_mesh, profile)) logging.debug(f"Activating profile: {profile} Current: {self.active_mesh}")
if profile != self.active_mesh: 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 is not None and self.active_mesh in self.profiles:
a = self.profiles[self.active_mesh] a = self.profiles[self.active_mesh]
a['buttons'].remove(a['refresh']) with contextlib.suppress(KeyError):
a['buttons'].pack_start(a['load'], False, False, 0) a['button_box'].remove(a['calibrate'])
self.active_mesh = profile a['button_box'].pack_start(a['load'], False, False, 0)
if self.active_mesh is not None:
a = self.profiles[profile] logging.info(f"Active {self.active_mesh} changing to {profile}")
a['buttons'].remove(a['load']) self.active_mesh = profile
a['buttons'].pack_start(a['refresh'], False, False, 0)
self._screen.show_all() if self.active_mesh is not None:
a = self.profiles[profile]
with contextlib.suppress(KeyError):
a['button_box'].remove(a['load'])
with contextlib.suppress(KeyError):
a['button_box'].remove(a['view'])
a['button_box'].pack_start(a['calibrate'], False, False, 0)
if self._printer.get_config_section(f"bed_mesh {profile}"):
a['button_box'].pack_end(a["view"], False, False, 0)
self._screen.show_all()
def add_profile(self, profile): def add_profile(self, profile):
_ = self.lang.gettext
frame = Gtk.Frame()
logging.debug(f"Adding Profile: {profile} Current: {self.active_mesh}")
name = Gtk.Label() name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (profile)) name.set_markup(f"<big><b>{profile}</b></big>")
name.set_hexpand(True) name.set_hexpand(True)
name.set_vexpand(True) name.set_vexpand(False)
name.set_halign(Gtk.Align.START) name.set_halign(Gtk.Align.START)
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)
load = self._gtk.ButtonImage("load", _("Load"), "color2") buttons = {
load.connect("clicked", self.send_load_mesh, profile) "calibrate": self._gtk.ButtonImage("refresh", _("Calibrate"), "color4"),
load.set_size_request(60, 0) "load": self._gtk.ButtonImage("load", _("Load"), "color2"),
load.set_hexpand(False) "save": self._gtk.ButtonImage("complete", _("Save"), "color3"),
load.set_halign(Gtk.Align.END) "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["delete"].connect("clicked", self.send_remove_mesh, profile)
buttons["view"].connect("clicked", self.show_mesh, profile)
refresh = self._gtk.ButtonImage("refresh", _("Calibrate"), "color4") for b in buttons.values():
refresh.connect("clicked", self.calibrate_mesh) b.set_hexpand(False)
refresh.set_size_request(60, 0) b.set_vexpand(False)
refresh.set_hexpand(False) b.set_halign(Gtk.Align.END)
refresh.set_halign(Gtk.Align.END)
view = self._gtk.ButtonImage("bed-level", _("View Mesh"), "color1")
view.connect("clicked", self.show_mesh, profile)
view.set_size_request(60, 0)
view.set_hexpand(False)
view.set_halign(Gtk.Align.END)
info = self._gtk.ButtonImage("info", None, "color3")
info.connect("clicked", self.show_mesh, profile)
info.set_size_request(60, 0)
info.set_hexpand(False)
info.set_halign(Gtk.Align.END)
save = self._gtk.ButtonImage("sd", _("Save"), "color3")
save.connect("clicked", self.send_save_mesh, profile)
save.set_size_request(60, 0)
save.set_hexpand(False)
save.set_halign(Gtk.Align.END)
delete = self._gtk.ButtonImage("cancel", _("Delete"), "color3")
delete.connect("clicked", self.send_remove_mesh, profile)
delete.set_size_request(60, 0)
delete.set_hexpand(False)
delete.set_halign(Gtk.Align.END)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_margin_top(10)
dev.set_margin_end(15)
dev.set_margin_start(15)
dev.set_margin_bottom(10)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev.add(labels)
buttons = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
logging.debug("Profile compare: '%s' '%s'" % (self.active_mesh, profile))
if self.active_mesh == profile:
buttons.pack_start(refresh, False, False, 0)
else:
buttons.pack_start(load, False, False, 0)
# buttons.pack_end(info, False, False, 0)
button_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
button_box.add(buttons["calibrate"])
if profile != "default": if profile != "default":
buttons.pack_end(save, False, False, 0) button_box.add(buttons["save"])
buttons.pack_end(delete, False, False, 0) button_box.add(buttons["delete"])
buttons.pack_end(view, False, False, 0) if self._printer.get_config_section(f"bed_mesh {profile}"):
button_box.add(buttons["load"])
button_box.add(buttons["view"])
dev.add(buttons)
frame.add(dev) box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
box.pack_start(name, True, True, 0)
box.pack_start(button_box, False, False, 0)
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
frame.add(box)
self.profiles[profile] = { self.profiles[profile] = {
"box": dev, "button_box": button_box,
"buttons": buttons,
"row": frame, "row": frame,
"load": load, "calibrate": buttons["calibrate"],
"refresh": refresh, "load": buttons["load"],
"save": save, "save": buttons["save"],
"view": view, "delete": buttons["delete"],
"view": buttons["view"],
} }
pl = list(self.profiles) pl = list(self.profiles)
if "default" in pl: if "default" in pl:
pl.remove('default') pl.remove('default')
profiles = sorted(pl) profiles = sorted(pl)
pos = profiles.index(profile)+1 if profile != "default" else 0 pos = profiles.index(profile) + 1 if profile != "default" else 0
self.labels['profiles'].insert_row(pos) self.labels['profiles'].insert_row(pos)
self.labels['profiles'].attach(self.profiles[profile]['row'], 0, pos, 1, 1) self.labels['profiles'].attach(self.profiles[profile]['row'], 0, pos, 1, 1)
@@ -189,36 +179,17 @@ class BedMeshPanel(ScreenPanel):
return True return True
return False return False
def create_profile(self, widget):
name = self.labels['profile_name'].get_text()
if " " in name:
name = '"%s"' % name
self._screen._ws.klippy.gcode_script("BED_MESH_PROFILE SAVE=%s" % name)
self.remove_create()
def calibrate_mesh(self, widget):
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"
)
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"})
def load_meshes(self): def load_meshes(self):
bm_profiles = self._screen.printer.get_config_section_list("bed_mesh ") bm_profiles = self._screen.printer.get_config_section_list("bed_mesh ")
self.profiles = {} logging.info(f"Bed profiles: {bm_profiles}")
for prof in bm_profiles: for prof in bm_profiles:
self.add_profile(prof[9:]) self.add_profile(prof[9:])
def process_update(self, action, data): def process_update(self, action, data):
if action == "notify_status_update": if action == "notify_status_update":
if "bed_mesh" in data and "profile_name" in data['bed_mesh']: with contextlib.suppress(KeyError):
if data['bed_mesh']['profile_name'] != self.active_mesh: self.activate_mesh(data['bed_mesh']['profile_name'])
self.activate_mesh(data['bed_mesh']['profile_name'])
def remove_create(self): def remove_create(self):
if self.show_create is False: if self.show_create is False:
@@ -240,103 +211,81 @@ class BedMeshPanel(ScreenPanel):
if "default" in pl: if "default" in pl:
pl.remove('default') pl.remove('default')
profiles = sorted(pl) profiles = sorted(pl)
pos = profiles.index(profile)+1 if profile != "default" else 0 pos = profiles.index(profile) + 1 if profile != "default" else 0
self.labels['profiles'].remove_row(pos) self.labels['profiles'].remove_row(pos)
del self.profiles[profile] del self.profiles[profile]
def send_load_mesh(self, widget, profile):
self._screen._ws.klippy.gcode_script(
KlippyGcodes.bed_mesh_load(profile)
)
def send_save_mesh(self, widget, profile):
self._screen._ws.klippy.gcode_script(
KlippyGcodes.bed_mesh_save(profile)
)
def send_remove_mesh(self, widget, profile):
self._screen._ws.klippy.gcode_script(
KlippyGcodes.bed_mesh_remove(profile)
)
self.remove_profile(profile)
def show_create_profile(self, widget): def show_create_profile(self, widget):
_ = self.lang.gettext
for child in self.content.get_children(): for child in self.content.get_children():
self.content.remove(child) self.content.remove(child)
if "create_profile" not in self.labels: if "create_profile" not in self.labels:
self.labels['create_profile'] = Gtk.VBox()
self.labels['create_profile'].set_valign(Gtk.Align.START)
box = Gtk.Box(spacing=5)
box.set_size_request(self._gtk.get_content_width(), self._gtk.get_content_height() -
self._screen.keyboard_height - 20)
box.set_hexpand(True)
box.set_vexpand(False)
self.labels['create_profile'].add(box)
pl = self._gtk.Label(_("Profile Name:")) pl = self._gtk.Label(_("Profile Name:"))
pl.set_hexpand(False) pl.set_hexpand(False)
entry = Gtk.Entry() self.labels['profile_name'] = Gtk.Entry()
entry.set_hexpand(True) self.labels['profile_name'].set_text('')
entry.connect("activate", self.create_profile) self.labels['profile_name'].set_hexpand(True)
self.labels['profile_name'].connect("activate", self.create_profile)
self.labels['profile_name'].connect("focus-in-event", self._show_keyboard)
self.labels['profile_name'].grab_focus_without_selecting()
save = self._gtk.ButtonImage("sd", _("Save"), "color3") save = self._gtk.ButtonImage("complete", _("Save"), "color3")
save.set_hexpand(False) save.set_hexpand(False)
save.connect("clicked", self.create_profile) save.connect("clicked", self.create_profile)
box = Gtk.Box()
self.labels['profile_name'] = entry box.pack_start(self.labels['profile_name'], True, True, 5)
box.pack_start(pl, False, False, 5)
box.pack_start(entry, True, True, 5)
box.pack_start(save, False, False, 5) box.pack_start(save, False, False, 5)
self.show_create = True self.labels['create_profile'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=5)
self.labels['profile_name'].set_text('') self.labels['create_profile'].set_valign(Gtk.Align.CENTER)
self.labels['create_profile'].set_hexpand(True)
self.labels['create_profile'].set_vexpand(True)
self.labels['create_profile'].pack_start(pl, True, True, 5)
self.labels['create_profile'].pack_start(box, True, True, 5)
self.content.add(self.labels['create_profile']) self.content.add(self.labels['create_profile'])
self.content.show() self._show_keyboard()
self._screen.show_keyboard() self.show_create = True
self.labels['profile_name'].grab_focus_without_selecting()
def _show_keyboard(self, widget=None, event=None):
self._screen.show_keyboard(entry=self.labels['profile_name'])
def show_mesh(self, widget, profile): def show_mesh(self, widget, profile):
_ = self.lang.gettext
bm = self._printer.get_config_section("bed_mesh %s" % profile) bm = self._printer.get_config_section(f"bed_mesh {profile}")
if bm is False: if bm is False:
logging.info("Unable to load profile: %s" % profile) logging.info(f"Unable to load profile: {profile}")
return return
if profile == self.active_mesh: if profile == self.active_mesh:
abm = self._printer.get_stat("bed_mesh") abm = self._printer.get_stat("bed_mesh")
if abm is None: if abm is None:
logging.info("Unable to load active mesh: %s" % profile) logging.info(f"Unable to load active mesh: {profile}")
return return
x_range = [int(abm['mesh_min'][0]), int(abm['mesh_max'][0])] x_range = [int(abm['mesh_min'][0]), int(abm['mesh_max'][0])]
y_range = [int(abm['mesh_min'][1]), int(abm['mesh_max'][1])] y_range = [int(abm['mesh_min'][1]), int(abm['mesh_max'][1])]
minz_mesh = min(min(abm['mesh_matrix'])) minz_mesh = min(min(abm['mesh_matrix']))
maxz_mesh = max(max(abm['mesh_matrix'])) maxz_mesh = max(max(abm['mesh_matrix']))
# Do not use a very small zscale, because that could be misleading # Do not use a very small zscale, because that could be misleading
if minz_mesh > -0.5: minz_mesh = min(minz_mesh, -0.5)
minz_mesh = -0.5 maxz_mesh = max(maxz_mesh, 0.5)
if maxz_mesh < 0.5:
maxz_mesh = 0.5
z_range = [minz_mesh, maxz_mesh] z_range = [minz_mesh, maxz_mesh]
counts = [len(abm['mesh_matrix'][0]), len(abm['mesh_matrix'])] 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)] 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])] 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])] y = [(i * deltas[0]) + y_range[0] for i in range(counts[1])]
x, y = np.meshgrid(x, y) x, y = np.meshgrid(x, y)
z = np.asarray(abm['mesh_matrix']) z = np.asarray(abm['mesh_matrix'])
else: else:
x_range = [int(bm['min_x']), int(bm['max_x'])] x_range = [int(bm['min_x']), int(bm['max_x'])]
y_range = [int(bm['min_y']), int(bm['max_y'])] y_range = [int(bm['min_y']), int(bm['max_y'])]
z_range = [min(min(bm['points'])), max(max(bm['points']))] z_range = [min(min(bm['points'])), max(max(bm['points']))]
deltas = [(x_range[1] - x_range[0]) / (int(bm['x_count'])-1), deltas = [(x_range[1] - x_range[0]) / (int(bm['x_count']) - 1),
(y_range[1] - y_range[0]) / (int(bm['y_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'])] 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'])] y = [(i * deltas[0]) + y_range[0] for i in range(bm['y_count'])]
x, y = np.meshgrid(x, y) x, y = np.meshgrid(x, y)
z = np.asarray(bm['points']) z = np.asarray(bm['points'])
@@ -349,8 +298,8 @@ class BedMeshPanel(ScreenPanel):
fig.add_axes(ax) fig.add_axes(ax)
surf = ax.plot_surface(x, y, z, cmap=cm.coolwarm, vmin=-0.1, vmax=0.1) surf = ax.plot_surface(x, y, z, cmap=cm.coolwarm, vmin=-0.1, vmax=0.1)
chartBox = ax.get_position() chartbox = ax.get_position()
ax.set_position([chartBox.x0, chartBox.y0+0.1, chartBox.width*.92, chartBox.height]) ax.set_position([chartbox.x0, chartbox.y0 + 0.1, chartbox.width * .92, chartbox.height])
ax.set_zlim(z_range[0], z_range[1]) ax.set_zlim(z_range[0], z_range[1])
ax.zaxis.set_major_locator(LinearLocator(5)) ax.zaxis.set_major_locator(LinearLocator(5))
@@ -358,12 +307,12 @@ class BedMeshPanel(ScreenPanel):
ax.zaxis.set_major_formatter('{x:.02f}') ax.zaxis.set_major_formatter('{x:.02f}')
fig.colorbar(surf, shrink=0.7, aspect=5, pad=0.25) fig.colorbar(surf, shrink=0.7, aspect=5, pad=0.25)
box = Gtk.VBox() box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.set_hexpand(True) box.set_hexpand(True)
box.set_vexpand(True) box.set_vexpand(True)
title = Gtk.Label() title = Gtk.Label()
title.set_markup("<b>%s</b>" % profile) title.set_markup(f"<b>{profile}</b>")
title.set_hexpand(True) title.set_hexpand(True)
title.set_halign(Gtk.Align.CENTER) title.set_halign(Gtk.Align.CENTER)
@@ -381,7 +330,7 @@ class BedMeshPanel(ScreenPanel):
alloc = canvas_box.get_allocation() alloc = canvas_box.get_allocation()
canvas = FigureCanvas(fig) canvas = FigureCanvas(fig)
canvas.set_size_request(alloc.width, self._screen.height/3*2) canvas.set_size_request(alloc.width, self._screen.height / 3 * 2)
canvas_box.add(canvas) canvas_box.add(canvas)
canvas_box.show_all() canvas_box.show_all()
# Remove the "matplotlib-canvas" class which forces a white background. # Remove the "matplotlib-canvas" class which forces a white background.
@@ -390,6 +339,56 @@ class BedMeshPanel(ScreenPanel):
for css_class in style_ctx.list_classes(): for css_class in style_ctx.list_classes():
style_ctx.remove_class(css_class) style_ctx.remove_class(css_class)
@staticmethod
def _close_dialog(self, widget, response): def _close_dialog(widget, response):
widget.destroy() widget.destroy()
def create_profile(self, widget):
name = self.labels['profile_name'].get_text()
if " " in name:
name = f'"{name}"'
self._screen._ws.klippy.gcode_script(f"BED_MESH_PROFILE SAVE={name}")
self.remove_create()
def calibrate_mesh(self, widget):
self._screen.show_popup_message(_("Calibrating"), level=1)
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"
)
# Load zcalibrate to do a manual mesh
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"})
def _clear_mesh(self, widget):
self._screen._ws.klippy.gcode_script(
"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):
self._screen._ws.klippy.gcode_script(
KlippyGcodes.bed_mesh_load(profile)
)
def send_save_mesh(self, widget, profile):
self._screen._ws.klippy.gcode_script(
KlippyGcodes.bed_mesh_save(profile)
)
def send_remove_mesh(self, widget, profile):
self._screen._ws.klippy.gcode_script(
KlippyGcodes.bed_mesh_remove(profile)
)
self.remove_profile(profile)
+31 -29
View File
@@ -1,5 +1,4 @@
import gi import gi
import logging
import time import time
import re import re
@@ -9,6 +8,7 @@ from gi.repository import Gtk
from datetime import datetime from datetime import datetime
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
def create_panel(*args): def create_panel(*args):
return ConsolePanel(*args) return ConsolePanel(*args)
@@ -21,40 +21,42 @@ COLORS = {
"warning": "#c9c9c9" "warning": "#c9c9c9"
} }
class ConsolePanel(ScreenPanel): class ConsolePanel(ScreenPanel):
def initialize(self, panel_name): def __init__(self, screen, title, back=True):
_ = self.lang.gettext super().__init__(screen, title, back)
self.autoscroll = True self.autoscroll = True
self.hidetemps = True self.hidetemps = True
gcodes = self._screen._ws.send_method("server.gcode_store", {"count": 100}, self.gcode_response) def initialize(self, panel_name):
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"))
o1_lbl.set_halign(Gtk.Align.END) o1_lbl.set_halign(Gtk.Align.END)
o1_switch = Gtk.Switch() o1_switch = Gtk.Switch()
o1_switch.set_property("width-request", round(self._gtk.get_font_size()*5)) o1_switch.set_property("width-request", round(self._gtk.get_font_size() * 5))
o1_switch.set_property("height-request", round(self._gtk.get_font_size()*2.5)) o1_switch.set_property("height-request", round(self._gtk.get_font_size() * 2.5))
o1_switch.set_active(self.autoscroll) o1_switch.set_active(self.autoscroll)
o1_switch.connect("notify::active", self.set_autoscroll) o1_switch.connect("notify::active", self.set_autoscroll)
o2_lbl = Gtk.Label(_("Hide temp.")) o2_lbl = Gtk.Label(_("Hide temp."))
o2_lbl.set_halign(Gtk.Align.END) o2_lbl.set_halign(Gtk.Align.END)
o2_switch = Gtk.Switch() o2_switch = Gtk.Switch()
o2_switch.set_property("width-request", round(self._gtk.get_font_size()*5)) o2_switch.set_property("width-request", round(self._gtk.get_font_size() * 5))
o2_switch.set_property("height-request", round(self._gtk.get_font_size()*2.5)) o2_switch.set_property("height-request", round(self._gtk.get_font_size() * 2.5))
o2_switch.set_active(self.hidetemps) o2_switch.set_active(self.hidetemps)
o2_switch.connect("notify::active", self.hide_temps) o2_switch.connect("notify::active", self.hide_temps)
o3_button = self._gtk.ButtonImage("refresh", _('Clear') + " ", None, .66, Gtk.PositionType.RIGHT, False) o3_button = self._gtk.ButtonImage("refresh", _('Clear') + " ", None, .66, Gtk.PositionType.RIGHT, False)
o3_button.connect("clicked", self.clear) o3_button.connect("clicked", self.clear)
options = Gtk.HBox() options = Gtk.Box()
options.set_hexpand(True) options.set_hexpand(True)
options.set_vexpand(False) options.set_vexpand(False)
options.add(o1_lbl) options.add(o1_lbl)
options.pack_start(o1_switch, False, 0, 5) options.pack_start(o1_switch, False, False, 5)
options.add(o2_lbl) options.add(o2_lbl)
options.pack_start(o2_switch, False, 0, 5) options.pack_start(o2_switch, False, False, 5)
options.add(o3_button) options.add(o3_button)
sw = Gtk.ScrolledWindow() sw = Gtk.ScrolledWindow()
@@ -67,6 +69,7 @@ class ConsolePanel(ScreenPanel):
tv.set_editable(False) tv.set_editable(False)
tv.set_cursor_visible(False) tv.set_cursor_visible(False)
tv.connect("size-allocate", self._autoscroll) tv.connect("size-allocate", self._autoscroll)
tv.connect("focus-in-event", self._screen.remove_keyboard)
sw.add(tv) sw.add(tv)
@@ -77,15 +80,15 @@ class ConsolePanel(ScreenPanel):
entry = Gtk.Entry() entry = Gtk.Entry()
entry.set_hexpand(True) entry.set_hexpand(True)
entry.set_vexpand(False) entry.set_vexpand(False)
entry.connect("focus-in-event", self._show_keyboard) entry.connect("button-press-event", self._show_keyboard)
entry.connect("focus-out-event", self._remove_keyboard) entry.connect("focus-in-event", self._screen.show_keyboard)
entry.connect("activate", self._send_command) entry.connect("activate", self._send_command)
entry.grab_focus_without_selecting()
enter = self._gtk.ButtonImage("resume", " " + _('Send') + " ", None, .66, Gtk.PositionType.RIGHT, False) enter = self._gtk.ButtonImage("resume", " " + _('Send') + " ", None, .66, Gtk.PositionType.RIGHT, False)
enter.set_hexpand(False) enter.set_hexpand(False)
enter.connect("clicked", self._send_command) enter.connect("clicked", self._send_command)
ebox.add(entry) ebox.add(entry)
ebox.add(enter) ebox.add(enter)
@@ -96,36 +99,40 @@ class ConsolePanel(ScreenPanel):
"tv": tv "tv": tv
}) })
content_box = Gtk.VBox() content_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
content_box.pack_start(options, False, 0, 5) content_box.pack_start(options, False, False, 5)
content_box.add(sw) content_box.add(sw)
content_box.pack_end(ebox, False, 0, 0) content_box.pack_end(ebox, False, False, 0)
self.content.add(content_box) self.content.add(content_box)
def _show_keyboard(self, widget=None, event=None):
self._screen.show_keyboard(entry=self.labels['entry'])
def clear(self, widget): def clear(self, widget):
self.labels['tb'].set_text("") self.labels['tb'].set_text("")
def add_gcode(self, type, time, message): def add_gcode(self, msgtype, msgtime, message):
if type == "command": if msgtype == "command":
color = COLORS['command'] color = COLORS['command']
message = '$ %s' % message
elif message.startswith("!!"): elif message.startswith("!!"):
color = COLORS['error'] color = COLORS['error']
message = message.replace("!! ", "")
elif message.startswith("//"): elif message.startswith("//"):
color = COLORS['warning'] color = COLORS['warning']
message = message.replace("// ", "")
elif self.hidetemps and re.match('^(?:ok\\s+)?(B|C|T\\d*):', message): elif self.hidetemps and re.match('^(?:ok\\s+)?(B|C|T\\d*):', message):
return return
else: else:
color = COLORS['response'] color = COLORS['response']
message = '<span color="%s"><b>%s</b></span>' % (color, message) message = f'<span color="{color}"><b>{message}</b></span>'
message = message.replace('\n', '\n ') message = message.replace('\n', '\n ')
self.labels['tb'].insert_markup( self.labels['tb'].insert_markup(
self.labels['tb'].get_end_iter(), self.labels['tb'].get_end_iter(),
'\n<span color="%s">%s</span> %s' % (COLORS['time'], datetime.fromtimestamp(time).strftime("%H:%M:%S"), f'\n<span color="{COLORS["time"]}">{datetime.fromtimestamp(msgtime).strftime("%H:%M:%S")}</span> {message}',
message), -1 -1
) )
# Limit the length # Limit the length
if self.labels['tb'].get_line_count() > 999: if self.labels['tb'].get_line_count() > 999:
@@ -153,15 +160,10 @@ class ConsolePanel(ScreenPanel):
adj = self.labels['sw'].get_vadjustment() adj = self.labels['sw'].get_vadjustment()
adj.set_value(adj.get_upper() - adj.get_page_size()) adj.set_value(adj.get_upper() - adj.get_page_size())
def _show_keyboard(self, *args):
self._screen.show_keyboard()
def _remove_keyboard(self, *args):
self._screen.remove_keyboard()
def _send_command(self, *args): def _send_command(self, *args):
cmd = self.labels['entry'].get_text() cmd = self.labels['entry'].get_text()
self.labels['entry'].set_text('') self.labels['entry'].set_text('')
self._screen.remove_keyboard()
self.add_gcode("command", time.time(), cmd) self.add_gcode("command", time.time(), cmd)
self._screen._ws.klippy.gcode_script(cmd) self._screen._ws.klippy.gcode_script(cmd)
+3 -1
View File
@@ -5,12 +5,14 @@ from gi.repository import Gtk
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
def create_panel(*args): def create_panel(*args):
return ExamplePanel(*args) return ExamplePanel(*args)
class ExamplePanel(ScreenPanel): class ExamplePanel(ScreenPanel):
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
# Create gtk items here # Create gtk items here
self.content.add(Gtk.Box()) self.content.add(Gtk.Box())
+142 -95
View File
@@ -2,40 +2,38 @@ import gi
import logging import logging
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk from gi.repository import Gtk, Pango
from ks_includes.KlippyGcodes import KlippyGcodes from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
def create_panel(*args): def create_panel(*args):
return ExtrudePanel(*args) return ExtrudePanel(*args)
class ExtrudePanel(ScreenPanel): class ExtrudePanel(ScreenPanel):
distance = 5
distances = ['5', '10', '15', '25'] def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
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()
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)
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
self.load_filament = self.unload_filament = False
self.find_gcode_macros()
self.speed = 1
self.speeds = ['1', '2', '5', '25']
grid = Gtk.Grid()
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, "+")
if not self.load_filament: self.labels['load'] = self._gtk.ButtonImage("arrow-down", _("Load"), "color3")
self.labels['load'] = self._gtk.ButtonImage("arrow-down", _("Load"))
else: self.labels['load'].connect("clicked", self.load_unload, "+")
self.labels['load'] = self._gtk.ButtonImage("arrow-down", _("Load"), "color3") self.labels['unload'] = self._gtk.ButtonImage("arrow-up", _("Unload"), "color2")
self.labels['load'].connect("clicked", self.load_unload, "+", self.load_filament)
if not self.unload_filament: self.labels['unload'].connect("clicked", self.load_unload, "-")
self.labels['unload'] = self._gtk.ButtonImage("arrow-up", _("Unload"))
else:
self.labels['unload'] = self._gtk.ButtonImage("arrow-up", _("Unload"), "color2")
self.labels['unload'].connect("clicked", self.load_unload, "-", self.unload_filament)
self.labels['retract'] = self._gtk.ButtonImage("retract", _("Retract"), "color1") self.labels['retract'] = self._gtk.ButtonImage("retract", _("Retract"), "color1")
self.labels['retract'].connect("clicked", self.extrude, "-") self.labels['retract'].connect("clicked", self.extrude, "-")
self.labels['temperature'] = self._gtk.ButtonImage("heat-up", _("Temperature"), "color4") self.labels['temperature'] = self._gtk.ButtonImage("heat-up", _("Temperature"), "color4")
@@ -45,72 +43,57 @@ class ExtrudePanel(ScreenPanel):
}) })
extgrid = self._gtk.HomogeneousGrid() extgrid = self._gtk.HomogeneousGrid()
self.current_extruder = self._printer.get_stat("toolhead", "extruder")
limit = 5 limit = 5
for i, extruder in enumerate(self._printer.get_tools()): i = 0
for extruder in self._printer.get_tools():
if self._printer.extrudercount > 1: if self._printer.extrudercount > 1:
self.labels[extruder] = self._gtk.ButtonImage("extruder-%s" % i, _("Tool") + " %s" % str(i)) self.labels[extruder] = self._gtk.ButtonImage(f"extruder-{i}",
f"T{self._printer.get_tool_number(extruder)}")
else: else:
self.labels[extruder] = self._gtk.ButtonImage("extruder", _("Tool")) self.labels[extruder] = self._gtk.ButtonImage("extruder", "")
self.labels[extruder].connect("clicked", self.change_extruder, extruder) self.labels[extruder].connect("clicked", self.change_extruder, extruder)
if extruder == self.current_extruder: if extruder == self.current_extruder:
self.labels[extruder].get_style_context().add_class("button_active") self.labels[extruder].get_style_context().add_class("button_active")
if i < limit: if i < limit:
extgrid.attach(self.labels[extruder], i, 0, 1, 1) extgrid.attach(self.labels[extruder], i, 0, 1, 1)
i += 1
if i < (limit - 1): if i < (limit - 1):
extgrid.attach(self.labels['temperature'], i+1, 0, 1, 1) extgrid.attach(self.labels['temperature'], i + 1, 0, 1, 1)
grid.attach(extgrid, 0, 0, 4, 1)
if self._screen.vertical_mode:
grid.attach(self.labels['extrude'], 0, 1, 2, 1)
grid.attach(self.labels['retract'], 2, 1, 2, 1)
grid.attach(self.labels['load'], 0, 2, 2, 1)
grid.attach(self.labels['unload'], 2, 2, 2, 1)
else:
grid.attach(self.labels['extrude'], 0, 1, 1, 1)
grid.attach(self.labels['load'], 1, 1, 1, 1)
grid.attach(self.labels['unload'], 2, 1, 1, 1)
grid.attach(self.labels['retract'], 3, 1, 1, 1)
distgrid = Gtk.Grid() distgrid = Gtk.Grid()
j = 0 for j, i in enumerate(self.distances):
for i in self.distances: self.labels[f"dist{i}"] = self._gtk.ToggleButton(i)
self.labels["dist"+str(i)] = self._gtk.ToggleButton(i) self.labels[f"dist{i}"].connect("clicked", self.change_distance, int(i))
self.labels["dist"+str(i)].connect("clicked", self.change_distance, i) ctx = self.labels[f"dist{i}"].get_style_context()
ctx = self.labels["dist"+str(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
(self._screen.lang_ltr is False and j == len(self.distances)-1)): (self._screen.lang_ltr is False and j == len(self.distances) - 1)):
ctx.add_class("distbutton_top") ctx.add_class("distbutton_top")
elif ((self._screen.lang_ltr is False and j == 0) or elif ((self._screen.lang_ltr is False and j == 0) or
(self._screen.lang_ltr is True and j == len(self.distances)-1)): (self._screen.lang_ltr is True and j == len(self.distances) - 1)):
ctx.add_class("distbutton_bottom") ctx.add_class("distbutton_bottom")
else: else:
ctx.add_class("distbutton") ctx.add_class("distbutton")
if i == "5": if i == "5":
ctx.add_class("distbutton_active") ctx.add_class("distbutton_active")
distgrid.attach(self.labels["dist"+str(i)], j, 0, 1, 1) distgrid.attach(self.labels[f"dist{i}"], j, 0, 1, 1)
j += 1
self.labels["dist5"].set_active(True) self.labels["dist5"].set_active(True)
speedgrid = Gtk.Grid() speedgrid = Gtk.Grid()
j = 0 for j, i in enumerate(self.speeds):
for i in self.speeds: self.labels[f"speed{i}"] = self._gtk.ToggleButton(_(i))
self.labels["speed"+str(i)] = self._gtk.ToggleButton(_(i)) self.labels[f"speed{i}"].connect("clicked", self.change_speed, int(i))
self.labels["speed"+str(i)].connect("clicked", self.change_speed, i) ctx = self.labels[f"speed{i}"].get_style_context()
ctx = self.labels["speed"+str(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
(self._screen.lang_ltr is False and j == len(self.speeds)-1)): (self._screen.lang_ltr is False and j == len(self.speeds) - 1)):
ctx.add_class("distbutton_top") ctx.add_class("distbutton_top")
elif ((self._screen.lang_ltr is False and j == 0) or elif ((self._screen.lang_ltr is False and j == 0) or
(self._screen.lang_ltr is True and j == len(self.speeds)-1)): (self._screen.lang_ltr is True and j == len(self.speeds) - 1)):
ctx.add_class("distbutton_bottom") ctx.add_class("distbutton_bottom")
else: else:
ctx.add_class("distbutton") ctx.add_class("distbutton")
if i == "2": if i == "2":
ctx.add_class("distbutton_active") ctx.add_class("distbutton_active")
speedgrid.attach(self.labels["speed" + str(i)], j, 0, 1, 1) speedgrid.attach(self.labels[f"speed{i}"], j, 0, 1, 1)
j += 1
self.labels["speed2"].set_active(True) self.labels["speed2"].set_active(True)
distbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) distbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
@@ -122,13 +105,58 @@ class ExtrudePanel(ScreenPanel):
speedbox.pack_start(self.labels['extrude_speed'], True, True, 0) speedbox.pack_start(self.labels['extrude_speed'], True, True, 0)
speedbox.add(speedgrid) speedbox.add(speedgrid)
filament_sensors = self._printer.get_filament_sensors()
sensors = Gtk.Grid()
if len(filament_sensors) > 0:
sensors.set_column_spacing(5)
sensors.set_row_spacing(5)
sensors.set_halign(Gtk.Align.CENTER)
sensors.set_valign(Gtk.Align.CENTER)
for s, x in enumerate(filament_sensors):
if s > limit:
break
name = x[23:].strip()
self.labels[x] = {
'label': Gtk.Label(name.capitalize().replace('_', ' ')),
'switch': Gtk.Switch(),
'box': Gtk.Box()
}
self.labels[x]['label'].set_halign(Gtk.Align.CENTER)
self.labels[x]['label'].set_hexpand(True)
self.labels[x]['label'].set_ellipsize(Pango.EllipsizeMode.END)
self.labels[x]['switch'].set_property("width-request", round(self._gtk.get_font_size() * 2))
self.labels[x]['switch'].set_property("height-request", round(self._gtk.get_font_size()))
self.labels[x]['switch'].connect("notify::active", self.enable_disable_fs, name, x)
self.labels[x]['box'].pack_start(self.labels[x]['label'], True, True, 5)
self.labels[x]['box'].pack_start(self.labels[x]['switch'], False, False, 5)
self.labels[x]['box'].get_style_context().add_class("filament_sensor")
self.labels[x]['box'].set_hexpand(True)
if self._printer.get_dev_stat(x, "filament_detected"):
self.labels[x]['box'].get_style_context().add_class("filament_sensor_detected")
else:
self.labels[x]['box'].get_style_context().add_class("filament_sensor_empty")
sensors.attach(self.labels[x]['box'], s, 0, 1, 1)
grid = Gtk.Grid()
grid.set_column_homogeneous(True) grid.set_column_homogeneous(True)
grid.attach(extgrid, 0, 0, 4, 1)
if self._screen.vertical_mode: if self._screen.vertical_mode:
grid.attach(self.labels['extrude'], 0, 1, 2, 1)
grid.attach(self.labels['retract'], 2, 1, 2, 1)
grid.attach(self.labels['load'], 0, 2, 2, 1)
grid.attach(self.labels['unload'], 2, 2, 2, 1)
grid.attach(distbox, 0, 3, 4, 1) grid.attach(distbox, 0, 3, 4, 1)
grid.attach(speedbox, 0, 4, 4, 1) grid.attach(speedbox, 0, 4, 4, 1)
grid.attach(sensors, 0, 5, 4, 1)
else: else:
grid.attach(distbox, 0, 2, 2, 1) grid.attach(self.labels['extrude'], 0, 2, 1, 1)
grid.attach(speedbox, 2, 2, 2, 1) grid.attach(self.labels['load'], 1, 2, 1, 1)
grid.attach(self.labels['unload'], 2, 2, 1, 1)
grid.attach(self.labels['retract'], 3, 2, 1, 1)
grid.attach(distbox, 0, 3, 2, 1)
grid.attach(speedbox, 2, 3, 2, 1)
grid.attach(sensors, 0, 4, 4, 1)
self.content.add(grid) self.content.add(grid)
@@ -150,70 +178,89 @@ class ExtrudePanel(ScreenPanel):
self.current_extruder = data["toolhead"]["extruder"] self.current_extruder = data["toolhead"]["extruder"]
self.labels[self.current_extruder].get_style_context().add_class("button_active") self.labels[self.current_extruder].get_style_context().add_class("button_active")
for x in self._printer.get_filament_sensors():
if x in data:
if 'enabled' in data[x]:
self._printer.set_dev_stat(x, "enabled", data[x]['enabled'])
self.labels[x]['switch'].set_active(data[x]['enabled'])
logging.info(f"{x} Enabled: {data[x]['enabled']}")
if 'filament_detected' in data[x]:
self._printer.set_dev_stat(x, "filament_detected", data[x]['filament_detected'])
if data[x]['filament_detected']:
self.labels[x]['box'].get_style_context().remove_class("filament_sensor_empty")
self.labels[x]['box'].get_style_context().add_class("filament_sensor_detected")
else:
self.labels[x]['box'].get_style_context().remove_class("filament_sensor_detected")
self.labels[x]['box'].get_style_context().add_class("filament_sensor_empty")
logging.info(f"{x}: Filament detected: {data[x]['filament_detected']}")
def change_distance(self, widget, distance): def change_distance(self, widget, distance):
if self.distance == distance: if self.distance == distance:
return return
logging.info("### Distance " + str(distance)) logging.info(f"### Distance {distance}")
ctx = self.labels["dist"+str(self.distance)].get_style_context() ctx = self.labels[f"dist{self.distance}"].get_style_context()
ctx.remove_class("distbutton_active") ctx.remove_class("distbutton_active")
self.distance = distance self.distance = distance
ctx = self.labels["dist"+self.distance].get_style_context() ctx = self.labels[f"dist{self.distance}"].get_style_context()
ctx.add_class("distbutton_active") ctx.add_class("distbutton_active")
for i in self.distances: for i in self.distances:
if i == self.distance: if i == self.distance:
continue continue
self.labels["dist"+str(i)].set_active(False) self.labels[f"dist{i}"].set_active(False)
def change_extruder(self, widget, extruder): def change_extruder(self, widget, extruder):
if extruder == self.current_extruder: logging.info(f"Changing extruder to {extruder}")
return for tool in self._printer.get_tools():
self.labels[tool].get_style_context().remove_class("button_active")
self.labels[extruder].get_style_context().add_class("button_active")
self._screen._ws.klippy.gcode_script("T%s" % 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: if self.speed == speed:
return return
logging.info("### Speed " + str(speed)) logging.info(f"### Speed {speed}")
self.labels["speed" + str(self.speed)].get_style_context().remove_class("distbutton_active") self.labels[f"speed{self.speed}"].get_style_context().remove_class("distbutton_active")
self.speed = speed self.speed = speed
self.labels["speed" + self.speed].get_style_context().add_class("distbutton_active") self.labels[f"speed{self.speed}"].get_style_context().add_class("distbutton_active")
for i in self.speeds: for i in self.speeds:
if i == self.speed: if i == self.speed:
continue continue
self.labels["speed" + str(i)].set_active(False) self.labels[f"speed{i}"].set_active(False)
def extrude(self, widget, dir):
dist = str(self.distance) if dir == "+" else "-" + str(self.distance)
speed = str(int(self.speed) * 60)
print(KlippyGcodes.extrude(dist, speed))
def extrude(self, widget, direction):
self._screen._ws.klippy.gcode_script(KlippyGcodes.EXTRUDE_REL) self._screen._ws.klippy.gcode_script(KlippyGcodes.EXTRUDE_REL)
self._screen._ws.klippy.gcode_script(KlippyGcodes.extrude(dist, speed)) self._screen._ws.klippy.gcode_script(KlippyGcodes.extrude(f"{direction}{self.distance}", f"{self.speed * 60}"))
def load_unload(self, widget, dir, found): def load_unload(self, widget, direction):
if dir == "-": if direction == "-":
if not found: if not self.unload_filament:
self._screen.show_popup_message("Macro UNLOAD_FILAMENT not found") self._screen.show_popup_message("Macro UNLOAD_FILAMENT not found")
else: else:
self._screen._ws.klippy.gcode_script("UNLOAD_FILAMENT SPEED=" + str(int(self.speed) * 60)) self._screen._ws.klippy.gcode_script(f"UNLOAD_FILAMENT SPEED={self.speed * 60}")
if dir == "+": if direction == "+":
if not found: if not self.load_filament:
self._screen.show_popup_message("Macro LOAD_FILAMENT not found") self._screen.show_popup_message("Macro LOAD_FILAMENT not found")
else: else:
self._screen._ws.klippy.gcode_script("LOAD_FILAMENT SPEED=" + str(int(self.speed) * 60)) self._screen._ws.klippy.gcode_script(f"LOAD_FILAMENT SPEED={self.speed * 60}")
def find_gcode_macros(self): def enable_disable_fs(self, switch, gparams, name, x):
macros = self._screen.printer.get_gcode_macros() if switch.get_active():
for x in macros: self._printer.set_dev_stat(x, "enabled", True)
macro = x[12:].strip() self._screen._ws.klippy.gcode_script(f"SET_FILAMENT_SENSOR SENSOR={name} ENABLE=1")
macro = macro.upper() else:
if macro == "LOAD_FILAMENT": self._printer.set_dev_stat(x, "enabled", False)
logging.info("Found %s" % macro) self._screen._ws.klippy.gcode_script(f"SET_FILAMENT_SENSOR SENSOR={name} ENABLE=0")
self.load_filament = True self.labels[x]['box'].get_style_context().remove_class("filament_sensor_empty")
if macro == "UNLOAD_FILAMENT": self.labels[x]['box'].get_style_context().remove_class("filament_sensor_detected")
logging.info("Found %s" % macro)
self.unload_filament = True def update_temp(self, dev, temp, target):
if dev in self.labels and temp is not None:
if target > 0:
self.labels[dev].set_label(f"{temp:.1f}°C\n({target:.0f})")
else:
self.labels[dev].set_label(f"{temp:.1f}°C")
+56 -62
View File
@@ -2,85 +2,68 @@ import gi
import logging import logging
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango from gi.repository import Gtk, GLib, 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
def create_panel(*args): def create_panel(*args):
return FanPanel(*args) return FanPanel(*args)
CHANGEABLE_FANS = ["fan", "fan_generic"] CHANGEABLE_FANS = ["fan", "fan_generic"]
class FanPanel(ScreenPanel): class FanPanel(ScreenPanel):
fan_speed = {}
user_selecting = False
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext self.fan_speed = {}
self.user_selecting = False
self.devices = {} self.devices = {}
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
# Create a grid for all devices # Create a grid for all devices
self.labels['devices'] = Gtk.Grid() self.labels['devices'] = Gtk.Grid()
scroll.add(self.labels['devices']) self.labels['devices'].set_valign(Gtk.Align.CENTER)
# Create a box to contain all of the above
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
box.pack_start(scroll, True, True, 0)
self.load_fans() self.load_fans()
self.content.add(box) scroll = self._gtk.ScrolledWindow()
scroll.add(self.labels['devices'])
self.content.add(scroll)
def process_update(self, action, data): def process_update(self, action, data):
if (action != "notify_status_update"): if action != "notify_status_update":
return return
for fan in self.devices: for fan in self.devices:
if fan in data and "speed" in data[fan]: if fan in data and "speed" in data[fan]:
self.update_fan_speed(fan, self._printer.get_fan_speed(fan, data[fan]["speed"])) self.update_fan_speed(None, fan, self._printer.get_fan_speed(fan, data[fan]["speed"]))
def update_fan_speed(self, fan, speed): def update_fan_speed(self, widget, fan, speed):
if fan not in self.devices: if fan not in self.devices:
return return
if self.devices[fan]['changeable'] is True: if self.devices[fan]['changeable'] is True:
if self.devices[fan]['scale'].has_grab(): if self.devices[fan]['scale'].has_grab():
return return
self.fan_speed[fan] = round(float(speed) * 100) self.devices[fan]["speed"] = round(float(speed) * 100)
self.devices[fan]['scale'].disconnect_by_func(self.set_fan_speed) self.devices[fan]['scale'].disconnect_by_func(self.set_fan_speed)
self.devices[fan]['scale'].set_value(self.fan_speed[fan]) self.devices[fan]['scale'].set_value(self.devices[fan]["speed"])
self.devices[fan]['scale'].connect("button-release-event", self.set_fan_speed, fan) self.devices[fan]['scale'].connect("button-release-event", self.set_fan_speed, fan)
else: else:
self.fan_speed[fan] = float(speed) self.devices[fan]["speed"] = float(speed)
self.devices[fan]['scale'].set_fraction(self.fan_speed[fan]) self.devices[fan]['scale'].set_fraction(self.devices[fan]["speed"])
if widget is not None:
self.set_fan_speed(None, None, fan)
def add_fan(self, fan): def add_fan(self, fan):
logging.info("Adding fan: %s" % fan)
changeable = False
for x in CHANGEABLE_FANS:
if fan.startswith(x) or fan == x:
changeable = True
break
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
self.fan_speed[fan] = float(self._printer.get_fan_speed(fan))
logging.info(f"Adding fan: {fan}")
changeable = any(fan.startswith(x) or fan == x for x in CHANGEABLE_FANS)
name = Gtk.Label() name = Gtk.Label()
if fan == "fan": fan_name = _("Part Fan") if fan == "fan" else fan.split()[1]
fan_name = "Part Fan" name.set_markup(f"\n<big><b>{fan_name}</b></big>\n")
else:
fan_name = " ".join(fan.split(" ")[1:])
name.set_markup("<big><b>%s</b></big>" % (fan_name))
name.set_hexpand(True) name.set_hexpand(True)
name.set_vexpand(True) name.set_vexpand(True)
name.set_halign(Gtk.Align.START) name.set_halign(Gtk.Align.START)
@@ -88,37 +71,46 @@ class FanPanel(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)
adj = Gtk.Adjustment(0, 0, 100, 1, 5, 0) fan_col = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
if changeable is True: stop_btn = self._gtk.ButtonImage("cancel", None, "color1", 1)
self.fan_speed[fan] = round(self.fan_speed[fan] * 100) stop_btn.set_hexpand(False)
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj) stop_btn.connect("clicked", self.update_fan_speed, fan, 0)
scale.set_value(self.fan_speed[fan]) max_btn = self._gtk.ButtonImage("fan-on", _("Max"), "color2", 1)
max_btn.set_hexpand(False)
max_btn.connect("clicked", self.update_fan_speed, fan, 100)
speed = float(self._printer.get_fan_speed(fan))
if changeable:
speed = round(speed * 100)
scale = Gtk.Scale.new_with_range(orientation=Gtk.Orientation.HORIZONTAL, min=0, max=100, step=1)
scale.set_value(speed)
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)
scale.get_style_context().add_class("fan_slider") scale.get_style_context().add_class("fan_slider")
scale.connect("button-release-event", self.set_fan_speed, fan) scale.connect("button-release-event", self.set_fan_speed, fan)
fan_col.add(stop_btn)
fan_col.add(scale)
fan_col.add(max_btn)
else: else:
scale = Gtk.ProgressBar() scale = Gtk.ProgressBar()
scale.set_fraction(self.fan_speed[fan]) scale.set_fraction(speed)
scale.set_show_text(True) scale.set_show_text(True)
scale.set_hexpand(True) scale.set_hexpand(True)
# scale.get_style_context().add_class("fan_slider") fan_col.pack_start(scale, True, True, 10)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) fan_row = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name) fan_row.add(name)
labels.add(scale) fan_row.add(fan_col)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5) frame = Gtk.Frame()
dev.set_hexpand(True) frame.get_style_context().add_class("frame-item")
dev.set_vexpand(False) frame.add(fan_row)
dev.add(labels)
frame.add(dev)
self.devices[fan] = { self.devices[fan] = {
"changeable": changeable, "changeable": changeable,
"row": frame,
"scale": scale, "scale": scale,
"speed": speed,
} }
devices = sorted(self.devices) devices = sorted(self.devices)
@@ -131,17 +123,20 @@ class FanPanel(ScreenPanel):
pos = devices.index(fan) pos = devices.index(fan)
self.labels['devices'].insert_row(pos) self.labels['devices'].insert_row(pos)
self.labels['devices'].attach(self.devices[fan]['row'], 0, pos, 1, 1) self.labels['devices'].attach(frame, 0, pos, 1, 1)
self.labels['devices'].show_all() self.labels['devices'].show_all()
def load_fans(self): def load_fans(self):
fans = self._printer.get_fans() fans = self._printer.get_fans()
for fan in fans: for fan in fans:
# Support for hiding devices by name # Support for hiding devices by name
name = " ".join(fan.split(" ")[1:]) if not (fan == "fan") else fan name = fan.split()[1] if len(fan.split()) > 1 else fan
if name.startswith("_"): if name.startswith("_"):
continue continue
self.add_fan(fan) self.add_fan(fan)
frame = Gtk.Frame()
frame.set_vexpand(False)
self.labels['devices'].attach(frame, 0, -1, 1, 1)
def set_fan_speed(self, widget, event, fan): def set_fan_speed(self, widget, event, fan):
value = self.devices[fan]['scale'].get_value() value = self.devices[fan]['scale'].get_value()
@@ -149,11 +144,10 @@ class FanPanel(ScreenPanel):
if fan == "fan": if fan == "fan":
self._screen._ws.klippy.gcode_script(KlippyGcodes.set_fan_speed(value)) self._screen._ws.klippy.gcode_script(KlippyGcodes.set_fan_speed(value))
else: else:
f = " ".join(fan.split(" ")[1:]) self._screen._ws.klippy.gcode_script(f"SET_FAN_SPEED FAN={fan.split()[1]} SPEED={float(value) / 100}")
self._screen._ws.klippy.gcode_script("SET_FAN_SPEED FAN=%s SPEED=%s" % (f, float(value)/100))
# Check the speed in case it wasn't applied # Check the speed in case it wasn't applied
GLib.timeout_add_seconds(1, self.check_fan_speed, fan) GLib.timeout_add_seconds(1, self.check_fan_speed, fan)
def check_fan_speed(self, fan): def check_fan_speed(self, fan):
self.update_fan_speed(fan, self._printer.get_fan_speed(fan)) self.update_fan_speed(None, fan, self._printer.get_fan_speed(fan))
return False return False
+33 -54
View File
@@ -8,9 +8,11 @@ from gi.repository import Gtk
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
def create_panel(*args): def create_panel(*args):
return FineTunePanel(*args) return FineTunePanel(*args)
class FineTunePanel(ScreenPanel): class FineTunePanel(ScreenPanel):
user_selecting = False user_selecting = False
@@ -23,7 +25,6 @@ class FineTunePanel(ScreenPanel):
speed = 100 speed = 100
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
logging.debug("FineTunePanel") logging.debug("FineTunePanel")
@@ -32,48 +33,39 @@ class FineTunePanel(ScreenPanel):
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(',')]
if len(bs) <= 2: self.bs_deltas = bs if len(bs) <= 2 else [bs[0], bs[-1]]
self.bs_deltas = bs
else:
self.bs_deltas = [bs[0], bs[-1]]
self.bs_delta = self.bs_deltas[0] self.bs_delta = self.bs_deltas[0]
# babystepping grid # babystepping grid
bsgrid = Gtk.Grid() bsgrid = Gtk.Grid()
j = 0 for j, i in enumerate(self.bs_deltas):
for i in self.bs_deltas:
self.labels[i] = self._gtk.ToggleButton(i) self.labels[i] = self._gtk.ToggleButton(i)
self.labels[i].connect("clicked", self.change_bs_delta, i) self.labels[i].connect("clicked", self.change_bs_delta, i)
ctx = self.labels[i].get_style_context() ctx = self.labels[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:
ctx.add_class("distbutton_bottom") ctx.add_class("distbutton_bottom")
else: else:
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[i], j, 0, 1, 1)
j += 1
# Grid for percentage # Grid for percentage
deltgrid = Gtk.Grid() deltgrid = Gtk.Grid()
j = 0 for j, i in enumerate(self.percent_deltas):
for i in self.percent_deltas: self.labels[i] = self._gtk.ToggleButton(f"{i}%")
self.labels[i] = self._gtk.ToggleButton("%s%%" % i)
self.labels[i].connect("clicked", self.change_percent_delta, i) self.labels[i].connect("clicked", self.change_percent_delta, i)
ctx = self.labels[i].get_style_context() ctx = self.labels[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 == "1":
ctx.add_class("distbutton_active") ctx.add_class("distbutton_active")
deltgrid.attach(self.labels[i], j, 0, 1, 1) deltgrid.attach(self.labels[i], j, 0, 1, 1)
j += 1
self.labels["1"].set_active(True) self.labels["1"].set_active(True)
grid = self._gtk.HomogeneousGrid() grid = self._gtk.HomogeneousGrid()
@@ -147,41 +139,32 @@ class FineTunePanel(ScreenPanel):
self.content.add(grid) self.content.add(grid)
def process_update(self, action, data): def process_update(self, action, data):
_ = self.lang.gettext
if action != "notify_status_update": if action != "notify_status_update":
return return
if "gcode_move" in data: if "gcode_move" in data:
if "homing_origin" in data["gcode_move"]: if "homing_origin" in data["gcode_move"]:
self.labels['zoffset'].set_label(" %.2fmm" % data["gcode_move"]["homing_origin"][2]) self.labels['zoffset'].set_label(f' {data["gcode_move"]["homing_origin"][2]:.2f}mm')
if "extrude_factor" in data["gcode_move"]: if "extrude_factor" in data["gcode_move"]:
self.extrusion = int(round(data["gcode_move"]["extrude_factor"]*100)) self.extrusion = int(round(data["gcode_move"]["extrude_factor"] * 100))
self.labels['extrudefactor'].set_label(" %3d%%" % self.extrusion) self.labels['extrudefactor'].set_label(f" {self.extrusion:3}%")
if "speed_factor" in data["gcode_move"]: if "speed_factor" in data["gcode_move"]:
self.speed = int(round(data["gcode_move"]["speed_factor"]*100)) self.speed = int(round(data["gcode_move"]["speed_factor"] * 100))
self.labels['speedfactor'].set_label(" %3d%%" % self.speed) self.labels['speedfactor'].set_label(f" {self.speed:3}%")
def change_babystepping(self, widget, dir): def change_babystepping(self, widget, direction):
if self._screen.printer.get_stat("toolhead", "homed_axes") != "xyz": if direction == "reset":
self._screen.show_popup_message("Must home first") self._screen._ws.klippy.gcode_script("SET_GCODE_OFFSET Z=0 MOVE=1")
return elif direction in ["+", "-"]:
self._screen._ws.klippy.gcode_script(f"SET_GCODE_OFFSET Z_ADJUST={direction}{self.bs_delta} MOVE=1")
if dir == "+":
gcode = "SET_GCODE_OFFSET Z_ADJUST=%s MOVE=1" % self.bs_delta
elif dir == "-":
gcode = "SET_GCODE_OFFSET Z_ADJUST=-%s MOVE=1" % self.bs_delta
elif dir == "reset":
gcode = "SET_GCODE_OFFSET Z=0 MOVE=1"
self._screen._ws.klippy.gcode_script(gcode)
def change_bs_delta(self, widget, bs): def change_bs_delta(self, widget, bs):
if self.bs_delta == bs: if self.bs_delta == bs:
return return
logging.info("### BabyStepping " + str(bs)) logging.info(f"### BabyStepping {bs}")
ctx = self.labels[str(self.bs_delta)].get_style_context() ctx = self.labels[f"{self.bs_delta}"].get_style_context()
ctx.remove_class("distbutton_active") ctx.remove_class("distbutton_active")
self.bs_delta = bs self.bs_delta = bs
@@ -192,38 +175,34 @@ class FineTunePanel(ScreenPanel):
continue continue
self.labels[i].set_active(False) self.labels[i].set_active(False)
def change_extrusion(self, widget, dir): def change_extrusion(self, widget, direction):
if dir == "+": if direction == "+":
self.extrusion += int(self.percent_delta) self.extrusion += int(self.percent_delta)
elif dir == "-": elif direction == "-":
self.extrusion -= int(self.percent_delta) self.extrusion -= int(self.percent_delta)
elif dir == "reset": elif direction == "reset":
self.extrusion = 100 self.extrusion = 100
if self.extrusion < 1: self.extrusion = max(self.extrusion, 1)
self.extrusion = 1
self._screen._ws.klippy.gcode_script(KlippyGcodes.set_extrusion_rate(self.extrusion)) self._screen._ws.klippy.gcode_script(KlippyGcodes.set_extrusion_rate(self.extrusion))
def change_speed(self, widget, dir): def change_speed(self, widget, direction):
if dir == "+": if direction == "+":
self.speed += int(self.percent_delta) self.speed += int(self.percent_delta)
elif dir == "-": elif direction == "-":
self.speed -= int(self.percent_delta) self.speed -= int(self.percent_delta)
elif dir == "reset": elif direction == "reset":
self.speed = 100 self.speed = 100
if self.speed < 1: self.speed = max(self.speed, 1)
self.speed = 1
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: if self.percent_delta == delta:
return return
logging.info("### Delta " + str(delta)) logging.info(f"### Delta {delta}")
ctx = self.labels[str(self.percent_delta)].get_style_context() ctx = self.labels[f"{self.percent_delta}"].get_style_context()
ctx.remove_class("distbutton_active") ctx.remove_class("distbutton_active")
self.percent_delta = delta self.percent_delta = delta
@@ -232,4 +211,4 @@ class FineTunePanel(ScreenPanel):
for i in self.percent_deltas: for i in self.percent_deltas:
if i == self.percent_delta: if i == self.percent_delta:
continue continue
self.labels[str(i)].set_active(False) self.labels[f"{i}"].set_active(False)
+137 -46
View File
@@ -2,50 +2,68 @@ import gi
import logging import logging
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gdk, Gtk, Pango from gi.repository import Gtk, GLib, Pango
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
def create_panel(*args): def create_panel(*args):
return MacroPanel(*args) return MacroPanel(*args)
class MacroPanel(ScreenPanel): class MacroPanel(ScreenPanel):
def initialize(self, panel_name): def __init__(self, screen, title, back=True):
_ = self.lang.gettext super().__init__(screen, title, back)
self.macros = {} self.sort_reverse = False
self.sort_lbl = _("Name")
self.sort_btn = self._gtk.ButtonImage("arrow-up", self.sort_lbl, "color1", .66, Gtk.PositionType.RIGHT, False)
self.sort_btn.connect("clicked", self.change_sort)
self.sort_btn.set_hexpand(True)
self.allmacros = {}
self.loaded_macros = [] self.loaded_macros = []
self.macros = {}
self.menu = ['macros_menu']
# Create a scroll window for the macros def initialize(self, panel_name):
scroll = Gtk.ScrolledWindow() sort = Gtk.Label(_("Sort:"))
scroll.set_property("overlay-scrolling", False) sort.set_hexpand(False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
# Create a grid for all macros adjust = self._gtk.ButtonImage("settings", None, "color2", 1, Gtk.PositionType.LEFT, False)
adjust.connect("clicked", self.load_menu, 'options')
adjust.set_hexpand(False)
sbox = Gtk.Box()
sbox.set_vexpand(False)
sbox.pack_start(sort, False, False, 5)
sbox.pack_start(self.sort_btn, True, True, 5)
sbox.pack_start(adjust, True, True, 5)
self.labels['macros_list'] = self._gtk.ScrolledWindow()
self.labels['macros'] = Gtk.Grid() self.labels['macros'] = Gtk.Grid()
scroll.add(self.labels['macros']) self.labels['macros_list'].add(self.labels['macros'])
# Create a box to contain all of the above self.labels['macros_menu'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0) self.labels['macros_menu'].set_vexpand(True)
box.set_vexpand(True) self.labels['macros_menu'].pack_start(sbox, False, False, 0)
box.pack_start(scroll, True, True, 0) self.labels['macros_menu'].pack_start(self.labels['macros_list'], True, True, 0)
self.content.add(box) self.content.add(self.labels['macros_menu'])
self.labels['options_menu'] = self._gtk.ScrolledWindow()
self.labels['options'] = Gtk.Grid()
self.labels['options_menu'].add(self.labels['options'])
def activate(self): def activate(self):
self.unload_gcode_macros() while len(self.menu) > 1:
self.load_gcode_macros() self.unload_menu()
self.reload_macros()
def add_gcode_macro(self, macro): def add_gcode_macro(self, macro):
# Support for hiding macros by name # Support for hiding macros by name
if macro.startswith("_"): if macro.startswith("_"):
return return
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
name = Gtk.Label() name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (macro)) name.set_markup(f"<big><b>{macro}</b></big>")
name.set_hexpand(True) name.set_hexpand(True)
name.set_vexpand(True) name.set_vexpand(True)
name.set_halign(Gtk.Align.START) name.set_halign(Gtk.Align.START)
@@ -53,38 +71,58 @@ class MacroPanel(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)
open = self._gtk.ButtonImage("resume", None, "color3") btn = self._gtk.ButtonImage("resume", None, "color3")
open.connect("clicked", self.run_gcode_macro, macro) btn.connect("clicked", self.run_gcode_macro, macro)
open.set_hexpand(False) btn.set_hexpand(False)
open.set_halign(Gtk.Align.END) btn.set_halign(Gtk.Align.END)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name) labels.add(name)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5) dev = Gtk.Box(spacing=5)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev.add(labels) dev.add(labels)
dev.add(open) dev.add(btn)
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
frame.add(dev) frame.add(dev)
self.macros[macro] = { self.macros[macro] = {
"row": frame "row": frame
} }
macros = sorted(self.macros) macros = sorted(self.macros, reverse=self.sort_reverse, key=str.casefold)
pos = macros.index(macro) pos = macros.index(macro)
self.loaded_macros.append(macro) self.loaded_macros.append(macro)
self.labels['macros'].insert_row(pos) self.labels['macros'].insert_row(pos)
self.labels['macros'].attach(self.macros[macro]['row'], 0, pos, 1, 1) self.labels['macros'].attach(self.macros[macro]['row'], 0, pos, 1, 1)
self.labels['macros'].show_all()
def run_gcode_macro(self, widget, macro):
self._screen._ws.klippy.gcode_script(macro)
def change_sort(self, widget):
self.sort_reverse ^= True
if self.sort_reverse:
self.sort_btn.set_image(self._gtk.Image("arrow-down", .66))
else:
self.sort_btn.set_image(self._gtk.Image("arrow-up", .66))
self.sort_btn.show()
GLib.idle_add(self.reload_macros)
def reload_macros(self):
self.labels['macros'].remove_column(0)
self.macros = {}
self.loaded_macros = []
self.allmacros = {}
self.labels['options'].remove_column(0)
self.load_gcode_macros()
def load_gcode_macros(self): def load_gcode_macros(self):
macros = self._screen.printer.get_gcode_macros() macros = self._screen.printer.get_gcode_macros()
section_name = "displayed_macros %s" % self._screen.connected_printer section_name = f"displayed_macros {self._screen.connected_printer}"
logging.info("Macro section name [%s]" % section_name) logging.info(f"Macro section name [{section_name}]")
for x in macros: for x in macros:
macro = x[12:].strip() macro = x[12:].strip()
@@ -96,15 +134,68 @@ class MacroPanel(ScreenPanel):
self._config.get_config().getboolean(section_name, macro.lower(), fallback=True)): self._config.get_config().getboolean(section_name, macro.lower(), fallback=True)):
self.add_gcode_macro(macro) self.add_gcode_macro(macro)
def run_gcode_macro(self, widget, macro): for macro in self._printer.get_config_section_list("gcode_macro "):
self._screen._ws.klippy.gcode_script(macro) macro = macro[12:]
# Support for hiding macros by name
if macro.startswith("_"):
continue
def unload_gcode_macros(self): self.allmacros[macro] = {
section_name = "displayed_macros %s" % self._screen.connected_printer "name": macro,
for macro in self.loaded_macros: "section": f"displayed_macros {self._screen.connected_printer}",
if (section_name in self._config.get_config().sections() and }
not self._config.get_config().getboolean(section_name, macro.lower(), fallback=True)): for macro in list(self.allmacros):
macros = sorted(self.macros) self.add_option('options', self.allmacros, macro, self.allmacros[macro])
pos = macros.index(macro)
self.labels['macros'].remove_row(pos) self.labels['macros'].show_all()
self.labels['macros'].show_all()
def add_option(self, boxname, opt_array, opt_name, option):
name = Gtk.Label()
name.set_markup(f"<big><b>{option['name']}</b></big>")
name.set_hexpand(True)
name.set_vexpand(True)
name.set_halign(Gtk.Align.START)
name.set_valign(Gtk.Align.CENTER)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
box = Gtk.Box()
box.set_vexpand(False)
switch = Gtk.Switch()
switch.set_hexpand(False)
switch.set_vexpand(False)
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name, fallback=True))
switch.connect("notify::active", self.switch_config_option, option['section'], opt_name)
switch.set_property("width-request", round(self._gtk.get_font_size() * 7))
switch.set_property("height-request", round(self._gtk.get_font_size() * 3.5))
box.add(switch)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev.set_valign(Gtk.Align.CENTER)
dev.add(name)
dev.add(box)
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
frame.add(dev)
frame.show_all()
opt_array[opt_name] = {
"name": option['name'],
"row": frame
}
opts = sorted(self.allmacros, key=str.casefold)
pos = opts.index(opt_name)
self.labels[boxname].insert_row(pos)
self.labels[boxname].attach(opt_array[opt_name]['row'], 0, pos, 1, 1)
self.labels[boxname].show_all()
def back(self):
if len(self.menu) > 1:
self.unload_menu()
self.reload_macros()
return True
return False
+202
View File
@@ -0,0 +1,202 @@
import gi
import re
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Pango
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return InputShaperPanel(*args)
# X and Y frequencies
XY_FREQ = [
{'name': 'X', 'config': 'shaper_freq_x', 'min': 0, 'max': 133},
{'name': 'Y', 'config': 'shaper_freq_y', 'min': 0, 'max': 133},
]
SHAPERS = ['zv', 'mzv', 'zvd', 'ei', '2hump_ei', '3hump_ei']
class InputShaperPanel(ScreenPanel):
def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
self.freq_xy_adj = {}
self.freq_xy_combo = {}
self.calibrate_btn = self._gtk.ButtonImage("move", _('Finding ADXL'), "color1", word_wrap=False)
self.calibrate_btn.connect("clicked", self.on_popover_clicked)
self.calibrate_btn.set_sensitive(False)
self.status = Gtk.Label("")
self.status.set_hexpand(True)
self.status.set_vexpand(False)
self.status.set_halign(Gtk.Align.START)
self.status.set_ellipsize(Pango.EllipsizeMode.END)
self.calibrating_axis = None
self.has_sensor = False
def initialize(self, panel_name):
self.has_sensor = False
self.calibrating_axis = None
auto_calibration_label = Gtk.Label()
auto_calibration_label.set_markup('<big><b>Auto Calibration</b></big>')
auto_calibration_label.set_hexpand(True)
auto_grid = Gtk.Grid()
auto_grid.attach(auto_calibration_label, 0, 0, 1, 1)
auto_grid.attach(self.calibrate_btn, 1, 0, 1, 1)
manual_calibration_label = Gtk.Label()
manual_calibration_label.set_markup('<big><b>Manual Calibration</b></big>')
manual_calibration_label.set_vexpand(True)
disclaimer = Gtk.Label()
disclaimer.set_markup('<small>NOTE: Edit your printer.cfg to save manual calibration changes.</small>')
disclaimer.set_line_wrap(True)
disclaimer.set_halign(Gtk.Align.CENTER)
input_grid = Gtk.Grid()
input_grid.attach(manual_calibration_label, 0, 0, 3, 1)
input_grid.attach(disclaimer, 0, 1, 3, 1)
for i, dim_freq in enumerate(XY_FREQ):
axis_lbl = Gtk.Label()
axis_lbl.set_markup(f"<b>{dim_freq['name']}</b>")
axis_lbl.set_hexpand(False)
axis_lbl.set_vexpand(True)
axis_lbl.set_halign(Gtk.Align.START)
axis_lbl.set_valign(Gtk.Align.CENTER)
axis_lbl.set_line_wrap(True)
self.freq_xy_adj[dim_freq['config']] = Gtk.Adjustment(0, dim_freq['min'], dim_freq['max'], 0.1)
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=self.freq_xy_adj[dim_freq['config']])
scale.set_digits(1)
scale.set_hexpand(True)
scale.set_valign(Gtk.Align.END)
scale.set_has_origin(True)
scale.get_style_context().add_class("option_slider")
scale.connect("button-release-event", self.set_opt_value, dim_freq['config'])
shaper_slug = dim_freq['config'].replace('_freq_', '_type_')
self.freq_xy_combo[shaper_slug] = Gtk.ComboBoxText()
for shaper in SHAPERS:
self.freq_xy_combo[shaper_slug].append(shaper, shaper)
self.freq_xy_combo[shaper_slug].set_active(0)
input_grid.attach(axis_lbl, 0, i + 2, 1, 1)
input_grid.attach(scale, 1, i + 2, 1, 1)
input_grid.attach(self.freq_xy_combo[shaper_slug], 2, i + 2, 1, 1)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.add(auto_grid)
box.add(input_grid)
box.add(self.status)
self.content.add(box)
pobox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
test_x = self._gtk.Button(_("Measure X"))
test_x.connect("clicked", self.start_calibration, "x")
pobox.pack_start(test_x, True, True, 5)
test_y = self._gtk.Button(_("Measure Y"))
test_y.connect("clicked", self.start_calibration, "y")
pobox.pack_start(test_y, True, True, 5)
test_both = self._gtk.Button(_("Measure Both"))
test_both.connect("clicked", self.start_calibration, "both")
pobox.pack_start(test_both, True, True, 5)
self.labels['popover'] = Gtk.Popover()
self.labels['popover'].add(pobox)
self.labels['popover'].set_position(Gtk.PositionType.LEFT)
def on_popover_clicked(self, widget):
self.labels['popover'].set_relative_to(widget)
self.labels['popover'].show_all()
def start_calibration(self, widget, method):
self.labels['popover'].popdown()
if self._screen.printer.get_stat("toolhead", "homed_axes") != "xyz":
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
self.calibrating_axis = method
if method == "x":
self._screen._ws.klippy.gcode_script('SHAPER_CALIBRATE AXIS=X')
if method == "y":
self._screen._ws.klippy.gcode_script('SHAPER_CALIBRATE AXIS=Y')
if method == "both":
self._screen._ws.klippy.gcode_script('SHAPER_CALIBRATE')
self.calibrate_btn.set_label(self.lang.gettext('Calibrating...'))
self.calibrate_btn.set_sensitive(False)
def set_opt_value(self, widget, opt, *args):
shaper_freq_x = self.freq_xy_adj['shaper_freq_x'].get_value()
shaper_freq_y = self.freq_xy_adj['shaper_freq_y'].get_value()
shaper_type_x = self.freq_xy_combo['shaper_type_x'].get_active_text()
shaper_type_y = self.freq_xy_combo['shaper_type_y'].get_active_text()
self._screen._ws.klippy.gcode_script(
f'SET_INPUT_SHAPER '
f'SHAPER_FREQ_X={shaper_freq_x} '
f'SHAPER_TYPE_X={shaper_type_x} '
f'SHAPER_FREQ_Y={shaper_freq_y} '
f'SHAPER_TYPE_Y={shaper_type_y}'
)
def save_config(self):
script = {"script": "SAVE_CONFIG"}
self._screen._confirm_send_action(
None,
_("Save configuration?") + "\n\n" + _("Klipper will reboot"),
"printer.gcode.script",
script
)
def activate(self):
# This will return the current values
self._screen._ws.klippy.gcode_script(
'SET_INPUT_SHAPER'
)
# Check for the accelerometer
self._screen._ws.klippy.gcode_script(
'ACCELEROMETER_QUERY'
)
# Send at least two commands, with my accelerometer the first command after a reboot will fail
self._screen._ws.klippy.gcode_script(
'MEASURE_AXES_NOISE'
)
def process_update(self, action, data):
if action == "notify_gcode_response":
self.status.set_text(f"{data.replace('shaper_', '').replace('damping_', '')}")
data = data.lower()
if 'got 0' in data:
self.calibrate_btn.set_label(_('Check ADXL Wiring'))
self.calibrate_btn.set_sensitive(False)
if 'unknown command:"accelerometer_query"' in data:
self.calibrate_btn.set_label(_('ADXL Not Configured'))
self.calibrate_btn.set_sensitive(False)
if 'adxl345 values' in data or 'axes noise' in data:
self.has_sensor = True
self.calibrate_btn.set_sensitive(True)
self.calibrate_btn.set_label(_('Auto-calibrate'))
# Recommended shaper_type_y = ei, shaper_freq_y = 48.4 Hz
if 'recommended shaper_type_' in data:
results = re.search(r'shaper_type_(?P<axis>[xy])\s*=\s*(?P<shaper_type>.*?), shaper_freq_.\s*=\s*('
r'?P<shaper_freq>[0-9.]+)', data).groupdict()
self.freq_xy_adj['shaper_freq_' + results['axis']].set_value(float(results['shaper_freq']))
self.freq_xy_combo['shaper_type_' + results['axis']].set_active(SHAPERS.index(results['shaper_type']))
if self.calibrating_axis == results['axis'] \
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']))
+246 -211
View File
@@ -3,30 +3,44 @@ import gi
import logging import logging
import os import os
import time import time
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 numpy import sqrt, pi, dot, array, median
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
def create_panel(*args): def create_panel(*args):
return JobStatusPanel(*args) return JobStatusPanel(*args)
class JobStatusPanel(ScreenPanel):
is_paused = False
filename = state_timeout = prev_pos = prev_gpos = vel_timeout = None
file_metadata = labels = {}
state = "standby"
timeleft_type = "file"
progress = zoffset = flowrate = vel = 0
main_status_displayed = True
close_timeouts = velstore = flowstore = []
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.grid = self._gtk.HomogeneousGrid()
self.grid.set_row_homogeneous(False)
self.pos_z = 0
self.extrusion = 100
self.speed = 100
self.speed_factor = 1
self.req_speed = 0
self.f_layer_h = self.layer_h = 1
self.oheight = 0
self.current_extruder = None
self.fila_section = 0
self.buttons = None
self.is_paused = False
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.file_metadata = self.fans = {}
self.state = "standby"
self.timeleft_type = "auto"
self.progress = self.zoffset = self.flowrate = self.vel = 0
self.main_status_displayed = True
self.velstore = self.flowstore = []
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
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',
@@ -55,13 +69,12 @@ class JobStatusPanel(ScreenPanel):
self.labels['height_lbl'] = Gtk.Label(_("Height:")) self.labels['height_lbl'] = Gtk.Label(_("Height:"))
self.labels['layer_lbl'] = Gtk.Label(_("Layer:")) self.labels['layer_lbl'] = Gtk.Label(_("Layer:"))
self.fans = {}
for fan in self._printer.get_fans(): for fan in self._printer.get_fans():
# fan_types = ["controller_fan", "fan_generic", "heater_fan"] # fan_types = ["controller_fan", "fan_generic", "heater_fan"]
if fan == "fan": if fan == "fan":
name = " " name = " "
elif fan.startswith("fan_generic"): elif fan.startswith("fan_generic"):
name = fan.split(" ")[1:][0][:1].upper() + ":" name = " ".join(fan.split(" ")[1:])[:1].upper() + ":"
if name.startswith("_"): if name.startswith("_"):
continue continue
else: else:
@@ -85,10 +98,9 @@ class JobStatusPanel(ScreenPanel):
for label in self.labels: for label in self.labels:
self.labels[label].set_halign(Gtk.Align.START) self.labels[label].set_halign(Gtk.Align.START)
self.labels[label].set_ellipsize(True)
self.labels[label].set_ellipsize(Pango.EllipsizeMode.END) self.labels[label].set_ellipsize(Pango.EllipsizeMode.END)
fi_box = Gtk.VBox(spacing=0) fi_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
fi_box.add(self.labels['file']) fi_box.add(self.labels['file'])
fi_box.add(self.labels['status']) fi_box.add(self.labels['status'])
fi_box.add(self.labels['lcdmessage']) fi_box.add(self.labels['lcdmessage'])
@@ -109,16 +121,18 @@ class JobStatusPanel(ScreenPanel):
self.labels['thumbnail'] = self._gtk.Image("file", 2) self.labels['thumbnail'] = self._gtk.Image("file", 2)
if self._screen.vertical_mode: if self._screen.vertical_mode:
self.labels['thumbnail'].set_size_request(0, self._screen.height/4) self.labels['thumbnail'].set_size_request(0, self._screen.height / 4)
else: else:
self.labels['thumbnail'].set_size_request(self._screen.width/3, 0) 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():
self.current_extruder = self._printer.get_stat("toolhead", "extruder")
diameter = float(self._printer.get_config_section(self.current_extruder)['filament_diameter'])
self.fila_section = pi * ((diameter / 2) ** 2)
self.create_status_grid() self.create_status_grid()
self.grid = self._gtk.HomogeneousGrid()
self.grid.set_row_homogeneous(False)
self.grid.attach(overlay, 0, 0, 1, 1) self.grid.attach(overlay, 0, 0, 1, 1)
self.grid.attach(fi_box, 1, 0, 3, 1) self.grid.attach(fi_box, 1, 0, 3, 1)
self.grid.attach(self.labels['info_grid'], 0, 1, 4, 2) self.grid.attach(self.labels['info_grid'], 0, 1, 4, 2)
@@ -127,26 +141,17 @@ class JobStatusPanel(ScreenPanel):
self.content.add(self.grid) self.content.add(self.grid)
self._screen.wake_screen() self._screen.wake_screen()
self.current_extruder = self._printer.get_stat("toolhead", "extruder")
# the diameter may change with extruders but is highly unusual
diameter = float(self._printer.get_config_section(self.current_extruder)['filament_diameter'])
self.fila_section = pi * ((diameter / 2) ** 2)
def create_status_grid(self, widget=None): def create_status_grid(self, widget=None):
_ = self.lang.gettext
self.main_status_displayed = True self.main_status_displayed = True
self.labels['temp_grid'] = Gtk.Grid() self.labels['temp_grid'] = Gtk.Grid()
if self._screen.width <= 480: nlimit = 2 if self._screen.width <= 480 else 3
nlimit = 2
else:
nlimit = 3
n = 0 n = 0
self.extruder_button = {} self.extruder_button = {}
if self._screen.printer.get_tools(): if self._screen.printer.get_tools():
for i, extruder in enumerate(self._printer.get_tools()): for i, extruder in enumerate(self._printer.get_tools()):
self.labels[extruder] = Gtk.Label("-") self.labels[extruder] = Gtk.Label("-")
self.extruder_button[extruder] = self._gtk.ButtonImage("extruder-%s" % i, self.extruder_button[extruder] = self._gtk.ButtonImage(f"extruder-{i}",
None, None, .6, Gtk.PositionType.LEFT) None, None, .6, Gtk.PositionType.LEFT)
self.extruder_button[extruder].set_label(self.labels[extruder].get_text()) self.extruder_button[extruder].set_label(self.labels[extruder].get_text())
self.extruder_button[extruder].connect("clicked", self.menu_item_clicked, "temperature", self.extruder_button[extruder].connect("clicked", self.menu_item_clicked, "temperature",
@@ -187,10 +192,10 @@ class JobStatusPanel(ScreenPanel):
titlebar_items = printer_cfg.get("titlebar_items", "") titlebar_items = printer_cfg.get("titlebar_items", "")
if titlebar_items is not None: if titlebar_items is not None:
titlebar_items = [str(i.strip()) for i in titlebar_items.split(',')] titlebar_items = [str(i.strip()) for i in titlebar_items.split(',')]
logging.info("Titlebar items: %s", titlebar_items) logging.info(f"Titlebar items: {titlebar_items}")
for device in self._screen.printer.get_heaters(): for device in self._screen.printer.get_heaters():
if device.startswith("temperature_sensor"): if device.startswith("temperature_sensor"):
name = device.split(" ")[1:][0] name = " ".join(device.split(" ")[1:])
for item in titlebar_items: for item in titlebar_items:
if name == item: if name == item:
if extra_item: if extra_item:
@@ -242,11 +247,12 @@ class JobStatusPanel(ScreenPanel):
szfe = Gtk.Grid() szfe = Gtk.Grid()
szfe.attach(self.speed_button, 0, 0, 1, 1) szfe.attach(self.speed_button, 0, 0, 1, 1)
szfe.attach(self.z_button, 1, 0, 1, 1) szfe.attach(self.z_button, 1, 0, 1, 1)
szfe.attach(self.extrusion_button, 0, 1, 1, 1) if self._screen.printer.get_tools():
szfe.attach(self.fan_button, 1, 1, 1, 1) szfe.attach(self.extrusion_button, 0, 1, 1, 1)
if self._screen.printer.get_fans():
szfe.attach(self.fan_button, 1, 1, 1, 1)
info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
info = Gtk.VBox(spacing=0)
info.get_style_context().add_class("printing-info") info.get_style_context().add_class("printing-info")
info.add(self.labels['temp_grid']) info.add(self.labels['temp_grid'])
info.add(szfe) info.add(szfe)
@@ -286,7 +292,7 @@ class JobStatusPanel(ScreenPanel):
goback.set_hexpand(False) goback.set_hexpand(False)
goback.get_style_context().add_class("printing-info") goback.get_style_context().add_class("printing-info")
pos_box = Gtk.HBox(spacing=5) pos_box = Gtk.Box(spacing=5)
pos_box.add(self.labels['pos_x']) pos_box.add(self.labels['pos_x'])
pos_box.add(self.labels['pos_y']) pos_box.add(self.labels['pos_y'])
pos_box.add(self.labels['pos_z']) pos_box.add(self.labels['pos_z'])
@@ -345,27 +351,33 @@ class JobStatusPanel(ScreenPanel):
def on_draw(self, da, ctx): def on_draw(self, da, ctx):
w = da.get_allocated_width() w = da.get_allocated_width()
h = da.get_allocated_height() h = da.get_allocated_height()
r = min(w, h)*.42 r = min(w, h) * .42
ctx.set_source_rgb(0.13, 0.13, 0.13) ctx.set_source_rgb(0.13, 0.13, 0.13)
ctx.set_line_width(self._gtk.get_font_size() * .75) ctx.set_line_width(self._gtk.get_font_size() * .75)
ctx.translate(w / 2, h / 2) ctx.translate(w / 2, h / 2)
ctx.arc(0, 0, r, 0, 2*pi) ctx.arc(0, 0, r, 0, 2 * pi)
ctx.stroke() ctx.stroke()
ctx.set_source_rgb(0.718, 0.110, 0.110) ctx.set_source_rgb(0.718, 0.110, 0.110)
ctx.arc(0, 0, r, 3/2*pi, 3/2*pi+(self.progress*2*pi)) ctx.arc(0, 0, r, 3 / 2 * pi, 3 / 2 * pi + (self.progress * 2 * pi))
ctx.stroke() ctx.stroke()
def activate(self): def activate(self):
_ = self.lang.gettext
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: if self.state_timeout is None:
self.state_timeout = GLib.timeout_add_seconds(1, self.state_check) 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:
self.vel_timeout = GLib.timeout_add_seconds(1, self.update_velocity)
def deactivate(self):
if self.vel_timeout is not None:
GLib.source_remove(self.vel_timeout)
self.vel_timeout = None
def create_buttons(self): def create_buttons(self):
_ = self.lang.gettext
self.buttons = { self.buttons = {
'cancel': self._gtk.ButtonImage("stop", _("Cancel"), "color2"), 'cancel': self._gtk.ButtonImage("stop", _("Cancel"), "color2"),
'control': self._gtk.ButtonImage("settings", _("Settings"), "color3"), 'control': self._gtk.ButtonImage("settings", _("Settings"), "color3"),
@@ -385,16 +397,48 @@ class JobStatusPanel(ScreenPanel):
self.buttons['pause'].connect("clicked", self.pause) self.buttons['pause'].connect("clicked", self.pause)
self.buttons['restart'].connect("clicked", self.restart) self.buttons['restart'].connect("clicked", self.restart)
self.buttons['resume'].connect("clicked", self.resume) self.buttons['resume'].connect("clicked", self.resume)
self.buttons['save_offset_probe'].connect("clicked", self.save_offset_probe) self.buttons['save_offset_probe'].connect("clicked", self.save_offset, "probe")
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_probe(self, widget): def save_offset(self, widget, device):
self._screen._ws.klippy.gcode_script("Z_OFFSET_APPLY_PROBE")
self._screen._ws.klippy.gcode_script("SAVE_CONFIG")
def save_offset_endstop(self, widget): saved_z_offset = 0
self._screen._ws.klippy.gcode_script("Z_OFFSET_APPLY_ENDSTOP") if self._printer.config_section_exists("probe"):
self._screen._ws.klippy.gcode_script("SAVE_CONFIG") saved_z_offset = float(self._screen.printer.get_config_section("probe")['z_offset'])
elif self._printer.config_section_exists("bltouch"):
saved_z_offset = float(self._screen.printer.get_config_section("bltouch")['z_offset'])
sign = "+" if self.zoffset > 0 else "-"
label = Gtk.Label()
if device == "probe":
label.set_text(_("Apply %s%.2f offset to Probe?") % (sign, abs(self.zoffset))
+ "\n\n"
+ _("Saved offset: %s") % saved_z_offset)
elif device == "endstop":
label.set_text(_("Apply %.2f offset to Endstop?") % self.zoffset)
label.set_hexpand(True)
label.set_halign(Gtk.Align.CENTER)
label.set_vexpand(True)
label.set_valign(Gtk.Align.CENTER)
label.set_line_wrap(True)
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
grid = self._gtk.HomogeneousGrid()
grid.attach(label, 0, 0, 1, 1)
buttons = [
{"name": _("Apply"), "response": Gtk.ResponseType.APPLY},
{"name": _("Cancel"), "response": Gtk.ResponseType.CANCEL}
]
self._gtk.Dialog(self._screen, buttons, grid, self.save_confirm, device)
def save_confirm(self, widget, response_id, device):
if response_id == Gtk.ResponseType.APPLY:
if device == "probe":
self._screen._ws.klippy.gcode_script("Z_OFFSET_APPLY_PROBE")
if device == "endstop":
self._screen._ws.klippy.gcode_script("Z_OFFSET_APPLY_ENDSTOP")
self._screen._ws.klippy.gcode_script("SAVE_CONFIG")
widget.destroy()
def restart(self, widget): def restart(self, widget):
if self.filename != "none": if self.filename != "none":
@@ -410,7 +454,6 @@ class JobStatusPanel(ScreenPanel):
self._screen.show_all() self._screen.show_all()
def cancel(self, widget): def cancel(self, widget):
_ = self.lang.gettext
buttons = [ buttons = [
{"name": _("Cancel Print"), "response": Gtk.ResponseType.OK}, {"name": _("Cancel Print"), "response": Gtk.ResponseType.OK},
@@ -454,9 +497,9 @@ class JobStatusPanel(ScreenPanel):
return False return False
def remove_close_timeout(self): def remove_close_timeout(self):
for to in self.close_timeouts: if self.close_timeout is not None:
GLib.source_remove(to) GLib.source_remove(self.close_timeout)
self.close_timeouts.remove(to) self.close_timeout = None
def enable_button(self, *args): def enable_button(self, *args):
for arg in args: for arg in args:
@@ -467,7 +510,7 @@ class JobStatusPanel(ScreenPanel):
self.buttons[arg].set_sensitive(False) self.buttons[arg].set_sensitive(False)
def _callback_metadata(self, newfiles, deletedfiles, modifiedfiles): def _callback_metadata(self, newfiles, deletedfiles, modifiedfiles):
if bool(self.file_metadata) is False and self.filename in modifiedfiles: if not bool(self.file_metadata) and self.filename in modifiedfiles:
self.update_file_metadata() self.update_file_metadata()
self._files.remove_file_callback(self._callback_metadata) self._files.remove_file_callback(self._callback_metadata)
@@ -489,7 +532,6 @@ class JobStatusPanel(ScreenPanel):
return return
elif action != "notify_status_update": elif action != "notify_status_update":
return return
_ = self.lang.gettext
if self.main_status_displayed: if self.main_status_displayed:
for x in self._printer.get_tools(): for x in self._printer.get_tools():
@@ -510,24 +552,23 @@ class JobStatusPanel(ScreenPanel):
self.update_message() self.update_message()
if "toolhead" in data and "extruder" in data["toolhead"]: with contextlib.suppress(KeyError):
if self.current_extruder is not None and data["toolhead"]["extruder"] != self.current_extruder: if data["toolhead"]["extruder"] != self.current_extruder:
self.labels['temp_grid'].remove_column(0) self.labels['temp_grid'].remove_column(0)
self.labels['temp_grid'].insert_column(0) self.labels['temp_grid'].insert_column(0)
self.current_extruder = data["toolhead"]["extruder"] self.current_extruder = data["toolhead"]["extruder"]
self.labels['temp_grid'].attach(self.extruder_button[self.current_extruder], 0, 0, 1, 1) self.labels['temp_grid'].attach(self.extruder_button[self.current_extruder], 0, 0, 1, 1)
self._screen.show_all() self._screen.show_all()
if "max_accel" in data["toolhead"]: with contextlib.suppress(KeyError):
self.labels['max_accel'].set_text("%d mm/s2" % (data["toolhead"]["max_accel"])) self.labels['max_accel'].set_text(f"{data['toolhead']['max_accel']} mm/s²")
with contextlib.suppress(KeyError):
if "extruder" in data and "pressure_advance" in data['extruder']: self.labels['advance'].set_text(f"{data['extruder']['pressure_advance']:.2f}")
self.labels['advance'].set_text("%.2f" % data['extruder']['pressure_advance'])
if "gcode_move" in data: if "gcode_move" in data:
if "gcode_position" in data["gcode_move"]: with contextlib.suppress(KeyError):
self.labels['pos_x'].set_text("X: %6.2f" % (data["gcode_move"]["gcode_position"][0])) self.labels['pos_x'].set_text(f"X: {data['gcode_move']['gcode_position'][0]:6.2f}")
self.labels['pos_y'].set_text("Y: %6.2f" % (data["gcode_move"]["gcode_position"][1])) self.labels['pos_y'].set_text(f"Y: {data['gcode_move']['gcode_position'][1]:6.2f}")
self.labels['pos_z'].set_text("Z: %6.2f" % (data["gcode_move"]["gcode_position"][2])) self.labels['pos_z'].set_text(f"Z: {data['gcode_move']['gcode_position'][2]:6.2f}")
self.pos_z = data["gcode_move"]["gcode_position"][2] self.pos_z = data["gcode_move"]["gcode_position"][2]
if self.main_status_displayed: if self.main_status_displayed:
self.z_button.set_label(self.labels['pos_z'].get_text()) self.z_button.set_label(self.labels['pos_z'].get_text())
@@ -542,54 +583,54 @@ class JobStatusPanel(ScreenPanel):
vel = array(vel) vel = array(vel)
self.velstore.append(sqrt(vel.dot(vel)) / interval) self.velstore.append(sqrt(vel.dot(vel)) / interval)
self.prev_gpos = [pos, now] self.prev_gpos = [pos, now]
if "extrude_factor" in data["gcode_move"]: with contextlib.suppress(KeyError):
self.extrusion = int(round(data["gcode_move"]["extrude_factor"] * 100)) self.extrusion = int(round(data["gcode_move"]["extrude_factor"] * 100))
self.labels['extrude_factor'].set_text("%3d%%" % self.extrusion) self.labels['extrude_factor'].set_text(f"{self.extrusion:3}%")
if self.main_status_displayed: if self.main_status_displayed:
self.extrusion_button.set_label("%3d%%" % self.extrusion) self.extrusion_button.set_label(f"{self.extrusion:3}%")
if "speed_factor" in data["gcode_move"]: with contextlib.suppress(KeyError):
self.speed = int(round(data["gcode_move"]["speed_factor"] * 100)) self.speed = int(round(data["gcode_move"]["speed_factor"] * 100))
self.speed_factor = float(data["gcode_move"]["speed_factor"]) self.speed_factor = float(data["gcode_move"]["speed_factor"])
self.labels['speed_factor'].set_text("%3d%%" % self.speed) self.labels['speed_factor'].set_text(f"{self.speed:3}%")
if "speed" in data["gcode_move"]: with contextlib.suppress(KeyError):
self.req_speed = int(round(data["gcode_move"]["speed"] / 60 * self.speed_factor)) self.req_speed = int(round(data["gcode_move"]["speed"] / 60 * self.speed_factor))
self.labels['req_speed'].set_text("%d mm/s" % self.req_speed) with contextlib.suppress(KeyError):
if "homing_origin" in data["gcode_move"]:
self.zoffset = data["gcode_move"]["homing_origin"][2] self.zoffset = data["gcode_move"]["homing_origin"][2]
self.labels['zoffset'].set_text("%.2f" % self.zoffset) self.labels['zoffset'].set_text(f"{self.zoffset:.2f}")
if "motion_report" in data: if "motion_report" in data:
if 'live_position' in data["motion_report"]: with contextlib.suppress(KeyError):
now = time.time() pos = data["motion_report"]["live_position"]
pos = data["motion_report"]["live_position"] now = time.time()
if self.prev_pos is not None: if self.prev_pos is not None:
interval = (now - self.prev_pos[1]) interval = (now - self.prev_pos[1])
# Calculate Flowrate # Calculate Flowrate
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 = [(pos[0] - self.prev_pos[0][0]),
(pos[1] - self.prev_pos[0][1]), (pos[1] - self.prev_pos[0][1]),
(pos[2] - self.prev_pos[0][2])] (pos[2] - self.prev_pos[0][2])]
vel = array(vel) vel = array(vel)
self.velstore.append(sqrt(vel.dot(vel)) / interval) self.velstore.append(sqrt(vel.dot(vel)) / interval)
self.prev_pos = [pos, now] self.prev_pos = [pos, now]
if "live_velocity" in data["motion_report"]: with contextlib.suppress(KeyError):
self.velstore.append(data["motion_report"]["live_velocity"]) self.velstore.append(float(data["motion_report"]["live_velocity"]))
if "live_extruder_velocity" in data["motion_report"]: with contextlib.suppress(KeyError):
self.flowstore.append(self.flowrate) self.flowstore.append(self.fila_section * float(data["motion_report"]["live_extruder_velocity"]))
for fan in self.fans:
if fan in data and "speed" in data[fan]:
fan_speed = int(round(self._printer.get_fan_speed(fan, data[fan]["speed"]), 2)*100)
self.fans[fan]['speed'] = ("%3d%%" % fan_speed)
fan_label = "" fan_label = ""
for fan in self.fans: for fan in self.fans:
fan_label += self.fans[fan]['name'] + self.fans[fan]['speed'] + " " with contextlib.suppress(KeyError):
self.labels['fan'].set_text(fan_label[:12]) fan_speed = int(round(self._printer.get_fan_speed(fan, data[fan]["speed"]), 2) * 100)
self.fans[fan]['speed'] = f"{fan_speed:3}%"
fan_label += f" {self.fans[fan]['name']}{self.fans[fan]['speed']}"
if fan_label:
self.labels['fan'].set_text(fan_label[:12])
if "layer_height" in self.file_metadata: if "layer_height" in self.file_metadata and "object_height" in self.file_metadata:
layer_label = str(1 + round((self.pos_z - self.f_layer_h) / self.layer_h)) layer_label = (
layer_label += " / " + self.labels['total_layers'].get_text() 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.labels['layer'].set_label(layer_label)
self.state_check() self.state_check()
@@ -603,101 +644,87 @@ class JobStatusPanel(ScreenPanel):
else: else:
duration = ps['print_duration'] duration = ps['print_duration']
if 'filament_used' in ps: if 'filament_used' in ps:
fila_used = float(ps['filament_used']) self.labels['filament_used'].set_text(f"{float(ps['filament_used']) / 1000:.1f} m")
self.labels['filament_used'].set_text("%.1f m" % (fila_used / 1000))
if 'filename' in ps and (ps['filename'] != self.filename): if 'filename' in ps and (ps['filename'] != self.filename):
logging.debug("Changing filename: '%s' to '%s'" % (self.filename, ps['filename'])) logging.debug(f"Changing filename: '{self.filename}' to '{ps['filename']}'")
self.update_filename() self.update_filename()
else: else:
self.update_percent_complete() self.update_percent_complete()
self.update_text("duration", str(self._gtk.formatTimeString(duration))) self.update_time_left(duration, ps['filament_used'])
self.update_text("time_left", self.calculate_time_left(duration, ps['filament_used']))
if self.main_status_displayed: if self.main_status_displayed:
self.fan_button.set_label(self.labels['fan'].get_text()) self.fan_button.set_label(self.labels['fan'].get_text())
elapsed_label = self.labels['elapsed'].get_text() + " " + self.labels['duration'].get_text() elapsed_label = f"{self.labels['elapsed'].get_text()} {self.labels['duration'].get_text()}"
self.elapsed_button.set_label(elapsed_label) self.elapsed_button.set_label(elapsed_label)
remaining_label = self.labels['left'].get_text() + " " + self.labels['time_left'].get_text() remaining_label = f"{self.labels['left'].get_text()} {self.labels['time_left'].get_text()}"
self.left_button.set_label(remaining_label) self.left_button.set_label(remaining_label)
if self.vel_timeout is None:
self.vel_timeout = GLib.timeout_add_seconds(1, self.update_velocity)
def update_velocity(self): def update_velocity(self):
if len(self.velstore) > 0: if not self.velstore:
self.vel = (self.vel + median(array(self.velstore))) / 2 self.velstore.append(0)
self.labels['req_speed'].set_text("%d/%d mm/s" % (self.vel, self.req_speed)) if not self.flowstore:
self.velstore = [] self.flowstore.append(0)
if len(self.flowstore) > 0: self.flowrate = median(array(self.flowstore))
self.flowrate = (self.flowrate + median(array(self.flowstore))) / 2 self.vel = median(array(self.velstore))
self.labels['flowrate'].set_label("%.1f mm3/s" % self.flowrate) self.velstore = []
self.flowstore = [] self.flowstore = []
self.labels['flowrate'].set_label(f"{self.flowrate:.1f} mm³/s")
self.labels['req_speed'].set_text(f"{self.vel:.0f}/{self.req_speed:.0f} mm/s")
if self.main_status_displayed: if self.main_status_displayed:
self.speed_button.set_label("%3d%% %5d mm/s" % (self.speed, self.vel)) self.speed_button.set_label(f"{self.speed:3.0f}% {self.vel:5.0f} mm/s")
self.extrusion_button.set_label("%3d%% %5.1f mm3/s" % (self.extrusion, self.flowrate)) self.extrusion_button.set_label(f"{self.extrusion:3}% {self.flowrate:5.1f} mm³/s")
return True return True
def calculate_time_left(self, duration=0, filament_used=0): def update_time_left(self, duration=0, fila_used=0):
total_duration = None total_duration = None
if self.progress < 1: if self.progress < 1:
slicer_time = filament_time = file_time = None slicer_time = filament_time = file_time = None
timeleft_type = self._config.get_config()['main'].get('print_estimate_method', 'auto') timeleft_type = self._config.get_config()['main'].get('print_estimate_method', 'auto')
slicer_correction = (self._config.get_config()['main'].getint('print_estimate_compensation', 100) / 100)
# speed_factor compensation based on empirical testing
spdcomp = sqrt(self.speed_factor)
if "estimated_time" in self.file_metadata: with contextlib.suppress(KeyError):
if self.file_metadata['estimated_time'] > 0: if self.file_metadata['estimated_time'] > 0:
slicer_time = (self.file_metadata['estimated_time'] * slicer_correction) / spdcomp usrcomp = (self._config.get_config()['main'].getint('print_estimate_compensation', 100) / 100)
if slicer_time < duration: # speed_factor compensation based on empirical testing
slicer_time = None spdcomp = sqrt(self.speed_factor)
slicer_time = (self.file_metadata['estimated_time'] * usrcomp) / spdcomp
self.update_text("slicer_time", self.format_time(slicer_time))
if "filament_total" in self.file_metadata: with contextlib.suppress(Exception):
if self.file_metadata['filament_total'] > 0 and filament_used > 0: if self.file_metadata['filament_total'] > fila_used:
if self.file_metadata['filament_total'] > filament_used: filament_time = duration / (fila_used / self.file_metadata['filament_total'])
filament_time = duration / (filament_used / self.file_metadata['filament_total']) self.update_text("filament_time", self.format_time(filament_time))
if filament_time < duration:
filament_time = None
if self.progress > 0: with contextlib.suppress(ZeroDivisionError):
file_time = duration / self.progress file_time = duration / self.progress
self.update_text("file_time", self.format_time(file_time))
if timeleft_type == "file" and file_time is not None: if timeleft_type == "file":
total_duration = file_time total_duration = file_time
elif timeleft_type == "filament" and filament_time is not None: elif timeleft_type == "filament":
total_duration = filament_time total_duration = filament_time
elif slicer_time is not None: elif slicer_time is not None:
if timeleft_type == "slicer": if timeleft_type == "slicer":
total_duration = slicer_time total_duration = slicer_time
elif filament_time is not None and self.progress > 0.14:
# Weighted arithmetic mean (Slicer is the most accurate)
total_duration = (slicer_time * 3 + filament_time + file_time) / 5
else: else:
if filament_time is not None and self.progress > 0.14: # At the begining file and filament are innacurate
# Weighted arithmetic mean (Slicer is the most accurate) total_duration = slicer_time
total_duration = (slicer_time * 3 + filament_time + file_time) / 5
else:
# At the begining file and filament are innacurate
total_duration = slicer_time
elif file_time is not None: elif file_time is not None:
if filament_time is not None: if filament_time is not None:
total_duration = (filament_time + file_time) / 2 total_duration = (filament_time + file_time) / 2
else: else:
total_duration = file_time total_duration = file_time
self.update_text("duration", self.format_time(duration))
if total_duration is None: self.update_text("est_time", self.format_time(total_duration))
return "-" self.update_text("time_left", self.format_time(total_duration - duration))
self.update_text("est_time", str(self._gtk.formatTimeString(total_duration)))
if slicer_time is not None:
self.update_text("slicer_time", str(self._gtk.formatTimeString(slicer_time)))
if file_time is not None:
self.update_text("file_time", str(self._gtk.formatTimeString(file_time)))
if filament_time is not None:
self.update_text("filament_time", str(self._gtk.formatTimeString(filament_time)))
return str(self._gtk.formatTimeString((total_duration - duration)))
def state_check(self): def state_check(self):
ps = self._printer.get_stat("print_stats") ps = self._printer.get_stat("print_stats")
if ps['state'] == self.state: if ps['state'] == self.state:
return True return True
_ = self.lang.gettext
if ps['state'] == "printing": if ps['state'] == "printing":
if self.state == "cancelling": if self.state == "cancelling":
@@ -708,43 +735,35 @@ class JobStatusPanel(ScreenPanel):
self.progress = 1 self.progress = 1
self.update_progress() self.update_progress()
self.set_state("complete") self.set_state("complete")
self._screen.wake_screen() return self._add_timeout("job_complete_timeout")
self.remove_close_timeout()
timeout = self._config.get_main_config().getint("job_complete_timeout", 30)
if timeout != 0:
self.close_timeouts.append(GLib.timeout_add_seconds(timeout, self.close_panel))
return False
elif ps['state'] == "error": elif ps['state'] == "error":
logging.debug("Error!") logging.debug("Error!")
self.set_state("error") self.set_state("error")
self.labels['status'].set_text("%s" % (_("Error"))) self.labels['status'].set_text(_("Error"))
self._screen.show_popup_message(ps['message']) self._screen.show_popup_message(ps['message'])
self._screen.wake_screen() return self._add_timeout("job_error_timeout")
self.remove_close_timeout()
timeout = self._config.get_main_config().getint("job_error_timeout", 0)
if timeout != 0:
self.close_timeouts.append(GLib.timeout_add_seconds(timeout, self.close_panel))
return False
elif ps['state'] == "cancelled": elif ps['state'] == "cancelled":
# Print was cancelled # Print was cancelled
self.set_state("cancelled") self.set_state("cancelled")
self._screen.wake_screen() return self._add_timeout("job_cancelled_timeout")
self.remove_close_timeout()
timeout = self._config.get_main_config().getint("job_cancelled_timeout", 0)
if timeout != 0:
self.close_timeouts.append(GLib.timeout_add_seconds(timeout, self.close_panel))
return False
elif ps['state'] == "paused": elif ps['state'] == "paused":
self.set_state("paused") self.set_state("paused")
elif ps['state'] == "standby": elif ps['state'] == "standby":
self.set_state("standby") self.set_state("standby")
return True return True
def _add_timeout(self, job_timeout):
self._screen.wake_screen()
self.remove_close_timeout()
timeout = self._config.get_main_config().getint(job_timeout, 0)
if timeout != 0:
self.close_timeout = GLib.timeout_add_seconds(timeout, self.close_panel)
return False
def set_state(self, state): def set_state(self, state):
_ = self.lang.gettext
if self.state != state: if self.state != state:
logging.debug("Changing job_status state from '%s' to '%s'" % (self.state, state)) logging.debug(f"Changing job_status state from '{self.state}' to '{state}'")
if state == "paused": if state == "paused":
self.update_text("status", _("Paused")) self.update_text("status", _("Paused"))
elif state == "printing": elif state == "printing":
@@ -758,7 +777,6 @@ class JobStatusPanel(ScreenPanel):
self.state = state self.state = state
self.show_buttons_for_state() self.show_buttons_for_state()
def show_buttons_for_state(self): def show_buttons_for_state(self):
self.buttons['button_grid'].remove_row(0) self.buttons['button_grid'].remove_row(0)
self.buttons['button_grid'].insert_row(0) self.buttons['button_grid'].insert_row(0)
@@ -782,7 +800,7 @@ class JobStatusPanel(ScreenPanel):
self.buttons['button_grid'].attach(self.buttons["save_offset_endstop"], 0, 0, 1, 1) self.buttons['button_grid'].attach(self.buttons["save_offset_endstop"], 0, 0, 1, 1)
else: else:
self.buttons['button_grid'].attach(Gtk.Label(""), 0, 0, 1, 1) self.buttons['button_grid'].attach(Gtk.Label(""), 0, 0, 1, 1)
if (self._printer.config_section_exists("probe") or self._printer.config_section_exists("bltouch")): if self._printer.config_section_exists("probe") or self._printer.config_section_exists("bltouch"):
self.buttons['button_grid'].attach(self.buttons["save_offset_probe"], 1, 0, 1, 1) self.buttons['button_grid'].attach(self.buttons["save_offset_probe"], 1, 0, 1, 1)
else: else:
self.buttons['button_grid'].attach(Gtk.Label(""), 1, 0, 1, 1) self.buttons['button_grid'].attach(Gtk.Label(""), 1, 0, 1, 1)
@@ -797,42 +815,60 @@ class JobStatusPanel(ScreenPanel):
def show_file_thumbnail(self): def show_file_thumbnail(self):
if self._files.has_thumbnail(self.filename): if self._files.has_thumbnail(self.filename):
scale = 5 * self._files.get_thumbnail_scale(self.filename) pixbuf = self.get_file_image(self.filename, 5, 4)
pixbuf = self.get_file_image(self.filename, scale, scale)
if pixbuf is not None: if pixbuf is not None:
self.labels['thumbnail'].set_from_pixbuf(pixbuf) self.labels['thumbnail'].set_from_pixbuf(pixbuf)
def update_filename(self): def update_filename(self):
self.filename = self._printer.get_stat('print_stats', 'filename') self.filename = self._printer.get_stat('print_stats', 'filename')
self.update_text("file", os.path.splitext(self._printer.get_stat('print_stats', 'filename'))[0]) self.update_text("file", os.path.splitext(self.filename)[0])
self.filename_label = {
"complete": self.labels['file'].get_label(),
"current": self.labels['file'].get_label(),
"position": 0,
"limit": 24,
"length": len(self.labels['file'].get_label())
}
if self.animation_timeout is None:
# if self.labels['file'].is_ellipsized(): <- currently this doesn't work
if (self.filename_label['length'] - self.filename_label['limit']) > 0:
self.animation_timeout = GLib.timeout_add_seconds(1, self.animate_label)
self.update_percent_complete() self.update_percent_complete()
self.update_file_metadata() self.update_file_metadata()
def animate_label(self):
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']):
self.filename_label['position'] = 0
self.labels['file'].set_label(complete)
else:
self.labels['file'].set_label(current[pos:self.filename_label['length']])
self.filename_label['position'] += 1
return True
def update_file_metadata(self): def update_file_metadata(self):
if self._files.file_metadata_exists(self.filename): if self._files.file_metadata_exists(self.filename):
self.file_metadata = self._files.get_file_info(self.filename) self.file_metadata = self._files.get_file_info(self.filename)
logging.info("Update Metadata. File: %s Size: %s" % (self.filename, self.file_metadata['size'])) logging.info(f"Update Metadata. File: {self.filename} Size: {self.file_metadata['size']}")
if "estimated_time" in self.file_metadata and self.timeleft_type == "slicer": if "estimated_time" in self.file_metadata and self.timeleft_type == "slicer":
self.update_text("est_time", self.update_text("est_time", self.format_time(self.file_metadata['estimated_time']))
str(self._gtk.formatTimeString(self.file_metadata['estimated_time'])))
if "thumbnails" in self.file_metadata:
tmp = self.file_metadata['thumbnails'].copy()
for i in tmp:
i['data'] = ""
self.show_file_thumbnail() self.show_file_thumbnail()
if "object_height" in self.file_metadata: if "object_height" in self.file_metadata:
self.height = self.file_metadata['object_height'] self.oheight = float(self.file_metadata['object_height'])
self.labels['height'].set_label(str(self.height) + " mm") self.labels['height'].set_label(f"{self.oheight} mm")
if "layer_height" in self.file_metadata: if "layer_height" in self.file_metadata:
self.layer_h = self.file_metadata['layer_height'] self.layer_h = float(self.file_metadata['layer_height'])
if "first_layer_height" in self.file_metadata: if "first_layer_height" in self.file_metadata:
self.f_layer_h = self.file_metadata['first_layer_height'] self.f_layer_h = float(self.file_metadata['first_layer_height'])
else: else:
self.f_layer_h = layer_h self.f_layer_h = self.layer_h
self.labels['total_layers'].set_label(str(int((self.height - self.f_layer_h) / self.layer_h) + 1)) self.labels['total_layers'].set_label(f"{((self.oheight - self.f_layer_h) / self.layer_h) + 1:.0f}")
if "filament_total" in self.file_metadata: if "filament_total" in self.file_metadata:
filament_total = float(self.file_metadata['filament_total']) / 1000 self.labels['filament_total'].set_text(f"{float(self.file_metadata['filament_total']) / 1000:.1f} m")
self.labels['filament_total'].set_text("%.1f m" % filament_total)
else: else:
self.file_metadata = {} self.file_metadata = {}
logging.debug("Cannot find file metadata. Listening for updated metadata") logging.debug("Cannot find file metadata. Listening for updated metadata")
@@ -848,8 +884,8 @@ class JobStatusPanel(ScreenPanel):
if "gcode_start_byte" in self.file_metadata: if "gcode_start_byte" in self.file_metadata:
progress = (max(self._printer.get_stat('virtual_sdcard', 'file_position') - progress = (max(self._printer.get_stat('virtual_sdcard', 'file_position') -
self.file_metadata['gcode_start_byte'], 0) / (self.file_metadata['gcode_end_byte'] - self.file_metadata['gcode_start_byte'], 0) / (self.file_metadata['gcode_end_byte'] -
self.file_metadata['gcode_start_byte'])) self.file_metadata['gcode_start_byte']))
else: else:
progress = self._printer.get_stat('virtual_sdcard', 'progress') progress = self._printer.get_stat('virtual_sdcard', 'progress')
@@ -863,18 +899,17 @@ class JobStatusPanel(ScreenPanel):
self.labels[label].set_text(text) self.labels[label].set_text(text)
def update_progress(self): def update_progress(self):
if self.progress < 1: self.labels['progress_text'].set_text(f"{self.progress * 100:.0f}%")
self.labels['progress_text'].set_text("%s%%" % (str((int(self.progress*100)))))
else:
self.labels['progress_text'].set_text("100")
def update_message(self): def update_message(self):
msg = self._printer.get_stat("display_status", "message") msg = self._printer.get_stat("display_status", "message")
if type(msg) == str: if msg is None:
self.labels['lcdmessage'].set_text(msg) msg = " "
self.labels['lcdmessage'].set_text(f"{msg}")
def update_temp(self, x, temp, target): def update_temp(self, x, temp, target):
if target > 0: if x in self.labels and temp is not None:
self.labels[x].set_label("%3d/%3d°" % (temp, target)) if target is not None and target > 0:
else: self.labels[x].set_label(f"{int(temp):3}/{int(target):3}°")
self.labels[x].set_label("%3d°" % (temp)) else:
self.labels[x].set_label(f"{int(temp):3}°")
+67 -65
View File
@@ -2,86 +2,80 @@ import gi
import logging import logging
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
def create_panel(*args): def create_panel(*args):
return LimitsPanel(*args) return LimitsPanel(*args)
class LimitsPanel(ScreenPanel): class LimitsPanel(ScreenPanel):
values = {}
def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
self.limits = {}
self.grid = Gtk.Grid()
self.options = None
self.values = {}
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
self.devices = {}
scroll = Gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False) scroll.add(self.grid)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
# Create a grid for all devices
self.labels['devices'] = Gtk.Grid()
scroll.add(self.labels['devices'])
# Create a box to contain all of the above
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
box.pack_start(scroll, True, True, 0)
conf = self._printer.get_config_section("printer") conf = self._printer.get_config_section("printer")
self.options = [ self.options = [
{"name": _("Max Accelation"), "units": _("mm/s^2"), "option": "max_accel", {"name": _("Max Acceleration"), "units": _("mm/s²"), "option": "max_accel",
"value": self.stn(conf['max_accel'])}, "max": int(float(conf['max_accel']))},
{"name": _("Max Acceleration to Deceleration"), "units": _("mm/s^2"), "option": "max_accel_to_decel", {"name": _("Max Acceleration to Deceleration"), "units": _("mm/s²"), "option": "max_accel_to_decel",
"value": self.stn(conf['max_accel_to_decel']) if "max_accel_to_decel" in conf else "max": int(float(conf['max_accel_to_decel'])) if "max_accel_to_decel" in conf
round(self.stn(conf['max_accel'])/2)}, else int(float(conf['max_accel']) / 2)},
{"name": _("Max Velocity"), "units": _("mm/s"), "option": "max_velocity", {"name": _("Max Velocity"), "units": _("mm/s"), "option": "max_velocity",
"value": self.stn(conf["max_velocity"])}, "max": int(float(conf["max_velocity"]))},
{"name": _("Square Corner Velocity"), "units": _("mm/s"), "option": "square_corner_velocity", {"name": _("Square Corner Velocity"), "units": _("mm/s"), "option": "square_corner_velocity",
"value": self.stn(conf['square_corner_velocity']) if "square_corner_velocity" in conf else 5} "max": int(float(conf['square_corner_velocity'])) if "square_corner_velocity" in conf
else 5}
] ]
for opt in self.options: for opt in self.options:
self.add_option(opt['option'], opt['name'], opt['units'], opt['value']) self.add_option(opt['option'], opt['name'], opt['units'], opt['max'])
self.content.add(box) self.content.add(scroll)
self.content.show_all() self.content.show_all()
def stn(self, str):
return int(float(str))
def process_update(self, action, data): def process_update(self, action, data):
if (action != "notify_status_update"): if action != "notify_status_update":
return return
for opt in self.devices: for opt in self.limits:
if "toolhead" in data and opt in data["toolhead"]: if "toolhead" in data and opt in data["toolhead"]:
self.update_option(opt, data["toolhead"][opt]) self.update_option(opt, data["toolhead"][opt])
def update_option(self, option, value): def update_option(self, option, value):
if option not in self.devices: if option not in self.limits:
return return
if self.devices[option]['scale'].has_grab(): if self.limits[option]['scale'].has_grab():
return return
self.values[option] = int(value) self.values[option] = int(value)
self.devices[option]['scale'].disconnect_by_func(self.set_opt_value) self.limits[option]['scale'].disconnect_by_func(self.set_opt_value)
self.devices[option]['scale'].set_value(self.values[option]) self.limits[option]['scale'].set_value(self.values[option])
self.devices[option]['scale'].connect("button-release-event", self.set_opt_value, option) for opt in self.options:
if opt["option"] == option:
if self.values[option] > opt["max"]:
self.limits[option]['scale'].get_style_context().add_class("option_slider_max")
else:
self.limits[option]['scale'].get_style_context().remove_class("option_slider_max")
self.limits[option]['scale'].connect("button-release-event", self.set_opt_value, option)
def add_option(self, option, optname, units, value): def add_option(self, option, optname, units, value):
logging.info("Adding option: %s" % option) logging.info(f"Adding option: {option}")
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
name = Gtk.Label() name = Gtk.Label()
name.set_markup("<big><b>%s</b></big> (%s)" % (optname, units)) name.set_markup(f"<big><b>{optname}</b></big> ({units})")
name.set_hexpand(True) name.set_hexpand(True)
name.set_vexpand(True) name.set_vexpand(True)
name.set_halign(Gtk.Align.START) name.set_halign(Gtk.Align.START)
@@ -89,46 +83,54 @@ 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)
adj = Gtk.Adjustment(0, 0, value, 1, 5, 0) scale = Gtk.Scale.new_with_range(orientation=Gtk.Orientation.HORIZONTAL, min=0, max=value * 1.5, step=1)
self.values[option] = value scale.set_value(value)
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj)
scale.set_value(self.values[option])
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)
scale.get_style_context().add_class("option_slider") scale.get_style_context().add_class("option_slider")
scale.connect("button-release-event", self.set_opt_value, option) scale.connect("button-release-event", self.set_opt_value, option)
self.values[option] = value
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) reset = self._gtk.ButtonImage("refresh", None, "color1")
labels.add(name) reset.connect("clicked", self.reset_value, option)
labels.add(scale) reset.set_hexpand(False)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5) item = Gtk.Grid()
dev.set_hexpand(True) item.attach(name, 0, 0, 2, 1)
dev.set_vexpand(False) item.attach(scale, 0, 1, 1, 1)
dev.add(labels) item.attach(reset, 1, 1, 1, 1)
frame.add(dev)
self.devices[option] = { frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
frame.add(item)
self.limits[option] = {
"row": frame, "row": frame,
"scale": scale, "scale": scale,
} }
devices = sorted(self.devices) limits = sorted(self.limits)
pos = devices.index(option) pos = limits.index(option)
self.labels['devices'].insert_row(pos) self.grid.insert_row(pos)
self.labels['devices'].attach(self.devices[option]['row'], 0, pos, 1, 1) self.grid.attach(self.limits[option]['row'], 0, pos, 1, 1)
self.labels['devices'].show_all() self.grid.show_all()
def reset_value(self, widget, option):
for x in self.options:
if x["option"] == option:
self.update_option(option, x["max"])
self.set_opt_value(None, None, option)
def set_opt_value(self, widget, event, opt): def set_opt_value(self, widget, event, opt):
value = self.devices[opt]['scale'].get_value() value = self.limits[opt]['scale'].get_value()
if opt == "max_accel": if opt == "max_accel":
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT ACCEL=%s" % (value)) self._screen._ws.klippy.gcode_script(f"SET_VELOCITY_LIMIT ACCEL={value}")
elif opt == "max_accel_to_decel": elif opt == "max_accel_to_decel":
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT ACCEL_TO_DECEL=%s" % (value)) self._screen._ws.klippy.gcode_script(f"SET_VELOCITY_LIMIT ACCEL_TO_DECEL={value}")
elif opt == "max_velocity": elif opt == "max_velocity":
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT VELOCITY=%s" % (value)) self._screen._ws.klippy.gcode_script(f"SET_VELOCITY_LIMIT VELOCITY={value}")
elif opt == "square_corner_velocity": elif opt == "square_corner_velocity":
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=%s" % (value)) self._screen._ws.klippy.gcode_script(f"SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY={value}")
+65 -121
View File
@@ -2,166 +2,130 @@ import gi
import logging import logging
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango from gi.repository import Gtk, GLib, Pango
from panels.menu import MenuPanel from panels.menu import MenuPanel
from ks_includes.widgets.graph import HeaterGraph from ks_includes.widgets.graph import HeaterGraph
from ks_includes.widgets.keypad import Keypad from ks_includes.widgets.keypad import Keypad
def create_panel(*args): def create_panel(*args):
return MainPanel(*args) return MainPanel(*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.popover_device = 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
def initialize(self, panel_name, items, extrudercount): def initialize(self, panel_name, items, extrudercount):
print("### Making MainMenu") logging.info("### Making MainMenu")
grid = self._gtk.HomogeneousGrid()
grid.set_hexpand(True)
grid.set_vexpand(True)
self.items = items self.items = items
self.create_menu_items() self.create_menu_items()
self._gtk.reset_temp_color() stats = self._printer.get_printer_status_data()["printer"]
grid = self._gtk.HomogeneousGrid()
self.grid = Gtk.Grid() if stats["temperature_devices"]["count"] > 0 or stats["extruders"]["count"] > 0:
self.grid.set_row_homogeneous(True) self._gtk.reset_temp_color()
self.grid.set_column_homogeneous(True) grid.attach(self.create_left_panel(), 0, 0, 1, 1)
else:
leftpanel = self.create_left_panel() self.graph_update = False
grid.attach(leftpanel, 0, 0, 1, 1)
if self._screen.vertical_mode: if self._screen.vertical_mode:
self.labels['menu'] = self.arrangeMenuItems(items, 3, True) self.labels['menu'] = self.arrangeMenuItems(items, 3, True)
grid.attach(self.labels['menu'], 0, 1, 1, 1) grid.attach(self.labels['menu'], 0, 1, 1, 1)
else: else:
self.labels['menu'] = self.arrangeMenuItems(items, 2, True) self.labels['menu'] = self.arrangeMenuItems(items, 2, True)
grid.attach(self.labels['menu'], 1, 0, 1, 1) grid.attach(self.labels['menu'], 1, 0, 1, 1)
self.grid = grid self.grid = grid
self.content.add(self.grid) self.content.add(self.grid)
self.layout.show_all() self.layout.show_all()
def activate(self): def activate(self):
# For this case False != None
if self.graph_update is None: if self.graph_update is None:
# 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)
return return
def deactivate(self): def deactivate(self):
if self.graph_update is not None: if self.graph_update:
GLib.source_remove(self.graph_update) GLib.source_remove(self.graph_update)
self.graph_update = None self.graph_update = None
def add_device(self, device): def add_device(self, device):
_ = self.lang.gettext
logging.info("Adding device: %s" % device) logging.info(f"Adding device: {device}")
temperature = self._printer.get_dev_stat(device, "temperature") temperature = self._printer.get_dev_stat(device, "temperature")
if temperature is None: if temperature is None:
return False return False
if not (device.startswith("extruder") or device.startswith("heater_bed")): devname = device.split()[1] if len(device.split()) > 1 else device
devname = " ".join(device.split(" ")[1:]) # Support for hiding devices by name
# Support for hiding devices by name if devname.startswith("_"):
if devname.startswith("_"): return False
return False
else:
devname = device
if device.startswith("extruder"): if device.startswith("extruder"):
i = 0 i = sum(d.startswith('extruder') for d in self.devices)
for d in self.devices: image = f"extruder-{i}" if self._printer.extrudercount > 1 else "extruder"
if d.startswith('extruder'): class_name = f"graph_label_{device}"
i += 1 dev_type = "extruder"
if self._printer.extrudercount > 1:
image = "extruder-%s" % i
else:
image = "extruder"
class_name = "graph_label_%s" % device
type = "extruder"
elif device == "heater_bed": elif device == "heater_bed":
image = "bed" image = "bed"
devname = "Heater Bed" devname = "Heater Bed"
class_name = "graph_label_heater_bed" class_name = "graph_label_heater_bed"
type = "bed" dev_type = "bed"
elif device.startswith("heater_generic"): elif device.startswith("heater_generic"):
self.h = 1 self.h = sum("heater_generic" in d for d in self.devices)
for d in self.devices:
if "heater_generic" in d:
self.h += 1
image = "heater" image = "heater"
class_name = "graph_label_sensor_%s" % self.h class_name = f"graph_label_sensor_{self.h}"
type = "sensor" dev_type = "sensor"
elif device.startswith("temperature_fan"): elif device.startswith("temperature_fan"):
f = 1 f = 1 + sum("temperature_fan" in d for d in self.devices)
for d in self.devices:
if "temperature_fan" in d:
f += 1
image = "fan" image = "fan"
class_name = "graph_label_fan_%s" % f class_name = f"graph_label_fan_{f}"
type = "fan" dev_type = "fan"
elif self._config.get_main_config_option('only_heaters') == "True": elif self._config.get_main_config().getboolean("only_heaters", False):
return False return False
else: else:
s = 1 self.h += sum("sensor" in d for d in self.devices)
try:
s += self.h
except Exception:
pass
for d in self.devices:
if "sensor" in d:
s += 1
image = "heat-up" image = "heat-up"
class_name = "graph_label_sensor_%s" % s class_name = f"graph_label_sensor_{self.h}"
type = "sensor" dev_type = "sensor"
rgb, color = self._gtk.get_temp_color(type) rgb = self._gtk.get_temp_color(dev_type)
can_target = self._printer.get_temp_store_device_has_target(device) can_target = self._printer.get_temp_store_device_has_target(device)
self.labels['da'].add_object(device, "temperatures", rgb, False, True) self.labels['da'].add_object(device, "temperatures", rgb, False, True)
if can_target: if can_target:
self.labels['da'].add_object(device, "targets", rgb, True, False) self.labels['da'].add_object(device, "targets", rgb, True, False)
text = "<span underline='double' underline_color='#%s'>%s</span>" % (color, devname.capitalize())
name = self._gtk.ButtonImage(image, devname.capitalize().replace("_", " "), name = self._gtk.ButtonImage(image, devname.capitalize().replace("_", " "),
None, .5, Gtk.PositionType.LEFT, False) None, .5, Gtk.PositionType.LEFT, False)
name.connect('clicked', self.on_popover_clicked, device) name.connect('clicked', self.on_popover_clicked, device)
name.set_alignment(0, .5) name.set_alignment(0, .5)
name.get_style_context().add_class(class_name) name.get_style_context().add_class(class_name)
child = name.get_children()[0].get_children()[0].get_children()[1] child = name.get_children()[0].get_children()[0].get_children()[1]
child.set_ellipsize(True)
child.set_ellipsize(Pango.EllipsizeMode.END) child.set_ellipsize(Pango.EllipsizeMode.END)
temp = self._gtk.Button("") temp = self._gtk.Button("")
temp.connect('clicked', self.on_popover_clicked, device) temp.connect('clicked', self.on_popover_clicked, device)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev.add(labels)
self.devices[device] = { self.devices[device] = {
"class": class_name, "class": class_name,
"type": type,
"name": name, "name": name,
"temp": temp, "temp": temp,
"can_target": can_target "can_target": can_target
} }
if self.devices[device]["can_target"]:
temp.get_child().set_label("%.1f %s" %
(temperature, self.format_target(self._printer.get_dev_stat(device, "target"))))
else:
temp.get_child().set_label("%.1f " % temperature)
devices = sorted(self.devices) devices = sorted(self.devices)
pos = devices.index(device) + 1 pos = devices.index(device) + 1
@@ -172,29 +136,28 @@ class MainPanel(MenuPanel):
return True return True
def change_target_temp(self, temp): def change_target_temp(self, temp):
_ = self.lang.gettext
MAX_TEMP = int(float(self._printer.get_config_section(self.active_heater)['max_temp'])) max_temp = int(float(self._printer.get_config_section(self.active_heater)['max_temp']))
if temp > MAX_TEMP: if temp > max_temp:
self._screen.show_popup_message(_("Can't set above the maximum:") + (" %s" % MAX_TEMP)) self._screen.show_popup_message(_("Can't set above the maximum:") + f' {max_temp}')
return return
temp = 0 if temp < 0 else temp temp = max(temp, 0)
name = self.active_heater.split()[1] if len(self.active_heater.split()) > 1 else self.active_heater
if self.active_heater.startswith('extruder'): if self.active_heater.startswith('extruder'):
self._screen._ws.klippy.set_tool_temp(self._printer.get_tool_number(self.active_heater), temp) self._screen._ws.klippy.set_tool_temp(self._printer.get_tool_number(self.active_heater), temp)
elif self.active_heater == "heater_bed": elif self.active_heater == "heater_bed":
self._screen._ws.klippy.set_bed_temp(temp) self._screen._ws.klippy.set_bed_temp(temp)
elif self.active_heater.startswith('heater_generic '): elif self.active_heater.startswith('heater_generic '):
self._screen._ws.klippy.set_heater_temp(" ".join(self.active_heater.split(" ")[1:]), temp) self._screen._ws.klippy.set_heater_temp(name, temp)
elif self.active_heater.startswith('temperature_fan '): elif self.active_heater.startswith('temperature_fan '):
self._screen._ws.klippy.set_temp_fan_temp(" ".join(self.active_heater.split(" ")[1:]), temp) self._screen._ws.klippy.set_temp_fan_temp(name, temp)
else: else:
logging.info("Unknown heater: %s" % self.active_heater) logging.info(f"Unknown heater: {self.active_heater}")
self._screen.show_popup_message(_("Unknown Heater") + " " + self.active_heater) self._screen.show_popup_message(_("Unknown Heater") + " " + self.active_heater)
self._printer.set_dev_stat(self.active_heater, "target", temp) self._printer.set_dev_stat(self.active_heater, "target", temp)
def create_left_panel(self): def create_left_panel(self):
_ = self.lang.gettext
self.labels['devices'] = Gtk.Grid() self.labels['devices'] = Gtk.Grid()
self.labels['devices'].get_style_context().add_class('heater-grid') self.labels['devices'].get_style_context().add_class('heater-grid')
@@ -202,30 +165,22 @@ class MainPanel(MenuPanel):
name = Gtk.Label("") name = Gtk.Label("")
temp = Gtk.Label(_("Temp (°C)")) temp = Gtk.Label(_("Temp (°C)"))
temp.set_size_request(round(self._gtk.get_font_size() * 7.7), 0) temp.set_size_request(round(self._gtk.get_font_size() * 7.7), -1)
self.labels['devices'].attach(name, 0, 0, 1, 1) self.labels['devices'].attach(name, 0, 0, 1, 1)
self.labels['devices'].attach(temp, 1, 0, 1, 1) self.labels['devices'].attach(temp, 1, 0, 1, 1)
da = HeaterGraph(self._printer, self._gtk.get_font_size()) self.labels['da'] = HeaterGraph(self._printer, self._gtk.get_font_size())
da.set_vexpand(True) self.labels['da'].set_vexpand(True)
self.labels['da'] = da
scroll = Gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC) scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.add(self.labels['devices']) scroll.add(self.labels['devices'])
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0) box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
box.add(scroll) box.add(scroll)
box.add(self.labels['da']) box.add(self.labels['da'])
self.labels['graph_settemp'] = self._gtk.Button(label=_("Set Temp")) self.labels['graph_settemp'] = self._gtk.Button(label=_("Set Temp"))
self.labels['graph_settemp'].connect("clicked", self.show_numpad) self.labels['graph_settemp'].connect("clicked", self.show_numpad)
self.labels['graph_hide'] = self._gtk.Button(label=_("Hide")) self.labels['graph_hide'] = self._gtk.Button(label=_("Hide"))
@@ -234,25 +189,18 @@ class MainPanel(MenuPanel):
self.labels['graph_show'].connect("clicked", self.graph_show_device) self.labels['graph_show'].connect("clicked", self.graph_show_device)
popover = Gtk.Popover() popover = Gtk.Popover()
self.labels['popover_vbox'] = Gtk.VBox() self.labels['popover_vbox'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
popover.add(self.labels['popover_vbox']) popover.add(self.labels['popover_vbox'])
popover.set_position(Gtk.PositionType.BOTTOM) popover.set_position(Gtk.PositionType.BOTTOM)
self.labels['popover'] = popover self.labels['popover'] = popover
i = 2
for d in self._printer.get_temp_store_devices(): for d in self._printer.get_temp_store_devices():
if self.add_device(d): self.add_device(d)
i += 1
if self._screen.vertical_mode:
aux = 1.38
else:
aux = 1
graph_height = max(0, self._screen.height / aux - (i * 5 * self._gtk.get_font_size()))
self.labels['da'].set_size_request(0, graph_height)
return box return box
def graph_show_device(self, widget, show=True): def graph_show_device(self, widget, show=True):
logging.info("Graph show: %s %s" % (self.popover_device, show)) logging.info(f"Graph show: {self.popover_device} {show}")
self.labels['da'].set_showing(self.popover_device, show) self.labels['da'].set_showing(self.popover_device, show)
if show: if show:
self.devices[self.popover_device]['name'].get_style_context().remove_class("graph_label_hidden") self.devices[self.popover_device]['name'].get_style_context().remove_class("graph_label_hidden")
@@ -267,7 +215,7 @@ class MainPanel(MenuPanel):
self.labels['popover'].show_all() self.labels['popover'].show_all()
def hide_numpad(self, widget): def hide_numpad(self, widget):
self.devices[self.active_heater]['name'].get_style_context().remove_class("active_device") self.devices[self.active_heater]['name'].get_style_context().remove_class("button_active")
self.active_heater = None self.active_heater = None
if self._screen.vertical_mode: if self._screen.vertical_mode:
@@ -292,12 +240,10 @@ class MainPanel(MenuPanel):
if self.labels['da'].is_showing(self.popover_device): if self.labels['da'].is_showing(self.popover_device):
pobox.pack_start(self.labels['graph_hide'], True, True, 5) pobox.pack_start(self.labels['graph_hide'], True, True, 5)
if self.devices[self.popover_device]['type'] != "sensor":
pobox.pack_start(self.labels['graph_settemp'], True, True, 5)
else: else:
pobox.pack_start(self.labels['graph_show'], True, True, 5) pobox.pack_start(self.labels['graph_show'], True, True, 5)
if self.devices[self.popover_device]['type'] != "sensor": if self.devices[self.popover_device]["can_target"]:
pobox.pack_start(self.labels['graph_settemp'], True, True, 5) pobox.pack_start(self.labels['graph_settemp'], True, True, 5)
def process_update(self, action, data): def process_update(self, action, data):
if action != "notify_status_update": if action != "notify_status_update":
@@ -318,12 +264,11 @@ class MainPanel(MenuPanel):
return return
def show_numpad(self, widget): def show_numpad(self, widget):
_ = self.lang.gettext
if self.active_heater is not None: if self.active_heater is not None:
self.devices[self.active_heater]['name'].get_style_context().remove_class("active_device") self.devices[self.active_heater]['name'].get_style_context().remove_class("button_active")
self.active_heater = self.popover_device self.active_heater = self.popover_device
self.devices[self.active_heater]['name'].get_style_context().add_class("active_device") self.devices[self.active_heater]['name'].get_style_context().add_class("button_active")
if "keypad" not in self.labels: if "keypad" not in self.labels:
self.labels["keypad"] = Keypad(self._screen, self.change_target_temp, self.hide_numpad) self.labels["keypad"] = Keypad(self._screen, self.change_target_temp, self.hide_numpad)
@@ -346,8 +291,7 @@ class MainPanel(MenuPanel):
def update_temp(self, device, temp, target): def update_temp(self, device, temp, target):
if device not in self.devices: if device not in self.devices:
return return
if self.devices[device]["can_target"] and target > 0:
if self.devices[device]["can_target"]: self.devices[device]["temp"].get_child().set_label(f"{temp:.1f} / {target:.0f}")
self.devices[device]["temp"].get_child().set_label("%.1f %s" % (temp, self.format_target(target)))
else: else:
self.devices[device]["temp"].get_child().set_label("%.1f " % temp) self.devices[device]["temp"].get_child().set_label(f"{temp:.1f}")
+20 -20
View File
@@ -7,32 +7,30 @@ from jinja2 import Environment, Template
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
def create_panel(*args): def create_panel(*args):
return MenuPanel(*args) return MenuPanel(*args)
class MenuPanel(ScreenPanel): class MenuPanel(ScreenPanel):
i = 0 i = 0
j2_data = None j2_data = None
def initialize(self, panel_name, display_name, items): def initialize(self, panel_name, display_name, items):
_ = self.lang.gettext
self.items = items self.items = items
self.create_menu_items() self.create_menu_items()
self.grid = self._gtk.HomogeneousGrid() self.grid = self._gtk.HomogeneousGrid()
scroll = Gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
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(self.grid) scroll.add(self.grid)
self.content.add(scroll) self.content.add(scroll)
def activate(self): def activate(self):
if not self.j2_data: self.j2_data = self._printer.get_printer_status_data()
self.j2_data = self._printer.get_printer_status_data()
self.j2_data.update({ self.j2_data.update({
'moonraker_connected': self._screen._ws.is_connected() 'moonraker_connected': self._screen._ws.is_connected()
}) })
@@ -41,7 +39,7 @@ class MenuPanel(ScreenPanel):
else: else:
self.arrangeMenuItems(self.items, 4) self.arrangeMenuItems(self.items, 4)
def arrangeMenuItems(self, items, columns, expandLast=False): def arrangeMenuItems(self, items, columns, expand_last=False):
for child in self.grid.get_children(): for child in self.grid.get_children():
self.grid.remove(child) self.grid.remove(child)
@@ -49,7 +47,7 @@ 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("Evaluating item: %s" % key) logging.debug(f"Evaluating item: {key}")
if not self.evaluate_enable(item[key]['enable']): if not self.evaluate_enable(item[key]['enable']):
continue continue
@@ -57,15 +55,15 @@ class MenuPanel(ScreenPanel):
if length <= 4: if length <= 4:
# Arrange 2 x 2 # Arrange 2 x 2
columns = 2 columns = 2
elif length > 4 and length <= 6: elif 4 < length <= 6:
# Arrange 3 x 2 # Arrange 3 x 2
columns = 3 columns = 3
col = i % columns col = i % columns
row = int(i/columns) row = int(i / columns)
width = height = 1 width = height = 1
if expandLast is True and i+1 == length and length % 2 == 1: if expand_last is True and i + 1 == length and length % 2 == 1:
width = 2 width = 2
self.grid.attach(self.labels[key], col, row, width, height) self.grid.attach(self.labels[key], col, row, width, height)
@@ -78,13 +76,13 @@ class MenuPanel(ScreenPanel):
key = list(self.items[i])[0] key = list(self.items[i])[0]
item = self.items[i][key] item = self.items[i][key]
env = Environment(extensions=["jinja2.ext.i18n"]) env = Environment(extensions=["jinja2.ext.i18n"], autoescape=True)
env.install_gettext_translations(self.lang) env.install_gettext_translations(self.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( b = self._gtk.ButtonImage(
item['icon'], parsed_name, "color"+str((i % 4)+1) item['icon'], parsed_name, f"color{(i % 4) + 1}"
) )
if item['panel'] is not False: if item['panel'] is not False:
b.connect("clicked", self.menu_item_clicked, item['panel'], item) b.connect("clicked", self.menu_item_clicked, item['panel'], item)
@@ -104,16 +102,18 @@ class MenuPanel(ScreenPanel):
if enable is False: if enable is False:
return False return False
if not self.j2_data: if enable == "{{ moonraker_connected }}":
self.j2_data = self._printer.get_printer_status_data() logging.info("moonraker is_connected %s", self._screen._ws.is_connected())
return self._screen._ws.is_connected()
self.j2_data = self._printer.get_printer_status_data()
try: try:
logging.debug("Template: '%s'" % enable) logging.debug(f"Template: '{enable}'")
logging.debug("Data: %s" % self.j2_data) j2_temp = Template(enable, autoescape=True)
j2_temp = Template(enable)
result = j2_temp.render(self.j2_data) result = j2_temp.render(self.j2_data)
if result == 'True': if result == 'True':
return True return True
return False return False
except Exception: except Exception:
logging.debug("Error evaluating enable statement: %s", enable) logging.debug(f"Error evaluating enable statement: {enable}")
return False return False
+134 -48
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 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
@@ -11,17 +11,21 @@ AXIS_X = "X"
AXIS_Y = "Y" AXIS_Y = "Y"
AXIS_Z = "Z" 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 distance = 1
distances = ['.1', '.5', '1', '5', '10', '25', '50'] distances = ['.1', '.5', '1', '5', '10', '25', '50']
def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
self.settings = {}
self.menu = ['move_menu']
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
grid = self._gtk.HomogeneousGrid() grid = self._gtk.HomogeneousGrid()
self.labels['x+'] = self._gtk.ButtonImage("arrow-right", _("X+"), "color1") self.labels['x+'] = self._gtk.ButtonImage("arrow-right", _("X+"), "color1")
@@ -89,49 +93,78 @@ class MovePanel(ScreenPanel):
grid.attach(self.labels['z_tilt'], 2, 0, 1, 1) grid.attach(self.labels['z_tilt'], 2, 0, 1, 1)
elif self._printer.config_section_exists("quad_gantry_level"): elif self._printer.config_section_exists("quad_gantry_level"):
grid.attach(self.labels['quad_gantry_level'], 2, 0, 1, 1) grid.attach(self.labels['quad_gantry_level'], 2, 0, 1, 1)
elif "delta" in self._screen.printer.get_config_section("printer")['kinematics']:
grid.attach(self.labels['motors-off'], 2, 0, 1, 1)
else: else:
if "delta" in self._screen.printer.get_config_section("printer")['kinematics']: grid.attach(self.labels['home-xy'], 2, 0, 1, 1)
grid.attach(self.labels['motors-off'], 2, 0, 1, 1)
else:
grid.attach(self.labels['home-xy'], 2, 0, 1, 1)
distgrid = Gtk.Grid() distgrid = Gtk.Grid()
j = 0 for j, i in enumerate(self.distances):
for i in self.distances:
self.labels[i] = self._gtk.ToggleButton(i) self.labels[i] = self._gtk.ToggleButton(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()
if (self._screen.lang_ltr and j == 0) or (not self._screen.lang_ltr and j == len(self.distances)-1): if (self._screen.lang_ltr and j == 0) or (not self._screen.lang_ltr and j == len(self.distances) - 1):
ctx.add_class("distbutton_top") ctx.add_class("distbutton_top")
elif (not self._screen.lang_ltr and j == 0) or (self._screen.lang_ltr and j == len(self.distances)-1): elif (not self._screen.lang_ltr and j == 0) or (self._screen.lang_ltr and j == len(self.distances) - 1):
ctx.add_class("distbutton_bottom") ctx.add_class("distbutton_bottom")
else: else:
ctx.add_class("distbutton") ctx.add_class("distbutton")
if i == "1": if i == "1":
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)
j += 1
self.labels["1"].set_active(True) self.labels["1"].set_active(True)
bottomgrid = self._gtk.HomogeneousGrid()
bottomgrid.set_direction(Gtk.TextDirection.LTR)
self.labels['pos_x'] = Gtk.Label("X: 0") self.labels['pos_x'] = Gtk.Label("X: 0")
self.labels['pos_y'] = Gtk.Label("Y: 0") self.labels['pos_y'] = Gtk.Label("Y: 0")
self.labels['pos_z'] = Gtk.Label("Z: 0") self.labels['pos_z'] = Gtk.Label("Z: 0")
adjust = self._gtk.ButtonImage("settings", None, "color2", 1, Gtk.PositionType.LEFT, False)
adjust.connect("clicked", self.load_menu, 'options')
adjust.set_hexpand(False)
self.labels['move_dist'] = Gtk.Label(_("Move Distance (mm)"))
bottomgrid = self._gtk.HomogeneousGrid()
bottomgrid.set_direction(Gtk.TextDirection.LTR)
bottomgrid.attach(self.labels['pos_x'], 0, 0, 1, 1) bottomgrid.attach(self.labels['pos_x'], 0, 0, 1, 1)
bottomgrid.attach(self.labels['pos_y'], 1, 0, 1, 1) bottomgrid.attach(self.labels['pos_y'], 1, 0, 1, 1)
bottomgrid.attach(self.labels['pos_z'], 2, 0, 1, 1) bottomgrid.attach(self.labels['pos_z'], 2, 0, 1, 1)
self.labels['move_dist'] = Gtk.Label(_("Move Distance (mm)")) bottomgrid.attach(self.labels['move_dist'], 0, 1, 3, 1)
bottomgrid.attach(adjust, 3, 0, 1, 2)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) self.labels['move_menu'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.pack_start(grid, True, True, 0) self.labels['move_menu'].set_vexpand(True)
box.pack_start(bottomgrid, True, True, 0) self.labels['move_menu'].pack_start(grid, True, True, 0)
box.pack_start(self.labels['move_dist'], True, True, 0) self.labels['move_menu'].pack_start(bottomgrid, True, True, 0)
box.pack_start(distgrid, True, True, 0) self.labels['move_menu'].pack_start(distgrid, True, True, 0)
self.content.add(box) self.content.add(self.labels['move_menu'])
printer_cfg = self._printer.get_config_section("printer")
# The max_velocity parameter is not optional in klipper config.
max_velocity = int(float(printer_cfg["max_velocity"]))
if "max_z_velocity" in printer_cfg:
max_z_velocity = int(float(printer_cfg["max_z_velocity"]))
else:
max_z_velocity = max_velocity
configurable_options = [
{"invert_x": {"section": "main", "name": _("Invert X"), "type": "binary", "value": "False"}},
{"invert_y": {"section": "main", "name": _("Invert Y"), "type": "binary", "value": "False"}},
{"invert_z": {"section": "main", "name": _("Invert Z"), "type": "binary", "value": "False"}},
{"move_speed_xy": {
"section": "main", "name": _("XY Speed (mm/s)"), "type": "scale", "value": "50",
"range": [1, max_velocity], "step": 1}},
{"move_speed_z": {
"section": "main", "name": _("Z Speed (mm/s)"), "type": "scale", "value": "10",
"range": [1, max_z_velocity], "step": 1}}
]
self.labels['options_menu'] = self._gtk.ScrolledWindow()
self.labels['options'] = Gtk.Grid()
self.labels['options_menu'].add(self.labels['options'])
for option in configurable_options:
name = list(option)[0]
self.add_option('options', self.settings, name, option[name])
def process_update(self, action, data): def process_update(self, action, data):
if action != "notify_status_update": if action != "notify_status_update":
@@ -140,32 +173,32 @@ class MovePanel(ScreenPanel):
homed_axes = self._screen.printer.get_stat("toolhead", "homed_axes") homed_axes = self._screen.printer.get_stat("toolhead", "homed_axes")
if homed_axes == "xyz": if homed_axes == "xyz":
if "gcode_move" in data and "gcode_position" in data["gcode_move"]: if "gcode_move" in data and "gcode_position" in data["gcode_move"]:
self.labels['pos_x'].set_text("X: %.2f" % (data["gcode_move"]["gcode_position"][0])) self.labels['pos_x'].set_text(f"X: {data['gcode_move']['gcode_position'][0]:.2f}")
self.labels['pos_y'].set_text("Y: %.2f" % (data["gcode_move"]["gcode_position"][1])) self.labels['pos_y'].set_text(f"Y: {data['gcode_move']['gcode_position'][1]:.2f}")
self.labels['pos_z'].set_text("Z: %.2f" % (data["gcode_move"]["gcode_position"][2])) self.labels['pos_z'].set_text(f"Z: {data['gcode_move']['gcode_position'][2]:.2f}")
else: else:
if "x" in homed_axes: if "x" in homed_axes:
if "gcode_move" in data and "gcode_position" in data["gcode_move"]: if "gcode_move" in data and "gcode_position" in data["gcode_move"]:
self.labels['pos_x'].set_text("X: %.2f" % (data["gcode_move"]["gcode_position"][0])) self.labels['pos_x'].set_text(f"X: {data['gcode_move']['gcode_position'][0]:.2f}")
else: else:
self.labels['pos_x'].set_text("X: ?") self.labels['pos_x'].set_text("X: ?")
if "y" in homed_axes: if "y" in homed_axes:
if "gcode_move" in data and "gcode_position" in data["gcode_move"]: if "gcode_move" in data and "gcode_position" in data["gcode_move"]:
self.labels['pos_y'].set_text("Y: %.2f" % (data["gcode_move"]["gcode_position"][1])) self.labels['pos_y'].set_text(f"Y: {data['gcode_move']['gcode_position'][1]:.2f}")
else: else:
self.labels['pos_y'].set_text("Y: ?") self.labels['pos_y'].set_text("Y: ?")
if "z" in homed_axes: if "z" in homed_axes:
if "gcode_move" in data and "gcode_position" in data["gcode_move"]: if "gcode_move" in data and "gcode_position" in data["gcode_move"]:
self.labels['pos_z'].set_text("Z: %.2f" % (data["gcode_move"]["gcode_position"][2])) self.labels['pos_z'].set_text(f"Z: {data['gcode_move']['gcode_position'][2]:.2f}")
else: else:
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: if self.distance == distance:
return return
logging.info("### Distance " + str(distance)) logging.info(f"### Distance {distance}")
ctx = self.labels[str(self.distance)].get_style_context() ctx = self.labels[f"{self.distance}"].get_style_context()
ctx.remove_class("distbutton_active") ctx.remove_class("distbutton_active")
self.distance = distance self.distance = distance
@@ -174,29 +207,82 @@ class MovePanel(ScreenPanel):
for i in self.distances: for i in self.distances:
if i == self.distance: if i == self.distance:
continue continue
self.labels[str(i)].set_active(False) self.labels[f"{i}"].set_active(False)
def move(self, widget, axis, dir): def move(self, widget, axis, direction):
if self._config.get_config()['main'].getboolean("invert_%s" % axis.lower(), False): if self._config.get_config()['main'].getboolean(f"invert_{axis.lower()}", False):
dir = "-" if dir == "+" else "+" direction = "-" if direction == "+" else "+"
dist = str(self.distance) if dir == "+" else "-" + str(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 == AXIS_Z else "move_speed_xy"
speed = None speed = self._config.get_printer_config(self._screen.connected_printer).getint(config_key, None)
printer_cfg = self._config.get_printer_config(self._screen.connected_printer)
if printer_cfg is not 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 = max(1, speed) speed = 60 * max(1, speed)
self._screen._ws.klippy.gcode_script( self._screen._ws.klippy.gcode_script(f"{KlippyGcodes.MOVE_RELATIVE}\n{KlippyGcodes.MOVE} {axis}{dist} F{speed}")
"%s\n%s %s%s F%s%s" % ( if self._printer.get_stat("gcode_move", "absolute_coordinates"):
KlippyGcodes.MOVE_RELATIVE, KlippyGcodes.MOVE, axis, dist, speed*60, self._screen._ws.klippy.gcode_script("G90")
"\nG90" if self._printer.get_stat("gcode_move", "absolute_coordinates") is True else ""
) def add_option(self, boxname, opt_array, opt_name, option):
) name = Gtk.Label()
name.set_markup(f"<big><b>{option['name']}</b></big>")
name.set_hexpand(True)
name.set_vexpand(True)
name.set_halign(Gtk.Align.START)
name.set_valign(Gtk.Align.CENTER)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev.set_valign(Gtk.Align.CENTER)
dev.add(name)
if option['type'] == "binary":
box = Gtk.Box()
box.set_vexpand(False)
switch = Gtk.Switch()
switch.set_hexpand(False)
switch.set_vexpand(False)
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name))
switch.connect("notify::active", self.switch_config_option, option['section'], opt_name)
switch.set_property("width-request", round(self._gtk.get_font_size() * 7))
switch.set_property("height-request", round(self._gtk.get_font_size() * 3.5))
box.add(switch)
dev.add(box)
elif option['type'] == "scale":
dev.set_orientation(Gtk.Orientation.VERTICAL)
scale = Gtk.Scale.new_with_range(orientation=Gtk.Orientation.HORIZONTAL,
min=option['range'][0], max=option['range'][1], step=option['step'])
scale.set_hexpand(True)
scale.set_value(int(self._config.get_config().get(option['section'], opt_name, fallback=option['value'])))
scale.set_digits(0)
scale.connect("button-release-event", self.scale_moved, option['section'], opt_name)
dev.add(scale)
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
frame.add(dev)
frame.show_all()
opt_array[opt_name] = {
"name": option['name'],
"row": frame
}
opts = sorted(list(opt_array), key=lambda x: opt_array[x]['name'])
pos = opts.index(opt_name)
self.labels[boxname].insert_row(pos)
self.labels[boxname].attach(opt_array[opt_name]['row'], 0, pos, 1, 1)
self.labels[boxname].show_all()
def back(self):
if len(self.menu) > 1:
self.unload_menu()
return True
return False
+58 -64
View File
@@ -8,25 +8,29 @@ gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
def create_panel(*args): def create_panel(*args):
return NetworkPanel(*args) return NetworkPanel(*args)
class NetworkPanel(ScreenPanel): class NetworkPanel(ScreenPanel):
initialized = False initialized = False
def initialize(self, menu): def __init__(self, screen, title, back=True):
_ = self.lang.gettext super().__init__(screen, title, back)
self.show_add = False self.show_add = False
self.networks = {} self.networks = {}
self.interface = None
self.prev_network = None
self.update_timeout = None self.update_timeout = None
self.network_interfaces = netifaces.interfaces() self.network_interfaces = netifaces.interfaces()
self.wireless_interfaces = [int for int in self.network_interfaces if int.startswith('w')] self.wireless_interfaces = [iface for iface in self.network_interfaces if iface.startswith('w')]
self.wifi = None self.wifi = None
if len(self.wireless_interfaces) > 0: if len(self.wireless_interfaces) > 0:
logging.info("Found wireless interfaces: %s" % 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 = self._gtk.HomogeneousGrid()
grid.set_hexpand(True) grid.set_hexpand(True)
@@ -38,7 +42,7 @@ class NetworkPanel(ScreenPanel):
ints = netifaces.interfaces() ints = netifaces.interfaces()
if 'lo' in ints: if 'lo' in ints:
ints.pop(ints.index('lo')) ints.pop(ints.index('lo'))
if (len(ints) > 0): if len(ints) > 0:
self.interface = ints[0] self.interface = ints[0]
else: else:
self.interface = 'lo' self.interface = 'lo'
@@ -56,7 +60,7 @@ class NetworkPanel(ScreenPanel):
self.labels['interface'].set_hexpand(True) self.labels['interface'].set_hexpand(True)
self.labels['ip'] = Gtk.Label() self.labels['ip'] = Gtk.Label()
self.labels['ip'].set_hexpand(True) self.labels['ip'].set_hexpand(True)
reload_networks = self._gtk.ButtonImage("refresh", None, "color1") reload_networks = self._gtk.ButtonImage("refresh", None, "color1", .66)
reload_networks.connect("clicked", self.reload_networks) reload_networks.connect("clicked", self.reload_networks)
reload_networks.set_hexpand(False) reload_networks.set_hexpand(False)
@@ -65,16 +69,11 @@ class NetworkPanel(ScreenPanel):
sbox.set_vexpand(False) sbox.set_vexpand(False)
sbox.add(self.labels['interface']) sbox.add(self.labels['interface'])
if ip is not None: if ip is not None:
self.labels['ip'].set_text("IP: %s " % ip) self.labels['ip'].set_text(f"IP: {ip} ")
sbox.add(self.labels['ip']) sbox.add(self.labels['ip'])
sbox.add(reload_networks) sbox.add(reload_networks)
scroll = self._gtk.ScrolledWindow()
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0) box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True) box.set_vexpand(True)
@@ -117,7 +116,6 @@ class NetworkPanel(ScreenPanel):
self.content.show_all() self.content.show_all()
def add_network(self, ssid, show=True): def add_network(self, ssid, show=True):
_ = self.lang.gettext
if ssid is None: if ssid is None:
logging.info("SSID is None") logging.info("SSID is None")
@@ -133,11 +131,7 @@ class NetworkPanel(ScreenPanel):
if configured_networks[net]['ssid'] == ssid: if configured_networks[net]['ssid'] == ssid:
network_id = net network_id = net
if ssid.startswith("\x00"): display_name = _("Hidden") if ssid.startswith("\x00") else f"{ssid}"
display_name = _("Hidden")
else:
display_name = str(ssid)
netinfo = self.wifi.get_network_info(ssid) netinfo = self.wifi.get_network_info(ssid)
connected_ssid = self.wifi.get_connected_ssid() connected_ssid = self.wifi.get_connected_ssid()
if netinfo is None: if netinfo is None:
@@ -151,7 +145,7 @@ class NetworkPanel(ScreenPanel):
display_name += " (" + _("Connected") + ")" display_name += " (" + _("Connected") + ")"
name = Gtk.Label("") name = Gtk.Label("")
name.set_markup("<big><b>%s</b></big>" % (display_name)) name.set_markup(f"<big><b>{display_name}</b></big>")
name.set_hexpand(True) name.set_hexpand(True)
name.set_halign(Gtk.Align.START) name.set_halign(Gtk.Align.START)
name.set_line_wrap(True) name.set_line_wrap(True)
@@ -171,7 +165,7 @@ class NetworkPanel(ScreenPanel):
connect.set_hexpand(False) connect.set_hexpand(False)
connect.set_halign(Gtk.Align.END) connect.set_halign(Gtk.Align.END)
delete = self._gtk.ButtonImage("delete", "", "color3") delete = self._gtk.ButtonImage("delete", None, "color3")
delete.connect("clicked", self.remove_wifi_network, ssid) delete.connect("clicked", self.remove_wifi_network, ssid)
delete.set_size_request(60, 0) delete.set_size_request(60, 0)
delete.set_hexpand(False) delete.set_hexpand(False)
@@ -229,7 +223,7 @@ class NetworkPanel(ScreenPanel):
if result: if result:
self.connect_network(widget, ssid, False) self.connect_network(widget, ssid, False)
else: else:
self._screen.show_popup_message("Error adding network %s" % ssid) self._screen.show_popup_message(f"Error adding network {ssid}")
def back(self): def back(self):
if self.show_add: if self.show_add:
@@ -260,7 +254,8 @@ class NetworkPanel(ScreenPanel):
del self.labels[i] del self.labels[i]
self.show_add = False self.show_add = False
def close_dialog(self, widget, response_id): @staticmethod
def close_dialog(widget, response_id):
widget.destroy() widget.destroy()
def connected_callback(self, ssid, prev_ssid): def connected_callback(self, ssid, prev_ssid):
@@ -273,11 +268,10 @@ class NetworkPanel(ScreenPanel):
self.check_missing_networks() self.check_missing_networks()
def connect_network(self, widget, ssid, showadd=True): def connect_network(self, widget, ssid, showadd=True):
_ = self.lang.gettext
snets = self.wifi.get_supplicant_networks() snets = self.wifi.get_supplicant_networks()
isdef = False isdef = False
for id, net in snets.items(): for netid, net in snets.items():
if net['ssid'] == ssid: if net['ssid'] == ssid:
isdef = True isdef = True
break break
@@ -314,7 +308,7 @@ class NetworkPanel(ScreenPanel):
self.wifi.connect(ssid) self.wifi.connect(ssid)
def connecting_status_callback(self, msg): def connecting_status_callback(self, msg):
self.labels['connecting_info'].set_text(self.labels['connecting_info'].get_text() + "\n" + msg) self.labels['connecting_info'].set_text(f"{self.labels['connecting_info'].get_text()}\n{msg}")
self.labels['connecting_info'].show_all() self.labels['connecting_info'].show_all()
def remove_network(self, ssid, show=True): def remove_network(self, ssid, show=True):
@@ -345,62 +339,59 @@ class NetworkPanel(ScreenPanel):
if self.show_add: if self.show_add:
return return
_ = self.lang.gettext
for child in self.content.get_children(): for child in self.content.get_children():
self.content.remove(child) self.content.remove(child)
if "add_network" in self.labels: if "add_network" in self.labels:
del self.labels['add_network'] del self.labels['add_network']
self.labels['add_network'] = Gtk.VBox() label = self._gtk.Label(_("PSK for") + f' ssid')
self.labels['add_network'].set_valign(Gtk.Align.START)
box = Gtk.Box(spacing=5)
box.set_size_request(self._gtk.get_content_width(), self._gtk.get_content_height() -
self._screen.keyboard_height - 20)
box.set_hexpand(True)
box.set_vexpand(False)
self.labels['add_network'].add(box)
label = self._gtk.Label("%s %s:" % (_("PSK for"), ssid))
label.set_hexpand(False) label.set_hexpand(False)
entry = Gtk.Entry() self.labels['network_psk'] = Gtk.Entry()
entry.set_hexpand(True) self.labels['network_psk'].set_text('')
entry.connect("activate", self.add_new_network, ssid, True) self.labels['network_psk'].set_hexpand(True)
self.labels['network_psk'].connect("activate", self.add_new_network, ssid, True)
self.labels['network_psk'].connect("focus-in-event", self._show_keyboard)
self.labels['network_psk'].grab_focus_without_selecting()
save = self._gtk.ButtonImage("sd", _("Save"), "color3") save = self._gtk.ButtonImage("sd", _("Save"), "color3")
save.set_hexpand(False) save.set_hexpand(False)
save.connect("clicked", self.add_new_network, ssid, True) save.connect("clicked", self.add_new_network, ssid, True)
box = Gtk.Box()
self.labels['network_psk'] = entry box.pack_start(self.labels['network_psk'], True, True, 5)
box.pack_start(label, False, False, 5)
box.pack_start(entry, True, True, 5)
box.pack_start(save, False, False, 5) box.pack_start(save, False, False, 5)
self.show_create = True self.labels['add_network'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=5)
self.labels['network_psk'].set_text('') self.labels['add_network'].set_valign(Gtk.Align.CENTER)
self.labels['add_network'].set_hexpand(True)
self.labels['add_network'].set_vexpand(True)
self.labels['add_network'].pack_start(label, True, True, 5)
self.labels['add_network'].pack_start(box, True, True, 5)
self.content.add(self.labels['add_network']) self.content.add(self.labels['add_network'])
self._screen.show_keyboard() self._screen.show_keyboard()
self.labels['network_psk'].grab_focus_without_selecting()
self.content.show_all() self.content.show_all()
self.show_add = True self.show_add = True
def _show_keyboard(self, widget=None, event=None):
self._screen.show_keyboard(entry=self.labels['network_psk'])
def update_all_networks(self): def update_all_networks(self):
for network in list(self.networks): for network in list(self.networks):
self.update_network_info(network) self.update_network_info(network)
return True return True
def update_network_info(self, ssid): def update_network_info(self, ssid):
_ = self.lang.gettext
info = freq = encr = chan = lvl = ipv4 = ipv6 = "" info = freq = encr = chan = lvl = ipv4 = ipv6 = ""
if ssid not in list(self.networks) or ssid not in self.labels['networks']: if ssid not in list(self.networks) or ssid not in self.labels['networks']:
logging.info("Unknown SSID %s", ssid) logging.info(f"Unknown SSID {ssid}")
return return
netinfo = self.wifi.get_network_info(ssid) netinfo = self.wifi.get_network_info(ssid)
if netinfo is None: if netinfo is None:
netinfo = [] netinfo = {}
if "connected" in netinfo: if "connected" in netinfo:
connected = netinfo['connected'] connected = netinfo['connected']
else: else:
@@ -411,10 +402,10 @@ class NetworkPanel(ScreenPanel):
hostname = stream.read().strip() hostname = stream.read().strip()
ifadd = netifaces.ifaddresses(self.interface) ifadd = netifaces.ifaddresses(self.interface)
if netifaces.AF_INET in ifadd and len(ifadd[netifaces.AF_INET]) > 0: if netifaces.AF_INET in ifadd and len(ifadd[netifaces.AF_INET]) > 0:
ipv4 = "<b>%s:</b> %s " % ("IPv4", ifadd[netifaces.AF_INET][0]['addr']) ipv4 = f"<b>IPv4:</b> {ifadd[netifaces.AF_INET][0]['addr']} "
if netifaces.AF_INET6 in ifadd and len(ifadd[netifaces.AF_INET6]) > 0: if netifaces.AF_INET6 in ifadd and len(ifadd[netifaces.AF_INET6]) > 0:
ipv6 = "<b>%s:</b> %s " % ("IPv6", ifadd[netifaces.AF_INET6][0]['addr'].split('%')[0]) ipv6 = f"<b>IPv6:</b> {ifadd[netifaces.AF_INET6][0]['addr'].split('%')[0]} "
info = "<b>%s:</b> %s\n%s\n%s\n" % (_("Hostname"), hostname, ipv4, ipv6) info = f'<b>' + _("Hostname") + f':</b> {hostname}\n{ipv4}\n{ipv6}\n'
elif "psk" in netinfo: elif "psk" in netinfo:
info = _("Password saved") info = _("Password saved")
if "encryption" in netinfo: if "encryption" in netinfo:
@@ -423,16 +414,14 @@ class NetworkPanel(ScreenPanel):
if "frequency" in netinfo: if "frequency" in netinfo:
freq = "2.4 GHz" if netinfo['frequency'][0:1] == "2" else "5 Ghz" freq = "2.4 GHz" if netinfo['frequency'][0:1] == "2" else "5 Ghz"
if "channel" in netinfo: if "channel" in netinfo:
chan = _("Channel") + " " + netinfo['channel'] chan = _("Channel") + f' {netinfo["channel"]}'
if "signal_level_dBm" in netinfo: if "signal_level_dBm" in netinfo:
lvl = netinfo['signal_level_dBm'] + " " + _("dBm") lvl = f'{netinfo["signal_level_dBm"]} ' + _("dBm")
self.labels['networks'][ssid]['info'].set_markup("%s <small>%s %s %s %s</small>" % ( self.labels['networks'][ssid]['info'].set_markup(f"{info} <small>{encr} {freq} {chan} {lvl}</small>")
info, encr, freq, chan, lvl))
self.labels['networks'][ssid]['info'].show_all() self.labels['networks'][ssid]['info'].show_all()
def update_single_network_info(self): def update_single_network_info(self):
_ = self.lang.gettext
stream = os.popen('hostname -f') stream = os.popen('hostname -f')
hostname = stream.read().strip() hostname = stream.read().strip()
@@ -440,11 +429,16 @@ class NetworkPanel(ScreenPanel):
ipv4 = "" ipv4 = ""
ipv6 = "" ipv6 = ""
if netifaces.AF_INET in ifadd and len(ifadd[netifaces.AF_INET]) > 0: if netifaces.AF_INET in ifadd and len(ifadd[netifaces.AF_INET]) > 0:
ipv4 = "<b>%s:</b> %s " % ("IPv4", ifadd[netifaces.AF_INET][0]['addr']) ipv4 = f"<b>IPv4:</b> {ifadd[netifaces.AF_INET][0]['addr']} "
if netifaces.AF_INET6 in ifadd and len(ifadd[netifaces.AF_INET6]) > 0: if netifaces.AF_INET6 in ifadd and len(ifadd[netifaces.AF_INET6]) > 0:
ipv6 = ipv6 = "<b>%s:</b> %s " % ("IPv6", ifadd[netifaces.AF_INET6][0]['addr'].split('%')[0]) ipv6 = f"<b>IPv6:</b> {ifadd[netifaces.AF_INET6][0]['addr'].split('%')[0]} "
connected = "<b>%s</b>\n\n<small><b>%s</b></small>\n<b>%s:</b> %s\n%s\n%s\n" % ( connected = (
self.interface, _("Connected"), _("Hostname"), hostname, ipv4, ipv6) f'<b>{self.interface}</b>\n\n'
f'<small><b>' + _("Connected") + f'</b></small>\n'
f'<b>' + _("Hostname") + f':</b> {hostname}\n'
f'{ipv4}\n'
f'{ipv6}\n'
)
self.labels['networkinfo'].set_markup(connected) self.labels['networkinfo'].set_markup(connected)
self.labels['networkinfo'].show_all() self.labels['networkinfo'].show_all()
+118
View File
@@ -0,0 +1,118 @@
import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, GLib, Pango
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return OutputPinPanel(*args)
class OutputPinPanel(ScreenPanel):
def initialize(self, panel_name):
self.devices = {}
# Create a grid for all devices
self.labels['devices'] = Gtk.Grid()
self.labels['devices'].set_valign(Gtk.Align.CENTER)
self.load_pins()
scroll = self._gtk.ScrolledWindow()
scroll.add(self.labels['devices'])
self.content.add(scroll)
def load_pins(self):
output_pins = self._printer.get_output_pins()
for pin in output_pins:
# Support for hiding devices by name
name = pin.split()[1]
if name.startswith("_"):
continue
self.add_pin(pin)
frame = Gtk.Frame()
frame.set_vexpand(False)
self.labels['devices'].attach(frame, 0, -1, 1, 1)
def add_pin(self, pin):
logging.info(f"Adding pin: {pin}")
name = Gtk.Label()
name.set_markup(f'\n<big><b>{" ".join(pin.split(" ")[1:])}</b></big>\n')
name.set_hexpand(True)
name.set_vexpand(True)
name.set_halign(Gtk.Align.START)
name.set_valign(Gtk.Align.CENTER)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
scale = Gtk.Scale.new_with_range(orientation=Gtk.Orientation.HORIZONTAL, min=0, max=100, step=1)
scale.set_value(self.check_pin_value(pin))
scale.set_digits(0)
scale.set_hexpand(True)
scale.set_has_origin(True)
scale.get_style_context().add_class("fan_slider")
scale.connect("button-release-event", self.set_output_pin, pin)
min_btn = self._gtk.ButtonImage("cancel", None, "color1", 1)
min_btn.set_hexpand(False)
min_btn.connect("clicked", self.update_pin_value, pin, 0)
pin_col = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
pin_col.add(min_btn)
pin_col.add(scale)
pin_row = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
pin_row.add(name)
pin_row.add(pin_col)
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
frame.add(pin_row)
self.devices[pin] = {
"row": frame,
"scale": scale,
}
devices = sorted(self.devices)
pos = devices.index(pin)
self.labels['devices'].insert_row(pos)
self.labels['devices'].attach(self.devices[pin]['row'], 0, pos, 1, 1)
self.labels['devices'].show_all()
def set_output_pin(self, widget, event, pin):
self._screen._ws.klippy.gcode_script(f'SET_PIN PIN={" ".join(pin.split(" ")[1:])} '
f'VALUE={self.devices[pin]["scale"].get_value() / 100}')
# Check the speed in case it wasn't applied
GLib.timeout_add_seconds(1, self.check_pin_value, pin)
def check_pin_value(self, pin):
self.update_pin_value(None, pin, self._printer.get_pin_value(pin))
return False
def process_update(self, action, data):
if action != "notify_status_update":
return
for pin in self.devices:
if pin in data and "value" in data[pin]:
self.update_pin_value(None, pin, data[pin]["value"])
def update_pin_value(self, widget, pin, value):
if pin not in self.devices:
return
self.devices[pin]['scale'].disconnect_by_func(self.set_output_pin)
self.devices[pin]['scale'].set_value(round(float(value) * 100))
self.devices[pin]['scale'].connect("button-release-event", self.set_output_pin, pin)
if widget is not None:
self.set_output_pin(None, None, pin)
+13 -15
View File
@@ -2,24 +2,22 @@ import gi
import logging import logging
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
def create_panel(*args): def create_panel(*args):
return PowerPanel(*args) return PowerPanel(*args)
class PowerPanel(ScreenPanel): class PowerPanel(ScreenPanel):
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
self.devices = {} self.devices = {}
# Create a scroll window for the power devices # Create a scroll window for the power devices
scroll = Gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
# Create a grid for all devices # Create a grid for all devices
self.labels['devices'] = Gtk.Grid() self.labels['devices'] = Gtk.Grid()
@@ -38,8 +36,8 @@ class PowerPanel(ScreenPanel):
devices = self._screen.printer.get_power_devices() devices = self._screen.printer.get_power_devices()
for x in devices: for x in devices:
self.devices[x]['switch'].disconnect_by_func(self.on_switch) self.devices[x]['switch'].disconnect_by_func(self.on_switch)
self.devices[x]['switch'].set_active(True if self._screen.printer.get_power_device_status(x) == "on" self.devices[x]['switch'].set_active(self._screen.printer.get_power_device_status(x) == "on")
else False)
self.devices[x]['switch'].connect("notify::active", self.on_switch, x) self.devices[x]['switch'].connect("notify::active", self.on_switch, x)
def add_device(self, device): def add_device(self, device):
@@ -47,7 +45,7 @@ class PowerPanel(ScreenPanel):
frame.get_style_context().add_class("frame-item") frame.get_style_context().add_class("frame-item")
name = Gtk.Label() name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (device)) name.set_markup(f"<big><b>{device}</b></big>")
name.set_hexpand(True) name.set_hexpand(True)
name.set_vexpand(True) name.set_vexpand(True)
name.set_halign(Gtk.Align.START) name.set_halign(Gtk.Align.START)
@@ -57,10 +55,10 @@ class PowerPanel(ScreenPanel):
switch = Gtk.Switch() switch = Gtk.Switch()
switch.set_hexpand(False) switch.set_hexpand(False)
switch.set_active(True if self._screen.printer.get_power_device_status(device) == "on" else False) switch.set_active(self._screen.printer.get_power_device_status(device) == "on")
switch.connect("notify::active", self.on_switch, device) switch.connect("notify::active", self.on_switch, device)
switch.set_property("width-request", round(self._gtk.get_font_size()*7)) switch.set_property("width-request", round(self._gtk.get_font_size() * 7))
switch.set_property("height-request", round(self._gtk.get_font_size()*3.5)) switch.set_property("height-request", round(self._gtk.get_font_size() * 3.5))
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name) labels.add(name)
@@ -91,7 +89,7 @@ class PowerPanel(ScreenPanel):
self.add_device(x) self.add_device(x)
def on_switch(self, switch, gparam, device): def on_switch(self, switch, gparam, device):
logging.debug("Power toggled %s" % device) logging.debug(f"Power toggled {device}")
if switch.get_active(): if switch.get_active():
self._screen._ws.klippy.power_device_on(device) self._screen._ws.klippy.power_device_on(device)
else: else:
@@ -105,5 +103,5 @@ class PowerPanel(ScreenPanel):
return return
device = data['device'] device = data['device']
self.devices[device]['switch'].disconnect_by_func(self.on_switch) self.devices[device]['switch'].disconnect_by_func(self.on_switch)
self.devices[device]['switch'].set_active(True if data['status'] == "on" else False) self.devices[device]['switch'].set_active(data['status'] == "on")
self.devices[device]['switch'].connect("notify::active", self.on_switch, device) self.devices[device]['switch'].connect("notify::active", self.on_switch, device)
+191 -216
View File
@@ -4,58 +4,52 @@ import logging
import os import os
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango from gi.repository import Gtk, GLib, Pango
from datetime import datetime from datetime import datetime
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
def create_panel(*args): def create_panel(*args):
return PrintPanel(*args) return PrintPanel(*args)
class PrintPanel(ScreenPanel): class PrintPanel(ScreenPanel):
cur_directory = "gcodes" cur_directory = "gcodes"
dir_panels = {} dir_panels = {}
filelist = {'gcodes': {'directories': [], 'files': []}} filelist = {'gcodes': {'directories': [], 'files': []}}
def initialize(self, panel_name): def __init__(self, screen, title, back=True):
_ = self.lang.gettext super().__init__(screen, title, back)
self.labels['directories'] = {} sortdir = self._config.get_main_config().get("print_sort_dir", "name_asc")
self.labels['files'] = {}
self.sort_items = {
"name": _("Name"),
"date": _("Date")
}
self.sort_char = ["↑", "↓"]
sortdir = self._config.get_main_config_option("print_sort_dir", "name_asc")
sortdir = sortdir.split('_') sortdir = sortdir.split('_')
if sortdir[0] not in ["name", "date"] or sortdir[1] not in ["asc", "desc"]: if sortdir[0] not in ["name", "date"] or sortdir[1] not in ["asc", "desc"]:
sortdir = ["name", "asc"] sortdir = ["name", "asc"]
self.sort_current = [sortdir[0], 0 if sortdir[1] == "asc" else 1] # 0 for asc, 1 for desc self.sort_current = [sortdir[0], 0 if sortdir[1] == "asc" else 1] # 0 for asc, 1 for desc
self.sort_items = {
"name": _("Name"),
"date": _("Date")
}
self.sort_icon = ["arrow-up", "arrow-down"]
self.scroll = self._gtk.ScrolledWindow()
self.files = {}
self.directories = {}
self.labels['directories'] = {}
self.labels['files'] = {}
scroll = Gtk.ScrolledWindow() def initialize(self, panel_name):
scroll.set_property("overlay-scrolling", False) sort = Gtk.Label(_("Sort by: "))
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
sort = Gtk.Label()
sort.set_text(_("Sort by: "))
sbox = Gtk.Box(spacing=0) sbox = Gtk.Box(spacing=0)
sbox.set_vexpand(False) sbox.set_vexpand(False)
sbox.add(sort) sbox.add(sort)
i = 1 for i, (name, val) in enumerate(self.sort_items.items(), start=1):
for name, val in self.sort_items.items(): s = self._gtk.ButtonImage(None, val, f"color{i % 4}", .66, Gtk.PositionType.RIGHT, False)
s = self._gtk.Button(val, "color%s" % (i % 4)) if name == self.sort_current[0]:
s.set_label(val) s.set_image(self._gtk.Image(self.sort_icon[self.sort_current[1]], .66))
if name == sortdir[0]:
s.set_label("%s %s" % (s.get_label(), self.sort_char[self.sort_current[1]]))
s.connect("clicked", self.change_sort, name) s.connect("clicked", self.change_sort, name)
self.labels['sort_%s' % name] = s self.labels[f'sort_{name}'] = s
sbox.add(s) sbox.add(s)
i += 1 refresh = self._gtk.ButtonImage("refresh", None, None, .66)
refresh = self._gtk.ButtonImage("refresh", None, None, .5)
refresh.connect('clicked', self._refresh_files) refresh.connect('clicked', self._refresh_files)
sbox.add(refresh) sbox.add(refresh)
sbox.set_hexpand(True) sbox.set_hexpand(True)
@@ -72,16 +66,13 @@ class PrintPanel(ScreenPanel):
box.set_vexpand(True) box.set_vexpand(True)
box.pack_start(sbox, False, False, 0) box.pack_start(sbox, False, False, 0)
box.pack_start(pbox, False, False, 0) box.pack_start(pbox, False, False, 0)
box.pack_start(scroll, True, True, 0) box.pack_start(self.scroll, True, True, 0)
self.dir_panels['gcodes'] = Gtk.Grid() self.dir_panels['gcodes'] = Gtk.Grid()
self.files = {}
self.directories = {}
GLib.idle_add(self.reload_files) GLib.idle_add(self.reload_files)
scroll.add(self.dir_panels['gcodes']) self.scroll.add(self.dir_panels['gcodes'])
self.scroll = scroll
self.content.add(box) self.content.add(box)
self._screen.files.add_file_callback(self._callback) self._screen.files.add_file_callback(self._callback)
@@ -96,58 +87,13 @@ class PrintPanel(ScreenPanel):
self.filelist[parent_dir]['directories'].append(directory) self.filelist[parent_dir]['directories'].append(directory)
if directory not in self.labels['directories']: if directory not in self.labels['directories']:
frame = Gtk.Frame() self._create_frame(directory)
frame.get_style_context().add_class("frame-item") reverse = self.sort_current[1] != 0
dirs = sorted(
self.filelist[parent_dir]['directories'],
reverse=reverse, key=lambda item: self.filelist[item]['modified']
) if self.sort_current[0] == "date" else sorted(self.filelist[parent_dir]['directories'], reverse=reverse)
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (directory.split("/")[-1]))
name.set_hexpand(True)
name.set_halign(Gtk.Align.START)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
info = Gtk.Label()
info.set_halign(Gtk.Align.START)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
labels.add(info)
labels.set_vexpand(True)
labels.set_valign(Gtk.Align.CENTER)
labels.set_halign(Gtk.Align.START)
actions = self._gtk.ButtonImage("load", None, "color3")
actions.connect("clicked", self.change_dir, directory)
actions.set_hexpand(False)
actions.set_halign(Gtk.Align.END)
file = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
file.set_hexpand(True)
file.set_vexpand(False)
icon = self._gtk.Image("folder", 1)
file.add(icon)
file.add(labels)
file.add(actions)
frame.add(file)
self.directories[directory] = frame
self.labels['directories'][directory] = {
"icon": icon,
"info": info,
"name": name
}
self.dir_panels[directory] = Gtk.Grid()
reverse = False if self.sort_current[1] == 0 else True
if self.sort_current[0] == "date":
dirs = sorted(self.filelist[parent_dir]['directories'], reverse=reverse,
key=lambda item: self.filelist[item]['modified'])
else:
dirs = sorted(self.filelist[parent_dir]['directories'], reverse=reverse)
pos = dirs.index(directory) pos = dirs.index(directory)
self.dir_panels[parent_dir].insert_row(pos) self.dir_panels[parent_dir].insert_row(pos)
@@ -156,89 +102,41 @@ class PrintPanel(ScreenPanel):
self.dir_panels[parent_dir].show_all() self.dir_panels[parent_dir].show_all()
def add_file(self, filepath, show=True): def add_file(self, filepath, show=True):
_ = self.lang.gettext
fileinfo = self._screen.files.get_file_info(filepath) fileinfo = self._screen.files.get_file_info(filepath)
if fileinfo is None: if fileinfo is None:
return return
dir = ("gcodes/%s" % filepath).split('/')[:-1] d = f"gcodes/{filepath}".split('/')[:-1]
directory = '/'.join(dir) directory = '/'.join(d)
filename = filepath.split('/')[-1] filename = filepath.split('/')[-1]
for i in range(1, len(dir)): for i in range(1, len(d)):
curdir = "/".join(dir[0:i]) curdir = "/".join(d[:i])
newdir = "/".join(dir[0:i+1]) newdir = "/".join(d[:i + 1])
if newdir not in self.filelist[curdir]['directories']: if newdir not in self.filelist[curdir]['directories']:
self.add_directory(newdir) self.add_directory(newdir)
if filename not in self.filelist[directory]['files']: if filename not in self.filelist[directory]['files']:
for i in range(1, len(dir)): for i in range(1, len(d)):
curdir = "/".join(dir[0:i+1]) curdir = "/".join(d[:i + 1])
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(
"<small>%s: <b>%s</b></small>" % f'<small>' + _("Modified")
(_("Modified"), datetime.fromtimestamp(fileinfo['modified']).strftime("%Y-%m-%d %H:%M"))) + f' <b>{datetime.fromtimestamp(fileinfo["modified"]):%Y-%m-%d %H:%M}</b></small>'
)
self.filelist[directory]['files'].append(filename) self.filelist[directory]['files'].append(filename)
if filepath not in self.files: if filepath not in self.files:
frame = Gtk.Frame() self._create_frame_file(filename, filepath)
frame.get_style_context().add_class("frame-item") reverse = self.sort_current[1] != 0
files = sorted(
self.filelist[directory]['files'],
reverse=reverse,
key=lambda item: self._screen.files.get_file_info(f"{directory}/{item}"[7:])['modified']
) if self.sort_current[0] == "date" else sorted(self.filelist[directory]['files'], reverse=reverse)
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (os.path.splitext(filename)[0].replace("_", " ")))
name.set_hexpand(True)
name.set_halign(Gtk.Align.START)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.CHAR)
info = Gtk.Label()
info.set_halign(Gtk.Align.START)
info.set_markup(self.get_file_info_str(filepath))
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
labels.add(info)
labels.set_vexpand(True)
labels.set_valign(Gtk.Align.CENTER)
labels.set_halign(Gtk.Align.START)
actions = self._gtk.ButtonImage("print", None, "color3")
actions.connect("clicked", self.confirm_print, filepath)
actions.set_hexpand(False)
actions.set_halign(Gtk.Align.END)
file = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
file.set_hexpand(True)
file.set_vexpand(False)
icon = Gtk.Image()
pixbuf = self.get_file_image(filepath)
if pixbuf is not None:
icon.set_from_pixbuf(pixbuf)
else:
icon = self._gtk.Image("file", 1.6)
file.add(icon)
file.add(labels)
if os.path.splitext(filename)[1] in [".gcode", ".g", ".gco"]:
file.add(actions)
frame.add(file)
self.files[filepath] = frame
self.labels['files'][filepath] = {
"icon": icon,
"info": info,
"name": name
}
reverse = False if self.sort_current[1] == 0 else True
if self.sort_current[0] == "date":
files = sorted(
self.filelist[directory]['files'], reverse=reverse,
key=lambda item: self._screen.files.get_file_info(("%s/%s" % (directory, item))[7:])['modified']
)
else:
files = sorted(self.filelist[directory]['files'], reverse=reverse)
pos = files.index(filename) pos = files.index(filename)
pos += len(self.filelist[directory]['directories']) pos += len(self.filelist[directory]['directories'])
@@ -247,6 +145,117 @@ class PrintPanel(ScreenPanel):
if show is True: if show is True:
self.dir_panels[directory].show_all() self.dir_panels[directory].show_all()
def _create_frame(self, directory):
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
name.set_markup(f"<big><b>{directory.split('/')[-1]}</b></big>")
name.set_hexpand(True)
name.set_halign(Gtk.Align.START)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
info = Gtk.Label()
info.set_halign(Gtk.Align.START)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
labels.add(info)
labels.set_vexpand(True)
labels.set_valign(Gtk.Align.CENTER)
labels.set_halign(Gtk.Align.START)
actions = self._gtk.ButtonImage("load", None, "color3")
actions.connect("clicked", self.change_dir, directory)
actions.set_hexpand(False)
actions.set_halign(Gtk.Align.END)
file = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
file.set_hexpand(True)
file.set_vexpand(False)
icon = self._gtk.Image("folder", 1)
file.add(icon)
file.add(labels)
file.add(actions)
frame.add(file)
self.directories[directory] = frame
self.labels['directories'][directory] = {
"icon": icon,
"info": info,
"name": name
}
self.dir_panels[directory] = Gtk.Grid()
def _create_frame_file(self, filename, filepath):
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
name.set_markup(f'<big><b>{os.path.splitext(filename)[0].replace("_", " ")}</b></big>')
name.set_hexpand(True)
name.set_halign(Gtk.Align.START)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.CHAR)
info = Gtk.Label()
info.set_halign(Gtk.Align.START)
info.set_markup(self.get_file_info_str(filepath))
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
labels.add(info)
labels.set_vexpand(True)
labels.set_valign(Gtk.Align.CENTER)
labels.set_halign(Gtk.Align.START)
actions = self._gtk.ButtonImage("print", None, "color3")
actions.connect("clicked", self.confirm_print, filepath)
actions.set_hexpand(False)
actions.set_halign(Gtk.Align.END)
file = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
file.set_hexpand(True)
file.set_vexpand(False)
icon = Gtk.Image()
pixbuf = self.get_file_image(filepath, small=True)
if pixbuf is not None:
icon.set_from_pixbuf(pixbuf)
else:
icon = self._gtk.Image("file", 1.6)
img = Gtk.Button()
img.set_image(icon)
img.connect("clicked", self.confirm_delete_file, f"gcodes/{filepath}")
file.add(img)
file.add(labels)
if os.path.splitext(filename)[1] in [".gcode", ".g", ".gco"]:
file.add(actions)
frame.add(file)
self.files[filepath] = frame
self.labels['files'][filepath] = {
"icon": icon,
"info": info,
"name": name
}
def confirm_delete_file(self, widget, filepath):
logging.debug(f"Sending delete_file {filepath}")
params = {"path": f"{filepath}"}
self._screen._confirm_send_action(
None,
_("Delete File?") + "\n\n" + filepath,
"server.files.delete_file",
params
)
def back(self): def back(self):
if len(self.cur_directory.split('/')) > 1: if len(self.cur_directory.split('/')) > 1:
self.change_dir(None, '/'.join(self.cur_directory.split('/')[:-1])) self.change_dir(None, '/'.join(self.cur_directory.split('/')[:-1]))
@@ -256,12 +265,12 @@ class PrintPanel(ScreenPanel):
def change_dir(self, widget, directory): def change_dir(self, widget, directory):
if directory not in self.dir_panels: if directory not in self.dir_panels:
return return
logging.debug("Changing dir to %s" % directory) logging.debug(f"Changing dir to {directory}")
for child in self.scroll.get_children(): for child in self.scroll.get_children():
self.scroll.remove(child) self.scroll.remove(child)
self.cur_directory = directory self.cur_directory = directory
self.labels['path'].set_text(" /%s" % self.cur_directory[7:]) self.labels['path'].set_text(f" /{self.cur_directory[7:]}")
self.scroll.add(self.dir_panels[directory]) self.scroll.add(self.dir_panels[directory])
self.content.show_all() self.content.show_all()
@@ -271,26 +280,26 @@ class PrintPanel(ScreenPanel):
self.sort_current[1] = (self.sort_current[1] + 1) % 2 self.sort_current[1] = (self.sort_current[1] + 1) % 2
else: else:
oldkey = self.sort_current[0] oldkey = self.sort_current[0]
logging.info("Changing %s to %s" % ('sort_%s' % oldkey, self.sort_items[self.sort_current[0]])) logging.info(f"Changing sort_{oldkey} to {self.sort_items[self.sort_current[0]]}")
self.labels['sort_%s' % oldkey].set_label("%s" % self.sort_items[oldkey]) self.labels[f'sort_{oldkey}'].set_image(None)
self.labels['sort_%s' % oldkey].show_all() self.labels[f'sort_{oldkey}'].show_all()
self.sort_current = [key, 0] self.sort_current = [key, 0]
self.labels['sort_%s' % key].set_label("%s %s" % (self.sort_items[key], self.sort_char[self.sort_current[1]])) self.labels[f'sort_{key}'].set_image(self._gtk.Image(self.sort_icon[self.sort_current[1]], .66))
self.labels['sort_%s' % key].show() self.labels[f'sort_{key}'].show()
GLib.idle_add(self.reload_files) GLib.idle_add(self.reload_files)
self._config.set("main", "print_sort_dir", "%s_%s" % (key, "asc" if self.sort_current[1] == 0 else "desc")) self._config.set("main", "print_sort_dir", f'{key}_{"asc" if self.sort_current[1] == 0 else "desc"}')
self._config.save_user_config_options() self._config.save_user_config_options()
def confirm_print(self, widget, filename): def confirm_print(self, widget, filename):
_ = self.lang.gettext
buttons = [ buttons = [
{"name": _("Print"), "response": Gtk.ResponseType.OK}, {"name": _("Print"), "response": Gtk.ResponseType.OK},
{"name": _("Cancel"), "response": Gtk.ResponseType.CANCEL} {"name": _("Cancel"), "response": Gtk.ResponseType.CANCEL}
] ]
label = Gtk.Label() label = Gtk.Label()
label.set_markup("<b>%s</b>\n" % (filename)) label.set_markup(f"<b>{filename}</b>\n")
label.set_hexpand(True) label.set_hexpand(True)
label.set_halign(Gtk.Align.CENTER) label.set_halign(Gtk.Align.CENTER)
label.set_vexpand(True) label.set_vexpand(True)
@@ -300,7 +309,6 @@ class PrintPanel(ScreenPanel):
grid = Gtk.Grid() grid = Gtk.Grid()
grid.add(label) grid.add(label)
grid.set_size_request(self._screen.width - 60, -1)
pixbuf = self.get_file_image(filename, 8, 3.2) pixbuf = self.get_file_image(filename, 8, 3.2)
if pixbuf is not None: if pixbuf is not None:
@@ -319,16 +327,16 @@ class PrintPanel(ScreenPanel):
if response_id == Gtk.ResponseType.CANCEL: if response_id == Gtk.ResponseType.CANCEL:
return return
logging.info("Starting print: %s" % (filename)) logging.info(f"Starting print: {filename}")
self._screen._ws.klippy.print_start(filename) self._screen._ws.klippy.print_start(filename)
def delete_file(self, filename): def delete_file(self, filename):
dir_parts = ("gcodes/%s" % filename).split('/')[:-1] dir_parts = f"gcodes/{filename}".split('/')[:-1]
directory = '/'.join(dir_parts) directory = '/'.join(dir_parts)
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:
cur_dir = '/'.join(dir_parts[0:i]) cur_dir = '/'.join(dir_parts[:i])
if len(self.filelist[cur_dir]['directories']) > 0 or len(self.filelist[cur_dir]['files']) > 0: if len(self.filelist[cur_dir]['directories']) > 0 or len(self.filelist[cur_dir]['files']) > 0:
break break
par_dir = '/'.join(cur_dir.split('/')[:-1]) par_dir = '/'.join(cur_dir.split('/')[:-1])
@@ -349,52 +357,19 @@ class PrintPanel(ScreenPanel):
self.files.pop(filename) self.files.pop(filename)
def get_file_info_str(self, filename): def get_file_info_str(self, filename):
_ = self.lang.gettext
fileinfo = self._screen.files.get_file_info(filename) fileinfo = self._screen.files.get_file_info(filename)
if fileinfo is None: if fileinfo is None:
return return
info = '<small>' + _("Uploaded") + f': <b>{datetime.fromtimestamp(fileinfo["modified"]):%Y-%m-%d %H:%M}</b>\n'
return "<small>%s: <b>%s</b>\n%s: <b>%s</b>\n%s: <b>%s</b></small>" % ( if "size" in fileinfo:
_("Uploaded"), info += _("Size") + f': <b>{self.format_size(fileinfo["size"])}</b>\n'
datetime.fromtimestamp(fileinfo['modified']).strftime("%Y-%m-%d %H:%M"),
_("Size"),
self.formatsize(fileinfo['size']),
_("Print Time"),
self.get_print_time(filename)
)
def formatsize(self, size):
size = float(size)
suffixes = ["kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]
for i, suffix in enumerate(suffixes, start=2):
unit = 1024 ** i
if size < unit:
return ("%.1f %s") % ((1024 * size / unit), suffix)
def get_print_time(self, filename):
fileinfo = self._screen.files.get_file_info(filename)
if fileinfo is None:
return
if "estimated_time" in fileinfo: if "estimated_time" in fileinfo:
print_time = fileinfo['estimated_time'] info += _("Print Time") + f': <b>{self.format_time(fileinfo["estimated_time"])}</b>'
print_str = "" info += "</small>"
# Figure out how many days return info
print_val = int(print_time/86400)
if print_val > 0:
print_str = "%sd " % print_val
# Take remainder from days and divide by hours
print_val = int((print_time % 86400)/3600)
if print_val > 0:
print_str = "%s%sh " % (print_str, print_val)
print_val = int(((print_time % 86400) % 3600)/60)
print_str = "%s%sm" % (print_str, print_val)
return print_str
return "Unavailable"
def reload_files(self, widget=None): def reload_files(self, widget=None):
self.filelist = {'gcodes': {'directories': [], 'files': []}} self.filelist = {'gcodes': {'directories': [], 'files': []}}
@@ -408,10 +383,10 @@ class PrintPanel(ScreenPanel):
def update_file(self, filename): def update_file(self, filename):
if filename not in self.labels['files']: if filename not in self.labels['files']:
logging.debug("Cannot update file, file not in labels: %s" % filename) logging.debug(f"Cannot update file, file not in labels: {filename}")
return return
logging.info("Updating file %s" % filename) logging.info(f"Updating file {filename}")
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
@@ -419,22 +394,22 @@ class PrintPanel(ScreenPanel):
if pixbuf is not None: if pixbuf is not None:
self.labels['files'][filename]['icon'].set_from_pixbuf(pixbuf) self.labels['files'][filename]['icon'].set_from_pixbuf(pixbuf)
def _callback(self, newfiles, deletedfiles, updatedfiles=[]): def _callback(self, newfiles, deletedfiles, updatedfiles=None):
logging.debug("newfiles: %s", newfiles) logging.debug(f"newfiles: {newfiles}")
for file in newfiles: for file in newfiles:
self.add_file(file) self.add_file(file)
logging.debug("deletedfiles: %s", deletedfiles) logging.debug(f"deletedfiles: {deletedfiles}")
for file in deletedfiles: for file in deletedfiles:
self.delete_file(file) self.delete_file(file)
logging.debug("updatefiles: %s", updatedfiles) if updatedfiles is not None:
for file in updatedfiles: logging.debug(f"updatefiles: {updatedfiles}")
self.update_file(file) for file in updatedfiles:
self.update_file(file)
def _refresh_files(self, widget): def _refresh_files(self, widget):
self._files.refresh_files() self._files.refresh_files()
def process_update(self, action, data): def process_update(self, action, data):
if action == "notify_gcode_response": if action == "notify_gcode_response" and "unknown" in data.lower():
if "unknown" in data.lower(): self._screen.show_popup_message(data)
self._screen.show_popup_message("%s" % data)
return return
+9 -11
View File
@@ -7,23 +7,21 @@ from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.PrinterSelect") logger = logging.getLogger("KlipperScreen.PrinterSelect")
def create_panel(*args): def create_panel(*args):
return PrinterSelect(*args) return PrinterSelect(*args)
class PrinterSelect(ScreenPanel): class PrinterSelect(ScreenPanel):
def __init__(self, screen, title, back=True, action_bar=True, printer_name=True): def __init__(self, screen, title, back=True):
super().__init__(screen, title, False, False, False) super().__init__(screen, title, False)
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
printers = self._config.get_printers() printers = self._config.get_printers()
grid = self._gtk.HomogeneousGrid() grid = self._gtk.HomogeneousGrid()
scroll = Gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
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(grid) scroll.add(grid)
self.content.add(scroll) self.content.add(scroll)
@@ -32,7 +30,7 @@ class PrinterSelect(ScreenPanel):
if length == 4: if length == 4:
# Arrange 2 x 2 # Arrange 2 x 2
columns = 2 columns = 2
elif length > 4 and length <= 6: elif 4 < length <= 6:
# Arrange 3 x 2 # Arrange 3 x 2
columns = 3 columns = 3
else: else:
@@ -40,12 +38,12 @@ 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, "color%s" % (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._screen.connect_printer_widget, 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)
else: else:
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)
+58 -47
View File
@@ -3,59 +3,66 @@ import logging
import re import re
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
def create_panel(*args): def create_panel(*args):
return FWRetractionPanel(*args) return FWRetractionPanel(*args)
class FWRetractionPanel(ScreenPanel): class FWRetractionPanel(ScreenPanel):
values = {}
list = {} def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
self.options = None
self.grid = Gtk.Grid()
self.values = {}
self.list = {}
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
self.grid = Gtk.Grid()
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_speed = int(float((conf['retract_speed']))) if 'retract_speed' in conf else 20
unretract_extra_length = float(conf['unretract_extra_length']) if 'unretract_extra_length' in conf else 0
unretract_speed = int(float((conf['unretract_speed']))) if 'unretract_speed' in conf else 10
maxlength = retract_length * 1.2 if retract_length >= 6 else 6
maxspeed = retract_speed * 1.2 if retract_speed >= 100 else 100
self.options = [ self.options = [
{"name": _("Retraction Length"), {"name": _("Retraction Length"),
"units": _("mm"), "units": _("mm"),
"option": "retract_length", "option": "retract_length",
"value": float(conf['retract_length']) if 'retract_length' in conf else 0, "value": retract_length,
"digits":2, "digits": 2,
"maxval":4}, "maxval": maxlength},
{"name": _("Retraction Speed"), {"name": _("Retraction Speed"),
"units": _("mm/s"), "units": _("mm/s"),
"option": "retract_speed", "option": "retract_speed",
"value": int(float((conf['retract_speed']))) if 'retract_speed' in conf else 20, "value": retract_speed,
"digits":0, "digits": 0,
"maxval":100}, "maxval": maxspeed},
{"name": _("Unretract Extra Length"), {"name": _("Unretract Extra Length"),
"units": _("mm"), "units": _("mm"),
"option": "unretract_extra_length", "option": "unretract_extra_length",
"value": float(conf['unretract_extra_length']) if 'unretract_extra_length' in conf else 0, "value": unretract_extra_length,
"digits":2, "digits": 2,
"maxval":15}, "maxval": maxlength},
{"name": _("Unretract Speed"), {"name": _("Unretract Speed"),
"units": _("mm/s"), "units": _("mm/s"),
"option": "unretract_speed", "option": "unretract_speed",
"value": int(float((conf['unretract_speed']))) if 'unretract_speed' in conf else 10, "value": unretract_speed,
"digits":0, "digits": 0,
"maxval":60} "maxval": maxspeed}
] ]
for opt in self.options: for opt in self.options:
self.add_option(opt['option'], opt['name'], opt['units'], opt['value'], opt['digits'], opt["maxval"]) self.add_option(opt['option'], opt['name'], opt['units'], opt['value'], opt['digits'], opt["maxval"])
scroll = Gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
scroll.add(self.grid) scroll.add(self.grid)
self.content.add(scroll) self.content.add(scroll)
@@ -70,7 +77,6 @@ class FWRetractionPanel(ScreenPanel):
if opt in data["firmware_retraction"]: if opt in data["firmware_retraction"]:
self.update_option(opt, data["firmware_retraction"][opt]) self.update_option(opt, data["firmware_retraction"][opt])
elif action == "notify_gcode_response": elif action == "notify_gcode_response":
logging.info("data")
# // RETRACT_LENGTH=0.00000 RETRACT_SPEED=20.00000 UNRETRACT_EXTRA_LENGTH=0.00000 UNRETRACT_SPEED=10.00000 # // RETRACT_LENGTH=0.00000 RETRACT_SPEED=20.00000 UNRETRACT_EXTRA_LENGTH=0.00000 UNRETRACT_SPEED=10.00000
result = re.match( result = re.match(
"^// [RETRACT_LENGTH= ]+([\\-0-9\\.]+)" + "^// [RETRACT_LENGTH= ]+([\\-0-9\\.]+)" +
@@ -80,10 +86,10 @@ class FWRetractionPanel(ScreenPanel):
data data
) )
if result: if result:
self.update_option('retract_length', result.group(1)) self.update_option('retract_length', result[1])
self.update_option('retract_speed', result.group(2)) self.update_option('retract_speed', result[2])
self.update_option('unretract_extra_length', result.group(3)) self.update_option('unretract_extra_length', result[3])
self.update_option('unretract_speed', result.group(4)) self.update_option('unretract_speed', result[4])
def update_option(self, option, value): def update_option(self, option, value):
if option not in self.list: if option not in self.list:
@@ -98,23 +104,19 @@ class FWRetractionPanel(ScreenPanel):
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)
def add_option(self, option, optname, units, value, digits, maxval): def add_option(self, option, optname, units, value, digits, maxval):
logging.info("Adding option: %s" % option) logging.info(f"Adding option: {option}")
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
name = Gtk.Label() name = Gtk.Label()
name.set_markup("<big><b>%s</b></big> (%s)" % (optname, units)) name.set_markup(f"<big><b>{optname}</b></big> ({units})")
name.set_hexpand(True) name.set_hexpand(True)
name.set_vexpand(True) name.set_vexpand(True)
name.set_halign(Gtk.Align.START) name.set_halign(Gtk.Align.START)
name.set_valign(Gtk.Align.CENTER) name.set_valign(Gtk.Align.CENTER)
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)
minimum = 1 if option in ["retract_speed", "unretract_speed"] else 0
adj = Gtk.Adjustment(0, 0, value, 1, 5, 0)
self.values[option] = value self.values[option] = value
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj) scale = Gtk.Scale.new_with_range(orientation=Gtk.Orientation.HORIZONTAL, min=minimum, max=maxval, step=1)
scale.set_range(0, maxval)
scale.set_value(self.values[option]) scale.set_value(self.values[option])
scale.set_digits(digits) scale.set_digits(digits)
scale.set_hexpand(True) scale.set_hexpand(True)
@@ -122,15 +124,18 @@ class FWRetractionPanel(ScreenPanel):
scale.get_style_context().add_class("option_slider") scale.get_style_context().add_class("option_slider")
scale.connect("button-release-event", self.set_opt_value, option) scale.connect("button-release-event", self.set_opt_value, option)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) reset = self._gtk.ButtonImage("refresh", None, "color1")
labels.add(name) reset.connect("clicked", self.reset_value, option)
labels.add(scale) reset.set_hexpand(False)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5) item = Gtk.Grid()
dev.set_hexpand(True) item.attach(name, 0, 0, 2, 1)
dev.set_vexpand(False) item.attach(scale, 0, 1, 1, 1)
dev.add(labels) item.attach(reset, 1, 1, 1, 1)
frame.add(dev)
frame = Gtk.Frame()
frame.get_style_context().add_class("frame-item")
frame.add(item)
self.list[option] = { self.list[option] = {
"row": frame, "row": frame,
@@ -141,14 +146,20 @@ class FWRetractionPanel(ScreenPanel):
self.grid.attach(self.list[option]['row'], 0, pos, 1, 1) self.grid.attach(self.list[option]['row'], 0, pos, 1, 1)
self.grid.show_all() self.grid.show_all()
def reset_value(self, widget, option):
for x in self.options:
if x["option"] == option:
self.update_option(option, x["value"])
self.set_opt_value(None, None, option)
def set_opt_value(self, widget, event, opt): def set_opt_value(self, widget, event, opt):
value = self.list[opt]['scale'].get_value() value = self.list[opt]['scale'].get_value()
if opt == "retract_speed": if opt == "retract_speed":
self._screen._ws.klippy.gcode_script("SET_RETRACTION RETRACT_SPEED=%s" % (value)) self._screen._ws.klippy.gcode_script(f"SET_RETRACTION RETRACT_SPEED={value}")
elif opt == "retract_length": elif opt == "retract_length":
self._screen._ws.klippy.gcode_script("SET_RETRACTION RETRACT_LENGTH=%s" % (value)) self._screen._ws.klippy.gcode_script(f"SET_RETRACTION RETRACT_LENGTH={value}")
elif opt == "unretract_extra_length": elif opt == "unretract_extra_length":
self._screen._ws.klippy.gcode_script("SET_RETRACTION UNRETRACT_EXTRA_LENGTH=%s" % (value)) self._screen._ws.klippy.gcode_script(f"SET_RETRACTION UNRETRACT_EXTRA_LENGTH={value}")
elif opt == "unretract_speed": elif opt == "unretract_speed":
self._screen._ws.klippy.gcode_script("SET_RETRACTION UNRETRACT_SPEED=%s" % (value)) self._screen._ws.klippy.gcode_script(f"SET_RETRACTION UNRETRACT_SPEED={value}")
+35 -137
View File
@@ -2,73 +2,55 @@ import gi
import logging import logging
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
def create_panel(*args): def create_panel(*args):
return SettingsPanel(*args) return SettingsPanel(*args)
class SettingsPanel(ScreenPanel): class SettingsPanel(ScreenPanel):
def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
self.printers = self.settings = {}
self.menu = ['settings_menu']
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
self.settings = {}
self.macros = {}
self.menu_cur = 'main_box'
self.menu = ['main_box']
self.labels['main_box'] = self.create_box('main')
self.labels['macros_box'] = self.create_box('macros')
printbox = Gtk.Box(spacing=0)
printbox.set_vexpand(False)
self.labels['add_printer_button'] = self._gtk.Button(_("Add Printer"), "color1") self.labels['add_printer_button'] = self._gtk.Button(_("Add Printer"), "color1")
self.labels['printers_box'] = self.create_box('printers', printbox)
options = self._config.get_configurable_options().copy() options = self._config.get_configurable_options().copy()
options.append({"macros": {
"name": _("Displayed Macros"),
"type": "menu",
"menu": "macros"}
})
options.append({"printers": { options.append({"printers": {
"name": _("Printer Connections"), "name": _("Printer Connections"),
"type": "menu", "type": "menu",
"menu": "printers" "menu": "printers"
}}) }})
self.labels['settings_menu'] = self._gtk.ScrolledWindow()
self.labels['settings'] = Gtk.Grid()
self.labels['settings_menu'].add(self.labels['settings'])
for option in options: for option in options:
name = list(option)[0] name = list(option)[0]
self.add_option('main', self.settings, name, option[name]) self.add_option('settings', self.settings, name, option[name])
for macro in self._printer.get_config_section_list("gcode_macro "): self.labels['printers_menu'] = self._gtk.ScrolledWindow()
macro = macro[12:] self.labels['printers'] = Gtk.Grid()
# Support for hiding macros by name self.labels['printers_menu'].add(self.labels['printers'])
if macro.startswith("_"):
continue
self.macros[macro] = {
"name": macro,
"section": "displayed_macros %s" % self._screen.connected_printer,
"type": "macro"
}
for macro in list(self.macros):
self.add_option('macros', self.macros, macro, self.macros[macro])
self.printers = {}
for printer in self._config.get_printers(): for printer in self._config.get_printers():
logging.debug("Printer: %s" % printer) logging.debug(f"Printer: {printer}")
pname = list(printer)[0] pname = list(printer)[0]
self.printers[pname] = { self.printers[pname] = {
"name": pname, "name": pname,
"section": "printer %s" % pname, "section": f"printer {pname}",
"type": "printer", "type": "printer",
"moonraker_host": printer[pname]['moonraker_host'], "moonraker_host": printer[pname]['moonraker_host'],
"moonraker_port": printer[pname]['moonraker_port'], "moonraker_port": printer[pname]['moonraker_port'],
} }
self.add_option("printers", self.printers, pname, self.printers[pname]) self.add_option("printers", self.printers, pname, self.printers[pname])
self.content.add(self.labels['main_box']) self.content.add(self.labels['settings_menu'])
def activate(self): def activate(self):
while len(self.menu) > 1: while len(self.menu) > 1:
@@ -80,26 +62,6 @@ class SettingsPanel(ScreenPanel):
return True return True
return False return False
def create_box(self, name, insert=None):
# Create a scroll window for the macros
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
# Create a grid for all macros
self.labels[name] = Gtk.Grid()
scroll.add(self.labels[name])
# Create a box to contain all of the above
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
if insert is not None:
box.pack_start(insert, False, False, 0)
box.pack_start(scroll, True, True, 0)
return box
def add_option(self, boxname, opt_array, opt_name, option): def add_option(self, boxname, opt_array, opt_name, option):
if option['type'] is None: if option['type'] is None:
return return
@@ -108,7 +70,7 @@ class SettingsPanel(ScreenPanel):
frame.get_style_context().add_class("frame-item") frame.get_style_context().add_class("frame-item")
name = Gtk.Label() name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (option['name'])) name.set_markup(f"<big><b>{option['name']}</b></big>")
name.set_hexpand(True) name.set_hexpand(True)
name.set_vexpand(True) name.set_vexpand(True)
name.set_halign(Gtk.Align.START) name.set_halign(Gtk.Align.START)
@@ -125,20 +87,17 @@ class SettingsPanel(ScreenPanel):
dev.set_valign(Gtk.Align.CENTER) dev.set_valign(Gtk.Align.CENTER)
dev.add(labels) dev.add(labels)
if option['type'] == "binary" or option['type'] == "macro": if option['type'] == "binary":
box = Gtk.Box() box = Gtk.Box()
box.set_vexpand(False) box.set_vexpand(False)
switch = Gtk.Switch() switch = Gtk.Switch()
switch.set_hexpand(False) switch.set_hexpand(False)
switch.set_vexpand(False) switch.set_vexpand(False)
if option['type'] == "macro": switch.set_active(self._config.get_config().getboolean(option['section'], opt_name))
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name, fallback=True))
else:
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name))
switch.connect("notify::active", self.switch_config_option, option['section'], opt_name, switch.connect("notify::active", self.switch_config_option, option['section'], opt_name,
option['callback'] if "callback" in option else None) option['callback'] if "callback" in option else None)
switch.set_property("width-request", round(self._gtk.get_font_size()*7)) switch.set_property("width-request", round(self._gtk.get_font_size() * 7))
switch.set_property("height-request", round(self._gtk.get_font_size()*3.5)) switch.set_property("height-request", round(self._gtk.get_font_size() * 3.5))
box.add(switch) box.add(switch)
dev.add(box) dev.add(box)
elif option['type'] == "dropdown": elif option['type'] == "dropdown":
@@ -154,29 +113,29 @@ class SettingsPanel(ScreenPanel):
dropdown.set_entry_text_column(0) dropdown.set_entry_text_column(0)
dev.add(dropdown) dev.add(dropdown)
elif option['type'] == "scale": elif option['type'] == "scale":
val = int(self._config.get_config().get(option['section'], opt_name, fallback=option['value'])) dev.set_orientation(Gtk.Orientation.VERTICAL)
adj = Gtk.Adjustment(val, option['range'][0], option['range'][1], option['step'], option['step']*5) scale = Gtk.Scale.new_with_range(orientation=Gtk.Orientation.HORIZONTAL,
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj) min=option['range'][0], max=option['range'][1], step=option['step'])
scale.set_hexpand(True) scale.set_hexpand(True)
scale.set_value(int(self._config.get_config().get(option['section'], opt_name, fallback=option['value'])))
scale.set_digits(0) scale.set_digits(0)
scale.connect("button-release-event", self.scale_moved, option['section'], opt_name) scale.connect("button-release-event", self.scale_moved, option['section'], opt_name)
scale.set_property("width-request", round(self._screen.width/2.2))
dev.add(scale) dev.add(scale)
elif option['type'] == "printer": elif option['type'] == "printer":
logging.debug("Option: %s" % option) 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()
url = "%s:%s" % (option['moonraker_host'], option['moonraker_port']) url = f"{option['moonraker_host']}:{option['moonraker_port']}"
label.set_markup("<big>%s</big>\n%s" % (option['name'], url)) 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":
open = self._gtk.ButtonImage("settings", None, "color3") open_menu = self._gtk.ButtonImage("settings", None, "color3")
open.connect("clicked", self.load_menu, option['menu']) open_menu.connect("clicked", self.load_menu, option['menu'])
open.set_hexpand(False) open_menu.set_hexpand(False)
open.set_halign(Gtk.Align.END) open_menu.set_halign(Gtk.Align.END)
dev.add(open) dev.add(open_menu)
frame.add(dev) frame.add(dev)
frame.show_all() frame.show_all()
@@ -186,70 +145,9 @@ class SettingsPanel(ScreenPanel):
"row": frame "row": frame
} }
opts = sorted(opt_array)
opts = sorted(list(opt_array), key=lambda x: opt_array[x]['name']) opts = sorted(list(opt_array), key=lambda x: opt_array[x]['name'])
pos = opts.index(opt_name) pos = opts.index(opt_name)
self.labels[boxname].insert_row(pos) self.labels[boxname].insert_row(pos)
self.labels[boxname].attach(opt_array[opt_name]['row'], 0, pos, 1, 1) self.labels[boxname].attach(opt_array[opt_name]['row'], 0, pos, 1, 1)
self.labels[boxname].show_all() self.labels[boxname].show_all()
def load_menu(self, widget, name):
if ("%s_box" % name) not in self.labels:
return
for child in self.content.get_children():
self.content.remove(child)
self.menu.append('%s_box' % name)
self.content.add(self.labels[self.menu[-1]])
self.content.show_all()
def unload_menu(self, widget=None):
logging.debug("self.menu: %s" % self.menu)
if len(self.menu) <= 1 or self.menu[-2] not in self.labels:
return
self.menu.pop()
for child in self.content.get_children():
self.content.remove(child)
self.content.add(self.labels[self.menu[-1]])
self.content.show_all()
def on_dropdown_change(self, combo, section, option, callback=None):
tree_iter = combo.get_active_iter()
if tree_iter is not None:
model = combo.get_model()
value = model[tree_iter][1]
logging.debug("[%s] %s changed to %s" % (section, option, value))
self._config.set(section, option, value)
self._config.save_user_config_options()
if callback is not None:
callback(value)
def scale_moved(self, widget, event, section, option):
logging.debug("[%s] %s changed to %s" % (section, option, widget.get_value()))
if section not in self._config.get_config().sections():
self._config.get_config().add_section(section)
self._config.set(section, option, str(int(widget.get_value())))
self._config.save_user_config_options()
def switch_config_option(self, switch, gparam, section, option, callback=None):
logging.debug("[%s] %s toggled %s" % (section, option, switch.get_active()))
if section not in self._config.get_config().sections():
self._config.get_config().add_section(section)
self._config.set(section, option, "True" if switch.get_active() else "False")
self._config.save_user_config_options()
if callback is not None:
callback(switch.get_active())
def add_gcode_option(self):
macros = self._screen.printer.get_gcode_macros()
for x in macros:
self.add_gcode_macro("macros", self.macros, x, {
"name": x[12:],
"type": binary
})
def run_gcode_macro(self, widget, macro):
self._screen._ws.klippy.gcode_script(macro)
+21 -14
View File
@@ -7,20 +7,18 @@ from gi.repository import Gdk, Gtk, Pango
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
def create_panel(*args): def create_panel(*args):
return SplashScreenPanel(*args) return SplashScreenPanel(*args)
class SplashScreenPanel(ScreenPanel): class SplashScreenPanel(ScreenPanel):
box = None 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)
self.layout = Gtk.Layout()
self.layout.set_size(self._screen.width, self._screen.height)
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
image = self._gtk.Image("klipper", 3.2) image = self._gtk.Image("klipper", 3.2)
@@ -70,7 +68,7 @@ class SplashScreenPanel(ScreenPanel):
self.content.add(main) self.content.add(main)
def update_text(self, text): def update_text(self, text):
self.labels['text'].set_markup("%s" % text) self.labels['text'].set_markup(f"{text}")
self.show_restart_buttons() self.show_restart_buttons()
def clear_action_bar(self): def clear_action_bar(self):
@@ -78,7 +76,6 @@ class SplashScreenPanel(ScreenPanel):
self.labels['actions'].remove(child) self.labels['actions'].remove(child)
def show_restart_buttons(self): def show_restart_buttons(self):
_ = self.lang.gettext
self.clear_action_bar() self.clear_action_bar()
printer = self._screen.connected_printer printer = self._screen.connected_printer
@@ -87,23 +84,20 @@ class SplashScreenPanel(ScreenPanel):
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("Associated power devices: %s", power_devices) logging.info(f"Associated power devices: {power_devices}")
self.add_power_button(self._screen.search_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.printer is not None and self._screen.printer.state != "disconnected":
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'])
self.labels['actions'].add(self.labels['menu'])
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'])
self.labels['actions'].show_all() self.labels['actions'].show_all()
def add_power_button(self, powerdevs): def add_power_button(self, powerdevs):
if powerdevs is not None: if powerdevs is not None:
_ = self.lang.gettext
self.labels['power'] = self._gtk.ButtonImage("shutdown", _("Power On Printer"), "color3") self.labels['power'] = self._gtk.ButtonImage("shutdown", _("Power On Printer"), "color3")
self.labels['power'].connect("clicked", self._screen.power_on, powerdevs) self.labels['power'].connect("clicked", self._screen.power_on, powerdevs)
self.check_power_status() self.check_power_status()
@@ -129,9 +123,22 @@ class SplashScreenPanel(ScreenPanel):
def restart(self, widget): def restart(self, widget):
self._screen._ws.klippy.restart() self._screen._ws.klippy.restart()
def shutdown(self, widget): def shutdown(self, widget):
os.system("sudo shutdown -P now")
if self._screen._ws.is_connected():
self._screen._confirm_send_action(widget,
_("Are you sure you wish to shutdown the system?"),
"machine.shutdown")
else:
logging.info("OS Shutdown")
os.system("systemctl poweroff")
def restart_system(self, widget): def restart_system(self, widget):
os.system("sudo reboot now")
if self._screen._ws.is_connected():
self._screen._confirm_send_action(widget,
_("Are you sure you wish to reboot the system?"),
"machine.reboot")
else:
logging.info("OS Reboot")
os.system("systemctl reboot")
+120 -158
View File
@@ -1,32 +1,38 @@
import gi import gi
import logging import logging
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, GLib
from datetime import datetime from datetime import datetime
from ks_includes.screen_panel import ScreenPanel from ks_includes.screen_panel import ScreenPanel
def create_panel(*args): def create_panel(*args):
return SystemPanel(*args) return SystemPanel(*args)
ALLOWED_SERVICES = ["KlipperScreen", "MoonCord", "klipper", "moonraker"] ALLOWED_SERVICES = ["KlipperScreen", "MoonCord", "klipper", "moonraker", "webcamd"]
class SystemPanel(ScreenPanel): class SystemPanel(ScreenPanel):
def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
self.update_status = None
self.update_dialog = None
self.update_prog = None
def initialize(self, panel_name): def initialize(self, panel_name):
_ = self.lang.gettext
grid = self._gtk.HomogeneousGrid() grid = self._gtk.HomogeneousGrid()
grid.set_row_homogeneous(False) grid.set_row_homogeneous(False)
update_all = self._gtk.ButtonImage('refresh', "\n".join(_('Full\nUpdate').split(' ')), 'color1') update_all = self._gtk.ButtonImage('arrow-up', _('Full\nUpdate'), 'color1')
update_all.connect("clicked", self.show_update_info, "full") update_all.connect("clicked", self.show_update_info, "full")
update_all.set_vexpand(False) update_all.set_vexpand(False)
firmrestart = self._gtk.ButtonImage('refresh', "\n".join(_('Firmware\nRestart').split(' ')), 'color2') self.refresh = self._gtk.ButtonImage('refresh', _('Refresh'), 'color2')
firmrestart.connect("clicked", self.restart_klippy, "firmware") self.refresh.connect("clicked", self.refresh_updates)
firmrestart.set_vexpand(False) self.refresh.set_vexpand(False)
reboot = self._gtk.ButtonImage('refresh', _('System\nRestart'), 'color3') reboot = self._gtk.ButtonImage('refresh', _('System\nRestart'), 'color3')
reboot.connect("clicked", self._screen._confirm_send_action, reboot.connect("clicked", self._screen._confirm_send_action,
@@ -37,17 +43,12 @@ class SystemPanel(ScreenPanel):
_("Are you sure you wish to shutdown the system?"), "machine.shutdown") _("Are you sure you wish to shutdown the system?"), "machine.shutdown")
shutdown.set_vexpand(False) shutdown.set_vexpand(False)
scroll = Gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
infogrid = Gtk.Grid() infogrid = Gtk.Grid()
infogrid.get_style_context().add_class("system-program-grid") infogrid.get_style_context().add_class("system-program-grid")
update_resp = self._screen.apiclient.send_request("machine/update/status") update_resp = self._screen.apiclient.send_request("machine/update/status")
self.update_status = False self.update_status = None
if not update_resp: if not update_resp:
logging.info("No update manager configured") logging.info("No update manager configured")
@@ -61,20 +62,19 @@ class SystemPanel(ScreenPanel):
self.labels[prog].set_hexpand(True) self.labels[prog].set_hexpand(True)
self.labels[prog].set_halign(Gtk.Align.START) self.labels[prog].set_halign(Gtk.Align.START)
self.labels["%s_status" % prog] = self._gtk.Button() self.labels[f"{prog}_status"] = self._gtk.Button()
self.labels["%s_status" % prog].set_hexpand(False) self.labels[f"{prog}_status"].set_hexpand(False)
self.labels["%s_status" % prog].connect("clicked", self.show_update_info, prog) self.labels[f"{prog}_status"].connect("clicked", self.show_update_info, prog)
if prog in ALLOWED_SERVICES: if prog in ALLOWED_SERVICES:
self.labels["%s_restart" % prog] = self._gtk.ButtonImage("refresh", None, None, .7, .7) self.labels[f"{prog}_restart"] = self._gtk.ButtonImage("refresh", None, None, .7, .7)
self.labels["%s_restart" % prog].connect("clicked", self.restart, prog) self.labels[f"{prog}_restart"].connect("clicked", self.restart, prog)
infogrid.attach(self.labels["%s_restart" % prog], 0, i, 1, 1) infogrid.attach(self.labels[f"{prog}_restart"], 0, i, 1, 1)
infogrid.attach(self.labels["%s_status" % prog], 2, i, 1, 1) infogrid.attach(self.labels[f"{prog}_status"], 2, i, 1, 1)
logging.info("Updating program: %s " % prog) 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)
self.labels[prog].get_style_context().add_class('updater-item') self.labels[prog].get_style_context().add_class('updater-item')
i = i + 1 i = i + 1
@@ -83,7 +83,7 @@ class SystemPanel(ScreenPanel):
grid.attach(scroll, 0, 0, 4, 2) grid.attach(scroll, 0, 0, 4, 2)
grid.attach(update_all, 0, 2, 1, 1) grid.attach(update_all, 0, 2, 1, 1)
grid.attach(firmrestart, 1, 2, 1, 1) grid.attach(self.refresh, 1, 2, 1, 1)
grid.attach(reboot, 2, 2, 1, 1) grid.attach(reboot, 2, 2, 1, 1)
grid.attach(shutdown, 3, 2, 1, 1) grid.attach(shutdown, 3, 2, 1, 1)
self.content.add(grid) self.content.add(grid)
@@ -91,16 +91,18 @@ class SystemPanel(ScreenPanel):
def activate(self): def activate(self):
self.get_updates() self.get_updates()
def destroy_widget(self, widget, response_id):
widget.destroy()
def finish_updating(self, widget, response_id): def finish_updating(self, widget, response_id):
widget.destroy() widget.destroy()
self._screen.set_updating(False) self._screen.set_updating(False)
self.get_updates() self.get_updates()
def get_updates(self): def refresh_updates(self, widget=None):
update_resp = self._screen.apiclient.send_request("machine/update/status") self.refresh.set_sensitive(False)
self._screen.show_popup_message(_("Checking for updates, please wait..."), level=1)
GLib.timeout_add_seconds(1, self.get_updates, "true")
def get_updates(self, refresh="false"):
update_resp = self._screen.apiclient.send_request(f"machine/update/status?refresh={refresh}")
if not update_resp: if not update_resp:
logging.info("No update manager configured") logging.info("No update manager configured")
else: else:
@@ -109,19 +111,16 @@ class SystemPanel(ScreenPanel):
items = sorted(list(vi)) items = sorted(list(vi))
for prog in items: for prog in items:
self.update_program_info(prog) self.update_program_info(prog)
self.refresh.set_sensitive(True)
def process_update(self, action, data): def process_update(self, action, data):
if action == "notify_update_response": if action == "notify_update_response":
logging.info("Update: %s" % data) logging.info(f"Update: {data}")
if 'application' in data: if 'application' in data:
self.labels['update_progress'].set_text(self.labels['update_progress'].get_text().strip() + "\n" + self.labels['update_progress'].set_text(
data['message'] + "\n") f"{self.labels['update_progress'].get_text().strip()}\n"
self.labels['update_progress'].set_ellipsize(True) f"{data['message']}\n"
self.labels['update_progress'].set_ellipsize(Pango.EllipsizeMode.END) )
adjustment = self.labels['update_scroll'].get_vadjustment()
adjustment.set_value(adjustment.get_upper() - adjustment.get_page_size())
adjustment = self.labels['update_scroll'].show_all()
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)
@@ -129,27 +128,19 @@ class SystemPanel(ScreenPanel):
if program not in ALLOWED_SERVICES: if program not in ALLOWED_SERVICES:
return return
logging.info("Restarting service: %s" % program) logging.info(f"Restarting service: {program}")
self._screen._ws.send_method("machine.services.restart", {"service": program}) self._screen._ws.send_method("machine.services.restart", {"service": program})
def show_update_info(self, widget, program): def show_update_info(self, widget, program):
_ = self.lang.gettext
_n = self.lang.ngettext
if not self.update_status: if not self.update_status:
return return
if program in self.update_status['version_info']: if program in self.update_status['version_info']:
info = self.update_status['version_info'][program] info = self.update_status['version_info'][program]
else: else:
info = ["full"] info = {"full": True}
scroll = Gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True)
scroll.set_vexpand(True)
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
grid = Gtk.Grid() grid = Gtk.Grid()
grid.set_column_homogeneous(True) grid.set_column_homogeneous(True)
@@ -176,10 +167,11 @@ class SystemPanel(ScreenPanel):
ncommits = len(info['commits_behind']) ncommits = len(info['commits_behind'])
label.set_markup("<b>" + label.set_markup("<b>" +
_("Outdated by %d") % ncommits + _("Outdated by %d") % ncommits +
" " + _n("commit", "commits", ncommits) + " " + ngettext("commit", "commits", ncommits) +
":</b>\n") ":</b>\n")
grid.attach(label, 0, i, 1, 1) grid.attach(label, 0, i, 1, 1)
i = i + 1 i += 1
date = "" date = ""
for c in info['commits_behind']: for c in info['commits_behind']:
ndate = datetime.fromtimestamp(int(c['date'])).strftime("%b %d") ndate = datetime.fromtimestamp(int(c['date'])).strftime("%b %d")
@@ -187,51 +179,52 @@ class SystemPanel(ScreenPanel):
date = ndate date = ndate
label = Gtk.Label() label = Gtk.Label()
label.set_line_wrap(True) label.set_line_wrap(True)
label.set_markup("<b>%s</b>\n" % date) label.set_markup(f"<b>{date}</b>\n")
label.set_halign(Gtk.Align.START) label.set_halign(Gtk.Align.START)
grid.attach(label, 0, i, 1, 1) grid.attach(label, 0, i, 1, 1)
i = i + 1 i += 1
label = Gtk.Label() label = Gtk.Label()
label.set_line_wrap(True) label.set_line_wrap(True)
label.set_markup("<b>%s</b>\n<i>%s</i>\n" % (c['subject'], c['author'])) label.set_markup(f"<b>{c['subject']}</b>\n<i>{c['author']}</i>\n")
label.set_halign(Gtk.Align.START) label.set_halign(Gtk.Align.START)
grid.attach(label, 0, i, 1, 1) grid.attach(label, 0, i, 1, 1)
i = i + 1 i += 1
details = Gtk.Label(label=c['message']+"\n\n\n") details = Gtk.Label(label=f"{c['message']}\n\n\n")
details.set_line_wrap(True) details.set_line_wrap(True)
details.set_halign(Gtk.Align.START) details.set_halign(Gtk.Align.START)
grid.attach(details, 0, i, 1, 1) grid.attach(details, 0, i, 1, 1)
i = i + 1 i += 1
if "package_count" in info: if "package_count" in info:
label.set_markup("<b>%d " % info['package_count'] + label.set_markup((
_n("Package will be updated", "Packages will be updated", info['package_count']) + f'<b>{info["package_count"]} '
":</b>\n") + ngettext("Package will be updated", "Packages will be updated", info["package_count"])
+ f':</b>\n'
))
label.set_halign(Gtk.Align.CENTER) label.set_halign(Gtk.Align.CENTER)
grid.attach(label, 0, i, 3, 1) grid.attach(label, 0, i, 3, 1)
i = i + 1 i += 1
j = 0 for j, c in enumerate(info["package_list"]):
for c in info["package_list"]:
label = Gtk.Label() label = Gtk.Label()
label.set_markup(" %s " % c) label.set_markup(f" {c} ")
label.set_halign(Gtk.Align.START) label.set_halign(Gtk.Align.START)
label.set_ellipsize(True)
label.set_ellipsize(Pango.EllipsizeMode.END) label.set_ellipsize(Pango.EllipsizeMode.END)
pos = (j % 3) pos = (j % 3)
grid.attach(label, pos, i, 1, 1) grid.attach(label, pos, i, 1, 1)
j = j + 1 if pos == 2:
if (pos == 2): i += 1
i = i + 1
elif "full" in info: elif "full" in info:
label.set_markup("<b>" + _("Perform a full upgrade?") + "</b>") label.set_markup('<b>' + _("Perform a full upgrade?") + '</b>')
grid.attach(label, 0, i, 1, 1) grid.attach(label, 0, i, 1, 1)
i = i + 1 i += 1
else: else:
label.set_markup("<b>" + _("%s will be updated to version") % program.capitalize() + label.set_markup(
": %s</b>" % (info['remote_version'])) "<b>" + _("%s will be updated to version") % program.capitalize()
+ f": {info['remote_version']}</b>"
)
grid.attach(label, 0, i, 1, 1) grid.attach(label, 0, i, 1, 1)
i = i + 1
scroll.add(grid) scroll.add(grid)
@@ -243,16 +236,16 @@ class SystemPanel(ScreenPanel):
def update_confirm(self, widget, response_id, program): def update_confirm(self, widget, response_id, program):
if response_id == Gtk.ResponseType.OK: if response_id == Gtk.ResponseType.OK:
logging.debug("Updating %s" % program) logging.debug(f"Updating {program}")
self.update_program(self, program) self.update_program(self, program)
widget.destroy() widget.destroy()
def reset_confirm(self, widget, response_id, program): def reset_confirm(self, widget, response_id, program):
if response_id == Gtk.ResponseType.OK: if response_id == Gtk.ResponseType.OK:
logging.debug("Recovering hard %s" % program) logging.debug(f"Recovering hard {program}")
self.reset_repo(self, program, True) self.reset_repo(self, program, True)
if response_id == Gtk.ResponseType.APPLY: if response_id == Gtk.ResponseType.APPLY:
logging.debug("Recovering soft %s" % program) logging.debug(f"Recovering soft {program}")
self.reset_repo(self, program, False) self.reset_repo(self, program, False)
widget.destroy() widget.destroy()
@@ -260,23 +253,16 @@ class SystemPanel(ScreenPanel):
if self._screen.is_updating(): if self._screen.is_updating():
return return
_ = self.lang.gettext
buttons = [ buttons = [
{"name": _("Finish"), "response": Gtk.ResponseType.CANCEL} {"name": _("Finish"), "response": Gtk.ResponseType.CANCEL}
] ]
scroll = Gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True)
scroll.set_vexpand(True)
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.labels['update_progress'] = Gtk.Label("%s %s..." % (_("Starting recovery for"), program)) self.labels['update_progress'] = Gtk.Label(_("Starting recovery for") + f' {program}...')
self.labels['update_progress'].set_halign(Gtk.Align.START) self.labels['update_progress'].set_halign(Gtk.Align.START)
self.labels['update_progress'].set_valign(Gtk.Align.START) self.labels['update_progress'].set_valign(Gtk.Align.START)
self.labels['update_progress'].set_ellipsize(Pango.EllipsizeMode.END)
scroll.add(self.labels['update_progress']) scroll.add(self.labels['update_progress'])
self.labels['update_scroll'] = scroll self.labels['update_scroll'] = scroll
@@ -286,50 +272,38 @@ class SystemPanel(ScreenPanel):
self.update_prog = program self.update_prog = program
self.update_dialog = dialog self.update_dialog = dialog
logging.info("Sending machine.update.recover name: %s" % program) logging.info(f"Sending machine.update.recover name: {program}")
self._screen._ws.send_method("machine.update.recover", {"name": program, "hard": str(hard)}) self._screen._ws.send_method("machine.update.recover", {"name": program, "hard": hard})
self._screen.set_updating(True) self._screen.set_updating(True)
def update_program(self, widget, program): def update_program(self, widget, program):
if self._screen.is_updating(): if self._screen.is_updating():
return return
_ = self.lang.gettext
if not self.update_status: if not self.update_status:
return return
if program in self.update_status['version_info']: if program in self.update_status['version_info']:
info = self.update_status['version_info'][program] info = self.update_status['version_info'][program]
logging.info("program: %s" % info) logging.info(f"program: {info}")
else: else:
info = ["full"] info = {"full": True}
logging.info("full upgrade") logging.info("full upgrade")
if "package_count" in info: if "package_count" in info and info['package_count'] == 0 \
if info['package_count'] == 0: or "version" in info and info['version'] == info['remote_version']:
return return
elif "version" in info:
if info['version'] == info['remote_version']:
return
buttons = [ buttons = [
{"name": _("Finish"), "response": Gtk.ResponseType.CANCEL} {"name": _("Finish"), "response": Gtk.ResponseType.CANCEL}
] ]
scroll = Gtk.ScrolledWindow() scroll = self._gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True)
scroll.set_vexpand(True)
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
scroll.add_events(Gdk.EventMask.TOUCH_MASK)
scroll.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
if "full" in info: if "full" in info:
self.labels['update_progress'] = Gtk.Label("%s\n" % _("Updating")) self.labels['update_progress'] = Gtk.Label(_("Updating") + '\n')
else: else:
self.labels['update_progress'] = Gtk.Label("%s %s..." % (_("Starting update for"), program)) self.labels['update_progress'] = Gtk.Label(_("Starting update for") + f' {program}...')
self.labels['update_progress'].set_halign(Gtk.Align.START) self.labels['update_progress'].set_halign(Gtk.Align.START)
self.labels['update_progress'].set_valign(Gtk.Align.START) self.labels['update_progress'].set_valign(Gtk.Align.START)
scroll.add(self.labels['update_progress']) scroll.add(self.labels['update_progress'])
@@ -342,69 +316,57 @@ class SystemPanel(ScreenPanel):
self.update_dialog = dialog self.update_dialog = dialog
if program in ['klipper', 'moonraker', 'system', 'full']: if program in ['klipper', 'moonraker', 'system', 'full']:
logging.info("Sending machine.update.%s" % program) logging.info(f"Sending machine.update.{program}")
self._screen._ws.send_method("machine.update.%s" % program) self._screen._ws.send_method(f"machine.update.{program}")
else: else:
logging.info("Sending machine.update.client name: %s" % program) logging.info(f"Sending machine.update.client name: {program}")
self._screen._ws.send_method("machine.update.client", {"name": program}) self._screen._ws.send_method("machine.update.client", {"name": program})
self._screen.set_updating(True) self._screen.set_updating(True)
def update_program_info(self, p): def update_program_info(self, p):
_ = self.lang.gettext
logging.info("Updating program: %s " % 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']:
return return
info = self.update_status['version_info'][p] info = self.update_status['version_info'][p]
logging.info("%s: %s" % (p, info)) logging.info(f"{p}: {info}")
if p != "system": if p == "system":
if 'configured_type' in info and info['configured_type'] == 'git_repo':
if info['is_valid'] and not info['is_dirty']:
if info['version'] == info['remote_version']:
self.labels[p].set_markup("<b>%s</b>\n%s" % (p, info['version']))
self.labels["%s_status" % p].set_label(_("Up To Date"))
self.labels["%s_status" % p].get_style_context().remove_class('update')
self.labels["%s_status" % p].get_style_context().remove_class('invalid')
self.labels["%s_status" % p].set_sensitive(False)
else:
self.labels[p].set_markup("<b>%s</b>\n%s -> %s" % (p, info['version'], info['remote_version']))
self.labels["%s_status" % p].set_label(_("Update"))
self.labels["%s_status" % p].get_style_context().add_class('update')
self.labels["%s_status" % p].set_sensitive(True)
else:
self.labels[p].set_markup("<b>%s</b>\n%s" % (p, info['version']))
self.labels["%s_status" % p].set_label(_("Invalid"))
self.labels["%s_status" % p].get_style_context().add_class('invalid')
self.labels["%s_status" % p].set_sensitive(True)
else:
if 'version' in info and info['version'] == info['remote_version']:
self.labels[p].set_markup("<b>%s</b>\n%s" % (p, info['version']))
self.labels["%s_status" % p].set_label(_("Up To Date"))
self.labels["%s_status" % p].get_style_context().remove_class('update')
self.labels["%s_status" % p].set_sensitive(False)
else:
self.labels[p].set_markup("<b>%s</b>\n%s -> %s" % (p, info['version'], info['remote_version']))
self.labels["%s_status" % p].set_label(_("Update"))
self.labels["%s_status" % p].get_style_context().add_class('update')
self.labels["%s_status" % p].set_sensitive(True)
else:
self.labels[p].set_markup("<b>System</b>") self.labels[p].set_markup("<b>System</b>")
if info['package_count'] == 0: if info['package_count'] == 0:
self.labels["%s_status" % p].set_label(_("Up To Date")) self.labels[f"{p}_status"].set_label(_("Up To Date"))
self.labels["%s_status" % p].get_style_context().remove_class('update') self.labels[f"{p}_status"].get_style_context().remove_class('update')
self.labels["%s_status" % p].set_sensitive(False) self.labels[f"{p}_status"].set_sensitive(False)
else: else:
self.labels["%s_status" % p].set_label(_("Update")) self._needs_update(p)
self.labels["%s_status" % p].get_style_context().add_class('update')
self.labels["%s_status" % p].set_sensitive(True)
def restart_klippy(self, widget, type=None): elif 'configured_type' in info and info['configured_type'] == 'git_repo':
if type == "firmware": if info['is_valid'] and not info['is_dirty']:
self._screen._ws.klippy.restart_firmware() if info['version'] == info['remote_version']:
self._already_updated(p, info)
self.labels[f"{p}_status"].get_style_context().remove_class('invalid')
else:
self.labels[p].set_markup(f"<b>{p}</b>\n{info['version']} -> {info['remote_version']}")
self._needs_update(p)
else:
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"].get_style_context().add_class('invalid')
self.labels[f"{p}_status"].set_sensitive(True)
elif 'version' in info and info['version'] == info['remote_version']:
self._already_updated(p, info)
else: else:
self._screen._ws.klippy.restart() self.labels[p].set_markup(f"<b>{p}</b>\n{info['version']} -> {info['remote_version']}")
self._needs_update(p)
def restart_ks(self, widget): def _already_updated(self, p, info):
os.system("sudo systemctl restart %s" % self._config.get_main_config_option('service')) 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"].get_style_context().remove_class('update')
self.labels[f"{p}_status"].set_sensitive(False)
def _needs_update(self, p):
self.labels[f"{p}_status"].set_label(_("Update"))
self.labels[f"{p}_status"].get_style_context().add_class('update')
self.labels[f"{p}_status"].set_sensitive(True)
Loaded 100 of 117 files, more files were not shown because too many files have changed in this diff. Show more