Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca8abecb55 | ||
|
|
934acd0ad0 | ||
|
|
71abc27ad8 | ||
|
|
642fe8a52e | ||
|
|
b2b3127183 | ||
|
|
d11e9ec3a6 | ||
|
|
3fee1ff947 | ||
|
|
0bdb5ac457 | ||
|
|
3a60277392 | ||
|
|
0b8751836c | ||
|
|
e227f22aba | ||
|
|
b57cbc8352 | ||
|
|
7b593b704c | ||
|
|
3c2bdee22a | ||
|
|
c08a293f83 | ||
|
|
9d89311bcc | ||
|
|
63764ee32e | ||
|
|
c58b040be2 | ||
|
|
389eceaf06 | ||
|
|
9aa4389eaf | ||
|
|
931d15b6cc | ||
|
|
3abbe921b2 | ||
|
|
e2a0f86f45 | ||
|
|
263b07ae94 | ||
|
|
f223332cd8 | ||
|
|
1c2519be41 | ||
|
|
9016b67c6f | ||
|
|
37c043b3f9 | ||
|
|
717e4ee902 | ||
|
|
cb90a0bd70 | ||
|
|
6a6161dfef | ||
|
|
1973002b3d | ||
|
|
51714180ac | ||
|
|
246c15494c | ||
|
|
5c1d5a1825 | ||
|
|
136ecf79fb | ||
|
|
3fe1665e0b | ||
|
|
c3f96418ea | ||
|
|
bcbbc03151 | ||
|
|
51da7cecc8 | ||
|
|
07554250ad | ||
|
|
9f4204b898 | ||
|
|
5682eb5616 | ||
|
|
47d08f5385 | ||
|
|
ecc4c5ac4c | ||
|
|
f343f03b96 | ||
|
|
36c9b42970 | ||
|
|
5408aec036 | ||
|
|
7471cd39b9 | ||
|
|
238badb110 | ||
|
|
ea465b0f4d | ||
|
|
fb0a0557c5 | ||
|
|
e6b71d5478 | ||
|
|
a18eb42399 | ||
|
|
9047f58c60 | ||
|
|
1c384144c4 | ||
|
|
348a9e3e42 | ||
|
|
4736ed4d84 | ||
|
|
0907c6a06a | ||
|
|
cf3a924bb2 | ||
|
|
d61db5fb17 | ||
|
|
3ad44d9ecf | ||
|
|
cb39b469b0 | ||
|
|
5ad29f0183 | ||
|
|
a2f178c7e0 | ||
|
|
7efb0fddf0 | ||
|
|
46410f797a | ||
|
|
c7496973ee | ||
|
|
2d29eef255 | ||
|
|
3e11fad1fd | ||
|
|
a724836378 | ||
|
|
25b89cb7e9 | ||
|
|
b37ba531f7 | ||
|
|
58b6325776 | ||
|
|
5cfed7f477 | ||
|
|
369fc24e16 | ||
|
|
a099151693 | ||
|
|
c182cc21f2 | ||
|
|
16f7d4543a | ||
|
|
3a4c556f25 | ||
|
|
67e04248c3 | ||
|
|
08a7057668 | ||
|
|
6d71022dbf | ||
|
|
972c869e62 | ||
|
|
c36aa4b430 | ||
|
|
90950101d8 | ||
|
|
67d61d164c |
No files matched your search
@@ -1,5 +1,5 @@
|
||||
# KlipperScreen
|
||||
KlipperScreen is an idea based from [OctoScreen](https://github.com/Z-Bolt/OctoScreen/), but instead of needing OctoPrint or to compile go, KlipperScreen is python based and interacts directly with Moonraker, Klipper's API service, so that it can be run with no dependencies besides Klipper.
|
||||
KlipperScreen is an idea based from [OctoScreen](https://github.com/Z-Bolt/OctoScreen/), but instead of needing OctoPrint or to compile go, KlipperScreen is python based and interacts directly with [Moonraker](https://github.com/arksine/moonraker), Klipper's API service.
|
||||
|
||||
Current feature list:
|
||||
- [x] Homing
|
||||
@@ -13,20 +13,33 @@ Current feature list:
|
||||
- [x] Print tuning (Z Babystepping, Speed Control, Flow Control)
|
||||
- [x] Manual bed leveling assist
|
||||
- [x] Using thumbnails from prusa on job status page
|
||||
- [x] Scale UI based off of resolution
|
||||
- [ ] Better system panel
|
||||
- [ ] Wifi selection
|
||||
- [ ] Scale UI based off of resolution
|
||||
|
||||
|
||||
More details to come...
|
||||
[Changelog](docs/changelog.md)
|
||||
|
||||
### Required Hardware
|
||||
KlipperScreen should run on any HDMI touchscreen that you can connect to a computer. The required video driver may
|
||||
be slightly different depending on what model you get. I am developing on a 1024x600 resolution screen. Due to this,
|
||||
other resolutions may not be scaled properly at this moment. UI scaling is a future development item.
|
||||
KlipperScreen should run on any touchscreen that you can connect to a computer. The required video driver may be
|
||||
slightly different depending on what model you get. KlipperScreen will scale to the resolution of the screen being used.
|
||||
However, three resolutions are tested during development: 1024x600, 800x480, 480x320.
|
||||
|
||||
There are no recommended screens, but there are several screens that work with KlipperScreen. They include screens that
|
||||
use HDMI/USB, Raspberry Pi GPIO, or the Rapsberry Pi DSI (ribbon cable) port.
|
||||
|
||||
### Links
|
||||
|
||||
[Installation](docs/Installation.md)
|
||||
|
||||
[Configuration](docs/Configuration.md)
|
||||
|
||||
[Panels](docs/panels.md)
|
||||
|
||||
|
||||
### Sample Panels
|
||||
|
||||
Main Menu
|
||||

|
||||
|
||||
Job Status
|
||||

|
||||
@@ -1,7 +1,35 @@
|
||||
# Configuration
|
||||
|
||||
In the KlipperScreen folder, a file _KlipperScreen.conf_ allows for configuration of the screen. This document will
|
||||
detail how to configure KlipperScreen. A default config is included here: [ks_includes/KlipperScreen.conf](../ks_includes/KlipperScreen.conf)
|
||||
KlipperScreen has some configuration options which are outlined below. KlipperScreen will search for a configuration
|
||||
file in the following order:
|
||||
_${HOME}/KlipperScreen.conf_
|
||||
_${KlipperScreen_Directory}/KlipperScreen.conf_
|
||||
|
||||
If one of those files are found, it will be used over the default configuration. The default configuration will be
|
||||
merged with the custom configuration, so if you do not define any menus the default menus will be used.The default
|
||||
config is included here: [ks_includes/KlipperScreen.conf](../ks_includes/KlipperScreen.conf)
|
||||
|
||||
## Main Options
|
||||
```
|
||||
[main]
|
||||
# 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
|
||||
|
||||
# Invert axis in move panel. Default is False. Change to true to invert
|
||||
invert_x: False
|
||||
invert_y: False
|
||||
invert_z: False
|
||||
|
||||
# Time (seconds) before the Job Status page reverts to main menu after a successful job
|
||||
job_complete_timeout: 30
|
||||
|
||||
# Time (seconds) before the Job Status page reverts to main menu after a successful job.
|
||||
# If this option is 0, the user must click on a button to go back to the main menu.
|
||||
job_error_timeout: 0
|
||||
```
|
||||
|
||||
|
||||
## Preheat Options
|
||||
@@ -40,6 +68,11 @@ Available panels are listed here: [docs/panels.md](panels.md)
|
||||
|
||||
Certain variables are available for conditional testing of the enable statement:
|
||||
```
|
||||
printer.bltouch # Available if bltouch section defined in config
|
||||
printer.gcode_macros.count # Number of gcode macros
|
||||
printer.idle_timeout # Idle timeout section
|
||||
printer.pause_resume # Pause resume section of Klipper
|
||||
printer.probe # Available if probe section defined in config
|
||||
printer.power_devices.count # Number of power devices configured in Moonraker
|
||||
```
|
||||
|
||||
|
||||
@@ -38,3 +38,6 @@ python virtual environment at ${HOME}/.KlipperScreen-env and install a systemd
|
||||
service file.
|
||||
|
||||
As an option to do development or interact with KlipperScreen from your computer, you may install tigervnc-scraping-server and VNC to your pi instance. Follow tigervnc server setup procedures for details on how to do that.
|
||||
|
||||
If you need a custom location for the configuration file, you can add -c or --configfile to the systemd file and specify
|
||||
the location of your configuration file.
|
||||
@@ -0,0 +1,19 @@
|
||||
## Create Translations
|
||||
|
||||
You can use a editor such as [poedit](https://poedit.net/) to assist in translations. This guide will assume that you
|
||||
will be using poedit.
|
||||
|
||||
This guide will refer to `language designation`. This can be found from running `echo $LANG` on your pi, as long as you
|
||||
have set your pi up for your preferred language.
|
||||
|
||||
#### New Language
|
||||
|
||||
* Select `Create a new translation` or `File -> New from POT/PO` and select `ks_includes/locals/KlipperScreen.pot`.
|
||||
* Enter your language designation.
|
||||
* Create the translations
|
||||
* Save the file as `ks_includes/locales/{LANGUAGE DESIGNATION}/KlipperScreen.po`.
|
||||
* Select `File -> Compile to MO`. Save this file as `ks_includes/locales/{LANGUAGE DESIGNATION}/KlipperScreen.mo`
|
||||
|
||||
Once you have followed those steps, as long as your pi is set up for your preferred language, KlipperScreen will
|
||||
automatically use the translations provided in the file. KlipperScreen currently does not detect RTL languages, but
|
||||
support for RTL is planned in the near future.
|
||||
@@ -1,8 +1,52 @@
|
||||
## Changelog
|
||||
|
||||
#### 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 retreived 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.
|
||||
|
||||
|
After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 273 KiB |
@@ -7,6 +7,7 @@
|
||||
* [extrude](#extrude)
|
||||
* [fan](#fan)
|
||||
* [fine_tune](#finetune)
|
||||
* [gcode_macros](#gcode-macros)
|
||||
* [move](#move)
|
||||
* [network](#network)
|
||||
* [preheat](#preheat)
|
||||
@@ -26,6 +27,19 @@
|
||||
type: bed_level
|
||||

|
||||
|
||||
The bed level panel has the ability to have preset locations from Klipper. Please see documentation on the following
|
||||
Klipper Sections:
|
||||
* [bed_screws](https://github.com/KevinOConnor/klipper/blob/master/docs/Config_Reference.md#bed_screws)
|
||||
* [screws_tilt_adjust](https://github.com/KevinOConnor/klipper/blob/master/docs/Config_Reference.md#screws_tilt_adjust)
|
||||
|
||||
_Important Note: Due to Klipper using the bltouch/probe offsets in screws_tilt_adjust, if a bltouch/probe is enabled_
|
||||
_KlipperScreen will add the offset to the defined screw values. This will not occur if bed_screws section is used._
|
||||
|
||||
This panel will favor screws_tilt_adjust over the bed_screws section. If screws_tilt_adjust is defined, an extra button
|
||||
for _Screws Calibrate_ will appear. This button runs the SCREWS_TILT_CALCULATE command and shows the results on the
|
||||
panel.
|
||||
|
||||
|
||||
### Extrude
|
||||
type: extrude
|
||||

|
||||
@@ -38,6 +52,10 @@ type: fan
|
||||
type: fine_tune
|
||||

|
||||
|
||||
### Gcode Macros
|
||||
type: gcode_macros
|
||||

|
||||
|
||||
### Menu
|
||||
type: menu
|
||||

|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
[main]
|
||||
moonraker_host: 127.0.0.1
|
||||
moonraker_port: 7125
|
||||
|
||||
[preheat PLA]
|
||||
bed = 40
|
||||
extruder = 195
|
||||
@@ -7,142 +11,170 @@ bed = 90
|
||||
extruder = 220
|
||||
|
||||
[menu __main]
|
||||
name: {{ gettext('Main Menu') }}
|
||||
|
||||
[menu __main homing]
|
||||
name: Homing
|
||||
name: {{ gettext('Homing') }}
|
||||
icon: home
|
||||
|
||||
[menu __main preheat]
|
||||
name: Preheat
|
||||
name: {{ gettext('Preheat') }}
|
||||
icon: heat-up
|
||||
panel: preheat
|
||||
|
||||
[menu __main actions]
|
||||
name: Actions
|
||||
name: {{ gettext('Actions') }}
|
||||
icon: actions
|
||||
|
||||
[menu __main config]
|
||||
name: Configuration
|
||||
name: {{ gettext('Configuration') }}
|
||||
icon: control
|
||||
|
||||
[menu __main print]
|
||||
name: Print
|
||||
name: {{ gettext('Print') }}
|
||||
icon: print
|
||||
panel: print
|
||||
|
||||
[menu __main homing homeall]
|
||||
name: Home All
|
||||
name: {{ gettext('Home All') }}
|
||||
icon: home
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28"}
|
||||
|
||||
[menu __main homing homex]
|
||||
name: Home X
|
||||
icon: home
|
||||
name: {{ gettext('Home X') }}
|
||||
icon: home-x
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 X"}
|
||||
|
||||
[menu __main homing homey]
|
||||
name: Home Y
|
||||
icon: home
|
||||
name: {{ gettext('Home Y') }}
|
||||
icon: home-y
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 Y"}
|
||||
|
||||
[menu __main homing homez]
|
||||
name: Home Z
|
||||
icon: home
|
||||
name: {{ gettext('Home Z') }}
|
||||
icon: home-z
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 Z"}
|
||||
|
||||
[menu __main homing homexy]
|
||||
name: Home XY
|
||||
name: {{ gettext('Home XY') }}
|
||||
icon: home
|
||||
method: printer.gcode.script
|
||||
params: {"script":"G28 X Y"}
|
||||
|
||||
[menu __main actions move]
|
||||
name: Move
|
||||
icon: heat-up
|
||||
name: {{ gettext('Move') }}
|
||||
icon: move
|
||||
panel: move
|
||||
|
||||
[menu __main actions extrude]
|
||||
name: Extrude
|
||||
name: {{ gettext('Extrude') }}
|
||||
icon: filament
|
||||
panel: extrude
|
||||
|
||||
[menu __main actions fan]
|
||||
name: Fan
|
||||
name: {{ gettext('Fan') }}
|
||||
icon: fan
|
||||
panel: fan
|
||||
|
||||
[menu __main actions temperature]
|
||||
name: Temperature
|
||||
name: {{ gettext('Temperature') }}
|
||||
icon: heat-up
|
||||
panel: temperature
|
||||
|
||||
[menu __main actions macros]
|
||||
name: {{ gettext('Macros') }}
|
||||
icon: custom-script
|
||||
panel: gcode_macros
|
||||
enable: {{ printer.gcode_macros.count > 0 }}
|
||||
|
||||
[menu __main actions power]
|
||||
name: Power
|
||||
name: {{ gettext('Power') }}
|
||||
icon: shutdown
|
||||
panel: power
|
||||
enable: {{ printer.power_devices.count > 0 }}
|
||||
|
||||
[menu __main actions disablemotors]
|
||||
name: Disable Motors
|
||||
name: {{ gettext('Disable Motors') }}
|
||||
icon: motor-off
|
||||
method: printer.gcode.script
|
||||
params: {"script":"M18"}
|
||||
|
||||
[menu __main config bedlevel]
|
||||
name: Bed Level
|
||||
name: {{ gettext('Bed Level') }}
|
||||
icon: bed-level
|
||||
panel: bed_level
|
||||
|
||||
[menu __main config bedmesh]
|
||||
name: {{ gettext('Bed Mesh') }}
|
||||
icon: bed-level
|
||||
panel: bed_mesh
|
||||
enable: {{ printer.bed_mesh is defined }}
|
||||
|
||||
[menu __main config zoffset]
|
||||
name: Z Calibrate
|
||||
name: {{ gettext('Z Calibrate') }}
|
||||
icon: z-offset-increase
|
||||
panel: zcalibrate
|
||||
enable: {{ ((printer.bltouch is defined) or (printer.probe is defined)) }}
|
||||
|
||||
[menu __main config network]
|
||||
name: Network
|
||||
name: {{ gettext('Network') }}
|
||||
icon: network
|
||||
panel: network
|
||||
|
||||
[menu __main config system]
|
||||
name: System
|
||||
name: {{ gettext('System') }}
|
||||
icon: info
|
||||
panel: system
|
||||
|
||||
[menu __main config save]
|
||||
name: Save Config
|
||||
name: {{ gettext('Save Config') }}
|
||||
icon: complete
|
||||
method: printer.gcode.script
|
||||
params: {"script":"SAVE_CONFIG"}
|
||||
confirm:
|
||||
Save configuration.
|
||||
{{ gettext('Save configuration.') }}
|
||||
|
||||
Klipper will reboot
|
||||
{{ gettext('Klipper will reboot') }}
|
||||
|
||||
[menu __main config settings]
|
||||
name: {{ gettext('Settings') }}
|
||||
icon: settings
|
||||
panel: settings
|
||||
|
||||
[menu __print]
|
||||
name: {{ gettext('Print Control') }}
|
||||
|
||||
[menu __print temperature]
|
||||
name: Temperature
|
||||
name: {{ gettext('Temperature') }}
|
||||
icon: heat-up
|
||||
panel: temperature
|
||||
|
||||
[menu __print tuning]
|
||||
name: Fine Tuning
|
||||
name: {{ gettext('Fine Tuning') }}
|
||||
icon: fan
|
||||
panel: fine_tune
|
||||
|
||||
[menu __print fan]
|
||||
name: {{ gettext('Fan') }}
|
||||
icon: fan
|
||||
panel: fan
|
||||
|
||||
[menu __print extrude]
|
||||
name: {{ gettext('Extrude') }}
|
||||
icon: filament
|
||||
panel: extrude
|
||||
enable: {{ printer.pause_resume.is_paused == True }}
|
||||
|
||||
[menu __print network]
|
||||
name: Network
|
||||
name: {{ gettext('Network') }}
|
||||
icon: network
|
||||
panel: network
|
||||
|
||||
[menu __print system]
|
||||
name: System
|
||||
name: {{ gettext('System') }}
|
||||
icon: info
|
||||
panel: system
|
||||
|
||||
[menu __print extrude]
|
||||
name: Extrude
|
||||
icon: filament
|
||||
panel: extrude
|
||||
@@ -34,16 +34,16 @@ class KlippyGcodes:
|
||||
|
||||
@staticmethod
|
||||
def set_bed_temp(temp):
|
||||
return KlippyGcodes.SET_BED_TEMP + " S" + str(temp)
|
||||
return "%s S%s" % (KlippyGcodes.SET_BED_TEMP, str(temp))
|
||||
|
||||
@staticmethod
|
||||
def set_ext_temp(temp, tool=0):
|
||||
return KlippyGcodes.SET_EXT_TEMP + " T" + str(tool) + " S" + str(temp)
|
||||
return "%s T%s S%s" % (KlippyGcodes.SET_EXT_TEMP, str(tool), str(temp))
|
||||
|
||||
@staticmethod
|
||||
def set_fan_speed(speed):
|
||||
speed = str( int(float(int(speed) % 101)/100*255) )
|
||||
return KlippyGcodes.SET_FAN_SPEED + " S"+ speed
|
||||
return "%s S%s" % (KlippyGcodes.SET_FAN_SPEED, speed)
|
||||
|
||||
@staticmethod
|
||||
def set_extrusion_rate(rate):
|
||||
@@ -59,4 +59,12 @@ class KlippyGcodes:
|
||||
|
||||
@staticmethod
|
||||
def extrude(dist, speed=500):
|
||||
return KlippyGcodes.MOVE + " E" + dist + " F" + speed
|
||||
return "%s E%s F%s" % (KlippyGcodes.MOVE, dist, speed)
|
||||
|
||||
@staticmethod
|
||||
def bed_mesh_load(profile):
|
||||
return "BED_MESH_PROFILE LOAD=%s" % profile
|
||||
|
||||
@staticmethod
|
||||
def bed_mesh_save(profile):
|
||||
return "BED_MESH_PROFILE SAVE=%s" % profile
|
||||
@@ -1,30 +1,61 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GdkPixbuf, GLib
|
||||
import os
|
||||
klipperscreendir = os.getcwd()
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.KlippyGtk")
|
||||
|
||||
class KlippyGtk:
|
||||
labels = {}
|
||||
font_ratio = 51
|
||||
width_ratio = 16
|
||||
height_ratio = 9.375
|
||||
|
||||
@staticmethod
|
||||
def Label(label, style):
|
||||
def __init__(self, width, height):
|
||||
self.width = width
|
||||
self.height = height
|
||||
|
||||
self.font_size = int(round(self.width / self.font_ratio))
|
||||
self.header_size = int(round((self.width / self.width_ratio) / 1.33))
|
||||
self.img_width = int(round(self.width / self.width_ratio))
|
||||
self.img_height = int(round(self.height / self.height_ratio))
|
||||
self.header_image_scale_width = .625
|
||||
self.header_image_scale_height = .625
|
||||
|
||||
logger.debug("img width: %s height: %s" % (self.img_width, self.img_height))
|
||||
|
||||
def get_header_size(self):
|
||||
return self.header_size
|
||||
|
||||
def get_header_image_scale(self):
|
||||
return [self.header_image_scale_width, self.header_image_scale_height]
|
||||
|
||||
def get_image_width(self):
|
||||
return self.img_width
|
||||
|
||||
def get_image_height(self):
|
||||
return self.img_height
|
||||
|
||||
def get_font_size(self):
|
||||
return self.font_size
|
||||
|
||||
def Label(self, label, style):
|
||||
l = Gtk.Label(label)
|
||||
if style != False:
|
||||
l.get_style_context().add_class(style)
|
||||
return l
|
||||
|
||||
@staticmethod
|
||||
def ImageLabel(image_name, text, size=20, style=False):
|
||||
def ImageLabel(self, image_name, text, size=20, style=False, width_scale=.32, height_scale=.32):
|
||||
box1 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=15)
|
||||
image = Gtk.Image()
|
||||
#TODO: update file reference
|
||||
image.set_from_file(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg")
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
|
||||
"%s/styles/z-bolt/images/%s.svg" % (klipperscreendir, str(image_name)),
|
||||
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
|
||||
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg", 20, 20, True)
|
||||
image.set_from_pixbuf(pixbuf)
|
||||
image = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_text(text)
|
||||
@@ -37,35 +68,26 @@ class KlippyGtk:
|
||||
|
||||
return {"l": label, "b": box1}
|
||||
|
||||
@staticmethod
|
||||
def Image(image_name, style=False, width=None, height=None):
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg")
|
||||
|
||||
if height != None and width != None:
|
||||
pixbuf = pixbuf.scale_simple(width, height, GdkPixbuf.InterpType.BILINEAR)
|
||||
def Image(self, image_name, style=False, width_scale=1, height_scale=1):
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
|
||||
"%s/styles/z-bolt/images/%s" % (klipperscreendir, str(image_name)),
|
||||
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
|
||||
|
||||
return Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
@staticmethod
|
||||
def ImageFromFile(filename, style=False, width=None, height=None):
|
||||
if height != -1 or width != -1:
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, width, height, True)
|
||||
else:
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file(filename)
|
||||
def ImageFromFile(self, filename, style=False, width_scale=1, height_scale=1):
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename,
|
||||
int(round(self.img_width * width_scale)), int(round(self.img_height * height_scale)), True)
|
||||
|
||||
return Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
@staticmethod
|
||||
def PixbufFromFile(filename, style=False, width=None, height=None):
|
||||
if height != -1 or width != -1:
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, width, height, True)
|
||||
else:
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file(filename)
|
||||
def PixbufFromFile(self, filename, style=False, width_scale=1, height_scale=1):
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(filename, int(round(self.img_width * width_scale)),
|
||||
int(round(self.img_height * height_scale)), True)
|
||||
|
||||
return pixbuf
|
||||
|
||||
@staticmethod
|
||||
def ProgressBar(style=False):
|
||||
def ProgressBar(self, style=False):
|
||||
bar = Gtk.ProgressBar()
|
||||
|
||||
if style != False:
|
||||
@@ -74,8 +96,7 @@ class KlippyGtk:
|
||||
|
||||
return bar
|
||||
|
||||
@staticmethod
|
||||
def Button(label=None, style=None):
|
||||
def Button(self, label=None, style=None):
|
||||
b = Gtk.Button(label=label)
|
||||
b.set_hexpand(True)
|
||||
b.set_vexpand(True)
|
||||
@@ -87,13 +108,14 @@ class KlippyGtk:
|
||||
|
||||
return b
|
||||
|
||||
@staticmethod
|
||||
def ButtonImage(image_name, label=None, style=None, height=None, width=None):
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg")
|
||||
|
||||
if height != None and width != None:
|
||||
pixbuf = pixbuf.scale_simple(width, height, GdkPixbuf.InterpType.BILINEAR)
|
||||
|
||||
def ButtonImage(self, image_name, label=None, style=None, width_scale=1, height_scale=1):
|
||||
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)
|
||||
|
||||
@@ -111,8 +133,7 @@ class KlippyGtk:
|
||||
|
||||
return b
|
||||
|
||||
@staticmethod
|
||||
def Dialog(screen, buttons, content, callback=None, *args):
|
||||
def Dialog(self, screen, buttons, content, callback=None, *args):
|
||||
dialog = Gtk.Dialog()
|
||||
dialog.set_default_size(screen.width - 15, screen.height - 15)
|
||||
dialog.set_resizable(False)
|
||||
@@ -144,9 +165,16 @@ class KlippyGtk:
|
||||
return dialog, grid
|
||||
|
||||
|
||||
@staticmethod
|
||||
def ToggleButtonImage(image_name, label, style=False):
|
||||
img = Gtk.Image.new_from_file(klipperscreendir + "/styles/z-bolt/images/" + str(image_name) + ".svg")
|
||||
def ToggleButtonImage(self, image_name, label, style=False, width_scale=1, height_scale=1):
|
||||
filename = "%s/styles/z-bolt/images/%s.svg" % (klipperscreendir, str(image_name))
|
||||
pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale(
|
||||
filename,
|
||||
int(round(self.img_width * width_scale)),
|
||||
int(round(self.img_height * height_scale)),
|
||||
True
|
||||
)
|
||||
|
||||
img = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
|
||||
b = Gtk.ToggleButton(label=label)
|
||||
#b.props.relief = Gtk.RELIEF_NONE
|
||||
@@ -164,23 +192,22 @@ class KlippyGtk:
|
||||
|
||||
return b
|
||||
|
||||
@staticmethod
|
||||
def HomogeneousGrid():
|
||||
def HomogeneousGrid(self, width=None, height=None):
|
||||
g = Gtk.Grid()
|
||||
g.set_row_homogeneous(True)
|
||||
g.set_column_homogeneous(True)
|
||||
if width != None and height != None:
|
||||
g.set_size_request(width, height)
|
||||
return g
|
||||
|
||||
@staticmethod
|
||||
def ToggleButton(text):
|
||||
def ToggleButton(self, text):
|
||||
b = Gtk.ToggleButton(text)
|
||||
b.props.relief = Gtk.ReliefStyle.NONE
|
||||
b.set_hexpand(True)
|
||||
b.set_vexpand(True)
|
||||
return b
|
||||
|
||||
@staticmethod
|
||||
def formatFileName(name):
|
||||
def formatFileName(self, name):
|
||||
name = name.split('/')[-1] if "/" in name else name
|
||||
name = name.split('.gcod')[0] if ".gcode" in name else name
|
||||
if len(name) > 25:
|
||||
@@ -188,8 +215,7 @@ class KlippyGtk:
|
||||
return name
|
||||
|
||||
|
||||
@staticmethod
|
||||
def formatTimeString(seconds):
|
||||
def formatTimeString(self, seconds):
|
||||
time = int(seconds)
|
||||
text = ""
|
||||
if int(time/3600) !=0:
|
||||
@@ -197,8 +223,7 @@ class KlippyGtk:
|
||||
text += str(int(time/60)%60)+"m "+str(time%60)+"s"
|
||||
return text
|
||||
|
||||
@staticmethod
|
||||
def formatTemperatureString(temp, target):
|
||||
def formatTemperatureString(self, temp, target):
|
||||
if (target > temp-2 and target < temp+2) or round(target,0) == 0:
|
||||
return str(round(temp,2)) + "°C" #°C →"
|
||||
return str(round(temp)) + " → " + str(round(target)) + "°C"
|
||||
@@ -5,20 +5,28 @@ import logging
|
||||
logger = logging.getLogger("KlipperScreen.KlippyRest")
|
||||
|
||||
class KlippyRest:
|
||||
def __init__(self, ip, port=7125):
|
||||
def __init__(self, ip, port=7125, api_key=False):
|
||||
self.ip = ip
|
||||
self.port = port
|
||||
self.api_key = api_key
|
||||
|
||||
def get_server_info(self):
|
||||
return self.send_request("server/info")
|
||||
|
||||
def get_oneshot_token(self):
|
||||
r = self.send_request("access/oneshot_token")
|
||||
if r == False:
|
||||
return False
|
||||
return r['result']
|
||||
|
||||
def get_printer_info(self):
|
||||
return self.send_request("printer/info")
|
||||
|
||||
def send_request(self, method):
|
||||
url = "http://%s:%s/%s" % (self.ip, self.port, method)
|
||||
logger.debug("Sending request to %s" % url)
|
||||
r = requests.get(url)
|
||||
headers = {} if self.api_key == False else {"x-api-key":self.api_key}
|
||||
r = requests.get(url, headers=headers)
|
||||
if r.status_code != 200:
|
||||
return False
|
||||
|
||||
|
||||
@@ -38,26 +38,27 @@ class KlippyWebsocket(threading.Thread):
|
||||
callback_table = {}
|
||||
timeout = None
|
||||
|
||||
def __init__(self, screen, callback):
|
||||
def __init__(self, screen, callback, host, port):
|
||||
threading.Thread.__init__(self)
|
||||
self._screen = screen
|
||||
self._callback = callback
|
||||
self.klippy = MoonrakerApi(self)
|
||||
|
||||
self._url = "127.0.0.1:7125"
|
||||
self._url = "%s:%s" % (host, port)
|
||||
|
||||
def initial_connect(self):
|
||||
# Enable a timeout so that way if moonraker is not running, it will attempt to reconnect
|
||||
if self.timeout == None:
|
||||
self.timeout = GLib.timeout_add(500, self.reconnect)
|
||||
|
||||
def connect (self):
|
||||
#r = requests.get(
|
||||
# "http://%s%s" % (self._url, api['oneshot_token']['url']),
|
||||
# headers={"x-api-key":api_key}
|
||||
#)
|
||||
#if r.status_code != 200:
|
||||
# logger.info("Failed to retrieve oneshot token")
|
||||
# return
|
||||
try:
|
||||
token = self._screen.apiclient.get_oneshot_token()
|
||||
except:
|
||||
logger.debug("Unable to get oneshot token")
|
||||
return False
|
||||
|
||||
#token = json.loads(r.content)['result']
|
||||
#self.ws_url = "ws://%s/websocket?token=%s" % (self._url, token)
|
||||
self.ws_url = "ws://%s/websocket" % (self._url)
|
||||
self.ws_url = "ws://%s/websocket?token=%s" % (self._url, token)
|
||||
self.ws = websocket.WebSocketApp(self.ws_url,
|
||||
on_message = lambda ws,msg: self.on_message(ws, msg),
|
||||
on_error = lambda ws,msg: self.on_error(ws, msg),
|
||||
@@ -155,7 +156,16 @@ class KlippyWebsocket(threading.Thread):
|
||||
|
||||
|
||||
def on_error(self, ws, error):
|
||||
print(error)
|
||||
logger.debug("Websocket error: %s" % error)
|
||||
if error.status_code == 401:
|
||||
# Check for any pending reconnects and remove. No amount of trying will help
|
||||
if self.timeout != None:
|
||||
GLib.source_remove(self.timeout)
|
||||
Gdk.threads_add_idle(
|
||||
GLib.PRIORITY_HIGH_IDLE,
|
||||
self._callback['on_close'],
|
||||
"Unable to authenticate with moonraker.\nCheck the API key"
|
||||
)
|
||||
|
||||
class MoonrakerApi:
|
||||
def __init__ (self, ws):
|
||||
|
||||
@@ -2,6 +2,7 @@ import configparser
|
||||
import os
|
||||
import logging
|
||||
import json
|
||||
import re
|
||||
|
||||
from io import StringIO
|
||||
|
||||
@@ -14,39 +15,93 @@ class ConfigError(Exception):
|
||||
|
||||
class KlipperScreenConfig:
|
||||
config = None
|
||||
configfile_name = "KlipperScreen.conf"
|
||||
do_not_edit_line = "#~# --- Do not edit below this line. This section is auto generated --- #~#"
|
||||
do_not_edit_prefix = "#~#"
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, configfile, lang=None):
|
||||
_ = lang.gettext
|
||||
|
||||
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"}}
|
||||
]
|
||||
|
||||
self.default_config_path = "%s/ks_includes/%s" % (os.getcwd(), self.configfile_name)
|
||||
self.config = configparser.ConfigParser()
|
||||
self.config_path = self.get_config_file_location()
|
||||
self.config_path = self.get_config_file_location(configfile)
|
||||
logger.debug("Config path location: %s" % self.config_path)
|
||||
self.defined_config = None
|
||||
|
||||
try:
|
||||
self.config.read(self.config_path)
|
||||
self.config.read(self.default_config_path)
|
||||
if self.config_path != self.default_config_path:
|
||||
user_def, saved_def = self.separate_saved_config(self.config_path)
|
||||
self.defined_config = configparser.ConfigParser()
|
||||
self.defined_config.read_string(user_def)
|
||||
self.log_config(self.defined_config)
|
||||
self.config.read_string(user_def)
|
||||
if saved_def != None:
|
||||
self.config.read_string(saved_def)
|
||||
except KeyError:
|
||||
raise ConfigError(f"Error reading config: {self.config_path}")
|
||||
|
||||
self.log_config(self.config)
|
||||
|
||||
self.get_menu_items("__main")
|
||||
for item in self.configurable_options:
|
||||
name = list(item)[0]
|
||||
vals = item[name]
|
||||
if vals['section'] not in self.config.sections():
|
||||
self.config.add_section(vals['section'])
|
||||
if name not in list(self.config[vals['section']]):
|
||||
self.config.set(vals['section'], name, vals['value'])
|
||||
#self.build_main_menu(self.config)
|
||||
|
||||
def separate_saved_config(self, config_path):
|
||||
user_def = []
|
||||
saved_def = None
|
||||
found_saved = False
|
||||
if not path.exists(config_path):
|
||||
return [None, None]
|
||||
with open(config_path) as file:
|
||||
for line in file:
|
||||
line = line.replace('\n','')
|
||||
if line == self.do_not_edit_line:
|
||||
found_saved = True
|
||||
saved_def = []
|
||||
continue
|
||||
if found_saved == False:
|
||||
user_def.append(line.replace('\n',''))
|
||||
else:
|
||||
if line.startswith(self.do_not_edit_prefix):
|
||||
saved_def.append(line[(len(self.do_not_edit_prefix)+1):])
|
||||
return ["\n".join(user_def), None if saved_def == None else "\n".join(saved_def)]
|
||||
|
||||
def get_config_file_location(self):
|
||||
conf_name = "KlipperScreen.conf"
|
||||
|
||||
file = "%s/%s" % (os.getenv("HOME"), conf_name)
|
||||
def get_config_file_location(self, file):
|
||||
if not path.exists(file):
|
||||
file = "%s/%s" % (os.getcwd(), conf_name)
|
||||
file = "%s/%s" % (os.getcwd(), self.configfile_name)
|
||||
if not path.exists(file):
|
||||
file = "%s/ks_includes/%s" % (os.getcwd(), conf_name)
|
||||
file = self.default_config_path
|
||||
|
||||
logger.info("Found configuration file at: %s" % file)
|
||||
return file
|
||||
|
||||
def get_config(self):
|
||||
return self.config
|
||||
|
||||
def get_configurable_options(self):
|
||||
return self.configurable_options
|
||||
|
||||
def get_main_config(self):
|
||||
return self.config['main']
|
||||
|
||||
def get_main_config_option(self, option, default=None):
|
||||
return self.config['main'].get(option, default)
|
||||
|
||||
def get_menu_items(self, menu="__main", subsection=""):
|
||||
if subsection != "":
|
||||
subsection = subsection + " "
|
||||
index = "menu %s %s" % (menu, subsection)
|
||||
logger.debug("Getting menu items for: %s" % index)
|
||||
items = [i[len(index):] for i in self.config.sections() if i.startswith(index)]
|
||||
menu_items = []
|
||||
for item in items:
|
||||
@@ -56,10 +111,16 @@ class KlipperScreenConfig:
|
||||
|
||||
return menu_items
|
||||
|
||||
def get_menu_name(self, menu="__main", subsection=""):
|
||||
name = ("menu %s %s" % (menu, subsection)) if subsection != "" else ("menu %s" % menu)
|
||||
if name not in self.config:
|
||||
return False
|
||||
return self.config[name].get('name')
|
||||
|
||||
|
||||
def get_preheat_options(self):
|
||||
index = "preheat "
|
||||
items = [i[len(index):] for i in self.config.sections() if i.startswith(index)]
|
||||
logger.debug("Items: %s" % items)
|
||||
|
||||
preheat_options = {}
|
||||
for item in items:
|
||||
@@ -70,12 +131,73 @@ class KlipperScreenConfig:
|
||||
def get_printer_power_name(self):
|
||||
return self.config['settings'].get("printer_power_name", "printer")
|
||||
|
||||
def get_user_saved_config(self):
|
||||
if self.config_path != self.default_config_path:
|
||||
print("Get")
|
||||
|
||||
def save_user_config_options(self):
|
||||
save_config = configparser.ConfigParser()
|
||||
for item in self.configurable_options:
|
||||
name = list(item)[0]
|
||||
opt = item[name]
|
||||
curval = self.config[opt['section']].get(name)
|
||||
if curval != opt["value"] or (
|
||||
self.defined_config != None and opt['section'] in self.defined_config.sections() and
|
||||
self.defined_config[opt['section']].get(name,None) not in (None, curval)):
|
||||
if opt['section'] not in save_config.sections():
|
||||
save_config.add_section(opt['section'])
|
||||
save_config.set(opt['section'], name, str(curval))
|
||||
|
||||
if "displayed_macros" in self.config.sections():
|
||||
for item in self.config.options('displayed_macros'):
|
||||
value = self.config['displayed_macros'].getboolean(item, fallback=True)
|
||||
if value == False or (self.defined_config != None and
|
||||
"displayed_macros" in self.defined_config.sections() and
|
||||
self.defined_config['displayed_macros'].getboolean(item, fallback=True) == False and
|
||||
self.defined_config['displayed_macros'].getboolean(item, fallback=True) != value):
|
||||
if "displayed_macros" not in save_config.sections():
|
||||
save_config.add_section("displayed_macros")
|
||||
save_config.set("displayed_macros", item, str(value))
|
||||
|
||||
save_output = self._build_config_string(save_config).split("\n")
|
||||
for i in range(len(save_output)):
|
||||
save_output[i] = "%s %s" % (self.do_not_edit_prefix, save_output[i])
|
||||
|
||||
if self.config_path == self.default_config_path:
|
||||
user_def = ""
|
||||
saved_def = None
|
||||
else:
|
||||
user_def, saved_def = self.separate_saved_config(self.config_path)
|
||||
|
||||
extra_lb = "\n" if saved_def != None else ""
|
||||
contents = "%s\n%s%s\n%s\n%s\n%s\n" % (user_def, self.do_not_edit_line, extra_lb,
|
||||
self.do_not_edit_prefix, "\n".join(save_output), self.do_not_edit_prefix)
|
||||
|
||||
if self.config_path != self.default_config_path:
|
||||
path = self.config_path
|
||||
else:
|
||||
path = os.path.expanduser("~/KlipperScreen.conf")
|
||||
|
||||
try:
|
||||
file = open(path, 'w')
|
||||
file.write(contents)
|
||||
file.close()
|
||||
except:
|
||||
logger.error("Error writing configuration file")
|
||||
|
||||
def set(self, section, name, value):
|
||||
self.config.set(section, name, value)
|
||||
|
||||
|
||||
def log_config(self, config):
|
||||
lines = [
|
||||
" "
|
||||
"===== Config File =====",
|
||||
self._build_config_string(config),
|
||||
re.sub(
|
||||
r'(moonraker_api_key\s*=\s*\S+)',
|
||||
'moonraker_api_key = [redacted]',
|
||||
self._build_config_string(config)
|
||||
),
|
||||
"======================="
|
||||
]
|
||||
logger.info("\n".join(lines))
|
||||
@@ -86,8 +208,6 @@ class KlipperScreenConfig:
|
||||
sfile.seek(0)
|
||||
return sfile.read().strip()
|
||||
|
||||
|
||||
|
||||
def _build_menu_item(self, menu, name):
|
||||
if name not in self.config:
|
||||
return False
|
||||
|
||||
@@ -14,14 +14,16 @@ class KlippyFiles:
|
||||
callbacks = []
|
||||
filelist = []
|
||||
files = {}
|
||||
metadata_timeout = {}
|
||||
timeout = None
|
||||
thumbnail_dir = "/tmp/.KS-thumbnails"
|
||||
|
||||
def __init__(self, screen):
|
||||
self._screen = screen
|
||||
self.add_timeout()
|
||||
|
||||
if not os.path.exists('/tmp/.KS-thumbnails'):
|
||||
os.makedirs('/tmp/.KS-thumbnails')
|
||||
if not os.path.exists(self.thumbnail_dir):
|
||||
os.makedirs(self.thumbnail_dir)
|
||||
GLib.idle_add(self.ret_files, False)
|
||||
|
||||
|
||||
@@ -41,12 +43,12 @@ class KlippyFiles:
|
||||
"size": item['size'],
|
||||
"modified": item['modified']
|
||||
}
|
||||
self.update_metadata(item['filename'])
|
||||
self.request_metadata(item['filename'])
|
||||
|
||||
if len(self.callbacks) > 0 and (len(newfiles) > 0 or len(deletedfiles) > 0):
|
||||
logger.debug("Running callbacks...")
|
||||
for cb in self.callbacks:
|
||||
cb(newfiles, deletedfiles)
|
||||
cb(newfiles, deletedfiles, [])
|
||||
|
||||
if len(deletedfiles) > 0:
|
||||
logger.debug("Deleted files: %s", deletedfiles)
|
||||
@@ -54,41 +56,81 @@ class KlippyFiles:
|
||||
self.filelist.remove(file)
|
||||
self.files.pop(file, None)
|
||||
|
||||
#self.get_file_data(item['filename'])
|
||||
#files = [asyncio.create_task(self.get_file_data(file)) for file in self.files]
|
||||
#await asyncio.gather(files)
|
||||
#files = [GLib.idle_add(self.ret_file_data, file) for file in self.files]
|
||||
|
||||
elif method == "server.files.metadata":
|
||||
if "error" in result.keys():
|
||||
logger.debug("Error in getting metadata for %s" %(params['filename']))
|
||||
GLib.timeout_add(2000, self._screen._ws.klippy.get_file_metadata, params['filename'], self._callback)
|
||||
logger.debug("Error in getting metadata for %s. Retrying in 6 seconds" %(params['filename']))
|
||||
return
|
||||
|
||||
logger.debug("Got metadata for %s" % (result['result']['filename']))
|
||||
if params['filename'] in self.metadata_timeout:
|
||||
GLib.source_remove(self.metadata_timeout[params['filename']])
|
||||
del self.metadata_timeout[params['filename']]
|
||||
|
||||
for x in result['result']:
|
||||
self.files[params['filename']][x] = result['result'][x]
|
||||
if "thumbnails" in self.files[params['filename']]:
|
||||
self.files[params['filename']]['thumbnails'].sort(key=lambda x: x['size'], reverse=True)
|
||||
|
||||
for thumbnail in self.files[params['filename']]['thumbnails']:
|
||||
f = open("/tmp/.KS-thumbnails/%s-%s" % (params['filename'], thumbnail['size']), "wb")
|
||||
f = open("%s/%s-%s" % (self.thumbnail_dir, params['filename'].split('/')[-1], thumbnail['size']),
|
||||
"wb")
|
||||
f.write(base64.b64decode(thumbnail['data']))
|
||||
f.close()
|
||||
for cb in self.callbacks:
|
||||
logger.debug("Running metadata callbacks")
|
||||
cb([], [], [params['filename']])
|
||||
|
||||
def add_file_callback(self, callback):
|
||||
self.callbacks.append(callback)
|
||||
try:
|
||||
self.callbacks.append(callback)
|
||||
except:
|
||||
logger.debug("Callback not found: %s" % callback)
|
||||
|
||||
def remove_file_callback(self, callback):
|
||||
if callback in self.callbacks:
|
||||
self.callbacks.pop(self.callbacks.index(callback))
|
||||
|
||||
def add_timeout(self):
|
||||
if self.timeout == None:
|
||||
self.timeout = GLib.timeout_add(4000, self.ret_files)
|
||||
|
||||
def file_exists(self, filename):
|
||||
return True if filename in self.filelist else False
|
||||
|
||||
def file_metadata_exists(self, filename):
|
||||
if not self.file_exists(filename):
|
||||
return False
|
||||
if "slicer" in self.files[filename]:
|
||||
return True
|
||||
return False
|
||||
|
||||
def get_thumbnail_location(self, filename):
|
||||
if not self.has_thumbnail(filename):
|
||||
return None
|
||||
return "%s/%s-%s" % (self.thumbnail_dir, filename.split('/')[-1], self.files[filename]['thumbnails'][0]['size'])
|
||||
|
||||
def has_thumbnail(self, filename):
|
||||
if filename not in self.files:
|
||||
return False
|
||||
return "thumbnails" in self.files[filename] and len(self.files[filename]) > 0
|
||||
|
||||
def remove_timeout(self):
|
||||
if self.timeout != None:
|
||||
self.timeout = None
|
||||
|
||||
def request_metadata(self, filename):
|
||||
if filename not in self.filelist:
|
||||
return False
|
||||
if filename in self.metadata_timeout:
|
||||
GLib.source_remove(self.metadata_timeout[filename])
|
||||
self.metadata_timeout[filename] = GLib.timeout_add(
|
||||
6000, self._screen._ws.klippy.get_file_metadata, filename, self._callback
|
||||
)
|
||||
GLib.idle_add(
|
||||
lambda x, y: False if self._screen._ws.klippy.get_file_metadata(x,y) else False,
|
||||
filename, self._callback
|
||||
)
|
||||
|
||||
def ret_files(self, retval=True):
|
||||
if not self._screen._ws.klippy.get_file_list(self._callback):
|
||||
self.timeout = None
|
||||
@@ -110,6 +152,3 @@ class KlippyFiles:
|
||||
|
||||
def add_file(self, file_name, size, modified, old_file_name = None):
|
||||
print(file_name)
|
||||
|
||||
def update_metadata(self, filename):
|
||||
self._screen._ws.klippy.get_file_metadata(filename, self._callback)
|
||||
@@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2020-11-18 12:37+0000\n"
|
||||
"POT-Creation-Date: 2021-01-07 05:48+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -17,272 +17,419 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: panels/print.py:229
|
||||
#: panels/print.py:197
|
||||
msgid "?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:65
|
||||
#: panels/zcalibrate.py:70
|
||||
msgid "Abort"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:61
|
||||
#: panels/zcalibrate.py:67
|
||||
msgid "Accept"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:229
|
||||
#: ks_includes/KlipperScreen.conf:26
|
||||
msgid "Actions"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:197
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:108
|
||||
#: panels/job_status.py:305
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:89 panels/fan.py:52 panels/fine_tune.py:119
|
||||
#: panels/menu.py:18 panels/move.py:96 panels/network.py:34
|
||||
#: panels/preheat.py:54 panels/temperature.py:78
|
||||
msgid "Back"
|
||||
#: ks_includes/KlipperScreen.conf:107
|
||||
msgid "Bed Level"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:79 panels/print.py:225
|
||||
#: ks_includes/KlipperScreen.conf:112
|
||||
msgid "Bed Mesh"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:455 panels/job_status.py:267 panels/print.py:193
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:42
|
||||
#: panels/fan.py:45
|
||||
msgid "Cancel Change"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:111
|
||||
#: panels/job_status.py:300
|
||||
msgid "Cancel Print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:146
|
||||
#: screen.py:289
|
||||
msgid ""
|
||||
"Check /tmp/KlipperScreen.log for more information.\n"
|
||||
"Please submit an issue on GitHub for help."
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:172 panels/temperature.py:149
|
||||
msgid "Close"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:85
|
||||
#: ks_includes/KlipperScreen.conf:30
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:454
|
||||
msgid "Continue"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:269
|
||||
msgid "Control"
|
||||
msgstr ""
|
||||
|
||||
#: panels/preheat.py:51
|
||||
#: panels/preheat.py:54
|
||||
msgid "Cooldown"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:49
|
||||
#: panels/temperature.py:53
|
||||
msgid "Decrease"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:79
|
||||
#: ks_includes/KlipperScreen.conf:101
|
||||
msgid "Disable Motors"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:101
|
||||
msgid "Disable XY"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:57
|
||||
#: panels/settings.py:32
|
||||
msgid "Displayed Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:63
|
||||
msgid "Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:85 panels/job_status.py:82
|
||||
#: panels/job_status.py:135
|
||||
msgid "Elapsed:"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:271
|
||||
msgid "Emergency Stop"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:32
|
||||
#: panels/extrude.py:45 ks_includes/KlipperScreen.conf:74
|
||||
#: ks_includes/KlipperScreen.conf:167
|
||||
msgid "Extrude"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:66 panels/fine_tune.py:134
|
||||
msgid "Extrusion"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:64
|
||||
#: panels/fine_tune.py:57
|
||||
msgid "Extrusion +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:68
|
||||
#: panels/fine_tune.py:61
|
||||
msgid "Extrusion -"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:46 panels/fine_tune.py:141
|
||||
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:162
|
||||
msgid "Fan"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:44
|
||||
msgid "Fan +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:48
|
||||
msgid "Fan -"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:32
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan Off"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:35
|
||||
#: panels/fan.py:38
|
||||
msgid "Fan On"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:21 panels/extrude.py:25
|
||||
#: panels/extrude.py:30
|
||||
msgid "Fast"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22 panels/splash_screen.py:59
|
||||
#: ks_includes/KlipperScreen.conf:157
|
||||
msgid "Fine Tuning"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:62 panels/system.py:24
|
||||
msgid "Firmware Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:115
|
||||
#: screen.py:284 panels/job_status.py:301
|
||||
msgid "Go Back"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:76 panels/move.py:38
|
||||
#: panels/bed_level.py:98 panels/move.py:40 ks_includes/KlipperScreen.conf:39
|
||||
msgid "Home All"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:25
|
||||
#: ks_includes/KlipperScreen.conf:45
|
||||
msgid "Home X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:63
|
||||
msgid "Home XY"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:51
|
||||
msgid "Home Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:57
|
||||
msgid "Home Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
|
||||
msgid "Homing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:47
|
||||
#: panels/temperature.py:51
|
||||
msgid "Increase"
|
||||
msgstr ""
|
||||
|
||||
#. self._load_panels()
|
||||
#: screen.py:136
|
||||
msgid "Initializing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:20
|
||||
#: ks_includes/config.py:26
|
||||
msgid "Invert X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:27
|
||||
msgid "Invert Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:28
|
||||
msgid "Invert Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22
|
||||
msgid "Klipper Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:43 panels/system.py:42
|
||||
#: panels/system.py:35
|
||||
msgid "Klipper Version"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:384
|
||||
msgid "Klipper has disconnected"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:395
|
||||
msgid ""
|
||||
"Klipper has encountered an error with the micro-controller.\n"
|
||||
"Please recompile and flash."
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:399
|
||||
msgid "Klipper has encountered an error."
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:391
|
||||
msgid ""
|
||||
"Klipper has encountered an error.\n"
|
||||
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:417
|
||||
msgid "Klipper has shutdown"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:413
|
||||
msgid "Klipper is attempting to start"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:141
|
||||
msgid "Klipper will reboot"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:39
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:62
|
||||
#: panels/job_status.py:123
|
||||
msgid "Left:"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:57
|
||||
msgid "Load Average"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:34
|
||||
#: panels/zcalibrate.py:39
|
||||
msgid "Lower Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:20 panels/extrude.py:21 panels/extrude.py:24
|
||||
msgid "Medium"
|
||||
#: ks_includes/KlipperScreen.conf:89
|
||||
msgid "Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:87
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: panels/network.py:28
|
||||
msgid "Network Info"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Number Pad"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:70
|
||||
msgid "Pause"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:224
|
||||
msgid "Print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:154
|
||||
msgid "Print Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:32
|
||||
msgid "Raise Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:57
|
||||
msgid "Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:68
|
||||
msgid "Resume"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:34
|
||||
msgid "Retract"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:39
|
||||
msgid "Set Speed"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:152
|
||||
msgid "Size"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:21 panels/extrude.py:23
|
||||
msgid "Slow"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:56 panels/fine_tune.py:137
|
||||
msgid "Speed"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:54
|
||||
msgid "Speed +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:58
|
||||
msgid "Speed -"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:31 panels/system.py:30
|
||||
msgid "System Information"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:36
|
||||
msgid "Temperature"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:33 panels/job_status.py:34
|
||||
msgid "Time Elapsed"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:35 panels/job_status.py:36
|
||||
msgid "Time Left"
|
||||
#: panels/job_status.py:273 ks_includes/KlipperScreen.conf:14
|
||||
msgid "Main Menu"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Tool 1"
|
||||
msgid "Medium"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:150
|
||||
#: ks_includes/KlipperScreen.conf:69
|
||||
msgid "Move"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:86
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:124 ks_includes/KlipperScreen.conf:173
|
||||
msgid "Network"
|
||||
msgstr ""
|
||||
|
||||
#: panels/network.py:31
|
||||
msgid "Network Info"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:55
|
||||
msgid "Number Pad"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:275
|
||||
msgid "Pause"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:454
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:95
|
||||
msgid "Power"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:59
|
||||
msgid "Power On Printer"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:21
|
||||
msgid "Preheat"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:192 ks_includes/KlipperScreen.conf:34
|
||||
msgid "Print"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:149
|
||||
msgid "Print Control"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:122
|
||||
msgid "Print Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:231
|
||||
msgid "Printing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:37
|
||||
msgid "Raise Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:277 panels/splash_screen.py:60
|
||||
msgid "Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:279
|
||||
msgid "Resume"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:47
|
||||
msgid "Retract"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:134
|
||||
msgid "Save Config"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:139
|
||||
msgid "Save configuration."
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:108
|
||||
msgid "Screws Adjust"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Set Speed"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:144
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:120
|
||||
msgid "Size"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Slow"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:47
|
||||
msgid "Speed +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:51
|
||||
msgid "Speed -"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:129 ks_includes/KlipperScreen.conf:178
|
||||
msgid "System"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:49 ks_includes/KlipperScreen.conf:84
|
||||
#: ks_includes/KlipperScreen.conf:152
|
||||
msgid "Temperature"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:37
|
||||
msgid "Tool"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:118
|
||||
msgid "Uploaded"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:23
|
||||
#: panels/move.py:25
|
||||
msgid "X+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:25
|
||||
#: panels/move.py:27
|
||||
msgid "X-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:28
|
||||
#: panels/move.py:30
|
||||
msgid "Y+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:30
|
||||
#: panels/move.py:32
|
||||
msgid "Y-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:35 panels/fine_tune.py:131 panels/zcalibrate.py:23
|
||||
#: ks_includes/KlipperScreen.conf:118
|
||||
msgid "Z Calibrate"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:28
|
||||
msgid "Z Offset"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:33 panels/move.py:33
|
||||
#: panels/fine_tune.py:36 panels/move.py:35
|
||||
msgid "Z+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:37 panels/move.py:35
|
||||
#: panels/fine_tune.py:40 panels/move.py:37
|
||||
msgid "Z-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:35
|
||||
#: panels/fine_tune.py:38
|
||||
msgid "mm"
|
||||
msgstr ""
|
||||
@@ -1,269 +1,416 @@
|
||||
#: panels/print.py:229
|
||||
#: panels/print.py:197
|
||||
msgid "?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:65
|
||||
#: panels/zcalibrate.py:70
|
||||
msgid "Abort"
|
||||
msgstr "Abort"
|
||||
|
||||
#: panels/zcalibrate.py:61
|
||||
#: panels/zcalibrate.py:67
|
||||
msgid "Accept"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:229
|
||||
#: ks_includes/KlipperScreen.conf:26
|
||||
msgid "Actions"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:197
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:108
|
||||
#: panels/job_status.py:305
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:89 panels/fan.py:52 panels/fine_tune.py:119
|
||||
#: panels/menu.py:18 panels/move.py:96 panels/network.py:34
|
||||
#: panels/preheat.py:54 panels/temperature.py:78
|
||||
msgid "Back"
|
||||
#: ks_includes/KlipperScreen.conf:107
|
||||
msgid "Bed Level"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:79 panels/print.py:225
|
||||
#: ks_includes/KlipperScreen.conf:112
|
||||
msgid "Bed Mesh"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:455 panels/job_status.py:267 panels/print.py:193
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:42
|
||||
#: panels/fan.py:45
|
||||
msgid "Cancel Change"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:111
|
||||
#: panels/job_status.py:300
|
||||
msgid "Cancel Print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:146
|
||||
#: screen.py:289
|
||||
msgid ""
|
||||
"Check /tmp/KlipperScreen.log for more information.\n"
|
||||
"Please submit an issue on GitHub for help."
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_mesh.py:172 panels/temperature.py:149
|
||||
msgid "Close"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:85
|
||||
#: ks_includes/KlipperScreen.conf:30
|
||||
msgid "Configuration"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:454
|
||||
msgid "Continue"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:269
|
||||
msgid "Control"
|
||||
msgstr ""
|
||||
|
||||
#: panels/preheat.py:51
|
||||
#: panels/preheat.py:54
|
||||
msgid "Cooldown"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:49
|
||||
#: panels/temperature.py:53
|
||||
msgid "Decrease"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:79
|
||||
#: ks_includes/KlipperScreen.conf:101
|
||||
msgid "Disable Motors"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:101
|
||||
msgid "Disable XY"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:57
|
||||
#: panels/settings.py:32
|
||||
msgid "Displayed Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:63
|
||||
msgid "Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:85 panels/job_status.py:82
|
||||
#: panels/job_status.py:135
|
||||
msgid "Elapsed:"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:271
|
||||
msgid "Emergency Stop"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:32
|
||||
#: panels/extrude.py:45 ks_includes/KlipperScreen.conf:74
|
||||
#: ks_includes/KlipperScreen.conf:167
|
||||
msgid "Extrude"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:66 panels/fine_tune.py:134
|
||||
msgid "Extrusion"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:64
|
||||
#: panels/fine_tune.py:57
|
||||
msgid "Extrusion +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:68
|
||||
#: panels/fine_tune.py:61
|
||||
msgid "Extrusion -"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:46 panels/fine_tune.py:141
|
||||
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:162
|
||||
msgid "Fan"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:44
|
||||
msgid "Fan +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:48
|
||||
msgid "Fan -"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:32
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan Off"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:35
|
||||
#: panels/fan.py:38
|
||||
msgid "Fan On"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:21 panels/extrude.py:25
|
||||
#: panels/extrude.py:30
|
||||
msgid "Fast"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22 panels/splash_screen.py:59
|
||||
#: ks_includes/KlipperScreen.conf:157
|
||||
msgid "Fine Tuning"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:62 panels/system.py:24
|
||||
msgid "Firmware Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:115
|
||||
#: screen.py:284 panels/job_status.py:301
|
||||
msgid "Go Back"
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:76 panels/move.py:38
|
||||
#: panels/bed_level.py:98 panels/move.py:40 ks_includes/KlipperScreen.conf:39
|
||||
msgid "Home All"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:25
|
||||
#: ks_includes/KlipperScreen.conf:45
|
||||
msgid "Home X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:63
|
||||
msgid "Home XY"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:51
|
||||
msgid "Home Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:57
|
||||
msgid "Home Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
|
||||
msgid "Homing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:47
|
||||
#: panels/temperature.py:51
|
||||
msgid "Increase"
|
||||
msgstr ""
|
||||
|
||||
#. self._load_panels()
|
||||
#: screen.py:136
|
||||
msgid "Initializing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:20
|
||||
#: ks_includes/config.py:26
|
||||
msgid "Invert X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:27
|
||||
msgid "Invert Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:28
|
||||
msgid "Invert Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22
|
||||
msgid "Klipper Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:43 panels/system.py:42
|
||||
#: panels/system.py:35
|
||||
msgid "Klipper Version"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:384
|
||||
msgid "Klipper has disconnected"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:395
|
||||
msgid ""
|
||||
"Klipper has encountered an error with the micro-controller.\n"
|
||||
"Please recompile and flash."
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:399
|
||||
msgid "Klipper has encountered an error."
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:391
|
||||
msgid ""
|
||||
"Klipper has encountered an error.\n"
|
||||
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:417
|
||||
msgid "Klipper has shutdown"
|
||||
msgstr ""
|
||||
|
||||
#: screen.py:413
|
||||
msgid "Klipper is attempting to start"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:141
|
||||
msgid "Klipper will reboot"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:39
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:62
|
||||
#: panels/job_status.py:123
|
||||
msgid "Left:"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:57
|
||||
msgid "Load Average"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:34
|
||||
#: panels/zcalibrate.py:39
|
||||
msgid "Lower Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:20 panels/extrude.py:21 panels/extrude.py:24
|
||||
msgid "Medium"
|
||||
#: ks_includes/KlipperScreen.conf:89
|
||||
msgid "Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:87
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: panels/network.py:28
|
||||
msgid "Network Info"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Number Pad"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:70
|
||||
msgid "Pause"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:224
|
||||
msgid "Print"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:154
|
||||
msgid "Print Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:32
|
||||
msgid "Raise Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:57
|
||||
msgid "Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:68
|
||||
msgid "Resume"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:34
|
||||
msgid "Retract"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:39
|
||||
msgid "Set Speed"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:152
|
||||
msgid "Size"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:21 panels/extrude.py:23
|
||||
msgid "Slow"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:56 panels/fine_tune.py:137
|
||||
msgid "Speed"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:54
|
||||
msgid "Speed +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:58
|
||||
msgid "Speed -"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:31 panels/system.py:30
|
||||
msgid "System Information"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:36
|
||||
msgid "Temperature"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:33 panels/job_status.py:34
|
||||
msgid "Time Elapsed"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:35 panels/job_status.py:36
|
||||
msgid "Time Left"
|
||||
#: panels/job_status.py:273 ks_includes/KlipperScreen.conf:14
|
||||
msgid "Main Menu"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Tool 1"
|
||||
msgid "Medium"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:150
|
||||
#: ks_includes/KlipperScreen.conf:69
|
||||
msgid "Move"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:86
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:124 ks_includes/KlipperScreen.conf:173
|
||||
msgid "Network"
|
||||
msgstr ""
|
||||
|
||||
#: panels/network.py:31
|
||||
msgid "Network Info"
|
||||
msgstr ""
|
||||
|
||||
#: panels/temperature.py:55
|
||||
msgid "Number Pad"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:275
|
||||
msgid "Pause"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:454
|
||||
msgid "Paused"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:95
|
||||
msgid "Power"
|
||||
msgstr ""
|
||||
|
||||
#: panels/splash_screen.py:59
|
||||
msgid "Power On Printer"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:21
|
||||
msgid "Preheat"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:192 ks_includes/KlipperScreen.conf:34
|
||||
msgid "Print"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:149
|
||||
msgid "Print Control"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:122
|
||||
msgid "Print Time"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:231
|
||||
msgid "Printing"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:37
|
||||
msgid "Raise Nozzle"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:277 panels/splash_screen.py:60
|
||||
msgid "Restart"
|
||||
msgstr ""
|
||||
|
||||
#: panels/job_status.py:279
|
||||
msgid "Resume"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:47
|
||||
msgid "Retract"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:134
|
||||
msgid "Save Config"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:139
|
||||
msgid "Save configuration."
|
||||
msgstr ""
|
||||
|
||||
#: panels/bed_level.py:108
|
||||
msgid "Screws Adjust"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Set Speed"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:144
|
||||
msgid "Settings"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:120
|
||||
msgid "Size"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Slow"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:47
|
||||
msgid "Speed +"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:51
|
||||
msgid "Speed -"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:129 ks_includes/KlipperScreen.conf:178
|
||||
msgid "System"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:49 ks_includes/KlipperScreen.conf:84
|
||||
#: ks_includes/KlipperScreen.conf:152
|
||||
msgid "Temperature"
|
||||
msgstr ""
|
||||
|
||||
#: panels/extrude.py:37
|
||||
msgid "Tool"
|
||||
msgstr ""
|
||||
|
||||
#: panels/print.py:118
|
||||
msgid "Uploaded"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:23
|
||||
#: panels/move.py:25
|
||||
msgid "X+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:25
|
||||
#: panels/move.py:27
|
||||
msgid "X-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:28
|
||||
#: panels/move.py:30
|
||||
msgid "Y+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/move.py:30
|
||||
#: panels/move.py:32
|
||||
msgid "Y-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:35 panels/fine_tune.py:131 panels/zcalibrate.py:23
|
||||
#: ks_includes/KlipperScreen.conf:118
|
||||
msgid "Z Calibrate"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:28
|
||||
msgid "Z Offset"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:33 panels/move.py:33
|
||||
#: panels/fine_tune.py:36 panels/move.py:35
|
||||
msgid "Z+"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:37 panels/move.py:35
|
||||
#: panels/fine_tune.py:40 panels/move.py:37
|
||||
msgid "Z-"
|
||||
msgstr ""
|
||||
|
||||
#: panels/fine_tune.py:35
|
||||
#: panels/fine_tune.py:38
|
||||
msgid "mm"
|
||||
msgstr ""
|
||||
@@ -0,0 +1,469 @@
|
||||
# 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-01-07 05:48+0000\n"
|
||||
"PO-Revision-Date: 2021-01-03 23:18+0200\n"
|
||||
"Last-Translator: Emanuel Sharvit <manu7irl@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: fr_FR\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.4.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
|
||||
|
||||
#: panels/print.py:197
|
||||
msgid "?"
|
||||
msgstr "?"
|
||||
|
||||
#: panels/zcalibrate.py:70
|
||||
msgid "Abort"
|
||||
msgstr "Annuler"
|
||||
|
||||
#: panels/zcalibrate.py:67
|
||||
msgid "Accept"
|
||||
msgstr "Accepter"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:26
|
||||
msgid "Actions"
|
||||
msgstr "Actions"
|
||||
|
||||
#: panels/print.py:197
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr "Es tu sure de vouloir imprimer"
|
||||
|
||||
#: panels/job_status.py:305
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr "Es tu sure de vouloir annuler cette impression?"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:107
|
||||
msgid "Bed Level"
|
||||
msgstr "Nivelage du plateau"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:112
|
||||
msgid "Bed Mesh"
|
||||
msgstr "Grille du plateau"
|
||||
|
||||
#: screen.py:455 panels/job_status.py:267 panels/print.py:193
|
||||
msgid "Cancel"
|
||||
msgstr "Annuler"
|
||||
|
||||
#: panels/fan.py:45
|
||||
msgid "Cancel Change"
|
||||
msgstr "Annuler le changement"
|
||||
|
||||
#: panels/job_status.py:300
|
||||
msgid "Cancel Print"
|
||||
msgstr "Annuler l'impression"
|
||||
|
||||
#: screen.py:289
|
||||
msgid ""
|
||||
"Check /tmp/KlipperScreen.log for more information.\n"
|
||||
"Please submit an issue on GitHub for help."
|
||||
msgstr ""
|
||||
"Verifier /tmp/KlipperScreen.log pour plus d'imformation.\n"
|
||||
"SVP envoie une requte sur GITHUB pour obtenir de l'aide"
|
||||
|
||||
#: panels/bed_mesh.py:172 panels/temperature.py:149
|
||||
msgid "Close"
|
||||
msgstr "Fermer"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:30
|
||||
msgid "Configuration"
|
||||
msgstr "Configuration"
|
||||
|
||||
#: screen.py:454
|
||||
msgid "Continue"
|
||||
msgstr "Continuer"
|
||||
|
||||
#: panels/job_status.py:269
|
||||
msgid "Control"
|
||||
msgstr "Controle"
|
||||
|
||||
#: panels/preheat.py:54
|
||||
msgid "Cooldown"
|
||||
msgstr "Refroidir"
|
||||
|
||||
#: panels/temperature.py:53
|
||||
msgid "Decrease"
|
||||
msgstr "Diminuer"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:101
|
||||
msgid "Disable Motors"
|
||||
msgstr "Déactiver les moteurs"
|
||||
|
||||
#: panels/bed_level.py:101
|
||||
msgid "Disable XY"
|
||||
msgstr "Deactiver XY"
|
||||
|
||||
#: panels/settings.py:32
|
||||
msgid "Displayed Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:63
|
||||
msgid "Distance (mm)"
|
||||
msgstr "Distance (mm)"
|
||||
|
||||
#: panels/job_status.py:135
|
||||
msgid "Elapsed:"
|
||||
msgstr "Écoulé:"
|
||||
|
||||
#: panels/job_status.py:271
|
||||
msgid "Emergency Stop"
|
||||
msgstr "Arret d'urgence"
|
||||
|
||||
#: panels/extrude.py:45 ks_includes/KlipperScreen.conf:74
|
||||
#: ks_includes/KlipperScreen.conf:167
|
||||
msgid "Extrude"
|
||||
msgstr "Extruder"
|
||||
|
||||
#: panels/fine_tune.py:57
|
||||
msgid "Extrusion +"
|
||||
msgstr "Extrusion +"
|
||||
|
||||
#: panels/fine_tune.py:61
|
||||
msgid "Extrusion -"
|
||||
msgstr "Extrusion +"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:79 ks_includes/KlipperScreen.conf:162
|
||||
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:30
|
||||
msgid "Fast"
|
||||
msgstr "Rapide"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:157
|
||||
msgid "Fine Tuning"
|
||||
msgstr "Fin réglage"
|
||||
|
||||
#: panels/splash_screen.py:62 panels/system.py:24
|
||||
msgid "Firmware Restart"
|
||||
msgstr "Redemarrer le FW"
|
||||
|
||||
#: screen.py:284 panels/job_status.py:301
|
||||
msgid "Go Back"
|
||||
msgstr "Retourner"
|
||||
|
||||
#: panels/bed_level.py:98 panels/move.py:40 ks_includes/KlipperScreen.conf:39
|
||||
msgid "Home All"
|
||||
msgstr "Réinitialiser XYZ"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:45
|
||||
msgid "Home X"
|
||||
msgstr "Réinitialiser X"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:63
|
||||
msgid "Home XY"
|
||||
msgstr "Réinitialiser XY"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:51
|
||||
msgid "Home Y"
|
||||
msgstr "Réinitialiser Y"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:57
|
||||
msgid "Home Z"
|
||||
msgstr "Réinitialiser Z"
|
||||
|
||||
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
|
||||
msgid "Homing"
|
||||
msgstr "Réinitialisation"
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Increase"
|
||||
msgstr "Augmenter"
|
||||
|
||||
#. self._load_panels()
|
||||
#: screen.py:136
|
||||
msgid "Initializing"
|
||||
msgstr "Initialisation"
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr "Initialisation l'imprimante"
|
||||
|
||||
#: ks_includes/config.py:26
|
||||
msgid "Invert X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:27
|
||||
msgid "Invert Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:28
|
||||
msgid "Invert Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22
|
||||
msgid "Klipper Restart"
|
||||
msgstr "Redémarrer klipper"
|
||||
|
||||
#: panels/system.py:35
|
||||
msgid "Klipper Version"
|
||||
msgstr "Version de klipper"
|
||||
|
||||
#: screen.py:384
|
||||
msgid "Klipper has disconnected"
|
||||
msgstr "Klipper s'est déconnecté"
|
||||
|
||||
#: screen.py:395
|
||||
msgid ""
|
||||
"Klipper has encountered an error with the micro-controller.\n"
|
||||
"Please recompile and flash."
|
||||
msgstr ""
|
||||
"Klipper a rencontré une erreur avec le microcontrôleur.\n"
|
||||
"Veuillez recompiler et reflasher."
|
||||
|
||||
#: screen.py:399
|
||||
msgid "Klipper has encountered an error."
|
||||
msgstr "Klipper a rencontré une erreur."
|
||||
|
||||
#: screen.py:391
|
||||
msgid ""
|
||||
"Klipper has encountered an error.\n"
|
||||
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
msgstr ""
|
||||
"Klipper a rencontré une erreur. Taper FIRMWARE_RESTART pour fixer l'erreur."
|
||||
|
||||
#: screen.py:417
|
||||
msgid "Klipper has shutdown"
|
||||
msgstr "Klipper s'est arrêté"
|
||||
|
||||
#: screen.py:413
|
||||
msgid "Klipper is attempting to start"
|
||||
msgstr "Klipper tente de démarrer"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:141
|
||||
msgid "Klipper will reboot"
|
||||
msgstr "Klipper va redémarrer"
|
||||
|
||||
#: panels/system.py:39
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr "Version de KlipperScreen"
|
||||
|
||||
#: panels/job_status.py:123
|
||||
msgid "Left:"
|
||||
msgstr "Gauche:"
|
||||
|
||||
#: panels/system.py:57
|
||||
msgid "Load Average"
|
||||
msgstr "Charge moyenne"
|
||||
|
||||
#: panels/zcalibrate.py:39
|
||||
msgid "Lower Nozzle"
|
||||
msgstr "Rapprocher la buse"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:89
|
||||
msgid "Macros"
|
||||
msgstr "Macros"
|
||||
|
||||
#: panels/job_status.py:273 ks_includes/KlipperScreen.conf:14
|
||||
msgid "Main Menu"
|
||||
msgstr "Menu principal"
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Medium"
|
||||
msgstr "Moyen"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:69
|
||||
msgid "Move"
|
||||
msgstr "Mouvement"
|
||||
|
||||
#: panels/move.py:86
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr "Distance de mouvement (mm)"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:124 ks_includes/KlipperScreen.conf:173
|
||||
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"
|
||||
|
||||
#: panels/job_status.py:275
|
||||
msgid "Pause"
|
||||
msgstr "Pause"
|
||||
|
||||
#: panels/job_status.py:454
|
||||
msgid "Paused"
|
||||
msgstr "En pause"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:95
|
||||
msgid "Power"
|
||||
msgstr "Energie"
|
||||
|
||||
#: panels/splash_screen.py:59
|
||||
msgid "Power On Printer"
|
||||
msgstr "Allumer l'imrimante"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:21
|
||||
msgid "Preheat"
|
||||
msgstr "Préchauffer"
|
||||
|
||||
#: panels/print.py:192 ks_includes/KlipperScreen.conf:34
|
||||
msgid "Print"
|
||||
msgstr "Imprimer"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:149
|
||||
msgid "Print Control"
|
||||
msgstr "Controle de l'imprimante"
|
||||
|
||||
#: panels/print.py:122
|
||||
msgid "Print Time"
|
||||
msgstr "Temps d'impression"
|
||||
|
||||
#: panels/job_status.py:231
|
||||
msgid "Printing"
|
||||
msgstr "imprime"
|
||||
|
||||
#: panels/zcalibrate.py:37
|
||||
msgid "Raise Nozzle"
|
||||
msgstr "Éloigner la buse"
|
||||
|
||||
#: panels/job_status.py:277 panels/splash_screen.py:60
|
||||
msgid "Restart"
|
||||
msgstr "Redémarrage"
|
||||
|
||||
#: panels/job_status.py:279
|
||||
msgid "Resume"
|
||||
msgstr "Resumer"
|
||||
|
||||
#: panels/extrude.py:47
|
||||
msgid "Retract"
|
||||
msgstr "Rétracter"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:134
|
||||
msgid "Save Config"
|
||||
msgstr "Enregistrer la config"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:139
|
||||
msgid "Save configuration."
|
||||
msgstr "Enregistrer la configuration"
|
||||
|
||||
#: panels/bed_level.py:108
|
||||
msgid "Screws Adjust"
|
||||
msgstr "Ajuster les vis"
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Set Speed"
|
||||
msgstr "Régler la vitesse"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:144
|
||||
#, fuzzy
|
||||
msgid "Settings"
|
||||
msgstr "Paramètres KS"
|
||||
|
||||
#: panels/print.py:120
|
||||
msgid "Size"
|
||||
msgstr "dimensions"
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Slow"
|
||||
msgstr "Lent"
|
||||
|
||||
#: panels/fine_tune.py:47
|
||||
msgid "Speed +"
|
||||
msgstr "Vitesse+"
|
||||
|
||||
#: panels/fine_tune.py:51
|
||||
msgid "Speed -"
|
||||
msgstr "Vitesse-"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:129 ks_includes/KlipperScreen.conf:178
|
||||
msgid "System"
|
||||
msgstr "Systeme"
|
||||
|
||||
#: panels/extrude.py:49 ks_includes/KlipperScreen.conf:84
|
||||
#: ks_includes/KlipperScreen.conf:152
|
||||
msgid "Temperature"
|
||||
msgstr "Temperature"
|
||||
|
||||
#: panels/extrude.py:37
|
||||
msgid "Tool"
|
||||
msgstr "outil"
|
||||
|
||||
#: panels/print.py:118
|
||||
msgid "Uploaded"
|
||||
msgstr "Telecharger"
|
||||
|
||||
#: panels/move.py:25
|
||||
msgid "X+"
|
||||
msgstr "X+"
|
||||
|
||||
#: panels/move.py:27
|
||||
msgid "X-"
|
||||
msgstr "X-"
|
||||
|
||||
#: panels/move.py:30
|
||||
msgid "Y+"
|
||||
msgstr "Y+"
|
||||
|
||||
#: panels/move.py:32
|
||||
msgid "Y-"
|
||||
msgstr "Y-"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:118
|
||||
msgid "Z Calibrate"
|
||||
msgstr "Calibration Z"
|
||||
|
||||
#: panels/zcalibrate.py:28
|
||||
msgid "Z Offset"
|
||||
msgstr "Décalage Z"
|
||||
|
||||
#: panels/fine_tune.py:36 panels/move.py:35
|
||||
msgid "Z+"
|
||||
msgstr "Z+"
|
||||
|
||||
#: panels/fine_tune.py:40 panels/move.py:37
|
||||
msgid "Z-"
|
||||
msgstr "Z-"
|
||||
|
||||
#: panels/fine_tune.py:38
|
||||
msgid "mm"
|
||||
msgstr "mm"
|
||||
|
||||
#~ msgid "Back"
|
||||
#~ msgstr "Retour"
|
||||
|
||||
#~ msgid "Extrusion"
|
||||
#~ msgstr "Extrusion"
|
||||
|
||||
#~ msgid "Fan +"
|
||||
#~ msgstr "Ventilateur+"
|
||||
|
||||
#~ msgid "Fan -"
|
||||
#~ msgstr "Ventilateur-"
|
||||
|
||||
#~ msgid "Speed"
|
||||
#~ msgstr "Vitesse"
|
||||
|
||||
#~ msgid "System Information"
|
||||
#~ msgstr "Info systeme"
|
||||
|
||||
#~ msgid "Time Elapsed"
|
||||
#~ msgstr "Temps écoulé"
|
||||
|
||||
#~ msgid "Time Left"
|
||||
#~ msgstr "temps restant"
|
||||
|
||||
#~ msgid "Tool 1"
|
||||
#~ msgstr "Outil 1"
|
||||
@@ -0,0 +1,470 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Klipperscreen\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2021-01-07 05:48+0000\n"
|
||||
"PO-Revision-Date: 2021-01-05 21:32+0200\n"
|
||||
"Last-Translator: Emanuel Sharvit <manu7irl@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: he_IL\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.4.2\n"
|
||||
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : n==2 ? 1 : n>10 && n%10==0 ? "
|
||||
"2 : 3);\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
|
||||
#: panels/print.py:197
|
||||
msgid "?"
|
||||
msgstr "?"
|
||||
|
||||
#: panels/zcalibrate.py:70
|
||||
msgid "Abort"
|
||||
msgstr "בטל"
|
||||
|
||||
#: panels/zcalibrate.py:67
|
||||
msgid "Accept"
|
||||
msgstr "אשר"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:26
|
||||
msgid "Actions"
|
||||
msgstr "פעולות"
|
||||
|
||||
#: panels/print.py:197
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr "האם אתה בטוח שברצונך להדפיס"
|
||||
|
||||
#: panels/job_status.py:305
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr "האם אתה בטוח שברצונך לבטל את ההדפסה?"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:107
|
||||
msgid "Bed Level"
|
||||
msgstr "פילוס מיטה"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:112
|
||||
msgid "Bed Mesh"
|
||||
msgstr "מיפוי מיטה"
|
||||
|
||||
#: screen.py:455 panels/job_status.py:267 panels/print.py:193
|
||||
msgid "Cancel"
|
||||
msgstr "ביטול"
|
||||
|
||||
#: panels/fan.py:45
|
||||
msgid "Cancel Change"
|
||||
msgstr "בטל שינוי"
|
||||
|
||||
#: panels/job_status.py:300
|
||||
msgid "Cancel Print"
|
||||
msgstr "בטל הדפסה"
|
||||
|
||||
#: screen.py:289
|
||||
msgid ""
|
||||
"Check /tmp/KlipperScreen.log for more information.\n"
|
||||
"Please submit an issue on GitHub for help."
|
||||
msgstr ""
|
||||
"בדוק KlipperScreen.log, בתיקית tmp ליותר פרטים.\n"
|
||||
"אנא שלח דוח תקלה ב- GITHUB, לעזרה."
|
||||
|
||||
#: panels/bed_mesh.py:172 panels/temperature.py:149
|
||||
msgid "Close"
|
||||
msgstr "סגור"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:30
|
||||
msgid "Configuration"
|
||||
msgstr "קונפיגורציה"
|
||||
|
||||
#: screen.py:454
|
||||
msgid "Continue"
|
||||
msgstr "המשך"
|
||||
|
||||
#: panels/job_status.py:269
|
||||
msgid "Control"
|
||||
msgstr "שליטה"
|
||||
|
||||
#: panels/preheat.py:54
|
||||
msgid "Cooldown"
|
||||
msgstr "קירור"
|
||||
|
||||
#: panels/temperature.py:53
|
||||
msgid "Decrease"
|
||||
msgstr "הקטן"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:101
|
||||
msgid "Disable Motors"
|
||||
msgstr "בטל מנועים"
|
||||
|
||||
#: panels/bed_level.py:101
|
||||
msgid "Disable XY"
|
||||
msgstr "בטל XY"
|
||||
|
||||
#: panels/settings.py:32
|
||||
msgid "Displayed Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:63
|
||||
msgid "Distance (mm)"
|
||||
msgstr "מרחק (מ''מ)"
|
||||
|
||||
#: panels/job_status.py:135
|
||||
msgid "Elapsed:"
|
||||
msgstr "זמן שעבר:"
|
||||
|
||||
#: panels/job_status.py:271
|
||||
msgid "Emergency Stop"
|
||||
msgstr "עצירת חירום"
|
||||
|
||||
#: panels/extrude.py:45 ks_includes/KlipperScreen.conf:74
|
||||
#: ks_includes/KlipperScreen.conf:167
|
||||
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:162
|
||||
msgid "Fan"
|
||||
msgstr "מאוורר"
|
||||
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan Off"
|
||||
msgstr "כבה מאוורר"
|
||||
|
||||
#: panels/fan.py:38
|
||||
msgid "Fan On"
|
||||
msgstr "הפעל מאוורר"
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Fast"
|
||||
msgstr "מהיר"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:157
|
||||
msgid "Fine Tuning"
|
||||
msgstr "כיולים עדינים"
|
||||
|
||||
#: panels/splash_screen.py:62 panels/system.py:24
|
||||
msgid "Firmware Restart"
|
||||
msgstr "התחל קושחה"
|
||||
|
||||
#: screen.py:284 panels/job_status.py:301
|
||||
msgid "Go Back"
|
||||
msgstr "חזרה"
|
||||
|
||||
#: panels/bed_level.py:98 panels/move.py:40 ks_includes/KlipperScreen.conf:39
|
||||
msgid "Home All"
|
||||
msgstr "איפוס XYZ"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:45
|
||||
msgid "Home X"
|
||||
msgstr "איפוס X"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:63
|
||||
msgid "Home XY"
|
||||
msgstr "איפוס XY"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:51
|
||||
msgid "Home Y"
|
||||
msgstr "איפוס Y"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:57
|
||||
msgid "Home Z"
|
||||
msgstr "איפוס Z"
|
||||
|
||||
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
|
||||
msgid "Homing"
|
||||
msgstr "איפוס צירים"
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Increase"
|
||||
msgstr "הגדל"
|
||||
|
||||
#. self._load_panels()
|
||||
#: screen.py:136
|
||||
msgid "Initializing"
|
||||
msgstr "מאתחל"
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr "מאתחל מדפסת..."
|
||||
|
||||
#: ks_includes/config.py:26
|
||||
msgid "Invert X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:27
|
||||
msgid "Invert Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:28
|
||||
msgid "Invert Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22
|
||||
msgid "Klipper Restart"
|
||||
msgstr "אתחול קליפר"
|
||||
|
||||
#: panels/system.py:35
|
||||
msgid "Klipper Version"
|
||||
msgstr "גרסא של קליפר"
|
||||
|
||||
#: screen.py:384
|
||||
msgid "Klipper has disconnected"
|
||||
msgstr "קליפר התנתק"
|
||||
|
||||
#: screen.py:395
|
||||
msgid ""
|
||||
"Klipper has encountered an error with the micro-controller.\n"
|
||||
"Please recompile and flash."
|
||||
msgstr "בעיית תקשורת בין קליפר ללוח בקרה. אנא לקמפל קושחה ולצרובה מחדש. "
|
||||
|
||||
#: screen.py:399
|
||||
msgid "Klipper has encountered an error."
|
||||
msgstr "קילפר נתקל בבעיה."
|
||||
|
||||
#: screen.py:391
|
||||
msgid ""
|
||||
"Klipper has encountered an error.\n"
|
||||
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
msgstr ""
|
||||
"קליפר נתקל בבעיה. \n"
|
||||
"נסה להריץ firmware_restart, כדי לפתור את הבעיה."
|
||||
|
||||
#: screen.py:417
|
||||
msgid "Klipper has shutdown"
|
||||
msgstr "קליפר נכבה"
|
||||
|
||||
#: screen.py:413
|
||||
msgid "Klipper is attempting to start"
|
||||
msgstr "קליפר מנסה לרוץ"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:141
|
||||
msgid "Klipper will reboot"
|
||||
msgstr "קליפר יבצע אתחול"
|
||||
|
||||
#: panels/system.py:39
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr "גרסא של KlipperScreen"
|
||||
|
||||
#: panels/job_status.py:123
|
||||
msgid "Left:"
|
||||
msgstr "זמן שנותר:"
|
||||
|
||||
#: panels/system.py:57
|
||||
msgid "Load Average"
|
||||
msgstr "עומס ממוצע"
|
||||
|
||||
#: panels/zcalibrate.py:39
|
||||
msgid "Lower Nozzle"
|
||||
msgstr "הנמך דיזה"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:89
|
||||
msgid "Macros"
|
||||
msgstr "מקרואים"
|
||||
|
||||
#: panels/job_status.py:273 ks_includes/KlipperScreen.conf:14
|
||||
msgid "Main Menu"
|
||||
msgstr "תפריט ראשי"
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Medium"
|
||||
msgstr "ממוצע"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:69
|
||||
msgid "Move"
|
||||
msgstr "הזזת צירים"
|
||||
|
||||
#: panels/move.py:86
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr "מרחק הזזה (מ''מ)"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:124 ks_includes/KlipperScreen.conf:173
|
||||
msgid "Network"
|
||||
msgstr "רשת"
|
||||
|
||||
#: panels/network.py:31
|
||||
msgid "Network Info"
|
||||
msgstr "מידע על הרשת"
|
||||
|
||||
#: panels/temperature.py:55
|
||||
msgid "Number Pad"
|
||||
msgstr "פד נומרי"
|
||||
|
||||
#: panels/job_status.py:275
|
||||
msgid "Pause"
|
||||
msgstr "השהיה"
|
||||
|
||||
#: panels/job_status.py:454
|
||||
msgid "Paused"
|
||||
msgstr "מושהה"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:95
|
||||
msgid "Power"
|
||||
msgstr "הפעלה"
|
||||
|
||||
#: panels/splash_screen.py:59
|
||||
msgid "Power On Printer"
|
||||
msgstr "הפעל מדפסת"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:21
|
||||
msgid "Preheat"
|
||||
msgstr "חימום מראש"
|
||||
|
||||
#: panels/print.py:192 ks_includes/KlipperScreen.conf:34
|
||||
msgid "Print"
|
||||
msgstr "הדפס"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:149
|
||||
msgid "Print Control"
|
||||
msgstr "שליטה בהדפסה"
|
||||
|
||||
#: panels/print.py:122
|
||||
msgid "Print Time"
|
||||
msgstr "זמן הדפסה"
|
||||
|
||||
#: panels/job_status.py:231
|
||||
msgid "Printing"
|
||||
msgstr "מדפיס"
|
||||
|
||||
#: panels/zcalibrate.py:37
|
||||
msgid "Raise Nozzle"
|
||||
msgstr "הגבה"
|
||||
|
||||
#: panels/job_status.py:277 panels/splash_screen.py:60
|
||||
msgid "Restart"
|
||||
msgstr "אתחל"
|
||||
|
||||
#: panels/job_status.py:279
|
||||
msgid "Resume"
|
||||
msgstr "המשך"
|
||||
|
||||
#: panels/extrude.py:47
|
||||
msgid "Retract"
|
||||
msgstr "שיחול לאחור"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:134
|
||||
msgid "Save Config"
|
||||
msgstr "שמור קונפיג"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:139
|
||||
msgid "Save configuration."
|
||||
msgstr "שמור קונפיגורציה"
|
||||
|
||||
#: panels/bed_level.py:108
|
||||
msgid "Screws Adjust"
|
||||
msgstr "סידור ברגים"
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Set Speed"
|
||||
msgstr "קבע מהירות"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:144
|
||||
#, fuzzy
|
||||
msgid "Settings"
|
||||
msgstr "הגדרות KS"
|
||||
|
||||
#: panels/print.py:120
|
||||
msgid "Size"
|
||||
msgstr "גודל"
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Slow"
|
||||
msgstr "האט"
|
||||
|
||||
#: panels/fine_tune.py:47
|
||||
msgid "Speed +"
|
||||
msgstr "מהירות +"
|
||||
|
||||
#: panels/fine_tune.py:51
|
||||
msgid "Speed -"
|
||||
msgstr "מהירות -"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:129 ks_includes/KlipperScreen.conf:178
|
||||
msgid "System"
|
||||
msgstr "מערכת"
|
||||
|
||||
#: panels/extrude.py:49 ks_includes/KlipperScreen.conf:84
|
||||
#: ks_includes/KlipperScreen.conf:152
|
||||
msgid "Temperature"
|
||||
msgstr "טמפרטורה"
|
||||
|
||||
#: panels/extrude.py:37
|
||||
msgid "Tool"
|
||||
msgstr "כלי"
|
||||
|
||||
#: panels/print.py:118
|
||||
msgid "Uploaded"
|
||||
msgstr "הועלה"
|
||||
|
||||
#: panels/move.py:25
|
||||
msgid "X+"
|
||||
msgstr "X+"
|
||||
|
||||
#: panels/move.py:27
|
||||
msgid "X-"
|
||||
msgstr "X-"
|
||||
|
||||
#: panels/move.py:30
|
||||
msgid "Y+"
|
||||
msgstr "Y+"
|
||||
|
||||
#: panels/move.py:32
|
||||
msgid "Y-"
|
||||
msgstr "Y-"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:118
|
||||
msgid "Z Calibrate"
|
||||
msgstr "כיול Z"
|
||||
|
||||
#: panels/zcalibrate.py:28
|
||||
msgid "Z Offset"
|
||||
msgstr "הפרז גובה Z"
|
||||
|
||||
#: panels/fine_tune.py:36 panels/move.py:35
|
||||
msgid "Z+"
|
||||
msgstr "Z+"
|
||||
|
||||
#: panels/fine_tune.py:40 panels/move.py:37
|
||||
msgid "Z-"
|
||||
msgstr "Z-"
|
||||
|
||||
#: panels/fine_tune.py:38
|
||||
msgid "mm"
|
||||
msgstr "מ''מ"
|
||||
|
||||
#~ msgid "Back"
|
||||
#~ msgstr "חזור"
|
||||
|
||||
#~ msgid "Extrusion"
|
||||
#~ msgstr "שיחול"
|
||||
|
||||
#~ msgid "Fan +"
|
||||
#~ msgstr "מאוורר +"
|
||||
|
||||
#~ msgid "Fan -"
|
||||
#~ msgstr "מאוורר -"
|
||||
|
||||
#~ msgid "Speed"
|
||||
#~ msgstr "מהירות"
|
||||
|
||||
#~ msgid "System Information"
|
||||
#~ msgstr "מידע אודות המערכת"
|
||||
|
||||
#~ msgid "Time Elapsed"
|
||||
#~ msgstr "זמן שעבר"
|
||||
|
||||
#~ msgid "Time Left"
|
||||
#~ msgstr "זמן שנשאר"
|
||||
|
||||
#~ msgid "Tool 1"
|
||||
#~ msgstr "כלי 1"
|
||||
@@ -0,0 +1,470 @@
|
||||
# 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-01-07 05:48+0000\n"
|
||||
"PO-Revision-Date: 2021-01-06 00:35+0200\n"
|
||||
"Last-Translator: Emanuel Sharvit <manu7irl@gmail.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.4.2\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
|
||||
#: panels/print.py:197
|
||||
msgid "?"
|
||||
msgstr "?"
|
||||
|
||||
#: panels/zcalibrate.py:70
|
||||
msgid "Abort"
|
||||
msgstr "中止"
|
||||
|
||||
#: panels/zcalibrate.py:67
|
||||
msgid "Accept"
|
||||
msgstr "接受"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:26
|
||||
msgid "Actions"
|
||||
msgstr "动作"
|
||||
|
||||
#: panels/print.py:197
|
||||
msgid "Are you sure you want to print"
|
||||
msgstr "您确定要打印吗"
|
||||
|
||||
#: panels/job_status.py:305
|
||||
msgid "Are you sure you wish to cancel this print?"
|
||||
msgstr "您要取消此打印吗?"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:107
|
||||
msgid "Bed Level"
|
||||
msgstr "床位"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:112
|
||||
msgid "Bed Mesh"
|
||||
msgstr "床网"
|
||||
|
||||
#: screen.py:455 panels/job_status.py:267 panels/print.py:193
|
||||
msgid "Cancel"
|
||||
msgstr "取消"
|
||||
|
||||
#: panels/fan.py:45
|
||||
msgid "Cancel Change"
|
||||
msgstr "取消变更"
|
||||
|
||||
#: panels/job_status.py:300
|
||||
msgid "Cancel Print"
|
||||
msgstr "取消列印"
|
||||
|
||||
#: screen.py:289
|
||||
msgid ""
|
||||
"Check /tmp/KlipperScreen.log for more information.\n"
|
||||
"Please submit an issue on GitHub for help."
|
||||
msgstr ""
|
||||
"检查/tmp/KlipperScreen.log以获取更多信息。\n"
|
||||
"请在GitHub上提交问题以寻求帮助。"
|
||||
|
||||
#: panels/bed_mesh.py:172 panels/temperature.py:149
|
||||
msgid "Close"
|
||||
msgstr "关"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:30
|
||||
msgid "Configuration"
|
||||
msgstr "组态"
|
||||
|
||||
#: screen.py:454
|
||||
msgid "Continue"
|
||||
msgstr "继续"
|
||||
|
||||
#: panels/job_status.py:269
|
||||
msgid "Control"
|
||||
msgstr "控制"
|
||||
|
||||
#: panels/preheat.py:54
|
||||
msgid "Cooldown"
|
||||
msgstr "冷却"
|
||||
|
||||
#: panels/temperature.py:53
|
||||
msgid "Decrease"
|
||||
msgstr "减少"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:101
|
||||
msgid "Disable Motors"
|
||||
msgstr "禁用马达"
|
||||
|
||||
#: panels/bed_level.py:101
|
||||
msgid "Disable XY"
|
||||
msgstr "禁用XY"
|
||||
|
||||
#: panels/settings.py:32
|
||||
msgid "Displayed Macros"
|
||||
msgstr ""
|
||||
|
||||
#: panels/zcalibrate.py:63
|
||||
msgid "Distance (mm)"
|
||||
msgstr "距离(毫米)"
|
||||
|
||||
#: panels/job_status.py:135
|
||||
msgid "Elapsed:"
|
||||
msgstr "过去"
|
||||
|
||||
#: panels/job_status.py:271
|
||||
msgid "Emergency Stop"
|
||||
msgstr "紧急停止"
|
||||
|
||||
#: panels/extrude.py:45 ks_includes/KlipperScreen.conf:74
|
||||
#: ks_includes/KlipperScreen.conf:167
|
||||
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:162
|
||||
msgid "Fan"
|
||||
msgstr "风扇"
|
||||
|
||||
#: panels/fan.py:35
|
||||
msgid "Fan Off"
|
||||
msgstr "散开"
|
||||
|
||||
#: panels/fan.py:38
|
||||
msgid "Fan On"
|
||||
msgstr "扇上"
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Fast"
|
||||
msgstr "快速"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:157
|
||||
msgid "Fine Tuning"
|
||||
msgstr "微调"
|
||||
|
||||
#: panels/splash_screen.py:62 panels/system.py:24
|
||||
msgid "Firmware Restart"
|
||||
msgstr "固件重启"
|
||||
|
||||
#: screen.py:284 panels/job_status.py:301
|
||||
msgid "Go Back"
|
||||
msgstr "回去"
|
||||
|
||||
#: panels/bed_level.py:98 panels/move.py:40 ks_includes/KlipperScreen.conf:39
|
||||
msgid "Home All"
|
||||
msgstr "全部回家"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:45
|
||||
msgid "Home X"
|
||||
msgstr "X家庭"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:63
|
||||
msgid "Home XY"
|
||||
msgstr "XY首页"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:51
|
||||
msgid "Home Y"
|
||||
msgstr "Y家"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:57
|
||||
msgid "Home Z"
|
||||
msgstr "Z家"
|
||||
|
||||
#: panels/zcalibrate.py:29 ks_includes/KlipperScreen.conf:17
|
||||
msgid "Homing"
|
||||
msgstr "归巢"
|
||||
|
||||
#: panels/temperature.py:51
|
||||
msgid "Increase"
|
||||
msgstr "增加"
|
||||
|
||||
#. self._load_panels()
|
||||
#: screen.py:136
|
||||
msgid "Initializing"
|
||||
msgstr "Initializing"
|
||||
|
||||
#: panels/splash_screen.py:23
|
||||
msgid "Initializing printer..."
|
||||
msgstr "初始化打印机..."
|
||||
|
||||
#: ks_includes/config.py:26
|
||||
msgid "Invert X"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:27
|
||||
msgid "Invert Y"
|
||||
msgstr ""
|
||||
|
||||
#: ks_includes/config.py:28
|
||||
msgid "Invert Z"
|
||||
msgstr ""
|
||||
|
||||
#: panels/system.py:22
|
||||
msgid "Klipper Restart"
|
||||
msgstr "快闪重启"
|
||||
|
||||
#: panels/system.py:35
|
||||
msgid "Klipper Version"
|
||||
msgstr "快艇版本"
|
||||
|
||||
#: screen.py:384
|
||||
msgid "Klipper has disconnected"
|
||||
msgstr "Klipper已断开连接"
|
||||
|
||||
#: screen.py:395
|
||||
msgid ""
|
||||
"Klipper has encountered an error with the micro-controller.\n"
|
||||
"Please recompile and flash."
|
||||
msgstr ""
|
||||
"Klipper的微控制器出错。\n"
|
||||
"请重新编译并刷新。"
|
||||
|
||||
#: screen.py:399
|
||||
msgid "Klipper has encountered an error."
|
||||
msgstr "Klipper遇到错误。"
|
||||
|
||||
#: screen.py:391
|
||||
msgid ""
|
||||
"Klipper has encountered an error.\n"
|
||||
"Issue a FIRMWARE_RESTART to attempt fixing the issue."
|
||||
msgstr ""
|
||||
"Klipper遇到错误。\n"
|
||||
"发出FIRMWARE_RESTART尝试解决此问题。"
|
||||
|
||||
#: screen.py:417
|
||||
msgid "Klipper has shutdown"
|
||||
msgstr "Klipper已关闭"
|
||||
|
||||
#: screen.py:413
|
||||
msgid "Klipper is attempting to start"
|
||||
msgstr "Klipper正在尝试启动"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:141
|
||||
msgid "Klipper will reboot"
|
||||
msgstr "Klipper将重新启动"
|
||||
|
||||
#: panels/system.py:39
|
||||
msgid "KlipperScreen Version"
|
||||
msgstr "KlipperScreen版本"
|
||||
|
||||
#: panels/job_status.py:123
|
||||
msgid "Left:"
|
||||
msgstr "剩下的时间"
|
||||
|
||||
#: panels/system.py:57
|
||||
msgid "Load Average"
|
||||
msgstr "平均负载"
|
||||
|
||||
#: panels/zcalibrate.py:39
|
||||
msgid "Lower Nozzle"
|
||||
msgstr "下喷嘴"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:89
|
||||
msgid "Macros"
|
||||
msgstr "巨集"
|
||||
|
||||
#: panels/job_status.py:273 ks_includes/KlipperScreen.conf:14
|
||||
msgid "Main Menu"
|
||||
msgstr "主菜单"
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Medium"
|
||||
msgstr "中"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:69
|
||||
msgid "Move"
|
||||
msgstr "移动"
|
||||
|
||||
#: panels/move.py:86
|
||||
msgid "Move Distance (mm)"
|
||||
msgstr "移动距离(mm)"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:124 ks_includes/KlipperScreen.conf:173
|
||||
msgid "Network"
|
||||
msgstr "网络"
|
||||
|
||||
#: panels/network.py:31
|
||||
msgid "Network Info"
|
||||
msgstr "网络信息"
|
||||
|
||||
#: panels/temperature.py:55
|
||||
msgid "Number Pad"
|
||||
msgstr "数字键盘"
|
||||
|
||||
#: panels/job_status.py:275
|
||||
msgid "Pause"
|
||||
msgstr "暂停"
|
||||
|
||||
#: panels/job_status.py:454
|
||||
msgid "Paused"
|
||||
msgstr "已暂停"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:95
|
||||
msgid "Power"
|
||||
msgstr "功率"
|
||||
|
||||
#: panels/splash_screen.py:59
|
||||
msgid "Power On Printer"
|
||||
msgstr "开启打印机电源"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:21
|
||||
msgid "Preheat"
|
||||
msgstr "预热"
|
||||
|
||||
#: panels/print.py:192 ks_includes/KlipperScreen.conf:34
|
||||
msgid "Print"
|
||||
msgstr "打印"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:149
|
||||
msgid "Print Control"
|
||||
msgstr "打印控制"
|
||||
|
||||
#: panels/print.py:122
|
||||
msgid "Print Time"
|
||||
msgstr "打印时间"
|
||||
|
||||
#: panels/job_status.py:231
|
||||
msgid "Printing"
|
||||
msgstr "印刷"
|
||||
|
||||
#: panels/zcalibrate.py:37
|
||||
msgid "Raise Nozzle"
|
||||
msgstr "升高喷嘴"
|
||||
|
||||
#: panels/job_status.py:277 panels/splash_screen.py:60
|
||||
msgid "Restart"
|
||||
msgstr "重新开始"
|
||||
|
||||
#: panels/job_status.py:279
|
||||
msgid "Resume"
|
||||
msgstr "恢复"
|
||||
|
||||
#: panels/extrude.py:47
|
||||
msgid "Retract"
|
||||
msgstr "缩回"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:134
|
||||
msgid "Save Config"
|
||||
msgstr "保存配置"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:139
|
||||
msgid "Save configuration."
|
||||
msgstr "保存配置"
|
||||
|
||||
#: panels/bed_level.py:108
|
||||
msgid "Screws Adjust"
|
||||
msgstr "螺丝调整"
|
||||
|
||||
#: panels/fan.py:42
|
||||
msgid "Set Speed"
|
||||
msgstr "设定速度"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:144
|
||||
#, fuzzy
|
||||
msgid "Settings"
|
||||
msgstr "KS设置"
|
||||
|
||||
#: panels/print.py:120
|
||||
msgid "Size"
|
||||
msgstr "尺寸"
|
||||
|
||||
#: panels/extrude.py:30
|
||||
msgid "Slow"
|
||||
msgstr "慢"
|
||||
|
||||
#: panels/fine_tune.py:47
|
||||
msgid "Speed +"
|
||||
msgstr "速度 +"
|
||||
|
||||
#: panels/fine_tune.py:51
|
||||
msgid "Speed -"
|
||||
msgstr "速度 -"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:129 ks_includes/KlipperScreen.conf:178
|
||||
msgid "System"
|
||||
msgstr "系统"
|
||||
|
||||
#: panels/extrude.py:49 ks_includes/KlipperScreen.conf:84
|
||||
#: ks_includes/KlipperScreen.conf:152
|
||||
msgid "Temperature"
|
||||
msgstr "温度"
|
||||
|
||||
#: panels/extrude.py:37
|
||||
msgid "Tool"
|
||||
msgstr "工具"
|
||||
|
||||
#: panels/print.py:118
|
||||
msgid "Uploaded"
|
||||
msgstr "已上传"
|
||||
|
||||
#: panels/move.py:25
|
||||
msgid "X+"
|
||||
msgstr "X+"
|
||||
|
||||
#: panels/move.py:27
|
||||
msgid "X-"
|
||||
msgstr "X-"
|
||||
|
||||
#: panels/move.py:30
|
||||
msgid "Y+"
|
||||
msgstr "Y ="
|
||||
|
||||
#: panels/move.py:32
|
||||
msgid "Y-"
|
||||
msgstr "Y-"
|
||||
|
||||
#: ks_includes/KlipperScreen.conf:118
|
||||
msgid "Z Calibrate"
|
||||
msgstr "Z校准"
|
||||
|
||||
#: panels/zcalibrate.py:28
|
||||
msgid "Z Offset"
|
||||
msgstr "Z偏移"
|
||||
|
||||
#: panels/fine_tune.py:36 panels/move.py:35
|
||||
msgid "Z+"
|
||||
msgstr "Z+"
|
||||
|
||||
#: panels/fine_tune.py:40 panels/move.py:37
|
||||
msgid "Z-"
|
||||
msgstr "Z-"
|
||||
|
||||
#: panels/fine_tune.py:38
|
||||
msgid "mm"
|
||||
msgstr "毫米"
|
||||
|
||||
#~ msgid "Back"
|
||||
#~ msgstr "背部"
|
||||
|
||||
#~ msgid "Extrusion"
|
||||
#~ msgstr "挤压"
|
||||
|
||||
#~ msgid "Fan +"
|
||||
#~ msgstr "风扇+"
|
||||
|
||||
#~ msgid "Fan -"
|
||||
#~ msgstr "风扇-"
|
||||
|
||||
#~ msgid "Speed"
|
||||
#~ msgstr "速度"
|
||||
|
||||
#~ msgid "System Information"
|
||||
#~ msgstr "系统信息"
|
||||
|
||||
#~ msgid "Time Elapsed"
|
||||
#~ msgstr "时间流逝"
|
||||
|
||||
#~ msgid "Time Left"
|
||||
#~ msgstr "剩下的时间"
|
||||
|
||||
#~ msgid "Tool 1"
|
||||
#~ msgstr "工具1"
|
||||
@@ -3,21 +3,36 @@ import logging
|
||||
logger = logging.getLogger("KlipperScreen.Printer")
|
||||
|
||||
class Printer:
|
||||
state_callbacks = {
|
||||
"disconnected": None,
|
||||
"error": None,
|
||||
"paused": None,
|
||||
"printing": None,
|
||||
"ready": None,
|
||||
"startup": None,
|
||||
"shutdown": None
|
||||
}
|
||||
|
||||
def __init__(self, data):
|
||||
def __init__(self, printer_info, data):
|
||||
self.state = "disconnected"
|
||||
self.power_devices = {}
|
||||
|
||||
def reinit(self, printer_info, data):
|
||||
logger.debug("Moonraker object status: %s" % data)
|
||||
self.config = data['configfile']['config']
|
||||
|
||||
logging.info("### Reading printer config")
|
||||
self.toolcount = 0
|
||||
self.extrudercount = 0
|
||||
self.tools = []
|
||||
self.devices = {}
|
||||
self.state = data['print_stats']['state']
|
||||
self.data = data
|
||||
self.power_devices = {}
|
||||
self.klipper = {}
|
||||
|
||||
self.klipper = {
|
||||
"version": printer_info['software_version']
|
||||
}
|
||||
|
||||
for x in self.config.keys():
|
||||
if x.startswith('extruder'):
|
||||
if x[0:8] == "extruder":
|
||||
if x.startswith('extruder_stepper'):
|
||||
continue
|
||||
|
||||
@@ -26,8 +41,9 @@ class Printer:
|
||||
"target": 0
|
||||
}
|
||||
self.tools.append(x)
|
||||
self.tools = sorted(self.tools)
|
||||
self.toolcount += 1
|
||||
if "shared_heater" in self.config[x]:
|
||||
self.toolcount += 1
|
||||
continue
|
||||
self.extrudercount += 1
|
||||
if x.startswith('heater_bed'):
|
||||
@@ -35,24 +51,32 @@ class Printer:
|
||||
"temperature": 0,
|
||||
"target": 0
|
||||
}
|
||||
if x.startswith('bed_mesh '):
|
||||
r = self.config[x]
|
||||
r['x_count'] = int(r['x_count'])
|
||||
r['y_count'] = int(r['y_count'])
|
||||
r['max_x'] = float(r['max_x'])
|
||||
r['min_x'] = float(r['min_x'])
|
||||
r['max_y'] = float(r['max_y'])
|
||||
r['min_y'] = float(r['min_y'])
|
||||
r['points'] = [[float(j.strip()) for j in i.split(",")] for i in r['points'].strip().split("\n")]
|
||||
self.process_update(data)
|
||||
|
||||
logging.info("### Toolcount: " + str(self.toolcount) + " Heaters: " + str(self.extrudercount))
|
||||
|
||||
def configure_power_devices(self, data):
|
||||
self.power_devices = {}
|
||||
|
||||
logger.debug("Processing power devices: %s" % data)
|
||||
for x in data['devices']:
|
||||
logger.debug(x)
|
||||
self.power_devices[x['device']] = {
|
||||
"status": "on" if x['status'] == "on" else "off"
|
||||
}
|
||||
logger.debug("Power devices: %s" % self.power_devices)
|
||||
logger.info("Klipper version: %s", self.klipper['version'])
|
||||
logger.info("### Toolcount: " + str(self.toolcount) + " Heaters: " + str(self.extrudercount))
|
||||
|
||||
def process_update(self, data):
|
||||
keys = ['virtual_sdcard','pause_resume','idle_timeout','print_stats']
|
||||
keys = ['fan','gcode_move','idle_timeout','pause_resume','print_stats','toolhead','virtual_sdcard']
|
||||
keys = [
|
||||
'bed_mesh',
|
||||
'fan',
|
||||
'gcode_move',
|
||||
'idle_timeout',
|
||||
'pause_resume',
|
||||
'print_stats',
|
||||
'toolhead',
|
||||
'virtual_sdcard',
|
||||
'webhooks'
|
||||
]
|
||||
for x in keys:
|
||||
if x in data:
|
||||
if x not in self.data:
|
||||
@@ -75,12 +99,58 @@ class Printer:
|
||||
if "temperature" in d:
|
||||
self.set_dev_stat(x, "temperature", d["temperature"])
|
||||
|
||||
if "webhooks" in data or "idle_timeout" in data or "pause_resume" in data or "print_stats" in data:
|
||||
self.evaluate_state()
|
||||
|
||||
def evaluate_state(self):
|
||||
wh_state = self.data['webhooks']['state'] # 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'] # possible values: complete, paused, printing, standby
|
||||
|
||||
if wh_state == "ready":
|
||||
new_state = "ready"
|
||||
if idle_state == "printing" and print_state != "printing": # Not printing a file, toolhead moving
|
||||
new_state = "busy"
|
||||
elif idle_state == "printing" and print_state == "printing":
|
||||
new_state = "printing"
|
||||
elif print_state == "paused":
|
||||
new_state = "paused"
|
||||
|
||||
if new_state != "busy":
|
||||
self.change_state(new_state)
|
||||
else:
|
||||
self.change_state(wh_state)
|
||||
|
||||
def process_power_update(self, data):
|
||||
if data['device'] in self.power_devices:
|
||||
self.power_devices[data['device']]['status'] = data['status']
|
||||
|
||||
def get_config_section_list(self):
|
||||
return list(self.config)
|
||||
def change_state(self, state):
|
||||
if state == self.state or state not in list(self.state_callbacks):
|
||||
return
|
||||
|
||||
logger.debug("Changing state from '%s' to '%s'" % (self.state, state))
|
||||
self.state = state
|
||||
if self.state_callbacks[state] != None:
|
||||
logger.debug("Running callback for state: %s" % state)
|
||||
self.state_callbacks[state]()
|
||||
|
||||
def configure_power_devices(self, data):
|
||||
self.power_devices = {}
|
||||
|
||||
logger.debug("Processing power devices: %s" % data)
|
||||
for x in data['devices']:
|
||||
logger.debug(x)
|
||||
self.power_devices[x['device']] = {
|
||||
"status": "on" if x['status'] == "on" else "off"
|
||||
}
|
||||
logger.debug("Power devices: %s" % self.power_devices)
|
||||
|
||||
def config_section_exists(self, section):
|
||||
return section in list(self.config)
|
||||
|
||||
def get_config_section_list(self, search=""):
|
||||
return [i for i in list(self.config) if i.startswith(search)]
|
||||
|
||||
def get_config_section(self, section):
|
||||
if section not in self.config:
|
||||
@@ -90,6 +160,35 @@ class Printer:
|
||||
def get_data(self):
|
||||
return self.data
|
||||
|
||||
def get_gcode_macros(self):
|
||||
return self.get_config_section_list("gcode_macro ")
|
||||
|
||||
def get_printer_status_data(self):
|
||||
data = {
|
||||
"printer": {
|
||||
"bltouch": self.section_exists("bltouch"),
|
||||
"gcode_macros": {
|
||||
"count": len(self.get_gcode_macros())
|
||||
},
|
||||
"idle_timeout": self.get_stat("idle_timeout").copy(),
|
||||
"pause_resume": self.get_stat("pause_resume").copy(),
|
||||
"power_devices": {
|
||||
"count": len(self.get_power_devices())
|
||||
},
|
||||
"probe": self.section_exists("probe")
|
||||
}
|
||||
}
|
||||
|
||||
sections = ["bed_mesh","bltouch","probe"]
|
||||
for section in sections:
|
||||
if self.config_section_exists(section):
|
||||
data["printer"][section] = self.get_config_section(section).copy()
|
||||
|
||||
return data
|
||||
|
||||
def get_klipper_version(self):
|
||||
return self.klipper['version']
|
||||
|
||||
def get_power_devices(self):
|
||||
return list(self.power_devices)
|
||||
|
||||
@@ -99,10 +198,17 @@ class Printer:
|
||||
return self.power_devices[device]['status']
|
||||
|
||||
def get_stat(self, stat, substat = None):
|
||||
if stat not in self.data:
|
||||
return None
|
||||
if substat != None:
|
||||
return self.data[stat][substat]
|
||||
if substat in self.data[stat]:
|
||||
return self.data[stat][substat]
|
||||
return None
|
||||
return self.data[stat]
|
||||
|
||||
def get_state(self):
|
||||
return self.state
|
||||
|
||||
def set_dev_temps(self, dev, temp, target=None):
|
||||
if dev in self.devices:
|
||||
self.devices[dev]['temperature'] = temp
|
||||
@@ -128,6 +234,20 @@ class Printer:
|
||||
def get_tool_number(self, tool):
|
||||
return self.tools.index(tool)
|
||||
|
||||
def has_heated_bed(self):
|
||||
if "heater_bed" in self.devices:
|
||||
return True
|
||||
|
||||
def section_exists(self, section):
|
||||
if section in self.get_config_section_list():
|
||||
return True
|
||||
return False
|
||||
|
||||
def set_callbacks(self, callbacks):
|
||||
for name, cb in callbacks.items():
|
||||
if name in list(self.state_callbacks):
|
||||
self.state_callbacks[name] = cb
|
||||
|
||||
def set_dev_stat(self, dev, stat, value):
|
||||
if dev not in self.devices:
|
||||
return
|
||||
|
||||
@@ -1,17 +1,65 @@
|
||||
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
|
||||
logger = logging.getLogger("KlipperScreen.ScreenPanel")
|
||||
|
||||
class ScreenPanel:
|
||||
def __init__(self, screen):
|
||||
title_spacing = 50
|
||||
control = {}
|
||||
|
||||
def __init__(self, screen, title, back=True):
|
||||
self._screen = screen
|
||||
self._config = screen._config
|
||||
self._files = screen.files
|
||||
self.lang = self._screen.lang
|
||||
self._printer = screen.printer
|
||||
self.labels = {}
|
||||
self._gtk = screen.gtk
|
||||
|
||||
self.layout = Gtk.Layout()
|
||||
self.layout.set_size(self._screen.width, self._screen.height)
|
||||
|
||||
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.layout.put(self.control['back'], 0, 0)
|
||||
|
||||
self.control['home'] = self._gtk.ButtonImage('home', None, None, button_scale[0], button_scale[1])
|
||||
self.control['home'].connect("clicked", self.menu_return, True)
|
||||
self.layout.put(self.control['home'], self._screen.width - round(
|
||||
self._gtk.get_image_width() * button_scale[0] * 1.45), 0)
|
||||
|
||||
self.control['estop'] = self._gtk.ButtonImage('emergency', None, None, button_scale[0], button_scale[1])
|
||||
self.control['estop'].connect("clicked", self.emergency_stop)
|
||||
self.layout.put(self.control['estop'], int(self._screen.width/4*3 - button_scale[0]/2), 0)
|
||||
|
||||
try:
|
||||
env = Environment(extensions=["jinja2.ext.i18n"])
|
||||
env.install_gettext_translations(self.lang)
|
||||
j2_temp = env.from_string(title)
|
||||
title = j2_temp.render()
|
||||
except:
|
||||
logger.debug("Error parsing jinja for title: %s" % title)
|
||||
|
||||
self.title = Gtk.Label()
|
||||
self.title.set_size_request(self._screen.width, self.title_spacing)
|
||||
self.title.set_hexpand(True)
|
||||
self.title.set_halign(Gtk.Align.CENTER)
|
||||
self.title.set_valign(Gtk.Align.CENTER)
|
||||
self.set_title(title)
|
||||
self.layout.put(self.title, 0, 0)
|
||||
|
||||
self.content = Gtk.Box(spacing=0)
|
||||
self.content.set_size_request(self._screen.width, self._screen.height - self.title_spacing)
|
||||
self.layout.put(self.content, 0, self.title_spacing)
|
||||
|
||||
|
||||
def initialize(self, panel_name):
|
||||
@@ -22,8 +70,12 @@ class ScreenPanel:
|
||||
self._screen._ws.klippy.emergency_stop()
|
||||
|
||||
def get(self):
|
||||
# Return gtk item
|
||||
return self.panel
|
||||
return self.layout
|
||||
|
||||
def get_file_image(self, filename, width=1.6, height=1.6):
|
||||
if not self._files.has_thumbnail(filename):
|
||||
return None
|
||||
return self._gtk.PixbufFromFile(self._files.get_thumbnail_location(filename), None, width, height)
|
||||
|
||||
def home(self, widget):
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.HOME)
|
||||
@@ -31,9 +83,23 @@ class ScreenPanel:
|
||||
def menu_item_clicked(self, widget, panel, item):
|
||||
print("### Creating panel "+ item['panel'])
|
||||
if "items" in item:
|
||||
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + item['name'], item['panel'], 1, False, items=item['items'])
|
||||
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + item['name'], item['panel'], item['name'],
|
||||
1, False, items=item['items'])
|
||||
return
|
||||
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + item['name'], item['panel'], 1, False)
|
||||
self._screen.show_panel(self._screen._cur_panels[-1] + '_' + item['name'], item['panel'], item['name'],
|
||||
1, False)
|
||||
|
||||
def menu_return(self, widget, home=False):
|
||||
if home == False:
|
||||
self._screen._menu_go_back()
|
||||
return
|
||||
self._screen._menu_go_home()
|
||||
|
||||
def set_title(self, title):
|
||||
self.title.set_label(title)
|
||||
|
||||
def show_all(self):
|
||||
self._screen.show_all()
|
||||
|
||||
def update_image_text(self, label, text):
|
||||
if label in self.labels and 'l' in self.labels[label]:
|
||||
@@ -41,4 +107,4 @@ class ScreenPanel:
|
||||
|
||||
def update_temp(self, dev, temp, target):
|
||||
if dev in self.labels:
|
||||
self.labels[dev].set_label(KlippyGtk.formatTemperatureString(temp, target))
|
||||
self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
|
||||
@@ -6,41 +6,63 @@ gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.BedLevelPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return BedLevelPanel(*args)
|
||||
|
||||
class BedLevelPanel(ScreenPanel):
|
||||
def initialize(self, menu):
|
||||
x_offset = 0
|
||||
y_offset = 0
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
self.panel_name = panel_name
|
||||
self.screws = None
|
||||
self.panel = KlippyGtk.HomogeneousGrid()
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
self.disabled_motors = False
|
||||
|
||||
screws = []
|
||||
if "bed_screws" in self._screen.printer.get_config_section_list():
|
||||
bed_screws = self._screen.printer.get_config_section("bed_screws")
|
||||
for item in bed_screws:
|
||||
if re.match(r"^[0-9\.]+,[0-9\.]+$", bed_screws[item]):
|
||||
screws.append(bed_screws[item].split(","))
|
||||
config_section_name = None
|
||||
if "screws_tilt_adjust" in self._screen.printer.get_config_section_list():
|
||||
config_section_name = "screws_tilt_adjust"
|
||||
elif "bed_screws" in self._screen.printer.get_config_section_list():
|
||||
config_section_name = "bed_screws"
|
||||
|
||||
if config_section_name != None:
|
||||
config_section = self._screen.printer.get_config_section(config_section_name)
|
||||
for item in config_section:
|
||||
logger.debug("Screws section: %s" % config_section[item])
|
||||
result = re.match(r"([0-9\.]+)\s*,\s*([0-9\.]+)", config_section[item])
|
||||
if result:
|
||||
screws.append([
|
||||
round(float(result.group(1)),2),
|
||||
round(float(result.group(2)),2)
|
||||
])
|
||||
|
||||
screws = sorted(screws, key=lambda x: (float(x[1]), float(x[0])))
|
||||
logger.debug("Bed screw locations [x,y]: %s", screws)
|
||||
if "bltouch" in self._screen.printer.get_config_section_list():
|
||||
if ("bltouch" in self._screen.printer.get_config_section_list() and
|
||||
config_section_name == "screws_tilt_adjust"):
|
||||
x_offset = 0
|
||||
y_offset = 0
|
||||
bltouch = self._screen.printer.get_config_section("bltouch")
|
||||
if "x_offset" in bltouch:
|
||||
x_offset = float(bltouch['x_offset'])
|
||||
self.x_offset = float(bltouch['x_offset'])
|
||||
if "y_offset" in bltouch:
|
||||
y_offset = float(bltouch['y_offset'])
|
||||
self.y_offset = float(bltouch['y_offset'])
|
||||
new_screws = []
|
||||
for screw in screws:
|
||||
new_screws.append([float(screw[0]) + x_offset, float(screw[1]) + y_offset])
|
||||
new_screws.append([
|
||||
round(float(screw[0]) + self.x_offset,2),
|
||||
round(float(screw[1]) + self.y_offset,2)
|
||||
])
|
||||
screws = new_screws
|
||||
|
||||
self.screws = screws
|
||||
logger.debug("Screws: %s" % screws)
|
||||
|
||||
if len(screws) < 4:
|
||||
logger.debug("bed_screws not configured, calculating locations")
|
||||
@@ -59,36 +81,41 @@ class BedLevelPanel(ScreenPanel):
|
||||
logger.debug("Configured screw locations [x,y]: %s", screws)
|
||||
|
||||
|
||||
self.labels['tl'] = KlippyGtk.ButtonImage("bed-level-t-l")
|
||||
self.labels['tl'].connect("clicked", self.go_to_position, self.screws[2])
|
||||
self.labels['tr'] = KlippyGtk.ButtonImage("bed-level-t-r")
|
||||
self.labels['tr'].connect("clicked", self.go_to_position, self.screws[3])
|
||||
self.labels['bl'] = KlippyGtk.ButtonImage("bed-level-b-l")
|
||||
self.labels['bl'].connect("clicked", self.go_to_position, self.screws[0])
|
||||
self.labels['br'] = KlippyGtk.ButtonImage("bed-level-b-r")
|
||||
self.labels['br'].connect("clicked", self.go_to_position, self.screws[1])
|
||||
self.labels['bl'] = self._gtk.ButtonImage("bed-level-t-l", None, None, 3, 3)
|
||||
self.labels['bl'].connect("clicked", self.go_to_position, self.screws[2])
|
||||
self.labels['br'] = self._gtk.ButtonImage("bed-level-t-r", None, None, 3, 3)
|
||||
self.labels['br'].connect("clicked", self.go_to_position, self.screws[3])
|
||||
self.labels['fl'] = self._gtk.ButtonImage("bed-level-b-l", None, None, 3, 3)
|
||||
self.labels['fl'].connect("clicked", self.go_to_position, self.screws[0])
|
||||
self.labels['fr'] = self._gtk.ButtonImage("bed-level-b-r", None, None, 3, 3)
|
||||
self.labels['fr'].connect("clicked", self.go_to_position, self.screws[1])
|
||||
|
||||
self.panel.attach(self.labels['tl'], 1, 0, 1, 1)
|
||||
self.panel.attach(self.labels['tr'], 2, 0, 1, 1)
|
||||
self.panel.attach(self.labels['bl'], 1, 1, 1, 1)
|
||||
self.panel.attach(self.labels['br'], 2, 1, 1, 1)
|
||||
grid.attach(self.labels['bl'], 1, 0, 1, 1)
|
||||
grid.attach(self.labels['br'], 2, 0, 1, 1)
|
||||
grid.attach(self.labels['fl'], 1, 1, 1, 1)
|
||||
grid.attach(self.labels['fr'], 2, 1, 1, 1)
|
||||
|
||||
self.labels['home'] = KlippyGtk.ButtonImage("home",_("Home All"),"color2")
|
||||
self.labels['home'] = self._gtk.ButtonImage("home",_("Home All"),"color2")
|
||||
self.labels['home'].connect("clicked", self.home)
|
||||
|
||||
self.labels['dm'] = KlippyGtk.ButtonImage("motor-off", _("Disable XY"), "color3")
|
||||
self.labels['dm'] = self._gtk.ButtonImage("motor-off", _("Disable XY"), "color3")
|
||||
self.labels['dm'].connect("clicked", self.disable_motors)
|
||||
|
||||
self.panel.attach(self.labels['home'], 0, 0, 1, 1)
|
||||
self.panel.attach(self.labels['dm'], 0, 1, 1, 1)
|
||||
grid.attach(self.labels['home'], 0, 0, 1, 1)
|
||||
grid.attach(self.labels['dm'], 0, 1, 1, 1)
|
||||
|
||||
self.labels['estop'] = KlippyGtk.ButtonImage("decrease",_("Emergency Stop"),"color4")
|
||||
self.labels['estop'].connect("clicked", self.emergency_stop)
|
||||
self.panel.attach(self.labels['estop'], 3, 0, 1, 1)
|
||||
if self._printer.config_section_exists("screws_tilt_adjust"):
|
||||
self.labels['screws'] = self._gtk.ButtonImage("refresh",_("Screws Adjust"),"color4")
|
||||
self.labels['screws'].connect("clicked", self.screws_tilt_calculate)
|
||||
grid.attach(self.labels['screws'], 3, 0, 1, 1)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
self.panel.attach(b, 3, 1, 1, 1)
|
||||
self.content.add(grid)
|
||||
|
||||
def activate(self):
|
||||
self.labels['bl'].set_label("")
|
||||
self.labels['br'].set_label("")
|
||||
self.labels['fl'].set_label("")
|
||||
self.labels['fr'].set_label("")
|
||||
|
||||
def go_to_position(self, widget, position):
|
||||
logger.debug("Going to position: %s", position)
|
||||
@@ -112,5 +139,29 @@ class BedLevelPanel(ScreenPanel):
|
||||
"M18" # Disable motors
|
||||
)
|
||||
|
||||
def create_panel(*args):
|
||||
return BedLevelPanel(*args)
|
||||
def process_update(self, action, data):
|
||||
if action == "notify_gcode_response":
|
||||
result = re.match(
|
||||
"^// (.*) : X ([0-9\.]+), Y ([0-9\.]+), Z [0-9\.]+ : Adjust -> ([CW]+ [0-9:]+)",
|
||||
data
|
||||
)
|
||||
if result:
|
||||
screw_labels = ['fl','fr','br','bl']
|
||||
x = int(float(result.group(2)) + self.x_offset)
|
||||
y = int(float(result.group(3)) + self.y_offset)
|
||||
logger.debug(data)
|
||||
logger.debug("X: %s Y: %s" % (x,y))
|
||||
for i in range(len(self.screws)):
|
||||
logger.debug(self.screws[i])
|
||||
if x == int(float(self.screws[i][0])) and y == int(float(self.screws[i][1])):
|
||||
break
|
||||
self.labels[screw_labels[i]].set_label(result.group(4))
|
||||
self.response_count += 1
|
||||
if self.response_count >= len(self.screws)-1:
|
||||
self._screen.remove_subscription(self.panel_name)
|
||||
|
||||
|
||||
def screws_tilt_calculate(self, widget):
|
||||
self.response_count = 0
|
||||
self._screen.add_subscription(self.panel_name)
|
||||
self._screen._ws.klippy.gcode_script("SCREWS_TILT_CALCULATE")
|
||||
@@ -0,0 +1,177 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.BedMeshPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return BedMeshPanel(*args)
|
||||
|
||||
class BedMeshPanel(ScreenPanel):
|
||||
active_mesh = None
|
||||
graphs = {}
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
scroll = Gtk.ScrolledWindow()
|
||||
scroll.set_property("overlay-scrolling", False)
|
||||
scroll.set_vexpand(True)
|
||||
|
||||
# Create a grid for all profiles
|
||||
self.labels['profiles'] = Gtk.Grid()
|
||||
scroll.add(self.labels['profiles'])
|
||||
|
||||
# Create a box to contain all of the above
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||
box.set_vexpand(True)
|
||||
box.pack_start(scroll, True, True, 0)
|
||||
|
||||
self.load_meshes()
|
||||
|
||||
self.content.add(box)
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def activate(self):
|
||||
am = self._screen.printer.get_stat("bed_mesh","profile_name")
|
||||
self.activate_mesh(am)
|
||||
|
||||
def activate_mesh(self, profile):
|
||||
if profile == "":
|
||||
profile = None
|
||||
|
||||
logger.debug("Activating profile: %s %s" % (self.active_mesh, profile))
|
||||
if profile != self.active_mesh:
|
||||
if self.active_mesh != None:
|
||||
a = self.profiles[self.active_mesh]
|
||||
a['buttons'].remove(a['refresh'])
|
||||
a['buttons'].pack_start(a['load'], False, False, 0)
|
||||
self.active_mesh = profile
|
||||
if self.active_mesh != None:
|
||||
a = self.profiles[profile]
|
||||
a['buttons'].remove(a['load'])
|
||||
a['buttons'].pack_start(a['refresh'], False, False, 0)
|
||||
self._screen.show_all()
|
||||
|
||||
def add_profile(self, profile):
|
||||
frame = Gtk.Frame()
|
||||
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
|
||||
|
||||
name = Gtk.Label()
|
||||
name.set_markup("<big><b>%s</b></big>" % (profile))
|
||||
name.set_hexpand(True)
|
||||
name.set_vexpand(True)
|
||||
name.set_halign(Gtk.Align.START)
|
||||
name.set_line_wrap(True)
|
||||
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
load = self._gtk.ButtonImage("load","Load","color2")
|
||||
load.connect("clicked", self.send_load_mesh, profile)
|
||||
load.set_size_request(60,0)
|
||||
load.set_hexpand(False)
|
||||
load.set_halign(Gtk.Align.END)
|
||||
|
||||
refresh = self._gtk.ButtonImage("refresh","Calibrate","color4")
|
||||
refresh.connect("clicked", self.calibrate_mesh)
|
||||
refresh.set_size_request(60,0)
|
||||
refresh.set_hexpand(False)
|
||||
refresh.set_halign(Gtk.Align.END)
|
||||
|
||||
info = self._gtk.ButtonImage("info",None,"color3")
|
||||
info.connect("clicked", self.show_mesh, profile)
|
||||
info.set_size_request(60,0)
|
||||
info.set_hexpand(False)
|
||||
info.set_halign(Gtk.Align.END)
|
||||
|
||||
save = self._gtk.ButtonImage("sd","Save","color3")
|
||||
save.connect("clicked", self.send_save_mesh, profile)
|
||||
save.set_size_request(60,0)
|
||||
save.set_hexpand(False)
|
||||
save.set_halign(Gtk.Align.END)
|
||||
|
||||
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
labels.add(name)
|
||||
|
||||
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
dev.set_margin_top(10)
|
||||
dev.set_margin_end(15)
|
||||
dev.set_margin_start(15)
|
||||
dev.set_margin_bottom(10)
|
||||
dev.set_hexpand(True)
|
||||
dev.set_vexpand(False)
|
||||
dev.add(labels)
|
||||
|
||||
buttons = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
logger.debug("Profile compare: '%s' '%s'" % (self.active_mesh, profile))
|
||||
if self.active_mesh == profile:
|
||||
buttons.pack_start(refresh, False, False, 0)
|
||||
else:
|
||||
buttons.pack_start(load, False, False, 0)
|
||||
#buttons.pack_end(info, False, False, 0)
|
||||
|
||||
if profile != "default":
|
||||
buttons.pack_end(save, False, False, 0)
|
||||
|
||||
dev.add(buttons)
|
||||
frame.add(dev)
|
||||
|
||||
self.profiles[profile] = {
|
||||
"box": dev,
|
||||
"buttons": buttons,
|
||||
"row": frame,
|
||||
"load": load,
|
||||
"refresh": refresh,
|
||||
"save": save
|
||||
}
|
||||
|
||||
profiles = sorted(self.profiles)
|
||||
pos = profiles.index(profile)
|
||||
|
||||
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 calibrate_mesh(self, widget):
|
||||
self._screen._ws.klippy.gcode_script(
|
||||
"BED_MESH_CALIBRATE"
|
||||
)
|
||||
|
||||
def load_meshes(self):
|
||||
bm_profiles = self._screen.printer.get_config_section_list("bed_mesh ")
|
||||
self.profiles = {}
|
||||
for prof in bm_profiles:
|
||||
self.add_profile(prof[9:])
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action == "notify_status_update":
|
||||
if "bed_mesh" in data and "profile_name" in data['bed_mesh']:
|
||||
if data['bed_mesh']['profile_name'] != self.active_mesh:
|
||||
self.activate_mesh(data['bed_mesh']['profile_name'])
|
||||
|
||||
def send_load_mesh(self, widget, profile):
|
||||
self._screen._ws.klippy.gcode_script(
|
||||
KlippyGcodes.bed_mesh_load(profile)
|
||||
)
|
||||
|
||||
def send_save_mesh(self, widget, profile):
|
||||
self._screen._ws.klippy.gcode_script(
|
||||
KlippyGcodes.bed_mesh_save(profile)
|
||||
)
|
||||
|
||||
def show_mesh(self, widget, profile):
|
||||
_ = self.lang.gettext
|
||||
|
||||
buttons = [
|
||||
{"name": _("Close"), "response": Gtk.ResponseType.CANCEL}
|
||||
]
|
||||
dialog = self._gtk.Dialog(self._screen, buttons, self.graphs[profile], self._close_dialog)
|
||||
|
||||
def _close_dialog(self, widget, response):
|
||||
widget.destroy()
|
||||
@@ -4,7 +4,6 @@ import logging
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
@@ -17,4 +16,5 @@ class ExamplePanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
# Create gtk items here
|
||||
return
|
||||
|
||||
self.content.add(Gtk.Box())
|
||||
@@ -4,7 +4,6 @@ import logging
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
@@ -20,30 +19,40 @@ class ExtrudePanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
self.speed = _("Medium")
|
||||
self.speeds = [_("Slow"), _("Medium"), _("Fast")]
|
||||
self.speed = "Medium"
|
||||
self.speeds = ["Slow", "Medium", "Fast"]
|
||||
self.speed_trans = {
|
||||
_("Slow"): "300",
|
||||
_("Medium"): "800",
|
||||
_("Fast"): "1400"
|
||||
"Slow": "300",
|
||||
"Medium": "800",
|
||||
"Fast": "1400"
|
||||
}
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
# This line for translations only
|
||||
speed_translations = [_("Slow"), _("Medium"), _("Fast")]
|
||||
|
||||
self.labels['tool0'] = KlippyGtk.ButtonImage("extruder-1",_("Tool 1"),"color1")
|
||||
self.labels['tool0'].get_style_context().add_class("button_active")
|
||||
self.labels['extrude'] = KlippyGtk.ButtonImage("extrude",_("Extrude"),"color3")
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
i = 0
|
||||
self.current_extruder = self._printer.get_stat("toolhead","extruder")
|
||||
for extruder in self._printer.get_tools():
|
||||
self.labels[extruder] = self._gtk.ButtonImage("extruder-%s" % i,_("Tool") + " %s" %str(i),"color1")
|
||||
self.labels[extruder].connect("clicked", self.change_extruder, extruder)
|
||||
if extruder == self.current_extruder:
|
||||
self.labels[extruder].get_style_context().add_class("button_active")
|
||||
if i <= 3:
|
||||
grid.attach(self.labels[extruder], i, 0, 1, 1)
|
||||
i += 1
|
||||
|
||||
self.labels['extrude'] = self._gtk.ButtonImage("extrude",_("Extrude"),"color3")
|
||||
self.labels['extrude'].connect("clicked", self.extrude, "+")
|
||||
self.labels['retract'] = KlippyGtk.ButtonImage("retract",_("Retract"),"color2")
|
||||
self.labels['retract'] = self._gtk.ButtonImage("retract",_("Retract"),"color2")
|
||||
self.labels['retract'].connect("clicked", self.extrude, "-")
|
||||
self.labels['temperature'] = KlippyGtk.ButtonImage("heat-up",_("Temperature"),"color4")
|
||||
self.labels['temperature'] = self._gtk.ButtonImage("heat-up",_("Temperature"),"color4")
|
||||
self.labels['temperature'].connect("clicked", self.menu_item_clicked, "temperature", {
|
||||
"name": "Temperature",
|
||||
"panel": "temperature"
|
||||
})
|
||||
|
||||
|
||||
grid.attach(self.labels['tool0'], 0, 0, 1, 1)
|
||||
grid.attach(self.labels['extrude'], 0, 1, 1, 1)
|
||||
grid.attach(self.labels['retract'], 3, 1, 1, 1)
|
||||
grid.attach(self.labels['temperature'], 0, 2, 1, 1)
|
||||
@@ -52,7 +61,7 @@ class ExtrudePanel(ScreenPanel):
|
||||
distgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.distances:
|
||||
self.labels["dist"+str(i)] = KlippyGtk.ToggleButton(i)
|
||||
self.labels["dist"+str(i)] = self._gtk.ToggleButton(i)
|
||||
self.labels["dist"+str(i)].connect("clicked", self.change_distance, i)
|
||||
ctx = self.labels["dist"+str(i)].get_style_context()
|
||||
if j == 0:
|
||||
@@ -70,7 +79,7 @@ class ExtrudePanel(ScreenPanel):
|
||||
speedgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.speeds:
|
||||
self.labels["speed"+str(i)] = KlippyGtk.ToggleButton(i)
|
||||
self.labels["speed"+str(i)] = self._gtk.ToggleButton(_(i))
|
||||
self.labels["speed"+str(i)].connect("clicked", self.change_speed, i)
|
||||
ctx = self.labels["speed"+str(i)].get_style_context()
|
||||
if j == 0:
|
||||
@@ -91,23 +100,26 @@ class ExtrudePanel(ScreenPanel):
|
||||
|
||||
grid.attach(box, 1, 2, 2, 1)
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage("back", "Back")
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b, 3, 2, 1, 1)
|
||||
|
||||
|
||||
|
||||
self.panel = grid
|
||||
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")
|
||||
)
|
||||
|
||||
if ("toolhead" in data and "extruder" in data["toolhead"] and
|
||||
data["toolhead"]["extruder"] != self.current_extruder):
|
||||
for extruder in self._printer.get_tools():
|
||||
self.labels[extruder].get_style_context().remove_class("button_active")
|
||||
self.current_extruder = data["toolhead"]["extruder"]
|
||||
self.labels[self.current_extruder].get_style_context().add_class("button_active")
|
||||
|
||||
def change_distance(self, widget, distance):
|
||||
if self.distance == distance:
|
||||
return
|
||||
@@ -124,6 +136,12 @@ class ExtrudePanel(ScreenPanel):
|
||||
continue
|
||||
self.labels["dist"+str(i)].set_active(False)
|
||||
|
||||
def change_extruder(self, widget, extruder):
|
||||
if extruder == self.current_extruder:
|
||||
return
|
||||
|
||||
self._screen._ws.klippy.gcode_script("T%s" % self._printer.get_tool_number(extruder))
|
||||
|
||||
def change_speed(self, widget, speed):
|
||||
if self.speed == speed:
|
||||
return
|
||||
|
||||
@@ -4,7 +4,6 @@ import logging
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
@@ -14,12 +13,13 @@ def create_panel(*args):
|
||||
return FanPanel(*args)
|
||||
|
||||
class FanPanel(ScreenPanel):
|
||||
fan_speed = 0
|
||||
user_selecting = False
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
||||
box.set_hexpand(True)
|
||||
@@ -32,17 +32,17 @@ class FanPanel(ScreenPanel):
|
||||
self.labels["scale"].get_style_context().add_class("fan_slider")
|
||||
box.add(self.labels["scale"])
|
||||
|
||||
self.labels["fanoff"] = KlippyGtk.ButtonImage("fan-off", _("Fan Off"))
|
||||
self.labels["fanoff"] = self._gtk.ButtonImage("fan-off", _("Fan Off"))
|
||||
self.labels["fanoff"].get_style_context().add_class("color1")
|
||||
self.labels["fanoff"].connect("clicked", self.set_fan_on, False)
|
||||
self.labels["fanon"] = KlippyGtk.ButtonImage("fan", _("Fan On"))
|
||||
self.labels["fanon"] = self._gtk.ButtonImage("fan", _("Fan On"))
|
||||
self.labels["fanon"].get_style_context().add_class("color3")
|
||||
self.labels["fanon"].connect("clicked", self.set_fan_on, True)
|
||||
|
||||
self.labels["apply"] = KlippyGtk.ButtonImage("resume", _("Set Speed"))
|
||||
self.labels["apply"] = self._gtk.ButtonImage("resume", _("Set Speed"))
|
||||
self.labels["apply"].get_style_context().add_class("color2")
|
||||
self.labels["apply"].connect("clicked", self.set_fan_speed)
|
||||
self.labels["cancel"] = KlippyGtk.ButtonImage("stop", _("Cancel Change"))
|
||||
self.labels["cancel"] = self._gtk.ButtonImage("stop", _("Cancel Change"))
|
||||
self.labels["cancel"].get_style_context().add_class("color4")
|
||||
self.labels["cancel"].connect("clicked", self.cancel_select_fan_speed)
|
||||
self.labels["cancel"].hide()
|
||||
@@ -50,35 +50,35 @@ class FanPanel(ScreenPanel):
|
||||
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"], 1, 2, 1, 1)
|
||||
grid.attach(self.labels["fanon"], 3, 2, 1, 1)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b,3,2,1,1)
|
||||
|
||||
self.panel = grid
|
||||
self.grid = grid
|
||||
self.content.add(grid)
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
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(float(int(float(data["fan"]["speed"]) * 100)))
|
||||
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:
|
||||
return
|
||||
|
||||
self.user_selecting = True
|
||||
self.panel.attach(self.labels["apply"], 3, 0, 1, 1)
|
||||
self.panel.attach(self.labels["cancel"], 0, 0, 1, 1)
|
||||
self.grid.attach(self.labels["apply"], 3, 0, 1, 1)
|
||||
self.grid.attach(self.labels["cancel"], 0, 0, 1, 1)
|
||||
self._screen.show_all()
|
||||
|
||||
def cancel_select_fan_speed(self, widget):
|
||||
self.labels["scale"].set_value(self.fan_speed)
|
||||
self.user_selecting = False
|
||||
self.panel.remove(self.labels["apply"])
|
||||
self.panel.remove(self.labels["cancel"])
|
||||
self.grid.remove(self.labels["apply"])
|
||||
self.grid.remove(self.labels["cancel"])
|
||||
|
||||
|
||||
def set_fan_speed(self, widget):
|
||||
@@ -87,7 +87,9 @@ class FanPanel(ScreenPanel):
|
||||
|
||||
def set_fan_on(self, widget, fanon):
|
||||
speed = 100 if fanon == True else 0
|
||||
self.labels["scale"].disconnect_by_func(self.select_fan_speed)
|
||||
self.labels["scale"].set_value(speed)
|
||||
self.labels["scale"].connect("value-changed", self.select_fan_speed)
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.set_fan_speed(speed))
|
||||
self.fan_speed = float(speed)
|
||||
self.labels["scale"].disconnect_by_func(self.select_fan_speed)
|
||||
self.labels["scale"].set_value(self.fan_speed)
|
||||
self.labels["scale"].connect("value-changed", self.select_fan_speed)
|
||||
self.cancel_select_fan_speed(widget)
|
||||
@@ -4,7 +4,6 @@ import logging
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
@@ -29,57 +28,48 @@ class FineTunePanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
grid.set_row_homogeneous(False)
|
||||
logger.debug("FineTunePanel")
|
||||
|
||||
|
||||
self.labels['z+'] = KlippyGtk.ButtonImage("move-z-", _("Z+"), "color1")
|
||||
self.labels['z+'] = self._gtk.ButtonImage("move-z-", _("Z+"), "color1")
|
||||
self.labels['z+'].connect("clicked", self.change_babystepping, "+")
|
||||
self.labels['zoffset'] = Gtk.Label(_("Z Offset") + ": 0.00" + _("mm"))
|
||||
self.labels['zoffset'] = Gtk.Label("0.00" + _("mm"))
|
||||
self.labels['zoffset'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['z-'] = KlippyGtk.ButtonImage("move-z+", _("Z-"), "color1")
|
||||
self.labels['z-'] = self._gtk.ButtonImage("move-z+", _("Z-"), "color1")
|
||||
self.labels['z-'].connect("clicked", self.change_babystepping, "-")
|
||||
|
||||
grid.attach(self.labels['z+'], 0, 0, 1, 1)
|
||||
grid.attach(self.labels['zoffset'], 0, 1, 1, 1)
|
||||
grid.attach(self.labels['z-'], 0, 2, 1, 1)
|
||||
|
||||
self.labels['fan+'] = KlippyGtk.ButtonImage("fan-on", _("Fan +"), "color2")
|
||||
self.labels['fan+'].connect("clicked", self.change_fan, "+")
|
||||
self.labels['fanspeed'] = Gtk.Label(_("Fan") + ": 100%")
|
||||
self.labels['fanspeed'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['fan-'] = KlippyGtk.ButtonImage("fan-off", _("Fan -"), "color2")
|
||||
self.labels['fan-'].connect("clicked", self.change_fan, "-")
|
||||
grid.attach(self.labels['fan+'], 1, 0, 1, 1)
|
||||
grid.attach(self.labels['fanspeed'], 1, 1, 1, 1)
|
||||
grid.attach(self.labels['fan-'], 1, 2, 1, 1)
|
||||
|
||||
self.labels['speed+'] = KlippyGtk.ButtonImage("speed-step", _("Speed +"), "color3")
|
||||
self.labels['speed+'] = self._gtk.ButtonImage("speed-step", _("Speed +"), "color3")
|
||||
self.labels['speed+'].connect("clicked", self.change_speed, "+")
|
||||
self.labels['speedfactor'] = Gtk.Label(_("Speed") + ": 100%")
|
||||
self.labels['speedfactor'] = Gtk.Label("100%")
|
||||
self.labels['speedfactor'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['speed-'] = KlippyGtk.ButtonImage("speed-step", _("Speed -"), "color3")
|
||||
self.labels['speed-'] = self._gtk.ButtonImage("speed-step", _("Speed -"), "color3")
|
||||
self.labels['speed-'].connect("clicked", self.change_speed, "-")
|
||||
grid.attach(self.labels['speed+'], 2, 0, 1, 1)
|
||||
grid.attach(self.labels['speedfactor'], 2, 1, 1, 1)
|
||||
grid.attach(self.labels['speed-'], 2, 2, 1, 1)
|
||||
grid.attach(self.labels['speed+'], 1, 0, 1, 1)
|
||||
grid.attach(self.labels['speedfactor'], 1, 1, 1, 1)
|
||||
grid.attach(self.labels['speed-'], 1, 2, 1, 1)
|
||||
|
||||
self.labels['extrude+'] = KlippyGtk.ButtonImage("extrude", _("Extrusion +"), "color4")
|
||||
self.labels['extrude+'] = self._gtk.ButtonImage("extrude", _("Extrusion +"), "color4")
|
||||
self.labels['extrude+'].connect("clicked", self.change_extrusion, "+")
|
||||
self.labels['extrudefactor'] = Gtk.Label(_("Extrusion") + ": 100%")
|
||||
self.labels['extrudefactor'] = Gtk.Label("100%")
|
||||
self.labels['extrudefactor'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['extrude-'] = KlippyGtk.ButtonImage("retract", _("Extrusion -"), "color4")
|
||||
self.labels['extrude-'] = self._gtk.ButtonImage("retract", _("Extrusion -"), "color4")
|
||||
self.labels['extrude-'].connect("clicked", self.change_extrusion, "-")
|
||||
grid.attach(self.labels['extrude+'], 3, 0, 1, 1)
|
||||
grid.attach(self.labels['extrudefactor'], 3, 1, 1, 1)
|
||||
grid.attach(self.labels['extrude-'], 3, 2, 1, 1)
|
||||
grid.attach(self.labels['extrude+'], 2, 0, 1, 1)
|
||||
grid.attach(self.labels['extrudefactor'], 2, 1, 1, 1)
|
||||
grid.attach(self.labels['extrude-'], 2, 2, 1, 1)
|
||||
|
||||
|
||||
# babystepping grid
|
||||
bsgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.bs_deltas:
|
||||
self.labels[i] = KlippyGtk.ToggleButton(i)
|
||||
self.labels[i] = self._gtk.ToggleButton(i)
|
||||
self.labels[i].connect("clicked", self.change_bs_delta, i)
|
||||
ctx = self.labels[i].get_style_context()
|
||||
if j == 0:
|
||||
@@ -98,7 +88,7 @@ class FineTunePanel(ScreenPanel):
|
||||
deltgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.percent_deltas:
|
||||
self.labels[i] = KlippyGtk.ToggleButton("%s%%" % i)
|
||||
self.labels[i] = self._gtk.ToggleButton("%s%%" % i)
|
||||
self.labels[i].connect("clicked", self.change_percent_delta, i)
|
||||
ctx = self.labels[i].get_style_context()
|
||||
if j == 0:
|
||||
@@ -116,14 +106,8 @@ class FineTunePanel(ScreenPanel):
|
||||
|
||||
grid.attach(deltgrid, 1, 3, 2, 1)
|
||||
|
||||
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b,3,3,1,1)
|
||||
|
||||
self.panel = grid
|
||||
#self.panel = grid
|
||||
self.content.add(grid)
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def process_update(self, action, data):
|
||||
@@ -134,17 +118,13 @@ class FineTunePanel(ScreenPanel):
|
||||
|
||||
if "gcode_move" in data:
|
||||
if "homing_origin" in data["gcode_move"]:
|
||||
self.labels['zoffset'].set_text(_("Z Offset") + ": %.2fmm" % data["gcode_move"]["homing_origin"][2])
|
||||
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['extrudefactor'].set_text(_("Extrusion") + ": %3d%%" % self.extrusion)
|
||||
self.labels['extrudefactor'].set_text("%3d%%" % self.extrusion)
|
||||
if "speed_factor" in data["gcode_move"]:
|
||||
self.speed = int(data["gcode_move"]["speed_factor"]*100)
|
||||
self.labels['speedfactor'].set_text(_("Speed") + ": %3d%%" % self.speed)
|
||||
|
||||
if "fan" in data and "speed" in data['fan']:
|
||||
self.fan = int(round(data['fan']['speed'],2)*100)
|
||||
self.labels['fanspeed'].set_text(_("Fan") + ": %3d%%" % self.fan)
|
||||
self.labels['speedfactor'].set_text("%3d%%" % self.speed)
|
||||
|
||||
def change_babystepping(self, widget, dir):
|
||||
if dir == "+":
|
||||
@@ -222,19 +202,3 @@ class FineTunePanel(ScreenPanel):
|
||||
if i == self.percent_delta:
|
||||
continue
|
||||
self.labels[str(i)].set_active(False)
|
||||
|
||||
#def
|
||||
|
||||
def select_fan_speed(self, widget):
|
||||
if self.user_selecting == True:
|
||||
return
|
||||
|
||||
self.user_selecting = True
|
||||
self.panel.attach(self.labels["apply"], 3, 0, 1, 1)
|
||||
self.panel.attach(self.labels["cancel"], 0, 0, 1, 1)
|
||||
self._screen.show_all()
|
||||
|
||||
def cancel_select_fan_speed(self, widget):
|
||||
self.user_selecting = False
|
||||
self.panel.remove(self.labels["apply"])
|
||||
self.panel.remove(self.labels["cancel"])
|
||||
@@ -0,0 +1,106 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.Macro")
|
||||
|
||||
def create_panel(*args):
|
||||
return MacroPanel(*args)
|
||||
|
||||
class MacroPanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
self.macros = {}
|
||||
self.loaded_macros = []
|
||||
|
||||
# Create a scroll window for the macros
|
||||
scroll = Gtk.ScrolledWindow()
|
||||
scroll.set_property("overlay-scrolling", False)
|
||||
scroll.set_vexpand(True)
|
||||
|
||||
# Create a grid for all macros
|
||||
self.labels['macros'] = Gtk.Grid()
|
||||
scroll.add(self.labels['macros'])
|
||||
|
||||
# Create a box to contain all of the above
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||
box.set_vexpand(True)
|
||||
box.pack_start(scroll, True, True, 0)
|
||||
|
||||
self.content.add(box)
|
||||
|
||||
def activate(self):
|
||||
self.unload_gcode_macros()
|
||||
self.load_gcode_macros()
|
||||
|
||||
def add_gcode_macro(self, macro):
|
||||
|
||||
frame = Gtk.Frame()
|
||||
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
|
||||
frame.get_style_context().add_class("frame-item")
|
||||
|
||||
name = Gtk.Label()
|
||||
name.set_markup("<big><b>%s</b></big>" % (macro))
|
||||
name.set_hexpand(True)
|
||||
name.set_vexpand(True)
|
||||
name.set_halign(Gtk.Align.START)
|
||||
name.set_valign(Gtk.Align.CENTER)
|
||||
name.set_line_wrap(True)
|
||||
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
open = self._gtk.ButtonImage("open",None,"color3")
|
||||
open.connect("clicked", self.run_gcode_macro, macro)
|
||||
open.set_hexpand(False)
|
||||
open.set_halign(Gtk.Align.END)
|
||||
|
||||
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
labels.add(name)
|
||||
|
||||
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
dev.set_hexpand(True)
|
||||
dev.set_vexpand(False)
|
||||
|
||||
dev.add(labels)
|
||||
dev.add(open)
|
||||
frame.add(dev)
|
||||
|
||||
self.macros[macro] = {
|
||||
"row": frame
|
||||
}
|
||||
|
||||
macros = sorted(self.macros)
|
||||
pos = macros.index(macro)
|
||||
|
||||
self.loaded_macros.append(macro)
|
||||
self.labels['macros'].insert_row(pos)
|
||||
self.labels['macros'].attach(self.macros[macro]['row'], 0, pos, 1, 1)
|
||||
self.labels['macros'].show_all()
|
||||
|
||||
def load_gcode_macros(self):
|
||||
macros = self._screen.printer.get_gcode_macros()
|
||||
for x in macros:
|
||||
macro = x[12:]
|
||||
|
||||
if macro in self.loaded_macros:
|
||||
continue
|
||||
|
||||
if ("displayed_macros" not in self._config.get_config().sections() or
|
||||
self._config.get_config().getboolean("displayed_macros", macro, fallback=True)):
|
||||
self.add_gcode_macro(macro)
|
||||
|
||||
def run_gcode_macro(self, widget, macro):
|
||||
self._screen._ws.klippy.gcode_script(macro)
|
||||
|
||||
def unload_gcode_macros(self):
|
||||
for macro in self.loaded_macros:
|
||||
if ("displayed_macros" in self._config.get_config().sections() and
|
||||
not self._config.get_config().getboolean("displayed_macros", macro, fallback=True)):
|
||||
macros = sorted(self.macros)
|
||||
pos = macros.index(macro)
|
||||
self.labels['macros'].remove_row(pos)
|
||||
self.labels['macros'].show_all()
|
||||
@@ -1,10 +1,11 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import gi
|
||||
import logging
|
||||
import math
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.JobStatusPanel")
|
||||
@@ -15,33 +16,40 @@ def create_panel(*args):
|
||||
class JobStatusPanel(ScreenPanel):
|
||||
is_paused = False
|
||||
filename = None
|
||||
file_metadata = {}
|
||||
progress = 0
|
||||
state = "printing"
|
||||
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
self.layout = Gtk.Layout()
|
||||
self.layout.set_size(self._screen.width, self._screen.height)
|
||||
|
||||
self.labels['progress'] = KlippyGtk.ProgressBar("printing-progress-bar")
|
||||
#self.labels['progress'].set_vexpand(True)
|
||||
#self.labels['progress'].set_valign(Gtk.Align.CENTER)
|
||||
self.labels['progress'].set_show_text(False)
|
||||
#self.labels['progress'].set_margin_top(10)
|
||||
self.labels['progress'].set_margin_end(20)
|
||||
self.labels['progress_text'] = Gtk.Label()
|
||||
self.labels['progress_text'].get_style_context().add_class("printing-progress-text")
|
||||
overlay = Gtk.Overlay()
|
||||
overlay.add(self.labels['progress'])
|
||||
overlay.add_overlay(self.labels['progress_text'])
|
||||
self.create_buttons()
|
||||
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
grid.set_size_request(self._screen.width, self._screen.height)
|
||||
|
||||
fi_box = Gtk.VBox(spacing=0)
|
||||
fi_box.set_hexpand(True)
|
||||
fi_box.set_vexpand(False)
|
||||
fi_box.set_halign(Gtk.Align.START)
|
||||
|
||||
self.labels['file'] = Gtk.Label(label="file")
|
||||
self.labels['file'].set_halign(Gtk.Align.START)
|
||||
self.labels['file'].set_vexpand(False)
|
||||
self.labels['file'].get_style_context().add_class("printing-filename")
|
||||
self.labels['file'].set_line_wrap(True)
|
||||
self.labels['file'].set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
self.labels['status'] = Gtk.Label()
|
||||
self.labels['status'].set_halign(Gtk.Align.START)
|
||||
self.labels['status'].set_vexpand(False)
|
||||
self.labels['status'].get_style_context().add_class("printing-status")
|
||||
|
||||
fi_box.add(self.labels['file']) #, True, True, 0)
|
||||
fi_box.add(self.labels['status']) #, True, True, 0)
|
||||
fi_box.set_valign(Gtk.Align.CENTER)
|
||||
|
||||
self.labels['file'] = KlippyGtk.ImageLabel("file","",20,"printing-status-label")
|
||||
self.labels['time_label'] = KlippyGtk.ImageLabel("speed-step",_("Time Elapsed"),20,"printing-status-label")
|
||||
self.labels['time'] = KlippyGtk.Label(_("Time Elapsed"),"printing-status-label")
|
||||
self.labels['time_left_label'] = KlippyGtk.ImageLabel("speed-step",_("Time Left"),20,"printing-status-label")
|
||||
self.labels['time_left'] = KlippyGtk.Label(_("Time Left"),"printing-status-label")
|
||||
timegrid = Gtk.Grid()
|
||||
timegrid.attach(self.labels['time_label']['b'], 0, 0, 1, 1)
|
||||
timegrid.attach(self.labels['time'], 0, 1, 1, 1)
|
||||
timegrid.attach(self.labels['time_left_label']['b'], 1, 0, 1, 1)
|
||||
timegrid.attach(self.labels['time_left'], 1, 1, 1, 1)
|
||||
info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
info.props.valign = Gtk.Align.CENTER
|
||||
info.set_hexpand(True)
|
||||
@@ -52,75 +60,255 @@ class JobStatusPanel(ScreenPanel):
|
||||
|
||||
#grid.attach(info,2,0,2,1)
|
||||
|
||||
pbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
pbox.pack_start(self.labels['file']['b'], False, True, 0)
|
||||
pbox.pack_end(timegrid, False, False, 0)
|
||||
#pbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
#pbox.pack_start(self.labels['file']['b'], False, True, 0)
|
||||
#pbox.pack_end(timegrid, False, False, 0)
|
||||
#pbox.pack_end(self.labels['progress'], False, False, 0)
|
||||
pbox.pack_end(overlay, False, False, 0)
|
||||
#pbox.pack_end(overlay, False, False, 0)
|
||||
|
||||
grid.attach(pbox, 1, 0, 3, 2)
|
||||
#grid.attach(pbox, 0, 0, 4, 3)
|
||||
self.labels['darea'] = Gtk.DrawingArea()
|
||||
self.labels['darea'].connect("draw", self.on_draw)
|
||||
|
||||
self.labels['extruder'] = KlippyGtk.ButtonImage("extruder-1", KlippyGtk.formatTemperatureString(0, 0))
|
||||
self.labels['extruder'].set_sensitive(False)
|
||||
grid.attach(self.labels['extruder'], 0, 0, 1, 1)
|
||||
box = Gtk.Box()
|
||||
box.set_hexpand(True)
|
||||
box.set_vexpand(True)
|
||||
box.set_halign(Gtk.Align.CENTER)
|
||||
self.labels['progress_text'] = Gtk.Label()
|
||||
self.labels['progress_text'].get_style_context().add_class("printing-progress-text")
|
||||
box.add(self.labels['progress_text'])
|
||||
|
||||
self.labels['heater_bed'] = KlippyGtk.ButtonImage("bed", KlippyGtk.formatTemperatureString(0, 0))
|
||||
self.labels['heater_bed'].set_sensitive(False)
|
||||
grid.attach(self.labels['heater_bed'], 0, 1, 1, 1)
|
||||
overlay = Gtk.Overlay()
|
||||
overlay.set_hexpand(True)
|
||||
overlay.set_vexpand(True)
|
||||
overlay.add(self.labels['darea'])
|
||||
overlay.add_overlay(box)
|
||||
|
||||
self.labels['resume'] = KlippyGtk.ButtonImage("resume",_("Resume"),"color1")
|
||||
self.labels['resume'].connect("clicked",self.resume)
|
||||
self.labels['pause'] = KlippyGtk.ButtonImage("pause",_("Pause"),"color1" )
|
||||
self.labels['pause'].connect("clicked",self.pause)
|
||||
#self.labels['extruder'] = self._gtk.ButtonImage("extruder-1", self._gtk.formatTemperatureString(0, 0))
|
||||
#self.labels['extruder'].set_sensitive(False)
|
||||
#grid.attach(self.labels['extruder'], 0, 0, 1, 1)
|
||||
|
||||
if self._printer.get_stat('pause_resume','is_paused') == True:
|
||||
self.is_paused = True
|
||||
grid.attach(self.labels['resume'], 0, 2, 1, 1)
|
||||
else:
|
||||
grid.attach(self.labels['pause'], 0, 2, 1, 1)
|
||||
#self.labels['heater_bed'] = self._gtk.ButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
|
||||
#self.labels['heater_bed'].set_sensitive(False)
|
||||
#grid.attach(self.labels['heater_bed'], 0, 1, 1, 1)
|
||||
|
||||
self.labels['cancel'] = KlippyGtk.ButtonImage("stop",_("Cancel"),"color2")
|
||||
self.labels['cancel'].connect("clicked", self.cancel)
|
||||
grid.attach(self.labels['cancel'], 1, 2, 1, 1)
|
||||
self.labels['estop'] = KlippyGtk.ButtonImage("decrease",_("Emergency Stop"),"color4")
|
||||
self.labels['estop'].connect("clicked", self.emergency_stop)
|
||||
grid.attach(self.labels['estop'], 2, 2, 1, 1)
|
||||
self.labels['control'] = KlippyGtk.ButtonImage("control",_("Control"),"color3")
|
||||
self.labels['control'].connect("clicked", self._screen._go_to_submenu, "")
|
||||
grid.attach(self.labels['control'], 3, 2, 1, 1)
|
||||
self.labels['thumbnail'] = self._gtk.Image("file.svg", False, 1.6, 1.6)
|
||||
|
||||
self.panel = grid
|
||||
i = 0
|
||||
for extruder in self._printer.get_tools():
|
||||
self.labels[extruder + '_box'] = Gtk.Box(spacing=0)
|
||||
self.labels[extruder] = Gtk.Label(label="")
|
||||
self.labels[extruder].get_style_context().add_class("printing-info")
|
||||
if i <= 4:
|
||||
ext_img = self._gtk.Image("extruder-%s.svg" % i, None, .6, .6)
|
||||
self.labels[extruder + '_box'].add(ext_img)
|
||||
self.labels[extruder + '_box'].add(self.labels[extruder])
|
||||
i += 1
|
||||
|
||||
temp_grid = self._gtk.HomogeneousGrid()
|
||||
self.current_extruder = self._printer.get_stat("toolhead","extruder")
|
||||
temp_grid.attach(self.labels[self.current_extruder + '_box'], 0, 0, 1, 1)
|
||||
if self._printer.has_heated_bed():
|
||||
heater_bed = self._gtk.Image("bed.svg", None, .6, .6)
|
||||
self.labels['heater_bed'] = Gtk.Label(label="")
|
||||
self.labels['heater_bed'].get_style_context().add_class("printing-info")
|
||||
heater_bed_box = Gtk.Box(spacing=0)
|
||||
heater_bed_box.add(heater_bed)
|
||||
heater_bed_box.add(self.labels['heater_bed'])
|
||||
temp_grid.attach(heater_bed_box, 1, 0, 1, 1)
|
||||
self.labels['temp_grid'] = temp_grid
|
||||
|
||||
# Create time remaining items
|
||||
hourglass = self._gtk.Image("hourglass.svg", None, .6, .6)
|
||||
self.labels['left'] = Gtk.Label(label=_("Left:"))
|
||||
self.labels['left'].get_style_context().add_class("printing-info")
|
||||
self.labels['time_left'] = Gtk.Label(label="0s")
|
||||
self.labels['time_left'].get_style_context().add_class("printing-info")
|
||||
itl_box = Gtk.Box(spacing=0)
|
||||
itl_box.add(hourglass)
|
||||
itl_box.add(self.labels['left'])
|
||||
itl_box.add(self.labels['time_left'])
|
||||
self.labels['itl_box'] = itl_box
|
||||
|
||||
# Create overall items
|
||||
clock = self._gtk.Image("clock.svg", None, .6, .6)
|
||||
self.labels['elapsed'] = Gtk.Label(label=_("Elapsed:"))
|
||||
self.labels['elapsed'].get_style_context().add_class("printing-info")
|
||||
self.labels['duration'] = Gtk.Label(label="0s")
|
||||
self.labels['duration'].get_style_context().add_class("printing-info")
|
||||
self.labels['est_time'] = Gtk.Label(label="/ 0s")
|
||||
self.labels['est_time'].get_style_context().add_class("printing-info")
|
||||
it_box = Gtk.Box(spacing=0)
|
||||
it_box.add(clock)
|
||||
it_box.add(self.labels['elapsed'])
|
||||
it_box.add(self.labels['duration'])
|
||||
it_box.add(self.labels['est_time'])
|
||||
self.labels['it_box'] = it_box
|
||||
|
||||
position = self._gtk.Image("move.svg", None, .6, .6)
|
||||
self.labels['pos_x'] = Gtk.Label(label="X: 0")
|
||||
self.labels['pos_x'].get_style_context().add_class("printing-info")
|
||||
self.labels['pos_y'] = Gtk.Label(label="Y: 0")
|
||||
self.labels['pos_y'].get_style_context().add_class("printing-info")
|
||||
self.labels['pos_z'] = Gtk.Label(label="Z: 0")
|
||||
self.labels['pos_z'].get_style_context().add_class("printing-info")
|
||||
pos_box = Gtk.Box(spacing=0)
|
||||
posgrid = self._gtk.HomogeneousGrid()
|
||||
posgrid.set_hexpand(True)
|
||||
posgrid.attach(self.labels['pos_x'], 0, 0, 1, 1)
|
||||
posgrid.attach(self.labels['pos_y'], 1, 0, 1, 1)
|
||||
posgrid.attach(self.labels['pos_z'], 2, 0, 1, 1)
|
||||
pos_box.add(position)
|
||||
pos_box.add(posgrid)
|
||||
self.labels['pos_box'] = pos_box
|
||||
|
||||
speed = self._gtk.Image("speed-step.svg", None, .6, .6)
|
||||
self.labels['speed'] = Gtk.Label(label="")
|
||||
self.labels['speed'].get_style_context().add_class("printing-info")
|
||||
speed_box = Gtk.Box(spacing=0)
|
||||
speed_box.add(speed)
|
||||
speed_box.add(self.labels['speed'])
|
||||
extrusion = self._gtk.Image("extrude.svg", None, .6, .6)
|
||||
self.labels['extrusion'] = Gtk.Label(label="")
|
||||
self.labels['extrusion'].get_style_context().add_class("printing-info")
|
||||
extrusion_box = Gtk.Box(spacing=0)
|
||||
extrusion_box.add(extrusion)
|
||||
extrusion_box.add(self.labels['extrusion'])
|
||||
fan = self._gtk.Image("fan.svg", None, .6, .6)
|
||||
self.labels['fan'] = Gtk.Label(label="")
|
||||
self.labels['fan'].get_style_context().add_class("printing-info")
|
||||
fan_box = Gtk.Box(spacing=0)
|
||||
fan_box.add(fan)
|
||||
fan_box.add(self.labels['fan'])
|
||||
sfe_grid = self._gtk.HomogeneousGrid()
|
||||
sfe_grid.set_hexpand(True)
|
||||
sfe_grid.attach(speed_box, 0, 0, 1, 1)
|
||||
sfe_grid.attach(extrusion_box, 1, 0, 1, 1)
|
||||
sfe_grid.attach(fan_box, 2, 0, 1, 1)
|
||||
self.labels['sfe_grid'] = sfe_grid
|
||||
|
||||
self.labels['i1_box'] = Gtk.VBox(spacing=0)
|
||||
self.labels['i1_box'].get_style_context().add_class("printing-info-box")
|
||||
self.labels['i1_box'].set_valign(Gtk.Align.CENTER)
|
||||
self.labels['i2_box'] = Gtk.VBox(spacing=0)
|
||||
self.labels['i2_box'].get_style_context().add_class("printing-info-box")
|
||||
|
||||
grid.attach(overlay, 0, 0, 1, 1)
|
||||
grid.attach(fi_box, 1, 0, 3, 1)
|
||||
grid.attach(self.labels['i1_box'], 0, 1, 2, 2)
|
||||
grid.attach(self.labels['i2_box'], 2, 1, 2, 2)
|
||||
|
||||
self.add_labels()
|
||||
|
||||
self.grid = grid
|
||||
self.layout.put(grid, 0, 0)
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def on_draw(self, da, ctx):
|
||||
w = da.get_allocated_width()
|
||||
h = da.get_allocated_height()
|
||||
r = min(w,h)*.4
|
||||
|
||||
ctx.set_source_rgb(0.6, 0.6, 0.6)
|
||||
ctx.set_line_width(self._gtk.get_font_size() * .75)
|
||||
ctx.translate(w / 2, h / 2)
|
||||
ctx.arc(0, 0, r, 0, 2*math.pi)
|
||||
ctx.stroke()
|
||||
|
||||
ctx.set_source_rgb(1, 0, 0)
|
||||
ctx.arc(0, 0, r, 3/2*math.pi, 3/2*math.pi+(self.progress*2*math.pi))
|
||||
ctx.stroke()
|
||||
|
||||
|
||||
def activate(self):
|
||||
_ = self.lang.gettext
|
||||
self.progress = self._printer.get_stat('virtual_sdcard','progress')
|
||||
self.update_progress()
|
||||
self.enable_button("pause","cancel","resume")
|
||||
|
||||
state = "printing"
|
||||
self.update_text("status",_("Printing"))
|
||||
|
||||
self.filename = self._printer.get_stat('print_stats','filename')
|
||||
self.update_file_metadata()
|
||||
|
||||
self.grid.remove_row(3)
|
||||
self.grid.insert_row(3)
|
||||
|
||||
ps = self._printer.get_stat("print_stats")
|
||||
logger.debug("Act State: %s" % ps['state'])
|
||||
self.set_state(ps['state'])
|
||||
self.show_buttons_for_state()
|
||||
|
||||
def add_labels(self):
|
||||
for child in self.labels['i1_box'].get_children():
|
||||
self.labels['i1_box'].remove(child)
|
||||
for child in self.labels['i2_box'].get_children():
|
||||
self.labels['i2_box'].remove(child)
|
||||
|
||||
#if self.file_metadata == None:
|
||||
# self.labels['i1_box'].add(self.labels['temp_grid'])
|
||||
# self.labels['i1_box'].add(self.labels['pos_box'])
|
||||
# self.labels['i1_box'].add(self.labels['sfe_grid'])
|
||||
# self.labels['i2_box'].add(self.labels['it_box'])
|
||||
# self.labels['i2_box'].add(self.labels['itl_box'])
|
||||
#else:
|
||||
self.labels['i1_box'].add(self.labels['thumbnail'])
|
||||
self.labels['i2_box'].add(self.labels['temp_grid'])
|
||||
self.labels['i2_box'].add(self.labels['pos_box'])
|
||||
self.labels['i2_box'].add(self.labels['sfe_grid'])
|
||||
self.labels['i2_box'].add(self.labels['it_box'])
|
||||
self.labels['i2_box'].add(self.labels['itl_box'])
|
||||
|
||||
|
||||
def create_buttons(self):
|
||||
_ = self.lang.gettext
|
||||
self.labels['cancel'] = self._gtk.ButtonImage("stop",_("Cancel"),"color2")
|
||||
self.labels['cancel'].connect("clicked", self.cancel)
|
||||
self.labels['control'] = self._gtk.ButtonImage("control",_("Control"),"color3")
|
||||
self.labels['control'].connect("clicked", self._screen._go_to_submenu, "")
|
||||
self.labels['estop'] = self._gtk.ButtonImage("emergency",_("Emergency Stop"),"color4")
|
||||
self.labels['estop'].connect("clicked", self.emergency_stop)
|
||||
self.labels['menu'] = self._gtk.ButtonImage("complete",_("Main Menu"),"color4")
|
||||
self.labels['menu'].connect("clicked", self.close_panel)
|
||||
self.labels['pause'] = self._gtk.ButtonImage("pause",_("Pause"),"color1" )
|
||||
self.labels['pause'].connect("clicked",self.pause)
|
||||
self.labels['restart'] = self._gtk.ButtonImage("restart",_("Restart"),"color3")
|
||||
self.labels['restart'].connect("clicked", self.restart)
|
||||
self.labels['resume'] = self._gtk.ButtonImage("resume",_("Resume"),"color1")
|
||||
self.labels['resume'].connect("clicked",self.resume)
|
||||
|
||||
def restart(self, widget):
|
||||
if self.filename != "none":
|
||||
self._screen._ws.klippy.print_start(self.filename)
|
||||
|
||||
def resume(self, widget):
|
||||
self.disable_button("pause","cancel")
|
||||
#self.disable_button("resume","cancel")
|
||||
self._screen._ws.klippy.print_resume(self._response_callback, "enable_button", "pause", "cancel")
|
||||
self._screen.show_all()
|
||||
|
||||
def pause(self, widget):
|
||||
self.disable_button("resume","cancel")
|
||||
#self.disable_button("pause","cancel")
|
||||
self._screen._ws.klippy.print_pause(self._response_callback, "enable_button", "resume", "cancel")
|
||||
self._screen.show_all()
|
||||
|
||||
def cancel(self, widget):
|
||||
_ = self.lang.gettext
|
||||
|
||||
dialog = KlippyGtk.ConfirmDialog(
|
||||
self._screen,
|
||||
_("Are you sure you wish to cancel this print?"),
|
||||
[
|
||||
{
|
||||
"name": _("Cancel Print"),
|
||||
"response": Gtk.ResponseType.OK
|
||||
},
|
||||
{
|
||||
"name": _("Go Back"),
|
||||
"response": Gtk.ResponseType.CANCEL
|
||||
}
|
||||
],
|
||||
self.cancel_confirm
|
||||
)
|
||||
buttons = [
|
||||
{"name": _("Cancel Print"), "response": Gtk.ResponseType.OK},
|
||||
{"name": _("Go Back"), "response": Gtk.ResponseType.CANCEL}
|
||||
]
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_markup(_("Are you sure you wish to cancel this print?"))
|
||||
label.set_hexpand(True)
|
||||
label.set_halign(Gtk.Align.CENTER)
|
||||
label.set_line_wrap(True)
|
||||
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
dialog = self._gtk.Dialog(self._screen, buttons, label, self.cancel_confirm)
|
||||
self.disable_button("pause","cancel")
|
||||
|
||||
def cancel_confirm(self, widget, response_id):
|
||||
@@ -130,12 +318,19 @@ class JobStatusPanel(ScreenPanel):
|
||||
self.enable_button("pause","cancel")
|
||||
return
|
||||
|
||||
self._screen._ws.klippy.print_cancel(self._response_callback, "enable_button", "pause", "cancel")
|
||||
logger.debug("Canceling print")
|
||||
self.disable_button("pause","resume","cancel")
|
||||
self._screen._ws.klippy.print_cancel(self._response_callback)
|
||||
|
||||
def _response_callback(self, response, method, params, func, *args):
|
||||
if func == "enable_button":
|
||||
self.enable_button(*args)
|
||||
|
||||
def close_panel(self, widget=None):
|
||||
if self._screen.is_printing():
|
||||
self._screen.printer_ready()
|
||||
return False
|
||||
|
||||
def enable_button(self, *args):
|
||||
for arg in args:
|
||||
self.labels[arg].set_sensitive(True)
|
||||
@@ -144,54 +339,171 @@ class JobStatusPanel(ScreenPanel):
|
||||
for arg in args:
|
||||
self.labels[arg].set_sensitive(False)
|
||||
|
||||
def _callback_metadata(self, newfiles, deletedfiles, modifiedfiles):
|
||||
if self.file_metadata == None and self.filename in modifiedfiles:
|
||||
self.update_file_metadata()
|
||||
self._files.remove_file_callback(self._callback_metadata)
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action != "notify_status_update":
|
||||
return
|
||||
|
||||
self.update_temp("heater_bed",
|
||||
self._printer.get_dev_stat("heater_bed","temperature"),
|
||||
self._printer.get_dev_stat("heater_bed","target")
|
||||
)
|
||||
_ = 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")
|
||||
)
|
||||
for x in self._printer.get_tools():
|
||||
self.update_temp(x,
|
||||
self._printer.get_dev_stat(x,"temperature"),
|
||||
self._printer.get_dev_stat(x,"target")
|
||||
)
|
||||
|
||||
vsd = self._printer.get_stat("print_stats")
|
||||
if "filename" in vsd and self.filename != vsd['filename']:
|
||||
if vsd['filename'] != "":
|
||||
self.filename = KlippyGtk.formatFileName(vsd['filename'])
|
||||
self.update_image_text("file", self.filename)
|
||||
else:
|
||||
file = "Unknown"
|
||||
self.update_image_text("file", "Unknown")
|
||||
|
||||
if "toolhead" in data:
|
||||
if "extruder" in data["toolhead"]:
|
||||
if data["toolhead"]["extruder"] != self.current_extruder:
|
||||
self.labels['temp_grid'].remove_column(0)
|
||||
self.labels['temp_grid'].insert_column(0)
|
||||
self.current_extruder = data["toolhead"]["extruder"]
|
||||
self.labels['temp_grid'].attach(self.labels[self.current_extruder + '_box'], 0, 0, 1, 1)
|
||||
self._screen.show_all()
|
||||
if "position" in data["toolhead"]:
|
||||
self.labels['pos_x'].set_text("X: %.2f" % (data["toolhead"]["position"][0]))
|
||||
self.labels['pos_y'].set_text("Y: %.2f" % (data["toolhead"]["position"][1]))
|
||||
if "gcode_move" in data and "gcode_position" in data["gcode_move"]:
|
||||
self.labels['pos_z'].set_text("Z: %.2f" % (data["gcode_move"]["gcode_position"][2]))
|
||||
|
||||
progress = 0 if self._printer.get_stat('virtual_sdcard','progress') == 0 else (vsd['print_duration'] /
|
||||
self._printer.get_stat('virtual_sdcard','progress') - vsd['print_duration'])
|
||||
if "gcode_move" in data:
|
||||
#if "homing_origin" in data["gcode_move"]:
|
||||
# self.labels['zoffset'].set_text("%.2fmm" % data["gcode_move"]["homing_origin"][2])
|
||||
if "extrude_factor" in data["gcode_move"]:
|
||||
self.extrusion = int(data["gcode_move"]["extrude_factor"]*100)
|
||||
self.labels['extrusion'].set_text("%3d%%" % self.extrusion)
|
||||
if "speed_factor" in data["gcode_move"]:
|
||||
self.speed = int(data["gcode_move"]["speed_factor"]*100)
|
||||
self.labels['speed'].set_text("%3d%%" % self.speed)
|
||||
if "fan" in data and "speed" in data['fan']:
|
||||
self.fan = int(round(data['fan']['speed'],2)*100)
|
||||
self.labels['fan'].set_text("%3d%%" % self.fan)
|
||||
|
||||
self.update_text("time", str(KlippyGtk.formatTimeString(vsd['print_duration'])))
|
||||
self.update_text("time_left", str(KlippyGtk.formatTimeString(
|
||||
progress
|
||||
)))
|
||||
if "print_stats" in data or "virtual_sdcard" in data:
|
||||
ps = self._printer.get_stat("print_stats")
|
||||
vsd = self._printer.get_stat("virtual_sdcard")
|
||||
if ps['state'] == "printing" and self.state != "printing":
|
||||
self.set_state("printing")
|
||||
self.show_buttons_for_state()
|
||||
if ps['state'] == "complete" and self.state != "complete":
|
||||
self.progress = 1
|
||||
self.update_progress()
|
||||
self.set_state("complete")
|
||||
self.show_buttons_for_state()
|
||||
timeout = self._config.get_main_config().getint("job_complete_timeout", 30)
|
||||
if timeout != 0:
|
||||
GLib.timeout_add(timeout * 1000, self.close_panel)
|
||||
elif ps['state'] == "error" and self.state != "error":
|
||||
logger.debug("Error!")
|
||||
self.set_state("error")
|
||||
self.labels['status'].set_text("Error - %s" % ps['message'])
|
||||
self.show_buttons_for_state()
|
||||
timeout = self._config.get_main_config().getint("job_error_timeout", 0)
|
||||
if timeout != 0:
|
||||
GLib.timeout_add(timeout * 1000, self.close_panel)
|
||||
elif ps['state'] == "standby":
|
||||
self.close_panel()
|
||||
|
||||
self.update_progress(self._printer.get_stat('virtual_sdcard','progress'))
|
||||
if self.filename != ps['filename']:
|
||||
if ps['filename'] != "":
|
||||
self.filename = ps['filename']
|
||||
self.file_metadata = None
|
||||
self.update_text("file", self.filename.split("/")[-1])
|
||||
else:
|
||||
file = "Unknown"
|
||||
self.update_text("file", "Unknown file")
|
||||
|
||||
if "pause_resume" in data:
|
||||
if self.is_paused == True and data['pause_resume']['is_paused'] == False:
|
||||
self.is_paused = False
|
||||
self.panel.attach(self.labels['pause'], 0, 2, 1, 1)
|
||||
self.panel.remove(self.labels['resume'])
|
||||
self.panel.show_all()
|
||||
if self.is_paused == False and data['pause_resume']['is_paused'] == True:
|
||||
self.is_paused = True
|
||||
self.panel.attach(self.labels['resume'], 0, 2, 1, 1)
|
||||
self.panel.remove(self.labels['pause'])
|
||||
self.panel.show_all()
|
||||
if self.file_metadata != None:
|
||||
if "gcode_start_byte" in self.file_metadata:
|
||||
progress = (max(vsd['file_position'] - self.file_metadata['gcode_start_byte'],0) /
|
||||
(self.file_metadata['gcode_end_byte'] - self.file_metadata['gcode_start_byte']))
|
||||
else:
|
||||
progress = 0 if self._printer.get_stat('virtual_sdcard','progress') == 0 else (ps['print_duration']/
|
||||
self._printer.get_stat('virtual_sdcard','progress') - ps['print_duration'])
|
||||
progress = round(progress,2)
|
||||
|
||||
if progress != self.progress:
|
||||
self.progress = progress
|
||||
self.labels['darea'].queue_draw()
|
||||
|
||||
if ps['print_duration'] == 0:
|
||||
time_left = self.file_metadata['estimated_time'] if "estimated_time" in self.file_metadata else 0
|
||||
else:
|
||||
est_time = self.file_metadata['estimated_time'] if "estimated_time" in self.file_metadata else 0
|
||||
time_left = max(
|
||||
est_time - ps['print_duration'] ,
|
||||
0 #ps['print_duration'] / (vsd['progress'] if vsd['progress'] != 0 else 1)
|
||||
)
|
||||
|
||||
self.update_text("duration", str(self._gtk.formatTimeString(ps['print_duration'])))
|
||||
self.update_text("time_left", str(self._gtk.formatTimeString(time_left)))
|
||||
self.update_progress()
|
||||
|
||||
if "pause_resume" in data and self.state != "complete":
|
||||
if self.state == "paused" and data['pause_resume']['is_paused'] == False:
|
||||
self.set_state("printing")
|
||||
self.update_text("status",_("Paused"))
|
||||
self.grid.attach(self.labels['pause'], 0, 3, 1, 1)
|
||||
self.grid.remove(self.labels['resume'])
|
||||
self.grid.show_all()
|
||||
if self.state != "paused" and data['pause_resume']['is_paused'] == True:
|
||||
self.set_state("paused")
|
||||
self.grid.attach(self.labels['resume'], 0, 3, 1, 1)
|
||||
self.grid.remove(self.labels['pause'])
|
||||
self.grid.show_all()
|
||||
|
||||
def set_state(self, state):
|
||||
self.state = state
|
||||
self.update_text("status",state.capitalize())
|
||||
|
||||
def show_buttons_for_state(self):
|
||||
self.grid.remove_row(3)
|
||||
self.grid.insert_row(3)
|
||||
if self.state == "printing":
|
||||
self.grid.attach(self.labels['pause'], 0, 3, 1, 1)
|
||||
self.grid.attach(self.labels['cancel'], 1, 3, 1, 1)
|
||||
self.grid.attach(self.labels['estop'], 2, 3, 1, 1)
|
||||
self.grid.attach(self.labels['control'], 3, 3, 1, 1)
|
||||
elif self.state == "paused":
|
||||
self.grid.attach(self.labels['resume'], 0, 3, 1, 1)
|
||||
self.grid.attach(self.labels['cancel'], 1, 3, 1, 1)
|
||||
self.grid.attach(self.labels['estop'], 2, 3, 1, 1)
|
||||
self.grid.attach(self.labels['control'], 3, 3, 1, 1)
|
||||
elif self.state == "error" or self.state == "complete":
|
||||
self.grid.attach(self.labels['restart'], 2, 3, 1, 1)
|
||||
self.grid.attach(self.labels['menu'], 3, 3, 1, 1)
|
||||
self.show_all()
|
||||
|
||||
def show_file_thumbnail(self):
|
||||
if self._files.has_thumbnail(self.filename):
|
||||
pixbuf = self.get_file_image(self.filename, 7, 3.25)
|
||||
if pixbuf != None:
|
||||
self.labels['thumbnail'].set_from_pixbuf(pixbuf)
|
||||
|
||||
def update_file_metadata(self):
|
||||
if self._files.file_metadata_exists(self.filename):
|
||||
self.file_metadata = self._files.get_file_info(self.filename)
|
||||
logger.debug("Parsing file metadata: %s" % list(self.file_metadata))
|
||||
self.update_text("est_time","/ %s" % str(self._gtk.formatTimeString(self.file_metadata['estimated_time'])))
|
||||
if "thumbnails" in self.file_metadata:
|
||||
tmp = self.file_metadata['thumbnails'].copy()
|
||||
for i in tmp:
|
||||
i['data'] = ""
|
||||
logger.debug("Thumbnails: %s" % list(tmp))
|
||||
self.show_file_thumbnail()
|
||||
else:
|
||||
self.file_metadata = None
|
||||
logger.debug("Cannot find file metadata. Listening for updated metadata")
|
||||
self._screen.files.add_file_callback(self._callback_metadata)
|
||||
|
||||
def update_image_text(self, label, text):
|
||||
if label in self.labels and 'l' in self.labels[label]:
|
||||
@@ -201,10 +513,14 @@ class JobStatusPanel(ScreenPanel):
|
||||
if label in self.labels:
|
||||
self.labels[label].set_text(text)
|
||||
|
||||
def update_progress (self, progress):
|
||||
self.labels['progress'].set_fraction(progress)
|
||||
self.labels['progress_text'].set_text("%s%%" % (str(int(progress*100))))
|
||||
def update_progress (self):
|
||||
self.labels['progress_text'].set_text("%s%%" % (str( min(int(self.progress*100),100) )))
|
||||
|
||||
def update_temp(self, dev, temp, target):
|
||||
if dev in self.labels:
|
||||
self.labels[dev].set_label(KlippyGtk.formatTemperatureString(temp, target))
|
||||
#def update_temp(self, dev, temp, target):
|
||||
# if dev in self.labels:
|
||||
# self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
|
||||
|
||||
def update_temp(self, x, temp, target):
|
||||
self.labels[x].set_markup(
|
||||
"%.1f<big>/</big>%.0f °C" % (temp, target)
|
||||
)
|
||||
@@ -4,7 +4,6 @@ import logging
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from panels.menu import MenuPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.MainMenu")
|
||||
@@ -16,42 +15,61 @@ class MainPanel(MenuPanel):
|
||||
|
||||
def initialize(self, panel_name, items, extrudercount):
|
||||
print("### Making MainMenu")
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
self.layout = Gtk.Layout()
|
||||
self.layout.set_size(self._screen.width, self._screen.height)
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
grid.set_size_request(self._screen.width, self._screen.height)
|
||||
|
||||
# Create Extruders and bed icons
|
||||
eq_grid = KlippyGtk.HomogeneousGrid()
|
||||
|
||||
eq_grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
i = 0
|
||||
for x in self._printer.get_tools():
|
||||
if i > 3:
|
||||
break
|
||||
self.labels[x] = KlippyGtk.ButtonImage("extruder-"+str(i+1), KlippyGtk.formatTemperatureString(0, 0))
|
||||
eq_grid.attach(self.labels[x], i%2, i/2, 1, 1)
|
||||
self.labels[x] = self._gtk.ButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0))
|
||||
col = 0 if len(self._printer.get_tools()) == 1 else (i%2 if self._screen.lang_ltr else 1 - i%2)
|
||||
row = i/2
|
||||
eq_grid.attach(self.labels[x], col, row, 1, 1)
|
||||
i += 1
|
||||
|
||||
self.labels['heater_bed'] = KlippyGtk.ButtonImage("bed", KlippyGtk.formatTemperatureString(0, 0))
|
||||
if self._printer.has_heated_bed():
|
||||
self.labels['heater_bed'] = self._gtk.ButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
|
||||
|
||||
width = 2 if i > 1 else 1
|
||||
eq_grid.attach(self.labels['heater_bed'], 0, i/2+1, width, 1)
|
||||
width = 2 if i > 1 else 1
|
||||
eq_grid.attach(self.labels['heater_bed'], 0, i/2+1, width, 1)
|
||||
|
||||
self.items = items
|
||||
self.create_menu_items()
|
||||
|
||||
self.grid = Gtk.Grid()
|
||||
self.grid.set_row_homogeneous(True)
|
||||
self.grid.set_column_homogeneous(True)
|
||||
|
||||
if self._screen.lang_ltr:
|
||||
grid.attach(eq_grid, 0, 0, 1, 1)
|
||||
grid.attach(self.arrangeMenuItems(items, 2, True), 1, 0, 1, 1)
|
||||
else:
|
||||
grid.attach(eq_grid, 1, 0, 1, 1)
|
||||
grid.attach(self.arrangeMenuItems(items, 2, True), 0, 0, 1, 1)
|
||||
|
||||
grid.attach(eq_grid, 0, 0, 1, 1)
|
||||
grid.attach(self.arrangeMenuItems(items, 2, True), 1, 0, 1, 1)
|
||||
self.grid = grid
|
||||
|
||||
self.target_temps = {
|
||||
"heater_bed": 0,
|
||||
"extruder": 0
|
||||
}
|
||||
self.layout.put(grid, 0, 0)
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def get(self):
|
||||
return self.grid
|
||||
def activate(self):
|
||||
return
|
||||
|
||||
def update_temp(self, dev, temp, target):
|
||||
if dev in self.labels:
|
||||
self.labels[dev].set_label(KlippyGtk.formatTemperatureString(temp, target))
|
||||
self.labels[dev].set_label(self._gtk.formatTemperatureString(temp, target))
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action != "notify_status_update":
|
||||
|
||||
@@ -1,67 +1,73 @@
|
||||
import gettext
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
from jinja2 import Environment, Template
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
from jinja2 import Template
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.MenuPanel")
|
||||
|
||||
def create_panel(*args):
|
||||
return MenuPanel(*args)
|
||||
|
||||
class MenuPanel(ScreenPanel):
|
||||
def initialize(self, panel_name, items):
|
||||
i = 0
|
||||
def initialize(self, panel_name, display_name, items):
|
||||
_ = self.lang.gettext
|
||||
|
||||
self.activate()
|
||||
grid = self.arrangeMenuItems(items, 4)
|
||||
self.items = items
|
||||
self.create_menu_items()
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b, 3, 1, 1, 1)
|
||||
|
||||
self.panel = grid
|
||||
self.grid = Gtk.Grid()
|
||||
self.grid.set_row_homogeneous(True)
|
||||
self.grid.set_column_homogeneous(True)
|
||||
self.content.add(self.grid)
|
||||
|
||||
def activate(self):
|
||||
self.j2_data = {
|
||||
"printer": {
|
||||
"power_devices": {
|
||||
"count": len(self._screen.printer.get_power_devices())
|
||||
}
|
||||
}
|
||||
}
|
||||
logger.debug("j2_data: %s" % self.j2_data)
|
||||
self.j2_data = self._printer.get_printer_status_data()
|
||||
self.arrangeMenuItems(self.items, 4)
|
||||
|
||||
def arrangeMenuItems (self, items, columns, expandLast=False):
|
||||
grid = Gtk.Grid()
|
||||
grid.set_row_homogeneous(True)
|
||||
grid.set_column_homogeneous(True)
|
||||
logger.debug(items)
|
||||
for item in items:
|
||||
key = list(item)[0]
|
||||
logger.debug(item)
|
||||
if not self.evaluate_enable(item[key]['enable']):
|
||||
items.remove(item)
|
||||
for child in self.grid.get_children():
|
||||
self.grid.remove(child)
|
||||
|
||||
l = len(items)
|
||||
i = 0
|
||||
for i in range(l):
|
||||
col = i % columns
|
||||
for item in items:
|
||||
key = list(item)[0]
|
||||
logger.debug("Evaluating item: %s" % key)
|
||||
if not self.evaluate_enable(item[key]['enable']):
|
||||
continue
|
||||
|
||||
col = i % columns if self._screen.lang_ltr == True else (columns - (i % columns) - 1)
|
||||
row = int(i/columns)
|
||||
width = 1
|
||||
|
||||
if expandLast == True and i+1 == l and l%2 == 1:
|
||||
width = 2
|
||||
if not self._screen.lang_ltr:
|
||||
col = col - 1
|
||||
|
||||
key = list(items[i])[0]
|
||||
item = items[i][key]
|
||||
b = KlippyGtk.ButtonImage(
|
||||
item['icon'], item['name'], "color"+str((i%4)+1)
|
||||
self.grid.attach(self.labels[key], col, row, width, 1)
|
||||
i += 1
|
||||
|
||||
return self.grid
|
||||
|
||||
def create_menu_items(self):
|
||||
for i in range(len(self.items)):
|
||||
key = list(self.items[i])[0]
|
||||
item = self.items[i][key]
|
||||
|
||||
env = Environment(extensions=["jinja2.ext.i18n"])
|
||||
env.install_gettext_translations(self.lang)
|
||||
j2_temp = env.from_string(item['name'])
|
||||
parsed_name = j2_temp.render()
|
||||
|
||||
b = self._gtk.ButtonImage(
|
||||
item['icon'], parsed_name, "color"+str((i%4)+1)
|
||||
)
|
||||
if item['panel'] != False:
|
||||
b.connect("clicked", self.menu_item_clicked, item['panel'], item)
|
||||
@@ -73,12 +79,7 @@ class MenuPanel(ScreenPanel):
|
||||
b.connect("clicked", self._screen._send_action, item['method'], params)
|
||||
else:
|
||||
b.connect("clicked", self._screen._go_to_submenu, key)
|
||||
|
||||
grid.attach(b, col, row, width, 1)
|
||||
|
||||
i += 1
|
||||
|
||||
return grid
|
||||
self.labels[key] = b
|
||||
|
||||
def evaluate_enable(self, enable):
|
||||
if enable == True:
|
||||
@@ -91,7 +92,6 @@ class MenuPanel(ScreenPanel):
|
||||
logger.debug("Date: %s" % self.j2_data)
|
||||
j2_temp = Template(enable)
|
||||
result = j2_temp.render(self.j2_data)
|
||||
logger.debug("Result: %s" % result)
|
||||
if result == 'True':
|
||||
return True
|
||||
return False
|
||||
|
||||
@@ -4,7 +4,6 @@ import logging
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
@@ -21,24 +20,24 @@ class MovePanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
self.labels['x+'] = KlippyGtk.ButtonImage("move-x+", _("X+"), "color1")
|
||||
self.labels['x+'] = self._gtk.ButtonImage("move-x+", _("X+"), "color1")
|
||||
self.labels['x+'].connect("clicked", self.move, "X", "+")
|
||||
self.labels['x-'] = KlippyGtk.ButtonImage("move-x-", _("X-"), "color1")
|
||||
self.labels['x-'] = self._gtk.ButtonImage("move-x-", _("X-"), "color1")
|
||||
self.labels['x-'].connect("clicked", self.move, "X", "-")
|
||||
|
||||
self.labels['y+'] = KlippyGtk.ButtonImage("move-y+", _("Y+"), "color2")
|
||||
self.labels['y+'] = self._gtk.ButtonImage("move-y+", _("Y+"), "color2")
|
||||
self.labels['y+'].connect("clicked", self.move, "Y", "+")
|
||||
self.labels['y-'] = KlippyGtk.ButtonImage("move-y-", _("Y-"), "color2")
|
||||
self.labels['y-'] = self._gtk.ButtonImage("move-y-", _("Y-"), "color2")
|
||||
self.labels['y-'].connect("clicked", self.move, "Y", "-")
|
||||
|
||||
self.labels['z+'] = KlippyGtk.ButtonImage("move-z-", _("Z+"), "color3")
|
||||
self.labels['z+'] = self._gtk.ButtonImage("move-z-", _("Z+"), "color3")
|
||||
self.labels['z+'].connect("clicked", self.move, "Z", "+")
|
||||
self.labels['z-'] = KlippyGtk.ButtonImage("move-z+", _("Z-"), "color3")
|
||||
self.labels['z-'] = self._gtk.ButtonImage("move-z+", _("Z-"), "color3")
|
||||
self.labels['z-'].connect("clicked", self.move, "Z", "-")
|
||||
|
||||
self.labels['home'] = KlippyGtk.ButtonImage("home", _("Home All"))
|
||||
self.labels['home'] = self._gtk.ButtonImage("home", _("Home All"))
|
||||
self.labels['home'].connect("clicked", self.home)
|
||||
|
||||
|
||||
@@ -54,7 +53,7 @@ class MovePanel(ScreenPanel):
|
||||
distgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.distances:
|
||||
self.labels[i] = KlippyGtk.ToggleButton(i)
|
||||
self.labels[i] = self._gtk.ToggleButton(i)
|
||||
self.labels[i].connect("clicked", self.change_distance, i)
|
||||
ctx = self.labels[i].get_style_context()
|
||||
if j == 0:
|
||||
@@ -70,43 +69,33 @@ class MovePanel(ScreenPanel):
|
||||
|
||||
self.labels["1"].set_active(True)
|
||||
|
||||
#space_grid = KlippyGtk.HomogeneousGrid()
|
||||
#space_grid = self._gtk.HomogeneousGrid()
|
||||
#space_grid.attach(Gtk.Label("Distance (mm):"),0,0,1,1)
|
||||
#space_grid.attach(distgrid,0,1,1,1)
|
||||
#space_grid.attach(Gtk.Label(" "),0,2,1,1)
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
|
||||
bottomgrid = KlippyGtk.HomogeneousGrid()
|
||||
bottomgrid = self._gtk.HomogeneousGrid()
|
||||
self.labels['pos_x'] = Gtk.Label("X: 0")
|
||||
self.labels['pos_y'] = Gtk.Label("Y: 0")
|
||||
self.labels['pos_z'] = Gtk.Label("Z: 0")
|
||||
self.labels['pos_x'].get_style_context().add_class("text")
|
||||
self.labels['pos_y'].get_style_context().add_class("text")
|
||||
self.labels['pos_z'].get_style_context().add_class("text")
|
||||
bottomgrid.attach(self.labels['pos_x'], 0, 0, 1, 1)
|
||||
bottomgrid.attach(self.labels['pos_y'], 1, 0, 1, 1)
|
||||
bottomgrid.attach(self.labels['pos_z'], 2, 0, 1, 1)
|
||||
box.pack_start(bottomgrid, True, True, 0)
|
||||
self.labels['move_dist'] = Gtk.Label(_("Move Distance (mm)"))
|
||||
self.labels['move_dist'].get_style_context().add_class("text")
|
||||
box.pack_start(self.labels['move_dist'], True, True, 0)
|
||||
box.pack_start(distgrid, True, True, 0)
|
||||
|
||||
grid.attach(box, 0, 2, 3, 1)
|
||||
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
grid.attach(b, 3, 2, 1, 1)
|
||||
|
||||
self.panel = grid
|
||||
self.content.add(grid)
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def process_update(self, action, data):
|
||||
if action != "notify_status_update":
|
||||
return
|
||||
|
||||
|
||||
if "toolhead" in data and "position" in data["toolhead"]:
|
||||
self.labels['pos_x'].set_text("X: %.2f" % (data["toolhead"]["position"][0]))
|
||||
self.labels['pos_y'].set_text("Y: %.2f" % (data["toolhead"]["position"][1]))
|
||||
@@ -129,6 +118,9 @@ class MovePanel(ScreenPanel):
|
||||
self.labels[str(i)].set_active(False)
|
||||
|
||||
def move(self, widget, axis, dir):
|
||||
if self._config.get_config().getboolean("main", "invert_%s" % axis.lower(), False):
|
||||
dir = "-" if dir == "+" else "+"
|
||||
|
||||
dist = str(self.distance) if dir == "+" else "-" + str(self.distance)
|
||||
logging.info("# Moving " + axis + " " + dist + "mm")
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import os
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.NetworkPanel")
|
||||
@@ -16,7 +15,8 @@ def create_panel(*args):
|
||||
class NetworkPanel(ScreenPanel):
|
||||
def initialize(self, menu):
|
||||
_ = self.lang.gettext
|
||||
self.panel = KlippyGtk.HomogeneousGrid()
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
grid.set_hexpand(True)
|
||||
|
||||
# Get Hostname
|
||||
stream = os.popen('hostname -A')
|
||||
@@ -31,9 +31,6 @@ class NetworkPanel(ScreenPanel):
|
||||
_("Network Info") + "\n\n%s%s" % (hostname, ip)
|
||||
)
|
||||
self.labels['networkinfo'].get_style_context().add_class('temperature_entry')
|
||||
self.panel.attach(self.labels['networkinfo'], 1, 0, 1, 1)
|
||||
grid.attach(self.labels['networkinfo'], 1, 0, 1, 1)
|
||||
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
self.panel.attach(b, 1, 1, 1, 1)
|
||||
self.content.add(grid)
|
||||
@@ -4,7 +4,6 @@ import logging
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
@@ -18,20 +17,6 @@ class PowerPanel(ScreenPanel):
|
||||
_ = self.lang.gettext
|
||||
self.devices = {}
|
||||
|
||||
# Create bottom bar
|
||||
bar = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
||||
bar.set_hexpand(True)
|
||||
bar.set_vexpand(False)
|
||||
bar.set_halign(Gtk.Align.END)
|
||||
bar.set_margin_top(5)
|
||||
bar.set_margin_bottom(5)
|
||||
bar.set_margin_end(5)
|
||||
|
||||
# Add a back button to the bottom bar
|
||||
back = KlippyGtk.ButtonImage('back', None, None, 60, 60)
|
||||
back.connect("clicked", self._screen._menu_go_back)
|
||||
bar.add(back)
|
||||
|
||||
# Create a scroll window for the power devices
|
||||
scroll = Gtk.ScrolledWindow()
|
||||
scroll.set_property("overlay-scrolling", False)
|
||||
@@ -45,22 +30,24 @@ class PowerPanel(ScreenPanel):
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||
box.set_vexpand(True)
|
||||
box.pack_start(scroll, True, True, 0)
|
||||
box.pack_end(bar, False, False, 0)
|
||||
|
||||
self.load_power_devices()
|
||||
|
||||
self.panel = box
|
||||
self.content.add(box)
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def add_device(self, device):
|
||||
|
||||
frame = Gtk.Frame()
|
||||
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
|
||||
frame.get_style_context().add_class("frame-item")
|
||||
|
||||
name = Gtk.Label()
|
||||
name.set_markup("<big><b>%s</b></big>" % (device))
|
||||
name.set_hexpand(True)
|
||||
name.set_vexpand(True)
|
||||
name.set_halign(Gtk.Align.START)
|
||||
name.set_valign(Gtk.Align.CENTER)
|
||||
name.set_line_wrap(True)
|
||||
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
@@ -68,20 +55,15 @@ class PowerPanel(ScreenPanel):
|
||||
switch.set_hexpand(False)
|
||||
switch.set_active(True if self._screen.printer.get_power_device_status(device) == "on" else False)
|
||||
switch.connect("notify::active", self.on_switch, device)
|
||||
switch.set_property("width-request", 150)
|
||||
switch.set_property("height-request", 80)
|
||||
switch.set_property("width-request", round(self._gtk.get_image_width()*2.5))
|
||||
switch.set_property("height-request", round(self._gtk.get_image_height()*1.25))
|
||||
|
||||
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
labels.add(name)
|
||||
|
||||
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
dev.set_margin_top(10)
|
||||
dev.set_margin_end(15)
|
||||
dev.set_margin_start(15)
|
||||
dev.set_margin_bottom(10)
|
||||
dev.set_hexpand(True)
|
||||
dev.set_vexpand(False)
|
||||
|
||||
dev.add(labels)
|
||||
dev.add(switch)
|
||||
frame.add(dev)
|
||||
|
||||
@@ -4,7 +4,6 @@ import logging
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.PreheatPanel")
|
||||
@@ -20,30 +19,31 @@ class PreheatPanel(ScreenPanel):
|
||||
self.preheat_options = self._screen._config.get_preheat_options()
|
||||
logger.debug("Preheat options: %s" % self.preheat_options)
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
eq_grid = KlippyGtk.HomogeneousGrid()
|
||||
eq_grid = self._gtk.HomogeneousGrid()
|
||||
i = 0
|
||||
for x in self._printer.get_tools():
|
||||
if i > 3:
|
||||
break
|
||||
elif i == 0:
|
||||
primary_tool = x
|
||||
self.labels[x] = KlippyGtk.ToggleButtonImage("extruder-"+str(i+1), KlippyGtk.formatTemperatureString(0, 0))
|
||||
self.labels[x] = self._gtk.ToggleButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0))
|
||||
self.labels[x].connect('clicked', self.select_heater, x)
|
||||
eq_grid.attach(self.labels[x], i%2, i/2, 1, 1)
|
||||
i += 1
|
||||
|
||||
self.labels["heater_bed"] = KlippyGtk.ToggleButtonImage("bed", KlippyGtk.formatTemperatureString(0, 0))
|
||||
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
|
||||
width = 2 if i > 1 else 1
|
||||
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
|
||||
if self._printer.has_heated_bed():
|
||||
self.labels["heater_bed"] = self._gtk.ToggleButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
|
||||
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
|
||||
width = 2 if i > 1 else 1
|
||||
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
|
||||
|
||||
self.labels["control_grid"] = KlippyGtk.HomogeneousGrid()
|
||||
self.labels["control_grid"] = self._gtk.HomogeneousGrid()
|
||||
|
||||
i = 0
|
||||
for option in self.preheat_options:
|
||||
self.labels[option] = KlippyGtk.Button(option, "color%d" % ((i%4)+1))
|
||||
self.labels[option] = self._gtk.Button(option, "color%d" % ((i%4)+1))
|
||||
self.labels[option].connect("clicked", self.set_temperature, option)
|
||||
self.labels['control_grid'].attach(
|
||||
self.labels[option],
|
||||
@@ -51,21 +51,17 @@ class PreheatPanel(ScreenPanel):
|
||||
i += 1
|
||||
|
||||
|
||||
cooldown = KlippyGtk.ButtonImage('cool-down', _('Cooldown'))
|
||||
cooldown = self._gtk.ButtonImage('cool-down', _('Cooldown'))
|
||||
cooldown.connect("clicked", self.set_temperature, "cooldown")
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
|
||||
row = int(i/2) if i%2 == 0 else int(i/2)+1
|
||||
self.labels["control_grid"].attach(cooldown, 0, row, 1, 1)
|
||||
self.labels["control_grid"].attach(b, 1, row, 1, 1)
|
||||
self.labels["control_grid"].attach(cooldown, 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.panel = grid
|
||||
self.content.add(grid)
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
@@ -74,7 +70,7 @@ class PreheatPanel(ScreenPanel):
|
||||
if x not in self.active_heaters:
|
||||
self.select_heater(None, x)
|
||||
|
||||
if "heater_bed" not in self.active_heaters:
|
||||
if self._printer.has_heated_bed() and "heater_bed" not in self.active_heaters:
|
||||
self.select_heater(None, "heater_bed")
|
||||
|
||||
def select_heater(self, widget, heater):
|
||||
@@ -113,10 +109,11 @@ class PreheatPanel(ScreenPanel):
|
||||
if action != "notify_status_update":
|
||||
return
|
||||
|
||||
self.update_temp("heater_bed",
|
||||
self._printer.get_dev_stat("heater_bed","temperature"),
|
||||
self._printer.get_dev_stat("heater_bed","target")
|
||||
)
|
||||
if self._printer.has_heated_bed():
|
||||
self.update_temp("heater_bed",
|
||||
self._printer.get_dev_stat("heater_bed","temperature"),
|
||||
self._printer.get_dev_stat("heater_bed","target")
|
||||
)
|
||||
for x in self._printer.get_tools():
|
||||
self.update_temp(x,
|
||||
self._printer.get_dev_stat(x,"temperature"),
|
||||
|
||||
@@ -6,7 +6,6 @@ gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
from datetime import datetime
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
@@ -27,24 +26,6 @@ class PrintPanel(ScreenPanel):
|
||||
box.set_vexpand(True)
|
||||
box.pack_start(scroll, True, True, 0)
|
||||
|
||||
|
||||
bar = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
||||
bar.set_hexpand(True)
|
||||
bar.set_vexpand(False)
|
||||
bar.set_halign(Gtk.Align.END)
|
||||
bar.set_margin_top(5)
|
||||
bar.set_margin_bottom(5)
|
||||
bar.set_margin_end(5)
|
||||
refresh = KlippyGtk.ButtonImage('refresh', None, None, 60, 60)
|
||||
refresh.connect("clicked", self.reload_files)
|
||||
#bar.add(refresh)
|
||||
|
||||
back = KlippyGtk.ButtonImage('back', None, None, 60, 60)
|
||||
back.connect("clicked", self._screen._menu_go_back)
|
||||
bar.add(back)
|
||||
|
||||
box.pack_end(bar, False, False, 0)
|
||||
|
||||
self.labels['filelist'] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
self.labels['filelist'].set_vexpand(True)
|
||||
|
||||
@@ -57,8 +38,7 @@ class PrintPanel(ScreenPanel):
|
||||
|
||||
scroll.add(self.labels['filelist'])
|
||||
|
||||
|
||||
self.panel = box
|
||||
self.content.add(box)
|
||||
|
||||
self._screen.files.add_file_callback(self._callback)
|
||||
|
||||
@@ -72,6 +52,7 @@ class PrintPanel(ScreenPanel):
|
||||
|
||||
frame = Gtk.Frame()
|
||||
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
|
||||
frame.get_style_context().add_class("frame-item")
|
||||
|
||||
|
||||
name = Gtk.Label()
|
||||
@@ -93,20 +74,16 @@ class PrintPanel(ScreenPanel):
|
||||
labels.set_valign(Gtk.Align.CENTER)
|
||||
labels.set_halign(Gtk.Align.START)
|
||||
|
||||
actions = KlippyGtk.ButtonImage("print",None,"color3")
|
||||
actions = self._gtk.ButtonImage("print",None,"color3")
|
||||
actions.connect("clicked", self.confirm_print, filename)
|
||||
actions.set_hexpand(False)
|
||||
actions.set_halign(Gtk.Align.END)
|
||||
|
||||
file = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
file.set_margin_top(1)
|
||||
file.set_margin_end(15)
|
||||
file.set_margin_start(15)
|
||||
file.set_margin_bottom(1)
|
||||
file.set_hexpand(True)
|
||||
file.set_vexpand(False)
|
||||
|
||||
icon = KlippyGtk.Image("file", False, 100, 100)
|
||||
icon = self._gtk.Image("file.svg", False, 1.6, 1.6)
|
||||
pixbuf = self.get_file_image(filename)
|
||||
if pixbuf != None:
|
||||
icon.set_from_pixbuf(pixbuf)
|
||||
@@ -130,18 +107,6 @@ class PrintPanel(ScreenPanel):
|
||||
self.labels['filelist'].attach(self.files[filename], 0, pos, 1, 1)
|
||||
self.labels['filelist'].show_all()
|
||||
|
||||
def get_file_image(self, filename, width=100, height=100):
|
||||
fileinfo = self._screen.files.get_file_info(filename)
|
||||
if fileinfo == None:
|
||||
return None
|
||||
|
||||
if "thumbnails" in fileinfo and len(fileinfo["thumbnails"]) > 0:
|
||||
thumbnail = fileinfo['thumbnails'][0]
|
||||
return KlippyGtk.PixbufFromFile("/tmp/.KS-thumbnails/%s-%s" % (fileinfo['filename'], thumbnail['size']),
|
||||
None, width, height)
|
||||
return None
|
||||
|
||||
|
||||
def get_file_info_str(self, filename):
|
||||
_ = self.lang.gettext
|
||||
|
||||
@@ -234,16 +199,14 @@ class PrintPanel(ScreenPanel):
|
||||
label.set_halign(Gtk.Align.CENTER)
|
||||
label.set_line_wrap(True)
|
||||
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
label.get_style_context().add_class("text")
|
||||
|
||||
grid = Gtk.Grid()
|
||||
grid.add(label)
|
||||
grid.set_size_request(self._screen.width - 60, -1)
|
||||
|
||||
pixbuf = self.get_file_image(filename, self._screen.width/2, self._screen.height/3)
|
||||
pixbuf = self.get_file_image(filename, 8, 3.2)
|
||||
if pixbuf != None:
|
||||
image = Gtk.Image.new_from_pixbuf(pixbuf)
|
||||
image.set_margin_top(20)
|
||||
grid.attach_next_to(image, label, Gtk.PositionType.BOTTOM, 1, 3)
|
||||
|
||||
#table.attach(label, 0, 1, 0, 1, Gtk.AttachOptions.SHRINK | Gtk.AttachOptions.FILL)
|
||||
@@ -251,7 +214,7 @@ class PrintPanel(ScreenPanel):
|
||||
grid.set_halign(Gtk.Align.CENTER)
|
||||
grid.set_valign(Gtk.Align.CENTER)
|
||||
|
||||
dialog = KlippyGtk.Dialog(self._screen, buttons, grid, self.confirm_print_response, filename)
|
||||
dialog = self._gtk.Dialog(self._screen, buttons, grid, self.confirm_print_response, filename)
|
||||
|
||||
def confirm_print_response(self, widget, response_id, filename):
|
||||
widget.destroy()
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.Settings")
|
||||
|
||||
def create_panel(*args):
|
||||
return SettingsPanel(*args)
|
||||
|
||||
class SettingsPanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
self.settings = {}
|
||||
self.macros = {}
|
||||
self.menu_cur = 'main_box'
|
||||
self.menu = ['main_box']
|
||||
|
||||
self.labels['main_box'] = self.create_box('main')
|
||||
self.labels['macros_box'] = self.create_box('macros')
|
||||
|
||||
options = self._config.get_configurable_options()
|
||||
for option in options:
|
||||
name = list(option)[0]
|
||||
self.add_option('main', self.settings, name, option[name])
|
||||
|
||||
self.add_option('main', self.settings, "macros", {
|
||||
"name": _("Displayed Macros"),
|
||||
"type": "menu",
|
||||
"menu": "macros"
|
||||
})
|
||||
|
||||
for macro in self._printer.get_config_section_list("gcode_macro "):
|
||||
macro = macro[12:]
|
||||
self.macros[macro] = {
|
||||
"name": macro,
|
||||
"section": "displayed_macros",
|
||||
"type": "macro"
|
||||
}
|
||||
|
||||
for macro in list(self.macros):
|
||||
self.add_option('macros', self.macros, macro, self.macros[macro])
|
||||
|
||||
logger.debug("Macros: %s" % self.macros)
|
||||
|
||||
self.control['back'].disconnect_by_func(self._screen._menu_go_back)
|
||||
self.control['back'].connect("clicked", self.back)
|
||||
self.content.add(self.labels['main_box'])
|
||||
|
||||
def activate(self):
|
||||
while len(self.menu) > 1:
|
||||
self.unload_menu()
|
||||
|
||||
def back(self, widget):
|
||||
if len(self.menu) > 1:
|
||||
self.unload_menu()
|
||||
else:
|
||||
self._screen._menu_go_back()
|
||||
|
||||
def create_box(self, name):
|
||||
# Create a scroll window for the macros
|
||||
scroll = Gtk.ScrolledWindow()
|
||||
scroll.set_property("overlay-scrolling", False)
|
||||
scroll.set_vexpand(True)
|
||||
|
||||
# Create a grid for all macros
|
||||
self.labels[name] = Gtk.Grid()
|
||||
scroll.add(self.labels[name])
|
||||
|
||||
# Create a box to contain all of the above
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0)
|
||||
box.set_vexpand(True)
|
||||
box.pack_start(scroll, True, True, 0)
|
||||
return box
|
||||
|
||||
def add_option(self, boxname, opt_array, opt_name, option):
|
||||
frame = Gtk.Frame()
|
||||
frame.set_property("shadow-type",Gtk.ShadowType.NONE)
|
||||
frame.get_style_context().add_class("frame-item")
|
||||
|
||||
name = Gtk.Label()
|
||||
name.set_markup("<big><b>%s</b></big>" % (option['name']))
|
||||
name.set_hexpand(True)
|
||||
name.set_vexpand(True)
|
||||
name.set_halign(Gtk.Align.START)
|
||||
name.set_valign(Gtk.Align.CENTER)
|
||||
name.set_line_wrap(True)
|
||||
name.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
|
||||
#open = self._gtk.ButtonImage("open",None,"color3")
|
||||
#open.connect("clicked", self.run_gcode_macro, macro)
|
||||
#open.set_hexpand(False)
|
||||
#open.set_halign(Gtk.Align.END)
|
||||
|
||||
labels = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
labels.add(name)
|
||||
|
||||
dev = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5)
|
||||
dev.set_hexpand(True)
|
||||
dev.set_vexpand(False)
|
||||
dev.set_valign(Gtk.Align.CENTER)
|
||||
|
||||
dev.add(labels)
|
||||
if option['type'] == "binary" or option['type'] == "macro":
|
||||
box = Gtk.Box()
|
||||
box.set_vexpand(False)
|
||||
switch = Gtk.Switch()
|
||||
switch.set_hexpand(False)
|
||||
switch.set_vexpand(False)
|
||||
if option['type'] == "macro":
|
||||
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name, fallback=True))
|
||||
else:
|
||||
switch.set_active(self._config.get_config().getboolean(option['section'], opt_name))
|
||||
switch.connect("notify::active", self.switch_config_option, option['section'], opt_name)
|
||||
switch.set_property("width-request", round(self._gtk.get_image_width()*2.5))
|
||||
switch.set_property("height-request", round(self._gtk.get_image_height()*1.25))
|
||||
box.add(switch)
|
||||
dev.add(box)
|
||||
elif option['type'] == "menu":
|
||||
open = self._gtk.ButtonImage("open",None,"color3")
|
||||
open.connect("clicked", self.load_menu, option['menu'])
|
||||
open.set_hexpand(False)
|
||||
open.set_halign(Gtk.Align.END)
|
||||
dev.add(open)
|
||||
|
||||
frame.add(dev)
|
||||
|
||||
opt_array[opt_name] = {
|
||||
"row": frame
|
||||
}
|
||||
|
||||
opts = sorted(opt_array)
|
||||
pos = opts.index(opt_name)
|
||||
|
||||
self.labels[boxname].insert_row(pos)
|
||||
self.labels[boxname].attach(opt_array[opt_name]['row'], 0, pos, 1, 1)
|
||||
self.labels[boxname].show_all()
|
||||
|
||||
def load_menu(self, widget, name):
|
||||
if ("%s_box" % name) not in self.labels:
|
||||
return
|
||||
|
||||
for child in self.content.get_children():
|
||||
self.content.remove(child)
|
||||
|
||||
self.menu.append('%s_box' % name)
|
||||
self.content.add(self.labels[self.menu[-1]])
|
||||
self.content.show_all()
|
||||
|
||||
def unload_menu(self, widget=None):
|
||||
logger.debug("self.menu: %s" % self.menu)
|
||||
if len(self.menu) <= 1 or self.menu[-2] not in self.labels:
|
||||
return
|
||||
|
||||
self.menu.pop()
|
||||
for child in self.content.get_children():
|
||||
self.content.remove(child)
|
||||
self.content.add(self.labels[self.menu[-1]])
|
||||
self.content.show_all()
|
||||
|
||||
def switch_config_option(self, switch, gparam, section, option):
|
||||
logger.debug("[%s] %s toggled %s" % (section, option, switch.get_active()))
|
||||
if section not in self._config.get_config().sections():
|
||||
self._config.get_config().add_section(section)
|
||||
self._config.set(section, option, "True" if switch.get_active() else "False")
|
||||
self._config.save_user_config_options()
|
||||
|
||||
def add_gcode_option(self):
|
||||
macros = self._screen.printer.get_gcode_macros()
|
||||
for x in macros:
|
||||
self.add_gcode_macro("macros", self.macros, x, {
|
||||
"name": x[12:],
|
||||
"type": binary
|
||||
})
|
||||
|
||||
def run_gcode_macro(self, widget, macro):
|
||||
self._screen._ws.klippy.gcode_script(macro)
|
||||
@@ -5,7 +5,6 @@ import os
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
logger = logging.getLogger("KlipperScreen.SplashScreenPanel")
|
||||
@@ -19,14 +18,12 @@ class SplashScreenPanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
image = Gtk.Image()
|
||||
#TODO: update file reference
|
||||
image.set_from_file(os.getcwd() + "/styles/z-bolt/images/klipper.png")
|
||||
image = self._gtk.Image("klipper.png", None, 4, 3)
|
||||
|
||||
self.labels['text'] = Gtk.Label(_("Initializing printer..."))
|
||||
self.labels['text'].get_style_context().add_class("text")
|
||||
self.labels['text'].set_line_wrap(True)
|
||||
self.labels['text'].set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
self.labels['text'].set_halign(Gtk.Align.CENTER)
|
||||
|
||||
|
||||
self.labels['actions'] = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
|
||||
@@ -45,7 +42,7 @@ class SplashScreenPanel(ScreenPanel):
|
||||
box = Gtk.VBox()
|
||||
box.add(main)
|
||||
|
||||
self.panel = box
|
||||
self.layout = box
|
||||
|
||||
def update_text(self, text):
|
||||
self.labels['text'].set_text(text)
|
||||
@@ -59,10 +56,10 @@ class SplashScreenPanel(ScreenPanel):
|
||||
_ = self.lang.gettext
|
||||
|
||||
if "firmware_restart" not in self.labels:
|
||||
self.labels['power'] = KlippyGtk.ButtonImage("reboot",_("Power On Printer"),"color3")
|
||||
self.labels['restart'] = KlippyGtk.ButtonImage("reboot",_("Restart"),"color1")
|
||||
self.labels['power'] = self._gtk.ButtonImage("reboot",_("Power On Printer"),"color3")
|
||||
self.labels['restart'] = self._gtk.ButtonImage("reboot",_("Restart"),"color1")
|
||||
self.labels['restart'].connect("clicked", self.restart)
|
||||
self.labels['firmware_restart'] = KlippyGtk.ButtonImage("restart",_("Firmware Restart"),"color2")
|
||||
self.labels['firmware_restart'] = self._gtk.ButtonImage("restart",_("Firmware Restart"),"color2")
|
||||
self.labels['firmware_restart'].connect("clicked", self.firmware_restart)
|
||||
|
||||
self.clear_action_bar()
|
||||
@@ -74,7 +71,6 @@ class SplashScreenPanel(ScreenPanel):
|
||||
self.labels['power'].connect("clicked", self.power_on, devices[0])
|
||||
self.labels['actions'].add(self.labels['power'])
|
||||
|
||||
self.labels['actions'].add(self.labels['power'])
|
||||
self.labels['actions'].add(self.labels['restart'])
|
||||
self.labels['actions'].add(self.labels['firmware_restart'])
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import os
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
@@ -18,45 +17,38 @@ class SystemPanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
restart = KlippyGtk.ButtonImage('reboot',_('Klipper Restart'),'color1')
|
||||
restart = self._gtk.ButtonImage('reboot',_('Klipper Restart'),'color1')
|
||||
restart.connect("clicked", self.restart_klippy)
|
||||
firmrestart = KlippyGtk.ButtonImage('restart',_('Firmware Restart'),'color2')
|
||||
firmrestart = self._gtk.ButtonImage('restart',_('Firmware Restart'),'color2')
|
||||
firmrestart.connect("clicked", self.restart_klippy, "firmware")
|
||||
back = KlippyGtk.ButtonImage('back', 'Back')
|
||||
back.connect("clicked", self._screen._menu_go_back)
|
||||
|
||||
info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
info.set_vexpand(True)
|
||||
|
||||
title = Gtk.Label(_("System Information"))
|
||||
title.set_margin_bottom(5)
|
||||
title.set_margin_top(15)
|
||||
|
||||
self.labels['loadavg'] = Gtk.Label("temp")
|
||||
self.update_system_load()
|
||||
|
||||
self.system_timeout = GLib.timeout_add(1000, self.update_system_load)
|
||||
|
||||
title.get_style_context().add_class('temperature_entry')
|
||||
self.labels['loadavg'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['klipper_version'] = Gtk.Label(_("Klipper Version") +
|
||||
(": %s" % self._screen.printer.get_klipper_version()))
|
||||
self.labels['klipper_version'].set_margin_top(15)
|
||||
|
||||
self.labels['version'] = Gtk.Label(_("KlipperScreen Version") + (": %s" % self._screen.version))
|
||||
self.labels['version'].set_margin_top(15)
|
||||
self.labels['version'].get_style_context().add_class('temperature_entry')
|
||||
self.labels['ks_version'] = Gtk.Label(_("KlipperScreen Version") + (": %s" % self._screen.version))
|
||||
self.labels['ks_version'].set_margin_top(15)
|
||||
|
||||
info.add(title)
|
||||
info.add(self.labels['loadavg'])
|
||||
info.add(self.labels['version'])
|
||||
info.add(self.labels['klipper_version'])
|
||||
info.add(self.labels['ks_version'])
|
||||
|
||||
|
||||
grid.attach(info, 0, 0, 4, 2)
|
||||
grid.attach(restart, 0, 2, 1, 1)
|
||||
grid.attach(firmrestart, 1, 2, 1, 1)
|
||||
grid.attach(back, 3, 2, 1, 1)
|
||||
|
||||
self.panel = grid
|
||||
self.content.add(grid)
|
||||
|
||||
def update_system_load(self):
|
||||
_ = self.lang.gettext
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import gi
|
||||
import logging
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
@@ -21,16 +21,16 @@ class TemperaturePanel(ScreenPanel):
|
||||
def initialize(self, panel_name):
|
||||
_ = self.lang.gettext
|
||||
|
||||
grid = KlippyGtk.HomogeneousGrid()
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
eq_grid = KlippyGtk.HomogeneousGrid()
|
||||
eq_grid = self._gtk.HomogeneousGrid()
|
||||
i = 0
|
||||
for x in self._printer.get_tools():
|
||||
if i > 3:
|
||||
break
|
||||
elif i == 0:
|
||||
primary_tool = x
|
||||
self.labels[x] = KlippyGtk.ToggleButtonImage("extruder-"+str(i+1), KlippyGtk.formatTemperatureString(0, 0))
|
||||
self.labels[x] = self._gtk.ToggleButtonImage("extruder-"+str(i), self._gtk.formatTemperatureString(0, 0))
|
||||
self.labels[x].connect('clicked', self.select_heater, x)
|
||||
if i == 0:
|
||||
self.labels[x].set_active(True)
|
||||
@@ -40,24 +40,25 @@ class TemperaturePanel(ScreenPanel):
|
||||
print ("Primary tool: " + primary_tool)
|
||||
self.labels[primary_tool].get_style_context().add_class('button_active')
|
||||
|
||||
self.labels["heater_bed"] = KlippyGtk.ToggleButtonImage("bed", KlippyGtk.formatTemperatureString(0, 0))
|
||||
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
|
||||
width = 2 if i > 1 else 1
|
||||
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
|
||||
if self._printer.has_heated_bed():
|
||||
self.labels["heater_bed"] = self._gtk.ToggleButtonImage("bed", self._gtk.formatTemperatureString(0, 0))
|
||||
self.labels["heater_bed"].connect('clicked', self.select_heater, "heater_bed")
|
||||
width = 2 if i > 1 else 1
|
||||
eq_grid.attach(self.labels["heater_bed"], 0, i/2+1, width, 1)
|
||||
|
||||
self.labels["control_grid"] = KlippyGtk.HomogeneousGrid()
|
||||
self.labels["control_grid"] = self._gtk.HomogeneousGrid()
|
||||
|
||||
self.labels["increase"] = KlippyGtk.ButtonImage("increase", _("Increase"), "color1")
|
||||
self.labels["increase"] = self._gtk.ButtonImage("increase", _("Increase"), "color1")
|
||||
self.labels["increase"].connect("clicked",self.change_target_temp, "+")
|
||||
self.labels["decrease"] = KlippyGtk.ButtonImage("decrease", _("Decrease"), "color3")
|
||||
self.labels["decrease"] = self._gtk.ButtonImage("decrease", _("Decrease"), "color3")
|
||||
self.labels["decrease"].connect("clicked",self.change_target_temp, "-")
|
||||
self.labels["npad"] = KlippyGtk.ButtonImage("settings", _("Number Pad"), "color2")
|
||||
self.labels["npad"] = self._gtk.ButtonImage("settings", _("Number Pad"), "color2")
|
||||
self.labels["npad"].connect("clicked", self.show_numpad)
|
||||
|
||||
tempgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.tempdeltas:
|
||||
self.labels['deg'+ i] = KlippyGtk.ToggleButton(i)
|
||||
self.labels['deg'+ i] = self._gtk.ToggleButton(i)
|
||||
self.labels['deg'+ i].connect("clicked", self.change_temp_delta, i)
|
||||
ctx = self.labels['deg'+ i].get_style_context()
|
||||
if j == 0:
|
||||
@@ -73,20 +74,20 @@ class TemperaturePanel(ScreenPanel):
|
||||
|
||||
self.labels["deg" + self.tempdelta].set_active(True)
|
||||
|
||||
self.labels["control_grid"].attach(tempgrid, 2, 0, 1, 2)
|
||||
vbox = Gtk.VBox()
|
||||
vbox.pack_start(Gtk.Label("Temp °C"), False, False, 4)
|
||||
vbox.pack_end(tempgrid, True, True, 0)
|
||||
|
||||
self.labels["control_grid"].attach(vbox, 2, 0, 1, 3)
|
||||
self.labels["control_grid"].attach(self.labels["increase"], 3, 0, 1, 1)
|
||||
self.labels["control_grid"].attach(self.labels["decrease"], 3, 1, 1, 1)
|
||||
self.labels["control_grid"].attach(self.labels["npad"], 2, 2, 1, 1)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', _('Back'))
|
||||
b.connect("clicked", self._screen._menu_go_back)
|
||||
self.labels["control_grid"].attach(b, 3, 2, 1, 1)
|
||||
|
||||
self.labels["control_grid"].attach(self.labels["npad"], 3, 2, 1, 1)
|
||||
|
||||
grid.attach(eq_grid, 0, 0, 1, 1)
|
||||
grid.attach(self.labels["control_grid"], 1, 0, 1, 1)
|
||||
|
||||
self.panel = grid
|
||||
self.grid = grid
|
||||
self.content.add(grid)
|
||||
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
@@ -111,7 +112,7 @@ class TemperaturePanel(ScreenPanel):
|
||||
def show_numpad(self, widget):
|
||||
_ = self.lang.gettext
|
||||
|
||||
numpad = KlippyGtk.HomogeneousGrid()
|
||||
numpad = self._gtk.HomogeneousGrid()
|
||||
|
||||
keys = [
|
||||
['1','numpad_tleft'],
|
||||
@@ -130,9 +131,9 @@ class TemperaturePanel(ScreenPanel):
|
||||
for i in range(len(keys)):
|
||||
id = 'button_' + str(keys[i][0])
|
||||
if keys[i][0] == "B":
|
||||
self.labels[id] = KlippyGtk.ButtonImage("backspace")
|
||||
self.labels[id] = Gtk.Button("B") #self._gtk.ButtonImage("backspace")
|
||||
elif keys[i][0] == "E":
|
||||
self.labels[id] = KlippyGtk.ButtonImage("complete", None, None, 40, 40)
|
||||
self.labels[id] = Gtk.Button("E") #self._gtk.ButtonImage("complete", None, None, .675, .675)
|
||||
else:
|
||||
self.labels[id] = Gtk.Button(keys[i][0])
|
||||
self.labels[id].connect('clicked', self.update_entry, keys[i][0])
|
||||
@@ -140,17 +141,14 @@ class TemperaturePanel(ScreenPanel):
|
||||
ctx.add_class(keys[i][1])
|
||||
numpad.attach(self.labels[id], i%3, i/3, 1, 1)
|
||||
|
||||
self.labels["keypad"] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=3)
|
||||
self.labels["keypad"] = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
self.labels['entry'] = Gtk.Entry()
|
||||
self.labels['entry'].props.xalign = 0.5
|
||||
ctx = self.labels['entry'].get_style_context()
|
||||
ctx.add_class('temperature_entry')
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', _('Close'))
|
||||
b = self._gtk.ButtonImage('back', _('Close'))
|
||||
b.connect("clicked", self.hide_numpad)
|
||||
|
||||
#numpad.attach(b, 0, 5, 3, 1)
|
||||
#numpad.attach(self.labels['entry'], 0, 0, 3, 1)
|
||||
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
|
||||
box.add(self.labels['entry'])
|
||||
box.add(numpad)
|
||||
@@ -158,15 +156,14 @@ class TemperaturePanel(ScreenPanel):
|
||||
|
||||
self.labels["keypad"] = numpad
|
||||
|
||||
self.panel.remove_column(1)
|
||||
#self.panel.attach(self.labels["keypad"], 1, 0, 1, 1)
|
||||
self.panel.attach(box, 1, 0, 1, 1)
|
||||
self.panel.show_all()
|
||||
self.grid.remove_column(1)
|
||||
self.grid.attach(box, 1, 0, 1, 1)
|
||||
self.grid.show_all()
|
||||
|
||||
def hide_numpad(self, widget):
|
||||
self.panel.remove_column(1)
|
||||
self.panel.attach(self.labels["control_grid"], 1, 0, 1, 1)
|
||||
self.panel.show_all()
|
||||
self.grid.remove_column(1)
|
||||
self.grid.attach(self.labels["control_grid"], 1, 0, 1, 1)
|
||||
self.grid.show_all()
|
||||
|
||||
|
||||
def select_heater (self, widget, heater):
|
||||
@@ -185,11 +182,12 @@ class TemperaturePanel(ScreenPanel):
|
||||
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")
|
||||
)
|
||||
|
||||
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"),
|
||||
|
||||
@@ -3,7 +3,6 @@ import gi
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib
|
||||
|
||||
from ks_includes.KlippyGtk import KlippyGtk
|
||||
from ks_includes.KlippyGcodes import KlippyGcodes
|
||||
from ks_includes.screen_panel import ScreenPanel
|
||||
|
||||
@@ -19,28 +18,31 @@ class ZCalibratePanel(ScreenPanel):
|
||||
distance = 1
|
||||
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 = KlippyGtk.HomogeneousGrid()
|
||||
grid = self._gtk.HomogeneousGrid()
|
||||
|
||||
label = Gtk.Label(_("Z Offset") + ": ")
|
||||
label.get_style_context().add_class('temperature_entry')
|
||||
self.labels['zpos'] = Gtk.Label(_("Homing"))
|
||||
self.labels['zpos'].get_style_context().add_class('temperature_entry')
|
||||
box = Gtk.Box()
|
||||
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)
|
||||
|
||||
box.add(label)
|
||||
box.add(self.labels['zpos'])
|
||||
box.add(self.labels['zposition'])
|
||||
|
||||
zpos = KlippyGtk.ButtonImage('z-offset-decrease',_("Raise Nozzle"))
|
||||
zpos = self._gtk.ButtonImage('z-offset-decrease',_("Raise Nozzle"))
|
||||
zpos.connect("clicked", self.move, "+")
|
||||
zneg = KlippyGtk.ButtonImage('z-offset-increase',_("Lower Nozzle"))
|
||||
zneg = self._gtk.ButtonImage('z-offset-increase',_("Lower Nozzle"))
|
||||
zneg.connect("clicked", self.move, "-")
|
||||
|
||||
distgrid = Gtk.Grid()
|
||||
j = 0;
|
||||
for i in self.distances:
|
||||
self.labels[i] = KlippyGtk.ToggleButton(i)
|
||||
self.labels[i] = self._gtk.ToggleButton(i)
|
||||
self.labels[i].connect("clicked", self.change_distance, i)
|
||||
ctx = self.labels[i].get_style_context()
|
||||
if j == 0:
|
||||
@@ -56,31 +58,29 @@ class ZCalibratePanel(ScreenPanel):
|
||||
|
||||
self.labels["1"].set_active(True)
|
||||
|
||||
space_grid = KlippyGtk.HomogeneousGrid()
|
||||
space_grid = self._gtk.HomogeneousGrid()
|
||||
space_grid.set_row_homogeneous(False)
|
||||
space_grid.attach(Gtk.Label(_("Distance (mm)") + ":"),0,0,1,1)
|
||||
space_grid.attach(distgrid,0,1,1,1)
|
||||
space_grid.attach(Gtk.Label(" "),0,2,1,1)
|
||||
|
||||
estop = KlippyGtk.ButtonImage("decrease",_("Emergency Stop"),"color4")
|
||||
estop.connect("clicked", self.emergency_stop)
|
||||
|
||||
complete = KlippyGtk.ButtonImage('complete',_('Accept'),'color2')
|
||||
complete = self._gtk.ButtonImage('complete',_('Accept'),'color2')
|
||||
complete.connect("clicked", self.accept)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', _('Abort'))
|
||||
b = self._gtk.ButtonImage('back', _('Abort'))
|
||||
b.connect("clicked", self.abort)
|
||||
|
||||
|
||||
grid.attach(zpos, 1, 0, 1, 1)
|
||||
grid.attach(box, 0, 1, 2, 1)
|
||||
grid.attach(zneg, 1, 1, 1, 1)
|
||||
grid.attach(estop, 3, 0, 1, 1)
|
||||
grid.attach(complete, 3, 1, 1, 1)
|
||||
#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)
|
||||
|
||||
|
||||
self.panel = grid
|
||||
self.content.add(grid)
|
||||
self._screen.add_subscription(panel_name)
|
||||
|
||||
def activate(self):
|
||||
@@ -96,7 +96,7 @@ class ZCalibratePanel(ScreenPanel):
|
||||
self.updatePosition(data['toolhead']['position'])
|
||||
|
||||
def updatePosition(self, position):
|
||||
self.labels['zpos'].set_text(str(round(position[2],2)))
|
||||
self.labels['zposition'].set_text(str(round(position[2],2)))
|
||||
|
||||
def change_distance(self, widget, distance):
|
||||
if self.distance == distance:
|
||||
@@ -121,9 +121,9 @@ class ZCalibratePanel(ScreenPanel):
|
||||
def abort(self, widget):
|
||||
logger.info("Aborting Z calibrate")
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.PROBE_ABORT)
|
||||
self._screen._menu_go_back(widget)
|
||||
self.menu_return(widget)
|
||||
|
||||
def accept(self, widget):
|
||||
logger.info("Accepting Z calibrate")
|
||||
self._screen._ws.klippy.gcode_script(KlippyGcodes.PROBE_ACCEPT)
|
||||
self._screen._menu_go_back(widget)
|
||||
self.menu_return(widget)
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import argparse
|
||||
import gi
|
||||
import gettext
|
||||
import time
|
||||
@@ -17,6 +18,7 @@ import subprocess
|
||||
|
||||
gi.require_version("Gtk", "3.0")
|
||||
from gi.repository import Gtk, Gdk, GLib, Pango
|
||||
from jinja2 import Environment, Template
|
||||
|
||||
from ks_includes.KlippyWebsocket import KlippyWebsocket
|
||||
from ks_includes.KlippyRest import KlippyRest
|
||||
@@ -48,24 +50,38 @@ logger.info("Config file: " + config)
|
||||
|
||||
class KlipperScreen(Gtk.Window):
|
||||
""" Class for creating a screen for Klipper via HDMI """
|
||||
currentPanel = None
|
||||
bed_temp_label = None
|
||||
number_tools = 1
|
||||
|
||||
panels = {}
|
||||
load_panel = {}
|
||||
_cur_panels = []
|
||||
bed_temp_label = None
|
||||
currentPanel = None
|
||||
files = None
|
||||
filename = ""
|
||||
subscriptions = []
|
||||
last_update = {}
|
||||
shutdown = True
|
||||
load_panel = {}
|
||||
number_tools = 1
|
||||
panels = {}
|
||||
popup_message = None
|
||||
printer = None
|
||||
rtl_languages = ['he_il']
|
||||
subscriptions = []
|
||||
shutdown = True
|
||||
|
||||
def __init__(self):
|
||||
self._config = KlipperScreenConfig()
|
||||
self.init_style()
|
||||
self.version = get_software_version()
|
||||
logger.info("KlipperScreen version: %s" % self.version)
|
||||
|
||||
parser = argparse.ArgumentParser(description="KlipperScreen - A GUI for Klipper")
|
||||
parser.add_argument(
|
||||
"-c","--configfile", default="~/KlipperScreen.conf", metavar='<configfile>',
|
||||
help="Location of KlipperScreen configuration file"
|
||||
)
|
||||
args = parser.parse_args()
|
||||
configfile = os.path.normpath(os.path.expanduser(args.configfile))
|
||||
|
||||
self.lang = gettext.translation('KlipperScreen', localedir='ks_includes/locales', fallback=True)
|
||||
self._config = KlipperScreenConfig(configfile, self.lang)
|
||||
self.printer = Printer({
|
||||
"software_version": "Unknown"
|
||||
}, {
|
||||
'configfile': {
|
||||
'config': {}
|
||||
},
|
||||
@@ -76,30 +92,59 @@ class KlipperScreen(Gtk.Window):
|
||||
'is_active': False
|
||||
}
|
||||
})
|
||||
self.lang = gettext.translation('KlipperScreen', localedir='ks_includes/locales')
|
||||
|
||||
self.printer.set_callbacks({
|
||||
"disconnected": self.state_disconnected,
|
||||
"error": self.state_error,
|
||||
"printing": self.state_printing,
|
||||
"ready": self.state_ready,
|
||||
"startup": self.state_startup,
|
||||
"shutdown": self.state_shutdown
|
||||
})
|
||||
|
||||
logger.debug("OS Language: %s" % os.getenv('LANG'))
|
||||
|
||||
self.lang_ltr = True
|
||||
for lang in self.rtl_languages:
|
||||
if os.getenv('LANG').lower().startswith(lang):
|
||||
self.lang_ltr = False
|
||||
logger.debug("Enabling RTL mode")
|
||||
break
|
||||
|
||||
_ = self.lang.gettext
|
||||
|
||||
self.apiclient = KlippyRest("127.0.0.1",7125)
|
||||
Gtk.Window.__init__(self)
|
||||
self.apiclient = KlippyRest(self._config.get_main_config_option("moonraker_host"),
|
||||
self._config.get_main_config_option("moonraker_port"),
|
||||
self._config.get_main_config_option("moonraker_api_key", False))
|
||||
|
||||
self.width = Gdk.Screen.get_width(Gdk.Screen.get_default())
|
||||
self.height = Gdk.Screen.get_height(Gdk.Screen.get_default())
|
||||
powerdevs = self.apiclient.send_request("machine/device_power/devices")
|
||||
if powerdevs != False:
|
||||
self.printer.configure_power_devices(powerdevs['result'])
|
||||
|
||||
Gtk.Window.__init__(self)
|
||||
self.width = self._config.get_main_config().getint("width", Gdk.Screen.get_width(Gdk.Screen.get_default()))
|
||||
self.height = self._config.get_main_config().getint("height", Gdk.Screen.get_height(Gdk.Screen.get_default()))
|
||||
self.set_default_size(self.width, self.height)
|
||||
self.set_resizable(False)
|
||||
self.version = get_software_version()
|
||||
logger.info("KlipperScreen version: %s" % self.version)
|
||||
logger.info("Screen resolution: %sx%s" % (self.width, self.height))
|
||||
|
||||
self.gtk = KlippyGtk(self.width, self.height)
|
||||
self.init_style()
|
||||
|
||||
#self._load_panels()
|
||||
|
||||
self.printer_initializing(_("Initializing"))
|
||||
|
||||
self._ws = KlippyWebsocket(self, {
|
||||
"on_connect": self.init_printer,
|
||||
"on_message": self._websocket_callback,
|
||||
"on_close": self.printer_initializing
|
||||
})
|
||||
self._ws.connect()
|
||||
self._ws = KlippyWebsocket(self,
|
||||
{
|
||||
"on_connect": self.init_printer,
|
||||
"on_message": self._websocket_callback,
|
||||
"on_close": self.printer_initializing
|
||||
},
|
||||
self._config.get_main_config_option("moonraker_host"),
|
||||
self._config.get_main_config_option("moonraker_port")
|
||||
)
|
||||
self._ws.initial_connect()
|
||||
|
||||
# Disable DPMS
|
||||
os.system("/usr/bin/xset -display :0 s off")
|
||||
@@ -112,17 +157,22 @@ class KlipperScreen(Gtk.Window):
|
||||
def ws_subscribe(self):
|
||||
requested_updates = {
|
||||
"objects": {
|
||||
"bed_mesh": ["profile_name","mesh_max","mesh_min","probed_matrix"],
|
||||
"configfile": ["config"],
|
||||
"extruder": ["target","temperature","pressure_advance","smooth_time"],
|
||||
"fan": ["speed"],
|
||||
"gcode_move": ["homing_origin","extrude_factor","speed_factor"],
|
||||
"gcode_move": ["extrude_factor","gcode_position","homing_origin","speed_factor"],
|
||||
"heater_bed": ["target","temperature"],
|
||||
"idle_timeout": ["state"],
|
||||
"pause_resume": ["is_paused"],
|
||||
"print_stats": ["print_duration","total_duration","filament_used","filename","state","message"],
|
||||
"toolhead": ["homed_axes","estimated_print_time","print_time","position","extruder"],
|
||||
"virtual_sdcard": ["file_position","is_active","progress"],
|
||||
"webhooks": ["state","state_message"]
|
||||
}
|
||||
}
|
||||
for extruder in self.printer.get_tools():
|
||||
requested_updates['objects'][extruder] = ["target","temperature","pressure_advance","smooth_time"]
|
||||
|
||||
self._ws.klippy.object_subscription(requested_updates)
|
||||
|
||||
def _load_panel(self, panel, *args):
|
||||
@@ -150,9 +200,9 @@ class KlipperScreen(Gtk.Window):
|
||||
raise Exception(msg)
|
||||
|
||||
|
||||
def show_panel(self, panel_name, type, remove=None, pop=True, **kwargs):
|
||||
def show_panel(self, panel_name, type, title, remove=None, pop=True, **kwargs):
|
||||
if panel_name not in self.panels:
|
||||
self.panels[panel_name] = self._load_panel(type, self)
|
||||
self.panels[panel_name] = self._load_panel(type, self, title)
|
||||
|
||||
try:
|
||||
if kwargs != {}:
|
||||
@@ -180,6 +230,52 @@ class KlipperScreen(Gtk.Window):
|
||||
self._cur_panels.append(panel_name)
|
||||
logger.debug("Current panel hierarchy: %s", str(self._cur_panels))
|
||||
|
||||
def show_popup_message(self, message):
|
||||
if self.popup_message != None:
|
||||
self.close_popup_message()
|
||||
|
||||
box = Gtk.Box()
|
||||
box.get_style_context().add_class("message_popup")
|
||||
box.set_size_request(self.width, self.gtk.get_header_size())
|
||||
label = Gtk.Label()
|
||||
if "must home axis first" in message.lower():
|
||||
message = "Must home all axis first."
|
||||
label.set_text(message)
|
||||
|
||||
close = Gtk.Button.new_with_label("X")
|
||||
close.set_can_focus(False)
|
||||
close.props.relief = Gtk.ReliefStyle.NONE
|
||||
close.connect("clicked", self.close_popup_message)
|
||||
|
||||
box.pack_start(label, True, True, 0)
|
||||
box.pack_end(close, False, False, 0)
|
||||
box.set_halign(Gtk.Align.CENTER)
|
||||
|
||||
cur_panel = self.panels[self._cur_panels[-1]]
|
||||
for i in ['back','estop','home']:
|
||||
if i in cur_panel.control:
|
||||
cur_panel.control[i].set_sensitive(False)
|
||||
cur_panel.get().put(box, 0,0)
|
||||
|
||||
self.show_all()
|
||||
self.popup_message = box
|
||||
|
||||
GLib.timeout_add(10000, self.close_popup_message)
|
||||
|
||||
return False
|
||||
|
||||
def close_popup_message(self, widget=None):
|
||||
if self.popup_message == None:
|
||||
return
|
||||
|
||||
cur_panel = self.panels[self._cur_panels[-1]]
|
||||
for i in ['back','estop','home']:
|
||||
if i in cur_panel.control:
|
||||
cur_panel.control[i].set_sensitive(True)
|
||||
cur_panel.get().remove(self.popup_message)
|
||||
self.popup_message = None
|
||||
self.show_all()
|
||||
|
||||
def show_error_modal(self, err):
|
||||
_ = self.lang.gettext
|
||||
logger.exception("Showing error modal: %s", err)
|
||||
@@ -195,9 +291,8 @@ class KlipperScreen(Gtk.Window):
|
||||
label.set_halign(Gtk.Align.CENTER)
|
||||
label.set_line_wrap(True)
|
||||
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
label.get_style_context().add_class("text")
|
||||
|
||||
dialog = KlippyGtk.Dialog(self, buttons, label, self.error_modal_response)
|
||||
dialog = self.gtk.Dialog(self, buttons, label, self.error_modal_response)
|
||||
|
||||
def error_modal_response(self, widget, response_id):
|
||||
widget.destroy()
|
||||
@@ -205,7 +300,15 @@ class KlipperScreen(Gtk.Window):
|
||||
|
||||
def init_style(self):
|
||||
style_provider = Gtk.CssProvider()
|
||||
style_provider.load_from_path(klipperscreendir + "/style.css")
|
||||
#style_provider.load_from_path(klipperscreendir + "/style.css")
|
||||
|
||||
css = open(klipperscreendir + "/styles/style.css")
|
||||
css_data = css.read()
|
||||
css.close()
|
||||
css_data = css_data.replace("KS_FONT_SIZE",str(self.gtk.get_font_size()))
|
||||
|
||||
style_provider = Gtk.CssProvider()
|
||||
style_provider.load_from_data(css_data.encode())
|
||||
|
||||
Gtk.StyleContext.add_provider_for_screen(
|
||||
Gdk.Screen.get_default(),
|
||||
@@ -213,6 +316,9 @@ class KlipperScreen(Gtk.Window):
|
||||
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
|
||||
)
|
||||
|
||||
def is_printing(self):
|
||||
return "job_status" in self._cur_panels
|
||||
|
||||
def _go_to_submenu(self, widget, name):
|
||||
logger.info("#### Go to submenu " + str(name))
|
||||
#self._remove_current_panel(False)
|
||||
@@ -225,50 +331,38 @@ class KlipperScreen(Gtk.Window):
|
||||
menu = "__print"
|
||||
|
||||
logger.info("#### Menu " + str(menu))
|
||||
#self.show_panel("_".join(self._cur_panels) + '_' + name, "menu", 1, False, menu=menu)
|
||||
|
||||
disname = self._config.get_menu_name(menu, name)
|
||||
menuitems = self._config.get_menu_items(menu, name)
|
||||
if len(menuitems) == 0:
|
||||
logger.info("No items in menu, returning.")
|
||||
return
|
||||
|
||||
self.show_panel(self._cur_panels[-1] + '_' + name, "menu", 1, False, items=menuitems)
|
||||
return
|
||||
|
||||
grid = self.arrangeMenuItems(menu, 4)
|
||||
|
||||
b = KlippyGtk.ButtonImage('back', 'Back')
|
||||
b.connect("clicked", self._menu_go_back)
|
||||
grid.attach(b, 4, 2, 1, 1)
|
||||
|
||||
self._cur_panels.append(cur_item['name']) #str(cur_item['name']))
|
||||
self.panels[cur_item['name']] = grid
|
||||
self.add(self.panels[cur_item['name']])
|
||||
self.show_all()
|
||||
self.show_panel(self._cur_panels[-1] + '_' + name, "menu", disname, 1, False, display_name=disname,
|
||||
items=menuitems)
|
||||
|
||||
def _remove_all_panels(self):
|
||||
while len(self._cur_panels) > 0:
|
||||
self._remove_current_panel()
|
||||
self._remove_current_panel(True, False)
|
||||
self.show_all()
|
||||
|
||||
|
||||
|
||||
def _remove_current_panel(self, pop=True):
|
||||
def _remove_current_panel(self, pop=True, show=True):
|
||||
if len(self._cur_panels) > 0:
|
||||
self.remove(
|
||||
self.panels[
|
||||
self._cur_panels[-1]
|
||||
].get()
|
||||
)
|
||||
self.remove(self.panels[self._cur_panels[-1]].get())
|
||||
if pop == True:
|
||||
self._cur_panels.pop()
|
||||
if len(self._cur_panels) > 0:
|
||||
self.add(self.panels[self._cur_panels[-1]].get())
|
||||
self.show_all()
|
||||
if show == True:
|
||||
self.show_all()
|
||||
|
||||
def _menu_go_back (self, widget):
|
||||
def _menu_go_back (self, widget=None):
|
||||
logger.info("#### Menu go back")
|
||||
self._remove_current_panel()
|
||||
|
||||
def _menu_go_home(self):
|
||||
logger.info("#### Menu go home")
|
||||
while len(self._cur_panels) > 1:
|
||||
self._remove_current_panel()
|
||||
|
||||
def add_subscription (self, panel_name):
|
||||
add = True
|
||||
@@ -284,52 +378,70 @@ class KlipperScreen(Gtk.Window):
|
||||
self.subscriptions.pop(i)
|
||||
return
|
||||
|
||||
def state_disconnected(self):
|
||||
_ = self.lang.gettext
|
||||
logger.debug("### Going to disconnected")
|
||||
self.printer_initializing(_("Klipper has disconnected"))
|
||||
|
||||
def state_error(self):
|
||||
_ = self.lang.gettext
|
||||
msg = self.printer.get_stat("webhooks","state_message")
|
||||
if "FIRMWARE_RESTART" in msg:
|
||||
self.printer_initializing(
|
||||
_("Klipper has encountered an error.\nIssue a FIRMWARE_RESTART to attempt fixing the issue.")
|
||||
)
|
||||
elif "micro-controller" in msg:
|
||||
self.printer_initializing(
|
||||
_("Klipper has encountered an error with the micro-controller.\nPlease recompile and flash.")
|
||||
)
|
||||
else:
|
||||
self.printer_initializing(
|
||||
_("Klipper has encountered an error.")
|
||||
)
|
||||
|
||||
def state_printing(self):
|
||||
self.printer_printing()
|
||||
|
||||
def state_ready(self):
|
||||
# Do not return to main menu if completing a job, timeouts/user input will return
|
||||
if "job_status" in self._cur_panels or "main_menu" in self._cur_panels:
|
||||
return
|
||||
self.printer_ready()
|
||||
|
||||
def state_startup(self):
|
||||
_ = self.lang.gettext
|
||||
self.printer_initializing(_("Klipper is attempting to start"))
|
||||
|
||||
def state_shutdown(self):
|
||||
_ = self.lang.gettext
|
||||
self.printer_initializing(_("Klipper has shutdown"))
|
||||
|
||||
def _websocket_callback(self, action, data):
|
||||
_ = self.lang.gettext
|
||||
#print(json.dumps([action, data], indent=2))
|
||||
|
||||
if action == "notify_klippy_disconnected":
|
||||
logger.info("### Going to disconnected state")
|
||||
self.printer_initializing(_("Klipper has shutdown"))
|
||||
self.printer.change_state("disconnected")
|
||||
return
|
||||
elif action == "notify_klippy_ready":
|
||||
logger.info("### Going to ready state")
|
||||
self.init_printer()
|
||||
elif action == "notify_status_update" and self.shutdown == False:
|
||||
self.printer.change_state("ready")
|
||||
elif action == "notify_status_update" and self.printer.get_state() != "shutdown":
|
||||
self.printer.process_update(data)
|
||||
if "webhooks" in data:
|
||||
print(json.dumps([action, data], indent=2))
|
||||
if "webhooks" in data and "state" in data['webhooks']:
|
||||
if data['webhooks']['state'] == "ready":
|
||||
logger.info("### Going to ready state")
|
||||
self.printer_ready()
|
||||
elif data['webhooks']['state'] == "shutdown":
|
||||
self.shutdown == True
|
||||
self.printer_initializing(_("Klipper has shutdown"))
|
||||
else:
|
||||
active = self.printer.get_stat('virtual_sdcard','is_active')
|
||||
paused = self.printer.get_stat('pause_resume','is_paused')
|
||||
if "job_status" in self._cur_panels:
|
||||
if active == False and paused == False:
|
||||
self.printer_ready()
|
||||
else:
|
||||
if active == True or paused == True:
|
||||
self.printer_printing()
|
||||
elif action == "notify_filelist_changed":
|
||||
logger.debug("Filelist changed: %s", json.dumps(data,indent=2))
|
||||
#self.files.add_file()
|
||||
elif action == "notify_metadata_update":
|
||||
self.files.update_metadata(data['filename'])
|
||||
self.files.request_metadata(data['filename'])
|
||||
elif action == "notify_power_changed":
|
||||
logger.debug("Power status changed: %s", data)
|
||||
self.printer.process_power_update(data)
|
||||
elif self.shutdown == False and action == "notify_gcode_response":
|
||||
elif self.printer.get_state() not in ["error","shutdown"] and action == "notify_gcode_response":
|
||||
if "Klipper state: Shutdown" in data:
|
||||
self.shutdown == True
|
||||
self.printer_initializing(_("Klipper has shutdown"))
|
||||
self.printer.change_state("shutdown")
|
||||
|
||||
if not (data.startswith("B:") and
|
||||
re.search(r'B:[0-9\.]+\s/[0-9\.]+\sT[0-9]+:[0-9\.]+', data)):
|
||||
if data.startswith("!! "):
|
||||
self.show_popup_message(data[3:])
|
||||
logger.debug(json.dumps([action, data], indent=2))
|
||||
|
||||
for sub in self.subscriptions:
|
||||
@@ -343,15 +455,22 @@ class KlipperScreen(Gtk.Window):
|
||||
{"name":_("Cancel"),"response": Gtk.ResponseType.CANCEL}
|
||||
]
|
||||
|
||||
try:
|
||||
env = Environment(extensions=["jinja2.ext.i18n"])
|
||||
env.install_gettext_translations(self.lang)
|
||||
j2_temp = env.from_string(text)
|
||||
text = j2_temp.render()
|
||||
except:
|
||||
logger.debug("Error parsing jinja for confirm_send_action")
|
||||
|
||||
label = Gtk.Label()
|
||||
label.set_markup(text)
|
||||
label.set_hexpand(True)
|
||||
label.set_halign(Gtk.Align.CENTER)
|
||||
label.set_line_wrap(True)
|
||||
label.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
|
||||
label.get_style_context().add_class("text")
|
||||
|
||||
dialog = KlippyGtk.Dialog(self, buttons, label, self._confirm_send_action_response, method, params)
|
||||
dialog = self.gtk.Dialog(self, buttons, label, self._confirm_send_action_response, method, params)
|
||||
|
||||
def _confirm_send_action_response(self, widget, response_id, method, params):
|
||||
if response_id == Gtk.ResponseType.OK:
|
||||
@@ -364,16 +483,17 @@ class KlipperScreen(Gtk.Window):
|
||||
|
||||
def printer_initializing(self, text=None):
|
||||
self.shutdown = True
|
||||
self.show_panel('splash_screen',"splash_screen", 2)
|
||||
self.close_popup_message()
|
||||
self.show_panel('splash_screen',"splash_screen", "Splash Screen", 2)
|
||||
if text != None:
|
||||
self.panels['splash_screen'].update_text(text)
|
||||
self.panels['splash_screen'].show_restart_buttons()
|
||||
|
||||
def init_printer(self):
|
||||
_ = self.lang.gettext
|
||||
self.shutdown = False
|
||||
|
||||
status_objects = [
|
||||
'bed_mesh',
|
||||
'idle_timeout',
|
||||
'configfile',
|
||||
'gcode_move',
|
||||
@@ -383,51 +503,40 @@ class KlipperScreen(Gtk.Window):
|
||||
'print_stats',
|
||||
'heater_bed',
|
||||
'extruder',
|
||||
'pause_resume'
|
||||
'pause_resume',
|
||||
'webhooks'
|
||||
]
|
||||
info = self.apiclient.get_printer_info()
|
||||
printer_info = self.apiclient.get_printer_info()
|
||||
logger.debug("Sendingn request %s" % "printer/objects/query?" + "&".join(status_objects))
|
||||
data = self.apiclient.send_request("printer/objects/query?" + "&".join(status_objects))
|
||||
powerdevs = self.apiclient.send_request("machine/device_power/devices")
|
||||
if info == False or data == False:
|
||||
self.printer_initializing(_("Moonraker error"))
|
||||
return
|
||||
data = data['result']['status']
|
||||
|
||||
# Reinitialize printer, in case the printer was shut down and anything has changed.
|
||||
self.printer.__init__(data)
|
||||
self.printer.reinit(printer_info['result'], data)
|
||||
self.ws_subscribe()
|
||||
self.printer.configure_power_devices(powerdevs['result'])
|
||||
|
||||
if powerdevs != False:
|
||||
self.printer.configure_power_devices(powerdevs['result'])
|
||||
|
||||
if self.files == None:
|
||||
self.files = KlippyFiles(self)
|
||||
else:
|
||||
self.files.add_timeout()
|
||||
|
||||
if info['result']['state'] == "shutdown":
|
||||
if "FIRMWARE_RESTART" in info['result']['state_message']:
|
||||
self.printer_initializing(
|
||||
_("Klipper has encountered an error. Issue a FIRMWARE_RESTART to attempt fixing the issue.")
|
||||
)
|
||||
else:
|
||||
self.printer_initializing(_("Klipper has shutdown"))
|
||||
return
|
||||
if (data['print_stats']['state'] == "printing" or data['print_stats']['state'] == "paused"):
|
||||
self.printer_printing()
|
||||
return
|
||||
self.printer_ready()
|
||||
|
||||
def printer_ready(self):
|
||||
if self.shutdown == True:
|
||||
self.init_printer()
|
||||
return
|
||||
|
||||
self.files.add_timeout()
|
||||
self.show_panel('main_panel', "main_menu", 2, items=self._config.get_menu_items("__main"), extrudercount=self.printer.get_extruder_count())
|
||||
self.close_popup_message()
|
||||
self.show_panel('main_panel', "main_menu", "Main Menu", 2, items=self._config.get_menu_items("__main"),
|
||||
extrudercount=self.printer.get_extruder_count())
|
||||
self.ws_subscribe()
|
||||
if "job_status" in self.panels:
|
||||
self.remove_subscription("job_status")
|
||||
del self.panels["job_status"]
|
||||
|
||||
def printer_printing(self):
|
||||
self.ws_subscribe()
|
||||
self.files.remove_timeout()
|
||||
self.show_panel('job_status',"job_status", 2)
|
||||
self.close_popup_message()
|
||||
self.show_panel('job_status',"job_status", "Print Status", 2)
|
||||
|
||||
def get_software_version():
|
||||
prog = ('git', '-C', os.path.dirname(__file__), 'describe', '--always',
|
||||
|
||||
@@ -41,11 +41,13 @@ install_systemd_service()
|
||||
KSPATH_ESC=$(sed "s/\//\\\\\//g" <<< $KSPATH)
|
||||
KSENV_ESC=$(sed "s/\//\\\\\//g" <<< $KSENV)
|
||||
|
||||
SERVICE=$(sed "s/KS_USER/$USER/g" <<< $SERVICE)
|
||||
SERVICE=$(sed "s/KS_ENV/$KSENV_ESC/g" <<< $SERVICE)
|
||||
SERVICE=$(sed "s/KS_DIR/$KSPATH_ESC/g" <<< $SERVICE)
|
||||
|
||||
echo "$SERVICE" | sudo tee /etc/systemd/system/KlipperScreen.service > /dev/null
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable KlipperScreen
|
||||
}
|
||||
|
||||
update_x11()
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
websocket==0.2.1
|
||||
requests==2.25.0
|
||||
requests==2.25.1
|
||||
vext==0.7.4
|
||||
websocket-client==0.57.0
|
||||
humanize==3.1.0
|
||||
humanize==3.2.0
|
||||
jinja2==2.11.2
|
||||
@@ -7,10 +7,9 @@ StartLimitIntervalSec=0
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
User=pi
|
||||
User=KS_USER
|
||||
WorkingDirectory=KS_DIR
|
||||
ExecStart=/usr/bin/xinit KS_ENV/bin/python KS_DIR/screen.py
|
||||
ExecStartPost=KS_DIR/scripts/disablescreenblank.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,13 @@
|
||||
xgettext --keyword=_ --language=Python --add-comments --sort-output \
|
||||
-o ks_includes/locales/KlipperScreen.pot \
|
||||
*.py \
|
||||
ks_includes/*.py \
|
||||
panels/*.py \
|
||||
ks_includes/KlipperScreen.conf
|
||||
|
||||
langs=(en fr_FR he_IL zh_CN)
|
||||
for lang in ${langs[@]}; do
|
||||
msgmerge ks_includes/locales/$lang/LC_MESSAGES/KlipperScreen.po \
|
||||
ks_includes/locales/KlipperScreen.pot \
|
||||
-o ks_includes/locales/$lang/LC_MESSAGES/KlipperScreen.po
|
||||
done
|
||||
@@ -1,301 +0,0 @@
|
||||
/* * {
|
||||
|
||||
} */
|
||||
|
||||
window {
|
||||
background-color: #13181C;
|
||||
-gtk-icon-shadow: none;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
scrollbar, scrollbar button, scrollbar trough {
|
||||
border: none;
|
||||
background-color: #13181C;
|
||||
}
|
||||
|
||||
scrollbar slider {
|
||||
min-width: 60px;
|
||||
border-radius: 15px;
|
||||
background-color: #404E57;
|
||||
}
|
||||
|
||||
frame {
|
||||
color: #fff;
|
||||
border-bottom: 1px solid #444;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
progress, trough {
|
||||
min-height: 40px;
|
||||
/*font-size: 50px;*/
|
||||
background-color: #404E57;
|
||||
color: #fff;
|
||||
border: #000 1px solid;
|
||||
}
|
||||
|
||||
progress {
|
||||
background-color: #d47b00;
|
||||
font-size: 50px;
|
||||
font-weight: lighter;
|
||||
}
|
||||
|
||||
.printing-progress-bar {
|
||||
font-size: 25px;
|
||||
color: #00C9B4;
|
||||
}
|
||||
|
||||
.printing-progress-text {
|
||||
font-size: 25px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.printing-state {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
button {
|
||||
background-image: none;
|
||||
background-color: #13181C;
|
||||
margin: 5px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 0;
|
||||
border: 0px solid #000;
|
||||
color: #fff;
|
||||
-gtk-icon-shadow: none;
|
||||
}
|
||||
|
||||
button:active {
|
||||
background-color: #304C62;
|
||||
}
|
||||
|
||||
.button_active {
|
||||
background-color: #20303D;
|
||||
}
|
||||
|
||||
button.color1 {
|
||||
border-bottom: 8px solid #ED6500;
|
||||
}
|
||||
|
||||
button.color2 {
|
||||
border-bottom: 8px solid #B10080;
|
||||
}
|
||||
|
||||
button.color3 {
|
||||
border-bottom: 8px solid #009384;
|
||||
}
|
||||
|
||||
button.color4 {
|
||||
border-bottom: 8px solid #A7E100;
|
||||
}
|
||||
|
||||
button.active {
|
||||
background-color: #20303D;
|
||||
}
|
||||
|
||||
button.file-list {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.distbutton_top {
|
||||
border: 3px solid #fff;
|
||||
border-right: 0px;
|
||||
border-top-left-radius: 15px;
|
||||
border-bottom-left-radius: 15px;
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
.distbutton {
|
||||
border: 3px solid #fff;
|
||||
border-left: 3px solid #ccc;
|
||||
border-right: 0px;
|
||||
margin-left: 0;
|
||||
margin-right: 0px;
|
||||
}
|
||||
|
||||
.distbutton_bottom {
|
||||
border: 3px solid #fff;
|
||||
border-left: 3px solid #ccc;
|
||||
border-top-right-radius: 15px;
|
||||
border-bottom-right-radius: 15px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.tempbutton_top {
|
||||
border: 3px solid #fff;
|
||||
border-bottom: 0px;
|
||||
border-top-left-radius: 15px;
|
||||
border-top-right-radius: 15px;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.tempbutton {
|
||||
border: 3px solid #fff;
|
||||
border-top: 3px solid #ccc;
|
||||
border-bottom: 0px;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.tempbutton_bottom {
|
||||
border: 3px solid #fff;
|
||||
border-top: 3px solid #ccc;
|
||||
border-bottom-left-radius: 15px;
|
||||
border-bottom-right-radius: 15px;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.distbutton_active {
|
||||
background-color: #20303D;
|
||||
}
|
||||
|
||||
entry {
|
||||
font-size: 30px;
|
||||
background-color: #20292F;
|
||||
border-radius: 0;
|
||||
padding-left: 1em;
|
||||
margin-left: 1em;
|
||||
padding-right: 1em;
|
||||
}
|
||||
|
||||
button.keyboard {
|
||||
font-size: 30px;
|
||||
margin: 0px;
|
||||
/* margin-bottom:10px; */
|
||||
}
|
||||
|
||||
.dialog {
|
||||
border: 2px solid black;
|
||||
font-size: 20px;
|
||||
padding: 50px;
|
||||
background-color: #000;
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.dialog button {
|
||||
padding: 30px 50px 30px 50px;
|
||||
border-bottom: 8px solid #009384;
|
||||
}
|
||||
|
||||
.message {
|
||||
border: 2px solid #981E1F;
|
||||
font-size: 20px;
|
||||
padding: 50px;
|
||||
color: #FFF;
|
||||
background-color: #981E1F;
|
||||
}
|
||||
|
||||
.message button {
|
||||
background-color: #FFF;
|
||||
color: #000;
|
||||
padding: 40px 50px 40px 50px;
|
||||
}
|
||||
|
||||
.notification {
|
||||
background-clip: padding-box;
|
||||
padding: 5px;
|
||||
border-radius: 0 0 5px 5px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.warning {
|
||||
background-color: rgba(30, 204, 39, 0.7);
|
||||
}
|
||||
|
||||
.error {
|
||||
background-color: rgba(204, 30, 30, 0.7);
|
||||
}
|
||||
|
||||
.printing-status-label {
|
||||
padding-top: 5px;
|
||||
padding-bottom: 3px;
|
||||
color: #ccc;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
|
||||
.temperature_entry {
|
||||
border: 0px;
|
||||
color: #fff;
|
||||
margin: 10px 5px 5px 5px;
|
||||
}
|
||||
|
||||
.numpad_tleft {
|
||||
border-left: 3px solid #fff;
|
||||
border-top: 3px solid #fff;
|
||||
border-top-left-radius: 15px;
|
||||
margin: 3px 0 0 3px;
|
||||
}
|
||||
|
||||
.numpad_top {
|
||||
border-left: 3px solid #ccc;
|
||||
border-top: 3px solid #fff;
|
||||
margin: 3px 0 0 0;
|
||||
}
|
||||
|
||||
.numpad_tright {
|
||||
border-left: 3px solid #fff;
|
||||
border-right: 3px solid #fff;
|
||||
border-top: 3px solid #fff;
|
||||
border-top-right-radius: 15px;
|
||||
margin: 3px 3px 0 0;
|
||||
}
|
||||
|
||||
.numpad_left {
|
||||
border-left: 3px solid #fff;
|
||||
border-top: 3px solid #ccc;
|
||||
margin: 0 0 0 3px;
|
||||
}
|
||||
|
||||
.numpad_button {
|
||||
border-left: 3px solid #ccc;
|
||||
border-top: 3px solid #ccc;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.numpad_right {
|
||||
border-right: 3px solid #fff;
|
||||
border-left: 3px solid #ccc;
|
||||
border-top: 3px solid #ccc;
|
||||
margin: 0 3px 0 0;
|
||||
}
|
||||
|
||||
.numpad_bleft {
|
||||
border-left: 3px solid #fff;
|
||||
border-bottom: 3px solid #fff;
|
||||
border-top: 3px solid #ccc;
|
||||
border-bottom-left-radius: 15px;
|
||||
margin: 0 0 3px 3px;
|
||||
}
|
||||
|
||||
.numpad_bottom {
|
||||
border-left: 3px solid #ccc;
|
||||
border-bottom: 3px solid #fff;
|
||||
border-top: 3px solid #ccc;
|
||||
margin: 0 0 3px 0;
|
||||
}
|
||||
|
||||
.numpad_bright {
|
||||
border-left: 3px solid #ccc;
|
||||
border-bottom: 3px solid #fff;
|
||||
border-top: 3px solid #ccc;
|
||||
border-right: 3px solid #ccc;
|
||||
border-bottom-right-radius: 15px;
|
||||
margin: 0 3px 3px 0;
|
||||
}
|
||||
|
||||
.fan_slider {
|
||||
margin: 20px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
scale mark {
|
||||
margin-top: 20px;
|
||||
color: #fff;
|
||||
}
|
||||
@@ -0,0 +1,317 @@
|
||||
* {
|
||||
color: #fff;
|
||||
font-size: KS_FONT_SIZEpx;
|
||||
}
|
||||
|
||||
window {
|
||||
background-color: #13181C;
|
||||
-gtk-icon-shadow: none;
|
||||
}
|
||||
|
||||
button {
|
||||
background-image: none;
|
||||
background-color: #13181C;
|
||||
margin: .25em;
|
||||
margin-bottom: .5em;
|
||||
border-radius: 0;
|
||||
border: 0 solid #000;
|
||||
-gtk-icon-shadow: none;
|
||||
}
|
||||
|
||||
button:active {
|
||||
background-color: #304C62;
|
||||
}
|
||||
|
||||
.button_active {
|
||||
background-color: #20303D;
|
||||
}
|
||||
|
||||
button.color1 {
|
||||
border-bottom: .4em solid #ED6500;
|
||||
}
|
||||
|
||||
button.color2 {
|
||||
border-bottom: .4em solid #B10080;
|
||||
}
|
||||
|
||||
button.color3 {
|
||||
border-bottom: .4em solid #009384;
|
||||
}
|
||||
|
||||
button.color4 {
|
||||
border-bottom: .4em solid #A7E100;
|
||||
}
|
||||
|
||||
button.active {
|
||||
background-color: #20303D;
|
||||
}
|
||||
|
||||
button.file-list {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
entry {
|
||||
font-size: 1em;
|
||||
background-color: #20292F;
|
||||
border: 0;
|
||||
padding: .25em;
|
||||
}
|
||||
|
||||
frame {
|
||||
color: #fff;
|
||||
border-bottom: 1px solid #444;
|
||||
}
|
||||
|
||||
label {
|
||||
color: white;
|
||||
}
|
||||
|
||||
progress, trough {
|
||||
min-height: 2em;
|
||||
background-color: #404E57;
|
||||
color: #fff;
|
||||
border: #000 1px solid;
|
||||
}
|
||||
|
||||
progress {
|
||||
background-color: #d47b00;
|
||||
}
|
||||
|
||||
scale mark {
|
||||
margin-top: 1em;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
scrollbar, scrollbar button, scrollbar trough {
|
||||
border: none;
|
||||
background-color: #13181C;
|
||||
}
|
||||
|
||||
scrollbar slider {
|
||||
min-width: 3em;
|
||||
border-radius: .7em;
|
||||
background-color: #404E57;
|
||||
}
|
||||
|
||||
trough {
|
||||
margin: .5em 1em;
|
||||
}
|
||||
|
||||
.dialog {
|
||||
border: .1em solid black;
|
||||
padding: 2.5em;
|
||||
background-color: #000;
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
.dialog button {
|
||||
padding: 1.5em 2.5em 1.5em 2.5em;
|
||||
border-bottom: .4em solid #009384;
|
||||
}
|
||||
|
||||
.distbutton_active {
|
||||
background-color: #20303D;
|
||||
}
|
||||
|
||||
.distbutton_top {
|
||||
border: .15em solid #fff;
|
||||
border-right: 0;
|
||||
border-top-left-radius: .75em;
|
||||
border-bottom-left-radius: .75em;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.distbutton {
|
||||
border: .15em solid #fff;
|
||||
border-left: .15em solid #ccc;
|
||||
border-right: 0;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.distbutton_bottom {
|
||||
border: .15em solid #fff;
|
||||
border-left: .15em solid #ccc;
|
||||
border-top-right-radius: .7em;
|
||||
border-bottom-right-radius: .7em;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.fan_slider {
|
||||
margin: 1em;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.frame-item {
|
||||
min-height: 4.5em;
|
||||
padding: .1em .75em;
|
||||
}
|
||||
|
||||
.message_popup {
|
||||
background-color: #367554;
|
||||
border-bottom: .1em solid #fff;
|
||||
}
|
||||
|
||||
.message_popup button {
|
||||
background-color: #367554;
|
||||
}
|
||||
|
||||
.numpad_tleft {
|
||||
border-left: .15em solid #fff;
|
||||
border-top: .15em solid #fff;
|
||||
border-top-left-radius: .7em;
|
||||
margin: .15em 0 0 .15em;
|
||||
}
|
||||
|
||||
.numpad_top {
|
||||
border-left: .15em solid #ccc;
|
||||
border-top: .15em solid #fff;
|
||||
margin: .15em 0 0 0;
|
||||
}
|
||||
|
||||
.numpad_tright {
|
||||
border-left: .15em solid #fff;
|
||||
border-right: .15em solid #fff;
|
||||
border-top: .15em solid #fff;
|
||||
border-top-right-radius: .7em;
|
||||
margin: .15em .15em 0 0;
|
||||
}
|
||||
|
||||
.numpad_left {
|
||||
border-left: .15em solid #fff;
|
||||
border-top: .15em solid #ccc;
|
||||
margin: 0 0 0 .15em;
|
||||
}
|
||||
|
||||
.numpad_button {
|
||||
border-left: .15em solid #ccc;
|
||||
border-top: .15em solid #ccc;
|
||||
margin: 0;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
.numpad_right {
|
||||
border-right: .15em solid #fff;
|
||||
border-left: .15em solid #ccc;
|
||||
border-top: .15em solid #ccc;
|
||||
margin: 0 .15em 0 0;
|
||||
}
|
||||
|
||||
.numpad_bleft {
|
||||
border-left: .15em solid #fff;
|
||||
border-bottom: .15em solid #fff;
|
||||
border-top: .15em solid #ccc;
|
||||
border-bottom-left-radius: .7em;
|
||||
margin: 0 0 .15em .15em;
|
||||
}
|
||||
|
||||
.numpad_bottom {
|
||||
border-left: .15em solid #ccc;
|
||||
border-bottom: .15em solid #fff;
|
||||
border-top: .15em solid #ccc;
|
||||
margin: 0 0 .15em 0;
|
||||
}
|
||||
|
||||
.numpad_bright {
|
||||
border-left: .15em solid #ccc;
|
||||
border-bottom: .15em solid #fff;
|
||||
border-top: .15em solid #ccc;
|
||||
border-right: .15em solid #ccc;
|
||||
border-bottom-right-radius: .7em;
|
||||
margin: 0 .15em .15em 0;
|
||||
}
|
||||
|
||||
.printing-filename {
|
||||
font-size: 1.75em;
|
||||
font-weight: bold;
|
||||
margin: .25em .25em 0 0;
|
||||
}
|
||||
|
||||
.printing-info {
|
||||
font-size: 1.2em;
|
||||
margin-left: .25em;
|
||||
}
|
||||
|
||||
.printing-info-box {
|
||||
padding-left: .25em;
|
||||
}
|
||||
|
||||
.printing-info-box box {
|
||||
margin-bottom: .5em;
|
||||
}
|
||||
|
||||
.printing-status {
|
||||
color: #f0f0f0;
|
||||
font-style: italic;
|
||||
margin: 0 0 0 0;
|
||||
}
|
||||
|
||||
.printing-progress-bar {
|
||||
color: #00C9B4;
|
||||
}
|
||||
|
||||
.printing-progress-text {
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.printing-status-label {
|
||||
padding-top: .25em;
|
||||
padding-bottom: .15em;
|
||||
color: #ccc;
|
||||
font-size: 1.25em;
|
||||
}
|
||||
|
||||
.tempbutton_top {
|
||||
border: .15em solid #fff;
|
||||
border-bottom: 0;
|
||||
border-top-left-radius: .75em;
|
||||
border-top-right-radius: .75em;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.tempbutton {
|
||||
border: .15em solid #fff;
|
||||
border-top: .15em solid #ccc;
|
||||
border-bottom: 0;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.tempbutton_bottom {
|
||||
border: .15em solid #fff;
|
||||
border-top: .15em solid #ccc;
|
||||
border-bottom-left-radius: .7em;
|
||||
border-bottom-right-radius: .7em;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.message {
|
||||
border: .1em solid #981E1F;
|
||||
font-size: 1em;
|
||||
padding: 2.5em;
|
||||
color: #FFF;
|
||||
background-color: #981E1F;
|
||||
}
|
||||
|
||||
.message button {
|
||||
background-color: #FFF;
|
||||
color: #000;
|
||||
padding: 2em 2.5em 2em 2.5em;
|
||||
}
|
||||
|
||||
.notification {
|
||||
background-clip: padding-box;
|
||||
padding: .25em;
|
||||
border-radius: 0 0 .25em .25em;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.warning {
|
||||
background-color: rgba(30, 204, 39, 0.7);
|
||||
}
|
||||
|
||||
.error {
|
||||
background-color: rgba(204, 30, 30, 0.7);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" ?><svg data-name="Layer 1" id="Layer_1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title/><path style="fill:#FFFFFF" d="M12,2A10,10,0,1,0,22,12,10,10,0,0,0,12,2Zm0,18a8,8,0,1,1,8-8A8,8,0,0,1,12,20ZM13,6H11v7h6V11H13Z"/></svg>
|
||||
|
After Width: | Height: | Size: 259 B |
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
sodipodi:docname="emergency.svg"
|
||||
inkscape:version="1.0 (4035a4fb49, 2020-05-01)"
|
||||
version="1.1"
|
||||
id="svg4160"
|
||||
viewBox="0 0 60.137677 60.776516"
|
||||
height="60.776516"
|
||||
width="60.13768">
|
||||
<defs
|
||||
id="defs4162">
|
||||
<rect
|
||||
id="rect35"
|
||||
height="75.089285"
|
||||
width="56.160714"
|
||||
y="3.7185006"
|
||||
x="-24.056441" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
inkscape:document-rotation="0"
|
||||
inkscape:snap-global="false"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:window-y="-11"
|
||||
inkscape:window-x="-11"
|
||||
inkscape:window-height="2066"
|
||||
inkscape:window-width="3840"
|
||||
showguides="false"
|
||||
units="in"
|
||||
showgrid="true"
|
||||
inkscape:current-layer="layer1"
|
||||
inkscape:document-units="px"
|
||||
inkscape:cy="30.217279"
|
||||
inkscape:cx="2.3098192"
|
||||
inkscape:zoom="11.313709"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
borderopacity="1.0"
|
||||
bordercolor="#666666"
|
||||
pagecolor="#ffffff"
|
||||
id="base">
|
||||
<inkscape:grid
|
||||
originy="-29.820954"
|
||||
originx="-9.9771178"
|
||||
id="grid4712"
|
||||
type="xygrid" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata4165">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
transform="translate(-3.5328446,2.2636422)"
|
||||
style="display:inline"
|
||||
inkscape:label="Move"
|
||||
id="layer2"
|
||||
inkscape:groupmode="layer">
|
||||
<g
|
||||
id="g46"
|
||||
transform="translate(-6.0411758,-15.071814)">
|
||||
<path
|
||||
style="fill:none;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
d="m 22.795553,16.619161 3.21242,-1.25 3.212421,1.25 v 47.687531 l -3.212421,0.892857 -3.21242,-0.892857 z"
|
||||
id="rect4760-8"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="ccccccc" />
|
||||
<ellipse
|
||||
style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#d40000;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
|
||||
id="path4508"
|
||||
cx="39.64286"
|
||||
cy="43.19643"
|
||||
rx="29.040764"
|
||||
ry="29.130053" />
|
||||
</g>
|
||||
<text
|
||||
transform="translate(47.1875,-4.8214286)"
|
||||
style="font-style:normal;font-weight:normal;font-size:53px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;white-space:pre;shape-inside:url(#rect35);fill:#d40000;fill-opacity:1;stroke:none;"
|
||||
id="text33"
|
||||
xml:space="preserve"><tspan
|
||||
x="-26"
|
||||
y="52.376338"><tspan
|
||||
style="font-weight:bold;font-size:53px;fill:#d40000">!</tspan></tspan></text>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="77px" height="80px" viewBox="0 0 77 80" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 52.5 (67469) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>extruder1</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="Artboard" transform="translate(-62.000000, -173.000000)">
|
||||
<g id="extruder-1" transform="translate(62.000000, 173.000000)">
|
||||
<g id="Group" transform="translate(10.000000, 6.000000)" fill="#FFFFFF" stroke="#FFFFFF" stroke-linecap="round" stroke-width="2">
|
||||
<path d="M0.5,3.5 L6,0.5" id="Line"></path>
|
||||
<path d="M6,0.5 L14.5,0.5" id="Line-2"></path>
|
||||
<path d="M14.5,0.5 L17.5,4.5" id="Line-3" stroke-linejoin="round"></path>
|
||||
<path d="M0.5,3.5 L0.5,15.5" id="Line-5"></path>
|
||||
<path d="M17.5,4.5 L29.5,4.5" id="Line-4"></path>
|
||||
<path d="M0.5,15.5 L4,21.5" id="Line-6"></path>
|
||||
<path d="M4,47.5 L0.5,52.5" id="Line-8"></path>
|
||||
<path d="M0.5,52.5 L0.5,66.5" id="Line-9"></path>
|
||||
<path d="M4,21.5 L4,47.5" id="Line-7"></path>
|
||||
<path d="M0.5,66.5 L13.5,69" id="Line-10"></path>
|
||||
<path d="M13.5,69 L17.5,64.5" id="Line-11"></path>
|
||||
<path d="M17.5,64.5 L29.5,64.5" id="Line-12"></path>
|
||||
</g>
|
||||
<g id="Group" transform="translate(52.000000, 40.500000) scale(-1, 1) translate(-52.000000, -40.500000) translate(37.000000, 6.000000)" stroke="#FFFFFF" stroke-linecap="round" stroke-width="2">
|
||||
<path d="M0.5,3.5 L6,0.5" id="Line"></path>
|
||||
<path d="M6,0.5 L14.5,0.5" id="Line-2"></path>
|
||||
<path d="M14.5,0.5 L17.5,4.5" id="Line-3" stroke-linejoin="round"></path>
|
||||
<path d="M0.5,3.5 L0.5,15.5" id="Line-5"></path>
|
||||
<path d="M17.5,4.5 L29.5,4.5" id="Line-4"></path>
|
||||
<path d="M0.5,15.5 L4,21.5" id="Line-6"></path>
|
||||
<path d="M4,47.5 L0.5,52.5" id="Line-8"></path>
|
||||
<path d="M0.5,52.5 L0.5,66.5" id="Line-9"></path>
|
||||
<path d="M4,21.5 L4,47.5" id="Line-7"></path>
|
||||
<path d="M0.5,66.5 L13.5,69" id="Line-10"></path>
|
||||
<path d="M13.5,69 L17.5,64.5" id="Line-11"></path>
|
||||
<path d="M17.5,64.5 L29.5,64.5" id="Line-12"></path>
|
||||
</g>
|
||||
<circle id="Oval" stroke="#FFFFFF" stroke-width="2" cx="38.5" cy="35.5" r="19.5"></circle>
|
||||
<circle id="Oval" stroke="#000000" stroke-width="0.5" fill="#FFFFFF" cx="55" cy="22" r="21"></circle>
|
||||
<text id="1" font-family="OpenSans-SemiBold, Open Sans" font-size="26" font-weight="500" fill="#000000">
|
||||
<tspan x="47.6188697" y="31">0</tspan>
|
||||
</text>
|
||||
<path d="M35.5,73.5 L38.5,77.5" id="Line-16" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
|
||||
<path d="M38.5,77.5 L41.5,73.5" id="Line-17" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
|
||||
<path d="M29.5,73.5 L47.5,73.5" id="Line-14" stroke="#FFFFFF" stroke-width="2" stroke-linecap="round"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" ?><svg data-name="Layer 1" id="Layer_1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title/><path style="fill:#FFFFFF" d="M19,6.76V2H6V6.76A4,4,0,0,0,7.17,9.59L9.59,12,7.17,14.41A4.06,4.06,0,0,0,6,17.24V22H19V17.24a4.06,4.06,0,0,0-1.17-2.83L15.41,12l2.42-2.41A4,4,0,0,0,19,6.76ZM8,4h9V6H8Zm8.41,11.83A2,2,0,0,1,17,17.24V20H8V17.24a2,2,0,0,1,.59-1.41l2.76-2.77L11.4,13h2.2l.05.06Zm-2.76-4.89L13.6,11H11.4l-.05-.06L8.59,8.17A1.22,1.22,0,0,1,8.44,8h8.12a1.22,1.22,0,0,1-.15.17Z"/></svg>
|
||||
|
After Width: | Height: | Size: 515 B |