Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
52a40dac7c | |||
|
f8688d6415 | ||
|
d59d041b0b | ||
|
175f13bbde | ||
|
8a9a2fe401 | ||
|
8a2e732663 | ||
|
e8f9badc65 | ||
|
4f37707acb | ||
|
33b2352afb |
14
README.md
14
README.md
@ -10,8 +10,7 @@ That's the point of an EMERGENCY stop!
|
|||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
Install via the bundled [Plugin Manager](https://github.com/foosel/OctoPrint/wiki/Plugin:-Plugin-Manager)
|
Install via the bundled plugin manager, or manually using this URL:
|
||||||
or manually using this URL:
|
|
||||||
|
|
||||||
https://github.com/ntoff/OctoPrint-Estop/archive/master.zip
|
https://github.com/ntoff/OctoPrint-Estop/archive/master.zip
|
||||||
|
|
||||||
@ -21,12 +20,11 @@ Once installed, you may wish to move the button to the top of the sidebar, you c
|
|||||||
|
|
||||||
Find the "appearance" section, and add the plugin to the top of the sidebar order. If no other components have been previously rearranged, you may end up with only the plugin in the order list, this is fine, you don't need to add every item to the list (not adding them won't stop them from showing up).
|
Find the "appearance" section, and add the plugin to the top of the sidebar order. If no other components have been previously rearranged, you may end up with only the plugin in the order list, this is fine, you don't need to add every item to the list (not adding them won't stop them from showing up).
|
||||||
|
|
||||||
appearance:
|
appearance:
|
||||||
color: violet
|
components:
|
||||||
components:
|
order:
|
||||||
order:
|
sidebar:
|
||||||
sidebar:
|
- plugin_estop
|
||||||
- plugin_estop
|
|
||||||
|
|
||||||
Please note: White spaces are critical inside the config.yaml file, special care must be taken when adding or removing entries that the correct layout is maintained. For more information on config.yaml and its appearance section, see here: http://docs.octoprint.org/en/master/configuration/config_yaml.html#appearance
|
Please note: White spaces are critical inside the config.yaml file, special care must be taken when adding or removing entries that the correct layout is maintained. For more information on config.yaml and its appearance section, see here: http://docs.octoprint.org/en/master/configuration/config_yaml.html#appearance
|
||||||
|
|
||||||
|
@ -3,11 +3,11 @@ layout: plugin
|
|||||||
|
|
||||||
id: estop
|
id: estop
|
||||||
title: Emergency STOP! button
|
title: Emergency STOP! button
|
||||||
description: Adds an emergency stop (gcode M112) button to the sidebar.
|
description: Adds an emergency stop button to the sidebar.
|
||||||
author: ntoff
|
author: ntoff
|
||||||
license: AGPLv3
|
license: AGPLv3
|
||||||
|
|
||||||
date: 2017-03-23
|
date: 2017-12-02
|
||||||
|
|
||||||
homepage: https://github.com/ntoff/OctoPrint-Estop
|
homepage: https://github.com/ntoff/OctoPrint-Estop
|
||||||
source: https://github.com/ntoff/OctoPrint-Estop
|
source: https://github.com/ntoff/OctoPrint-Estop
|
||||||
@ -21,10 +21,10 @@ tags:
|
|||||||
|
|
||||||
|
|
||||||
screenshots:
|
screenshots:
|
||||||
- /assets/img/plugins/estop/enabled.PNG
|
- url: /assets/img/plugins/estop/enabled.PNG
|
||||||
alt: enabled
|
alt: enabled
|
||||||
caption: Enabled (logged in and operational)
|
caption: Enabled (logged in and operational)
|
||||||
- /assets/img/plugins/estop/disabled.PNG
|
- url: /assets/img/plugins/estop/disabled.PNG
|
||||||
alt: disabled
|
alt: disabled
|
||||||
caption: Disabled (logged out or non operational)
|
caption: Disabled (logged out or non operational)
|
||||||
|
|
||||||
@ -42,4 +42,6 @@ compatibility:
|
|||||||
- macos
|
- macos
|
||||||
---
|
---
|
||||||
|
|
||||||
Adds a nice big emergency stop button that sends M112 to the printer in the case of an emergency.
|
Adds a nice big emergency stop button that (by default) sends M112 to the printer in the case of an emergency. If your printer uses a different E-Stop command, there's a settings page entry to allow changing the command sent.
|
||||||
|
|
||||||
|
Please do be aware that this button is no substitute for human interaction in the case of a real emergency. How your printer responds to M112 depends entirely on its firmware.
|
@ -3,8 +3,18 @@ from __future__ import absolute_import
|
|||||||
|
|
||||||
import octoprint.plugin
|
import octoprint.plugin
|
||||||
|
|
||||||
class EstopPlugin(octoprint.plugin.AssetPlugin,
|
class EstopPlugin(octoprint.plugin.StartupPlugin,
|
||||||
octoprint.plugin.TemplatePlugin):
|
octoprint.plugin.AssetPlugin,
|
||||||
|
octoprint.plugin.TemplatePlugin,
|
||||||
|
octoprint.plugin.SettingsPlugin):
|
||||||
|
|
||||||
|
def get_settings_defaults(self):
|
||||||
|
return dict(estopCommand = "M112")
|
||||||
|
|
||||||
|
def on_after_startup(self):
|
||||||
|
self.estopCommand = self._settings.get(["estopCommand"])
|
||||||
|
if (self.estopCommand != "M112"):
|
||||||
|
self._logger.warn("WARNING! EMERGENCY STOP COMMAND HAS BEEN CHANGED FROM DEFAULT \"M112\" TO \"" + self.estopCommand + "\"")
|
||||||
|
|
||||||
def get_assets(self):
|
def get_assets(self):
|
||||||
return dict(
|
return dict(
|
||||||
@ -13,7 +23,8 @@ class EstopPlugin(octoprint.plugin.AssetPlugin,
|
|||||||
)
|
)
|
||||||
def get_template_configs(self):
|
def get_template_configs(self):
|
||||||
return [
|
return [
|
||||||
dict(type="sidebar", name="Emergency STOP!", icon="fa icon-print", template="estop_sidebar.jinja2", styles=["display: none"], data_bind="visible: loginState.isUser")
|
dict(type="sidebar", name="Emergency STOP!", icon="close", template="estop_sidebar.jinja2", styles=["display: none"], data_bind="visible: loginState.isUser"),
|
||||||
|
dict(type="settings", name="E-Stop Settings", template="estop_settings.jinja2", custom_bindings=False)
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_update_information(self):
|
def get_update_information(self):
|
||||||
@ -34,6 +45,7 @@ class EstopPlugin(octoprint.plugin.AssetPlugin,
|
|||||||
)
|
)
|
||||||
|
|
||||||
__plugin_name__ = "Emergency Stop Button"
|
__plugin_name__ = "Emergency Stop Button"
|
||||||
|
__plugin_pythoncompat__ = ">=2.7,<4"
|
||||||
|
|
||||||
def __plugin_load__():
|
def __plugin_load__():
|
||||||
global __plugin_implementation__
|
global __plugin_implementation__
|
||||||
|
@ -8,6 +8,9 @@ $(function() {
|
|||||||
|
|
||||||
self.loginState = parameters[0];
|
self.loginState = parameters[0];
|
||||||
self.printerState = parameters[1];
|
self.printerState = parameters[1];
|
||||||
|
self.settings = parameters[2];
|
||||||
|
|
||||||
|
self.estopCommand = ko.observable("M112");
|
||||||
|
|
||||||
self.enableEstop = ko.pureComputed(function() {
|
self.enableEstop = ko.pureComputed(function() {
|
||||||
return self.printerState.isOperational() && self.loginState.isUser();
|
return self.printerState.isOperational() && self.loginState.isUser();
|
||||||
@ -25,9 +28,18 @@ $(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
self.buttonTitle = ko.pureComputed(function() {
|
||||||
|
self.estopCommand(self.settings.settings.plugins.estop.estopCommand());
|
||||||
|
return gettext("Sends " + self.estopCommand() + " to the printer IMMEDIATELY");
|
||||||
|
});
|
||||||
|
|
||||||
|
self.onBeforeBinding = function () {
|
||||||
|
//self.estopCommand(self.settings.settings.plugins.estop.estopCommand());
|
||||||
|
}
|
||||||
self.sendEstopCommand = function () {
|
self.sendEstopCommand = function () {
|
||||||
if (self.enableEstop()) {
|
if (self.enableEstop()) {
|
||||||
OctoPrint.control.sendGcode("M112");
|
self.estopCommand(self.settings.settings.plugins.estop.estopCommand());
|
||||||
|
OctoPrint.control.sendGcode(self.estopCommand());
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -37,7 +49,7 @@ $(function() {
|
|||||||
dependencies: [
|
dependencies: [
|
||||||
"loginStateViewModel",
|
"loginStateViewModel",
|
||||||
"printerStateViewModel",
|
"printerStateViewModel",
|
||||||
],
|
"settingsViewModel"],
|
||||||
elements: ["#sidebar_plugin_estop_wrapper"]
|
elements: ["#sidebar_plugin_estop_wrapper"]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
13
octoprint_estop/templates/estop_settings.jinja2
Normal file
13
octoprint_estop/templates/estop_settings.jinja2
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<h3>{{ _('E-Stop Settings') }}</h3>
|
||||||
|
<div>
|
||||||
|
<p>Here you can change the command issued to your printer when you press the emergency stop button.</p>
|
||||||
|
<form class="form-horizontal">
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label">{{ _('Emergency STOP! Command') }}</label>
|
||||||
|
<div class="controls">
|
||||||
|
<input type="text" class="input-block" data-bind="value: settings.plugins.estop.estopCommand">
|
||||||
|
<span class="help-block">Usually this is M112. Only change if you know what you're doing.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
@ -1,4 +1,4 @@
|
|||||||
<div id="sidebar_estop_background" class="estop_sidebar" data-bind="css: estopState">
|
<div id="sidebar_estop_background" class="estop_sidebar" data-bind="css: estopState">
|
||||||
<button type="button" id="emergemcy_stop" title="send M112 estop gcode command" class="btn-estop" data-bind="text: buttonText, enable: enableEstop, click: function() { sendEstopCommand() }"></button>
|
<button type="button" id="emergemcy_stop" class="btn-estop" data-bind="attr: { title: buttonTitle }, text: buttonText, enable: enableEstop, click: function() { sendEstopCommand() }"></button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
2
setup.py
2
setup.py
@ -14,7 +14,7 @@ plugin_package = "octoprint_estop"
|
|||||||
plugin_name = "OctoPrint-Estop"
|
plugin_name = "OctoPrint-Estop"
|
||||||
|
|
||||||
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
|
# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
|
||||||
plugin_version = "0.1.0"
|
plugin_version = "0.1.2"
|
||||||
|
|
||||||
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
|
# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
|
||||||
# module
|
# module
|
||||||
|
Loading…
x
Reference in New Issue
Block a user