Compare commits

...
135 Commits
Author SHA1 Message Date
Jordan Ruthe 0a5e931d17 bed_mesh: Updates to content to include action bar width 2021-02-15 15:53:39 -05:00
Jordan Ruthe f047830852 system: Change buttons for reduced width 2021-02-15 15:46:26 -05:00
Jordan Ruthe 2c87e096f4 docs: Update configuration and changelog for new features 2021-02-15 15:42:45 -05:00
Jordan Ruthe acbfd6e5c5 screen_panel: Add border on action panel 2021-02-15 15:37:35 -05:00
Jordan Ruthe 79eefbd170 network: Show wifi information 2021-02-15 15:35:13 -05:00
Jordan Ruthe a332556a51 files: Update logging and reduce metadata retrive time 2021-02-15 15:21:32 -05:00
Jordan Ruthe 874b74d59a screen_panel: Put icons on a side bar instead of on the header 2021-02-15 14:58:33 -05:00
Jordan Ruthe 49f7cf0e46 main_menu: Show printer name in main_menu 2021-02-15 14:52:09 -05:00
Jordan Ruthe 57aa7e6e85 screen: Initial update to allow several moonraker connections 2021-02-15 14:51:49 -05:00
Jordan Ruthe 054f7c72db Update emergency stop icon 2021-02-15 14:50:51 -05:00
Jordan Ruthe 1d746c074c screen: Catch errors on attaching panel 2021-02-15 14:25:07 -05:00
Jordan Ruthe 9f2a328b62 files: put files in it's own thread 2021-02-15 14:22:28 -05:00
Jordan Ruthe e1d01c81a2 config: Include multiple configured printers 2021-02-15 14:21:01 -05:00
Jordan Ruthe b251a2ebbb Websocket: changes to include closing websocket 2021-02-15 14:20:39 -05:00
Jordan Ruthe c3f0abd671 splash_screen: Fix none case for printer 2021-02-15 14:18:09 -05:00
schpuntikandschpuntik b6fb4c1da2 Add Russian locales (#79)
* add russian locale

* update script update_translation_files.sh

* Defining Python Source Code Encodings

* Update Russian locale

* Update German locale

* update to PO files for new changes

* fix typo

* Update Russian locale

Co-authored-by: schpuntik <schpuntik@freenet.de>
2021-02-14 12:09:19 -05:00
Jordan Ruthe 6228465fdd job_status: Fix divide by zero case 2021-02-05 21:25:58 +00:00
Elektrickser 05623b7a26 Added Language de_DE (#73)
added German Language
2021-02-05 21:25:52 +00:00
Jordan Ruthe b258d64fb4 KlippyGtk: Undo wrap word. Causing screen to be out of proportion. 2021-02-03 21:40:40 -05:00
Jordan Ruthe 7d1ec41f4b printer: Include quad_gantry_level 2021-01-31 15:24:22 -05:00
Jordan Ruthe 1e9aabec7d screen: Add required traceback module 2021-01-31 15:15:14 -05:00
Jordan Ruthe 7609cedda4 docs: fix typo 2021-01-29 22:37:49 -05:00
Jordan Ruthe f5a2d97842 KlippyGtk: Add word wrapping to buttons 2021-01-29 22:37:39 -05:00
Jordan Ruthe c2dc0fdb46 wifi: Initial wifi class 2021-01-29 22:37:05 -05:00
Jordan Ruthe faabceeafd KlippyRest: catch connection errors 2021-01-29 22:30:55 -05:00
Stefan Dej 4b4faaab88 tiny addition to the install doc (#65)
docs/Installation: Add git clone command
2021-01-29 22:18:01 -05:00
Jordan Ruthe 3e4ae3bdee screen: Enhanced error logging 2021-01-29 16:19:49 -05:00
Jordan Ruthe ad17131393 job_status: Fix issue with NoneType error 2021-01-29 15:46:01 -05:00
Jordan Ruthe d25f642716 docs/Installation: Updates to installation instructions 2021-01-25 20:48:14 -05:00
Jordan Ruthe f1ced2ac46 bed_level: Fix #50 2021-01-25 20:36:37 -05:00
jordanruthe 1137ddb265 Create FUNDING.yml 2021-01-24 14:43:17 -05:00
Jordan Ruthe 3f2fc93be4 KlipperScreen.conf: Add power to print menu 2021-01-24 11:01:43 -05:00
Jordan Ruthe d6bf77870b settings: Screen blanking settings 2021-01-24 11:01:37 -05:00
Jordan Ruthe 874dd509bf bed_mesh: Include add bed mesh 2021-01-21 21:49:57 -05:00
Jordan Ruthe 3ea8402303 screen: Force state into ready 2021-01-21 08:43:41 -05:00
Jordan Ruthe f297699396 job_status/settings: Allow different file estimation methods 2021-01-20 22:06:48 -05:00
Jordan Ruthe 52cadb7744 screen: bug fixes 2021-01-20 22:02:48 -05:00
Jordan Ruthe 90c84d5f17 menu: Fix issue in updating j2_data for moonraker connection 2021-01-20 16:27:02 -05:00
Jordan Ruthe a51360f372 printer: Optimize print states and more print state logging 2021-01-20 15:35:01 -05:00
Jordan Ruthe fc074c350f printer: More debugs for state changes 2021-01-19 13:22:07 -05:00
Jordan Ruthe c926184918 docs: Add commands for calibration 2021-01-19 13:19:39 -05:00
Jordan Ruthe a17c8665ac KlippyGtk: Allow different button image positions 2021-01-19 08:01:12 -05:00
Jordan Ruthe 6c252b0862 splash_screen: Enable menu to network, power, and system panels 2021-01-19 07:59:58 -05:00
Jordan Ruthe 30ed648934 gcode_macros: Updates to fix bugs in visibility of macros 2021-01-13 11:02:15 -05:00
Jordan Ruthe da9570a925 print: Allow sorting by date and name. 2021-01-12 18:35:24 -05:00
Jordan Ruthe 37f8a5d632 system: Add reboot and shutdown buttons 2021-01-10 14:22:18 -05:00
Jordan Ruthe 0453627d40 bed_level/move/temperature/zcalibrate: RTL support 2021-01-09 22:21:27 -05:00
Jordan Ruthe 4f929ba342 move: fix error in move function 2021-01-09 11:27:22 -05:00
Jordan Ruthe 8920516053 extrude: RTL support 2021-01-08 19:03:01 -05:00
Jordan Ruthe a087ecfa30 menu/main_menu: Better RTL support 2021-01-08 19:02:49 -05:00
Jordan Ruthe ab7cffe4d6 language: update to PO files for near-future changes 2021-01-08 11:21:15 -05:00
Jordan Ruthe 32ccfc125d install: Add check for Xwrapper.conf file. Add it if it does not exist 2021-01-08 11:09:34 -05:00
Jordan Ruthe ffb24a2ffd install: Add user to tty group 2021-01-08 10:34:26 -05:00
Jordan Ruthe 6e3965bf6c docs: Update installation on how to turn off base GUI 2021-01-08 10:25:02 -05:00
Jordan Ruthe b1f110c13a screen_panel: change panel name so it's not language localized in logging 2021-01-08 08:35:35 -05:00
Jordan Ruthe 6f15bb1d91 docs: Update changelog, Fix rename of KS Settings to Settings 2021-01-08 08:24:06 -05:00
Jordan Ruthe ca8abecb55 gcode_macros: Update to hide macros based on settings 2021-01-07 01:02:38 -05:00
Jordan Ruthe 934acd0ad0 move: Update to get configuration value properly 2021-01-07 01:02:25 -05:00
Jordan Ruthe 71abc27ad8 splash_screen: Don't display power on if no power devices 2021-01-07 01:02:10 -05:00
Jordan Ruthe 642fe8a52e settings: Create settings panel for KlipperScreen settings 2021-01-07 01:01:55 -05:00
Jordan Ruthe b2b3127183 extrude: Include translations in function 2021-01-07 01:00:43 -05:00
Jordan Ruthe d11e9ec3a6 Create script to update translations with new words and update translation files 2021-01-07 00:59:39 -05:00
Jordan Ruthe 3fee1ff947 zh_CN: Add translation 2021-01-07 00:24:24 -05:00
Jordan Ruthe 0bdb5ac457 he_IL: Updates to translations 2021-01-07 00:24:10 -05:00
Jordan Ruthe 3a60277392 extrude: Updates for language compatability 2021-01-03 18:44:19 -05:00
Jordan Ruthe 0b8751836c Add fr_FR translation 2021-01-03 16:23:21 -05:00
Jordan Ruthe e227f22aba Update he_IL translations 2021-01-03 16:22:41 -05:00
Jordan Ruthe b57cbc8352 Language support for RTL and he_IL 2021-01-03 16:04:26 -05:00
Jordan Ruthe 7b593b704c screen_panel: Parse jinja from config file 2021-01-03 12:45:39 -05:00
Jordan Ruthe 3c2bdee22a Update to allow translations from config file. Updates to use translations from config file. 2021-01-03 12:43:53 -05:00
Jordan Ruthe c08a293f83 job_status: fix problem with directories in the filename 2020-12-29 10:35:23 -05:00
Jordan 9d89311bcc updates to several panels to account for a lack of heater_bed 2020-12-28 17:08:17 -05:00
Jordan 63764ee32e config: log only defined config, redact api key 2020-12-28 16:30:05 -05:00
Jordan c58b040be2 printer: change how states are transitioned 2020-12-28 16:21:15 -05:00
Jordan 389eceaf06 job_status: fix percentage above 100; fix no timeout for job complete 2020-12-28 15:53:20 -05:00
Jordan 9aa4389eaf websocket: remove token debug 2020-12-28 11:53:00 -05:00
Jordan 931d15b6cc printer: Updates to make toolcount less confusing 2020-12-28 11:52:54 -05:00
Jordan 3abbe921b2 extrude: fix panel to allow for multiple extruders 2020-12-21 10:01:21 -05:00
Jordan e2a0f86f45 panels: Add extruder-0 image so that panels align to the T0/T1.. command 2020-12-21 09:57:42 -05:00
Jordan 263b07ae94 docs: update changelog 2020-12-21 09:42:48 -05:00
Jordan f223332cd8 job_status: updates to show active extruder 2020-12-21 09:40:26 -05:00
Jordan 1c2519be41 gcode_macros: visual updates 2020-12-20 23:52:01 -05:00
Jordan 9016b67c6f power: visual updates 2020-12-20 23:51:41 -05:00
Jordan 37c043b3f9 KlippyWebsocket: changes to allow for moonraker api key 2020-12-20 15:43:42 -05:00
Jordan 717e4ee902 readme: updates to hardware 2020-12-18 15:43:39 -05:00
Jordan cb90a0bd70 docs: Update for gcode_macros panel 2020-12-18 15:30:57 -05:00
Jordan 6a6161dfef printer: add bltouch/probe variables 2020-12-18 15:25:35 -05:00
Jordan 1973002b3d power: cleanup dependency 2020-12-18 15:22:30 -05:00
Jordan 51714180ac gcode_macros: add a panel for gcode macros 2020-12-18 15:22:16 -05:00
Jordan 246c15494c screen: Allow fallback for other languages 2020-12-18 13:10:45 -05:00
Jordan 5c1d5a1825 screen: Better error display for klippy 2020-12-18 13:02:10 -05:00
dependabot[bot] 136ecf79fb build(deps): bump humanize from 3.1.0 to 3.2.0 (#31)
Bumps [humanize](https://github.com/jmoiron/humanize) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/jmoiron/humanize/releases)
- [Commits](https://github.com/jmoiron/humanize/compare/3.1.0...3.2.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-18 12:34:13 -05:00
dependabot[bot] 3fe1665e0b build(deps): bump requests from 2.25.0 to 2.25.1 (#33)
Bumps [requests](https://github.com/psf/requests) from 2.25.0 to 2.25.1.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.25.0...v2.25.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-12-18 12:33:56 -05:00
Jordan Ruthe c3f96418ea screen: allow custom moonraker url/port 2020-12-16 23:02:33 -05:00
Jordan Ruthe bcbbc03151 config: Allow specifying configfile location from command line 2020-12-16 23:00:50 -05:00
Jordan Ruthe 51da7cecc8 job_status: change how metadata update is handled 2020-12-10 17:01:51 -05:00
Jordan Ruthe 07554250ad screen: Catch "startup" state from moonraker 2020-12-10 12:35:44 -05:00
Jordan Ruthe 9f4204b898 job_status: update Z value to gcode value 2020-12-09 13:25:01 -05:00
Jordan Ruthe 5682eb5616 fix job status panel not updating filename after one print 2020-12-08 23:48:48 -05:00
Jordan Ruthe 47d08f5385 job_status: line wrapping for filenames with no spaces 2020-12-08 23:38:38 -05:00
Jordan Ruthe ecc4c5ac4c readme: Include more links/info 2020-12-08 23:35:45 -05:00
Jordan Ruthe f343f03b96 job_status: Refactored layout in panel 2020-12-08 23:32:27 -05:00
Jordan Ruthe 36c9b42970 splash_screen: Update klipper logo to scale for lower resolutions 2020-12-08 20:28:15 -05:00
Jordan Ruthe 5408aec036 screen: fix broken function call 2020-12-07 15:53:50 -05:00
Jordan Ruthe 7471cd39b9 style: fix color on progress bar 2020-12-07 15:46:50 -05:00
jordanruthe 238badb110 UI scaling (#28)
* Initial UI scaling commit

* temperature: updates to styling

* screen: fix dialog creation

* bed_level: scale images

* job_status: updates to scaling
2020-12-07 15:44:03 -05:00
Jordan Ruthe ea465b0f4d bed_level: fix math error 2020-12-06 21:23:16 -05:00
Jordan Ruthe fb0a0557c5 docs: Updates to bed_level panel 2020-12-06 21:04:09 -05:00
Jordan Ruthe e6b71d5478 screen: fixes to popup message 2020-12-06 21:03:32 -05:00
Jordan Ruthe a18eb42399 screen: init GTK earlier 2020-12-06 16:09:27 -05:00
Jordan Ruthe 9047f58c60 bed_level: change so only screws_tilt_adjust section will take into account the probe offset 2020-12-06 16:06:34 -05:00
Jordan Ruthe 1c384144c4 files: load metadata faster than 6 seconds after start 2020-12-06 15:30:55 -05:00
Jordan Ruthe 348a9e3e42 screen: move version ahead of config output in logfile 2020-12-06 15:30:37 -05:00
Jordan Ruthe 4736ed4d84 bed_level: updates to screws_tilt_calculate feature 2020-12-05 17:09:29 -05:00
Jordan Ruthe 0907c6a06a move: Allow inverting of the axis 2020-12-05 15:42:34 -05:00
Jordan Ruthe cf3a924bb2 screen: Set buttons under message bar to not be sensitive when covered 2020-12-05 14:14:02 -05:00
Jordan Ruthe d61db5fb17 files: Changes to metadata request to fix getting stuck in a loop 2020-12-05 13:50:15 -05:00
Jordan Ruthe 3ad44d9ecf configuration: update icons for homing 2020-12-05 13:46:17 -05:00
Jordan Ruthe cb39b469b0 bed_level: include screws_tilt_calculate command 2020-12-04 19:41:45 -05:00
Jordan Ruthe 5ad29f0183 screen: popup error messages 2020-12-04 19:11:16 -05:00
Jordan Ruthe a2f178c7e0 extrude: fix not showing temperatures 2020-12-04 18:28:49 -05:00
Jordan Ruthe 7efb0fddf0 fan: Remove user select buttons if fan on/off is hit while selecting 2020-12-04 14:26:08 -05:00
Jordan Ruthe 46410f797a fine_tune: Remove fan from fine tune panel. Add fan to print menu 2020-12-04 14:20:31 -05:00
Jordan Ruthe c7496973ee docs: Update with latest changes 2020-12-04 14:13:41 -05:00
Jordan Ruthe 2d29eef255 configuration: hide extrude while printing 2020-12-04 14:13:10 -05:00
Jordan Ruthe 3e11fad1fd bed_mesh: Add panel for bed_mesh 2020-12-04 14:13:03 -05:00
Jordan Ruthe a724836378 fine_tune: remove unused code 2020-12-04 14:04:09 -05:00
Jordan Ruthe 25b89cb7e9 menu: refactor adding items to menu so they can be dynamically added/rmeoved. 2020-12-04 14:03:14 -05:00
Jordan Ruthe b37ba531f7 screen: add popup message capability 2020-12-04 14:02:06 -05:00
Jordan Ruthe 58b6325776 screen: cleanup unused code 2020-12-04 14:01:50 -05:00
Jordan Ruthe 5cfed7f477 install: enable systemd 2020-12-03 20:22:17 -05:00
Jordan Ruthe 369fc24e16 screen: include "error" for state calculation 2020-12-03 13:40:25 -05:00
Jordan Ruthe a099151693 job_status: Fix problem with cancel print not working 2020-12-03 09:46:45 -05:00
Jordan Ruthe c182cc21f2 z_calibrate: uncomment probe commands 2020-12-02 19:22:04 -05:00
Jordan Ruthe 16f7d4543a job_status: Update confirm dialog. Fix variable name 2020-12-02 16:33:04 -05:00
62 changed files with 7253 additions and 1342 deletions

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: klipperscreen
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
+20 -7
View File
@@ -1,5 +1,5 @@
# KlipperScreen
KlipperScreen is an idea based from [OctoScreen](https://github.com/Z-Bolt/OctoScreen/), but instead of needing OctoPrint or to compile go, KlipperScreen is python based and interacts directly with Moonraker, Klipper's API service, so that it can be run with no dependencies besides Klipper.
KlipperScreen is an idea based from [OctoScreen](https://github.com/Z-Bolt/OctoScreen/), but instead of needing OctoPrint or to compile go, KlipperScreen is python based and interacts directly with [Moonraker](https://github.com/arksine/moonraker), Klipper's API service.
Current feature list:
- [x] Homing
@@ -13,20 +13,33 @@ Current feature list:
- [x] Print tuning (Z Babystepping, Speed Control, Flow Control)
- [x] Manual bed leveling assist
- [x] Using thumbnails from prusa on job status page
- [x] Scale UI based off of resolution
- [ ] Better system panel
- [ ] Wifi selection
- [ ] Scale UI based off of resolution
More details to come...
[Changelog](docs/changelog.md)
### Required Hardware
KlipperScreen should run on any HDMI touchscreen that you can connect to a computer. The required video driver may
be slightly different depending on what model you get. I am developing on a 1024x600 resolution screen. Due to this,
other resolutions may not be scaled properly at this moment. UI scaling is a future development item.
KlipperScreen should run on any touchscreen that you can connect to a computer. The required video driver may be
slightly different depending on what model you get. KlipperScreen will scale to the resolution of the screen being used.
However, three resolutions are tested during development: 1024x600, 800x480, 480x320.
There are no recommended screens, but there are several screens that work with KlipperScreen. They include screens that
use HDMI/USB, Raspberry Pi GPIO, or the Rapsberry Pi DSI (ribbon cable) port.
### Links
[Installation](docs/Installation.md)
[Configuration](docs/Configuration.md)
[Panels](docs/panels.md)
### Sample Panels
Main Menu
![Main Menu](docs/img/main_panel.png)
Job Status
![Job Status](docs/img/job_status.png)
+51 -2
View File
@@ -1,7 +1,51 @@
# Configuration
In the KlipperScreen folder, a file _KlipperScreen.conf_ allows for configuration of the screen. This document will
detail how to configure KlipperScreen. A default config is included here: [ks_includes/KlipperScreen.conf](../ks_includes/KlipperScreen.conf)
KlipperScreen has some configuration options which are outlined below. KlipperScreen will search for a configuration
file in the following order:
_${HOME}/KlipperScreen.conf_
_${KlipperScreen_Directory}/KlipperScreen.conf_
If one of those files are found, it will be used over the default configuration. The default configuration will be
merged with the custom configuration, so if you do not define any menus the default menus will be used.The default
config is included here: [ks_includes/KlipperScreen.conf](../ks_includes/KlipperScreen.conf)
## Main Options
```
[main]
# Invert axis in move panel. Default is False. Change to true to invert
invert_x: False
invert_y: False
invert_z: False
# Time (seconds) before the Job Status page reverts to main menu after a successful job
job_complete_timeout: 30
# Time (seconds) before the Job Status page reverts to main menu after a successful job.
# If this option is 0, the user must click on a button to go back to the main menu.
job_error_timeout: 0
#
# The following main options are deprecated and will be removed in the near future
#
# Define the moonraker host/port if different from 127.0.0.1 and 7125
moonraker_host: 127.0.0.1
moonraker_port: 7125
# Moonraker API key if this is not connecting from a trusted client IP
moonraker_api_key: False
```
## Printer Options
Multiple printers can be defined, currently only the first one will be used until an update in the near future.
```
# Define printer and name. Name is anything after the first printer word
[printer Ender 3 Pro]
# Define the moonraker host/port if different from 127.0.0.1 and 7125
moonraker_host: 127.0.0.1
moonraker_port: 7125
# Moonraker API key if this is not connecting from a trusted client IP
moonraker_api_key: False
```
## Preheat Options
@@ -40,6 +84,11 @@ Available panels are listed here: [docs/panels.md](panels.md)
Certain variables are available for conditional testing of the enable statement:
```
printer.bltouch # Available if bltouch section defined in config
printer.gcode_macros.count # Number of gcode macros
printer.idle_timeout # Idle timeout section
printer.pause_resume # Pause resume section of Klipper
printer.probe # Available if probe section defined in config
printer.power_devices.count # Number of power devices configured in Moonraker
```
+47 -5
View File
@@ -19,6 +19,15 @@ After changing _/boot/config.txt_ you must reboot your raspberry pi. Please also
### Installation
#### Setup Raspberry Pi
This install process is meant for Raspbian non-desktop version. If you have installed it on the GUI version, use
`sudo raspi-config` to set boot to console by choosing the following options in order:
* 1 System Options
* S5 Boot / Auto Login
* B1 Console
#### Klipper and Moonraker Installation
Follow the instructions to install klipper and moonraker.
klipper: https://github.com/KevinOConnor/klipper/
moonraker: https://github.com/Arksine/moonraker
@@ -30,11 +39,44 @@ trusted_clients:
127.0.0.1
```
For moonraker, ensure that 127.0.0.1 is a trusted client:
If you wish to use the update manager feature of moonraker for KlipperScreen, add the following block into the moonraker
configuration:
```
[update_manager client KlipperScreen]
type: git_repo
path: /home/pi/KlipperScreen
origin: https://github.com/jordanruthe/KlipperScreen.git
env: /home/pi/.KlipperScreen-env/bin/python
requirements: scripts/KlipperScreen-requirements.txt
install_script: scripts/KlipperScreen-install.sh
```
Run _scripts/KlipperScreen-install.sh_
This script will install packages that are listed under manual install, create a
python virtual environment at ${HOME}/.KlipperScreen-env and install a systemd
service file.
#### KlipperScreen Installation
To clone and install execute the following commands:
```
cd ~/
git clone https://github.com/jordanruthe/KlipperScreen.git
cd ~/KlipperScreen
./scripts/KlipperScreen-install.sh
```
This script will install packages that are listed under manual install, create a python virtual environment at
${HOME}/.KlipperScreen-env and install a systemd service file.
KlipperScreen will create a log file output at `/tmp/KlipperScreen.log`. If you are having issues and KlipperScreen has
not gotten to the point where the log file has been created. Run `journalctl -xe -u KlipperScreen` to view the ouput and
see any issues that may be happening.
As an option to do development or interact with KlipperScreen from your computer, you may install tigervnc-scraping-server and VNC to your pi instance. Follow tigervnc server setup procedures for details on how to do that.
If you need a custom location for the configuration file, you can add -c or --configfile to the systemd file and specify
the location of your configuration file.
#### Touchscreen Calibration
Most people don't need to calibrate, but if you do need to calibrate your touchscreen, follow this process:
```
DISPLAY=:0 xinput_calibrator --list
Device "wch.cn USB2IIC_CTP_CONTROL" id=6
DISPLAY=:0 xinput_calibrator -v --device <id from last command>
```
+19
View File
@@ -0,0 +1,19 @@
## Create Translations
You can use a editor such as [poedit](https://poedit.net/) to assist in translations. This guide will assume that you
will be using poedit.
This guide will refer to `language designation`. This can be found from running `echo $LANG` on your pi, as long as you
have set your pi up for your preferred language.
#### New Language
* Select `Create a new translation` or `File -> New from POT/PO` and select `ks_includes/locals/KlipperScreen.pot`.
* Enter your language designation.
* Create the translations
* Save the file as `ks_includes/locales/{LANGUAGE DESIGNATION}/KlipperScreen.po`.
* Select `File -> Compile to MO`. Save this file as `ks_includes/locales/{LANGUAGE DESIGNATION}/KlipperScreen.mo`
Once you have followed those steps, as long as your pi is set up for your preferred language, KlipperScreen will
automatically use the translations provided in the file. KlipperScreen currently does not detect RTL languages, but
support for RTL is planned in the near future.
+68
View File
@@ -1,5 +1,73 @@
## Changelog
#### 2021 02 15
* Added action bar to left side (moves the Back, E-stop, and Home buttons)
* Added wifi manager. Will show current wifi details in network panel. Will allow switching networks in the future.
* Show printer name in main menu (user will need to configure the printer)
#### 2021 01 21
* Configure screen blanking from settings panel
#### 2021 01 21
* !! Important. matchbox-keyboard must be installed. Install script has changed to include this
* Added onscreen keyboard
* Can now add bed mesh profiles
#### 2021 01 20
* Add different time estimation methods to settings panel
* Job status panel will use time estimation method selected from settings panel
* Bugfixes to state tracking
#### 2021 01 10
* Added system reboot/shutdown buttons to systems panel.
#### 2021 01 09
* Better RTL support (most panels now properly support RTL)
* Fixes to install script for latest version of raspbian.
#### 2021 01 08
* Added settings panel. Invert axis and hiding macros can now be configured from within KlipperScreen
#### 2021 01 03
* Updated base language translation files with new phrases
* Allow translations from KlipperScreen.conf for
* Update menus for RTL languages
* Add fr_FR and he_IL language (courtesy of manu7irl)
#### 2020 12 21
* KlipperScreen doesn't have to be a trusted client. It can use the Moonraker API key
* Updates to job_status for multiple extruders. Will now show the current extruder.
* Updates to extrude panel to show multiple extruders and allow switching between them.
#### 2020 12 18
* Add gcode_macros panel
#### 2020 12 16
* Config file can now be specified when running from the command line
* Moonraker host/port can be specified in the configuration file
#### 2020 12 09
* Z value in job status now reflects the gcode Z value. This allows people with ABL to have a better understanding of Z
#### 2020 12 08
* Screen Width/Height are now definable in the configuration file
* Changed job page to allow for more information, display thumbnail of STL
* Job page will now say a job is complete and timeout to the main menu (time changeable from the config)
* Job page will now stay on the job page if there is an error.
* Restart option is available upon a completed/failed job
#### 2020 12 05
* Added ability to invert Z axis in move panel
* Fixed problem with metadata being retrieved constantly
#### 2020 12 04
* Removed fan options from fine tuning
* Add bed mesh panel
* Added more variables to the menu enable option
* Hide extrude panel during printing if the printer is not paused
* Add fan panel to print control menu
* Included screws_tilt_calculate gcode command into the bed level panel. This section must be configured in klipper.
#### 2020 12 02
* Change panel layout: Added Title, Back, Emergency Stop, and Home to panels.
Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 273 KiB

+18
View File
@@ -7,6 +7,7 @@
* [extrude](#extrude)
* [fan](#fan)
* [fine_tune](#finetune)
* [gcode_macros](#gcode-macros)
* [move](#move)
* [network](#network)
* [preheat](#preheat)
@@ -26,6 +27,19 @@
type: bed_level
![Bed Level](img/bedlevel.png)
The bed level panel has the ability to have preset locations from Klipper. Please see documentation on the following
Klipper Sections:
* [bed_screws](https://github.com/KevinOConnor/klipper/blob/master/docs/Config_Reference.md#bed_screws)
* [screws_tilt_adjust](https://github.com/KevinOConnor/klipper/blob/master/docs/Config_Reference.md#screws_tilt_adjust)
_Important Note: Due to Klipper using the bltouch/probe offsets in screws_tilt_adjust, if a bltouch/probe is enabled_
_KlipperScreen will add the offset to the defined screw values. This will not occur if bed_screws section is used._
This panel will favor screws_tilt_adjust over the bed_screws section. If screws_tilt_adjust is defined, an extra button
for _Screws Calibrate_ will appear. This button runs the SCREWS_TILT_CALCULATE command and shows the results on the
panel.
### Extrude
type: extrude
![Extrude](img/extrude.png)
@@ -38,6 +52,10 @@ type: fan
type: fine_tune
![Fine Tune Panel](img/fine_tune.png)
### Gcode Macros
type: gcode_macros
![Gcode Macros Panel](img/gcode_macros.png)
### Menu
type: menu
![Menu Panel](img/menu.png)
+102 -36
View File
@@ -1,3 +1,7 @@
[main]
moonraker_host: 127.0.0.1
moonraker_port: 7125
[preheat PLA]
bed = 40
extruder = 195
@@ -7,146 +11,208 @@ bed = 90
extruder = 220
[menu __main]
name: Main Menu
name: {{ gettext('Main Menu') }}
[menu __main homing]
name: Homing
name: {{ gettext('Homing') }}
icon: home
[menu __main preheat]
name: Preheat
name: {{ gettext('Preheat') }}
icon: heat-up
panel: preheat
[menu __main actions]
name: Actions
name: {{ gettext('Actions') }}
icon: actions
[menu __main config]
name: Configuration
name: {{ gettext('Configuration') }}
icon: control
[menu __main print]
name: Print
name: {{ gettext('Print') }}
icon: print
panel: print
[menu __main homing homeall]
name: Home All
name: {{ gettext('Home All') }}
icon: home
method: printer.gcode.script
params: {"script":"G28"}
[menu __main homing homex]
name: Home X
icon: home
name: {{ gettext('Home X') }}
icon: home-x
method: printer.gcode.script
params: {"script":"G28 X"}
[menu __main homing homey]
name: Home Y
icon: home
name: {{ gettext('Home Y') }}
icon: home-y
method: printer.gcode.script
params: {"script":"G28 Y"}
[menu __main homing homez]
name: Home Z
icon: home
name: {{ gettext('Home Z') }}
icon: home-z
method: printer.gcode.script
params: {"script":"G28 Z"}
[menu __main homing homexy]
name: Home XY
name: {{ gettext('Home XY') }}
icon: home
method: printer.gcode.script
params: {"script":"G28 X Y"}
[menu __main actions move]
name: Move
name: {{ gettext('Move') }}
icon: move
panel: move
[menu __main actions extrude]
name: Extrude
name: {{ gettext('Extrude') }}
icon: filament
panel: extrude
[menu __main actions fan]
name: Fan
name: {{ gettext('Fan') }}
icon: fan
panel: fan
[menu __main actions temperature]
name: Temperature
name: {{ gettext('Temperature') }}
icon: heat-up
panel: temperature
[menu __main actions quad_gantry_level]
name: {{ gettext('Quad Gantry Level') }}
icon: home-z
method: printer.gcode.script
params: {"script":"QUAD_GANTRY_LEVEL"}
enable: {{ printer.quad_gantry_level is defined }}
[menu __main actions macros]
name: {{ gettext('Macros') }}
icon: custom-script
panel: gcode_macros
enable: {{ printer.gcode_macros.count > 0 }}
[menu __main actions power]
name: Power
name: {{ gettext('Power') }}
icon: shutdown
panel: power
enable: {{ printer.power_devices.count > 0 }}
[menu __main actions disablemotors]
name: Disable Motors
name: {{ gettext('Disable Motors') }}
icon: motor-off
method: printer.gcode.script
params: {"script":"M18"}
[menu __main config bedlevel]
name: Bed Level
name: {{ gettext('Bed Level') }}
icon: bed-level
panel: bed_level
[menu __main config bedmesh]
name: {{ gettext('Bed Mesh') }}
icon: bed-level
panel: bed_mesh
enable: {{ printer.bed_mesh is defined }}
[menu __main config zoffset]
name: Z Calibrate
name: {{ gettext('Z Calibrate') }}
icon: z-offset-increase
panel: zcalibrate
enable: {{ ((printer.bltouch is defined) or (printer.probe is defined)) }}
[menu __main config network]
name: Network
name: {{ gettext('Network') }}
icon: network
panel: network
[menu __main config system]
name: System
name: {{ gettext('System') }}
icon: info
panel: system
[menu __main config save]
name: Save Config
name: {{ gettext('Save Config') }}
icon: complete
method: printer.gcode.script
params: {"script":"SAVE_CONFIG"}
confirm:
Save configuration.
{{ gettext('Save configuration.') }}
Klipper will reboot
{{ gettext('Klipper will reboot') }}
[menu __main config settings]
name: {{ gettext('Settings') }}
icon: settings
panel: settings
[menu __print]
name: Print Control
name: {{ gettext('Print Control') }}
[menu __print temperature]
name: Temperature
name: {{ gettext('Temperature') }}
icon: heat-up
panel: temperature
[menu __print tuning]
name: Fine Tuning
name: {{ gettext('Fine Tuning') }}
icon: fan
panel: fine_tune
[menu __print fan]
name: {{ gettext('Fan') }}
icon: fan
panel: fan
[menu __print extrude]
name: {{ gettext('Extrude') }}
icon: filament
panel: extrude
enable: {{ printer.pause_resume.is_paused == True }}
[menu __print power]
name: {{ gettext('Power') }}
icon: shutdown
panel: power
enable: {{ printer.power_devices.count > 0 }}
[menu __print network]
name: Network
name: {{ gettext('Network') }}
icon: network
panel: network
[menu __print system]
name: System
name: {{ gettext('System') }}
icon: info
panel: system
[menu __print extrude]
name: Extrude
icon: filament
panel: extrude
[menu __print settings]
name: {{ gettext('Settings') }}
icon: settings
panel: settings
[menu __splashscreen]
name: {{ gettext('Menu') }}
[menu __splashscreen power]
name: {{ gettext('Power') }}
icon: shutdown
panel: power
enable: {{ printer.power_devices.count > 0 }}
[menu __splashscreen network]
name: {{ gettext('Network') }}
icon: network
panel: network
[menu __splashscreen system]
name: {{ gettext('System') }}
icon: info
panel: system
+16 -4
View File
@@ -34,16 +34,16 @@ class KlippyGcodes:
@staticmethod
def set_bed_temp(temp):
return KlippyGcodes.SET_BED_TEMP + " S" + str(temp)
return "%s S%s" % (KlippyGcodes.SET_BED_TEMP, str(temp))
@staticmethod
def set_ext_temp(temp, tool=0):
return KlippyGcodes.SET_EXT_TEMP + " T" + str(tool) + " S" + str(temp)
return "%s T%s S%s" % (KlippyGcodes.SET_EXT_TEMP, str(tool), str(temp))
@staticmethod
def set_fan_speed(speed):
speed = str( int(float(int(speed) % 101)/100*255) )
return KlippyGcodes.SET_FAN_SPEED + " S"+ speed
return "%s S%s" % (KlippyGcodes.SET_FAN_SPEED, speed)
@staticmethod
def set_extrusion_rate(rate):
@@ -59,4 +59,16 @@ class KlippyGcodes:
@staticmethod
def extrude(dist, speed=500):
return KlippyGcodes.MOVE + " E" + dist + " F" + speed
return "%s E%s F%s" % (KlippyGcodes.MOVE, dist, speed)
@staticmethod
def bed_mesh_load(profile):
return "BED_MESH_PROFILE LOAD='%s'" % profile
@staticmethod
def bed_mesh_remove(profile):
return "BED_MESH_PROFILE REMOVE='%s'" % profile
@staticmethod
def bed_mesh_save(profile):
return "BED_MESH_PROFILE SAVE='%s'" % profile
+98 -56
View File
@@ -1,30 +1,71 @@
# -*- coding: utf-8 -*-
import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib, Pango
import os
klipperscreendir = os.getcwd()
logger = logging.getLogger("KlipperScreen.KlippyGtk")
class KlippyGtk:
labels = {}
font_ratio = 51
width_ratio = 16
height_ratio = 9.375
@staticmethod
def Label(label, style):
def __init__(self, width, height):
self.width = width
self.height = height
self.font_size = int(round(self.width / self.font_ratio))
self.header_size = int(round((self.width / self.width_ratio) / 1.33))
self.img_width = int(round(self.width / self.width_ratio))
self.img_height = int(round(self.height / self.height_ratio))
self.action_bar_width = int(self.width * .1)
self.header_image_scale_width = 1.2
self.header_image_scale_height = 1.4
logger.debug("img width: %s height: %s" % (self.img_width, self.img_height))
def get_action_bar_width(self):
return self.action_bar_width
def get_content_width(self):
return self.width - self.action_bar_width
def get_content_height(self):
return self.height - self.header_size
def get_header_size(self):
return self.header_size
def get_header_image_scale(self):
return [self.header_image_scale_width, self.header_image_scale_height]
def get_image_width(self):
return self.img_width
def get_image_height(self):
return self.img_height
def get_font_size(self):
return self.font_size
def Label(self, label, style=None):
l = Gtk.Label(label)
if style != False:
if style != None and style != False:
l.get_style_context().add_class(style)
return l
@staticmethod
def ImageLabel(image_name, text, size=20, style=False):
def ImageLabel(self, image_name, text, size=20, style=False, width_scale=.32, height_scale=.32):
box1 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=15)
image = Gtk.Image()
#TODO: update file reference
image.set_from_file(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg")
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
"%s/styles/z-bolt/images/%s.svg" % (klipperscreendir, str(image_name)),
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg", 20, 20, True)
image.set_from_pixbuf(pixbuf)
image = Gtk.Image.new_from_pixbuf(pixbuf)
label = Gtk.Label()
label.set_text(text)
@@ -37,35 +78,26 @@ class KlippyGtk:
return {"l": label, "b": box1}
@staticmethod
def Image(image_name, style=False, width=None, height=None):
pixbuf = GdkPixbuf.Pixbuf.new_from_file(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg")
if height != None and width != None:
pixbuf = pixbuf.scale_simple(width, height, GdkPixbuf.InterpType.BILINEAR)
def Image(self, image_name, style=False, width_scale=1, height_scale=1):
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
"%s/styles/z-bolt/images/%s" % (klipperscreendir, str(image_name)),
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
return Gtk.Image.new_from_pixbuf(pixbuf)
@staticmethod
def ImageFromFile(filename, style=False, width=None, height=None):
if height != -1 or width != -1:
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, width, height, True)
else:
pixbuf = GdkPixbuf.Pixbuf.new_from_file(filename)
def ImageFromFile(self, filename, style=False, width_scale=1, height_scale=1):
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename,
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
return Gtk.Image.new_from_pixbuf(pixbuf)
@staticmethod
def PixbufFromFile(filename, style=False, width=None, height=None):
if height != -1 or width != -1:
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, width, height, True)
else:
pixbuf = GdkPixbuf.Pixbuf.new_from_file(filename)
def PixbufFromFile(self, filename, style=False, width_scale=1, height_scale=1):
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, int(round(self.img_width * width_scale)),
int(round(self.img_height * height_scale)), True)
return pixbuf
@staticmethod
def ProgressBar(style=False):
def ProgressBar(self, style=False):
bar = Gtk.ProgressBar()
if style != False:
@@ -74,8 +106,7 @@ class KlippyGtk:
return bar
@staticmethod
def Button(label=None, style=None):
def Button(self, label=None, style=None):
b = Gtk.Button(label=label)
b.set_hexpand(True)
b.set_vexpand(True)
@@ -87,13 +118,15 @@ class KlippyGtk:
return b
@staticmethod
def ButtonImage(image_name, label=None, style=None, height=None, width=None):
pixbuf = GdkPixbuf.Pixbuf.new_from_file(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg")
if height != None and width != None:
pixbuf = pixbuf.scale_simple(width, height, GdkPixbuf.InterpType.BILINEAR)
def ButtonImage(self, image_name, label=None, style=None, width_scale=1, height_scale=1,
position=Gtk.PositionType.TOP):
filename = "%s/styles/z-bolt/images/%s.svg" % (klipperscreendir, str(image_name))
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
filename,
int(round(self.img_width * width_scale)),
int(round(self.img_height * height_scale)),
True
)
img = Gtk.Image.new_from_pixbuf(pixbuf)
@@ -102,17 +135,24 @@ class KlippyGtk:
b.set_hexpand(True)
b.set_vexpand(True)
b.set_can_focus(False)
b.set_image_position(Gtk.PositionType.TOP)
b.set_image_position(position)
b.set_always_show_image(True)
b.props.relief = Gtk.ReliefStyle.NONE
#try:
# # Get the label object
# child = b.get_children()[0].get_children()[0].get_children()[1]
# child.set_line_wrap(True)
# child.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
#except:
# pass
if style != None:
b.get_style_context().add_class(style)
return b
@staticmethod
def Dialog(screen, buttons, content, callback=None, *args):
def Dialog(self, screen, buttons, content, callback=None, *args):
dialog = Gtk.Dialog()
dialog.set_default_size(screen.width - 15, screen.height - 15)
dialog.set_resizable(False)
@@ -144,9 +184,16 @@ class KlippyGtk:
return dialog, grid
@staticmethod
def ToggleButtonImage(image_name, label, style=False):
img = Gtk.Image.new_from_file(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg")
def ToggleButtonImage(self, image_name, label, style=False, width_scale=1, height_scale=1):
filename = "%s/styles/z-bolt/images/%s.svg" % (klipperscreendir, str(image_name))
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
filename,
int(round(self.img_width * width_scale)),
int(round(self.img_height * height_scale)),
True
)
img = Gtk.Image.new_from_pixbuf(pixbuf)
b = Gtk.ToggleButton(label=label)
#b.props.relief = Gtk.RELIEF_NONE
@@ -164,8 +211,7 @@ class KlippyGtk:
return b
@staticmethod
def HomogeneousGrid(width=None, height=None):
def HomogeneousGrid(self, width=None, height=None):
g = Gtk.Grid()
g.set_row_homogeneous(True)
g.set_column_homogeneous(True)
@@ -173,16 +219,14 @@ class KlippyGtk:
g.set_size_request(width, height)
return g
@staticmethod
def ToggleButton(text):
def ToggleButton(self, text):
b = Gtk.ToggleButton(text)
b.props.relief = Gtk.ReliefStyle.NONE
b.set_hexpand(True)
b.set_vexpand(True)
return b
@staticmethod
def formatFileName(name):
def formatFileName(self, name):
name = name.split('/')[-1] if "/" in name else name
name = name.split('.gcod')[0] if ".gcode" in name else name
if len(name) > 25:
@@ -190,8 +234,7 @@ class KlippyGtk:
return name
@staticmethod
def formatTimeString(seconds):
def formatTimeString(self, seconds):
time = int(seconds)
text = ""
if int(time/3600) !=0:
@@ -199,8 +242,7 @@ class KlippyGtk:
text += str(int(time/60)%60)+"m "+str(time%60)+"s"
return text
@staticmethod
def formatTemperatureString(temp, target):
def formatTemperatureString(self, temp, target):
if (target > temp-2 and target < temp+2) or round(target,0) == 0:
return str(round(temp,2)) + "°C" #°C →"
return str(round(temp)) + " → " + str(round(target)) + "°C"
+13 -2
View File
@@ -5,20 +5,31 @@ import logging
logger = logging.getLogger("KlipperScreen.KlippyRest")
class KlippyRest:
def __init__(self, ip, port=7125):
def __init__(self, ip, port=7125, api_key=False):
self.ip = ip
self.port = port
self.api_key = api_key
def get_server_info(self):
return self.send_request("server/info")
def get_oneshot_token(self):
r = self.send_request("access/oneshot_token")
if r == False:
return False
return r['result']
def get_printer_info(self):
return self.send_request("printer/info")
def send_request(self, method):
url = "http://%s:%s/%s" % (self.ip, self.port, method)
logger.debug("Sending request to %s" % url)
r = requests.get(url)
headers = {} if self.api_key == False else {"x-api-key":self.api_key}
try:
r = requests.get(url, headers=headers)
except:
return False
if r.status_code != 200:
return False
+32 -13
View File
@@ -38,26 +38,28 @@ class KlippyWebsocket(threading.Thread):
callback_table = {}
timeout = None
def __init__(self, screen, callback):
def __init__(self, screen, callback, host, port):
threading.Thread.__init__(self)
self._screen = screen
self._callback = callback
self.klippy = MoonrakerApi(self)
self.closing = False
self._url = "127.0.0.1:7125"
self._url = "%s:%s" % (host, port)
def initial_connect(self):
# Enable a timeout so that way if moonraker is not running, it will attempt to reconnect
if self.timeout == None:
self.timeout = GLib.timeout_add(500, self.reconnect)
def connect (self):
#r = requests.get(
# "http://%s%s" % (self._url, api['oneshot_token']['url']),
# headers={"x-api-key":api_key}
#)
#if r.status_code != 200:
# logger.info("Failed to retrieve oneshot token")
# return
try:
token = self._screen.apiclient.get_oneshot_token()
except:
logger.debug("Unable to get oneshot token")
return False
#token = json.loads(r.content)['result']
#self.ws_url = "ws://%s/websocket?token=%s" % (self._url, token)
self.ws_url = "ws://%s/websocket" % (self._url)
self.ws_url = "ws://%s/websocket?token=%s" % (self._url, token)
self.ws = websocket.WebSocketApp(self.ws_url,
on_message = lambda ws,msg: self.on_message(ws, msg),
on_error = lambda ws,msg: self.on_error(ws, msg),
@@ -72,6 +74,9 @@ class KlippyWebsocket(threading.Thread):
except Exception:
logger.debug("Error starting web socket")
def close(self):
self.closing = True
def is_connected(self):
return self.connected
@@ -132,6 +137,11 @@ class KlippyWebsocket(threading.Thread):
logger.debug("Connection already closed")
return
if self.closing == True:
logger.debug("Closing websocket")
self.ws.stop()
return
logger.info("Moonraker Websocket Closed")
self.connected = False
if self.timeout == None:
@@ -155,7 +165,16 @@ class KlippyWebsocket(threading.Thread):
def on_error(self, ws, error):
print(error)
logger.debug("Websocket error: %s" % error)
if error.status_code == 401:
# Check for any pending reconnects and remove. No amount of trying will help
if self.timeout != None:
GLib.source_remove(self.timeout)
Gdk.threads_add_idle(
GLib.PRIORITY_HIGH_IDLE,
self._callback['on_close'],
"Unable to authenticate with moonraker.\nCheck the API key"
)
class MoonrakerApi:
def __init__ (self, ws):
+187 -17
View File
@@ -2,6 +2,7 @@ import configparser
import os
import logging
import json
import re
from io import StringIO
@@ -9,44 +10,154 @@ from os import path
logger = logging.getLogger("KlipperScreen.config")
SCREEN_BLANKING_OPTIONS = [
"300", #5 Minutes
"900", #15 Minutes
"1800", #30 Minutes
"3600", #1 Hour
"7200", #2 Hours
"14400", #4 Hours
]
class ConfigError(Exception):
pass
class KlipperScreenConfig:
config = None
configfile_name = "KlipperScreen.conf"
do_not_edit_line = "#~# --- Do not edit below this line. This section is auto generated --- #~#"
do_not_edit_prefix = "#~#"
def __init__(self):
def __init__(self, configfile, lang=None, screen=None):
_ = lang.gettext
_n = lang.ngettext
self.configurable_options = [
{"invert_x": {"section": "main", "name": _("Invert X"), "type": "binary", "value": "False"}},
{"invert_y": {"section": "main", "name": _("Invert Y"), "type": "binary", "value": "False"}},
{"invert_z": {"section": "main", "name": _("Invert Z"), "type": "binary", "value": "False"}},
{"print_estimate_method": {"section": "main", "name": _("Estimated Time Method"), "type": "dropdown",
"value": "file","options":[
{"name": _("File Estimation (default)"), "value": "file"},
{"name": _("Duration Only"), "value": "duration"},
{"name": _("Filament Used"), "value": "filament"},
{"name": _("Slicer"), "value": "slicer"}
]}},
{"screen_blanking": {"section": "main", "name": _("Screen Blanking Time"), "type": "dropdown",
"value": "3600", "callback": screen.set_screenblanking_timeout, "options":[
{"name": _("Off"), "value": "off"}
]}}
#{"": {"section": "main", "name": _(""), "type": ""}}
]
index = self.configurable_options.index(
[i for i in self.configurable_options if list(i)[0]=="screen_blanking"][0])
for num in SCREEN_BLANKING_OPTIONS:
hour = int(int(num)/3600)
if hour > 0:
name = str(hour) + " " + _n("hour","hours", hour)
else:
name = str(int(int(num)/60)) + " " + _("minutes")
self.configurable_options[index]['screen_blanking']['options'].append({
"name": name,
"value": num
})
self.default_config_path = "%s/ks_includes/%s" % (os.getcwd(), self.configfile_name)
self.config = configparser.ConfigParser()
self.config_path = self.get_config_file_location()
self.config_path = self.get_config_file_location(configfile)
logger.debug("Config path location: %s" % self.config_path)
self.defined_config = None
try:
self.config.read(self.config_path)
self.config.read(self.default_config_path)
if self.config_path != self.default_config_path:
user_def, saved_def = self.separate_saved_config(self.config_path)
self.defined_config = configparser.ConfigParser()
self.defined_config.read_string(user_def)
self.log_config(self.defined_config)
self.config.read_string(user_def)
if saved_def != None:
self.config.read_string(saved_def)
except KeyError:
raise ConfigError(f"Error reading config: {self.config_path}")
self.log_config(self.config)
printers = [i for i in self.config.sections() if i.startswith("printer ")]
logger.debug("Printers: %s %s" % (len(printers), printers))
self.printers = []
for printer in printers:
self.printers.append({
printer[8:]: {
"moonraker_host": self.config.get(printer, "moonraker_host", fallback="127.0.0.1"),
"moonraker_port": self.config.get(printer, "moonraker_port", fallback="7125"),
"moonraker_api_key": self.config.get(printer, "moonraker_api_key", fallback="")
}
})
if len(printers) <= 0:
self.printers.append({
"Printer": {
"moonraker_host": self.config.get("main", "moonraker_host", fallback="127.0.0.1"),
"moonraker_port": self.config.get("main", "moonraker_port", fallback="7125"),
"moonraker_api_key": self.config.get("main", "moonraker_api_key", fallback="")
}
})
self.get_menu_items("__main")
logger.debug("Configured printers: %s" % json.dumps(self.printers, indent=2))
for item in self.configurable_options:
name = list(item)[0]
vals = item[name]
if vals['section'] not in self.config.sections():
self.config.add_section(vals['section'])
if name not in list(self.config[vals['section']]):
self.config.set(vals['section'], name, vals['value'])
#self.build_main_menu(self.config)
def separate_saved_config(self, config_path):
user_def = []
saved_def = None
found_saved = False
if not path.exists(config_path):
return [None, None]
with open(config_path) as file:
for line in file:
line = line.replace('\n','')
if line == self.do_not_edit_line:
found_saved = True
saved_def = []
continue
if found_saved == False:
user_def.append(line.replace('\n',''))
else:
if line.startswith(self.do_not_edit_prefix):
saved_def.append(line[(len(self.do_not_edit_prefix)+1):])
return ["\n".join(user_def), None if saved_def == None else "\n".join(saved_def)]
def get_config_file_location(self):
conf_name = "KlipperScreen.conf"
file = "%s/%s" % (os.getenv("HOME"), conf_name)
def get_config_file_location(self, file):
if not path.exists(file):
file = "%s/%s" % (os.getcwd(), conf_name)
file = "%s/%s" % (os.getcwd(), self.configfile_name)
if not path.exists(file):
file = "%s/ks_includes/%s" % (os.getcwd(), conf_name)
file = self.default_config_path
logger.info("Found configuration file at: %s" % file)
return file
def get_config(self):
return self.config
def get_configurable_options(self):
return self.configurable_options
def get_main_config(self):
return self.config['main']
def get_main_config_option(self, option, default=None):
return self.config['main'].get(option, default)
def get_menu_items(self, menu="__main", subsection=""):
if subsection != "":
subsection = subsection + " "
index = "menu %s %s" % (menu, subsection)
logger.debug("Getting menu items for: %s" % index)
items = [i[len(index):] for i in self.config.sections() if i.startswith(index)]
menu_items = []
for item in items:
@@ -58,7 +169,6 @@ class KlipperScreenConfig:
def get_menu_name(self, menu="__main", subsection=""):
name = ("menu %s %s" % (menu, subsection)) if subsection != "" else ("menu %s" % menu)
logger.debug("Menu name: %s" % name)
if name not in self.config:
return False
return self.config[name].get('name')
@@ -67,7 +177,6 @@ class KlipperScreenConfig:
def get_preheat_options(self):
index = "preheat "
items = [i[len(index):] for i in self.config.sections() if i.startswith(index)]
logger.debug("Items: %s" % items)
preheat_options = {}
for item in items:
@@ -78,12 +187,75 @@ class KlipperScreenConfig:
def get_printer_power_name(self):
return self.config['settings'].get("printer_power_name", "printer")
def get_printers(self):
return self.printers
def get_user_saved_config(self):
if self.config_path != self.default_config_path:
print("Get")
def save_user_config_options(self):
save_config = configparser.ConfigParser()
for item in self.configurable_options:
name = list(item)[0]
opt = item[name]
curval = self.config[opt['section']].get(name)
if curval != opt["value"] or (
self.defined_config != None and opt['section'] in self.defined_config.sections() and
self.defined_config[opt['section']].get(name,None) not in (None, curval)):
if opt['section'] not in save_config.sections():
save_config.add_section(opt['section'])
save_config.set(opt['section'], name, str(curval))
if "displayed_macros" in self.config.sections():
for item in self.config.options('displayed_macros'):
value = self.config['displayed_macros'].getboolean(item, fallback=True)
if value == False or (self.defined_config != None and
"displayed_macros" in self.defined_config.sections() and
self.defined_config['displayed_macros'].getboolean(item, fallback=True) == False and
self.defined_config['displayed_macros'].getboolean(item, fallback=True) != value):
if "displayed_macros" not in save_config.sections():
save_config.add_section("displayed_macros")
save_config.set("displayed_macros", item, str(value))
save_output = self._build_config_string(save_config).split("\n")
for i in range(len(save_output)):
save_output[i] = "%s %s" % (self.do_not_edit_prefix, save_output[i])
if self.config_path == self.default_config_path:
user_def = ""
saved_def = None
else:
user_def, saved_def = self.separate_saved_config(self.config_path)
extra_lb = "\n" if saved_def != None else ""
contents = "%s\n%s%s\n%s\n%s\n%s\n" % (user_def, self.do_not_edit_line, extra_lb,
self.do_not_edit_prefix, "\n".join(save_output), self.do_not_edit_prefix)
if self.config_path != self.default_config_path:
path = self.config_path
else:
path = os.path.expanduser("~/KlipperScreen.conf")
try:
file = open(path, 'w')
file.write(contents)
file.close()
except:
logger.error("Error writing configuration file")
def set(self, section, name, value):
self.config.set(section, name, value)
def log_config(self, config):
lines = [
" "
"===== Config File =====",
self._build_config_string(config),
re.sub(
r'(moonraker_api_key\s*=\s*\S+)',
'moonraker_api_key = [redacted]',
self._build_config_string(config)
),
"======================="
]
logger.info("\n".join(lines))
@@ -94,8 +266,6 @@ class KlipperScreenConfig:
sfile.seek(0)
return sfile.read().strip()
def _build_menu_item(self, menu, name):
if name not in self.config:
return False
+81 -25
View File
@@ -4,25 +4,60 @@ import json
import os
import base64
from contextlib import suppress
from threading import Thread
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
logger = logging.getLogger("KlipperScreen.KlippyFiles")
class KlippyFiles:
RESCAN_INTERVAL = 4
class KlippyFiles(Thread):
callbacks = []
filelist = []
files = {}
metadata_timeout = {}
timeout = None
thumbnail_dir = "/tmp/.KS-thumbnails"
def __init__(self, screen):
def __init__(self, screen, *args, **kwargs):
super().__init__(*args, **kwargs)
self.loop = None
self._poll_task = None
self._screen = screen
self.add_timeout()
if not os.path.exists('/tmp/.KS-thumbnails'):
os.makedirs('/tmp/.KS-thumbnails')
GLib.idle_add(self.ret_files, False)
if not os.path.exists(self.thumbnail_dir):
os.makedirs(self.thumbnail_dir)
def run(self):
self.loop = asyncio.new_event_loop()
loop = self.loop
asyncio.set_event_loop(loop)
try:
self._poll_task = asyncio.ensure_future(self._poll())
loop.run_forever()
loop.run_until_complete(loop.shutdown_asyncgens())
self._poll_task.cancel()
with suppress(asyncio.CancelledError):
loop.run_until_complete(self._poll_task)
finally:
loop.close()
def stop(self):
self.loop.call_soon_threadsafe(self.loop.stop)
async def _poll(self):
await self.ret_files()
while True:
try:
await self.ret_files()
except:
logger.exception("Poll files error")
await asyncio.sleep(4)
def _callback(self, result, method, params):
@@ -41,12 +76,12 @@ class KlippyFiles:
"size": item['size'],
"modified": item['modified']
}
self.update_metadata(item['filename'])
self.request_metadata(item['filename'])
if len(self.callbacks) > 0 and (len(newfiles) > 0 or len(deletedfiles) > 0):
logger.debug("Running callbacks...")
for cb in self.callbacks:
cb(newfiles, deletedfiles)
cb(newfiles, deletedfiles, [])
if len(deletedfiles) > 0:
logger.debug("Deleted files: %s", deletedfiles)
@@ -54,50 +89,74 @@ class KlippyFiles:
self.filelist.remove(file)
self.files.pop(file, None)
#self.get_file_data(item['filename'])
#files = [asyncio.create_task(self.get_file_data(file)) for file in self.files]
#await asyncio.gather(files)
#files = [GLib.idle_add(self.ret_file_data, file) for file in self.files]
elif method == "server.files.metadata":
if "error" in result.keys():
logger.debug("Error in getting metadata for %s" %(params['filename']))
self.request_metadata(params['filename'])
logger.debug("Error in getting metadata for %s. Retrying in 6 seconds" %(params['filename']))
return
logger.debug("Got metadata for %s" % (result['result']['filename']))
for x in result['result']:
self.files[params['filename']][x] = result['result'][x]
if "thumbnails" in self.files[params['filename']]:
self.files[params['filename']]['thumbnails'].sort(key=lambda x: x['size'], reverse=True)
for thumbnail in self.files[params['filename']]['thumbnails']:
f = open("/tmp/.KS-thumbnails/%s-%s" % (params['filename'], thumbnail['size']), "wb")
f = open("%s/%s-%s" % (self.thumbnail_dir, params['filename'].split('/')[-1], thumbnail['size']),
"wb")
f.write(base64.b64decode(thumbnail['data']))
f.close()
for cb in self.callbacks:
logger.debug("Running metadata callbacks")
cb([], [], [params['filename']])
def add_file_callback(self, callback):
self.callbacks.append(callback)
try:
self.callbacks.append(callback)
except:
logger.debug("Callback not found: %s" % callback)
def remove_file_callback(self, callback):
if callback in self.callbacks:
self.callbacks.pop(self.callbacks.index(callback))
def add_timeout(self):
if self.timeout == None:
self.timeout = GLib.timeout_add(4000, self.ret_files)
def file_exists(self, filename):
return True if filename in self.filelist else False
def file_metadata_exists(self, filename):
if not self.file_exists(filename):
return False
if "slicer" in self.files[filename]:
return True
return False
def get_thumbnail_location(self, filename):
if not self.has_thumbnail(filename):
return None
return "%s/%s-%s" % (self.thumbnail_dir, filename.split('/')[-1], self.files[filename]['thumbnails'][0]['size'])
def has_thumbnail(self, filename):
if filename not in self.files:
return False
return "thumbnails" in self.files[filename] and len(self.files[filename]) > 0
def remove_timeout(self):
if self.timeout != None:
self.timeout = None
def request_metadata(self, filename):
GLib.timeout_add(2000, self._screen._ws.klippy.get_file_metadata, filename, self._callback)
return False
if filename not in self.filelist:
return False
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
def ret_files(self, retval=True):
async def ret_files(self, retval=True):
logger.debug("Scanning for files")
if not self._screen._ws.klippy.get_file_list(self._callback):
self.timeout = None
return False
return retval
def ret_file_data (self, filename):
print("Getting file info for %s" % (filename))
@@ -114,6 +173,3 @@ class KlippyFiles:
def add_file(self, file_name, size, modified, old_file_name = None):
print(file_name)
def update_metadata(self, filename):
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
+335 -88
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-11-18 12:37+0000\n"
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,272 +17,519 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: panels/print.py:229
#: panels/print.py:247
msgid "?"
msgstr ""
#: panels/zcalibrate.py:65
#: panels/zcalibrate.py:71
msgid "Abort"
msgstr ""
#: panels/zcalibrate.py:61
#: panels/zcalibrate.py:68
msgid "Accept"
msgstr ""
#: panels/print.py:229
#: ks_includes/KlipperScreen.conf:26
msgid "Actions"
msgstr ""
#: panels/bed_mesh.py:33
msgid "Add bed mesh profile"
msgstr ""
#: panels/print.py:247
msgid "Are you sure you want to print"
msgstr ""
#: panels/job_status.py:108
#: panels/job_status.py:306
msgid "Are you sure you wish to cancel this print?"
msgstr ""
#: panels/bed_level.py:89 panels/fan.py:52 panels/fine_tune.py:119
#: panels/menu.py:18 panels/move.py:96 panels/network.py:34
#: panels/preheat.py:54 panels/temperature.py:78
msgid "Back"
#: panels/system.py:29
msgid "Are you sure you wish to reboot the system?"
msgstr ""
#: panels/job_status.py:79 panels/print.py:225
#: panels/system.py:32
msgid "Are you sure you wish to shutdown the system?"
msgstr ""
#: ks_includes/KlipperScreen.conf:114
msgid "Bed Level"
msgstr ""
#: ks_includes/KlipperScreen.conf:119
msgid "Bed Mesh"
msgstr ""
#: panels/bed_mesh.py:104
msgid "Calibrate"
msgstr ""
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
msgid "Cancel"
msgstr ""
#: panels/fan.py:42
#: panels/fan.py:45
msgid "Cancel Change"
msgstr ""
#: panels/job_status.py:111
#: panels/job_status.py:301
msgid "Cancel Print"
msgstr ""
#: panels/temperature.py:146
#: screen.py:305
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
#: panels/bed_mesh.py:290 panels/temperature.py:150
msgid "Close"
msgstr ""
#: panels/job_status.py:85
#: ks_includes/KlipperScreen.conf:30
msgid "Configuration"
msgstr ""
#: screen.py:492
msgid "Continue"
msgstr ""
#: panels/job_status.py:270
msgid "Control"
msgstr ""
#: panels/preheat.py:51
#: panels/preheat.py:54
msgid "Cooldown"
msgstr ""
#: panels/temperature.py:49
#: panels/print.py:24
msgid "Date"
msgstr ""
#: panels/temperature.py:53
msgid "Decrease"
msgstr ""
#: panels/bed_level.py:79
#: panels/bed_mesh.py:122
msgid "Delete"
msgstr ""
#: ks_includes/KlipperScreen.conf:108
msgid "Disable Motors"
msgstr ""
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr ""
#: panels/zcalibrate.py:57
#: panels/settings.py:28
msgid "Displayed Macros"
msgstr ""
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr ""
#: panels/bed_level.py:85 panels/job_status.py:82
#: ks_includes/config.py:42
msgid "Duration Only"
msgstr ""
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr ""
#: panels/job_status.py:272
msgid "Emergency Stop"
msgstr ""
#: panels/extrude.py:32
#: ks_includes/config.py:39
msgid "Estimated Time Method"
msgstr ""
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
#: ks_includes/KlipperScreen.conf:174
msgid "Extrude"
msgstr ""
#: panels/fine_tune.py:66 panels/fine_tune.py:134
msgid "Extrusion"
msgstr ""
#: panels/fine_tune.py:64
#: panels/fine_tune.py:57
msgid "Extrusion +"
msgstr ""
#: panels/fine_tune.py:68
#: panels/fine_tune.py:61
msgid "Extrusion -"
msgstr ""
#: panels/fine_tune.py:46 panels/fine_tune.py:141
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
msgid "Fan"
msgstr ""
#: panels/fine_tune.py:44
msgid "Fan +"
msgstr ""
#: panels/fine_tune.py:48
msgid "Fan -"
msgstr ""
#: panels/fan.py:32
#: panels/fan.py:35
msgid "Fan Off"
msgstr ""
#: panels/fan.py:35
#: panels/fan.py:38
msgid "Fan On"
msgstr ""
#: panels/extrude.py:21 panels/extrude.py:25
#: panels/extrude.py:31
msgid "Fast"
msgstr ""
#: panels/system.py:22 panels/splash_screen.py:59
#: ks_includes/config.py:43
msgid "Filament Used"
msgstr ""
#: ks_includes/config.py:41
msgid "File Estimation (default)"
msgstr ""
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr ""
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Firmware Restart"
msgstr ""
#: panels/job_status.py:115
#: screen.py:300 panels/job_status.py:302
msgid "Go Back"
msgstr ""
#: panels/bed_level.py:76 panels/move.py:38
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
msgid "Home All"
msgstr ""
#: panels/zcalibrate.py:25
#: ks_includes/KlipperScreen.conf:45
msgid "Home X"
msgstr ""
#: ks_includes/KlipperScreen.conf:63
msgid "Home XY"
msgstr ""
#: ks_includes/KlipperScreen.conf:51
msgid "Home Y"
msgstr ""
#: ks_includes/KlipperScreen.conf:57
msgid "Home Z"
msgstr ""
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
msgid "Homing"
msgstr ""
#: panels/temperature.py:47
#: panels/temperature.py:51
msgid "Increase"
msgstr ""
#. self._load_panels()
#: screen.py:149
msgid "Initializing"
msgstr ""
#: panels/splash_screen.py:23
msgid "Initializing printer..."
msgstr ""
#: panels/system.py:20
#: ks_includes/config.py:36
msgid "Invert X"
msgstr ""
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr ""
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr ""
#: panels/system.py:22
msgid "Klipper Restart"
msgstr ""
#: panels/system.py:43 panels/system.py:42
#: panels/system.py:42
msgid "Klipper Version"
msgstr ""
#: screen.py:418
msgid "Klipper has disconnected"
msgstr ""
#: screen.py:429
msgid ""
"Klipper has encountered an error with the micro-controller.\n"
"Please recompile and flash."
msgstr ""
#: screen.py:433
msgid "Klipper has encountered an error."
msgstr ""
#: screen.py:425
msgid ""
"Klipper has encountered an error.\n"
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
msgstr ""
#: screen.py:453
msgid "Klipper has shutdown"
msgstr ""
#: screen.py:449
msgid "Klipper is attempting to start"
msgstr ""
#: ks_includes/KlipperScreen.conf:148
msgid "Klipper will reboot"
msgstr ""
#: panels/system.py:46
msgid "KlipperScreen Version"
msgstr ""
#: panels/system.py:62
#: panels/job_status.py:124
msgid "Left:"
msgstr ""
#: panels/bed_mesh.py:98
msgid "Load"
msgstr ""
#: panels/system.py:66
msgid "Load Average"
msgstr ""
#: panels/zcalibrate.py:34
#: panels/zcalibrate.py:39
msgid "Lower Nozzle"
msgstr ""
#: panels/extrude.py:20 panels/extrude.py:21 panels/extrude.py:24
#: ks_includes/KlipperScreen.conf:96
msgid "Macros"
msgstr ""
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr ""
#: panels/extrude.py:31
msgid "Medium"
msgstr ""
#: panels/move.py:87
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
msgid "Menu"
msgstr ""
#: ks_includes/KlipperScreen.conf:69
msgid "Move"
msgstr ""
#: panels/move.py:91
msgid "Move Distance (mm)"
msgstr ""
#: panels/network.py:28
#: panels/print.py:23
msgid "Name"
msgstr ""
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
#: ks_includes/KlipperScreen.conf:211
msgid "Network"
msgstr ""
#: panels/network.py:31
msgid "Network Info"
msgstr ""
#: panels/temperature.py:51
#: panels/temperature.py:55
msgid "Number Pad"
msgstr ""
#: panels/job_status.py:70
#: ks_includes/config.py:48
msgid "Off"
msgstr ""
#: panels/job_status.py:276
msgid "Pause"
msgstr ""
#: panels/print.py:224
#: panels/job_status.py:470
msgid "Paused"
msgstr ""
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
#: ks_includes/KlipperScreen.conf:205
msgid "Power"
msgstr ""
#: panels/splash_screen.py:61
msgid "Power On Printer"
msgstr ""
#: ks_includes/KlipperScreen.conf:21
msgid "Preheat"
msgstr ""
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
msgid "Print"
msgstr ""
#: panels/print.py:154
#: ks_includes/KlipperScreen.conf:156
msgid "Print Control"
msgstr ""
#: panels/print.py:171
msgid "Print Time"
msgstr ""
#: panels/zcalibrate.py:32
#: panels/job_status.py:232
msgid "Printing"
msgstr ""
#: panels/bed_mesh.py:264
msgid "Profile Name:"
msgstr ""
#: ks_includes/KlipperScreen.conf:89
msgid "Quad Gantry Level"
msgstr ""
#: panels/zcalibrate.py:37
msgid "Raise Nozzle"
msgstr ""
#: panels/splash_screen.py:57
#: panels/job_status.py:278 panels/splash_screen.py:62
msgid "Restart"
msgstr ""
#: panels/job_status.py:68
#: panels/job_status.py:280
msgid "Resume"
msgstr ""
#: panels/extrude.py:34
#: panels/extrude.py:48
msgid "Retract"
msgstr ""
#: panels/fan.py:39
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
msgid "Save"
msgstr ""
#: ks_includes/KlipperScreen.conf:141
msgid "Save Config"
msgstr ""
#: ks_includes/KlipperScreen.conf:146
msgid "Save configuration."
msgstr ""
#: ks_includes/config.py:46
msgid "Screen Blanking Time"
msgstr ""
#: panels/bed_level.py:114
msgid "Screws Adjust"
msgstr ""
#: panels/fan.py:42
msgid "Set Speed"
msgstr ""
#: panels/print.py:152
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
msgid "Settings"
msgstr ""
#: panels/print.py:169
msgid "Size"
msgstr ""
#: panels/extrude.py:21 panels/extrude.py:23
#: ks_includes/config.py:44
msgid "Slicer"
msgstr ""
#. This line for translations only
#: panels/extrude.py:31
msgid "Slow"
msgstr ""
#: panels/fine_tune.py:56 panels/fine_tune.py:137
msgid "Speed"
#: panels/print.py:39
msgid "Sort by: "
msgstr ""
#: panels/fine_tune.py:54
#: panels/fine_tune.py:47
msgid "Speed +"
msgstr ""
#: panels/fine_tune.py:58
#: panels/fine_tune.py:51
msgid "Speed -"
msgstr ""
#: panels/system.py:31 panels/system.py:30
msgid "System Information"
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
#: ks_includes/KlipperScreen.conf:216
msgid "System"
msgstr ""
#: panels/extrude.py:36
#: panels/system.py:27
msgid ""
"System\n"
"Restart"
msgstr ""
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
msgstr ""
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
#: ks_includes/KlipperScreen.conf:159
msgid "Temperature"
msgstr ""
#: panels/job_status.py:33 panels/job_status.py:34
msgid "Time Elapsed"
#: panels/extrude.py:38
msgid "Tool"
msgstr ""
#: panels/job_status.py:35 panels/job_status.py:36
msgid "Time Left"
msgstr ""
#: panels/extrude.py:30
msgid "Tool 1"
msgstr ""
#: panels/print.py:150
#: panels/print.py:167
msgid "Uploaded"
msgstr ""
#: panels/move.py:23
#: panels/move.py:25
msgid "X+"
msgstr ""
#: panels/move.py:25
#: panels/move.py:27
msgid "X-"
msgstr ""
#: panels/move.py:28
#: panels/move.py:30
msgid "Y+"
msgstr ""
#: panels/move.py:30
#: panels/move.py:32
msgid "Y-"
msgstr ""
#: panels/fine_tune.py:35 panels/fine_tune.py:131 panels/zcalibrate.py:23
#: ks_includes/KlipperScreen.conf:125
msgid "Z Calibrate"
msgstr ""
#: panels/zcalibrate.py:28
msgid "Z Offset"
msgstr ""
#: panels/fine_tune.py:33 panels/move.py:33
#: panels/fine_tune.py:36 panels/move.py:35
msgid "Z+"
msgstr ""
#: panels/fine_tune.py:37 panels/move.py:35
#: panels/fine_tune.py:40 panels/move.py:37
msgid "Z-"
msgstr ""
#: panels/fine_tune.py:35
#: ks_includes/config.py:60
msgid "minutes"
msgstr ""
#: panels/fine_tune.py:38
msgid "mm"
msgstr ""
@@ -0,0 +1,562 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Jakob Kais <schpuntik@freenet.de>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
"PO-Revision-Date: 2021-02-12 02:02+0100\n"
"Last-Translator: Jakob Kais <schpuntik@freenet.de>\n"
"Language-Team: Russian <kde-i18n-de@kde.org>\n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.3\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: panels/print.py:247
msgid "?"
msgstr "?"
#: panels/zcalibrate.py:71
msgid "Abort"
msgstr "Abbrechen"
#: panels/zcalibrate.py:68
msgid "Accept"
msgstr "OK"
#: ks_includes/KlipperScreen.conf:26
msgid "Actions"
msgstr "Aktionen"
#: panels/bed_mesh.py:33
msgid "Add bed mesh profile"
msgstr "Druckbett Mesh Profil hinzufügen"
#: panels/print.py:247
msgid "Are you sure you want to print"
msgstr "Möchten Sie wirklich drucken"
#: panels/job_status.py:306
msgid "Are you sure you wish to cancel this print?"
msgstr "Möchten Sie diesen Druck wirklich abbrechen?"
#: panels/system.py:29
msgid "Are you sure you wish to reboot the system?"
msgstr "Möchten Sie das System wirklich neu starten?"
#: panels/system.py:32
msgid "Are you sure you wish to shutdown the system?"
msgstr "Möchten Sie das System wirklich herunterfahren?"
#: ks_includes/KlipperScreen.conf:114
msgid "Bed Level"
msgstr "Druckbett leveln"
#: ks_includes/KlipperScreen.conf:119
msgid "Bed Mesh"
msgstr "Druckbett Mesh-Level"
#: panels/bed_mesh.py:104
msgid "Calibrate"
msgstr "Kalibrieren"
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
msgid "Cancel"
msgstr "Abbruch"
#: panels/fan.py:45
msgid "Cancel Change"
msgstr "Änderung abbrechen"
#: panels/job_status.py:301
msgid "Cancel Print"
msgstr "Druck abbrechen"
#: screen.py:305
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
"Prüfe /tmp/KlipperScreen.log für weitere Informationen.\n"
"Bitte eröffne einen Fehlerbericht auf https://git.io/JLNn4 für Hilfe."
#: panels/bed_mesh.py:290 panels/temperature.py:150
msgid "Close"
msgstr "Schließen"
#: ks_includes/KlipperScreen.conf:30
msgid "Configuration"
msgstr "Einstellungen"
#: screen.py:492
msgid "Continue"
msgstr "Fortsetzen"
#: panels/job_status.py:270
msgid "Control"
msgstr "Steuerung"
#: panels/preheat.py:54
msgid "Cooldown"
msgstr "Abkühlen"
#: panels/print.py:24
msgid "Date"
msgstr "Datum"
#: panels/temperature.py:53
msgid "Decrease"
msgstr "Verringern"
#: panels/bed_mesh.py:122
msgid "Delete"
msgstr "Löschen"
#: ks_includes/KlipperScreen.conf:108
msgid "Disable Motors"
msgstr "Motoren deaktivieren"
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr "Achse XY deaktivieren"
#: panels/settings.py:28
msgid "Displayed Macros"
msgstr "Aktive Macros"
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr "Entfernung (mm)"
#: ks_includes/config.py:42
msgid "Duration Only"
msgstr "Reine Druckzeit"
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr "Verstrichene Zeit:"
#: panels/job_status.py:272
msgid "Emergency Stop"
msgstr "NOT-STOP"
#: ks_includes/config.py:39
msgid "Estimated Time Method"
msgstr "Druckzeit"
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
#: ks_includes/KlipperScreen.conf:174
msgid "Extrude"
msgstr "Filament fördern"
#: panels/fine_tune.py:57
msgid "Extrusion +"
msgstr "Extrusion +"
#: panels/fine_tune.py:61
msgid "Extrusion -"
msgstr "Extrusion -"
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
msgid "Fan"
msgstr "Lüfter"
#: panels/fan.py:35
msgid "Fan Off"
msgstr "Lüfter Aus"
#: panels/fan.py:38
msgid "Fan On"
msgstr "Lüfter An"
#: panels/extrude.py:31
msgid "Fast"
msgstr "Schnell"
#: ks_includes/config.py:43
msgid "Filament Used"
msgstr "Filamentverbrauch"
#: ks_includes/config.py:41
msgid "File Estimation (default)"
msgstr "Dateischätzung (Standard)"
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr "Feintuning"
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Firmware Restart"
msgstr ""
"Firmware\n"
" neustarten"
#: screen.py:300 panels/job_status.py:302
msgid "Go Back"
msgstr "Zurück"
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
msgid "Home All"
msgstr ""
"Alle Achsen\n"
"zurücksetzen"
#: ks_includes/KlipperScreen.conf:45
msgid "Home X"
msgstr ""
"Achse X\n"
"zurücksetzen"
#: ks_includes/KlipperScreen.conf:63
msgid "Home XY"
msgstr ""
"Achse XY\n"
"zurücksetzen"
#: ks_includes/KlipperScreen.conf:51
msgid "Home Y"
msgstr ""
"Achse Y\n"
"zurücksetzen"
#: ks_includes/KlipperScreen.conf:57
msgid "Home Z"
msgstr ""
"Achse Z\n"
"zurücksetzen"
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
msgid "Homing"
msgstr "Grundposition"
#: panels/temperature.py:51
msgid "Increase"
msgstr "Erhöhen"
#. self._load_panels()
#: screen.py:149
msgid "Initializing"
msgstr "Startvorgang"
#: panels/splash_screen.py:23
msgid "Initializing printer..."
msgstr "Drucker wird initialisiert..."
#: ks_includes/config.py:36
msgid "Invert X"
msgstr "Achse X invertieren"
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr "Achse Y invertieren"
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr "Achse Z invertieren"
#: panels/system.py:22
msgid "Klipper Restart"
msgstr ""
"Klipper\n"
" neustarten"
#: panels/system.py:42
msgid "Klipper Version"
msgstr "Klipper Version"
#: screen.py:418
msgid "Klipper has disconnected"
msgstr "Klipper nicht verbunden"
#: screen.py:429
msgid ""
"Klipper has encountered an error with the micro-controller.\n"
"Please recompile and flash."
msgstr ""
"Klipper hat einen Fehler mit dem Mainboard festgestellt.\n"
"Bitte Mainboard neu programmieren."
#: screen.py:433
msgid "Klipper has encountered an error."
msgstr "Klipper hat einen Fehler festgestellt."
#: screen.py:425
msgid ""
"Klipper has encountered an error.\n"
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
msgstr ""
"Klipper hat einen Fehler festgestellt.\n"
"Führe einen FIRMWARE_RESTART durch um den Fehler zu beheben."
#: screen.py:453
msgid "Klipper has shutdown"
msgstr "Klipper abgeschaltet"
#: screen.py:449
msgid "Klipper is attempting to start"
msgstr "Klipper ist startbereit"
#: ks_includes/KlipperScreen.conf:148
msgid "Klipper will reboot"
msgstr "Klipper startet neu"
#: panels/system.py:46
msgid "KlipperScreen Version"
msgstr "KlipperScreen Version"
#: panels/job_status.py:124
msgid "Left:"
msgstr "Restzeit:"
#: panels/bed_mesh.py:98
msgid "Load"
msgstr "Belastung"
#: panels/system.py:66
msgid "Load Average"
msgstr "Durchschnittslast"
#: panels/zcalibrate.py:39
msgid "Lower Nozzle"
msgstr "Düse absenken"
#: ks_includes/KlipperScreen.conf:96
msgid "Macros"
msgstr "Makros"
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr "Hauptmenü"
#: panels/extrude.py:31
msgid "Medium"
msgstr "Mittel"
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
msgid "Menu"
msgstr "Menü"
#: ks_includes/KlipperScreen.conf:69
msgid "Move"
msgstr "Bewegen"
#: panels/move.py:91
msgid "Move Distance (mm)"
msgstr "Bewegungsdistanz (mm)"
#: panels/print.py:23
msgid "Name"
msgstr "Name"
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
#: ks_includes/KlipperScreen.conf:211
msgid "Network"
msgstr "Netzwerk"
#: panels/network.py:31
msgid "Network Info"
msgstr "Netzwerkinfo"
#: panels/temperature.py:55
msgid "Number Pad"
msgstr "Nummernblock"
#: ks_includes/config.py:48
msgid "Off"
msgstr "Ausschalten"
#: panels/job_status.py:276
msgid "Pause"
msgstr "Pause"
#: panels/job_status.py:470
msgid "Paused"
msgstr "Pausiert"
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
#: ks_includes/KlipperScreen.conf:205
msgid "Power"
msgstr "Ein"
#: panels/splash_screen.py:61
msgid "Power On Printer"
msgstr "Drucker einschalten"
#: ks_includes/KlipperScreen.conf:21
msgid "Preheat"
msgstr "Vorheizen"
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
msgid "Print"
msgstr "Druck"
#: ks_includes/KlipperScreen.conf:156
msgid "Print Control"
msgstr "Druck Steuerung"
#: panels/print.py:171
msgid "Print Time"
msgstr "Druckzeit"
#: panels/job_status.py:232
msgid "Printing"
msgstr "Drucken"
#: panels/bed_mesh.py:264
msgid "Profile Name:"
msgstr "Profil Name:"
#: ks_includes/KlipperScreen.conf:89
msgid "Quad Gantry Level"
msgstr "Quad Gantry Level"
#: panels/zcalibrate.py:37
msgid "Raise Nozzle"
msgstr "Düse anheben"
#: panels/job_status.py:278 panels/splash_screen.py:62
msgid "Restart"
msgstr "Neustart"
#: panels/job_status.py:280
msgid "Resume"
msgstr "Fortsetzen"
#: panels/extrude.py:48
msgid "Retract"
msgstr "Zurückziehen"
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
msgid "Save"
msgstr "Speichern"
#: ks_includes/KlipperScreen.conf:141
msgid "Save Config"
msgstr "Einstellungen speichern"
#: ks_includes/KlipperScreen.conf:146
msgid "Save configuration."
msgstr "Speichere Einstellungen."
#: ks_includes/config.py:46
msgid "Screen Blanking Time"
msgstr "Bildschirm Ausblenden in"
#: panels/bed_level.py:114
msgid "Screws Adjust"
msgstr "Schrauben Einstellen"
#: panels/fan.py:42
msgid "Set Speed"
msgstr "Geschwindigkeit einstellen"
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
msgid "Settings"
msgstr "Einstellungen"
#: panels/print.py:169
msgid "Size"
msgstr "Größe"
#: ks_includes/config.py:44
msgid "Slicer"
msgstr "Slicer"
#. This line for translations only
#: panels/extrude.py:31
msgid "Slow"
msgstr "Langsam"
#: panels/print.py:39
msgid "Sort by: "
msgstr "Sortieren nach: "
#: panels/fine_tune.py:47
msgid "Speed +"
msgstr "Geschwindigkeit +"
#: panels/fine_tune.py:51
msgid "Speed -"
msgstr "Geschwindigkeit -"
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
#: ks_includes/KlipperScreen.conf:216
msgid "System"
msgstr "System"
#: panels/system.py:27
msgid ""
"System\n"
"Restart"
msgstr ""
"Drucker\n"
"Neustarten"
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
msgstr ""
"Drucker\n"
"Ausschalten"
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
#: ks_includes/KlipperScreen.conf:159
msgid "Temperature"
msgstr "Temperatur"
#: panels/extrude.py:38
msgid "Tool"
msgstr "Druckkopf"
#: panels/print.py:167
msgid "Uploaded"
msgstr "Hochgeladen"
#: panels/move.py:25
msgid "X+"
msgstr "X+"
#: panels/move.py:27
msgid "X-"
msgstr "X-"
#: panels/move.py:30
msgid "Y+"
msgstr "Y+"
#: panels/move.py:32
msgid "Y-"
msgstr "Y-"
#: ks_includes/KlipperScreen.conf:125
msgid "Z Calibrate"
msgstr "Höhe Kalibrieren"
#: panels/zcalibrate.py:28
msgid "Z Offset"
msgstr "Z Offset"
#: panels/fine_tune.py:36 panels/move.py:35
msgid "Z+"
msgstr "Z+"
#: panels/fine_tune.py:40 panels/move.py:37
msgid "Z-"
msgstr "Z-"
#: ks_includes/config.py:60
msgid "minutes"
msgstr "Minuten"
#: panels/fine_tune.py:38
msgid "mm"
msgstr "mm"
#~ msgid "Klipper"
#~ msgstr "Klipper"
@@ -1,269 +1,516 @@
#: panels/print.py:229
#: panels/print.py:247
msgid "?"
msgstr ""
#: panels/zcalibrate.py:65
#: panels/zcalibrate.py:71
msgid "Abort"
msgstr "Abort"
#: panels/zcalibrate.py:61
#: panels/zcalibrate.py:68
msgid "Accept"
msgstr ""
#: panels/print.py:229
#: ks_includes/KlipperScreen.conf:26
msgid "Actions"
msgstr ""
#: panels/bed_mesh.py:33
msgid "Add bed mesh profile"
msgstr ""
#: panels/print.py:247
msgid "Are you sure you want to print"
msgstr ""
#: panels/job_status.py:108
#: panels/job_status.py:306
msgid "Are you sure you wish to cancel this print?"
msgstr ""
#: panels/bed_level.py:89 panels/fan.py:52 panels/fine_tune.py:119
#: panels/menu.py:18 panels/move.py:96 panels/network.py:34
#: panels/preheat.py:54 panels/temperature.py:78
msgid "Back"
#: panels/system.py:29
msgid "Are you sure you wish to reboot the system?"
msgstr ""
#: panels/job_status.py:79 panels/print.py:225
#: panels/system.py:32
msgid "Are you sure you wish to shutdown the system?"
msgstr ""
#: ks_includes/KlipperScreen.conf:114
msgid "Bed Level"
msgstr ""
#: ks_includes/KlipperScreen.conf:119
msgid "Bed Mesh"
msgstr ""
#: panels/bed_mesh.py:104
msgid "Calibrate"
msgstr ""
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
msgid "Cancel"
msgstr ""
#: panels/fan.py:42
#: panels/fan.py:45
msgid "Cancel Change"
msgstr ""
#: panels/job_status.py:111
#: panels/job_status.py:301
msgid "Cancel Print"
msgstr ""
#: panels/temperature.py:146
#: screen.py:305
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
#: panels/bed_mesh.py:290 panels/temperature.py:150
msgid "Close"
msgstr ""
#: panels/job_status.py:85
#: ks_includes/KlipperScreen.conf:30
msgid "Configuration"
msgstr ""
#: screen.py:492
msgid "Continue"
msgstr ""
#: panels/job_status.py:270
msgid "Control"
msgstr ""
#: panels/preheat.py:51
#: panels/preheat.py:54
msgid "Cooldown"
msgstr ""
#: panels/temperature.py:49
#: panels/print.py:24
msgid "Date"
msgstr ""
#: panels/temperature.py:53
msgid "Decrease"
msgstr ""
#: panels/bed_level.py:79
#: panels/bed_mesh.py:122
msgid "Delete"
msgstr ""
#: ks_includes/KlipperScreen.conf:108
msgid "Disable Motors"
msgstr ""
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr ""
#: panels/zcalibrate.py:57
#: panels/settings.py:28
msgid "Displayed Macros"
msgstr ""
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr ""
#: panels/bed_level.py:85 panels/job_status.py:82
#: ks_includes/config.py:42
msgid "Duration Only"
msgstr ""
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr ""
#: panels/job_status.py:272
msgid "Emergency Stop"
msgstr ""
#: panels/extrude.py:32
#: ks_includes/config.py:39
msgid "Estimated Time Method"
msgstr ""
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
#: ks_includes/KlipperScreen.conf:174
msgid "Extrude"
msgstr ""
#: panels/fine_tune.py:66 panels/fine_tune.py:134
msgid "Extrusion"
msgstr ""
#: panels/fine_tune.py:64
#: panels/fine_tune.py:57
msgid "Extrusion +"
msgstr ""
#: panels/fine_tune.py:68
#: panels/fine_tune.py:61
msgid "Extrusion -"
msgstr ""
#: panels/fine_tune.py:46 panels/fine_tune.py:141
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
msgid "Fan"
msgstr ""
#: panels/fine_tune.py:44
msgid "Fan +"
msgstr ""
#: panels/fine_tune.py:48
msgid "Fan -"
msgstr ""
#: panels/fan.py:32
#: panels/fan.py:35
msgid "Fan Off"
msgstr ""
#: panels/fan.py:35
#: panels/fan.py:38
msgid "Fan On"
msgstr ""
#: panels/extrude.py:21 panels/extrude.py:25
#: panels/extrude.py:31
msgid "Fast"
msgstr ""
#: panels/system.py:22 panels/splash_screen.py:59
#: ks_includes/config.py:43
msgid "Filament Used"
msgstr ""
#: ks_includes/config.py:41
msgid "File Estimation (default)"
msgstr ""
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr ""
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Firmware Restart"
msgstr ""
#: panels/job_status.py:115
#: screen.py:300 panels/job_status.py:302
msgid "Go Back"
msgstr ""
#: panels/bed_level.py:76 panels/move.py:38
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
msgid "Home All"
msgstr ""
#: panels/zcalibrate.py:25
#: ks_includes/KlipperScreen.conf:45
msgid "Home X"
msgstr ""
#: ks_includes/KlipperScreen.conf:63
msgid "Home XY"
msgstr ""
#: ks_includes/KlipperScreen.conf:51
msgid "Home Y"
msgstr ""
#: ks_includes/KlipperScreen.conf:57
msgid "Home Z"
msgstr ""
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
msgid "Homing"
msgstr ""
#: panels/temperature.py:47
#: panels/temperature.py:51
msgid "Increase"
msgstr ""
#. self._load_panels()
#: screen.py:149
msgid "Initializing"
msgstr ""
#: panels/splash_screen.py:23
msgid "Initializing printer..."
msgstr ""
#: panels/system.py:20
#: ks_includes/config.py:36
msgid "Invert X"
msgstr ""
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr ""
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr ""
#: panels/system.py:22
msgid "Klipper Restart"
msgstr ""
#: panels/system.py:43 panels/system.py:42
#: panels/system.py:42
msgid "Klipper Version"
msgstr ""
#: screen.py:418
msgid "Klipper has disconnected"
msgstr ""
#: screen.py:429
msgid ""
"Klipper has encountered an error with the micro-controller.\n"
"Please recompile and flash."
msgstr ""
#: screen.py:433
msgid "Klipper has encountered an error."
msgstr ""
#: screen.py:425
msgid ""
"Klipper has encountered an error.\n"
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
msgstr ""
#: screen.py:453
msgid "Klipper has shutdown"
msgstr ""
#: screen.py:449
msgid "Klipper is attempting to start"
msgstr ""
#: ks_includes/KlipperScreen.conf:148
msgid "Klipper will reboot"
msgstr ""
#: panels/system.py:46
msgid "KlipperScreen Version"
msgstr ""
#: panels/system.py:62
#: panels/job_status.py:124
msgid "Left:"
msgstr ""
#: panels/bed_mesh.py:98
msgid "Load"
msgstr ""
#: panels/system.py:66
msgid "Load Average"
msgstr ""
#: panels/zcalibrate.py:34
#: panels/zcalibrate.py:39
msgid "Lower Nozzle"
msgstr ""
#: panels/extrude.py:20 panels/extrude.py:21 panels/extrude.py:24
#: ks_includes/KlipperScreen.conf:96
msgid "Macros"
msgstr ""
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr ""
#: panels/extrude.py:31
msgid "Medium"
msgstr ""
#: panels/move.py:87
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
msgid "Menu"
msgstr ""
#: ks_includes/KlipperScreen.conf:69
msgid "Move"
msgstr ""
#: panels/move.py:91
msgid "Move Distance (mm)"
msgstr ""
#: panels/network.py:28
#: panels/print.py:23
msgid "Name"
msgstr ""
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
#: ks_includes/KlipperScreen.conf:211
msgid "Network"
msgstr ""
#: panels/network.py:31
msgid "Network Info"
msgstr ""
#: panels/temperature.py:51
#: panels/temperature.py:55
msgid "Number Pad"
msgstr ""
#: panels/job_status.py:70
#: ks_includes/config.py:48
msgid "Off"
msgstr ""
#: panels/job_status.py:276
msgid "Pause"
msgstr ""
#: panels/print.py:224
#: panels/job_status.py:470
msgid "Paused"
msgstr ""
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
#: ks_includes/KlipperScreen.conf:205
msgid "Power"
msgstr ""
#: panels/splash_screen.py:61
msgid "Power On Printer"
msgstr ""
#: ks_includes/KlipperScreen.conf:21
msgid "Preheat"
msgstr ""
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
msgid "Print"
msgstr ""
#: panels/print.py:154
#: ks_includes/KlipperScreen.conf:156
msgid "Print Control"
msgstr ""
#: panels/print.py:171
msgid "Print Time"
msgstr ""
#: panels/zcalibrate.py:32
#: panels/job_status.py:232
msgid "Printing"
msgstr ""
#: panels/bed_mesh.py:264
msgid "Profile Name:"
msgstr ""
#: ks_includes/KlipperScreen.conf:89
msgid "Quad Gantry Level"
msgstr ""
#: panels/zcalibrate.py:37
msgid "Raise Nozzle"
msgstr ""
#: panels/splash_screen.py:57
#: panels/job_status.py:278 panels/splash_screen.py:62
msgid "Restart"
msgstr ""
#: panels/job_status.py:68
#: panels/job_status.py:280
msgid "Resume"
msgstr ""
#: panels/extrude.py:34
#: panels/extrude.py:48
msgid "Retract"
msgstr ""
#: panels/fan.py:39
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
msgid "Save"
msgstr ""
#: ks_includes/KlipperScreen.conf:141
msgid "Save Config"
msgstr ""
#: ks_includes/KlipperScreen.conf:146
msgid "Save configuration."
msgstr ""
#: ks_includes/config.py:46
msgid "Screen Blanking Time"
msgstr ""
#: panels/bed_level.py:114
msgid "Screws Adjust"
msgstr ""
#: panels/fan.py:42
msgid "Set Speed"
msgstr ""
#: panels/print.py:152
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
msgid "Settings"
msgstr ""
#: panels/print.py:169
msgid "Size"
msgstr ""
#: panels/extrude.py:21 panels/extrude.py:23
#: ks_includes/config.py:44
msgid "Slicer"
msgstr ""
#. This line for translations only
#: panels/extrude.py:31
msgid "Slow"
msgstr ""
#: panels/fine_tune.py:56 panels/fine_tune.py:137
msgid "Speed"
#: panels/print.py:39
msgid "Sort by: "
msgstr ""
#: panels/fine_tune.py:54
#: panels/fine_tune.py:47
msgid "Speed +"
msgstr ""
#: panels/fine_tune.py:58
#: panels/fine_tune.py:51
msgid "Speed -"
msgstr ""
#: panels/system.py:31 panels/system.py:30
msgid "System Information"
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
#: ks_includes/KlipperScreen.conf:216
msgid "System"
msgstr ""
#: panels/extrude.py:36
#: panels/system.py:27
msgid ""
"System\n"
"Restart"
msgstr ""
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
msgstr ""
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
#: ks_includes/KlipperScreen.conf:159
msgid "Temperature"
msgstr ""
#: panels/job_status.py:33 panels/job_status.py:34
msgid "Time Elapsed"
#: panels/extrude.py:38
msgid "Tool"
msgstr ""
#: panels/job_status.py:35 panels/job_status.py:36
msgid "Time Left"
msgstr ""
#: panels/extrude.py:30
msgid "Tool 1"
msgstr ""
#: panels/print.py:150
#: panels/print.py:167
msgid "Uploaded"
msgstr ""
#: panels/move.py:23
#: panels/move.py:25
msgid "X+"
msgstr ""
#: panels/move.py:25
#: panels/move.py:27
msgid "X-"
msgstr ""
#: panels/move.py:28
#: panels/move.py:30
msgid "Y+"
msgstr ""
#: panels/move.py:30
#: panels/move.py:32
msgid "Y-"
msgstr ""
#: panels/fine_tune.py:35 panels/fine_tune.py:131 panels/zcalibrate.py:23
#: ks_includes/KlipperScreen.conf:125
msgid "Z Calibrate"
msgstr ""
#: panels/zcalibrate.py:28
msgid "Z Offset"
msgstr ""
#: panels/fine_tune.py:33 panels/move.py:33
#: panels/fine_tune.py:36 panels/move.py:35
msgid "Z+"
msgstr ""
#: panels/fine_tune.py:37 panels/move.py:35
#: panels/fine_tune.py:40 panels/move.py:37
msgid "Z-"
msgstr ""
#: panels/fine_tune.py:35
#: ks_includes/config.py:60
msgid "minutes"
msgstr ""
#: panels/fine_tune.py:38
msgid "mm"
msgstr ""
@@ -0,0 +1,579 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
"PO-Revision-Date: 2021-01-03 23:18+0200\n"
"Last-Translator: Emanuel Sharvit <manu7irl@gmail.com>\n"
"Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.4.2\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: panels/print.py:247
msgid "?"
msgstr "?"
#: panels/zcalibrate.py:71
msgid "Abort"
msgstr "Annuler"
#: panels/zcalibrate.py:68
msgid "Accept"
msgstr "Accepter"
#: ks_includes/KlipperScreen.conf:26
msgid "Actions"
msgstr "Actions"
#: panels/bed_mesh.py:33
msgid "Add bed mesh profile"
msgstr ""
#: panels/print.py:247
msgid "Are you sure you want to print"
msgstr "Es tu sure de vouloir imprimer"
#: panels/job_status.py:306
msgid "Are you sure you wish to cancel this print?"
msgstr "Es tu sure de vouloir annuler cette impression?"
#: panels/system.py:29
#, fuzzy
msgid "Are you sure you wish to reboot the system?"
msgstr "Es tu sure de vouloir annuler cette impression?"
#: panels/system.py:32
#, fuzzy
msgid "Are you sure you wish to shutdown the system?"
msgstr "Es tu sure de vouloir annuler cette impression?"
#: ks_includes/KlipperScreen.conf:114
msgid "Bed Level"
msgstr "Nivelage du plateau"
#: ks_includes/KlipperScreen.conf:119
msgid "Bed Mesh"
msgstr "Grille du plateau"
#: panels/bed_mesh.py:104
#, fuzzy
msgid "Calibrate"
msgstr "Calibration Z"
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
msgid "Cancel"
msgstr "Annuler"
#: panels/fan.py:45
msgid "Cancel Change"
msgstr "Annuler le changement"
#: panels/job_status.py:301
msgid "Cancel Print"
msgstr "Annuler l'impression"
#: screen.py:305
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
"Verifier /tmp/KlipperScreen.log pour plus d'imformation.\n"
"SVP envoie une requte sur GITHUB pour obtenir de l'aide"
#: panels/bed_mesh.py:290 panels/temperature.py:150
msgid "Close"
msgstr "Fermer"
#: ks_includes/KlipperScreen.conf:30
msgid "Configuration"
msgstr "Configuration"
#: screen.py:492
msgid "Continue"
msgstr "Continuer"
#: panels/job_status.py:270
msgid "Control"
msgstr "Controle"
#: panels/preheat.py:54
msgid "Cooldown"
msgstr "Refroidir"
#: panels/print.py:24
msgid "Date"
msgstr ""
#: panels/temperature.py:53
msgid "Decrease"
msgstr "Diminuer"
#: panels/bed_mesh.py:122
msgid "Delete"
msgstr ""
#: ks_includes/KlipperScreen.conf:108
msgid "Disable Motors"
msgstr "Déactiver les moteurs"
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr "Deactiver XY"
#: panels/settings.py:28
msgid "Displayed Macros"
msgstr ""
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr "Distance (mm)"
#: ks_includes/config.py:42
msgid "Duration Only"
msgstr ""
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr "Écoulé:"
#: panels/job_status.py:272
msgid "Emergency Stop"
msgstr "Arret d'urgence"
#: ks_includes/config.py:39
msgid "Estimated Time Method"
msgstr ""
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
#: ks_includes/KlipperScreen.conf:174
msgid "Extrude"
msgstr "Extruder"
#: panels/fine_tune.py:57
msgid "Extrusion +"
msgstr "Extrusion +"
#: panels/fine_tune.py:61
msgid "Extrusion -"
msgstr "Extrusion +"
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
msgid "Fan"
msgstr "Ventilateur"
#: panels/fan.py:35
msgid "Fan Off"
msgstr "ventilateur éteint"
#: panels/fan.py:38
msgid "Fan On"
msgstr "Ventilateur en marche"
#: panels/extrude.py:31
msgid "Fast"
msgstr "Rapide"
#: ks_includes/config.py:43
msgid "Filament Used"
msgstr ""
#: ks_includes/config.py:41
msgid "File Estimation (default)"
msgstr ""
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr "Fin réglage"
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Firmware Restart"
msgstr "Redemarrer le FW"
#: screen.py:300 panels/job_status.py:302
msgid "Go Back"
msgstr "Retourner"
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
msgid "Home All"
msgstr "Réinitialiser XYZ"
#: ks_includes/KlipperScreen.conf:45
msgid "Home X"
msgstr "Réinitialiser X"
#: ks_includes/KlipperScreen.conf:63
msgid "Home XY"
msgstr "Réinitialiser XY"
#: ks_includes/KlipperScreen.conf:51
msgid "Home Y"
msgstr "Réinitialiser Y"
#: ks_includes/KlipperScreen.conf:57
msgid "Home Z"
msgstr "Réinitialiser Z"
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
msgid "Homing"
msgstr "Réinitialisation"
#: panels/temperature.py:51
msgid "Increase"
msgstr "Augmenter"
#. self._load_panels()
#: screen.py:149
msgid "Initializing"
msgstr "Initialisation"
#: panels/splash_screen.py:23
msgid "Initializing printer..."
msgstr "Initialisation l'imprimante"
#: ks_includes/config.py:36
msgid "Invert X"
msgstr ""
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr ""
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr ""
#: panels/system.py:22
msgid "Klipper Restart"
msgstr "Redémarrer klipper"
#: panels/system.py:42
msgid "Klipper Version"
msgstr "Version de klipper"
#: screen.py:418
msgid "Klipper has disconnected"
msgstr "Klipper s'est déconnecté"
#: screen.py:429
msgid ""
"Klipper has encountered an error with the micro-controller.\n"
"Please recompile and flash."
msgstr ""
"Klipper a rencontré une erreur avec le microcontrôleur.\n"
"Veuillez recompiler et reflasher."
#: screen.py:433
msgid "Klipper has encountered an error."
msgstr "Klipper a rencontré une erreur."
#: screen.py:425
msgid ""
"Klipper has encountered an error.\n"
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
msgstr ""
"Klipper a rencontré une erreur. Taper FIRMWARE_RESTART pour fixer l'erreur."
#: screen.py:453
msgid "Klipper has shutdown"
msgstr "Klipper s'est arrêté"
#: screen.py:449
msgid "Klipper is attempting to start"
msgstr "Klipper tente de démarrer"
#: ks_includes/KlipperScreen.conf:148
msgid "Klipper will reboot"
msgstr "Klipper va redémarrer"
#: panels/system.py:46
msgid "KlipperScreen Version"
msgstr "Version de KlipperScreen"
#: panels/job_status.py:124
msgid "Left:"
msgstr "Gauche:"
#: panels/bed_mesh.py:98
msgid "Load"
msgstr ""
#: panels/system.py:66
msgid "Load Average"
msgstr "Charge moyenne"
#: panels/zcalibrate.py:39
msgid "Lower Nozzle"
msgstr "Rapprocher la buse"
#: ks_includes/KlipperScreen.conf:96
msgid "Macros"
msgstr "Macros"
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr "Menu principal"
#: panels/extrude.py:31
msgid "Medium"
msgstr "Moyen"
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
#, fuzzy
msgid "Menu"
msgstr "Menu principal"
#: ks_includes/KlipperScreen.conf:69
msgid "Move"
msgstr "Mouvement"
#: panels/move.py:91
msgid "Move Distance (mm)"
msgstr "Distance de mouvement (mm)"
#: panels/print.py:23
msgid "Name"
msgstr ""
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
#: ks_includes/KlipperScreen.conf:211
msgid "Network"
msgstr "Réseau"
#: panels/network.py:31
msgid "Network Info"
msgstr "Information réseau "
#: panels/temperature.py:55
msgid "Number Pad"
msgstr "Pad numerique"
#: ks_includes/config.py:48
#, fuzzy
msgid "Off"
msgstr "ventilateur éteint"
#: panels/job_status.py:276
msgid "Pause"
msgstr "Pause"
#: panels/job_status.py:470
msgid "Paused"
msgstr "En pause"
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
#: ks_includes/KlipperScreen.conf:205
msgid "Power"
msgstr "Energie"
#: panels/splash_screen.py:61
msgid "Power On Printer"
msgstr "Allumer l'imrimante"
#: ks_includes/KlipperScreen.conf:21
msgid "Preheat"
msgstr "Préchauffer"
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
msgid "Print"
msgstr "Imprimer"
#: ks_includes/KlipperScreen.conf:156
msgid "Print Control"
msgstr "Controle de l'imprimante"
#: panels/print.py:171
msgid "Print Time"
msgstr "Temps d'impression"
#: panels/job_status.py:232
msgid "Printing"
msgstr "imprime"
#: panels/bed_mesh.py:264
msgid "Profile Name:"
msgstr ""
#: ks_includes/KlipperScreen.conf:89
msgid "Quad Gantry Level"
msgstr ""
#: panels/zcalibrate.py:37
msgid "Raise Nozzle"
msgstr "Éloigner la buse"
#: panels/job_status.py:278 panels/splash_screen.py:62
msgid "Restart"
msgstr "Redémarrage"
#: panels/job_status.py:280
msgid "Resume"
msgstr "Resumer"
#: panels/extrude.py:48
msgid "Retract"
msgstr "Rétracter"
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
msgid "Save"
msgstr ""
#: ks_includes/KlipperScreen.conf:141
msgid "Save Config"
msgstr "Enregistrer la config"
#: ks_includes/KlipperScreen.conf:146
msgid "Save configuration."
msgstr "Enregistrer la configuration"
#: ks_includes/config.py:46
msgid "Screen Blanking Time"
msgstr ""
#: panels/bed_level.py:114
msgid "Screws Adjust"
msgstr "Ajuster les vis"
#: panels/fan.py:42
msgid "Set Speed"
msgstr "Régler la vitesse"
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
#, fuzzy
msgid "Settings"
msgstr "Paramètres"
#: panels/print.py:169
msgid "Size"
msgstr "dimensions"
#: ks_includes/config.py:44
msgid "Slicer"
msgstr ""
#. This line for translations only
#: panels/extrude.py:31
msgid "Slow"
msgstr "Lent"
#: panels/print.py:39
msgid "Sort by: "
msgstr ""
#: panels/fine_tune.py:47
msgid "Speed +"
msgstr "Vitesse+"
#: panels/fine_tune.py:51
msgid "Speed -"
msgstr "Vitesse-"
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
#: ks_includes/KlipperScreen.conf:216
msgid "System"
msgstr "Systeme"
#: panels/system.py:27
#, fuzzy
msgid ""
"System\n"
"Restart"
msgstr "Redémarrage"
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
msgstr ""
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
#: ks_includes/KlipperScreen.conf:159
msgid "Temperature"
msgstr "Temperature"
#: panels/extrude.py:38
msgid "Tool"
msgstr "outil"
#: panels/print.py:167
msgid "Uploaded"
msgstr "Telecharger"
#: panels/move.py:25
msgid "X+"
msgstr "X+"
#: panels/move.py:27
msgid "X-"
msgstr "X-"
#: panels/move.py:30
msgid "Y+"
msgstr "Y+"
#: panels/move.py:32
msgid "Y-"
msgstr "Y-"
#: ks_includes/KlipperScreen.conf:125
msgid "Z Calibrate"
msgstr "Calibration Z"
#: panels/zcalibrate.py:28
msgid "Z Offset"
msgstr "Décalage Z"
#: panels/fine_tune.py:36 panels/move.py:35
msgid "Z+"
msgstr "Z+"
#: panels/fine_tune.py:40 panels/move.py:37
msgid "Z-"
msgstr "Z-"
#: ks_includes/config.py:60
msgid "minutes"
msgstr ""
#: panels/fine_tune.py:38
msgid "mm"
msgstr "mm"
#, fuzzy
#~ msgid "Klipper"
#~ msgstr "Redémarrer klipper"
#~ msgid "Back"
#~ msgstr "Retour"
#~ msgid "Extrusion"
#~ msgstr "Extrusion"
#~ msgid "Fan +"
#~ msgstr "Ventilateur+"
#~ msgid "Fan -"
#~ msgstr "Ventilateur-"
#~ msgid "Speed"
#~ msgstr "Vitesse"
#~ msgid "System Information"
#~ msgstr "Info systeme"
#~ msgid "Time Elapsed"
#~ msgstr "Temps écoulé"
#~ msgid "Time Left"
#~ msgstr "temps restant"
#~ msgid "Tool 1"
#~ msgstr "Outil 1"
@@ -0,0 +1,579 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: Klipperscreen\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
"PO-Revision-Date: 2021-01-08 08:21-0500\n"
"Last-Translator: Emanuel Sharvit <manu7irl@gmail.com>\n"
"Language-Team: \n"
"Language: he_IL\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.4.2\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : n==2 ? 1 : n>10 && n%10==0 ? "
"2 : 3);\n"
"X-Poedit-SourceCharset: UTF-8\n"
#: panels/print.py:247
msgid "?"
msgstr "?"
#: panels/zcalibrate.py:71
msgid "Abort"
msgstr "בטל"
#: panels/zcalibrate.py:68
msgid "Accept"
msgstr "אשר"
#: ks_includes/KlipperScreen.conf:26
msgid "Actions"
msgstr "פעולות"
#: panels/bed_mesh.py:33
msgid "Add bed mesh profile"
msgstr ""
#: panels/print.py:247
msgid "Are you sure you want to print"
msgstr "האם אתה בטוח שברצונך להדפיס"
#: panels/job_status.py:306
msgid "Are you sure you wish to cancel this print?"
msgstr "האם אתה בטוח שברצונך לבטל את ההדפסה?"
#: panels/system.py:29
#, fuzzy
msgid "Are you sure you wish to reboot the system?"
msgstr "האם אתה בטוח שברצונך לבטל את ההדפסה?"
#: panels/system.py:32
#, fuzzy
msgid "Are you sure you wish to shutdown the system?"
msgstr "האם אתה בטוח שברצונך לבטל את ההדפסה?"
#: ks_includes/KlipperScreen.conf:114
msgid "Bed Level"
msgstr "פילוס מיטה"
#: ks_includes/KlipperScreen.conf:119
msgid "Bed Mesh"
msgstr "מיפוי מיטה"
#: panels/bed_mesh.py:104
#, fuzzy
msgid "Calibrate"
msgstr "כיול Z"
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
msgid "Cancel"
msgstr "ביטול"
#: panels/fan.py:45
msgid "Cancel Change"
msgstr "בטל שינוי"
#: panels/job_status.py:301
msgid "Cancel Print"
msgstr "בטל הדפסה"
#: screen.py:305
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
"בדוק KlipperScreen.log, בתיקית tmp ליותר פרטים.\n"
"אנא שלח דוח תקלה ב- GITHUB, לעזרה."
#: panels/bed_mesh.py:290 panels/temperature.py:150
msgid "Close"
msgstr "סגור"
#: ks_includes/KlipperScreen.conf:30
msgid "Configuration"
msgstr "קונפיגורציה"
#: screen.py:492
msgid "Continue"
msgstr "המשך"
#: panels/job_status.py:270
msgid "Control"
msgstr "שליטה"
#: panels/preheat.py:54
msgid "Cooldown"
msgstr "קירור"
#: panels/print.py:24
msgid "Date"
msgstr ""
#: panels/temperature.py:53
msgid "Decrease"
msgstr "הקטן"
#: panels/bed_mesh.py:122
msgid "Delete"
msgstr ""
#: ks_includes/KlipperScreen.conf:108
msgid "Disable Motors"
msgstr "בטל מנועים"
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr "בטל XY"
#: panels/settings.py:28
msgid "Displayed Macros"
msgstr ""
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr "מרחק (מ''מ)"
#: ks_includes/config.py:42
msgid "Duration Only"
msgstr ""
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr "זמן שעבר:"
#: panels/job_status.py:272
msgid "Emergency Stop"
msgstr "עצירת חירום"
#: ks_includes/config.py:39
msgid "Estimated Time Method"
msgstr ""
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
#: ks_includes/KlipperScreen.conf:174
msgid "Extrude"
msgstr "אקסטרוזיה"
#: panels/fine_tune.py:57
msgid "Extrusion +"
msgstr "שיחול +"
#: panels/fine_tune.py:61
msgid "Extrusion -"
msgstr "שיחול -"
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
msgid "Fan"
msgstr "מאוורר"
#: panels/fan.py:35
msgid "Fan Off"
msgstr "כבה מאוורר"
#: panels/fan.py:38
msgid "Fan On"
msgstr "הפעל מאוורר"
#: panels/extrude.py:31
msgid "Fast"
msgstr "מהיר"
#: ks_includes/config.py:43
msgid "Filament Used"
msgstr ""
#: ks_includes/config.py:41
msgid "File Estimation (default)"
msgstr ""
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr "כיולים עדינים"
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Firmware Restart"
msgstr "התחל קושחה"
#: screen.py:300 panels/job_status.py:302
msgid "Go Back"
msgstr "חזרה"
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
msgid "Home All"
msgstr "איפוס XYZ"
#: ks_includes/KlipperScreen.conf:45
msgid "Home X"
msgstr "איפוס X"
#: ks_includes/KlipperScreen.conf:63
msgid "Home XY"
msgstr "איפוס XY"
#: ks_includes/KlipperScreen.conf:51
msgid "Home Y"
msgstr "איפוס Y"
#: ks_includes/KlipperScreen.conf:57
msgid "Home Z"
msgstr "איפוס Z"
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
msgid "Homing"
msgstr "איפוס צירים"
#: panels/temperature.py:51
msgid "Increase"
msgstr "הגדל"
#. self._load_panels()
#: screen.py:149
msgid "Initializing"
msgstr "מאתחל"
#: panels/splash_screen.py:23
msgid "Initializing printer..."
msgstr "מאתחל מדפסת..."
#: ks_includes/config.py:36
msgid "Invert X"
msgstr ""
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr ""
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr ""
#: panels/system.py:22
msgid "Klipper Restart"
msgstr "אתחול קליפר"
#: panels/system.py:42
msgid "Klipper Version"
msgstr "גרסא של קליפר"
#: screen.py:418
msgid "Klipper has disconnected"
msgstr "קליפר התנתק"
#: screen.py:429
msgid ""
"Klipper has encountered an error with the micro-controller.\n"
"Please recompile and flash."
msgstr "בעיית תקשורת בין קליפר ללוח בקרה. אנא לקמפל קושחה ולצרובה מחדש. "
#: screen.py:433
msgid "Klipper has encountered an error."
msgstr "קילפר נתקל בבעיה."
#: screen.py:425
msgid ""
"Klipper has encountered an error.\n"
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
msgstr ""
"קליפר נתקל בבעיה. \n"
"נסה להריץ firmware_restart, כדי לפתור את הבעיה."
#: screen.py:453
msgid "Klipper has shutdown"
msgstr "קליפר נכבה"
#: screen.py:449
msgid "Klipper is attempting to start"
msgstr "קליפר מנסה לרוץ"
#: ks_includes/KlipperScreen.conf:148
msgid "Klipper will reboot"
msgstr "קליפר יבצע אתחול"
#: panels/system.py:46
msgid "KlipperScreen Version"
msgstr "גרסא של KlipperScreen"
#: panels/job_status.py:124
msgid "Left:"
msgstr "זמן שנותר:"
#: panels/bed_mesh.py:98
msgid "Load"
msgstr ""
#: panels/system.py:66
msgid "Load Average"
msgstr "עומס ממוצע"
#: panels/zcalibrate.py:39
msgid "Lower Nozzle"
msgstr "הנמך דיזה"
#: ks_includes/KlipperScreen.conf:96
msgid "Macros"
msgstr "מקרואים"
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr "תפריט ראשי"
#: panels/extrude.py:31
msgid "Medium"
msgstr "ממוצע"
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
#, fuzzy
msgid "Menu"
msgstr "תפריט ראשי"
#: ks_includes/KlipperScreen.conf:69
msgid "Move"
msgstr "הזזת צירים"
#: panels/move.py:91
msgid "Move Distance (mm)"
msgstr "מרחק הזזה (מ''מ)"
#: panels/print.py:23
msgid "Name"
msgstr ""
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
#: ks_includes/KlipperScreen.conf:211
msgid "Network"
msgstr "רשת"
#: panels/network.py:31
msgid "Network Info"
msgstr "מידע על הרשת"
#: panels/temperature.py:55
msgid "Number Pad"
msgstr "פד נומרי"
#: ks_includes/config.py:48
#, fuzzy
msgid "Off"
msgstr "כבה מאוורר"
#: panels/job_status.py:276
msgid "Pause"
msgstr "השהיה"
#: panels/job_status.py:470
msgid "Paused"
msgstr "מושהה"
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
#: ks_includes/KlipperScreen.conf:205
msgid "Power"
msgstr "הפעלה"
#: panels/splash_screen.py:61
msgid "Power On Printer"
msgstr "הפעל מדפסת"
#: ks_includes/KlipperScreen.conf:21
msgid "Preheat"
msgstr "חימום מראש"
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
msgid "Print"
msgstr "הדפס"
#: ks_includes/KlipperScreen.conf:156
msgid "Print Control"
msgstr "שליטה בהדפסה"
#: panels/print.py:171
msgid "Print Time"
msgstr "זמן הדפסה"
#: panels/job_status.py:232
msgid "Printing"
msgstr "מדפיס"
#: panels/bed_mesh.py:264
msgid "Profile Name:"
msgstr ""
#: ks_includes/KlipperScreen.conf:89
msgid "Quad Gantry Level"
msgstr ""
#: panels/zcalibrate.py:37
msgid "Raise Nozzle"
msgstr "הגבה"
#: panels/job_status.py:278 panels/splash_screen.py:62
msgid "Restart"
msgstr "אתחל"
#: panels/job_status.py:280
msgid "Resume"
msgstr "המשך"
#: panels/extrude.py:48
msgid "Retract"
msgstr "שיחול לאחור"
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
msgid "Save"
msgstr ""
#: ks_includes/KlipperScreen.conf:141
msgid "Save Config"
msgstr "שמור קונפיג"
#: ks_includes/KlipperScreen.conf:146
msgid "Save configuration."
msgstr "שמור קונפיגורציה"
#: ks_includes/config.py:46
msgid "Screen Blanking Time"
msgstr ""
#: panels/bed_level.py:114
msgid "Screws Adjust"
msgstr "סידור ברגים"
#: panels/fan.py:42
msgid "Set Speed"
msgstr "קבע מהירות"
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
msgid "Settings"
msgstr "הגדרות"
#: panels/print.py:169
msgid "Size"
msgstr "גודל"
#: ks_includes/config.py:44
msgid "Slicer"
msgstr ""
#. This line for translations only
#: panels/extrude.py:31
msgid "Slow"
msgstr "האט"
#: panels/print.py:39
msgid "Sort by: "
msgstr ""
#: panels/fine_tune.py:47
msgid "Speed +"
msgstr "מהירות +"
#: panels/fine_tune.py:51
msgid "Speed -"
msgstr "מהירות -"
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
#: ks_includes/KlipperScreen.conf:216
msgid "System"
msgstr "מערכת"
#: panels/system.py:27
#, fuzzy
msgid ""
"System\n"
"Restart"
msgstr "אתחל"
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
msgstr ""
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
#: ks_includes/KlipperScreen.conf:159
msgid "Temperature"
msgstr "טמפרטורה"
#: panels/extrude.py:38
msgid "Tool"
msgstr "כלי"
#: panels/print.py:167
msgid "Uploaded"
msgstr "הועלה"
#: panels/move.py:25
msgid "X+"
msgstr "X+"
#: panels/move.py:27
msgid "X-"
msgstr "X-"
#: panels/move.py:30
msgid "Y+"
msgstr "Y+"
#: panels/move.py:32
msgid "Y-"
msgstr "Y-"
#: ks_includes/KlipperScreen.conf:125
msgid "Z Calibrate"
msgstr "כיול Z"
#: panels/zcalibrate.py:28
msgid "Z Offset"
msgstr "הפרז גובה Z"
#: panels/fine_tune.py:36 panels/move.py:35
msgid "Z+"
msgstr "Z+"
#: panels/fine_tune.py:40 panels/move.py:37
msgid "Z-"
msgstr "Z-"
#: ks_includes/config.py:60
msgid "minutes"
msgstr ""
#: panels/fine_tune.py:38
msgid "mm"
msgstr "מ''מ"
#, fuzzy
#~ msgid "Klipper"
#~ msgstr "אתחול קליפר"
#~ msgid "Back"
#~ msgstr "חזור"
#~ msgid "Extrusion"
#~ msgstr "שיחול"
#~ msgid "Fan +"
#~ msgstr "מאוורר +"
#~ msgid "Fan -"
#~ msgstr "מאוורר -"
#~ msgid "Speed"
#~ msgstr "מהירות"
#~ msgid "System Information"
#~ msgstr "מידע אודות המערכת"
#~ msgid "Time Elapsed"
#~ msgstr "זמן שעבר"
#~ msgid "Time Left"
#~ msgstr "זמן שנשאר"
#~ msgid "Tool 1"
#~ msgstr "כלי 1"
+209
View File
@@ -0,0 +1,209 @@
<?xml version="1.0" encoding="UTF-8"?>
<keyboard>
<options>
<!-- not yet implemented -->
</options>
<layout id="defualt keyboard">
<row>
<key obey-caps='true'>
<default display="q" />
<shifted display="Q" />
<mod1 display="1" />
<mod2 display="~" />
</key>
<key obey-caps='true'>
<default display="w" />
<shifted display="W" />
<mod1 display="2" />
<mod2 display="`" />
</key>
<key obey-caps='true'>
<default display="e" />
<shifted display="E" />
<mod1 display="3" />
<mod2 display="|" />
</key>
<key obey-caps='true'>
<default display="r" />
<shifted display="R" />
<mod1 display="4" />
<mod2 display="•" />
</key>
<key obey-caps='true'>
<default display="t" />
<shifted display="T" />
<mod1 display="5" />
<mod2 display="√" />
</key>
<key obey-caps='true'>
<default display="y" />
<shifted display="Y" />
<mod1 display="6" />
<mod2 display="π" />
</key>
<key obey-caps='true'>
<default display="u" />
<shifted display="U" />
<mod1 display="7" />
<mod2 display="÷" />
</key>
<key obey-caps='true'>
<default display="i" />
<shifted display="I" />
<mod1 display="8" />
<mod2 display="×" />
</key>
<key obey-caps='true'>
<default display="o" />
<shifted display="O" />
<mod1 display="9" />
<mod2 display="¶" />
</key>
<key obey-caps='true'>
<default display="p" />
<shifted display="P" />
<mod1 display="0" />
<mod2 display="∆" />
</key>
</row>
<row>
<key obey-caps='true'>
<default display="Caps" action="modifier:caps" />
<shifted display="Caps" action="modifier:caps" />
<mod1 display="@" />
<mod2 display="£" />
</key>
<key obey-caps='true'>
<default display="a" />
<shifted display="A" />
<mod1 display="#" />
<mod2 display="¢" />
</key>
<key obey-caps='true'>
<default display="s" />
<shifted display="S" />
<mod1 display="$" />
<mod2 display="€" />
</key>
<key obey-caps='true'>
<default display="d" />
<shifted display="D" />
<mod1 display="_" />
<mod2 display="¥" />
</key>
<key obey-caps='true'>
<default display="f" />
<shifted display="F" />
<mod1 display="&amp;" />
<mod2 display="^" />
</key>
<key obey-caps='true'>
<default display="g" />
<shifted display="G" />
<mod1 display="-" />
<mod2 display="°" />
</key>
<key obey-caps='true'>
<default display="h" />
<shifted display="H" />
<mod1 display="+" />
<mod2 display="=" />
</key>
<key obey-caps='true'>
<default display="j" />
<shifted display="J" />
<mod1 display="(" />
<mod2 display="{" />
</key>
<key obey-caps='true'>
<default display="k" />
<shifted display="K" />
<mod1 display=")" />
<mod2 display="}" />
</key>
<key obey-caps='true'>
<default display="l" />
<shifted display="L" />
<mod1 display="/" />
<mod2 display="\" />
</key>
</row>
<row>
<key obey-caps='true'>
<default display="↑" action="modifier:shift" />
</key>
<key obey-caps='true'>
<default display="z" />
<shifted display="Z" />
<mod1 display="*" />
<mod2 display="%" />
</key>
<key obey-caps='true'>
<default display="x" />
<shifted display="X" />
<mod1 display='"' />
<mod2 display="©" />
</key>
<key obey-caps='true'>
<default display="c" />
<shifted display="C" />
<mod1 display="'" />
<mod2 display="®" />
</key>
<key obey-caps='true'>
<default display="v" />
<shifted display="V" />
<mod1 display=":" />
<mod2 display="™" />
</key>
<key obey-caps='true'>
<default display="b" />
<shifted display="B" />
<mod1 display=";" />
<mod2 display="✓" />
</key>
<key obey-caps='true'>
<default display="n" />
<shifted display="N" />
<mod1 display="!" />
<mod2 display="[" />
</key>
<key obey-caps='true'>
<default display="m" />
<shifted display="M" />
<mod1 display="?" />
<mod2 display="]" />
</key>
<key obey-caps='true'>
<default display="⌫" action="backspace" />
</key>
</row>
<row>
<key>
<default display="?123" action="modifier:mod1" />
</key>
<key>
<default display="=\&lt;" action="modifier:mod2" />
</key>
<key>
<default display="," />
<mod2 display="&lt;" />
</key>
<key width="6000" fill="true">
<default display=" " action="space" />
</key>
<key>
<default display="." />
<mod2 display="&gt;" />
</key>
<key width="1000">
<!-- <default display="◀┛" action="return"/> -->
<default display="◀┛" action="return"/>
</key>
</row>
</layout>
</keyboard>
@@ -0,0 +1,552 @@
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
#
# Jakob Kais <schpuntik@freenet.de>, 2021.
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
"PO-Revision-Date: 2021-02-12 02:24+0100\n"
"Last-Translator: Jakob Kais <schpuntik@freenet.de>\n"
"Language-Team: Russian <kde-i18n-de@kde.org>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.3\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n"
"X-Poedit-Flags-xgettext: --add-comments\n"
#: panels/print.py:247
msgid "?"
msgstr "?"
#: panels/zcalibrate.py:71
msgid "Abort"
msgstr "Отменить"
#: panels/zcalibrate.py:68
msgid "Accept"
msgstr "Применить"
#: ks_includes/KlipperScreen.conf:26
msgid "Actions"
msgstr "Действия"
#: panels/bed_mesh.py:33
msgid "Add bed mesh profile"
msgstr "Добавить профиль сетки стола"
#: panels/print.py:247
msgid "Are you sure you want to print"
msgstr "Вы хотите это распечатать"
#: panels/job_status.py:306
msgid "Are you sure you wish to cancel this print?"
msgstr "Вы хотите отменить эту печать?"
#: panels/system.py:29
msgid "Are you sure you wish to reboot the system?"
msgstr "Вы уверены что хотите перезагрузить систему?"
#: panels/system.py:32
msgid "Are you sure you wish to shutdown the system?"
msgstr "Вы хотите выключить принтер?"
#: ks_includes/KlipperScreen.conf:114
msgid "Bed Level"
msgstr "Уровень стола"
#: ks_includes/KlipperScreen.conf:119
msgid "Bed Mesh"
msgstr "Сетка стола"
#: panels/bed_mesh.py:104
msgid "Calibrate"
msgstr "Калибровка"
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
msgid "Cancel"
msgstr "Отменить"
#: panels/fan.py:45
msgid "Cancel Change"
msgstr "Отменить изменения"
#: panels/job_status.py:301
msgid "Cancel Print"
msgstr "Отменить печать"
#: screen.py:305
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
"Проверьте /tmp/KlipperScreen.log для дополнитольной информации.\n"
"Создайте issues на GitHub что-бы получить помощь."
#: panels/bed_mesh.py:290 panels/temperature.py:150
msgid "Close"
msgstr "Закрыть"
#: ks_includes/KlipperScreen.conf:30
msgid "Configuration"
msgstr "Конфигурация"
#: screen.py:492
msgid "Continue"
msgstr "Продолжить"
#: panels/job_status.py:270
msgid "Control"
msgstr "Управление"
#: panels/preheat.py:54
msgid "Cooldown"
msgstr "Остудить"
#: panels/print.py:24
msgid "Date"
msgstr "Дата"
#: panels/temperature.py:53
msgid "Decrease"
msgstr "Уменьшить"
#: panels/bed_mesh.py:122
msgid "Delete"
msgstr "Удалить"
#: ks_includes/KlipperScreen.conf:108
msgid "Disable Motors"
msgstr "Отключить моторы"
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr "Отключить XY"
#: panels/settings.py:28
msgid "Displayed Macros"
msgstr "Показать макросы"
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr "Расстояние (mm)"
#: ks_includes/config.py:42
msgid "Duration Only"
msgstr "Продолжительность печати"
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr "Прошло:"
#: panels/job_status.py:272
msgid "Emergency Stop"
msgstr "Аварийный стоп"
#: ks_includes/config.py:39
msgid "Estimated Time Method"
msgstr "Расчётное время"
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
#: ks_includes/KlipperScreen.conf:174
msgid "Extrude"
msgstr "Заправить"
#: panels/fine_tune.py:57
msgid "Extrusion +"
msgstr "Экструзия +"
#: panels/fine_tune.py:61
msgid "Extrusion -"
msgstr "Экструзия -"
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
msgid "Fan"
msgstr "Обдув"
#: panels/fan.py:35
msgid "Fan Off"
msgstr "Вентилятор выкл"
#: panels/fan.py:38
msgid "Fan On"
msgstr "Вентилятор вкл"
#: panels/extrude.py:31
msgid "Fast"
msgstr "Быстро"
#: ks_includes/config.py:43
msgid "Filament Used"
msgstr "Использование филамента"
#: ks_includes/config.py:41
msgid "File Estimation (default)"
msgstr "По файлу (по умолчанию)"
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr "Точная настройка"
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Firmware Restart"
msgstr ""
"Перезагрузка\n"
"прошивки"
#: screen.py:300 panels/job_status.py:302
msgid "Go Back"
msgstr "Назад"
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
msgid "Home All"
msgstr "Парковать все"
#: ks_includes/KlipperScreen.conf:45
msgid "Home X"
msgstr "Парковать X"
#: ks_includes/KlipperScreen.conf:63
msgid "Home XY"
msgstr "Парковать XY"
#: ks_includes/KlipperScreen.conf:51
msgid "Home Y"
msgstr "Парковать Y"
#: ks_includes/KlipperScreen.conf:57
msgid "Home Z"
msgstr "Парковать Z"
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
msgid "Homing"
msgstr "Парковка"
#: panels/temperature.py:51
msgid "Increase"
msgstr "Поднять"
#. self._load_panels()
#: screen.py:149
msgid "Initializing"
msgstr "Запуск"
#: panels/splash_screen.py:23
msgid "Initializing printer..."
msgstr "Принтер стартует..."
#: ks_includes/config.py:36
msgid "Invert X"
msgstr "Инвертировать X"
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr "Инвертировать Y"
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr "Инвертировать Z"
#: panels/system.py:22
msgid "Klipper Restart"
msgstr ""
"Перезагрузка\n"
"Klipper"
#: panels/system.py:42
msgid "Klipper Version"
msgstr "Версия Klipper"
#: screen.py:418
msgid "Klipper has disconnected"
msgstr "Нет связи с Klipper"
#: screen.py:429
msgid ""
"Klipper has encountered an error with the micro-controller.\n"
"Please recompile and flash."
msgstr ""
"Klipper определил ошибку в микроконтроллере.\n"
"Прошейте заново."
#: screen.py:433
msgid "Klipper has encountered an error."
msgstr "Klipper обнаружил ошибку."
#: screen.py:425
msgid ""
"Klipper has encountered an error.\n"
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
msgstr ""
"Klipper обнаружил ошибку.\n"
"Выполните перезагрузку прошивки, чтобы попытаться исправить проблему."
#: screen.py:453
msgid "Klipper has shutdown"
msgstr "Klipper отключился"
#: screen.py:449
msgid "Klipper is attempting to start"
msgstr "Klipper готов"
#: ks_includes/KlipperScreen.conf:148
msgid "Klipper will reboot"
msgstr "Klipper перезагружается"
#: panels/system.py:46
msgid "KlipperScreen Version"
msgstr "Версия KlipperScreen"
#: panels/job_status.py:124
msgid "Left:"
msgstr "Осталось:"
#: panels/bed_mesh.py:98
msgid "Load"
msgstr "Загрузить"
#: panels/system.py:66
msgid "Load Average"
msgstr "Средняя нагрузка"
#: panels/zcalibrate.py:39
msgid "Lower Nozzle"
msgstr "Опустить сопло"
#: ks_includes/KlipperScreen.conf:96
msgid "Macros"
msgstr "Макросы"
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr "Главное меню"
#: panels/extrude.py:31
msgid "Medium"
msgstr "Среднее"
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
msgid "Menu"
msgstr "Меню"
#: ks_includes/KlipperScreen.conf:69
msgid "Move"
msgstr "Двигать"
#: panels/move.py:91
msgid "Move Distance (mm)"
msgstr "Дистанция перемещения (mm)"
#: panels/print.py:23
msgid "Name"
msgstr "Имя"
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
#: ks_includes/KlipperScreen.conf:211
msgid "Network"
msgstr "Сеть"
#: panels/network.py:31
msgid "Network Info"
msgstr "Информация о сети"
#: panels/temperature.py:55
msgid "Number Pad"
msgstr "Номер блока"
#: ks_includes/config.py:48
msgid "Off"
msgstr "Выкл"
#: panels/job_status.py:276
msgid "Pause"
msgstr "Пауза"
#: panels/job_status.py:470
msgid "Paused"
msgstr "Приостановлено"
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
#: ks_includes/KlipperScreen.conf:205
msgid "Power"
msgstr "Включено"
#: panels/splash_screen.py:61
msgid "Power On Printer"
msgstr "Включить принтер"
#: ks_includes/KlipperScreen.conf:21
msgid "Preheat"
msgstr "Разогрев"
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
msgid "Print"
msgstr "Печать"
#: ks_includes/KlipperScreen.conf:156
msgid "Print Control"
msgstr "Управление печатью"
#: panels/print.py:171
msgid "Print Time"
msgstr "Время печати"
#: panels/job_status.py:232
msgid "Printing"
msgstr "Печатается"
#: panels/bed_mesh.py:264
msgid "Profile Name:"
msgstr "Имя профиля:"
#: ks_includes/KlipperScreen.conf:89
msgid "Quad Gantry Level"
msgstr "Уровень Quad Gantry"
#: panels/zcalibrate.py:37
msgid "Raise Nozzle"
msgstr "Поднять сопло"
#: panels/job_status.py:278 panels/splash_screen.py:62
msgid "Restart"
msgstr "Перезагрузка"
#: panels/job_status.py:280
msgid "Resume"
msgstr "Продолжить"
#: panels/extrude.py:48
msgid "Retract"
msgstr "Выгрузить"
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
msgid "Save"
msgstr "Сохранить"
#: ks_includes/KlipperScreen.conf:141
msgid "Save Config"
msgstr "Сохранить настройки"
#: ks_includes/KlipperScreen.conf:146
msgid "Save configuration."
msgstr "Настройки сохраняются."
#: ks_includes/config.py:46
msgid "Screen Blanking Time"
msgstr "Скрыть экран через"
#: panels/bed_level.py:114
msgid "Screws Adjust"
msgstr "Настроить винты"
#: panels/fan.py:42
msgid "Set Speed"
msgstr "Скорость"
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
msgid "Settings"
msgstr "Настройки"
#: panels/print.py:169
msgid "Size"
msgstr "Размер"
#: ks_includes/config.py:44
msgid "Slicer"
msgstr "Slicer"
#. This line for translations only
#: panels/extrude.py:31
msgid "Slow"
msgstr "Медленно"
#: panels/print.py:39
msgid "Sort by: "
msgstr "Сортировать по: "
#: panels/fine_tune.py:47
msgid "Speed +"
msgstr "Скорость +"
#: panels/fine_tune.py:51
msgid "Speed -"
msgstr "Скорость -"
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
#: ks_includes/KlipperScreen.conf:216
msgid "System"
msgstr "Система"
#: panels/system.py:27
msgid ""
"System\n"
"Restart"
msgstr ""
"Перегрузить\n"
"Систему"
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
msgstr "Выключить"
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
#: ks_includes/KlipperScreen.conf:159
msgid "Temperature"
msgstr "Температура"
#: panels/extrude.py:38
msgid "Tool"
msgstr "Инструмент"
#: panels/print.py:167
msgid "Uploaded"
msgstr "Загружено"
#: panels/move.py:25
msgid "X+"
msgstr "X+"
#: panels/move.py:27
msgid "X-"
msgstr "X-"
#: panels/move.py:30
msgid "Y+"
msgstr "Y+"
#: panels/move.py:32
msgid "Y-"
msgstr "Y-"
#: ks_includes/KlipperScreen.conf:125
msgid "Z Calibrate"
msgstr "Калибровка Z"
#: panels/zcalibrate.py:28
msgid "Z Offset"
msgstr "Офсет Z"
#: panels/fine_tune.py:36 panels/move.py:35
msgid "Z+"
msgstr "Z+"
#: panels/fine_tune.py:40 panels/move.py:37
msgid "Z-"
msgstr "Z-"
#: ks_includes/config.py:60
msgid "minutes"
msgstr "минут"
#: panels/fine_tune.py:38
msgid "mm"
msgstr "mm"
#~ msgid "Klipper"
#~ msgstr "Klipper"
@@ -0,0 +1,580 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
"PO-Revision-Date: 2021-01-06 00:35+0200\n"
"Last-Translator: Emanuel Sharvit <manu7irl@gmail.com>\n"
"Language-Team: \n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.4.2\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: panels/print.py:247
msgid "?"
msgstr "?"
#: panels/zcalibrate.py:71
msgid "Abort"
msgstr "中止"
#: panels/zcalibrate.py:68
msgid "Accept"
msgstr "接受"
#: ks_includes/KlipperScreen.conf:26
msgid "Actions"
msgstr "动作"
#: panels/bed_mesh.py:33
msgid "Add bed mesh profile"
msgstr ""
#: panels/print.py:247
msgid "Are you sure you want to print"
msgstr "您确定要打印吗"
#: panels/job_status.py:306
msgid "Are you sure you wish to cancel this print?"
msgstr "您要取消此打印吗?"
#: panels/system.py:29
#, fuzzy
msgid "Are you sure you wish to reboot the system?"
msgstr "您要取消此打印吗?"
#: panels/system.py:32
#, fuzzy
msgid "Are you sure you wish to shutdown the system?"
msgstr "您要取消此打印吗?"
#: ks_includes/KlipperScreen.conf:114
msgid "Bed Level"
msgstr "床位"
#: ks_includes/KlipperScreen.conf:119
msgid "Bed Mesh"
msgstr "床网"
#: panels/bed_mesh.py:104
#, fuzzy
msgid "Calibrate"
msgstr "Z校准"
#: screen.py:493 panels/job_status.py:268 panels/print.py:243
msgid "Cancel"
msgstr "取消"
#: panels/fan.py:45
msgid "Cancel Change"
msgstr "取消变更"
#: panels/job_status.py:301
msgid "Cancel Print"
msgstr "取消列印"
#: screen.py:305
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
"检查/tmp/KlipperScreen.log以获取更多信息。\n"
"请在GitHub上提交问题以寻求帮助。"
#: panels/bed_mesh.py:290 panels/temperature.py:150
msgid "Close"
msgstr "关"
#: ks_includes/KlipperScreen.conf:30
msgid "Configuration"
msgstr "组态"
#: screen.py:492
msgid "Continue"
msgstr "继续"
#: panels/job_status.py:270
msgid "Control"
msgstr "控制"
#: panels/preheat.py:54
msgid "Cooldown"
msgstr "冷却"
#: panels/print.py:24
msgid "Date"
msgstr ""
#: panels/temperature.py:53
msgid "Decrease"
msgstr "减少"
#: panels/bed_mesh.py:122
msgid "Delete"
msgstr ""
#: ks_includes/KlipperScreen.conf:108
msgid "Disable Motors"
msgstr "禁用马达"
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr "禁用XY"
#: panels/settings.py:28
msgid "Displayed Macros"
msgstr ""
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr "距离(毫米)"
#: ks_includes/config.py:42
msgid "Duration Only"
msgstr ""
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr "过去"
#: panels/job_status.py:272
msgid "Emergency Stop"
msgstr "紧急停止"
#: ks_includes/config.py:39
msgid "Estimated Time Method"
msgstr ""
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
#: ks_includes/KlipperScreen.conf:174
msgid "Extrude"
msgstr "拉伸"
#: panels/fine_tune.py:57
msgid "Extrusion +"
msgstr "挤压+"
#: panels/fine_tune.py:61
msgid "Extrusion -"
msgstr "挤压-"
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:169
msgid "Fan"
msgstr "风扇"
#: panels/fan.py:35
msgid "Fan Off"
msgstr "散开"
#: panels/fan.py:38
msgid "Fan On"
msgstr "扇上"
#: panels/extrude.py:31
msgid "Fast"
msgstr "快速"
#: ks_includes/config.py:43
msgid "Filament Used"
msgstr ""
#: ks_includes/config.py:41
msgid "File Estimation (default)"
msgstr ""
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr "微调"
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Firmware Restart"
msgstr "固件重启"
#: screen.py:300 panels/job_status.py:302
msgid "Go Back"
msgstr "回去"
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
msgid "Home All"
msgstr "全部回家"
#: ks_includes/KlipperScreen.conf:45
msgid "Home X"
msgstr "X家庭"
#: ks_includes/KlipperScreen.conf:63
msgid "Home XY"
msgstr "XY首页"
#: ks_includes/KlipperScreen.conf:51
msgid "Home Y"
msgstr "Y家"
#: ks_includes/KlipperScreen.conf:57
msgid "Home Z"
msgstr "Z家"
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
msgid "Homing"
msgstr "归巢"
#: panels/temperature.py:51
msgid "Increase"
msgstr "增加"
#. self._load_panels()
#: screen.py:149
msgid "Initializing"
msgstr "Initializing"
#: panels/splash_screen.py:23
msgid "Initializing printer..."
msgstr "初始化打印机..."
#: ks_includes/config.py:36
msgid "Invert X"
msgstr ""
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr ""
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr ""
#: panels/system.py:22
msgid "Klipper Restart"
msgstr "快闪重启"
#: panels/system.py:42
msgid "Klipper Version"
msgstr "快艇版本"
#: screen.py:418
msgid "Klipper has disconnected"
msgstr "Klipper已断开连接"
#: screen.py:429
msgid ""
"Klipper has encountered an error with the micro-controller.\n"
"Please recompile and flash."
msgstr ""
"Klipper的微控制器出错。\n"
"请重新编译并刷新。"
#: screen.py:433
msgid "Klipper has encountered an error."
msgstr "Klipper遇到错误。"
#: screen.py:425
msgid ""
"Klipper has encountered an error.\n"
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
msgstr ""
"Klipper遇到错误。\n"
"发出FIRMWARE_RESTART尝试解决此问题。"
#: screen.py:453
msgid "Klipper has shutdown"
msgstr "Klipper已关闭"
#: screen.py:449
msgid "Klipper is attempting to start"
msgstr "Klipper正在尝试启动"
#: ks_includes/KlipperScreen.conf:148
msgid "Klipper will reboot"
msgstr "Klipper将重新启动"
#: panels/system.py:46
msgid "KlipperScreen Version"
msgstr "KlipperScreen版本"
#: panels/job_status.py:124
msgid "Left:"
msgstr "剩下的时间"
#: panels/bed_mesh.py:98
msgid "Load"
msgstr ""
#: panels/system.py:66
msgid "Load Average"
msgstr "平均负载"
#: panels/zcalibrate.py:39
msgid "Lower Nozzle"
msgstr "下喷嘴"
#: ks_includes/KlipperScreen.conf:96
msgid "Macros"
msgstr "巨集"
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr "主菜单"
#: panels/extrude.py:31
msgid "Medium"
msgstr "中"
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
#, fuzzy
msgid "Menu"
msgstr "主菜单"
#: ks_includes/KlipperScreen.conf:69
msgid "Move"
msgstr "移动"
#: panels/move.py:91
msgid "Move Distance (mm)"
msgstr "移动距离(mm)"
#: panels/print.py:23
msgid "Name"
msgstr ""
#: ks_includes/KlipperScreen.conf:131 ks_includes/KlipperScreen.conf:186
#: ks_includes/KlipperScreen.conf:211
msgid "Network"
msgstr "网络"
#: panels/network.py:31
msgid "Network Info"
msgstr "网络信息"
#: panels/temperature.py:55
msgid "Number Pad"
msgstr "数字键盘"
#: ks_includes/config.py:48
#, fuzzy
msgid "Off"
msgstr "散开"
#: panels/job_status.py:276
msgid "Pause"
msgstr "暂停"
#: panels/job_status.py:470
msgid "Paused"
msgstr "已暂停"
#: ks_includes/KlipperScreen.conf:102 ks_includes/KlipperScreen.conf:180
#: ks_includes/KlipperScreen.conf:205
msgid "Power"
msgstr "功率"
#: panels/splash_screen.py:61
msgid "Power On Printer"
msgstr "开启打印机电源"
#: ks_includes/KlipperScreen.conf:21
msgid "Preheat"
msgstr "预热"
#: panels/print.py:242 ks_includes/KlipperScreen.conf:34
msgid "Print"
msgstr "打印"
#: ks_includes/KlipperScreen.conf:156
msgid "Print Control"
msgstr "打印控制"
#: panels/print.py:171
msgid "Print Time"
msgstr "打印时间"
#: panels/job_status.py:232
msgid "Printing"
msgstr "印刷"
#: panels/bed_mesh.py:264
msgid "Profile Name:"
msgstr ""
#: ks_includes/KlipperScreen.conf:89
msgid "Quad Gantry Level"
msgstr ""
#: panels/zcalibrate.py:37
msgid "Raise Nozzle"
msgstr "升高喷嘴"
#: panels/job_status.py:278 panels/splash_screen.py:62
msgid "Restart"
msgstr "重新开始"
#: panels/job_status.py:280
msgid "Resume"
msgstr "恢复"
#: panels/extrude.py:48
msgid "Retract"
msgstr "缩回"
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
msgid "Save"
msgstr ""
#: ks_includes/KlipperScreen.conf:141
msgid "Save Config"
msgstr "保存配置"
#: ks_includes/KlipperScreen.conf:146
msgid "Save configuration."
msgstr "保存配置"
#: ks_includes/config.py:46
msgid "Screen Blanking Time"
msgstr ""
#: panels/bed_level.py:114
msgid "Screws Adjust"
msgstr "螺丝调整"
#: panels/fan.py:42
msgid "Set Speed"
msgstr "设定速度"
#: ks_includes/KlipperScreen.conf:151 ks_includes/KlipperScreen.conf:196
#, fuzzy
msgid "Settings"
msgstr "设置"
#: panels/print.py:169
msgid "Size"
msgstr "尺寸"
#: ks_includes/config.py:44
msgid "Slicer"
msgstr ""
#. This line for translations only
#: panels/extrude.py:31
msgid "Slow"
msgstr "慢"
#: panels/print.py:39
msgid "Sort by: "
msgstr ""
#: panels/fine_tune.py:47
msgid "Speed +"
msgstr "速度 +"
#: panels/fine_tune.py:51
msgid "Speed -"
msgstr "速度 -"
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
#: ks_includes/KlipperScreen.conf:216
msgid "System"
msgstr "系统"
#: panels/system.py:27
#, fuzzy
msgid ""
"System\n"
"Restart"
msgstr "重新开始"
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
msgstr ""
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
#: ks_includes/KlipperScreen.conf:159
msgid "Temperature"
msgstr "温度"
#: panels/extrude.py:38
msgid "Tool"
msgstr "工具"
#: panels/print.py:167
msgid "Uploaded"
msgstr "已上传"
#: panels/move.py:25
msgid "X+"
msgstr "X+"
#: panels/move.py:27
msgid "X-"
msgstr "X-"
#: panels/move.py:30
msgid "Y+"
msgstr "Y ="
#: panels/move.py:32
msgid "Y-"
msgstr "Y-"
#: ks_includes/KlipperScreen.conf:125
msgid "Z Calibrate"
msgstr "Z校准"
#: panels/zcalibrate.py:28
msgid "Z Offset"
msgstr "Z偏移"
#: panels/fine_tune.py:36 panels/move.py:35
msgid "Z+"
msgstr "Z+"
#: panels/fine_tune.py:40 panels/move.py:37
msgid "Z-"
msgstr "Z-"
#: ks_includes/config.py:60
msgid "minutes"
msgstr ""
#: panels/fine_tune.py:38
msgid "mm"
msgstr "毫米"
#, fuzzy
#~ msgid "Klipper"
#~ msgstr "快闪重启"
#~ msgid "Back"
#~ msgstr "背部"
#~ msgid "Extrusion"
#~ msgstr "挤压"
#~ msgid "Fan +"
#~ msgstr "风扇+"
#~ msgid "Fan -"
#~ msgstr "风扇-"
#~ msgid "Speed"
#~ msgstr "速度"
#~ msgid "System Information"
#~ msgstr "系统信息"
#~ msgid "Time Elapsed"
#~ msgstr "时间流逝"
#~ msgid "Time Left"
#~ msgstr "剩下的时间"
#~ msgid "Tool 1"
#~ msgstr "工具1"
+130 -20
View File
@@ -3,26 +3,36 @@ import logging
logger = logging.getLogger("KlipperScreen.Printer")
class Printer:
state_callbacks = {
"disconnected": None,
"error": None,
"paused": None,
"printing": None,
"ready": None,
"startup": None,
"shutdown": None
}
def __init__(self, printer_info, data):
self.config = data['configfile']['config']
self.state = "disconnected"
self.power_devices = {}
logging.info("### Reading printer config")
def reinit(self, printer_info, data):
logger.debug("Moonraker object status: %s" % data)
self.config = data['configfile']['config']
self.toolcount = 0
self.extrudercount = 0
self.tools = []
self.devices = {}
self.state = data['print_stats']['state']
self.data = data
self.klipper = {}
self.power_devices = {}
self.klipper = {
"version": printer_info['software_version']
}
for x in self.config.keys():
if x.startswith('extruder'):
if x[0:8] == "extruder":
if x.startswith('extruder_stepper'):
continue
@@ -31,8 +41,9 @@ class Printer:
"target": 0
}
self.tools.append(x)
self.tools = sorted(self.tools)
self.toolcount += 1
if "shared_heater" in self.config[x]:
self.toolcount += 1
continue
self.extrudercount += 1
if x.startswith('heater_bed'):
@@ -40,25 +51,32 @@ class Printer:
"temperature": 0,
"target": 0
}
if x.startswith('bed_mesh '):
r = self.config[x]
r['x_count'] = int(r['x_count'])
r['y_count'] = int(r['y_count'])
r['max_x'] = float(r['max_x'])
r['min_x'] = float(r['min_x'])
r['max_y'] = float(r['max_y'])
r['min_y'] = float(r['min_y'])
r['points'] = [[float(j.strip()) for j in i.split(",")] for i in r['points'].strip().split("\n")]
self.process_update(data)
logger.info("Klipper version: %s", self.klipper['version'])
logger.info("### Toolcount: " + str(self.toolcount) + " Heaters: " + str(self.extrudercount))
def configure_power_devices(self, data):
self.power_devices = {}
logger.debug("Processing power devices: %s" % data)
for x in data['devices']:
logger.debug(x)
self.power_devices[x['device']] = {
"status": "on" if x['status'] == "on" else "off"
}
logger.debug("Power devices: %s" % self.power_devices)
def process_update(self, data):
keys = ['virtual_sdcard','pause_resume','idle_timeout','print_stats']
keys = ['fan','gcode_move','idle_timeout','pause_resume','print_stats','toolhead','virtual_sdcard']
keys = [
'bed_mesh',
'fan',
'gcode_move',
'idle_timeout',
'pause_resume',
'print_stats',
'toolhead',
'virtual_sdcard',
'webhooks'
]
for x in keys:
if x in data:
if x not in self.data:
@@ -81,10 +99,55 @@ class Printer:
if "temperature" in d:
self.set_dev_stat(x, "temperature", d["temperature"])
if "webhooks" in data or "idle_timeout" in data or "pause_resume" in data or "print_stats" in data:
self.evaluate_state()
def evaluate_state(self):
wh_state = self.data['webhooks']['state'].lower() # possible values: startup, ready, shutdown, error
idle_state = self.data['idle_timeout']['state'].lower() # possible values: Idle, printing, ready
print_state = self.data['print_stats']['state'].lower() # possible values: complete, paused, printing, standby
if wh_state == "ready":
new_state = "ready"
if print_state == "paused":
new_state = "paused"
elif idle_state == "printing" and print_state != "printing": # Not printing a file, toolhead moving
new_state = "busy"
elif idle_state == "printing":
new_state = "printing"
if new_state != "busy":
self.change_state(new_state)
else:
self.change_state(wh_state)
def process_power_update(self, data):
if data['device'] in self.power_devices:
self.power_devices[data['device']]['status'] = data['status']
def change_state(self, state):
if state == self.state or state not in list(self.state_callbacks):
return
logger.debug("Changing state from '%s' to '%s'" % (self.state, state))
self.state = state
if self.state_callbacks[state] != None:
logger.debug("Running callback for state: %s" % state)
self.state_callbacks[state]()
def configure_power_devices(self, data):
self.power_devices = {}
logger.debug("Processing power devices: %s" % data)
for x in data['devices']:
self.power_devices[x['device']] = {
"status": "on" if x['status'] == "on" else "off"
}
logger.debug("Power devices: %s" % self.power_devices)
def config_section_exists(self, section):
return section in list(self.config)
def get_config_section_list(self, search=""):
return [i for i in list(self.config) if i.startswith(search)]
@@ -96,6 +159,32 @@ class Printer:
def get_data(self):
return self.data
def get_gcode_macros(self):
return self.get_config_section_list("gcode_macro ")
def get_printer_status_data(self):
data = {
"printer": {
"bltouch": self.section_exists("bltouch"),
"gcode_macros": {
"count": len(self.get_gcode_macros())
},
"idle_timeout": self.get_stat("idle_timeout").copy(),
"pause_resume": self.get_stat("pause_resume").copy(),
"power_devices": {
"count": len(self.get_power_devices())
},
"probe": self.section_exists("probe")
}
}
sections = ["bed_mesh","bltouch","probe","quad_gantry_level"]
for section in sections:
if self.config_section_exists(section):
data["printer"][section] = self.get_config_section(section).copy()
return data
def get_klipper_version(self):
return self.klipper['version']
@@ -108,10 +197,17 @@ class Printer:
return self.power_devices[device]['status']
def get_stat(self, stat, substat = None):
if stat not in self.data:
return None
if substat != None:
return self.data[stat][substat]
if substat in self.data[stat]:
return self.data[stat][substat]
return None
return self.data[stat]
def get_state(self):
return self.state
def set_dev_temps(self, dev, temp, target=None):
if dev in self.devices:
self.devices[dev]['temperature'] = temp
@@ -137,6 +233,20 @@ class Printer:
def get_tool_number(self, tool):
return self.tools.index(tool)
def has_heated_bed(self):
if "heater_bed" in self.devices:
return True
def section_exists(self, section):
if section in self.get_config_section_list():
return True
return False
def set_callbacks(self, callbacks):
for name, cb in callbacks.items():
if name in list(self.state_callbacks):
self.state_callbacks[name] = cb
def set_dev_stat(self, dev, stat, value):
if dev not in self.devices:
return
+57 -17
View File
@@ -3,6 +3,7 @@ import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from jinja2 import Environment, Template
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
@@ -10,40 +11,71 @@ logger = logging.getLogger("KlipperScreen.ScreenPanel")
class ScreenPanel:
title_spacing = 50
control = {}
def __init__(self, screen, title, back=True):
self._screen = screen
self._config = screen._config
self._files = screen.files
self.lang = self._screen.lang
self._printer = screen.printer
self.labels = {}
self._gtk = screen.gtk
self.layout = Gtk.Layout()
self.layout.set_size(self._screen.width, self._screen.height)
action_bar_width = self._gtk.get_action_bar_width()
self.control_grid = self._gtk.HomogeneousGrid()
self.control_grid.set_size_request(action_bar_width - 2, self._screen.height)
self.control_grid.get_style_context().add_class('action_bar')
button_scale = self._gtk.get_header_image_scale()
logger.debug("Button scale: %s" % button_scale)
if back == True:
b = KlippyGtk.ButtonImage('back', None, None, 40, 40)
b.connect("clicked", self._screen._menu_go_back)
self.layout.put(b, 0, 0)
self.control['back'] = self._gtk.ButtonImage('back', None, None, button_scale[0], button_scale[1])
self.control['back'].connect("clicked", self._screen._menu_go_back)
self.control_grid.attach(self.control['back'], 0, 0, 1, 1)
h = KlippyGtk.ButtonImage('home', None, None, 40, 40)
h.connect("clicked", self.menu_return, True)
self.layout.put(h, self._screen.width - 55, 0)
self.control['home'] = self._gtk.ButtonImage('home', None, None, button_scale[0], button_scale[1])
self.control['home'].connect("clicked", self.menu_return, True)
self.control_grid.attach(self.control['home'], 0, 1, 1, 1)
e = KlippyGtk.ButtonImage('emergency', None, None, 40, 40)
e.connect("clicked", self.emergency_stop)
self.layout.put(e, int(self._screen.width/4*3) - 20, 0)
self.control['printer_select'] = Gtk.Label("")
self.control_grid.attach(self.control['printer_select'], 0, 2, 1, 1)
else:
for i in range(3):
self.control['space%s' % i] = Gtk.Label("")
self.control_grid.attach(self.control['space%s' % i], 0, i, 1, 1)
self.control['estop'] = self._gtk.ButtonImage('emergency', None, None, button_scale[0], button_scale[1])
self.control['estop'].connect("clicked", self.emergency_stop)
self.control_grid.attach(self.control['estop'], 0, 3, 1, 1)
#self.layout.put(self.control['estop'], int(self._screen.width/4*3 - button_scale[0]/2), 0)
try:
env = Environment(extensions=["jinja2.ext.i18n"])
env.install_gettext_translations(self.lang)
j2_temp = env.from_string(title)
title = j2_temp.render()
except:
logger.debug("Error parsing jinja for title: %s" % title)
self.title = Gtk.Label()
self.title.set_size_request(self._screen.width, self.title_spacing)
self.title.set_size_request(self._screen.width - action_bar_width, self.title_spacing)
self.title.set_hexpand(True)
self.title.set_halign(Gtk.Align.CENTER)
self.title.set_valign(Gtk.Align.CENTER)
self.set_title(title)
self.layout.put(self.title, 0, 0)
self.content = Gtk.Box(spacing=0)
self.content.set_size_request(self._screen.width, self._screen.height - self.title_spacing)
self.layout.put(self.content, 0, self.title_spacing)
self.content.set_size_request(self._screen.width - action_bar_width, self._screen.height - self.title_spacing)
self.layout.put(self.control_grid, 0, 0)
self.layout.put(self.title, action_bar_width, 0)
self.layout.put(self.content, action_bar_width, self.title_spacing)
def initialize(self, panel_name):
@@ -56,16 +88,21 @@ class ScreenPanel:
def get(self):
return self.layout
def get_file_image(self, filename, width=1.6, height=1.6):
if not self._files.has_thumbnail(filename):
return None
return self._gtk.PixbufFromFile(self._files.get_thumbnail_location(filename), None, width, height)
def home(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
def menu_item_clicked(self, widget, panel, item):
print("### Creating panel "+ item['panel'])
print("### Creating panel "+ item['panel'] + " : %s %s" % (panel, item))
if "items" in item:
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + item['name'], item['panel'], item['name'],
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + panel, item['panel'], item['name'],
1, False, items=item['items'])
return
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + item['name'], item['panel'], item['name'],
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + panel, item['panel'], item['name'],
1, False)
def menu_return(self, widget, home=False):
@@ -77,10 +114,13 @@ class ScreenPanel:
def set_title(self, title):
self.title.set_label(title)
def show_all(self):
self._screen.show_all()
def update_image_text(self, label, text):
if label in self.labels and 'l' in self.labels[label]:
self.labels[label]['l'].set_text(text)
def update_temp(self, dev, temp, target):
if dev in self.labels:
self.labels[dev].set_label(KlippyGtk.formatTemperatureString(temp, target))
self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
+178
View File
@@ -0,0 +1,178 @@
import asyncio
import os, signal
import json
import logging
import re
import subprocess
from contextlib import suppress
from threading import Thread
logger = logging.getLogger("KlipperScreen.WifiManager")
RESCAN_INTERVAL = 120
class WifiManager(Thread):
iw_regexes = [
re.compile(r"^ESSID:\"(?P<essid>.*)\"$"),
re.compile(r"^Protocol:(?P<protocol>.+)$"),
re.compile(r"^Mode:(?P<mode>.+)$"),
re.compile(r"^Frequency:(?P<frequency>[\d.]+) (?P<frequency_units>.+) \(Channel (?P<channel>\d+)\)$"),
re.compile(r"^Encryption key:(?P<encryption>.+)$"),
re.compile(r"^Quality=(?P<signal_quality>\d+)/(?P<signal_total>\d+)\s+Signal level=(?P<signal_level_dBm>.+) d.+$"),
re.compile(r"^Signal level=(?P<signal_quality>\d+)/(?P<signal_total>\d+).*$")
]
networks_in_supplicant = []
wpa = {
"wpa": re.compile(r"IE:\ WPA\ Version\ 1$"),
"wpa2": re.compile(r"IE:\ IEEE\ 802\.11i/WPA2\ Version\ 1$")
}
connected = False
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.loop = None
self._poll_task = None
self._scanning = False
self.networks = {}
self.read_wpa_supplicant()
def run(self):
logger.debug("Setting up wifi event loop")
self.loop = asyncio.new_event_loop()
loop = self.loop
asyncio.set_event_loop(loop)
try:
self._poll_task = asyncio.ensure_future(self._poll())
loop.run_forever()
loop.run_until_complete(loop.shutdown_asyncgens())
self._poll_task.cancel()
with suppress(asyncio.CancelledError):
loop.run_until_complete(self._poll_task)
finally:
loop.close()
def stop(self):
self.loop.call_soon_threadsafe(self.loop.stop)
def stop_loop(self):
loop.stop()
async def _poll(self):
while True:
try:
await self.scan()
await asyncio.sleep(RESCAN_INTERVAL)
except:
logger.exception("Poll wifi error")
def get_current_wifi(self, interface="wlan0"):
p = subprocess.Popen(["iwconfig",interface], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
content = p.stdout.read().decode('utf-8').split('\n')
essid = None
mac = None
for line in content:
match = re.match(r'^.*ESSID:"(.*)"$', line.strip())
if match:
essid = match.group(1)
continue
match = re.match(r'^.*Access\s+Point:\s+([0-9A-Fa-f:]+)$', line.strip())
if match:
mac = match.group(1)
break
if essid is None or mac is None:
self.connected = False
return None
self.connected = True
return [essid, mac]
def get_network_info(self, essid=None, mac=None):
if essid is not None and essid in self.networks:
return self.networks[essid]
if mac is not None and essid is None:
for net in self.networks:
if mac == net['mac']:
return net
return None
def get_networks(self):
return list(self.networks)
def is_connected(self):
return self.connected
def parse(self, data):
aps = []
lines = data.split('\n')
for line in lines:
line = line.strip()
match = re.match(r'^Cell\s+([0-9]+)\s+-\s+Address:\s+(?P<mac>[0-9A-Fa-f:]+)$', line)
if match:
aps.append({"mac":match.group(2)})
continue
if len(aps) < 1:
continue
for w, wreg in self.wpa.items():
t = wreg.search(line)
if t is not None:
aps[-1].update({'encryption': w})
for exp in self.iw_regexes:
result = exp.search(line)
if result is not None:
if "encryption" in result.groupdict():
if result.groupdict()['encryption'] == 'on' :
aps[-1].update({'encryption': 'wep'})
else:
aps[-1].update({'encryption': 'off'})
else:
aps[-1].update(result.groupdict())
return aps
def read_wpa_supplicant(self):
wpaconf = "/etc/wpa_supplicant/wpa_supplicant.conf"
if not os.path.exists(wpaconf):
return None
regexes = [
re.compile(r'^ssid\s*=\s*"(?P<ssid>.*)"$'),
re.compile(r'^psk\s*=\s*"(?P<psk>.*)"$')
]
networks = []
p = subprocess.Popen(["sudo","cat",wpaconf], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
contents = p.stdout.read().decode('utf-8').split('\n')
for line in contents:
if re.match(r'^network\s*=\s*{$', line.strip()):
networks.append({})
continue
if len(networks) < 1:
continue
for exp in regexes:
result = exp.search(line.strip())
if result is not None:
networks[-1].update(result.groupdict())
self.networks_in_supplicant = []
for network in networks:
self.networks_in_supplicant.append(network)
async def scan(self, interface='wlan0'):
logger.debug("Scanning %s" % interface)
p = subprocess.Popen(["sudo","iwlist",interface,"scan"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
aps = self.parse(p.stdout.read().decode('utf-8'))
cur_info = self.get_current_wifi()
self.networks = {}
for ap in aps:
self.networks[ap['essid']] = ap
if cur_info is not None and cur_info[0] == ap['essid'] and cur_info[1] == ap['mac']:
self.networks[ap['essid']]['connected'] = True
for net in self.networks_in_supplicant:
if ap['essid'] == net['ssid'] and "psk" in net:
ap['psk'] = net['psk']
break
+90 -31
View File
@@ -6,41 +6,63 @@ gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.BedLevelPanel")
def create_panel(*args):
return BedLevelPanel(*args)
class BedLevelPanel(ScreenPanel):
def initialize(self, menu):
x_offset = 0
y_offset = 0
def initialize(self, panel_name):
_ = self.lang.gettext
self.panel_name = panel_name
self.screws = None
grid = KlippyGtk.HomogeneousGrid()
grid = self._gtk.HomogeneousGrid()
self.disabled_motors = False
screws = []
if "bed_screws" in self._screen.printer.get_config_section_list():
bed_screws = self._screen.printer.get_config_section("bed_screws")
for item in bed_screws:
if re.match(r"^[0-9\.]+,[0-9\.]+$", bed_screws[item]):
screws.append(bed_screws[item].split(","))
config_section_name = None
if "screws_tilt_adjust" in self._screen.printer.get_config_section_list():
config_section_name = "screws_tilt_adjust"
elif "bed_screws" in self._screen.printer.get_config_section_list():
config_section_name = "bed_screws"
if config_section_name != None:
config_section = self._screen.printer.get_config_section(config_section_name)
for item in config_section:
logger.debug("Screws section: %s" % config_section[item])
result = re.match(r"([0-9\.]+)\s*,\s*([0-9\.]+)", config_section[item])
if result:
screws.append([
round(float(result.group(1)),2),
round(float(result.group(2)),2)
])
screws = sorted(screws, key=lambda x: (float(x[1]), float(x[0])))
logger.debug("Bed screw locations [x,y]: %s", screws)
if "bltouch" in self._screen.printer.get_config_section_list():
if ("bltouch" in self._screen.printer.get_config_section_list() and
config_section_name == "screws_tilt_adjust"):
x_offset = 0
y_offset = 0
bltouch = self._screen.printer.get_config_section("bltouch")
if "x_offset" in bltouch:
x_offset = float(bltouch['x_offset'])
self.x_offset = float(bltouch['x_offset'])
if "y_offset" in bltouch:
y_offset = float(bltouch['y_offset'])
self.y_offset = float(bltouch['y_offset'])
new_screws = []
for screw in screws:
new_screws.append([float(screw[0]) + x_offset, float(screw[1]) + y_offset])
new_screws.append([
round(float(screw[0]) + self.x_offset,2),
round(float(screw[1]) + self.y_offset,2)
])
screws = new_screws
self.screws = screws
logger.debug("Screws: %s" % screws)
if len(screws) < 4:
logger.debug("bed_screws not configured, calculating locations")
@@ -59,35 +81,48 @@ class BedLevelPanel(ScreenPanel):
logger.debug("Configured screw locations [x,y]: %s", screws)
self.labels['tl'] = KlippyGtk.ButtonImage("bed-level-t-l")
self.labels['tl'].connect("clicked", self.go_to_position, self.screws[2])
self.labels['tr'] = KlippyGtk.ButtonImage("bed-level-t-r")
self.labels['tr'].connect("clicked", self.go_to_position, self.screws[3])
self.labels['bl'] = KlippyGtk.ButtonImage("bed-level-b-l")
self.labels['bl'].connect("clicked", self.go_to_position, self.screws[0])
self.labels['br'] = KlippyGtk.ButtonImage("bed-level-b-r")
self.labels['br'].connect("clicked", self.go_to_position, self.screws[1])
self.labels['bl'] = self._gtk.ButtonImage("bed-level-t-l", None, None, 3, 3)
self.labels['bl'].connect("clicked", self.go_to_position, self.screws[2])
self.labels['br'] = self._gtk.ButtonImage("bed-level-t-r", None, None, 3, 3)
self.labels['br'].connect("clicked", self.go_to_position, self.screws[3])
self.labels['fl'] = self._gtk.ButtonImage("bed-level-b-l", None, None, 3, 3)
self.labels['fl'].connect("clicked", self.go_to_position, self.screws[0])
self.labels['fr'] = self._gtk.ButtonImage("bed-level-b-r", None, None, 3, 3)
self.labels['fr'].connect("clicked", self.go_to_position, self.screws[1])
grid.attach(self.labels['tl'], 1, 0, 1, 1)
grid.attach(self.labels['tr'], 2, 0, 1, 1)
grid.attach(self.labels['bl'], 1, 1, 1, 1)
grid.attach(self.labels['br'], 2, 1, 1, 1)
if self._screen.lang_ltr:
grid.attach(self.labels['bl'], 1, 0, 1, 1)
grid.attach(self.labels['br'], 2, 0, 1, 1)
grid.attach(self.labels['fl'], 1, 1, 1, 1)
grid.attach(self.labels['fr'], 2, 1, 1, 1)
else:
grid.attach(self.labels['bl'], 2, 0, 1, 1)
grid.attach(self.labels['br'], 1, 0, 1, 1)
grid.attach(self.labels['fl'], 2, 1, 1, 1)
grid.attach(self.labels['fr'], 1, 1, 1, 1)
self.labels['home'] = KlippyGtk.ButtonImage("home",_("Home All"),"color2")
self.labels['home'] = self._gtk.ButtonImage("home",_("Home All"),"color2")
self.labels['home'].connect("clicked", self.home)
self.labels['dm'] = KlippyGtk.ButtonImage("motor-off", _("Disable XY"), "color3")
self.labels['dm'] = self._gtk.ButtonImage("motor-off", _("Disable XY"), "color3")
self.labels['dm'].connect("clicked", self.disable_motors)
grid.attach(self.labels['home'], 0, 0, 1, 1)
grid.attach(self.labels['dm'], 0, 1, 1, 1)
self.labels['estop'] = KlippyGtk.ButtonImage("decrease",_("Emergency Stop"),"color4")
self.labels['estop'].connect("clicked", self.emergency_stop)
grid.attach(self.labels['estop'], 3, 0, 1, 1)
if self._printer.config_section_exists("screws_tilt_adjust"):
self.labels['screws'] = self._gtk.ButtonImage("refresh",_("Screws Adjust"),"color4")
self.labels['screws'].connect("clicked", self.screws_tilt_calculate)
grid.attach(self.labels['screws'], 3, 0, 1, 1)
self.content.add(grid)
def activate(self):
self.labels['bl'].set_label("")
self.labels['br'].set_label("")
self.labels['fl'].set_label("")
self.labels['fr'].set_label("")
def go_to_position(self, widget, position):
logger.debug("Going to position: %s", position)
script = [
@@ -110,5 +145,29 @@ class BedLevelPanel(ScreenPanel):
"M18" # Disable motors
)
def create_panel(*args):
return BedLevelPanel(*args)
def process_update(self, action, data):
if action == "notify_gcode_response":
result = re.match(
"^// (.*) : X ([0-9\.]+), Y ([0-9\.]+), Z [0-9\.]+ : Adjust -> ([CW]+ [0-9:]+)",
data
)
if result:
screw_labels = ['fl','fr','bl','br']
x = int(float(result.group(2)) + self.x_offset)
y = int(float(result.group(3)) + self.y_offset)
logger.debug(data)
logger.debug("X: %s Y: %s" % (x,y))
for i in range(len(self.screws)):
logger.debug(self.screws[i])
if x == int(float(self.screws[i][0])) and y == int(float(self.screws[i][1])):
break
self.labels[screw_labels[i]].set_label(result.group(4))
self.response_count += 1
if self.response_count >= len(self.screws)-1:
self._screen.remove_subscription(self.panel_name)
def screws_tilt_calculate(self, widget):
self.response_count = 0
self._screen.add_subscription(self.panel_name)
self._screen._ws.klippy.gcode_script("SCREWS_TILT_CALCULATE")
+295
View File
@@ -0,0 +1,295 @@
import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.BedMeshPanel")
def create_panel(*args):
return BedMeshPanel(*args)
class BedMeshPanel(ScreenPanel):
active_mesh = None
graphs = {}
def initialize(self, panel_name):
_ = self.lang.gettext
self.show_create = False
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
# Create a grid for all profiles
self.labels['profiles'] = Gtk.Grid()
scroll.add(self.labels['profiles'])
addprofile = self._gtk.ButtonImage("increase"," %s" % _("Add bed mesh profile"),
"color1", .5, .5, Gtk.PositionType.LEFT)
addprofile.connect("clicked", self.show_create_profile)
addprofile.set_size_request(60,0)
addprofile.set_hexpand(False)
addprofile.set_halign(Gtk.Align.END)
abox = Gtk.Box(spacing=0)
abox.set_vexpand(False)
abox.add(addprofile)
# Create a box to contain all of the above
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
box.pack_start(abox, False, False, 0)
box.pack_end(scroll, True, True, 0)
self.load_meshes()
self.labels['main_box'] = box
self.control['back'].disconnect_by_func(self._screen._menu_go_back)
self.control['back'].connect("clicked", self.back)
self.content.add(self.labels['main_box'])
self._screen.add_subscription(panel_name)
def activate(self):
for child in self.content.get_children():
self.content.remove(child)
self.content.add(self.labels['main_box'])
am = self._screen.printer.get_stat("bed_mesh","profile_name")
self.activate_mesh(am)
def activate_mesh(self, profile):
if profile == "":
profile = None
logger.debug("Activating profile: %s %s" % (self.active_mesh, profile))
if profile != self.active_mesh:
if profile not in self.profiles:
self.add_profile(profile)
if self.active_mesh != None and self.active_mesh in self.profiles:
a = self.profiles[self.active_mesh]
a['buttons'].remove(a['refresh'])
a['buttons'].pack_start(a['load'], False, False, 0)
self.active_mesh = profile
if self.active_mesh != None:
a = self.profiles[profile]
a['buttons'].remove(a['load'])
a['buttons'].pack_start(a['refresh'], False, False, 0)
self._screen.show_all()
def add_profile(self, profile):
_ = self.lang.gettext
frame = Gtk.Frame()
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (profile))
name.set_hexpand(True)
name.set_vexpand(True)
name.set_halign(Gtk.Align.START)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
load = self._gtk.ButtonImage("load",_("Load"),"color2")
load.connect("clicked", self.send_load_mesh, profile)
load.set_size_request(60,0)
load.set_hexpand(False)
load.set_halign(Gtk.Align.END)
refresh = self._gtk.ButtonImage("refresh",_("Calibrate"),"color4")
refresh.connect("clicked", self.calibrate_mesh)
refresh.set_size_request(60,0)
refresh.set_hexpand(False)
refresh.set_halign(Gtk.Align.END)
info = self._gtk.ButtonImage("info",None,"color3")
info.connect("clicked", self.show_mesh, profile)
info.set_size_request(60,0)
info.set_hexpand(False)
info.set_halign(Gtk.Align.END)
save = self._gtk.ButtonImage("sd",_("Save"),"color3")
save.connect("clicked", self.send_save_mesh, profile)
save.set_size_request(60,0)
save.set_hexpand(False)
save.set_halign(Gtk.Align.END)
delete = self._gtk.ButtonImage("decrease",_("Delete"),"color3")
delete.connect("clicked", self.send_remove_mesh, profile)
delete.set_size_request(60,0)
delete.set_hexpand(False)
delete.set_halign(Gtk.Align.END)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_margin_top(10)
dev.set_margin_end(15)
dev.set_margin_start(15)
dev.set_margin_bottom(10)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev.add(labels)
buttons = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
logger.debug("Profile compare: '%s' '%s'" % (self.active_mesh, profile))
if self.active_mesh == profile:
buttons.pack_start(refresh, False, False, 0)
else:
buttons.pack_start(load, False, False, 0)
#buttons.pack_end(info, False, False, 0)
if profile != "default":
buttons.pack_end(save, False, False, 0)
buttons.pack_end(delete, False, False, 0)
dev.add(buttons)
frame.add(dev)
self.profiles[profile] = {
"box": dev,
"buttons": buttons,
"row": frame,
"load": load,
"refresh": refresh,
"save": save
}
l = list(self.profiles)
if "default" in l:
l.remove('default')
profiles = sorted(l)
pos = profiles.index(profile)+1 if profile != "default" else 0
self.labels['profiles'].insert_row(pos)
self.labels['profiles'].attach(self.profiles[profile]['row'], 0, pos, 1, 1)
self.labels['profiles'].show_all()
#Gdk.threads_add_idle(GLib.PRIORITY_LOW, self.create_graph, profile)
def back(self, widget):
if self.show_create == True:
self.remove_create()
else:
self._screen._menu_go_back()
def create_profile(self, widget):
name = self.labels['profile_name'].get_text()
if " " in name:
name = '"%s"' % name
self._screen._ws.klippy.gcode_script("BED_MESH_PROFILE SAVE=%s" % name)
self.remove_create()
def calibrate_mesh(self, widget):
self._screen._ws.klippy.gcode_script(
"BED_MESH_CALIBRATE"
)
def load_meshes(self):
bm_profiles = self._screen.printer.get_config_section_list("bed_mesh ")
self.profiles = {}
for prof in bm_profiles:
self.add_profile(prof[9:])
def process_update(self, action, data):
if action == "notify_status_update":
if "bed_mesh" in data and "profile_name" in data['bed_mesh']:
if data['bed_mesh']['profile_name'] != self.active_mesh:
self.activate_mesh(data['bed_mesh']['profile_name'])
def remove_create(self):
if self.show_create == False:
return
self._screen.remove_keyboard()
for child in self.content.get_children():
self.content.remove(child)
self.show_create = False
self.content.add(self.labels['main_box'])
self.content.show()
def remove_profile(self, profile):
if profile not in self.profiles:
return
l = list(self.profiles)
if "default" in l:
l.remove('default')
profiles = sorted(l)
pos = profiles.index(profile)+1 if profile != "default" else 0
self.labels['profiles'].remove_row(pos)
del self.profiles[profile]
def send_load_mesh(self, widget, profile):
self._screen._ws.klippy.gcode_script(
KlippyGcodes.bed_mesh_load(profile)
)
def send_save_mesh(self, widget, profile):
self._screen._ws.klippy.gcode_script(
KlippyGcodes.bed_mesh_save(profile)
)
def send_remove_mesh(self, widget, profile):
self._screen._ws.klippy.gcode_script(
KlippyGcodes.bed_mesh_remove(profile)
)
self.remove_profile(profile)
def show_create_profile(self, widget):
_ = self.lang.gettext
for child in self.content.get_children():
self.content.remove(child)
if "create_profile" not in self.labels:
self.labels['create_profile'] = Gtk.VBox()
self.labels['create_profile'].set_valign(Gtk.Align.START)
box = Gtk.Box(spacing=5)
box.set_size_request(self._gtk.get_content_width(), self._gtk.get_content_height() -
self._screen.keyboard_height - 20)
box.set_hexpand(True)
box.set_vexpand(False)
self.labels['create_profile'].add(box)
l = self._gtk.Label(_("Profile Name:"))
l.set_hexpand(False)
entry = Gtk.Entry()
entry.set_hexpand(True)
save = self._gtk.ButtonImage("sd",_("Save"),"color3")
save.set_hexpand(False)
save.connect("clicked", self.create_profile)
self.labels['profile_name'] = entry
box.pack_start(l, False, False, 5)
box.pack_start(entry, True, True, 5)
box.pack_start(save, False, False, 5)
self.show_create = True
self.labels['profile_name'].set_text('')
self.content.add(self.labels['create_profile'])
self.content.show()
self._screen.show_keyboard()
self.labels['profile_name'].grab_focus_without_selecting()
def show_mesh(self, widget, profile):
_ = self.lang.gettext
buttons = [
{"name": _("Close"), "response": Gtk.ResponseType.CANCEL}
]
dialog = self._gtk.Dialog(self._screen, buttons, self.graphs[profile], self._close_dialog)
def _close_dialog(self, widget, response):
widget.destroy()
-1
View File
@@ -4,7 +4,6 @@ import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
+49 -20
View File
@@ -4,7 +4,6 @@ import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
@@ -20,30 +19,40 @@ class ExtrudePanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
self.speed = _("Medium")
self.speeds = [_("Slow"), _("Medium"), _("Fast")]
self.speed = "Medium"
self.speeds = ["Slow", "Medium", "Fast"]
self.speed_trans = {
_("Slow"): "300",
_("Medium"): "800",
_("Fast"): "1400"
"Slow": "300",
"Medium": "800",
"Fast": "1400"
}
grid = KlippyGtk.HomogeneousGrid()
# This line for translations only
speed_translations = [_("Slow"), _("Medium"), _("Fast")]
self.labels['tool0'] = KlippyGtk.ButtonImage("extruder-1",_("Tool 1"),"color1")
self.labels['tool0'].get_style_context().add_class("button_active")
self.labels['extrude'] = KlippyGtk.ButtonImage("extrude",_("Extrude"),"color3")
grid = self._gtk.HomogeneousGrid()
i = 0
self.current_extruder = self._printer.get_stat("toolhead","extruder")
for extruder in self._printer.get_tools():
self.labels[extruder] = self._gtk.ButtonImage("extruder-%s" % i,_("Tool") + " %s" %str(i),"color1")
self.labels[extruder].connect("clicked", self.change_extruder, extruder)
if extruder == self.current_extruder:
self.labels[extruder].get_style_context().add_class("button_active")
if i <= 3:
grid.attach(self.labels[extruder], i, 0, 1, 1)
i += 1
self.labels['extrude'] = self._gtk.ButtonImage("extrude",_("Extrude"),"color3")
self.labels['extrude'].connect("clicked", self.extrude, "+")
self.labels['retract'] = KlippyGtk.ButtonImage("retract",_("Retract"),"color2")
self.labels['retract'] = self._gtk.ButtonImage("retract",_("Retract"),"color2")
self.labels['retract'].connect("clicked", self.extrude, "-")
self.labels['temperature'] = KlippyGtk.ButtonImage("heat-up",_("Temperature"),"color4")
self.labels['temperature'] = self._gtk.ButtonImage("heat-up",_("Temperature"),"color4")
self.labels['temperature'].connect("clicked", self.menu_item_clicked, "temperature", {
"name": "Temperature",
"panel": "temperature"
})
grid.attach(self.labels['tool0'], 0, 0, 1, 1)
grid.attach(self.labels['extrude'], 0, 1, 1, 1)
grid.attach(self.labels['retract'], 3, 1, 1, 1)
grid.attach(self.labels['temperature'], 0, 2, 1, 1)
@@ -52,12 +61,14 @@ class ExtrudePanel(ScreenPanel):
distgrid = Gtk.Grid()
j = 0;
for i in self.distances:
self.labels["dist"+str(i)] = KlippyGtk.ToggleButton(i)
self.labels["dist"+str(i)] = self._gtk.ToggleButton(i)
self.labels["dist"+str(i)].connect("clicked", self.change_distance, i)
ctx = self.labels["dist"+str(i)].get_style_context()
if j == 0:
if ((self._screen.lang_ltr == True and j == 0) or
(self._screen.lang_ltr == False and j == len(self.distances)-1)):
ctx.add_class("distbutton_top")
elif j == len(self.distances)-1:
elif ((self._screen.lang_ltr == False and j == 0) or
(self._screen.lang_ltr == True and j == len(self.distances)-1)):
ctx.add_class("distbutton_bottom")
else:
ctx.add_class("distbutton")
@@ -70,12 +81,14 @@ class ExtrudePanel(ScreenPanel):
speedgrid = Gtk.Grid()
j = 0;
for i in self.speeds:
self.labels["speed"+str(i)] = KlippyGtk.ToggleButton(i)
self.labels["speed"+str(i)] = self._gtk.ToggleButton(_(i))
self.labels["speed"+str(i)].connect("clicked", self.change_speed, i)
ctx = self.labels["speed"+str(i)].get_style_context()
if j == 0:
if ((self._screen.lang_ltr == True and j == 0) or
(self._screen.lang_ltr == False and j == len(self.speeds)-1)):
ctx.add_class("distbutton_top")
elif j == len(self.speeds)-1:
elif ((self._screen.lang_ltr == False and j == 0) or
(self._screen.lang_ltr == True and j == len(self.speeds)-1)):
ctx.add_class("distbutton_bottom")
else:
ctx.add_class("distbutton")
@@ -95,12 +108,22 @@ class ExtrudePanel(ScreenPanel):
self._screen.add_subscription(panel_name)
def process_update(self, action, data):
if action != "notify_status_update":
return
for x in self._printer.get_tools():
self.update_temp(x,
self._printer.get_dev_stat(x,"temperature"),
self._printer.get_dev_stat(x,"target")
)
if ("toolhead" in data and "extruder" in data["toolhead"] and
data["toolhead"]["extruder"] != self.current_extruder):
for extruder in self._printer.get_tools():
self.labels[extruder].get_style_context().remove_class("button_active")
self.current_extruder = data["toolhead"]["extruder"]
self.labels[self.current_extruder].get_style_context().add_class("button_active")
def change_distance(self, widget, distance):
if self.distance == distance:
return
@@ -117,6 +140,12 @@ class ExtrudePanel(ScreenPanel):
continue
self.labels["dist"+str(i)].set_active(False)
def change_extruder(self, widget, extruder):
if extruder == self.current_extruder:
return
self._screen._ws.klippy.gcode_script("T%s" % self._printer.get_tool_number(extruder))
def change_speed(self, widget, speed):
if self.speed == speed:
return
+10 -9
View File
@@ -4,7 +4,6 @@ import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
@@ -20,7 +19,7 @@ class FanPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
grid = KlippyGtk.HomogeneousGrid()
grid = self._gtk.HomogeneousGrid()
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
box.set_hexpand(True)
@@ -33,17 +32,17 @@ class FanPanel(ScreenPanel):
self.labels["scale"].get_style_context().add_class("fan_slider")
box.add(self.labels["scale"])
self.labels["fanoff"] = KlippyGtk.ButtonImage("fan-off", _("Fan Off"))
self.labels["fanoff"] = self._gtk.ButtonImage("fan-off", _("Fan Off"))
self.labels["fanoff"].get_style_context().add_class("color1")
self.labels["fanoff"].connect("clicked", self.set_fan_on, False)
self.labels["fanon"] = KlippyGtk.ButtonImage("fan", _("Fan On"))
self.labels["fanon"] = self._gtk.ButtonImage("fan", _("Fan On"))
self.labels["fanon"].get_style_context().add_class("color3")
self.labels["fanon"].connect("clicked", self.set_fan_on, True)
self.labels["apply"] = KlippyGtk.ButtonImage("resume", _("Set Speed"))
self.labels["apply"] = self._gtk.ButtonImage("resume", _("Set Speed"))
self.labels["apply"].get_style_context().add_class("color2")
self.labels["apply"].connect("clicked", self.set_fan_speed)
self.labels["cancel"] = KlippyGtk.ButtonImage("stop", _("Cancel Change"))
self.labels["cancel"] = self._gtk.ButtonImage("stop", _("Cancel Change"))
self.labels["cancel"].get_style_context().add_class("color4")
self.labels["cancel"].connect("clicked", self.cancel_select_fan_speed)
self.labels["cancel"].hide()
@@ -88,7 +87,9 @@ class FanPanel(ScreenPanel):
def set_fan_on(self, widget, fanon):
speed = 100 if fanon == True else 0
self.labels["scale"].disconnect_by_func(self.select_fan_speed)
self.labels["scale"].set_value(speed)
self.labels["scale"].connect("value-changed", self.select_fan_speed)
self._screen._ws.klippy.gcode_script(KlippyGcodes.set_fan_speed(speed))
self.fan_speed = float(speed)
self.labels["scale"].disconnect_by_func(self.select_fan_speed)
self.labels["scale"].set_value(self.fan_speed)
self.labels["scale"].connect("value-changed", self.select_fan_speed)
self.cancel_select_fan_speed(widget)
+16 -47
View File
@@ -4,7 +4,6 @@ import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
@@ -29,58 +28,48 @@ class FineTunePanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
grid = KlippyGtk.HomogeneousGrid()
grid = self._gtk.HomogeneousGrid()
grid.set_row_homogeneous(False)
logger.debug("FineTunePanel")
self.labels['z+'] = KlippyGtk.ButtonImage("move-z-", _("Z+"), "color1")
self.labels['z+'] = self._gtk.ButtonImage("move-z-", _("Z+"), "color1")
self.labels['z+'].connect("clicked", self.change_babystepping, "+")
self.labels['zoffset'] = Gtk.Label("0.00" + _("mm"))
self.labels['zoffset'].get_style_context().add_class('temperature_entry')
self.labels['z-'] = KlippyGtk.ButtonImage("move-z+", _("Z-"), "color1")
self.labels['z-'] = self._gtk.ButtonImage("move-z+", _("Z-"), "color1")
self.labels['z-'].connect("clicked", self.change_babystepping, "-")
grid.attach(self.labels['z+'], 0, 0, 1, 1)
grid.attach(self.labels['zoffset'], 0, 1, 1, 1)
grid.attach(self.labels['z-'], 0, 2, 1, 1)
self.labels['fan+'] = KlippyGtk.ButtonImage("fan-on", _("Fan +"), "color2")
self.labels['fan+'].connect("clicked", self.change_fan, "+")
self.labels['fanspeed'] = Gtk.Label("100%")
self.labels['fanspeed'].get_style_context().add_class('temperature_entry')
self.labels['fan-'] = KlippyGtk.ButtonImage("fan-off", _("Fan -"), "color2")
self.labels['fan-'].connect("clicked", self.change_fan, "-")
grid.attach(self.labels['fan+'], 1, 0, 1, 1)
grid.attach(self.labels['fanspeed'], 1, 1, 1, 1)
grid.attach(self.labels['fan-'], 1, 2, 1, 1)
self.labels['speed+'] = KlippyGtk.ButtonImage("speed-step", _("Speed +"), "color3")
self.labels['speed+'] = self._gtk.ButtonImage("speed-step", _("Speed +"), "color3")
self.labels['speed+'].connect("clicked", self.change_speed, "+")
self.labels['speedfactor'] = Gtk.Label("100%")
self.labels['speedfactor'].get_style_context().add_class('temperature_entry')
self.labels['speed-'] = KlippyGtk.ButtonImage("speed-step", _("Speed -"), "color3")
self.labels['speed-'] = self._gtk.ButtonImage("speed-step", _("Speed -"), "color3")
self.labels['speed-'].connect("clicked", self.change_speed, "-")
grid.attach(self.labels['speed+'], 2, 0, 1, 1)
grid.attach(self.labels['speedfactor'], 2, 1, 1, 1)
grid.attach(self.labels['speed-'], 2, 2, 1, 1)
grid.attach(self.labels['speed+'], 1, 0, 1, 1)
grid.attach(self.labels['speedfactor'], 1, 1, 1, 1)
grid.attach(self.labels['speed-'], 1, 2, 1, 1)
self.labels['extrude+'] = KlippyGtk.ButtonImage("extrude", _("Extrusion +"), "color4")
self.labels['extrude+'] = self._gtk.ButtonImage("extrude", _("Extrusion +"), "color4")
self.labels['extrude+'].connect("clicked", self.change_extrusion, "+")
self.labels['extrudefactor'] = Gtk.Label("100%")
self.labels['extrudefactor'].get_style_context().add_class('temperature_entry')
self.labels['extrude-'] = KlippyGtk.ButtonImage("retract", _("Extrusion -"), "color4")
self.labels['extrude-'] = self._gtk.ButtonImage("retract", _("Extrusion -"), "color4")
self.labels['extrude-'].connect("clicked", self.change_extrusion, "-")
grid.attach(self.labels['extrude+'], 3, 0, 1, 1)
grid.attach(self.labels['extrudefactor'], 3, 1, 1, 1)
grid.attach(self.labels['extrude-'], 3, 2, 1, 1)
grid.attach(self.labels['extrude+'], 2, 0, 1, 1)
grid.attach(self.labels['extrudefactor'], 2, 1, 1, 1)
grid.attach(self.labels['extrude-'], 2, 2, 1, 1)
# babystepping grid
bsgrid = Gtk.Grid()
j = 0;
for i in self.bs_deltas:
self.labels[i] = KlippyGtk.ToggleButton(i)
self.labels[i] = self._gtk.ToggleButton(i)
self.labels[i].connect("clicked", self.change_bs_delta, i)
ctx = self.labels[i].get_style_context()
if j == 0:
@@ -99,7 +88,7 @@ class FineTunePanel(ScreenPanel):
deltgrid = Gtk.Grid()
j = 0;
for i in self.percent_deltas:
self.labels[i] = KlippyGtk.ToggleButton("%s%%" % i)
self.labels[i] = self._gtk.ToggleButton("%s%%" % i)
self.labels[i].connect("clicked", self.change_percent_delta, i)
ctx = self.labels[i].get_style_context()
if j == 0:
@@ -115,7 +104,7 @@ class FineTunePanel(ScreenPanel):
self.labels["1"].set_active(True)
grid.attach(deltgrid, 1, 3, 3, 1)
grid.attach(deltgrid, 1, 3, 2, 1)
#self.panel = grid
self.content.add(grid)
@@ -137,10 +126,6 @@ class FineTunePanel(ScreenPanel):
self.speed = int(data["gcode_move"]["speed_factor"]*100)
self.labels['speedfactor'].set_text("%3d%%" % self.speed)
if "fan" in data and "speed" in data['fan']:
self.fan = int(round(data['fan']['speed'],2)*100)
self.labels['fanspeed'].set_text("%3d%%" % self.fan)
def change_babystepping(self, widget, dir):
if dir == "+":
gcode = "SET_GCODE_OFFSET Z_ADJUST=%s MOVE=1" % self.bs_delta
@@ -217,19 +202,3 @@ class FineTunePanel(ScreenPanel):
if i == self.percent_delta:
continue
self.labels[str(i)].set_active(False)
#def
def select_fan_speed(self, widget):
if self.user_selecting == True:
return
self.user_selecting = True
self.panel.attach(self.labels["apply"], 3, 0, 1, 1)
self.panel.attach(self.labels["cancel"], 0, 0, 1, 1)
self._screen.show_all()
def cancel_select_fan_speed(self, widget):
self.user_selecting = False
self.panel.remove(self.labels["apply"])
self.panel.remove(self.labels["cancel"])
+111
View File
@@ -0,0 +1,111 @@
import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.Macro")
def create_panel(*args):
return MacroPanel(*args)
class MacroPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
self.macros = {}
self.loaded_macros = []
# Create a scroll window for the macros
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
# Create a grid for all macros
self.labels['macros'] = Gtk.Grid()
scroll.add(self.labels['macros'])
# Create a box to contain all of the above
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
box.pack_start(scroll, True, True, 0)
self.content.add(box)
def activate(self):
self.unload_gcode_macros()
self.load_gcode_macros()
def add_gcode_macro(self, macro):
frame = Gtk.Frame()
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (macro))
name.set_hexpand(True)
name.set_vexpand(True)
name.set_halign(Gtk.Align.START)
name.set_valign(Gtk.Align.CENTER)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
open = self._gtk.ButtonImage("open",None,"color3")
open.connect("clicked", self.run_gcode_macro, macro)
open.set_hexpand(False)
open.set_halign(Gtk.Align.END)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev.add(labels)
dev.add(open)
frame.add(dev)
self.macros[macro] = {
"row": frame
}
macros = sorted(self.macros)
pos = macros.index(macro)
self.loaded_macros.append(macro)
self.labels['macros'].insert_row(pos)
self.labels['macros'].attach(self.macros[macro]['row'], 0, pos, 1, 1)
self.labels['macros'].show_all()
def load_gcode_macros(self):
macros = self._screen.printer.get_gcode_macros()
for x in macros:
macro = x[12:].strip()
if macro in self.loaded_macros:
continue
logger.debug("Evaluating '%s' value '%s'" % (macro.strip().lower(),
self._config.get_config().getboolean("displayed_macros", macro.lower(), fallback=True)))
if ("displayed_macros" not in self._config.get_config().sections() or
self._config.get_config().getboolean("displayed_macros", macro.lower(), fallback=True)):
self.add_gcode_macro(macro)
def run_gcode_macro(self, widget, macro):
self._screen._ws.klippy.gcode_script(macro)
def unload_gcode_macros(self):
for macro in self.loaded_macros:
logger.debug("Evaluating '%s' value '%s'" % (macro.strip().lower(),
self._config.get_config().getboolean("displayed_macros", macro.lower(), fallback=True)))
if ("displayed_macros" in self._config.get_config().sections() and
not self._config.get_config().getboolean("displayed_macros", macro.lower(), fallback=True)):
macros = sorted(self.macros)
pos = macros.index(macro)
self.labels['macros'].remove_row(pos)
self.labels['macros'].show_all()
+441 -109
View File
@@ -1,10 +1,11 @@
# -*- coding: utf-8 -*-
import gi
import logging
import math
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.JobStatusPanel")
@@ -15,33 +16,41 @@ def create_panel(*args):
class JobStatusPanel(ScreenPanel):
is_paused = False
filename = None
file_metadata = {}
progress = 0
state = "printing"
def initialize(self, panel_name):
_ = self.lang.gettext
grid = KlippyGtk.HomogeneousGrid()
self.layout = Gtk.Layout()
self.layout.set_size(self._screen.width, self._screen.height)
self.timeleft_type = "file"
self.labels['progress'] = KlippyGtk.ProgressBar("printing-progress-bar")
#self.labels['progress'].set_vexpand(True)
#self.labels['progress'].set_valign(Gtk.Align.CENTER)
self.labels['progress'].set_show_text(False)
#self.labels['progress'].set_margin_top(10)
self.labels['progress'].set_margin_end(20)
self.labels['progress_text'] = Gtk.Label()
self.labels['progress_text'].get_style_context().add_class("printing-progress-text")
overlay = Gtk.Overlay()
overlay.add(self.labels['progress'])
overlay.add_overlay(self.labels['progress_text'])
self.create_buttons()
grid = self._gtk.HomogeneousGrid()
grid.set_size_request(self._screen.width, self._screen.height)
fi_box = Gtk.VBox(spacing=0)
fi_box.set_hexpand(True)
fi_box.set_vexpand(False)
fi_box.set_halign(Gtk.Align.START)
self.labels['file'] = Gtk.Label(label="file")
self.labels['file'].set_halign(Gtk.Align.START)
self.labels['file'].set_vexpand(False)
self.labels['file'].get_style_context().add_class("printing-filename")
self.labels['file'].set_line_wrap(True)
self.labels['file'].set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
self.labels['status'] = Gtk.Label()
self.labels['status'].set_halign(Gtk.Align.START)
self.labels['status'].set_vexpand(False)
self.labels['status'].get_style_context().add_class("printing-status")
fi_box.add(self.labels['file']) #, True, True, 0)
fi_box.add(self.labels['status']) #, True, True, 0)
fi_box.set_valign(Gtk.Align.CENTER)
self.labels['file'] = KlippyGtk.ImageLabel("file","",20,"printing-status-label")
self.labels['time_label'] = KlippyGtk.ImageLabel("speed-step",_("Time Elapsed"),20,"printing-status-label")
self.labels['time'] = KlippyGtk.Label(_("Time Elapsed"),"printing-status-label")
self.labels['time_left_label'] = KlippyGtk.ImageLabel("speed-step",_("Time Left"),20,"printing-status-label")
self.labels['time_left'] = KlippyGtk.Label(_("Time Left"),"printing-status-label")
timegrid = Gtk.Grid()
timegrid.attach(self.labels['time_label']['b'], 0, 0, 1, 1)
timegrid.attach(self.labels['time'], 0, 1, 1, 1)
timegrid.attach(self.labels['time_left_label']['b'], 1, 0, 1, 1)
timegrid.attach(self.labels['time_left'], 1, 1, 1, 1)
info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
info.props.valign = Gtk.Align.CENTER
info.set_hexpand(True)
@@ -52,75 +61,255 @@ class JobStatusPanel(ScreenPanel):
#grid.attach(info,2,0,2,1)
pbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
pbox.pack_start(self.labels['file']['b'], False, True, 0)
pbox.pack_end(timegrid, False, False, 0)
#pbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
#pbox.pack_start(self.labels['file']['b'], False, True, 0)
#pbox.pack_end(timegrid, False, False, 0)
#pbox.pack_end(self.labels['progress'], False, False, 0)
pbox.pack_end(overlay, False, False, 0)
#pbox.pack_end(overlay, False, False, 0)
grid.attach(pbox, 1, 0, 3, 2)
#grid.attach(pbox, 0, 0, 4, 3)
self.labels['darea'] = Gtk.DrawingArea()
self.labels['darea'].connect("draw", self.on_draw)
self.labels['extruder'] = KlippyGtk.ButtonImage("extruder-1", KlippyGtk.formatTemperatureString(0, 0))
self.labels['extruder'].set_sensitive(False)
grid.attach(self.labels['extruder'], 0, 0, 1, 1)
box = Gtk.Box()
box.set_hexpand(True)
box.set_vexpand(True)
box.set_halign(Gtk.Align.CENTER)
self.labels['progress_text'] = Gtk.Label()
self.labels['progress_text'].get_style_context().add_class("printing-progress-text")
box.add(self.labels['progress_text'])
self.labels['heater_bed'] = KlippyGtk.ButtonImage("bed", KlippyGtk.formatTemperatureString(0, 0))
self.labels['heater_bed'].set_sensitive(False)
grid.attach(self.labels['heater_bed'], 0, 1, 1, 1)
overlay = Gtk.Overlay()
overlay.set_hexpand(True)
overlay.set_vexpand(True)
overlay.add(self.labels['darea'])
overlay.add_overlay(box)
self.labels['resume'] = KlippyGtk.ButtonImage("resume",_("Resume"),"color1")
self.labels['resume'].connect("clicked",self.resume)
self.labels['pause'] = KlippyGtk.ButtonImage("pause",_("Pause"),"color1" )
self.labels['pause'].connect("clicked",self.pause)
#self.labels['extruder'] = self._gtk.ButtonImage("extruder-1", self._gtk.formatTemperatureString(0, 0))
#self.labels['extruder'].set_sensitive(False)
#grid.attach(self.labels['extruder'], 0, 0, 1, 1)
if self._printer.get_stat('pause_resume','is_paused') == True:
self.is_paused = True
grid.attach(self.labels['resume'], 0, 2, 1, 1)
else:
grid.attach(self.labels['pause'], 0, 2, 1, 1)
#self.labels['heater_bed'] = self._gtk.ButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
#self.labels['heater_bed'].set_sensitive(False)
#grid.attach(self.labels['heater_bed'], 0, 1, 1, 1)
self.labels['cancel'] = KlippyGtk.ButtonImage("stop",_("Cancel"),"color2")
self.labels['cancel'].connect("clicked", self.cancel)
grid.attach(self.labels['cancel'], 1, 2, 1, 1)
self.labels['estop'] = KlippyGtk.ButtonImage("emergency",_("Emergency Stop"),"color4")
self.labels['estop'].connect("clicked", self.emergency_stop)
grid.attach(self.labels['estop'], 2, 2, 1, 1)
self.labels['control'] = KlippyGtk.ButtonImage("control",_("Control"),"color3")
self.labels['control'].connect("clicked", self._screen._go_to_submenu, "")
grid.attach(self.labels['control'], 3, 2, 1, 1)
self.labels['thumbnail'] = self._gtk.Image("file.svg", False, 1.6, 1.6)
self.layout = grid
i = 0
for extruder in self._printer.get_tools():
self.labels[extruder + '_box'] = Gtk.Box(spacing=0)
self.labels[extruder] = Gtk.Label(label="")
self.labels[extruder].get_style_context().add_class("printing-info")
if i <= 4:
ext_img = self._gtk.Image("extruder-%s.svg" % i, None, .6, .6)
self.labels[extruder + '_box'].add(ext_img)
self.labels[extruder + '_box'].add(self.labels[extruder])
i += 1
temp_grid = self._gtk.HomogeneousGrid()
self.current_extruder = self._printer.get_stat("toolhead","extruder")
temp_grid.attach(self.labels[self.current_extruder + '_box'], 0, 0, 1, 1)
if self._printer.has_heated_bed():
heater_bed = self._gtk.Image("bed.svg", None, .6, .6)
self.labels['heater_bed'] = Gtk.Label(label="")
self.labels['heater_bed'].get_style_context().add_class("printing-info")
heater_bed_box = Gtk.Box(spacing=0)
heater_bed_box.add(heater_bed)
heater_bed_box.add(self.labels['heater_bed'])
temp_grid.attach(heater_bed_box, 1, 0, 1, 1)
self.labels['temp_grid'] = temp_grid
# Create time remaining items
hourglass = self._gtk.Image("hourglass.svg", None, .6, .6)
self.labels['left'] = Gtk.Label(label=_("Left:"))
self.labels['left'].get_style_context().add_class("printing-info")
self.labels['time_left'] = Gtk.Label(label="0s")
self.labels['time_left'].get_style_context().add_class("printing-info")
itl_box = Gtk.Box(spacing=0)
itl_box.add(hourglass)
itl_box.add(self.labels['left'])
itl_box.add(self.labels['time_left'])
self.labels['itl_box'] = itl_box
# Create overall items
clock = self._gtk.Image("clock.svg", None, .6, .6)
self.labels['elapsed'] = Gtk.Label(label=_("Elapsed:"))
self.labels['elapsed'].get_style_context().add_class("printing-info")
self.labels['duration'] = Gtk.Label(label="0s")
self.labels['duration'].get_style_context().add_class("printing-info")
self.labels['est_time'] = Gtk.Label(label="/ 0s")
self.labels['est_time'].get_style_context().add_class("printing-info")
it_box = Gtk.Box(spacing=0)
it_box.add(clock)
it_box.add(self.labels['elapsed'])
it_box.add(self.labels['duration'])
it_box.add(self.labels['est_time'])
self.labels['it_box'] = it_box
position = self._gtk.Image("move.svg", None, .6, .6)
self.labels['pos_x'] = Gtk.Label(label="X: 0")
self.labels['pos_x'].get_style_context().add_class("printing-info")
self.labels['pos_y'] = Gtk.Label(label="Y: 0")
self.labels['pos_y'].get_style_context().add_class("printing-info")
self.labels['pos_z'] = Gtk.Label(label="Z: 0")
self.labels['pos_z'].get_style_context().add_class("printing-info")
pos_box = Gtk.Box(spacing=0)
posgrid = self._gtk.HomogeneousGrid()
posgrid.set_hexpand(True)
posgrid.attach(self.labels['pos_x'], 0, 0, 1, 1)
posgrid.attach(self.labels['pos_y'], 1, 0, 1, 1)
posgrid.attach(self.labels['pos_z'], 2, 0, 1, 1)
pos_box.add(position)
pos_box.add(posgrid)
self.labels['pos_box'] = pos_box
speed = self._gtk.Image("speed-step.svg", None, .6, .6)
self.labels['speed'] = Gtk.Label(label="")
self.labels['speed'].get_style_context().add_class("printing-info")
speed_box = Gtk.Box(spacing=0)
speed_box.add(speed)
speed_box.add(self.labels['speed'])
extrusion = self._gtk.Image("extrude.svg", None, .6, .6)
self.labels['extrusion'] = Gtk.Label(label="")
self.labels['extrusion'].get_style_context().add_class("printing-info")
extrusion_box = Gtk.Box(spacing=0)
extrusion_box.add(extrusion)
extrusion_box.add(self.labels['extrusion'])
fan = self._gtk.Image("fan.svg", None, .6, .6)
self.labels['fan'] = Gtk.Label(label="")
self.labels['fan'].get_style_context().add_class("printing-info")
fan_box = Gtk.Box(spacing=0)
fan_box.add(fan)
fan_box.add(self.labels['fan'])
sfe_grid = self._gtk.HomogeneousGrid()
sfe_grid.set_hexpand(True)
sfe_grid.attach(speed_box, 0, 0, 1, 1)
sfe_grid.attach(extrusion_box, 1, 0, 1, 1)
sfe_grid.attach(fan_box, 2, 0, 1, 1)
self.labels['sfe_grid'] = sfe_grid
self.labels['i1_box'] = Gtk.VBox(spacing=0)
self.labels['i1_box'].get_style_context().add_class("printing-info-box")
self.labels['i1_box'].set_valign(Gtk.Align.CENTER)
self.labels['i2_box'] = Gtk.VBox(spacing=0)
self.labels['i2_box'].get_style_context().add_class("printing-info-box")
grid.attach(overlay, 0, 0, 1, 1)
grid.attach(fi_box, 1, 0, 3, 1)
grid.attach(self.labels['i1_box'], 0, 1, 2, 2)
grid.attach(self.labels['i2_box'], 2, 1, 2, 2)
self.add_labels()
self.grid = grid
self.layout.put(grid, 0, 0)
self._screen.add_subscription(panel_name)
def on_draw(self, da, ctx):
w = da.get_allocated_width()
h = da.get_allocated_height()
r = min(w,h)*.4
ctx.set_source_rgb(0.6, 0.6, 0.6)
ctx.set_line_width(self._gtk.get_font_size() * .75)
ctx.translate(w / 2, h / 2)
ctx.arc(0, 0, r, 0, 2*math.pi)
ctx.stroke()
ctx.set_source_rgb(1, 0, 0)
ctx.arc(0, 0, r, 3/2*math.pi, 3/2*math.pi+(self.progress*2*math.pi))
ctx.stroke()
def activate(self):
_ = self.lang.gettext
self.progress = self._printer.get_stat('virtual_sdcard','progress')
self.update_progress()
self.enable_button("pause","cancel","resume")
state = "printing"
self.update_text("status",_("Printing"))
self.filename = self._printer.get_stat('print_stats','filename')
self.update_file_metadata()
self.grid.remove_row(3)
self.grid.insert_row(3)
ps = self._printer.get_stat("print_stats")
logger.debug("Act State: %s" % ps['state'])
self.set_state(ps['state'])
self.show_buttons_for_state()
def add_labels(self):
for child in self.labels['i1_box'].get_children():
self.labels['i1_box'].remove(child)
for child in self.labels['i2_box'].get_children():
self.labels['i2_box'].remove(child)
#if self.file_metadata == None:
# self.labels['i1_box'].add(self.labels['temp_grid'])
# self.labels['i1_box'].add(self.labels['pos_box'])
# self.labels['i1_box'].add(self.labels['sfe_grid'])
# self.labels['i2_box'].add(self.labels['it_box'])
# self.labels['i2_box'].add(self.labels['itl_box'])
#else:
self.labels['i1_box'].add(self.labels['thumbnail'])
self.labels['i2_box'].add(self.labels['temp_grid'])
self.labels['i2_box'].add(self.labels['pos_box'])
self.labels['i2_box'].add(self.labels['sfe_grid'])
self.labels['i2_box'].add(self.labels['it_box'])
self.labels['i2_box'].add(self.labels['itl_box'])
def create_buttons(self):
_ = self.lang.gettext
self.labels['cancel'] = self._gtk.ButtonImage("stop",_("Cancel"),"color2")
self.labels['cancel'].connect("clicked", self.cancel)
self.labels['control'] = self._gtk.ButtonImage("control",_("Control"),"color3")
self.labels['control'].connect("clicked", self._screen._go_to_submenu, "")
self.labels['estop'] = self._gtk.ButtonImage("emergency",_("Emergency Stop"),"color4")
self.labels['estop'].connect("clicked", self.emergency_stop)
self.labels['menu'] = self._gtk.ButtonImage("complete",_("Main Menu"),"color4")
self.labels['menu'].connect("clicked", self.close_panel)
self.labels['pause'] = self._gtk.ButtonImage("pause",_("Pause"),"color1" )
self.labels['pause'].connect("clicked",self.pause)
self.labels['restart'] = self._gtk.ButtonImage("restart",_("Restart"),"color3")
self.labels['restart'].connect("clicked", self.restart)
self.labels['resume'] = self._gtk.ButtonImage("resume",_("Resume"),"color1")
self.labels['resume'].connect("clicked",self.resume)
def restart(self, widget):
if self.filename != "none":
self._screen._ws.klippy.print_start(self.filename)
def resume(self, widget):
self.disable_button("pause","cancel")
#self.disable_button("resume","cancel")
self._screen._ws.klippy.print_resume(self._response_callback, "enable_button", "pause", "cancel")
self._screen.show_all()
def pause(self, widget):
self.disable_button("resume","cancel")
#self.disable_button("pause","cancel")
self._screen._ws.klippy.print_pause(self._response_callback, "enable_button", "resume", "cancel")
self._screen.show_all()
def cancel(self, widget):
_ = self.lang.gettext
dialog = KlippyGtk.ConfirmDialog(
self._screen,
_("Are you sure you wish to cancel this print?"),
[
{
"name": _("Cancel Print"),
"response": Gtk.ResponseType.OK
},
{
"name": _("Go Back"),
"response": Gtk.ResponseType.CANCEL
}
],
self.cancel_confirm
)
buttons = [
{"name": _("Cancel Print"), "response": Gtk.ResponseType.OK},
{"name": _("Go Back"), "response": Gtk.ResponseType.CANCEL}
]
label = Gtk.Label()
label.set_markup(_("Are you sure you wish to cancel this print?"))
label.set_hexpand(True)
label.set_halign(Gtk.Align.CENTER)
label.set_line_wrap(True)
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
dialog = self._gtk.Dialog(self._screen, buttons, label, self.cancel_confirm)
self.disable_button("pause","cancel")
def cancel_confirm(self, widget, response_id):
@@ -130,12 +319,19 @@ class JobStatusPanel(ScreenPanel):
self.enable_button("pause","cancel")
return
self._screen._ws.klippy.print_cancel(self._response_callback, "enable_button", "pause", "cancel")
logger.debug("Canceling print")
self.disable_button("pause","resume","cancel")
self._screen._ws.klippy.print_cancel(self._response_callback)
def _response_callback(self, response, method, params, func, *args):
def _response_callback(self, response, method, params, func=None, *args):
if func == "enable_button":
self.enable_button(*args)
def close_panel(self, widget=None):
if self._screen.is_printing():
self._screen.printer_ready()
return False
def enable_button(self, *args):
for arg in args:
self.labels[arg].set_sensitive(True)
@@ -144,54 +340,186 @@ class JobStatusPanel(ScreenPanel):
for arg in args:
self.labels[arg].set_sensitive(False)
def _callback_metadata(self, newfiles, deletedfiles, modifiedfiles):
if self.file_metadata == None and self.filename in modifiedfiles:
self.update_file_metadata()
self._files.remove_file_callback(self._callback_metadata)
def process_update(self, action, data):
if action != "notify_status_update":
return
_ = self.lang.gettext
self.update_temp("heater_bed",
self._printer.get_dev_stat("heater_bed","temperature"),
self._printer.get_dev_stat("heater_bed","target")
)
if self._printer.has_heated_bed():
self.update_temp("heater_bed",
self._printer.get_dev_stat("heater_bed","temperature"),
self._printer.get_dev_stat("heater_bed","target")
)
for x in self._printer.get_tools():
self.update_temp(x,
self._printer.get_dev_stat(x,"temperature"),
self._printer.get_dev_stat(x,"target")
)
vsd = self._printer.get_stat("print_stats")
if "filename" in vsd and self.filename != vsd['filename']:
if vsd['filename'] != "":
self.filename = KlippyGtk.formatFileName(vsd['filename'])
self.update_image_text("file", self.filename)
else:
file = "Unknown"
self.update_image_text("file", "Unknown")
if "toolhead" in data:
if "extruder" in data["toolhead"]:
if data["toolhead"]["extruder"] != self.current_extruder:
self.labels['temp_grid'].remove_column(0)
self.labels['temp_grid'].insert_column(0)
self.current_extruder = data["toolhead"]["extruder"]
self.labels['temp_grid'].attach(self.labels[self.current_extruder + '_box'], 0, 0, 1, 1)
self._screen.show_all()
if "position" in data["toolhead"]:
self.labels['pos_x'].set_text("X: %.2f" % (data["toolhead"]["position"][0]))
self.labels['pos_y'].set_text("Y: %.2f" % (data["toolhead"]["position"][1]))
if "gcode_move" in data and "gcode_position" in data["gcode_move"]:
self.labels['pos_z'].set_text("Z: %.2f" % (data["gcode_move"]["gcode_position"][2]))
progress = 0 if self._printer.get_stat('virtual_sdcard','progress') == 0 else (vsd['print_duration'] /
self._printer.get_stat('virtual_sdcard','progress') - vsd['print_duration'])
if "gcode_move" in data:
#if "homing_origin" in data["gcode_move"]:
# self.labels['zoffset'].set_text("%.2fmm" % data["gcode_move"]["homing_origin"][2])
if "extrude_factor" in data["gcode_move"]:
self.extrusion = int(data["gcode_move"]["extrude_factor"]*100)
self.labels['extrusion'].set_text("%3d%%" % self.extrusion)
if "speed_factor" in data["gcode_move"]:
self.speed = int(data["gcode_move"]["speed_factor"]*100)
self.labels['speed'].set_text("%3d%%" % self.speed)
if "fan" in data and "speed" in data['fan']:
self.fan = int(round(data['fan']['speed'],2)*100)
self.labels['fan'].set_text("%3d%%" % self.fan)
self.update_text("time", str(KlippyGtk.formatTimeString(vsd['print_duration'])))
self.update_text("time_left", str(KlippyGtk.formatTimeString(
progress
)))
if "print_stats" in data or "virtual_sdcard" in data:
ps = self._printer.get_stat("print_stats")
vsd = self._printer.get_stat("virtual_sdcard")
if ps['state'] == "printing" and self.state != "printing":
self.set_state("printing")
self.show_buttons_for_state()
if ps['state'] == "complete" and self.state != "complete":
self.progress = 1
self.update_progress()
self.set_state("complete")
self.show_buttons_for_state()
timeout = self._config.get_main_config().getint("job_complete_timeout", 30)
if timeout != 0:
GLib.timeout_add(timeout * 1000, self.close_panel)
elif ps['state'] == "error" and self.state != "error":
logger.debug("Error!")
self.set_state("error")
self.labels['status'].set_text("Error - %s" % ps['message'])
self.show_buttons_for_state()
timeout = self._config.get_main_config().getint("job_error_timeout", 0)
if timeout != 0:
GLib.timeout_add(timeout * 1000, self.close_panel)
elif ps['state'] == "standby":
self.close_panel()
self.update_progress(self._printer.get_stat('virtual_sdcard','progress'))
if self.filename != ps['filename']:
if ps['filename'] != "":
self.filename = ps['filename']
self.file_metadata = {}
self.update_text("file", self.filename.split("/")[-1])
else:
file = "Unknown"
self.update_text("file", "Unknown file")
if "pause_resume" in data:
if self.is_paused == True and data['pause_resume']['is_paused'] == False:
self.is_paused = False
self.panel.attach(self.labels['pause'], 0, 2, 1, 1)
self.panel.remove(self.labels['resume'])
self.panel.show_all()
if self.is_paused == False and data['pause_resume']['is_paused'] == True:
self.is_paused = True
self.panel.attach(self.labels['resume'], 0, 2, 1, 1)
self.panel.remove(self.labels['pause'])
self.panel.show_all()
if self.file_metadata != None:
if "gcode_start_byte" in self.file_metadata:
progress = (max(vsd['file_position'] - self.file_metadata['gcode_start_byte'],0) /
(self.file_metadata['gcode_end_byte'] - self.file_metadata['gcode_start_byte']))
else:
progress = 0 if self._printer.get_stat('virtual_sdcard','progress') == 0 else (ps['print_duration']/
self._printer.get_stat('virtual_sdcard','progress') - ps['print_duration'])
progress = round(progress,2)
if progress != self.progress:
self.progress = progress
self.labels['darea'].queue_draw()
self.update_text("duration", str(self._gtk.formatTimeString(ps['print_duration'])))
timeleft_type = self._config.get_config()['main'].get('print_estimate_method','file')
if timeleft_type != self.timeleft_type:
if self.timeleft_type == "duration":
self.labels['it_box'].add(self.labels['est_time'])
elif timeleft_type == "duration":
self.labels['it_box'].remove(self.labels['est_time'])
self.timeleft_type = timeleft_type
if timeleft_type in ['filament','file','slicer']:
duration = ps['print_duration']
if timeleft_type == "filament":
estimated_filament = (self.file_metadata['filament_total'] if "filament_total" in self.file_metadata
else 1)
total_duration = duration / (max(ps['filament_used'],0.0001) / max(estimated_filament, 0.0001))
elif timeleft_type == "file":
total_duration = duration / max(self.progress, 0.0001)
elif timeleft_type == "slicer":
total_duration = (self.file_metadata['estimated_time'] if "estimated_time" in self.file_metadata
else duration)
time_left = max(total_duration - duration, 0)
self.update_text("time_left", str(self._gtk.formatTimeString(time_left)))
self.update_progress()
if "pause_resume" in data and self.state != "complete":
if self.state == "paused" and data['pause_resume']['is_paused'] == False:
self.set_state("printing")
self.update_text("status",_("Paused"))
self.grid.attach(self.labels['pause'], 0, 3, 1, 1)
self.grid.remove(self.labels['resume'])
self.grid.show_all()
if self.state != "paused" and data['pause_resume']['is_paused'] == True:
self.set_state("paused")
self.grid.attach(self.labels['resume'], 0, 3, 1, 1)
self.grid.remove(self.labels['pause'])
self.grid.show_all()
def set_state(self, state):
self.state = state
self.update_text("status",state.capitalize())
def show_buttons_for_state(self):
self.grid.remove_row(3)
self.grid.insert_row(3)
if self.state == "printing":
self.grid.attach(self.labels['pause'], 0, 3, 1, 1)
self.grid.attach(self.labels['cancel'], 1, 3, 1, 1)
self.grid.attach(self.labels['estop'], 2, 3, 1, 1)
self.grid.attach(self.labels['control'], 3, 3, 1, 1)
elif self.state == "paused":
self.grid.attach(self.labels['resume'], 0, 3, 1, 1)
self.grid.attach(self.labels['cancel'], 1, 3, 1, 1)
self.grid.attach(self.labels['estop'], 2, 3, 1, 1)
self.grid.attach(self.labels['control'], 3, 3, 1, 1)
elif self.state == "error" or self.state == "complete":
self.grid.attach(self.labels['restart'], 2, 3, 1, 1)
self.grid.attach(self.labels['menu'], 3, 3, 1, 1)
self.show_all()
def show_file_thumbnail(self):
if self._files.has_thumbnail(self.filename):
pixbuf = self.get_file_image(self.filename, 7, 3.25)
if pixbuf != None:
self.labels['thumbnail'].set_from_pixbuf(pixbuf)
def update_file_metadata(self):
if self._files.file_metadata_exists(self.filename):
self.file_metadata = self._files.get_file_info(self.filename)
logger.debug("Parsing file metadata: %s" % list(self.file_metadata))
self.update_text("est_time","/ %s" % str(self._gtk.formatTimeString(self.file_metadata['estimated_time'])))
if "thumbnails" in self.file_metadata:
tmp = self.file_metadata['thumbnails'].copy()
for i in tmp:
i['data'] = ""
logger.debug("Thumbnails: %s" % list(tmp))
self.show_file_thumbnail()
else:
self.file_metadata = None
logger.debug("Cannot find file metadata. Listening for updated metadata")
self._screen.files.add_file_callback(self._callback_metadata)
def update_image_text(self, label, text):
if label in self.labels and 'l' in self.labels[label]:
@@ -201,10 +529,14 @@ class JobStatusPanel(ScreenPanel):
if label in self.labels:
self.labels[label].set_text(text)
def update_progress (self, progress):
self.labels['progress'].set_fraction(progress)
self.labels['progress_text'].set_text("%s%%" % (str(int(progress*100))))
def update_progress (self):
self.labels['progress_text'].set_text("%s%%" % (str( min(int(self.progress*100),100) )))
def update_temp(self, dev, temp, target):
if dev in self.labels:
self.labels[dev].set_label(KlippyGtk.formatTemperatureString(temp, target))
#def update_temp(self, dev, temp, target):
# if dev in self.labels:
# self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
def update_temp(self, x, temp, target):
self.labels[x].set_markup(
"%.1f<big>/</big>%.0f °C" % (temp, target)
)
+29 -12
View File
@@ -4,7 +4,6 @@ import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGtk import KlippyGtk
from panels.menu import MenuPanel
logger = logging.getLogger("KlipperScreen.MainMenu")
@@ -13,45 +12,63 @@ def create_panel(*args):
return MainPanel(*args)
class MainPanel(MenuPanel):
def __init__(self, screen, title, back=False):
super().__init__(screen, title, False)
def initialize(self, panel_name, items, extrudercount):
print("### Making MainMenu")
grid = KlippyGtk.HomogeneousGrid()
grid = self._gtk.HomogeneousGrid()
grid.set_hexpand(True)
grid.set_vexpand(True)
# Create Extruders and bed icons
eq_grid = KlippyGtk.HomogeneousGrid()
eq_grid = self._gtk.HomogeneousGrid()
i = 0
for x in self._printer.get_tools():
if i > 3:
break
self.labels[x] = KlippyGtk.ButtonImage("extruder-"+str(i+1), KlippyGtk.formatTemperatureString(0, 0))
eq_grid.attach(self.labels[x], i%2, i/2, 1, 1)
self.labels[x] = self._gtk.ButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0))
col = 0 if len(self._printer.get_tools()) == 1 else i%2
row = i/2
eq_grid.attach(self.labels[x], col, row, 1, 1)
i += 1
self.labels['heater_bed'] = KlippyGtk.ButtonImage("bed", KlippyGtk.formatTemperatureString(0, 0))
if self._printer.has_heated_bed():
self.labels['heater_bed'] = self._gtk.ButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
width = 2 if i > 1 else 1
eq_grid.attach(self.labels['heater_bed'], 0, i/2+1, width, 1)
width = 2 if i > 1 else 1
eq_grid.attach(self.labels['heater_bed'], 0, i/2+1, width, 1)
self.items = items
self.create_menu_items()
self.grid = Gtk.Grid()
self.grid.set_row_homogeneous(True)
self.grid.set_column_homogeneous(True)
grid.attach(eq_grid, 0, 0, 1, 1)
grid.attach(self.arrangeMenuItems(items, 2, True), 1, 0, 1, 1)
self.grid = grid
self.target_temps = {
"heater_bed": 0,
"extruder": 0
}
self.content.add(self.grid)
self.layout.show_all()
self._screen.add_subscription(panel_name)
def get(self):
return self.grid
def activate(self):
return
def update_temp(self, dev, temp, target):
if dev in self.labels:
self.labels[dev].set_label(KlippyGtk.formatTemperatureString(temp, target))
self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
def process_update(self, action, data):
if action != "notify_status_update":
+41 -39
View File
@@ -1,55 +1,50 @@
import gettext
import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from jinja2 import Environment, Template
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.screen_panel import ScreenPanel
from jinja2 import Template
logger = logging.getLogger("KlipperScreen.MenuPanel")
def create_panel(*args):
return MenuPanel(*args)
class MenuPanel(ScreenPanel):
i = 0
def initialize(self, panel_name, display_name, items):
_ = self.lang.gettext
self.activate()
self.items = items
self.create_menu_items()
grid = self.arrangeMenuItems(items, 4)
grid.set_size_request(self._screen.width, self._screen.height-45)
self.content.add(grid)
self.panel = self.layout
self.grid = Gtk.Grid()
self.grid.set_row_homogeneous(True)
self.grid.set_column_homogeneous(True)
self.content.add(self.grid)
def activate(self):
self.j2_data = {
"printer": {
"power_devices": {
"count": len(self._screen.printer.get_power_devices())
}
}
}
logger.debug("j2_data: %s" % self.j2_data)
self.j2_data = self._printer.get_printer_status_data()
self.j2_data.update({
'moonraker_connected': self._screen._ws.is_connected()
})
self.arrangeMenuItems(self.items, 4)
def arrangeMenuItems (self, items, columns, expandLast=False):
grid = Gtk.Grid()
grid.set_row_homogeneous(True)
grid.set_column_homogeneous(True)
logger.debug(items)
for item in items:
key = list(item)[0]
logger.debug(item)
if not self.evaluate_enable(item[key]['enable']):
items.remove(item)
for child in self.grid.get_children():
self.grid.remove(child)
l = len(items)
i = 0
for i in range(l):
for item in items:
key = list(item)[0]
logger.debug("Evaluating item: %s" % key)
if not self.evaluate_enable(item[key]['enable']):
continue
col = i % columns
row = int(i/columns)
width = 1
@@ -57,10 +52,23 @@ class MenuPanel(ScreenPanel):
if expandLast == True and i+1 == l and l%2 == 1:
width = 2
key = list(items[i])[0]
item = items[i][key]
b = KlippyGtk.ButtonImage(
item['icon'], item['name'], "color"+str((i%4)+1)
self.grid.attach(self.labels[key], col, row, width, 1)
i += 1
return self.grid
def create_menu_items(self):
for i in range(len(self.items)):
key = list(self.items[i])[0]
item = self.items[i][key]
env = Environment(extensions=["jinja2.ext.i18n"])
env.install_gettext_translations(self.lang)
j2_temp = env.from_string(item['name'])
parsed_name = j2_temp.render()
b = self._gtk.ButtonImage(
item['icon'], parsed_name, "color"+str((i%4)+1)
)
if item['panel'] != False:
b.connect("clicked", self.menu_item_clicked, item['panel'], item)
@@ -72,12 +80,7 @@ class MenuPanel(ScreenPanel):
b.connect("clicked", self._screen._send_action, item['method'], params)
else:
b.connect("clicked", self._screen._go_to_submenu, key)
grid.attach(b, col, row, width, 1)
i += 1
return grid
self.labels[key] = b
def evaluate_enable(self, enable):
if enable == True:
@@ -87,10 +90,9 @@ class MenuPanel(ScreenPanel):
try:
logger.debug("Template: '%s'" % enable)
logger.debug("Date: %s" % self.j2_data)
logger.debug("Data: %s" % self.j2_data)
j2_temp = Template(enable)
result = j2_temp.render(self.j2_data)
logger.debug("Result: %s" % result)
if result == 'True':
return True
return False
+24 -21
View File
@@ -4,7 +4,6 @@ import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
@@ -21,29 +20,32 @@ class MovePanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
grid = KlippyGtk.HomogeneousGrid()
grid = self._gtk.HomogeneousGrid()
self.labels['x+'] = KlippyGtk.ButtonImage("move-x+", _("X+"), "color1")
self.labels['x+'] = self._gtk.ButtonImage("move-x+", _("X+"), "color1")
self.labels['x+'].connect("clicked", self.move, "X", "+")
self.labels['x-'] = KlippyGtk.ButtonImage("move-x-", _("X-"), "color1")
self.labels['x-'] = self._gtk.ButtonImage("move-x-", _("X-"), "color1")
self.labels['x-'].connect("clicked", self.move, "X", "-")
self.labels['y+'] = KlippyGtk.ButtonImage("move-y+", _("Y+"), "color2")
self.labels['y+'] = self._gtk.ButtonImage("move-y+", _("Y+"), "color2")
self.labels['y+'].connect("clicked", self.move, "Y", "+")
self.labels['y-'] = KlippyGtk.ButtonImage("move-y-", _("Y-"), "color2")
self.labels['y-'] = self._gtk.ButtonImage("move-y-", _("Y-"), "color2")
self.labels['y-'].connect("clicked", self.move, "Y", "-")
self.labels['z+'] = KlippyGtk.ButtonImage("move-z-", _("Z+"), "color3")
self.labels['z+'] = self._gtk.ButtonImage("move-z-", _("Z+"), "color3")
self.labels['z+'].connect("clicked", self.move, "Z", "+")
self.labels['z-'] = KlippyGtk.ButtonImage("move-z+", _("Z-"), "color3")
self.labels['z-'] = self._gtk.ButtonImage("move-z+", _("Z-"), "color3")
self.labels['z-'].connect("clicked", self.move, "Z", "-")
self.labels['home'] = KlippyGtk.ButtonImage("home", _("Home All"))
self.labels['home'] = self._gtk.ButtonImage("home", _("Home All"))
self.labels['home'].connect("clicked", self.home)
grid.attach(self.labels['x+'], 2, 1, 1, 1)
grid.attach(self.labels['x-'], 0, 1, 1, 1)
if self._screen.lang_ltr:
grid.attach(self.labels['x+'], 2, 1, 1, 1)
grid.attach(self.labels['x-'], 0, 1, 1, 1)
else:
grid.attach(self.labels['x+'], 0, 1, 1, 1)
grid.attach(self.labels['x-'], 2, 1, 1, 1)
grid.attach(self.labels['y+'], 1, 0, 1, 1)
grid.attach(self.labels['y-'], 1, 1, 1, 1)
grid.attach(self.labels['z+'], 3, 0, 1, 1)
@@ -54,12 +56,13 @@ class MovePanel(ScreenPanel):
distgrid = Gtk.Grid()
j = 0;
for i in self.distances:
self.labels[i] = KlippyGtk.ToggleButton(i)
self.labels[i] = self._gtk.ToggleButton(i)
self.labels[i].set_direction(Gtk.TextDirection.LTR)
self.labels[i].connect("clicked", self.change_distance, i)
ctx = self.labels[i].get_style_context()
if j == 0:
if (self._screen.lang_ltr and j == 0) or (not self._screen.lang_ltr and j == len(self.distances)-1):
ctx.add_class("distbutton_top")
elif j == len(self.distances)-1:
elif (not self._screen.lang_ltr and j == 0) or (self._screen.lang_ltr and j == len(self.distances)-1):
ctx.add_class("distbutton_bottom")
else:
ctx.add_class("distbutton")
@@ -70,25 +73,22 @@ class MovePanel(ScreenPanel):
self.labels["1"].set_active(True)
#space_grid = KlippyGtk.HomogeneousGrid()
#space_grid = self._gtk.HomogeneousGrid()
#space_grid.attach(Gtk.Label("Distance (mm):"),0,0,1,1)
#space_grid.attach(distgrid,0,1,1,1)
#space_grid.attach(Gtk.Label(" "),0,2,1,1)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
bottomgrid = KlippyGtk.HomogeneousGrid()
bottomgrid = self._gtk.HomogeneousGrid()
bottomgrid.set_direction(Gtk.TextDirection.LTR)
self.labels['pos_x'] = Gtk.Label("X: 0")
self.labels['pos_y'] = Gtk.Label("Y: 0")
self.labels['pos_z'] = Gtk.Label("Z: 0")
self.labels['pos_x'].get_style_context().add_class("text")
self.labels['pos_y'].get_style_context().add_class("text")
self.labels['pos_z'].get_style_context().add_class("text")
bottomgrid.attach(self.labels['pos_x'], 0, 0, 1, 1)
bottomgrid.attach(self.labels['pos_y'], 1, 0, 1, 1)
bottomgrid.attach(self.labels['pos_z'], 2, 0, 1, 1)
box.pack_start(bottomgrid, True, True, 0)
self.labels['move_dist'] = Gtk.Label(_("Move Distance (mm)"))
self.labels['move_dist'].get_style_context().add_class("text")
box.pack_start(self.labels['move_dist'], True, True, 0)
box.pack_start(distgrid, True, True, 0)
@@ -123,6 +123,9 @@ class MovePanel(ScreenPanel):
self.labels[str(i)].set_active(False)
def move(self, widget, axis, dir):
if self._config.get_config()['main'].getboolean("invert_%s" % axis.lower(), False):
dir = "-" if dir == "+" else "+"
dist = str(self.distance) if dir == "+" else "-" + str(self.distance)
logging.info("# Moving " + axis + " " + dist + "mm")
+143 -9
View File
@@ -1,11 +1,11 @@
import gi
import logging
import os
import re
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.NetworkPanel")
@@ -14,9 +14,13 @@ def create_panel(*args):
return NetworkPanel(*args)
class NetworkPanel(ScreenPanel):
networks = {}
network_list = []
interface = "wlan0"
def initialize(self, menu):
_ = self.lang.gettext
grid = KlippyGtk.HomogeneousGrid()
grid = self._gtk.HomogeneousGrid()
grid.set_hexpand(True)
# Get Hostname
@@ -26,12 +30,142 @@ class NetworkPanel(ScreenPanel):
stream = os.popen('hostname -I')
ip = stream.read()
self.labels['networks'] = {}
self.labels['interface'] = Gtk.Label()
self.labels['interface'].set_text(" %s: %s" % (_("Interface"), self.interface))
self.labels['disconnect'] = self._gtk.Button(_("Disconnect"), "color2")
self.labels['networkinfo'] = Gtk.Label(
_("Network Info") + "\n\n%s%s" % (hostname, ip)
)
self.labels['networkinfo'].get_style_context().add_class('temperature_entry')
grid.attach(self.labels['networkinfo'], 1, 0, 1, 1)
sbox = Gtk.Box()
sbox.set_hexpand(True)
sbox.set_vexpand(False)
sbox.add(self.labels['interface'])
#sbox.add(self.labels['disconnect'])
self.content.add(grid)
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
box.pack_start(sbox, False, False, 0)
box.pack_start(scroll, True, True, 0)
self.labels['networklist'] = Gtk.Grid()
self.files = {}
GLib.idle_add(self.load_networks)
scroll.add(self.labels['networklist'])
#self.labels['networkinfo'] = Gtk.Label(
# _("Network Info") + "\n\n%s%s" % (hostname, ip)
#)
#self.labels['networkinfo'].get_style_context().add_class('temperature_entry')
#grid.attach(self.labels['networkinfo'], 1, 0, 1, 1)
self.content.add(box)
def load_networks(self):
networks = self._screen.wifi.get_networks()
for net in networks:
self.add_network(net, False)
self.content.show_all()
def add_network(self, essid, show=True):
_ = self.lang.gettext
netinfo = self._screen.wifi.get_network_info(essid)
if netinfo == None:
return
# For now, only add connected network
if "connected" not in netinfo:
return
frame = Gtk.Frame()
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (essid))
name.set_hexpand(True)
name.set_halign(Gtk.Align.START)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
stream = os.popen('ip add show dev %s' % self.interface)
content = stream.read()
ipv4_re = re.compile(r'inet ([0-9\.]+)/[0-9]+', re.MULTILINE)
ipv6_re = re.compile(r'inet6 ([a-fA-F0-9:\.]+)/[0-9+]', re.MULTILINE)
match = ipv4_re.search(content)
ipv4 = ""
if match:
ipv4 = "<b>%s:</b> %s " % (_("IPv4"), match.group(1))
match = ipv6_re.search(content)
ipv6 = ""
if match:
ipv6 = "<b>%s:</b> %s " % (_("IPv6"), match.group(1))
stream = os.popen('hostname -f')
hostname = stream.read().strip()
connected = ""
if "connected" in netinfo:
connected = "<b>%s</b>\n<b>%s:</b> %s\n%s%s\n" % (_("Connected"),_("Hostname"),hostname, ipv4, ipv6)
elif "psk" in netinfo:
connected = "Password saved."
freq = "2.4 GHz" if netinfo['frequency'][0:1] == "2" else "5 Ghz"
info = Gtk.Label()
info.set_markup("%s%s <small>%s %s %s %s%s</small>" % ( connected,
"" if netinfo['encryption'] == "off" else netinfo['encryption'].upper(),
freq, _("Channel"), netinfo['channel'], netinfo['signal_level_dBm'], _("dBm")
))
info.set_halign(Gtk.Align.START)
#info.set_markup(self.get_file_info_str(essid))
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
labels.add(info)
labels.set_vexpand(True)
labels.set_valign(Gtk.Align.CENTER)
labels.set_halign(Gtk.Align.START)
actions = self._gtk.ButtonImage("print",None,"color3")
#actions.connect("clicked", self.confirm_print, essid)
actions.set_hexpand(False)
actions.set_halign(Gtk.Align.END)
network = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
network.set_hexpand(True)
network.set_vexpand(False)
network.add(labels)
if not "connected" in netinfo:
network.add(actions)
self.networks[essid] = frame
frame.add(network)
reverse = False
nets = sorted(self.networks, reverse=reverse)
pos = nets.index(essid)
if "connected" in netinfo:
pos = 0
elif self._screen.wifi.is_connected():
pos += 1
self.labels['networks'][essid] = {
"info": info,
"name": name,
"row": network
}
self.labels['networklist'].insert_row(pos)
self.labels['networklist'].attach(self.networks[essid], 0, pos, 1, 1)
if show == True:
self.labels['networklist'].show_all()
+5 -9
View File
@@ -4,7 +4,6 @@ import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
@@ -39,14 +38,16 @@ class PowerPanel(ScreenPanel):
self._screen.add_subscription(panel_name)
def add_device(self, device):
frame = Gtk.Frame()
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (device))
name.set_hexpand(True)
name.set_vexpand(True)
name.set_halign(Gtk.Align.START)
name.set_valign(Gtk.Align.CENTER)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
@@ -54,20 +55,15 @@ class PowerPanel(ScreenPanel):
switch.set_hexpand(False)
switch.set_active(True if self._screen.printer.get_power_device_status(device) == "on" else False)
switch.connect("notify::active", self.on_switch, device)
switch.set_property("width-request", 150)
switch.set_property("height-request", 80)
switch.set_property("width-request", round(self._gtk.get_image_width()*2.5))
switch.set_property("height-request", round(self._gtk.get_image_height()*1.25))
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_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)
dev.add(switch)
frame.add(dev)
+17 -16
View File
@@ -4,7 +4,6 @@ import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.PreheatPanel")
@@ -20,30 +19,31 @@ class PreheatPanel(ScreenPanel):
self.preheat_options = self._screen._config.get_preheat_options()
logger.debug("Preheat options: %s" % self.preheat_options)
grid = KlippyGtk.HomogeneousGrid()
grid = self._gtk.HomogeneousGrid()
eq_grid = KlippyGtk.HomogeneousGrid()
eq_grid = self._gtk.HomogeneousGrid()
i = 0
for x in self._printer.get_tools():
if i > 3:
break
elif i == 0:
primary_tool = x
self.labels[x] = KlippyGtk.ToggleButtonImage("extruder-"+str(i+1), KlippyGtk.formatTemperatureString(0, 0))
self.labels[x] = self._gtk.ToggleButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0))
self.labels[x].connect('clicked', self.select_heater, x)
eq_grid.attach(self.labels[x], i%2, i/2, 1, 1)
i += 1
self.labels["heater_bed"] = KlippyGtk.ToggleButtonImage("bed", KlippyGtk.formatTemperatureString(0, 0))
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
width = 2 if i > 1 else 1
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
if self._printer.has_heated_bed():
self.labels["heater_bed"] = self._gtk.ToggleButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
width = 2 if i > 1 else 1
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
self.labels["control_grid"] = KlippyGtk.HomogeneousGrid()
self.labels["control_grid"] = self._gtk.HomogeneousGrid()
i = 0
for option in self.preheat_options:
self.labels[option] = KlippyGtk.Button(option, "color%d" % ((i%4)+1))
self.labels[option] = self._gtk.Button(option, "color%d" % ((i%4)+1))
self.labels[option].connect("clicked", self.set_temperature, option)
self.labels['control_grid'].attach(
self.labels[option],
@@ -51,7 +51,7 @@ class PreheatPanel(ScreenPanel):
i += 1
cooldown = KlippyGtk.ButtonImage('cool-down', _('Cooldown'))
cooldown = self._gtk.ButtonImage('cool-down', _('Cooldown'))
cooldown.connect("clicked", self.set_temperature, "cooldown")
row = int(i/2) if i%2 == 0 else int(i/2)+1
@@ -70,7 +70,7 @@ class PreheatPanel(ScreenPanel):
if x not in self.active_heaters:
self.select_heater(None, x)
if "heater_bed" not in self.active_heaters:
if self._printer.has_heated_bed() and "heater_bed" not in self.active_heaters:
self.select_heater(None, "heater_bed")
def select_heater(self, widget, heater):
@@ -109,10 +109,11 @@ class PreheatPanel(ScreenPanel):
if action != "notify_status_update":
return
self.update_temp("heater_bed",
self._printer.get_dev_stat("heater_bed","temperature"),
self._printer.get_dev_stat("heater_bed","target")
)
if self._printer.has_heated_bed():
self.update_temp("heater_bed",
self._printer.get_dev_stat("heater_bed","temperature"),
self._printer.get_dev_stat("heater_bed","target")
)
for x in self._printer.get_tools():
self.update_temp(x,
self._printer.get_dev_stat(x,"temperature"),
+64 -36
View File
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
import gi
import humanize
import logging
@@ -6,7 +7,6 @@ gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
from datetime import datetime
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
@@ -17,46 +17,70 @@ def create_panel(*args):
class PrintPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
self.labels['files'] = {}
self.sort_items = {
"name": _("Name"),
"date": _("Date")
}
self.sort_char = ["↑","↓"]
sortdir = self._config.get_main_config_option("print_sort_dir","name_asc")
sortdir = sortdir.split('_')
if sortdir[0] not in ["name","date"] or sortdir[1] not in ["asc","desc"]:
sortdir = ["name","asc"]
self.sort_current = [sortdir[0], 0 if sortdir[1] == "asc" else 1] # 0 for asc, 1 for desc
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
sort = Gtk.Label()
sort.set_text(_("Sort by: "))
sbox = Gtk.Box(spacing=0)
sbox.set_vexpand(False)
sbox.add(sort)
i = 1
for name, val in self.sort_items.items():
s = self._gtk.Button(val, "color%s" % (i%4))
s.set_label(val)
if name == sortdir[0]:
s.set_label("%s %s" % (s.get_label(), self.sort_char[self.sort_current[1]]))
s.connect("clicked", self.change_sort, name)
self.labels['sort_%s' % name] = s
sbox.add(s)
i += 1
sbox.set_hexpand(True)
sbox.set_vexpand(False)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
box.pack_start(sbox, False, False, 0)
box.pack_start(scroll, True, True, 0)
refresh = KlippyGtk.ButtonImage('refresh', None, None, 60, 60)
refresh.connect("clicked", self.reload_files)
#bar.add(refresh)
self.labels['filelist'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['filelist'].set_vexpand(True)
#self.labels['filelist'] = Gtk.Grid(orientation=Gtk.Orientation.VERTICAL)
#self.labels['filelist'].set_vexpand(True)
self.labels['filelist'] = Gtk.Grid()
self.files = {}
self.reload_files()
GLib.idle_add(self.reload_files)
scroll.add(self.labels['filelist'])
self.content.add(box)
self._screen.files.add_file_callback(self._callback)
return
def add_file(self, filename):
def add_file(self, filename, show=True):
fileinfo = self._screen.files.get_file_info(filename)
if fileinfo == None:
return
frame = Gtk.Frame()
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
@@ -78,20 +102,16 @@ class PrintPanel(ScreenPanel):
labels.set_valign(Gtk.Align.CENTER)
labels.set_halign(Gtk.Align.START)
actions = KlippyGtk.ButtonImage("print",None,"color3")
actions = self._gtk.ButtonImage("print",None,"color3")
actions.connect("clicked", self.confirm_print, filename)
actions.set_hexpand(False)
actions.set_halign(Gtk.Align.END)
file = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
file.set_margin_top(1)
file.set_margin_end(15)
file.set_margin_start(15)
file.set_margin_bottom(1)
file.set_hexpand(True)
file.set_vexpand(False)
icon = KlippyGtk.Image("file", False, 100, 100)
icon = self._gtk.Image("file.svg", False, 1.6, 1.6)
pixbuf = self.get_file_image(filename)
if pixbuf != None:
icon.set_from_pixbuf(pixbuf)
@@ -102,7 +122,13 @@ class PrintPanel(ScreenPanel):
frame.add(file)
self.files[filename] = frame
files = sorted(self.files)
reverse = False if self.sort_current[1] == 0 else True
if self.sort_current[0] == "date":
files = sorted(self.files, reverse=reverse,
key=lambda item: self._screen.files.get_file_info(item)['modified'])
else:
files = sorted(self.files, reverse=reverse)
pos = files.index(filename)
self.labels['files'][filename] = {
@@ -113,19 +139,22 @@ class PrintPanel(ScreenPanel):
self.labels['filelist'].insert_row(pos)
self.labels['filelist'].attach(self.files[filename], 0, pos, 1, 1)
self.labels['filelist'].show_all()
if show == True:
self.labels['filelist'].show_all()
def get_file_image(self, filename, width=100, height=100):
fileinfo = self._screen.files.get_file_info(filename)
if fileinfo == None:
return None
if "thumbnails" in fileinfo and len(fileinfo["thumbnails"]) > 0:
thumbnail = fileinfo['thumbnails'][0]
return KlippyGtk.PixbufFromFile("/tmp/.KS-thumbnails/%s-%s" % (fileinfo['filename'], thumbnail['size']),
None, width, height)
return None
def change_sort(self, widget, key):
if self.sort_current[0] == key:
self.sort_current[1] = (self.sort_current[1] + 1) % 2
else:
oldkey = self.sort_current[0]
logger.info("Changing %s to %s" % ('sort_%s' % oldkey, self.sort_items[self.sort_current[0]]))
self.labels['sort_%s' % oldkey].set_label("%s" % self.sort_items[oldkey])
self.labels['sort_%s' % oldkey].show_all()
self.sort_current = [key, 0]
self.labels['sort_%s' % key].set_label("%s %s" % (self.sort_items[key], self.sort_char[self.sort_current[1]]))
self.labels['sort_%s' % key].show()
GLib.idle_add(self.reload_files)
def get_file_info_str(self, filename):
_ = self.lang.gettext
@@ -192,8 +221,9 @@ class PrintPanel(ScreenPanel):
self.labels['filelist'].show_all()
for file in self._screen.files.get_file_list():
#TODO: Change priority on this
GLib.idle_add(self.add_file, file)
self.add_file(file, False)
self.labels['filelist'].show_all()
def _callback(self, newfiles, deletedfiles, updatedfiles=[]):
logger.debug("newfiles: %s", newfiles)
@@ -219,16 +249,14 @@ class PrintPanel(ScreenPanel):
label.set_halign(Gtk.Align.CENTER)
label.set_line_wrap(True)
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
label.get_style_context().add_class("text")
grid = Gtk.Grid()
grid.add(label)
grid.set_size_request(self._screen.width - 60, -1)
pixbuf = self.get_file_image(filename, self._screen.width/2, self._screen.height/3)
pixbuf = self.get_file_image(filename, 8, 3.2)
if pixbuf != None:
image = Gtk.Image.new_from_pixbuf(pixbuf)
image.set_margin_top(20)
grid.attach_next_to(image, label, Gtk.PositionType.BOTTOM, 1, 3)
#table.attach(label, 0, 1, 0, 1, Gtk.AttachOptions.SHRINK | Gtk.AttachOptions.FILL)
@@ -236,7 +264,7 @@ class PrintPanel(ScreenPanel):
grid.set_halign(Gtk.Align.CENTER)
grid.set_valign(Gtk.Align.CENTER)
dialog = KlippyGtk.Dialog(self._screen, buttons, grid, self.confirm_print_response, filename)
dialog = self._gtk.Dialog(self._screen, buttons, grid, self.confirm_print_response, filename)
def confirm_print_response(self, widget, response_id, filename):
widget.destroy()
+210
View File
@@ -0,0 +1,210 @@
import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.Settings")
def create_panel(*args):
return SettingsPanel(*args)
class SettingsPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
self.settings = {}
self.macros = {}
self.menu_cur = 'main_box'
self.menu = ['main_box']
self.labels['main_box'] = self.create_box('main')
self.labels['macros_box'] = self.create_box('macros')
options = self._config.get_configurable_options().copy()
options.append({"macros": {
"name": _("Displayed Macros"),
"type": "menu",
"menu": "macros"}
})
for option in options:
name = list(option)[0]
self.add_option('main', self.settings, name, option[name])
for macro in self._printer.get_config_section_list("gcode_macro "):
macro = macro[12:]
self.macros[macro] = {
"name": macro,
"section": "displayed_macros",
"type": "macro"
}
for macro in list(self.macros):
self.add_option('macros', self.macros, macro, self.macros[macro])
logger.debug("Macros: %s" % self.macros)
self.control['back'].disconnect_by_func(self._screen._menu_go_back)
self.control['back'].connect("clicked", self.back)
self.content.add(self.labels['main_box'])
def activate(self):
while len(self.menu) > 1:
self.unload_menu()
def back(self, widget):
if len(self.menu) > 1:
self.unload_menu()
else:
self._screen._menu_go_back()
def create_box(self, name):
# Create a scroll window for the macros
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
# Create a grid for all macros
self.labels[name] = Gtk.Grid()
scroll.add(self.labels[name])
# Create a box to contain all of the above
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
box.pack_start(scroll, True, True, 0)
return box
def add_option(self, boxname, opt_array, opt_name, option):
frame = Gtk.Frame()
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (option['name']))
name.set_hexpand(True)
name.set_vexpand(True)
name.set_halign(Gtk.Align.START)
name.set_valign(Gtk.Align.CENTER)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
#open = self._gtk.ButtonImage("open",None,"color3")
#open.connect("clicked", self.run_gcode_macro, macro)
#open.set_hexpand(False)
#open.set_halign(Gtk.Align.END)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev.set_valign(Gtk.Align.CENTER)
dev.add(labels)
if option['type'] == "binary" or option['type'] == "macro":
box = Gtk.Box()
box.set_vexpand(False)
switch = Gtk.Switch()
switch.set_hexpand(False)
switch.set_vexpand(False)
if option['type'] == "macro":
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name, fallback=True))
else:
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name))
switch.connect("notify::active", self.switch_config_option, option['section'], opt_name)
switch.set_property("width-request", round(self._gtk.get_image_width()*2.5))
switch.set_property("height-request", round(self._gtk.get_image_height()*1.25))
box.add(switch)
dev.add(box)
elif option['type'] == "dropdown":
dropdown = Gtk.ComboBoxText()
i = 0
for opt in option['options']:
dropdown.append(opt['value'], opt['name'])
if opt['value'] == self._config.get_config()[option['section']].get(opt_name, option['value']):
dropdown.set_active(i)
i += 1
dropdown.connect("changed", self.on_dropdown_change, option['section'], opt_name,
option['callback'] if "callback" in option else None)
#dropdown.props.relief = Gtk.ReliefStyle.NONE
dropdown.set_entry_text_column(0)
dev.add(dropdown)
logger.debug("Children: %s" % dropdown.get_children())
elif option['type'] == "menu":
open = self._gtk.ButtonImage("open",None,"color3")
open.connect("clicked", self.load_menu, option['menu'])
open.set_hexpand(False)
open.set_halign(Gtk.Align.END)
dev.add(open)
frame.add(dev)
frame.show_all()
opt_array[opt_name] = {
"name": option['name'],
"row": frame
}
opts = sorted(opt_array)
opts = sorted(list(opt_array), key=lambda x: opt_array[x]['name'])
pos = opts.index(opt_name)
self.labels[boxname].insert_row(pos)
self.labels[boxname].attach(opt_array[opt_name]['row'], 0, pos, 1, 1)
self.labels[boxname].show_all()
def load_menu(self, widget, name):
if ("%s_box" % name) not in self.labels:
return
for child in self.content.get_children():
self.content.remove(child)
self.menu.append('%s_box' % name)
self.content.add(self.labels[self.menu[-1]])
self.content.show_all()
def unload_menu(self, widget=None):
logger.debug("self.menu: %s" % self.menu)
if len(self.menu) <= 1 or self.menu[-2] not in self.labels:
return
self.menu.pop()
for child in self.content.get_children():
self.content.remove(child)
self.content.add(self.labels[self.menu[-1]])
self.content.show_all()
def on_dropdown_change(self, combo, section, option, callback=None):
tree_iter = combo.get_active_iter()
if tree_iter is not None:
model = combo.get_model()
value = model[tree_iter][1]
logger.debug("[%s] %s changed to %s" % (section, option, value))
self._config.set(section, option, value)
self._config.save_user_config_options()
if callback is not None:
callback(value)
def switch_config_option(self, switch, gparam, section, option):
logger.debug("[%s] %s toggled %s" % (section, option, switch.get_active()))
if section not in self._config.get_config().sections():
self._config.get_config().add_section(section)
self._config.set(section, option, "True" if switch.get_active() else "False")
self._config.save_user_config_options()
def add_gcode_option(self):
macros = self._screen.printer.get_gcode_macros()
for x in macros:
self.add_gcode_macro("macros", self.macros, x, {
"name": x[12:],
"type": binary
})
def run_gcode_macro(self, widget, macro):
self._screen._ws.klippy.gcode_script(macro)
+10 -10
View File
@@ -5,7 +5,6 @@ import os
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.SplashScreenPanel")
@@ -19,12 +18,9 @@ class SplashScreenPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
image = Gtk.Image()
#TODO: update file reference
image.set_from_file(os.getcwd() + "/styles/z-bolt/images/klipper.png")
image = self._gtk.Image("klipper.png", None, 4, 3)
self.labels['text'] = Gtk.Label(_("Initializing printer..."))
self.labels['text'].get_style_context().add_class("text")
self.labels['text'].set_line_wrap(True)
self.labels['text'].set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
self.labels['text'].set_halign(Gtk.Align.CENTER)
@@ -60,24 +56,28 @@ class SplashScreenPanel(ScreenPanel):
_ = self.lang.gettext
if "firmware_restart" not in self.labels:
self.labels['power'] = KlippyGtk.ButtonImage("reboot",_("Power On Printer"),"color3")
self.labels['restart'] = KlippyGtk.ButtonImage("reboot",_("Restart"),"color1")
self.labels['menu'] = self._gtk.ButtonImage("control",_("Menu"),"color4")
self.labels['menu'].connect("clicked", self._screen._go_to_submenu, "")
self.labels['power'] = self._gtk.ButtonImage("reboot",_("Power On Printer"),"color3")
self.labels['restart'] = self._gtk.ButtonImage("reboot",_("Restart"),"color1")
self.labels['restart'].connect("clicked", self.restart)
self.labels['firmware_restart'] = KlippyGtk.ButtonImage("restart",_("Firmware Restart"),"color2")
self.labels['firmware_restart'] = self._gtk.ButtonImage("restart",_("Firmware Restart"),"color2")
self.labels['firmware_restart'].connect("clicked", self.firmware_restart)
self.clear_action_bar()
devices = [i for i in self._screen.printer.get_power_devices() if i.lower().startswith('printer')]
devices = [i for i in self._printer.get_power_devices() if i.lower().startswith('printer')] if (
self._printer is not None) else []
logger.debug("Power devices: %s" % devices)
if len(devices) > 0:
logger.debug("Adding power button")
self.labels['power'].connect("clicked", self.power_on, devices[0])
self.labels['actions'].add(self.labels['power'])
self.labels['actions'].add(self.labels['power'])
self.labels['actions'].add(self.labels['restart'])
self.labels['actions'].add(self.labels['firmware_restart'])
self.labels['actions'].add(self.labels['menu'])
self.labels['actions'].show()
def firmware_restart(self, widget):
self._screen._ws.klippy.restart_firmware()
+13 -5
View File
@@ -5,7 +5,6 @@ import os
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
@@ -18,13 +17,20 @@ class SystemPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
grid = KlippyGtk.HomogeneousGrid()
grid = self._gtk.HomogeneousGrid()
restart = KlippyGtk.ButtonImage('reboot',_('Klipper Restart'),'color1')
restart = self._gtk.ButtonImage('reboot',"\n".join(_('Klipper Restart').split(' ')),'color1')
restart.connect("clicked", self.restart_klippy)
firmrestart = KlippyGtk.ButtonImage('restart',_('Firmware Restart'),'color2')
firmrestart = self._gtk.ButtonImage('restart',"\n".join(_('Firmware Restart').split(' ')),'color2')
firmrestart.connect("clicked", self.restart_klippy, "firmware")
reboot = self._gtk.ButtonImage('reboot',_('System\nRestart'),'color3')
reboot.connect("clicked", self._screen._confirm_send_action,
_("Are you sure you wish to reboot the system?"), "machine.reboot")
shutdown = self._gtk.ButtonImage('shutdown',_('System\nShutdown'),'color4')
shutdown.connect("clicked", self._screen._confirm_send_action,
_("Are you sure you wish to shutdown the system?"), "machine.shutdown")
info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
info.set_vexpand(True)
@@ -45,9 +51,11 @@ class SystemPanel(ScreenPanel):
info.add(self.labels['ks_version'])
grid.attach(info, 0, 0, 4, 2)
grid.attach(info, 0, 0, 5, 2)
grid.attach(restart, 0, 2, 1, 1)
grid.attach(firmrestart, 1, 2, 1, 1)
grid.attach(reboot, 3, 2, 1, 1)
grid.attach(shutdown, 4, 2, 1, 1)
self.content.add(grid)
+25 -26
View File
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
@@ -21,16 +21,16 @@ class TemperaturePanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
grid = KlippyGtk.HomogeneousGrid()
grid = self._gtk.HomogeneousGrid()
eq_grid = KlippyGtk.HomogeneousGrid()
eq_grid = self._gtk.HomogeneousGrid()
i = 0
for x in self._printer.get_tools():
if i > 3:
break
elif i == 0:
primary_tool = x
self.labels[x] = KlippyGtk.ToggleButtonImage("extruder-"+str(i+1), KlippyGtk.formatTemperatureString(0, 0))
self.labels[x] = self._gtk.ToggleButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0))
self.labels[x].connect('clicked', self.select_heater, x)
if i == 0:
self.labels[x].set_active(True)
@@ -40,24 +40,25 @@ class TemperaturePanel(ScreenPanel):
print ("Primary tool: " + primary_tool)
self.labels[primary_tool].get_style_context().add_class('button_active')
self.labels["heater_bed"] = KlippyGtk.ToggleButtonImage("bed", KlippyGtk.formatTemperatureString(0, 0))
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
width = 2 if i > 1 else 1
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
if self._printer.has_heated_bed():
self.labels["heater_bed"] = self._gtk.ToggleButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
width = 2 if i > 1 else 1
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
self.labels["control_grid"] = KlippyGtk.HomogeneousGrid()
self.labels["control_grid"] = self._gtk.HomogeneousGrid()
self.labels["increase"] = KlippyGtk.ButtonImage("increase", _("Increase"), "color1")
self.labels["increase"] = self._gtk.ButtonImage("increase", _("Increase"), "color1")
self.labels["increase"].connect("clicked",self.change_target_temp, "+")
self.labels["decrease"] = KlippyGtk.ButtonImage("decrease", _("Decrease"), "color3")
self.labels["decrease"] = self._gtk.ButtonImage("decrease", _("Decrease"), "color3")
self.labels["decrease"].connect("clicked",self.change_target_temp, "-")
self.labels["npad"] = KlippyGtk.ButtonImage("settings", _("Number Pad"), "color2")
self.labels["npad"] = self._gtk.ButtonImage("settings", _("Number Pad"), "color2")
self.labels["npad"].connect("clicked", self.show_numpad)
tempgrid = Gtk.Grid()
j = 0;
for i in self.tempdeltas:
self.labels['deg'+ i] = KlippyGtk.ToggleButton(i)
self.labels['deg'+ i] = self._gtk.ToggleButton(i)
self.labels['deg'+ i].connect("clicked", self.change_temp_delta, i)
ctx = self.labels['deg'+ i].get_style_context()
if j == 0:
@@ -111,7 +112,8 @@ class TemperaturePanel(ScreenPanel):
def show_numpad(self, widget):
_ = self.lang.gettext
numpad = KlippyGtk.HomogeneousGrid()
numpad = self._gtk.HomogeneousGrid()
numpad.set_direction(Gtk.TextDirection.LTR)
keys = [
['1','numpad_tleft'],
@@ -130,9 +132,9 @@ class TemperaturePanel(ScreenPanel):
for i in range(len(keys)):
id = 'button_' + str(keys[i][0])
if keys[i][0] == "B":
self.labels[id] = KlippyGtk.ButtonImage("backspace")
self.labels[id] = Gtk.Button("B") #self._gtk.ButtonImage("backspace")
elif keys[i][0] == "E":
self.labels[id] = KlippyGtk.ButtonImage("complete", None, None, 40, 40)
self.labels[id] = Gtk.Button("E") #self._gtk.ButtonImage("complete", None, None, .675, .675)
else:
self.labels[id] = Gtk.Button(keys[i][0])
self.labels[id].connect('clicked', self.update_entry, keys[i][0])
@@ -140,17 +142,14 @@ class TemperaturePanel(ScreenPanel):
ctx.add_class(keys[i][1])
numpad.attach(self.labels[id], i%3, i/3, 1, 1)
self.labels["keypad"] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=3)
self.labels["keypad"] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['entry'] = Gtk.Entry()
self.labels['entry'].props.xalign = 0.5
ctx = self.labels['entry'].get_style_context()
ctx.add_class('temperature_entry')
b = KlippyGtk.ButtonImage('back', _('Close'))
b = self._gtk.ButtonImage('back', _('Close'))
b.connect("clicked", self.hide_numpad)
#numpad.attach(b, 0, 5, 3, 1)
#numpad.attach(self.labels['entry'], 0, 0, 3, 1)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.add(self.labels['entry'])
box.add(numpad)
@@ -159,7 +158,6 @@ class TemperaturePanel(ScreenPanel):
self.labels["keypad"] = numpad
self.grid.remove_column(1)
#self.grid.attach(self.labels["keypad"], 1, 0, 1, 1)
self.grid.attach(box, 1, 0, 1, 1)
self.grid.show_all()
@@ -186,10 +184,11 @@ class TemperaturePanel(ScreenPanel):
if action != "notify_status_update":
return
self.update_temp("heater_bed",
self._printer.get_dev_stat("heater_bed","temperature"),
self._printer.get_dev_stat("heater_bed","target")
)
if self._printer.has_heated_bed():
self.update_temp("heater_bed",
self._printer.get_dev_stat("heater_bed","temperature"),
self._printer.get_dev_stat("heater_bed","target")
)
for x in self._printer.get_tools():
self.update_temp(x,
self._printer.get_dev_stat(x,"temperature"),
+13 -14
View File
@@ -3,7 +3,6 @@ import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
@@ -24,7 +23,7 @@ class ZCalibratePanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
grid = KlippyGtk.HomogeneousGrid()
grid = self._gtk.HomogeneousGrid()
label = Gtk.Label(_("Z Offset") + ": \n")
self.labels['zposition'] = Gtk.Label(_("Homing"))
@@ -35,20 +34,21 @@ class ZCalibratePanel(ScreenPanel):
box.add(label)
box.add(self.labels['zposition'])
zpos = KlippyGtk.ButtonImage('z-offset-decrease',_("Raise Nozzle"))
zpos = self._gtk.ButtonImage('z-offset-decrease',_("Raise Nozzle"))
zpos.connect("clicked", self.move, "+")
zneg = KlippyGtk.ButtonImage('z-offset-increase',_("Lower Nozzle"))
zneg = self._gtk.ButtonImage('z-offset-increase',_("Lower Nozzle"))
zneg.connect("clicked", self.move, "-")
distgrid = Gtk.Grid()
j = 0;
for i in self.distances:
self.labels[i] = KlippyGtk.ToggleButton(i)
self.labels[i] = self._gtk.ToggleButton(i)
self.labels[i].set_direction(Gtk.TextDirection.LTR)
self.labels[i].connect("clicked", self.change_distance, i)
ctx = self.labels[i].get_style_context()
if j == 0:
if (self._screen.lang_ltr and j == 0) or (not self._screen.lang_ltr and j == len(self.distances)-1):
ctx.add_class("distbutton_top")
elif j == len(self.distances)-1:
elif (not self._screen.lang_ltr and j == 0) or (self._screen.lang_ltr and j == len(self.distances)-1):
ctx.add_class("distbutton_bottom")
else:
ctx.add_class("distbutton")
@@ -59,16 +59,16 @@ class ZCalibratePanel(ScreenPanel):
self.labels["1"].set_active(True)
space_grid = KlippyGtk.HomogeneousGrid()
space_grid = self._gtk.HomogeneousGrid()
space_grid.set_row_homogeneous(False)
space_grid.attach(Gtk.Label(_("Distance (mm)") + ":"),0,0,1,1)
space_grid.attach(distgrid,0,1,1,1)
space_grid.attach(Gtk.Label(" "),0,2,1,1)
complete = KlippyGtk.ButtonImage('complete',_('Accept'),'color2')
complete = self._gtk.ButtonImage('complete',_('Accept'),'color2')
complete.connect("clicked", self.accept)
b = KlippyGtk.ButtonImage('back', _('Abort'))
b = self._gtk.ButtonImage('back', _('Abort'))
b.connect("clicked", self.abort)
@@ -85,10 +85,9 @@ class ZCalibratePanel(ScreenPanel):
self._screen.add_subscription(panel_name)
def activate(self):
#if self._screen.printer.get_stat("toolhead","homed_axes") != "xyz":
# self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
#self._screen._ws.klippy.gcode_script(KlippyGcodes.PROBE_CALIBRATE)
print("nothing")
if self._screen.printer.get_stat("toolhead","homed_axes") != "xyz":
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
self._screen._ws.klippy.gcode_script(KlippyGcodes.PROBE_CALIBRATE)
def process_update(self, action, data):
if action != "notify_status_update":
+360 -142
View File
@@ -1,5 +1,6 @@
#!/usr/bin/python
import argparse
import gi
import gettext
import time
@@ -12,21 +13,44 @@ import importlib
import logging
import os
import re
import signal
import subprocess
import sys
import traceback
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
from jinja2 import Environment, Template
from ks_includes.KlippyWebsocket import KlippyWebsocket
from ks_includes.KlippyRest import KlippyRest
from ks_includes.files import KlippyFiles
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.printer import Printer
from ks_includes.wifi import WifiManager
from ks_includes.config import KlipperScreenConfig
PRINTER_BASE_STATUS_OBJECTS = [
'bed_mesh',
'idle_timeout',
'configfile',
'gcode_move',
'fan',
'toolhead',
'virtual_sdcard',
'print_stats',
'heater_bed',
'extruder',
'pause_resume',
'webhooks'
]
# Create logging
for h in logging.getLogger().handlers:
logging.getLogger().removeHandler(h)
logger = logging.getLogger('KlipperScreen')
logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
@@ -35,36 +59,106 @@ fh = logging.FileHandler('/tmp/KlipperScreen.log')
fh.setLevel(logging.DEBUG)
fh.setFormatter(formatter)
ch = logging.StreamHandler()
ch.setLevel(logging.ERROR)
ch = logging.StreamHandler(sys.stdout)
ch.setLevel(logging.DEBUG)
ch.setFormatter(formatter)
logger.addHandler(fh)
logger.addHandler(ch)
def logging_exception_handler(type, value, tb):
logger.exception("Uncaught exception %s: %s\nTraceback: %s" % (type, value, "\n".join(traceback.format_tb(tb))))
sys.excepthook = logging_exception_handler
klipperscreendir = os.getcwd()
config = klipperscreendir + "/KlipperScreen.config"
logger.info("Config file: " + config)
class KlipperScreen(Gtk.Window):
""" Class for creating a screen for Klipper via HDMI """
currentPanel = None
bed_temp_label = None
number_tools = 1
panels = {}
load_panel = {}
_cur_panels = []
bed_temp_label = None
connected_printer = None
currentPanel = None
files = None
filename = ""
subscriptions = []
keyboard = None
keyboard_height = 200
last_update = {}
shutdown = True
load_panel = {}
number_tools = 1
panels = {}
popup_message = None
printer = None
rtl_languages = ['he_il']
subscriptions = []
shutdown = True
_ws = None
def __init__(self):
self._config = KlipperScreenConfig()
self.version = get_software_version()
logger.info("KlipperScreen version: %s" % self.version)
parser = argparse.ArgumentParser(description="KlipperScreen - A GUI for Klipper")
parser.add_argument(
"-c","--configfile", default="~/KlipperScreen.conf", metavar='<configfile>',
help="Location of KlipperScreen configuration file"
)
args = parser.parse_args()
configfile = os.path.normpath(os.path.expanduser(args.configfile))
self.lang = gettext.translation('KlipperScreen', localedir='ks_includes/locales', fallback=True)
self._config = KlipperScreenConfig(configfile, self.lang, self)
self.wifi = WifiManager()
self.wifi.start()
logger.debug("OS Language: %s" % os.getenv('LANG'))
self.lang_ltr = True
for lang in self.rtl_languages:
if os.getenv('LANG').lower().startswith(lang):
self.lang_ltr = False
Gtk.Widget.set_default_direction(Gtk.TextDirection.RTL)
logger.debug("Enabling RTL mode")
break
_ = self.lang.gettext
Gtk.Window.__init__(self)
self.width = self._config.get_main_config().getint("width", Gdk.Screen.get_width(Gdk.Screen.get_default()))
self.height = self._config.get_main_config().getint("height", Gdk.Screen.get_height(Gdk.Screen.get_default()))
self.set_default_size(self.width, self.height)
self.set_resizable(False)
logger.info("Screen resolution: %sx%s" % (self.width, self.height))
self.gtk = KlippyGtk(self.width, self.height)
self.init_style()
self.printer_initializing(_("Initializing"))
# Disable DPMS
os.system("/usr/bin/xset -display :0 -dpms")
self.set_screenblanking_timeout(self._config.get_main_config_option('screen_blanking'))
# Change cursor to blank
#self.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR))
pname = list(self._config.get_printers()[0])[0]
self.connect_printer(pname, self._config.get_printers()[0][pname])
def connect_printer(self, name, data):
_ = self.lang.gettext
if self.connected_printer == name:
return
if self.files is not None:
self.files.stop()
self.apiclient = KlippyRest(self._config.get_main_config_option("moonraker_host"),
self._config.get_main_config_option("moonraker_port"),
self._config.get_main_config_option("moonraker_api_key", False))
self.printer = Printer({
"software_version": "Unknown"
}, {
@@ -78,53 +172,67 @@ class KlipperScreen(Gtk.Window):
'is_active': False
}
})
self.lang = gettext.translation('KlipperScreen', localedir='ks_includes/locales')
_ = self.lang.gettext
self.apiclient = KlippyRest("127.0.0.1",7125)
Gtk.Window.__init__(self)
self._remove_all_panels()
panels = list(self.panels)
for panel in panels:
del self.panels[panel]
self.printer_initializing(_("Connecting to %s") % name)
self.width = Gdk.Screen.get_width(Gdk.Screen.get_default())
self.height = Gdk.Screen.get_height(Gdk.Screen.get_default())
self.set_default_size(self.width, self.height)
self.set_resizable(False)
self.version = get_software_version()
logger.info("KlipperScreen version: %s" % self.version)
logger.info("Screen resolution: %sx%s" % (self.width, self.height))
#self._load_panels()
self.printer_initializing(_("Initializing"))
self._ws = KlippyWebsocket(self, {
"on_connect": self.init_printer,
"on_message": self._websocket_callback,
"on_close": self.printer_initializing
self.printer.set_callbacks({
"disconnected": self.state_disconnected,
"error": self.state_error,
"printing": self.state_printing,
"ready": self.state_ready,
"startup": self.state_startup,
"shutdown": self.state_shutdown
})
self._ws.connect()
# Disable DPMS
os.system("/usr/bin/xset -display :0 s off")
os.system("/usr/bin/xset -display :0 -dpms")
os.system("/usr/bin/xset -display :0 s noblank")
powerdevs = self.apiclient.send_request("machine/device_power/devices")
logger.debug("Found power devices: %s" % powerdevs)
if powerdevs != False:
self.printer.configure_power_devices(powerdevs['result'])
self.panels['splash_screen'].show_restart_buttons()
return
if self._ws is not None:
self._ws.close
self._ws = KlippyWebsocket(self,
{
"on_connect": self.init_printer,
"on_message": self._websocket_callback,
"on_close": self.printer_initializing
},
self._config.get_main_config_option("moonraker_host"),
self._config.get_main_config_option("moonraker_port")
)
self._ws.initial_connect()
self.files = KlippyFiles(self)
self.files.start()
self.connected_printer = name
logger.debug("Connected to printer: %s" % name)
def ws_subscribe(self):
requested_updates = {
"objects": {
"bed_mesh": ["profile_name","mesh_max","mesh_min","probed_matrix"],
"configfile": ["config"],
"extruder": ["target","temperature","pressure_advance","smooth_time"],
"fan": ["speed"],
"gcode_move": ["homing_origin","extrude_factor","speed_factor"],
"gcode_move": ["extrude_factor","gcode_position","homing_origin","speed_factor"],
"heater_bed": ["target","temperature"],
"idle_timeout": ["state"],
"pause_resume": ["is_paused"],
"print_stats": ["print_duration","total_duration","filament_used","filename","state","message"],
"toolhead": ["homed_axes","estimated_print_time","print_time","position","extruder"],
"virtual_sdcard": ["file_position","is_active","progress"],
"webhooks": ["state","state_message"]
}
}
for extruder in self.printer.get_tools():
requested_updates['objects'][extruder] = ["target","temperature","pressure_advance","smooth_time"]
self._ws.klippy.object_subscription(requested_updates)
def _load_panel(self, panel, *args):
@@ -151,7 +259,6 @@ class KlipperScreen(Gtk.Window):
logger.exception(msg)
raise Exception(msg)
def show_panel(self, panel_name, type, title, remove=None, pop=True, **kwargs):
if panel_name not in self.panels:
self.panels[panel_name] = self._load_panel(type, self, title)
@@ -163,25 +270,79 @@ class KlipperScreen(Gtk.Window):
self.panels[panel_name].initialize(panel_name)
except:
del self.panels[panel_name]
logger.exception("Unable to load panel %s" % type)
self.show_error_modal("Unable to load panel %s" % type)
return
if hasattr(self.panels[panel_name],"process_update"):
self.panels[panel_name].process_update("notify_status_update", self.printer.get_data())
if hasattr(self.panels[panel_name],"activate"):
self.panels[panel_name].activate()
try:
if remove == 2:
self._remove_all_panels()
elif remove == 1:
self._remove_current_panel(pop)
if remove == 2:
self._remove_all_panels()
elif remove == 1:
self._remove_current_panel(pop)
logger.debug("Attaching panel %s" % panel_name)
self.add(self.panels[panel_name].get())
self.show_all()
if hasattr(self.panels[panel_name],"activate"):
self.panels[panel_name].activate()
self.show_all()
except:
logger.exception("Error attaching panel")
self.add(self.panels[panel_name].get())
self.show_all()
self._cur_panels.append(panel_name)
logger.debug("Current panel hierarchy: %s", str(self._cur_panels))
def show_popup_message(self, message):
if self.popup_message != None:
self.close_popup_message()
box = Gtk.Box()
box.get_style_context().add_class("message_popup")
box.set_size_request(self.width, self.gtk.get_header_size())
label = Gtk.Label()
if "must home axis first" in message.lower():
message = "Must home all axis first."
label.set_text(message)
close = Gtk.Button.new_with_label("X")
close.set_can_focus(False)
close.props.relief = Gtk.ReliefStyle.NONE
close.connect("clicked", self.close_popup_message)
box.pack_start(label, True, True, 0)
box.pack_end(close, False, False, 0)
box.set_halign(Gtk.Align.CENTER)
cur_panel = self.panels[self._cur_panels[-1]]
for i in ['back','estop','home']:
if i in cur_panel.control:
cur_panel.control[i].set_sensitive(False)
cur_panel.get().put(box, 0,0)
self.show_all()
self.popup_message = box
GLib.timeout_add(10000, self.close_popup_message)
return False
def close_popup_message(self, widget=None):
if self.popup_message == None:
return
cur_panel = self.panels[self._cur_panels[-1]]
for i in ['back','estop','home']:
if i in cur_panel.control:
cur_panel.control[i].set_sensitive(True)
cur_panel.get().remove(self.popup_message)
self.popup_message = None
self.show_all()
def show_error_modal(self, err):
_ = self.lang.gettext
logger.exception("Showing error modal: %s", err)
@@ -197,17 +358,23 @@ class KlipperScreen(Gtk.Window):
label.set_halign(Gtk.Align.CENTER)
label.set_line_wrap(True)
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
label.get_style_context().add_class("text")
dialog = KlippyGtk.Dialog(self, buttons, label, self.error_modal_response)
dialog = self.gtk.Dialog(self, buttons, label, self.error_modal_response)
def error_modal_response(self, widget, response_id):
widget.destroy()
def init_style(self):
style_provider = Gtk.CssProvider()
style_provider.load_from_path(klipperscreendir + "/style.css")
#style_provider.load_from_path(klipperscreendir + "/style.css")
css = open(klipperscreendir + "/styles/style.css")
css_data = css.read()
css.close()
css_data = css_data.replace("KS_FONT_SIZE",str(self.gtk.get_font_size()))
style_provider = Gtk.CssProvider()
style_provider.load_from_data(css_data.encode())
Gtk.StyleContext.add_provider_for_screen(
Gdk.Screen.get_default(),
@@ -215,14 +382,19 @@ class KlipperScreen(Gtk.Window):
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
)
def is_printing(self):
return "job_status" in self._cur_panels
def _go_to_submenu(self, widget, name):
logger.info("#### Go to submenu " + str(name))
#self._remove_current_panel(False)
# Find current menu item
panels = list(self._cur_panels)
if "job_status" not in self._cur_panels:
if "main_panel" in self._cur_panels:
menu = "__main"
elif "splash_screen" in self._cur_panels:
menu = "__splashscreen"
else:
menu = "__print"
@@ -235,18 +407,6 @@ class KlipperScreen(Gtk.Window):
self.show_panel(self._cur_panels[-1] + '_' + name, "menu", disname, 1, False, display_name=disname,
items=menuitems)
return
grid = self.arrangeMenuItems(menu, 4)
b = KlippyGtk.ButtonImage('back', 'Back')
b.connect("clicked", self._menu_go_back)
grid.attach(b, 4, 2, 1, 1)
self._cur_panels.append(cur_item['name']) #str(cur_item['name']))
self.panels[cur_item['name']] = grid
self.add(self.panels[cur_item['name']])
self.show_all()
def _remove_all_panels(self):
while len(self._cur_panels) > 0:
@@ -265,10 +425,12 @@ class KlipperScreen(Gtk.Window):
def _menu_go_back (self, widget=None):
logger.info("#### Menu go back")
self.remove_keyboard()
self._remove_current_panel()
def _menu_go_home(self):
logger.info("#### Menu go home")
self.remove_keyboard()
while len(self._cur_panels) > 1:
self._remove_current_panel()
@@ -286,58 +448,94 @@ class KlipperScreen(Gtk.Window):
self.subscriptions.pop(i)
return
def set_screenblanking_timeout(self, time):
logger.debug("Changing screenblanking to: %s" % time)
if time == "off":
os.system("/usr/bin/xset -display :0 s off")
os.system("/usr/bin/xset -display :0 s noblank")
return
time = int(time)
if time < 0:
return
os.system("/usr/bin/xset -display :0 s on")
os.system("/usr/bin/xset -display :0 s %s" % time)
def state_disconnected(self):
_ = self.lang.gettext
logger.debug("### Going to disconnected")
self.printer_initializing(_("Klipper has disconnected"))
def state_error(self):
_ = self.lang.gettext
msg = self.printer.get_stat("webhooks","state_message")
if "FIRMWARE_RESTART" in msg:
self.printer_initializing(
_("Klipper has encountered an error.\nIssue a FIRMWARE_RESTART to attempt fixing the issue.")
)
elif "micro-controller" in msg:
self.printer_initializing(
_("Klipper has encountered an error with the micro-controller.\nPlease recompile and flash.")
)
else:
self.printer_initializing(
_("Klipper has encountered an error.")
)
def state_printing(self):
if "job_status" in self._cur_panels:
return
self.printer_printing()
def state_ready(self):
# Do not return to main menu if completing a job, timeouts/user input will return
if "job_status" in self._cur_panels or "main_menu" in self._cur_panels:
return
self.printer_ready()
def state_startup(self):
_ = self.lang.gettext
self.printer_initializing(_("Klipper is attempting to start"))
def state_shutdown(self):
_ = self.lang.gettext
self.printer_initializing(_("Klipper has shutdown"))
def _websocket_callback(self, action, data):
_ = self.lang.gettext
#print(json.dumps([action, data], indent=2))
if action == "notify_klippy_disconnected":
logger.info("### Going to disconnected state")
self.printer_initializing(_("Klipper has shutdown"))
logger.debug("Received notify_klippy_disconnected")
self.printer.change_state("disconnected")
return
elif action == "notify_klippy_ready":
logger.info("### Going to ready state")
self.init_printer()
elif action == "notify_status_update" and self.shutdown == False:
self.printer.change_state("ready")
elif action == "notify_status_update" and self.printer.get_state() != "shutdown":
self.printer.process_update(data)
if "webhooks" in data:
print(json.dumps([action, data], indent=2))
if "webhooks" in data and "state" in data['webhooks']:
if data['webhooks']['state'] == "ready":
logger.info("### Going to ready state")
self.printer_ready()
elif data['webhooks']['state'] == "shutdown":
self.shutdown == True
self.printer_initializing(_("Klipper has shutdown"))
else:
active = self.printer.get_stat('virtual_sdcard','is_active')
paused = self.printer.get_stat('pause_resume','is_paused')
if "job_status" in self._cur_panels:
if active == False and paused == False:
self.printer_ready()
else:
if active == True or paused == True:
self.printer_printing()
elif action == "notify_filelist_changed":
logger.debug("Filelist changed: %s", json.dumps(data,indent=2))
#self.files.add_file()
elif action == "notify_metadata_update":
self.files.update_metadata(data['filename'])
self.files.request_metadata(data['filename'])
elif action == "notify_power_changed":
logger.debug("Power status changed: %s", data)
self.printer.process_power_update(data)
elif self.shutdown == False and action == "notify_gcode_response":
elif self.printer.get_state() not in ["error","shutdown"] and action == "notify_gcode_response":
if "Klipper state: Shutdown" in data:
self.shutdown == True
self.printer_initializing(_("Klipper has shutdown"))
logger.debug("Shutdown in gcode response, changing state to shutdown")
self.printer.change_state("shutdown")
if not (data.startswith("B:") and
re.search(r'B:[0-9\.]+\s/[0-9\.]+\sT[0-9]+:[0-9\.]+', data)):
if data.startswith("!! "):
self.show_popup_message(data[3:])
logger.debug(json.dumps([action, data], indent=2))
for sub in self.subscriptions:
self.panels[sub].process_update(action, data)
def _confirm_send_action(self, widget, text, method, params):
def _confirm_send_action(self, widget, text, method, params={}):
_ = self.lang.gettext
buttons = [
@@ -345,15 +543,22 @@ class KlipperScreen(Gtk.Window):
{"name":_("Cancel"),"response": Gtk.ResponseType.CANCEL}
]
try:
env = Environment(extensions=["jinja2.ext.i18n"])
env.install_gettext_translations(self.lang)
j2_temp = env.from_string(text)
text = j2_temp.render()
except:
logger.debug("Error parsing jinja for confirm_send_action")
label = Gtk.Label()
label.set_markup(text)
label.set_hexpand(True)
label.set_halign(Gtk.Align.CENTER)
label.set_line_wrap(True)
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
label.get_style_context().add_class("text")
dialog = KlippyGtk.Dialog(self, buttons, label, self._confirm_send_action_response, method, params)
dialog = self.gtk.Dialog(self, buttons, label, self._confirm_send_action_response, method, params)
def _confirm_send_action_response(self, widget, response_id, method, params):
if response_id == Gtk.ResponseType.OK:
@@ -366,6 +571,7 @@ class KlipperScreen(Gtk.Window):
def printer_initializing(self, text=None):
self.shutdown = True
self.close_popup_message()
self.show_panel('splash_screen',"splash_screen", "Splash Screen", 2)
if text != None:
self.panels['splash_screen'].update_text(text)
@@ -373,67 +579,80 @@ class KlipperScreen(Gtk.Window):
def init_printer(self):
_ = self.lang.gettext
self.shutdown = False
status_objects = [
'idle_timeout',
'configfile',
'gcode_move',
'fan',
'toolhead',
'virtual_sdcard',
'print_stats',
'heater_bed',
'extruder',
'pause_resume'
]
printer_info = self.apiclient.get_printer_info()
data = self.apiclient.send_request("printer/objects/query?" + "&".join(status_objects))
data = self.apiclient.send_request("printer/objects/query?" + "&".join(PRINTER_BASE_STATUS_OBJECTS))
powerdevs = self.apiclient.send_request("machine/device_power/devices")
if printer_info == False or data == False:
self.printer_initializing(_("Moonraker error"))
return
data = data['result']['status']
# Reinitialize printer, in case the printer was shut down and anything has changed.
self.printer.__init__(printer_info['result'], data)
self.printer.reinit(printer_info['result'], data)
self.ws_subscribe()
if powerdevs != False:
self.printer.configure_power_devices(powerdevs['result'])
if self.files == None:
self.files = KlippyFiles(self)
else:
self.files.add_timeout()
if printer_info['result']['state'] == "shutdown":
if "FIRMWARE_RESTART" in printer_info['result']['state_message']:
self.printer_initializing(
_("Klipper has encountered an error.\nIssue a FIRMWARE_RESTART to attempt fixing the issue.")
)
else:
self.printer_initializing(_("Klipper has shutdown"))
return
if (data['print_stats']['state'] == "printing" or data['print_stats']['state'] == "paused"):
self.printer_printing()
return
self.printer_ready()
def printer_ready(self):
if self.shutdown == True:
self.init_printer()
return
self.files.add_timeout()
self.show_panel('main_panel', "main_menu", "Main Menu", 2, items=self._config.get_menu_items("__main"),
extrudercount=self.printer.get_extruder_count())
self.close_popup_message()
# Force update to printer webhooks state in case the update is missed due to websocket subscribe not yet sent
self.printer.process_update({"webhooks":{"state":"ready","state_message": "Printer is ready"}})
self.show_panel('main_panel', "main_menu", self.connected_printer, 2,
items=self._config.get_menu_items("__main"), extrudercount=self.printer.get_extruder_count())
self.ws_subscribe()
if "job_status" in self.panels:
self.remove_subscription("job_status")
del self.panels["job_status"]
def printer_printing(self):
self.ws_subscribe()
self.files.remove_timeout()
self.close_popup_message()
self.show_panel('job_status',"job_status", "Print Status", 2)
def show_keyboard(self, widget=None):
if self.keyboard is not None:
return
env = os.environ.copy()
env["MB_KBD_CONFIG"] = "/home/pi/.matchbox/keyboard.xml"
env["MB_KBD_CONFIG"] = "ks_includes/locales/keyboard.xml"
p = subprocess.Popen(["matchbox-keyboard", "--xid"], stdout=subprocess.PIPE,
stderr=subprocess.PIPE, env=env)
#p = subprocess.Popen(["onboard", "--xid"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
xid = int(p.stdout.readline())
logger.debug("XID %s" % xid)
logger.debug("PID %s" % p.pid)
keyboard = Gtk.Socket()
#keyboard.connect("plug-added", self.plug_added)
action_bar_width = self.gtk.get_action_bar_width()
box = Gtk.VBox()
box.set_size_request(self.width - action_bar_width, self.keyboard_height)
box.add(keyboard)
cur_panel = self.panels[self._cur_panels[-1]]
#for i in ['back','estop','home']:
# if i in cur_panel.control:
# cur_panel.control[i].set_sensitive(False)
cur_panel.get().put(box, action_bar_width, self.height - 200)
self.show_all()
keyboard.add_id(xid)
keyboard.show()
self.keyboard = {
"box": box,
"panel": cur_panel.get(),
"process": p,
"socket": keyboard
}
def remove_keyboard(self, widget=None):
if self.keyboard is None:
return
self.keyboard['panel'].remove(self.keyboard['box'])
os.kill(self.keyboard['process'].pid, signal.SIGTERM)
self.keyboard = None
def get_software_version():
prog = ('git', '-C', os.path.dirname(__file__), 'describe', '--always',
'--tags', '--long', '--dirty')
@@ -454,7 +673,6 @@ def get_software_version():
return "?"
def main():
win = KlipperScreen()
win.connect("destroy", Gtk.main_quit)
win.show_all()
+17 -3
View File
@@ -20,7 +20,8 @@ install_packages()
python3-gi-cairo \
python3-virtualenv \
gir1.2-gtk-3.0 \
virtualenv
virtualenv \
matchbox-keyboard
}
create_virtualenv()
@@ -47,12 +48,24 @@ install_systemd_service()
echo "$SERVICE" | sudo tee /etc/systemd/system/KlipperScreen.service > /dev/null
sudo systemctl daemon-reload
sudo systemctl enable KlipperScreen
}
modify_user()
{
sudo usermod -a -G tty $USER
}
update_x11()
{
echo "Updating X11 configuration"
sudo sed -i 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
if [ -e /etc/X11/Xwrapper.conf ]
then
echo "Updating X11 Xwrapper"
sudo sed -i 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
else
echo "Adding X11 Xwrapper"
echo 'allowed_users=anybody' | sudo tee /etc/X11/Xwrapper.config
fi
}
start_KlipperScreen() {
@@ -61,6 +74,7 @@ start_KlipperScreen() {
install_packages
create_virtualenv
modify_user
install_systemd_service
update_x11
start_KlipperScreen
+2 -2
View File
@@ -1,5 +1,5 @@
requests==2.25.0
requests==2.25.1
vext==0.7.4
websocket-client==0.57.0
humanize==3.1.0
humanize==3.2.0
jinja2==2.11.2
+13
View File
@@ -0,0 +1,13 @@
xgettext --keyword=_ --language=Python --add-comments --sort-output \
-o ks_includes/locales/KlipperScreen.pot \
*.py \
ks_includes/*.py \
panels/*.py \
ks_includes/KlipperScreen.conf
langs=(de_DE en fr_FR he_IL ru_RU zh_CN)
for lang in ${langs[@]}; do
msgmerge ks_includes/locales/$lang/LC_MESSAGES/KlipperScreen.po \
ks_includes/locales/KlipperScreen.pot \
-o ks_includes/locales/$lang/LC_MESSAGES/KlipperScreen.po
done
-305
View File
@@ -1,305 +0,0 @@
/* * {
} */
window {
background-color: #13181C;
-gtk-icon-shadow: none;
font-size: 20px;
}
scrollbar, scrollbar button, scrollbar trough {
border: none;
background-color: #13181C;
}
scrollbar slider {
min-width: 60px;
border-radius: 15px;
background-color: #404E57;
}
label {
color: white;
}
frame {
color: #fff;
border-bottom: 1px solid #444;
}
.text {
color: #fff;
}
progress, trough {
min-height: 40px;
/*font-size: 50px;*/
background-color: #404E57;
color: #fff;
border: #000 1px solid;
}
progress {
background-color: #d47b00;
font-size: 50px;
font-weight: lighter;
}
.printing-progress-bar {
font-size: 25px;
color: #00C9B4;
}
.printing-progress-text {
font-size: 25px;
color: #fff;
}
.printing-state {
opacity: 0.5;
}
button {
background-image: none;
background-color: #13181C;
margin: 5px;
margin-bottom: 10px;
border-radius: 0;
border: 0px solid #000;
color: #fff;
-gtk-icon-shadow: none;
}
button:active {
background-color: #304C62;
}
.button_active {
background-color: #20303D;
}
button.color1 {
border-bottom: 8px solid #ED6500;
}
button.color2 {
border-bottom: 8px solid #B10080;
}
button.color3 {
border-bottom: 8px solid #009384;
}
button.color4 {
border-bottom: 8px solid #A7E100;
}
button.active {
background-color: #20303D;
}
button.file-list {
margin: 0px;
}
.distbutton_top {
border: 3px solid #fff;
border-right: 0px;
border-top-left-radius: 15px;
border-bottom-left-radius: 15px;
margin-right: 0px;
}
.distbutton {
border: 3px solid #fff;
border-left: 3px solid #ccc;
border-right: 0px;
margin-left: 0;
margin-right: 0px;
}
.distbutton_bottom {
border: 3px solid #fff;
border-left: 3px solid #ccc;
border-top-right-radius: 15px;
border-bottom-right-radius: 15px;
margin-left: 0;
}
.tempbutton_top {
border: 3px solid #fff;
border-bottom: 0px;
border-top-left-radius: 15px;
border-top-right-radius: 15px;
margin-bottom: 0px;
}
.tempbutton {
border: 3px solid #fff;
border-top: 3px solid #ccc;
border-bottom: 0px;
margin-top: 0;
margin-bottom: 0px;
}
.tempbutton_bottom {
border: 3px solid #fff;
border-top: 3px solid #ccc;
border-bottom-left-radius: 15px;
border-bottom-right-radius: 15px;
margin-top: 0;
}
.distbutton_active {
background-color: #20303D;
}
entry {
font-size: 30px;
background-color: #20292F;
border-radius: 0;
padding-left: 1em;
margin-left: 1em;
padding-right: 1em;
}
button.keyboard {
font-size: 30px;
margin: 0px;
/* margin-bottom:10px; */
}
.dialog {
border: 2px solid black;
font-size: 20px;
padding: 50px;
background-color: #000;
margin: 20px;
}
.dialog button {
padding: 30px 50px 30px 50px;
border-bottom: 8px solid #009384;
}
.message {
border: 2px solid #981E1F;
font-size: 20px;
padding: 50px;
color: #FFF;
background-color: #981E1F;
}
.message button {
background-color: #FFF;
color: #000;
padding: 40px 50px 40px 50px;
}
.notification {
background-clip: padding-box;
padding: 5px;
border-radius: 0 0 5px 5px;
opacity: 0.8;
}
.warning {
background-color: rgba(30, 204, 39, 0.7);
}
.error {
background-color: rgba(204, 30, 30, 0.7);
}
.printing-status-label {
padding-top: 5px;
padding-bottom: 3px;
color: #ccc;
font-size: 24px;
}
.hidden {
opacity: 0;
}
.temperature_entry {
border: 0px;
color: #fff;
margin: 10px 5px 5px 5px;
}
.numpad_tleft {
border-left: 3px solid #fff;
border-top: 3px solid #fff;
border-top-left-radius: 15px;
margin: 3px 0 0 3px;
}
.numpad_top {
border-left: 3px solid #ccc;
border-top: 3px solid #fff;
margin: 3px 0 0 0;
}
.numpad_tright {
border-left: 3px solid #fff;
border-right: 3px solid #fff;
border-top: 3px solid #fff;
border-top-right-radius: 15px;
margin: 3px 3px 0 0;
}
.numpad_left {
border-left: 3px solid #fff;
border-top: 3px solid #ccc;
margin: 0 0 0 3px;
}
.numpad_button {
border-left: 3px solid #ccc;
border-top: 3px solid #ccc;
margin: 0;
}
.numpad_right {
border-right: 3px solid #fff;
border-left: 3px solid #ccc;
border-top: 3px solid #ccc;
margin: 0 3px 0 0;
}
.numpad_bleft {
border-left: 3px solid #fff;
border-bottom: 3px solid #fff;
border-top: 3px solid #ccc;
border-bottom-left-radius: 15px;
margin: 0 0 3px 3px;
}
.numpad_bottom {
border-left: 3px solid #ccc;
border-bottom: 3px solid #fff;
border-top: 3px solid #ccc;
margin: 0 0 3px 0;
}
.numpad_bright {
border-left: 3px solid #ccc;
border-bottom: 3px solid #fff;
border-top: 3px solid #ccc;
border-right: 3px solid #ccc;
border-bottom-right-radius: 15px;
margin: 0 3px 3px 0;
}
.fan_slider {
margin: 20px;
color: #fff;
}
scale mark {
margin-top: 20px;
color: #fff;
}
+343
View File
@@ -0,0 +1,343 @@
* {
color: #fff;
font-size: KS_FONT_SIZEpx;
-GtkComboBox-appears-as-list: 0;
}
window {
background-color: #13181C;
-gtk-icon-shadow: none;
}
button {
background-image: none;
background-color: #13181C;
margin: .25em;
margin-bottom: .5em;
border-radius: 0;
border: 0 solid #000;
-gtk-icon-shadow: none;
}
button:active {
background-color: #304C62;
}
.button_active {
background-color: #20303D;
}
button.color1 {
border-bottom: .4em solid #ED6500;
}
button.color2 {
border-bottom: .4em solid #B10080;
}
button.color3 {
border-bottom: .4em solid #009384;
}
button.color4 {
border-bottom: .4em solid #A7E100;
}
button.active {
background-color: #20303D;
}
button.file-list {
margin: 0;
}
combobox box button {
border: .05em solid #cccccc;
padding: .5em 1em;
}
entry {
font-size: 1em;
background-color: #20292F;
border: 0;
padding: .25em;
}
frame {
color: #fff;
border-bottom: 1px solid #444;
}
label {
color: white;
}
menu {
background-color: #13181C;
border: .1em solid #cccccc;
}
menuitem {
background-color: #13181C;
border: .1em solid #cccccc;
border-bottom: 0;
border-top: 0;
}
progress, trough {
min-height: 2em;
background-color: #404E57;
color: #fff;
border: #000 1px solid;
}
progress {
background-color: #d47b00;
}
scale mark {
margin-top: 1em;
color: #fff;
}
scrollbar, scrollbar button, scrollbar trough {
border: none;
background-color: #13181C;
}
scrollbar slider {
min-width: 3em;
border-radius: .7em;
background-color: #404E57;
}
trough {
margin: .5em 1em;
}
.popup {
background-color: #0000ff;
}
.action_bar {
border-right: 2px solid #444;
}
.dialog {
border: .1em solid black;
padding: 2.5em;
background-color: #000;
margin: 1em;
}
.dialog button {
padding: 1.5em 2.5em 1.5em 2.5em;
border-bottom: .4em solid #009384;
}
.distbutton_active {
background-color: #20303D;
}
.distbutton_top {
border: .15em solid #fff;
border-right: 0;
border-top-left-radius: .75em;
border-bottom-left-radius: .75em;
margin-right: 0;
}
.distbutton {
border: .15em solid #fff;
border-left: .15em solid #ccc;
border-right: 0;
margin-left: 0;
margin-right: 0;
}
.distbutton_bottom {
border: .15em solid #fff;
border-left: .15em solid #ccc;
border-top-right-radius: .7em;
border-bottom-right-radius: .7em;
margin-left: 0;
}
.fan_slider {
margin: 1em;
color: #fff;
}
.frame-item {
min-height: 4.5em;
padding: .1em .75em;
}
.message_popup {
background-color: #367554;
border-bottom: .1em solid #fff;
}
.message_popup button {
background-color: #367554;
}
.numpad_tleft {
border-left: .15em solid #fff;
border-top: .15em solid #fff;
border-top-left-radius: .7em;
margin: .15em 0 0 .15em;
}
.numpad_top {
border-left: .15em solid #ccc;
border-top: .15em solid #fff;
margin: .15em 0 0 0;
}
.numpad_tright {
border-left: .15em solid #fff;
border-right: .15em solid #fff;
border-top: .15em solid #fff;
border-top-right-radius: .7em;
margin: .15em .15em 0 0;
}
.numpad_left {
border-left: .15em solid #fff;
border-top: .15em solid #ccc;
margin: 0 0 0 .15em;
}
.numpad_button {
border-left: .15em solid #ccc;
border-top: .15em solid #ccc;
margin: 0;
padding: 1em;
}
.numpad_right {
border-right: .15em solid #fff;
border-left: .15em solid #ccc;
border-top: .15em solid #ccc;
margin: 0 .15em 0 0;
}
.numpad_bleft {
border-left: .15em solid #fff;
border-bottom: .15em solid #fff;
border-top: .15em solid #ccc;
border-bottom-left-radius: .7em;
margin: 0 0 .15em .15em;
}
.numpad_bottom {
border-left: .15em solid #ccc;
border-bottom: .15em solid #fff;
border-top: .15em solid #ccc;
margin: 0 0 .15em 0;
}
.numpad_bright {
border-left: .15em solid #ccc;
border-bottom: .15em solid #fff;
border-top: .15em solid #ccc;
border-right: .15em solid #ccc;
border-bottom-right-radius: .7em;
margin: 0 .15em .15em 0;
}
.printing-filename {
font-size: 1.75em;
font-weight: bold;
margin: .25em .25em 0 0;
}
.printing-info {
font-size: 1.2em;
margin-left: .25em;
}
.printing-info-box {
padding-left: .25em;
}
.printing-info-box box {
margin-bottom: .5em;
}
.printing-status {
color: #f0f0f0;
font-style: italic;
margin: 0 0 0 0;
}
.printing-progress-bar {
color: #00C9B4;
}
.printing-progress-text {
font-size: 1.5em;
font-weight: bold;
color: #fff;
}
.printing-status-label {
padding-top: .25em;
padding-bottom: .15em;
color: #ccc;
font-size: 1.25em;
}
.tempbutton_top {
border: .15em solid #fff;
border-bottom: 0;
border-top-left-radius: .75em;
border-top-right-radius: .75em;
margin-bottom: 0;
}
.tempbutton {
border: .15em solid #fff;
border-top: .15em solid #ccc;
border-bottom: 0;
margin-top: 0;
margin-bottom: 0;
}
.tempbutton_bottom {
border: .15em solid #fff;
border-top: .15em solid #ccc;
border-bottom-left-radius: .7em;
border-bottom-right-radius: .7em;
margin-top: 0;
}
.message {
border: .1em solid #981E1F;
font-size: 1em;
padding: 2.5em;
color: #FFF;
background-color: #981E1F;
}
.message button {
background-color: #FFF;
color: #000;
padding: 2em 2.5em 2em 2.5em;
}
.notification {
background-clip: padding-box;
padding: .25em;
border-radius: 0 0 .25em .25em;
opacity: 0.8;
}
.warning {
background-color: rgba(30, 204, 39, 0.7);
}
.error {
background-color: rgba(204, 30, 30, 0.7);
}
+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" ?><svg data-name="Layer 1" id="Layer_1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title/><path style="fill:#FFFFFF" d="M12,2A10,10,0,1,0,22,12,10,10,0,0,0,12,2Zm0,18a8,8,0,1,1,8-8A8,8,0,0,1,12,20ZM13,6H11v7h6V11H13Z"/></svg>

After

Width:  |  Height:  |  Size: 259 B

+3 -97
View File
@@ -1,99 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
sodipodi:docname="emergency.svg"
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
version="1.1"
id="svg4160"
viewBox="0 0 60.137677 60.776516"
height="60.776516"
width="60.13768">
<defs
id="defs4162">
<rect
id="rect35"
height="75.089285"
width="56.160714"
y="3.7185006"
x="-24.056441" />
</defs>
<sodipodi:namedview
inkscape:document-rotation="0"
inkscape:snap-global="false"
inkscape:snap-bbox="true"
inkscape:window-maximized="1"
inkscape:window-y="-11"
inkscape:window-x="-11"
inkscape:window-height="2066"
inkscape:window-width="3840"
showguides="false"
units="in"
showgrid="true"
inkscape:current-layer="layer1"
inkscape:document-units="px"
inkscape:cy="30.217279"
inkscape:cx="2.3098192"
inkscape:zoom="11.313709"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base">
<inkscape:grid
originy="-29.820954"
originx="-9.9771178"
id="grid4712"
type="xygrid" />
</sodipodi:namedview>
<metadata
id="metadata4165">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
transform="translate(-3.5328446,2.2636422)"
style="display:inline"
inkscape:label="Move"
id="layer2"
inkscape:groupmode="layer">
<g
id="g46"
transform="translate(-6.0411758,-15.071814)">
<path
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 22.795553,16.619161 3.21242,-1.25 3.212421,1.25 v 47.687531 l -3.212421,0.892857 -3.21242,-0.892857 z"
id="rect4760-8"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccccccc" />
<ellipse
style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#d40000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path4508"
cx="39.64286"
cy="43.19643"
rx="29.040764"
ry="29.130053" />
</g>
<text
transform="translate(47.1875,-4.8214286)"
style="font-style:normal;font-weight:normal;font-size:53px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect35);fill:#d40000;fill-opacity:1;stroke:none;"
id="text33"
xml:space="preserve"><tspan
x="-26"
y="52.376338"><tspan
style="font-weight:bold;font-size:53px;fill:#d40000">!</tspan></tspan></text>
</g>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true" class="v-icon__svg" style="color: #ff0000;">
<path style="fill:#ff0000;" d="M11,15H13V17H11V15M11,7H13V13H11V7M12,3A9,9 0 0,0 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M12,19C8.14,19 5,15.86 5,12C5,8.14 8.14,5 12,5C15.86,5 19,8.14 19,12C19,15.86 15.86,19 12,19M20.5,20.5C22.66,18.31 24,15.31 24,12C24,8.69 22.66,5.69 20.5,3.5L19.42,4.58C21.32,6.5 22.5,9.11 22.5,12C22.5,14.9 21.32,17.5 19.42,19.42L20.5,20.5M4.58,19.42C2.68,17.5 1.5,14.9 1.5,12C1.5,9.11 2.68,6.5 4.58,4.58L3.5,3.5C1.34,5.69 0,8.69 0,12C0,15.31 1.34,18.31 3.5,20.5L4.58,19.42Z"></path>
</svg>

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 718 B

+48
View File
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="77px" height="80px" viewBox="0 0 77 80" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 52.5 (67469) - http://www.bohemiancoding.com/sketch -->
<title>extruder1</title>
<desc>Created with Sketch.</desc>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Artboard" transform="translate(-62.000000, -173.000000)">
<g id="extruder-1" transform="translate(62.000000, 173.000000)">
<g id="Group" transform="translate(10.000000, 6.000000)" fill="#FFFFFF" stroke="#FFFFFF" stroke-linecap="round" stroke-width="2">
<path d="M0.5,3.5 L6,0.5" id="Line"></path>
<path d="M6,0.5 L14.5,0.5" id="Line-2"></path>
<path d="M14.5,0.5 L17.5,4.5" id="Line-3" stroke-linejoin="round"></path>
<path d="M0.5,3.5 L0.5,15.5" id="Line-5"></path>
<path d="M17.5,4.5 L29.5,4.5" id="Line-4"></path>
<path d="M0.5,15.5 L4,21.5" id="Line-6"></path>
<path d="M4,47.5 L0.5,52.5" id="Line-8"></path>
<path d="M0.5,52.5 L0.5,66.5" id="Line-9"></path>
<path d="M4,21.5 L4,47.5" id="Line-7"></path>
<path d="M0.5,66.5 L13.5,69" id="Line-10"></path>
<path d="M13.5,69 L17.5,64.5" id="Line-11"></path>
<path d="M17.5,64.5 L29.5,64.5" id="Line-12"></path>
</g>
<g id="Group" transform="translate(52.000000, 40.500000) scale(-1, 1) translate(-52.000000, -40.500000) translate(37.000000, 6.000000)" stroke="#FFFFFF" stroke-linecap="round" stroke-width="2">
<path d="M0.5,3.5 L6,0.5" id="Line"></path>
<path d="M6,0.5 L14.5,0.5" id="Line-2"></path>
<path d="M14.5,0.5 L17.5,4.5" id="Line-3" stroke-linejoin="round"></path>
<path d="M0.5,3.5 L0.5,15.5" id="Line-5"></path>
<path d="M17.5,4.5 L29.5,4.5" id="Line-4"></path>
<path d="M0.5,15.5 L4,21.5" id="Line-6"></path>
<path d="M4,47.5 L0.5,52.5" id="Line-8"></path>
<path d="M0.5,52.5 L0.5,66.5" id="Line-9"></path>
<path d="M4,21.5 L4,47.5" id="Line-7"></path>
<path d="M0.5,66.5 L13.5,69" id="Line-10"></path>
<path d="M13.5,69 L17.5,64.5" id="Line-11"></path>
<path d="M17.5,64.5 L29.5,64.5" id="Line-12"></path>
</g>
<circle id="Oval" stroke="#FFFFFF" stroke-width="2" cx="38.5" cy="35.5" r="19.5"></circle>
<circle id="Oval" stroke="#000000" stroke-width="0.5" fill="#FFFFFF" cx="55" cy="22" r="21"></circle>
<text id="1" font-family="OpenSans-SemiBold, Open Sans" font-size="26" font-weight="500" fill="#000000">
<tspan x="47.6188697" y="31">0</tspan>
</text>
<path d="M35.5,73.5 L38.5,77.5" id="Line-16" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
<path d="M38.5,77.5 L41.5,73.5" id="Line-17" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
<path d="M29.5,73.5 L47.5,73.5" id="Line-14" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" ?><svg data-name="Layer 1" id="Layer_1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title/><path style="fill:#FFFFFF" d="M19,6.76V2H6V6.76A4,4,0,0,0,7.17,9.59L9.59,12,7.17,14.41A4.06,4.06,0,0,0,6,17.24V22H19V17.24a4.06,4.06,0,0,0-1.17-2.83L15.41,12l2.42-2.41A4,4,0,0,0,19,6.76ZM8,4h9V6H8Zm8.41,11.83A2,2,0,0,1,17,17.24V20H8V17.24a2,2,0,0,1,.59-1.41l2.76-2.77L11.4,13h2.2l.05.06Zm-2.76-4.89L13.6,11H11.4l-.05-.06L8.59,8.17A1.22,1.22,0,0,1,8.44,8h8.12a1.22,1.22,0,0,1-.15.17Z"/></svg>

After

Width:  |  Height:  |  Size: 515 B