This commit is contained in:
2020-04-13 21:37:30 +08:00
parent 0e2a05af55
commit 7db85cc4c3
13 changed files with 139 additions and 14 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ Configuration::Configuration()
EmptyTileBorders = QPen(Qt::white);
ScalePen = QPen(Qt::blue);
SelectionPen = QPen(Qt::blue);
DragButton = Qt::LeftButton;//使用键拖动
DragButton = Qt::RightButton;//使用you键拖动
}
void Configuration::SetAccessMode(core::AccessMode::Types const & type)
+4
View File
@@ -142,6 +142,10 @@ void GPSItem::SetTrailType(const UAVTrailType::Types &value)
if (trailtype == UAVTrailType::ByTimeElapsed) {
timer.restart();
}
//设置航迹的刷新放式,这个需要改一改,改成来一个坐标刷新一次,如果坐标一致不刷新
}
void GPSItem::SetShowTrail(const bool &value)
{
+1 -1
View File
@@ -45,7 +45,7 @@ HomeItem::HomeItem(MapGraphicItem *map, OPMapWidget *parent) : safe(true), map(m
connect(map, SIGNAL(childSetOpacity(qreal)), this, SLOT(setOpacitySlot(qreal)));
}
void HomeItem::RefreshToolTip()
void HomeItem::RefreshToolTip()//不必要
{
QString coord_str = " " + QString::number(coord.Lat(), 'f', 6) + " " + QString::number(coord.Lng(), 'f', 6);
+3
View File
@@ -181,6 +181,9 @@ void MapGraphicItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
}
void MapGraphicItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
//qDebug() << "MapGraphicItem" << "press";
if (!IsMouseOverMarker()) {
if (event->button() == config->DragButton && CanDragMap() && !((event->modifiers() == Qt::ShiftModifier) || (event->modifiers() == Qt::ControlModifier))) {
core->mouseDown.SetX(event->pos().x());
+18 -1
View File
@@ -46,7 +46,9 @@ OPMapWidget::OPMapWidget(QWidget *parent, Configuration *config) : QGraphicsView
config->SetCacheLocation("./maps/");
map = new MapGraphicItem(core, config);
mscene.addItem(map);
mscene.addItem(map);//添加图层
this->setScene(&mscene);
Home = new HomeItem(map, this);
Home->setParentItem(map);
@@ -239,6 +241,10 @@ void OPMapWidget::mouseMoveEvent(QMouseEvent *event)
p = map->mapFromParent(p);
currentmouseposition = map->FromLocalToLatLng(p.x(), p.y());
emit EmitCurrentMousePosition(currentmouseposition);
}
@@ -246,6 +252,17 @@ void OPMapWidget::mouseMoveEvent(QMouseEvent *event)
void OPMapWidget::mousePressEvent(QMouseEvent *event)
{
QGraphicsView::mousePressEvent(event);
QPointF p = event->pos();
p = map->mapFromParent(p);
internals::PointLatLng LatLng;
LatLng = map->FromLocalToLatLng(p.x(), p.y());
qDebug() << "OPMapWidget" << QString::number(LatLng.Lat(),'f',8) << QString::number(LatLng.Lng(),'f',8);
emit MousePressEvent(event);
}
+2 -1
View File
@@ -41,7 +41,8 @@ void TrailItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
Q_UNUSED(widget);
painter->setBrush(m_brush);
painter->drawEllipse(-2, -2, 4, 4);
//painter->drawEllipse(-2, -2, 4, 4);
painter->drawPoint(0,0);
}
QRectF TrailItem::boundingRect() const
{
+2 -2
View File
@@ -217,7 +217,7 @@ void UAVItem::SetCAS(double CAS_mps)
this->CAS_mps = CAS_mps;
}
void UAVItem::SetGroundspeed(double vNED[3], int m_maxUpdateRate_ms)
void UAVItem::SetGroundspeed(double vNED[3], int m_maxUpdateRate_ms)//这个应该没有任何意义
{
this->vNED[0] = vNED[0];
this->vNED[1] = vNED[1];
@@ -398,7 +398,7 @@ void UAVItem::SetShowUAVInfo(bool const & value)
update();
}
void UAVItem::generateArrowhead()
void UAVItem::generateArrowhead()//不需要
{
qreal arrowSize = 10;
+41
View File
@@ -484,3 +484,44 @@ void WayPointItem::setFlag(QGraphicsItem::GraphicsItemFlag flag, bool enabled)
int WayPointItem::snumber = 0;
}
/*
float param1;
float param2;
float param3;
float param4;
int32_t x; PARAM5 / local: x position in meters * 1e4, global: latitude in degrees * 10^7*
int32_t y; PARAM6 / y position: local: x position in meters * 1e4, global: longitude in degrees *10^7
float z; PARAM7 / z position: global: altitude in meters (relative or absolute, depending on frame.
uint16_t seq; Waypoint ID (sequence number). Starts at zero. Increases monotonically for each waypoint, no gaps in the sequence (0,1,2,3,4)
uint16_t command; /*< The scheduled action for the waypoint.
uint8_t target_system; /*< System ID*
uint8_t target_component; /*< Component ID*
uint8_t frame; /*< The coordinate system of the waypoint.
uint8_t current; /*< false:0, true:1
uint8_t autocontinue; /*< Autocontinue to next waypoint
uint8_t mission_type; /*< Mission type.
*/