From bb083575e144872b273c382388678e15f5b3f728 Mon Sep 17 00:00:00 2001 From: Neptune-1 Date: Fri, 7 Dec 2018 21:50:59 +0300 Subject: [PATCH] upgrade --- Server/Server.py | 20 ++ Server/gui/gui.ui | 17 ++ Server/gui/swarm_5.ui | 460 ------------------------------------------ Server/main_gui.py | 8 +- 4 files changed, 44 insertions(+), 461 deletions(-) delete mode 100644 Server/gui/swarm_5.ui diff --git a/Server/Server.py b/Server/Server.py index 1570521..d4ddf90 100644 --- a/Server/Server.py +++ b/Server/Server.py @@ -237,6 +237,26 @@ class Widget(QMainWindow, main_gui.Ui_MainWindow): f = open(sub_file, 'r') prog = f.read() self.sender(b'programm' + bytes(prog, 'utf-8')+b'stop', str(counter)) + t1 = Thread(target=self.start_retime) + t1.daemon = True + t1.start() + def start_retime(self): + for i in range(11): + time.sleep(1) + self.time_to_start_label.setText("

"+str(10-i)+"

") + '''if i==10: + k=0 + while True: + k+=1 + time.sleep(0.2r) + self.time_to_start_label.setText("

"+k*'.'+"

") + if k>3: + k=0'''# for ... animation + self.time_to_start_label.setText("

Take off

") + time.sleep(2) + self.time_to_start_label.setText("

") + + def stop_swarm(self): pass diff --git a/Server/gui/gui.ui b/Server/gui/gui.ui index c83797f..1d1ea3d 100755 --- a/Server/gui/gui.ui +++ b/Server/gui/gui.ui @@ -414,6 +414,22 @@ p, li { white-space: pre-wrap; } Synchronize + + + + 220 + 200 + 141 + 51 + + + + color:rgb(30, 30, 30) + + + <html><head/><body><p align="center"><span style=" font-size:16pt;"/></p></body></html> + + back_label take_off_button land_all_button @@ -440,6 +456,7 @@ p, li { white-space: pre-wrap; } start_animation_button safty_button synch_button + time_to_start_label diff --git a/Server/gui/swarm_5.ui b/Server/gui/swarm_5.ui deleted file mode 100644 index c83797f..0000000 --- a/Server/gui/swarm_5.ui +++ /dev/null @@ -1,460 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 1280 - 720 - - - - - 1280 - 720 - - - - - 1280 - 720 - - - - Drone Swarm - - - - - - 760 - 70 - 100 - 40 - - - - Take off all - - - - - - 890 - 70 - 91 - 40 - - - - Land all - - - - - - 1010 - 70 - 101 - 40 - - - - background-color: red - - - - Disarm all - - - - - - 760 - 150 - 100 - 40 - - - - Take off n - - - - - - 890 - 150 - 91 - 40 - - - - - - - Land n - - - - - - 1010 - 150 - 101 - 40 - - - - background-color: red - - - - Disarm n - - - - - - 790 - 120 - 50 - 22 - - - - - - - 910 - 120 - 50 - 22 - - - - - - - 1040 - 120 - 50 - 22 - - - - - - - 840 - 20 - 200 - 20 - - - - <html><head/><body><p><span style=" font-size:12pt; color:#c8c8c8;">Control console</span></p></body></html> - - - Qt::AlignCenter - - - - - - 1140 - 60 - 100 - 61 - - - - - - - Turn on Leds - - - - - - 1140 - 140 - 100 - 61 - - - - Turn off Leds - - - - - - 220 - 510 - 141 - 51 - - - - - - - Stop swarm - - - - - - 620 - 60 - 111 - 40 - - - - - - - Connect - - - - - - 260 - 80 - 50 - 20 - - - - - - - 240 - 50 - 100 - 20 - - - - <html><head/><body><p><span style=" font-size:9pt;">Swarm Size</span></p></body></html> - - - Qt::AlignCenter - - - - - - 840 - 260 - 200 - 20 - - - - <html><head/><body><p><span style=" font-size:12pt; color:#c8c8c8;">Send command</span></p></body></html> - - - Qt::AlignCenter - - - - - - 640 - 290 - 591 - 271 - - - - background-color: rgb(1, 36, 86) - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Noto Sans'; font-size:9pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:7.8pt; color:#ffffff;">...</span></p></body></html> - - - - - - 220 - 300 - 141 - 51 - - - - - - - Show 3d scene - - - - - - 220 - 370 - 141 - 51 - - - - - - - Upload animation - - - - - - 220 - 160 - 131 - 41 - - - - color: red - - - - - <html><head/><body><p><span style=" font-size:12pt;">Disconnect</span></p></body></html> - - - Qt::AlignCenter - - - - - - 230 - 140 - 111 - 20 - - - - Statement swarm - - - Qt::AlignCenter - - - - - - 220 - 440 - 141 - 51 - - - - - - - Start animation - - - - - - 0 - -1 - 1280 - 701 - - - - <html><head/><body><p><img src=":/back/back.png"/></p></body></html> - - - - - - 620 - 110 - 111 - 40 - - - - - - - Safty check - - - - - - 620 - 160 - 111 - 40 - - - - - - - Synchronize - - - back_label - take_off_button - land_all_button - disarm_all_button - take_off_n_button - land_n_button - disarm_n_button - take_off_spinBox - land_spinBox - disarm_spinBox - control_console_label - turn_on_led_button - turn_off_led_button - stop_swarm_but - connect_button - swarm_size_spinBox - swarm_size_label - send_command_label - console_textEdit - show_3d_scene_button - upload_animation_button - state_label - statement_swarm_label - start_animation_button - safty_button - synch_button - - - - - 0 - 0 - 1280 - 23 - - - - - - - - - - diff --git a/Server/main_gui.py b/Server/main_gui.py index 844d61e..75fc44b 100644 --- a/Server/main_gui.py +++ b/Server/main_gui.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Form implementation generated from reading ui file 'swarm_5.ui' +# Form implementation generated from reading ui file 'gui.ui' # # Created by: PyQt5 UI code generator 5.11.3 # @@ -116,6 +116,10 @@ class Ui_MainWindow(object): self.synch_button.setGeometry(QtCore.QRect(620, 160, 111, 40)) self.synch_button.setStyleSheet("") self.synch_button.setObjectName("synch_button") + self.time_to_start_label = QtWidgets.QLabel(self.centralwidget) + self.time_to_start_label.setGeometry(QtCore.QRect(220, 200, 141, 51)) + self.time_to_start_label.setStyleSheet("color:rgb(30, 30, 30)") + self.time_to_start_label.setObjectName("time_to_start_label") self.back_label.raise_() self.take_off_button.raise_() self.land_all_button.raise_() @@ -142,6 +146,7 @@ class Ui_MainWindow(object): self.start_animation_button.raise_() self.safty_button.raise_() self.synch_button.raise_() + self.time_to_start_label.raise_() MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 1280, 23)) @@ -183,6 +188,7 @@ class Ui_MainWindow(object): self.back_label.setText(_translate("MainWindow", "

")) self.safty_button.setText(_translate("MainWindow", "Safty check")) self.synch_button.setText(_translate("MainWindow", "Synchronize")) + self.time_to_start_label.setText(_translate("MainWindow", "

")) import back_1_rc