b
This commit is contained in:
@@ -31,11 +31,15 @@
|
||||
#include "waypointitem.h"
|
||||
#include "QDir"
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include "QTextCodec"
|
||||
|
||||
|
||||
namespace mapcontrol {
|
||||
OPMapWidget::OPMapWidget(QWidget *parent, Configuration *config) : QGraphicsView(parent), configuration(config), UAV(0), GPS(0), Home(0)
|
||||
, followmouse(true), compass(0), showuav(false), showhome(false), diagTimer(0), diagGraphItem(0), showDiag(false), overlayOpacity(1),isWPCreate(false)
|
||||
{
|
||||
QTextCodec::setCodecForLocale(QTextCodec::codecForName( "utf8" ));
|
||||
|
||||
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
||||
core = new internals::Core;
|
||||
|
||||
@@ -1475,17 +1479,18 @@ void OPMapWidget::updateMessage(void)
|
||||
double distance;
|
||||
|
||||
|
||||
/*
|
||||
WayPointItem *Last = nullptr;
|
||||
|
||||
//WayPointItem *Last = nullptr;
|
||||
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
if (w)
|
||||
{
|
||||
/*
|
||||
if(Last != nullptr)
|
||||
{
|
||||
|
||||
distance += internals::PureProjection::DistanceBetweenLatLng(Last->Coord(),w->Coord()) * 10e2;
|
||||
//distance += internals::PureProjection::DistanceBetweenLatLng(Last->Coord(),w->Coord()) * 10e2;
|
||||
}
|
||||
|
||||
qDebug() << "distance" << distance
|
||||
@@ -1493,22 +1498,25 @@ void OPMapWidget::updateMessage(void)
|
||||
<< w->Number();
|
||||
|
||||
Last = w;
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
delete Last;
|
||||
Last = nullptr;
|
||||
*/
|
||||
//delete Last;
|
||||
//Last = nullptr;
|
||||
|
||||
|
||||
|
||||
|
||||
waypointMessage.clear();
|
||||
|
||||
waypointMessage.append(tr("总航程:%1\t").arg(QString::number(distance)));
|
||||
waypointMessage.append(tr("最远航点:%1\t").arg(QString::number(distance)));
|
||||
waypointMessage.append(tr("最远距离:%1\t").arg(QString::number(distance)));
|
||||
waypointMessage.append(tr("预计飞行时间:%1\t").arg(QString::number(distance)));
|
||||
waypointMessage.append("123456987");
|
||||
|
||||
//waypointMessage.append(tr("总航程:%1\t").arg(QString::number(distance)));
|
||||
// waypointMessage.append(tr("最远航点:%1\t").arg(QString::number(distance)));
|
||||
//waypointMessage.append(tr("最远距离:%1\t").arg(QString::number(distance)));
|
||||
//waypointMessage.append(tr("预计飞行时间:%1\t").arg(QString::number(distance)));
|
||||
|
||||
emit showMessage(waypointMessage);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user