From 8fabf0a68ac8b9a2583c74116e9bfbc94ff45707 Mon Sep 17 00:00:00 2001 From: Thor Johnson Date: Fri, 10 Jul 2020 22:33:15 -0400 Subject: [PATCH 1/3] Enables/disables directional buttons and play/pause based on the status of the gcode uploader. --- static/scripts/frontpageControls.js | 24 +++++++++++++++++------ templates/frontpage3d.html | 30 ++++++++++++++--------------- 2 files changed, 33 insertions(+), 21 deletions(-) diff --git a/static/scripts/frontpageControls.js b/static/scripts/frontpageControls.js index dc0bb784..52896efc 100644 --- a/static/scripts/frontpageControls.js +++ b/static/scripts/frontpageControls.js @@ -149,15 +149,27 @@ function moveAction(direction) { function processStatusMessage(data){ //console.log(data) - if (data.uploadFlag){ - if (!isDisabled){ + if (data.uploadFlag==1){ + if (isDisabled!=data.uploadFlag){ $('.disabler').prop('disabled', true); - isDisabled = true; + $('.ndisabler').prop('disabled', false); + $('.gcdisabler').prop('disabled', true); + isDisabled =data.uploadFlag; } - } else { - if (isDisabled){ + } else if (data.uploadFlag==2 || data.uploadFlag==-1 ){ + if (isDisabled!=data.uploadFlag){ + $('.gcdisabler').prop('disabled', true); $('.disabler').prop('disabled', false); - isDisabled = false; + $('.ndisabler').prop('disabled', false); + isDisabled = data.uploadFlag; + } + } + else { + if (isDisabled!=data.uploadFlag){ + $('.disabler').prop('disabled', false); + $('.ndisabler').prop('disabled', true); + $('.gcdisabler').prop('disabled', false); + isDisabled = data.uploadFlag; } } $("#currentTool").text(data.currentTool.toString()); diff --git a/templates/frontpage3d.html b/templates/frontpage3d.html index a902f1c6..66293e00 100644 --- a/templates/frontpage3d.html +++ b/templates/frontpage3d.html @@ -24,44 +24,44 @@

Controls

-
+
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
@@ -74,7 +74,7 @@

Controls

- +
@@ -84,10 +84,10 @@

Controls

- +
- +
From 00bcc19aa1dbaa837f5e5f2a7463a553f80e9f04 Mon Sep 17 00:00:00 2001 From: Thor Johnson Date: Sun, 12 Jul 2020 21:45:24 -0400 Subject: [PATCH 2/3] Had 2 "disabler" classes on a control, and I forgot the "change units" button, --- templates/frontpage3d.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/frontpage3d.html b/templates/frontpage3d.html index 66293e00..ffbd31ec 100644 --- a/templates/frontpage3d.html +++ b/templates/frontpage3d.html @@ -45,7 +45,7 @@

Controls

- +
@@ -71,7 +71,7 @@

Controls

- +
From d6f9b3c2f39f6a66d2db5346c3ff31ead1ba36eb Mon Sep 17 00:00:00 2001 From: Thor Johnson Date: Sun, 12 Jul 2020 22:29:32 -0400 Subject: [PATCH 3/3] Added the disabler classes to the mobile version. UNTESTED. --- templates/frontpage3d_mobilecontrols.html | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/templates/frontpage3d_mobilecontrols.html b/templates/frontpage3d_mobilecontrols.html index 2aeb7354..366076a1 100644 --- a/templates/frontpage3d_mobilecontrols.html +++ b/templates/frontpage3d_mobilecontrols.html @@ -16,51 +16,51 @@

Controls

-
-
-
-
-
-
-
-
-
@@ -73,12 +73,12 @@

Controls

- +
- +
@@ -89,7 +89,7 @@

Controls

- +
@@ -100,10 +100,10 @@

Controls

- +
- +