10 changed files with 632 additions and 824 deletions
@ -0,0 +1,68 @@
@@ -0,0 +1,68 @@
|
||||
#include "QGCMissionNavWaypoint.h" |
||||
#include "ui_QGCMissionNavWaypoint.h" |
||||
#include "WaypointEditableView.h" |
||||
|
||||
QGCMissionNavWaypoint::QGCMissionNavWaypoint(WaypointEditableView* WEV) : |
||||
QWidget(WEV), |
||||
ui(new Ui::QGCMissionNavWaypoint) |
||||
{ |
||||
ui->setupUi(this); |
||||
this->WEV = WEV; |
||||
|
||||
//Using UI to change WP:
|
||||
connect(this->ui->holdTimeSpinBox, SIGNAL(valueChanged(double)),WEV,SLOT(changedParam1(double))); |
||||
connect(this->ui->acceptanceSpinBox, SIGNAL(valueChanged(double)),WEV,SLOT(changedParam2(double))); |
||||
//connect(this->ui->param3SpinBox, SIGNAL(valueChanged(double)),WEV,SLOT(changedParam3(double)));
|
||||
connect(this->ui->yawSpinBox, SIGNAL(valueChanged(double)),WEV,SLOT(changedParam4(double))); |
||||
connect(this->ui->posNSpinBox, SIGNAL(valueChanged(double)),WEV,SLOT(changedParam5(double)));//NED
|
||||
connect(this->ui->posESpinBox, SIGNAL(valueChanged(double)),WEV,SLOT(changedParam6(double))); |
||||
connect(this->ui->posDSpinBox, SIGNAL(valueChanged(double)),WEV,SLOT(changedParam7(double))); |
||||
connect(this->ui->latSpinBox, SIGNAL(valueChanged(double)),WEV,SLOT(changedParam5(double)));//Global
|
||||
connect(this->ui->lonSpinBox, SIGNAL(valueChanged(double)),WEV,SLOT(changedParam6(double))); |
||||
connect(this->ui->altSpinBox, SIGNAL(valueChanged(double)),WEV,SLOT(changedParam7(double))); |
||||
|
||||
//Reading WP to update UI:
|
||||
connect(WEV,SIGNAL(frameBroadcast(MAV_FRAME)),this,SLOT(updateFrame(MAV_FRAME))); |
||||
connect(WEV,SIGNAL(param1Broadcast(double)),this->ui->holdTimeSpinBox,SLOT(setValue(double))); |
||||
connect(WEV,SIGNAL(param2Broadcast(double)),this->ui->acceptanceSpinBox,SLOT(setValue(double))); |
||||
//connect(WEV,SIGNAL(param3Broadcast(double)),this->ui->param3SpinBox,SLOT(setValue(double)));
|
||||
connect(WEV,SIGNAL(param4Broadcast(double)),this->ui->yawSpinBox,SLOT(setValue(double))); |
||||
connect(WEV,SIGNAL(param5Broadcast(double)),this->ui->posNSpinBox,SLOT(setValue(double)));//NED
|
||||
connect(WEV,SIGNAL(param6Broadcast(double)),this->ui->posESpinBox,SLOT(setValue(double))); |
||||
connect(WEV,SIGNAL(param7Broadcast(double)),this->ui->posDSpinBox,SLOT(setValue(double))); |
||||
connect(WEV,SIGNAL(param5Broadcast(double)),this->ui->latSpinBox,SLOT(setValue(double)));//Global
|
||||
connect(WEV,SIGNAL(param6Broadcast(double)),this->ui->lonSpinBox,SLOT(setValue(double))); |
||||
connect(WEV,SIGNAL(param7Broadcast(double)),this->ui->altSpinBox,SLOT(setValue(double))); |
||||
} |
||||
|
||||
void QGCMissionNavWaypoint::updateFrame(MAV_FRAME frame) |
||||
{ |
||||
switch(frame) |
||||
{ |
||||
case MAV_FRAME_LOCAL_ENU: |
||||
case MAV_FRAME_LOCAL_NED: |
||||
this->ui->posNSpinBox->show(); |
||||
this->ui->posESpinBox->show(); |
||||
this->ui->posDSpinBox->show(); |
||||
this->ui->latSpinBox->hide(); |
||||
this->ui->lonSpinBox->hide(); |
||||
this->ui->altSpinBox->hide(); |
||||
break; |
||||
case MAV_FRAME_GLOBAL: |
||||
case MAV_FRAME_GLOBAL_RELATIVE_ALT: |
||||
this->ui->posNSpinBox->hide(); |
||||
this->ui->posESpinBox->hide(); |
||||
this->ui->posDSpinBox->hide(); |
||||
this->ui->latSpinBox->show(); |
||||
this->ui->lonSpinBox->show(); |
||||
this->ui->altSpinBox->show(); |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
} |
||||
|
||||
QGCMissionNavWaypoint::~QGCMissionNavWaypoint() |
||||
{ |
||||
delete ui; |
||||
} |
@ -0,0 +1,32 @@
@@ -0,0 +1,32 @@
|
||||
#ifndef QGCMISSIONNAVWAYPOINT_H |
||||
#define QGCMISSIONNAVWAYPOINT_H |
||||
|
||||
#include <QWidget> |
||||
#include "WaypointEditableView.h" |
||||
|
||||
namespace Ui { |
||||
class QGCMissionNavWaypoint; |
||||
} |
||||
|
||||
class QGCMissionNavWaypoint : public QWidget |
||||
{ |
||||
Q_OBJECT |
||||
|
||||
public: |
||||
explicit QGCMissionNavWaypoint(WaypointEditableView* WEV); |
||||
~QGCMissionNavWaypoint(); |
||||
|
||||
public slots: |
||||
void updateFrame(MAV_FRAME); |
||||
|
||||
protected: |
||||
WaypointEditableView* WEV; |
||||
|
||||
private: |
||||
Ui::QGCMissionNavWaypoint *ui; |
||||
}; |
||||
|
||||
|
||||
|
||||
|
||||
#endif // QGCMISSIONNAVWAYPOINT_H
|
@ -0,0 +1,343 @@
@@ -0,0 +1,343 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<ui version="4.0"> |
||||
<class>QGCMissionNavWaypoint</class> |
||||
<widget class="QWidget" name="QGCMissionNavWaypoint"> |
||||
<property name="geometry"> |
||||
<rect> |
||||
<x>0</x> |
||||
<y>0</y> |
||||
<width>2208</width> |
||||
<height>37</height> |
||||
</rect> |
||||
</property> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="minimumSize"> |
||||
<size> |
||||
<width>200</width> |
||||
<height>0</height> |
||||
</size> |
||||
</property> |
||||
<property name="windowTitle"> |
||||
<string>Form</string> |
||||
</property> |
||||
<property name="styleSheet"> |
||||
<string notr="true"/> |
||||
</property> |
||||
<layout class="QHBoxLayout" name="horizontalLayout"> |
||||
<property name="spacing"> |
||||
<number>5</number> |
||||
</property> |
||||
<property name="margin"> |
||||
<number>0</number> |
||||
</property> |
||||
<item> |
||||
<widget class="QDoubleSpinBox" name="posNSpinBox"> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="focusPolicy"> |
||||
<enum>Qt::WheelFocus</enum> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Position X coordinate</string> |
||||
</property> |
||||
<property name="statusTip"> |
||||
<string>Position X corrdinate</string> |
||||
</property> |
||||
<property name="wrapping"> |
||||
<bool>false</bool> |
||||
</property> |
||||
<property name="frame"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<property name="accelerated"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<property name="prefix"> |
||||
<string>N </string> |
||||
</property> |
||||
<property name="suffix"> |
||||
<string> m</string> |
||||
</property> |
||||
<property name="minimum"> |
||||
<double>-10000.000000000000000</double> |
||||
</property> |
||||
<property name="maximum"> |
||||
<double>10000.000000000000000</double> |
||||
</property> |
||||
<property name="singleStep"> |
||||
<double>0.050000000000000</double> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QDoubleSpinBox" name="posESpinBox"> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="focusPolicy"> |
||||
<enum>Qt::WheelFocus</enum> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Position Y/Longitude coordinate</string> |
||||
</property> |
||||
<property name="statusTip"> |
||||
<string>Position Y/Longitude coordinate</string> |
||||
</property> |
||||
<property name="prefix"> |
||||
<string>E </string> |
||||
</property> |
||||
<property name="suffix"> |
||||
<string> m</string> |
||||
</property> |
||||
<property name="minimum"> |
||||
<double>-10000.000000000000000</double> |
||||
</property> |
||||
<property name="maximum"> |
||||
<double>10000.000000000000000</double> |
||||
</property> |
||||
<property name="singleStep"> |
||||
<double>0.050000000000000</double> |
||||
</property> |
||||
<property name="value"> |
||||
<double>0.000000000000000</double> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QDoubleSpinBox" name="posDSpinBox"> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="focusPolicy"> |
||||
<enum>Qt::WheelFocus</enum> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Position Z coordinate (local frame, negative)</string> |
||||
</property> |
||||
<property name="statusTip"> |
||||
<string/> |
||||
</property> |
||||
<property name="prefix"> |
||||
<string>D </string> |
||||
</property> |
||||
<property name="suffix"> |
||||
<string> m</string> |
||||
</property> |
||||
<property name="minimum"> |
||||
<double>-10000.000000000000000</double> |
||||
</property> |
||||
<property name="maximum"> |
||||
<double>10000.000000000000000</double> |
||||
</property> |
||||
<property name="singleStep"> |
||||
<double>0.050000000000000</double> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QDoubleSpinBox" name="latSpinBox"> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="focusPolicy"> |
||||
<enum>Qt::WheelFocus</enum> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Latitude in degrees</string> |
||||
</property> |
||||
<property name="statusTip"> |
||||
<string>Latitude in degrees</string> |
||||
</property> |
||||
<property name="prefix"> |
||||
<string>lat </string> |
||||
</property> |
||||
<property name="suffix"> |
||||
<string>°</string> |
||||
</property> |
||||
<property name="decimals"> |
||||
<number>7</number> |
||||
</property> |
||||
<property name="minimum"> |
||||
<double>-90.000000000000000</double> |
||||
</property> |
||||
<property name="maximum"> |
||||
<double>90.000000000000000</double> |
||||
</property> |
||||
<property name="singleStep"> |
||||
<double>0.000010000000000</double> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QDoubleSpinBox" name="lonSpinBox"> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="focusPolicy"> |
||||
<enum>Qt::WheelFocus</enum> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Longitude in degrees</string> |
||||
</property> |
||||
<property name="statusTip"> |
||||
<string>Longitude in degrees</string> |
||||
</property> |
||||
<property name="prefix"> |
||||
<string>lon </string> |
||||
</property> |
||||
<property name="suffix"> |
||||
<string>°</string> |
||||
</property> |
||||
<property name="decimals"> |
||||
<number>7</number> |
||||
</property> |
||||
<property name="minimum"> |
||||
<double>-180.000000000000000</double> |
||||
</property> |
||||
<property name="maximum"> |
||||
<double>180.000000000000000</double> |
||||
</property> |
||||
<property name="singleStep"> |
||||
<double>0.000010000000000</double> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QDoubleSpinBox" name="altSpinBox"> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Altitude in meters</string> |
||||
</property> |
||||
<property name="statusTip"> |
||||
<string>Altitude in meters</string> |
||||
</property> |
||||
<property name="prefix"> |
||||
<string>alt </string> |
||||
</property> |
||||
<property name="suffix"> |
||||
<string>m</string> |
||||
</property> |
||||
<property name="decimals"> |
||||
<number>2</number> |
||||
</property> |
||||
<property name="minimum"> |
||||
<double>-100000.000000000000000</double> |
||||
</property> |
||||
<property name="maximum"> |
||||
<double>100000.000000000000000</double> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QDoubleSpinBox" name="yawSpinBox"> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="focusPolicy"> |
||||
<enum>Qt::StrongFocus</enum> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Rotary wing only: Desired yaw angle at waypoint</string> |
||||
</property> |
||||
<property name="statusTip"> |
||||
<string>Rotary wing only: Desired yaw angle at waypoint</string> |
||||
</property> |
||||
<property name="wrapping"> |
||||
<bool>true</bool> |
||||
</property> |
||||
<property name="prefix"> |
||||
<string/> |
||||
</property> |
||||
<property name="suffix"> |
||||
<string>°</string> |
||||
</property> |
||||
<property name="decimals"> |
||||
<number>0</number> |
||||
</property> |
||||
<property name="minimum"> |
||||
<double>-180.000000000000000</double> |
||||
</property> |
||||
<property name="maximum"> |
||||
<double>180.000000000000000</double> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QDoubleSpinBox" name="acceptanceSpinBox"> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Uncertainty radius in meters |
||||
where to accept this waypoint as reached</string> |
||||
</property> |
||||
<property name="statusTip"> |
||||
<string>Uncertainty radius in meters where to accept this waypoint as reached</string> |
||||
</property> |
||||
<property name="suffix"> |
||||
<string> m</string> |
||||
</property> |
||||
<property name="value"> |
||||
<double>0.200000000000000</double> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
<item> |
||||
<widget class="QDoubleSpinBox" name="holdTimeSpinBox"> |
||||
<property name="sizePolicy"> |
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed"> |
||||
<horstretch>0</horstretch> |
||||
<verstretch>0</verstretch> |
||||
</sizepolicy> |
||||
</property> |
||||
<property name="toolTip"> |
||||
<string>Time to stay/loiter at this position before advancing</string> |
||||
</property> |
||||
<property name="statusTip"> |
||||
<string>Time to stay/loiter at this position before advancing</string> |
||||
</property> |
||||
<property name="suffix"> |
||||
<string> s</string> |
||||
</property> |
||||
<property name="maximum"> |
||||
<double>9999.989999999999782</double> |
||||
</property> |
||||
</widget> |
||||
</item> |
||||
</layout> |
||||
</widget> |
||||
<resources/> |
||||
<connections/> |
||||
</ui> |
Loading…
Reference in new issue