OctoPrint-Estop/octoprint_estop/static/js/estop.js

26 lines
657 B
JavaScript
Raw Normal View History

2017-03-22 22:17:16 +01:00
/*
* 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"]
});
});