27 #include "ui_gcscontrol.h"
30 #include <QStringList>
33 #include <QVBoxLayout>
34 #include <QPushButton>
38 #include "manualcontrolcommand.h"
40 #include "flightstatus.h"
45 m_gcscontrol =
new Ui_GCSControl();
46 m_gcscontrol->setupUi(
this);
52 FlightStatus *flightStatus = FlightStatus::GetInstance(objManager);
54 m_gcscontrol->comboBoxFlightMode->addItems(flightStatus->getField(
"FlightMode")->getOptions());
63 connect(m_gcscontrol->checkBoxGcsControl, &QAbstractButton::clicked,
this,
65 connect(m_gcscontrol->checkBoxArmed, &QAbstractButton::clicked,
this,
67 connect(m_gcscontrol->comboBoxFlightMode, QOverload<int>::of(&QComboBox::currentIndexChanged),
71 connect(flightStatus, &FlightStatus::FlightModeChanged,
this,
89 m_gcscontrol->widgetLeftStick->changePosition(leftX, leftY);
90 m_gcscontrol->widgetRightStick->changePosition(rightX, rightY);
131 m_gcscontrol->comboBoxFlightMode->setCurrentIndex(mode);
136 m_gcscontrol->checkBoxArmed->setChecked(armed != 0);
150 m_gcscontrol->checkBoxGcsControl->setEnabled(allow);
152 m_gcscontrol->checkBoxGcsControl->setToolTip(tr(
"Take control of the board from GCS"));
154 m_gcscontrol->checkBoxGcsControl->setToolTip(
155 tr(
"Disabled for safety. Enable this in the options page."));
160 m_gcscontrol->checkBoxGcsControl->setChecked(newState);
165 return m_gcscontrol->checkBoxGcsControl->isChecked();
void setGCSControl(bool newState)
void flightModeChanged(quint8 mode)
void updateSticks(double leftX, double leftY, double rightX, double rightY)
Signals from parent gadget indicating change from the remote system.
void allowGcsControl(bool allow)
Allow the GCS to take over control of UAV.
Core plugin system that manages the plugins, their life cycle and their registered objects...
GCSControlGadgetWidget(QWidget *parent=nullptr)
void leftStickClicked(double X, double Y)
void sticksChanged(double leftX, double leftY, double rightX, double rightY, double arming)
Emitted whenever the UI is clicked on to indicate the new stick positions.
void rightStickClicked(double X, double Y)
void toggleControl(bool checked)
Called when the gcs control is toggled.
void positionClicked(double x, double y)
void controlEnabled(bool)
void flightModeChangedLocally(ManualControlSettings::FlightModePositionOptions)
void toggleArming(bool checked)
Called when the gcs control is toggled.
void selectFlightMode(int state)
Called when the flight mode drop down is changed and sets the ManualControlCommand->FlightMode accord...
void armedChanged(quint8 armed)