mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-05-26 23:19:33 +00:00
Merge pull request #3 from goldarte/PyQt5-interface
PyQT5 interface branch
This commit is contained in:
85
Server/server_gui.py
Normal file
85
Server/server_gui.py
Normal file
@@ -0,0 +1,85 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'server_gui.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(850, 460)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.pushButton.setGeometry(QtCore.QRect(680, 20, 150, 40))
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.pushButton_2 = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.pushButton_2.setGeometry(QtCore.QRect(680, 120, 150, 40))
|
||||
self.pushButton_2.setObjectName("pushButton_2")
|
||||
self.spinBox = QtWidgets.QSpinBox(self.centralwidget)
|
||||
self.spinBox.setGeometry(QtCore.QRect(760, 70, 50, 40))
|
||||
self.spinBox.setObjectName("spinBox")
|
||||
self.pushButton_3 = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.pushButton_3.setGeometry(QtCore.QRect(680, 170, 150, 40))
|
||||
self.pushButton_3.setObjectName("pushButton_3")
|
||||
self.pushButton_4 = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.pushButton_4.setGeometry(QtCore.QRect(680, 220, 150, 40))
|
||||
self.pushButton_4.setObjectName("pushButton_4")
|
||||
self.pushButton_5 = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.pushButton_5.setGeometry(QtCore.QRect(680, 280, 150, 40))
|
||||
self.pushButton_5.setObjectName("pushButton_5")
|
||||
self.pushButton_6 = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.pushButton_6.setGeometry(QtCore.QRect(680, 330, 150, 40))
|
||||
self.pushButton_6.setObjectName("pushButton_6")
|
||||
self.pushButton_7 = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.pushButton_7.setGeometry(QtCore.QRect(680, 380, 150, 40))
|
||||
self.pushButton_7.setObjectName("pushButton_7")
|
||||
self.label = QtWidgets.QLabel(self.centralwidget)
|
||||
self.label.setGeometry(QtCore.QRect(680, 70, 71, 40))
|
||||
self.label.setObjectName("label")
|
||||
self.label_2 = QtWidgets.QLabel(self.centralwidget)
|
||||
self.label_2.setGeometry(QtCore.QRect(820, 70, 10, 40))
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.tableView = QtWidgets.QTableView(self.centralwidget)
|
||||
self.tableView.setGeometry(QtCore.QRect(20, 20, 640, 400))
|
||||
self.tableView.setObjectName("tableView")
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 850, 25))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menuOptions = QtWidgets.QMenu(self.menubar)
|
||||
self.menuOptions.setObjectName("menuOptions")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.actionSend_Animations = QtWidgets.QAction(MainWindow)
|
||||
self.actionSend_Animations.setObjectName("actionSend_Animations")
|
||||
self.actionSend_Configurations = QtWidgets.QAction(MainWindow)
|
||||
self.actionSend_Configurations.setObjectName("actionSend_Configurations")
|
||||
self.menuOptions.addAction(self.actionSend_Animations)
|
||||
self.menuOptions.addAction(self.actionSend_Configurations)
|
||||
self.menubar.addAction(self.menuOptions.menuAction())
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "Clever Drone Animation Player"))
|
||||
self.pushButton.setText(_translate("MainWindow", "Preflight check"))
|
||||
self.pushButton_2.setText(_translate("MainWindow", "Start animation"))
|
||||
self.pushButton_3.setText(_translate("MainWindow", "Pause"))
|
||||
self.pushButton_4.setText(_translate("MainWindow", "Stop"))
|
||||
self.pushButton_5.setText(_translate("MainWindow", "Takeoff"))
|
||||
self.pushButton_6.setText(_translate("MainWindow", "Land"))
|
||||
self.pushButton_7.setText(_translate("MainWindow", "Disarm"))
|
||||
self.label.setText(_translate("MainWindow", "Start after"))
|
||||
self.label_2.setText(_translate("MainWindow", "s"))
|
||||
self.menuOptions.setTitle(_translate("MainWindow", "Actions"))
|
||||
self.actionSend_Animations.setText(_translate("MainWindow", "Send Animations"))
|
||||
self.actionSend_Configurations.setText(_translate("MainWindow", "Send Configurations"))
|
||||
|
||||
|
||||
186
Server/server_gui.ui
Normal file
186
Server/server_gui.ui
Normal file
@@ -0,0 +1,186 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>MainWindow</class>
|
||||
<widget class="QMainWindow" name="MainWindow">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>850</width>
|
||||
<height>460</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Clever Drone Animation Player</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>680</x>
|
||||
<y>20</y>
|
||||
<width>150</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Preflight check</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>680</x>
|
||||
<y>120</y>
|
||||
<width>150</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start animation</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QSpinBox" name="spinBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>760</x>
|
||||
<y>70</y>
|
||||
<width>50</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>680</x>
|
||||
<y>170</y>
|
||||
<width>150</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Pause</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>680</x>
|
||||
<y>220</y>
|
||||
<width>150</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_5">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>680</x>
|
||||
<y>280</y>
|
||||
<width>150</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Takeoff</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>680</x>
|
||||
<y>330</y>
|
||||
<width>150</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Land</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton" name="pushButton_7">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>680</x>
|
||||
<y>380</y>
|
||||
<width>150</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disarm</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>680</x>
|
||||
<y>70</y>
|
||||
<width>71</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Start after</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>820</x>
|
||||
<y>70</y>
|
||||
<width>10</width>
|
||||
<height>40</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>s</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTableView" name="tableView">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>640</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>850</width>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
<widget class="QMenu" name="menuOptions">
|
||||
<property name="title">
|
||||
<string>Actions</string>
|
||||
</property>
|
||||
<addaction name="actionSend_Animations"/>
|
||||
<addaction name="actionSend_Configurations"/>
|
||||
</widget>
|
||||
<addaction name="menuOptions"/>
|
||||
</widget>
|
||||
<action name="actionSend_Animations">
|
||||
<property name="text">
|
||||
<string>Send Animations</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSend_Configurations">
|
||||
<property name="text">
|
||||
<string>Send Configurations</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
33
Server/server_qt.py
Normal file
33
Server/server_qt.py
Normal file
@@ -0,0 +1,33 @@
|
||||
from PyQt5 import QtWidgets
|
||||
from PyQt5.QtGui import QStandardItem
|
||||
from PyQt5.QtGui import QStandardItemModel
|
||||
from PyQt5.QtCore import QModelIndex
|
||||
from PyQt5.QtCore import Qt
|
||||
from PyQt5.QtCore import pyqtSlot
|
||||
|
||||
# Импортируем нашу форму.
|
||||
from server_gui import Ui_MainWindow
|
||||
import sys
|
||||
|
||||
|
||||
class main_window(QtWidgets.QMainWindow):
|
||||
def __init__(self):
|
||||
super(main_window, self).__init__()
|
||||
self.ui = Ui_MainWindow()
|
||||
self.ui.setupUi(self)
|
||||
model = QStandardItemModel()
|
||||
item = QStandardItem()
|
||||
model.setHorizontalHeaderLabels(
|
||||
('copter ID', 'animation ID', 'battery V', 'battery %', 'selfcheck', 'time UTC')
|
||||
)
|
||||
model.setColumnCount(6)
|
||||
model.setRowCount(20)
|
||||
self.ui.tableView.setModel(model)
|
||||
self.ui.tableView.horizontalHeader().setStretchLastSection(True)
|
||||
|
||||
|
||||
app = QtWidgets.QApplication([])
|
||||
application = main_window()
|
||||
application.show()
|
||||
|
||||
sys.exit(app.exec())
|
||||
Reference in New Issue
Block a user