From bc20469122f484b004566037e7918e2c929f959b Mon Sep 17 00:00:00 2001 From: Kragrathea Date: Tue, 18 Aug 2020 13:26:20 -0700 Subject: [PATCH 01/10] Fix local gcode path. Antialias test. --- octoprint_prettygcode/static/js/prettygcode.js | 8 ++++---- setup.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/octoprint_prettygcode/static/js/prettygcode.js b/octoprint_prettygcode/static/js/prettygcode.js index 73c3a0f..59b3cee 100644 --- a/octoprint_prettygcode/static/js/prettygcode.js +++ b/octoprint_prettygcode/static/js/prettygcode.js @@ -14,7 +14,7 @@ $(function () { durJobDate = job.file.date; if(viewInitialized && gcodeProxy) { - gcodeProxy.loadGcode('/downloads/files/local/' + curJobName); + gcodeProxy.loadGcode('./downloads/files/local/' + curJobName); printHeadSim=new PrintHeadSimulator(); //terminalGcodeProxy = new GCodeParser(); @@ -292,7 +292,7 @@ $(function () { this.orbitWhenIdle=true; this.reloadGcode = function () { if(gcodeProxy && curJobName!="") - gcodeProxy.loadGcode('/downloads/files/local/' + curJobName); + gcodeProxy.loadGcode('./downloads/files/local/' + curJobName); }; this.showState=true; this.showWebcam=true; @@ -426,7 +426,7 @@ $(function () { scene.add(gcodeObject); if(curJobName!="") - gcodeProxy.loadGcode('/downloads/files/local/' + curJobName); + gcodeProxy.loadGcode('./downloads/files/local/' + curJobName); if(false){ //terminal parser @@ -1225,7 +1225,7 @@ $(function () { function initThree() { - renderer = new THREE.WebGLRenderer({ canvas: document.getElementById("mycanvas") }); + renderer = new THREE.WebGLRenderer({ canvas: document.getElementById("mycanvas"),antialias: true }); //todo. is this right? renderer.setPixelRatio(window.devicePixelRatio); diff --git a/setup.py b/setup.py index f694063..5ec7240 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ plugin_name = "OctoPrint-PrettyGCode" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "1.2" +plugin_version = "1.2.1" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module From 661a08518cc47d052ac90930242777d0c77c6cb4 Mon Sep 17 00:00:00 2001 From: Kragrathea Date: Tue, 18 Aug 2020 13:36:08 -0700 Subject: [PATCH 02/10] Revert local path change --- octoprint_prettygcode/static/js/prettygcode.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/octoprint_prettygcode/static/js/prettygcode.js b/octoprint_prettygcode/static/js/prettygcode.js index 59b3cee..94641f7 100644 --- a/octoprint_prettygcode/static/js/prettygcode.js +++ b/octoprint_prettygcode/static/js/prettygcode.js @@ -14,7 +14,7 @@ $(function () { durJobDate = job.file.date; if(viewInitialized && gcodeProxy) { - gcodeProxy.loadGcode('./downloads/files/local/' + curJobName); + gcodeProxy.loadGcode('/downloads/files/local/' + curJobName); printHeadSim=new PrintHeadSimulator(); //terminalGcodeProxy = new GCodeParser(); @@ -292,7 +292,7 @@ $(function () { this.orbitWhenIdle=true; this.reloadGcode = function () { if(gcodeProxy && curJobName!="") - gcodeProxy.loadGcode('./downloads/files/local/' + curJobName); + gcodeProxy.loadGcode('/downloads/files/local/' + curJobName); }; this.showState=true; this.showWebcam=true; @@ -426,7 +426,7 @@ $(function () { scene.add(gcodeObject); if(curJobName!="") - gcodeProxy.loadGcode('./downloads/files/local/' + curJobName); + gcodeProxy.loadGcode('/downloads/files/local/' + curJobName); if(false){ //terminal parser From ff3638e9396f878b3c00474549409c29b3d8e195 Mon Sep 17 00:00:00 2001 From: Kragrathea Date: Tue, 18 Aug 2020 13:59:50 -0700 Subject: [PATCH 03/10] Add AntiAlias option --- Todo.txt | 1 + octoprint_prettygcode/static/js/prettygcode.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 Todo.txt diff --git a/Todo.txt b/Todo.txt new file mode 100644 index 0000000..b7ae2ec --- /dev/null +++ b/Todo.txt @@ -0,0 +1 @@ +Top buttons in Div? \ No newline at end of file diff --git a/octoprint_prettygcode/static/js/prettygcode.js b/octoprint_prettygcode/static/js/prettygcode.js index 94641f7..c8f11a6 100644 --- a/octoprint_prettygcode/static/js/prettygcode.js +++ b/octoprint_prettygcode/static/js/prettygcode.js @@ -298,6 +298,7 @@ $(function () { this.showWebcam=true; this.showFiles=false; this.showDash=true; + this.antialias=true; }; var pgSettings = new PGSettings(); @@ -380,6 +381,7 @@ $(function () { gui.add(pgSettings, 'orbitWhenIdle'); gui.add(pgSettings, 'fatLines').onFinishChange(pgSettings.reloadGcode); gui.add(pgSettings, 'reflections'); + gui.add(pgSettings, 'antialias'); //gui.add(pgSettings, 'reloadGcode'); var folder = gui.addFolder('Windows');//hidden. @@ -1225,7 +1227,7 @@ $(function () { function initThree() { - renderer = new THREE.WebGLRenderer({ canvas: document.getElementById("mycanvas"),antialias: true }); + renderer = new THREE.WebGLRenderer({ canvas: document.getElementById("mycanvas"),antialias: pgSettings.antialias }); //todo. is this right? renderer.setPixelRatio(window.devicePixelRatio); From 44815d6c7d7c6ccbb6e91db7155901c51364cf0e Mon Sep 17 00:00:00 2001 From: Kragrathea Date: Tue, 18 Aug 2020 14:26:49 -0700 Subject: [PATCH 04/10] Move top/bottom buttons to div --- .../static/css/prettygcode.css | 27 ++++++++++++++----- .../templates/prettygcode_tab.jinja2 | 16 ++++++----- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/octoprint_prettygcode/static/css/prettygcode.css b/octoprint_prettygcode/static/css/prettygcode.css index 9b3469d..77f8f94 100644 --- a/octoprint_prettygcode/static/css/prettygcode.css +++ b/octoprint_prettygcode/static/css/prettygcode.css @@ -12,19 +12,34 @@ position: absolute; } #tab_plugin_prettygcode .fstoggle { - top: 20px; + /*top: 20px;*/ right: 60px; position: absolute; z-index:10; } -#tab_plugin_prettygcode .pgsettingstoggle { +#tab_plugin_prettygcode .pg_top_buttons { top: 20px; + left: 0px; + right: 0px; + position: absolute; + z-index:10; +} +#tab_plugin_prettygcode .pg_bottom_buttons { + bottom: 20px; + left: 0px; + right: 0px; + position: absolute; + z-index:10; +} + +#tab_plugin_prettygcode .pgsettingstoggle { + /*top: 20px;*/ right: 95px; position: absolute; z-index:10; } .pgfullscreen #tab_plugin_prettygcode .pgstatetoggle { - top: 20px; + /*top: 20px;*/ left: 20px; position: absolute; z-index:10; @@ -34,7 +49,7 @@ display:none; } .pgfullscreen #tab_plugin_prettygcode .pgfilestoggle { - top: 20px; + /*top: 20px;*/ left: 95px; position: absolute; z-index:10; @@ -44,7 +59,7 @@ display:none; } .pgfullscreen #tab_plugin_prettygcode .pgcameratoggle { - bottom: 20px; + /*bottom: 20px;*/ right: 40px; position: absolute; z-index:10; @@ -247,7 +262,7 @@ .pgfullscreen #tab_plugin_prettygcode .pgdashtoggle { left: 20px; - bottom: 20px; + /*bottom: 20px;*/ position: absolute; z-index:10; display:unset; diff --git a/octoprint_prettygcode/templates/prettygcode_tab.jinja2 b/octoprint_prettygcode/templates/prettygcode_tab.jinja2 index 87d9c45..60c361b 100644 --- a/octoprint_prettygcode/templates/prettygcode_tab.jinja2 +++ b/octoprint_prettygcode/templates/prettygcode_tab.jinja2 @@ -4,12 +4,16 @@ {# #}
View Settings
- - - - - - +
+ + + + +
+
+ + +
From 69b779bee629ca70fcff09846be01cd194a74dd1 Mon Sep 17 00:00:00 2001 From: Kragrathea Date: Tue, 18 Aug 2020 14:38:08 -0700 Subject: [PATCH 05/10] Revert button div change --- .../static/css/prettygcode.css | 27 +++++-------------- .../templates/prettygcode_tab.jinja2 | 16 +++++------ 2 files changed, 12 insertions(+), 31 deletions(-) diff --git a/octoprint_prettygcode/static/css/prettygcode.css b/octoprint_prettygcode/static/css/prettygcode.css index 77f8f94..9b3469d 100644 --- a/octoprint_prettygcode/static/css/prettygcode.css +++ b/octoprint_prettygcode/static/css/prettygcode.css @@ -12,34 +12,19 @@ position: absolute; } #tab_plugin_prettygcode .fstoggle { - /*top: 20px;*/ - right: 60px; - position: absolute; - z-index:10; -} -#tab_plugin_prettygcode .pg_top_buttons { top: 20px; - left: 0px; - right: 0px; - position: absolute; - z-index:10; -} -#tab_plugin_prettygcode .pg_bottom_buttons { - bottom: 20px; - left: 0px; - right: 0px; + right: 60px; position: absolute; z-index:10; } - #tab_plugin_prettygcode .pgsettingstoggle { - /*top: 20px;*/ + top: 20px; right: 95px; position: absolute; z-index:10; } .pgfullscreen #tab_plugin_prettygcode .pgstatetoggle { - /*top: 20px;*/ + top: 20px; left: 20px; position: absolute; z-index:10; @@ -49,7 +34,7 @@ display:none; } .pgfullscreen #tab_plugin_prettygcode .pgfilestoggle { - /*top: 20px;*/ + top: 20px; left: 95px; position: absolute; z-index:10; @@ -59,7 +44,7 @@ display:none; } .pgfullscreen #tab_plugin_prettygcode .pgcameratoggle { - /*bottom: 20px;*/ + bottom: 20px; right: 40px; position: absolute; z-index:10; @@ -262,7 +247,7 @@ .pgfullscreen #tab_plugin_prettygcode .pgdashtoggle { left: 20px; - /*bottom: 20px;*/ + bottom: 20px; position: absolute; z-index:10; display:unset; diff --git a/octoprint_prettygcode/templates/prettygcode_tab.jinja2 b/octoprint_prettygcode/templates/prettygcode_tab.jinja2 index 60c361b..3e36736 100644 --- a/octoprint_prettygcode/templates/prettygcode_tab.jinja2 +++ b/octoprint_prettygcode/templates/prettygcode_tab.jinja2 @@ -4,16 +4,12 @@ {# #}
View Settings
-
- - - - -
-
- - -
+ + + + + + From c47a9c6bbb433096fb093279e3e2e09f5a939bdf Mon Sep 17 00:00:00 2001 From: Kragrathea Date: Tue, 18 Aug 2020 19:15:59 -0700 Subject: [PATCH 06/10] Unset BG color to work with themeify --- octoprint_prettygcode/static/css/prettygcode.css | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/octoprint_prettygcode/static/css/prettygcode.css b/octoprint_prettygcode/static/css/prettygcode.css index 9b3469d..6a10329 100644 --- a/octoprint_prettygcode/static/css/prettygcode.css +++ b/octoprint_prettygcode/static/css/prettygcode.css @@ -60,7 +60,8 @@ width: 300px; position: absolute; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - background: rgba(255, 255, 255, 0.2); + /*background: rgba(255, 255, 255, 0.2);*/ + opacity: 0.5; z-index:5; } @@ -71,7 +72,8 @@ width: 300px; position: absolute; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.70); - background: rgba(204, 204, 204, 0.9); + /*background: rgba(204, 204, 204, 0.9);*/ + opacity: 0.5; z-index:6; } /* .pgfullscreen #files .gcode_files .entry { @@ -239,7 +241,7 @@ left: 20px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); z-index:4; - background: rgba(255, 255, 255, 0.2); + /*background: rgba(255, 255, 255, 0.2);*/ opacity: 0.8; /* width: 300px; */ /* transform: scale(0.8); */ From 1bff405da73d9d10324cd83b51778ee9225ed4df Mon Sep 17 00:00:00 2001 From: Kragrathea Date: Tue, 18 Aug 2020 19:32:15 -0700 Subject: [PATCH 07/10] Undo bg unset --- octoprint_prettygcode/static/css/prettygcode.css | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/octoprint_prettygcode/static/css/prettygcode.css b/octoprint_prettygcode/static/css/prettygcode.css index 6a10329..9b3469d 100644 --- a/octoprint_prettygcode/static/css/prettygcode.css +++ b/octoprint_prettygcode/static/css/prettygcode.css @@ -60,8 +60,7 @@ width: 300px; position: absolute; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); - /*background: rgba(255, 255, 255, 0.2);*/ - opacity: 0.5; + background: rgba(255, 255, 255, 0.2); z-index:5; } @@ -72,8 +71,7 @@ width: 300px; position: absolute; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.70); - /*background: rgba(204, 204, 204, 0.9);*/ - opacity: 0.5; + background: rgba(204, 204, 204, 0.9); z-index:6; } /* .pgfullscreen #files .gcode_files .entry { @@ -241,7 +239,7 @@ left: 20px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); z-index:4; - /*background: rgba(255, 255, 255, 0.2);*/ + background: rgba(255, 255, 255, 0.2); opacity: 0.8; /* width: 300px; */ /* transform: scale(0.8); */ From 87791988da01513b035293696aa9e908a8192edb Mon Sep 17 00:00:00 2001 From: Kragrathea Date: Tue, 18 Aug 2020 19:50:37 -0700 Subject: [PATCH 08/10] Force font color to Black in FS. Fix themeify bug. --- octoprint_prettygcode/static/css/prettygcode.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/octoprint_prettygcode/static/css/prettygcode.css b/octoprint_prettygcode/static/css/prettygcode.css index 9b3469d..ede73ae 100644 --- a/octoprint_prettygcode/static/css/prettygcode.css +++ b/octoprint_prettygcode/static/css/prettygcode.css @@ -33,6 +33,9 @@ #tab_plugin_prettygcode .pgstatetoggle { display:none; } +.pgfullscreen { + color:black; +} .pgfullscreen #tab_plugin_prettygcode .pgfilestoggle { top: 20px; left: 95px; From 81d045054612bdecd53a0b17fd4d120898665e61 Mon Sep 17 00:00:00 2001 From: Kragrathea Date: Tue, 18 Aug 2020 20:28:20 -0700 Subject: [PATCH 09/10] Warn about anti alias changes --- octoprint_prettygcode/static/js/prettygcode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octoprint_prettygcode/static/js/prettygcode.js b/octoprint_prettygcode/static/js/prettygcode.js index c8f11a6..a0f5db6 100644 --- a/octoprint_prettygcode/static/js/prettygcode.js +++ b/octoprint_prettygcode/static/js/prettygcode.js @@ -381,7 +381,7 @@ $(function () { gui.add(pgSettings, 'orbitWhenIdle'); gui.add(pgSettings, 'fatLines').onFinishChange(pgSettings.reloadGcode); gui.add(pgSettings, 'reflections'); - gui.add(pgSettings, 'antialias'); + gui.add(pgSettings, 'antialias').onFinishChange(alert("Antialias chenges won't take effect until you refresh the page")); //gui.add(pgSettings, 'reloadGcode'); var folder = gui.addFolder('Windows');//hidden. From 17a74539dc4bb2f8698a4056433014c80ee17f5e Mon Sep 17 00:00:00 2001 From: Kragrathea Date: Tue, 18 Aug 2020 20:34:55 -0700 Subject: [PATCH 10/10] Minor fix --- octoprint_prettygcode/static/js/prettygcode.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/octoprint_prettygcode/static/js/prettygcode.js b/octoprint_prettygcode/static/js/prettygcode.js index a0f5db6..4003905 100644 --- a/octoprint_prettygcode/static/js/prettygcode.js +++ b/octoprint_prettygcode/static/js/prettygcode.js @@ -381,7 +381,9 @@ $(function () { gui.add(pgSettings, 'orbitWhenIdle'); gui.add(pgSettings, 'fatLines').onFinishChange(pgSettings.reloadGcode); gui.add(pgSettings, 'reflections'); - gui.add(pgSettings, 'antialias').onFinishChange(alert("Antialias chenges won't take effect until you refresh the page")); + gui.add(pgSettings, 'antialias').onFinishChange(function(){ + alert("Antialias chenges won't take effect until you refresh the page"); + }); //gui.add(pgSettings, 'reloadGcode'); var folder = gui.addFolder('Windows');//hidden.