修改航线从缓存读取,多任务模式

This commit is contained in:
hm
2022-06-09 17:50:48 +08:00
parent 51b5ba03ff
commit aa199e173c
22 changed files with 989 additions and 688 deletions
+24 -19
View File
@@ -49,7 +49,7 @@ UAVItem::UAVItem(MapGraphicItem *map, OPMapWidget *parent, QString uavPic ,uint8
localposition = map->FromLatLngToLocal(mapwidget->CurrentPosition());
this->setPos(localposition.X(), localposition.Y());
this->setZValue(4);
this->setZValue(7);
trail = new QGraphicsItemGroup(this);
trail->setParentItem(map);
trailLine = new QGraphicsItemGroup(this);
@@ -99,11 +99,11 @@ void UAVItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q
{
if (isSelected)
{
this->setZValue(5);
this->setZValue(6);
}
else
{
this->setZValue(4);
this->setZValue(7);
}
}
@@ -200,11 +200,11 @@ void UAVItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q
}
/*
painter->save();
painter->drawRect(boundingRect());
painter->restore();
*/
}
@@ -230,23 +230,28 @@ void UAVItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
isSelected = true;
//查找所有
foreach(QGraphicsItem * i, map->childItems()) {
UAVItem *uav = qgraphicsitem_cast<UAVItem *>(i);
if (uav) {
if(uav != this)
{
uav->setSelect(false);
if(isSelected == false)
{
isSelected = true;
//查找所有
foreach(QGraphicsItem * i, map->childItems()) {
UAVItem *uav = qgraphicsitem_cast<UAVItem *>(i);
if (uav) {
if(uav != this)
{
uav->setSelect(false);
}
}
}
}
qDebug() << "emit select" << sysid << compid;
emit selected(sysid,compid);
qDebug() << "emit select" << sysid << compid;
emit selected(sysid,compid);
isShowTip = (isShowTip)?(false):(true);
isShowTip = (isShowTip)?(false):(true);
update();
emit vehicleChanged(sysid,compid);
update();
}
}
//QGraphicsItem::mouseReleaseEvent(event);
@@ -284,7 +289,7 @@ void UAVItem::setEdit(bool value)
}
else
{
this->setZValue(4);
this->setZValue(7);
}
}