diff --git a/README.md b/README.md
index 131387a..bc07f5a 100644
--- a/README.md
+++ b/README.md
@@ -31,10 +31,53 @@ resources.
This is the main reason because I develop this X application to be executed
in my 3d printer.
+## This version brings some major improvements and fixes:
+
+### Improvements:
+- Built-in DPMS control to disable screen blanking
+- Status screen optimized, with larger and more visible progress bar and larger buttons
+- New button has been added to the temperature controls, allowing to heat only the nozzle up, for example for filament changes
+- Redesigned reboot / shutdown buttons in the system menu
+- New confirmation dialog when pressing Stop print button
+
+### Fixes:
+- Mid-print freezing of the interface has been fixed
+- Print/pause/stop buttons now work correctly
+- Random appearance of splash screen after pressing pause / resume has been fixed
+
Installation
------------
-### Dependencies
+## Install the GUI context
+First we need to make sure the GUI context is set up correctly and running on your TFT screen. For this, please follow the instructions, based on your specific installation:
+
+
+### For Raspbian installation
+If you first installed Raspbian, and then manually installed Octoprint:
+```sh
+sudo apt install lightdm
+```
+If you have previously attempted to install Octoprint-TFT, during the follwing GUI installation process you could be asked whether to use Lightdm or Octoprint-TFT as your default window manager. Please select Lightdm for now.
+After installation is completed, reboot and make sure the GUI works on your TFT screen.
+NOTE: if the screen remains blank, you should try reinstalling the TFT screen drivers (depending on your screen make and model).
+
+### For Octopi installation
+If you have installed Octopi directly. First you need to install GUI context:
+```sh
+sudo /home/pi/scripts/install-desktop
+```
+If you have previously attempted to install Octoprint-TFT, during the follwing GUI installation process you could be asked whether to use Lightdm or Octoprint-TFT as your default window manager. Please select Lightdm for now.
+Answer 'yes' to all questions. After installation is completed, reboot and make sure the GUI works on your TFT screen.
+NOTE: if the screen remains blank, you should try reinstalling the TFT screen drivers (depending on your screen make and model).
+
+## Uninstall Lightdm window manager
+Prior to Octoprint-TFT installation, we need to remove Lightdm window manager, as it could interefere with the successful installation of OctoPrint TFT. In order to do this without removing dependencies that are also required by Octoprint-TFT, run:
+
+```sh
+sudo dpkg -r --force-depends lightdm
+```
+
+## Dependencies
*OctoPrint-TFT* is based on [Golang](golang.org), usually this means that is
dependency-less, but in this case [GTK+3](https://developer.gnome.org/gtk3/3.0/gtk.html)
@@ -52,23 +95,35 @@ OctoPi does not come with graphical environment, additionally install:
```sh
sudo apt-get install xserver-xorg xinit
```
+IMPORTANT!!! In order for the DPMS management to work correctly, you need to install:
+```sh
+sudo apt-get install x11-xserver-utils
+```
-### Installation on Raspbian/OctoPi (recommended)
+## Installation using the Debian installer for Raspbian/OctoPi (recommended)
The recommended way to install *OctoPrint-TFT* is use the `.deb` packages
-from the [Releases](https://github.com/mcuadros/OctoPrint-TFT/releases) page. The packages
+from the [Releases](https://github.com/darksid3r/OctoPrint-TFT/releases) page. The packages
are available for Debian based distributions such as Raspbian and OctoPi for
-versions `jessie` and `stretch`.
+versions `Jessie` or `Stretch`.
+
+In order to check which Debian version you have installed, run the following command:
+
+```sh
+cat /etc/os-release | grep PRETTY_NAME
+```
+
+For example, for a Raspbian Stretch, version 1.1:
-For example for a Raspbian Jessie:
```sh
-> wget https://github.com/mcuadros/OctoPrint-TFT/releases/download/v0.1.0/octoprint-tft_0.1.0-1.jessie_armhf.deb
-> dpkg -i octoprint-tft_0.1.0-1.jessie_armhf.deb
+> wget https://github.com/darksid3r/OctoPrint-TFT/releases/download/1.1/octoprint-tft_stretch_1.1.git91fa718-1_armhf.deb
+> sudo dpkg -i octoprint-tft_stretch_1.1.git91fa718-1_armhf.deb
```
+### Please note that in order to get the latest version of Octoprint-TFT for your specific Debian release, go to the "Releases" section of this page.
-### Install from source
+## Install from source
The compilation and packaging tasks are managed by the [`Makefile`](Makefile)
and backed on [Docker](Dockerfile). Docker is used to avoid installing any other
diff --git a/debian/local/disablescreenblank.sh b/debian/local/disablescreenblank.sh
new file mode 100644
index 0000000..3ee4221
--- /dev/null
+++ b/debian/local/disablescreenblank.sh
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+screen=${1:-0}
+
+# wait 20s for the display manager service to start and attach to screen
+sleep 20
+
+/usr/bin/xset -display :$screen s off # deactivate screen saver
+/usr/bin/xset -display :$screen -dpms # disable DPMS
+/usr/bin/xset -display :$screen s noblank # disable screen blanking
+
diff --git a/debian/octoprint-tft.install b/debian/octoprint-tft.install
index 615c5c9..89eafda 100644
--- a/debian/octoprint-tft.install
+++ b/debian/octoprint-tft.install
@@ -1,2 +1,3 @@
-debian/local/octoprint-tft-environment etc
-debian/local/insserv.conf.d etc
+debian/local/octoprint-tft-environment etc
+debian/local/insserv.conf.d/octoprint-tft etc/insserv.conf.d
+debian/local/disablescreenblank.sh etc
diff --git a/debian/octoprint-tft.postinst b/debian/octoprint-tft.postinst
old mode 100755
new mode 100644
index 082bb47..669589d
--- a/debian/octoprint-tft.postinst
+++ b/debian/octoprint-tft.postinst
@@ -35,6 +35,7 @@ if [ "$1" = configure ] && [ -d /etc/systemd/system/ ]; then
echo "Display manager service is masked" >&2
elif [ -e "$SERVICE" ]; then
ln -sf "$SERVICE" "$DEFAULT_SERVICE"
+ chmod +x /etc/disablescreenblank.sh
else
echo "WARNING: $SERVICE is the selected default display manager but does not exist" >&2
rm -f "$DEFAULT_SERVICE"
diff --git a/debian/octoprint-tft.service b/debian/octoprint-tft.service
index c4f43fa..1a5730c 100644
--- a/debian/octoprint-tft.service
+++ b/debian/octoprint-tft.service
@@ -6,6 +6,7 @@ After=systemd-user-sessions.service getty@tty7.service plymouth-quit.service
[Service]
EnvironmentFile=/etc/octoprint-tft-environment
ExecStart=/usr/bin/xinit /usr/bin/OctoPrint-TFT -- :0 -nolisten tcp -nocursor
+ExecStartPost=/etc/disablescreenblank.sh 0
StandardOutput=journal
Restart=always
RestartSec=1s
diff --git a/debian/rules b/debian/rules
old mode 100755
new mode 100644
diff --git a/styles/default/images/back.svg b/styles/default/images/back.svg
index 1ac347b..95979c1 100644
--- a/styles/default/images/back.svg
+++ b/styles/default/images/back.svg
@@ -84,7 +84,7 @@
inkscape:connector-curvature="0"
id="path7561"
d="m 38.323568,26.061953 -17.56836,17.787109 17.78711,17.56836 7.027343,-7.115235 -5.699218,-5.628906 h 20.740234 v -10 h -20.6875 l 5.515625,-5.583984 z"
- style="fill:none;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/bed.svg b/styles/default/images/bed.svg
index 3061587..01e8475 100644
--- a/styles/default/images/bed.svg
+++ b/styles/default/images/bed.svg
@@ -84,25 +84,25 @@
inkscape:connector-curvature="0"
id="path4434"
d="m 32.825393,25.942337 c 0,0 4.297062,4.866713 4.079832,7.62116 -0.16145,2.047151 -3.752831,3.272536 -3.898507,5.320432 -0.15243,2.142847 3.189558,3.750169 3.263866,5.895614 0.08507,2.456252 -3.196392,4.445587 -3.263866,6.902183 -0.06368,2.318578 2.719888,6.614591 2.719888,6.614591"
- style="fill:none;fill-rule:evenodd;stroke:#fbb351;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/bed_off.svg b/styles/default/images/bed_off.svg
new file mode 100644
index 0000000..1233b0a
--- /dev/null
+++ b/styles/default/images/bed_off.svg
@@ -0,0 +1,72 @@
+
+
+
+
diff --git a/styles/default/images/calibrate.svg b/styles/default/images/calibrate.svg
index f4ed49c..b476ab2 100644
--- a/styles/default/images/calibrate.svg
+++ b/styles/default/images/calibrate.svg
@@ -84,36 +84,36 @@
inkscape:connector-curvature="0"
id="path7561-4"
d="m 7.548005,19.993455 8.214692,-7.874475 8.30088,7.792715 -3.286059,3.149792 -2.659605,-2.496887 0.110498,9.190042 -4.670963,0.05054 -0.110217,-9.166674 -2.578872,2.472206 -3.320354,-3.117258 z"
- style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#fbb351;stroke-width:1.36491191;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:1.36491191;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#ff670f;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#ff670f;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:1.36491191;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:1.36491191;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:1.36491191;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="display:inline;fill:#ff670f;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:9;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
-
-
-
+
+
+
diff --git a/styles/default/images/decrease.svg b/styles/default/images/decrease.svg
index 8b21482..44b4f58 100644
--- a/styles/default/images/decrease.svg
+++ b/styles/default/images/decrease.svg
@@ -84,7 +84,7 @@
inkscape:connector-curvature="0"
id="path4535"
d="m 21.25,39.535714 h 40 v 10 h -40 z"
- style="fill:none;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/delete.svg b/styles/default/images/delete.svg
new file mode 100644
index 0000000..74f4d52
--- /dev/null
+++ b/styles/default/images/delete.svg
@@ -0,0 +1,19 @@
+
+
+
diff --git a/styles/default/images/extrude.svg b/styles/default/images/extrude.svg
index 42fad68..3cd3f6a 100644
--- a/styles/default/images/extrude.svg
+++ b/styles/default/images/extrude.svg
@@ -107,7 +107,7 @@
inkscape:connector-curvature="0"
id="path4710-2"
d="m 29.752599,64.146236 3.756999,5.270354 3.638377,-5.270354 z"
- style="display:inline;fill:none;fill-rule:evenodd;stroke:#fbb351;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="display:inline;fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="display:inline;fill:#ff670f;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:2.73126698;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/extruder.svg b/styles/default/images/extruder.svg
index c388d4a..0a8a03e 100644
--- a/styles/default/images/extruder.svg
+++ b/styles/default/images/extruder.svg
@@ -79,7 +79,7 @@
inkscape:connector-curvature="0"
id="path4710"
d="M 25.836759,53.108992 40.228325,69.155562 54.1655,53.108992 Z"
- style="fill:none;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;stroke:#ff670f;stroke-width:2.81566715;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/fan-on.svg b/styles/default/images/fan-on.svg
index fe8a7b5..beb5d9e 100644
--- a/styles/default/images/fan-on.svg
+++ b/styles/default/images/fan-on.svg
@@ -117,7 +117,7 @@
cy="43.547615"
cx="39.822281"
id="path5114"
- style="fill:none;fill-opacity:1;stroke:#fbb351;stroke-width:2.81566715;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;stroke:#ff670f;stroke-width:2.81566715;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="display:inline;fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="display:inline;fill:#ff670f;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:2.73126698;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/filament_clean.svg b/styles/default/images/filament_clean.svg
new file mode 100644
index 0000000..04a287a
--- /dev/null
+++ b/styles/default/images/filament_clean.svg
@@ -0,0 +1,37 @@
+
+
+
diff --git a/styles/default/images/file.svg b/styles/default/images/file.svg
index 74521b5..9df1597 100644
--- a/styles/default/images/file.svg
+++ b/styles/default/images/file.svg
@@ -82,22 +82,22 @@
inkscape:connector-curvature="0"
id="path6012-9"
d="m 40.255032,17.515472 v 10 h 9"
- style="display:inline;opacity:1;fill:#fbb351;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="display:inline;opacity:1;fill:#ff670f;fill-opacity:1;fill-rule:evenodd;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="display:inline;opacity:1;fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/files.svg b/styles/default/images/files.svg
index 2330c87..a762e8e 100644
--- a/styles/default/images/files.svg
+++ b/styles/default/images/files.svg
@@ -1,110 +1,29 @@
-
-
-
-
+
+
+
diff --git a/styles/default/images/finish.svg b/styles/default/images/finish.svg
new file mode 100644
index 0000000..d81c545
--- /dev/null
+++ b/styles/default/images/finish.svg
@@ -0,0 +1,131 @@
+
+
+
+
diff --git a/styles/default/images/heat-up.svg b/styles/default/images/heat-up.svg
index 6bca096..ea7b9ec 100644
--- a/styles/default/images/heat-up.svg
+++ b/styles/default/images/heat-up.svg
@@ -80,14 +80,14 @@
cy="97.833321"
cx="-7.0827856"
id="path4837"
- style="fill:#d7b351;fill-opacity:1;stroke:#d7b351;stroke-width:1.99953949;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#ff670f;fill-opacity:1;stroke:#ff670f;stroke-width:1.99953949;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#ff670f;fill-opacity:1;stroke:#ff670f;stroke-width:2.81615663;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/home-x.svg b/styles/default/images/home-x.svg
index 4964eaf..00b8506 100644
--- a/styles/default/images/home-x.svg
+++ b/styles/default/images/home-x.svg
@@ -85,13 +85,13 @@
inkscape:connector-curvature="0"
id="path7561-4"
d="M 50.958201,63.223502 33.122106,45.704877 50.640734,27.868782 l 7.134442,7.007842 -5.613196,5.714691 20.737849,-0.314541 0.151657,9.99885 -20.68512,0.313741 5.599675,5.499693 z"
- style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#ff670f;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/home-y.svg b/styles/default/images/home-y.svg
index 4be91ad..11d3384 100644
--- a/styles/default/images/home-y.svg
+++ b/styles/default/images/home-y.svg
@@ -85,14 +85,14 @@
inkscape:connector-curvature="0"
id="path7561-4"
d="M 59.591359,39.025291 41.881524,56.671543 24.235271,38.961705 l 7.084326,-7.058501 5.653863,5.67446 -0.09102,-20.740035 9.999904,-0.04389 0.09079,20.6873 5.559723,-5.540077 7.058503,7.084325 z"
- style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#ff670f;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/home-z.svg b/styles/default/images/home-z.svg
index 6cc5d62..33728f9 100644
--- a/styles/default/images/home-z.svg
+++ b/styles/default/images/home-z.svg
@@ -84,14 +84,14 @@
inkscape:connector-curvature="0"
id="path7561-4"
d="M 56.941331,35.239568 39.355752,53.009653 21.585667,35.424072 l 7.034623,-7.108037 5.693541,5.634648 -0.236549,-20.738885 9.99935,-0.114053 0.235947,20.686154 5.520713,-5.578953 z"
- style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#ff670f;fill-opacity:1;fill-rule:nonzero;stroke:#ffffff;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/home.svg b/styles/default/images/home.svg
index c9f7cd9..3c708e9 100644
--- a/styles/default/images/home.svg
+++ b/styles/default/images/home.svg
@@ -69,7 +69,7 @@
style="display:inline;opacity:1"
id="g37">
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/motor-off.svg b/styles/default/images/motor-off.svg
index ffa9e7a..100f0c5 100644
--- a/styles/default/images/motor-off.svg
+++ b/styles/default/images/motor-off.svg
@@ -85,14 +85,14 @@
inkscape:connector-curvature="0"
id="path4535"
d="M 39.382891,38.886141 57.933077,66.678837 49.659078,72.294968 31.108892,44.502272 30.826474,35.633291 Z"
- style="fill:#fbb351;fill-opacity:1;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#ff670f;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#ff670f;fill-opacity:1;stroke-width:3;stroke-miterlimit:4;stroke-dasharray:none" />
+ style="display:inline;fill:#ff670f;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:2.27288914;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="display:inline;fill:#ff670f;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:2.27288914;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="display:inline;fill:#ff670f;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:2.27288914;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/move-x+.svg b/styles/default/images/move-x+.svg
index 74d9c33..616127e 100644
--- a/styles/default/images/move-x+.svg
+++ b/styles/default/images/move-x+.svg
@@ -85,7 +85,7 @@
inkscape:connector-curvature="0"
id="path7561-4"
d="M 51.280343,63.044931 69.116438,45.526306 51.59781,27.690211 l -7.134442,7.007842 5.613196,5.714691 -20.737849,-0.314541 -0.151657,9.99885 20.68512,0.313741 -5.599675,5.499693 z"
- style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/move-x-.svg b/styles/default/images/move-x-.svg
index d4d693a..540faa5 100644
--- a/styles/default/images/move-x-.svg
+++ b/styles/default/images/move-x-.svg
@@ -85,7 +85,7 @@
inkscape:connector-curvature="0"
id="path7561-4"
d="M 27.922487,63.044931 10.086392,45.526306 27.60502,27.690211 l 7.134442,7.007842 -5.613196,5.714691 20.737849,-0.314541 0.151657,9.99885 -20.68512,0.313741 5.599675,5.499693 z"
- style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/move-y+.svg b/styles/default/images/move-y+.svg
index b7b17c0..63ea771 100644
--- a/styles/default/images/move-y+.svg
+++ b/styles/default/images/move-y+.svg
@@ -84,7 +84,7 @@
inkscape:connector-curvature="0"
id="path7561-4-3"
d="M 58.029325,30.86777 40.443746,13.097685 22.673661,30.683266 l 7.034623,7.108037 5.693541,-5.634648 -0.236549,20.738885 9.99935,0.114053 0.235947,-20.686154 5.520713,5.578953 z"
- style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/move-y-.svg b/styles/default/images/move-y-.svg
index 75ee5cd..ae926a1 100644
--- a/styles/default/images/move-y-.svg
+++ b/styles/default/images/move-y-.svg
@@ -85,7 +85,7 @@
inkscape:connector-curvature="0"
id="path7561-4"
d="M 58.029325,51.229977 40.443746,69.000062 22.673661,51.414481 l 7.034623,-7.108037 5.693541,5.634648 -0.236549,-20.738885 9.99935,-0.114053 0.235947,20.686154 5.520713,-5.578953 z"
- style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/move-z+.svg b/styles/default/images/move-z+.svg
index 9d55d3f..4bb4f4b 100644
--- a/styles/default/images/move-z+.svg
+++ b/styles/default/images/move-z+.svg
@@ -84,7 +84,7 @@
inkscape:connector-curvature="0"
id="path7561-4"
d="M 58.029325,30.86777 40.443746,13.097685 22.673661,30.683266 l 7.034623,7.108037 5.693541,-5.634648 -0.236549,20.738885 9.99935,0.114053 0.235947,-20.686154 5.520713,5.578953 z"
- style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/move-z-.svg b/styles/default/images/move-z-.svg
index 0711a44..4c838f2 100644
--- a/styles/default/images/move-z-.svg
+++ b/styles/default/images/move-z-.svg
@@ -85,7 +85,7 @@
inkscape:connector-curvature="0"
id="path7561-4-3"
d="M 58.029325,54.858544 40.443746,72.628629 22.673661,55.043048 l 7.034623,-7.108037 5.693541,5.634648 -0.236549,-20.738885 9.99935,-0.114053 0.235947,20.686154 5.520713,-5.578953 z"
- style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#232323;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/move.svg b/styles/default/images/move.svg
index baef42d..8ee9a0d 100644
--- a/styles/default/images/move.svg
+++ b/styles/default/images/move.svg
@@ -85,7 +85,7 @@
cy="38.997379"
cx="-43.947254"
id="path8128"
- style="fill:#fbb351;fill-opacity:1;fill-rule:nonzero;stroke:#fbb351;stroke-width:2.35894179;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:#ff670f;fill-opacity:1;fill-rule:nonzero;stroke:#ff670f;stroke-width:2.35894179;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2.28880167;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2.28880167;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/print.svg b/styles/default/images/print.svg
index 1ac347b..95979c1 100644
--- a/styles/default/images/print.svg
+++ b/styles/default/images/print.svg
@@ -84,7 +84,7 @@
inkscape:connector-curvature="0"
id="path7561"
d="m 38.323568,26.061953 -17.56836,17.787109 17.78711,17.56836 7.027343,-7.115235 -5.699218,-5.628906 h 20.740234 v -10 h -20.6875 l 5.515625,-5.583984 z"
- style="fill:none;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/reboot.svg b/styles/default/images/reboot.svg
index 63810fa..6c621b7 100644
--- a/styles/default/images/reboot.svg
+++ b/styles/default/images/reboot.svg
@@ -9,82 +9,96 @@
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"
- width="60.13768"
- height="60.776516"
- viewBox="0 0 60.137677 60.776516"
- id="svg4160"
+ width="60"
+ height="61"
+ viewBox="0 0 15.875 16.139584"
version="1.1"
- inkscape:version="0.92.2 5c3e80d, 2017-08-06"
- sodipodi:docname="power.svg">
+ id="svg4003"
+ inkscape:version="0.92.4 (unknown)"
+ sodipodi:docname="reboot.svg">
+ id="defs3997">
+
+
+
+
-
-
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ units="px"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="1920"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1" />
+ id="metadata4000">
image/svg+xml
-
+
-
-
-
-
-
+ id="layer1"
+ transform="translate(0,-280.8604)">
+
+
+
+
diff --git a/styles/default/images/refresh.svg b/styles/default/images/refresh.svg
index 1cdb0db..3cb02ea 100644
--- a/styles/default/images/refresh.svg
+++ b/styles/default/images/refresh.svg
@@ -103,7 +103,7 @@
inkscape:transform-center-x="3.8692967"
inkscape:transform-center-y="1.5048666" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2.28880167;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2.95693779;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/retract.svg b/styles/default/images/retract.svg
index 481a0e2..3a5cf89 100644
--- a/styles/default/images/retract.svg
+++ b/styles/default/images/retract.svg
@@ -107,7 +107,7 @@
inkscape:connector-curvature="0"
id="path4710-2"
d="m 29.752599,64.146236 3.756999,5.270354 3.638377,-5.270354 z"
- style="display:inline;fill:none;fill-rule:evenodd;stroke:#fbb351;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="display:inline;fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="display:inline;fill:#ff670f;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:2.73126698;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/sd.svg b/styles/default/images/sd.svg
index 7b866fb..1712312 100644
--- a/styles/default/images/sd.svg
+++ b/styles/default/images/sd.svg
@@ -83,28 +83,28 @@
height="11"
width="2"
id="rect4378"
- style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/sd_eject.svg b/styles/default/images/sd_eject.svg
index fba90f6..781bfea 100644
--- a/styles/default/images/sd_eject.svg
+++ b/styles/default/images/sd_eject.svg
@@ -83,28 +83,28 @@
height="11"
width="2"
id="rect4378"
- style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;fill-rule:nonzero;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:1.94661856;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:2.95693779;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/settings.svg b/styles/default/images/settings.svg
index 28cabd9..b226680 100644
--- a/styles/default/images/settings.svg
+++ b/styles/default/images/settings.svg
@@ -87,7 +87,7 @@
diff --git a/styles/default/images/shutdown.svg b/styles/default/images/shutdown.svg
new file mode 100644
index 0000000..627edbc
--- /dev/null
+++ b/styles/default/images/shutdown.svg
@@ -0,0 +1,82 @@
+
+
+
+
diff --git a/styles/default/images/speed-step.svg b/styles/default/images/speed-step.svg
index 8e3b1f8..5ae5964 100644
--- a/styles/default/images/speed-step.svg
+++ b/styles/default/images/speed-step.svg
@@ -122,7 +122,7 @@
inkscape:connector-curvature="0"
id="path4242"
d="m 43.310553,48.055281 -1.497561,-3.709086 14.65785,-3.761307 z"
- style="fill:#fbb351;fill-opacity:1;fill-rule:evenodd;stroke:#fbb351;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
+ style="fill:#ff670f;fill-opacity:1;fill-rule:evenodd;stroke:#ff670f;stroke-width:1px;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;stroke:#ff670f;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-opacity:1;stroke:#ff670f;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/images/stop.svg b/styles/default/images/stop.svg
index 101f60e..f940318 100644
--- a/styles/default/images/stop.svg
+++ b/styles/default/images/stop.svg
@@ -84,7 +84,7 @@
inkscape:connector-curvature="0"
id="path4535"
d="M 52.545757,29.135597 52.532897,57.079565 27.27567,57.078631 27.28853,29.134663 Z"
- style="fill:none;fill-rule:evenodd;stroke:#fbb351;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+ style="fill:none;fill-rule:evenodd;stroke:#ff670f;stroke-width:3;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
diff --git a/styles/default/style.css b/styles/default/style.css
index c847e9e..9947689 100644
--- a/styles/default/style.css
+++ b/styles/default/style.css
@@ -1,16 +1,77 @@
-.dialog { border: 2px solid black; }
+.dialog { border: 2px solid #333333; }
.notification {
background-clip: padding-box;
padding: 5px;
- border-radius: 0 0 5px 5px;
+ border-radius: 0;
opacity: 0.8;
}
.warning {
- background-color:rgba(30, 204, 39, 0.7);
+ background-color:rgba(23, 153, 29, 0.7);
}
.error {
- background-color:rgba(204, 30, 30, 0.7);
+ background-color:rgba(165, 23, 23, 0.7);
}
+
+GtkWindow {
+ background-color: #000000;
+}
+
+GtkButton {
+ background-image: none;
+ background-color:#101010;
+ /*border:0;*/
+ margin:2px;
+ border-radius:0;
+}
+
+.scrollbar {
+ -GtkRange-slider-width: 4px;
+}
+
+.slider{
+ border-radius:0;
+ border-width:0;
+}
+
+
+@define-color progress_bg_color #37C8AB;
+
+#PrintProg {
+ color: white;
+ font-style: normal;
+ font-weight: bold;
+ font-size: 18px;
+ min-height: 40px;
+ min-width: 60px;
+ margin-top: 10px;
+ margin-bottom: 30px;
+}
+
+#NameLabel {
+ font-size: 16px;
+ font-weight: bold;
+}
+
+#TimeLabel {
+ font-size: 18px;
+ font-weight: bold;
+}
+
+#TempLabel {
+ font-size: 16px;
+ font-weight: bold;
+}
+
+@define-color progress_bg_color #ff6c00;
+@define-color progress_bg_color1 #ffa666;
+
+
+progress, trough {
+ min-height: 30px;
+ border: 1px solid shade (@progress_bg_color, 0.9);
+ color: #000000;
+}
+
diff --git a/ui/common.go b/ui/common.go
index c0f4dc7..914a957 100644
--- a/ui/common.go
+++ b/ui/common.go
@@ -53,8 +53,6 @@ func (p *CommonPanel) Initialize() {
for i := len(p.buttons) + 1; i < last; i++ {
p.AddButton(MustBox(gtk.ORIENTATION_HORIZONTAL, 0))
}
-
- p.AddButton(MustButtonImage("Back", "back.svg", p.UI.GoHistory))
}
func (p *CommonPanel) Parent() Panel {
diff --git a/ui/control.go b/ui/control.go
index bcb7be7..104e4f1 100644
--- a/ui/control.go
+++ b/ui/control.go
@@ -9,7 +9,7 @@ import (
var control = []*octoprint.ControlDefinition{{
Name: "Motor Off",
- Command: "M18",
+ Command: "M84",
}, {
Name: "Fan On",
Command: "M106",
@@ -46,6 +46,7 @@ func (m *controlPanel) initialize() {
b := m.createCommandButton(c)
m.AddButton(b)
}
+ m.Grid().Attach(MustButtonImage("Back", "back.svg", m.UI.GoHistory), 4, 1, 1, 1)
}
func (m *controlPanel) getControl() []*octoprint.ControlDefinition {
diff --git a/ui/default.go b/ui/default.go
index 12e3e89..6e9beb3 100644
--- a/ui/default.go
+++ b/ui/default.go
@@ -18,12 +18,12 @@ func DefaultPanel(ui *UI) Panel {
func (m *defaultPanel) initialize() {
m.Grid().Attach(MustButtonImage("Status", "status.svg", m.showStatus), 1, 0, 1, 1)
- m.Grid().Attach(MustButtonImage("Heat Up", "heat-up.svg", m.showTemperature), 2, 0, 1, 1)
- m.Grid().Attach(MustButtonImage("Move", "move.svg", m.showMove), 3, 0, 1, 1)
- m.Grid().Attach(MustButtonImage("Home", "home.svg", m.showHome), 4, 0, 1, 1)
- m.Grid().Attach(MustButtonImage("Filament", "filament.svg", m.showFilament), 1, 1, 1, 1)
- m.Grid().Attach(MustButtonImage("Control", "control.svg", m.showControl), 2, 1, 1, 1)
- m.Grid().Attach(MustButtonImage("Files", "files.svg", m.showFiles), 3, 1, 1, 1)
+ m.Grid().Attach(MustButtonImage("Files", "files.svg", m.showFiles), 2, 0, 1, 1)
+ m.Grid().Attach(MustButtonImage("Heat Up", "heat-up.svg", m.showTemperature), 3, 0, 1, 1)
+ m.Grid().Attach(MustButtonImage("Filament", "filament_clean.svg", m.showFilament), 4, 0, 1, 1)
+ m.Grid().Attach(MustButtonImage("Home", "home.svg", m.showHome), 1, 1, 1, 1)
+ m.Grid().Attach(MustButtonImage("Move", "move.svg", m.showMove), 2, 1, 1, 1)
+ m.Grid().Attach(MustButtonImage("Control", "fan-on.svg", m.showControl), 3, 1, 1, 1)
m.Grid().Attach(MustButtonImage("System", "settings.svg", m.showSystem), 4, 1, 1, 1)
}
@@ -36,7 +36,7 @@ func (m *defaultPanel) showHome() {
}
func (m *defaultPanel) showTemperature() {
- m.UI.Add(TemperaturePanel(m.UI, m))
+ m.UI.Add(ProfilesPanel(m.UI, m))
}
func (m *defaultPanel) showFilament() {
diff --git a/ui/filament.go b/ui/filament.go
index b1bc6a1..2476286 100644
--- a/ui/filament.go
+++ b/ui/filament.go
@@ -28,7 +28,7 @@ func FilamentPanel(ui *UI, parent Panel) Panel {
labels: map[string]*LabelWithImage{},
}
- m.b = NewBackgroundTask(time.Second*5, m.updateTemperatures)
+ m.b = NewBackgroundTask(time.Second*2, m.updateTemperatures)
m.initialize()
filamentPanelInstance = m
}
@@ -39,8 +39,8 @@ func FilamentPanel(ui *UI, parent Panel) Panel {
func (m *filamentPanel) initialize() {
defer m.Initialize()
- m.Grid().Attach(m.createExtrudeButton("Extrude", "extrude.svg", 1), 1, 0, 1, 1)
- m.Grid().Attach(m.createExtrudeButton("Retract", "retract.svg", -1), 4, 0, 1, 1)
+ m.Grid().Attach(m.createExtrudeButton("Retract", "retract.svg", -1), 1, 0, 1, 1)
+ m.Grid().Attach(m.createExtrudeButton("Extrude", "extrude.svg", 1), 4, 0, 1, 1)
m.box = MustBox(gtk.ORIENTATION_VERTICAL, 5)
m.box.SetVAlign(gtk.ALIGN_CENTER)
@@ -53,6 +53,8 @@ func (m *filamentPanel) initialize() {
m.Grid().Attach(m.createToolButton(), 1, 1, 1, 1)
m.Grid().Attach(m.createFlowrateButton(), 3, 1, 1, 1)
+
+ m.Grid().Attach(MustButtonImage("Back", "back.svg", m.UI.GoHistory), 4, 1, 1, 1)
}
func (m *filamentPanel) updateTemperatures() {
@@ -79,7 +81,7 @@ func (m *filamentPanel) loadTemperatureState(s *octoprint.TemperatureState) {
}
m.previous = s
-}
+}
func (m *filamentPanel) addNewTool(tool string) {
m.labels[tool] = MustLabelWithImage("extruder.svg", "")
@@ -90,11 +92,11 @@ func (m *filamentPanel) addNewTool(tool string) {
}
func (m *filamentPanel) loadTemperatureData(tool string, d *octoprint.TemperatureData) {
- text := fmt.Sprintf("%s: %.1f°C / %.1f°C", strings.Title(tool), d.Actual, d.Target)
+ text := fmt.Sprintf("%s: %.1f°C \n⇒ %.1f°C", strings.Title(tool), d.Actual, d.Target)
if m.previous != nil && d.Target > 0 {
if p, ok := m.previous.Current[tool]; ok {
- text = fmt.Sprintf("%s (%.1f°C)", text, d.Actual-p.Actual)
+ text = fmt.Sprintf("%s\nΔ (%.1f°C)", text, d.Actual-p.Actual)
}
}
diff --git a/ui/files.go b/ui/files.go
index 48baeee..3a91115 100644
--- a/ui/files.go
+++ b/ui/files.go
@@ -3,7 +3,7 @@ package ui
import (
"fmt"
"sort"
- "time"
+ //"time"
"github.com/dustin/go-humanize"
"github.com/gotk3/gotk3/gtk"
@@ -19,11 +19,11 @@ type filesPanel struct {
}
func FilesPanel(ui *UI, parent Panel) Panel {
- if filesPanelInstance == nil {
+ // if filesPanelInstance == nil {
m := &filesPanel{CommonPanel: NewCommonPanel(ui, parent)}
m.initialize()
filesPanelInstance = m
- }
+ // }
return filesPanelInstance
}
@@ -52,25 +52,25 @@ func (m *filesPanel) createActionBar() gtk.IWidget {
bar.SetMarginEnd(5)
bar.Add(m.createRefreshButton())
- bar.Add(m.createInitReleaseSDButton())
- bar.Add(MustButton(MustImageFromFileWithSize("back.svg", 40, 40), m.UI.GoHistory))
+ //bar.Add(m.createInitReleaseSDButton())
+ bar.Add(MustButton(MustImageFromFileWithSize("back.svg", 35, 35), m.UI.GoHistory))
return bar
}
func (m *filesPanel) createRefreshButton() gtk.IWidget {
- return MustButton(MustImageFromFileWithSize("refresh.svg", 40, 40), m.doLoadFiles)
+ return MustButton(MustImageFromFileWithSize("refresh.svg", 35, 35), m.doLoadFiles)
}
func (m *filesPanel) doLoadFiles() {
Logger.Info("Refreshing list of files")
- m.doRefreshSD()
+ //m.doRefreshSD()
local := m.doLoadFilesFromLocation(octoprint.Local)
- sdcard := m.doLoadFilesFromLocation(octoprint.SDCard)
+ //sdcard := m.doLoadFilesFromLocation(octoprint.SDCard)
s := byDate(local)
- s = append(s, sdcard...)
+ //s = append(s, sdcard...)
sort.Sort(s)
EmptyContainer(&m.list.Container)
@@ -85,11 +85,11 @@ func (m *filesPanel) doLoadFiles() {
m.list.ShowAll()
}
-func (m *filesPanel) doRefreshSD() {
- if err := (&octoprint.SDRefreshRequest{}).Do(m.UI.Printer); err != nil {
- Logger.Error(err)
- }
-}
+// func (m *filesPanel) doRefreshSD() {
+// if err := (&octoprint.SDRefreshRequest{}).Do(m.UI.Printer); err != nil {
+// Logger.Error(err)
+// }
+// }
func (m *filesPanel) doLoadFilesFromLocation(l octoprint.Location) []*octoprint.FileInformation {
r := &octoprint.FilesRequest{Location: l, Recursive: true}
@@ -106,31 +106,34 @@ func (m *filesPanel) addFile(b *gtk.Box, f *octoprint.FileInformation) {
frame, _ := gtk.FrameNew("")
name := MustLabel(f.Name)
- name.SetMarkup(fmt.Sprintf("%s", filenameEllipsis(f.Name)))
+ name.SetMarkup(fmt.Sprintf("%s", filenameEllipsis(f.Name)))
name.SetHExpand(true)
+ name.SetHAlign(gtk.ALIGN_START)
+ name.SetMarginTop(5)
info := MustLabel("")
- info.SetMarkup(fmt.Sprintf("Uploaded: %s - Size: %s",
+ info.SetMarkup(fmt.Sprintf("%s - %s",
humanize.Time(f.Date.Time), humanize.Bytes(uint64(f.Size)),
))
+ info.SetHAlign(gtk.ALIGN_START)
labels := MustBox(gtk.ORIENTATION_VERTICAL, 5)
labels.Add(name)
labels.Add(info)
actions := MustBox(gtk.ORIENTATION_HORIZONTAL, 5)
- actions.Add(m.createLoadAndPrintButton("load.svg", f, false))
- actions.Add(m.createLoadAndPrintButton("status.svg", f, true))
+ actions.Add(m.createLoadAndPrintButton("status.svg", f))
+ // actions.Add(m.createLoadAndPrintButton("load.svg", f, false))
+ actions.Add(m.createDeleteButton("delete.svg", f))
+ actions.SetHAlign(gtk.ALIGN_END)
file := MustBox(gtk.ORIENTATION_HORIZONTAL, 5)
- file.SetMarginTop(15)
- file.SetMarginEnd(15)
- file.SetMarginStart(15)
- file.SetMarginBottom(15)
+ file.SetMarginTop(5)
+ file.SetMarginEnd(5)
+ file.SetMarginStart(5)
+ file.SetMarginBottom(5)
file.SetHExpand(true)
- file.Add(MustImageFromFileWithSize("file.svg", 35, 35))
-
file.Add(labels)
file.Add(actions)
@@ -138,67 +141,127 @@ func (m *filesPanel) addFile(b *gtk.Box, f *octoprint.FileInformation) {
b.Add(frame)
}
-func (m *filesPanel) createLoadAndPrintButton(img string, f *octoprint.FileInformation, print bool) gtk.IWidget {
+func (m *filesPanel) createLoadAndPrintButton(img string, f *octoprint.FileInformation) gtk.IWidget {
return MustButton(
- MustImageFromFileWithSize(img, 30, 30),
- MustConfirmDialog(m.UI.w, "Are you sure you want to proceed?", func() {
- r := &octoprint.SelectFileRequest{}
- r.Location = octoprint.Local
- r.Path = f.Path
- r.Print = print
-
- Logger.Infof("Loading file %q, printing: %v", f.Name, print)
- if err := r.Do(m.UI.Printer); err != nil {
- Logger.Error(err)
- return
- }
- }),
+ MustImageFromFileWithSize(img, 20, 20),
+ PrintDialog(m.UI.w, "File loaded. Start printing?\n"+filenameEllipsis_short(f.Name), f.Path, m),
)
}
-func (m *filesPanel) createInitReleaseSDButton() gtk.IWidget {
- release := MustImageFromFileWithSize("sd_eject.svg", 40, 40)
- init := MustImageFromFileWithSize("sd.svg", 40, 40)
- b := MustButton(release, nil)
-
- state := func() {
- time.Sleep(50 * time.Millisecond)
- switch m.isReady() {
- case true:
- b.SetImage(release)
- case false:
- b.SetImage(init)
- }
- }
- b.Connect("clicked", func() {
- var err error
- if !m.isReady() {
- err = (&octoprint.SDInitRequest{}).Do(m.UI.Printer)
- } else {
- err = (&octoprint.SDReleaseRequest{}).Do(m.UI.Printer)
- }
- if err != nil {
- Logger.Error(err)
- }
+func PrintDialog(parent *gtk.Window, msg string, pfad string, ma *filesPanel) func() {
+ return func() {
+ win := gtk.MessageDialogNewWithMarkup(
+ parent,
+ gtk.DIALOG_MODAL,
+ gtk.MESSAGE_INFO,
+ gtk.BUTTONS_YES_NO,
+ "",
+ )
- state()
- })
+ win.SetMarkup(CleanHTML(msg))
+ defer win.Destroy()
- return b
-}
+ box, _ := win.GetContentArea()
+ box.SetMarginStart(15)
+ box.SetMarginEnd(15)
+ box.SetMarginTop(15)
+ box.SetMarginBottom(15)
-func (m *filesPanel) isReady() bool {
- state, err := (&octoprint.SDStateRequest{}).Do(m.UI.Printer)
- if err != nil {
- Logger.Error(err)
- return false
+ ctx, _ := win.GetStyleContext()
+ ctx.AddClass("dialog")
+
+ ergebnis := win.Run()
+
+ if ergebnis == int(gtk.RESPONSE_NO) {
+ ro := &octoprint.SelectFileRequest{}
+ ro.Location = octoprint.Local
+ ro.Path = pfad
+ ro.Print = false
+
+ Logger.Infof("Loading file %q", ro)
+ if err := ro.Do(ma.UI.Printer); err != nil {
+ Logger.Error(err)
+ return
+ }
+ }else if ergebnis == int(gtk.RESPONSE_YES) {
+ rt := &octoprint.SelectFileRequest{}
+ rt.Location = octoprint.Local
+ rt.Path = pfad
+ rt.Print = true
+
+ Logger.Infof("Printing file %q", rt)
+ if err := rt.Do(ma.UI.Printer); err != nil {
+ Logger.Error(err)
+ return
+ }
+ }
}
+}
- return state.Ready
+func (m *filesPanel) createDeleteButton(img string, de *octoprint.FileInformation) gtk.IWidget {
+ return MustButton(
+ MustImageFromFileWithSize(img, 20, 20),
+ MustConfirmDialog(m.UI.w, "Delete file?\n"+filenameEllipsis_short(de.Name), func() {
+ del := &octoprint.DeleteFileRequest{}
+ del.Location = octoprint.Local
+ del.Path = de.Path
+
+ Logger.Infof("RM %q FROM %v", de.Path, octoprint.Local)
+ if err := del.Do(m.UI.Printer); err != nil {
+ Logger.Error(err)
+ return
+ }
+
+ m.doLoadFiles()
+ }),
+ )
}
+// func (m *filesPanel) createInitReleaseSDButton() gtk.IWidget {
+// release := MustImageFromFileWithSize("sd_eject.svg", 40, 40)
+// init := MustImageFromFileWithSize("sd.svg", 40, 40)
+// b := MustButton(release, nil)
+
+// state := func() {
+// time.Sleep(50 * time.Millisecond)
+// switch m.isReady() {
+// case true:
+// b.SetImage(release)
+// case false:
+// b.SetImage(init)
+// }
+// }
+
+// b.Connect("clicked", func() {
+// var err error
+// if !m.isReady() {
+// err = (&octoprint.SDInitRequest{}).Do(m.UI.Printer)
+// } else {
+// err = (&octoprint.SDReleaseRequest{}).Do(m.UI.Printer)
+// }
+
+// if err != nil {
+// Logger.Error(err)
+// }
+
+// state()
+// })
+
+// return b
+// }
+
+// func (m *filesPanel) isReady() bool {
+// state, err := (&octoprint.SDStateRequest{}).Do(m.UI.Printer)
+// if err != nil {
+// Logger.Error(err)
+// return false
+// }
+
+// return state.Ready
+// }
+
type byDate []*octoprint.FileInformation
func (s byDate) Len() int { return len(s) }
diff --git a/ui/home.go b/ui/home.go
index 66f02d4..6d42a35 100644
--- a/ui/home.go
+++ b/ui/home.go
@@ -31,12 +31,13 @@ func (m *homePanel) initialize() {
m.AddButton(m.createMoveButton("Home X", "home-x.svg", octoprint.XAxis))
m.AddButton(m.createMoveButton("Home Y", "home-y.svg", octoprint.YAxis))
m.AddButton(m.createMoveButton("Home Z", "home-z.svg", octoprint.ZAxis))
+ m.Grid().Attach(MustButtonImage("Back", "back.svg", m.UI.GoHistory), 4, 1, 1, 1)
}
func (m *homePanel) createMoveButton(label, image string, axes ...octoprint.Axis) gtk.IWidget {
return MustButtonImage(label, image, func() {
cmd := &octoprint.PrintHeadHomeRequest{Axes: axes}
- Logger.Warningf("Homing the print head in %s axes", axes)
+ Logger.Warningf("Homing %s axes", axes)
if err := cmd.Do(m.UI.Printer); err != nil {
Logger.Error(err)
return
diff --git a/ui/move.go b/ui/move.go
index b199b94..8831c70 100644
--- a/ui/move.go
+++ b/ui/move.go
@@ -28,17 +28,19 @@ func (m *movePanel) initialize() {
defer m.Initialize()
m.AddButton(m.createMoveButton("X+", "move-x+.svg", octoprint.XAxis, 1))
- m.AddButton(m.createMoveButton("Y+", "move-y+.svg", octoprint.YAxis, 1))
+ m.AddButton(m.createMoveButton("Y-", "move-y+.svg", octoprint.YAxis, -1))
m.AddButton(m.createMoveButton("Z+", "move-z+.svg", octoprint.ZAxis, 1))
m.step = MustStepButton("move-step.svg",
- Step{"5mm", 5}, Step{"10mm", 10}, Step{"1mm", 1},
+ Step{"20mm", 20}, Step{"10mm", 10}, Step{"1mm", 1},
)
m.AddButton(m.step)
m.AddButton(m.createMoveButton("X-", "move-x-.svg", octoprint.XAxis, -1))
- m.AddButton(m.createMoveButton("Y-", "move-y-.svg", octoprint.YAxis, -1))
+ m.AddButton(m.createMoveButton("Y+", "move-y-.svg", octoprint.YAxis, 1))
m.AddButton(m.createMoveButton("Z-", "move-z-.svg", octoprint.ZAxis, -1))
+
+ m.Grid().Attach(MustButtonImage("Back", "back.svg", m.UI.GoHistory), 4, 1, 1, 1)
}
func (m *movePanel) createMoveButton(label, image string, a octoprint.Axis, dir int) gtk.IWidget {
@@ -55,7 +57,7 @@ func (m *movePanel) createMoveButton(label, image string, a octoprint.Axis, dir
cmd.Z = distance
}
- Logger.Warningf("Jogging print head axis %s in %dmm",
+ Logger.Warningf("Jogging %s axis in %dmm",
strings.ToUpper(string(a)), distance,
)
diff --git a/ui/status.go b/ui/status.go
index 5e11611..04eb3e9 100644
--- a/ui/status.go
+++ b/ui/status.go
@@ -2,7 +2,6 @@ package ui
import (
"fmt"
- "strings"
"time"
"github.com/gotk3/gotk3/gtk"
@@ -16,17 +15,21 @@ type statusPanel struct {
step *StepButton
pb *gtk.ProgressBar
- bed, tool0, tool1 *LabelWithImage
- file, left *LabelWithImage
+ bed, tool0 *LabelWithImage
+ file, left, finish *LabelWithImage
+ //status *LabelWithImage
print, pause, stop *gtk.Button
+ taskRunning bool
+ printerStatus uint8
}
func StatusPanel(ui *UI, parent Panel) Panel {
if statusPanelInstance == nil {
m := &statusPanel{CommonPanel: NewCommonPanel(ui, parent)}
- m.b = NewBackgroundTask(time.Second*5, m.update)
+ m.b = NewBackgroundTask(time.Second*1, m.update)
m.initialize()
-
+ m.taskRunning = false
+ m.printerStatus = 0
statusPanelInstance = m
}
@@ -36,71 +39,87 @@ func StatusPanel(ui *UI, parent Panel) Panel {
func (m *statusPanel) initialize() {
defer m.Initialize()
- m.Grid().Attach(m.createMainBox(), 1, 0, 4, 1)
- m.Grid().Attach(m.createPrintButton(), 1, 1, 1, 1)
- m.Grid().Attach(m.createPauseButton(), 2, 1, 1, 1)
- m.Grid().Attach(m.createStopButton(), 3, 1, 1, 1)
+ m.Grid().Attach(m.createMainBox(), 1, 0, 4, 2)
+
+
}
func (m *statusPanel) createProgressBar() *gtk.ProgressBar {
m.pb = MustProgressBar()
m.pb.SetShowText(true)
- m.pb.SetMarginTop(10)
- m.pb.SetMarginStart(10)
- m.pb.SetMarginEnd(10)
-
+ //m.pb.SetMarginTop(12)
+ //m.pb.SetMarginStart(5)
+ //m.pb.SetMarginEnd(5)
+ //m.pb.SetMarginBottom(20)
+ m.pb.SetName("PrintProg")
return m.pb
}
func (m *statusPanel) createMainBox() *gtk.Box {
- grid := MustGrid()
- grid.SetHExpand(true)
- grid.Add(m.createInfoBox())
- grid.Add(m.createTemperatureBox())
box := MustBox(gtk.ORIENTATION_VERTICAL, 5)
- box.SetVAlign(gtk.ALIGN_CENTER)
+ box.SetVAlign(gtk.ALIGN_START)
box.SetVExpand(true)
+
+ grid := MustGrid()
+ grid.SetHExpand(true)
+ grid.Add(m.createInfoBox())
+ grid.SetVAlign(gtk.ALIGN_START)
+ grid.SetMarginTop(20)
+
box.Add(grid)
- box.Add(m.createProgressBar())
+ pb_box := MustBox(gtk.ORIENTATION_VERTICAL, 5)
+ pb_box.SetVExpand(true)
+ pb_box.SetHExpand(true)
+ //pb_box.Add(MustButton(MustImageFromFileWithSize("back.svg", 60, 60), m.UI.GoHistory))
+ pb_box.Add(m.createProgressBar())
+ box.Add(pb_box)
+
+ butt := MustBox(gtk.ORIENTATION_HORIZONTAL, 0)
+ butt.SetHAlign(gtk.ALIGN_END)
+ butt.SetVAlign(gtk.ALIGN_END)
+ butt.SetVExpand(true)
+ butt.SetMarginTop(0)
+ butt.SetMarginEnd(0)
+ butt.Add(m.createPrintButton())
+ butt.Add(m.createPauseButton())
+ butt.Add(m.createStopButton())
+ butt.Add(MustButton(MustImageFromFileWithSize("back.svg", 60, 60), m.UI.GoHistory))
+ box.Add(butt)
return box
}
func (m *statusPanel) createInfoBox() *gtk.Box {
m.file = MustLabelWithImage("file.svg", "")
+ m.file.SetName("NameLabel")
m.left = MustLabelWithImage("speed-step.svg", "")
+ m.left.SetName("TimeLabel")
+ m.finish = MustLabelWithImage("finish.svg", "")
+ m.finish.SetName("TimeLabel")
+ m.bed = MustLabelWithImage("bed.svg", "")
+ m.bed.SetName("TempLabel")
+ m.tool0 = MustLabelWithImage("extruder.svg", "")
+ m.tool0.SetName("TempLabel")
+// m.status = MustLabelWithImage("file.svg", "")
info := MustBox(gtk.ORIENTATION_VERTICAL, 5)
info.SetHAlign(gtk.ALIGN_START)
info.SetHExpand(true)
- info.SetVExpand(true)
info.Add(m.file)
info.Add(m.left)
- info.SetMarginStart(10)
+ info.Add(m.finish)
+ info.Add(m.tool0)
+ info.Add(m.bed)
+// info.Add(m.status)
+ info.SetMarginStart(20)
return info
}
-func (m *statusPanel) createTemperatureBox() *gtk.Box {
- m.bed = MustLabelWithImage("bed.svg", "")
- m.tool0 = MustLabelWithImage("extruder.svg", "")
- m.tool1 = MustLabelWithImage("extruder.svg", "")
-
- temp := MustBox(gtk.ORIENTATION_VERTICAL, 5)
- temp.SetHAlign(gtk.ALIGN_START)
- temp.SetHExpand(true)
- temp.SetVExpand(true)
- temp.Add(m.bed)
- temp.Add(m.tool0)
- temp.Add(m.tool1)
-
- return temp
-}
-
func (m *statusPanel) createPrintButton() gtk.IWidget {
- m.print = MustButtonImage("Print", "status.svg", func() {
- defer m.updateTemperature()
+ m.print = MustButton(MustImageFromFileWithSize("status.svg", 60, 60), func() {
+ defer m.updateTemperature() // modified dark
Logger.Warning("Starting a new job")
if err := (&octoprint.StartRequest{}).Do(m.UI.Printer); err != nil {
@@ -113,12 +132,11 @@ func (m *statusPanel) createPrintButton() gtk.IWidget {
}
func (m *statusPanel) createPauseButton() gtk.IWidget {
- m.pause = MustButtonImage("Pause", "pause.svg", func() {
+ m.pause = MustButton(MustImageFromFileWithSize("pause.svg", 60, 60), func() {
defer m.updateTemperature()
Logger.Warning("Pausing/Resuming job")
- cmd := &octoprint.PauseRequest{Action: octoprint.Toggle}
- if err := cmd.Do(m.UI.Printer); err != nil {
+ if err := (&octoprint.PauseRequest{Action: octoprint.Toggle}).Do(m.UI.Printer); err != nil {
Logger.Error(err)
return
}
@@ -128,22 +146,19 @@ func (m *statusPanel) createPauseButton() gtk.IWidget {
}
func (m *statusPanel) createStopButton() gtk.IWidget {
- m.stop = MustButtonImage("Stop", "stop.svg", func() {
- defer m.updateTemperature()
-
- Logger.Warning("Stopping job")
- if err := (&octoprint.CancelRequest{}).Do(m.UI.Printer); err != nil {
- Logger.Error(err)
- return
- }
- })
-
+ m.stop = MustButton(MustImageFromFileWithSize("stop.svg", 60, 60),
+ ConfirmStopDialog(m.UI.w, "Are you sure you want to stop current print?", m),
+ )
return m.stop
}
func (m *statusPanel) update() {
- m.updateTemperature()
- m.updateJob()
+ if m.taskRunning == false {
+ m.taskRunning = true
+ m.updateTemperature()
+ m.updateJob()
+ m.taskRunning = false
+ }
}
func (m *statusPanel) updateTemperature() {
@@ -152,49 +167,52 @@ func (m *statusPanel) updateTemperature() {
Logger.Error(err)
return
}
-
m.doUpdateState(&s.State)
- m.tool1.Hide()
for tool, s := range s.Temperature.Current {
- text := fmt.Sprintf("%s: %.0f°C / %.0f°C", strings.Title(tool), s.Actual, s.Target)
+ text := fmt.Sprintf("%.0f°C ⇒ %.0f°C ", s.Actual, s.Target)
switch tool {
case "bed":
m.bed.Label.SetLabel(text)
case "tool0":
m.tool0.Label.SetLabel(text)
- case "tool1":
- m.tool1.Label.SetLabel(text)
- m.tool1.Show()
}
}
}
func (m *statusPanel) doUpdateState(s *octoprint.PrinterState) {
- switch {
- case s.Flags.Printing:
- m.print.SetSensitive(false)
- m.pause.SetSensitive(true)
- m.stop.SetSensitive(true)
- case s.Flags.Paused:
- m.print.SetSensitive(false)
- m.pause.SetLabel("Resume")
- m.pause.SetImage(MustImageFromFile("resume.svg"))
- m.pause.SetSensitive(true)
- m.stop.SetSensitive(true)
- return
- case s.Flags.Ready:
- m.print.SetSensitive(true)
- m.pause.SetSensitive(false)
- m.stop.SetSensitive(false)
- default:
- m.print.SetSensitive(false)
- m.pause.SetSensitive(false)
- m.stop.SetSensitive(false)
- }
- m.pause.SetLabel("Pause")
- m.pause.SetImage(MustImageFromFile("pause.svg"))
+ currentPrinterStatus := btou(s.Flags.Printing) * 4 + btou(s.Flags.Paused) * 2 + btou(s.Flags.Ready) // printer status value
+// text := fmt.Sprintf("Status: %d", currentPrinterStatus)
+// m.status.Label.SetLabel(text)
+
+ if currentPrinterStatus != m.printerStatus {
+ m.printerStatus = currentPrinterStatus
+ switch currentPrinterStatus{
+ case 4: // printing
+ m.print.SetSensitive(false)
+ m.pause.SetImage(MustImageFromFileWithSize("pause.svg", 60, 60))
+ m.pause.SetSensitive(true)
+ m.stop.SetSensitive(true)
+ return
+ case 3: // paused
+ m.print.SetSensitive(false)
+ m.pause.SetImage(MustImageFromFileWithSize("resume.svg", 60, 60))
+ m.pause.SetSensitive(true)
+ m.stop.SetSensitive(true)
+ return
+ case 1: // ready
+ m.print.SetSensitive(true)
+ m.pause.SetSensitive(false)
+ m.stop.SetSensitive(false)
+ return
+ default:
+ m.print.SetSensitive(false)
+ m.pause.SetSensitive(false)
+ m.stop.SetSensitive(false)
+ return
+ }
+ }
}
func (m *statusPanel) updateJob() {
@@ -202,43 +220,107 @@ func (m *statusPanel) updateJob() {
if err != nil {
Logger.Error(err)
return
- }
- file := "not-set"
+ }
+ file := "File not set"
if s.Job.File.Name != "" {
- file = filenameEllipsis(s.Job.File.Name)
+ file = filenameEllipsis_long(s.Job.File.Name)
}
- m.file.Label.SetLabel(fmt.Sprintf("File: %s", file))
+ m.file.Label.SetLabel(fmt.Sprintf("%s", file))
m.pb.SetFraction(s.Progress.Completion / 100)
if m.UI.State.IsOperational() {
m.left.Label.SetLabel("Printer is ready")
+ m.finish.Label.SetLabel("-")
return
}
var text string
+ var finishText string
+ finishText = fmt.Sprintf("-")
switch s.Progress.Completion {
case 100:
- text = fmt.Sprintf("Job Completed in %s", time.Duration(int64(s.Job.LastPrintTime)*1e9))
+ text = fmt.Sprintf("Completed in %s", time.Duration(int64(s.Job.LastPrintTime)*1e9))
case 0:
text = "Warming up ..."
default:
e := time.Duration(int64(s.Progress.PrintTime) * 1e9)
l := time.Duration(int64(s.Progress.PrintTimeLeft) * 1e9)
- text = fmt.Sprintf("Elapsed/Left: %s / %s", e, l)
+ f := time.Now().Local().Add(time.Duration(int64(s.Progress.PrintTimeLeft)) * time.Second)
+ text = fmt.Sprintf("Elapsed: %s / Left: %s", e, l)
+ finishText = fmt.Sprintf("Finish time: %s", f.Format("15:04 02-Jan-06"))
if l == 0 {
text = fmt.Sprintf("Elapsed: %s", e)
}
}
-
m.left.Label.SetLabel(text)
+ m.finish.Label.SetLabel(finishText)
+}
+
+func filenameEllipsis_long(name string) string {
+ if len(name) > 35 {
+ return name[:32] + "…"
+ }
+
+ return name
}
func filenameEllipsis(name string) string {
- if len(name) > 26 {
- return name[:23] + "..."
+ if len(name) > 31 {
+ return name[:28] + "…"
+ }
+
+ return name
+}
+
+func filenameEllipsis_short(name string) string {
+ if len(name) > 27 {
+ return name[:24] + "…"
}
return name
}
+
+func btou(b bool) uint8 {
+ if b {
+ return 1
+ }
+ return 0
+}
+
+func ConfirmStopDialog(parent *gtk.Window, msg string, ma *statusPanel) func() {
+ return func() {
+ win := gtk.MessageDialogNewWithMarkup(
+ parent,
+ gtk.DIALOG_MODAL,
+ gtk.MESSAGE_INFO,
+ gtk.BUTTONS_YES_NO,
+ "",
+ )
+
+ win.SetMarkup(CleanHTML(msg))
+ defer win.Destroy()
+
+ box, _ := win.GetContentArea()
+ box.SetMarginStart(15)
+ box.SetMarginEnd(15)
+ box.SetMarginTop(15)
+ box.SetMarginBottom(15)
+
+ ctx, _ := win.GetStyleContext()
+ ctx.AddClass("dialog")
+
+ ergebnis := win.Run()
+
+ if ergebnis == int(gtk.RESPONSE_YES) {
+
+ Logger.Warning("Stopping job")
+ if err := (&octoprint.CancelRequest{}).Do(ma.UI.Printer); err != nil {
+ Logger.Error(err)
+ return
+ }
+ }
+ }
+}
+
diff --git a/ui/system.go b/ui/system.go
index 6f51367..ce54852 100644
--- a/ui/system.go
+++ b/ui/system.go
@@ -49,7 +49,12 @@ func (m *systemPanel) createActionBar() gtk.IWidget {
bar.Add(b)
}
- bar.Add(MustButton(MustImageFromFileWithSize("back.svg", 40, 40), m.UI.GoHistory))
+ if c := m.createShutdownButton(); c != nil {
+ bar.Add(c)
+ }
+
+
+ bar.Add(MustButton(MustImageFromFileWithSize("back.svg", 60, 60), m.UI.GoHistory))
return bar
}
@@ -75,6 +80,28 @@ func (m *systemPanel) createRestartButton() gtk.IWidget {
return m.doCreateButtonFromCommand(cmd)
}
+func (m *systemPanel) createShutdownButton() gtk.IWidget {
+ r, err := (&octoprint.SystemCommandsRequest{}).Do(m.UI.Printer)
+ if err != nil {
+ Logger.Error(err)
+ return nil
+ }
+
+ var cmd *octoprint.CommandDefinition
+ for _, c := range r.Core {
+ if c.Action == "shutdown" {
+ cmd = c
+ }
+ }
+
+ if cmd == nil {
+ return nil
+ }
+
+ return m.doCreateButtonFromCommand(cmd)
+}
+
+
func (m *systemPanel) doCreateButtonFromCommand(cmd *octoprint.CommandDefinition) gtk.IWidget {
do := func() {
r := &octoprint.SystemExecuteCommandRequest{
@@ -93,7 +120,7 @@ func (m *systemPanel) doCreateButtonFromCommand(cmd *octoprint.CommandDefinition
cb = MustConfirmDialog(m.UI.w, cmd.Confirm, do)
}
- return MustButton(MustImageFromFileWithSize(cmd.Action+".svg", 40, 40), cb)
+ return MustButton(MustImageFromFileWithSize(cmd.Action+".svg", 60, 60), cb)
}
func (m *systemPanel) createInfoBox() gtk.IWidget {
@@ -101,7 +128,7 @@ func (m *systemPanel) createInfoBox() gtk.IWidget {
main.SetHExpand(true)
main.SetHAlign(gtk.ALIGN_CENTER)
main.SetVExpand(true)
- main.Add(MustImageFromFileWithSize("octoprint-logo.png", 140, 140))
+ // main.Add(MustImageFromFileWithSize("octoprint-logo.png", 140, 140))
info := MustBox(gtk.ORIENTATION_VERTICAL, 0)
info.SetVExpand(true)
diff --git a/ui/temperature.go b/ui/temperature.go
index 4f9f617..bc71fa3 100644
--- a/ui/temperature.go
+++ b/ui/temperature.go
@@ -39,19 +39,20 @@ func TemperaturePanel(ui *UI, parent Panel) Panel {
func (m *temperaturePanel) initialize() {
defer m.Initialize()
+ m.Grid().Attach(m.createChangeButton("Decrease", "decrease.svg", -1), 1, 1, 1, 1)
m.Grid().Attach(m.createChangeButton("Increase", "increase.svg", 1), 1, 0, 1, 1)
- m.Grid().Attach(m.createChangeButton("Decrease", "decrease.svg", -1), 4, 0, 1, 1)
- m.box = MustBox(gtk.ORIENTATION_VERTICAL, 5)
+ m.box = MustBox(gtk.ORIENTATION_VERTICAL, 8)
m.box.SetVAlign(gtk.ALIGN_CENTER)
m.box.SetMarginStart(10)
- m.Grid().Attach(m.box, 2, 0, 2, 1)
+ m.Grid().Attach(m.box, 2, 0, 3, 1)
- m.Grid().Attach(m.createToolButton(), 1, 1, 1, 1)
- m.amount = MustStepButton("move-step.svg", Step{"5°C", 5.}, Step{"10°C", 10.}, Step{"1°C", 1.})
- m.Grid().Attach(m.amount, 2, 1, 1, 1)
+ m.Grid().Attach(m.createToolButton(), 2, 1, 1, 1)
+ m.amount = MustStepButton("move-step.svg", Step{"10°C", 10.}, Step{"5°C", 5.}, Step{"1°C", 1.})
+ m.Grid().Attach(m.amount, 3, 1, 1, 1)
- m.Grid().Attach(MustButtonImage("Profiles", "heat-up.svg", m.profilePanel), 3, 1, 1, 1)
+ // m.Grid().Attach(MustButtonImage("Profiles", "heat-up.svg", m.profilesPanel), 3, 1, 1, 1)
+ m.Grid().Attach(MustButtonImage("Back", "back.svg", m.UI.GoHistory), 4, 1, 1, 1)
}
func (m *temperaturePanel) createToolButton() *StepButton {
@@ -89,7 +90,7 @@ func (m *temperaturePanel) increaseTarget(tool string, value float64) error {
target = 0
}
- Logger.Infof("Setting target temperature for %s to %1.f°C.", tool, target)
+ Logger.Infof("Setting %s to %1.f°C", tool, target)
return m.setTarget(tool, target)
}
@@ -111,7 +112,7 @@ func (m *temperaturePanel) getToolTarget(tool string) (float64, error) {
current, ok := s.Temperature.Current[tool]
if !ok {
- return -1, fmt.Errorf("unable to find tool %q", tool)
+ return -1, fmt.Errorf("unable to find %q", tool)
}
return current.Target, nil
@@ -153,23 +154,20 @@ func (m *temperaturePanel) addNewTool(tool string) {
m.tool.AddStep(Step{strings.Title(tool), tool})
m.tool.Callback()
- Logger.Infof("New tool detected %s", tool)
+ Logger.Infof("Tool detected: %s", tool)
}
func (m *temperaturePanel) loadTemperatureData(tool string, d *octoprint.TemperatureData) {
- text := fmt.Sprintf("%s: %.1f°C / %.1f°C", strings.Title(tool), d.Actual, d.Target)
+ text := fmt.Sprintf("%s: %.1f°C ⇒ %.1f°C", strings.Title(tool), d.Actual, d.Target)
m.labels[tool].Label.SetText(text)
m.labels[tool].ShowAll()
}
-func (m *temperaturePanel) profilePanel() {
- m.UI.Add(ProfilesPanel(m.UI, m))
-}
-
var profilePanelInstance *profilesPanel
type profilesPanel struct {
CommonPanel
+ bedTemp *StepButton
}
func ProfilesPanel(ui *UI, parent Panel) Panel {
@@ -185,6 +183,12 @@ func ProfilesPanel(ui *UI, parent Panel) Panel {
func (m *profilesPanel) initialize() {
defer m.Initialize()
m.loadProfiles()
+
+ m.bedTemp = MustStepButton("bed.svg", Step{"Off", 0.0}, Step{"On", 1.0})
+ m.Grid().Attach(m.bedTemp, 2, 1, 1, 1)
+ m.Grid().Attach(MustButtonImage("Temp", "settings.svg", m.temperaturePanel), 3, 1, 1, 1)
+ m.Grid().Attach(MustButtonImage("Back", "back.svg", m.UI.GoHistory), 4, 1, 1, 1)
+
}
func (m *profilesPanel) loadProfiles() {
@@ -195,11 +199,11 @@ func (m *profilesPanel) loadProfiles() {
}
for _, profile := range s.Temperature.Profiles {
- m.AddButton(m.createProfileButton("filament.svg", profile))
+ m.AddButton(m.createProfileButton("heat-up.svg", profile))
}
m.AddButton(m.createProfileButton("cool-down.svg", &octoprint.TemperatureProfile{
- Name: "Cool Down",
+ Name: "Cool",
Bed: 0,
Extruder: 0,
}))
@@ -207,24 +211,26 @@ func (m *profilesPanel) loadProfiles() {
func (m *profilesPanel) createProfileButton(img string, p *octoprint.TemperatureProfile) gtk.IWidget {
return MustButtonImage(p.Name, img, func() {
- Logger.Warningf("Setting temperature profile %s.", p.Name)
+ Logger.Warningf("Setting profile: %s", p.Name)
if err := m.setProfile(p); err != nil {
Logger.Error(err)
}
})
}
-func (m *profilesPanel) setProfile(p *octoprint.TemperatureProfile) error {
- for tool := range temperaturePanelInstance.labels {
- temp := p.Extruder
- if tool == "bed" {
- temp = p.Bed
- }
-
- if err := temperaturePanelInstance.setTarget(tool, temp); err != nil {
- return err
- }
+func (m *profilesPanel) setProfile(p *octoprint.TemperatureProfile) error {
+
+ cmd := &octoprint.ToolTargetRequest{Targets: map[string]float64{"tool0": p.Extruder}}
+ cmd.Do(m.UI.Printer)
+ if m.bedTemp.Value().(float64) > 0.0 {
+ cmd_bed := &octoprint.BedTargetRequest{Target: p.Bed}
+ cmd_bed.Do(m.UI.Printer)
}
return nil
}
+
+
+func (m *profilesPanel) temperaturePanel() {
+ m.UI.Add(TemperaturePanel(m.UI, m))
+}
diff --git a/ui/ui.go b/ui/ui.go
index e64d518..47f2b8a 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -15,8 +15,8 @@ import (
var (
StylePath string
WindowName = "OctoPrint-TFT"
- WindowHeight = 320
- WindowWidth = 480
+ WindowHeight = 240
+ WindowWidth = 320
)
const (
@@ -138,7 +138,7 @@ func (ui *UI) verifyConnection() {
splash.Label.SetText(string(s.Current.State))
}
- ui.Add(splash)
+ //ui.Add(splash)
}
func (ui *UI) Add(p Panel) {
@@ -165,7 +165,7 @@ func (ui *UI) errToUser(err error) string {
text := err.Error()
if strings.Contains(text, "connection refused") {
return fmt.Sprintf(
- "Unable to connect to %q (Key: %v), \nmaybe OctoPrint not running?",
+ "Unable to connect to %q (Key: %v)",
ui.Printer.Endpoint, ui.Printer.APIKey != "",
)
}
diff --git a/vendor/github.com/shirou/gopsutil/cpu/testdata/linux/times_empty/proc/stat b/vendor/github.com/shirou/gopsutil/cpu/testdata/linux/times_empty/proc/stat
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/plan9/mkall.sh b/vendor/golang.org/x/sys/plan9/mkall.sh
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/plan9/mkerrors.sh b/vendor/golang.org/x/sys/plan9/mkerrors.sh
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/plan9/mksyscall.pl b/vendor/golang.org/x/sys/plan9/mksyscall.pl
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh b/vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/unix/linux/mksysnum.pl b/vendor/golang.org/x/sys/unix/linux/mksysnum.pl
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/unix/mksyscall.pl b/vendor/golang.org/x/sys/unix/mksyscall.pl
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/unix/mksyscall_solaris.pl b/vendor/golang.org/x/sys/unix/mksyscall_solaris.pl
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl b/vendor/golang.org/x/sys/unix/mksysctl_openbsd.pl
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/unix/mksysnum_darwin.pl b/vendor/golang.org/x/sys/unix/mksysnum_darwin.pl
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl b/vendor/golang.org/x/sys/unix/mksysnum_dragonfly.pl
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl b/vendor/golang.org/x/sys/unix/mksysnum_freebsd.pl
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl b/vendor/golang.org/x/sys/unix/mksysnum_netbsd.pl
old mode 100755
new mode 100644
diff --git a/vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl b/vendor/golang.org/x/sys/unix/mksysnum_openbsd.pl
old mode 100755
new mode 100644