예제 #1
0
    def setupUi(self):
        self.ui.setupUi(self)
        self.ui.one_button.clicked.connect(partial(self.selection_choice, 1))
        self.ui.two_button.clicked.connect(partial(self.selection_choice, 2))
        self.ui.land_emergency_button.clicked.connect(b_partial(self.send_to_selected, "land"))
        self.ui.disarm_emergency_button.clicked.connect(b_partial(self.send_to_selected, "disarm"))

        self.ui.one_button.setShortcut(QKeySequence("1"))
        self.ui.two_button.setShortcut(QKeySequence("2"))
        self.ui.land_emergency_button.setShortcut(QKeySequence("L"))
        self.ui.disarm_emergency_button.setShortcut(QKeySequence("D"))
예제 #2
0
    def init_ui(self):
        self.init_table()

        # Connecting
        self.ui.check_button.clicked.connect(self.selfcheck_selected)
        self.ui.start_button.clicked.connect(self.send_start_time_selected)
        self.ui.pause_button.clicked.connect(self.pause_resume_selected)

        self.ui.z_checkbox.clicked.connect(self.ui.z_spin.setEnabled)
        self.ui.z_spin.setEnabled(False)

        self.ui.land_all_button.clicked.connect(
            b_partial(Client.broadcast_message, "land"))
        self.ui.land_selected_button.clicked.connect(
            b_partial(self.send_to_selected, "land"))
        self.ui.disarm_all_button.clicked.connect(
            b_partial(Client.broadcast_message, "disarm"))
        self.ui.disarm_selected_button.clicked.connect(
            b_partial(self.send_to_selected, "disarm"))
        self.ui.visual_land_button.clicked.connect(self.visual_land)
        self.ui.emergency_land_button.clicked.connect(
            b_partial(self.send_to_selected, "emergency_land"))
        self.ui.leds_button.clicked.connect(
            b_partial(self.send_to_selected, "led_test"))
        self.ui.takeoff_button.clicked.connect(self.takeoff_selected)
        self.ui.flip_button.clicked.connect(self.flip_selected)
        self.ui.reboot_fcu.clicked.connect(
            b_partial(self.send_to_selected, "reboot_fcu"))
        self.ui.calibrate_gyro.clicked.connect(self.calibrate_gyro_selected)
        self.ui.calibrate_level.clicked.connect(self.calibrate_level_selected)

        self.ui.action_select_music_file.triggered.connect(
            self.select_music_file)
        self.ui.action_play_music.triggered.connect(self.play_music)
        self.ui.action_stop_music.triggered.connect(self.stop_music)

        self.ui.action_edit_any_config.triggered.connect(
            ConfigDialog.call_standalone_dialog)
        self.ui.action_edit_server_config.triggered.connect(
            self.edit_server_config)

        self.ui.action_restart_server.triggered.connect(restart)
        self.ui.action_update_server_git.triggered.connect(update_server)

        self.ui.action_select_all.triggered.connect(
            partial(self.ui.copter_table.select_all, Qt.Checked))
        self.ui.action_deselect_all.triggered.connect(
            partial(self.ui.copter_table.select_all, Qt.Unchecked))
        self.ui.action_toggle_select.triggered.connect(
            self.ui.copter_table.toggle_select)
        self.ui.action_remove_row.triggered.connect(self.remove_selected)
        self.ui.action_configure_columns.triggered.connect(
            self.configure_columns)

        self.ui.action_send_animations.triggered.connect(self.send_animations)
        self.ui.action_send_calibrations.triggered.connect(
            self.send_calibrations)
        self.ui.action_send_animation.triggered.connect(self.send_animation)
        self.ui.action_send_configurations.triggered.connect(self.send_config)
        self.ui.action_send_aruco_map.triggered.connect(self.send_aruco)
        self.ui.action_send_launch_file.triggered.connect(self.send_launch)
        self.ui.action_send_fcu_parameters.triggered.connect(
            self.send_fcu_parameters)
        self.ui.action_send_any_file.triggered.connect(self.send_any_file)
        self.ui.action_send_any_command.triggered.connect(
            self.send_any_command)

        self.ui.action_retrive_any_file.triggered.connect(
            b_partial(self.request_any_file, client_path=None))

        self.ui.action_restart_clever.triggered.connect(
            b_partial(self.send_to_selected,
                      "service_restart",
                      command_kwargs={"name": "clover"}))
        self.ui.action_restart_clever_show.triggered.connect(
            self.restart_clever_show)
        self.ui.action_restart_chrony.triggered.connect(self.restart_chrony)
        self.ui.action_reboot_all.triggered.connect(
            b_partial(self.send_to_selected, "reboot_all"))

        self.ui.action_set_start_to_current_position.triggered.connect(
            b_partial(self.send_to_selected, "move_start"))
        self.ui.action_reset_start.triggered.connect(
            b_partial(self.send_to_selected, "reset_start"))
        self.ui.action_set_z_offset_to_ground.triggered.connect(
            b_partial(self.send_to_selected, "set_z_to_ground"))
        self.ui.action_reset_z_offset.triggered.connect(
            b_partial(self.send_to_selected, "reset_z_offset"))

        self.ui.action_update_client_repo.triggered.connect(
            b_partial(self.send_to_selected, "update_repo"))