修改 hold模式下的速度显示

This commit is contained in:
hm
2022-05-09 18:35:25 +08:00
parent b8a8697a4d
commit f3c632ec4d
4 changed files with 14 additions and 9 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ TrailItem::TrailItem(internals::PointLatLng const & coord, int const & altitude,
QString coord_str = " " + QString::number(coord.Lat(), 'f', 6) + " " + QString::number(coord.Lng(), 'f', 6);
setToolTip(QString(tr("Position:") + "%1\n" + tr("Altitude:") + "%2\n" + tr("Time:") + "%3").arg(coord_str).arg(QString::number(altitude)).arg(time.toString()));
this->setZValue(3);
this->setZValue(4);
}
+1 -1
View File
@@ -35,7 +35,7 @@ TrailLineItem::TrailLineItem(internals::PointLatLng const & coord1, internals::P
pen.setWidth(2);
this->setPen(pen);
this->setZValue(3);
this->setZValue(4);
}
+6 -1
View File
@@ -391,21 +391,27 @@ void WayPointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
switch ((int32_t)property.param1) {
case 0:
_h.append(tr("hold\n"));
_v = tr("");
break;
case -1:
_h.append(tr("cas\n"));
_v = tr("Speed: %1m/s").arg(QString::number(property.param4,'f',0));
break;
case -2:
_h.append(tr("Vz\n"));
_v = tr("Speed: %1m/s").arg(QString::number(property.param4,'f',0));
break;
case -3:
_h.append(tr("onAB\n"));
_v = tr("Speed: %1m/s").arg(QString::number(property.param4,'f',0));
break;
case -4:
_h.append(tr("offAB\n"));
_v = tr("Speed: %1m/s").arg(QString::number(property.param4,'f',0));
break;
default:
_h.append(tr("unknow\n"));
_v = tr("Speed: %1m/s").arg(QString::number(property.param4,'f',0));
break;
}
}
@@ -414,7 +420,6 @@ void WayPointItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
_h.append(tr("\n"));
}
_v = tr("Speed: %1m/s").arg(QString::number(property.param4,'f',0));
_h.append(tr("Height: %1m\n%2").arg(QString::number(property.z,'f',0)).arg(_v));
painter->drawText(QRectF(rect.x() + 2,rect.y()+2,rect.width() - 4,rect.height() - 4),Qt::AlignLeft | Qt::AlignVCenter,_h);
}
+6 -6
View File
@@ -38,11 +38,11 @@ WayPointLine::WayPointLine(WayPointItem *from, WayPointItem *to, MapGraphicItem
connect(from, SIGNAL(aboutToBeDeleted(WayPointItem *)), this, SLOT(waypointdeleted()));
connect(to, SIGNAL(aboutToBeDeleted(WayPointItem *)), this, SLOT(waypointdeleted()));
if (myColor == Qt::green) {
this->setZValue(2);
this->setZValue(1);
} else if (myColor == Qt::yellow) {
this->setZValue(2);
this->setZValue(1);
} else if (myColor == Qt::red) {
this->setZValue(2);
this->setZValue(1);
}
connect(map, SIGNAL(childSetOpacity(qreal)), this, SLOT(setOpacitySlot(qreal)));
@@ -58,11 +58,11 @@ WayPointLine::WayPointLine(HomeItem *from, WayPointItem *to, MapGraphicItem *map
connect(to, SIGNAL(localPositionChanged(QPointF, WayPointItem *)), this, SLOT(refreshLocations()));
connect(to, SIGNAL(aboutToBeDeleted(WayPointItem *)), this, SLOT(waypointdeleted()));
if (myColor == Qt::green) {
this->setZValue(2);
this->setZValue(1);
} else if (myColor == Qt::yellow) {
this->setZValue(2);
this->setZValue(1);
} else if (myColor == Qt::red) {
this->setZValue(2);
this->setZValue(1);
}
connect(map, SIGNAL(childSetOpacity(qreal)), this, SLOT(setOpacitySlot(qreal)));