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:
parent
3666aa5e8d
commit
beff41780b
@ -30,12 +30,16 @@ $(function() {
|
|||||||
self.buttonText = ko.pureComputed(function() {
|
self.buttonText = ko.pureComputed(function() {
|
||||||
if (self.enableEstop()) {
|
if (self.enableEstop()) {
|
||||||
return gettext("EMERGENCY STOP");
|
return gettext("EMERGENCY STOP");
|
||||||
} else if (self.reconnect()) {
|
}
|
||||||
|
else if (self.reconnect()) {
|
||||||
return gettext("Reconnecting...")
|
return gettext("Reconnecting...")
|
||||||
}
|
}
|
||||||
else {
|
else if (!self.enableEstop()) {
|
||||||
return gettext("Offline");
|
return gettext("Offline");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return gettext("Unknown Status");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
self.buttonTitle = ko.pureComputed(function() {
|
self.buttonTitle = ko.pureComputed(function() {
|
||||||
@ -67,11 +71,11 @@ $(function() {
|
|||||||
|
|
||||||
self.sendEstopCommand = function () {
|
self.sendEstopCommand = function () {
|
||||||
if (self.enableEstop()) {
|
if (self.enableEstop()) {
|
||||||
self.emergencyCalled(true);
|
|
||||||
self.estopCommand(self.settings.settings.plugins.estop.estopCommand());
|
self.estopCommand(self.settings.settings.plugins.estop.estopCommand());
|
||||||
OctoPrint.control.sendGcode(self.estopCommand());
|
OctoPrint.control.sendGcode(self.estopCommand());
|
||||||
|
|
||||||
if (self.estopReconnect()) {
|
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
|
OctoPrint.connection.disconnect(); //normally octoprint would probably disconnect anyway, just calling this here in case the printer is in a blocking loop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user