Fixed ply and selfcheck bug

If copter is disconnected from server copter.refresh() stucks in while loop
This commit is contained in:
Igor Nurullaev
2019-09-06 17:40:44 +03:00
parent 416431dcca
commit 948e600f89
2 changed files with 5 additions and 3 deletions

View File

@@ -246,7 +246,7 @@ function askPermission(text, func) {
Ply.dialog("confirm",
{},
text
).done(function (e) {
).always(function (e) {
if (e.state) {
func();
}

View File

@@ -1,8 +1,9 @@
from server import Client
from time import time
copters = []
delay = 0
def set_delay_manually(_delay):
global delay
delay = _delay
@@ -30,8 +31,9 @@ class WebCopter:
self.client.get_response("cell_voltage", save, callback_args=(self, 'cell_voltage'))
self.client.get_response("selfcheck", save, callback_args=(self, 'selfcheck'))
t1 = self.time
time_started = time()
self.client.get_response("time", save, callback_args=(self, 'time'))
while t1 == self.time:
while t1 == self.time and time() - time_started < 5:
pass