mirror of
https://github.com/CopterExpress/clever-show.git
synced 2026-06-02 10:09:32 +00:00
Merge master branch
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'server_gui.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.13.0
|
||||
# Created by: PyQt5 UI code generator 5.13.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
@@ -224,12 +224,15 @@ class Ui_MainWindow(object):
|
||||
self.action_stop_music.setObjectName("action_stop_music")
|
||||
self.action_remove_row = QtWidgets.QAction(MainWindow)
|
||||
self.action_remove_row.setObjectName("action_remove_row")
|
||||
self.action_send_calibrations = QtWidgets.QAction(MainWindow)
|
||||
self.action_send_calibrations.setObjectName("action_send_calibrations")
|
||||
self.menuDeveloper_mode.addAction(self.action_send_any_file)
|
||||
self.menuDeveloper_mode.addAction(self.actionSend_any_command)
|
||||
self.menuOptions.addAction(self.action_send_animations)
|
||||
self.menuOptions.addAction(self.action_send_configurations)
|
||||
self.menuOptions.addAction(self.action_send_Aruco_map)
|
||||
self.menuOptions.addAction(self.action_send_launch_file)
|
||||
self.menuOptions.addAction(self.action_send_Aruco_map)
|
||||
self.menuOptions.addAction(self.action_send_calibrations)
|
||||
self.menuOptions.addSeparator()
|
||||
self.menuOptions.addAction(self.menuDeveloper_mode.menuAction())
|
||||
self.menuOptions.addSeparator()
|
||||
@@ -306,13 +309,4 @@ class Ui_MainWindow(object):
|
||||
self.actionSend_any_command.setText(_translate("MainWindow", "Send any command"))
|
||||
self.action_stop_music.setText(_translate("MainWindow", "Stop music"))
|
||||
self.action_remove_row.setText(_translate("MainWindow", "Remove from table"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
MainWindow = QtWidgets.QMainWindow()
|
||||
ui = Ui_MainWindow()
|
||||
ui.setupUi(MainWindow)
|
||||
MainWindow.show()
|
||||
sys.exit(app.exec_())
|
||||
self.action_send_calibrations.setText(_translate("MainWindow", "Send camera calibrations"))
|
||||
|
||||
@@ -344,8 +344,9 @@
|
||||
</widget>
|
||||
<addaction name="action_send_animations"/>
|
||||
<addaction name="action_send_configurations"/>
|
||||
<addaction name="action_send_Aruco_map"/>
|
||||
<addaction name="action_send_launch_file"/>
|
||||
<addaction name="action_send_Aruco_map"/>
|
||||
<addaction name="action_send_calibrations"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menuDeveloper_mode"/>
|
||||
<addaction name="separator"/>
|
||||
@@ -495,6 +496,11 @@
|
||||
<action name="action_remove_row">
|
||||
<property name="text">
|
||||
<string>Remove from table</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_send_calibrations">
|
||||
<property name="text">
|
||||
<string>Send camera calibrations</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
|
||||
@@ -144,6 +144,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
self.ui.action_remove_row.triggered.connect(self.remove_selected)
|
||||
|
||||
self.ui.action_send_animations.triggered.connect(self.send_animations)
|
||||
self.ui.action_send_calibrations.triggered.connect(self.send_calibrations)
|
||||
self.ui.action_send_configurations.triggered.connect(self.send_configurations)
|
||||
self.ui.action_send_Aruco_map.triggered.connect(self.send_aruco)
|
||||
self.ui.action_send_launch_file.triggered.connect(self.send_launch)
|
||||
@@ -337,7 +338,7 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
print("Selected directory:", path)
|
||||
files = [file for file in glob.glob(path + '/*.csv')]
|
||||
names = [os.path.basename(file).split(".")[0] for file in files]
|
||||
print(files)
|
||||
# print(files)
|
||||
for file, name in zip(files, names):
|
||||
for copter in self.model.user_selected():
|
||||
if name == copter.copter_id:
|
||||
@@ -345,6 +346,22 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
else:
|
||||
print("Filename has no matches with any drone selected")
|
||||
|
||||
@pyqtSlot()
|
||||
def send_calibrations(self):
|
||||
path = str(QFileDialog.getExistingDirectory(self, "Select directory with calibration files"))
|
||||
|
||||
if path:
|
||||
print("Selected directory:", path)
|
||||
files = [file for file in glob.glob(path + '/*.yaml')]
|
||||
names = [os.path.basename(file).split(".")[0] for file in files]
|
||||
# print(files)
|
||||
for file, name in zip(files, names):
|
||||
for copter in self.model.user_selected():
|
||||
if name == copter.copter_id:
|
||||
copter.client.send_file(file, "/home/pi/catkin_ws/src/clever/clever/camera_info/calibration.yaml")
|
||||
else:
|
||||
print("Filename has no matches with any drone selected")
|
||||
|
||||
@pyqtSlot()
|
||||
def send_configurations(self):
|
||||
path = QFileDialog.getOpenFileName(self, "Select configuration file", filter="Configs (*.ini *.txt .cfg)")[0]
|
||||
|
||||
Reference in New Issue
Block a user