From 878bee784a23cfd450bbab7c8a968a644ba36802 Mon Sep 17 00:00:00 2001 From: Richard Mitchell Date: Sat, 9 Feb 2013 11:22:09 +0000 Subject: [PATCH 1/4] Modified the appearance of the jogging controls with a view to adding finer control --- octoprint/static/css/ui.css | 26 +++++++++++++++++++- octoprint/templates/index.html | 44 +++++++++++++++++++++------------- 2 files changed, 52 insertions(+), 18 deletions(-) diff --git a/octoprint/static/css/ui.css b/octoprint/static/css/ui.css index 5188b91..90dd04c 100644 --- a/octoprint/static/css/ui.css +++ b/octoprint/static/css/ui.css @@ -144,4 +144,28 @@ table th.timelapse_files_action, table td.timelapse_files_action { .overflow_visible { overflow: visible !important; -} \ No newline at end of file +} + +#controls { + overflow: hidden; +} + +#controls .jog-panel { + float: left; + margin-right: 20px; +} + +#controls .jog-panel > h4 { + border-bottom: 1px solid #ddd; +} + +#controls .jog-panel > div { + text-align: center; +} + +#controls .box { + width: 40px; + height: 40px; + margin-right: 20px; + margin-bottom: 20px; +} diff --git a/octoprint/templates/index.html b/octoprint/templates/index.html index 8bedf3e..eebdf17 100644 --- a/octoprint/templates/index.html +++ b/octoprint/templates/index.html @@ -169,23 +169,33 @@
-
-
 
-
-
 
-
+ +
+

XY

+
+ +
+
+ + + +
+
+ +
-
-
-
-
-
-
-
-
 
-
-
 
-
+ +
+

Z

+
+ +
+
+ +
+
+ +
@@ -433,4 +443,4 @@ - \ No newline at end of file + From 7fb354a2567b705b58071306feaef81b5002c9aa Mon Sep 17 00:00:00 2001 From: Richard Mitchell Date: Sat, 9 Feb 2013 12:07:31 +0000 Subject: [PATCH 2/4] Added controls I want (motors off, fans on/off) - they perhaps should be custom --- octoprint/static/css/ui.css | 7 +++++++ octoprint/templates/index.html | 13 +++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/octoprint/static/css/ui.css b/octoprint/static/css/ui.css index 90dd04c..770e6c0 100644 --- a/octoprint/static/css/ui.css +++ b/octoprint/static/css/ui.css @@ -169,3 +169,10 @@ table th.timelapse_files_action, table td.timelapse_files_action { margin-right: 20px; margin-bottom: 20px; } + +#controls .control-box { + display: block; + height: 40px; + margin-right: 20px; + margin-bottom: 20px; +} diff --git a/octoprint/templates/index.html b/octoprint/templates/index.html index eebdf17..40282d9 100644 --- a/octoprint/templates/index.html +++ b/octoprint/templates/index.html @@ -170,7 +170,7 @@
-
+

XY

@@ -185,7 +185,7 @@
-
+

Z

@@ -197,6 +197,15 @@
+ +
+

Control

+
+ + + +
+
From f09d57bef9015afa1d8d49cbbfcd99e66d5eae37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Sat, 9 Feb 2013 23:20:41 +0100 Subject: [PATCH 3/4] Started work on adding extrusion control --- octoprint/static/css/ui.css | 4 ++++ octoprint/templates/index.html | 32 +++++++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/octoprint/static/css/ui.css b/octoprint/static/css/ui.css index 770e6c0..f1f9c79 100644 --- a/octoprint/static/css/ui.css +++ b/octoprint/static/css/ui.css @@ -176,3 +176,7 @@ table th.timelapse_files_action, table td.timelapse_files_action { margin-right: 20px; margin-bottom: 20px; } + +.text-right { + text-align: right; +} \ No newline at end of file diff --git a/octoprint/templates/index.html b/octoprint/templates/index.html index 40282d9..152b86c 100644 --- a/octoprint/templates/index.html +++ b/octoprint/templates/index.html @@ -171,7 +171,7 @@
-

XY

+

X/Y

@@ -186,7 +186,7 @@
-

Z

+

Z

@@ -197,16 +197,38 @@
- +
-

Control

+

E

+
+
+ + mm +
+
+ + + +
+
+
+ + +
From 8c9c2ecfee45421c6106ad30207a3a02a4eb0431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Sun, 10 Feb 2013 00:40:06 +0100 Subject: [PATCH 4/4] Added extrusion controls, kept motor and fan controls in general control area as suggested (recurring demand suggests that they definitely aren't something to be added by anyone individually via custom controls), made custom controls always position themselves below the general stuff. --- octoprint/server.py | 4 ++++ octoprint/static/js/ui.js | 21 +++++++++++++++++++++ octoprint/templates/index.html | 27 +++++++++------------------ 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/octoprint/server.py b/octoprint/server.py index 5fde4a9..43a00b0 100644 --- a/octoprint/server.py +++ b/octoprint/server.py @@ -202,6 +202,10 @@ def jog(): if "homeZ" in request.values.keys(): # home z printer.command("G28 Z0") + if "extrude" in request.values.keys(): + # extrude/retract + length = request.values["extrude"] + printer.commands(["G91", "G1 E" + length + " F300", "G90"]) return jsonify(SUCCESS) diff --git a/octoprint/static/js/ui.js b/octoprint/static/js/ui.js index 2c88413..ddd5b2d 100644 --- a/octoprint/static/js/ui.js +++ b/octoprint/static/js/ui.js @@ -355,6 +355,7 @@ function ControlsViewModel() { self.isReady = ko.observable(undefined); self.isLoading = ko.observable(undefined); + self.extrusionAmount = ko.observable(undefined); self.controls = ko.observableArray([]); self.fromCurrentData = function(data) { @@ -426,6 +427,26 @@ function ControlsViewModel() { }) } + self.sendExtrudeCommand = function() { + self._sendECommand(1); + } + + self.sendRetractCommand = function() { + self._sendECommand(-1); + } + + self._sendECommand = function(dir) { + var length = self.extrusionAmount(); + if (!length) + length = 5; + $.ajax({ + url: AJAX_BASEURL + "control/jog", + type: "POST", + dataType: "json", + data: "extrude=" + (dir * length) + }) + } + self.sendCustomCommand = function(command) { if (!command) return; diff --git a/octoprint/templates/index.html b/octoprint/templates/index.html index 152b86c..ff08e4c 100644 --- a/octoprint/templates/index.html +++ b/octoprint/templates/index.html @@ -201,35 +201,26 @@

E

-
- +
+ mm
-
- - - -
+ +
- - +
+

General

- +
-
+