27 #include "ui_magicwaypoint.h"
31 #include <QStringList>
34 #include <QVBoxLayout>
35 #include <QPushButton>
39 #include "manualcontrolcommand.h"
46 m_magicwaypoint =
new Ui_MagicWaypoint();
47 m_magicwaypoint->setupUi(
this);
50 connect(getPathDesired(), SIGNAL(objectUpdated(
UAVObject *)),
this,
52 connect(getPositionActual(), SIGNAL(objectUpdated(
UAVObject *)),
this,
56 connect(m_magicwaypoint->widgetPosition, SIGNAL(positionClicked(
double,
double)),
this,
59 m_magicwaypoint->widgetPosition, SLOT(updateActualIndicator(
double,
double)));
61 m_magicwaypoint->widgetPosition, SLOT(updateDesiredIndicator(
double,
double)));
64 connect(m_magicwaypoint->horizontalSliderScale, SIGNAL(valueChanged(
int)),
this,
68 m_magicwaypoint->horizontalSliderScale->setValue(10);
80 PathDesired *MagicWaypointGadgetWidget::getPathDesired()
84 PathDesired *obj = PathDesired::GetInstance(objManager);
85 Q_ASSERT(obj != NULL);
92 PositionActual *MagicWaypointGadgetWidget::getPositionActual()
96 PositionActual *obj = PositionActual::GetInstance(objManager);
97 Q_ASSERT(obj != NULL);
116 PositionActual::DataFields positionActual = getPositionActual()->getData();
117 double scale = m_magicwaypoint->horizontalSliderScale->value();
127 PathDesired::DataFields pathDesired = getPathDesired()->getData();
128 double scale = m_magicwaypoint->horizontalSliderScale->value();
131 pathDesired.End[PathDesired::END_EAST] / scale);
139 double scale = m_magicwaypoint->horizontalSliderScale->value();
141 PathDesired::DataFields pathDesired = getPathDesired()->getData();
142 pathDesired.End[PathDesired::END_NORTH] = north * scale;
143 pathDesired.End[PathDesired::END_EAST] = east * scale;
144 pathDesired.Mode = PathDesired::MODE_ENDPOINT;
145 getPathDesired()->setData(pathDesired);
void pathDesiredChanged(UAVObject *)
MagicWaypointGadgetWidget(QWidget *parent=nullptr)
Core plugin system that manages the plugins, their life cycle and their registered objects...
void positionDesiredObjectChanged(double north, double east)
void positionSelected(double north, double east)
void scaleChanged(int scale)
void positionActualChanged(UAVObject *)
void positionActualObjectChanged(double north, double east)
~MagicWaypointGadgetWidget()