Server: Update emergency dialog

This commit is contained in:
Arthur Golubtsov
2019-12-26 00:53:57 +03:00
parent 9647548ac1
commit a85af14b3a
2 changed files with 25 additions and 60 deletions

View File

@@ -1,36 +1,20 @@
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'emergency.ui'
# Form implementation generated from reading ui file 'visual_land.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
import os
import glob
from PyQt5 import QtWidgets
from PyQt5.QtGui import QStandardItemModel, QStandardItem
from PyQt5.QtCore import Qt, pyqtSlot, pyqtSignal, QObject
from PyQt5.QtWidgets import QDialog
# Importing gui form
from server_qt import *
from server import *
class Ui_Dialog(object):
def __init__(self):
self.Dialog = None
def setupUi(self, Dialog):
self.Dialog = Dialog
Dialog.setObjectName("Dialog")
Dialog.resize(746, 620)
Dialog.setStyleSheet("QDialog{\n"
"background-color: #fffdd0;\n"
"}")
Dialog.setStyleSheet("")
self.two_button = QtWidgets.QPushButton(Dialog)
self.two_button.setGeometry(QtCore.QRect(420, 120, 231, 171))
self.two_button.setSizeIncrement(QtCore.QSize(16, 16))
@@ -42,10 +26,12 @@ class Ui_Dialog(object):
"}")
self.two_button.setObjectName("two_button")
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(90, 30, 561, 51))
self.label.setGeometry(QtCore.QRect(60, 30, 631, 51))
font = QtGui.QFont()
font.setPointSize(16)
font.setPointSize(20)
self.label.setFont(font)
self.label.setLayoutDirection(QtCore.Qt.LeftToRight)
self.label.setAlignment(QtCore.Qt.AlignCenter)
self.label.setObjectName("label")
self.one_button = QtWidgets.QPushButton(Dialog)
self.one_button.setGeometry(QtCore.QRect(90, 120, 231, 171))
@@ -54,7 +40,7 @@ class Ui_Dialog(object):
"color: white;\n"
"font-weight: 600;\n"
"font-size: 25pt;\n"
"background-color: RGB(118, 255, 122);\n"
"background-color: green;\n"
"}")
self.one_button.setObjectName("one_button")
self.land_emergency_button = QtWidgets.QPushButton(Dialog)
@@ -73,39 +59,15 @@ class Ui_Dialog(object):
"background-color: white;\n"
"}")
self.disarm_emergency_button.setObjectName("disarm_emergency_button")
self.one_button.clicked.connect(self.one_button_click)
self.two_button.clicked.connect(self.two_button_click)
self.land_emergency_button.clicked.connect(self.land_emergency_click)
self.disarm_emergency_button.clicked.connect(self.disarm_emergency_click)
self.retranslateUi(Dialog)
QtCore.QMetaObject.connectSlotsByName(Dialog)
def retranslateUi(self, Dialog):
_translate = QtCore.QCoreApplication.translate
Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
Dialog.setWindowTitle(_translate("Dialog", "Visual land"))
self.two_button.setText(_translate("Dialog", "2"))
self.label.setText(_translate("Dialog", "\n"
"Select a group in which the drone does not work correctly"))
self.label.setText(_translate("Dialog", "Select the group with the defective copter"))
self.one_button.setText(_translate("Dialog", "1"))
self.land_emergency_button.setText(_translate("Dialog", "Land"))
self.disarm_emergency_button.setText(_translate("Dialog", "Disarm"))
def one_button_click(self):
self.Dialog.done(1)
def two_button_click(self):
self.Dialog.done(2)
def land_emergency_click(self):
self.Dialog.done(3)
def disarm_emergency_click(self):
self.Dialog.done(4)
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Dialog = QtWidgets.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
sys.exit(app.exec_())
self.disarm_emergency_button.setText(_translate("Dialog", "Disarm"))

View File

@@ -11,12 +11,10 @@
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
<string>Visual land</string>
</property>
<property name="styleSheet">
<string notr="true">QDialog{
background-color: #fffdd0;
}</string>
<string notr="true"/>
</property>
<widget class="QPushButton" name="two_button">
<property name="geometry">
@@ -48,20 +46,25 @@ background-color: red;
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>90</x>
<x>60</x>
<y>30</y>
<width>561</width>
<width>631</width>
<height>51</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>16</pointsize>
<pointsize>20</pointsize>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>
Select a group in which the drone does not work correctly</string>
<string>Select the group with the defective copter</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QPushButton" name="one_button">
@@ -84,7 +87,7 @@ Select a group in which the drone does not work correctly</string>
color: white;
font-weight: 600;
font-size: 25pt;
background-color: RGB(118, 255, 122);
background-color: green;
}</string>
</property>
<property name="text">