添加飞控新修改的

This commit is contained in:
hm
2022-06-08 17:58:20 +08:00
parent df0c93f724
commit 51b5ba03ff
11 changed files with 71 additions and 22 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ geoFencecircle::geoFencecircle(int group, bool inclusion, int version, internals
{
this->setAcceptHoverEvents(true);
this->setZValue(3);
this->setZValue(2);
//this->setFlag(QGraphicsEllipseItem::ItemIsMovable, true);
//this->setFlag(QGraphicsEllipseItem::ItemIgnoresTransformations, true);
+1 -1
View File
@@ -8,7 +8,7 @@ geoFenceitem::geoFenceitem(int group, bool inclusion, int version, internals::Po
QGraphicsPolygonItem(map), number(0) , coord(coord), m_brush(color), m_map(map), dashed(dashed), lineWidth(width)
{
this->setAcceptHoverEvents(true);
this->setZValue(3);
this->setZValue(2);
//this->setFlag(QGraphicsPolygonItem::ItemIsMovable, true);
//this->setFlag(QGraphicsPolygonItem::ItemIgnoresTransformations, true);
+15 -9
View File
@@ -1742,18 +1742,24 @@ void OPMapWidget::setWPLock(bool const & lock)
void OPMapWidget::WPSetCurrent(int seq)
{
int group = seq /1000 + 3;
int num = seq %1000;
groupchanged(group);
foreach(QGraphicsItem * i, map->childItems()) {
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
if (w) {
if(w->Number() == seq)
if(w->MissionType() == group)
{
w->WPSetCurrent(true);
//qDebug() << "map WPSetCurrent" << seq;
}
else
{
w->WPSetCurrent(false);
if(w->Number() == num)
{
w->WPSetCurrent(true);
}
else
{
w->WPSetCurrent(false);
}
}
}
}
@@ -2741,7 +2747,7 @@ void OPMapWidget::groupchanged(int value)
}
else//飞行界面
{
qDebug() << "show current group" << currentMissionType;
//qDebug() << "show current group" << currentMissionType;
if(currentMissionType > 6)
{
+20 -1
View File
@@ -195,8 +195,17 @@ void UAVItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q
painter->drawText(QRectF(rect.x() + 2,rect.y()+2,rect.width() - 4,rect.height() - 4),Qt::AlignLeft | Qt::AlignVCenter,_h);
painter->restore();
}
painter->save();
painter->drawRect(boundingRect());
painter->restore();
}
@@ -340,7 +349,17 @@ QRectF UAVItem::boundingRect() const
return QRectF(-boundingRectSize, -boundingRectSize, 2 * boundingRectSize, 2 * boundingRectSize);
}
} else {
return QRectF(-pic.width() * 2, -pic.height() * 2, pic.width() * 4, pic.height() * 4);
if(isShowTip)
{
return QRectF(-pic.width() * 1.3, -pic.height() * 1.3, pic.width() * 2.6, pic.height() * 2.6);
}
else
{
return QRectF(-pic.width() * 0.5, -pic.height() * 0.5, pic.width() * 1, pic.height() * 1);
}
}
}
+2 -1
View File
@@ -515,7 +515,8 @@ void WayPointItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
if(Command() < MAV_CMD::MAV_CMD_NAV_LAST)
{
emit SetCurrent(this->Number());
//不允许点击界面修改航点
//emit SetCurrent(this->Number());
}
}
}
+1 -1
View File
@@ -199,7 +199,7 @@ WayPointSetting::WayPointSetting(MapGraphicItem *map, QColor background) : myMap
QRectF WayPointSetting::boundingRect() const //鼠标可以操作的大小
{
qDebug() << rect;
//qDebug() << rect;
return rect;
//return QRectF(0,0,100,370);