Compare commits

...
256 Commits
Author SHA1 Message Date
Alfredo Monclus 0a9180d482 Graph (#357)
* Add theme graph colors

* Fix graph not applying colors
2021-12-07 20:56:32 -05:00
Jordan e1fcfdc9c7 Main menu hide 'set temp' for devices that don't have a heater. 2021-12-06 19:30:02 -05:00
Jordan c37acb5c00 Fix graph error and make colors configurable 2021-12-05 20:35:37 -05:00
Jordan 8f71eb7ca8 Create keypad widget and include set temp on the main menu 2021-12-04 15:13:31 -05:00
Jordan e9ed33c580 Move graph location 2021-12-04 15:11:16 -05:00
Jordan bf76132a0f graph: Add ability to hide/show sensors. 2021-12-04 15:11:16 -05:00
Alfredo Monclus df32787dc0 tweaks (#291) 2021-12-04 15:11:16 -05:00
Jordan 7ffc394366 Updates to graphing.
Modify heaters to show only ones available in the temp store. Add 
ability to hide/show heaters.
2021-12-04 15:11:16 -05:00
Jordan 44c417bc85 Adding graph capability to main menu 2021-12-04 15:11:16 -05:00
Alfredo Monclus 5ff249cb20 Switch from vext.gi to PyGObject (#348) 2021-12-04 12:29:35 -05:00
Alfredo Monclus eca3385ffe Add the full message of the commits in the updater (#343) 2021-12-04 12:29:17 -05:00
Alfredo Monclus 873f61d74b Change gdk deprecated functions (#342) 2021-12-04 12:29:01 -05:00
Alfredo Monclus 2c050a649c Wakeup touch block (#340)
* Prevent accidental touches on wakeup (DPMS needed)

* fixup

* This is a very old workaround to blank the cursor for the entire X

* Separate cursor change into a procedure

* Check for DPMS FAIL state first
2021-12-04 12:28:37 -05:00
dependabot[bot] 9f2711b506 build(deps): bump humanize from 3.12.0 to 3.13.1 (#347)
Bumps [humanize](https://github.com/jmoiron/humanize) from 3.12.0 to 3.13.1.
- [Release notes](https://github.com/jmoiron/humanize/releases)
- [Commits](https://github.com/jmoiron/humanize/compare/3.12.0...3.13.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-04 12:28:16 -05:00
dependabot[bot] 2c6d3d1866 build(deps): bump matplotlib from 3.4.3 to 3.5.0 (#329)
Bumps [matplotlib](https://github.com/matplotlib/matplotlib) from 3.4.3 to 3.5.0.
- [Release notes](https://github.com/matplotlib/matplotlib/releases)
- [Commits](https://github.com/matplotlib/matplotlib/compare/v3.4.3...v3.5.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-04 12:28:02 -05:00
Jordan 41d41dc2eb screen: Add configuration option for estop confirmation (Default off). Fixes #321 and fixes #341 2021-12-01 19:58:45 -05:00
Jordan dd0fd18b25 power: Sync power state on panel load. Fixes #322 2021-12-01 19:41:49 -05:00
Alfredo Monclus 1e5d701631 Update Docs (#346) 2021-11-29 11:09:25 -05:00
Alfredo Monclus 4569192ffa Improve the bed mesh plot (#338)
* Improve the bed mesh plot

* Fix when the mesh is offset or there are big values
2021-11-25 12:45:54 -05:00
Leif Bladt 13473c2cfd Update docs to point to new discourse thread 2021-11-25 12:45:43 -05:00
Jordan c8420c260b screen: RESPOND echo will now show a message on the screen. 2021-11-21 20:19:45 -05:00
Alfredo Monclus 0a6ac42069 Installer: improvements (#335)
* Fix vext.gi error
The problem occurs because vext and vext.gi are installed at the same time
we need to install the requirements in order

* Simplify path (the env was activated)

* Colorize output

* Abort if pip exit is not clean
2021-11-21 15:42:11 -05:00
Alfredo Monclus 4f61cedd6c Zcal panel: Support for Z_ENDSTOP_CALIBRATE (#327)
* Zcal panel: Support for Z_ENDSTOP_CALIBRATE

* Suggested changes

* Change naming of Gcodes because it can be calibrating an endstop and not a probe

* Update translations
2021-11-21 15:40:42 -05:00
Alfredo Monclus 39804814f5 Update FR translation (#332) 2021-11-18 07:18:26 -05:00
Jordan 2b2e096955 install script: Integrate vext.gi into requirements file 2021-11-16 22:48:32 -05:00
Alfredo Monclus b959cf5b4f Move panel: Add Z-tilt/Quad-gantry-level/HomeXY button (#326) 2021-11-16 21:05:02 -05:00
Elektrickser b52085746f More German Translations (#318)
* Add German Language

Translate the texts to german.

* Update system.py

change grid, to see all buttons on screen

* Revert "Add German Language"

This reverts commit 6982258839.

* Add German Language

add German translated files.

* fixed german translation

fixed "Laden"

* fixed german translation

add more translations

* Update system.py
2021-11-16 21:03:46 -05:00
Julian Schill 51d26a3a29 Add temperature fans to heaters (#325)
* Add temperature fans to heaters

* Make code prettier

* Indentation
2021-11-16 21:03:14 -05:00
dependabot[bot] 29e9bad1aa build(deps): bump jinja2 from 3.0.2 to 3.0.3 (#323)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.0.2 to 3.0.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.0.2...3.0.3)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-16 21:00:10 -05:00
Jordan 2f6149c5b7 Fix connect issues with moonraker. Addresses #328 2021-11-16 20:59:06 -05:00
Jordan f6fcb322f5 z_calibrate: Fix issue where z_calibrate_position section does not exist 2021-11-06 22:46:24 -04:00
Christian Kvasny 4780592778 Configurable xy position for z-calibrate added (#310)
* Configurable xy position for z-calibrate added

* fix coding style

* Z probe calibrate option added
2021-11-02 08:00:20 -04:00
dependabot[bot] 96a91f3e41 build(deps): bump humanize from 3.11.0 to 3.12.0 (#298)
Bumps [humanize](https://github.com/jmoiron/humanize) from 3.11.0 to 3.12.0.
- [Release notes](https://github.com/jmoiron/humanize/releases)
- [Commits](https://github.com/jmoiron/humanize/compare/3.11.0...3.12.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-01 22:57:31 -04:00
hawkeyexp 47b7f0920e Fix german translation (#309)
* Fix german translation

* update binary
2021-11-01 22:53:18 -04:00
Alfredo Monclus d36364a807 Augment scrollbar contrast (#314)
Some screen have very little contrast and where making the scrollbar invisible
2021-11-01 22:51:55 -04:00
Vladimir Poleh c7901243cf Fix Network panel not functioning when Wi-Fi point is within range (#304) (#315) 2021-11-01 22:51:41 -04:00
Alfredo Monclus e7e91aee27 Material (#297) 2021-10-06 12:02:27 -04:00
dependabot[bot] 5a93e0009c build(deps): bump jinja2 from 3.0.1 to 3.0.2 (#295)
Bumps [jinja2](https://github.com/pallets/jinja) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/3.0.1...3.0.2)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-06 12:02:17 -04:00
Alfredo Monclus e54c7dcbb3 Update docs and add theming section (#296) 2021-10-06 12:02:05 -04:00
Alfredo Monclusandjordanruthe 5f5e6336c0 Update Translations (#284)
* Update Translations

* Various fixes to not break the UI

* Add updater translations

* Fix pycodestyle

* Fix updater translations

* Fix pycodestyle

* Fix restart translation

* Fix \n in label

* Update French
Thank you Bahoue

* Separate "default"

Co-authored-by: jordanruthe <31575189+jordanruthe@users.noreply.github.com>
2021-10-04 20:18:27 -04:00
Alfredo Monclus c618044898 Support custom themes (#288)
* Remove relief
The relief gets stuck on touchscreens

* Support custom themes
2021-10-04 20:14:40 -04:00
Alfredo Monclus 423d344197 Fix Zcalibrate showing when there is no probe (#289) 2021-10-04 20:13:55 -04:00
Jordan 969b47f425 job_status: Tweaks to state changes 2021-10-01 19:48:03 -04:00
Jordan 3053502a32 fine_tune: Fix issue with wrong babystep interval selected. 2021-10-01 19:02:51 -04:00
Alfredo Monclus 5e3e8be005 Styling updates (#279)
* Dialog buttons colors

* Zcalibrate add colors for buttons

* Fix move panel misalignment and add color to home button

* z-bolt switch styling

* Splash screen homogeneous buttons

* remove switch slider border

* Remove max chars from filename (ellipsizes anyway)

* Fix colorized buttons moving when pressed

* Updater more row spacing

* Colorized button press
2021-09-22 23:14:21 -04:00
Bertrand Lemasle 7b904fec79 Fixed typo in limits,py (#283) 2021-09-22 18:10:03 -04:00
pappicio bfed3339d8 updates it lang (#278)
deleted outdated translation strings and update .po and .mo files
2021-09-21 18:24:32 -04:00
Alfredo Monclus 155ac2ab6f System: Updater improvements (#260)
* System: improve updater

* Styling updates

* dialog buttons pressed

* Update styling

* styling

* implement repo recovery

* check if dirty

* Fix scrollbars and logic

* Fix codestyling
2021-09-21 18:23:56 -04:00
Jordan cdf4d60b21 install script: Add fonts package. Addresses #254 2021-09-21 18:21:18 -04:00
Jordan b0b56a026c screen: Fixes for printer select button 2021-09-19 00:09:00 -04:00
Jordan 0c35e58308 limits: Fixes to limit 2021-09-19 00:08:36 -04:00
Jordan 36aaece846 screen: Put font size setting into KlippyGtk 2021-09-18 16:53:31 -04:00
Jordan 857b4a9bab docs: Add generic heater to preheat section 2021-09-18 10:32:51 -04:00
Frank Tackitt e1c478be83 Allow gcode commands with preheat options (#274)
* Allow gcode commands with preheat options

I use this to run a heatsoak macro during preheat.
  It moves to bed center, maxes the part cooling fan,
  and starts my nevermore chamber filter to circulate
  more air.

* Add documentation for preheat gcode
2021-09-18 10:32:13 -04:00
Jordan 414ac3f211 limits: Fix issue with square_corner_velocity possibly being a decimal 2021-09-18 10:09:58 -04:00
Jordan e9432ae308 Update language files. Include updates to it from @pappicio 2021-09-18 10:01:20 -04:00
Jordan 5d6f80a170 bed_level: Fix #275. Make the screws button disabled while command is running. 2021-09-18 09:50:24 -04:00
Jordan d7b8f4f1ed Add printer limits panel 2021-09-16 22:56:58 -04:00
Jordan 996777a6dd Rename KlipperScreen.conf to defaults.conf to avoid some confusion 2021-09-16 22:56:33 -04:00
Jordan 54c47554d2 Change how panel subscriptions work 2021-09-16 21:54:51 -04:00
Alfredo Monclus 62b65ba4d2 Add unload/load and reorganize extrude panel (#250)
* Add Load/Unload buttons and re-organize extruder panel
This uses the LOAD_FILAMENT and UNLOAD_FILAMENT macros so the user can have custom loading sequences.
If the macros are not found then the buttons don't show up

* Fix styling

* Fix styling2

* No colors because this are not buttons
2021-09-16 20:04:09 -04:00
Alfredo Monclus 67cc396ad9 Use a base css (#186)
* Use a base CSS for styles

* Fix updater dialogs too close to buttons and updater too close to the edge

* Fix blurry Dropdown and dialog buttons

* minor tweaks and fixes

* Solarized restyle

* more vertical clearance between items

* workaround colorized bar at high res.

* colorized pressed state
2021-09-16 20:02:36 -04:00
Jordan e9599a14c5 screen: Output font settings 2021-09-14 19:51:14 -04:00
pappicio c5f84998e4 Italian review (#266)
* Add files via upload

some other fixes on italian translation and updated .mo file!

* Delete ks_includes/locales/it/LC_MESSAGES directory

* Add files via upload
2021-09-12 20:59:45 -04:00
Jordan 1726126807 Update docs for update_manager to use user directory 2021-09-12 15:23:42 -04:00
Jordan 31606ddc38 Update metadata on file change. Fixes #227 2021-09-12 15:21:32 -04:00
Jordan e639a27de1 Test code: update line length 2021-09-11 17:36:30 -04:00
Jordan ed48cb75ad Fix workflow 2021-09-11 17:35:30 -04:00
jordanruthe c80a983fe3 Update test_code.yml 2021-09-11 17:28:03 -04:00
jordanruthe d0951c6d18 Add test_code.yml 2021-09-11 17:27:19 -04:00
Jordan 70d8315539 Update code style 2021-09-11 17:25:38 -04:00
Alfredo Monclus 98cb3ef743 Font Size Selector (#245) 2021-09-11 14:21:50 -04:00
Alfredo Monclus da8ba4db93 Preheat: Add colors to cooldown and temperature (#259) 2021-09-11 14:21:05 -04:00
Alfredo Monclus f943dee498 Update French (Bahoue) (#261) 2021-09-11 14:20:55 -04:00
pappicio 963214c549 Update Italian Language (#258)
some corrections
2021-09-11 14:20:41 -04:00
Jordan d540c038a4 Update Fan panel to include all configured fans. 2021-09-11 14:17:53 -04:00
Jordan 407d8ad000 base_panel: Updates to macro shortcut 2021-09-11 09:15:47 -04:00
Alfredo Monclus 517a6afab8 Dialogs updates (#252)
* Fix cursor on dialogs and make them fullscreen

* Fix date alignment varying with text length
2021-09-07 21:30:21 -04:00
Alfredo Monclus bf0f2d4342 Colorized theme update (#255) 2021-09-07 21:28:35 -04:00
Alfredo Monclus 3c4dfc4766 Add Italian translation (pappicio) (#257)
* Add Italian translation (pappicio)

* Fixup italian
2021-09-07 21:26:51 -04:00
Jordan 246c9829db screen: Make macros shortcut show/hide when configured. Addresses #246 2021-08-31 22:02:04 -04:00
Alfredo Monclus d41370cdf1 Use klipper_config by default if available (#241)
* Use klipper_config by default if available

* Update docs about config
2021-08-30 19:54:45 -04:00
Alfredo Monclus c54282962d Adjust titlebar height (#248) 2021-08-30 19:53:23 -04:00
Alfredo Monclus 11445db55a Fix for user keyboard layout (#244) 2021-08-30 19:52:48 -04:00
Alfredo Monclus 7bf7a54540 Ellipsize Job_status Filename and LCD message (#238) 2021-08-27 22:06:03 -04:00
Alfredo Monclus 452a56ffcb Update Spanish (#240) 2021-08-27 21:23:36 -04:00
Alfredo Monclus 13e163faf0 Check for blanking disabled (#237) 2021-08-22 17:39:02 -04:00
Alfredo Monclus 46245bb275 Macros shortcut on sidebar (#232)
* Macros shortcut

* Add config option
2021-08-22 17:38:03 -04:00
Alfredo MonclusandJordan 41e917bc41 Wake the screen at print start and end (#229)
* Wake the screen at print start and end

* job_status: Wake screen on re-print

Co-authored-by: Jordan <jordan.ruthe@gmail.com>
2021-08-19 21:07:24 -04:00
Alfredo Monclus 8bfaf69109 Updater UI cleanup (#230) 2021-08-19 21:00:07 -04:00
Alfredo Monclus 642385eead Strip .gcode from name in job_status (#231) 2021-08-19 20:45:28 -04:00
Alfredo Monclus e6a1cc483b Change solarized load icon (#233) 2021-08-19 20:45:05 -04:00
Alfredo Monclus 50b309a213 UI Fix for Other Languages (#228)
* Update translation files

* Fixup UI in other languages
2021-08-17 07:20:26 -04:00
Alfredo Monclus 17da2b3d4e Bigger Fonts and icons (#169) 2021-08-15 18:44:13 -04:00
dependabot[bot] 93c7010dc0 build(deps): bump requests from 2.25.1 to 2.26.0 (#205)
Bumps [requests](https://github.com/psf/requests) from 2.25.1 to 2.26.0.
- [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.1...v2.26.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-15 18:44:00 -04:00
dependabot[bot] 211d0c5d9b build(deps): bump humanize from 3.9.0 to 3.11.0 (#219)
Bumps [humanize](https://github.com/jmoiron/humanize) from 3.9.0 to 3.11.0.
- [Release notes](https://github.com/jmoiron/humanize/releases)
- [Commits](https://github.com/jmoiron/humanize/compare/3.9.0...3.11.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-15 18:43:56 -04:00
dependabot[bot] d6799a1b04 build(deps): bump websocket-client from 1.1.0 to 1.2.1 (#225)
Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.1.0 to 1.2.1.
- [Release notes](https://github.com/websocket-client/websocket-client/releases)
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog)
- [Commits](https://github.com/websocket-client/websocket-client/compare/v1.1.0...v1.2.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-15 18:43:52 -04:00
dependabot[bot] cc75deb02f build(deps): bump matplotlib from 3.4.2 to 3.4.3 (#226)
Bumps [matplotlib](https://github.com/matplotlib/matplotlib) from 3.4.2 to 3.4.3.
- [Release notes](https://github.com/matplotlib/matplotlib/releases)
- [Commits](https://github.com/matplotlib/matplotlib/compare/v3.4.2...v3.4.3)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-15 18:43:46 -04:00
Jordan 3996f9f1c6 screen: Remove gcode_response logging 2021-08-04 20:27:59 -04:00
Jordan afbf96e30e files: Update metadata for file that was overwritten 2021-08-03 23:21:21 -04:00
Jordan 53889bba56 config: Allow switching of languages from GUI 2021-07-30 16:20:45 -04:00
Jordan 649ef38385 config: Allow specification of language in the config file 2021-07-30 12:42:02 -04:00
Peter Buchegger 4b1aa52e89 docs: fixing xinput argument (#208) 2021-07-21 07:38:31 -04:00
Jordan 10e1fa867b bed_level: Fix #206 Format change for SCREWS_TILT_ADJUST output 2021-07-18 16:41:56 -04:00
Alfredo Monclus be5ad88029 add temp to preheat (#196) 2021-07-14 20:01:29 -10:00
Alfredo Monclus 2018b8b852 Center dialogs (#201)
* Center dialogs

* Center and clean print dialog
2021-07-14 20:00:50 -10:00
Alfredo Monclus b2ce22caa9 Reorganize zcalibrate (#202) 2021-07-14 19:59:55 -10:00
Henky Prayoga 98a8d68c67 Fixed bug KlipperScreen ignoring moonraker_api_key configuration. (#204)
* Fixed bug KlipperScreen ignoring moonraker_api_key configuration.

Signed-off-by: Henky Prayoga <henky.prayoga@callysta-engineering.com>

* Fixed bug KlipperScreen ignoring moonraker_api_key configuration.

Signed-off-by: Henky Prayoga <henky.prayoga@callysta-engineering.com>

* Fixed bug KlipperScreen ignoring moonraker_api_key configuration.

Signed-off-by: Henky Prayoga <henky.prayoga@callysta-engineering.com>
2021-07-14 19:58:45 -10:00
Jordan f68f9c642b screen: Fix popup error message 2021-06-30 19:47:03 -04:00
Jordan 912ecea3e3 docs: Add multiple fb devices to troubleshooting 2021-06-27 19:04:13 -04:00
Jordan f681676e8d docs: Update to include troubleshooting and contact page. 2021-06-27 10:29:20 -04:00
Jordan 145d9c1d84 install-script: Change to account for fixing broken packages in apt 2021-06-27 10:27:04 -04:00
Jordan 4d3918a68a scripts: remove old files 2021-06-27 10:25:38 -04:00
Jordan 30cbaa7e23 gtk: Make keyboard height be dynamic based off resolution 2021-06-26 12:24:05 -04:00
Jordan Ruthe 57a952c4e0 Add colorized console image 2021-06-26 12:24:05 -04:00
Jordan Ruthe 85816932d3 Add console to the print menu in default configuration 2021-06-26 12:24:05 -04:00
Jordan a8038c39c0 console: Change colors for errors/warnings 2021-06-26 12:24:05 -04:00
Jordan 207c026cb5 Add console panel 2021-06-26 12:24:05 -04:00
dependabot[bot] 8d2b6230ad build(deps): bump humanize from 3.7.1 to 3.9.0 (#188)
Bumps [humanize](https://github.com/jmoiron/humanize) from 3.7.1 to 3.9.0.
- [Release notes](https://github.com/jmoiron/humanize/releases)
- [Commits](https://github.com/jmoiron/humanize/compare/3.7.1...3.9.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-26 12:23:10 -04:00
Alfredo Monclus bf277dd3d2 splash_screen: Increase font size (#192) 2021-06-26 12:22:57 -04:00
Alfredo Monclus bcad2a9a78 job_status: more space for info (#193) 2021-06-26 12:21:56 -04:00
Alfredo Monclus b4064c6b9e job_status: fix cancel print label position (#194) 2021-06-26 12:21:40 -04:00
Alfredo Monclus 1c45b87f09 move: Add 50mm to move panel (#195) 2021-06-26 12:21:20 -04:00
Jordan ede73619ea docs: Touchscreen rotation configuration 2021-06-20 20:27:07 -04:00
Jordan ca2855b80b install script: Fix #142 2021-06-18 12:09:42 -04:00
Jordan 469376cf34 preheat: Change print to log statements 2021-06-16 21:13:53 -04:00
Jordan 000f30327b files: Handle case for create_dir notifications 2021-06-12 15:26:01 -04:00
Jordan d3ae02e8d8 system: Add restart option to services that moonraker supports 2021-06-12 06:30:00 -04:00
Jordan dfe9883923 system: Change information icon 2021-06-12 06:30:00 -04:00
Jordan 867ded34d9 Add update manager capability and revamp system panel to show all moonraker update clients 2021-06-12 06:30:00 -04:00
dependabot[bot] 23832e8ad6 build(deps): bump websocket-client from 1.0.1 to 1.1.0 (#184)
Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.0.1 to 1.1.0.
- [Release notes](https://github.com/websocket-client/websocket-client/releases)
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog)
- [Commits](https://github.com/websocket-client/websocket-client/compare/v1.0.1...v1.1.0)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-12 06:29:37 -04:00
dependabot[bot] 6bb81f1790 build(deps): bump humanize from 3.5.0 to 3.7.1 (#180)
Bumps [humanize](https://github.com/jmoiron/humanize) from 3.5.0 to 3.7.1.
- [Release notes](https://github.com/jmoiron/humanize/releases)
- [Commits](https://github.com/jmoiron/humanize/compare/3.5.0...3.7.1)

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

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-12 06:29:22 -04:00
dependabot[bot] dab8206ada build(deps): bump netifaces from 0.10.9 to 0.11.0 (#174)
Bumps [netifaces](https://github.com/al45tair/netifaces) from 0.10.9 to 0.11.0.
- [Release notes](https://github.com/al45tair/netifaces/releases)
- [Changelog](https://github.com/al45tair/netifaces/blob/master/CHANGELOG)
- [Commits](https://github.com/al45tair/netifaces/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-12 06:29:14 -04:00
Alfredo Monclus e86dd8b935 Graphical Fixes (#181)
* Fix fan panel going out of screen

* Fix Numpad and clean css

* Fan panel margin tweak needed for bigger fonts
2021-06-11 07:16:14 -04:00
Alfredo Monclus 816d254582 Solarize warning icon (#179) 2021-06-06 23:07:54 -04:00
Jordan 58e3e17310 gtk: Gracefully fail if no image is found for buttons. Addresses #173 2021-06-06 21:43:06 -04:00
Jordan e49c19e2d9 websocket: Fixes due to issues with recent websocket-client update 2021-06-01 07:56:09 -04:00
dependabot[bot] bdbdd221ee build(deps): bump websocket-client from 1.0.0 to 1.0.1 (#165)
Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/websocket-client/websocket-client/releases)
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog)
- [Commits](https://github.com/websocket-client/websocket-client/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-27 12:54:35 -04:00
Alfredo Monclus 81f6bbe42d restart KS after theme change (#166) 2021-05-27 12:54:02 -04:00
Wang a537ad788a Update Chinese language pack (#168) 2021-05-27 12:46:28 -04:00
Alfredo Monclus 6eedbdca88 Update Spanish (#164) 2021-05-23 22:48:47 -04:00
Jordan Ruthe 84f725697c changelog: Update for config change 2021-05-20 20:29:14 -04:00
Jordan Ruthe eb80148692 config: Don't merge default options if a user option is defined. 2021-05-20 20:27:20 -04:00
Jordan Ruthe 360e8b4055 base_panel: Fix issue with nonetype error 2021-05-20 20:26:52 -04:00
Jordan Ruthe dcac0012c9 job_status: Log filesize. Add cancelling to ignore states for new print 2021-05-20 18:50:49 -04:00
Jordan Ruthe a06ae084db job_status: Cancel/Resume button corrections 2021-05-20 00:30:38 -04:00
Jordan Ruthe db166f97e4 screen: Deleted instantied panels so that Klipper config changes will be reflected 2021-05-20 00:16:01 -04:00
Jordan 00ec1a668e changelog: Change to only have breaking changes 2021-05-19 20:54:33 -04:00
dependabot[bot] 81ee57da1f build(deps): bump jinja2 from 2.11.3 to 3.0.1 (#160)
Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.3 to 3.0.1.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.11.3...3.0.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-19 20:48:37 -04:00
Jordan 6e1f653762 wifi: Remove repetitive logging statements 2021-05-19 20:44:48 -04:00
Jordan 85ee8c4112 base_panel: Add extruder/heater bed temperatures to the title bar 2021-05-19 20:44:48 -04:00
Jordan a0de521631 base_panel: Include time 2021-05-19 20:44:48 -04:00
Jordan 73b54f7aba base_panel: Include back/home button 2021-05-19 20:44:48 -04:00
Jordan a0d3bd6a0c base_panel: Initial commit 2021-05-19 20:44:48 -04:00
jordanruthe bb62064616 Update FUNDING.yml 2021-05-19 20:41:36 -04:00
dependabot[bot] 32785c901f build(deps): bump websocket-client from 0.59.0 to 1.0.0 (#159)
Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 0.59.0 to 1.0.0.
- [Release notes](https://github.com/websocket-client/websocket-client/releases)
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog)
- [Commits](https://github.com/websocket-client/websocket-client/compare/v0.59.0...v1.0.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-19 20:40:07 -04:00
dependabot[bot] be706fd16f build(deps): bump matplotlib from 3.4.1 to 3.4.2 (#149)
Bumps [matplotlib](https://github.com/matplotlib/matplotlib) from 3.4.1 to 3.4.2.
- [Release notes](https://github.com/matplotlib/matplotlib/releases)
- [Commits](https://github.com/matplotlib/matplotlib/compare/v3.4.1...v3.4.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-19 20:39:59 -04:00
Alfredo Monclus 13617da10b Add delete and some tweaks to colorized (#156) 2021-05-15 17:16:11 -04:00
Jordan a1bd702a92 Fix issue with stale confiugration and temperature panel unassigned var #155 2021-05-13 23:01:06 -04:00
jordanruthe 7e3b919c62 Wifi manager (#148)
Updates to include ability to change wifi networks.
2021-05-13 20:53:58 -04:00
Alfredo Monclus e75a10a888 New Style - Solarized (#144)
* New Style solarized
2021-05-10 20:55:15 -04:00
Alexander Spassky 9951323e91 M117 messages display (#150)
* Added displaying M117 messages under printer state label on JobStatus panel
2021-05-10 19:46:07 -04:00
Jordan 5333218ec5 files: Compatability for key change from filename to path 2021-05-09 14:22:35 -04:00
dependabot[bot] 178abc2c9a build(deps): bump websocket-client from 0.58.0 to 0.59.0 (#147)
Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 0.58.0 to 0.59.0.
- [Release notes](https://github.com/websocket-client/websocket-client/releases)
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog)
- [Commits](https://github.com/websocket-client/websocket-client/compare/v0.58.0...v0.59.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-09 14:08:24 -04:00
dependabot[bot] 22528885ff build(deps): bump humanize from 3.4.1 to 3.5.0 (#145)
Bumps [humanize](https://github.com/jmoiron/humanize) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/jmoiron/humanize/releases)
- [Commits](https://github.com/jmoiron/humanize/compare/3.4.1...3.5.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-09 14:08:17 -04:00
Jordan 449f3274c6 preheat: Fix bug where temperature_sensor is tried to be activated 2021-05-09 13:57:32 -04:00
Jordan bd1650fd18 files: Updates to not cache thumbnails locally. Also get notified by inotify 2021-05-09 13:57:18 -04:00
Jordan f8ca339de5 printer: Fix NoneType issue
Fixes #143
2021-05-08 22:27:55 -04:00
Jordan ce8c8e44fc print: Fix error if new print starts while job_status is displayed
This may address some issues in #122
2021-05-08 22:24:28 -04:00
Jordan b27814845b print: Include refresh button for files 2021-05-08 21:40:27 -04:00
Jordan 96d252ba3c files: Convert away from thread
Convert files so it is not a thread, as it will become un-necessary with 
inotify from moonraker
2021-05-08 21:40:16 -04:00
Jordan 236fb0c4ff websocket: Change connect and logging statements to be more accurate 2021-05-08 21:38:51 -04:00
Jordan d2fea57c39 printer: Remove un-necessary logging statements 2021-05-08 21:25:43 -04:00
Jordan 7b9c98a0a8 Include temperature_sensor in listing of temperatures
This update will add temperature sensors to the main menu and 
temperature panels.
2021-05-08 14:31:50 -04:00
Jordan Ruthe c2c4e9c42e function: Add except hook for threads
This will log exceptions on different threads
2021-05-02 17:48:04 -04:00
Jordan Ruthe 7b6efa0521 logs: hide certain logging statements 2021-05-02 17:46:51 -04:00
Jordan Ruthe b39d433c46 bed_level: Fix other regex statement for screws Fixes another regex statement to allow negative values. Addresses #138 2021-04-26 20:55:24 -04:00
Jordan Ruthe 9dce74fac1 bed_level: Fix regex statement for screws
Regex statement for screws will now find screws in the negative 
position. Addresses #138
2021-04-25 19:10:50 -04:00
Alfredo Monclus a8fc7b6337 Initial Spanish translation (#139) 2021-04-25 19:03:37 -04:00
Markus 0ae0593907 word adaptation (#136)
de_DE: change wording
2021-04-21 21:44:19 -04:00
dependabot[bot] bb8689175e build(deps): bump humanize from 3.3.0 to 3.4.1 (#130)
Bumps [humanize](https://github.com/jmoiron/humanize) from 3.3.0 to 3.4.1.
- [Release notes](https://github.com/jmoiron/humanize/releases)
- [Commits](https://github.com/jmoiron/humanize/compare/3.3.0...3.4.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-19 00:23:10 -04:00
Jordan Ruthe e7b3b963c3 install: Check for existing service file
Don't overwrite service file for KlipperScreen on running install 
script.
2021-04-18 23:45:54 -04:00
Jordan Ruthe 0e1c30879b install: Change install command to PKGLIST
This enables moonraker update compatability for installing system 
packages
2021-04-18 23:42:04 -04:00
Jordan Ruthe 3494f8a7d4 screen: remove un-necessary logging line 2021-04-08 22:27:35 -04:00
Jordan Ruthe 02ea32506b screen: Fix problem where job_status does not update
Fixes a problem where a panel does not refresh data (such as extrusion 
rate, speed rate)
2021-04-08 22:25:56 -04:00
Jordan Ruthe bac2d9f23e install: Add missing dependency for libatlas 2021-04-08 07:18:09 -04:00
Jordan Ruthe 75cd4749d6 docs: Touchscreen calibration
Update touchscreen calibration docs to be more clear.
2021-04-08 00:04:26 -04:00
Jordan Ruthe c0cbe25531 bed_mesh: Include ability to view mesh
Added ability to visualize bed meshes. The active bed mesh will have 
more points available to view than inactive bed meshes.
2021-04-07 21:20:00 -04:00
dependabot[bot] 791b1c37d4 build(deps): bump humanize from 3.2.0 to 3.3.0 (#114)
Bumps [humanize](https://github.com/jmoiron/humanize) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/jmoiron/humanize/releases)
- [Commits](https://github.com/jmoiron/humanize/compare/3.2.0...3.3.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 21:27:25 -04:00
dependabot[bot] 40b9f4e56b build(deps): bump vext from 0.7.4 to 0.7.6 (#116)
Bumps [vext](https://github.com/stuaxo/vext) from 0.7.4 to 0.7.6.
- [Release notes](https://github.com/stuaxo/vext/releases)
- [Changelog](https://github.com/vext-python/vext/blob/master/HISTORY)
- [Commits](https://github.com/stuaxo/vext/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-30 21:27:11 -04:00
Jordan Ruthe 86e2174152 docs: Put hardware on its own page. 2021-03-23 21:23:42 -04:00
Jordan Ruthe f3e7941acf readme: Update docs to readthedocs 2021-03-23 00:28:20 -04:00
Jordan Ruthe d61e5983da move and settings: Update settings panel to include configurable movement speed
This allows the user to set the speed in mm/s for the move panel

Completes #95
2021-03-23 00:09:36 -04:00
Jordan Ruthe 6fd25994d4 job_status: Update percent complete on creating job_status panel 2021-03-22 23:06:54 -04:00
Jordan Ruthe fe1721debd KlippyGcodes: fixes #110 2021-03-22 20:04:33 -04:00
Jordan Ruthe 543654b499 job_status: Fix error in displaying filename 2021-03-22 20:03:05 -04:00
Jordan Ruthe 496850faec readme: Update documentation link 2021-03-15 20:28:01 -04:00
Jordan Ruthe 7743f2aa63 job_status: Add missing variable declaration for gettext 2021-03-14 23:42:12 -04:00
Jordan Ruthe 47e233928e docs: Remove screenshot from readme 2021-03-14 23:39:09 -04:00
Jordan Ruthe 344df0a869 docs: Update to use mkdocs 2021-03-14 17:02:05 -04:00
Jordan Ruthe 84ca1ded7c readme: fix broken klipper link 2021-03-14 14:27:03 -04:00
Jordan Ruthe 396467d50f splash_screen: Hide change printer button if only one printer is configured 2021-03-13 17:05:20 -05:00
Jordan Ruthe 6f8ee80574 job_status Update estimated time values 2021-03-13 14:10:28 -05:00
Jordan Ruthe 029c59436c job_status: Logic updates for printing state 2021-03-12 12:35:33 -05:00
Jordan Ruthe 55193e227f system: Add KlipperScreen restart button 2021-03-12 11:47:39 -05:00
Jordan Ruthe 66570f4ac6 job_status: Include fine tuning button on panel rather than in menu 2021-03-07 17:21:34 -05:00
schpuntikandschpuntik b7ad50deff Update Russian locale (#107)
Co-authored-by: schpuntik <schpuntik@freenet.de>
2021-03-06 16:31:28 -05:00
Jordan Ruthe 3e505d7a71 config: Add include feature 2021-03-06 12:43:47 -05:00
jordanruthe 5e31e3cfa6 Multiple printers (#85)
* screen/printer_select/splash_screen: Updates to allow changing between moonraker instances

* Updates to multiple printers

* settings: Display printer endpoints

* Update macros to be on a per-printer basis

* files: Changes to clear out file cache on printer switch

* job_status: Redo page for action bar

* splash_screen: Change icon

* websocket: Actually close the websocket

* printer: Fix error case

* splash_screen: show buttons update

* readme update
2021-03-05 18:30:59 -05:00
dependabot[bot] dd08d3d9c8 build(deps): bump websocket-client from 0.57.0 to 0.58.0 (#105)
Bumps [websocket-client](https://github.com/websocket-client/websocket-client) from 0.57.0 to 0.58.0.
- [Release notes](https://github.com/websocket-client/websocket-client/releases)
- [Changelog](https://github.com/websocket-client/websocket-client/blob/master/ChangeLog)
- [Commits](https://github.com/websocket-client/websocket-client/compare/v0.57.0...v0.58.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 18:14:48 -05:00
dependabot[bot] 5c1a23914a build(deps): bump jinja2 from 2.11.2 to 2.11.3 (#69)
Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.2 to 2.11.3.
- [Release notes](https://github.com/pallets/jinja/releases)
- [Changelog](https://github.com/pallets/jinja/blob/master/CHANGES.rst)
- [Commits](https://github.com/pallets/jinja/compare/2.11.2...2.11.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 18:14:37 -05:00
Jordan Ruthe 8c7d9726d7 move: Keep abs/rel coordinates. Closes #106 2021-03-05 00:20:26 -05:00
Jordan Ruthe 78fd11c4f1 install: fix no-binary 2021-03-04 20:44:02 -05:00
Jordan Ruthe 5f931fa09d job_status: Fix error with non-existent metadata 2021-03-03 18:32:28 -05:00
Elektrickser b264719cd9 Z-Tilt integration and Update German Language (#100)
* Z-Tilt integration and Update German Language

- Update German language
- Integration Z-Tilt in Move-Menue

* Update KlipperScreen.po
2021-03-02 18:22:19 -05:00
Jordan Ruthe f3001f3c76 wifi: Remove scanning log message 2021-02-26 10:59:13 -05:00
Jordan Ruthe 988608f9d3 language: Remove location comments from po files. Update all po files 2021-02-26 10:58:13 -05:00
Jordan Ruthe f14f494fee splash_screen: fix issue with message popup 2021-02-26 10:52:55 -05:00
Jordan Ruthe f04b14c813 printer: Ensure callbacks don't run out of order #96 2021-02-26 10:49:27 -05:00
Jordan Ruthe e1f45b3c1a screen: Enable DPMS so screens can power down. 2021-02-22 19:46:41 -05:00
Jordan Ruthe 81477f4b0a functions: Fix log issue 2021-02-22 19:43:11 -05:00
Jordan Ruthe 90d115d1f4 job_status: Update states for paused 2021-02-22 17:35:19 -05:00
Jordan Ruthe fadf4488be temperature: fix another bug 2021-02-22 16:47:48 -05:00
Jordan Ruthe 774f273858 temperature: Fix problem with manually enterring tool temp 2021-02-22 15:34:39 -05:00
Jordan Ruthe cdfd25357f functions: Fix forgotten import 2021-02-22 15:33:13 -05:00
Jordan Ruthe f6f2f3f143 printer: Add quad_gantry_level/z_tilt_adjust to homing menu. Fixes #46 2021-02-22 15:19:23 -05:00
Jordan Ruthe b78ebea687 screen: Allow cursor to be displayed #51 2021-02-22 11:40:21 -05:00
Jordan Ruthe 3f2ed97385 fine_tune: Allow z babystep intervals to be configured 2021-02-22 11:10:19 -05:00
Jordan Ruthe a57ab7f9d5 docs: Update changelog 2021-02-22 10:42:23 -05:00
Jordan Ruthe a19661ca90 gtk: fix font ratio for insanely wide screens 2021-02-22 10:36:33 -05:00
Jordan Ruthe cd8929bcb0 files: remove needless logging statements 2021-02-22 10:36:26 -05:00
Jordan Ruthe aed61f4aba system: Fix buttons being off screen 2021-02-22 10:35:41 -05:00
Jordan Ruthe c0b4b464bd Changes to logging implementation 2021-02-21 12:19:30 -05:00
Jordan Ruthe c8fe6de747 screen: Fix cosmetic issue with mouse hover at startup 2021-02-21 11:58:14 -05:00
Jordan Ruthe 316ff627ac temperature: add heater_generic 2021-02-19 15:21:58 -05:00
Jordan Ruthe 0c73b3831b preheat: add heater_generic 2021-02-19 15:21:50 -05:00
Jordan Ruthe 56731e77f6 main_menu: Show all heaters 2021-02-19 15:05:12 -05:00
Jordan Ruthe da1bdcfb6c screen: websocket subscribe for extra heaters 2021-02-19 14:41:10 -05:00
Jordan Ruthe 106a72b8f5 screen_panel: Update update_temp method to include name 2021-02-19 14:40:48 -05:00
Jordan Ruthe 3326551d5e printer: Add get_heaters 2021-02-19 14:40:33 -05:00
gdachs 41e2008249 wireless-tools is a required package (#86)
Missing wireless-tools lead to a very high CPU usage
2021-02-19 00:49:48 -05:00
Jordan Ruthe b303c61c1b DefaultConfig: Add macros to print menu 2021-02-19 00:48:32 -05:00
Jordan Ruthe a02913d631 docs: Update panel images 2021-02-19 00:45:55 -05:00
Jordan Ruthe 3d234af67c style: remove border on action bar 2021-02-19 00:16:32 -05:00
Jordan Ruthe 41e5963ad7 print: Save sort order to fix #66 2021-02-19 00:13:57 -05:00
Jordan Ruthe cea0df8658 print: Add support for directories 2021-02-18 23:56:25 -05:00
Jordan Ruthe cfb24dd885 config: redact moonraker api key while logging with new printers option 2021-02-18 12:48:27 -05:00
Jordan Ruthe e41c330cf1 style: Change spacing between info boxes in job_status screen 2021-02-18 12:38:42 -05:00
Jordan Ruthe 0bfe649882 KlippyGtk: Enable word wrap on buttons 2021-02-18 12:38:05 -05:00
Jordan Ruthe 0efdd2ca06 job_status: Fix issues with homogeneous grids 2021-02-18 12:37:43 -05:00
Jordan Ruthe e111053a67 move: Fix bigger text strings 2021-02-18 12:36:43 -05:00
Jordan Ruthe 08b1e0d17a screen: Only process current panel's subscription 2021-02-18 12:35:00 -05:00
Jordan Ruthe 52e3f53333 screen: Add transition for paused state (mainly for startup) 2021-02-18 12:34:35 -05:00
Jordan Ruthe 693c45e2d7 wifi: remove asyncio 2021-02-18 11:59:59 -05:00
Jordan Ruthe 0a25b4e502 job_status: Fix case for no estimated time from slicer 2021-02-15 21:45:24 -05:00
Jordan 8a9072c5d0 sudo_fix: Fix sudo for no password on certain commands 2021-02-15 21:11:37 +00:00
488 changed files with 28788 additions and 8391 deletions

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@
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
ko_fi: klipperscreen
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
+17
View File
@@ -0,0 +1,17 @@
name: test-code
on: [push, pull_request]
jobs:
lint-python-code:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: ricardochaves/python-lint@v1.4.0
with:
python-root-list: "screen.py ks_includes panels"
use-pylint: false
use-pycodestyle: true
use-flake8: false
use-black: false
use-mypy: false
use-isort: false
extra-pycodestyle-options: "--ignore=E226,E301,E302,E303,E402,W503,W504 --max-line-length=120 --max-doc-length=120"
+8 -38
View File
@@ -1,45 +1,15 @@
# 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](https://github.com/arksine/moonraker), Klipper's API service.
Current feature list:
- [x] Homing
- [x] Preheating
- [x] Job Status and control
- [x] Temperature control
- [x] Extrude control
- [x] Fan control
- [x] Disable steppers
- [x] Configure Z Offset using PROBE_CALIBRATE
- [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
KlipperScreen is touchscreen GUI for Klipper based 3D printers. KlipperScreen interfaces with [Klipper](https://github.com/kevinOConnor/klipper) via [Moonraker](https://github.com/arksine/moonraker).
[Changelog](docs/changelog.md)
Multiple printers update is here! Please check the configuration information for specifying several printers.
### Required Hardware
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.
### Documentation
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.
[Click here to access the documentation.](https://klipperscreen.readthedocs.io/en/latest/)
### Links
Screenshots are included in the documentation.
[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)
### Inspiration
KlipperScreen was inspired by [OctoScreen](https://github.com/Z-Bolt/OctoScreen/) and the need for a touchscreen GUI that
will natively work with [Klipper](https://github.com/kevinOConnor/klipper) and [Moonraker](https://github.com/arksine/moonraker).
+52 -16
View File
@@ -1,13 +1,15 @@
# Configuration
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_
Create a blank file in `~/klipper_config/KlipperScreen.conf_`, if the file already exist then just edit it.
Write in the file only the options that need to be changed.
## Include files
```
[include conf.d/*.conf]
# Include another configuration file. Wildcards (*) will expand to match anything.
```
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
```
@@ -24,19 +26,16 @@ job_complete_timeout: 30
# 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
#
# Specify the language
# The language can be specified here instead of using the system default language.
language: en
# 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
# Allows the cursor to be displayed on the screen
show_cursor: False
```
## Printer Options
Multiple printers can be defined, currently only the first one will be used until an update in the near future.
Multiple printers can be defined
```
# Define printer and name. Name is anything after the first printer word
[printer Ender 3 Pro]
@@ -45,8 +44,20 @@ 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
# Define the z_babystep intervals in a CSV list. Currently only 2 are supported
z_babystep_values: 0.01, 0.05
```
## Z probe calibrate Option
If for any reason the XYZ home position is not suitable for calibrating the probe Z offset, you can enter the coordinates for the desired position here.
```
[z_calibrate_position]
# The specified positions must be> 0 otherwise this option is ignored.
# the center of the print bed is a good value
calibrate_x_position: 100
calibrate_y_position: 100
```
## Preheat Options
```
@@ -55,6 +66,10 @@ moonraker_api_key: False
bed: 40
# Temperature for the tools
extruder: 195
# Temperature for generic heaters
heater_generic: 40
# optional GCode to run when the option is selected
gcode: MY_HEATSOAK_MACRO
```
## Menu
@@ -115,3 +130,24 @@ icon: home
method: printer.gcode.script
params: {"script":"G28"}
```
## KlipperScreen behaviour towards configuration
KlipperScreen will search for a configuration file in the following order:
1. _~/KlipperScreen.conf_
2. _${KlipperScreen_Directory}/KlipperScreen.conf_
3. _~/klipper_config/KlipperScreen.conf_
If you need a custom location for the configuration file, you can add -c or --configfile to the systemd file and specify
the location of your configuration file.
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: (do not edit use as reference)
_${KlipperScreen_Directory}/ks_includes/default.conf_
Preferably *do not* copy the entire default.conf file, just configure the settings needed.
If no config file is found, then when a setting is changed in the settings panel, a new configuration file will be created automatically.
+13
View File
@@ -0,0 +1,13 @@
# Contact
There are several ways to contact people who can assist with issues. Discord is going to be the quickest response as
there will be more people in the chat who can help.
## GitHub Issues
You may submit a GitHub issue request for any problems you are having.
## Klipper Community Discord
The invite link: https://discord.klipper3d.org/
Look for the channel `#klipper-screen`
+81
View File
@@ -0,0 +1,81 @@
# Hardware
There are no recommended screens, but here are some guidelines:
* There is no support for vertical/portrait mode, only widescreen
* Minimum resolution of 480x320
#### Hardware known to work
* [BTT PI TFT50](https://www.biqu.equipment/collections/lcd/products/bigtreetech-pi-tft50-v1-0-tft-display-for-raspberry-pi-3d-printer-part)
* [Raspberry PI 7" Touchscreen](https://www.raspberrypi.org/products/raspberry-pi-touch-display/)
* [Hyperpixel 4](https://shop.pimoroni.com/products/hyperpixel-4)
* [3.5" Elegoo](https://www.elegoo.com/de/products/elegoo-3-5-inch-tft-lcd-screen)
* [3.5" RPi Display](http://www.lcdwiki.com/3.5inch_RPi_Display)
* [5" HDMI Display-B](http://lcdwiki.com/5inch_HDMI_Display-B)
* [VoCore](https://klipper.discourse.group/t/hardware-known-to-work-with-klipperscreen/35/7)
* [Android Phone](https://klipper.discourse.group/t/how-to-klipperscreen-on-android-smart-phones/1196)
* [WAVESHARE 4.3 inch DSI LCD](https://www.waveshare.com/4.3inch-dsi-lcd.htm)
* [DFrobot DFR0550](https://wiki.dfrobot.com/5%27%27TFT-Display_with_Touchscreen_V1.0_SKU_DFR0550)
* [More known hardware in the klipper discourse](https://klipper.discourse.group/t/hardware-known-to-work-with-klipperscreen/35)
#### Configuration
Follow the manufacturer instructions on how to install your screen. In general if you see a white screen, then it's not properly installed, ensure that you at least see a console, Then ![install](Installation.md) KlipperScreen, if you are having troubles refer to the ![troubleshooting page](Troubleshooting.md) for further information.
#### Touchscreen Calibration
Most people don't need to calibrate, but if you do need to calibrate your touchscreen, follow the below steps.
Run this command:
```
DISPLAY=:0 xinput_calibrator --list
```
It will output something such as:
```
Device "wch.cn USB2IIC_CTP_CONTROL" id=6
```
Find the ID of your display and put it in the following command:
```
DISPLAY=:0 xinput_calibrator -v --device <id from last command>
```
#### Touchscreen touch rotation
If your touchscreen isn't registering touches properly after the screen has been rotated, you will need to apply a
transformation matrix. You can have the matrix be one of the following:
* 0°: `1 0 0 0 1 0 0 0 1`
* 90° Clockwise: `0 -1 1 1 0 0 0 0 1`
* 90° Counter-Clockwise: `0 1 0 -1 0 1 0 0 1`
* 180°: `-1 0 1 0 -1 1 0 0 1`
To check the current matrix, you will need your `<screen name>`
(which can be found via the last section, ex: "wch.cn USB2IIC_CTP_CONTROL").
Run the following command: `xinput list-props "wch.cn USB2IIC_CTP_CONTROL"`
It will output something such as:
```
Device '<screen name>':
Device Enabled (115): 1
Coordinate Transformation Matrix (116): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix (247): -1.000000, 0.000000, 1.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, 1.000000
libinput Calibration Matrix Default (248): -1.000000, 0.000000, 1.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, 1.000000
libinput Send Events Modes Available (249): 1, 0
libinput Send Events Mode Enabled (250): 0, 0
libinput Send Events Mode Enabled Default (251): 0, 0
Device Node (252): "/dev/input/event0"
Device Product ID (253): 6790, 58083
```
You can verify by checking that the 'Coordinate Transformation Matrix' or 'libinput Calibration Matrix'.
You can test a change by running: `xinput set-prop "<screen name>" 'Coordinate Transformation Matrix' <matrix>`
Replace matrix with one of the options above, such as: `1 0 0 0 1 0 0 0 1`
To make this permanent, modify the file `/etc/udev/rules.d/51-touchscreen.rules` and add following line:
```
ACTION=="add", ATTRS{name}=="<screen name>", ENV{LIBINPUT_CALIBRATION_MATRIX}="<matrix>"
```
+19 -47
View File
@@ -1,58 +1,43 @@
### Required Hardware
KlipperScreen should run on any HDMI touchscreen that you can connect to a computer. The required video driver may
be slightly different depending on what model you get. I am developing on a 1024x600 resolution screen. Due to this,
other resolutions may not be scaled properly at this moment. UI scaling is a future development item.
#### Configure Hardware
Add the following to _/boot/config.txt_. You can alter the hdmi_cvt to your screen specifications. This example is setup
for a resolution of 1024x600 and a refresh rate of 60hz.
```
hdmi_cvt=1024 600 60 6 0 0 0
hdmi_group=2
hdmi_mode=87
hdmi_drive=2
```
* Development has been using 1024x600 for a screen resolution. Other resolutions may have issues currently
After changing _/boot/config.txt_ you must reboot your raspberry pi. Please also ensure you followed setting up your screen via the screen instructions. This will likely have a xorg.conf.d file for input from the touchscreen that you need to create.
### Installation
# 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:
This install process is meant for Raspbian non-desktop version aka Raspbian Lite.
If you have installed it on the GUI version, then use `sudo raspi-config` to set boot to console by choosing the following options in order:
* 1 System Options
* S5 Boot / Auto Login
* B1 Console
* 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
Follow the instructions to install Klipper and Moonraker.
* klipper: https://www.klipper3d.org/Installation.html
* moonraker: https://moonraker.readthedocs.io/en/latest/installation/
Ensure that 127.0.0.1 is a trusted client for moonraker, such as in this example:
In moonraker.conf ensure that 127.0.0.1 is a trusted client for moonraker, such as in this example:
```
[authorization]
trusted_clients:
127.0.0.1
```
Note: `force_logins: true` requires the moonraker api key in [KlipperScreen.conf](Configuration.md)
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]
[update_manager KlipperScreen]
type: git_repo
path: /home/pi/KlipperScreen
path: ~/KlipperScreen
origin: https://github.com/jordanruthe/KlipperScreen.git
env: /home/pi/.KlipperScreen-env/bin/python
env: ~/.KlipperScreen-env/bin/python
requirements: scripts/KlipperScreen-requirements.txt
install_script: scripts/KlipperScreen-install.sh
```
#### KlipperScreen Installation
To clone and install execute the following commands:
Execute the following commands:
```
cd ~/
git clone https://github.com/jordanruthe/KlipperScreen.git
@@ -61,22 +46,9 @@ cd ~/KlipperScreen
```
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.
~/.KlipperScreen-env and install a systemd service file.
If you need a custom location for the configuration file, you can add -c or --configfile to the systemd file and specify
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>
```
At this point KlipperScreen should be working, check out the [hardware page](Hardware.md) if you still haven't installed the screen, or head to the [troubleshooting page](Troubleshooting.md) if you are having problems
+33
View File
@@ -0,0 +1,33 @@
# Theming
To create a custom theme, create a folder in: _${KlipperScreen_Directory}/styles/_
The folder name will be the theme name, in that folder create another folder named `images` this is where the icons should be placed. The icons must be SVG files and they need to have specific names that are defined in the code, use the default theme as a reference for the names or check the code.
To edit colors and styles, create a css file named `style.css` you can use the contents of another theme as a reference.
### Example 1
```
cd ~/KlipperScreen/styles
mkdir -p mytheme/images
cd mytheme
cp ../z-bolt/images/* images/
echo "window { background-color: red;}" > style.css
sudo service KlipperScreen restart
```
At this point `mytheme` should be on the list of themes, and when you select it the background should be red.
### Example 2
Creating a custom background from Mainsail sidebar and this css using Z-bolt icons
```
window { background-image: url("/home/pi/mainsail/img/background.svg");}
button {background-color: rgba(0,0,0,0); border-radius:2em;}
```
![Custom theme example with background](img/theme_example.png)
+48
View File
@@ -0,0 +1,48 @@
# Troubleshooting
This page will have common problems and common solutions to those problems.
## First Steps
The first step to troubleshooting any problem is getting the cause of the error. KlipperScreen log output will occur
in two places. Check for the file `/tmp/KlipperScreen.log` and look at the contents by running
`cat /tmp/KlipperScreen.log` or grabbing the file over WinSCP or another scp program.
If that file is non-existent, there is a problem in KlipperScreen starting up. To get the error output in this case,
run `journalctl -xe -u KlipperScreen`.
## Common Errors
### Problems occurring before the log file appears
This section will detail problems that may happen before the log file has been created. Each section will start with a
relevant line from the journalctl output.
#### Cannot open virtual Console
```
xf86OpenConsole: Cannot open virtual console 2 (Permission denied)
```
* Check /etc/X11/Xwrapper.conf
This should have the line `allowed_users=anybody` in it
* Check /etc/group
Run the command `cat /etc/group | grep tty`. If you username is not listed under that line, you need to add it with the
following command (if you username is not 'pi' change 'pi' to your username):
`usermode -a -G tty pi`
### Problems occurring with the log file
#### Screen shows console instead of KlipperScreen
Run the command `ls /dev/fb*`. If you have multiple devices, you may need to fix the X11 configuration.
Run the command `cat /usr/share/X11/xorg.conf.d/99-fbturbo.conf | grep /dev/fb`. Try modifying the file (
`sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf`) and change `/dev/fb0` to a different file listed in the
previous command (i.e. `/dev/fb1`).
Once you have saved that file, restart KlipperScreen and it should show up on your display.
#### Screen is all white or blank
Improperly installed screen, follow the manufacturer instructions on how to physically connect the screen and install the proper drivers.
+5 -86
View File
@@ -1,89 +1,8 @@
## Changelog
# 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)
Breaking changes will be listed here.
#### 2021 01 21
* Configure screen blanking from settings panel
#### 2021 05 20
* Default configuration is not merged if a user configuration is set for a specific option
#### 2021 01 21
* !! Important. matchbox-keyboard must be installed. Install script has changed to include this
* Added onscreen keyboard
* Can now add bed mesh profiles
#### 2021 01 20
* Add different time estimation methods to settings panel
* Job status panel will use time estimation method selected from settings panel
* Bugfixes to state tracking
#### 2021 01 10
* Added system reboot/shutdown buttons to systems panel.
#### 2021 01 09
* Better RTL support (most panels now properly support RTL)
* Fixes to install script for latest version of raspbian.
#### 2021 01 08
* Added settings panel. Invert axis and hiding macros can now be configured from within KlipperScreen
#### 2021 01 03
* Updated base language translation files with new phrases
* Allow translations from KlipperScreen.conf for
* Update menus for RTL languages
* Add fr_FR and he_IL language (courtesy of manu7irl)
#### 2020 12 21
* KlipperScreen doesn't have to be a trusted client. It can use the Moonraker API key
* Updates to job_status for multiple extruders. Will now show the current extruder.
* Updates to extrude panel to show multiple extruders and allow switching between them.
#### 2020 12 18
* Add gcode_macros panel
#### 2020 12 16
* Config file can now be specified when running from the command line
* Moonraker host/port can be specified in the configuration file
#### 2020 12 09
* Z value in job status now reflects the gcode Z value. This allows people with ABL to have a better understanding of Z
#### 2020 12 08
* Screen Width/Height are now definable in the configuration file
* Changed job page to allow for more information, display thumbnail of STL
* Job page will now say a job is complete and timeout to the main menu (time changeable from the config)
* Job page will now stay on the job page if there is an error.
* Restart option is available upon a completed/failed job
#### 2020 12 05
* Added ability to invert Z axis in move panel
* Fixed problem with metadata being retrieved constantly
#### 2020 12 04
* Removed fan options from fine tuning
* Add bed mesh panel
* Added more variables to the menu enable option
* Hide extrude panel during printing if the printer is not paused
* Add fan panel to print control menu
* Included screws_tilt_calculate gcode command into the bed level panel. This section must be configured in klipper.
#### 2020 12 02
* Change panel layout: Added Title, Back, Emergency Stop, and Home to panels.
#### 2020 11 28
* Add option for enable in menu for configuration. This can hide certain options
* Add Power panel to control power devices via moonraker
* Add klipper version to system panel
#### 2020 11 18
* Changed configuration file format.
* Moved default configuration file to an include folder.
* Added ability to do a confirm dialog from a menu item when running a script
* Added "Save Config" button to default configuration's Configuration menu.
#### 2020 11 14
* Update print panel to include line wrapping for longer filenames
#### 2020 11 13
* Fine Tuning Panel is now fully functional: Z BabyStepping, Fan Speed, Speed Factor, and Extrusion Factor
For instance, if `menu __main` is user defined, the main menu will not have any defaults.
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 14 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 11 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 267 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 12 KiB

+24
View File
@@ -0,0 +1,24 @@
# KlipperScreen
KlipperScreen is a touchscreen GUI that interfaces with [Klipper](https://github.com/kevinOConnor/klipper) via [Moonraker](https://github.com/arksine/moonraker). It can switch between multiple printers to access them from a single location, and it doesn't even need to run on the same host, you can install it on another device and configure the IP address to access the printer.
### Required Hardware
KlipperScreen should run on any touchscreen that you can connect to a host (Raspberry, PC, Tablet), but not screens that connect directly to the printer MCU board.
A physical touchscreen is not strictly required, for example you may install a remote desktop server like tigervnc-scraping-server and connect from a client device, ![check out the hardware page for further information.](Hardware.md)
### Sample Panels
Main Menu
![Main Menu](img/main_panel.png)
Job Status
![Job Status](img/job_status.png)
### Inspiration
KlipperScreen was inspired by [OctoScreen](https://github.com/Z-Bolt/OctoScreen/) and the need for a touchscreen GUI that
will natively work with [Klipper](https://github.com/klipper3d/klipper) and [Moonraker](https://github.com/arksine/moonraker).
[Changelog](changelog.md)
+23 -25
View File
@@ -1,21 +1,4 @@
## Panels
### Index
* [Main menu](#main-menu)
* [Job Status](#job-status)
* [bed_level](#bed-level)
* [extrude](#extrude)
* [fan](#fan)
* [fine_tune](#finetune)
* [gcode_macros](#gcode-macros)
* [move](#move)
* [network](#network)
* [preheat](#preheat)
* [print](#print)
* [system](#system)
* [temperature](#temperature)
* [zcalibrate](#zcalibrate)
# Panels
### Main Menu
![Main Menu](img/main_panel.png)
@@ -25,12 +8,12 @@
### Bed Level
type: bed_level
![Bed Level](img/bedlevel.png)
![Bed Level](img/bed_level.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)
* [bed_screws](https://www.klipper3d.org/Config_Reference.html#bed_screws)
* [screws_tilt_adjust](https://www.klipper3d.org/Config_Reference.html#screws_tilt_adjust)
_Important Note: Due to Klipper using the bltouch/probe offsets in screws_tilt_adjust, if a bltouch/probe is enabled_
_KlipperScreen will add the offset to the defined screw values. This will not occur if bed_screws section is used._
@@ -39,9 +22,12 @@ This panel will favor screws_tilt_adjust over the bed_screws section. If screws_
for _Screws Calibrate_ will appear. This button runs the SCREWS_TILT_CALCULATE command and shows the results on the
panel.
### Bed Mesh
type: bed_mesh theme:material-dark
![Bed Mesh](img/bed_mesh.png)
### Extrude
type: extrude
type: extrude theme:material-dark
![Extrude](img/extrude.png)
### Fan
@@ -49,11 +35,11 @@ type: fan
![Fan](img/fan.png)
### Fine Tune
type: fine_tune
type: fine_tune theme:custom
![Fine Tune Panel](img/fine_tune.png)
### Gcode Macros
type: gcode_macros
type: gcode_macros theme: material-darker
![Gcode Macros Panel](img/gcode_macros.png)
### Menu
@@ -68,6 +54,10 @@ type: move
type: network
![Network Panel](img/network.png)
### Power
type: power
![Power](img/power.png)
### Preheat
type: preheat
![Preheat Panel](img/preheat.png)
@@ -76,14 +66,22 @@ type: preheat
type: print
![Print Panel](img/print.png)
### Settings
type: settings theme:colorized
![Settings](img/settings.png)
### System
type: system
![System Panel](img/system.png)
### Temperature
type: temperature
type: temperature theme:material-light
![Temperature](img/temperature.png)
### Z Calibrate
type: zcalibrate
![Z Calibrate](img/zcalibrate.png)
### Limits
type: limits theme: material-dark
![Limits](img/limits.png)
+37 -25
View File
@@ -1,35 +1,39 @@
class KlippyGcodes:
HOME = "G28"
HOME_X = "G28 X"
HOME_Y = "G28 Y"
HOME_Z = "G28 Z"
HOME = "G28"
HOME_X = "G28 X"
HOME_Y = "G28 Y"
HOME_Z = "G28 Z"
HOME_XY = "G28 X Y"
Z_TILT = "Z_TILT_ADJUST"
QUAD_GANTRY_LEVEL = "QUAD_GANTRY_LEVEL"
MOVE = "G1"
MOVE_ABSOLUTE = "G90"
MOVE_RELATIVE = "G91"
MOVE = "G1"
MOVE_ABSOLUTE = "G90"
MOVE_RELATIVE = "G91"
EXTRUDE_ABS = "M82"
EXTRUDE_REL = "M83"
EXTRUDE_ABS = "M82"
EXTRUDE_REL = "M83"
SET_EXT_TEMP = "M104"
MAX_EXT_TEMP = 300
SET_EXT_TEMP = "M104"
MAX_EXT_TEMP = 450
SET_BED_TEMP = "M140"
MAX_BED_TEMP = 150
SET_BED_TEMP = "M140"
MAX_BED_TEMP = 150
SET_EXT_FACTOR = "M221"
SET_FAN_SPEED = "M106"
SET_SPD_FACTOR = "M220"
SET_EXT_FACTOR = "M221"
SET_FAN_SPEED = "M106"
SET_SPD_FACTOR = "M220"
PROBE_CALIBRATE = "PROBE_CALIBRATE"
PROBE_MOVE = "TESTZ Z="
PROBE_ABORT = "ABORT"
PROBE_ACCEPT = "ACCEPT"
Z_ENDSTOP_CALIBRATE = "Z_ENDSTOP_CALIBRATE"
TESTZ = "TESTZ Z="
ABORT = "ABORT"
ACCEPT = "ACCEPT"
SAVE_CONFIG = "SAVE_CONFIG"
RESTART = "RESTART"
FIRMWARE_RESTART= "FIRMWARE_RESTART"
SAVE_CONFIG = "SAVE_CONFIG"
RESTART = "RESTART"
FIRMWARE_RESTART = "FIRMWARE_RESTART"
@staticmethod
@@ -40,9 +44,17 @@ class KlippyGcodes:
def set_ext_temp(temp, tool=0):
return "%s T%s S%s" % (KlippyGcodes.SET_EXT_TEMP, str(tool), str(temp))
@staticmethod
def set_heater_temp(heater, temp):
return 'SET_HEATER_TEMPERATURE heater="%s" target=%s' % (heater, str(temp))
@staticmethod
def set_temp_fan_temp(temp_fan, temp):
return 'SET_TEMPERATURE_FAN_TARGET temperature_fan="%s" target=%s' % (temp_fan, str(temp))
@staticmethod
def set_fan_speed(speed):
speed = str( int(float(int(speed) % 101)/100*255) )
speed = str(int(float(int(speed) % 101)/100*255))
return "%s S%s" % (KlippyGcodes.SET_FAN_SPEED, speed)
@staticmethod
@@ -54,8 +66,8 @@ class KlippyGcodes:
return "%s S%s" % (KlippyGcodes.SET_SPD_FACTOR, rate)
@staticmethod
def probe_move(dist):
return KlippyGcodes.PROBE_MOVE + dist
def testz_move(dist):
return KlippyGcodes.TESTZ + dist
@staticmethod
def extrude(dist, speed=500):
+147 -63
View File
@@ -1,33 +1,49 @@
# -*- coding: utf-8 -*-
import gi
import logging
import os
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib, Pango
import os
klipperscreendir = os.getcwd()
from gi.repository import Gtk, Gdk, GdkPixbuf, Gio, GLib, Pango
logger = logging.getLogger("KlipperScreen.KlippyGtk")
klipperscreendir = os.getcwd()
class KlippyGtk:
labels = {}
font_ratio = 51
font_ratio = [43, 29]
keyboard_ratio = .22
width_ratio = 16
height_ratio = 9.375
def __init__(self, width, height):
def __init__(self, screen, width, height, theme, cursor, fontsize_type):
self.screen = screen
self.width = width
self.height = height
self.font_size = int(round(self.width / self.font_ratio))
self.theme = theme
self.font_size = int(min(
self.width / self.font_ratio[0],
self.height / self.font_ratio[1]
))
if fontsize_type == "small":
self.font_size = round(self.font_size * 0.91)
elif (fontsize_type == "large"):
self.font_size = round(self.font_size * 1.09)
self.header_size = int(round((self.width / self.width_ratio) / 1.33))
self.img_width = int(round(self.width / self.width_ratio))
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
self.cursor = cursor
logger.debug("img width: %s height: %s" % (self.img_width, self.img_height))
self.color_list = {} # This is set by screen.py init_style()
for key in self.color_list:
if "base" in self.color_list[key]:
rgb = [int(self.color_list[key]['base'][i:i+2], 16) for i in range(0, 6, 2)]
self.color_list[key]['rgb'] = rgb
logging.debug("img width: %s height: %s" % (self.img_width, self.img_height))
def get_action_bar_width(self):
return self.action_bar_width
@@ -38,6 +54,9 @@ class KlippyGtk:
def get_content_height(self):
return self.height - self.header_size
def get_font_size(self):
return self.font_size
def get_header_size(self):
return self.header_size
@@ -50,57 +69,115 @@ class KlippyGtk:
def get_image_height(self):
return self.img_height
def get_font_size(self):
return self.font_size
def get_keyboard_height(self):
return (self.width - self.get_action_bar_width()) * self.keyboard_ratio
def get_temp_color(self, device):
logging.debug("Color list %s" % self.color_list)
if device not in self.color_list:
return False, False
if 'base' in self.color_list[device]:
rgb = self.color_list[device]['rgb'].copy()
if self.color_list[device]['state'] > 0:
rgb[1] = rgb[1] + self.color_list[device]['hsplit'] * self.color_list[device]['state']
self.color_list[device]['state'] += 1
color = '{:02X}{:02X}{:02X}'.format(rgb[0], rgb[1], rgb[2])
rgb = [x/255 for x in rgb]
logging.debug("Assigning color: %s %s %s" % (device, rgb, color))
else:
colors = self.color_list[device]['colors']
if self.color_list[device]['state'] >= len(colors):
self.color_list[device]['state'] = 0
color = colors[self.color_list[device]['state'] % len(colors)]
rgb = [int(color[i:i+2], 16)/255 for i in range(0, 6, 2)]
self.color_list[device]['state'] += 1
logging.debug("Assigning color: %s %s %s" % (device, rgb, color))
return rgb, color
def reset_temp_color(self):
for key in self.color_list:
self.color_list[key]['state'] = 0
def Label(self, label, style=None):
l = Gtk.Label(label)
if style != None and style != False:
l.get_style_context().add_class(style)
return l
la = Gtk.Label(label)
if style is not None and style is not False:
la.get_style_context().add_class(style)
return la
def ImageLabel(self, image_name, text, size=20, style=False, width_scale=.32, height_scale=.32):
box1 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=15)
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
"%s/styles/z-bolt/images/%s.svg" % (klipperscreendir, str(image_name)),
"%s/styles/%s/images/%s.svg" % (klipperscreendir, self.theme, str(image_name)),
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
image = Gtk.Image.new_from_pixbuf(pixbuf)
label = Gtk.Label()
label.set_text(text)
label.set_markup(text)
box1.add(image)
box1.add(label)
if style != False:
if style is not False:
ctx = box1.get_style_context()
ctx.add_class(style)
return {"l": label, "b": box1}
def ImageMenuButton(self, image_name, text, size=20, style=False, width_scale=.32, height_scale=.32, popover=False):
box1 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=15)
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
"%s/styles/%s/images/%s.svg" % (klipperscreendir, self.theme, str(image_name)),
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
image = Gtk.Image.new_from_pixbuf(pixbuf)
mb = Gtk.MenuButton(label="", popover=popover)
label = mb.get_label()
box1.add(image)
box1.add(mb)
if style is not False:
ctx = box1.get_style_context()
ctx.add_class(style)
return {"l": label, "mb": mb, "b": box1}
def Image(self, image_name, style=False, width_scale=1, height_scale=1):
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
"%s/styles/z-bolt/images/%s" % (klipperscreendir, str(image_name)),
"%s/styles/%s/images/%s" % (klipperscreendir, self.theme, str(image_name)),
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
return Gtk.Image.new_from_pixbuf(pixbuf)
def ImageFromFile(self, filename, style=False, width_scale=1, height_scale=1):
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename,
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
filename, int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
return Gtk.Image.new_from_pixbuf(pixbuf)
def PixbufFromFile(self, filename, style=False, width_scale=1, height_scale=1):
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, int(round(self.img_width * width_scale)),
int(round(self.img_height * height_scale)), True)
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
filename, int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
return pixbuf
def PixbufFromHttp(self, resource, style=False, width_scale=1, height_scale=1):
response = self.screen.apiclient.get_thumbnail_stream(resource)
if response is False:
return None
stream = Gio.MemoryInputStream.new_from_data(response, None)
pixbuf = GdkPixbuf.Pixbuf.new_from_stream_at_scale(
stream, int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
return pixbuf
def ProgressBar(self, style=False):
bar = Gtk.ProgressBar()
if style != False:
if style is not False:
ctx = bar.get_style_context()
ctx.add_class(style)
@@ -113,25 +190,30 @@ class KlippyGtk:
b.set_can_focus(False)
b.props.relief = Gtk.ReliefStyle.NONE
if style != None:
if style is not None:
b.get_style_context().add_class(style)
return b
def ButtonImage(self, image_name, label=None, style=None, width_scale=1, height_scale=1,
position=Gtk.PositionType.TOP):
filename = "%s/styles/z-bolt/images/%s.svg" % (klipperscreendir, str(image_name))
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
filename,
int(round(self.img_width * width_scale)),
int(round(self.img_height * height_scale)),
True
)
img = Gtk.Image.new_from_pixbuf(pixbuf)
def ButtonImage(self, image_name, label=None, style=None, width_scale=1.38, height_scale=1.38,
position=Gtk.PositionType.TOP, word_wrap=True):
filename = "%s/styles/%s/images/%s.svg" % (klipperscreendir, self.theme, str(image_name))
if not os.path.exists(filename):
logging.error("Unable to find button image (theme, image): (%s, %s)" % (self.theme, str(image_name)))
filename = "%s/styles/%s/images/%s.svg" % (klipperscreendir, self.theme, "warning")
b = Gtk.Button(label=label)
b.set_image(img)
if os.path.exists(filename):
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
filename,
int(round(self.img_width * width_scale)),
int(round(self.img_height * height_scale)),
True
)
img = Gtk.Image.new_from_pixbuf(pixbuf)
b.set_image(img)
b.set_hexpand(True)
b.set_vexpand(True)
b.set_can_focus(False)
@@ -139,22 +221,23 @@ class KlippyGtk:
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 word_wrap is True:
try:
# Get the label object
child = b.get_children()[0].get_children()[0].get_children()[1]
child.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
child.set_line_wrap(True)
except Exception:
pass
if style != None:
if style is not None:
b.get_style_context().add_class(style)
return b
def Dialog(self, screen, buttons, content, callback=None, *args):
dialog = Gtk.Dialog()
dialog.set_default_size(screen.width - 15, screen.height - 15)
dialog.set_default_size(screen.width, screen.height)
dialog.set_resizable(False)
dialog.set_transient_for(screen)
dialog.set_modal(True)
@@ -165,27 +248,29 @@ class KlippyGtk:
dialog.connect("response", callback, *args)
dialog.get_style_context().add_class("dialog")
grid = Gtk.Grid()
grid.set_size_request(screen.width - 60, -1)
grid.set_vexpand(True)
grid.set_halign(Gtk.Align.CENTER)
grid.set_valign(Gtk.Align.CENTER)
grid.add(content)
box = Gtk.Box()
box.set_size_request(screen.width - 60, 0)
box.set_vexpand(True)
content_area = dialog.get_content_area()
content_area.set_margin_start(15)
content_area.set_margin_end(15)
content_area.set_margin_top(15)
content_area.set_margin_bottom(15)
content_area.add(grid)
content_area.add(content)
dialog.show_all()
# Change cursor to blank
if self.cursor:
dialog.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.ARROW))
else:
dialog.get_window().set_cursor(Gdk.Cursor(Gdk.CursorType.BLANK_CURSOR))
return dialog, grid
return dialog
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))
def ToggleButtonImage(self, image_name, label, style=False, width_scale=1.38, height_scale=1.38):
filename = "%s/styles/%s/images/%s.svg" % (klipperscreendir, self.theme, str(image_name))
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
filename,
int(round(self.img_width * width_scale)),
@@ -196,7 +281,6 @@ class KlippyGtk:
img = Gtk.Image.new_from_pixbuf(pixbuf)
b = Gtk.ToggleButton(label=label)
#b.props.relief = Gtk.RELIEF_NONE
b.set_image(img)
b.set_hexpand(True)
b.set_vexpand(True)
@@ -205,7 +289,7 @@ class KlippyGtk:
b.set_always_show_image(True)
b.props.relief = Gtk.ReliefStyle.NONE
if style != False:
if style is not False:
ctx = b.get_style_context()
ctx.add_class(style)
@@ -215,7 +299,7 @@ class KlippyGtk:
g = Gtk.Grid()
g.set_row_homogeneous(True)
g.set_column_homogeneous(True)
if width != None and height != None:
if width is not None and height is not None:
g.set_size_request(width, height)
return g
@@ -237,12 +321,12 @@ class KlippyGtk:
def formatTimeString(self, seconds):
time = int(seconds)
text = ""
if int(time/3600) !=0:
if int(time/3600) != 0:
text += str(int(time/3600))+"h "
text += str(int(time/60)%60)+"m "+str(time%60)+"s"
text += str(int(time/60) % 60)+"m "+str(time % 60)+"s"
return text
def formatTemperatureString(self, temp, target):
if (target > temp-2 and target < temp+2) or round(target,0) == 0:
return str(round(temp,2)) + "°C" #°C →"
if (target > temp-2 and target < temp+2) or round(target, 0) == 0:
return str(round(temp, 1)) + "°C" # °C →"
return str(round(temp)) + " → " + str(round(target)) + "°C"
+15 -9
View File
@@ -2,8 +2,6 @@ import json
import requests
import logging
logger = logging.getLogger("KlipperScreen.KlippyRest")
class KlippyRest:
def __init__(self, ip, port=7125, api_key=False):
self.ip = ip
@@ -15,29 +13,37 @@ class KlippyRest:
def get_oneshot_token(self):
r = self.send_request("access/oneshot_token")
if r == False:
if r is False:
return False
return r['result']
def get_printer_info(self):
return self.send_request("printer/info")
def get_thumbnail_stream(self, thumbnail):
url = "http://%s:%s/server/files/gcodes/%s" % (self.ip, self.port, thumbnail)
response = requests.get(url, stream=True)
if response.status_code == 200:
response.raw.decode_content = True
return response.content
return False
def send_request(self, method):
url = "http://%s:%s/%s" % (self.ip, self.port, method)
logger.debug("Sending request to %s" % url)
headers = {} if self.api_key == False else {"x-api-key":self.api_key}
logging.debug("Sending request to %s" % url)
headers = {} if self.api_key is False else {"x-api-key": self.api_key}
try:
r = requests.get(url, headers=headers)
except:
except Exception:
return False
if r.status_code != 200:
return False
#TODO: Try/except
# TODO: Try/except
try:
data = json.loads(r.content)
except:
logger.exception("Unable to parse response from moonraker:\n %s" % r.content)
except Exception:
logging.exception("Unable to parse response from moonraker:\n %s" % r.content)
return False
return data
+99 -63
View File
@@ -9,18 +9,15 @@ import requests
import websocket
import asyncio
import logging
logger = logging.getLogger("KlipperScreen.KlipperWebsocket")
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGcodes import KlippyGcodes
#f = open("/home/pi/.moonraker_api_key", "r")
api_key = "" #f.readline()
#f.close()
api_key = ""
api = {
"printer_info": {
"printer_info": {
"url": "/printer/info",
"method": "get_printer_info"
},
@@ -49,33 +46,49 @@ class KlippyWebsocket(threading.Thread):
def initial_connect(self):
# Enable a timeout so that way if moonraker is not running, it will attempt to reconnect
if self.timeout == None:
if self.timeout is None:
self.timeout = GLib.timeout_add(500, self.reconnect)
self.connect()
def connect(self):
def ws_on_close(ws, a=None, b=None):
self.on_close(ws)
def ws_on_error(ws, msg):
self.on_error(ws, msg)
def ws_on_message(ws, msg):
self.on_message(ws, msg)
def ws_on_open(ws):
self.on_open(ws)
def connect (self):
try:
state = self._screen.apiclient.get_server_info()
if state is False or state['result']['klippy_connected'] is False:
return False
printer_info = self._screen.apiclient.get_printer_info()
if printer_info is False:
return False
token = self._screen.apiclient.get_oneshot_token()
except:
logger.debug("Unable to get oneshot token")
except Exception:
logging.debug("Unable to get oneshot token")
return False
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),
on_close = lambda ws: self.on_close(ws),
on_open = lambda ws: self.on_open(ws)
)
self.ws = websocket.WebSocketApp(
self.ws_url, on_close=ws_on_close, on_error=ws_on_error, on_message=ws_on_message, on_open=ws_on_open)
self._wst = threading.Thread(target=self.ws.run_forever)
self._wst.daemon = True
try:
self._wst.start()
except Exception:
logger.debug("Error starting web socket")
logging.debug("Error starting web socket")
def close(self):
self.closing = True
self.ws.close()
def is_connected(self):
return self.connected
@@ -105,11 +118,11 @@ class KlippyWebsocket(threading.Thread):
return
def send_method(self, method, params={}, callback=None, *args):
if self.is_connected() == False:
if self.is_connected() is False:
return False
self._req_id += 1
if callback != None:
if callback is not None:
self.callback_table[self._req_id] = [callback, method, params, [*args]]
data = {
@@ -122,10 +135,12 @@ class KlippyWebsocket(threading.Thread):
return True
def on_open(self, ws):
logger.info("Moonraker Websocket Open")
logger.info("Self.connected = %s" % self.is_connected())
logging.info("Moonraker Websocket Open")
logging.info("Self.connected = %s" % self.is_connected())
self.connected = True
self.timeout = None
if self.timeout is not None:
GLib.source_remove(self.timeout)
self.timeout = None
if "on_connect" in self._callback:
Gdk.threads_add_idle(
GLib.PRIORITY_HIGH_IDLE,
@@ -133,61 +148,52 @@ class KlippyWebsocket(threading.Thread):
)
def on_close(self, ws):
if self.is_connected() == False:
logger.debug("Connection already closed")
if self.is_connected() is False:
logging.debug("Connection already closed")
return
if self.closing == True:
logger.debug("Closing websocket")
if self.closing is True:
logging.debug("Closing websocket")
self.ws.stop()
return
logger.info("Moonraker Websocket Closed")
logging.info("Moonraker Websocket Closed")
self.connected = False
if self.timeout == None:
if self.timeout is None:
self.timeout = GLib.timeout_add(500, self.reconnect)
if "on_close" in self._callback:
Gdk.threads_add_idle(
GLib.PRIORITY_HIGH_IDLE,
self._callback['on_close'],
"Lost Connection to Moonraker"
"Lost Connection to Moonraker",
True
)
def reconnect(self):
logger.debug("Attempting to reconnect")
if self.is_connected():
logger.debug("Reconnected")
logging.debug("Reconnected")
return False
logging.debug("Attempting to reconnect")
self.connect()
return True
def on_error(self, ws, 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"
)
logging.debug("Websocket error: %s" % error)
class MoonrakerApi:
def __init__ (self, ws):
def __init__(self, ws):
self._ws = ws
def emergency_stop(self):
logger.info("Sending printer.emergency_stop")
logging.info("Sending printer.emergency_stop")
return self._ws.send_method(
"printer.emergency_stop"
)
def gcode_script(self, script, callback=None, *args):
logger.debug("Sending printer.gcode.script: %s", script)
logging.debug("Sending printer.gcode.script: %s", script)
return self._ws.send_method(
"printer.gcode.script",
{"script": script},
@@ -195,9 +201,17 @@ class MoonrakerApi:
*args
)
def get_file_dir(self, path='gcodes', callback=None, *args):
logging.debug("Sending server.files.directory")
return self._ws.send_method(
"server.files.list",
{"path": path},
callback,
*args
)
def get_file_list(self, callback=None, *args):
#Commenting this log for being too noisy
#logger.debug("Sending server.files.list")
logging.debug("Sending server.files.list")
return self._ws.send_method(
"server.files.list",
{},
@@ -206,7 +220,6 @@ class MoonrakerApi:
)
def get_file_metadata(self, filename, callback=None, *args):
logger.debug("Sending server.files.metadata: %s", filename)
return self._ws.send_method(
"server.files.metadata",
{"filename": filename},
@@ -215,14 +228,14 @@ class MoonrakerApi:
)
def object_subscription(self, updates):
logger.debug("Sending printer.objects.subscribe: %s", str(updates))
logging.debug("Sending printer.objects.subscribe: %s", str(updates))
return self._ws.send_method(
"printer.objects.subscribe",
updates
)
def power_device_off(self, device, callback=None, *args):
logger.debug("Sending machine.device_power.off: %s" % device)
logging.debug("Sending machine.device_power.off: %s" % device)
return self._ws.send_method(
"machine.device_power.off",
{device: False},
@@ -231,7 +244,7 @@ class MoonrakerApi:
)
def power_device_on(self, device, callback=None, *args):
logger.debug("Sending machine.device_power.on %s" % device)
logging.debug("Sending machine.device_power.on %s" % device)
return self._ws.send_method(
"machine.device_power.on",
{device: False},
@@ -240,7 +253,7 @@ class MoonrakerApi:
)
def print_cancel(self, callback=None, *args):
logger.debug("Sending printer.print.cancel")
logging.debug("Sending printer.print.cancel")
return self._ws.send_method(
"printer.print.cancel",
{},
@@ -249,7 +262,7 @@ class MoonrakerApi:
)
def print_pause(self, callback=None, *args):
logger.debug("Sending printer.print.pause")
logging.debug("Sending printer.print.pause")
return self._ws.send_method(
"printer.print.pause",
{},
@@ -258,7 +271,7 @@ class MoonrakerApi:
)
def print_resume(self, callback=None, *args):
logger.debug("Sending printer.print.resume")
logging.debug("Sending printer.print.resume")
return self._ws.send_method(
"printer.print.resume",
{},
@@ -267,7 +280,7 @@ class MoonrakerApi:
)
def print_start(self, filename, callback=None, *args):
logger.debug("Sending printer.print.start")
logging.debug("Sending printer.print.start")
return self._ws.send_method(
"printer.print.start",
{
@@ -279,7 +292,7 @@ class MoonrakerApi:
def temperature_set(self, heater, target, callback=None, *args):
if heater == "heater_bed":
logger.debug("Sending printer.gcode.script: %s", KlippyGcodes.set_bed_temp(target))
logging.debug("Sending printer.gcode.script: %s", KlippyGcodes.set_bed_temp(target))
return self._ws.send_method(
"printer.gcode.script",
{
@@ -289,20 +302,21 @@ class MoonrakerApi:
*args
)
else:
logger.debug("Sending printer.gcode.script: %s",
KlippyGcodes.set_ext_temp(target, heater.replace("tool","")))
#TODO: Add max/min limits
logging.debug(
"Sending printer.gcode.script: %s",
KlippyGcodes.set_ext_temp(target, heater.replace("tool", "")))
# TODO: Add max/min limits
return self._ws.send_method(
"printer.gcode.script",
{
"script": KlippyGcodes.set_ext_temp(target, heater.replace("tool",""))
"script": KlippyGcodes.set_ext_temp(target, heater.replace("tool", ""))
},
callback,
*args
)
def set_bed_temp(self, target, callback=None, *args):
logger.debug("Sending set_bed_temp: %s", KlippyGcodes.set_bed_temp(target))
logging.debug("Sending set_bed_temp: %s", KlippyGcodes.set_bed_temp(target))
return self._ws.send_method(
"printer.gcode.script",
{
@@ -312,8 +326,30 @@ class MoonrakerApi:
*args
)
def set_heater_temp(self, heater, target, callback=None, *args):
logging.debug("Sending heater %s to temp: %s", heater, target)
return self._ws.send_method(
"printer.gcode.script",
{
"script": KlippyGcodes.set_heater_temp(heater, target)
},
callback,
*args
)
def set_temp_fan_temp(self, temp_fan, target, callback=None, *args):
logging.debug("Sending temperature fan %s to temp: %s", temp_fan, target)
return self._ws.send_method(
"printer.gcode.script",
{
"script": KlippyGcodes.set_temp_fan_temp(temp_fan, target)
},
callback,
*args
)
def set_tool_temp(self, tool, target, callback=None, *args):
logger.debug("Sending set_tool_temp: %s", KlippyGcodes.set_ext_temp(target, tool))
logging.debug("Sending set_tool_temp: %s", KlippyGcodes.set_ext_temp(target, tool))
return self._ws.send_method(
"printer.gcode.script",
{
@@ -324,13 +360,13 @@ class MoonrakerApi:
)
def restart(self):
logger.debug("Sending printer.restart")
logging.debug("Sending printer.restart")
return self._ws.send_method(
"printer.restart"
)
def restart_firmware(self):
logger.debug("Sending printer.firmware_restart")
logging.debug("Sending printer.firmware_restart")
return self._ws.send_method(
"printer.firmware_restart"
)
+202 -79
View File
@@ -1,22 +1,22 @@
import configparser
import gettext
import os
import logging
import json
import re
import copy
from io import StringIO
from os import path
logger = logging.getLogger("KlipperScreen.config")
SCREEN_BLANKING_OPTIONS = [
"300", #5 Minutes
"900", #15 Minutes
"1800", #30 Minutes
"3600", #1 Hour
"7200", #2 Hours
"14400", #4 Hours
"300", # 5 Minutes
"900", # 15 Minutes
"1800", # 30 Minutes
"3600", # 1 Hour
"7200", # 2 Hours
"14400", # 4 Hours
]
class ConfigError(Exception):
@@ -28,45 +28,11 @@ class KlipperScreenConfig:
do_not_edit_line = "#~# --- Do not edit below this line. This section is auto generated --- #~#"
do_not_edit_prefix = "#~#"
def __init__(self, configfile, lang=None, screen=None):
_ = lang.gettext
_n = lang.ngettext
self.configurable_options = [
{"invert_x": {"section": "main", "name": _("Invert X"), "type": "binary", "value": "False"}},
{"invert_y": {"section": "main", "name": _("Invert Y"), "type": "binary", "value": "False"}},
{"invert_z": {"section": "main", "name": _("Invert Z"), "type": "binary", "value": "False"}},
{"print_estimate_method": {"section": "main", "name": _("Estimated Time Method"), "type": "dropdown",
"value": "file","options":[
{"name": _("File Estimation (default)"), "value": "file"},
{"name": _("Duration Only"), "value": "duration"},
{"name": _("Filament Used"), "value": "filament"},
{"name": _("Slicer"), "value": "slicer"}
]}},
{"screen_blanking": {"section": "main", "name": _("Screen Blanking Time"), "type": "dropdown",
"value": "3600", "callback": screen.set_screenblanking_timeout, "options":[
{"name": _("Off"), "value": "off"}
]}}
#{"": {"section": "main", "name": _(""), "type": ""}}
]
index = self.configurable_options.index(
[i for i in self.configurable_options if list(i)[0]=="screen_blanking"][0])
for num in SCREEN_BLANKING_OPTIONS:
hour = int(int(num)/3600)
if hour > 0:
name = str(hour) + " " + _n("hour","hours", hour)
else:
name = str(int(int(num)/60)) + " " + _("minutes")
self.configurable_options[index]['screen_blanking']['options'].append({
"name": name,
"value": num
})
self.default_config_path = "%s/ks_includes/%s" % (os.getcwd(), self.configfile_name)
def __init__(self, configfile, screen=None):
self.default_config_path = "%s/ks_includes/%s" % (os.getcwd(), "defaults.conf")
self.config = configparser.ConfigParser()
self.config_path = self.get_config_file_location(configfile)
logger.debug("Config path location: %s" % self.config_path)
logging.debug("Config path location: %s" % self.config_path)
self.defined_config = None
try:
@@ -75,22 +41,37 @@ class KlipperScreenConfig:
user_def, saved_def = self.separate_saved_config(self.config_path)
self.defined_config = configparser.ConfigParser()
self.defined_config.read_string(user_def)
includes = [i[8:] for i in self.defined_config.sections() if i.startswith("include ")]
for include in includes:
self._include_config("/".join(self.config_path.split("/")[:-1]), include)
for i in ['menu __main', 'menu __print', 'menu __splashscreen', 'preheat']:
for j in self.defined_config.sections():
if j.startswith(i):
for k in list(self.config.sections()):
if k.startswith(i):
del self.config[k]
break
self.log_config(self.defined_config)
self.config.read_string(user_def)
if saved_def != None:
if saved_def is not None:
self.config.read_string(saved_def)
logging.info("====== Saved Def ======\n%s\n=======================" % saved_def)
except KeyError:
raise ConfigError(f"Error reading config: {self.config_path}")
except Exception:
logging.exception("Unknown error with config")
printers = [i for i in self.config.sections() if i.startswith("printer ")]
logger.debug("Printers: %s %s" % (len(printers), printers))
printers = sorted([i for i in self.config.sections() if i.startswith("printer ")])
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="")
"moonraker_api_key": self.config.get(printer, "moonraker_api_key", fallback=False)
}
})
if len(printers) <= 0:
@@ -102,7 +83,97 @@ class KlipperScreenConfig:
}
})
logger.debug("Configured printers: %s" % json.dumps(self.printers, indent=2))
conf_printers_debug = copy.deepcopy(self.printers)
for printer in conf_printers_debug:
name = list(printer)[0]
item = conf_printers_debug[conf_printers_debug.index(printer)]
if item[list(printer)[0]]['moonraker_api_key'] != "":
item[list(printer)[0]]['moonraker_api_key'] = "redacted"
logging.debug("Configured printers: %s" % json.dumps(conf_printers_debug, indent=2))
lang = self.get_main_config_option("language", None)
lang = [lang] if lang is not None and lang != "default" else None
logging.info("Detected language: %s" % lang)
self.lang = gettext.translation('KlipperScreen', localedir='ks_includes/locales', languages=lang,
fallback=True)
self._create_configurable_options(screen)
def _create_configurable_options(self, screen):
_ = self.lang.gettext
_n = self.lang.ngettext
self.configurable_options = [
{"invert_x": {"section": "main", "name": _("Invert X"), "type": "binary", "value": "False"}},
{"invert_y": {"section": "main", "name": _("Invert Y"), "type": "binary", "value": "False"}},
{"invert_z": {"section": "main", "name": _("Invert Z"), "type": "binary", "value": "False"}},
{"language": {"section": "main", "name": _("Language"), "type": "dropdown", "value": "system_lang",
"callback": screen.restart_warning, "options": [
{"name": _("System") + " " + _("(default)"), "value": "system_lang"}
]}},
{"move_speed": {
"section": "main", "name": _("Move Speed (mm/s)"), "type": "scale", "value": "20",
"range": [5, 100], "step": 1}},
{"print_sort_dir": {"section": "main", "type": None, "value": "name_asc"}},
{"print_estimate_method": {
"section": "main", "name": _("Estimated Time Method"), "type": "dropdown",
"value": "file", "options": [
{"name": _("File") + " " + _("(default)"), "value": "file"},
{"name": _("Duration Only"), "value": "duration"},
{"name": _("Filament Used"), "value": "filament"},
{"name": _("Slicer"), "value": "slicer"}]}},
{"screen_blanking": {
"section": "main", "name": _("Screen Power Off Time"), "type": "dropdown",
"value": "3600", "callback": screen.set_screenblanking_timeout, "options": [
{"name": _("Off"), "value": "off"}]
}},
{"theme": {
"section": "main", "name": _("Icon Theme"), "type": "dropdown",
"value": "z-bolt", "callback": screen.restart_warning, "options": [
{"name": "Z-bolt" + " " + _("(default)"), "value": "z-bolt"}]}},
{"24htime": {"section": "main", "name": _("24 Hour Time"), "type": "binary", "value": "True"}},
{"side_macro_shortcut": {
"section": "main", "name": _("Macro shortcut on sidebar"), "type": "binary",
"value": "True", "callback": screen.toggle_macro_shortcut}},
{"font_size": {
"section": "main", "name": _("Font Size"), "type": "dropdown",
"value": "medium", "callback": screen.restart_warning, "options": [
{"name": _("Small"), "value": "small"},
{"name": _("Medium") + " " + _("(default)"), "value": "medium"},
{"name": _("Large"), "value": "large"}]}},
{"confirm_estop": {"section": "main", "name": "Confirm Emergency Stop", "type": "binary",
"value": "False"}},
# {"": {"section": "main", "name": _(""), "type": ""}}
]
lang_path = os.path.join(os.getcwd(), 'ks_includes/locales')
langs = [d for d in os.listdir(lang_path) if not os.path.isfile(os.path.join(lang_path, d))]
langs.sort()
lang_opt = self.configurable_options[3]['language']['options']
for lang in langs:
lang_opt.append({"name": lang, "value": lang})
t_path = os.path.join(os.getcwd(), 'styles')
themes = [d for d in os.listdir(t_path) if (not os.path.isfile(os.path.join(t_path, d)) and d != "z-bolt")]
themes.sort()
theme_opt = self.configurable_options[8]['theme']['options']
for theme in themes:
theme_opt.append({"name": theme, "value": theme})
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
})
for item in self.configurable_options:
name = list(item)[0]
@@ -111,7 +182,37 @@ class KlipperScreenConfig:
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 _include_config(self, dir, path):
full_path = path if path[0] == "/" else "%s/%s" % (dir, path)
parse_files = []
if "*" in full_path:
parent_dir = "/".join(full_path.split("/")[:-1])
file = full_path.split("/")[-1]
if not os.path.exists(parent_dir):
logging.info("Config Error: Directory %s does not exist" % parent_dir)
return
files = os.listdir(parent_dir)
regex = "^%s$" % file.replace('*', '.*')
for file in files:
if re.match(regex, file):
parse_files.append(os.path.join(parent_dir, file))
else:
if not os.path.exists(os.path.join(full_path)):
logging.info("Config Error: %s does not exist" % full_path)
return
parse_files.append(full_path)
logging.info("Parsing files: %s" % parse_files)
for file in parse_files:
config = configparser.ConfigParser()
config.read(file)
includes = [i[8:] for i in config.sections() if i.startswith("include ")]
for include in includes:
self._include_config("/".join(full_path.split("/")[:-1]), include)
self.config.read(file)
self.defined_config.read(file)
def separate_saved_config(self, config_path):
user_def = []
@@ -121,25 +222,28 @@ class KlipperScreenConfig:
return [None, None]
with open(config_path) as file:
for line in file:
line = line.replace('\n','')
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',''))
if found_saved is 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)]
return ["\n".join(user_def), None if saved_def is None else "\n".join(saved_def)]
def get_config_file_location(self, file):
logging.info("Passed config file: %s" % file)
if not path.exists(file):
file = "%s/%s" % (os.getcwd(), self.configfile_name)
if not path.exists(file):
file = self.default_config_path
file = os.path.expanduser("~/") + "klipper_config/%s" % (self.configfile_name)
if not path.exists(file):
file = self.default_config_path
logger.info("Found configuration file at: %s" % file)
logging.info("Found configuration file at: %s" % file)
return file
def get_config(self):
@@ -148,6 +252,9 @@ class KlipperScreenConfig:
def get_configurable_options(self):
return self.configurable_options
def get_lang(self):
return self.lang
def get_main_config(self):
return self.config['main']
@@ -184,6 +291,14 @@ class KlipperScreenConfig:
return preheat_options
def get_printer_config(self, name):
if not name.startswith("printer "):
name = "printer %s" % name
if name not in self.config:
return None
return self.config[name]
def get_printer_power_name(self):
return self.config['settings'].get("printer_power_name", "printer")
@@ -201,22 +316,23 @@ class KlipperScreenConfig:
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)):
self.defined_config is not 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))
macro_sections = [i for i in self.config.sections() if i.startswith("displayed_macros")]
for macro_sec in macro_sections:
for item in self.config.options(macro_sec):
value = self.config[macro_sec].getboolean(item, fallback=True)
if value is False or (self.defined_config is not None and
macro_sec in self.defined_config.sections() and
self.defined_config[macro_sec].getboolean(item, fallback=True) is False and
self.defined_config[macro_sec].getboolean(item, fallback=True) != value):
if macro_sec not in save_config.sections():
save_config.add_section(macro_sec)
save_config.set(macro_sec, item, str(value))
save_output = self._build_config_string(save_config).split("\n")
for i in range(len(save_output)):
@@ -228,21 +344,26 @@ class KlipperScreenConfig:
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)
extra_lb = "\n" if saved_def is not 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")
path = os.path.expanduser("~/")
if os.path.exists(path+"klipper_config/"):
path = path + "klipper_config/KlipperScreen.conf"
else:
path = path + "KlipperScreen.conf"
try:
file = open(path, 'w')
file.write(contents)
file.close()
except:
logger.error("Error writing configuration file")
except Exception:
logging.error("Error writing configuration file in %s" % path)
def set(self, section, name, value):
self.config.set(section, name, value)
@@ -258,7 +379,7 @@ class KlipperScreenConfig:
),
"======================="
]
logger.info("\n".join(lines))
logging.info("\n".join(lines))
def _build_config_string(self, config):
sfile = StringIO()
@@ -281,8 +402,8 @@ class KlipperScreenConfig:
try:
item["params"] = json.loads(cfg.get("params", "{}"))
except:
logger.debug("Unable to parse parameters for [%s]" % name)
except Exception:
logging.debug("Unable to parse parameters for [%s]" % name)
item["params"] = {}
return {name[(len(menu) + 6):]: item}
@@ -293,6 +414,8 @@ class KlipperScreenConfig:
cfg = self.config[name]
item = {
"extruder": cfg.getint("extruder", 0),
"bed": cfg.getint("bed", 0)
"bed": cfg.getint("bed", 0),
"heater_generic": cfg.getint("heater_generic", 0),
"gcode": cfg.get("gcode", None)
}
return item
@@ -24,11 +24,11 @@ panel: preheat
[menu __main actions]
name: {{ gettext('Actions') }}
icon: actions
icon: move
[menu __main config]
name: {{ gettext('Configuration') }}
icon: control
icon: settings
[menu __main print]
name: {{ gettext('Print') }}
@@ -65,6 +65,21 @@ icon: home
method: printer.gcode.script
params: {"script":"G28 X Y"}
[menu __main homing 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 homing Z-Tilt]
name: {{ gettext('Z Tilt') }}
icon: z-tilt
method: printer.gcode.script
params: {"script":"Z_TILT_ADJUST"}
enable: {{ printer.z_tilt is defined }}
[menu __main actions move]
name: {{ gettext('Move') }}
icon: move
@@ -85,13 +100,6 @@ 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
@@ -110,6 +118,11 @@ icon: motor-off
method: printer.gcode.script
params: {"script":"M18"}
[menu __main actions console]
name: {{ gettext('Console') }}
icon: console
panel: console
[menu __main config bedlevel]
name: {{ gettext('Bed Level') }}
icon: bed-level
@@ -123,9 +136,13 @@ enable: {{ printer.bed_mesh is defined }}
[menu __main config zoffset]
name: {{ gettext('Z Calibrate') }}
icon: z-offset-increase
icon: z-farther
panel: zcalibrate
enable: {{ ((printer.bltouch is defined) or (printer.probe is defined)) }}
[menu __main config limits]
name: {{ gettext('Limits') }}
icon: fine-tune
panel: limits
[menu __main config network]
name: {{ gettext('Network') }}
@@ -160,11 +177,6 @@ name: {{ gettext('Temperature') }}
icon: heat-up
panel: temperature
[menu __print tuning]
name: {{ gettext('Fine Tuning') }}
icon: fan
panel: fine_tune
[menu __print fan]
name: {{ gettext('Fan') }}
icon: fan
@@ -182,6 +194,22 @@ icon: shutdown
panel: power
enable: {{ printer.power_devices.count > 0 }}
[menu __print macros]
name: {{ gettext('Macros') }}
icon: custom-script
panel: gcode_macros
enable: {{ printer.gcode_macros.count > 0 }}
[menu __print console]
name: {{ gettext('Console') }}
icon: console
panel: console
[menu __print limits]
name: {{ gettext('Limits') }}
icon: fine-tune
panel: limits
[menu __print network]
name: {{ gettext('Network') }}
icon: network
@@ -197,7 +225,6 @@ name: {{ gettext('Settings') }}
icon: settings
panel: settings
[menu __splashscreen]
name: {{ gettext('Menu') }}
@@ -216,3 +243,8 @@ panel: network
name: {{ gettext('System') }}
icon: info
panel: system
[menu __splashscreen settings]
name: {{ gettext('Settings') }}
icon: settings
panel: settings
+6
View File
@@ -0,0 +1,6 @@
#define emptyCursor_width 1
#define emptyCursor_height 1
#define emptyCursor_x_hot 0
#define emptyCursor_y_hot 0
static unsigned char emptyCursor_bits[] = {
0x00};
+117 -90
View File
@@ -1,129 +1,142 @@
import logging
import asyncio
import json
import os
import base64
from contextlib import suppress
from threading import Thread
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
logger = logging.getLogger("KlipperScreen.KlippyFiles")
RESCAN_INTERVAL = 4
class KlippyFiles(Thread):
callbacks = []
filelist = []
files = {}
metadata_timeout = {}
timeout = None
class KlippyFiles():
thumbnail_dir = "/tmp/.KS-thumbnails"
def __init__(self, screen, *args, **kwargs):
super().__init__(*args, **kwargs)
def __init__(self, screen):
self.loop = None
self._poll_task = None
self._screen = screen
self.callbacks = []
self.files = {}
self.filelist = []
self.metadata_timeout = {}
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)
self.gcodes_path = None
def initialize(self):
self.gcodes_path = None
if "virtual_sdcard" in self._screen.printer.get_config_section_list():
vsd = self._screen.printer.get_config_section("virtual_sdcard")
if "path" in vsd:
self.gcodes_path = vsd['path']
logging.info("Gcodes path: %s" % self.gcodes_path)
def _callback(self, result, method, params):
if method == "server.files.list":
if "result" in result and isinstance(result['result'],list):
if "result" in result and isinstance(result['result'], list):
newfiles = []
deletedfiles = self.filelist.copy()
for item in result['result']:
if item['filename'] in self.files:
deletedfiles.remove(item['filename'])
file = item['filename'] if "filename" in item else item['path']
if file in self.files:
deletedfiles.remove(file)
else:
newfiles.append(item['filename'])
logger.debug("New file: %s", item['filename'])
self.filelist.append(item['filename'])
self.files[item['filename']] = {
"size": item['size'],
"modified": item['modified']
}
self.request_metadata(item['filename'])
newfiles.append(file)
self.add_file(item, False)
if len(self.callbacks) > 0 and (len(newfiles) > 0 or len(deletedfiles) > 0):
logger.debug("Running callbacks...")
for cb in self.callbacks:
cb(newfiles, deletedfiles, [])
if len(newfiles) > 0 or len(deletedfiles) > 0:
self.run_callbacks(newfiles, deletedfiles)
if len(deletedfiles) > 0:
logger.debug("Deleted files: %s", deletedfiles)
for file in deletedfiles:
self.filelist.remove(file)
self.files.pop(file, None)
self.remove_file(file)
elif method == "server.files.directory":
if "result" in result:
dir = params['path'][7:] if params['path'].startswith('gcodes/') else params['path']
if dir[-1] == '/':
dir = dir[:-1]
newfiles = []
for file in result['result']['files']:
fullpath = "%s/%s" % (dir, file['filename'])
if fullpath not in self.filelist:
newfiles.append(fullpath)
if len(newfiles) > 0:
self.run_callbacks(newfiles)
elif method == "server.files.metadata":
if "error" in result.keys():
logger.debug("Error in getting metadata for %s. Retrying in 6 seconds" %(params['filename']))
logging.debug("Error in getting metadata for %s. Retrying in 6 seconds" % (params['filename']))
return
logger.debug("Got metadata for %s" % (result['result']['filename']))
for x in result['result']:
self.files[params['filename']][x] = result['result'][x]
if "thumbnails" in self.files[params['filename']]:
self.files[params['filename']]['thumbnails'].sort(key=lambda x: x['size'], reverse=True)
for thumbnail in self.files[params['filename']]['thumbnails']:
f = open("%s/%s-%s" % (self.thumbnail_dir, params['filename'].split('/')[-1], thumbnail['size']),
"wb")
f.write(base64.b64decode(thumbnail['data']))
f.close()
for cb in self.callbacks:
logger.debug("Running metadata callbacks")
cb([], [], [params['filename']])
thumbnail['local'] = False
if self.gcodes_path is not None:
fpath = os.path.join(self.gcodes_path, params['filename'])
fdir = os.path.dirname(fpath)
path = os.path.join(fdir, thumbnail['relative_path'])
if os.access(path, os.R_OK):
thumbnail['local'] = True
thumbnail['path'] = path
if thumbnail['local'] is False:
fdir = os.path.dirname(params['filename'])
thumbnail['path'] = os.path.join(fdir, thumbnail['relative_path'])
self.run_callbacks(mods=[params['filename']])
def add_file(self, item, notify=True):
if 'filename' not in item and 'path' not in item:
logging.info("Error adding item, unknown filename or path: %s" % item)
return
filename = item['path'] if "path" in item else item['filename']
if filename in self.filelist:
logging.info("File already exists: %s" % filename)
self.request_metadata(filename)
GLib.timeout_add(1000, self.run_callbacks, mods=[filename])
return
self.filelist.append(filename)
self.files[filename] = {
"size": item['size'],
"modified": item['modified']
}
self.request_metadata(filename)
if notify is True:
self.run_callbacks(newfiles=[filename])
def add_file_callback(self, callback):
try:
self.callbacks.append(callback)
except:
logger.debug("Callback not found: %s" % callback)
except Exception:
logging.debug("Callback not found: %s" % callback)
def process_update(self, data):
if 'item' in data and data['item']['root'] != 'gcodes':
return
if data['action'] == "create_dir":
self._screen._ws.klippy.get_file_dir("gcodes/%s" % data['item']['path'], self._callback)
elif data['action'] == "create_file":
self.add_file(data['item'])
elif data['action'] == "delete_file":
self.remove_file(data['item']['path'])
elif data['action'] == "modify_file":
self.request_metadata(data['item']['path'])
elif data['action'] == "move_file":
self.add_file(data['item'], False)
self.remove_file(data['source_item']['path'], False)
self.run_callbacks(newfiles=[data['item']['path']], deletedfiles=[data['source_item']['path']])
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
@@ -137,39 +150,53 @@ class KlippyFiles(Thread):
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'])
thumb = self.files[filename]['thumbnails'][0]
if thumb['local'] is False:
return ['http', thumb['path']]
return ['file', thumb['path']]
def has_thumbnail(self, filename):
if filename not in self.files:
return False
return "thumbnails" in self.files[filename] and len(self.files[filename]) > 0
def remove_timeout(self):
if self.timeout != None:
self.timeout = None
def request_metadata(self, filename):
if filename not in self.filelist:
return False
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
async def ret_files(self, retval=True):
logger.debug("Scanning for files")
if not self._screen._ws.klippy.get_file_list(self._callback):
self.timeout = None
def refresh_files(self):
self._screen._ws.klippy.get_file_list(self._callback)
def ret_file_data (self, filename):
def remove_file(self, filename, notify=True):
if filename not in self.filelist:
return
self.filelist.remove(filename)
self.files.pop(filename, None)
if notify is True:
self.run_callbacks(deletedfiles=[filename])
def ret_file_data(self, filename):
print("Getting file info for %s" % (filename))
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
def run_callbacks(self, newfiles=[], deletedfiles=[], mods=[]):
if len(self.callbacks) <= 0:
return
for cb in self.callbacks:
GLib.idle_add(cb, newfiles, deletedfiles, mods)
return False
def get_file_list(self):
return self.filelist
def get_file_info(self, filename):
if filename not in self.files:
return None
return {"path": None, "modified": 0, "size": 0}
return self.files[filename]
def add_file(self, file_name, size, modified, old_file_name = None):
print(file_name)
+170
View File
@@ -0,0 +1,170 @@
import logging
import logging.handlers
import os
import re
import subprocess
import sys
import threading
import time
import traceback
from queue import SimpleQueue as Queue
import ctypes
import struct
dpms_loaded = False
try:
ctypes.cdll.LoadLibrary('libXext.so.6')
libXext = ctypes.CDLL('libXext.so.6')
class DPMS_State:
Fail = -1
On = 0
Standby = 1
Suspend = 2
Off = 3
def get_DPMS_state(display_name_in_byte_string=b':0'):
state = DPMS_State.Fail
if not isinstance(display_name_in_byte_string, bytes):
raise TypeError
display_name = ctypes.c_char_p()
display_name.value = display_name_in_byte_string
libXext.XOpenDisplay.restype = ctypes.c_void_p
display = ctypes.c_void_p(libXext.XOpenDisplay(display_name))
dummy1_i_p = ctypes.create_string_buffer(8)
dummy2_i_p = ctypes.create_string_buffer(8)
if display.value:
if libXext.DPMSQueryExtension(display, dummy1_i_p, dummy2_i_p)\
and libXext.DPMSCapable(display):
onoff_p = ctypes.create_string_buffer(1)
state_p = ctypes.create_string_buffer(2)
if libXext.DPMSInfo(display, state_p, onoff_p):
onoff = struct.unpack('B', onoff_p.raw)[0]
if onoff:
state = struct.unpack('H', state_p.raw)[0]
libXext.XCloseDisplay(display)
return state
dpms_loaded = True
except Exception:
pass
def get_network_interfaces():
stream = os.popen("ip addr | grep ^'[0-9]' | cut -d ' ' -f 2 | grep -o '[a-zA-Z0-9\\.]*'")
return [i for i in stream.read().strip().split('\n') if not i.startswith('lo')]
def get_wireless_interfaces():
p = subprocess.Popen(["which", "iwconfig"], stdout=subprocess.PIPE)
while p.poll() is None:
time.sleep(.1)
if p.poll() != 0:
return None
try:
p = subprocess.Popen(["iwconfig"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
result = p.stdout.read().decode('ascii').split('\n')
except Exception:
logging.info("Error with running iwconfig command")
return None
interfaces = []
for line in result:
match = re.search('^(\\S+)\\s+.*$', line)
if match:
interfaces.append(match.group(1))
return interfaces
def get_software_version():
prog = ('git', '-C', os.path.dirname(__file__), 'describe', '--always',
'--tags', '--long', '--dirty')
try:
process = subprocess.Popen(prog, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
ver, err = process.communicate()
retcode = process.wait()
if retcode == 0:
version = ver.strip()
if isinstance(version, bytes):
version = version.decode()
return version
else:
logging.debug(f"Error getting git version: {err}")
except OSError:
logging.exception("Error runing git describe")
return "?"
def patch_threading_excepthook():
"""Installs our exception handler into the threading modules Thread object
Inspired by https://bugs.python.org/issue1230540
"""
old_init = threading.Thread.__init__
def new_init(self, *args, **kwargs):
old_init(self, *args, **kwargs)
old_run = self.run
def run_with_excepthook(*args, **kwargs):
try:
old_run(*args, **kwargs)
except (KeyboardInterrupt, SystemExit):
raise
except Exception:
sys.excepthook(*sys.exc_info(), thread_identifier=threading.get_ident())
self.run = run_with_excepthook
threading.Thread.__init__ = new_init
# Timed rotating file handler based on Klipper and Moonraker's implementation
class KlipperScreenLoggingHandler(logging.handlers.TimedRotatingFileHandler):
def __init__(self, software_version, filename, **kwargs):
super(KlipperScreenLoggingHandler, self).__init__(filename, **kwargs)
self.rollover_info = {
'header': f"{'-'*20}KlipperScreen Log Start{'-'*20}",
'version': f"Git Version: {software_version}",
}
lines = [line for line in self.rollover_info.values() if line]
if self.stream is not None:
self.stream.write("\n".join(lines) + "\n")
def set_rollover_info(self, name, item):
self.rollover_info[name] = item
def doRollover(self):
super(KlipperScreenLoggingHandler, self).doRollover()
lines = [line for line in self.rollover_info.values() if line]
if self.stream is not None:
self.stream.write("\n".join(lines) + "\n")
# Logging based on Arksine's logging setup
def setup_logging(log_file, software_version):
root_logger = logging.getLogger()
queue = Queue()
queue_handler = logging.handlers.QueueHandler(queue)
root_logger.addHandler(queue_handler)
root_logger.setLevel(logging.DEBUG)
stdout_hdlr = logging.StreamHandler(sys.stdout)
stdout_fmt = logging.Formatter(
'%(asctime)s [%(filename)s:%(funcName)s()] - %(message)s')
stdout_hdlr.setFormatter(stdout_fmt)
fh = None
if log_file:
fh = KlipperScreenLoggingHandler(software_version, log_file, when='midnight', backupCount=2)
formatter = logging.Formatter(
'%(asctime)s [%(filename)s:%(funcName)s()] - %(message)s')
fh.setFormatter(formatter)
listener = logging.handlers.QueueListener(
queue, fh, stdout_hdlr)
else:
listener = logging.handlers.QueueListener(
queue, stdout_hdlr)
listener.start()
def logging_exception_handler(type, value, tb, thread_identifier=None):
logging.exception(
"Uncaught exception %s: %s\nTraceback: %s" % (type, value, "\n".join(traceback.format_tb(tb))))
sys.excepthook = logging_exception_handler
logging.captureWarnings(True)
return listener, fh
+168 -165
View File
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-02-11 22:13+0100\n"
"POT-Creation-Date: 2021-11-18 11:29-0300\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,519 +17,522 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: panels/print.py:247
msgid "?"
#, python-format
msgid "%d Packages will be updated"
msgstr ""
#, python-format
msgid "%s will be updated to version"
msgstr ""
msgid "(default)"
msgstr ""
msgid "24 Hour Time"
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 Printer"
msgstr ""
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 "Cancelled"
msgstr ""
msgid "Cancelling"
msgstr ""
msgid "Channel"
msgstr ""
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
#: panels/bed_mesh.py:290 panels/temperature.py:150
msgid "Close"
msgstr ""
#: ks_includes/KlipperScreen.conf:30
msgid "Complete"
msgstr ""
msgid "Configuration"
msgstr ""
#: screen.py:492
msgid "Connected"
msgstr ""
#, python-format
msgid "Connecting to %s"
msgstr ""
msgid "Console"
msgstr ""
msgid "Continue"
msgstr ""
#: panels/job_status.py:270
msgid "Control"
msgstr ""
#: panels/preheat.py:54
msgid "Cooldown"
msgstr ""
#: panels/print.py:24
msgid "Date"
msgstr ""
#: panels/temperature.py:53
msgid "Decrease"
msgstr ""
#: panels/bed_mesh.py:122
msgid "Delete"
msgstr ""
#: ks_includes/KlipperScreen.conf:108
msgid "Disable Motors"
msgstr ""
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr ""
#: panels/settings.py:28
msgid "Disconnect"
msgstr ""
msgid "Displayed Macros"
msgstr ""
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr ""
#: ks_includes/config.py:42
#, python-format
msgid "Do you want to recover %s?"
msgstr ""
msgid "Duration Only"
msgstr ""
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr ""
#: panels/job_status.py:272
msgid "Emergency Stop"
msgid "Error"
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)"
msgid "File"
msgstr ""
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr ""
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Finish"
msgstr ""
msgid "Firmware Restart"
msgstr ""
#: screen.py:300 panels/job_status.py:302
msgid "Font Size"
msgstr ""
msgid "Go Back"
msgstr ""
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
msgid "Home"
msgstr ""
msgid "Home All"
msgstr ""
#: ks_includes/KlipperScreen.conf:45
msgid "Home X"
msgstr ""
#: ks_includes/KlipperScreen.conf:63
msgid "Home XY"
msgstr ""
#: ks_includes/KlipperScreen.conf:51
msgid "Home Y"
msgstr ""
#: ks_includes/KlipperScreen.conf:57
msgid "Home Z"
msgstr ""
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
msgid "Homing"
msgstr ""
#: panels/temperature.py:51
msgid "Hostname"
msgstr ""
msgid "IPv4"
msgstr ""
msgid "IPv6"
msgstr ""
msgid "Icon Theme"
msgstr ""
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 "Interface"
msgstr ""
msgid "Invalid"
msgstr ""
msgid "Invert X"
msgstr ""
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr ""
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr ""
#: panels/system.py:22
msgid "Klipper Restart"
msgstr ""
#: panels/system.py:42
msgid "Klipper Version"
msgstr ""
#: screen.py:418
msgid "Klipper has disconnected"
msgstr ""
#: screen.py:429
msgid ""
"Klipper has encountered an error with the micro-controller.\n"
"Please recompile and flash."
msgstr ""
#: screen.py:433
msgid "Klipper has encountered an error."
msgstr ""
#: screen.py:425
msgid ""
"Klipper has encountered an error.\n"
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
msgstr ""
#: screen.py:453
msgid "Klipper has shutdown"
msgstr ""
#: screen.py:449
msgid "Klipper is attempting to start"
msgstr ""
#: ks_includes/KlipperScreen.conf:148
msgid "Klipper will reboot"
msgstr ""
#: panels/system.py:46
msgid "KlipperScreen Version"
msgstr ""
#: panels/job_status.py:124
msgid "Language"
msgstr ""
msgid "Large"
msgstr ""
msgid "Left:"
msgstr ""
#: panels/bed_mesh.py:98
msgid "Limits"
msgstr ""
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 "Macro shortcut on sidebar"
msgstr ""
msgid "Macros"
msgstr ""
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr ""
#: panels/extrude.py:31
msgid "Max Accelation"
msgstr ""
msgid "Max Acceleration to Deceleration"
msgstr ""
msgid "Max Velocity"
msgstr ""
msgid "Medium"
msgstr ""
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
msgid "Menu"
msgstr ""
#: ks_includes/KlipperScreen.conf:69
msgid "Modified"
msgstr ""
msgid "Move"
msgstr ""
#: panels/move.py:91
msgid "Move Distance (mm)"
msgstr ""
#: panels/print.py:23
msgid "Move Speed (mm/s)"
msgstr ""
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
#, python-format
msgid "Outdated by %d commits:"
msgstr ""
msgid "PSK for"
msgstr ""
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 "Printer Connections"
msgstr ""
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 "Recover Hard"
msgstr ""
msgid "Recover Soft"
msgstr ""
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"
msgid "Screen Power Off Time"
msgstr ""
msgid "Screen will show in less than one second"
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"
msgid "Small"
msgstr ""
#: panels/print.py:39
msgid "Sort by: "
msgstr ""
#: panels/fine_tune.py:47
msgid "Speed (mm/s)"
msgstr ""
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 "Square Corner Velocity"
msgstr ""
msgid "Start"
msgstr ""
msgid "Starting WiFi Re-association"
msgstr ""
msgid "Starting recovery for"
msgstr ""
msgid "Starting update for"
msgstr ""
msgid "System"
msgstr ""
#: panels/system.py:27
msgid ""
"System\n"
"Restart"
msgstr ""
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
msgstr ""
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
#: ks_includes/KlipperScreen.conf:159
msgid "Temperature"
msgstr ""
#: panels/extrude.py:38
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr ""
msgid "Tool"
msgstr ""
#: panels/print.py:167
msgid "Unload"
msgstr ""
msgid "Up To Date"
msgstr ""
msgid "Update"
msgstr ""
msgid "Uploaded"
msgstr ""
#: panels/move.py:25
msgid "View Mesh"
msgstr ""
msgid "X+"
msgstr ""
#: panels/move.py:27
msgid "X-"
msgstr ""
#: panels/move.py:30
msgid "Y+"
msgstr ""
#: panels/move.py:32
msgid "Y-"
msgstr ""
#: ks_includes/KlipperScreen.conf:125
msgid "Z Calibrate"
msgstr ""
#: panels/zcalibrate.py:28
msgid "Z Offset"
msgstr ""
#: panels/fine_tune.py:36 panels/move.py:35
msgid "Z Tilt"
msgstr ""
msgid "Z+"
msgstr ""
#: panels/fine_tune.py:40 panels/move.py:37
msgid "Z-"
msgstr ""
#: ks_includes/config.py:60
msgid "dBm"
msgstr ""
msgid "minutes"
msgstr ""
#: panels/fine_tune.py:38
msgid "mm"
msgstr ""
msgid "mm/s"
msgstr ""
msgid "mm/s^2"
msgstr ""
@@ -1,83 +1,87 @@
# 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 Elektrickser@gmail.com, 2021
#
# 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"
"POT-Creation-Date: 2021-11-18 11:29-0300\n"
"PO-Revision-Date: 2021-11-18 11:32-0300\n"
"Last-Translator: \n"
"Language-Team: \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"
"X-Generator: Poedit 3.0\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: panels/print.py:247
msgid "?"
msgstr "?"
#, python-format
msgid "%d Packages will be updated"
msgstr "%d Pakete werden aktualisiert"
#, python-format
msgid "%s will be updated to version"
msgstr "%s wird aktualisiert auf Version"
msgid "(default)"
msgstr "(Standard)"
msgid "24 Hour Time"
msgstr "24h-Zeit"
#: 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 Printer"
msgstr "Drucker hinzufügen"
msgid "Add bed mesh profile"
msgstr "Druckbett Mesh Profil hinzufügen"
msgstr "Mesh-Level 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"
msgstr "Höheneinstellung"
#: 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 "Cancelled"
msgstr "Abgebrochen"
#, fuzzy
#| msgid "Cancel"
msgid "Cancelling"
msgstr "Abbruch"
msgid "Channel"
msgstr "Kanal"
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
@@ -85,195 +89,183 @@ 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 "Colorized"
msgstr "Colorized"
msgid "Complete"
msgstr "Fertiggestellt"
msgid "Configuration"
msgstr "Einstellungen"
#: screen.py:492
msgid "Connected"
msgstr "Verbunden"
#, python-format
msgid "Connecting to %s"
msgstr "Verbinden zu %s"
msgid "Console"
msgstr "Konsole"
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 "Disconnect"
msgstr "Nicht verbunden"
msgid "Displayed Macros"
msgstr "Aktive Macros"
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr "Entfernung (mm)"
#: ks_includes/config.py:42
#, python-format
msgid "Do you want to recover %s?"
msgstr "Möchtest du zurück zu %s?"
msgid "Duration Only"
msgstr "Reine Druckzeit"
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr "Verstrichene Zeit:"
msgstr "Druckzeit:"
#: panels/job_status.py:272
msgid "Emergency Stop"
msgstr "NOT-STOP"
msgid "Error"
msgstr "Fehler"
#: 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)"
msgid "File"
msgstr "Datei"
#: 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"
msgid "Finish"
msgstr "Ziel"
msgid "Firmware Restart"
msgstr "Firmware neustarten"
msgid "Font Size"
msgstr "Schriftgröße"
#: 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"
msgstr "Grundposition"
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 "Hostname"
msgstr "Hostname"
msgid "IPv4"
msgstr "IPv4"
msgid "IPv6"
msgstr "IPv6"
msgid "Icon Theme"
msgstr "Icon Theme"
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 "Interface"
msgstr "Interface"
msgid "Invalid"
msgstr "ungültig"
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"
msgstr "Klipper 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."
@@ -281,11 +273,9 @@ 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."
@@ -293,203 +283,205 @@ 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 "Language"
msgstr "Sprache"
msgid "Large"
msgstr "Groß"
msgid "Left:"
msgstr "Restzeit:"
#: panels/bed_mesh.py:98
msgid "Limits"
msgstr "Grenzwerte:"
msgid "Load"
msgstr "Belastung"
msgstr "Laden"
#: 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 "Macro shortcut on sidebar"
msgstr "Makro Verknüpfung in Sidebar"
msgid "Macros"
msgstr "Makros"
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr "Hauptmenü"
#: panels/extrude.py:31
msgid "Max Accelation"
msgstr "Max Beschleunigung"
msgid "Max Acceleration to Deceleration"
msgstr "Max Verzögerung"
msgid "Max Velocity"
msgstr "Max Geschwindigkeit"
msgid "Medium"
msgstr "Mittel"
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
msgid "Menu"
msgstr "Menü"
#: ks_includes/KlipperScreen.conf:69
msgid "Modified"
msgstr "Modifiziert"
msgid "Move"
msgstr "Bewegen"
#: panels/move.py:91
msgid "Move Distance (mm)"
msgstr "Bewegungsdistanz (mm)"
#: panels/print.py:23
msgid "Move Speed (mm/s)"
msgstr "Bewegungsgeschwindigkeit (mm/s)"
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"
msgstr "Aus"
#, python-format
msgid "Outdated by %d commits:"
msgstr "Veraltet bis %d Commits:"
msgid "PSK for"
msgstr "PSK für"
#: 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 "Printer Connections"
msgstr "Drucker Verbindungen"
msgid "Printing"
msgstr "Drucken"
#: panels/bed_mesh.py:264
msgid "Profile Name:"
msgstr "Profil Name:"
msgstr "Profilname:"
#: 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 "Recover Hard"
msgstr "Wiederherstellung Hart"
msgid "Recover Soft"
msgstr "Wiederherstellung Soft"
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"
msgid "Screen Power Off Time"
msgstr "Bildschirm abschalten in"
msgid "Screen will show in less than one second"
msgstr "Der Bildschirm wird in weniger als einer Sekunde angezeigt"
#: 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"
msgid "Small"
msgstr "Klein"
#: panels/print.py:39
msgid "Sort by: "
msgstr "Sortieren nach: "
msgstr "Sortierung:"
msgid "Speed (mm/s)"
msgstr "Geschwindigkeit (mm/s)"
#: 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 "Square Corner Velocity"
msgstr "Eckgeschwindigkeit"
msgid "Start"
msgstr "Starten"
msgid "Starting WiFi Re-association"
msgstr "Starte WiFi Verbindung"
msgid "Starting recovery for"
msgstr "Starte Wiederherstellung für "
msgid "Starting update for"
msgstr "Starte Update für"
msgid "System"
msgstr "System"
#: panels/system.py:27
msgid ""
"System\n"
"Restart"
@@ -497,7 +489,6 @@ msgstr ""
"Drucker\n"
"Neustarten"
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
@@ -505,58 +496,84 @@ 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
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Zum Übernehmen von %s benötigt Klipperscreen einen Neustart"
msgid "Tool"
msgstr "Druckkopf"
#: panels/print.py:167
msgid "Unload"
msgstr "Entladen"
msgid "Up To Date"
msgstr "Kein Update verfügbar"
msgid "Update"
msgstr "Update"
msgid "Uploaded"
msgstr "Hochgeladen"
#: panels/move.py:25
msgid "View Mesh"
msgstr "Mesh anzeigen"
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 Tilt"
msgstr "Z-Achse ausrichten"
msgid "Z+"
msgstr "Z+"
#: panels/fine_tune.py:40 panels/move.py:37
msgid "Z-"
msgstr "Z-"
#: ks_includes/config.py:60
msgid "dBm"
msgstr "dBm"
msgid "minutes"
msgstr "Minuten"
#: panels/fine_tune.py:38
msgid "mm"
msgstr "mm"
#~ msgid "Klipper"
#~ msgstr "Klipper"
msgid "mm/s"
msgstr "mm/s"
msgid "mm/s^2"
msgstr "mm/s^2"
#~ msgid "?"
#~ msgstr "?"
#~ msgid "Are you sure you want to print"
#~ msgstr "Möchten Sie wirklich drucken"
#~ msgid "Cancel Change"
#~ msgstr "Änderung abbrechen"
#~ msgid "Control"
#~ msgstr "Steuerung"
#~ msgid "Load Average"
#~ msgstr "Durchschnittslast"
Binary file not shown.
@@ -1,516 +1,522 @@
#: panels/print.py:247
msgid "?"
msgid ""
msgstr ""
#: panels/zcalibrate.py:71
msgid "Abort"
msgstr "Abort"
#, python-format
msgid "%d Packages will be updated"
msgstr ""
#, python-format
msgid "%s will be updated to version"
msgstr ""
msgid "(default)"
msgstr ""
msgid "24 Hour Time"
msgstr ""
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 Printer"
msgstr ""
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 "Cancelled"
msgstr ""
msgid "Cancelling"
msgstr ""
msgid "Channel"
msgstr ""
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
#: panels/bed_mesh.py:290 panels/temperature.py:150
msgid "Close"
msgstr ""
#: ks_includes/KlipperScreen.conf:30
msgid "Complete"
msgstr ""
msgid "Configuration"
msgstr ""
#: screen.py:492
msgid "Connected"
msgstr ""
#, python-format
msgid "Connecting to %s"
msgstr ""
msgid "Console"
msgstr ""
msgid "Continue"
msgstr ""
#: panels/job_status.py:270
msgid "Control"
msgstr ""
#: panels/preheat.py:54
msgid "Cooldown"
msgstr ""
#: panels/print.py:24
msgid "Date"
msgstr ""
#: panels/temperature.py:53
msgid "Decrease"
msgstr ""
#: panels/bed_mesh.py:122
msgid "Delete"
msgstr ""
#: ks_includes/KlipperScreen.conf:108
msgid "Disable Motors"
msgstr ""
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr ""
#: panels/settings.py:28
msgid "Disconnect"
msgstr ""
msgid "Displayed Macros"
msgstr ""
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr ""
#: ks_includes/config.py:42
#, python-format
msgid "Do you want to recover %s?"
msgstr ""
msgid "Duration Only"
msgstr ""
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr ""
#: panels/job_status.py:272
msgid "Emergency Stop"
msgid "Error"
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)"
msgid "File"
msgstr ""
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr ""
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Finish"
msgstr ""
msgid "Firmware Restart"
msgstr ""
#: screen.py:300 panels/job_status.py:302
msgid "Font Size"
msgstr ""
msgid "Go Back"
msgstr ""
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
msgid "Home"
msgstr ""
msgid "Home All"
msgstr ""
#: ks_includes/KlipperScreen.conf:45
msgid "Home X"
msgstr ""
#: ks_includes/KlipperScreen.conf:63
msgid "Home XY"
msgstr ""
#: ks_includes/KlipperScreen.conf:51
msgid "Home Y"
msgstr ""
#: ks_includes/KlipperScreen.conf:57
msgid "Home Z"
msgstr ""
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
msgid "Homing"
msgstr ""
#: panels/temperature.py:51
msgid "Hostname"
msgstr ""
msgid "IPv4"
msgstr ""
msgid "IPv6"
msgstr ""
msgid "Icon Theme"
msgstr ""
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 "Interface"
msgstr ""
msgid "Invalid"
msgstr ""
msgid "Invert X"
msgstr ""
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr ""
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr ""
#: panels/system.py:22
msgid "Klipper Restart"
msgstr ""
#: panels/system.py:42
msgid "Klipper Version"
msgstr ""
#: screen.py:418
msgid "Klipper has disconnected"
msgstr ""
#: screen.py:429
msgid ""
"Klipper has encountered an error with the micro-controller.\n"
"Please recompile and flash."
msgstr ""
#: screen.py:433
msgid "Klipper has encountered an error."
msgstr ""
#: screen.py:425
msgid ""
"Klipper has encountered an error.\n"
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
msgstr ""
#: screen.py:453
msgid "Klipper has shutdown"
msgstr ""
#: screen.py:449
msgid "Klipper is attempting to start"
msgstr ""
#: ks_includes/KlipperScreen.conf:148
msgid "Klipper will reboot"
msgstr ""
#: panels/system.py:46
msgid "KlipperScreen Version"
msgstr ""
#: panels/job_status.py:124
msgid "Language"
msgstr ""
msgid "Large"
msgstr ""
msgid "Left:"
msgstr ""
#: panels/bed_mesh.py:98
msgid "Limits"
msgstr ""
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 "Macro shortcut on sidebar"
msgstr ""
msgid "Macros"
msgstr ""
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr ""
#: panels/extrude.py:31
msgid "Max Accelation"
msgstr ""
msgid "Max Acceleration to Deceleration"
msgstr ""
msgid "Max Velocity"
msgstr ""
msgid "Medium"
msgstr ""
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
msgid "Menu"
msgstr ""
#: ks_includes/KlipperScreen.conf:69
msgid "Modified"
msgstr ""
msgid "Move"
msgstr ""
#: panels/move.py:91
msgid "Move Distance (mm)"
msgstr ""
#: panels/print.py:23
msgid "Move Speed (mm/s)"
msgstr ""
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
#, python-format
msgid "Outdated by %d commits:"
msgstr ""
msgid "PSK for"
msgstr ""
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 "Printer Connections"
msgstr ""
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 "Recover Hard"
msgstr ""
msgid "Recover Soft"
msgstr ""
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"
msgid "Screen Power Off Time"
msgstr ""
msgid "Screen will show in less than one second"
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"
msgid "Small"
msgstr ""
#: panels/print.py:39
msgid "Sort by: "
msgstr ""
#: panels/fine_tune.py:47
msgid "Speed (mm/s)"
msgstr ""
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 "Square Corner Velocity"
msgstr ""
msgid "Start"
msgstr ""
msgid "Starting WiFi Re-association"
msgstr ""
msgid "Starting recovery for"
msgstr ""
msgid "Starting update for"
msgstr ""
msgid "System"
msgstr ""
#: panels/system.py:27
msgid ""
"System\n"
"Restart"
msgstr ""
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
msgstr ""
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
#: ks_includes/KlipperScreen.conf:159
msgid "Temperature"
msgstr ""
#: panels/extrude.py:38
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr ""
msgid "Tool"
msgstr ""
#: panels/print.py:167
msgid "Unload"
msgstr ""
msgid "Up To Date"
msgstr ""
msgid "Update"
msgstr ""
msgid "Uploaded"
msgstr ""
#: panels/move.py:25
msgid "View Mesh"
msgstr ""
msgid "X+"
msgstr ""
#: panels/move.py:27
msgid "X-"
msgstr ""
#: panels/move.py:30
msgid "Y+"
msgstr ""
#: panels/move.py:32
msgid "Y-"
msgstr ""
#: ks_includes/KlipperScreen.conf:125
msgid "Z Calibrate"
msgstr ""
#: panels/zcalibrate.py:28
msgid "Z Offset"
msgstr ""
#: panels/fine_tune.py:36 panels/move.py:35
msgid "Z Tilt"
msgstr ""
msgid "Z+"
msgstr ""
#: panels/fine_tune.py:40 panels/move.py:37
msgid "Z-"
msgstr ""
#: ks_includes/config.py:60
msgid "dBm"
msgstr ""
msgid "minutes"
msgstr ""
#: panels/fine_tune.py:38
msgid "mm"
msgstr ""
msgid "mm/s"
msgstr ""
msgid "mm/s^2"
msgstr ""
Binary file not shown.
@@ -0,0 +1,598 @@
# 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-11-18 11:29-0300\n"
"PO-Revision-Date: 2021-11-18 11:33-0300\n"
"Last-Translator: alfrix\n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.0\n"
#, python-format
msgid "%d Packages will be updated"
msgstr "%d Paquetes serán actualizados"
#, python-format
msgid "%s will be updated to version"
msgstr "%s será actualizado a la versión"
msgid "(default)"
msgstr "(por defecto)"
msgid "24 Hour Time"
msgstr "Formato 24 Horas"
msgid "Abort"
msgstr "Cancelar"
msgid "Accept"
msgstr "Aceptar"
msgid "Actions"
msgstr "Acciones"
msgid "Add Printer"
msgstr "Agregar impresora"
msgid "Add bed mesh profile"
msgstr "Agregar pefil de malla de cama"
msgid "Are you sure you wish to cancel this print?"
msgstr "Está seguro que desea cancelar esta impresión?"
msgid "Are you sure you wish to reboot the system?"
msgstr "Está seguro que desea reiniciar el sistema?"
msgid "Are you sure you wish to shutdown the system?"
msgstr "Está seguro que desea apagar el sistema?"
msgid "Bed Level"
msgstr "Nivelar cama"
msgid "Bed Mesh"
msgstr "Malla de cama"
msgid "Calibrate"
msgstr "Calibrar"
msgid "Cancel"
msgstr "Cancelar"
msgid "Cancel Print"
msgstr "Cancelar impresión"
msgid "Cancelled"
msgstr "Cancelado"
msgid "Cancelling"
msgstr "Cancelando"
msgid "Channel"
msgstr "Canal"
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
"Revise /tmp/KlipperScreen.log para mas información.\n"
"Por favor crear un 'issue' en GitHub para ser ayudado."
msgid "Close"
msgstr "Cerrar"
msgid "Complete"
msgstr "Completado"
msgid "Configuration"
msgstr "Ajustes"
msgid "Connected"
msgstr "Conectado"
#, python-format
msgid "Connecting to %s"
msgstr "Conectando a %s"
msgid "Console"
msgstr "Consola"
msgid "Continue"
msgstr "Continuar"
msgid "Cooldown"
msgstr "Enfriar"
msgid "Date"
msgstr "Fecha"
msgid "Decrease"
msgstr "Disminuir"
msgid "Delete"
msgstr "Borrar"
msgid "Disable Motors"
msgstr "Desactivar Motores"
msgid "Disable XY"
msgstr "Desactivar XY"
msgid "Disconnect"
msgstr "Desconectar"
msgid "Displayed Macros"
msgstr "Macros mostrados"
msgid "Distance (mm)"
msgstr "Distancia (mm)"
#, python-format
msgid "Do you want to recover %s?"
msgstr "Desea recuperar %s?"
msgid "Duration Only"
msgstr "Duración"
msgid "Elapsed:"
msgstr "Tiempo:"
msgid "Error"
msgstr "Error"
msgid "Estimated Time Method"
msgstr "Método para estimar tiempo"
msgid "Extrude"
msgstr "Extruir"
msgid "Extrusion +"
msgstr "Extrusor +"
msgid "Extrusion -"
msgstr "Extrusor -"
msgid "Fan"
msgstr "Ventilador"
msgid "Filament Used"
msgstr "Filamento Usado"
msgid "File"
msgstr "Archivo"
msgid "Fine Tuning"
msgstr "Ajuste Fino"
msgid "Finish"
msgstr "Cerrar"
msgid "Firmware Restart"
msgstr "Reiniciar Firmware"
msgid "Font Size"
msgstr "Tamaño del texto"
msgid "Go Back"
msgstr "Volver"
msgid "Home"
msgstr "Inicio"
msgid "Home All"
msgstr "Origen XYZ"
msgid "Home X"
msgstr "Origen X"
msgid "Home XY"
msgstr "Origen XY"
msgid "Home Y"
msgstr "Origen Y"
msgid "Home Z"
msgstr "Origen Z"
msgid "Homing"
msgstr "Origen"
msgid "Hostname"
msgstr "Hostname"
msgid "IPv4"
msgstr "IPv4"
msgid "IPv6"
msgstr "IPv6"
msgid "Icon Theme"
msgstr "Tema de Iconos"
msgid "Increase"
msgstr "Aumentar"
msgid "Initializing"
msgstr "Iniciando"
msgid "Initializing printer..."
msgstr "Iniciando Impresora..."
msgid "Interface"
msgstr "Interfaz"
msgid "Invalid"
msgstr "Invalido"
msgid "Invert X"
msgstr "Invertir X"
msgid "Invert Y"
msgstr "Invertir Y"
msgid "Invert Z"
msgstr "Invertir Z"
msgid "Klipper Restart"
msgstr ""
"Reiniciar\n"
"Klipper"
msgid "Klipper Version"
msgstr "Versión de Klipper"
msgid "Klipper has disconnected"
msgstr "Klipper se desconectó"
msgid ""
"Klipper has encountered an error with the micro-controller.\n"
"Please recompile and flash."
msgstr ""
"Klipper encontró un error en el microcontrolador.\n"
"Por favor recompile y flasheelo."
msgid "Klipper has encountered an error."
msgstr "Klipper encontró un error."
msgid ""
"Klipper has encountered an error.\n"
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
msgstr ""
"Klipper encontró un error.\n"
"Ejecute FIRMWARE_RESTART para tratar de arreglarlo."
msgid "Klipper has shutdown"
msgstr "Klipper se apagó"
msgid "Klipper is attempting to start"
msgstr "Klipper está intentando iniciar"
msgid "Klipper will reboot"
msgstr "Klipper se reiniciará"
msgid "KlipperScreen Version"
msgstr "Versión de KlipperScreen"
msgid "Language"
msgstr "Idioma"
msgid "Large"
msgstr "Grande"
msgid "Left:"
msgstr "Restante:"
msgid "Limits"
msgstr "Limites"
msgid "Load"
msgstr "Cargar"
msgid "Lower Nozzle"
msgstr "Bajar Boquilla"
msgid "Macro shortcut on sidebar"
msgstr "Atajo a Macros en el lateral"
msgid "Macros"
msgstr "Macros"
msgid "Main Menu"
msgstr "Menú"
msgid "Max Accelation"
msgstr "Max. Aceleración"
msgid "Max Acceleration to Deceleration"
msgstr "Max. Aceleración a Desaceleración"
msgid "Max Velocity"
msgstr "Max. Velocidad"
msgid "Medium"
msgstr "Medio"
msgid "Menu"
msgstr "Menú"
msgid "Modified"
msgstr "Modificado"
msgid "Move"
msgstr "Mover"
msgid "Move Distance (mm)"
msgstr "Mover Distancia (mm)"
msgid "Move Speed (mm/s)"
msgstr "Velocidad (mm/s)"
msgid "Name"
msgstr "Nombre"
msgid "Network"
msgstr "Red"
msgid "Number Pad"
msgstr "Teclado"
msgid "Off"
msgstr "Apagar"
#, python-format
msgid "Outdated by %d commits:"
msgstr "Desactualizado por %d commits:"
msgid "PSK for"
msgstr "PSK para"
msgid "Pause"
msgstr "Pausar"
msgid "Paused"
msgstr "Pausado"
msgid "Power"
msgstr "Energía"
msgid "Power On Printer"
msgstr "Encender Impresora"
msgid "Preheat"
msgstr "Precalentar"
msgid "Print"
msgstr "Imprimir"
msgid "Print Control"
msgstr "Control de impresión"
msgid "Print Time"
msgstr "Tiempo de impresión"
msgid "Printer Connections"
msgstr "Conexiones a impresoras"
msgid "Printing"
msgstr "Imprimiendo"
msgid "Profile Name:"
msgstr "Nombre del perfil:"
msgid "Quad Gantry Level"
msgstr "Nivelación cuádruple"
msgid "Raise Nozzle"
msgstr "Levantar Boquilla"
msgid "Recover Hard"
msgstr "Recuperar Hard"
msgid "Recover Soft"
msgstr "Recuperar Soft"
msgid "Restart"
msgstr "Reiniciar"
msgid "Resume"
msgstr "Continuar"
msgid "Retract"
msgstr "Retraer"
msgid "Save"
msgstr "Guardar"
msgid "Save Config"
msgstr "Guardar Config"
msgid "Save configuration."
msgstr "Guardar Configuración."
msgid "Screen Power Off Time"
msgstr "Apagar pantalla tras"
msgid "Screen will show in less than one second"
msgstr "La pantalla se mostrará en menos de un segundo"
msgid "Screws Adjust"
msgstr "Ajustar Tornillos"
msgid "Settings"
msgstr "Opciones"
msgid "Size"
msgstr "Tamaño"
msgid "Slicer"
msgstr "Slicer"
msgid "Small"
msgstr "Pequeño"
msgid "Sort by: "
msgstr "Ordenar por: "
msgid "Speed (mm/s)"
msgstr "Velocidad (mm/s)"
msgid "Speed +"
msgstr "Velocidad +"
msgid "Speed -"
msgstr "Velocidad -"
msgid "Square Corner Velocity"
msgstr "Velocidad de esquina"
msgid "Start"
msgstr "Iniciar"
msgid "Starting WiFi Re-association"
msgstr "Comenzando re-asociación"
msgid "Starting recovery for"
msgstr "Iniciando recuperación de"
msgid "Starting update for"
msgstr "Iniciando actualización de"
msgid "System"
msgstr "Sistema"
msgid ""
"System\n"
"Restart"
msgstr ""
"Reiniciar\n"
"Sistema"
msgid ""
"System\n"
"Shutdown"
msgstr ""
"Apagar\n"
"Sistema"
msgid "Temperature"
msgstr "Temperatura"
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Para aplicar %s KlipperScreen necesita reiniciarse"
msgid "Tool"
msgstr "Herrmienta"
msgid "Unload"
msgstr "Descargar"
msgid "Up To Date"
msgstr "Actualizado"
msgid "Update"
msgstr "Actualizar"
msgid "Uploaded"
msgstr "Subido"
msgid "View Mesh"
msgstr "Ver Malla"
msgid "X+"
msgstr "X+"
msgid "X-"
msgstr "X-"
msgid "Y+"
msgstr "Y+"
msgid "Y-"
msgstr "Y-"
msgid "Z Calibrate"
msgstr "Calibrar Z"
msgid "Z Offset"
msgstr "Desfase Z"
msgid "Z Tilt"
msgstr "Inclinación Z"
msgid "Z+"
msgstr "Z+"
msgid "Z-"
msgstr "Z-"
msgid "dBm"
msgstr "dBm"
msgid "minutes"
msgstr "minutos"
msgid "mm"
msgstr "mm"
msgid "mm/s"
msgstr "mm/s"
msgid "mm/s^2"
msgstr "mm/s^2"
#~ msgid "Medium (default)"
#~ msgstr "Medio (por defecto)"
#~ msgid "File Estimation (default)"
#~ msgstr "Archivo (por defecto)"
#~ msgid "..."
#~ msgstr "..."
#~ msgid "Change Printer"
#~ msgstr "Cambiar impresora"
#~ msgid "Commited"
#~ msgstr "Commited"
#~ msgid "Fan Off"
#~ msgstr "Apagar"
#~ msgid "Fan On"
#~ msgstr "Encender"
#~ msgid "Fast"
#~ msgstr "Rápido"
#~ msgid "Set Speed"
#~ msgstr "Establecer"
#~ msgid "Slow"
#~ msgstr "Lento"
#~ msgid "?"
#~ msgstr "?"
#~ msgid "Are you sure you want to print"
#~ msgstr "Está seguro que desea imprimir"
#~ msgid "Cancel Change"
#~ msgstr "Cancelar"
#~ msgid "Control"
#~ msgstr "Control"
#~ msgid "Emergency Stop"
#~ msgstr "Parada de Emergencia"
#~ msgid "Load Average"
#~ msgstr "Carga media"
@@ -7,549 +7,594 @@ 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"
"POT-Creation-Date: 2021-11-18 11:29-0300\n"
"PO-Revision-Date: 2021-11-18 11:33-0300\n"
"Last-Translator: Bahoue & alfrix\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"
"X-Generator: Poedit 3.0\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: panels/print.py:247
msgid "?"
msgstr "?"
#, python-format
msgid "%d Packages will be updated"
msgstr "%d packages seront mis à jour"
#, python-format
msgid "%s will be updated to version"
msgstr "%s sera mis à jour vers la version"
msgid "(default)"
msgstr "(défaut)"
msgid "24 Hour Time"
msgstr "Format 24 heures"
#: 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 Printer"
msgstr "Ajouter une imprimante"
msgid "Add bed mesh profile"
msgstr ""
msgstr "Ajouter un profil de maillage"
#: 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?"
msgstr "Êtes-vous sûr 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?"
msgstr "Êtes-vous sûr de vouloir redémarrer le système?"
#: panels/system.py:32
#, fuzzy
msgid "Are you sure you wish to shutdown the system?"
msgstr "Es tu sure de vouloir annuler cette impression?"
msgstr "Êtes-vous sûr de vouloir arrêter le système?"
#: ks_includes/KlipperScreen.conf:114
msgid "Bed Level"
msgstr "Nivelage du plateau"
#: ks_includes/KlipperScreen.conf:119
msgid "Bed Mesh"
msgstr "Grille du plateau"
msgstr "Maillage du plateau"
#: panels/bed_mesh.py:104
#, fuzzy
msgid "Calibrate"
msgstr "Calibration Z"
msgstr "Étalonner"
#: 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 "Cancelled"
msgstr "Annulé"
msgid "Cancelling"
msgstr "Annulation"
msgid "Channel"
msgstr "Canal"
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"
"Vérifier /tmp/KlipperScreen.log pour plus d'informations.\n"
"SVP envoyez une requête 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 "Complete"
msgstr "Finalisé"
msgid "Configuration"
msgstr "Configuration"
#: screen.py:492
msgid "Connected"
msgstr "Connecté"
#, python-format
msgid "Connecting to %s"
msgstr "Connexion à %s"
msgid "Console"
msgstr "Console"
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 ""
msgstr "Date"
#: panels/temperature.py:53
msgid "Decrease"
msgstr "Diminuer"
#: panels/bed_mesh.py:122
msgid "Delete"
msgstr ""
msgstr "Effacer"
#: ks_includes/KlipperScreen.conf:108
msgid "Disable Motors"
msgstr "Déactiver les moteurs"
msgstr "Désactiver les moteurs"
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr "Deactiver XY"
msgstr "Désactiver XY"
msgid "Disconnect"
msgstr "Déconnecter"
#: panels/settings.py:28
msgid "Displayed Macros"
msgstr ""
msgstr "Macros affichées"
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr "Distance (mm)"
#: ks_includes/config.py:42
msgid "Duration Only"
msgstr ""
#, python-format
msgid "Do you want to recover %s?"
msgstr "Voulez-vous récupérer %s ?"
msgid "Duration Only"
msgstr "Durée seulement"
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr "Écoulé:"
#: panels/job_status.py:272
msgid "Emergency Stop"
msgstr "Arret d'urgence"
msgid "Error"
msgstr "Erreur"
#: ks_includes/config.py:39
msgid "Estimated Time Method"
msgstr ""
msgstr "Méthode d'estimation du temps"
#: 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 +"
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 ""
msgstr "Filament utilisé"
#: ks_includes/config.py:41
msgid "File Estimation (default)"
msgstr ""
msgid "File"
msgstr "Fichier"
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr "Fin réglage"
msgstr "Réglages fins"
msgid "Finish"
msgstr "Fin"
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Firmware Restart"
msgstr "Redemarrer le FW"
msgstr "Redémarrer Firmware"
msgid "Font Size"
msgstr "Taille de police"
#: 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"
msgstr "Réinitialiser"
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"
msgstr "Origine"
msgid "Hostname"
msgstr "Hostname"
msgid "IPv4"
msgstr "IPv4"
msgid "IPv6"
msgstr "IPv6"
msgid "Icon Theme"
msgstr "Thème icônes"
#: 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"
msgstr "Démarrage de l'imprimante..."
msgid "Interface"
msgstr "Interface"
msgid "Invalid"
msgstr "Invalide"
#: ks_includes/config.py:36
msgid "Invert X"
msgstr ""
msgstr "Inverser X"
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr ""
msgstr "Inverser Y"
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr ""
msgstr "Inverser Z"
#: panels/system.py:22
msgid "Klipper Restart"
msgstr "Redémarrer klipper"
msgstr ""
"Redémarrer\n"
"Klipper"
#: panels/system.py:42
msgid "Klipper Version"
msgstr "Version de klipper"
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"
"Klipper a rencontré une erreur avec le micro-contrô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."
"Klipper a rencontré une erreur. \n"
"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 "Language"
msgstr "Langue"
msgid "Large"
msgstr "Grand"
msgid "Left:"
msgstr "Gauche:"
msgstr "Restant:"
msgid "Limits"
msgstr "Limites"
#: panels/bed_mesh.py:98
msgid "Load"
msgstr ""
msgstr "Charger"
#: 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 "Macro shortcut on sidebar"
msgstr "Raccourci macro sur la barre latérale"
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 "Max Accelation"
msgstr "Accélération maximale"
msgid "Max Acceleration to Deceleration"
msgstr "Accélération maximale à décélération"
msgid "Max Velocity"
msgstr "Vélocité maximale"
msgid "Medium"
msgstr "Moyen"
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
#, fuzzy
msgid "Menu"
msgstr "Menu principal"
msgstr "Menu"
msgid "Modified"
msgstr "Modifié"
#: 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 ""
msgid "Move Speed (mm/s)"
msgstr "Vitesse de déplacement (mm/s)"
msgid "Name"
msgstr "Nom"
#: 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"
msgstr "Clavier"
#: ks_includes/config.py:48
#, fuzzy
msgid "Off"
msgstr "ventilateur éteint"
msgstr "Éteindre"
#, python-format
msgid "Outdated by %d commits:"
msgstr "Obsolète par %d commits :"
msgid "PSK for"
msgstr "PSK pour"
#: 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"
msgstr "Allumer l'imprimante"
#: 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"
msgstr "Contrôle de l'impression"
#: panels/print.py:171
msgid "Print Time"
msgstr "Temps d'impression"
#: panels/job_status.py:232
msgid "Printer Connections"
msgstr "Connexions de l'imprimante"
msgid "Printing"
msgstr "imprime"
msgstr "Impression"
#: panels/bed_mesh.py:264
msgid "Profile Name:"
msgstr ""
msgstr "Nom de profil:"
#: ks_includes/KlipperScreen.conf:89
msgid "Quad Gantry Level"
msgstr ""
msgstr "Portique à quatre niveaux"
#: panels/zcalibrate.py:37
msgid "Raise Nozzle"
msgstr "Éloigner la buse"
#: panels/job_status.py:278 panels/splash_screen.py:62
msgid "Recover Hard"
msgstr "Récupérer Hard"
msgid "Recover Soft"
msgstr "Récupérer Soft"
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 ""
msgstr "Enregistrer"
#: ks_includes/KlipperScreen.conf:141
msgid "Save Config"
msgstr "Enregistrer la config"
#: ks_includes/KlipperScreen.conf:146
msgid "Save configuration."
msgstr "Enregistrer la configuration"
msgstr "Enregistrer la configuration."
#: ks_includes/config.py:46
msgid "Screen Blanking Time"
msgstr ""
msgid "Screen Power Off Time"
msgstr "Extinction de l'écran"
msgid "Screen will show in less than one second"
msgstr "L'écran s'affichera en moins d'une seconde"
#: 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"
msgstr "Dimension"
#: ks_includes/config.py:44
msgid "Slicer"
msgstr ""
msgstr "Trancheur"
#. This line for translations only
#: panels/extrude.py:31
msgid "Slow"
msgstr "Lent"
msgid "Small"
msgstr "Petit"
#: panels/print.py:39
msgid "Sort by: "
msgstr ""
msgstr "Trier par: "
msgid "Speed (mm/s)"
msgstr "Vitesse de déplacement (mm/s)"
#: panels/fine_tune.py:47
msgid "Speed +"
msgstr "Vitesse+"
msgstr "Vitesse +"
#: panels/fine_tune.py:51
msgid "Speed -"
msgstr "Vitesse-"
msgstr "Vitesse -"
msgid "Square Corner Velocity"
msgstr "Vélocité des angles droits"
msgid "Start"
msgstr "Démarrer"
msgid "Starting WiFi Re-association"
msgstr "Démarrage de la re-association WiFi"
msgid "Starting recovery for"
msgstr "Démarrage de la récupération pour"
msgid "Starting update for"
msgstr "Démarrage de la mise à jour pour"
#: ks_includes/KlipperScreen.conf:136 ks_includes/KlipperScreen.conf:191
#: ks_includes/KlipperScreen.conf:216
msgid "System"
msgstr "Systeme"
msgstr "Système"
#: panels/system.py:27
#, fuzzy
msgid ""
"System\n"
"Restart"
msgstr "Redémarrage"
msgstr ""
"Redémarrer\n"
"Système"
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
msgstr ""
msgstr "Arrêt du Système"
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
#: ks_includes/KlipperScreen.conf:159
msgid "Temperature"
msgstr "Temperature"
msgstr "Température"
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Pour appliquer %s KlipperScreen doit être redémarré"
#: panels/extrude.py:38
msgid "Tool"
msgstr "outil"
msgstr "Outil"
msgid "Unload"
msgstr "Décharger"
msgid "Up To Date"
msgstr "À jour"
msgid "Update"
msgstr "Mise à jour"
#: panels/print.py:167
msgid "Uploaded"
msgstr "Telecharger"
msgstr "Téléchargé"
msgid "View Mesh"
msgstr "Voir le maillage"
#: 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 Tilt"
msgstr "Z Tilt"
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 ""
msgid "dBm"
msgstr "dBm"
msgid "minutes"
msgstr "minutes"
#: panels/fine_tune.py:38
msgid "mm"
msgstr "mm"
#, fuzzy
#~ msgid "Klipper"
#~ msgstr "Redémarrer klipper"
msgid "mm/s"
msgstr "mm/s"
msgid "mm/s^2"
msgstr "mm/s^2"
#~ msgid "Medium (default)"
#~ msgstr "Moyen (défaut)"
#~ msgid "File Estimation (default)"
#~ msgstr "Fichier (défaut)"
#~ msgid "..."
#~ msgstr "..."
#~ msgid "Change Printer"
#~ msgstr "Changer d'imprimante"
#~ msgid "Fan Off"
#~ msgstr "Arrêter "
#~ msgid "Fan On"
#~ msgstr "Allumer"
#~ msgid "Fast"
#~ msgstr "Rapide"
#~ msgid "Set Speed"
#~ msgstr "Définir"
#~ msgid "Slow"
#~ msgstr "Lent"
#~ msgid "?"
#~ msgstr "?"
#~ msgid "Are you sure you want to print"
#~ msgstr "Es tu sure de vouloir imprimer"
#~ msgid "Cancel Change"
#~ msgstr "Annuler le changement"
#~ msgid "Control"
#~ msgstr "Controle"
#~ msgid "Emergency Stop"
#~ msgstr "Arret d'urgence"
#~ msgid "Load Average"
#~ msgstr "Charge moyenne"
#~ msgid "Network Info"
#~ msgstr "Information réseau "
#~ msgid "Back"
#~ msgstr "Retour"
@@ -7,83 +7,81 @@ 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"
"POT-Creation-Date: 2021-11-18 11:29-0300\n"
"PO-Revision-Date: 2021-11-18 11:34-0300\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"
"X-Generator: Poedit 3.0\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 "?"
#, python-format
msgid "%d Packages will be updated"
msgstr "%d חבילות יעודכנו"
#, python-format
msgid "%s will be updated to version"
msgstr "%s יעודכן לגרסה"
msgid "(default)"
msgstr "(בְּרִירַת מֶחדָל)"
msgid "24 Hour Time"
msgstr "זמן 24 שעות"
#: 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 Printer"
msgstr "הוסף מדפסת"
msgid "Add bed mesh profile"
msgstr ""
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 "האם אתה בטוח שברצונך לבטל את ההדפסה?"
msgstr "האם אתה בטוח שברצונך לאתחל את המערכת?"
#: panels/system.py:32
#, fuzzy
msgid "Are you sure you wish to shutdown the system?"
msgstr "האם אתה בטוח שברצונך לבטל את ההדפסה?"
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"
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 "Cancelled"
msgstr "מבוטל"
msgid "Cancelling"
msgstr "מבטל"
msgid "Channel"
msgstr "עָרוּץ"
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
@@ -91,191 +89,180 @@ msgstr ""
"בדוק KlipperScreen.log, בתיקית tmp ליותר פרטים.\n"
"אנא שלח דוח תקלה ב- GITHUB, לעזרה."
#: panels/bed_mesh.py:290 panels/temperature.py:150
msgid "Close"
msgstr "סגור"
#: ks_includes/KlipperScreen.conf:30
msgid "Complete"
msgstr "לְהַשְׁלִים"
msgid "Configuration"
msgstr "קונפיגורציה"
#: screen.py:492
msgid "Connected"
msgstr "מְחוּבָּר"
#, python-format
msgid "Connecting to %s"
msgstr "מתחבר ל- %s"
msgid "Console"
msgstr "לְנַחֵם"
msgid "Continue"
msgstr "המשך"
msgstr "לְהַמשִׁיך"
#: panels/job_status.py:270
msgid "Control"
msgstr "שליטה"
#: panels/preheat.py:54
msgid "Cooldown"
msgstr "קירור"
msgstr "תירגע"
#: panels/print.py:24
msgid "Date"
msgstr ""
msgstr "תַאֲרִיך"
#: panels/temperature.py:53
msgid "Decrease"
msgstr "הקטן"
msgstr "לְהַקְטִין"
#: panels/bed_mesh.py:122
msgid "Delete"
msgstr ""
msgstr "לִמְחוֹק"
#: ks_includes/KlipperScreen.conf:108
msgid "Disable Motors"
msgstr "בטל מנועים"
msgstr "השבת מנועים"
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr "בטל XY"
msgstr "השבת את XY"
msgid "Disconnect"
msgstr "לְנַתֵק"
#: panels/settings.py:28
msgid "Displayed Macros"
msgstr ""
msgstr "מוצגים מאקרו"
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr "מרחק (מ''מ)"
msgstr "מרחק (מ\"מ)"
#, python-format
msgid "Do you want to recover %s?"
msgstr "האם ברצונך לשחזר %s?"
#: ks_includes/config.py:42
msgid "Duration Only"
msgstr ""
msgstr "משך הזמן בלבד"
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr "זמן שעבר:"
#: panels/job_status.py:272
msgid "Emergency Stop"
msgstr "עצירת חירום"
msgid "Error"
msgstr "שְׁגִיאָה"
#: ks_includes/config.py:39
msgid "Estimated Time Method"
msgstr ""
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 ""
msgstr "נימה בשימוש"
#: ks_includes/config.py:41
msgid "File Estimation (default)"
msgstr ""
msgid "File"
msgstr "קוֹבֶץ"
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr "כיולים עדינים"
msgstr "כוונון עדין"
msgid "Finish"
msgstr "סיים"
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Firmware Restart"
msgstr "התחל קושחה"
msgstr "הפעלה מחדש של הקושחה"
msgid "Font Size"
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"
msgstr "איפוס"
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 "Hostname"
msgstr "Hostname"
msgid "IPv4"
msgstr "IPv4"
msgid "IPv6"
msgstr "IPv6"
msgid "Icon Theme"
msgstr "נושא אייקון"
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 "Interface"
msgstr "מִמְשָׁק"
msgid "Invalid"
msgstr "לא חוקי"
msgid "Invert X"
msgstr ""
msgstr "הפוך את X"
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr ""
msgstr "הפוך את Y"
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr ""
msgstr "הפוך את Z"
#: 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 "בעיית תקשורת בין קליפר ללוח בקרה. אנא לקמפל קושחה ולצרובה מחדש. "
msgstr ""
"קליפר נתקל בשגיאה בבקר המיקרו.\n"
"אנא הידור מחדש והבהב."
#: 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."
@@ -283,273 +270,327 @@ 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 "Language"
msgstr "שפה"
msgid "Large"
msgstr "גָדוֹל"
msgid "Left:"
msgstr "זמן שנותר:"
#: panels/bed_mesh.py:98
msgid "Limits"
msgstr "גבולות"
msgid "Load"
msgstr ""
msgstr "לִטעוֹן"
#: panels/system.py:66
msgid "Load Average"
msgstr "עומס ממוצע"
#: panels/zcalibrate.py:39
msgid "Lower Nozzle"
msgstr "הנמך דיזה"
#: ks_includes/KlipperScreen.conf:96
msgid "Macro shortcut on sidebar"
msgstr "קיצור מקרו בסרגל הצד"
msgid "Macros"
msgstr "מקרואים"
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr "תפריט ראשי"
#: panels/extrude.py:31
msgid "Max Accelation"
msgstr "האצה מרבית"
msgid "Max Acceleration to Deceleration"
msgstr "האצה מרבית להאטה"
msgid "Max Velocity"
msgstr "מהירות מרבית"
msgid "Medium"
msgstr "ממוצע"
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
#, fuzzy
msgid "Menu"
msgstr "תפריט ראשי"
msgstr "תַפרִיט"
msgid "Modified"
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 ""
msgid "Move Speed (mm/s)"
msgstr "מהירות הזזה (מ\"מ/שניות)"
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 "כבה מאוורר"
msgstr "כבוי"
#, python-format
msgid "Outdated by %d commits:"
msgstr "מיושן ב- %d מתחייב:"
msgid "PSK for"
msgstr "PSK עבור"
#: 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 "Printer Connections"
msgstr "חיבורי מדפסת"
msgid "Printing"
msgstr "מדפיס"
#: panels/bed_mesh.py:264
msgid "Profile Name:"
msgstr ""
msgstr "שם פרופיל:"
#: ks_includes/KlipperScreen.conf:89
msgid "Quad Gantry Level"
msgstr ""
msgstr "רמת מרפסת גנטרי"
#: panels/zcalibrate.py:37
msgid "Raise Nozzle"
msgstr "הגבה"
#: panels/job_status.py:278 panels/splash_screen.py:62
msgid "Recover Hard"
msgstr "לְהַחלִים Hard"
msgid "Recover Soft"
msgstr "לְהַחלִים Soft"
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 ""
msgstr "להציל"
#: ks_includes/KlipperScreen.conf:141
msgid "Save Config"
msgstr "שמור קונפיג"
#: ks_includes/KlipperScreen.conf:146
msgid "Save configuration."
msgstr "שמור קונפיגורציה"
msgstr "שמור תצורה."
#: ks_includes/config.py:46
msgid "Screen Blanking Time"
msgstr ""
msgid "Screen Power Off Time"
msgstr "זמן כיבוי מסך"
msgid "Screen will show in less than one second"
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 ""
msgstr "Slicer"
#. This line for translations only
#: panels/extrude.py:31
msgid "Slow"
msgstr "האט"
msgid "Small"
msgstr "קָטָן"
#: panels/print.py:39
msgid "Sort by: "
msgstr ""
msgstr "מיין לפי: "
msgid "Speed (mm/s)"
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 "Square Corner Velocity"
msgstr "מהירות פינה מרובעת"
msgid "Start"
msgstr "הַתחָלָה"
msgid "Starting WiFi Re-association"
msgstr "התחלת שיוך מחדש ל- WiFi"
msgid "Starting recovery for"
msgstr "החל התאוששות עבור"
msgid "Starting update for"
msgstr "מתחיל עדכון עבור"
msgid "System"
msgstr "מערכת"
#: panels/system.py:27
#, fuzzy
msgid ""
"System\n"
"Restart"
msgstr "אתחל"
msgstr ""
"מערכת\n"
"אתחול"
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
msgstr ""
"מערכת\n"
"לכבות"
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
#: ks_includes/KlipperScreen.conf:159
msgid "Temperature"
msgstr "טמפרטורה"
#: panels/extrude.py:38
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "כדי ליישם %s צריך להפעיל מחדש את KlipperScreen"
msgid "Tool"
msgstr "כלי"
#: panels/print.py:167
msgid "Unload"
msgstr "לִפְרוֹק"
msgid "Up To Date"
msgstr "עדכני"
msgid "Update"
msgstr "עדכון"
msgid "Uploaded"
msgstr "הועלה"
#: panels/move.py:25
msgid "View Mesh"
msgstr "צפה ברשת"
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 Tilt"
msgstr "הטיה Z"
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 ""
msgid "dBm"
msgstr "dBm"
msgid "minutes"
msgstr "דקות"
#: panels/fine_tune.py:38
msgid "mm"
msgstr "מ''מ"
#, fuzzy
#~ msgid "Klipper"
#~ msgstr "אתחול קליפר"
msgid "mm/s"
msgstr "מ\"מ/ש"
msgid "mm/s^2"
msgstr "mm/s^2"
#~ msgid "Medium (default)"
#~ msgstr "בינוני (ברירת מחדל)"
#~ msgid "File Estimation (default)"
#~ msgstr "קובץ (ברירת מחדל)"
#~ msgid "Fan Off"
#~ msgstr "כבה מאוורר"
#~ msgid "Fan On"
#~ msgstr "הפעל מאוורר"
#~ msgid "Fast"
#~ msgstr "מהיר"
#~ msgid "Set Speed"
#~ msgstr "קבע מהירות"
#~ msgid "Slow"
#~ msgstr "האט"
#~ msgid "?"
#~ msgstr "?"
#~ msgid "Are you sure you want to print"
#~ msgstr "האם אתה בטוח שברצונך להדפיס"
#~ msgid "Cancel Change"
#~ msgstr "בטל שינוי"
#~ msgid "Control"
#~ msgstr "שליטה"
#~ msgid "Emergency Stop"
#~ msgstr "עצירת חירום"
#~ msgid "Load Average"
#~ msgstr "עומס ממוצע"
#~ msgid "Network Info"
#~ msgstr "מידע על הרשת"
#~ msgid "Back"
#~ msgstr "חזור"
Binary file not shown.
@@ -0,0 +1,561 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-11-18 11:29-0300\n"
"PO-Revision-Date: \n"
"Last-Translator: pappicio\n"
"Language-Team: \n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.0\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#, python-format
msgid "%d Packages will be updated"
msgstr "%d pacchetti verranno aggiornati"
#, python-format
msgid "%s will be updated to version"
msgstr "%s verrà aggiornato alla versione"
msgid "(default)"
msgstr "(predef.)"
msgid "24 Hour Time"
msgstr "24H"
msgid "Abort"
msgstr "Annulla"
msgid "Accept"
msgstr "Accetta"
msgid "Actions"
msgstr "Azioni"
msgid "Add Printer"
msgstr "Aggiungi Stampante"
msgid "Add bed mesh profile"
msgstr "Aggiungi Profilo Mesh"
msgid "Are you sure you wish to cancel this print?"
msgstr "Cancellare la Stampa?"
msgid "Are you sure you wish to reboot the system?"
msgstr "Riavviare il Sistema?"
msgid "Are you sure you wish to shutdown the system?"
msgstr "Spegnere il Sistema?"
msgid "Bed Level"
msgstr "Livello del letto"
msgid "Bed Mesh"
msgstr "Rete letto"
msgid "Calibrate"
msgstr "Calibra"
msgid "Cancel"
msgstr "Annulla"
msgid "Cancel Print"
msgstr "Annulla Stampa"
msgid "Cancelled"
msgstr "Annullato"
msgid "Cancelling"
msgstr "Annullamento"
msgid "Channel"
msgstr "Canale"
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
msgstr ""
"Verifica /tmp/KlipperScreen.log per info.\n"
"Aggiungi un problema sul GitHub."
msgid "Close"
msgstr "Chiudi"
msgid "Complete"
msgstr "Completo"
msgid "Configuration"
msgstr "Impostazioni"
msgid "Connected"
msgstr "Connesso"
#, python-format
msgid "Connecting to %s"
msgstr "Connetto a %s"
msgid "Console"
msgstr "Console"
msgid "Continue"
msgstr "Continua"
msgid "Cooldown"
msgstr "Raffredda"
msgid "Date"
msgstr "Data"
msgid "Decrease"
msgstr "Diminuisci"
msgid "Delete"
msgstr "Elimina"
msgid "Disable Motors"
msgstr "Disab. Motori"
msgid "Disable XY"
msgstr "Disab. XY"
msgid "Disconnect"
msgstr "Sconnetti"
msgid "Displayed Macros"
msgstr "Mostra/Nascondi Macros"
msgid "Distance (mm)"
msgstr "Distanza (mm)"
#, python-format
msgid "Do you want to recover %s?"
msgstr "Vuoi recuperare %s?"
msgid "Duration Only"
msgstr "Solo Durata"
msgid "Elapsed:"
msgstr "Trascorso:"
msgid "Error"
msgstr "Errore"
msgid "Estimated Time Method"
msgstr "Metodo Tempo stimato"
msgid "Extrude"
msgstr "Estrudi"
msgid "Extrusion +"
msgstr "Estrudi +"
msgid "Extrusion -"
msgstr "Estrudi -"
msgid "Fan"
msgstr "Ventola"
msgid "Filament Used"
msgstr "Filamento Usato"
msgid "File"
msgstr "File"
msgid "Fine Tuning"
msgstr "Messa a Punto"
msgid "Finish"
msgstr "Finito"
msgid "Firmware Restart"
msgstr "Riavvia Firmware"
msgid "Font Size"
msgstr "Dimensione del testo"
msgid "Go Back"
msgstr "Indietro"
msgid "Home"
msgstr "Inizio"
msgid "Home All"
msgstr "Home XYZ"
msgid "Home X"
msgstr "Home X"
msgid "Home XY"
msgstr "Home XY"
msgid "Home Y"
msgstr "Home Y"
msgid "Home Z"
msgstr "Home Z"
msgid "Homing"
msgstr "Homing"
msgid "Hostname"
msgstr "Hostname"
msgid "IPv4"
msgstr "IPv4"
msgid "IPv6"
msgstr "IPv6"
msgid "Icon Theme"
msgstr "Tema Icone"
msgid "Increase"
msgstr "Incrementa"
msgid "Initializing"
msgstr "Inizializzo"
msgid "Initializing printer..."
msgstr "Inizializzo stampante..."
msgid "Interface"
msgstr "Interfaccia"
msgid "Invalid"
msgstr "Non valido"
msgid "Invert X"
msgstr "Inverti X"
msgid "Invert Y"
msgstr "Inverti Y"
msgid "Invert Z"
msgstr "Inverti Z"
msgid "Klipper Restart"
msgstr ""
"Riavvia\n"
"Klipper"
msgid "Klipper Version"
msgstr "Versione Klipper"
msgid "Klipper has disconnected"
msgstr "Klipper è disconnesso"
msgid ""
"Klipper has encountered an error with the micro-controller.\n"
"Please recompile and flash."
msgstr ""
"Klipper ha riscontrato un errore con il microcontrollore.\n"
"Si prega di ricompilare e flashare."
msgid "Klipper has encountered an error."
msgstr "Klipper ha riscontrato un errore."
msgid ""
"Klipper has encountered an error.\n"
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
msgstr ""
"Klipper ha riscontrato un errore.\n"
"esegui un FIRMWARE_RESTART per tentare di risolvere il problema."
msgid "Klipper has shutdown"
msgstr "Klipper è spento"
msgid "Klipper is attempting to start"
msgstr "Klipper si sta avviando"
msgid "Klipper will reboot"
msgstr "Klipper sarà riavviato"
msgid "KlipperScreen Version"
msgstr "Versione KlipperScreen"
msgid "Language"
msgstr "Lingua"
msgid "Large"
msgstr "Grande"
msgid "Left:"
msgstr "Restante:"
msgid "Limits"
msgstr "Imp. Limiti"
msgid "Load"
msgstr "Carica"
msgid "Lower Nozzle"
msgstr "Abbassa ugello"
msgid "Macro shortcut on sidebar"
msgstr "Macros sulla barra laterale"
msgid "Macros"
msgstr "Macros"
msgid "Main Menu"
msgstr "Menu Principale"
msgid "Max Accelation"
msgstr "Acceleraz. Massima"
msgid "Max Acceleration to Deceleration"
msgstr "Da acceleraz. Massima a Deceleraz. Massima"
msgid "Max Velocity"
msgstr "Velocità Massima"
msgid "Medium"
msgstr ""
msgid "Menu"
msgstr "Menù"
msgid "Modified"
msgstr "Modificato"
msgid "Move"
msgstr "Muovi"
msgid "Move Distance (mm)"
msgstr "Distanza Movimento (mm)"
msgid "Move Speed (mm/s)"
msgstr "Velocità Movimento (mm/s)"
msgid "Name"
msgstr "Nome"
msgid "Network"
msgstr "Rete"
msgid "Number Pad"
msgstr "Tastierino"
msgid "Off"
msgstr "Off"
#, python-format
msgid "Outdated by %d commits:"
msgstr "Obsoleto da %d commit:"
msgid "PSK for"
msgstr "PSK per"
msgid "Pause"
msgstr "Pausa"
msgid "Paused"
msgstr "In Pausa"
msgid "Power"
msgstr "Power"
msgid "Power On Printer"
msgstr "Accendi Stampante"
msgid "Preheat"
msgstr "Preriscalda"
msgid "Print"
msgstr "Stampa"
msgid "Print Control"
msgstr "Controllo Stampa"
msgid "Print Time"
msgstr "Tempo di Stampa"
msgid "Printer Connections"
msgstr "Connessioni Stampante"
msgid "Printing"
msgstr "In Stampa"
msgid "Profile Name:"
msgstr "Nome Profilo:"
msgid "Quad Gantry Level"
msgstr "Quad Gantry Level"
msgid "Raise Nozzle"
msgstr "Alza Ugello"
msgid "Recover Hard"
msgstr "Recuperare Hard"
msgid "Recover Soft"
msgstr "Recuperare Soft"
msgid "Restart"
msgstr "Riavvia"
msgid "Resume"
msgstr "Riprendi"
msgid "Retract"
msgstr "Ritrai"
msgid "Save"
msgstr "Salva"
msgid "Save Config"
msgstr "Salva Config"
msgid "Save configuration."
msgstr "Salva configurazione."
msgid "Screen Power Off Time"
msgstr "Tempo Spegnim. Schermo"
msgid "Screen will show in less than one second"
msgstr "Lo schermo verrà visualizzato a breve"
msgid "Screws Adjust"
msgstr "Calibra Screws"
msgid "Settings"
msgstr "Impostazioni"
msgid "Size"
msgstr "Grandezza"
msgid "Slicer"
msgstr "Slicer"
msgid "Small"
msgstr "Piccola"
msgid "Sort by: "
msgstr "Ordine: "
msgid "Speed (mm/s)"
msgstr "Velocità (mm/s)"
msgid "Speed +"
msgstr "Velocità+"
msgid "Speed -"
msgstr "Velocità-"
msgid "Square Corner Velocity"
msgstr "Velocità Square Corner"
msgid "Start"
msgstr "Iniziare"
msgid "Starting WiFi Re-association"
msgstr "Riassocia WiFi"
msgid "Starting recovery for"
msgstr "Inizio del recupero per"
msgid "Starting update for"
msgstr "Avvio aggiornamento per"
msgid "System"
msgstr "Sistema"
msgid ""
"System\n"
"Restart"
msgstr ""
"Riavvia\n"
"Sistema"
msgid ""
"System\n"
"Shutdown"
msgstr ""
"Spegni\n"
"Sistema"
msgid "Temperature"
msgstr "Temperatura"
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Riavvia KlipperScreen per applicare %s"
msgid "Tool"
msgstr "Strumenti"
msgid "Unload"
msgstr "Scaricare"
msgid "Up To Date"
msgstr "Aggiornato"
msgid "Update"
msgstr "Aggiorna"
msgid "Uploaded"
msgstr "Caricato"
msgid "View Mesh"
msgstr "Visual. Mesh"
msgid "X+"
msgstr "X+"
msgid "X-"
msgstr "X-"
msgid "Y+"
msgstr "Y+"
msgid "Y-"
msgstr "Y-"
msgid "Z Calibrate"
msgstr "Calibra Z"
msgid "Z Offset"
msgstr "Offset Z"
msgid "Z Tilt"
msgstr "Z Tilt"
msgid "Z+"
msgstr "Z+"
msgid "Z-"
msgstr "Z-"
msgid "dBm"
msgstr "dBm"
msgid "minutes"
msgstr "minuti"
msgid "mm"
msgstr "mm"
msgid "mm/s"
msgstr "mm/s"
msgid "mm/s^2"
msgstr "mm/s^2"
#~ msgid "Medium (default)"
#~ msgstr "Media (predef.)"
#~ msgid "File Estimation (default)"
#~ msgstr "Stima file (predef.)"
#~ msgid "..."
#~ msgstr "..."
#~ msgid "Change Printer"
#~ msgstr "Cambia Stampante"
#~ msgid "Commited"
#~ msgstr "Impegnato"
@@ -6,80 +6,81 @@ 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"
"POT-Creation-Date: 2021-11-18 11:29-0300\n"
"PO-Revision-Date: 2021-11-18 11:36-0300\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"
"X-Generator: Poedit 3.0\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 "?"
#, python-format
msgid "%d Packages will be updated"
msgstr "% d пакеты будут обновлены"
#, python-format
msgid "%s will be updated to version"
msgstr "% s будет обновлен до версии"
msgid "(default)"
msgstr "(дефолт)"
msgid "24 Hour Time"
msgstr "24-часовой формат"
#: 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 Printer"
msgstr "Добавить принтер"
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 "Cancelled"
msgstr "Отменено"
msgid "Cancelling"
msgstr "Отменить"
msgid "Channel"
msgstr "Канал"
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
@@ -87,185 +88,172 @@ 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 "Конфигурация"
msgid "Complete"
msgstr "Готово"
msgid "Configuration"
msgstr "Параметр"
msgid "Connected"
msgstr "Соединенный"
#, python-format
msgid "Connecting to %s"
msgstr "Соединенный с %s"
msgid "Console"
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 "Отключить моторы"
msgstr "Откл. моторы"
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr "Отключить XY"
#: panels/settings.py:28
msgid "Disconnect"
msgstr "Отключить"
msgid "Displayed Macros"
msgstr "Показать макросы"
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr "Расстояние (mm)"
#: ks_includes/config.py:42
#, python-format
msgid "Do you want to recover %s?"
msgstr "Вы хотите восстановить% s?"
msgid "Duration Only"
msgstr "Продолжительность печати"
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr "Прошло:"
#: panels/job_status.py:272
msgid "Emergency Stop"
msgstr "Аварийный стоп"
msgid "Error"
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 "По файлу (по умолчанию)"
msgid "File"
msgstr "Файл"
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr "Точная настройка"
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Firmware Restart"
msgstr ""
"Перезагрузка\n"
"прошивки"
msgid "Finish"
msgstr "Конец"
msgid "Firmware Restart"
msgstr "Рестарт прошивки"
msgid "Font Size"
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"
msgstr "Парковка"
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 "Hostname"
msgstr "Имя хоста"
msgid "IPv4"
msgstr "IPv4"
msgid "IPv6"
msgstr "IPv6"
msgid "Icon Theme"
msgstr "Темы"
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 "Interface"
msgstr "Интерфейс"
msgid "Invalid"
msgstr "Неверный"
msgid "Invert X"
msgstr "Инвертировать X"
msgstr "Инверсия X"
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr "Инвертировать Y"
msgstr "Инверсия Y"
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr "Инвертировать Z"
msgstr "Инверсия Z"
#: panels/system.py:22
msgid "Klipper Restart"
msgstr ""
"Перезагрузка\n"
"Рестарт\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."
@@ -273,11 +261,9 @@ 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."
@@ -285,268 +271,325 @@ 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 "Language"
msgstr "Язык"
msgid "Large"
msgstr "Большой"
msgid "Left:"
msgstr "Осталось:"
#: panels/bed_mesh.py:98
msgid "Limits"
msgstr "Лимиты"
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 "Macro shortcut on sidebar"
msgstr "Показать макросы в панели"
msgid "Macros"
msgstr "Макросы"
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr "Главное меню"
#: panels/extrude.py:31
msgid "Max Accelation"
msgstr "Ускорения"
msgid "Max Acceleration to Deceleration"
msgstr "Ускорения торможения"
msgid "Max Velocity"
msgstr "Скорость"
msgid "Medium"
msgstr "Среднее"
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
msgid "Menu"
msgstr "Меню"
#: ks_includes/KlipperScreen.conf:69
msgid "Modified"
msgstr "Изменено"
msgid "Move"
msgstr "Двигать"
#: panels/move.py:91
msgid "Move Distance (mm)"
msgstr "Дистанция перемещения (mm)"
msgstr "Дистанция перемещения (мм)"
msgid "Move Speed (mm/s)"
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 "Номер блока"
msgstr "Клавиатура"
#: ks_includes/config.py:48
msgid "Off"
msgstr "Выкл"
#: panels/job_status.py:276
#, python-format
msgid "Outdated by %d commits:"
msgstr "Устарело на% d коммитов:"
msgid "PSK for"
msgstr "PSK для"
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 "Printer Connections"
msgstr "Подключение принтера"
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 "Recover Hard"
msgstr "Восстановить Hard"
msgid "Recover Soft"
msgstr "Восстановить Soft"
msgid "Restart"
msgstr "Перезагрузка"
#: panels/job_status.py:280
msgid "Resume"
msgstr "Продолжить"
#: panels/extrude.py:48
msgid "Retract"
msgstr "Выгрузить"
msgstr "Втянуть"
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
msgid "Save"
msgstr "Сохранить"
#: ks_includes/KlipperScreen.conf:141
msgid "Save Config"
msgstr "Сохранить настройки"
msgstr "Сохр. Конфиг"
#: ks_includes/KlipperScreen.conf:146
msgid "Save configuration."
msgstr "Настройки сохраняются."
#: ks_includes/config.py:46
msgid "Screen Blanking Time"
msgstr "Скрыть экран через"
msgid "Screen Power Off Time"
msgstr "Время выключения экрана"
msgid "Screen will show in less than one second"
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"
msgstr "Слайсер"
#. This line for translations only
#: panels/extrude.py:31
msgid "Slow"
msgstr "Медленно"
msgid "Small"
msgstr "Маленький"
#: panels/print.py:39
msgid "Sort by: "
msgstr "Сортировать по: "
msgstr "Орден: "
msgid "Speed (mm/s)"
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 "Square Corner Velocity"
msgstr "Квадратная угловая скорость"
msgid "Start"
msgstr "Hачать"
msgid "Starting WiFi Re-association"
msgstr "WiFi реконенект"
msgid "Starting recovery for"
msgstr "Запуск восстановления для"
msgid "Starting update for"
msgstr "Запуск обновления для"
msgid "System"
msgstr "Система"
#: panels/system.py:27
msgid ""
"System\n"
"Restart"
msgstr ""
"Перегрузить\n"
"Систему"
"Рестарт\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 "Температура"
msgstr "Tемпература"
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "Чтобы применить %s необходимо перезапустить KlipperScreen"
#: panels/extrude.py:38
msgid "Tool"
msgstr "Инструмент"
#: panels/print.py:167
msgid "Uploaded"
msgid "Unload"
msgstr "Загружено"
#: panels/move.py:25
msgid "Up To Date"
msgstr "Обновлено"
msgid "Update"
msgstr "Обновить"
msgid "Uploaded"
msgstr "Дата"
msgid "View Mesh"
msgstr "Смотреть сетку"
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"
msgstr "Калибр. Z"
#: panels/zcalibrate.py:28
msgid "Z Offset"
msgstr "Офсет Z"
#: panels/fine_tune.py:36 panels/move.py:35
msgid "Z Tilt"
msgstr "Z Наклон"
msgid "Z+"
msgstr "Z+"
#: panels/fine_tune.py:40 panels/move.py:37
msgid "Z-"
msgstr "Z-"
#: ks_includes/config.py:60
msgid "dBm"
msgstr "dBm"
msgid "minutes"
msgstr "минут"
#: panels/fine_tune.py:38
msgid "mm"
msgstr "mm"
msgstr "мм"
#~ msgid "Klipper"
#~ msgstr "Klipper"
msgid "mm/s"
msgstr "мм/с"
msgid "mm/s^2"
msgstr "мм/с^2"
#~ msgid "Medium (default)"
#~ msgstr "Средний (по умолчанию)"
#~ msgid "File Estimation (default)"
#~ msgstr "По файлу (по умолчанию)"
#~ msgid "..."
#~ msgstr "..."
#~ msgid "Change Printer"
#~ msgstr "Сменить принтер"
#~ msgid "Commited"
#~ msgstr "Зафиксировано"
#~ msgid "Fan Off"
#~ msgstr "Bыключить"
#~ msgid "Fan On"
#~ msgstr "Bключи"
#~ msgid "Fast"
#~ msgstr "Быстро"
#~ msgid "Set Speed"
#~ msgstr "Скорость"
#~ msgid "Slow"
#~ msgstr "Mедленно"
#~ msgid "?"
#~ msgstr "?"
#~ msgid "Are you sure you want to print"
#~ msgstr "Вы хотите это распечатать"
#~ msgid "Cancel Change"
#~ msgstr "Отменить изменения"
#~ msgid "Control"
#~ msgstr "Управление"
#~ msgid "Load Average"
#~ msgstr "Средняя нагрузка"
@@ -7,81 +7,79 @@ 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"
"POT-Creation-Date: 2021-11-18 11:29-0300\n"
"PO-Revision-Date: 2021-11-18 11:36-0300\n"
"Last-Translator: \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"
"X-Generator: Poedit 3.0\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: panels/print.py:247
msgid "?"
msgstr "?"
#, python-format
msgid "%d Packages will be updated"
msgstr "%d 个软件包将被更新"
#, python-format
msgid "%s will be updated to version"
msgstr "%s 将更新到版本"
msgid "(default)"
msgstr "(默认"
msgid "24 Hour Time"
msgstr "24 小时制"
#: panels/zcalibrate.py:71
msgid "Abort"
msgstr "中止"
msgstr "终止"
#: panels/zcalibrate.py:68
msgid "Accept"
msgstr "接受"
#: ks_includes/KlipperScreen.conf:26
msgid "Actions"
msgstr "动作"
#: panels/bed_mesh.py:33
msgid "Add Printer"
msgstr "添加打印机"
msgid "Add bed mesh profile"
msgstr ""
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 "您要取消此打印吗?"
msgstr "您确定要取消打印吗?"
#: panels/system.py:29
#, fuzzy
msgid "Are you sure you wish to reboot the system?"
msgstr "您要取消此打印吗?"
msgstr "您确定要重启系统吗?"
#: panels/system.py:32
#, fuzzy
msgid "Are you sure you wish to shutdown the system?"
msgstr "您要取消此打印吗?"
msgstr "您确定要关闭系统吗?"
#: ks_includes/KlipperScreen.conf:114
msgid "Bed Level"
msgstr "床位"
msgstr "热床调平"
#: ks_includes/KlipperScreen.conf:119
msgid "Bed Mesh"
msgstr "床网"
msgstr "网格床"
#: panels/bed_mesh.py:104
#, fuzzy
msgid "Calibrate"
msgstr "Z校准"
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 "取消列印"
msgstr "取消打印"
msgid "Cancelled"
msgstr "取消"
msgid "Cancelling"
msgstr "取消"
msgid "Channel"
msgstr "通道"
#: screen.py:305
msgid ""
"Check /tmp/KlipperScreen.log for more information.\n"
"Please submit an issue on GitHub for help."
@@ -89,492 +87,504 @@ msgstr ""
"检查/tmp/KlipperScreen.log以获取更多信息。\n"
"请在GitHub上提交问题以寻求帮助。"
#: panels/bed_mesh.py:290 panels/temperature.py:150
msgid "Close"
msgstr "关"
msgstr "关闭"
msgid "Complete"
msgstr "完成"
#: ks_includes/KlipperScreen.conf:30
msgid "Configuration"
msgstr "组态"
msgstr "配置"
msgid "Connected"
msgstr "连接"
#, python-format
msgid "Connecting to %s"
msgstr "连接到 %s"
msgid "Console"
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 ""
msgstr "日期"
#: panels/temperature.py:53
msgid "Decrease"
msgstr "减少"
#: panels/bed_mesh.py:122
msgid "Delete"
msgstr ""
msgstr "删除"
#: ks_includes/KlipperScreen.conf:108
msgid "Disable Motors"
msgstr "禁用马达"
msgstr "禁用步进电机"
#: panels/bed_level.py:107
msgid "Disable XY"
msgstr "禁用XY"
msgstr "禁用 XY"
msgid "Disconnect"
msgstr "断开"
#: panels/settings.py:28
msgid "Displayed Macros"
msgstr ""
msgstr "显示宏命令"
#: panels/zcalibrate.py:64
msgid "Distance (mm)"
msgstr "距离(毫米)"
msgstr "距离(mm)"
#, python-format
msgid "Do you want to recover %s?"
msgstr "您想恢复 %s 吗?"
#: ks_includes/config.py:42
msgid "Duration Only"
msgstr ""
msgstr "仅持续时间"
#: panels/job_status.py:136
msgid "Elapsed:"
msgstr "过去"
msgstr "过去:"
#: panels/job_status.py:272
msgid "Emergency Stop"
msgstr "紧急停止"
msgid "Error"
msgstr "错误"
#: ks_includes/config.py:39
msgid "Estimated Time Method"
msgstr ""
msgstr "预估时间方法"
#: panels/extrude.py:46 ks_includes/KlipperScreen.conf:74
#: ks_includes/KlipperScreen.conf:174
msgid "Extrude"
msgstr "拉伸"
msgstr "挤出机"
#: panels/fine_tune.py:57
msgid "Extrusion +"
msgstr "挤压+"
msgstr "挤出 +"
#: panels/fine_tune.py:61
msgid "Extrusion -"
msgstr "挤压-"
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 ""
msgstr "已经消耗的耗材"
#: ks_includes/config.py:41
msgid "File Estimation (default)"
msgstr ""
msgid "File"
msgstr "文件"
#: ks_includes/KlipperScreen.conf:164
msgid "Fine Tuning"
msgstr "微调"
#: panels/splash_screen.py:64 panels/system.py:24
msgid "Finish"
msgstr "结束"
msgid "Firmware Restart"
msgstr "固件重启"
msgstr "框架重启"
msgid "Font Size"
msgstr "字体大小"
#: screen.py:300 panels/job_status.py:302
msgid "Go Back"
msgstr "回去"
msgstr "返回"
msgid "Home"
msgstr "归零"
#: panels/bed_level.py:104 panels/move.py:40 ks_includes/KlipperScreen.conf:39
msgid "Home All"
msgstr "全部回家"
msgstr "归零全部"
#: ks_includes/KlipperScreen.conf:45
msgid "Home X"
msgstr "X家庭"
msgstr "归零 X"
#: ks_includes/KlipperScreen.conf:63
msgid "Home XY"
msgstr "XY首页"
msgstr "归零 XY"
#: ks_includes/KlipperScreen.conf:51
msgid "Home Y"
msgstr "Y家"
msgstr "归零 Y"
#: ks_includes/KlipperScreen.conf:57
msgid "Home Z"
msgstr "Z家"
msgstr "归零 Z"
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
msgid "Homing"
msgstr "归巢"
msgstr "归零"
msgid "Hostname"
msgstr "主机名称"
msgid "IPv4"
msgstr "IPv4"
msgid "IPv6"
msgstr "IPv6"
msgid "Icon Theme"
msgstr "图标 主题"
#: panels/temperature.py:51
msgid "Increase"
msgstr "增加"
#. self._load_panels()
#: screen.py:149
msgid "Initializing"
msgstr "Initializing"
msgstr "初始化中"
#: panels/splash_screen.py:23
msgid "Initializing printer..."
msgstr "初始化打印机..."
msgstr "初始化打印机中.."
msgid "Interface"
msgstr "接口"
msgid "Invalid"
msgstr "无效的"
#: ks_includes/config.py:36
msgid "Invert X"
msgstr ""
msgstr "翻转 X"
#: ks_includes/config.py:37
msgid "Invert Y"
msgstr ""
msgstr "翻转 Y"
#: ks_includes/config.py:38
msgid "Invert Z"
msgstr ""
msgstr "翻转 Z"
#: panels/system.py:22
msgid "Klipper Restart"
msgstr "快闪重启"
msgstr "Klipper 重启"
#: panels/system.py:42
msgid "Klipper Version"
msgstr "快艇版本"
msgstr "Klipper 版本"
#: screen.py:418
msgid "Klipper has disconnected"
msgstr "Klipper已断开连接"
msgstr "Klipper 已断开连接"
#: screen.py:429
msgid ""
"Klipper has encountered an error with the micro-controller.\n"
"Please recompile and flash."
msgstr ""
"Klipper的微控制器出错。\n"
"Klipper的微控制器发生错误。\n"
"请重新编译并刷新。"
#: screen.py:433
msgid "Klipper has encountered an error."
msgstr "Klipper遇到错误。"
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尝试解决此问题。"
"发出 FIRMWARE_RESTART 尝试解决此问题。"
#: screen.py:453
msgid "Klipper has shutdown"
msgstr "Klipper已关闭"
msgstr "Klipper 已经关闭"
#: screen.py:449
msgid "Klipper is attempting to start"
msgstr "Klipper正在尝试启动"
msgstr "Klipper 正在尝试启动"
#: ks_includes/KlipperScreen.conf:148
msgid "Klipper will reboot"
msgstr "Klipper将重新启动"
msgstr "Klipper 将重新启动"
#: panels/system.py:46
msgid "KlipperScreen Version"
msgstr "KlipperScreen版本"
msgstr "KlipperScreen 版本"
msgid "Language"
msgstr "语"
msgid "Large"
msgstr "大的"
#: panels/job_status.py:124
msgid "Left:"
msgstr "剩下的时间"
msgstr "左:"
msgid "Limits"
msgstr "限制"
#: panels/bed_mesh.py:98
msgid "Load"
msgstr ""
msgstr "加载"
#: panels/system.py:66
msgid "Load Average"
msgstr "平均负载"
#: panels/zcalibrate.py:39
msgid "Lower Nozzle"
msgstr "下喷嘴"
msgstr "降低喷嘴"
msgid "Macro shortcut on sidebar"
msgstr "侧边栏上的宏快捷方式"
#: ks_includes/KlipperScreen.conf:96
msgid "Macros"
msgstr "巨集"
msgstr "宏"
#: panels/job_status.py:274 ks_includes/KlipperScreen.conf:14
msgid "Main Menu"
msgstr "主菜单"
#: panels/extrude.py:31
msgid "Max Accelation"
msgstr "最大加速度"
msgid "Max Acceleration to Deceleration"
msgstr "最大加速到减速"
msgid "Max Velocity"
msgstr "最大速度"
msgid "Medium"
msgstr "中"
#: panels/splash_screen.py:59 ks_includes/KlipperScreen.conf:202
#, fuzzy
msgid "Menu"
msgstr "主菜单"
msgstr "菜单"
msgid "Modified"
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 ""
msgid "Move Speed (mm/s)"
msgstr "移动速度 (mm/s)"
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 "散开"
msgstr "关闭"
#, python-format
msgid "Outdated by %d commits:"
msgstr "已过时 %d 次提交:"
msgid "PSK for"
msgstr "PSK 用于"
#: 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 "功率"
msgstr "电源"
#: panels/splash_screen.py:61
msgid "Power On Printer"
msgstr "开启打印机电源"
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 "Printer Connections"
msgstr "连接打印机"
msgid "Printing"
msgstr "印刷"
msgstr "打印中"
#: panels/bed_mesh.py:264
msgid "Profile Name:"
msgstr ""
msgstr "配置文件名称:"
#: ks_includes/KlipperScreen.conf:89
msgid "Quad Gantry Level"
msgstr ""
msgstr "龙门调平"
#: panels/zcalibrate.py:37
msgid "Raise Nozzle"
msgstr "升高喷嘴"
#: panels/job_status.py:278 panels/splash_screen.py:62
msgid "Restart"
msgstr "重新开始"
msgid "Recover Hard"
msgstr "恢复 Hard"
msgid "Recover Soft"
msgstr "恢复 Soft"
msgid "Restart"
msgstr "重启"
#: panels/job_status.py:280
msgid "Resume"
msgstr "恢复"
#: panels/extrude.py:48
msgid "Retract"
msgstr "缩回"
msgstr "回抽"
#: panels/bed_mesh.py:116 panels/bed_mesh.py:269
msgid "Save"
msgstr ""
msgstr "保存"
#: ks_includes/KlipperScreen.conf:141
msgid "Save Config"
msgstr "保存配置"
#: ks_includes/KlipperScreen.conf:146
msgid "Save configuration."
msgstr "保存配置"
msgstr "保存配置文件."
#: ks_includes/config.py:46
msgid "Screen Blanking Time"
msgstr ""
msgid "Screen Power Off Time"
msgstr "屏幕关闭时间"
msgid "Screen will show in less than one second"
msgstr "屏幕将在1秒内显示"
#: panels/bed_level.py:114
msgid "Screws Adjust"
msgstr "螺丝调整"
msgstr "Screws 调整"
#: 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 "尺寸"
msgstr "大小"
#: ks_includes/config.py:44
msgid "Slicer"
msgstr ""
msgstr "切片机"
#. This line for translations only
#: panels/extrude.py:31
msgid "Slow"
msgstr "慢"
msgid "Small"
msgstr "小的"
#: panels/print.py:39
msgid "Sort by: "
msgstr ""
msgstr "排序: "
msgid "Speed (mm/s)"
msgstr "速度(mm/s)"
#: 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 "Square Corner Velocity"
msgstr "方角速度"
msgid "Start"
msgstr "開始"
msgid "Starting WiFi Re-association"
msgstr "启动 WiFi 重新关联"
msgid "Starting recovery for"
msgstr "开始恢复"
msgid "Starting update for"
msgstr "开始更新"
msgid "System"
msgstr "系统"
#: panels/system.py:27
#, fuzzy
msgid ""
"System\n"
"Restart"
msgstr "重新开始"
msgstr "系统重启"
#: panels/system.py:30
msgid ""
"System\n"
"Shutdown"
msgstr ""
msgstr "关闭系统"
#: panels/extrude.py:50 ks_includes/KlipperScreen.conf:84
#: ks_includes/KlipperScreen.conf:159
msgid "Temperature"
msgstr "温度"
#: panels/extrude.py:38
#, python-format
msgid "To apply %s KlipperScreen needs to be restarted"
msgstr "要应用 %s,需要重新启动 KlipperScreen"
msgid "Tool"
msgstr "工具"
#: panels/print.py:167
msgid "Unload"
msgstr "卸下"
msgid "Up To Date"
msgstr "最新"
msgid "Update"
msgstr "更新"
msgid "Uploaded"
msgstr "已上传"
#: panels/move.py:25
msgid "View Mesh"
msgstr "查看网格"
msgid "X+"
msgstr "X+"
#: panels/move.py:27
msgid "X-"
msgstr "X-"
#: panels/move.py:30
msgid "Y+"
msgstr "Y ="
msgstr "Y+"
#: panels/move.py:32
msgid "Y-"
msgstr "Y-"
#: ks_includes/KlipperScreen.conf:125
msgid "Z Calibrate"
msgstr "Z校准"
msgstr "Z 校准"
#: panels/zcalibrate.py:28
msgid "Z Offset"
msgstr "Z偏移"
msgstr "Z 间隙"
msgid "Z Tilt"
msgstr "Z Tilt"
#: 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 "dBm"
msgstr "dBm"
msgid "minutes"
msgstr ""
msgstr "分钟"
#: panels/fine_tune.py:38
msgid "mm"
msgstr "毫米"
msgstr "mm"
#, fuzzy
#~ msgid "Klipper"
#~ msgstr "快闪重启"
msgid "mm/s"
msgstr "mm/s"
#~ msgid "Back"
#~ msgstr "背部"
msgid "mm/s^2"
msgstr "mm/s^2"
#~ msgid "Extrusion"
#~ msgstr "挤压"
#~ msgid "Medium (default)"
#~ msgstr "中(默认"
#~ msgid "Fan +"
#~ msgstr "风扇+"
#~ msgid "File Estimation (default)"
#~ msgstr "文件估计(默认)"
#~ msgid "Fan -"
#~ msgstr "风扇-"
#~ msgid "Fan Off"
#~ msgstr "关闭风扇"
#~ msgid "Speed"
#~ msgstr "速度"
#~ msgid "Fan On"
#~ msgstr "打开风扇"
#~ msgid "System Information"
#~ msgstr "系统信息"
#~ msgid "Fast"
#~ msgstr "快速"
#~ msgid "Time Elapsed"
#~ msgstr "时间流逝"
#~ msgid "Set Speed"
#~ msgstr "设置速度"
#~ msgid "Time Left"
#~ msgstr "剩下的时间"
#~ msgid "Slow"
#~ msgstr "慢"
#~ msgid "Tool 1"
#~ msgstr "工具1"
#~ msgid "?"
#~ msgstr "?"
#~ msgid "Are you sure you want to print"
#~ msgstr "您确定要开始打印吗"
#~ msgid "Cancel Change"
#~ msgstr "取消变更"
#~ msgid "Control"
#~ msgstr "控制"
#~ msgid "Emergency Stop"
#~ msgstr "紧急停止"
#~ msgid "Load Average"
#~ msgstr "平均负载"
#~ msgid "Network Info"
#~ msgstr "网络信息"
#~ msgid "Screen Blanking Time"
#~ msgstr "屏幕关闭时间"
+136 -45
View File
@@ -1,8 +1,15 @@
import gi
import logging
logger = logging.getLogger("KlipperScreen.Printer")
gi.require_version("Gtk", "3.0")
from gi.repository import Gdk, GLib
from ks_includes.KlippyGcodes import KlippyGcodes
class Printer:
data = {}
devices = {}
power_devices = {}
state_callbacks = {
"disconnected": None,
"error": None,
@@ -12,13 +19,16 @@ class Printer:
"startup": None,
"shutdown": None
}
tools = []
def __init__(self, printer_info, data):
def __init__(self, printer_info, data, state_execute_cb):
self.state = "disconnected"
self.state_cb = state_execute_cb
self.power_devices = {}
self.store_timeout = False
def reinit(self, printer_info, data):
logger.debug("Moonraker object status: %s" % data)
logging.debug("Moonraker object status: %s" % data)
self.config = data['configfile']['config']
self.toolcount = 0
self.extrudercount = 0
@@ -26,6 +36,9 @@ class Printer:
self.devices = {}
self.data = data
self.klipper = {}
self.tempstore = {}
if self.store_timeout is False:
GLib.timeout_add_seconds(1, self._update_temp_store)
self.klipper = {
"version": printer_info['software_version']
@@ -46,7 +59,8 @@ class Printer:
if "shared_heater" in self.config[x]:
continue
self.extrudercount += 1
if x.startswith('heater_bed'):
if x == 'heater_bed' or x.startswith('heater_generic ') or x.startswith('temperature_sensor ') \
or x.startswith('temperature_fan '):
self.devices[x] = {
"temperature": 0,
"target": 0
@@ -59,15 +73,16 @@ class Printer:
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")]
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))
logging.info("Klipper version: %s", self.klipper['version'])
logging.info("### Toolcount: " + str(self.toolcount) + " Heaters: " + str(self.extrudercount))
def process_update(self, data):
keys = [
'bed_mesh',
'display_status',
'fan',
'gcode_move',
'idle_timeout',
@@ -77,44 +92,43 @@ class Printer:
'virtual_sdcard',
'webhooks'
]
for x in keys:
for x in (self.get_tools() + self.get_heaters()):
if x in data:
if x not in self.data:
self.data[x] = {}
for i in data[x]:
self.set_dev_stat(x, i, data[x][i])
for y in data[x]:
self.data[x][y] = data[x][y]
for x in data:
if x == "configfile":
continue
if x not in self.data:
self.data[x] = {}
self.data[x].update(data[x])
if "heater_bed" in data:
d = data["heater_bed"]
if "target" in d:
self.set_dev_stat("heater_bed", "target", d["target"])
if "temperature" in d:
self.set_dev_stat("heater_bed", "temperature", d["temperature"])
for x in self.get_tools():
if x in data:
d = data[x]
if "target" in d:
self.set_dev_stat(x, "target", d["target"])
if "temperature" in d:
self.set_dev_stat(x, "temperature", d["temperature"])
if "webhooks" in data or "idle_timeout" in data or "pause_resume" in data or "print_stats" in data:
if "webhooks" in data or "idle_timeout" in data or "print_stats" in data:
self.evaluate_state()
def get_updates(self):
updates = self.data.copy()
updates.update(self.devices)
return updates
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
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 print_state == "complete":
new_state = "ready"
elif print_state != "printing": # Not printing a file, toolhead moving
new_state = "busy"
else:
new_state = "printing"
if new_state != "busy":
self.change_state(new_state)
@@ -129,28 +143,41 @@ class Printer:
if state == self.state or state not in list(self.state_callbacks):
return
logger.debug("Changing state from '%s' to '%s'" % (self.state, state))
logging.debug("Changing state from '%s' to '%s'" % (self.state, state))
prev_state = self.state
self.state = state
if self.state_callbacks[state] != None:
logger.debug("Running callback for state: %s" % state)
self.state_callbacks[state]()
if self.state_callbacks[state] is not None:
logging.debug("Adding callback for state: %s" % state)
Gdk.threads_add_idle(
GLib.PRIORITY_HIGH_IDLE,
self.state_cb,
self.state_callbacks[state],
prev_state
)
def configure_power_devices(self, data):
self.power_devices = {}
logger.debug("Processing power devices: %s" % data)
logging.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)
logging.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=""):
if not hasattr(self, "config"):
return []
return [i for i in list(self.config) if i.startswith(search)]
def get_config_section(self, section):
if section in self.config:
return self.config[section]
return False
def get_config_section(self, section):
if section not in self.config:
return False
@@ -159,9 +186,29 @@ class Printer:
def get_data(self):
return self.data
def get_fans(self):
fans = ["fan"] if len(self.get_config_section_list("fan")) > 0 else []
fan_types = ["controller_fan", "fan_generic", "heater_fan", "temperature_fan"]
for type in fan_types:
for f in self.get_config_section_list("%s " % type):
fans.append(f)
return fans
def get_gcode_macros(self):
return self.get_config_section_list("gcode_macro ")
def get_heaters(self):
heaters = []
if self.has_heated_bed():
heaters.append("heater_bed")
for h in self.get_config_section_list("heater_generic "):
heaters.append(h)
for h in self.get_config_section_list("temperature_sensor "):
heaters.append(h)
for h in self.get_config_section_list("temperature_fan "):
heaters.append(h)
return heaters
def get_printer_status_data(self):
data = {
"printer": {
@@ -178,7 +225,7 @@ class Printer:
}
}
sections = ["bed_mesh","bltouch","probe","quad_gantry_level"]
sections = ["bed_mesh", "bltouch", "probe", "quad_gantry_level", "z_tilt"]
for section in sections:
if self.config_section_exists(section):
data["printer"][section] = self.get_config_section(section).copy()
@@ -196,13 +243,13 @@ class Printer:
return
return self.power_devices[device]['status']
def get_stat(self, stat, substat = None):
def get_stat(self, stat, substat=None):
if stat not in self.data:
return None
if substat != None:
return {}
if substat is not None:
if substat in self.data[stat]:
return self.data[stat][substat]
return None
return {}
return self.data[stat]
def get_state(self):
@@ -211,7 +258,7 @@ class Printer:
def set_dev_temps(self, dev, temp, target=None):
if dev in self.devices:
self.devices[dev]['temperature'] = temp
if target != None:
if target is not None:
self.devices[dev]['target'] = target
def get_dev_stats(self, dev):
@@ -227,6 +274,33 @@ class Printer:
def get_extruder_count(self):
return self.extrudercount
def get_temp_store_devices(self):
return list(self.tempstore)
def get_temp_store_device_has_target(self, device):
if device in self.tempstore:
if "targets" in self.tempstore[device]:
return True
return False
def get_temp_store(self, device, section=False, results=0):
if device not in self.tempstore:
return False
if section is not False:
if section not in self.tempstore[device]:
return False
if results == 0 or results >= len(self.tempstore[device][section]):
return self.tempstore[device][section]
return self.tempstore[device][section][-results:]
temp = {}
for section in self.tempstore[device]:
if results == 0 or results >= len(self.tempstore[device][section]):
temp[section] = self.tempstore[device][section]
temp[section] = self.tempstore[device][section][-results:]
return temp
def get_tools(self):
return self.tools
@@ -237,6 +311,15 @@ class Printer:
if "heater_bed" in self.devices:
return True
def init_temp_store(self, result):
for dev in result:
self.tempstore[dev] = {}
if "targets" in result[dev]:
self.tempstore[dev]["targets"] = result[dev]["targets"]
if "temperatures" in result[dev]:
self.tempstore[dev]["temperatures"] = result[dev]["temperatures"]
logging.info("Temp store: %s" % list(self.tempstore))
def section_exists(self, section):
if section in self.get_config_section_list():
return True
@@ -252,3 +335,11 @@ class Printer:
return
self.devices[dev][stat] = value
def _update_temp_store(self):
for device in self.tempstore:
for x in self.tempstore[device]:
if len(self.tempstore[device][x]) >= 1200:
self.tempstore[device][x].pop(0)
self.tempstore[device][x].append(round(self.get_dev_stat(device, x[:-1]), 2))
return True
+58 -64
View File
@@ -7,13 +7,10 @@ from jinja2 import Environment, Template
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
logger = logging.getLogger("KlipperScreen.ScreenPanel")
class ScreenPanel:
title_spacing = 50
control = {}
def __init__(self, screen, title, back=True):
def __init__(self, screen, title, back=True, action_bar=True, printer_name=True):
self._screen = screen
self._config = screen._config
self._files = screen.files
@@ -21,98 +18,92 @@ class ScreenPanel:
self._printer = screen.printer
self.labels = {}
self._gtk = screen.gtk
self.control = {}
self.title = title
self.layout = Gtk.Layout()
self.layout.set_size(self._screen.width, self._screen.height)
action_bar_width = self._gtk.get_action_bar_width()
self.control_grid = self._gtk.HomogeneousGrid()
self.control_grid.set_size_request(action_bar_width - 2, self._screen.height)
self.control_grid.get_style_context().add_class('action_bar')
button_scale = self._gtk.get_header_image_scale()
logger.debug("Button scale: %s" % button_scale)
if back == True:
self.control['back'] = self._gtk.ButtonImage('back', None, None, button_scale[0], button_scale[1])
self.control['back'].connect("clicked", self._screen._menu_go_back)
self.control_grid.attach(self.control['back'], 0, 0, 1, 1)
self.control['home'] = self._gtk.ButtonImage('home', None, None, button_scale[0], button_scale[1])
self.control['home'].connect("clicked", self.menu_return, True)
self.control_grid.attach(self.control['home'], 0, 1, 1, 1)
self.control['printer_select'] = Gtk.Label("")
self.control_grid.attach(self.control['printer_select'], 0, 2, 1, 1)
else:
for i in range(3):
self.control['space%s' % i] = Gtk.Label("")
self.control_grid.attach(self.control['space%s' % i], 0, i, 1, 1)
self.control['estop'] = self._gtk.ButtonImage('emergency', None, None, button_scale[0], button_scale[1])
self.control['estop'].connect("clicked", self.emergency_stop)
self.control_grid.attach(self.control['estop'], 0, 3, 1, 1)
#self.layout.put(self.control['estop'], int(self._screen.width/4*3 - button_scale[0]/2), 0)
try:
env = Environment(extensions=["jinja2.ext.i18n"])
env.install_gettext_translations(self.lang)
j2_temp = env.from_string(title)
title = j2_temp.render()
except:
logger.debug("Error parsing jinja for title: %s" % title)
self.title = Gtk.Label()
self.title.set_size_request(self._screen.width - action_bar_width, self.title_spacing)
self.title.set_hexpand(True)
self.title.set_halign(Gtk.Align.CENTER)
self.title.set_valign(Gtk.Align.CENTER)
self.set_title(title)
action_bar_width = self._gtk.get_action_bar_width() if action_bar is True else 0
self.content = Gtk.Box(spacing=0)
self.content.set_size_request(self._screen.width - action_bar_width, self._screen.height - self.title_spacing)
self.layout.put(self.control_grid, 0, 0)
self.layout.put(self.title, action_bar_width, 0)
self.layout.put(self.content, action_bar_width, self.title_spacing)
def initialize(self, panel_name):
# Create gtk items here
return
def emergency_stop(self, widget):
self._screen._ws.klippy.emergency_stop()
_ = self.lang.gettext
if self._config.get_main_config_option('confirm_estop') == "True":
self._screen._confirm_send_action(widget, _("Are you sure you want to run Emergency Stop?"),
"printer.emergency_stop")
else:
self._screen._ws.klippy.emergency_stop()
def format_target(self, temp):
if temp <= 0:
return ""
else:
return self.format_temp(temp, 0)
def format_temp(self, temp, places=1):
if places == 0:
n = int(temp)
else:
n = round(temp, places)
return "%s<small>°C</small>" % str(n)
def get(self):
return self.layout
def get_content(self):
return self.content
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)
loc = self._files.get_thumbnail_location(filename)
if loc is None:
return None
if loc[0] == "file":
return self._gtk.PixbufFromFile(loc[1], None, width, height)
if loc[0] == "http":
return self._gtk.PixbufFromHttp(loc[1], None, width, height)
return None
def get_title(self):
return self.title
def home(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
def homexy(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME_XY)
def z_tilt(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.Z_TILT)
def quad_gantry_level(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.QUAD_GANTRY_LEVEL)
def menu_item_clicked(self, widget, panel, item):
print("### Creating panel "+ item['panel'] + " : %s %s" % (panel, item))
print("### Creating panel " + item['panel'] + " : %s %s" % (panel, item))
if "items" in item:
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + panel, item['panel'], item['name'],
1, False, items=item['items'])
1, False, items=item['items'])
return
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + panel, item['panel'], item['name'],
1, False)
1, False)
def menu_return(self, widget, home=False):
if home == False:
if home is False:
self._screen._menu_go_back()
return
self._screen._menu_go_home()
def set_title(self, title):
self.title.set_label(title)
self.title = title
def show_all(self):
self._screen.show_all()
@@ -121,6 +112,9 @@ class ScreenPanel:
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):
def update_temp(self, dev, temp, target, name=None):
if dev in self.labels:
self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
if name is None:
self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
else:
self.labels[dev].set_label("%s\n%s" % (name, self._gtk.formatTemperatureString(temp, target)))
+210
View File
@@ -0,0 +1,210 @@
import datetime
import gi
import logging
import math
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
class HeaterGraph(Gtk.DrawingArea):
def __init__(self, printer):
super().__init__()
self.set_hexpand(True)
self.set_vexpand(True)
self.get_style_context().add_class('heatergraph')
self.printer = printer
self.store = {}
self.max_length = 0
self.connect('draw', self.draw_graph)
self.add_events(Gdk.EventMask.TOUCH_MASK)
self.add_events(Gdk.EventMask.BUTTON_PRESS_MASK)
self.connect('touch-event', self.event_cb)
self.connect('button_press_event', self.event_cb)
def add_object(self, name, type, rgb=[0, 0, 0], dashed=False, fill=False):
if name not in self.store:
self.store.update({name: {"show": True}})
self.store[name].update({type: {
"dashed": dashed,
"fill": fill,
"rgb": rgb
}})
self.max_length = max(self.max_length, len(self.printer.get_temp_store(name, type)))
def event_cb(self, da, ev):
if ev.get_source_device().get_source() == Gdk.InputSource.MOUSE:
if ev.type == Gdk.EventType.BUTTON_PRESS:
x = ev.x
y = ev.y
# logging.info("Drawing area clicked: %s %s" % (x, y))
if ev.get_source_device().get_source() == Gdk.InputSource.TOUCHSCREEN:
if ev.touch.type == Gdk.EventType.TOUCH_BEGIN:
x = ev.touch.x
y = ev.touch.y
# logging.info("Drawing area clicked: %s %s" % (x, y))
def get_max_length(self):
n = []
for name in self.store:
if "temperatures" not in self.store[name]:
continue
n.append(len(self.printer.get_temp_store(name, "temperatures")))
return max(n)
def get_max_num(self, data_points=0):
mnum = []
for x in self.store:
for t in self.store[x]:
if t == "show":
continue
mnum.append(max(self.printer.get_temp_store(x, t, data_points)))
return max(mnum)
def draw_graph(self, da, ctx):
width = da.get_allocated_width()
height = da.get_allocated_height()
g_width_start = 30
g_width = width - 15
g_height_start = 15
g_height = height - 30
ctx.set_source_rgb(.5, .5, .5)
ctx.set_line_width(1)
ctx.set_tolerance(0.1)
ctx.move_to(g_width_start, g_height_start)
ctx.line_to(g_width, g_height_start)
ctx.line_to(g_width, g_height)
ctx.line_to(g_width_start, g_height)
ctx.line_to(g_width_start, g_height_start)
ctx.stroke()
ctx.set_source_rgb(1, 0, 0)
ctx.move_to(g_width_start, height)
gsize = [
[g_width_start, g_height_start],
[g_width, g_height]
]
self.max_length = self.get_max_length()
graph_width = gsize[1][0] - gsize[0][0]
points_per_pixel = self.max_length / graph_width
if points_per_pixel > 3:
points_per_pixel = 3
data_points = int(round(graph_width * points_per_pixel, 0))
max_num = math.ceil(self.get_max_num(data_points) * 1.1 / 10) * 10
d_width = 1 / points_per_pixel
d_height_scale = self.graph_lines(ctx, gsize, max_num)
self.graph_time(ctx, gsize, points_per_pixel)
for name in self.store:
if not self.store[name]['show']:
continue
for type in self.store[name]:
d = self.printer.get_temp_store(name, type, data_points)
if d is False:
continue
self.graph_data(ctx, d, gsize, d_height_scale, d_width, self.store[name][type]["rgb"],
self.store[name][type]["dashed"], self.store[name][type]["fill"])
def graph_data(self, ctx, data, gsize, hscale, swidth, rgb, dashed=False, fill=False):
i = 0
ctx.set_source_rgba(rgb[0], rgb[1], rgb[2], 1)
ctx.move_to(gsize[0][0] + 1, gsize[0][1] - 1)
if dashed:
ctx.set_dash([10, 5])
else:
ctx.set_dash([1, 0])
d_len = len(data) - 1
for d in data:
p_x = i*swidth + gsize[0][0] if i != d_len else gsize[1][0] - 1
p_y = gsize[1][1] - 1 - (d*hscale)
if i == 0:
ctx.move_to(gsize[0][0]+1, p_y)
i += 1
continue
ctx.line_to(p_x, p_y)
i += 1
if fill is False:
ctx.stroke()
return
ctx.stroke_preserve()
ctx.line_to(gsize[1][0] - 1, gsize[1][1] - 1)
ctx.line_to(gsize[0][0] + 1, gsize[1][1] - 1)
if fill:
ctx.set_source_rgba(rgb[0], rgb[1], rgb[2], .1)
ctx.fill()
def graph_lines(self, ctx, gsize, max_num):
if max_num <= 30:
nscale = 5
elif max_num <= 60:
nscale = 10
elif max_num <= 130:
nscale = 25
else:
nscale = 50
# nscale = math.floor((max_num / 10) / 4) * 10
r = int(max_num/nscale) + 1
hscale = (gsize[1][1] - gsize[0][1]) / (r * nscale)
for i in range(r):
ctx.set_source_rgb(.5, .5, .5)
lheight = gsize[1][1] - nscale*i*hscale
ctx.move_to(6, lheight + 3)
ctx.show_text(str(nscale*i).rjust(3, " "))
ctx.stroke()
ctx.set_source_rgba(.5, .5, .5, .2)
ctx.move_to(gsize[0][0], lheight)
ctx.line_to(gsize[1][0], lheight)
ctx.stroke()
return hscale
def graph_time(self, ctx, gsize, points_per_pixel):
glen = gsize[1][0] - gsize[0][0]
now = datetime.datetime.now()
first = gsize[1][0] - ((now.second + ((now.minute % 2) * 60)) / points_per_pixel)
steplen = 120 / points_per_pixel # For 120s
i = 0
while True:
x = first - i*steplen
if x < gsize[0][0]:
break
ctx.set_source_rgba(.5, .5, .5, .2)
ctx.move_to(x, gsize[0][1])
ctx.line_to(x, gsize[1][1])
ctx.stroke()
ctx.set_source_rgb(.5, .5, .5)
ctx.move_to(x - 15, gsize[1][1] + 15)
hour = now.hour
min = now.minute - (now.minute % 2) - i*2
if min < 0:
hour -= 1
min = 60 + min
if hour < 0:
hour += 24
ctx.show_text("%02d:%02d" % (hour, min))
ctx.stroke()
i += 1
def is_showing(self, device):
if device not in self.store:
return False
return self.store[device]['show']
def set_showing(self, device, show=True):
if device not in self.store:
return
self.store[device]['show'] = show
+79
View File
@@ -0,0 +1,79 @@
import datetime
import gi
import logging
import math
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
class Keypad(Gtk.Box):
def __init__(self, screen, change_temp, close_function):
super().__init__(orientation=Gtk.Orientation.VERTICAL)
_ = screen.lang.gettext
self.labels = {}
self.change_temp = change_temp
self.screen = screen
self._gtk = screen.gtk
numpad = self._gtk.HomogeneousGrid()
numpad.set_direction(Gtk.TextDirection.LTR)
keys = [
['1', 'numpad_tleft'],
['2', 'numpad_top'],
['3', 'numpad_tright'],
['4', 'numpad_left'],
['5', 'numpad_button'],
['6', 'numpad_right'],
['7', 'numpad_left'],
['8', 'numpad_button'],
['9', 'numpad_right'],
['B', 'numpad_bleft'],
['0', 'numpad_bottom'],
['E', 'numpad_bright']
]
for i in range(len(keys)):
id = 'button_' + str(keys[i][0])
if keys[i][0] == "B":
self.labels[id] = self._gtk.ButtonImage("backspace", None, None, 1, 1)
elif keys[i][0] == "E":
self.labels[id] = self._gtk.ButtonImage("complete", None, None, 1, 1)
else:
self.labels[id] = Gtk.Button(keys[i][0])
self.labels[id].connect('clicked', self.update_entry, keys[i][0])
self.labels[id].get_style_context().add_class(keys[i][1])
numpad.attach(self.labels[id], i % 3, i/3, 1, 1)
self.labels["keypad"] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['entry'] = Gtk.Entry()
self.labels['entry'].props.xalign = 0.5
ctx = self.labels['entry'].get_style_context()
b = self._gtk.ButtonImage('cancel', _('Close'), None, 1, 1)
b.connect("clicked", close_function)
self.add(self.labels['entry'])
self.add(numpad)
self.add(b)
self.labels["keypad"] = numpad
def clear(self):
self.labels['entry'].set_text("")
def update_entry(self, widget, digit):
text = self.labels['entry'].get_text()
if digit == 'B':
if len(text) < 1:
return
self.labels['entry'].set_text(text[0:-1])
elif digit == 'E':
temp = int(text)
self.change_temp(temp)
self.labels['entry'].set_text("")
else:
if len(text) >= 3:
return
self.labels['entry'].set_text(text + digit)
+423 -131
View File
@@ -1,98 +1,198 @@
import asyncio
import os, signal
import os
import signal
import json
import logging
import re
import socket
import subprocess
import threading
import time
from contextlib import suppress
from threading import Thread
logger = logging.getLogger("KlipperScreen.WifiManager")
from subprocess import PIPE, Popen, STDOUT
from queue import Queue, Empty
RESCAN_INTERVAL = 120
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
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+).*$")
]
RESCAN_INTERVAL = 180
KS_SOCKET_FILE = "/tmp/.KS_wpa_supplicant"
class WifiManager():
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
_stop_loop = False
thread = None
def __init__(self, *args, **kwargs):
def __init__(self, interface, *args, **kwargs):
super().__init__(*args, **kwargs)
self.loop = None
self._poll_task = None
self._scanning = False
self._callbacks = {
"connected": [],
"connecting_status": [],
"scan_results": []
}
self._stop_loop = False
self.connected = False
self.connected_ssid = None
self.connecting_info = []
self.event = threading.Event()
self.initialized = False
self.interface = interface
self.networks = {}
self.read_wpa_supplicant()
self.supplicant_networks = {}
self.queue = Queue()
self.tasks = []
self.timeout = None
self.scan_time = 0
if os.path.exists(KS_SOCKET_FILE):
os.remove(KS_SOCKET_FILE)
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.soc = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
self.soc.bind(KS_SOCKET_FILE)
self.soc.connect("/var/run/wpa_supplicant/%s" % interface)
except Exception:
logging.info("Error connecting to wifi socket: %s" % interface)
return
self._poll_task.cancel()
with suppress(asyncio.CancelledError):
loop.run_until_complete(self._poll_task)
finally:
loop.close()
self.wpa_thread = WpaSocket(self, self.queue, self.callback)
self.wpa_thread.start()
self.initialized = True
def stop(self):
self.loop.call_soon_threadsafe(self.loop.stop)
self.wpa_cli("ATTACH", False)
self.wpa_cli("SCAN", False)
GLib.idle_add(self.read_wpa_supplicant)
self.timeout = GLib.timeout_add_seconds(RESCAN_INTERVAL, self.rescan)
def stop_loop(self):
loop.stop()
def add_callback(self, name, callback):
if name in self._callbacks and callback not in self._callbacks[name]:
self._callbacks[name].append(callback)
async def _poll(self):
while True:
try:
await self.scan()
await asyncio.sleep(RESCAN_INTERVAL)
except:
logger.exception("Poll wifi error")
def add_network(self, ssid, psk):
for id in list(self.supplicant_networks):
if self.supplicant_networks[id]['ssid'] == ssid:
# Modify network
return
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')
# TODO: Add wpa_cli error checking
network_id = self.wpa_cli("ADD_NETWORK")
commands = [
'ENABLE_NETWORK %s' % (network_id),
'SET_NETWORK %s ssid "%s"' % (network_id, ssid.replace('"', '\"')),
'SET_NETWORK %s psk "%s"' % (network_id, psk.replace('"', '\"'))
]
self.wpa_cli_batch(commands)
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)
self.read_wpa_supplicant()
id = None
for i in list(self.supplicant_networks):
if self.supplicant_networks[i]['ssid'] == ssid:
id = i
break
if essid is None or mac is None:
self.connected = False
return None
self.connected = True
return [essid, mac]
if id is None:
logging.info("Error adding network")
return False
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:
self.save_wpa_conf()
return True
def callback(self, type, msg):
if type in self._callbacks:
for cb in self._callbacks[type]:
Gdk.threads_add_idle(
GLib.PRIORITY_DEFAULT_IDLE,
cb,
msg)
def connect(self, ssid):
id = None
for netid, net in self.supplicant_networks.items():
if net['ssid'] == ssid:
id = netid
break
if id is None:
logging.info("Wifi network is not defined in wpa_supplicant")
return False
logging.info("Attempting to connect to wifi: %s" % id)
self.connecting_info = ["Attempting to connect to %s" % ssid]
self.wpa_cli("SELECT_NETWORK %s" % id)
self.save_wpa_conf()
def delete_network(self, ssid):
id = None
for i in list(self.supplicant_networks):
if self.supplicant_networks[i]['ssid'] == ssid:
id = i
break
if id is None:
logging.debug("Unable to find network in wpa_supplicant")
return
self.wpa_cli("REMOVE_NETWORK %s" % id)
for id in list(self.supplicant_networks):
if self.supplicant_networks[id]['ssid'] == ssid:
del self.supplicant_networks[id]
break
self.save_wpa_conf()
def get_connected_ssid(self):
return self.connected_ssid
def get_current_wifi(self, interface="wlan0"):
status = self.wpa_cli("STATUS").split('\n')
vars = {}
for line in status:
arr = line.split('=')
vars[arr[0]] = "=".join(arr[1:])
prev_ssid = self.connected_ssid
if "ssid" in vars and "bssid" in vars:
self.connected = True
self.connected_ssid = vars['ssid']
for ssid, val in self.networks.items():
if ssid == vars['ssid']:
self.networks[ssid]['connected'] = True
else:
self.networks[ssid]['connected'] = False
if prev_ssid != self.connected_ssid:
for cb in self._callbacks['connected']:
Gdk.threads_add_idle(
GLib.PRIORITY_DEFAULT_IDLE,
cb, self.connected_ssid, prev_ssid)
return [vars['ssid'], vars['bssid']]
else:
logging.info("Resetting connected_ssid")
self.connected = False
self.connected_ssid = None
for ssid, val in self.networks.items():
self.networks[ssid]['connected'] = False
if prev_ssid != self.connected_ssid:
for cb in self._callbacks['connected']:
Gdk.threads_add_idle(
GLib.PRIORITY_DEFAULT_IDLE,
cb, self.connected_ssid, prev_ssid)
return None
def get_current_wifi_idle_add(self):
self.get_current_wifi()
return False
def get_network_info(self, ssid=None, mac=None):
if ssid is not None and ssid in self.networks:
return self.networks[ssid]
if mac is not None and ssid is None:
for net in self.networks:
if mac == net['mac']:
return net
@@ -101,78 +201,270 @@ class WifiManager(Thread):
def get_networks(self):
return list(self.networks)
def get_supplicant_networks(self):
return self.supplicant_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 is_initialized(self):
return self.initialized
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())
results = self.wpa_cli("LIST_NETWORKS").split('\n')
results.pop(0)
self.supplicant_networks = {}
self.networks_in_supplicant = []
for network in networks:
self.networks_in_supplicant.append(network)
for net in [n.split('\t') for n in results]:
self.supplicant_networks[net[0]] = {
"ssid": net[1],
"bssid": net[2],
"flags": net[3] if len(net) == 4 else ""
}
self.networks_in_supplicant.append(self.supplicant_networks[net[0]])
def remove_callback(self, name, callback):
if name in self._callbacks and callback in self._callbacks[name]:
self._callbacks[name].remove(callback)
def rescan(self):
self.wpa_cli("SCAN", False)
return True
def save_wpa_conf(self):
logging.info("Saving WPA config")
self.wpa_cli("SAVE_CONFIG")
def scan_results(self, interface='wlan0'):
new_networks = []
deleted_networks = list(self.networks)
results = self.wpa_cli("SCAN_RESULTS").split('\n')
results.pop(0)
aps = []
for res in results:
match = re.match("^([a-f0-9:]+)\\s+([0-9]+)\\s+([\\-0-9]+)\\s+(\\S+)\\s+(.+)?", res)
if match:
net = {
"mac": match.group(1),
"channel": WifiChannels.lookup(match.group(2))[1],
"connected": False,
"configured": False,
"frequency": match.group(2),
"flags": match.group(4),
"signal_level_dBm": match.group(3),
"ssid": match.group(5)
}
if "WPA2" in net['flags']:
net['encryption'] = "WPA2"
elif "WPA" in net['flags']:
net['encryption'] = "WPA"
elif "WEP" in net['flags']:
net['encryption'] = "WEP"
else:
net['encryption'] = "off"
aps.append(net)
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
self.networks[ap['ssid']] = ap
if cur_info is not None and cur_info[0] == ap['ssid'] and cur_info[1].lower() == ap['mac'].lower():
self.networks[ap['ssid']]['connected'] = True
for net in list(self.networks):
if net in deleted_networks:
deleted_networks.remove(net)
else:
new_networks.append(net)
if len(new_networks) > 0 or len(deleted_networks) > 0:
for cb in self._callbacks['scan_results']:
Gdk.threads_add_idle(
GLib.PRIORITY_DEFAULT_IDLE,
cb, new_networks, deleted_networks)
def wpa_cli(self, command, wait=True):
if wait is False:
self.wpa_thread.skip_command()
self.soc.send(command.encode())
if wait is True:
resp = self.queue.get()
return resp
def wpa_cli_batch(self, commands):
for cmd in commands:
self.wpa_cli(cmd)
class WpaSocket(Thread):
def __init__(self, wm, queue, callback):
super().__init__()
self.queue = queue
self.callback = callback
self.soc = wm.soc
self._stop_loop = False
self.skip_commands = 0
self.wm = wm
def run(self):
event = threading.Event()
logging.debug("Setting up wifi event loop")
while self._stop_loop is False:
try:
msg = self.soc.recv(4096).decode().strip()
except Exception:
# TODO: Socket error
continue
if msg.startswith("<"):
if "CTRL-EVENT-SCAN-RESULTS" in msg:
Gdk.threads_add_idle(GLib.PRIORITY_DEFAULT_IDLE, self.wm.scan_results)
elif "CTRL-EVENT-DISCONNECTED" in msg:
self.callback("connecting_status", msg)
match = re.match('<3>CTRL-EVENT-DISCONNECTED bssid=(\\S+) reason=3 locally_generated=1', msg)
if match:
for net in self.wm.networks:
if self.wm.networks[net]['mac'] == match.group(1):
self.wm.networks[net]['connected'] = False
break
elif "Trying to associate" in msg:
self.callback("connecting_status", msg)
elif "CTRL-EVENT-REGDOM-CHANGE" in msg:
self.callback("connecting_status", msg)
elif "CTRL-EVENT-CONNECTED" in msg:
Gdk.threads_add_idle(GLib.PRIORITY_DEFAULT_IDLE, self.wm.get_current_wifi_idle_add)
self.callback("connecting_status", msg)
else:
if self.skip_commands > 0:
self.skip_commands = self.skip_commands - 1
else:
self.queue.put(msg)
logging.info("Wifi event loop ended")
def skip_command(self):
self.skip_commands = self.skip_commands + 1
def stop(self):
self._stop_loop = True
class WifiChannels:
@staticmethod
def lookup(freq):
if freq == "2412":
return ("2.4", "1")
if freq == "2417":
return ("2.4", "2")
if freq == "2422":
return ("2.4", "3")
if freq == "2427":
return ("2.4", "4")
if freq == "2432":
return ("2.4", "5")
if freq == "2437":
return ("2.4", "6")
if freq == "2442":
return ("2.4", "7")
if freq == "2447":
return ("2.4", "8")
if freq == "2452":
return ("2.4", "9")
if freq == "2457":
return ("2.4", "10")
if freq == "2462":
return ("2.4", "11")
if freq == "2467":
return ("2.4", "12")
if freq == "2472":
return ("2.4", "13")
if freq == "2484":
return ("2.4", "14")
if freq == "5035":
return ("5", "7")
if freq == "5040":
return ("5", "8")
if freq == "5045":
return ("5", "9")
if freq == "5055":
return ("5", "11")
if freq == "5060":
return ("5", "12")
if freq == "5080":
return ("5", "16")
if freq == "5170":
return ("5", "34")
if freq == "5180":
return ("5", "36")
if freq == "5190":
return ("5", "38")
if freq == "5200":
return ("5", "40")
if freq == "5210":
return ("5", "42")
if freq == "5220":
return ("5", "44")
if freq == "5230":
return ("5", "46")
if freq == "5240":
return ("5", "48")
if freq == "5260":
return ("5", "52")
if freq == "5280":
return ("5", "56")
if freq == "5300":
return ("5", "60")
if freq == "5320":
return ("5", "64")
if freq == "5500":
return ("5", "100")
if freq == "5520":
return ("5", "104")
if freq == "5540":
return ("5", "108")
if freq == "5560":
return ("5", "112")
if freq == "5580":
return ("5", "116")
if freq == "5600":
return ("5", "120")
if freq == "5620":
return ("5", "124")
if freq == "5640":
return ("5", "128")
if freq == "5660":
return ("5", "132")
if freq == "5680":
return ("5", "136")
if freq == "5700":
return ("5", "140")
if freq == "5720":
return ("5", "144")
if freq == "5745":
return ("5", "149")
if freq == "5765":
return ("5", "153")
if freq == "5785":
return ("5", "157")
if freq == "5805":
return ("5", "161")
if freq == "5825":
return ("5", "165")
if freq == "4915":
return ("5", "183")
if freq == "4920":
return ("5", "184")
if freq == "4925":
return ("5", "185")
if freq == "4935":
return ("5", "187")
if freq == "4940":
return ("5", "188")
if freq == "4945":
return ("5", "189")
if freq == "4960":
return ("5", "192")
if freq == "4980":
return ("5", "196")
return None
+14
View File
@@ -0,0 +1,14 @@
site_name: KlipperScreen
nav:
- Hardware.md
- Installation.md
- Configuration.md
- Theming.md
- Troubleshooting.md
- changelog.md
- panels.md
- Contact.md
theme: readthedocs
repo_url: https://github.com/jordanruthe/KlipperScreen/
plugins:
- search
+283
View File
@@ -0,0 +1,283 @@
# -*- coding: utf-8 -*-
import datetime
import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from jinja2 import Environment, Template
from ks_includes.KlippyGtk import KlippyGtk
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
class BasePanel(ScreenPanel):
def __init__(self, screen, title, back=True, action_bar=True, printer_name=True):
super().__init__(screen, title, back, action_bar, printer_name)
self.current_panel = None
self.time_min = -1
self.time_format = self._config.get_main_config_option("24htime")
self.title_spacing = self._gtk.font_size * 2
self.buttons_showing = {
'back': False if back else True,
'macros_shortcut': False,
'printer_select': False
}
self.layout = Gtk.Layout()
self.layout.set_size(self._screen.width, self._screen.height)
action_bar_width = self._gtk.get_action_bar_width() if action_bar is True else 0
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()
logging.debug("Button scale: %s" % button_scale)
self.control['back'] = self._gtk.ButtonImage('back', None, None, button_scale[0], button_scale[1])
self.control['back'].connect("clicked", self.back)
self.control['home'] = self._gtk.ButtonImage('main', None, None, button_scale[0], button_scale[1])
self.control['home'].connect("clicked", self.menu_return, True)
if len(self._config.get_printers()) > 1:
self.control['printer_select'] = self._gtk.ButtonImage(
'shuffle', None, None, button_scale[0], button_scale[1])
self.control['printer_select'].connect("clicked", self._screen.show_printer_select)
self.control['macro_shortcut'] = self._gtk.ButtonImage(
'custom-script', None, None, button_scale[0], button_scale[1])
self.control['macro_shortcut'].connect("clicked", self.menu_item_clicked, "gcode_macros", {
"name": "Macros",
"panel": "gcode_macros"
})
self.control['estop'] = self._gtk.ButtonImage('emergency', None, None, button_scale[0], button_scale[1])
self.control['estop'].connect("clicked", self.emergency_stop)
self.locations = {
'macro_shortcut': 2,
'printer_select': 2
}
button_range = 3
if len(self._config.get_printers()) > 1:
self.locations['macro_shortcut'] = 3
if self._config.get_main_config_option('side_macro_shortcut') == "True":
button_range = 4
for i in range(button_range):
self.control['space%s' % i] = Gtk.Label("")
self.control_grid.attach(self.control['space%s' % i], 0, i, 1, 1)
self.control_grid.attach(self.control['estop'], 0, 4, 1, 1)
try:
env = Environment(extensions=["jinja2.ext.i18n"])
env.install_gettext_translations(self.lang)
j2_temp = env.from_string(title)
title = j2_temp.render()
except Exception:
logging.debug("Error parsing jinja for title: %s" % title)
self.titlelbl = Gtk.Label()
self.titlelbl.set_size_request(self._screen.width - action_bar_width, self.title_spacing)
self.titlelbl.set_hexpand(True)
self.titlelbl.set_halign(Gtk.Align.CENTER)
self.titlelbl.set_valign(Gtk.Align.CENTER)
self.set_title(title)
self.content = Gtk.VBox(spacing=0)
self.content.set_size_request(self._screen.width - action_bar_width, self._screen.height - self.title_spacing)
if action_bar is True:
self.layout.put(self.control_grid, 0, 0)
self.control['time_box'] = Gtk.Box()
self.control['time_box'].set_halign(Gtk.Align.END)
self.control['time_box'].set_size_request(0, self.title_spacing)
self.control['time'] = Gtk.Label("00:00 AM")
self.control['time'].set_size_request(0, self.title_spacing)
self.control['time'].set_halign(Gtk.Align.END)
self.control['time'].set_valign(Gtk.Align.CENTER)
self.control['time_box'].pack_end(self.control['time'], True, 0, 0)
self.control['temp_box'] = Gtk.Box()
self.control['temp_box'].set_vexpand(True)
self.control['temp_box'].set_size_request(0, self.title_spacing)
self.layout.put(self.control['temp_box'], action_bar_width, 0)
self.layout.put(self.titlelbl, action_bar_width, 0)
self.layout.put(self.control['time_box'], action_bar_width, 0)
self.layout.put(self.content, action_bar_width, self.title_spacing)
def initialize(self, panel_name):
# Create gtk items here
return
def show_heaters(self, show=True):
for child in self.control['temp_box'].get_children():
self.control['temp_box'].remove(child)
if show is False:
return
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, .4, .4)
self.labels[extruder + '_box'].pack_start(ext_img, True, 3, 3)
self.labels[extruder + '_box'].pack_start(self.labels[extruder], True, 3, 3)
i += 1
self.current_extruder = self._printer.get_stat("toolhead", "extruder")
self.control['temp_box'].pack_start(self.labels["%s_box" % self.current_extruder], True, 5, 5)
if self._printer.has_heated_bed():
heater_bed = self._gtk.Image("bed.svg", None, .4, .4)
self.labels['heater_bed'] = Gtk.Label(label="20 C")
# self.labels['heater_bed'].get_style_context().add_class("printing-info")
heater_bed_box = Gtk.Box(spacing=0)
heater_bed_box.pack_start(heater_bed, True, 5, 5)
heater_bed_box.pack_start(self.labels['heater_bed'], True, 3, 3)
self.control['temp_box'].pack_end(heater_bed_box, True, 3, 3)
def activate(self):
size = self.control['time_box'].get_allocation().width
self.layout.remove(self.control['time_box'])
self.control['time_box'].set_size_request(size, self.title_spacing)
self.layout.put(self.control['time_box'], self._screen.width - size - 5, 0)
GLib.timeout_add_seconds(1, self.update_time)
self.update_time()
def add_content(self, panel):
self.current_panel = panel
self.set_title(panel.get_title())
self.content.add(panel.get_content())
def back(self, widget):
if self.current_panel is None:
return
if self._screen.is_keyboard_showing():
self._screen.remove_keyboard()
if hasattr(self.current_panel, "back"):
if not self.current_panel.back():
self._screen._menu_go_back()
else:
self._screen._menu_go_back()
def get(self):
return self.layout
def process_update(self, action, data):
if action != "notify_status_update" or self._printer is None:
return
if self._printer.has_heated_bed():
self.labels["heater_bed"].set_label(
"%02d°" % round(self._printer.get_dev_stat("heater_bed", "temperature")))
for x in self._printer.get_tools():
self.labels[x].set_label("%02d°" % round(self._printer.get_dev_stat(x, "temperature")))
if "toolhead" in data and "extruder" in data["toolhead"]:
if data["toolhead"]["extruder"] != self.current_extruder:
self.control['temp_box'].remove(self.labels["%s_box" % self.current_extruder])
self.current_extruder = data["toolhead"]["extruder"]
self.control['temp_box'].pack_start(self.labels["%s_box" % self.current_extruder], True, 3, 3)
self.control['temp_box'].show_all()
def remove(self, widget):
self.content.remove(widget)
def show_back(self, show=True):
if show is True and self.buttons_showing['back'] is False:
self.control_grid.remove(self.control_grid.get_child_at(0, 0))
self.control_grid.attach(self.control['back'], 0, 0, 1, 1)
self.control_grid.remove(self.control_grid.get_child_at(0, 1))
self.control_grid.attach(self.control['home'], 0, 1, 1, 1)
self.buttons_showing['back'] = True
elif show is False and self.buttons_showing['back'] is True:
for i in range(0, 2):
self.control_grid.remove(self.control_grid.get_child_at(0, i))
self.control_grid.attach(self.control['space%s' % i], 0, i, 1, 1)
self.buttons_showing['back'] = False
self.control_grid.show()
def show_macro_shortcut(self, show=True, mod_row=False):
if show == "True":
show = True
if show is True and self.buttons_showing['macros_shortcut'] is False:
if len(self._config.get_printers()) > 1 and mod_row is True:
self.control_grid.insert_row(self.locations['macro_shortcut'])
else:
self.control_grid.remove(self.control_grid.get_child_at(0, self.locations['macro_shortcut']))
if 'space%s' % self.locations['macro_shortcut'] in self.control:
self.control_grid.remove(self.control['space%s' % self.locations['macro_shortcut']])
self.control_grid.attach(self.control['macro_shortcut'], 0, self.locations['macro_shortcut'], 1, 1)
self.buttons_showing['macros_shortcut'] = True
elif show is not True and self.buttons_showing['macros_shortcut'] is True:
if ('space%s' % self.locations['macro_shortcut']) not in self.control:
self.control['space%s' % self.locations['macro_shortcut']] = Gtk.Label("")
if len(self._config.get_printers()) > 1 and mod_row is True:
self.control_grid.remove(self.control_grid.get_child_at(0, self.locations['macro_shortcut']))
self.control_grid.remove(self.control['macro_shortcut'])
self.control_grid.remove_row(self.locations['macro_shortcut'])
else:
self.control_grid.remove(self.control_grid.get_child_at(0, self.locations['macro_shortcut']))
if ('space%s' % self.locations['macro_shortcut']) not in self.control:
self.control['space%s' % self.locations['macro_shortcut']] = Gtk.Label("")
self.control_grid.attach(self.control['space%s' % self.locations['macro_shortcut']],
0, self.locations['macro_shortcut'], 1, 1)
self.buttons_showing['macros_shortcut'] = False
self._screen.show_all()
def show_printer_select(self, show=True):
if len(self._config.get_printers()) <= 1:
return
if show and self.buttons_showing['printer_select'] is False:
logging.info("Turning on printer_select button")
self.control_grid.remove(self.control_grid.get_child_at(0, self.locations['printer_select']))
self.control_grid.attach(self.control['printer_select'], 0, self.locations['printer_select'], 1, 1)
self.buttons_showing['printer_select'] = True
elif show is False and self.buttons_showing['printer_select']:
logging.info("Turning off printer_select button")
self.control_grid.remove(self.control_grid.get_child_at(0, self.locations['printer_select']))
self.control_grid.attach(self.control['space%s' % self.locations['printer_select']],
0, self.locations['printer_select'], 1, 1)
self.buttons_showing['printer_select'] = False
self._screen.show_all()
def set_title(self, title):
try:
env = Environment(extensions=["jinja2.ext.i18n"])
env.install_gettext_translations(self.lang)
j2_temp = env.from_string(title)
title = j2_temp.render()
except Exception:
logging.debug("Error parsing jinja for title: %s" % title)
self.titlelbl.set_label("%s | %s" % (self._screen.connected_printer, title))
def show_back_buttons(self):
self.control_grid.attach(self.control['back'], 0, 0, 1, 1)
self.control_grid.attach(self.control['home'], 0, 1, 1, 1)
def update_time(self):
now = datetime.datetime.now()
confopt = self._config.get_main_config_option("24htime")
if now.minute != self.time_min or self.time_format != confopt:
if confopt == "True":
self.control['time'].set_text(now.strftime("%H:%M"))
else:
self.control['time'].set_text(now.strftime("%I:%M %p"))
return True
+26 -26
View File
@@ -8,8 +8,6 @@ from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.BedLevelPanel")
def create_panel(*args):
return BedLevelPanel(*args)
@@ -31,19 +29,19 @@ class BedLevelPanel(ScreenPanel):
elif "bed_screws" in self._screen.printer.get_config_section_list():
config_section_name = "bed_screws"
if config_section_name != None:
if config_section_name is not 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])
logging.debug("Screws section: %s" % config_section[item])
result = re.match(r"([\-0-9\.]+)\s*,\s*([\-0-9\.]+)", config_section[item])
if result:
screws.append([
round(float(result.group(1)),2),
round(float(result.group(2)),2)
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)
logging.debug("Bed screw locations [x,y]: %s", screws)
if ("bltouch" in self._screen.printer.get_config_section_list() and
config_section_name == "screws_tilt_adjust"):
x_offset = 0
@@ -56,16 +54,16 @@ class BedLevelPanel(ScreenPanel):
new_screws = []
for screw in screws:
new_screws.append([
round(float(screw[0]) + self.x_offset,2),
round(float(screw[1]) + self.y_offset,2)
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)
logging.debug("Screws: %s" % screws)
if len(screws) < 4:
logger.debug("bed_screws not configured, calculating locations")
logging.debug("bed_screws not configured, calculating locations")
xconf = self._screen.printer.get_config_section("stepper_x")
yconf = self._screen.printer.get_config_section("stepper_y")
x = int(int(xconf['position_max'])/4)
@@ -76,9 +74,9 @@ class BedLevelPanel(ScreenPanel):
[x, y*3],
[x*3, y*3],
]
logger.debug("Calculated screw locations [x,y]: %s", screws)
logging.debug("Calculated screw locations [x,y]: %s", screws)
else:
logger.debug("Configured screw locations [x,y]: %s", screws)
logging.debug("Configured screw locations [x,y]: %s", screws)
self.labels['bl'] = self._gtk.ButtonImage("bed-level-t-l", None, None, 3, 3)
@@ -101,7 +99,7 @@ class BedLevelPanel(ScreenPanel):
grid.attach(self.labels['fl'], 2, 1, 1, 1)
grid.attach(self.labels['fr'], 1, 1, 1, 1)
self.labels['home'] = self._gtk.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'] = self._gtk.ButtonImage("motor-off", _("Disable XY"), "color3")
@@ -111,7 +109,7 @@ class BedLevelPanel(ScreenPanel):
grid.attach(self.labels['dm'], 0, 1, 1, 1)
if self._printer.config_section_exists("screws_tilt_adjust"):
self.labels['screws'] = self._gtk.ButtonImage("refresh",_("Screws Adjust"),"color4")
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)
@@ -122,9 +120,10 @@ class BedLevelPanel(ScreenPanel):
self.labels['br'].set_label("")
self.labels['fl'].set_label("")
self.labels['fr'].set_label("")
self.labels['screws'].set_sensitive(True)
def go_to_position(self, widget, position):
logger.debug("Going to position: %s", position)
logging.debug("Going to position: %s", position)
script = [
"%s" % KlippyGcodes.MOVE_ABSOLUTE,
"G1 Z7 F800\n",
@@ -142,32 +141,33 @@ class BedLevelPanel(ScreenPanel):
def disable_motors(self, widget):
self._screen._ws.klippy.gcode_script(
"M18" # Disable motors
"M18" # Disable motors
)
def process_update(self, action, data):
if action == "notify_gcode_response":
result = re.match(
"^// (.*) : X ([0-9\.]+), Y ([0-9\.]+), Z [0-9\.]+ : Adjust -> ([CW]+ [0-9:]+)",
"^// (.*) : [xX= ]+([\\-0-9\\.]+), [yY= ]+([\\-0-9\\.]+), [zZ= ]+[\\-0-9\\.]+ :" +
" (Adjust ->|adjust) ([CW]+ [0-9:]+)",
data
)
if result:
screw_labels = ['fl','fr','bl','br']
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))
logging.debug(data)
logging.debug("X: %s Y: %s" % (x, y))
for i in range(len(self.screws)):
logger.debug(self.screws[i])
logging.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.labels[screw_labels[i]].set_label(result.group(5))
self.response_count += 1
if self.response_count >= len(self.screws)-1:
self._screen.remove_subscription(self.panel_name)
self.labels['screws'].set_sensitive(True)
def screws_tilt_calculate(self, widget):
self.response_count = 0
self._screen.add_subscription(self.panel_name)
self.labels['screws'].set_sensitive(False)
self._screen._ws.klippy.gcode_script("SCREWS_TILT_CALCULATE")
+139 -47
View File
@@ -1,14 +1,20 @@
import gi
import logging
import numpy as np
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import rc
from mpl_toolkits.mplot3d import Axes3D
from matplotlib.backends.backend_gtk3cairo import FigureCanvasGTK3Cairo as FigureCanvas
from matplotlib.ticker import LinearLocator
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)
@@ -30,10 +36,10 @@ class BedMeshPanel(ScreenPanel):
scroll.add(self.labels['profiles'])
addprofile = self._gtk.ButtonImage("increase"," %s" % _("Add bed mesh profile"),
"color1", .5, .5, Gtk.PositionType.LEFT)
addprofile = self._gtk.ButtonImage("increase", " %s" % _("Add bed mesh profile"),
"color1", .5, .5, Gtk.PositionType.LEFT, False)
addprofile.connect("clicked", self.show_create_profile)
addprofile.set_size_request(60,0)
addprofile.set_size_request(60, 0)
addprofile.set_hexpand(False)
addprofile.set_halign(Gtk.Align.END)
abox = Gtk.Box(spacing=0)
@@ -49,33 +55,30 @@ class BedMeshPanel(ScreenPanel):
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")
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))
logging.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:
if self.active_mesh is not 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:
if self.active_mesh is not None:
a = self.profiles[profile]
a['buttons'].remove(a['load'])
a['buttons'].pack_start(a['refresh'], False, False, 0)
@@ -85,7 +88,7 @@ class BedMeshPanel(ScreenPanel):
_ = self.lang.gettext
frame = Gtk.Frame()
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
frame.set_property("shadow-type", Gtk.ShadowType.NONE)
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (profile))
@@ -95,33 +98,39 @@ class BedMeshPanel(ScreenPanel):
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
load = self._gtk.ButtonImage("load",_("Load"),"color2")
load = self._gtk.ButtonImage("load", _("Load"), "color2")
load.connect("clicked", self.send_load_mesh, profile)
load.set_size_request(60,0)
load.set_size_request(60, 0)
load.set_hexpand(False)
load.set_halign(Gtk.Align.END)
refresh = self._gtk.ButtonImage("refresh",_("Calibrate"),"color4")
refresh = self._gtk.ButtonImage("refresh", _("Calibrate"), "color4")
refresh.connect("clicked", self.calibrate_mesh)
refresh.set_size_request(60,0)
refresh.set_size_request(60, 0)
refresh.set_hexpand(False)
refresh.set_halign(Gtk.Align.END)
info = self._gtk.ButtonImage("info",None,"color3")
view = self._gtk.ButtonImage("bed-level", _("View Mesh"), "color1")
view.connect("clicked", self.show_mesh, profile)
view.set_size_request(60, 0)
view.set_hexpand(False)
view.set_halign(Gtk.Align.END)
info = self._gtk.ButtonImage("info", None, "color3")
info.connect("clicked", self.show_mesh, profile)
info.set_size_request(60,0)
info.set_size_request(60, 0)
info.set_hexpand(False)
info.set_halign(Gtk.Align.END)
save = self._gtk.ButtonImage("sd",_("Save"),"color3")
save = self._gtk.ButtonImage("sd", _("Save"), "color3")
save.connect("clicked", self.send_save_mesh, profile)
save.set_size_request(60,0)
save.set_size_request(60, 0)
save.set_hexpand(False)
save.set_halign(Gtk.Align.END)
delete = self._gtk.ButtonImage("decrease",_("Delete"),"color3")
delete = self._gtk.ButtonImage("cancel", _("Delete"), "color3")
delete.connect("clicked", self.send_remove_mesh, profile)
delete.set_size_request(60,0)
delete.set_size_request(60, 0)
delete.set_hexpand(False)
delete.set_halign(Gtk.Align.END)
@@ -138,16 +147,17 @@ class BedMeshPanel(ScreenPanel):
dev.add(labels)
buttons = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
logger.debug("Profile compare: '%s' '%s'" % (self.active_mesh, profile))
logging.debug("Profile compare: '%s' '%s'" % (self.active_mesh, profile))
if self.active_mesh == profile:
buttons.pack_start(refresh, False, False, 0)
else:
buttons.pack_start(load, False, False, 0)
#buttons.pack_end(info, False, False, 0)
# buttons.pack_end(info, False, False, 0)
if profile != "default":
buttons.pack_end(save, False, False, 0)
buttons.pack_end(delete, False, False, 0)
buttons.pack_end(view, False, False, 0)
dev.add(buttons)
frame.add(dev)
@@ -158,26 +168,25 @@ class BedMeshPanel(ScreenPanel):
"row": frame,
"load": load,
"refresh": refresh,
"save": save
"save": save,
"view": view,
}
l = list(self.profiles)
if "default" in l:
l.remove('default')
profiles = sorted(l)
pl = list(self.profiles)
if "default" in pl:
pl.remove('default')
profiles = sorted(pl)
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:
def back(self):
if self.show_create is True:
self.remove_create()
else:
self._screen._menu_go_back()
return True
return False
def create_profile(self, widget):
name = self.labels['profile_name'].get_text()
@@ -205,7 +214,7 @@ class BedMeshPanel(ScreenPanel):
self.activate_mesh(data['bed_mesh']['profile_name'])
def remove_create(self):
if self.show_create == False:
if self.show_create is False:
return
self._screen.remove_keyboard()
@@ -220,10 +229,10 @@ class BedMeshPanel(ScreenPanel):
if profile not in self.profiles:
return
l = list(self.profiles)
if "default" in l:
l.remove('default')
profiles = sorted(l)
pl = list(self.profiles)
if "default" in pl:
pl.remove('default')
profiles = sorted(pl)
pos = profiles.index(profile)+1 if profile != "default" else 0
self.labels['profiles'].remove_row(pos)
del self.profiles[profile]
@@ -256,23 +265,23 @@ class BedMeshPanel(ScreenPanel):
box = Gtk.Box(spacing=5)
box.set_size_request(self._gtk.get_content_width(), self._gtk.get_content_height() -
self._screen.keyboard_height - 20)
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)
pl = self._gtk.Label(_("Profile Name:"))
pl.set_hexpand(False)
entry = Gtk.Entry()
entry.set_hexpand(True)
save = self._gtk.ButtonImage("sd",_("Save"),"color3")
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(pl, False, False, 5)
box.pack_start(entry, True, True, 5)
box.pack_start(save, False, False, 5)
@@ -286,10 +295,93 @@ class BedMeshPanel(ScreenPanel):
def show_mesh(self, widget, profile):
_ = self.lang.gettext
bm = self._printer.get_config_section("bed_mesh %s" % profile)
if bm is False:
logging.info("Unable to load profile: %s" % profile)
return
if profile == self.active_mesh:
abm = self._printer.get_stat("bed_mesh")
if abm is None:
logging.info("Unable to load active mesh: %s" % profile)
return
x_range = [int(abm['mesh_min'][0]), int(abm['mesh_max'][0])]
y_range = [int(abm['mesh_min'][1]), int(abm['mesh_max'][1])]
minz_mesh = min(min(abm['mesh_matrix']))
maxz_mesh = max(max(abm['mesh_matrix']))
# Do not use a very small zscale, because that could be misleading
if minz_mesh > -0.5:
minz_mesh = -0.5
if maxz_mesh < 0.5:
maxz_mesh = 0.5
z_range = [minz_mesh, maxz_mesh]
counts = [len(abm['mesh_matrix'][0]), len(abm['mesh_matrix'])]
deltas = [(x_range[1] - x_range[0]) / (counts[0]-1), (y_range[1] - y_range[0]) / (counts[1]-1)]
x = [(i*deltas[0])+x_range[0] for i in range(counts[0])]
y = [(i*deltas[0])+y_range[0] for i in range(counts[1])]
x, y = np.meshgrid(x, y)
z = np.asarray(abm['mesh_matrix'])
else:
x_range = [int(bm['min_x']), int(bm['max_x'])]
y_range = [int(bm['min_y']), int(bm['max_y'])]
z_range = [min(min(bm['points'])), max(max(bm['points']))]
deltas = [(x_range[1] - x_range[0]) / (int(bm['x_count'])-1),
(y_range[1] - y_range[0]) / (int(bm['y_count'])-1)]
x = [(i*deltas[0])+x_range[0] for i in range(bm['x_count'])]
y = [(i*deltas[0])+y_range[0] for i in range(bm['y_count'])]
x, y = np.meshgrid(x, y)
z = np.asarray(bm['points'])
rc('axes', edgecolor="#e2e2e2", labelcolor="#e2e2e2")
rc(('xtick', 'ytick'), color="#e2e2e2")
fig = plt.figure(facecolor='#12121277')
ax = Axes3D(fig, azim=245, elev=23)
ax.set(title=profile, xlabel="X", ylabel="Y", facecolor='none')
ax.spines['bottom'].set_color("#e2e2e2")
fig.add_axes(ax)
surf = ax.plot_surface(x, y, z, cmap=cm.coolwarm, vmin=-0.1, vmax=0.1)
chartBox = ax.get_position()
ax.set_position([chartBox.x0, chartBox.y0+0.1, chartBox.width, chartBox.height])
ax.set_zlim(z_range[0], z_range[1])
ax.zaxis.set_major_locator(LinearLocator(5))
# A StrMethodFormatter is used automatically
ax.zaxis.set_major_formatter('{x:.02f}')
fig.colorbar(surf, shrink=0.7, aspect=5, pad=0.25)
box = Gtk.VBox()
box.set_hexpand(True)
box.set_vexpand(True)
title = Gtk.Label()
title.set_markup("<b>%s</b>" % profile)
title.set_hexpand(True)
title.set_halign(Gtk.Align.CENTER)
canvas_box = Gtk.Box()
canvas_box.set_hexpand(True)
canvas_box.set_vexpand(True)
box.add(title)
box.add(canvas_box)
buttons = [
{"name": _("Close"), "response": Gtk.ResponseType.CANCEL}
]
dialog = self._gtk.Dialog(self._screen, buttons, self.graphs[profile], self._close_dialog)
dialog = self._gtk.Dialog(self._screen, buttons, box, self._close_dialog)
alloc = canvas_box.get_allocation()
canvas = FigureCanvas(fig)
canvas.set_size_request(alloc.width, self._screen.height/3*2)
canvas_box.add(canvas)
canvas_box.show_all()
# Remove the "matplotlib-canvas" class which forces a white background.
# https://github.com/matplotlib/matplotlib/commit/3c832377fb4c4b32fcbdbc60fdfedb57296bc8c0
style_ctx = canvas.get_style_context()
for css_class in style_ctx.list_classes():
style_ctx.remove_class(css_class)
def _close_dialog(self, widget, response):
widget.destroy()
+117
View File
@@ -0,0 +1,117 @@
import gi
import logging
import time
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from datetime import datetime
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
def create_panel(*args):
return ConsolePanel(*args)
COLORS = {
"command": "#bad8ff",
"error": "#ff6975",
"response": "#b8b8b8",
"time": "grey",
"warning": "#c9c9c9"
}
class ConsolePanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
gcodes = self._screen._ws.send_method("server.gcode_store", {"count": 100}, self.gcode_response)
vbox = Gtk.VBox()
vbox.set_hexpand(True)
vbox.set_vexpand(True)
sw = Gtk.ScrolledWindow()
sw.set_hexpand(True)
sw.set_vexpand(True)
tb = Gtk.TextBuffer()
tv = Gtk.TextView()
tv.set_buffer(tb)
tv.set_sensitive(False)
tv.connect("size-allocate", self._autoscroll)
sw.add(tv)
ebox = Gtk.Box()
ebox.set_hexpand(True)
ebox.set_vexpand(False)
entry = Gtk.Entry()
entry.set_hexpand(True)
entry.set_vexpand(False)
entry.connect("focus-in-event", self._show_keyboard)
enter = self._gtk.Button("Send")
enter.set_hexpand(False)
enter.connect("clicked", self._send_command)
ebox.add(entry) # , True, 0, 0)
ebox.add(enter) # , True, 0, 0)
self.labels.update({
"entry": entry,
"sw": sw,
"tb": tb,
"tv": tv
})
vbox.add(sw)
vbox.pack_end(ebox, False, 0, 0)
self.content.add(vbox)
def add_gcode(self, type, time, message):
if type == "command":
color = COLORS['command']
message = '$ %s' % message
elif message.startswith("!!"):
color = COLORS['error']
elif message.startswith("//"):
color = COLORS['warning']
else:
color = COLORS['response']
message = '<span color="%s">%s</span>' % (color, message)
message = message.replace('\n', '\n ')
self.labels['tb'].insert_markup(
self.labels['tb'].get_end_iter(),
'\n<span color="%s">%s</span> %s' % (COLORS['time'], datetime.fromtimestamp(time).strftime("%H:%M:%S"),
message), -1
)
def gcode_response(self, result, method, params):
if method != "server.gcode_store":
return
for resp in result['result']['gcode_store']:
self.add_gcode(resp['type'], resp['time'], resp['message'])
def process_update(self, action, data):
if action == "notify_gcode_response":
self.add_gcode("response", time.time(), data)
def _autoscroll(self, *args):
adj = self.labels['sw'].get_vadjustment()
adj.set_value(adj.get_upper() - adj.get_page_size())
def _show_keyboard(self, *args):
self._screen.show_keyboard()
def _send_command(self, *args):
cmd = self.labels['entry'].get_text()
self.labels['entry'].set_text('')
self.add_gcode("command", time.time(), cmd)
self._screen._ws.klippy.gcode_script(cmd)
-2
View File
@@ -7,8 +7,6 @@ from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.ExamplePanel")
def create_panel(*args):
return ExamplePanel(*args)
+71 -46
View File
@@ -7,35 +7,27 @@ from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.ExtrudePanel")
def create_panel(*args):
return ExtrudePanel(*args)
class ExtrudePanel(ScreenPanel):
distance = 1
distances = ['1','5','10','25']
distance = 5
distances = ['5', '10', '15', '25']
def initialize(self, panel_name):
_ = self.lang.gettext
self.speed = "Medium"
self.speeds = ["Slow", "Medium", "Fast"]
self.speed_trans = {
"Slow": "300",
"Medium": "800",
"Fast": "1400"
}
self.load_filament = self.unload_filament = False
self.find_gcode_macros()
self.speed = 1
self.speeds = ['1', '2', '5', '25']
# This line for translations only
speed_translations = [_("Slow"), _("Medium"), _("Fast")]
grid = self._gtk.HomogeneousGrid()
grid = Gtk.Grid()
i = 0
self.current_extruder = self._printer.get_stat("toolhead","extruder")
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] = self._gtk.ButtonImage("extruder-%s" % i, _("Tool") + " %s" % str(i))
self.labels[extruder].connect("clicked", self.change_extruder, extruder)
if extruder == self.current_extruder:
self.labels[extruder].get_style_context().add_class("button_active")
@@ -43,78 +35,93 @@ class ExtrudePanel(ScreenPanel):
grid.attach(self.labels[extruder], i, 0, 1, 1)
i += 1
self.labels['extrude'] = self._gtk.ButtonImage("extrude",_("Extrude"),"color3")
self.labels['extrude'] = self._gtk.ButtonImage("extrude", _("Extrude"), "color4")
self.labels['extrude'].connect("clicked", self.extrude, "+")
self.labels['retract'] = self._gtk.ButtonImage("retract",_("Retract"),"color2")
self.labels['load'] = self._gtk.ButtonImage("arrow-down", _("Load"), "color3")
self.labels['load'].connect("clicked", self.load_unload, "+")
self.labels['unload'] = self._gtk.ButtonImage("arrow-up", _("Unload"), "color2")
self.labels['unload'].connect("clicked", self.load_unload, "-")
self.labels['retract'] = self._gtk.ButtonImage("retract", _("Retract"), "color1")
self.labels['retract'].connect("clicked", self.extrude, "-")
self.labels['temperature'] = self._gtk.ButtonImage("heat-up",_("Temperature"),"color4")
self.labels['temperature'] = self._gtk.ButtonImage("heat-up", _("Temperature"), "color4")
self.labels['temperature'].connect("clicked", self.menu_item_clicked, "temperature", {
"name": "Temperature",
"panel": "temperature"
})
if i < 4:
grid.attach(self.labels['temperature'], 3, 0, 1, 1)
grid.attach(self.labels['extrude'], 0, 1, 1, 1)
if self.load_filament:
grid.attach(self.labels['load'], 1, 1, 1, 1)
if self.unload_filament:
grid.attach(self.labels['unload'], 2, 1, 1, 1)
grid.attach(self.labels['retract'], 3, 1, 1, 1)
grid.attach(self.labels['temperature'], 0, 2, 1, 1)
distgrid = Gtk.Grid()
j = 0;
j = 0
for i in self.distances:
self.labels["dist"+str(i)] = self._gtk.ToggleButton(i)
self.labels["dist"+str(i)].connect("clicked", self.change_distance, i)
ctx = self.labels["dist"+str(i)].get_style_context()
if ((self._screen.lang_ltr == True and j == 0) or
(self._screen.lang_ltr == False and j == len(self.distances)-1)):
if ((self._screen.lang_ltr is True and j == 0) or
(self._screen.lang_ltr is False and j == len(self.distances)-1)):
ctx.add_class("distbutton_top")
elif ((self._screen.lang_ltr == False and j == 0) or
(self._screen.lang_ltr == True and j == len(self.distances)-1)):
elif ((self._screen.lang_ltr is False and j == 0) or
(self._screen.lang_ltr is True and j == len(self.distances)-1)):
ctx.add_class("distbutton_bottom")
else:
ctx.add_class("distbutton")
if i == "1":
if i == "5":
ctx.add_class("distbutton_active")
distgrid.attach(self.labels["dist"+str(i)], j, 0, 1, 1)
j += 1
self.labels["dist1"].set_active(True)
self.labels["dist5"].set_active(True)
speedgrid = Gtk.Grid()
j = 0;
j = 0
for i in self.speeds:
self.labels["speed"+str(i)] = self._gtk.ToggleButton(_(i))
self.labels["speed"+str(i)].connect("clicked", self.change_speed, i)
ctx = self.labels["speed"+str(i)].get_style_context()
if ((self._screen.lang_ltr == True and j == 0) or
(self._screen.lang_ltr == False and j == len(self.speeds)-1)):
if ((self._screen.lang_ltr is True and j == 0) or
(self._screen.lang_ltr is False and j == len(self.speeds)-1)):
ctx.add_class("distbutton_top")
elif ((self._screen.lang_ltr == False and j == 0) or
(self._screen.lang_ltr == True and j == len(self.speeds)-1)):
elif ((self._screen.lang_ltr is False and j == 0) or
(self._screen.lang_ltr is True and j == len(self.speeds)-1)):
ctx.add_class("distbutton_bottom")
else:
ctx.add_class("distbutton")
if i == "Medium":
if i == "2":
ctx.add_class("distbutton_active")
speedgrid.attach(self.labels["speed"+str(i)], j, 0, 1, 1)
speedgrid.attach(self.labels["speed" + str(i)], j, 0, 1, 1)
j += 1
self.labels["speedMedium"].set_active(True)
self.labels["speed2"].set_active(True)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.add(distgrid)
box.add(speedgrid)
distbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['extrude_dist'] = Gtk.Label(_("Distance (mm)"))
distbox.pack_start(self.labels['extrude_dist'], True, True, 0)
distbox.add(distgrid)
speedbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['extrude_speed'] = Gtk.Label(_("Speed (mm/s)"))
speedbox.pack_start(self.labels['extrude_speed'], True, True, 0)
speedbox.add(speedgrid)
grid.attach(box, 1, 2, 2, 1)
grid.set_column_homogeneous(True)
grid.attach(distbox, 0, 2, 2, 1)
grid.attach(speedbox, 2, 2, 2, 1)
self.content.add(grid)
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")
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
@@ -162,8 +169,26 @@ class ExtrudePanel(ScreenPanel):
def extrude(self, widget, dir):
dist = str(self.distance) if dir == "+" else "-" + str(self.distance)
speed = self.speed_trans[self.speed]
speed = str(int(self.speed) * 60)
print(KlippyGcodes.extrude(dist, speed))
self._screen._ws.klippy.gcode_script(KlippyGcodes.EXTRUDE_REL)
self._screen._ws.klippy.gcode_script(KlippyGcodes.extrude(dist, speed))
def load_unload(self, widget, dir):
if dir == "-":
self._screen._ws.klippy.gcode_script("UNLOAD_FILAMENT")
if dir == "+":
self._screen._ws.klippy.gcode_script("LOAD_FILAMENT")
def find_gcode_macros(self):
macros = self._screen.printer.get_gcode_macros()
for x in macros:
macro = x[12:].strip()
macro = macro.upper()
if macro == "LOAD_FILAMENT":
logging.info("Found %s" % macro)
self.load_filament = True
if macro == "UNLOAD_FILAMENT":
logging.info("Found %s" % macro)
self.unload_filament = True
+122 -66
View File
@@ -2,94 +2,150 @@ import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
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.FanPanel")
def create_panel(*args):
return FanPanel(*args)
CHANGEABLE_FANS = ["fan", "fan_generic"]
class FanPanel(ScreenPanel):
fan_speed = 0
fan_speed = {}
user_selecting = False
def initialize(self, panel_name):
_ = self.lang.gettext
self.devices = {}
grid = self._gtk.HomogeneousGrid()
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
box.set_hexpand(True)
# Create a grid for all devices
self.labels['devices'] = Gtk.Grid()
scroll.add(self.labels['devices'])
adj = Gtk.Adjustment(0, 0, 100, 1, 5, 0)
self.labels["scale"] = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj)
self.labels["scale"].set_value(0)
self.labels["scale"].set_hexpand(True)
self.labels["scale"].connect("value-changed", self.select_fan_speed)
self.labels["scale"].get_style_context().add_class("fan_slider")
box.add(self.labels["scale"])
# Create a box to contain all of the above
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
box.pack_start(scroll, True, True, 0)
self.labels["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"] = 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.load_fans()
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"] = 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()
grid.attach(Gtk.Label(), 0, 0, 1, 1)
grid.attach(box, 0, 1, 4, 1)
grid.attach(self.labels["fanoff"], 0, 2, 1, 1)
grid.attach(self.labels["fanon"], 3, 2, 1, 1)
self.grid = grid
self.content.add(grid)
self._screen.add_subscription(panel_name)
self.content.add(box)
def process_update(self, action, data):
if (action == "notify_status_update" and "fan" in data and "speed" in data["fan"] and
self.user_selecting == False):
self.fan_speed = float(int(float(data["fan"]["speed"]) * 100))
self.labels["scale"].disconnect_by_func(self.select_fan_speed)
self.labels["scale"].set_value(self.fan_speed)
self.labels["scale"].connect("value-changed", self.select_fan_speed)
def select_fan_speed(self, widget):
if self.user_selecting == True:
if (action != "notify_status_update"):
return
self.user_selecting = True
self.grid.attach(self.labels["apply"], 3, 0, 1, 1)
self.grid.attach(self.labels["cancel"], 0, 0, 1, 1)
self._screen.show_all()
for fan in self.devices:
if fan in data and "speed" in data[fan]:
self.update_fan_speed(fan, data[fan]["speed"])
def cancel_select_fan_speed(self, widget):
self.labels["scale"].set_value(self.fan_speed)
self.user_selecting = False
self.grid.remove(self.labels["apply"])
self.grid.remove(self.labels["cancel"])
def update_fan_speed(self, fan, speed):
if fan not in self.devices:
return
if self.devices[fan]['changeable'] is True:
if self.devices[fan]['scale'].has_grab():
return
self.fan_speed[fan] = round(float(speed) * 100)
self.devices[fan]['scale'].disconnect_by_func(self.set_fan_speed)
self.devices[fan]['scale'].set_value(self.fan_speed[fan])
self.devices[fan]['scale'].connect("value-changed", self.set_fan_speed, fan)
else:
self.fan_speed[fan] = float(speed)
self.devices[fan]['scale'].set_fraction(self.fan_speed[fan])
def add_fan(self, fan):
logging.info("Adding fan: %s" % fan)
changeable = False
for x in CHANGEABLE_FANS:
if fan.startswith(x) or fan == x:
changeable = True
break
def set_fan_speed(self, widget):
self._screen._ws.klippy.gcode_script(KlippyGcodes.set_fan_speed(self.labels['scale'].get_value()))
self.cancel_select_fan_speed(widget)
frame = Gtk.Frame()
frame.set_property("shadow-type", Gtk.ShadowType.NONE)
frame.get_style_context().add_class("frame-item")
def set_fan_on(self, widget, fanon):
speed = 100 if fanon == True else 0
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)
try:
self.fan_speed[fan] = float(self._printer.get_data()[fan]["speed"])
except Exception:
self.fan_speed[fan] = 0
name = Gtk.Label()
if fan == "fan":
fan_name = "Part Fan"
else:
fan_name = " ".join(fan.split(" ")[1:])
name.set_markup("<big><b>%s</b></big>" % (fan_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)
adj = Gtk.Adjustment(0, 0, 100, 1, 5, 0)
if changeable is True:
self.fan_speed[fan] = round(self.fan_speed[fan] * 100)
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj)
scale.set_value(self.fan_speed[fan])
scale.set_digits(0)
scale.set_hexpand(True)
scale.set_has_origin(True)
scale.get_style_context().add_class("fan_slider")
scale.connect("value-changed", self.set_fan_speed, fan)
else:
scale = Gtk.ProgressBar()
scale.set_fraction(self.fan_speed[fan])
scale.set_show_text(True)
scale.set_hexpand(True)
# scale.get_style_context().add_class("fan_slider")
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
labels.add(scale)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev.add(labels)
frame.add(dev)
self.devices[fan] = {
"changeable": changeable,
"row": frame,
"scale": scale,
}
devices = sorted(self.devices)
if fan == "fan":
pos = 0
elif "fan" in devices:
devices.pop(devices.index("fan"))
pos = devices.index(fan) + 1
else:
pos = devices.index(fan)
self.labels['devices'].insert_row(pos)
self.labels['devices'].attach(self.devices[fan]['row'], 0, pos, 1, 1)
self.labels['devices'].show_all()
def load_fans(self):
fans = self._printer.get_fans()
for fan in fans:
self.add_fan(fan)
def set_fan_speed(self, widget, fan):
value = self.devices[fan]['scale'].get_value()
if fan == "fan":
self._screen._ws.klippy.gcode_script(KlippyGcodes.set_fan_speed(value))
else:
f = " ".join(fan.split(" ")[1:])
self._screen._ws.klippy.gcode_script("SET_FAN_SPEED FAN=%s SPEED=%s" % (f, float(value)/100))
+25 -16
View File
@@ -1,5 +1,6 @@
import gi
import logging
import re
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
@@ -7,8 +8,6 @@ from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.FineTunePanel")
def create_panel(*args):
return FineTunePanel(*args)
@@ -17,9 +16,9 @@ class FineTunePanel(ScreenPanel):
bs = 0
bs_delta = "0.05"
bs_deltas = ["0.01","0.05"]
bs_deltas = ["0.01", "0.05"]
percent_delta = 1
percent_deltas = ['1','5','10','25']
percent_deltas = ['1', '5', '10', '25']
fan = 100
extrusion = 0
@@ -30,35 +29,46 @@ class FineTunePanel(ScreenPanel):
grid = self._gtk.HomogeneousGrid()
grid.set_row_homogeneous(False)
logger.debug("FineTunePanel")
logging.debug("FineTunePanel")
print_cfg = self._config.get_printer_config(self._screen.connected_printer)
if print_cfg is not None:
bs = print_cfg.get("z_babystep_values", "0.01, 0.05")
if re.match(r'^[0-9,\.\s]+$', bs):
bs = [str(i.strip()) for i in bs.split(',')]
if len(bs) <= 2:
self.bs_deltas = bs
else:
self.bs_deltas = [bs[0], bs[-1]]
self.bs_delta = self.bs_deltas[0]
self.labels['z+'] = self._gtk.ButtonImage("move-z-", _("Z+"), "color1")
self.labels['z+'] = self._gtk.ButtonImage("z-farther", _("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-'] = self._gtk.ButtonImage("move-z+", _("Z-"), "color1")
self.labels['z-'] = self._gtk.ButtonImage("z-closer", _("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['speed+'] = self._gtk.ButtonImage("speed-step", _("Speed +"), "color3")
self.labels['speed+'] = self._gtk.ButtonImage("speed+", _("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-'] = self._gtk.ButtonImage("speed-step", _("Speed -"), "color3")
self.labels['speed-'] = self._gtk.ButtonImage("speed-", _("Speed -"), "color3")
self.labels['speed-'].connect("clicked", self.change_speed, "-")
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+'] = self._gtk.ButtonImage("extrude", _("Extrusion +"), "color4")
self.labels['extrude+'] = self._gtk.ButtonImage("flow+", _("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-'] = self._gtk.ButtonImage("retract", _("Extrusion -"), "color4")
self.labels['extrude-'] = self._gtk.ButtonImage("flow-", _("Extrusion -"), "color4")
self.labels['extrude-'].connect("clicked", self.change_extrusion, "-")
grid.attach(self.labels['extrude+'], 2, 0, 1, 1)
grid.attach(self.labels['extrudefactor'], 2, 1, 1, 1)
@@ -67,7 +77,7 @@ class FineTunePanel(ScreenPanel):
# babystepping grid
bsgrid = Gtk.Grid()
j = 0;
j = 0
for i in self.bs_deltas:
self.labels[i] = self._gtk.ToggleButton(i)
self.labels[i].connect("clicked", self.change_bs_delta, i)
@@ -78,7 +88,7 @@ class FineTunePanel(ScreenPanel):
ctx.add_class("distbutton_bottom")
else:
ctx.add_class("distbutton")
if i == "0.05":
if i == self.bs_delta:
ctx.add_class("distbutton_active")
bsgrid.attach(self.labels[i], j, 0, 1, 1)
j += 1
@@ -86,7 +96,7 @@ class FineTunePanel(ScreenPanel):
# Grid for percentage
deltgrid = Gtk.Grid()
j = 0;
j = 0
for i in self.percent_deltas:
self.labels[i] = self._gtk.ToggleButton("%s%%" % i)
self.labels[i].connect("clicked", self.change_percent_delta, i)
@@ -106,9 +116,8 @@ class FineTunePanel(ScreenPanel):
grid.attach(deltgrid, 1, 3, 2, 1)
#self.panel = grid
# self.panel = grid
self.content.add(grid)
self._screen.add_subscription(panel_name)
def process_update(self, action, data):
_ = self.lang.gettext
+10 -13
View File
@@ -7,8 +7,6 @@ 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)
@@ -41,7 +39,7 @@ class MacroPanel(ScreenPanel):
def add_gcode_macro(self, macro):
frame = Gtk.Frame()
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
frame.set_property("shadow-type", Gtk.ShadowType.NONE)
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
@@ -53,7 +51,7 @@ class MacroPanel(ScreenPanel):
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
open = self._gtk.ButtonImage("open",None,"color3")
open = self._gtk.ButtonImage("resume", None, "color3")
open.connect("clicked", self.run_gcode_macro, macro)
open.set_hexpand(False)
open.set_halign(Gtk.Align.END)
@@ -83,28 +81,27 @@ class MacroPanel(ScreenPanel):
def load_gcode_macros(self):
macros = self._screen.printer.get_gcode_macros()
section_name = "displayed_macros %s" % self._screen.connected_printer
logging.info("Macro section name [%s]" % section_name)
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)):
if (section_name not in self._config.get_config().sections() or
self._config.get_config().getboolean(section_name, macro.lower(), fallback=True)):
self.add_gcode_macro(macro)
def run_gcode_macro(self, widget, macro):
self._screen._ws.klippy.gcode_script(macro)
def unload_gcode_macros(self):
section_name = "displayed_macros %s" % self._screen.connected_printer
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)):
if (section_name in self._config.get_config().sections() and
not self._config.get_config().getboolean(section_name, macro.lower(), fallback=True)):
macros = sorted(self.macros)
pos = macros.index(macro)
self.labels['macros'].remove_row(pos)
+258 -190
View File
@@ -2,14 +2,13 @@
import gi
import logging
import math
import os
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.JobStatusPanel")
def create_panel(*args):
return JobStatusPanel(*args)
@@ -20,16 +19,22 @@ class JobStatusPanel(ScreenPanel):
progress = 0
state = "printing"
def __init__(self, screen, title, back=False):
super().__init__(screen, title, False)
def initialize(self, panel_name):
_ = self.lang.gettext
self.layout = Gtk.Layout()
self.layout.set_size(self._screen.width, self._screen.height)
self.timeleft_type = "file"
self.timeout = None
self.close_timeouts = []
self.create_buttons()
grid = self._gtk.HomogeneousGrid()
grid.set_size_request(self._screen.width, self._screen.height)
grid.set_row_homogeneous(False)
self.labels['button_grid'] = self._gtk.HomogeneousGrid()
self.labels['button_grid'].set_vexpand(False)
fi_box = Gtk.VBox(spacing=0)
fi_box.set_hexpand(True)
@@ -40,34 +45,29 @@ class JobStatusPanel(ScreenPanel):
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['file'].set_ellipsize(True)
self.labels['file'].set_ellipsize(Pango.EllipsizeMode.END)
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")
self.labels['lcdmessage'] = Gtk.Label("")
self.labels['lcdmessage'].set_halign(Gtk.Align.START)
self.labels['lcdmessage'].set_vexpand(False)
self.labels['lcdmessage'].get_style_context().add_class("printing-status")
self.labels['lcdmessage'].set_ellipsize(True)
self.labels['lcdmessage'].set_ellipsize(Pango.EllipsizeMode.END)
fi_box.add(self.labels['file']) #, True, True, 0)
fi_box.add(self.labels['status']) #, True, True, 0)
fi_box.add(self.labels['file'])
fi_box.add(self.labels['status'])
fi_box.add(self.labels['lcdmessage'])
fi_box.set_valign(Gtk.Align.CENTER)
info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
info.props.valign = Gtk.Align.CENTER
info.set_hexpand(True)
info.set_vexpand(True)
#info.add(self.labels['file']['b'])
#info.add(self.labels['time']['b'])
#info.add(self.labels['time_left']['b'])
#grid.attach(info,2,0,2,1)
#pbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
#pbox.pack_start(self.labels['file']['b'], False, True, 0)
#pbox.pack_end(timegrid, False, False, 0)
#pbox.pack_end(self.labels['progress'], False, False, 0)
#pbox.pack_end(overlay, False, False, 0)
#grid.attach(pbox, 0, 0, 4, 3)
self.labels['darea'] = Gtk.DrawingArea()
self.labels['darea'].connect("draw", self.on_draw)
@@ -85,14 +85,6 @@ class JobStatusPanel(ScreenPanel):
overlay.add(self.labels['darea'])
overlay.add_overlay(box)
#self.labels['extruder'] = self._gtk.ButtonImage("extruder-1", self._gtk.formatTemperatureString(0, 0))
#self.labels['extruder'].set_sensitive(False)
#grid.attach(self.labels['extruder'], 0, 0, 1, 1)
#self.labels['heater_bed'] = self._gtk.ButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
#self.labels['heater_bed'].set_sensitive(False)
#grid.attach(self.labels['heater_bed'], 0, 1, 1, 1)
self.labels['thumbnail'] = self._gtk.Image("file.svg", False, 1.6, 1.6)
i = 0
@@ -107,7 +99,7 @@ class JobStatusPanel(ScreenPanel):
i += 1
temp_grid = self._gtk.HomogeneousGrid()
self.current_extruder = self._printer.get_stat("toolhead","extruder")
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)
@@ -163,7 +155,7 @@ class JobStatusPanel(ScreenPanel):
pos_box.add(posgrid)
self.labels['pos_box'] = pos_box
speed = self._gtk.Image("speed-step.svg", None, .6, .6)
speed = self._gtk.Image("speed+.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)
@@ -188,28 +180,33 @@ class JobStatusPanel(ScreenPanel):
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'] = Gtk.HBox(spacing=0)
self.labels['i1_box'].set_vexpand(True)
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'].set_vexpand(True)
self.labels['i2_box'].get_style_context().add_class("printing-info-box")
self.labels['i2_box'].set_valign(Gtk.Align.CENTER)
self.labels['info_grid'] = self._gtk.HomogeneousGrid()
self.labels['info_grid'].attach(self.labels['i1_box'], 0, 0, 2, 1)
self.labels['info_grid'].attach(self.labels['i2_box'], 2, 0, 3, 1)
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)
grid.attach(self.labels['info_grid'], 0, 1, 4, 2)
grid.attach(self.labels['button_grid'], 0, 3, 4, 1)
self.add_labels()
self.grid = grid
self.layout.put(grid, 0, 0)
self._screen.add_subscription(panel_name)
self.content.add(grid)
self._screen.wake_screen()
def on_draw(self, da, ctx):
w = da.get_allocated_width()
h = da.get_allocated_height()
r = min(w,h)*.4
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)
@@ -224,37 +221,27 @@ class JobStatusPanel(ScreenPanel):
def activate(self):
_ = self.lang.gettext
self.progress = self._printer.get_stat('virtual_sdcard','progress')
self.update_progress()
self.enable_button("pause","cancel","resume")
self.progress = 0
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)
self.update_text("status", _("Printing"))
ps = self._printer.get_stat("print_stats")
logger.debug("Act State: %s" % ps['state'])
logging.debug("Act State: %s" % ps['state'])
self.set_state(ps['state'])
self.show_buttons_for_state()
if self.timeout is None:
GLib.timeout_add(500, self.state_check)
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'])
@@ -265,32 +252,37 @@ class JobStatusPanel(ScreenPanel):
def create_buttons(self):
_ = self.lang.gettext
self.labels['cancel'] = self._gtk.ButtonImage("stop",_("Cancel"),"color2")
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'] = self._gtk.ButtonImage("settings", _("Settings"), "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['fine_tune'] = self._gtk.ButtonImage("fine-tune", _("Fine Tuning"), "color4")
self.labels['fine_tune'].connect("clicked", self.menu_item_clicked, "fine_tune", {
"panel": "fine_tune", "name": _("Fine Tuning")})
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['pause'] = self._gtk.ButtonImage("pause", _("Pause"), "color1")
self.labels['pause'].connect("clicked", self.pause)
self.labels['restart'] = self._gtk.ButtonImage("refresh", _("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)
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)
for to in self.close_timeouts:
GLib.source_remove(to)
self.close_timeouts.remove(to)
if self.timeout is None:
self.timeout = GLib.timeout_add(500, self.state_check)
def resume(self, widget):
#self.disable_button("resume","cancel")
self._screen._ws.klippy.print_resume(self._response_callback, "enable_button", "pause", "cancel")
self._screen.show_all()
def pause(self, widget):
#self.disable_button("pause","cancel")
self._screen._ws.klippy.print_pause(self._response_callback, "enable_button", "resume", "cancel")
self._screen.show_all()
@@ -306,21 +298,23 @@ class JobStatusPanel(ScreenPanel):
label.set_markup(_("Are you sure you wish to cancel this print?"))
label.set_hexpand(True)
label.set_halign(Gtk.Align.CENTER)
label.set_vexpand(True)
label.set_valign(Gtk.Align.CENTER)
label.set_line_wrap(True)
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
dialog = self._gtk.Dialog(self._screen, buttons, label, self.cancel_confirm)
self.disable_button("pause","cancel")
self.disable_button("pause", "cancel")
def cancel_confirm(self, widget, response_id):
widget.destroy()
if response_id == Gtk.ResponseType.CANCEL:
self.enable_button("pause","cancel")
self.enable_button("pause", "cancel")
return
logger.debug("Canceling print")
self.disable_button("pause","resume","cancel")
logging.debug("Canceling print")
self.disable_button("pause", "resume", "cancel")
self._screen._ws.klippy.print_cancel(self._response_callback)
def _response_callback(self, response, method, params, func=None, *args):
@@ -328,8 +322,12 @@ class JobStatusPanel(ScreenPanel):
self.enable_button(*args)
def close_panel(self, widget=None):
if self._screen.is_printing():
self._screen.printer_ready()
logging.debug("Closing job_status panel")
for to in self.close_timeouts:
GLib.source_remove(to)
self.close_timeouts.remove(to)
self._screen.printer_ready()
return False
def enable_button(self, *args):
@@ -341,26 +339,55 @@ class JobStatusPanel(ScreenPanel):
self.labels[arg].set_sensitive(False)
def _callback_metadata(self, newfiles, deletedfiles, modifiedfiles):
if self.file_metadata == None and self.filename in modifiedfiles:
if bool(self.file_metadata) is False and self.filename in modifiedfiles:
self.update_file_metadata()
self._files.remove_file_callback(self._callback_metadata)
def new_print(self):
if self.state in ["cancelled", "cancelling", "complete", "error"]:
for to in self.close_timeouts:
GLib.source_remove(to)
self.close_timeouts.remove(to)
if self.timeout is None:
GLib.timeout_add(500, self.state_check)
self._screen.wake_screen()
self.state_check()
def process_update(self, action, data):
if action != "notify_status_update":
if action == "notify_gcode_response":
if "action:cancel" in data:
self.set_state("cancelling")
elif "action:paused" in data:
self.set_state("paused")
return
elif action != "notify_status_update":
return
_ = self.lang.gettext
if self._printer.has_heated_bed():
self.update_temp("heater_bed",
self._printer.get_dev_stat("heater_bed","temperature"),
self._printer.get_dev_stat("heater_bed","target")
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")
self.update_temp(
x,
self._printer.get_dev_stat(x, "temperature"),
self._printer.get_dev_stat(x, "target")
)
ps = self._printer.get_stat("print_stats")
vsd = self._printer.get_stat("virtual_sdcard")
if 'display_status' in data and 'message' in data['display_status']:
self.update_message()
if "print_stats" in data and "filename" in data['print_stats']:
if data['print_stats']['filename'] != self.filename and (
self.state not in ["cancelling", "cancelled", "complete"]):
logging.debug("filename: '%s' '%s' status: %s" %
(self.filename, data['print_stats']['filename'], self.state))
self.update_filename()
if "toolhead" in data:
if "extruder" in data["toolhead"]:
@@ -377,164 +404,205 @@ class JobStatusPanel(ScreenPanel):
self.labels['pos_z'].set_text("Z: %.2f" % (data["gcode_move"]["gcode_position"][2]))
if "gcode_move" in data:
#if "homing_origin" in data["gcode_move"]:
# self.labels['zoffset'].set_text("%.2fmm" % data["gcode_move"]["homing_origin"][2])
if "extrude_factor" in data["gcode_move"]:
self.extrusion = int(data["gcode_move"]["extrude_factor"]*100)
self.labels['extrusion'].set_text("%3d%%" % self.extrusion)
if "speed_factor" in data["gcode_move"]:
self.speed = int(data["gcode_move"]["speed_factor"]*100)
self.labels['speed'].set_text("%3d%%" % self.speed)
if "fan" in data and "speed" in data['fan']:
self.fan = int(round(data['fan']['speed'],2)*100)
self.fan = int(round(data['fan']['speed'], 2)*100)
self.labels['fan'].set_text("%3d%%" % self.fan)
if "print_stats" in data or "virtual_sdcard" in data:
ps = self._printer.get_stat("print_stats")
vsd = self._printer.get_stat("virtual_sdcard")
if ps['state'] == "printing" and self.state != "printing":
self.set_state("printing")
self.show_buttons_for_state()
if ps['state'] == "complete" and self.state != "complete":
self.progress = 1
self.update_progress()
self.set_state("complete")
self.show_buttons_for_state()
timeout = self._config.get_main_config().getint("job_complete_timeout", 30)
if timeout != 0:
GLib.timeout_add(timeout * 1000, self.close_panel)
elif ps['state'] == "error" and self.state != "error":
logger.debug("Error!")
self.set_state("error")
self.labels['status'].set_text("Error - %s" % ps['message'])
self.show_buttons_for_state()
timeout = self._config.get_main_config().getint("job_error_timeout", 0)
if timeout != 0:
GLib.timeout_add(timeout * 1000, self.close_panel)
elif ps['state'] == "standby":
self.close_panel()
if self.state in ["cancelling", "cancelled", "complete", "error"]:
return
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")
self.update_percent_complete()
self.update_text("duration", str(self._gtk.formatTimeString(ps['print_duration'])))
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)
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 progress != self.progress:
self.progress = progress
self.labels['darea'].queue_draw()
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_text("est_time", "/ %s" % str(self._gtk.formatTimeString(total_duration)))
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)))
def state_check(self):
ps = self._printer.get_stat("print_stats")
if ps['state'] == self.state:
return True
_ = self.lang.gettext
if ps['state'] == "printing":
if self.state == "cancelling":
return True
self.set_state("printing")
elif ps['state'] == "complete":
self.progress = 1
self.update_progress()
self.set_state("complete")
self._screen.wake_screen()
timeout = self._config.get_main_config().getint("job_complete_timeout", 30)
if timeout != 0:
self.close_timeouts.append(GLib.timeout_add(timeout * 1000, self.close_panel))
return False
elif ps['state'] == "error":
logging.debug("Error!")
self.set_state("error")
self.labels['status'].set_text("%s - %s" % (_("Error"), ps['message']))
self._screen.wake_screen()
timeout = self._config.get_main_config().getint("job_error_timeout", 0)
if timeout != 0:
self.close_timeouts.append(GLib.timeout_add(timeout * 1000, self.close_panel))
return False
elif ps['state'] == "cancelled" or ps['state'] == "standby":
# Print was cancelled
self.set_state("cancelled")
self._screen.wake_screen()
timeout = self._config.get_main_config().getint("job_cancelled_timeout", 0)
if timeout != 0:
self.close_timeouts.append(GLib.timeout_add(timeout * 1000, self.close_panel))
return False
elif ps['state'] == "paused":
self.set_state("paused")
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()
# TODO: Remove this in the future
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")
return True
def set_state(self, state):
_ = self.lang.gettext
if self.state == state:
return
logging.debug("Changing job_status state from '%s' to '%s'" % (self.state, state))
self.state = state
self.update_text("status",state.capitalize())
if state == "paused":
self.update_text("status", _("Paused"))
elif state == "printing":
self.update_text("status", _("Printing"))
elif state == "cancelling":
self.update_text("status", _("Cancelling"))
elif state == "cancelled":
self.update_text("status", _("Cancelled"))
elif state == "complete":
self.update_text("status", _("Complete"))
self.show_buttons_for_state()
def show_buttons_for_state(self):
self.grid.remove_row(3)
self.grid.insert_row(3)
self.labels['button_grid'].remove_row(0)
self.labels['button_grid'].insert_row(0)
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)
self.labels['button_grid'].attach(self.labels['pause'], 0, 0, 1, 1)
self.labels['button_grid'].attach(self.labels['cancel'], 1, 0, 1, 1)
self.labels['button_grid'].attach(self.labels['fine_tune'], 2, 0, 1, 1)
self.labels['button_grid'].attach(self.labels['control'], 3, 0, 1, 1)
self.enable_button("pause", "cancel")
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.labels['button_grid'].attach(self.labels['resume'], 0, 0, 1, 1)
self.labels['button_grid'].attach(self.labels['cancel'], 1, 0, 1, 1)
self.labels['button_grid'].attach(self.labels['fine_tune'], 2, 0, 1, 1)
self.labels['button_grid'].attach(self.labels['control'], 3, 0, 1, 1)
self.enable_button("resume", "cancel")
elif self.state == "cancelling":
self.labels['button_grid'].attach(Gtk.Label(""), 0, 0, 1, 1)
self.labels['button_grid'].attach(Gtk.Label(""), 1, 0, 1, 1)
self.labels['button_grid'].attach(self.labels['restart'], 2, 0, 1, 1)
self.labels['button_grid'].attach(self.labels['menu'], 3, 0, 1, 1)
elif self.state == "error" or self.state == "complete" or self.state == "cancelled":
self.labels['button_grid'].attach(Gtk.Label(""), 0, 0, 1, 1)
self.labels['button_grid'].attach(Gtk.Label(""), 1, 0, 1, 1)
self.labels['button_grid'].attach(self.labels['restart'], 2, 0, 1, 1)
self.labels['button_grid'].attach(self.labels['menu'], 3, 0, 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:
if pixbuf is not None:
self.labels['thumbnail'].set_from_pixbuf(pixbuf)
def update_filename(self):
self.filename = self._printer.get_stat('print_stats', 'filename')
self.update_text("file", os.path.splitext(self._printer.get_stat('print_stats', 'filename'))[0])
self.update_percent_complete()
self.update_file_metadata()
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'])))
logging.info("Update Metadata. File: %s Size: %s" % (self.filename, self.file_metadata['size']))
if "estimated_time" in self.file_metadata and self.timeleft_type == "slicer":
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.file_metadata = {}
logging.debug("Cannot find file metadata. Listening for updated metadata")
self._screen.files.add_file_callback(self._callback_metadata)
def update_image_text(self, label, text):
if label in self.labels and 'l' in self.labels[label]:
self.labels[label]['l'].set_text(text)
def update_percent_complete(self):
if self.state in ["cancelling", "cancelled", "complete", "error"]:
return
if "gcode_start_byte" in self.file_metadata:
progress = (max(self._printer.get_stat('virtual_sdcard', 'file_position') -
self.file_metadata['gcode_start_byte'], 0) / (self.file_metadata['gcode_end_byte'] -
self.file_metadata['gcode_start_byte']))
else:
progress = self._printer.get_stat('virtual_sdcard', 'progress')
progress = round(progress, 2)
if progress != self.progress:
self.progress = progress
self.labels['darea'].queue_draw()
self.update_progress()
def update_text(self, label, text):
if label in self.labels:
self.labels[label].set_text(text)
def update_progress (self):
self.labels['progress_text'].set_text("%s%%" % (str( min(int(self.progress*100),100) )))
def update_progress(self):
self.labels['progress_text'].set_text("%s%%" % (str(min(int(self.progress*100), 100))))
#def update_temp(self, dev, temp, target):
# if dev in self.labels:
# self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
def update_message(self):
msg = self._printer.get_stat("display_status", "message")
self.labels['lcdmessage'].set_text("" if msg is None else msg)
def update_temp(self, x, temp, target):
self.labels[x].set_markup(
+134
View File
@@ -0,0 +1,134 @@
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
def create_panel(*args):
return LimitsPanel(*args)
class LimitsPanel(ScreenPanel):
values = {}
def initialize(self, panel_name):
_ = self.lang.gettext
self.devices = {}
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
# Create a grid for all devices
self.labels['devices'] = Gtk.Grid()
scroll.add(self.labels['devices'])
# Create a box to contain all of the above
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
box.pack_start(scroll, True, True, 0)
conf = self._printer.get_config_section("printer")
self.options = [
{"name": _("Max Accelation"), "units": _("mm/s^2"), "option": "max_accel",
"value": self.stn(conf['max_accel'])},
{"name": _("Max Acceleration to Deceleration"), "units": _("mm/s^2"), "option": "max_accel_to_decel",
"value": self.stn(conf['max_accel_to_decel']) if "max_accel_to_decel" in conf else
round(self.stn(conf['max_accel'])/2)},
{"name": _("Max Velocity"), "units": _("mm/s"), "option": "max_velocity",
"value": self.stn(conf["max_velocity"])},
{"name": _("Square Corner Velocity"), "units": _("mm/s"), "option": "square_corner_velocity",
"value": self.stn(conf['square_corner_velocity']) if "square_corner_velocity" in conf else 5}
]
for opt in self.options:
self.add_option(opt['option'], opt['name'], opt['units'], opt['value'])
self.content.add(box)
self.content.show_all()
def stn(self, str):
return int(float(str))
def process_update(self, action, data):
if (action != "notify_status_update"):
return
for opt in self.devices:
if "toolhead" in data and opt in data["toolhead"]:
self.update_option(opt, data["toolhead"][opt])
def update_option(self, option, value):
if option not in self.devices:
return
if self.devices[option]['scale'].has_grab():
return
self.values[option] = int(value)
self.devices[option]['scale'].disconnect_by_func(self.set_opt_value)
self.devices[option]['scale'].set_value(self.values[option])
self.devices[option]['scale'].connect("value-changed", self.set_opt_value, option)
def add_option(self, option, optname, units, value):
logging.info("Adding option: %s" % 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>" % (optname))
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)
adj = Gtk.Adjustment(0, 0, value, 1, 5, 0)
self.values[option] = value
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj)
scale.set_value(self.values[option])
scale.set_digits(0)
scale.set_hexpand(True)
scale.set_has_origin(True)
scale.get_style_context().add_class("option_slider")
scale.connect("value-changed", self.set_opt_value, option)
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
labels.add(scale)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev.add(labels)
frame.add(dev)
self.devices[option] = {
"row": frame,
"scale": scale,
}
devices = sorted(self.devices)
pos = devices.index(option)
self.labels['devices'].insert_row(pos)
self.labels['devices'].attach(self.devices[option]['row'], 0, pos, 1, 1)
self.labels['devices'].show_all()
def set_opt_value(self, widget, opt):
value = self.devices[opt]['scale'].get_value()
if opt == "max_accel":
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT ACCEL=%s" % (value))
elif opt == "max_accel_to_decel":
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT ACCEL_TO_DECEL=%s" % (value))
elif opt == "max_velocity":
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT VELOCITY=%s" % (value))
elif opt == "square_corner_velocity":
self._screen._ws.klippy.gcode_script("SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=%s" % (value))
+243 -41
View File
@@ -1,12 +1,15 @@
import datetime
import gi
import math
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from gi.repository import Gtk, Gdk, GLib, Pango
from panels.menu import MenuPanel
logger = logging.getLogger("KlipperScreen.MainMenu")
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.widgets.graph import HeaterGraph
from ks_includes.widgets.keypad import Keypad
def create_panel(*args):
return MainPanel(*args)
@@ -14,6 +17,9 @@ def create_panel(*args):
class MainPanel(MenuPanel):
def __init__(self, screen, title, back=False):
super().__init__(screen, title, False)
self.devices = {}
self.graph_update = None
self.active_heater = None
def initialize(self, panel_name, items, extrudercount):
print("### Making MainMenu")
@@ -22,25 +28,6 @@ class MainPanel(MenuPanel):
grid.set_hexpand(True)
grid.set_vexpand(True)
# Create Extruders and bed icons
eq_grid = self._gtk.HomogeneousGrid()
i = 0
for x in self._printer.get_tools():
if i > 3:
break
self.labels[x] = self._gtk.ButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0))
col = 0 if len(self._printer.get_tools()) == 1 else i%2
row = i/2
eq_grid.attach(self.labels[x], col, row, 1, 1)
i += 1
if self._printer.has_heated_bed():
self.labels['heater_bed'] = self._gtk.ButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
width = 2 if i > 1 else 1
eq_grid.attach(self.labels['heater_bed'], 0, i/2+1, width, 1)
self.items = items
self.create_menu_items()
@@ -48,39 +35,254 @@ class MainPanel(MenuPanel):
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)
leftpanel = self.create_left_panel()
grid.attach(leftpanel, 0, 0, 1, 1)
self.labels['menu'] = self.arrangeMenuItems(items, 2, True)
grid.attach(self.labels['menu'], 1, 0, 1, 1)
self.grid = grid
self.target_temps = {
"heater_bed": 0,
"extruder": 0
}
self.content.add(self.grid)
self.layout.show_all()
self._screen.add_subscription(panel_name)
def activate(self):
if self.graph_update is None:
self.graph_update = GLib.timeout_add_seconds(1, self.update_graph)
return
def update_temp(self, dev, temp, target):
if dev in self.labels:
self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
def deactivate(self):
if self.graph_update is not None:
GLib.source_remove(self.graph_update)
self.graph_update = None
def add_device(self, device):
logging.info("Adding device: %s" % device)
if not (device.startswith("extruder") or device.startswith("heater_bed")):
devname = " ".join(device.split(" ")[1:])
else:
devname = device
if device.startswith("extruder"):
i = 0
for d in self.devices:
if d.startswith('extruder'):
i += 1
image = "extruder-%s" % i
class_name = "graph_label_%s" % device
type = "extruder"
elif device == "heater_bed":
image = "bed"
devname = "Heater Bed"
class_name = "graph_label_heater_bed"
type = "bed"
else:
s = 1
for d in self.devices:
if "sensor" in d:
s += 1
image = "heat-up"
class_name = "graph_label_sensor_%s" % s
type = "sensor"
rgb, color = self._gtk.get_temp_color(type)
can_target = self._printer.get_temp_store_device_has_target(device)
self.labels['da'].add_object(device, "temperatures", rgb, False, True)
if can_target:
self.labels['da'].add_object(device, "targets", rgb, True, False)
text = "<span underline='double' underline_color='#%s'>%s</span>" % (color, devname.capitalize())
name = self._gtk.ButtonImage(image, devname.capitalize(), None, .5, .5, Gtk.PositionType.LEFT, False)
# name['b'].set_hexpand(True)
name.connect('clicked', self.on_popover_clicked, device)
name.set_alignment(0, .5)
name.get_style_context().add_class(class_name)
child = name.get_children()[0].get_children()[0].get_children()[1]
child.set_ellipsize(True)
child.set_ellipsize(Pango.EllipsizeMode.END)
temp = Gtk.Label("")
temp.set_markup(self.format_temp(self._printer.get_dev_stat(device, "temperature")))
if can_target:
target = Gtk.Label("")
target.set_markup(self.format_target(self._printer.get_dev_stat(device, "target")))
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
dev.set_hexpand(True)
dev.set_vexpand(False)
dev.add(labels)
self.devices[device] = {
"class": class_name,
"type": type,
"name": name,
"temp": temp
}
if can_target:
self.devices[device]["target"] = target
devices = sorted(self.devices)
pos = devices.index(device) + 1
self.labels['devices'].insert_row(pos)
self.labels['devices'].attach(name, 0, pos, 1, 1)
self.labels['devices'].attach(temp, 1, pos, 1, 1)
if can_target:
self.labels['devices'].attach(target, 2, pos, 1, 1)
self.labels['devices'].show_all()
def change_target_temp(self, temp):
if self.active_heater.startswith('heater_generic '):
self._screen._ws.klippy.set_heater_temp(" ".join(self.active_heater.split(" ")[1:]), temp)
elif self.active_heater == "heater_bed":
temp = 0 if temp < 0 or temp > KlippyGcodes.MAX_BED_TEMP else temp
self._screen._ws.klippy.set_bed_temp(temp)
else:
temp = 0 if temp < 0 or temp > KlippyGcodes.MAX_EXT_TEMP else temp
self._screen._ws.klippy.set_tool_temp(self._printer.get_tool_number(self.active_heater), temp)
self._printer.set_dev_stat(self.active_heater, "target", temp)
def create_left_panel(self):
_ = self.lang.gettext
self.labels['devices'] = Gtk.Grid()
self.labels['devices'].get_style_context().add_class('heater-grid')
self.labels['devices'].set_vexpand(False)
name = Gtk.Label("")
temp = Gtk.Label(_("Temp"))
temp.set_size_request(round(self._gtk.get_font_size() * 5.5), 0)
target = Gtk.Label(_("Target"))
self.labels['devices'].attach(name, 0, 0, 1, 1)
self.labels['devices'].attach(temp, 1, 0, 1, 1)
self.labels['devices'].attach(target, 2, 0, 1, 1)
da = HeaterGraph(self._printer)
da.set_vexpand(True)
self.labels['da'] = da
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
box.add(self.labels['devices'])
box.add(da)
self.labels['graph_settemp'] = self._gtk.Button(label=_("Set Temp"))
self.labels['graph_settemp'].connect("clicked", self.show_numpad)
self.labels['graph_hide'] = self._gtk.Button(label=_("Hide"))
self.labels['graph_hide'].connect("clicked", self.graph_show_device, False)
self.labels['graph_show'] = self._gtk.Button(label=_("Show"))
self.labels['graph_show'].connect("clicked", self.graph_show_device)
popover = Gtk.Popover()
self.labels['popover_vbox'] = Gtk.VBox()
# vbox.pack_start(Gtk.Button(label="Hide"), False, True, 10)
# vbox.pack_start(Gtk.Label(label="Item 2"), False, True, 10)
popover.add(self.labels['popover_vbox'])
popover.set_position(Gtk.PositionType.BOTTOM)
self.labels['popover'] = popover
for d in self._printer.get_temp_store_devices():
self.add_device(d)
return box
def graph_show_device(self, widget, show=True):
logging.info("Graph show: %s %s" % (self.popover_device, show))
self.labels['da'].set_showing(self.popover_device, show)
if show:
self.devices[self.popover_device]['name'].get_style_context().remove_class("graph_label_hidden")
self.devices[self.popover_device]['name'].get_style_context().add_class(
self.devices[self.popover_device]['class'])
else:
self.devices[self.popover_device]['name'].get_style_context().remove_class(
self.devices[self.popover_device]['class'])
self.devices[self.popover_device]['name'].get_style_context().add_class("graph_label_hidden")
self.labels['da'].queue_draw()
self.popover_populate_menu()
self.labels['popover'].show_all()
def hide_numpad(self, widget):
self.devices[self.active_heater]['name'].get_style_context().remove_class("active_device")
self.active_heater = None
self.grid.remove_column(1)
self.grid.attach(self.labels['menu'], 1, 0, 1, 1)
self.grid.show_all()
def on_popover_clicked(self, widget, device):
self.popover_device = device
po = self.labels['popover']
po.set_relative_to(widget)
self.popover_populate_menu()
po.show_all()
def popover_populate_menu(self):
pobox = self.labels['popover_vbox']
for child in pobox.get_children():
pobox.remove(child)
if self.labels['da'].is_showing(self.popover_device):
pobox.pack_start(self.labels['graph_hide'], True, True, 5)
if self.devices[self.popover_device]['type'] != "sensor":
pobox.pack_start(self.labels['graph_settemp'], True, True, 5)
else:
pobox.pack_start(self.labels['graph_show'], True, True, 5)
if self.devices[self.popover_device]['type'] != "sensor":
pobox.pack_start(self.labels['graph_settemp'], True, True, 5)
def process_update(self, action, data):
if action != "notify_status_update":
return
self.update_temp("heater_bed",
self._printer.get_dev_stat("heater_bed","temperature"),
self._printer.get_dev_stat("heater_bed","target")
)
for x in self._printer.get_tools():
self.update_temp(x,
self._printer.get_dev_stat(x,"temperature"),
self._printer.get_dev_stat(x,"target")
self.update_temp(
x,
self._printer.get_dev_stat(x, "temperature"),
self._printer.get_dev_stat(x, "target")
)
for h in self._printer.get_heaters():
self.update_temp(
h,
self._printer.get_dev_stat(h, "temperature"),
self._printer.get_dev_stat(h, "target"),
)
return
def show_numpad(self, widget):
_ = self.lang.gettext
if self.active_heater is not None:
self.devices[self.active_heater]['name'].get_style_context().remove_class("active_device")
self.active_heater = self.popover_device
self.devices[self.active_heater]['name'].get_style_context().add_class("active_device")
if "keypad" not in self.labels:
self.labels["keypad"] = Keypad(self._screen, self.change_target_temp, self.hide_numpad)
self.labels["keypad"].clear()
self.grid.remove_column(1)
self.grid.attach(self.labels["keypad"], 1, 0, 1, 1)
self.grid.show_all()
self.labels['popover'].popdown()
def update_graph(self):
self.labels['da'].queue_draw()
alloc = self.labels['devices'].get_allocation()
alloc = self.labels['da'].get_allocation()
return True
def update_temp(self, device, temp, target):
if device not in self.devices:
return
self.devices[device]["temp"].set_markup(self.format_temp(temp))
if "target" in self.devices[device]:
self.devices[device]["target"].set_markup(self.format_target(target))
+15 -17
View File
@@ -8,8 +8,6 @@ from jinja2 import Environment, Template
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.MenuPanel")
def create_panel(*args):
return MenuPanel(*args)
@@ -33,15 +31,15 @@ class MenuPanel(ScreenPanel):
})
self.arrangeMenuItems(self.items, 4)
def arrangeMenuItems (self, items, columns, expandLast=False):
def arrangeMenuItems(self, items, columns, expandLast=False):
for child in self.grid.get_children():
self.grid.remove(child)
l = len(items)
length = len(items)
i = 0
for item in items:
key = list(item)[0]
logger.debug("Evaluating item: %s" % key)
logging.debug("Evaluating item: %s" % key)
if not self.evaluate_enable(item[key]['enable']):
continue
@@ -49,7 +47,7 @@ class MenuPanel(ScreenPanel):
row = int(i/columns)
width = 1
if expandLast == True and i+1 == l and l%2 == 1:
if expandLast is True and i+1 == length and length % 2 == 1:
width = 2
self.grid.attach(self.labels[key], col, row, width, 1)
@@ -68,13 +66,13 @@ class MenuPanel(ScreenPanel):
parsed_name = j2_temp.render()
b = self._gtk.ButtonImage(
item['icon'], parsed_name, "color"+str((i%4)+1)
item['icon'], parsed_name, "color"+str((i % 4)+1)
)
if item['panel'] != False:
if item['panel'] is not False:
b.connect("clicked", self.menu_item_clicked, item['panel'], item)
elif item['method'] != False:
params = item['params'] if item['params'] != False else {}
if item['confirm'] != False:
elif item['method'] is not False:
params = item['params'] if item['params'] is not False else {}
if item['confirm'] is not False:
b.connect("clicked", self._screen._confirm_send_action, item['confirm'], item['method'], params)
else:
b.connect("clicked", self._screen._send_action, item['method'], params)
@@ -83,19 +81,19 @@ class MenuPanel(ScreenPanel):
self.labels[key] = b
def evaluate_enable(self, enable):
if enable == True:
if enable is True:
return True
if enable == False:
if enable is False:
return False
try:
logger.debug("Template: '%s'" % enable)
logger.debug("Data: %s" % self.j2_data)
logging.debug("Template: '%s'" % enable)
logging.debug("Data: %s" % self.j2_data)
j2_temp = Template(enable)
result = j2_temp.render(self.j2_data)
if result == 'True':
return True
return False
except:
logger.debug("Error evaluating enable statement: %s", enable)
except Exception:
logging.debug("Error evaluating enable statement: %s", enable)
return False
+34 -22
View File
@@ -7,39 +7,47 @@ from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.MovePanel")
def create_panel(*args):
return MovePanel(*args)
class MovePanel(ScreenPanel):
distance = 1
distances = ['.1','.5','1','5','10','25']
distances = ['.1', '.5', '1', '5', '10', '25', '50']
def initialize(self, panel_name):
_ = self.lang.gettext
grid = self._gtk.HomogeneousGrid()
grid = Gtk.Grid()
grid.set_column_homogeneous(True)
self.labels['x+'] = self._gtk.ButtonImage("move-x+", _("X+"), "color1")
self.labels['x+'] = self._gtk.ButtonImage("arrow-right", _("X+"), "color1")
self.labels['x+'].connect("clicked", self.move, "X", "+")
self.labels['x-'] = self._gtk.ButtonImage("move-x-", _("X-"), "color1")
self.labels['x-'] = self._gtk.ButtonImage("arrow-left", _("X-"), "color1")
self.labels['x-'].connect("clicked", self.move, "X", "-")
self.labels['y+'] = self._gtk.ButtonImage("move-y+", _("Y+"), "color2")
self.labels['y+'] = self._gtk.ButtonImage("arrow-up", _("Y+"), "color2")
self.labels['y+'].connect("clicked", self.move, "Y", "+")
self.labels['y-'] = self._gtk.ButtonImage("move-y-", _("Y-"), "color2")
self.labels['y-'] = self._gtk.ButtonImage("arrow-down", _("Y-"), "color2")
self.labels['y-'].connect("clicked", self.move, "Y", "-")
self.labels['z+'] = self._gtk.ButtonImage("move-z-", _("Z+"), "color3")
self.labels['z+'] = self._gtk.ButtonImage("z-farther", _("Z+"), "color3")
self.labels['z+'].connect("clicked", self.move, "Z", "+")
self.labels['z-'] = self._gtk.ButtonImage("move-z+", _("Z-"), "color3")
self.labels['z-'] = self._gtk.ButtonImage("z-closer", _("Z-"), "color3")
self.labels['z-'].connect("clicked", self.move, "Z", "-")
self.labels['home'] = self._gtk.ButtonImage("home", _("Home All"))
self.labels['home'] = self._gtk.ButtonImage("home", _("Home All"), "color4")
self.labels['home'].connect("clicked", self.home)
self.labels['home-xy'] = self._gtk.ButtonImage("home", _("Home XY"), "color4")
self.labels['home-xy'].connect("clicked", self.homexy)
self.labels['z_tilt'] = self._gtk.ButtonImage("z-tilt", _("Z Tilt"), "color4")
self.labels['z_tilt'].connect("clicked", self.z_tilt)
self.labels['quad_gantry_level'] = self._gtk.ButtonImage("z-tilt", _("Quad Gantry Level"), "color4")
self.labels['quad_gantry_level'].connect("clicked", self.quad_gantry_level)
if self._screen.lang_ltr:
grid.attach(self.labels['x+'], 2, 1, 1, 1)
grid.attach(self.labels['x-'], 0, 1, 1, 1)
@@ -53,8 +61,15 @@ class MovePanel(ScreenPanel):
grid.attach(self.labels['home'], 0, 0, 1, 1)
if self._printer.config_section_exists("z_tilt"):
grid.attach(self.labels['z_tilt'], 2, 0, 1, 1)
elif self._printer.config_section_exists("quad_gantry_level"):
grid.attach(self.labels['quad_gantry_level'], 2, 0, 1, 1)
else:
grid.attach(self.labels['home-xy'], 2, 0, 1, 1)
distgrid = Gtk.Grid()
j = 0;
j = 0
for i in self.distances:
self.labels[i] = self._gtk.ToggleButton(i)
self.labels[i].set_direction(Gtk.TextDirection.LTR)
@@ -73,10 +88,6 @@ class MovePanel(ScreenPanel):
self.labels["1"].set_active(True)
#space_grid = self._gtk.HomogeneousGrid()
#space_grid.attach(Gtk.Label("Distance (mm):"),0,0,1,1)
#space_grid.attach(distgrid,0,1,1,1)
#space_grid.attach(Gtk.Label(" "),0,2,1,1)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
bottomgrid = self._gtk.HomogeneousGrid()
@@ -92,10 +103,9 @@ class MovePanel(ScreenPanel):
box.pack_start(self.labels['move_dist'], True, True, 0)
box.pack_start(distgrid, True, True, 0)
grid.attach(box, 0, 2, 3, 1)
grid.attach(box, 0, 2, 4, 1)
self.content.add(grid)
self._screen.add_subscription(panel_name)
def process_update(self, action, data):
if action != "notify_status_update":
@@ -127,9 +137,11 @@ class MovePanel(ScreenPanel):
dir = "-" if dir == "+" else "+"
dist = str(self.distance) if dir == "+" else "-" + str(self.distance)
logging.info("# Moving " + axis + " " + dist + "mm")
print("%s\n%s %s%s" % (KlippyGcodes.MOVE_RELATIVE, KlippyGcodes.MOVE, axis, dist))
speed = self._config.get_config()['main'].getint("move_speed", 20)
speed = min(max(1, speed), 200) # Cap movement speed between 1-200mm/s
self._screen._ws.klippy.gcode_script(
"%s\n%s %s%s" % (KlippyGcodes.MOVE_RELATIVE, KlippyGcodes.MOVE, axis, dist)
"%s\n%s %s%s F%s%s" % (
KlippyGcodes.MOVE_RELATIVE, KlippyGcodes.MOVE, axis, dist, speed*60,
"\nG90" if self._printer.get_stat("gcode_move", "absolute_coordinates") is True else ""
)
)
+331 -69
View File
@@ -1,25 +1,25 @@
import gi
import json
import logging
import netifaces
import os
import re
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.NetworkPanel")
def create_panel(*args):
return NetworkPanel(*args)
class NetworkPanel(ScreenPanel):
networks = {}
network_list = []
interface = "wlan0"
def initialize(self, menu):
_ = self.lang.gettext
self.show_add = False
grid = self._gtk.HomogeneousGrid()
grid.set_hexpand(True)
@@ -27,8 +27,23 @@ class NetworkPanel(ScreenPanel):
stream = os.popen('hostname -A')
hostname = stream.read()
# Get IP Address
stream = os.popen('hostname -I')
ip = stream.read()
gws = netifaces.gateways()
if "default" in gws and netifaces.AF_INET in gws["default"]:
self.interface = gws["default"][netifaces.AF_INET][1]
else:
ints = netifaces.interfaces()
if 'lo' in ints:
ints.pop(ints.index('lo'))
if (len(ints) > 0):
self.interface = ints[0]
else:
self.interface = 'lo'
res = netifaces.ifaddresses(self.interface)
if netifaces.AF_INET in res and len(res[netifaces.AF_INET]) > 0:
ip = res[netifaces.AF_INET][0]['addr']
else:
ip = "0.0.0.0"
self.labels['networks'] = {}
@@ -41,7 +56,7 @@ class NetworkPanel(ScreenPanel):
sbox.set_hexpand(True)
sbox.set_vexpand(False)
sbox.add(self.labels['interface'])
#sbox.add(self.labels['disconnect'])
# sbox.add(self.labels['disconnect'])
scroll = Gtk.ScrolledWindow()
@@ -50,84 +65,81 @@ class NetworkPanel(ScreenPanel):
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)
if self._screen.wifi is not None and self._screen.wifi.is_initialized():
box.pack_start(sbox, False, False, 0)
box.pack_start(scroll, True, True, 0)
scroll.add(self.labels['networklist'])
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._screen.wifi.add_callback("connected", self.connected_callback)
self._screen.wifi.add_callback("scan_results", self.scan_callback)
self.timeout = GLib.timeout_add_seconds(5, self.update_all_networks)
else:
self.labels['networkinfo'] = Gtk.Label("")
self.labels['networkinfo'].get_style_context().add_class('temperature_entry')
box.pack_start(self.labels['networkinfo'], False, False, 0)
self.update_single_network_info()
self.timeout = GLib.timeout_add_seconds(5, self.update_single_network_info)
self.content.add(box)
self.labels['main_box'] = box
def load_networks(self):
networks = self._screen.wifi.get_networks()
conn_ssid = self._screen.wifi.get_connected_ssid()
if conn_ssid in networks:
networks.remove(conn_ssid)
self.add_network(conn_ssid, False)
for net in networks:
self.add_network(net, False)
self.update_all_networks()
self.content.show_all()
def add_network(self, essid, show=True):
def add_network(self, ssid, show=True):
_ = self.lang.gettext
netinfo = self._screen.wifi.get_network_info(essid)
if netinfo == None:
if ssid is None:
return
# For now, only add connected network
if "connected" not in netinfo:
ssid = ssid.strip()
if ssid in list(self.networks):
logging.info("SSID already listed")
return
netinfo = self._screen.wifi.get_network_info(ssid)
if netinfo is None:
logging.debug("Couldn't get netinfo")
return
configured_networks = self._screen.wifi.get_supplicant_networks()
network_id = -1
for net in list(configured_networks):
if configured_networks[net]['ssid'] == ssid:
network_id = net
frame = Gtk.Frame()
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
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_markup("<big><b>%s</b></big>" % (ssid))
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))
# info.set_markup(self.get_file_info_str(ssid))
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
labels.add(info)
@@ -135,37 +147,287 @@ class NetworkPanel(ScreenPanel):
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)
connect = self._gtk.ButtonImage("load", None, "color3")
connect.connect("clicked", self.connect_network, ssid)
connect.set_hexpand(False)
connect.set_halign(Gtk.Align.END)
delete = self._gtk.ButtonImage("delete", "", "color3")
delete.connect("clicked", self.remove_wifi_network, ssid)
delete.set_size_request(60, 0)
delete.set_hexpand(False)
delete.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
buttons = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
if network_id != -1:
buttons.pack_end(delete, False, False, 0)
if netinfo['connected'] is False:
buttons.pack_end(connect, False, False, 0)
network.add(buttons)
self.networks[ssid] = 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] = {
pos = 0
if netinfo['connected'] is True:
pos = 0
else:
connected_ssid = self._screen.wifi.get_connected_ssid()
nets = list(self.networks)
if connected_ssid is not None:
if connected_ssid in nets:
nets.remove(connected_ssid)
nets = sorted(nets, reverse=reverse)
pos = nets.index(ssid)
if connected_ssid is not None:
pos += 1
self.labels['networks'][ssid] = {
"connect": connect,
"delete": delete,
"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()
self.labels['networklist'].attach(self.networks[ssid], 0, pos, 1, 1)
if show is True:
self.labels['networklist'].show()
def add_new_network(self, widget, ssid, connect=False):
networks = self._screen.wifi.get_networks()
psk = self.labels['network_psk'].get_text()
result = self._screen.wifi.add_network(ssid, psk)
self.close_add_network()
if connect is True:
if result is True:
self.connect_network(widget, ssid, False)
else:
self._screen.show_popup_message("Error adding network %s" % ssid)
def back(self):
if self.show_add is True:
self.close_add_network()
return True
return False
def check_missing_networks(self):
networks = self._screen.wifi.get_networks()
for net in list(self.networks):
if net in networks:
networks.remove(net)
for net in networks:
self.add_network(net)
self.labels['networklist'].show_all()
def close_add_network(self):
if self.show_add is False:
return
for child in self.content.get_children():
self.content.remove(child)
self.content.add(self.labels['main_box'])
self.content.show()
for i in ['add_network', 'network_psk']:
if i in self.labels:
del self.labels[i]
self.show_add = False
def close_dialog(self, widget, response_id):
widget.destroy()
def connected_callback(self, ssid, prev_ssid):
logging.info("Now connected to a new network")
if ssid is not None:
self.remove_network(ssid)
if prev_ssid is not None:
self.remove_network(prev_ssid)
self.check_missing_networks()
def connect_network(self, widget, ssid, showadd=True):
_ = self.lang.gettext
snets = self._screen.wifi.get_supplicant_networks()
isdef = False
for id, net in snets.items():
if net['ssid'] == ssid:
isdef = True
break
if isdef is False:
if showadd is True:
self.show_add_network(widget, ssid)
return
self.prev_network = self._screen.wifi.get_connected_ssid()
buttons = [
{"name": _("Close"), "response": Gtk.ResponseType.CANCEL}
]
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True)
scroll.set_vexpand(True)
scroll.set_size_request(800, 400)
self.labels['connecting_info'] = Gtk.Label(_("Starting WiFi Re-association"))
self.labels['connecting_info'].set_halign(Gtk.Align.START)
self.labels['connecting_info'].set_valign(Gtk.Align.START)
scroll.add(self.labels['connecting_info'])
dialog = self._gtk.Dialog(self._screen, buttons, scroll, self.close_dialog)
self._screen.show_all()
if ssid in self.networks:
self.remove_network(ssid)
if self.prev_network in self.networks:
self.remove_network(self.prev_network)
# GLib.timeout_add(500, self.add_network, self.prev_network)
self._screen.wifi.add_callback("connecting_status", self.connecting_status_callback)
self._screen.wifi.connect(ssid)
def connecting_status_callback(self, msg):
self.labels['connecting_info'].set_text(self.labels['connecting_info'].get_text() + "\n" + msg)
self.labels['connecting_info'].show_all()
def remove_network(self, ssid, show=True):
if ssid not in self.networks:
return
i = 0
while self.labels['networklist'].get_child_at(0, i) is not None:
if self.networks[ssid] == self.labels['networklist'].get_child_at(0, i):
self.labels['networklist'].remove_row(i)
self.labels['networklist'].show()
del self.networks[ssid]
del self.labels['networks'][ssid]
return
i = i+1
return
def remove_network_wid(self, widget, ssid):
self.remove_network(ssid)
def remove_wifi_network(self, widget, ssid):
self._screen.wifi.delete_network(ssid)
self.remove_network(ssid)
self.check_missing_networks()
def scan_callback(self, new_networks, old_networks):
for net in old_networks:
self.remove_network(net, False)
for net in new_networks:
self.add_network(net, False)
self.content.show_all()
def show_add_network(self, widget, ssid):
if self.show_add is True:
return
_ = self.lang.gettext
for child in self.content.get_children():
self.content.remove(child)
if "add_network" in self.labels:
del self.labels['add_network']
self.labels['add_network'] = Gtk.VBox()
self.labels['add_network'].set_valign(Gtk.Align.START)
box = Gtk.Box(spacing=5)
box.set_size_request(self._gtk.get_content_width(), self._gtk.get_content_height() -
self._screen.keyboard_height - 20)
box.set_hexpand(True)
box.set_vexpand(False)
self.labels['add_network'].add(box)
label = self._gtk.Label("%s %s:" % (_("PSK for"), ssid))
label.set_hexpand(False)
entry = Gtk.Entry()
entry.set_hexpand(True)
save = self._gtk.ButtonImage("sd", _("Save"), "color3")
save.set_hexpand(False)
save.connect("clicked", self.add_new_network, ssid, True)
self.labels['network_psk'] = entry
box.pack_start(label, False, False, 5)
box.pack_start(entry, True, True, 5)
box.pack_start(save, False, False, 5)
self.show_create = True
self.labels['network_psk'].set_text('')
self.content.add(self.labels['add_network'])
self._screen.show_keyboard()
self.labels['network_psk'].grab_focus_without_selecting()
self.content.show_all()
self.show_add = True
def update_all_networks(self):
for network in list(self.networks):
self.update_network_info(network)
return True
def update_network_info(self, ssid):
_ = self.lang.gettext
if ssid not in self.networks or ssid not in self.labels['networks']:
return
netinfo = self._screen.wifi.get_network_info(ssid)
if netinfo is None:
logging.debug("Couldn't get netinfo for update")
return
connected = ""
if netinfo['connected'] is True:
stream = os.popen('hostname -f')
hostname = stream.read().strip()
ifadd = netifaces.ifaddresses(self.interface)
ipv4 = ""
ipv6 = ""
if netifaces.AF_INET in ifadd and len(ifadd[netifaces.AF_INET]) > 0:
ipv4 = "<b>%s:</b> %s " % (_("IPv4"), ifadd[netifaces.AF_INET][0]['addr'])
if netifaces.AF_INET6 in ifadd and len(ifadd[netifaces.AF_INET6]) > 0:
ipv6 = ipv6 = "<b>%s:</b> %s " % (_("IPv6"), ifadd[netifaces.AF_INET6][0]['addr'].split('%')[0])
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"
self.labels['networks'][ssid]['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")
))
self.labels['networks'][ssid]['info'].show_all()
def update_single_network_info(self):
_ = self.lang.gettext
stream = os.popen('hostname -f')
hostname = stream.read().strip()
ifadd = netifaces.ifaddresses(self.interface)
ipv4 = ""
ipv6 = ""
if netifaces.AF_INET in ifadd and len(ifadd[netifaces.AF_INET]) > 0:
ipv4 = "<b>%s:</b> %s " % (_("IPv4"), ifadd[netifaces.AF_INET][0]['addr'])
if netifaces.AF_INET6 in ifadd and len(ifadd[netifaces.AF_INET6]) > 0:
ipv6 = ipv6 = "<b>%s:</b> %s " % (_("IPv6"), ifadd[netifaces.AF_INET6][0]['addr'].split('%')[0])
connected = "<b>%s</b>\n\n<small><b>%s</b></small>\n<b>%s:</b> %s\n%s\n%s\n" % (
self.interface, _("Connected"), _("Hostname"), hostname, ipv4, ipv6)
self.labels['networkinfo'].set_markup(connected)
self.labels['networkinfo'].show_all()
+9 -5
View File
@@ -7,8 +7,6 @@ from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.PowerPanel")
def create_panel(*args):
return PowerPanel(*args)
@@ -35,11 +33,17 @@ class PowerPanel(ScreenPanel):
self.content.add(box)
self._screen.add_subscription(panel_name)
def activate(self):
devices = self._screen.printer.get_power_devices()
for x in devices:
self.devices[x]['switch'].disconnect_by_func(self.on_switch)
self.devices[x]['switch'].set_active(True if self._screen.printer.get_power_device_status(x) == "on"
else False)
self.devices[x]['switch'].connect("notify::active", self.on_switch, x)
def add_device(self, device):
frame = Gtk.Frame()
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
frame.set_property("shadow-type", Gtk.ShadowType.NONE)
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
@@ -86,7 +90,7 @@ class PowerPanel(ScreenPanel):
self.add_device(x)
def on_switch(self, switch, gparam, device):
logger.debug("Power toggled %s" % device)
logging.debug("Power toggled %s" % device)
if switch.get_active():
self._screen._ws.klippy.power_device_on(device)
else:
+74 -42
View File
@@ -6,8 +6,6 @@ from gi.repository import Gtk, Gdk, GLib
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.PreheatPanel")
def create_panel(*args):
return PreheatPanel(*args)
@@ -17,61 +15,83 @@ class PreheatPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
self.preheat_options = self._screen._config.get_preheat_options()
logger.debug("Preheat options: %s" % self.preheat_options)
logging.debug("Preheat options: %s" % self.preheat_options)
grid = self._gtk.HomogeneousGrid()
eq_grid = self._gtk.HomogeneousGrid()
eq_grid = Gtk.Grid()
eq_grid.set_hexpand(True)
eq_grid.set_vexpand(True)
self.heaters = []
i = 0
for x in self._printer.get_tools():
if i > 3:
break
elif i == 0:
if i == 0:
primary_tool = x
self.labels[x] = self._gtk.ToggleButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0))
self.labels[x].connect('clicked', self.select_heater, x)
eq_grid.attach(self.labels[x], i%2, i/2, 1, 1)
self.heaters.append(x)
i += 1
add_heaters = self._printer.get_heaters()
for h in add_heaters:
if h.startswith("temperature_sensor "):
continue
if h == "heater_bed":
self.labels[h] = self._gtk.ButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
else:
name = " ".join(h.split(" ")[1:])
self.labels[h] = self._gtk.ButtonImage("heat-up", name)
self.heaters.append(h)
i = 0
cols = 3 if len(self.heaters) > 4 else (1 if len(self.heaters) <= 2 else 2)
for h in self.heaters:
self.labels[h].connect('clicked', self.select_heater, h)
eq_grid.attach(self.labels[h], i % cols, int(i/cols), 1, 1)
i += 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"] = self._gtk.HomogeneousGrid()
i = 0
for option in self.preheat_options:
self.labels[option] = self._gtk.Button(option, "color%d" % ((i%4)+1))
for option in self.preheat_options:
self.labels[option] = self._gtk.Button(option, "color%d" % ((i % 4)+1))
self.labels[option].connect("clicked", self.set_temperature, option)
self.labels['control_grid'].attach(
self.labels[option],
i%2, int(i/2), 1, 1)
i % 2, int(i/2), 1, 1)
i += 1
cooldown = self._gtk.ButtonImage('cool-down', _('Cooldown'))
cooldown = self._gtk.ButtonImage('cool-down', _('Cooldown'), "color%d" % ((i % 4)+1))
cooldown.connect("clicked", self.set_temperature, "cooldown")
row = int(i/2) if i%2 == 0 else int(i/2)+1
self.labels["control_grid"].attach(cooldown, i%2, int(i/2), 1, 1)
row = int(i/2) if i % 2 == 0 else int(i/2)+1
self.labels["control_grid"].attach(cooldown, i % 2, int(i/2), 1, 1)
i += 1
temperature = self._gtk.ButtonImage('heat-up', _('Temperature'), "color%d" % ((i % 4)+1))
temperature.connect("clicked", self.menu_item_clicked, "temperature", {
"name": "Temperature",
"panel": "temperature"
})
self.labels["control_grid"].attach(temperature, i % 2, int(i/2), 1, 1)
grid.attach(eq_grid, 0, 0, 1, 1)
grid.attach(self.labels["control_grid"], 1, 0, 1, 1)
self.content.add(grid)
self._screen.add_subscription(panel_name)
def activate(self):
for x in self._printer.get_tools():
if x not in self.active_heaters:
self.select_heater(None, x)
if self._printer.has_heated_bed() and "heater_bed" not in self.active_heaters:
self.select_heater(None, "heater_bed")
for h in self._printer.get_heaters():
if h.startswith("temperature_sensor "):
continue
if h not in self.active_heaters:
self.select_heater(None, h)
def select_heater(self, widget, heater):
if heater in self.active_heaters:
@@ -85,37 +105,49 @@ class PreheatPanel(ScreenPanel):
def set_temperature(self, widget, setting):
if setting == "cooldown":
for heater in self.active_heaters:
print ("Setting %s to %d" % (heater, 0))
if heater.startswith('heater_bed'):
logging.info("Setting %s to %d" % (heater, 0))
if heater.startswith('heater_generic '):
self._screen._ws.klippy.set_heater_temp(" ".join(heater.split(" ")[1:]), 0)
elif heater.startswith('heater_bed'):
self._screen._ws.klippy.set_bed_temp(0)
self._printer.set_dev_stat(heater,"target", 0)
self._printer.set_dev_stat(heater, "target", 0)
else:
self._screen._ws.klippy.set_tool_temp(self._printer.get_tool_number(heater), 0)
self._printer.set_dev_stat(heater,"target", 0)
self._printer.set_dev_stat(heater, "target", 0)
return
for heater in self.active_heaters:
if heater.startswith('heater_bed'):
print ("Setting %s to %d" % (heater, self.preheat_options[setting]['bed']))
if heater.startswith('heater_generic '):
logging.info("Setting %s to %d" % (heater, self.preheat_options[setting]['heater_generic']))
self._screen._ws.klippy.set_heater_temp(" ".join(heater.split(" ")[1:]),
self.preheat_options[setting]["heater_generic"])
elif heater.startswith('heater_bed'):
logging.info("Setting %s to %d" % (heater, self.preheat_options[setting]['bed']))
self._screen._ws.klippy.set_bed_temp(self.preheat_options[setting]["bed"])
self._printer.set_dev_stat(heater,"target", int(self.preheat_options[setting]["bed"]))
self._printer.set_dev_stat(heater, "target", int(self.preheat_options[setting]["bed"]))
else:
print ("Setting %s to %d" % (heater, self.preheat_options[setting]['extruder']))
logging.info("Setting %s to %d" % (heater, self.preheat_options[setting]['extruder']))
self._screen._ws.klippy.set_tool_temp(self._printer.get_tool_number(heater),
self.preheat_options[setting]["extruder"])
self._printer.set_dev_stat(heater,"target", int(self.preheat_options[setting]["extruder"]))
self.preheat_options[setting]["extruder"])
self._printer.set_dev_stat(heater, "target", int(self.preheat_options[setting]["extruder"]))
if self.preheat_options[setting]['gcode']:
self._screen._ws.klippy.gcode_script(self.preheat_options[setting]['gcode'])
def process_update(self, action, data):
if action != "notify_status_update":
return
if self._printer.has_heated_bed():
self.update_temp("heater_bed",
self._printer.get_dev_stat("heater_bed","temperature"),
self._printer.get_dev_stat("heater_bed","target")
)
for x in self._printer.get_tools():
self.update_temp(x,
self._printer.get_dev_stat(x,"temperature"),
self._printer.get_dev_stat(x,"target")
self.update_temp(
x,
self._printer.get_dev_stat(x, "temperature"),
self._printer.get_dev_stat(x, "target")
)
for h in self._printer.get_heaters():
self.update_temp(
h,
self._printer.get_dev_stat(h, "temperature"),
self._printer.get_dev_stat(h, "target"),
None if h == "heater_bed" else " ".join(h.split(" ")[1:])
)
+284 -132
View File
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import gi
import json
import humanize
import logging
@@ -10,26 +11,29 @@ from datetime import datetime
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.PrintPanel")
def create_panel(*args):
return PrintPanel(*args)
class PrintPanel(ScreenPanel):
cur_directory = "gcodes"
dir_panels = {}
filelist = {'gcodes': {'directories': [], 'files': []}}
def initialize(self, panel_name):
_ = self.lang.gettext
self.labels['directories'] = {}
self.labels['files'] = {}
self.sort_items = {
"name": _("Name"),
"date": _("Date")
}
self.sort_char = ["↑","↓"]
self.sort_char = ["↑", "↓"]
sortdir = self._config.get_main_config_option("print_sort_dir","name_asc")
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
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)
@@ -42,7 +46,7 @@ class PrintPanel(ScreenPanel):
sbox.add(sort)
i = 1
for name, val in self.sort_items.items():
s = self._gtk.Button(val, "color%s" % (i%4))
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]]))
@@ -50,117 +54,307 @@ class PrintPanel(ScreenPanel):
self.labels['sort_%s' % name] = s
sbox.add(s)
i += 1
refresh = self._gtk.ButtonImage("refresh", None, None, .5, .5)
refresh.connect('clicked', self._refresh_files)
sbox.add(refresh)
sbox.set_hexpand(True)
sbox.set_vexpand(False)
pbox = Gtk.Box(spacing=0)
pbox.set_hexpand(True)
pbox.set_vexpand(False)
self.labels['path'] = Gtk.Label(" /")
pbox.add(self.labels['path'])
self.labels['path_box'] = pbox
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
box.pack_start(sbox, False, False, 0)
box.pack_start(pbox, False, False, 0)
box.pack_start(scroll, True, True, 0)
self.labels['filelist'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['filelist'].set_vexpand(True)
self.labels['filelist'] = Gtk.Grid()
self.dir_panels['gcodes'] = Gtk.Grid()
self.files = {}
self.directories = {}
GLib.idle_add(self.reload_files)
scroll.add(self.labels['filelist'])
scroll.add(self.dir_panels['gcodes'])
self.scroll = scroll
self.content.add(box)
self._screen.files.add_file_callback(self._callback)
return
def add_file(self, filename, show=True):
fileinfo = self._screen.files.get_file_info(filename)
if fileinfo == None:
return
def activate(self):
if self.cur_directory != "gcodes":
self.change_dir(None, "gcodes")
frame = Gtk.Frame()
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
frame.get_style_context().add_class("frame-item")
def add_directory(self, directory, show=True):
parent_dir = '/'.join(directory.split('/')[:-1])
if directory not in self.filelist:
self.filelist[directory] = {'directories': [], 'files': [], 'modified': 0}
self.filelist[parent_dir]['directories'].append(directory)
if directory not in self.labels['directories']:
frame = Gtk.Frame()
frame.set_property("shadow-type", Gtk.ShadowType.NONE)
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
#n = 50
#name.set_markup("<big>%s</big>" % ("\n".join([filename[i:i+n] for i in range(0, len(filename), n)])))
name.set_markup("<big><b>%s</b></big>" % (filename))
name.set_hexpand(True)
name.set_halign(Gtk.Align.START)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
name = Gtk.Label()
name.set_markup("<big><b>%s</b></big>" % (directory.split("/")[-1]))
name.set_hexpand(True)
name.set_halign(Gtk.Align.START)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
info = Gtk.Label("Uploaded: blah - Size: blah")
info.set_halign(Gtk.Align.START)
info.set_markup(self.get_file_info_str(filename))
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)
info = Gtk.Label()
info.set_halign(Gtk.Align.START)
actions = self._gtk.ButtonImage("print",None,"color3")
actions.connect("clicked", self.confirm_print, filename)
actions.set_hexpand(False)
actions.set_halign(Gtk.Align.END)
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)
file = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
file.set_hexpand(True)
file.set_vexpand(False)
actions = self._gtk.ButtonImage("load", None, "color3")
actions.connect("clicked", self.change_dir, directory)
actions.set_hexpand(False)
actions.set_halign(Gtk.Align.END)
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)
file = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
file.set_hexpand(True)
file.set_vexpand(False)
file.add(icon)
file.add(labels)
file.add(actions)
frame.add(file)
icon = self._gtk.Image("folder.svg", False, 1, 1)
self.files[filename] = frame
file.add(icon)
file.add(labels)
file.add(actions)
frame.add(file)
self.directories[directory] = frame
self.labels['directories'][directory] = {
"icon": icon,
"info": info,
"name": name
}
self.dir_panels[directory] = Gtk.Grid()
reverse = False if self.sort_current[1] == 0 else True
if self.sort_current[0] == "date":
files = sorted(self.files, reverse=reverse,
key=lambda item: self._screen.files.get_file_info(item)['modified'])
dirs = sorted(self.filelist[parent_dir]['directories'], reverse=reverse,
key=lambda item: self.filelist[item]['modified'])
else:
files = sorted(self.files, reverse=reverse)
dirs = sorted(self.filelist[parent_dir]['directories'], reverse=reverse)
pos = dirs.index(directory)
self.dir_panels[parent_dir].insert_row(pos)
self.dir_panels[parent_dir].attach(self.directories[directory], 0, pos, 1, 1)
if show is True:
self.dir_panels[parent_dir].show_all()
def add_file(self, filepath, show=True):
_ = self.lang.gettext
fileinfo = self._screen.files.get_file_info(filepath)
if fileinfo is None:
return
dir = ("gcodes/%s" % filepath).split('/')[:-1]
directory = '/'.join(dir)
filename = filepath.split('/')[-1]
for i in range(1, len(dir)):
curdir = "/".join(dir[0:i])
newdir = "/".join(dir[0:i+1])
if newdir not in self.filelist[curdir]['directories']:
self.add_directory(newdir)
if filename not in self.filelist[directory]['files']:
for i in range(1, len(dir)):
curdir = "/".join(dir[0:i+1])
if curdir != "gcodes" and fileinfo['modified'] > self.filelist[curdir]['modified']:
self.filelist[curdir]['modified'] = fileinfo['modified']
self.labels['directories'][curdir]['info'].set_markup(
"<small>%s: <b>%s</b></small>" %
(_("Modified"), datetime.fromtimestamp(fileinfo['modified']).strftime("%Y-%m-%d %H:%M")))
self.filelist[directory]['files'].append(filename)
if filepath not in self.files:
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>" % (filename))
name.set_hexpand(True)
name.set_halign(Gtk.Align.START)
name.set_line_wrap(True)
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
info = Gtk.Label()
info.set_halign(Gtk.Align.START)
info.set_markup(self.get_file_info_str(filepath))
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
labels.add(name)
labels.add(info)
labels.set_vexpand(True)
labels.set_valign(Gtk.Align.CENTER)
labels.set_halign(Gtk.Align.START)
actions = self._gtk.ButtonImage("print", None, "color3")
actions.connect("clicked", self.confirm_print, filepath)
actions.set_hexpand(False)
actions.set_halign(Gtk.Align.END)
file = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
file.set_hexpand(True)
file.set_vexpand(False)
icon = self._gtk.Image("file.svg", False, 1.6, 1.6)
pixbuf = self.get_file_image(filepath)
if pixbuf is not None:
icon.set_from_pixbuf(pixbuf)
file.add(icon)
file.add(labels)
file.add(actions)
frame.add(file)
self.files[filepath] = frame
self.labels['files'][filepath] = {
"icon": icon,
"info": info,
"name": name
}
reverse = False if self.sort_current[1] == 0 else True
if self.sort_current[0] == "date":
files = sorted(
self.filelist[directory]['files'], reverse=reverse,
key=lambda item: self._screen.files.get_file_info(("%s/%s" % (directory, item))[7:])['modified']
)
else:
files = sorted(self.filelist[directory]['files'], reverse=reverse)
pos = files.index(filename)
pos += len(self.filelist[directory]['directories'])
self.labels['files'][filename] = {
"icon": icon,
"info": info,
"name": name
}
self.dir_panels[directory].insert_row(pos)
self.dir_panels[directory].attach(self.files[filepath], 0, pos, 1, 1)
if show is True:
self.dir_panels[directory].show_all()
self.labels['filelist'].insert_row(pos)
self.labels['filelist'].attach(self.files[filename], 0, pos, 1, 1)
if show == True:
self.labels['filelist'].show_all()
def back(self):
if len(self.cur_directory.split('/')) > 1:
self.change_dir(None, '/'.join(self.cur_directory.split('/')[:-1]))
return True
return False
def change_dir(self, widget, directory):
if directory not in self.dir_panels:
return
logging.debug("Changing dir to %s" % directory)
for child in self.scroll.get_children():
self.scroll.remove(child)
self.cur_directory = directory
self.labels['path'].set_text(" /%s" % self.cur_directory[7:])
self.scroll.add(self.dir_panels[directory])
self.content.show_all()
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]]))
logging.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)
self._config.set("main", "print_sort_dir", "%s_%s" % (key, "asc" if self.sort_current[1] == 0 else "desc"))
self._config.save_user_config_options()
def confirm_print(self, widget, filename):
_ = self.lang.gettext
buttons = [
{"name": _("Print"), "response": Gtk.ResponseType.OK},
{"name": _("Cancel"), "response": Gtk.ResponseType.CANCEL}
]
label = Gtk.Label()
label.set_markup("<b>%s</b>\n" % (filename))
label.set_hexpand(True)
label.set_halign(Gtk.Align.CENTER)
label.set_vexpand(True)
label.set_valign(Gtk.Align.CENTER)
label.set_line_wrap(True)
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
grid = Gtk.Grid()
grid.add(label)
grid.set_size_request(self._screen.width - 60, -1)
pixbuf = self.get_file_image(filename, 8, 3.2)
if pixbuf is not None:
image = Gtk.Image.new_from_pixbuf(pixbuf)
grid.attach_next_to(image, label, Gtk.PositionType.BOTTOM, 1, 3)
grid.set_vexpand(True)
grid.set_halign(Gtk.Align.CENTER)
grid.set_valign(Gtk.Align.CENTER)
dialog = self._gtk.Dialog(self._screen, buttons, grid, self.confirm_print_response, filename)
def confirm_print_response(self, widget, response_id, filename):
widget.destroy()
if response_id == Gtk.ResponseType.CANCEL:
return
logging.info("Starting print: %s" % (filename))
self._screen._ws.klippy.print_start(filename)
def delete_file(self, filename):
dir_parts = ("gcodes/%s" % filename).split('/')[:-1]
directory = '/'.join(dir_parts)
self.filelist[directory]["files"].pop(self.filelist[directory]["files"].index(filename.split('/')[-1]))
i = len(dir_parts)
while i > 1:
cur_dir = '/'.join(dir_parts[0:i])
if len(self.filelist[cur_dir]['directories']) > 0 or len(self.filelist[cur_dir]['files']) > 0:
break
par_dir = '/'.join(cur_dir.split('/')[:-1])
if self.cur_directory == cur_dir:
self.change_dir(None, par_dir)
del self.filelist[cur_dir]
self.filelist[par_dir]['directories'].pop(self.filelist[par_dir]['directories'].index(cur_dir))
self.dir_panels[par_dir].remove(self.directories[cur_dir])
del self.directories[cur_dir]
del self.labels['directories'][cur_dir]
self.dir_panels[par_dir].show_all()
i -= 1
self.dir_panels[directory].remove(self.files[filename])
self.dir_panels[directory].show_all()
self.files.pop(filename)
def get_file_info_str(self, filename):
_ = self.lang.gettext
fileinfo = self._screen.files.get_file_info(filename)
if fileinfo == None:
if fileinfo is None:
return
return "<small>%s: <b>%s</b> - %s: <b>%s</b>\n%s: <b>%s</b></small>" % (
@@ -172,9 +366,9 @@ class PrintPanel(ScreenPanel):
self.get_print_time(filename)
)
def get_print_time (self, filename):
def get_print_time(self, filename):
fileinfo = self._screen.files.get_file_info(filename)
if fileinfo == None:
if fileinfo is None:
return
if "estimated_time" in fileinfo:
@@ -187,90 +381,48 @@ class PrintPanel(ScreenPanel):
print_str = "%sd " % print_val
# Take remainder from days and divide by hours
print_val = int((print_time%86400)/3600)
print_val = int((print_time % 86400)/3600)
if print_val > 0:
print_str = "%s%sh " % (print_str, print_val)
print_val = int(((print_time%86400)%3600)/60)
print_val = int(((print_time % 86400) % 3600)/60)
print_str = "%s%sm" % (print_str, print_val)
return print_str
return "Unavailable"
def reload_files(self, widget=None):
self.filelist = {'gcodes': {'directories': [], 'files': []}}
for dirpan in self.dir_panels:
for child in self.dir_panels[dirpan].get_children():
self.dir_panels[dirpan].remove(child)
flist = sorted(self._screen.files.get_file_list(), key=lambda item: '/' in item)
for file in flist:
GLib.idle_add(self.add_file, file)
def update_file(self, filename):
if filename not in self.labels['files']:
logging.debug("Cannot update file, file not in labels: %s" % filename)
return
print("Updating file %s" % filename)
logging.info("Updating file %s" % filename)
self.labels['files'][filename]['info'].set_markup(self.get_file_info_str(filename))
# Update icon
pixbuf = self.get_file_image(filename)
if pixbuf != None:
if pixbuf is not None:
self.labels['files'][filename]['icon'].set_from_pixbuf(pixbuf)
def delete_file(self, filename):
files = sorted(self.files)
pos = files.index(filename)
self.labels['filelist'].remove_row(pos)
self.labels['filelist'].show_all()
self.files.pop(filename)
def reload_files(self, widget=None):
for child in self.labels['filelist'].get_children():
self.labels['filelist'].remove(child)
self.labels['filelist'].show_all()
for file in self._screen.files.get_file_list():
self.add_file(file, False)
self.labels['filelist'].show_all()
def _callback(self, newfiles, deletedfiles, updatedfiles=[]):
logger.debug("newfiles: %s", newfiles)
logging.debug("newfiles: %s", newfiles)
for file in newfiles:
self.add_file(file)
logger.debug("deletedfiles: %s", deletedfiles)
logging.debug("deletedfiles: %s", deletedfiles)
for file in deletedfiles:
self.delete_file(file)
logger.debug("updatefiles: %s", updatedfiles)
logging.debug("updatefiles: %s", updatedfiles)
for file in updatedfiles:
self.update_file(file)
def confirm_print(self, widget, filename):
_ = self.lang.gettext
buttons = [
{"name":_("Print"), "response": Gtk.ResponseType.OK},
{"name":_("Cancel"),"response": Gtk.ResponseType.CANCEL}
]
label = Gtk.Label()
label.set_markup("%s <b>%s</b>%s" % (_("Are you sure you want to print"), filename, _("?")))
label.set_hexpand(True)
label.set_halign(Gtk.Align.CENTER)
label.set_line_wrap(True)
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
grid = Gtk.Grid()
grid.add(label)
grid.set_size_request(self._screen.width - 60, -1)
pixbuf = self.get_file_image(filename, 8, 3.2)
if pixbuf != None:
image = Gtk.Image.new_from_pixbuf(pixbuf)
grid.attach_next_to(image, label, Gtk.PositionType.BOTTOM, 1, 3)
#table.attach(label, 0, 1, 0, 1, Gtk.AttachOptions.SHRINK | Gtk.AttachOptions.FILL)
grid.set_vexpand(True)
grid.set_halign(Gtk.Align.CENTER)
grid.set_valign(Gtk.Align.CENTER)
dialog = self._gtk.Dialog(self._screen, buttons, grid, self.confirm_print_response, filename)
def confirm_print_response(self, widget, response_id, filename):
widget.destroy()
if response_id == Gtk.ResponseType.CANCEL:
return
logging.info("Starting print: %s" % (filename))
self._screen._ws.klippy.print_start(filename)
def _refresh_files(self, widget):
self._files.refresh_files()
+33
View File
@@ -0,0 +1,33 @@
import gi
import logging
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.PrinterSelect")
def create_panel(*args):
return PrinterSelect(*args)
class PrinterSelect(ScreenPanel):
def __init__(self, screen, title, back=True, action_bar=True, printer_name=True):
super().__init__(screen, title, False, False, False)
def initialize(self, panel_name):
_ = self.lang.gettext
printers = self._config.get_printers()
box = Gtk.Box()
self.content.add(box)
i = 1
for printer in printers:
name = list(printer)[0]
self.labels[name] = self._gtk.ButtonImage("extruder", name, "color%s" % (i % 4))
self.labels[name].connect("clicked", self._screen.connect_printer_widget, name)
box.add(self.labels[name])
i += 1
+68 -26
View File
@@ -7,8 +7,6 @@ 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)
@@ -23,45 +21,64 @@ class SettingsPanel(ScreenPanel):
self.labels['main_box'] = self.create_box('main')
self.labels['macros_box'] = self.create_box('macros')
printbox = Gtk.Box(spacing=0)
printbox.set_vexpand(False)
self.labels['add_printer_button'] = self._gtk.Button(_("Add Printer"), "color1")
self.labels['printers_box'] = self.create_box('printers', printbox)
options = self._config.get_configurable_options().copy()
options.append({"macros": {
"name": _("Displayed Macros"),
"type": "menu",
"menu": "macros"}
})
options.append({"printers": {
"name": _("Printer Connections"),
"type": "menu",
"menu": "printers"
}})
for option in options:
name = list(option)[0]
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",
"section": "displayed_macros %s" % self._screen.connected_printer,
"type": "macro"
}
for macro in list(self.macros):
self.add_option('macros', self.macros, macro, self.macros[macro])
logger.debug("Macros: %s" % self.macros)
self.printers = {}
for printer in self._config.get_printers():
logging.debug("Printer: %s" % printer)
pname = list(printer)[0]
self.printers[pname] = {
"name": pname,
"section": "printer %s" % pname,
"type": "printer",
"moonraker_host": printer[pname]['moonraker_host'],
"moonraker_port": printer[pname]['moonraker_port'],
}
self.add_option("printers", self.printers, pname, self.printers[pname])
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):
def back(self):
if len(self.menu) > 1:
self.unload_menu()
else:
self._screen._menu_go_back()
return True
return False
def create_box(self, name):
def create_box(self, name, insert=None):
# Create a scroll window for the macros
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
@@ -74,12 +91,17 @@ class SettingsPanel(ScreenPanel):
# Create a box to contain all of the above
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
box.set_vexpand(True)
if insert is not None:
box.pack_start(insert, False, False, 0)
box.pack_start(scroll, True, True, 0)
return box
def add_option(self, boxname, opt_array, opt_name, option):
if option['type'] is None:
return
frame = Gtk.Frame()
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
frame.set_property("shadow-type", Gtk.ShadowType.NONE)
frame.get_style_context().add_class("frame-item")
name = Gtk.Label()
@@ -91,11 +113,6 @@ class SettingsPanel(ScreenPanel):
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)
@@ -115,7 +132,8 @@ class SettingsPanel(ScreenPanel):
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name, fallback=True))
else:
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name))
switch.connect("notify::active", self.switch_config_option, option['section'], opt_name)
switch.connect("notify::active", self.switch_config_option, option['section'], opt_name,
option['callback'] if "callback" in option else None)
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)
@@ -129,13 +147,29 @@ class SettingsPanel(ScreenPanel):
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
option['callback'] if "callback" in option else None)
dropdown.set_entry_text_column(0)
dev.add(dropdown)
logger.debug("Children: %s" % dropdown.get_children())
logging.debug("Children: %s" % dropdown.get_children())
elif option['type'] == "scale":
val = int(self._config.get_config().get(option['section'], opt_name, fallback=option['value']))
adj = Gtk.Adjustment(val, option['range'][0], option['range'][1], option['step'], option['step']*5)
scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj)
scale.set_hexpand(True)
scale.set_digits(0)
scale.connect("value-changed", self.scale_moved, option['section'], opt_name)
dev.add(scale)
elif option['type'] == "printer":
logging.debug("Option: %s" % option)
box = Gtk.Box()
box.set_vexpand(False)
label = Gtk.Label()
url = "%s:%s" % (option['moonraker_host'], option['moonraker_port'])
label.set_markup("<big>%s</big>\n%s" % (option['name'], url))
box.add(label)
dev.add(box)
elif option['type'] == "menu":
open = self._gtk.ButtonImage("open",None,"color3")
open = self._gtk.ButtonImage("settings", None, "color3")
open.connect("clicked", self.load_menu, option['menu'])
open.set_hexpand(False)
open.set_halign(Gtk.Align.END)
@@ -169,7 +203,7 @@ class SettingsPanel(ScreenPanel):
self.content.show_all()
def unload_menu(self, widget=None):
logger.debug("self.menu: %s" % self.menu)
logging.debug("self.menu: %s" % self.menu)
if len(self.menu) <= 1 or self.menu[-2] not in self.labels:
return
@@ -184,19 +218,27 @@ class SettingsPanel(ScreenPanel):
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))
logging.debug("[%s] %s changed to %s" % (section, option, value))
self._config.set(section, option, value)
self._config.save_user_config_options()
if callback is not None:
callback(value)
def scale_moved(self, widget, section, option):
logging.debug("[%s] %s changed to %s" % (section, option, widget.get_value()))
if section not in self._config.get_config().sections():
self._config.get_config().add_section(section)
self._config.set(section, option, str(int(widget.get_value())))
self._config.save_user_config_options()
def switch_config_option(self, switch, gparam, section, option):
logger.debug("[%s] %s toggled %s" % (section, option, switch.get_active()))
def switch_config_option(self, switch, gparam, section, option, callback=None):
logging.debug("[%s] %s toggled %s" % (section, option, switch.get_active()))
if section not in self._config.get_config().sections():
self._config.get_config().add_section(section)
self._config.set(section, option, "True" if switch.get_active() else "False")
self._config.save_user_config_options()
if callback is not None:
callback(switch.get_active())
def add_gcode_option(self):
macros = self._screen.printer.get_gcode_macros()
+23 -23
View File
@@ -7,42 +7,42 @@ from gi.repository import Gtk, Gdk, GLib, Pango
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.SplashScreenPanel")
def create_panel(*args):
return SplashScreenPanel(*args)
class SplashScreenPanel(ScreenPanel):
box = None
def __init__(self, screen, title, back=True):
super().__init__(screen, title, back)
self.layout = Gtk.Layout()
self.layout.set_size(self._screen.width, self._screen.height)
def initialize(self, panel_name):
_ = self.lang.gettext
image = self._gtk.Image("klipper.png", None, 4, 3)
image = self._gtk.Image("klipper.svg", None, 3.2, 3.2)
self.labels['text'] = Gtk.Label(_("Initializing printer..."))
self.labels['text'].set_line_wrap(True)
self.labels['text'].set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
self.labels['text'].set_halign(Gtk.Align.CENTER)
self.labels['text'].set_valign(Gtk.Align.CENTER)
self.labels['actions'] = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
self.labels['actions'].set_hexpand(True)
self.labels['actions'].set_vexpand(False)
self.labels['actions'].set_halign(Gtk.Align.END)
self.labels['actions'].set_margin_end(20)
self.labels['actions'].set_halign(Gtk.Align.CENTER)
self.labels['actions'].set_homogeneous(True)
main = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
main.pack_start(image, True, True, 0)
main.pack_end(self.labels['actions'], False, False, 0)
main.pack_end(self.labels['text'], True, True, 0)
main = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=15)
main.pack_start(image, True, True, 10)
main.pack_end(self.labels['actions'], False, False, 10)
main.pack_end(self.labels['text'], True, True, 10)
box = Gtk.VBox()
box.add(main)
self.layout = box
self.content.add(main)
def update_text(self, text):
self.labels['text'].set_text(text)
@@ -56,28 +56,28 @@ class SplashScreenPanel(ScreenPanel):
_ = self.lang.gettext
if "firmware_restart" not in self.labels:
self.labels['menu'] = self._gtk.ButtonImage("control",_("Menu"),"color4")
self.labels['menu'] = self._gtk.ButtonImage("settings", _("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['power'] = self._gtk.ButtonImage("shutdown", _("Power On Printer"), "color3")
self.labels['restart'] = self._gtk.ButtonImage("refresh", _("Restart"), "color1")
self.labels['restart'].connect("clicked", self.restart)
self.labels['firmware_restart'] = self._gtk.ButtonImage("restart",_("Firmware Restart"),"color2")
self.labels['firmware_restart'] = self._gtk.ButtonImage("refresh", _("Firmware Restart"), "color2")
self.labels['firmware_restart'].connect("clicked", self.firmware_restart)
self.clear_action_bar()
devices = [i for i in self._printer.get_power_devices() if i.lower().startswith('printer')] if (
self._printer is not None) else []
logger.debug("Power devices: %s" % devices)
self._printer is not None) else []
logging.debug("Power devices: %s" % devices)
if len(devices) > 0:
logger.debug("Adding power button")
logging.debug("Adding power button")
self.labels['power'].connect("clicked", self.power_on, devices[0])
self.labels['actions'].add(self.labels['power'])
self.labels['actions'].add(self.labels['restart'])
self.labels['actions'].add(self.labels['firmware_restart'])
self.labels['actions'].add(self.labels['menu'])
self.labels['actions'].show()
self.labels['actions'].show_all()
def firmware_restart(self, widget):
self._screen._ws.klippy.restart_firmware()
+351 -25
View File
@@ -3,43 +3,49 @@ import logging
import os
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, Gdk, GLib
from gi.repository import Gtk, Gdk, GLib, Pango
from datetime import datetime
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.SystemPanel")
def create_panel(*args):
return SystemPanel(*args)
ALLOWED_SERVICES = ["KlipperScreen", "MoonCord", "klipper", "moonraker"]
class SystemPanel(ScreenPanel):
def initialize(self, panel_name):
_ = self.lang.gettext
grid = self._gtk.HomogeneousGrid()
grid.set_row_homogeneous(False)
restart = self._gtk.ButtonImage('reboot',"\n".join(_('Klipper Restart').split(' ')),'color1')
restart = self._gtk.ButtonImage('refresh', "\n".join(_('Klipper Restart').split(' ')), 'color1')
restart.connect("clicked", self.restart_klippy)
firmrestart = self._gtk.ButtonImage('restart',"\n".join(_('Firmware Restart').split(' ')),'color2')
restart.set_vexpand(False)
firmrestart = self._gtk.ButtonImage('refresh', "\n".join(_('Firmware Restart').split(' ')), 'color2')
firmrestart.connect("clicked", self.restart_klippy, "firmware")
firmrestart.set_vexpand(False)
reboot = self._gtk.ButtonImage('reboot',_('System\nRestart'),'color3')
reboot = self._gtk.ButtonImage('refresh', _('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')
_("Are you sure you wish to reboot the system?"), "machine.reboot")
reboot.set_vexpand(False)
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")
_("Are you sure you wish to shutdown the system?"), "machine.shutdown")
shutdown.set_vexpand(False)
info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
info.set_vexpand(True)
info.set_valign(Gtk.Align.CENTER)
self.labels['loadavg'] = Gtk.Label("temp")
self.update_system_load()
self.system_timeout = GLib.timeout_add(1000, self.update_system_load)
self.labels['klipper_version'] = Gtk.Label(_("Klipper Version") +
self.labels['klipper_version'] = Gtk.Label(
_("Klipper Version") +
(": %s" % self._screen.printer.get_klipper_version()))
self.labels['klipper_version'].set_margin_top(15)
@@ -50,27 +56,347 @@ class SystemPanel(ScreenPanel):
info.add(self.labels['klipper_version'])
info.add(self.labels['ks_version'])
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_vexpand(True)
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
grid.attach(info, 0, 0, 5, 2)
infogrid = Gtk.Grid()
infogrid.get_style_context().add_class("system-program-grid")
update_resp = self._screen.apiclient.send_request("machine/update/status")
self.update_status = False
if not update_resp:
logging.info("No update manager configured")
else:
self.update_status = update_resp['result']
vi = update_resp['result']['version_info']
items = sorted(list(vi))
i = 0
for prog in items:
self.labels[prog] = Gtk.Label("")
self.labels[prog].set_hexpand(True)
self.labels[prog].set_halign(Gtk.Align.START)
self.labels["%s_status" % prog] = self._gtk.Button()
self.labels["%s_status" % prog].set_hexpand(False)
self.labels["%s_status" % prog].connect("clicked", self.show_update_info, prog)
if prog in ALLOWED_SERVICES:
self.labels["%s_restart" % prog] = self._gtk.ButtonImage("refresh", None, None, .7, .7)
self.labels["%s_restart" % prog].connect("clicked", self.restart, prog)
infogrid.attach(self.labels["%s_restart" % prog], 0, i, 1, 1)
infogrid.attach(self.labels["%s_status" % prog], 2, i, 1, 1)
logging.info("Updating program: %s " % prog)
self.update_program_info(prog)
infogrid.attach(self.labels[prog], 1, i, 1, 1)
self.labels[prog].get_style_context().add_class('updater-item')
i = i + 1
scroll.add(infogrid)
grid.attach(scroll, 0, 0, 4, 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)
grid.attach(reboot, 2, 2, 1, 1)
grid.attach(shutdown, 3, 2, 1, 1)
self.content.add(grid)
def update_system_load(self):
_ = self.lang.gettext
lavg = os.getloadavg()
self.labels['loadavg'].set_text(
_("Load Average") + (": %.2f %.2f %.2f" % (lavg[0], lavg[1], lavg[2]))
)
def activate(self):
self.get_updates()
#TODO: Shouldn't need this
self.system_timeout = GLib.timeout_add(1000, self.update_system_load)
def destroy_widget(self, widget, response_id):
widget.destroy()
def finish_updating(self, widget, response_id):
widget.destroy()
self._screen.set_updating(False)
self.get_updates()
def get_updates(self):
update_resp = self._screen.apiclient.send_request("machine/update/status")
if not update_resp:
logging.info("No update manager configured")
else:
self.update_status = update_resp['result']
vi = update_resp['result']['version_info']
items = sorted(list(vi))
for prog in items:
self.update_program_info(prog)
def process_update(self, action, data):
if action == "notify_update_response":
logging.info("Update: %s" % data)
if 'application' in data:
self.labels['update_progress'].set_text(self.labels['update_progress'].get_text().strip() + "\n" +
data['message'] + "\n")
self.labels['update_progress'].set_ellipsize(True)
self.labels['update_progress'].set_ellipsize(Pango.EllipsizeMode.END)
adjustment = self.labels['update_scroll'].get_vadjustment()
adjustment.set_value(adjustment.get_upper() - adjustment.get_page_size())
adjustment = self.labels['update_scroll'].show_all()
if data['complete']:
self.update_dialog.set_response_sensitive(Gtk.ResponseType.CANCEL, True)
def restart(self, widget, program):
if program not in ALLOWED_SERVICES:
return
logging.info("Restarting service: %s" % program)
self._screen._ws.send_method("machine.services.restart", {"service": program})
def show_update_info(self, widget, program):
_ = self.lang.gettext
if not self.update_status or program not in self.update_status['version_info']:
return
info = self.update_status['version_info'][program]
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True)
scroll.set_vexpand(True)
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
grid = Gtk.Grid()
grid.set_column_homogeneous(True)
grid.set_halign(Gtk.Align.CENTER)
grid.set_valign(Gtk.Align.CENTER)
i = 0
label = Gtk.Label()
if "configured_type" in info:
if info['configured_type'] == 'git_repo':
if not info['is_valid'] or info['is_dirty']:
label.set_markup(_("Do you want to recover %s?") % program)
grid.attach(label, 0, i, 1, 1)
scroll.add(grid)
recoverybuttons = [
{"name": _("Recover Hard"), "response": Gtk.ResponseType.OK},
{"name": _("Recover Soft"), "response": Gtk.ResponseType.APPLY},
{"name": _("Cancel"), "response": Gtk.ResponseType.CANCEL}
]
dialog = self._gtk.Dialog(self._screen, recoverybuttons, scroll, self.reset_confirm, program)
return
else:
if info['version'] == info['remote_version']:
return
label.set_markup("<b>" + _("Outdated by %d commits:") % len(info['commits_behind']) + "</b>\n")
grid.attach(label, 0, i, 1, 1)
i = i + 1
date = ""
for c in info['commits_behind']:
ndate = datetime.fromtimestamp(int(c['date'])).strftime("%b %d")
if date != ndate:
date = ndate
label = Gtk.Label()
label.set_markup("<b>%s</b>\n" % date)
label.set_halign(Gtk.Align.START)
grid.attach(label, 0, i, 1, 1)
i = i + 1
label = Gtk.Label()
label.set_ellipsize(True)
label.set_ellipsize(Pango.EllipsizeMode.END)
label.set_markup("<b>%s</b>\n<i>%s</i>\n" % (c['subject'], c['author']))
label.set_halign(Gtk.Align.START)
grid.attach(label, 0, i, 1, 1)
i = i + 1
details = Gtk.Label(label=c['message']+"\n\n\n")
details.set_halign(Gtk.Align.START)
grid.attach(details, 0, i, 1, 1)
i = i + 1
else:
label.set_markup("<b>" + _("%s will be updated to version") % program.capitalize() +
": %s</b>" % (info['remote_version']))
grid.attach(label, 0, i, 1, 1)
i = i + 1
if "package_count" in info:
label.set_markup("<b>" + _("%d Packages will be updated") % info['package_count'] + ":</b>\n")
label.set_halign(Gtk.Align.CENTER)
grid.attach(label, 0, i, 3, 1)
i = i + 1
j = 0
for c in info["package_list"]:
label = Gtk.Label()
label.set_markup(" %s " % c)
label.set_halign(Gtk.Align.START)
label.set_ellipsize(True)
label.set_ellipsize(Pango.EllipsizeMode.END)
pos = (j % 3)
grid.attach(label, pos, i, 1, 1)
j = j + 1
if (pos == 2):
i = i + 1
scroll.add(grid)
buttons = [
{"name": _("Update"), "response": Gtk.ResponseType.OK},
{"name": _("Cancel"), "response": Gtk.ResponseType.CANCEL}
]
dialog = self._gtk.Dialog(self._screen, buttons, scroll, self.update_confirm, program)
def update_confirm(self, widget, response_id, program):
if response_id == Gtk.ResponseType.OK:
logging.debug("Updating %s" % program)
self.update_program(self, program)
widget.destroy()
def reset_confirm(self, widget, response_id, program):
if response_id == Gtk.ResponseType.OK:
logging.debug("Recovering hard %s" % program)
self.reset_repo(self, program, True)
if response_id == Gtk.ResponseType.APPLY:
logging.debug("Recovering soft %s" % program)
self.reset_repo(self, program, False)
widget.destroy()
def reset_repo(self, widget, program, hard):
if self._screen.is_updating():
return
_ = self.lang.gettext
buttons = [
{"name": _("Finish"), "response": Gtk.ResponseType.CANCEL}
]
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True)
scroll.set_vexpand(True)
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
self.labels['update_progress'] = Gtk.Label("%s %s..." % (_("Starting recovery for"), program))
self.labels['update_progress'].set_halign(Gtk.Align.START)
self.labels['update_progress'].set_valign(Gtk.Align.START)
scroll.add(self.labels['update_progress'])
self.labels['update_scroll'] = scroll
dialog = self._gtk.Dialog(self._screen, buttons, scroll, self.finish_updating)
dialog.set_response_sensitive(Gtk.ResponseType.CANCEL, False)
self.update_prog = program
self.update_dialog = dialog
logging.info("Sending machine.update.recover name: %s" % program)
self._screen._ws.send_method("machine.update.recover", {"name": program, "hard": str(hard)})
self._screen.set_updating(True)
def update_program(self, widget, program):
if self._screen.is_updating():
return
_ = self.lang.gettext
if not self.update_status or program not in self.update_status['version_info']:
return
info = self.update_status['version_info'][program]
logging.info("program: %s" % info)
if "package_count" in info:
if info['package_count'] == 0:
return
else:
if info['version'] == info['remote_version']:
return
buttons = [
{"name": _("Finish"), "response": Gtk.ResponseType.CANCEL}
]
scroll = Gtk.ScrolledWindow()
scroll.set_property("overlay-scrolling", False)
scroll.set_hexpand(True)
scroll.set_vexpand(True)
scroll.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
self.labels['update_progress'] = Gtk.Label("%s %s..." % (_("Starting update for"), program))
self.labels['update_progress'].set_halign(Gtk.Align.START)
self.labels['update_progress'].set_valign(Gtk.Align.START)
scroll.add(self.labels['update_progress'])
self.labels['update_scroll'] = scroll
dialog = self._gtk.Dialog(self._screen, buttons, scroll, self.finish_updating)
dialog.set_response_sensitive(Gtk.ResponseType.CANCEL, False)
self.update_prog = program
self.update_dialog = dialog
if program in ['klipper', 'moonraker', 'system']:
logging.info("Sending machine.update.%s" % program)
self._screen._ws.send_method("machine.update.%s" % program)
else:
logging.info("Sending machine.update.client name: %s" % program)
self._screen._ws.send_method("machine.update.client", {"name": program})
self._screen.set_updating(True)
def update_program_info(self, p):
_ = self.lang.gettext
logging.info("Updating program: %s " % p)
if 'version_info' not in self.update_status or p not in self.update_status['version_info']:
return
info = self.update_status['version_info'][p]
logging.info("%s: %s" % (p, info))
if p != "system":
version = (info['full_version_string'] if "full_version_string" in info else info['version'])
if info['configured_type'] == 'git_repo':
if info['is_valid'] and not info['is_dirty']:
if info['version'] == info['remote_version']:
self.labels[p].set_markup("<b>%s</b>\n%s" % (p, version))
self.labels["%s_status" % p].set_label(_("Up To Date"))
self.labels["%s_status" % p].get_style_context().remove_class('update')
self.labels["%s_status" % p].get_style_context().remove_class('invalid')
self.labels["%s_status" % p].set_sensitive(False)
else:
self.labels[p].set_markup("<b>%s</b>\n%s -> %s" % (p, version, info['remote_version']))
self.labels["%s_status" % p].set_label(_("Update"))
self.labels["%s_status" % p].get_style_context().add_class('update')
self.labels["%s_status" % p].set_sensitive(True)
else:
self.labels[p].set_markup("<b>%s</b>\n%s" % (p, version))
self.labels["%s_status" % p].set_label(_("Invalid"))
self.labels["%s_status" % p].get_style_context().add_class('invalid')
self.labels["%s_status" % p].set_sensitive(True)
else:
if info['version'] == info['remote_version']:
self.labels[p].set_markup("<b>%s</b>\n%s" % (p, version))
self.labels["%s_status" % p].set_label(_("Up To Date"))
self.labels["%s_status" % p].get_style_context().remove_class('update')
self.labels["%s_status" % p].set_sensitive(False)
else:
self.labels[p].set_markup("<b>%s</b>\n%s -> %s" % (p, version, info['remote_version']))
self.labels["%s_status" % p].set_label(_("Update"))
self.labels["%s_status" % p].get_style_context().add_class('update')
self.labels["%s_status" % p].set_sensitive(True)
else:
self.labels[p].set_markup("<b>System</b>")
if info['package_count'] == 0:
self.labels["%s_status" % p].set_label(_("Up To Date"))
self.labels["%s_status" % p].get_style_context().remove_class('update')
self.labels["%s_status" % p].set_sensitive(False)
else:
self.labels["%s_status" % p].set_label(_("Update"))
self.labels["%s_status" % p].get_style_context().add_class('update')
self.labels["%s_status" % p].set_sensitive(True)
def restart_klippy(self, widget, type=None):
if type == "firmware":
self._screen._ws.klippy.restart_firmware()
else:
self._screen._ws.klippy.restart()
def restart_ks(self, widget):
os.system("sudo systemctl restart KlipperScreen")
+73 -117
View File
@@ -7,15 +7,14 @@ from gi.repository import Gtk, Gdk, GLib
from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
logger = logging.getLogger("KlipperScreen.TemperaturePanel")
from ks_includes.widgets.keypad import Keypad
def create_panel(*args):
return TemperaturePanel(*args)
class TemperaturePanel(ScreenPanel):
active_heater = "extruder"
tempdeltas = ["1","5","10","25"]
tempdeltas = ["1", "5", "10", "25"]
tempdelta = "10"
def initialize(self, panel_name):
@@ -23,44 +22,55 @@ class TemperaturePanel(ScreenPanel):
grid = self._gtk.HomogeneousGrid()
eq_grid = self._gtk.HomogeneousGrid()
eq_grid = Gtk.Grid()
eq_grid.set_hexpand(True)
eq_grid.set_vexpand(True)
self.heaters = []
i = 0
for x in self._printer.get_tools():
if i > 3:
break
elif i == 0:
primary_tool = x
tools = self._printer.get_tools()
for x in tools:
self.labels[x] = self._gtk.ToggleButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0))
self.labels[x].connect('clicked', self.select_heater, x)
if i == 0:
self.labels[x].set_active(True)
eq_grid.attach(self.labels[x], i%2, i/2, 1, 1)
self.heaters.append(x)
i += 1
print ("Primary tool: " + primary_tool)
self.labels[primary_tool].get_style_context().add_class('button_active')
if len(tools) > 0:
self.labels[tools[0]].get_style_context().add_class('button_active')
if self._printer.has_heated_bed():
self.labels["heater_bed"] = self._gtk.ToggleButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
width = 2 if i > 1 else 1
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
add_heaters = self._printer.get_heaters()
for h in add_heaters:
if h == "heater_bed":
self.labels[h] = self._gtk.ButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
else:
name = " ".join(h.split(" ")[1:])
self.labels[h] = self._gtk.ButtonImage("heat-up", name)
self.heaters.append(h)
i = 0
cols = 3 if len(self.heaters) > 4 else (1 if len(self.heaters) <= 2 else 2)
for h in self.heaters:
if not (h.startswith("temperature_sensor")):
self.labels[h].connect('clicked', self.select_heater, h)
eq_grid.attach(self.labels[h], i % cols, int(i/cols), 1, 1)
i += 1
self.labels["control_grid"] = self._gtk.HomogeneousGrid()
self.labels["increase"] = self._gtk.ButtonImage("increase", _("Increase"), "color1")
self.labels["increase"].connect("clicked",self.change_target_temp, "+")
self.labels["increase"].connect("clicked", self.change_target_temp_incremental, "+")
self.labels["decrease"] = self._gtk.ButtonImage("decrease", _("Decrease"), "color3")
self.labels["decrease"].connect("clicked",self.change_target_temp, "-")
self.labels["npad"] = self._gtk.ButtonImage("settings", _("Number Pad"), "color2")
self.labels["decrease"].connect("clicked", self.change_target_temp_incremental, "-")
self.labels["npad"] = self._gtk.ButtonImage("hashtag", _("Number Pad"), "color2")
self.labels["npad"].connect("clicked", self.show_numpad)
tempgrid = Gtk.Grid()
j = 0;
j = 0
for i in self.tempdeltas:
self.labels['deg'+ i] = self._gtk.ToggleButton(i)
self.labels['deg'+ i].connect("clicked", self.change_temp_delta, i)
ctx = self.labels['deg'+ i].get_style_context()
self.labels['deg' + i] = self._gtk.ToggleButton(i)
self.labels['deg' + i].connect("clicked", self.change_temp_delta, i)
ctx = self.labels['deg' + i].get_style_context()
if j == 0:
ctx.add_class("tempbutton_top")
elif j == len(self.tempdeltas)-1:
@@ -69,7 +79,7 @@ class TemperaturePanel(ScreenPanel):
ctx.add_class("tempbutton")
if i == "10":
ctx.add_class("distbutton_active")
tempgrid.attach(self.labels['deg'+ i], 0, j, 1, 1)
tempgrid.attach(self.labels['deg' + i], 0, j, 1, 1)
j += 1
self.labels["deg" + self.tempdelta].set_active(True)
@@ -89,9 +99,7 @@ class TemperaturePanel(ScreenPanel):
self.grid = grid
self.content.add(grid)
self._screen.add_subscription(panel_name)
self.update_temp("heater_bed",35,40)
self.update_temp("heater_bed", 35, 40)
def change_temp_delta(self, widget, tempdelta):
if self.tempdelta == tempdelta:
@@ -112,53 +120,12 @@ class TemperaturePanel(ScreenPanel):
def show_numpad(self, widget):
_ = self.lang.gettext
numpad = self._gtk.HomogeneousGrid()
numpad.set_direction(Gtk.TextDirection.LTR)
keys = [
['1','numpad_tleft'],
['2','numpad_top'],
['3','numpad_tright'],
['4','numpad_left'],
['5','numpad_button'],
['6','numpad_right'],
['7','numpad_left'],
['8','numpad_button'],
['9','numpad_right'],
['B','numpad_bleft'],
['0','numpad_bottom'],
['E','numpad_bright']
]
for i in range(len(keys)):
id = 'button_' + str(keys[i][0])
if keys[i][0] == "B":
self.labels[id] = Gtk.Button("B") #self._gtk.ButtonImage("backspace")
elif keys[i][0] == "E":
self.labels[id] = Gtk.Button("E") #self._gtk.ButtonImage("complete", None, None, .675, .675)
else:
self.labels[id] = Gtk.Button(keys[i][0])
self.labels[id].connect('clicked', self.update_entry, keys[i][0])
ctx=self.labels[id].get_style_context()
ctx.add_class(keys[i][1])
numpad.attach(self.labels[id], i%3, i/3, 1, 1)
self.labels["keypad"] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.labels['entry'] = Gtk.Entry()
self.labels['entry'].props.xalign = 0.5
ctx = self.labels['entry'].get_style_context()
b = self._gtk.ButtonImage('back', _('Close'))
b.connect("clicked", self.hide_numpad)
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
box.add(self.labels['entry'])
box.add(numpad)
box.add(b)
self.labels["keypad"] = numpad
if "keypad" not in self.labels:
self.labels["keypad"] = Keypad(self._screen, self.change_target_temp, self.hide_numpad)
self.labels["keypad"].clear()
self.grid.remove_column(1)
self.grid.attach(box, 1, 0, 1, 1)
self.grid.attach(self.labels["keypad"], 1, 0, 1, 1)
self.grid.show_all()
def hide_numpad(self, widget):
@@ -167,7 +134,7 @@ class TemperaturePanel(ScreenPanel):
self.grid.show_all()
def select_heater (self, widget, heater):
def select_heater(self, widget, heater):
if self.active_heater == heater:
return
@@ -184,19 +151,34 @@ class TemperaturePanel(ScreenPanel):
if action != "notify_status_update":
return
if self._printer.has_heated_bed():
self.update_temp("heater_bed",
self._printer.get_dev_stat("heater_bed","temperature"),
self._printer.get_dev_stat("heater_bed","target")
)
for x in self._printer.get_tools():
self.update_temp(x,
self._printer.get_dev_stat(x,"temperature"),
self._printer.get_dev_stat(x,"target")
self.update_temp(
x,
self._printer.get_dev_stat(x, "temperature"),
self._printer.get_dev_stat(x, "target")
)
for h in self._printer.get_heaters():
self.update_temp(
h,
self._printer.get_dev_stat(h, "temperature"),
self._printer.get_dev_stat(h, "target"),
None if h == "heater_bed" else " ".join(h.split(" ")[1:])
)
return
def change_target_temp(self, widget, dir):
def change_target_temp(self, temp):
if self.active_heater.startswith('heater_generic '):
self._screen._ws.klippy.set_heater_temp(" ".join(self.active_heater.split(" ")[1:]), temp)
elif self.active_heater == "heater_bed":
temp = 0 if temp < 0 or temp > KlippyGcodes.MAX_BED_TEMP else temp
self._screen._ws.klippy.set_bed_temp(temp)
else:
temp = 0 if temp < 0 or temp > KlippyGcodes.MAX_EXT_TEMP else temp
self._screen._ws.klippy.set_tool_temp(self._printer.get_tool_number(self.active_heater), temp)
self._printer.set_dev_stat(self.active_heater, "target", temp)
def change_target_temp_incremental(self, widget, dir):
logging.debug("Dev stats %s: %s" % (self.active_heater, self._printer.get_dev_stats(self.active_heater)))
target = self._printer.get_dev_stat(self.active_heater, "target")
if dir == "+":
target += int(self.tempdelta)
@@ -209,37 +191,11 @@ class TemperaturePanel(ScreenPanel):
self._printer.set_dev_stat(self.active_heater, "target", target)
if self.active_heater == "heater_bed":
self._screen._ws.klippy.gcode_script( KlippyGcodes.set_bed_temp(
target
))
if self.active_heater.startswith("heater_generic "):
self._screen._ws.klippy.set_heater_temp(" ".join(self.active_heater.split(" ")[1:]), target)
elif self.active_heater == "heater_bed":
self._screen._ws.klippy.set_bed_temp(target)
elif self.active_heater.startswith("temperature_fan "):
self._screen._ws.klippy.set_temp_fan_temp(" ".join(self.active_heater.split(" ")[1:]), target)
else:
self._screen._ws.klippy.gcode_script( KlippyGcodes.set_ext_temp(
target,
self._printer.get_tool_number(self.active_heater)
))
def update_entry(self, widget, digit):
text = self.labels['entry'].get_text()
if digit == 'B':
if len(text) < 1:
return
self.labels['entry'].set_text(text[0:-1])
elif digit == 'E':
if self.active_heater == "heater_bed":
temp = int(text)
temp = 0 if temp < 0 or temp > KlippyGcodes.MAX_BED_TEMP else temp
self._screen._ws.klippy.gcode_script(KlippyGcodes.set_bed_temp(temp))
else:
temp = int(text)
temp = 0 if temp < 0 or temp > KlippyGcodes.MAX_EXT_TEMP else temp
self._screen._ws.klippy.gcode_script( KlippyGcodes.set_ext_temp(
temp,
self._printer.get_tool_number(self.active_heater)
))
self._printer.set_dev_stat(self.active_heater, "target", temp)
self.labels['entry'].set_text("")
else:
if len(text) >= 3:
return
self.labels['entry'].set_text(text + digit)
self._screen._ws.klippy.set_tool_temp(self._printer.get_tool_number(self.active_heater), target)
+81 -55
View File
@@ -7,45 +7,53 @@ from ks_includes.KlippyGcodes import KlippyGcodes
from ks_includes.screen_panel import ScreenPanel
import logging
logger = logging.getLogger("KlipperScreen.ZCalibratePanel")
def create_panel(*args):
return ZCalibratePanel(*args)
class ZCalibratePanel(ScreenPanel):
_screen = None
labels = {}
widgets = {}
distance = 1
distances = ['.01','.05','.1','.5','1','5']
distances = ['.01', '.05', '.1', '.5', '1', '5']
def __init__(self, screen, title, back=True):
super().__init__(screen, title, False)
def initialize(self, panel_name):
_ = self.lang.gettext
grid = self._gtk.HomogeneousGrid()
grid = Gtk.Grid()
label = Gtk.Label(_("Z Offset") + ": \n")
self.labels['zposition'] = Gtk.Label(_("Homing"))
box = Gtk.VBox()
box.set_vexpand(False)
box.set_valign(Gtk.Align.CENTER)
self.widgets['zposition'] = Gtk.Label(_("Homing"))
pos = Gtk.VBox()
pos.set_vexpand(False)
pos.set_valign(Gtk.Align.CENTER)
pos.add(label)
pos.add(self.widgets['zposition'])
box.add(label)
box.add(self.labels['zposition'])
self.widgets['zpos'] = self._gtk.ButtonImage('z-farther', _("Raise Nozzle"))
self.widgets['zpos'].connect("clicked", self.move, "+")
self.widgets['zpos'].set_sensitive(False)
self.widgets['zneg'] = self._gtk.ButtonImage('z-closer', _("Lower Nozzle"))
self.widgets['zneg'].connect("clicked", self.move, "-")
self.widgets['zneg'].set_sensitive(False)
self.widgets['start'] = self._gtk.ButtonImage('resume', _("Start"), 'color3')
self.widgets['start'].connect("clicked", self.start_calibration)
zpos = self._gtk.ButtonImage('z-offset-decrease',_("Raise Nozzle"))
zpos.connect("clicked", self.move, "+")
zneg = self._gtk.ButtonImage('z-offset-increase',_("Lower Nozzle"))
zneg.connect("clicked", self.move, "-")
self.widgets['complete'] = self._gtk.ButtonImage('complete', _('Accept'))
self.widgets['complete'].connect("clicked", self.accept)
self.widgets['complete'].set_sensitive(False)
cancel = self._gtk.ButtonImage('cancel', _('Abort'), 'color2')
cancel.connect("clicked", self.abort)
distgrid = Gtk.Grid()
j = 0;
j = 0
for i in self.distances:
self.labels[i] = self._gtk.ToggleButton(i)
self.labels[i].set_direction(Gtk.TextDirection.LTR)
self.labels[i].connect("clicked", self.change_distance, i)
ctx = self.labels[i].get_style_context()
self.widgets[i] = self._gtk.ToggleButton(i)
self.widgets[i].set_direction(Gtk.TextDirection.LTR)
self.widgets[i].connect("clicked", self.change_distance, i)
ctx = self.widgets[i].get_style_context()
if (self._screen.lang_ltr and j == 0) or (not self._screen.lang_ltr and j == len(self.distances)-1):
ctx.add_class("distbutton_top")
elif (not self._screen.lang_ltr and j == 0) or (self._screen.lang_ltr and j == len(self.distances)-1):
@@ -54,40 +62,49 @@ class ZCalibratePanel(ScreenPanel):
ctx.add_class("distbutton")
if i == "1":
ctx.add_class("distbutton_active")
distgrid.attach(self.labels[i], j, 0, 1, 1)
distgrid.attach(self.widgets[i], j, 0, 1, 1)
j += 1
self.labels["1"].set_active(True)
self.widgets["1"].set_active(True)
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 = self._gtk.ButtonImage('complete',_('Accept'),'color2')
complete.connect("clicked", self.accept)
b = self._gtk.ButtonImage('back', _('Abort'))
b.connect("clicked", self.abort)
#grid.set_row_homogeneous(False)
grid.attach(zpos, 0, 0, 1, 1)
grid.attach(box, 1, 0, 2, 2)
grid.attach(zneg, 0, 1, 1, 1)
grid.attach(complete, 3, 0, 1, 1)
grid.attach(space_grid, 0, 2, 3, 1)
grid.attach(b, 3, 2, 1, 1)
distances = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
self.widgets['move_dist'] = Gtk.Label(_("Move Distance (mm)"))
distances.pack_start(self.widgets['move_dist'], True, True, 0)
distances.pack_start(distgrid, True, True, 0)
grid.set_column_homogeneous(True)
grid.attach(self.widgets['zpos'], 0, 0, 1, 1)
grid.attach(self.widgets['start'], 1, 0, 1, 1)
grid.attach(pos, 1, 1, 1, 1)
grid.attach(self.widgets['zneg'], 0, 1, 1, 1)
grid.attach(self.widgets['complete'], 2, 0, 1, 1)
grid.attach(distances, 0, 2, 3, 1)
grid.attach(cancel, 2, 1, 1, 1)
self.content.add(grid)
self._screen.add_subscription(panel_name)
def activate(self):
if self._screen.printer.get_stat("toolhead","homed_axes") != "xyz":
def start_calibration(self, widget):
if self._screen.printer.get_stat("toolhead", "homed_axes") != "xyz":
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
self._screen._ws.klippy.gcode_script(KlippyGcodes.PROBE_CALIBRATE)
if 'z_calibrate_position' in self._config.get_config():
x_position = self._config.get_config()['z_calibrate_position'].getint("calibrate_x_position", 0)
y_position = self._config.get_config()['z_calibrate_position'].getint("calibrate_y_position", 0)
if x_position > 0 and y_position > 0:
self._screen._ws.klippy.gcode_script('G0 X%d Y%d F3000' % (x_position, y_position))
if (self._printer.config_section_exists("probe") or self._printer.config_section_exists("bltouch")):
self._screen._ws.klippy.gcode_script(KlippyGcodes.PROBE_CALIBRATE)
else:
self._screen._ws.klippy.gcode_script(KlippyGcodes.Z_ENDSTOP_CALIBRATE)
self.widgets['start'].get_style_context().remove_class('color3')
self.widgets['zpos'].set_sensitive(True)
self.widgets['zpos'].get_style_context().add_class('color4')
self.widgets['zneg'].set_sensitive(True)
self.widgets['zneg'].get_style_context().add_class('color1')
self.widgets['complete'].set_sensitive(True)
self.widgets['complete'].get_style_context().add_class('color3')
def process_update(self, action, data):
if action != "notify_status_update":
@@ -97,34 +114,43 @@ class ZCalibratePanel(ScreenPanel):
self.updatePosition(data['toolhead']['position'])
def updatePosition(self, position):
self.labels['zposition'].set_text(str(round(position[2],2)))
self.widgets['zposition'].set_text(str(round(position[2], 2)))
def change_distance(self, widget, distance):
if self.distance == distance:
return
ctx = self.labels[str(self.distance)].get_style_context()
ctx = self.widgets[str(self.distance)].get_style_context()
ctx.remove_class("distbutton_active")
self.distance = distance
ctx = self.labels[self.distance].get_style_context()
ctx = self.widgets[self.distance].get_style_context()
ctx.add_class("distbutton_active")
for i in self.distances:
if i == self.distance:
continue
self.labels[str(i)].set_active(False)
self.widgets[str(i)].set_active(False)
def move(self, widget, dir):
dist = str(self.distance) if dir == "+" else "-" + str(self.distance)
logger.info("# Moving %s", KlippyGcodes.probe_move(dist))
self._screen._ws.klippy.gcode_script(KlippyGcodes.probe_move(dist))
logging.info("# Moving %s", KlippyGcodes.testz_move(dist))
self._screen._ws.klippy.gcode_script(KlippyGcodes.testz_move(dist))
def abort(self, widget):
logger.info("Aborting Z calibrate")
self._screen._ws.klippy.gcode_script(KlippyGcodes.PROBE_ABORT)
logging.info("Aborting Z calibrate")
self._screen._ws.klippy.gcode_script(KlippyGcodes.ABORT)
self.widgets['start'].get_style_context().add_class('color3')
self.widgets['zpos'].set_sensitive(False)
self.widgets['zpos'].get_style_context().remove_class('color4')
self.widgets['zneg'].set_sensitive(False)
self.widgets['zneg'].get_style_context().remove_class('color1')
self.widgets['complete'].set_sensitive(False)
self.widgets['complete'].get_style_context().remove_class('color3')
self.menu_return(widget)
def accept(self, widget):
logger.info("Accepting Z calibrate")
self._screen._ws.klippy.gcode_script(KlippyGcodes.PROBE_ACCEPT)
logging.info("Accepting Z calibrate")
self._screen._ws.klippy.gcode_script(KlippyGcodes.ACCEPT)
self.menu_return(widget)
+537 -219
View File
File diff suppressed because it is too large. Load diff
+69 -23
View File
@@ -4,39 +4,82 @@ SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
KSPATH=$(sed 's/\/scripts//g' <<< $SCRIPTPATH)
KSENV="${HOME}/.KlipperScreen-env"
PKGLIST="xserver-xorg-video-fbturbo xdotool xinit xinput x11-xserver-utils libopenjp2-7 python3-distutils"
PKGLIST="${PKGLIST} python3-virtualenv virtualenv matchbox-keyboard wireless-tools"
PKGLIST="${PKGLIST} libatlas-base-dev fonts-freefont-ttf"
PKGLIST="${PKGLIST} libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0"
Red='\033[0;31m'
Green='\033[0;32m'
Cyan='\033[0;36m'
Normal='\033[0m'
echo_text ()
{
printf "${Normal}$1${Cyan}\n"
}
echo_error ()
{
printf "${Red}$1${Normal}\n"
}
echo_ok ()
{
printf "${Green}$1${Normal}\n"
}
install_packages()
{
echo "Update package data"
sudo apt update
echo_text "Update package data"
sudo apt-get update
echo "Installing package dependencies"
sudo apt install -y \
xserver-xorg-video-fbturbo \
xinit \
xinput \
x11-xserver-utils \
python3-distutils \
python3-gi \
python3-gi-cairo \
python3-virtualenv \
gir1.2-gtk-3.0 \
virtualenv \
matchbox-keyboard
echo_text "Checking for broken packages..."
output=$(dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' | grep -E ^.[^nci])
if [ $? -eq 0 ]; then
echo_text "Detectected broken pacakges. Attempting to fix"
sudo apt-get -f install
output=$(dpkg-query -W -f='${db:Status-Abbrev} ${binary:Package}\n' | grep -E ^.[^nci])
if [ $? -eq 0 ]; then
echo_error "Unable to fix broken packages. These must be fixed before KlipperScreen can be installed"
exit 1
fi
else
echo_ok "No broken packages"
fi
echo_text "Installing KlipperScreen dependencies"
sudo apt-get install -y $PKGLIST
}
create_virtualenv()
{
echo "Creating virtual environment"
echo_text "Creating virtual environment"
[ ! -d ${KSENV} ] && virtualenv -p /usr/bin/python3 ${KSENV}
${KSENV}/bin/pip install -r ${KSPATH}/scripts/KlipperScreen-requirements.txt
${KSENV}/bin/pip install --no-binary ":all" "vext.gi==0.7.4"
${KSENV}/bin/vext -e
source ${KSENV}/bin/activate
pip install -U pip
while read requirements; do
pip install $requirements
if [ $? -gt 0 ]; then
echo "Error: pip install exited with status code $?"
echo "Unable to install dependencies, aborting install."
deactivate
exit
fi
done < ${KSPATH}/scripts/KlipperScreen-requirements.txt
vext -e
deactivate
echo_ok "Virtual enviroment created"
}
install_systemd_service()
{
echo "Installing KlipperScreen unit file"
if [ -f "/etc/systemd/system/KlipperScreen.service" ]; then
echo_text "KlipperScreen unit file already installed"
return
fi
echo_text "Installing KlipperScreen unit file"
SERVICE=$(<$SCRIPTPATH/KlipperScreen.service)
KSPATH_ESC=$(sed "s/\//\\\\\//g" <<< $KSPATH)
@@ -60,15 +103,17 @@ update_x11()
{
if [ -e /etc/X11/Xwrapper.conf ]
then
echo "Updating X11 Xwrapper"
echo_text "Updating X11 Xwrapper"
sudo sed -i 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config
else
echo "Adding X11 Xwrapper"
echo_text "Adding X11 Xwrapper"
echo 'allowed_users=anybody' | sudo tee /etc/X11/Xwrapper.config
fi
}
start_KlipperScreen() {
start_KlipperScreen()
{
echo_text "Starting service..."
sudo systemctl start KlipperScreen
}
@@ -77,4 +122,5 @@ create_virtualenv
modify_user
install_systemd_service
update_x11
echo_ok "KlipperScreen was installed"
start_KlipperScreen
+8 -5
View File
@@ -1,5 +1,8 @@
requests==2.25.1
vext==0.7.4
websocket-client==0.57.0
humanize==3.2.0
jinja2==2.11.2
humanize==3.13.1
jinja2==3.0.3
matplotlib==3.5.0
netifaces==0.11.0
requests==2.26.0
websocket-client==1.2.1
pycairo==1.20.1
PyGObject==3.42.0
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
pycodestyle --ignore=E226,E301,E302,E303,E402,W503,W504 --max-line-length=120 --max-doc-length=120 screen.py ks_includes panels
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
IMGDIR=$SCRIPTPATH/../docs/img
for file in $IMGDIR/*
do
res=$(identify $file | cut -d ' ' -f 3)
if [ "$res" != "1532x898" ]; then
echo "Converting $file"
convert $file -crop 1532x898+2+48 $file
fi
done
-10
View File
@@ -1,10 +0,0 @@
#!/bin/bash
screen=${1:-0}
# wait for the display manager service to start and attach to screen
sleep 15
/usr/bin/xset -display :$screen s off # deactivate screen saver
/usr/bin/xset -display :$screen -dpms # disable DPMS
/usr/bin/xset -display :$screen s noblank # disable screen blanking
-47
View File
@@ -1,47 +0,0 @@
#
import re
import base64
dir = "/home/pi/sdcard/"
file = "square_tower_0.2mm_PLA_ENDER3_46m.gcode"
#f = f.open(file, 'r')
thumbnails = []
cur_thumbnail = {}
state = 0
with open(dir + file, 'r') as f:
for line in f:
if state == 0:
match = re.match(r'^; thumbnail begin ([0-9]+)x([0-9]+) ([0-9]+)', line)
if match:
cur_thumbnail = {
"width": match.group(1),
"height": match.group(2),
"size": match.group(3),
"data": ""
}
state = 1
continue
elif state == 1:
if re.match (r'^; thumbnail end', line):
state = 0
thumbnails.append(cur_thumbnail)
continue
match = re.match(r'^; (\S+)$', line)
if match:
cur_thumbnail['data'] += match.group(1)
if len(thumbnails) > 0:
biggest = 0
for i in range(len(thumbnails)):
if i == 0:
continue
if thumbnails[i]['width'] > thumbnails[biggest]['width']:
biggest = i
image = base64.decodestring(thumbnails[biggest]['data'])
name = file.split('.gcod')[0] + ".png"
f = open(dir + name, 'wb')
f.write(image)
f.close()
+178
View File
@@ -0,0 +1,178 @@
#!/bin/bash
# KlipperScreen sudo fix. Modified from moonraker-sudo
# moonraker-sudo (mnrkrsudo)
# Provides a specified Group that is intended to elevate user privileges
# to help moonraker with sudo actions, if in CustomPIOS Images with
# Module "password-for-sudo".
#
# Partially used functions from Arcsine
#
# Copyright (C) 2020 Stephan Wendel <me@stephanwe.de>
#
# This file may be distributed under the terms of the GNU GPLv3 license
### Exit on Errors
set -e
### Configuration
SUDOERS_DIR='/etc/sudoers.d'
SUDOERS_FILE='021-sudo-for-klipperscreen'
NEW_GROUP='klipperscreensudo'
### Functions
verify_ready()
{
if [ "$EUID" -eq 0 ]; then
echo "This script must not run as root"
exit -1
fi
}
create_sudoers_file()
{
SCRIPT_TEMP_PATH=/tmp
report_status "Creating ${SUDOERS_FILE} ..."
sudo rm -f $SCRIPT_TEMP_PATH/$SUDOERS_FILE
sudo sed "s/GROUPNAME/$NEW_GROUP/g" > $SCRIPT_TEMP_PATH/$SUDOERS_FILE << '#EOF'
### Elevate moonraker API rights
### Do NOT allow Command Parts only Full Commands
### for example
###
### /sbin/systemctl "reboot", /sbin/apt "update", .....
Cmnd_Alias IWLIST = /sbin/iwlist wlan[0-9] scan
Cmnd_Alias IWCONFIG = /sbin/iwconfig wlan[0-9]
Cmnd_Alias SYSTEMCTL_KS_RESTART = /bin/systemctl restart KlipperScreen
%GROUPNAME ALL=(ALL) NOPASSWD: IWCONFGI, IWLIST, SYSTEMCTL_KS_RESTART
#EOF
report_status "\e[1;32m...done\e[0m"
}
update_env()
{
report_status "Export System Variable: DEBIAN_FRONTEND=noninteractive"
sudo /bin/sh -c 'echo "DEBIAN_FRONTEND=noninteractive" >> /etc/environment'
}
verify_syntax()
{
report_status "\e[1;33mVerifying Syntax of ${SUDOERS_FILE}\e[0m\n"
if [ $(LANG=C visudo -cf $SCRIPT_TEMP_PATH/$SUDOERS_FILE | grep -c "OK" ) -eq 1 ];
then
VERIFY_STATUS=0
report_status "\e[1;32m$(LANG=C visudo -cf $SCRIPT_TEMP_PATH/$SUDOERS_FILE)\e[0m"
else
report_status "\e[1;31mSyntax Error:\e[0m Check File: $SCRIPT_TEMP_PATH/$SUDOERS_FILE"
exit 1
fi
}
install_sudoers_file()
{
verify_syntax
if [ $VERIFY_STATUS -eq 0 ];
then
report_status "Copying $SCRIPT_TEMP_PATH/$SUDOERS_FILE to $SUDOERS_DIR/$SUDOERS_FILE"
sudo chmod 0440 $SCRIPT_TEMP_PATH/$SUDOERS_FILE
sudo cp --preserve=mode $SCRIPT_TEMP_PATH/$SUDOERS_FILE $SUDOERS_DIR/$SUDOERS_FILE
else
exit 1
fi
}
check_update_sudoers_file()
{
if [ -e "$SUDOERS_DIR/$SUDOERS_FILE" ];
then
create_sudoers_file
if [ -z $(sudo diff $SCRIPT_TEMP_PATH/$SUDOERS_FILE $SUDOERS_DIR/$SUDOERS_FILE) ]
then
report_status "No need to update $SUDOERS_DIR/$SUDOERS_FILE"
else
report_status "$SUDOERS_DIR/$SUDOERS_FILE needs to be updated."
install_sudoers_file
fi
fi
}
add_new_group()
{
sudo addgroup --system $NEW_GROUP &> /dev/null
report_status "\e[1;32m...done\e[0m"
}
add_user_to_group()
{
sudo usermod -aG $NEW_GROUP $USER &> /dev/null
report_status "\e[1;32m...done\e[0m"
}
adduser_hint()
{
report_status "\e[1;31mYou have to REBOOT to take changes effect!\e[0m"
}
# Helper functions
report_status()
{
echo -e "\n\n###### $1"
}
clean_temp()
{
sudo rm -f $SCRIPT_TEMP_PATH/$SUDOERS_FILE
}
### Main
verify_ready
if [ -e "$SUDOERS_DIR/$SUDOERS_FILE" ] && [ $(sudo cat /etc/gshadow | grep -c "${NEW_GROUP}") -eq 1 ] && [ $(groups | grep -c "$NEW_GROUP") -eq 1 ];
then
check_update_sudoers_file
report_status "\e[1;32mEverything is setup, nothing to do...\e[0m\n"
exit 0
else
if [ -e "$SUDOERS_DIR/$SUDOERS_FILE" ];
then
report_status "\e[1;32mFile exists:\e[0m ${SUDOERS_FILE}"
check_update_sudoers_file
else
report_status "\e[1;31mFile not found:\e[0m ${SUDOERS_FILE}\n"
create_sudoers_file
install_sudoers_file
fi
if [ $(sudo cat /etc/gshadow | grep -c "${NEW_GROUP}") -eq 1 ];
then
report_status "Group ${NEW_GROUP} already exists..."
else
report_status "Group ${NEW_GROUP} will be added..."
add_new_group
fi
if [ $(groups | grep -c "$NEW_GROUP") -eq 1 ];
then
report_status "User ${USER} is already in $NEW_GROUP..."
else
report_status "Adding User ${USER} to Group $NEW_GROUP..."
add_user_to_group
adduser_hint
fi
fi
update_env
clean_temp
exit 0
+3 -3
View File
@@ -1,11 +1,11 @@
xgettext --keyword=_ --language=Python --add-comments --sort-output \
xgettext --keyword=_ --language=Python --no-location --sort-output \
-o ks_includes/locales/KlipperScreen.pot \
*.py \
ks_includes/*.py \
panels/*.py \
ks_includes/KlipperScreen.conf
ks_includes/defaults.conf
langs=(de_DE en fr_FR he_IL ru_RU zh_CN)
langs=(de_DE en es fr_FR he_IL it ru_RU zh_CN)
for lang in ${langs[@]}; do
msgmerge ks_includes/locales/$lang/LC_MESSAGES/KlipperScreen.po \
ks_includes/locales/KlipperScreen.pot \
+20
View File
@@ -0,0 +1,20 @@
{
"graph_colors": {
"extruder": {
"colors": ["FF5252", "FF7252", "FF9252", "FFB252", "FFD252"],
"state": 0
},
"bed": {
"colors": ["1FB0FF"],
"state": 0
},
"fan": {
"colors": ["3DC25A", "58FC7C", "10EB40", "7EF297"],
"state": 0
},
"sensor": {
"colors": ["D67600", "830EE3", "B366F2", "E06573", "E38819"],
"state": 0
}
}
}
+463
View File
@@ -0,0 +1,463 @@
* {
color: white;
font-size: KS_FONT_SIZEpx;
-GtkComboBox-appears-as-list: 0;
text-shadow: none;
box-shadow: none;
}
window {
background-color: #13181C;
-gtk-icon-shadow: none;
}
button {
background-image: none;
background-color: #13181C;
margin: .25em;
padding: 0 .5em;
border-radius: 0;
border: 0;
-gtk-icon-shadow: none;
}
button:active {
background-color: #304C62;
}
.button_active {
background-color: #20303D;
}
button.color1 {
border-bottom: .4em solid #ED6500;
margin: .3em;
}
button.color2 {
border-bottom: .4em solid #B10080;
margin: .3em;
}
button.color3 {
border-bottom: .4em solid #009384;
margin: .3em;
}
button.color4 {
border-bottom: .4em solid #A7E100;
margin: .3em;
}
button.active {
background-color: #20303D;
}
button.file-list {
margin: 0;
}
button.update {
background: #009384;
border: .4em solid #009384;
border-radius: 0.4em;
font-weight: bold;
}
button.invalid {
background: #e61e1e;
border: .4em solid #e61e1e;
border-radius: 0.4em;
font-weight: bold;
}
combobox box button {
border: .05em solid #cccccc;
padding: .5em 1em;
}
combobox arrow {
min-width: 1em;
}
switch slider {
border: 0;
}
entry {
font-size: 1em;
background-color: #20292F;
border: 1em solid #13181C;
padding: .25em;
}
frame {
color: white;
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;
}
trough {
min-height: 2em;
background-color: #404E57;
color: white;
border: 1px solid black;
}
trough highlight, trough progress {
min-height: 2em;
background-color: #3584e4;
color: white;
border: 1px solid black;
}
trough progress.left {
border: 0px;
}
scale mark {
margin-top: 1em;
color: white;
}
scale trough slider {
min-height: 2em;
min-width: 2em;
}
scrollbar, scrollbar button, scrollbar trough {
border: none;
background-color: #13181C;
}
scrollbar slider {
min-width: 1.5em;
border-radius: .7em;
background-color: #404E57;
}
textview, textview text {
background: transparent;
font-family: Free Mono;
}
textview .time {
color: grey;
}
trough {
margin: .5em 1em;
}
.popup {
background-color: black;
}
.action_bar {
/*border-right: 2px solid #444;*/
}
.active_device {
background-color: #20303D;
}
.dialog {
border: .1em solid black;
padding: 2.5em;
background-color: black;
margin: 1em;
}
.dialog button {
padding: 1.5em;
border-bottom: .4em solid #009384;
margin-top: 1em;
}
.dialog button:nth-child(1) {
border-bottom-color: green;
}
.dialog button:nth-child(2) {
border-bottom-color: red;
}
.distbutton_active {
background-color: #20303D;
}
.distbutton_top {
border: .15em solid white;
border-right: 0;
border-top-left-radius: .75em;
border-bottom-left-radius: .75em;
margin-right: 0;
}
.distbutton {
border: .15em solid white;
border-left: .15em solid #ccc;
border-right: 0;
margin-left: 0;
margin-right: 0;
}
.distbutton_bottom {
border: .15em solid white;
border-left: .15em solid #ccc;
border-top-right-radius: .7em;
border-bottom-right-radius: .7em;
margin-left: 0;
}
.extruder-0 {
color: #ff0000;
}
.extruder-1 {
color: #00ff00;
}
.extruder-2 {
color: #0000ff;
}
.fan_slider {
margin: 0 1em 0 1em;
color: white;
}
.frame-item {
min-height: 4.5em;
padding: .2em .3em;
}
.heatergraph {
min-height: 350px;
}
.heater-grid {
margin-right: .5em;
}
.heater-grid label {
margin-top: .3em;
margin-bottom: .3em;
}
.message_popup {
border-bottom: .1em solid white;
}
.message_popup_echo, .message_popup_echo button {
background-color: #367554;
}
.message_popup_error, .message_popup_error button {
background-color: #9e2f3a;
}
.numpad_tleft {
border: .15em solid white;
border-bottom: 0;
border-right: 0;
border-top-left-radius: .7em;
margin: .15em 0 0 .15em;
}
.numpad_top {
border: .15em solid white;
border-bottom: 0;
border-right: 0;
margin: .15em 0 0 0;
}
.numpad_tright {
border: .15em solid white;
border-bottom: 0;
border-top-right-radius: .7em;
margin: .15em .15em 0 0;
}
.numpad_left {
border: .15em solid white;
border-right: 0;
border-bottom: 0;
margin: 0 0 0 .15em;
}
.numpad_button {
border: .15em solid white;
border-right: 0;
border-bottom: 0;
margin: 0;
}
.numpad_right {
border: .15em solid white;
border-bottom: 0;
margin: 0 .15em 0 0;
}
.numpad_bleft {
border: .15em solid white;
border-right: 0;
border-bottom-left-radius: .7em;
margin: 0 0 .15em .15em;
}
.numpad_bottom {
border: .15em solid white;
border-right: 0;
margin: 0 0 .15em 0;
}
.numpad_bright {
border: .15em solid white;
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: .25em;
}
.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: white;
}
.printing-status-label {
padding-top: .25em;
padding-bottom: .15em;
color: #ccc;
font-size: 1.25em;
}
.tempbutton_top {
border: .15em solid white;
border-bottom: 0;
border-top-left-radius: .75em;
border-top-right-radius: .75em;
margin-bottom: 0;
}
.tempbutton {
border: .15em solid white;
border-top: .15em solid #ccc;
border-bottom: 0;
margin-top: 0;
margin-bottom: 0;
}
.tempbutton_bottom {
border: .15em solid white;
border-top: .15em solid #ccc;
border-bottom-left-radius: .7em;
border-bottom-right-radius: .7em;
margin-top: 0;
}
.updater-item {
min-height: 3em;
padding: .2em;
}
.message {
border: .1em solid #981E1F;
font-size: 1em;
padding: 2.5em;
color: white;
background-color: #981E1F;
}
.message button {
background-color: white;
color: black;
padding: 2em 2.5em 2em 2.5em;
}
.notification {
background-clip: padding-box;
padding: .25em;
border-radius: 0 0 .25em .25em;
opacity: 0.8;
}
.system-program-grid {
padding: 0.25em;
padding-right: .5em;
padding-bottom: 0;
}
.warning {
background-color: rgba(30, 204, 39, 0.7);
}
.error {
background-color: rgba(204, 30, 30, 0.7);
}
popover {
background-color: #222;
}
popover button {
background-color: #222;
}
/* Hardcoded values until creation of dynamic CSS updates */
.graph_label_hidden {padding-left: .9em;} /* .4em on top of normal button padding */
.graph_label_extruder {border-left-width: .4em; border-left-style: solid;}
.graph_label_extruder2 {border-left-width: .4em; border-left-style: solid;}
.graph_label_heater_bed {border-left-width: .4em; border-left-style: solid;}
.graph_label_fan_1 {border-left-width: .4em; border-left-style: solid;}
.graph_label_fan_2 {border-left-width: .4em; border-left-style: solid;}
.graph_label_fan_3 {border-left-width: .4em; border-left-style: solid;}
.graph_label_fan_4 {border-left-width: .4em; border-left-style: solid;}
.graph_label_sensor_1 {border-left-width: .4em; border-left-style: solid;}
.graph_label_sensor_2 {border-left-width: .4em; border-left-style: solid;}
.graph_label_sensor_3 {border-left-width: .4em; border-left-style: solid;}
.graph_label_sensor_4 {border-left-width: .4em; border-left-style: solid;}
.graph_label_sensor_5 {border-left-width: .4em; border-left-style: solid;}
Loaded 100 of 488 files, more files were not shown because too many files have changed in this diff. Show more