estop plugin

This commit is contained in:
ntoff
2017-03-23 07:17:16 +10:00
parent 9150268fd8
commit 1fb15a0ea0
10 changed files with 307 additions and 0 deletions

View File

@ -0,0 +1,25 @@
/*
* Author: ntoff
* License: AGPLv3
*/
$(function() {
function EstopViewModel(parameters) {
var self = this;
//see if we're logged in and the printer is operational (for en/disable of button)
self.loginState = parameters[0];
self.terminal = parameters[1];
self.sendEstopCommand = function () {
OctoPrint.control.sendGcode("M112"); //should this ever be a variable? M112 universal?
};
}
OCTOPRINT_VIEWMODELS.push({
construct: EstopViewModel,
dependencies: [
"loginStateViewModel",
"terminalViewModel",
],
elements: ["#sidebar_plugin_estop"]
});
});