b
This commit is contained in:
@@ -706,12 +706,16 @@ void OPMapWidget::ConnectWP(WayPointItem *item)
|
||||
connect(this, SIGNAL(setWPProperty(float,float,float,float,int32_t,int32_t,float,uint16_t,uint16_t,uint16_t,uint8_t,uint8_t,uint8_t,uint8_t,uint8_t,uint8_t)),
|
||||
item, SLOT(setWPProperty(float,float,float,float,int32_t,int32_t,float,uint16_t,uint16_t,uint16_t,uint8_t,uint8_t,uint8_t,uint8_t,uint8_t,uint8_t)),Qt::DirectConnection);
|
||||
|
||||
connect(item, SIGNAL(WPFollowPrevious(bool,WayPointItem*)),
|
||||
this, SLOT(WPFollowPrevious(bool,WayPointItem*)));
|
||||
|
||||
|
||||
//生成后立即选中,并且把信息发给ui界面
|
||||
setSelectedWP(item);
|
||||
item->emitWPProperty();
|
||||
|
||||
|
||||
|
||||
//WPsearchall();
|
||||
|
||||
}
|
||||
@@ -885,6 +889,40 @@ void OPMapWidget::setWPCreate(bool const & value)
|
||||
isWPCreate = value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void OPMapWidget::WPFollowPrevious(bool flag,WayPointItem *waypoint)
|
||||
{
|
||||
|
||||
if(flag)
|
||||
{
|
||||
WayPointItem *item = WPFind(waypoint->Number() - 1);
|
||||
|
||||
if(item)
|
||||
{
|
||||
QPointF pos = item->pos();
|
||||
pos.setX(pos.x() + waypoint->boundingRect().width());
|
||||
|
||||
//waypoint->WPSetEdit(false);
|
||||
|
||||
waypoint->setPos(pos);
|
||||
// waypoint->
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
qDebug() << "set position";
|
||||
|
||||
}
|
||||
|
||||
|
||||
void OPMapWidget::WPLoad(void)//带文件目录参数
|
||||
{
|
||||
qDebug() << "WPLoad";
|
||||
|
||||
@@ -572,6 +572,9 @@ public slots:
|
||||
WayPointItem *WPInsert(const distBearingAltitude &relative, const QString &description, const int &position);
|
||||
|
||||
|
||||
void WPFollowPrevious(bool flag,WayPointItem *waypoint);
|
||||
|
||||
|
||||
void WPLoad(void);
|
||||
void WPSave(void);
|
||||
void WPDownload(void);
|
||||
|
||||
@@ -312,6 +312,7 @@ void WayPointItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
|
||||
if (isDragging) {
|
||||
|
||||
emit localPositionChanged(this->pos(), this);
|
||||
emit WPValuesChanged(this);
|
||||
}
|
||||
@@ -544,7 +545,9 @@ void WayPointItem::setWPProperty(float param1,float param2,float param3,float pa
|
||||
{
|
||||
if(seq == property.seq)
|
||||
{
|
||||
qDebug() << seq << "set property";
|
||||
qDebug() << seq << "set property";
|
||||
|
||||
|
||||
|
||||
property.param1 = param1;
|
||||
property.param2 = param2;
|
||||
@@ -560,6 +563,17 @@ void WayPointItem::setWPProperty(float param1,float param2,float param3,float pa
|
||||
property.current = current;
|
||||
property.autocontinue = autocontinue;
|
||||
property.mission_type = mission_type;
|
||||
|
||||
if(command > MAV_CMD::MAV_CMD_NAV_LAST)
|
||||
{
|
||||
qDebug() << "is cmd point";
|
||||
emit WPFollowPrevious(true,this);
|
||||
}
|
||||
else
|
||||
{
|
||||
emit WPFollowPrevious(false,this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -322,6 +322,11 @@ public slots:
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
void WPFollowPrevious(bool flag,WayPointItem *waypoint);
|
||||
|
||||
|
||||
void WPProperty(float param1,float param2,float param3,float param4,
|
||||
int32_t x,int32_t y,float z,
|
||||
uint16_t seq,
|
||||
|
||||
Reference in New Issue
Block a user