fix bizarre set of circumstances that could lead to malfunction of reconnect
If the setting to reconnect is unticked, and a user hits the e-stop button, and then ticks the box to reconnect, and then manually disconnects, the printer would automatically reconnect. This fixes that. Also added an "unknown status" to the button, since the status should always be known, if it's not then it's not, you know? Yeah, me either.
This commit is contained in:
@ -30,12 +30,16 @@ $(function() {
|
||||
self.buttonText = ko.pureComputed(function() {
|
||||
if (self.enableEstop()) {
|
||||
return gettext("EMERGENCY STOP");
|
||||
} else if (self.reconnect()) {
|
||||
}
|
||||
else if (self.reconnect()) {
|
||||
return gettext("Reconnecting...")
|
||||
}
|
||||
else {
|
||||
else if (!self.enableEstop()) {
|
||||
return gettext("Offline");
|
||||
}
|
||||
else {
|
||||
return gettext("Unknown Status");
|
||||
}
|
||||
});
|
||||
|
||||
self.buttonTitle = ko.pureComputed(function() {
|
||||
@ -67,11 +71,11 @@ $(function() {
|
||||
|
||||
self.sendEstopCommand = function () {
|
||||
if (self.enableEstop()) {
|
||||
self.emergencyCalled(true);
|
||||
self.estopCommand(self.settings.settings.plugins.estop.estopCommand());
|
||||
OctoPrint.control.sendGcode(self.estopCommand());
|
||||
|
||||
if (self.estopReconnect()) {
|
||||
self.emergencyCalled(true);
|
||||
OctoPrint.connection.disconnect(); //normally octoprint would probably disconnect anyway, just calling this here in case the printer is in a blocking loop
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user