修正地图中的类型错误
This commit is contained in:
@@ -842,6 +842,7 @@ WayPointItem *OPMapWidget::WPCreate()
|
||||
emit WPCreated(position, item);
|
||||
setSelectedWP(item);
|
||||
item->emitWPProperty();
|
||||
item->setisShowTip(isShowTip);
|
||||
return item;
|
||||
}
|
||||
WayPointItem *OPMapWidget::magicWPCreate()
|
||||
@@ -856,6 +857,7 @@ WayPointItem *OPMapWidget::magicWPCreate()
|
||||
item->SetMissionType(currentGroup);
|
||||
setSelectedWP(item);
|
||||
item->emitWPProperty();
|
||||
item->setisShowTip(isShowTip);
|
||||
return item;
|
||||
}
|
||||
void OPMapWidget::WPCreate(WayPointItem *item)
|
||||
@@ -868,6 +870,7 @@ void OPMapWidget::WPCreate(WayPointItem *item)
|
||||
setOverlayOpacity(overlayOpacity);
|
||||
setSelectedWP(item);
|
||||
item->emitWPProperty();
|
||||
item->setisShowTip(isShowTip);
|
||||
}
|
||||
WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int const & altitude)
|
||||
{
|
||||
@@ -884,6 +887,7 @@ WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int co
|
||||
setOverlayOpacity(overlayOpacity);
|
||||
setSelectedWP(item);
|
||||
item->emitWPProperty();
|
||||
item->setisShowTip(isShowTip);
|
||||
return item;
|
||||
}
|
||||
WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int const & altitude, QString const & description)
|
||||
@@ -901,6 +905,7 @@ WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int co
|
||||
setOverlayOpacity(overlayOpacity);
|
||||
setSelectedWP(item);
|
||||
item->emitWPProperty();
|
||||
item->setisShowTip(isShowTip);
|
||||
return item;
|
||||
}
|
||||
WayPointItem *OPMapWidget::WPCreate(const distBearingAltitude &relativeCoord, const QString &description)
|
||||
@@ -918,6 +923,7 @@ WayPointItem *OPMapWidget::WPCreate(const distBearingAltitude &relativeCoord, co
|
||||
setOverlayOpacity(overlayOpacity);
|
||||
setSelectedWP(item);
|
||||
item->emitWPProperty();
|
||||
item->setisShowTip(isShowTip);
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -1009,6 +1015,7 @@ void OPMapWidget::WPInsert()
|
||||
|
||||
setSelectedWP(item);
|
||||
item->emitWPProperty();//这个没有执行
|
||||
item->setisShowTip(isShowTip);
|
||||
|
||||
//调整编号
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
@@ -1060,6 +1067,7 @@ void OPMapWidget::WPInsert(WayPointItem *item, const int &position)
|
||||
item->SetMissionType(currentGroup);
|
||||
emit WPInserted(position, item);
|
||||
setOverlayOpacity(overlayOpacity);
|
||||
item->setisShowTip(isShowTip);
|
||||
}
|
||||
WayPointItem *OPMapWidget::WPInsert(internals::PointLatLng const & coord, int const & altitude, const int &position)
|
||||
{
|
||||
@@ -1071,6 +1079,7 @@ WayPointItem *OPMapWidget::WPInsert(internals::PointLatLng const & coord, int co
|
||||
item->SetMissionType(currentGroup);
|
||||
emit WPInserted(position, item);
|
||||
setOverlayOpacity(overlayOpacity);
|
||||
item->setisShowTip(isShowTip);
|
||||
return item;
|
||||
}
|
||||
WayPointItem *OPMapWidget::WPInsert(internals::PointLatLng const & coord, int const & altitude, QString const & description, const int &position)
|
||||
@@ -1094,6 +1103,7 @@ WayPointItem *OPMapWidget::WPInsert(internals::PointLatLng const & coord, int co
|
||||
emit WPValuesChanged(item);
|
||||
}
|
||||
setOverlayOpacity(overlayOpacity);
|
||||
item->setisShowTip(isShowTip);
|
||||
return item;
|
||||
}
|
||||
WayPointItem *OPMapWidget::WPInsert(distBearingAltitude const & relative, QString const & description, const int &position)
|
||||
@@ -1106,6 +1116,7 @@ WayPointItem *OPMapWidget::WPInsert(distBearingAltitude const & relative, QStrin
|
||||
item->SetMissionType(currentGroup);
|
||||
emit WPInserted(position, item);
|
||||
setOverlayOpacity(overlayOpacity);
|
||||
item->setisShowTip(isShowTip);
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -2175,12 +2186,11 @@ void OPMapWidget::groupchanged(int value)
|
||||
|
||||
//一下这里判断有问题,有bug
|
||||
|
||||
/*
|
||||
|
||||
//将不是当前的全部变成灰色,当前的显示
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
if (w) {
|
||||
qDebug() << "missiontype" << w->MissionType();
|
||||
if(w->MissionType() == currentMissionType)
|
||||
{
|
||||
w->setisActive(true);
|
||||
@@ -2197,8 +2207,22 @@ void OPMapWidget::groupchanged(int value)
|
||||
WayPointLine *l = qgraphicsitem_cast<WayPointLine *>(i);
|
||||
if (l) {
|
||||
|
||||
WayPointItem *from = qgraphicsitem_cast<WayPointItem *>(l->WPLineFrom());
|
||||
WayPointItem *to = qgraphicsitem_cast<WayPointItem *>(l->WPLineTo());
|
||||
WayPointItem *from = nullptr;
|
||||
WayPointItem *to = nullptr;
|
||||
|
||||
QGraphicsItem *_f = l->WPLineFrom();
|
||||
QGraphicsItem *_t = l->WPLineTo();
|
||||
|
||||
if(_f)
|
||||
{
|
||||
from = qgraphicsitem_cast<WayPointItem *>(_f);
|
||||
}
|
||||
|
||||
if(_t)
|
||||
{
|
||||
to = qgraphicsitem_cast<WayPointItem *>(_t);
|
||||
}
|
||||
|
||||
|
||||
if((from)||(to))
|
||||
{
|
||||
@@ -2215,7 +2239,7 @@ void OPMapWidget::groupchanged(int value)
|
||||
}
|
||||
else if(to)
|
||||
{
|
||||
if(from->MissionType() == currentMissionType)
|
||||
if(to->MissionType() == currentMissionType)
|
||||
{
|
||||
l->setisActive(true);
|
||||
}
|
||||
@@ -2226,12 +2250,12 @@ void OPMapWidget::groupchanged(int value)
|
||||
}
|
||||
else//不知道这句对不对
|
||||
{
|
||||
l->setisActive(false);
|
||||
//l->setisActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2253,7 +2277,6 @@ void OPMapWidget::WPGroup(int value)
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
if (w) {
|
||||
qDebug() << "missiontype" << w->MissionType();
|
||||
if(w->MissionType() == currentGroup)
|
||||
{
|
||||
w->setisActive(true);
|
||||
@@ -2270,8 +2293,21 @@ void OPMapWidget::WPGroup(int value)
|
||||
WayPointLine *l = qgraphicsitem_cast<WayPointLine *>(i);
|
||||
if (l) {
|
||||
|
||||
WayPointItem *from = qgraphicsitem_cast<WayPointItem *>(l->WPLineFrom());
|
||||
WayPointItem *to = qgraphicsitem_cast<WayPointItem *>(l->WPLineTo());
|
||||
WayPointItem *from = nullptr;
|
||||
WayPointItem *to = nullptr;
|
||||
|
||||
QGraphicsItem *_f = l->WPLineFrom();
|
||||
QGraphicsItem *_t = l->WPLineTo();
|
||||
|
||||
if(_f)
|
||||
{
|
||||
from = qgraphicsitem_cast<WayPointItem *>(_f);
|
||||
}
|
||||
|
||||
if(_t)
|
||||
{
|
||||
to = qgraphicsitem_cast<WayPointItem *>(_t);
|
||||
}
|
||||
|
||||
if((from)||(to))
|
||||
{
|
||||
@@ -2288,7 +2324,7 @@ void OPMapWidget::WPGroup(int value)
|
||||
}
|
||||
else if(to)
|
||||
{
|
||||
if(from->MissionType() == currentGroup)
|
||||
if(to->MissionType() == currentGroup)
|
||||
{
|
||||
l->setisActive(true);
|
||||
}
|
||||
@@ -2299,7 +2335,7 @@ void OPMapWidget::WPGroup(int value)
|
||||
}
|
||||
else//不知道这句对不对
|
||||
{
|
||||
l->setisActive(false);
|
||||
//l->setisActive(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2429,6 +2465,7 @@ void OPMapWidget::receivedPoint(float param1,float param2,float param3,float par
|
||||
|
||||
|
||||
Item->emitWPProperty();
|
||||
Item->setisShowTip(isShowTip);
|
||||
|
||||
qDebug() << "waypoint not exist:" << Item->Number() << seq+1 <<currentGroup << mission_type;
|
||||
|
||||
@@ -2591,6 +2628,8 @@ void OPMapWidget::getAllPoints(int group)
|
||||
|
||||
void OPMapWidget::WPShowTip(bool flag)
|
||||
{
|
||||
isShowTip = flag;
|
||||
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
if (w)
|
||||
@@ -2598,6 +2637,8 @@ void OPMapWidget::WPShowTip(bool flag)
|
||||
w->setisShowTip(flag);
|
||||
}
|
||||
}
|
||||
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user