mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
GCS/MapLib - Several fixes, changes and enhancements.
This commit is contained in:
parent
08040ab5cf
commit
5da9efd673
@ -1 +1,20 @@
|
||||
#ifndef OPMAP_CONTROL_H_
|
||||
#define OPMAP_CONTROL_H_
|
||||
#include "src/mapwidget/opmapwidget.h"
|
||||
namespace mapcontrol
|
||||
{
|
||||
struct customData
|
||||
{
|
||||
float velocity;
|
||||
int mode;
|
||||
float mode_params[4];
|
||||
int condition;
|
||||
float condition_params[4];
|
||||
int command;
|
||||
int jumpdestination;
|
||||
int errordestination;
|
||||
};
|
||||
|
||||
}
|
||||
Q_DECLARE_METATYPE(mapcontrol::customData)
|
||||
#endif
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
@ -267,6 +267,7 @@ namespace mapcontrol
|
||||
if(!selectedArea.IsEmpty() && event->modifiers() == Qt::ShiftModifier)
|
||||
{
|
||||
SetZoomToFitRect(SelectedArea());
|
||||
selectedArea=internals::RectLatLng::Empty;
|
||||
}
|
||||
}
|
||||
|
||||
@ -276,6 +277,8 @@ namespace mapcontrol
|
||||
{
|
||||
if(event->modifiers()&(Qt::ShiftModifier|Qt::ControlModifier))
|
||||
this->setCursor(Qt::CrossCursor);
|
||||
if(event->key()==Qt::Key_Escape)
|
||||
selectedArea=internals::RectLatLng::Empty;
|
||||
QGraphicsItem::keyPressEvent(event);
|
||||
}
|
||||
void MapGraphicItem::keyReleaseEvent(QKeyEvent *event)
|
||||
|
@ -12,6 +12,9 @@
|
||||
<file>images/mapquad.png</file>
|
||||
<file>images/dragons1.jpg</file>
|
||||
<file>images/dragons2.jpeg</file>
|
||||
<file>images/waypoint_marker1.png</file>
|
||||
<file>images/waypoint_marker2.png</file>
|
||||
<file>images/waypoint_marker3.png</file>
|
||||
</qresource>
|
||||
<qresource prefix="/uavs">
|
||||
<file>images/airplanepip.png</file>
|
||||
|
@ -38,14 +38,17 @@ WayPointCircle::WayPointCircle(WayPointItem *center, WayPointItem *radius,bool c
|
||||
connect(radius,SIGNAL(localPositionChanged(QPointF)),this,SLOT(refreshLocations()));
|
||||
connect(center,SIGNAL(aboutToBeDeleted(WayPointItem*)),this,SLOT(waypointdeleted()));
|
||||
connect(radius,SIGNAL(aboutToBeDeleted(WayPointItem*)),this,SLOT(waypointdeleted()));
|
||||
refreshLocations();
|
||||
|
||||
}
|
||||
|
||||
WayPointCircle::WayPointCircle(HomeItem *center, WayPointItem *radius, bool clockwise, MapGraphicItem *map, QColor color):my_center(center),
|
||||
WayPointCircle::WayPointCircle(HomeItem *radius, WayPointItem *center, bool clockwise, MapGraphicItem *map, QColor color):my_center(center),
|
||||
my_radius(radius),my_map(map),QGraphicsEllipseItem(map),myColor(color),myClockWise(clockwise)
|
||||
{
|
||||
connect(center,SIGNAL(homePositionChanged(internals::PointLatLng)),this,SLOT(refreshLocations()));
|
||||
connect(radius,SIGNAL(localPositionChanged(QPointF)),this,SLOT(refreshLocations()));
|
||||
connect(radius,SIGNAL(aboutToBeDeleted(WayPointItem*)),this,SLOT(waypointdeleted()));
|
||||
connect(radius,SIGNAL(homePositionChanged(internals::PointLatLng)),this,SLOT(refreshLocations()));
|
||||
connect(center,SIGNAL(localPositionChanged(QPointF)),this,SLOT(refreshLocations()));
|
||||
connect(center,SIGNAL(aboutToBeDeleted(WayPointItem*)),this,SLOT(waypointdeleted()));
|
||||
refreshLocations();
|
||||
}
|
||||
|
||||
int WayPointCircle::type() const
|
||||
@ -53,21 +56,13 @@ int WayPointCircle::type() const
|
||||
// Enable the use of qgraphicsitem_cast with this item.
|
||||
return Type;
|
||||
}
|
||||
QPainterPath WayPointCircle::shape() const
|
||||
{
|
||||
QPainterPath path = QGraphicsEllipseItem::shape();
|
||||
path.addPolygon(arrowHead);
|
||||
return path;
|
||||
}
|
||||
|
||||
void WayPointCircle::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
|
||||
{
|
||||
QPointF p1;
|
||||
QPointF p2;
|
||||
p1=my_center->pos();
|
||||
p2=my_center->pos();
|
||||
QLineF line(my_radius->pos(),my_center->pos());
|
||||
p1.ry()=p1.ry()+line.length();
|
||||
p2.ry()=p2.ry()-line.length();
|
||||
p1=QPointF(line.p1().x(),line.p1().y()+line.length());
|
||||
p2=QPointF(line.p1().x(),line.p1().y()-line.length());
|
||||
QPen myPen = pen();
|
||||
myPen.setColor(myColor);
|
||||
qreal arrowSize = 10;
|
||||
@ -75,10 +70,8 @@ void WayPointCircle::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
|
||||
QBrush brush=painter->brush();
|
||||
painter->setBrush(myColor);
|
||||
double angle =0;
|
||||
if(myClockWise)
|
||||
if(!myClockWise)
|
||||
angle+=Pi;
|
||||
if (line.dy() >= 0)
|
||||
angle = (Pi) - angle;
|
||||
|
||||
QPointF arrowP1 = p1 + QPointF(sin(angle + Pi / 3) * arrowSize,
|
||||
cos(angle + Pi / 3) * arrowSize);
|
||||
@ -104,8 +97,9 @@ void WayPointCircle::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
|
||||
|
||||
void WayPointCircle::refreshLocations()
|
||||
{
|
||||
QLineF line(my_center->pos(),my_radius->pos());
|
||||
line=QLineF(my_center->pos(),my_radius->pos());
|
||||
this->setRect(my_center->pos().x(),my_center->pos().y(),2*line.length(),2*line.length());
|
||||
this->update();
|
||||
}
|
||||
|
||||
void WayPointCircle::waypointdeleted()
|
||||
|
@ -47,7 +47,6 @@ public:
|
||||
WayPointCircle(WayPointItem * center, WayPointItem * radius,bool clockwise,MapGraphicItem * map,QColor color=Qt::green);
|
||||
WayPointCircle(HomeItem * center, WayPointItem * radius,bool clockwise,MapGraphicItem * map,QColor color=Qt::green);
|
||||
int type() const;
|
||||
QPainterPath shape() const;
|
||||
void setColor(const QColor &color)
|
||||
{ myColor = color; }
|
||||
private:
|
||||
@ -57,6 +56,7 @@ private:
|
||||
QPolygonF arrowHead;
|
||||
QColor myColor;
|
||||
bool myClockWise;
|
||||
QLineF line;
|
||||
protected:
|
||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
|
||||
public slots:
|
||||
|
@ -297,8 +297,10 @@ WayPointItem::WayPointItem(MapGraphicItem *map, bool magicwaypoint):reached(fals
|
||||
emit WPValuesChanged(this);
|
||||
if(value)
|
||||
picture.load(QString::fromUtf8(":/markers/images/bigMarkerGreen.png"));
|
||||
else
|
||||
else if(this->flags() & QGraphicsItem::ItemIsMovable==QGraphicsItem::ItemIsMovable)
|
||||
picture.load(QString::fromUtf8(":/markers/images/marker.png"));
|
||||
else
|
||||
picture.load(QString::fromUtf8(":/markers/images/waypoint_marker2.png"));
|
||||
this->update();
|
||||
|
||||
}
|
||||
@ -403,5 +405,17 @@ WayPointItem::WayPointItem(MapGraphicItem *map, bool magicwaypoint):reached(fals
|
||||
setToolTip(QString("Magic WayPoint\nCoordinate:%1\nFrom Home:%2\nAltitude:%3\nType:%4\n%5").arg(coord_str).arg(relativeCoord_str).arg(QString::number(altitude)).arg(type_str).arg(myCustomString));
|
||||
}
|
||||
|
||||
void WayPointItem::setFlag(QGraphicsItem::GraphicsItemFlag flag, bool enabled)
|
||||
{
|
||||
if(flag==QGraphicsItem::ItemIsMovable)
|
||||
{
|
||||
if(enabled)
|
||||
picture.load(QString::fromUtf8(":/markers/images/marker.png"));
|
||||
else
|
||||
picture.load(QString::fromUtf8(":/markers/images/waypoint_marker2.png"));
|
||||
}
|
||||
QGraphicsItem::setFlag(flag,enabled);
|
||||
}
|
||||
|
||||
int WayPointItem::snumber=0;
|
||||
}
|
||||
|
@ -155,10 +155,9 @@ public:
|
||||
void RefreshPos();
|
||||
void RefreshToolTip();
|
||||
QPixmap picture;
|
||||
QVariant customData(){return myCustomData;}
|
||||
void setCustomData(QVariant arg){myCustomData=arg;}
|
||||
QString customString(){return myCustomString;}
|
||||
void setCustomString(QString arg){myCustomString=arg;}
|
||||
void setFlag(GraphicsItemFlag flag, bool enabled);
|
||||
~WayPointItem();
|
||||
|
||||
static int snumber;
|
||||
@ -188,7 +187,6 @@ private:
|
||||
QTransform transf;
|
||||
HomeItem * myHome;
|
||||
wptype myType;
|
||||
QVariant myCustomData;
|
||||
QString myCustomString;
|
||||
|
||||
public slots:
|
||||
|
@ -34,11 +34,9 @@
|
||||
#include "objectpersistence.h"
|
||||
#include <QtGui/QWidget>
|
||||
#include <QList>
|
||||
//#include <QtWebKit/QWebView>
|
||||
#include <QTextBrowser>
|
||||
#include "utils/pathutils.h"
|
||||
#include <QMessageBox>
|
||||
//#include "fancytabwidget.h"
|
||||
#include "utils/mytabbedstackwidget.h"
|
||||
#include "../uavobjectwidgetutils/configtaskwidget.h"
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
QT += webkit network
|
||||
TEMPLATE = lib
|
||||
TARGET = OPMapGadget
|
||||
|
||||
include(../../openpilotgcsplugin.pri)
|
||||
include(../../plugins/coreplugin/coreplugin.pri)
|
||||
include(../../libs/opmapcontrol/opmapcontrol.pri)
|
||||
|
@ -27,8 +27,15 @@
|
||||
|
||||
#include "opmap_edit_waypoint_dialog.h"
|
||||
#include "ui_opmap_edit_waypoint_dialog.h"
|
||||
|
||||
#include "opmapcontrol/opmapcontrol.h"
|
||||
// *********************************************************************
|
||||
typedef enum { MODE_FLYENDPOINT=0, MODE_FLYVECTOR=1, MODE_FLYCIRCLERIGHT=2, MODE_FLYCIRCLELEFT=3,
|
||||
MODE_DRIVEENDPOINT=4, MODE_DRIVEVECTOR=5, MODE_DRIVECIRCLELEFT=6, MODE_DRIVECIRCLERIGHT=7,
|
||||
MODE_FIXEDATTITUDE=8, MODE_SETACCESSORY=9, MODE_DISARMALARM=10 } ModeOptions;
|
||||
typedef enum { ENDCONDITION_NONE=0, ENDCONDITION_TIMEOUT=1, ENDCONDITION_DISTANCETOTARGET=2,
|
||||
ENDCONDITION_LEGREMAINING=3, ENDCONDITION_ABOVEALTITUDE=4, ENDCONDITION_POINTINGTOWARDSNEXT=5,
|
||||
ENDCONDITION_PYTHONSCRIPT=6, ENDCONDITION_IMMEDIATE=7 } EndConditionOptions;
|
||||
|
||||
|
||||
// constructor
|
||||
opmap_edit_waypoint_dialog::opmap_edit_waypoint_dialog(QWidget *parent) :
|
||||
@ -36,8 +43,33 @@ opmap_edit_waypoint_dialog::opmap_edit_waypoint_dialog(QWidget *parent) :
|
||||
ui(new Ui::opmap_edit_waypoint_dialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
waypoint_item = NULL;
|
||||
connect(ui->rbRelative,SIGNAL(toggled(bool)),this,SLOT(setupWidgets(bool)));
|
||||
my_waypoint = NULL;
|
||||
connect(ui->rbRelative,SIGNAL(toggled(bool)),this,SLOT(setupPositionWidgets(bool)));
|
||||
connect(ui->cbMode,SIGNAL(currentIndexChanged(int)),this,SLOT(setupModeWidgets()));
|
||||
connect(ui->cbCondition,SIGNAL(currentIndexChanged(int)),this,SLOT(setupConditionWidgets()));
|
||||
ui->cbMode->addItem("Fly Direct",MODE_FLYENDPOINT);
|
||||
ui->cbMode->addItem("Fly Vector",MODE_FLYVECTOR);
|
||||
ui->cbMode->addItem("Fly Circle Right",MODE_FLYCIRCLERIGHT);
|
||||
ui->cbMode->addItem("Fly Circle Left",MODE_FLYCIRCLELEFT);
|
||||
|
||||
ui->cbMode->addItem("Drive Direct",MODE_DRIVEENDPOINT);
|
||||
ui->cbMode->addItem("Drive Vector",MODE_DRIVEVECTOR);
|
||||
ui->cbMode->addItem("Drive Circle Right",MODE_DRIVECIRCLELEFT);
|
||||
ui->cbMode->addItem("Drive Circle Left",MODE_DRIVECIRCLERIGHT);
|
||||
|
||||
ui->cbMode->addItem("Fixed Attitude",MODE_FIXEDATTITUDE);
|
||||
ui->cbMode->addItem("Set Accessory",MODE_SETACCESSORY);
|
||||
ui->cbMode->addItem("Disarm Alarm",MODE_DISARMALARM);
|
||||
|
||||
ui->cbCondition->addItem("None",ENDCONDITION_NONE);
|
||||
ui->cbCondition->addItem("Timeout",ENDCONDITION_TIMEOUT);
|
||||
ui->cbCondition->addItem("Distance to tgt",ENDCONDITION_DISTANCETOTARGET);
|
||||
ui->cbCondition->addItem("Leg remaining",ENDCONDITION_LEGREMAINING);
|
||||
ui->cbCondition->addItem("Above Altitude",ENDCONDITION_ABOVEALTITUDE);
|
||||
ui->cbCondition->addItem("Pointing towards next",ENDCONDITION_POINTINGTOWARDSNEXT);
|
||||
ui->cbCondition->addItem("Python script",ENDCONDITION_PYTHONSCRIPT);
|
||||
ui->cbCondition->addItem("Immediate",ENDCONDITION_IMMEDIATE);
|
||||
|
||||
}
|
||||
|
||||
// destrutor
|
||||
@ -65,7 +97,7 @@ void opmap_edit_waypoint_dialog::on_pushButtonOK_clicked()
|
||||
int res = saveSettings();
|
||||
if (res < 0) return;
|
||||
|
||||
waypoint_item = NULL;
|
||||
my_waypoint = NULL;
|
||||
|
||||
close();
|
||||
}
|
||||
@ -77,17 +109,10 @@ void opmap_edit_waypoint_dialog::on_pushButtonApply_clicked()
|
||||
|
||||
void opmap_edit_waypoint_dialog::on_pushButtonRevert_clicked()
|
||||
{
|
||||
ui->checkBoxLocked->setChecked(original_locked);
|
||||
ui->spinBoxNumber->setValue(original_number);
|
||||
ui->doubleSpinBoxLatitude->setValue(original_coord.Lat());
|
||||
ui->doubleSpinBoxLongitude->setValue(original_coord.Lng());
|
||||
ui->doubleSpinBoxAltitude->setValue(original_altitude);
|
||||
ui->lineEditDescription->setText(original_description);
|
||||
|
||||
saveSettings();
|
||||
loadFromWP(my_waypoint);
|
||||
}
|
||||
|
||||
void opmap_edit_waypoint_dialog::setupWidgets(bool isRelative)
|
||||
void opmap_edit_waypoint_dialog::setupPositionWidgets(bool isRelative)
|
||||
{
|
||||
ui->lbLong->setVisible(!isRelative);
|
||||
ui->lbDegLong->setVisible(!isRelative);
|
||||
@ -103,85 +128,216 @@ void opmap_edit_waypoint_dialog::setupWidgets(bool isRelative)
|
||||
ui->doubleSpinBoxBearing->setVisible(isRelative);
|
||||
}
|
||||
|
||||
void opmap_edit_waypoint_dialog::setupModeWidgets()
|
||||
{
|
||||
ModeOptions mode=(ModeOptions)ui->cbMode->itemData(ui->cbMode->currentIndex()).toInt();
|
||||
switch(mode)
|
||||
{
|
||||
case MODE_FLYENDPOINT:
|
||||
case MODE_FLYVECTOR:
|
||||
case MODE_FLYCIRCLERIGHT:
|
||||
case MODE_FLYCIRCLELEFT:
|
||||
case MODE_DRIVEENDPOINT:
|
||||
case MODE_DRIVEVECTOR:
|
||||
case MODE_DRIVECIRCLELEFT:
|
||||
case MODE_DRIVECIRCLERIGHT:
|
||||
case MODE_DISARMALARM:
|
||||
ui->modeParam1->setVisible(false);
|
||||
ui->modeParam2->setVisible(false);
|
||||
ui->modeParam3->setVisible(false);
|
||||
ui->modeParam4->setVisible(false);
|
||||
ui->dsb_modeParam1->setVisible(false);
|
||||
ui->dsb_modeParam2->setVisible(false);
|
||||
ui->dsb_modeParam3->setVisible(false);
|
||||
ui->dsb_modeParam4->setVisible(false);
|
||||
break;
|
||||
case MODE_FIXEDATTITUDE:
|
||||
ui->modeParam1->setText("pitch");
|
||||
ui->modeParam2->setText("roll");
|
||||
ui->modeParam3->setText("yaw");
|
||||
ui->modeParam4->setText("throttle");
|
||||
ui->modeParam1->setVisible(true);
|
||||
ui->modeParam2->setVisible(true);
|
||||
ui->modeParam3->setVisible(true);
|
||||
ui->modeParam4->setVisible(true);
|
||||
ui->dsb_modeParam1->setVisible(true);
|
||||
ui->dsb_modeParam2->setVisible(true);
|
||||
ui->dsb_modeParam3->setVisible(true);
|
||||
ui->dsb_modeParam4->setVisible(true);
|
||||
break;
|
||||
case MODE_SETACCESSORY:
|
||||
ui->modeParam1->setText("Acc.channel");
|
||||
ui->modeParam2->setText("Value");
|
||||
ui->modeParam1->setVisible(true);
|
||||
ui->modeParam2->setVisible(true);
|
||||
ui->modeParam3->setVisible(false);
|
||||
ui->modeParam4->setVisible(false);
|
||||
ui->dsb_modeParam1->setVisible(true);
|
||||
ui->dsb_modeParam2->setVisible(true);
|
||||
ui->dsb_modeParam3->setVisible(false);
|
||||
ui->dsb_modeParam4->setVisible(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
void opmap_edit_waypoint_dialog::setupConditionWidgets()
|
||||
{
|
||||
EndConditionOptions mode=(EndConditionOptions)ui->cbCondition->itemData(ui->cbCondition->currentIndex()).toInt();
|
||||
switch(mode)
|
||||
{
|
||||
case ENDCONDITION_NONE:
|
||||
case ENDCONDITION_IMMEDIATE:
|
||||
case ENDCONDITION_PYTHONSCRIPT:
|
||||
ui->condParam1->setVisible(false);
|
||||
ui->condParam2->setVisible(false);
|
||||
ui->condParam3->setVisible(false);
|
||||
ui->condParam4->setVisible(false);
|
||||
ui->dsb_condParam1->setVisible(false);
|
||||
ui->dsb_condParam2->setVisible(false);
|
||||
ui->dsb_condParam3->setVisible(false);
|
||||
ui->dsb_condParam4->setVisible(false);
|
||||
break;
|
||||
case ENDCONDITION_TIMEOUT:
|
||||
ui->condParam1->setVisible(true);
|
||||
ui->condParam2->setVisible(false);
|
||||
ui->condParam3->setVisible(false);
|
||||
ui->condParam4->setVisible(false);
|
||||
ui->dsb_condParam1->setVisible(true);
|
||||
ui->dsb_condParam2->setVisible(false);
|
||||
ui->dsb_condParam3->setVisible(false);
|
||||
ui->dsb_condParam4->setVisible(false);
|
||||
ui->condParam1->setText("Timeout(ms)");
|
||||
break;
|
||||
case ENDCONDITION_DISTANCETOTARGET:
|
||||
ui->condParam1->setVisible(true);
|
||||
ui->condParam2->setVisible(true);
|
||||
ui->condParam3->setVisible(false);
|
||||
ui->condParam4->setVisible(false);
|
||||
ui->dsb_condParam1->setVisible(true);
|
||||
ui->dsb_condParam2->setVisible(true);
|
||||
ui->dsb_condParam3->setVisible(false);
|
||||
ui->dsb_condParam4->setVisible(false);
|
||||
ui->condParam1->setText("Distance(m)");
|
||||
ui->condParam2->setText("Flag(0=2D,1=3D)");//FIXME
|
||||
break;
|
||||
case ENDCONDITION_LEGREMAINING:
|
||||
ui->condParam1->setVisible(true);
|
||||
ui->condParam2->setVisible(false);
|
||||
ui->condParam3->setVisible(false);
|
||||
ui->condParam4->setVisible(false);
|
||||
ui->dsb_condParam1->setVisible(true);
|
||||
ui->dsb_condParam2->setVisible(false);
|
||||
ui->dsb_condParam3->setVisible(false);
|
||||
ui->dsb_condParam4->setVisible(false);
|
||||
ui->condParam1->setText("Relative Distance(0=complete,1=just starting)");
|
||||
break;
|
||||
case ENDCONDITION_ABOVEALTITUDE:
|
||||
ui->condParam1->setVisible(true);
|
||||
ui->condParam2->setVisible(false);
|
||||
ui->condParam3->setVisible(false);
|
||||
ui->condParam4->setVisible(false);
|
||||
ui->dsb_condParam1->setVisible(true);
|
||||
ui->dsb_condParam2->setVisible(false);
|
||||
ui->dsb_condParam3->setVisible(false);
|
||||
ui->dsb_condParam4->setVisible(false);
|
||||
ui->condParam1->setText("Altitude in meters (negative)");
|
||||
break;
|
||||
case ENDCONDITION_POINTINGTOWARDSNEXT:
|
||||
ui->condParam1->setVisible(true);
|
||||
ui->condParam2->setVisible(false);
|
||||
ui->condParam3->setVisible(false);
|
||||
ui->condParam4->setVisible(false);
|
||||
ui->dsb_condParam1->setVisible(true);
|
||||
ui->dsb_condParam2->setVisible(false);
|
||||
ui->dsb_condParam3->setVisible(false);
|
||||
ui->dsb_condParam4->setVisible(false);
|
||||
ui->condParam1->setText("Degrees variation allowed");
|
||||
break;
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
void opmap_edit_waypoint_dialog::on_pushButtonCancel_clicked()
|
||||
{
|
||||
waypoint_item = NULL;
|
||||
my_waypoint = NULL;
|
||||
close();
|
||||
}
|
||||
|
||||
// *********************************************************************
|
||||
|
||||
int opmap_edit_waypoint_dialog::saveSettings()
|
||||
{
|
||||
// ********************
|
||||
// fetch the various ui item values
|
||||
|
||||
bool locked = ui->checkBoxLocked->isChecked();
|
||||
|
||||
int number = ui->spinBoxNumber->value();
|
||||
if (number < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
customData data;
|
||||
data.mode=ui->cbMode->itemData(ui->cbMode->currentIndex()).toInt();
|
||||
data.mode_params[0]=ui->dsb_modeParam1->value();
|
||||
data.mode_params[1]=ui->dsb_modeParam2->value();
|
||||
data.mode_params[2]=ui->dsb_modeParam3->value();
|
||||
data.mode_params[3]=ui->dsb_modeParam4->value();
|
||||
|
||||
double latitude = ui->doubleSpinBoxLatitude->value();
|
||||
double longitude = ui->doubleSpinBoxLongitude->value();
|
||||
data.condition=ui->cbCondition->itemData(ui->cbCondition->currentIndex()).toInt();
|
||||
data.condition_params[0]=ui->dsb_condParam1->value();
|
||||
data.condition_params[1]=ui->dsb_condParam2->value();
|
||||
data.condition_params[2]=ui->dsb_condParam3->value();
|
||||
data.condition_params[3]=ui->dsb_condParam4->value();
|
||||
|
||||
double altitude = ui->doubleSpinBoxAltitude->value();
|
||||
QVariant var;
|
||||
var.setValue(data);
|
||||
my_waypoint->setData(0,var);
|
||||
|
||||
QString description = ui->lineEditDescription->displayText().simplified();
|
||||
|
||||
// ********************
|
||||
// transfer the settings to the actual waypoint
|
||||
|
||||
waypoint_item->SetNumber(number);
|
||||
waypoint_item->SetCoord(internals::PointLatLng(latitude, longitude));
|
||||
waypoint_item->SetAltitude(altitude);
|
||||
waypoint_item->SetDescription(description);
|
||||
waypoint_item->setFlag(QGraphicsItem::ItemIsMovable, !locked);
|
||||
my_waypoint->SetNumber(ui->spinBoxNumber->value());
|
||||
my_waypoint->SetCoord(internals::PointLatLng(ui->doubleSpinBoxLatitude->value(), ui->doubleSpinBoxLongitude->value()));
|
||||
my_waypoint->SetAltitude(ui->doubleSpinBoxAltitude->value());
|
||||
my_waypoint->SetDescription(ui->lineEditDescription->displayText().simplified());
|
||||
my_waypoint->setFlag(QGraphicsItem::ItemIsMovable, !ui->checkBoxLocked->isChecked());
|
||||
if(ui->rbAbsolute->isChecked())
|
||||
waypoint_item->setWPType(mapcontrol::WayPointItem::absolute);
|
||||
my_waypoint->setWPType(mapcontrol::WayPointItem::absolute);
|
||||
else
|
||||
waypoint_item->setWPType(mapcontrol::WayPointItem::relative);
|
||||
my_waypoint->setWPType(mapcontrol::WayPointItem::relative);
|
||||
mapcontrol::distBearing pt;
|
||||
pt.distance=ui->spinBoxDistance->value();
|
||||
pt.bearing=ui->doubleSpinBoxBearing->value()/180*M_PI;
|
||||
this->waypoint_item->setRelativeCoord(pt);
|
||||
// ********************
|
||||
|
||||
my_waypoint->setRelativeCoord(pt);
|
||||
return 0; // all ok
|
||||
}
|
||||
|
||||
// *********************************************************************
|
||||
// public functions
|
||||
void opmap_edit_waypoint_dialog::loadFromWP(mapcontrol::WayPointItem *waypoint_item)
|
||||
{
|
||||
customData data=waypoint_item->data(0).value<customData>();
|
||||
ui->spinBoxNumber->setValue(waypoint_item->Number());
|
||||
ui->doubleSpinBoxLatitude->setValue(waypoint_item->Coord().Lat());
|
||||
ui->doubleSpinBoxLongitude->setValue(waypoint_item->Coord().Lng());
|
||||
ui->doubleSpinBoxAltitude->setValue(waypoint_item->Altitude());
|
||||
ui->lineEditDescription->setText(waypoint_item->Description());
|
||||
if(waypoint_item->WPType()==mapcontrol::WayPointItem::absolute)
|
||||
ui->rbAbsolute->setChecked(true);
|
||||
else
|
||||
ui->rbRelative->setChecked(true);
|
||||
ui->doubleSpinBoxBearing->setValue(waypoint_item->getRelativeCoord().bearing*180/M_PI);
|
||||
ui->spinBoxDistance->setValue(waypoint_item->getRelativeCoord().distance);
|
||||
|
||||
ui->cbMode->setCurrentIndex(ui->cbMode->findData(data.mode));
|
||||
ui->dsb_modeParam1->setValue(data.mode_params[0]);
|
||||
ui->dsb_modeParam2->setValue(data.mode_params[1]);
|
||||
ui->dsb_modeParam3->setValue(data.mode_params[2]);
|
||||
ui->dsb_modeParam4->setValue(data.mode_params[3]);
|
||||
|
||||
ui->cbCondition->setCurrentIndex(ui->cbCondition->findData(data.condition));
|
||||
ui->dsb_condParam1->setValue(data.condition_params[0]);
|
||||
ui->dsb_condParam2->setValue(data.condition_params[1]);
|
||||
ui->dsb_condParam3->setValue(data.condition_params[2]);
|
||||
ui->dsb_condParam4->setValue(data.condition_params[3]);
|
||||
}
|
||||
|
||||
void opmap_edit_waypoint_dialog::editWaypoint(mapcontrol::WayPointItem *waypoint_item)
|
||||
{
|
||||
if (!waypoint_item) return;
|
||||
|
||||
this->waypoint_item = waypoint_item;
|
||||
|
||||
original_number = this->waypoint_item->Number();
|
||||
original_locked = (this->waypoint_item->flags() & QGraphicsItem::ItemIsMovable) == 0;
|
||||
original_coord = this->waypoint_item->Coord();
|
||||
original_altitude = this->waypoint_item->Altitude();
|
||||
original_description = this->waypoint_item->Description().simplified();
|
||||
original_type=this->waypoint_item->WPType();
|
||||
original_distance=this->waypoint_item->getRelativeCoord().distance;
|
||||
original_bearing=this->waypoint_item->getRelativeCoord().bearing*180/M_PI;
|
||||
ui->checkBoxLocked->setChecked(original_locked);
|
||||
ui->spinBoxNumber->setValue(original_number);
|
||||
ui->doubleSpinBoxLatitude->setValue(original_coord.Lat());
|
||||
ui->doubleSpinBoxLongitude->setValue(original_coord.Lng());
|
||||
ui->doubleSpinBoxAltitude->setValue(original_altitude);
|
||||
ui->lineEditDescription->setText(original_description);
|
||||
if(original_type==mapcontrol::WayPointItem::absolute)
|
||||
ui->rbAbsolute->setChecked(true);
|
||||
else
|
||||
ui->rbRelative->setChecked(true);
|
||||
ui->doubleSpinBoxBearing->setValue(original_bearing);
|
||||
ui->spinBoxDistance->setValue(original_distance);
|
||||
setupWidgets(ui->rbRelative->isChecked());
|
||||
this->my_waypoint = waypoint_item;
|
||||
loadFromWP(waypoint_item);
|
||||
setupPositionWidgets(ui->rbRelative->isChecked());
|
||||
show();
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,7 @@
|
||||
namespace Ui {
|
||||
class opmap_edit_waypoint_dialog;
|
||||
}
|
||||
using namespace mapcontrol;
|
||||
|
||||
class opmap_edit_waypoint_dialog : public QDialog
|
||||
{
|
||||
@ -50,31 +51,21 @@ public:
|
||||
*/
|
||||
void editWaypoint(mapcontrol::WayPointItem *waypoint_item);
|
||||
|
||||
void loadFromWP(mapcontrol::WayPointItem *waypoint_item);
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
Ui::opmap_edit_waypoint_dialog *ui;
|
||||
|
||||
int original_number;
|
||||
bool original_locked;
|
||||
internals::PointLatLng original_coord;
|
||||
double original_altitude;
|
||||
QString original_description;
|
||||
double original_distance;
|
||||
double original_bearing;
|
||||
|
||||
|
||||
mapcontrol::WayPointItem::wptype original_type;
|
||||
|
||||
mapcontrol::WayPointItem *waypoint_item;
|
||||
|
||||
mapcontrol::WayPointItem * my_waypoint;
|
||||
int saveSettings();
|
||||
|
||||
private slots:
|
||||
|
||||
private slots:
|
||||
void setupWidgets(bool isRelative);
|
||||
void setupModeWidgets();
|
||||
void setupPositionWidgets(bool isRelative);
|
||||
void setupConditionWidgets();
|
||||
void on_pushButtonCancel_clicked();
|
||||
void on_pushButtonRevert_clicked();
|
||||
void on_pushButtonApply_clicked();
|
||||
|
@ -9,8 +9,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>546</width>
|
||||
<height>261</height>
|
||||
<width>571</width>
|
||||
<height>375</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -31,258 +31,604 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Number </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>Position</string>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="layoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>10</y>
|
||||
<width>528</width>
|
||||
<height>266</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbLat">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Latitude </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbLong">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Longitude </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Altitude </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>meters</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Description </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2" colspan="2">
|
||||
<widget class="QLineEdit" name="lineEditDescription"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QSpinBox" name="spinBoxNumber">
|
||||
<property name="maximum">
|
||||
<number>200</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxLatitude">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>7</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-90.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>90.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxLongitude">
|
||||
<property name="decimals">
|
||||
<number>7</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-180.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>180.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxAltitude">
|
||||
<property name="minimum">
|
||||
<double>-5000.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>5000.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QLabel" name="lbDegLong">
|
||||
<property name="text">
|
||||
<string>degrees</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QLabel" name="lbDegLat">
|
||||
<property name="text">
|
||||
<string>degrees</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="Type">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Type </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QRadioButton" name="rbRelative">
|
||||
<property name="text">
|
||||
<string>Relative</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QRadioButton" name="rbAbsolute">
|
||||
<property name="text">
|
||||
<string>Absolute</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QSpinBox" name="spinBoxDistance">
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QLabel" name="lbDistanceMeters">
|
||||
<property name="text">
|
||||
<string>meters</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QLabel" name="lbBearingDeg">
|
||||
<property name="text">
|
||||
<string>degrees</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lbBearing">
|
||||
<property name="text">
|
||||
<string>Bearing </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxBearing">
|
||||
<property name="maximum">
|
||||
<double>360.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lbDistance">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Distance </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QCheckBox" name="checkBoxLocked">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Locked</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Number </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbLat">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Latitude </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_4">
|
||||
<attribute name="title">
|
||||
<string>Mode</string>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="gridLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>-1</x>
|
||||
<y>-1</y>
|
||||
<width>511</width>
|
||||
<height>281</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Mode</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cbMode"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="dsb_modeParam1">
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="modeParam1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>param1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="modeParam2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>param2</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="modeParam3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>param3</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="modeParam4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>param4</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="dsb_modeParam2">
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="dsb_modeParam3">
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="dsb_modeParam4">
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<spacer name="horizontalSpacer_2">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbLong">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Longitude </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>End condition</string>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="gridLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>551</width>
|
||||
<height>291</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="Condition">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Condition</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cbCondition"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="dsb_condParam1">
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="condParam1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>param1</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="condParam2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>param2</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="condParam3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>param3</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="condParam4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>param4</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="dsb_condParam2">
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="dsb_condParam3">
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="dsb_condParam4">
|
||||
<property name="maximum">
|
||||
<double>999999999.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Altitude </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="3">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>meters</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Description </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="2" colspan="4">
|
||||
<widget class="QLineEdit" name="lineEditDescription"/>
|
||||
</item>
|
||||
<item row="0" column="5">
|
||||
<widget class="QCheckBox" name="checkBoxLocked">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::RightToLeft</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Locked</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QSpinBox" name="spinBoxNumber">
|
||||
<property name="maximum">
|
||||
<number>200</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxLatitude">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>7</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-90.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>90.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxLongitude">
|
||||
<property name="decimals">
|
||||
<number>7</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-180.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>180.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="2">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxAltitude">
|
||||
<property name="minimum">
|
||||
<double>-5000.000000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>5000.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QLabel" name="lbDegLong">
|
||||
<property name="text">
|
||||
<string>degrees</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QLabel" name="lbDegLat">
|
||||
<property name="text">
|
||||
<string>degrees</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="Type">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Type </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QRadioButton" name="rbRelative">
|
||||
<property name="text">
|
||||
<string>Relative</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QRadioButton" name="rbAbsolute">
|
||||
<property name="text">
|
||||
<string>Absolute</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="2">
|
||||
<widget class="QSpinBox" name="spinBoxDistance">
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="3">
|
||||
<widget class="QLabel" name="lbDistanceMeters">
|
||||
<property name="text">
|
||||
<string>meters</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QLabel" name="lbBearingDeg">
|
||||
<property name="text">
|
||||
<string>degrees</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="lbBearing">
|
||||
<property name="text">
|
||||
<string>Bearing </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBoxBearing">
|
||||
<property name="maximum">
|
||||
<double>360.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="lbDistance">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Distance </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Page</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
|
@ -32,7 +32,7 @@ opmap_overlay_widget::opmap_overlay_widget(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::opmap_overlay_widget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
}
|
||||
|
||||
opmap_overlay_widget::~opmap_overlay_widget()
|
||||
|
@ -206,14 +206,7 @@ OPMapGadgetWidget::OPMapGadgetWidget(QWidget *parent) : QWidget(parent)
|
||||
connect(m_map, SIGNAL(OnCurrentPositionChanged(internals::PointLatLng)), this, SLOT(OnCurrentPositionChanged(internals::PointLatLng))); // map poisition change signals
|
||||
connect(m_map, SIGNAL(OnTileLoadComplete()), this, SLOT(OnTileLoadComplete())); // tile loading stop signals
|
||||
connect(m_map, SIGNAL(OnTileLoadStart()), this, SLOT(OnTileLoadStart())); // tile loading start signals
|
||||
connect(m_map, SIGNAL(OnMapDrag()), this, SLOT(OnMapDrag())); // map drag signals
|
||||
connect(m_map, SIGNAL(OnMapZoomChanged()), this, SLOT(OnMapZoomChanged())); // map zoom changed
|
||||
connect(m_map, SIGNAL(OnMapTypeChanged(MapType::Types)), this, SLOT(OnMapTypeChanged(MapType::Types))); // map type changed
|
||||
connect(m_map, SIGNAL(OnEmptyTileError(int, core::Point)), this, SLOT(OnEmptyTileError(int, core::Point))); // tile error
|
||||
connect(m_map, SIGNAL(OnTilesStillToLoad(int)), this, SLOT(OnTilesStillToLoad(int))); // tile loading signals
|
||||
// connect(m_map, SIGNAL(WPNumberChanged(int const&,int const&,WayPointItem*)), this, SLOT(WPNumberChanged(int const&,int const&,WayPointItem*)));
|
||||
// connect(m_map, SIGNAL(WPInserted(int const&, WayPointItem*)), this, SLOT(WPInserted(int const&, WayPointItem*)));
|
||||
// connect(m_map, SIGNAL(WPDeleted(int,WayPointItem*)), this, SLOT(WPDeleted(int,WayPointItem*)));
|
||||
connect(m_map,SIGNAL(OnWayPointDoubleClicked(WayPointItem*)),this,SLOT(wpDoubleClickEvent(WayPointItem*)));
|
||||
m_map->SetCurrentPosition(m_home_position.coord); // set the map position
|
||||
m_map->Home->SetCoord(m_home_position.coord); // set the HOME position
|
||||
@ -490,7 +483,7 @@ void OPMapGadgetWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
contextMenu.addSeparator()->setText(tr("Waypoints"));
|
||||
|
||||
contextMenu.addAction(wayPointEditorAct);
|
||||
contextMenu.addAction(addWayPointAct);
|
||||
contextMenu.addAction(addWayPointActFromContextMenu);
|
||||
|
||||
if (m_mouse_waypoint)
|
||||
{ // we have a waypoint under the mouse
|
||||
@ -701,10 +694,6 @@ void OPMapGadgetWidget::zoomChanged(double zoomt, double zoom, double zoomd)
|
||||
zoomAct.at(index0_zoom)->setChecked(true); // set the right-click context menu zoom level
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::OnMapDrag()
|
||||
{
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::OnCurrentPositionChanged(internals::PointLatLng point)
|
||||
{
|
||||
if (!m_widget || !m_map)
|
||||
@ -754,47 +743,6 @@ void OPMapGadgetWidget::OnTileLoadComplete()
|
||||
m_widget->progressBarMap->setVisible(false);
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::OnMapZoomChanged()
|
||||
{
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::OnMapTypeChanged(MapType::Types type)
|
||||
{
|
||||
Q_UNUSED(type);
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::OnEmptyTileError(int zoom, core::Point pos)
|
||||
{
|
||||
Q_UNUSED(zoom);
|
||||
Q_UNUSED(pos);
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::WPNumberChanged(int const &oldnumber, int const &newnumber, WayPointItem *waypoint)
|
||||
{
|
||||
Q_UNUSED(oldnumber);
|
||||
Q_UNUSED(newnumber);
|
||||
Q_UNUSED(waypoint);
|
||||
}
|
||||
|
||||
/**
|
||||
TODO: slot to do something upon Waypoint insertion
|
||||
*/
|
||||
void OPMapGadgetWidget::WPInserted(int const &number, WayPointItem *waypoint)
|
||||
{
|
||||
Q_UNUSED(number);
|
||||
Q_UNUSED(waypoint);
|
||||
}
|
||||
|
||||
/**
|
||||
TODO: slot to do something upon Waypoint deletion
|
||||
*/
|
||||
void OPMapGadgetWidget::WPDeleted(int const &number, WayPointItem *waypoint)
|
||||
{
|
||||
Q_UNUSED(number);
|
||||
Q_UNUSED(waypoint);
|
||||
}
|
||||
|
||||
|
||||
void OPMapGadgetWidget::on_toolButtonZoomP_clicked()
|
||||
{
|
||||
QMutexLocker locker(&m_map_mutex);
|
||||
@ -1334,11 +1282,16 @@ void OPMapGadgetWidget::createActions()
|
||||
wayPointEditorAct->setEnabled(true); // temporary
|
||||
connect(wayPointEditorAct, SIGNAL(triggered()), this, SLOT(onOpenWayPointEditorAct_triggered()));
|
||||
|
||||
addWayPointAct = new QAction(tr("&Add waypoint"), this);
|
||||
addWayPointAct->setShortcut(tr("Ctrl+A"));
|
||||
addWayPointAct->setStatusTip(tr("Add waypoint"));
|
||||
connect(addWayPointAct, SIGNAL(triggered()), this, SLOT(onAddWayPointAct_triggered()));
|
||||
this->addAction(addWayPointAct);
|
||||
addWayPointActFromContextMenu = new QAction(tr("&Add waypoint"), this);
|
||||
addWayPointActFromContextMenu->setShortcut(tr("Ctrl+A"));
|
||||
addWayPointActFromContextMenu->setStatusTip(tr("Add waypoint"));
|
||||
connect(addWayPointActFromContextMenu, SIGNAL(triggered()), this, SLOT(onAddWayPointAct_triggeredFromContextMenu()));
|
||||
|
||||
addWayPointActFromThis = new QAction(tr("&Add waypoint"), this);
|
||||
addWayPointActFromThis->setShortcut(tr("Ctrl+A"));
|
||||
addWayPointActFromThis->setStatusTip(tr("Add waypoint"));
|
||||
connect(addWayPointActFromThis, SIGNAL(triggered()), this, SLOT(onAddWayPointAct_triggeredFromThis()));
|
||||
this->addAction(addWayPointActFromThis);
|
||||
|
||||
editWayPointAct = new QAction(tr("&Edit waypoint"), this);
|
||||
editWayPointAct->setShortcut(tr("Ctrl+E"));
|
||||
@ -1738,8 +1691,16 @@ void OPMapGadgetWidget::onOpenWayPointEditorAct_triggered()
|
||||
{
|
||||
waypoint_editor_dialog.show();
|
||||
}
|
||||
void OPMapGadgetWidget::onAddWayPointAct_triggeredFromContextMenu()
|
||||
{
|
||||
onAddWayPointAct_triggered(m_context_menu_lat_lon);
|
||||
}
|
||||
void OPMapGadgetWidget::onAddWayPointAct_triggeredFromThis()
|
||||
{
|
||||
onAddWayPointAct_triggered(lastLatLngMouse);
|
||||
}
|
||||
|
||||
void OPMapGadgetWidget::onAddWayPointAct_triggered()
|
||||
void OPMapGadgetWidget::onAddWayPointAct_triggered(internals::PointLatLng coord)
|
||||
{
|
||||
if (!m_widget || !m_map)
|
||||
return;
|
||||
@ -1747,20 +1708,11 @@ void OPMapGadgetWidget::onAddWayPointAct_triggered()
|
||||
if (m_map_mode != Normal_MapMode)
|
||||
return;
|
||||
|
||||
// m_waypoint_list_mutex.lock();
|
||||
|
||||
// create a waypoint on the map at the last known mouse position
|
||||
internals::PointLatLng coord;
|
||||
if(this->contextMenu.isVisible())
|
||||
coord = m_context_menu_lat_lon;
|
||||
else
|
||||
coord=lastLatLngMouse;
|
||||
m_map->WPCreate(coord, 0, "");
|
||||
|
||||
|
||||
//wp->map_wp_item->picture.load(QString::fromUtf8(":/opmap/images/waypoint_marker1.png"));
|
||||
//wp->map_wp_item->picture.load(QString::fromUtf8(":/opmap/images/waypoint_marker2.png"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -153,19 +153,8 @@ private slots:
|
||||
void OnCurrentPositionChanged(internals::PointLatLng point);
|
||||
void OnTileLoadComplete();
|
||||
void OnTileLoadStart();
|
||||
void OnMapDrag();
|
||||
void OnMapZoomChanged();
|
||||
void OnMapTypeChanged(MapType::Types type);
|
||||
void OnEmptyTileError(int zoom, core::Point pos);
|
||||
void OnTilesStillToLoad(int number);
|
||||
|
||||
/**
|
||||
* Unused for now, hooks for future waypoint support
|
||||
*/
|
||||
void WPNumberChanged(int const& oldnumber,int const& newnumber, WayPointItem* waypoint);
|
||||
void WPInserted(int const& number, WayPointItem* waypoint);
|
||||
void WPDeleted(int const& number, WayPointItem* waypoint);
|
||||
|
||||
/**
|
||||
* @brief mouse right click context menu signals
|
||||
*/
|
||||
@ -190,7 +179,9 @@ private slots:
|
||||
void onFollowUAVheadingAct_toggled(bool checked);
|
||||
|
||||
void onOpenWayPointEditorAct_triggered();
|
||||
void onAddWayPointAct_triggered();
|
||||
void onAddWayPointAct_triggeredFromContextMenu();
|
||||
void onAddWayPointAct_triggeredFromThis();
|
||||
void onAddWayPointAct_triggered(internals::PointLatLng coord);
|
||||
void onEditWayPointAct_triggered();
|
||||
void onLockWayPointAct_triggered();
|
||||
void onDeleteWayPointAct_triggered();
|
||||
@ -280,7 +271,8 @@ private:
|
||||
QAction *followUAVheadingAct;
|
||||
|
||||
QAction *wayPointEditorAct;
|
||||
QAction *addWayPointAct;
|
||||
QAction *addWayPointActFromThis;
|
||||
QAction *addWayPointActFromContextMenu;
|
||||
QAction *editWayPointAct;
|
||||
QAction *lockWayPointAct;
|
||||
QAction *deleteWayPointAct;
|
||||
|
@ -64,21 +64,25 @@ void pathPlanManager::on_WPInserted(int wp_number, WayPointItem * wp)
|
||||
data.mode=PathAction::MODE_FLYENDPOINT;
|
||||
data.condition=PathAction::ENDCONDITION_NONE;
|
||||
data.velocity=0;
|
||||
wp->customData().setValue(data);
|
||||
QVariant var;
|
||||
var.setValue(data);
|
||||
wp->setData(0,var);
|
||||
refreshOverlays();
|
||||
}
|
||||
|
||||
void pathPlanManager::on_WPValuesChanged(WayPointItem * wp)
|
||||
{
|
||||
}
|
||||
|
||||
//typedef enum { MODE_FLYENDPOINT=0, MODE_FLYVECTOR=1, MODE_FLYCIRCLERIGHT=2,
|
||||
//MODE_FLYCIRCLELEFT=3, MODE_DRIVEENDPOINT=4, MODE_DRIVEVECTOR=5, MODE_DRIVECIRCLELEFT=6,
|
||||
//MODE_DRIVECIRCLERIGHT=7, MODE_FIXEDATTITUDE=8, MODE_SETACCESSORY=9, MODE_DISARMALARM=10 } ModeOptions;
|
||||
void pathPlanManager::refreshOverlays()
|
||||
{
|
||||
QMutexLocker locker(&wplistmutex);
|
||||
myMap->deleteAllOverlays();
|
||||
foreach(WayPointItem * wp,*waypoints)
|
||||
{
|
||||
customData data=wp->customData().value<customData>();
|
||||
customData data=wp->data(0).value<customData>();
|
||||
switch(data.mode)
|
||||
{
|
||||
case PathAction::MODE_FLYENDPOINT:
|
||||
@ -92,10 +96,14 @@ void pathPlanManager::refreshOverlays()
|
||||
break;
|
||||
case PathAction::MODE_FLYCIRCLERIGHT:
|
||||
case PathAction::MODE_DRIVECIRCLERIGHT:
|
||||
if(wp->Number()==0)
|
||||
myMap->WPCircleCreate((HomeItem*)myMap->Home,wp,true);
|
||||
myMap->WPCircleCreate(findWayPointNumber(wp->Number()-1),wp,true);
|
||||
break;
|
||||
case PathAction::MODE_FLYCIRCLELEFT:
|
||||
case PathAction::MODE_DRIVECIRCLELEFT:
|
||||
if(wp->Number()==0)
|
||||
myMap->WPCircleCreate((HomeItem*)myMap->Home,wp,false);
|
||||
myMap->WPCircleCreate(findWayPointNumber(wp->Number()-1),wp,false);
|
||||
break;
|
||||
default:
|
||||
|
@ -34,22 +34,7 @@
|
||||
#include "waypoint.h"
|
||||
#include "QMutexLocker"
|
||||
#include "QPointer"
|
||||
namespace mapcontrol
|
||||
{
|
||||
struct customData
|
||||
{
|
||||
float velocity;
|
||||
int mode;
|
||||
float mode_params[4];
|
||||
int condition;
|
||||
float condition_params[4];
|
||||
int command;
|
||||
int jumpdestination;
|
||||
int errordestination;
|
||||
};
|
||||
|
||||
}
|
||||
Q_DECLARE_METATYPE(mapcontrol::customData)
|
||||
namespace Ui {
|
||||
class pathPlanManager;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user