From 2904bd62d7c2b0a42e7ef47210e7dc8b392c89b7 Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 11 Mar 2013 10:38:41 -0400 Subject: [PATCH 1/2] Enter key sends command Sending a command also clears the field. --- octoprint/static/js/ui.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/octoprint/static/js/ui.js b/octoprint/static/js/ui.js index eb7f54c5..60cc136a 100644 --- a/octoprint/static/js/ui.js +++ b/octoprint/static/js/ui.js @@ -1480,7 +1480,7 @@ $(function() { //~~ Terminal - $("#terminal-send").click(function () { + $("#terminal-send").click(function () { var command = $("#terminal-command").val(); if (command) { $.ajax({ @@ -1490,7 +1490,15 @@ $(function() { contentType: "application/json; charset=UTF-8", data: JSON.stringify({"command": command}) }) + $("#terminal-command").val('') } + + }) + + $("#terminal-command").keyup(function(event){ + if(event.keyCode == 13){ + $("#terminal-send").click() + } }) //~~ Gcode upload From f10e10f5b394927c5da697613a6f0256dbdbec1e Mon Sep 17 00:00:00 2001 From: Tom Date: Mon, 11 Mar 2013 10:39:03 -0400 Subject: [PATCH 2/2] Converts commands uppercase --- octoprint/util/comm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/octoprint/util/comm.py b/octoprint/util/comm.py index 3161084d..00d63fe8 100644 --- a/octoprint/util/comm.py +++ b/octoprint/util/comm.py @@ -461,6 +461,7 @@ class MachineCom(object): self.close() def _sendCommand(self, cmd): + cmd = cmd.upper() if self._serial is None: return if 'M109' in cmd or 'M190' in cmd: