添加惯导状态字,修正航线传输没有航点时的bug

This commit is contained in:
hm
2020-12-12 16:45:59 +08:00
parent 115d258441
commit ff19a5180b
8 changed files with 1494 additions and 631 deletions
+70 -17
View File
@@ -1603,6 +1603,9 @@ void OPMapWidget::WPDownload(void)
void OPMapWidget::WPUpload(void)
{
//发送第一个
QList<mapcontrol::WayPointItem *> list;
//先发送一个清空指令
@@ -1612,18 +1615,35 @@ void OPMapWidget::WPUpload(void)
list.append(w);
w->emitWPProperty();
w->setVisible(false);
//w->setVisible(false);
}
}
/*
foreach(QGraphicsItem * i, map->childItems()) {
WayPointLine *l = qgraphicsitem_cast<WayPointLine *>(i);
if (l) {
l->setVisible(false);
}
}
*/
qDebug() << "WPUpload" << list.size();
//qDebug() << "WPUpload" << list.size();
if(list.size() <= 0)
{
emit showMessage(tr("please create a plan"));
return;
}
emit showMessage(tr("start to send mossion %1").arg(list.size()));
//选择当前ID号
@@ -1648,6 +1668,47 @@ void OPMapWidget::WPUpload(void)
void OPMapWidget::WPSendItemOK(uint16_t seq, bool flag)
{
if(flag == true)
{
QString str;
str.append(tr("send way point %1").arg(seq));
emit showMessage(str);
}
else
{
QString str;
str.append(tr("fail to send %1").arg(seq));
emit showMessage(str);
}
/*
if(flag == true)
{
foreach(QGraphicsItem * i, map->childItems()) {
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
if (w) {
if(w->Number() == (seq))
{
w->setVisible(true);
foreach(QGraphicsItem * i, map->childItems()) {
WayPointLine *l = qgraphicsitem_cast<WayPointLine *>(i);
if (l) {
if(l->WPLineTo() == w)
l->setVisible(true);
}
}
}
}
}
}
*/
/*
if(flag == true)
{
foreach(QGraphicsItem * i, map->childItems()) {
@@ -1680,6 +1741,8 @@ void OPMapWidget::WPUpload(void)
if (l) l->setVisible(true);
}
}
*/
}
//这个有可能是其他线程运行,导致生成的航点不对,下载得到
@@ -1699,6 +1762,11 @@ void OPMapWidget::receivedPoint(float param1,float param2,float param3,float par
qDebug() << "receivers Point";
// << QThread::currentThreadId();
emit showMessage(tr("recieve way point %1").arg(seq + 1));
//qDebug() << "receivers Point" << x * 10e-8 << y * 10e-8 << 10e-8;
internals::PointLatLng LatLng;
@@ -1710,21 +1778,6 @@ void OPMapWidget::receivedPoint(float param1,float param2,float param3,float par
Item->SetNumber(seq+1);
if(command > MAV_CMD::MAV_CMD_NAV_LAST)
{
}
else
{
//WPLineCreate(WPFind(Item->Number() - 1),Item,Qt::green,false,2);
}
//Item->setParent(map);
emit setWPProperty(param1,param2,param3,param4,
x,y,z,
seq+1,