diff --git a/src/qt/Mainwindow.py b/src/qt/Mainwindow.py index f560ca1..5e99b9d 100644 --- a/src/qt/Mainwindow.py +++ b/src/qt/Mainwindow.py @@ -14,6 +14,9 @@ from findpath_UI import * from Screenshot.Screenshot_Gui import * import qdarkstyle +sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../../PaddleClas-release-2.3") +import Tello.KeyboardControl as KeyControl + class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") @@ -203,6 +206,13 @@ class Ui_MainWindow(object): self.toolBar.addAction(self.actionicon_3) self.actionicon_2.triggered.connect(lambda: self.path()) self.actionicon_3.triggered.connect(lambda: self.video()) + self.pushButton_7.clicked.connect(lambda: self.connect()) + self.pushButton_3.clicked.connect(lambda: self.up()) + self.pushButton_6.clicked.connect(lambda: self.down()) + self.pushButton.clicked.connect(lambda: self.forward()) + self.pushButton_4.clicked.connect(lambda: self.right()) + self.pushButton_2.clicked.connect(lambda: self.left()) + self.pushButton_5.clicked.connect(lambda: self.Return()) self.retranslateUi(MainWindow) QtCore.QMetaObject.connectSlotsByName(MainWindow) @@ -216,6 +226,29 @@ class Ui_MainWindow(object): self.ui = Ui_MainWindow2() self.ui.show() + def connect(self): + KeyControl.connect() + + def up(self): + KeyControl.getKeyboardInput("UP") + + def down(self): + KeyControl.getKeyboardInput("DOWN") + + def forward(self): + KeyControl.getKeyboardInput("i") + + def right(self): + KeyControl.getKeyboardInput("l") + + def left(self): + KeyControl.getKeyboardInput("j") + + def Return(self): + KeyControl.getKeyboardInput("a") + KeyControl.getKeyboardInput("dffsfdsa") + + def retranslateUi(self, MainWindow): _translate = QtCore.QCoreApplication.translate MainWindow.setWindowTitle(_translate("MainWindow", "无人机路径生成系统")) diff --git a/src/qt/Screenshot/__pycache__/Audio_record.cpython-39.pyc b/src/qt/Screenshot/__pycache__/Audio_record.cpython-39.pyc index 037c86a..a40e9dc 100644 Binary files a/src/qt/Screenshot/__pycache__/Audio_record.cpython-39.pyc and b/src/qt/Screenshot/__pycache__/Audio_record.cpython-39.pyc differ diff --git a/src/qt/Screenshot/__pycache__/Screenshot_Gui.cpython-39.pyc b/src/qt/Screenshot/__pycache__/Screenshot_Gui.cpython-39.pyc index ee5472f..3d094f4 100644 Binary files a/src/qt/Screenshot/__pycache__/Screenshot_Gui.cpython-39.pyc and b/src/qt/Screenshot/__pycache__/Screenshot_Gui.cpython-39.pyc differ diff --git a/src/qt/Screenshot/__pycache__/Screenshot_record.cpython-39.pyc b/src/qt/Screenshot/__pycache__/Screenshot_record.cpython-39.pyc index 64d31c2..8ec9235 100644 Binary files a/src/qt/Screenshot/__pycache__/Screenshot_record.cpython-39.pyc and b/src/qt/Screenshot/__pycache__/Screenshot_record.cpython-39.pyc differ diff --git a/src/qt/__pycache__/findpath_UI.cpython-39.pyc b/src/qt/__pycache__/findpath_UI.cpython-39.pyc index 54f0718..46c924e 100644 Binary files a/src/qt/__pycache__/findpath_UI.cpython-39.pyc and b/src/qt/__pycache__/findpath_UI.cpython-39.pyc differ