diff --git a/App/GCS_zh_CN.qm b/App/GCS_zh_CN.qm index 8ba1ba1..126c78e 100644 Binary files a/App/GCS_zh_CN.qm and b/App/GCS_zh_CN.qm differ diff --git a/App/GCS_zh_CN.ts b/App/GCS_zh_CN.ts index 257f0ec..2824968 100644 --- a/App/GCS_zh_CN.ts +++ b/App/GCS_zh_CN.ts @@ -2142,36 +2142,36 @@ 参数 - - + + Communication Lost 通讯丢失 - - + + Communication Regain 通讯已恢复 - + R:%1 / T:%2 收:%1/发:%2 - - - + + + 未定位 - + %1D[%2颗] %1D[%2颗] - + fix[%1颗] %1D Fix 差分[%1颗] @@ -2189,256 +2189,256 @@ GPS错误 - + float[%1颗] 浮点[%1颗] - + err[%1颗] 错误[%1颗] - + ARM 解锁 - + DISARM 上锁 - + MANUAL 手动 - + ALTCTL 定高 - + POSCTL 定点 - + AUTO 自主 - + ACRO - + OFFBOARD - + STABILIZED 增稳 - + RATTITUDE 速率 - + STANDBY 待机 - + BIT 测试 - + AUTO_READY 就绪 - + AUTO_TAKEOFF 起飞 - + AUTO_LOITER 盘旋 - + AUTO_MISSION 任务 - + AUTO_RTL 返航 - + AUTO_LAND 着陆 - + AUTO_RTGS RTGS - + AUTO_FOLLOW_TARGET 目标跟随 - + 开加力 - + 半加力 - + 全加力 - - + + 关加力 - + 伞舱开 - + 伞舱关 - + INS解算正常 - + INS星数不足 - + INS内部错误 - + INS速度超限 - + SBG解算正常 - + SBG星数不足 - + SBG内部错误 - + SBG速度超限 - + 安控区内 - + 安控区外 - + mission group has changed, current group is %1 航线切换,当前航线为 %1 - + VERT_OFF OFF 纵向制导关闭 - + VNAV2THT 消除纵向偏差 - + HDOT2THT 控制升降速率 - + GAMMA2THT 控制航迹角 - + AS2THT 俯仰控制速度 - + H2THT 控制绝对高度 - + AGL2THT 控制相对高度 - + LAT_OFF 横向制导关闭 - + LNAV2PHI 滚转消除侧偏 - + PSI2PHI 滚转控制航向 - - - + + + @@ -2447,156 +2447,156 @@ 未定位 - - + + 未初始化 - - + + 垂直陀螺 - - + + AHRS - - + + 速度导航 - - + + 位置导航 - - - - - - - - + + + + + + + + 正常 - - - - - - - - - - + + + + + + + + + + 无效 - - + + 解算正常 - - + + 卫星数不足 - - + + 内部错误 - - + + 速度超限 - - - - + + + + 未知 - - + + 多普勒 - - + + 微分 - - + + 单点 - - + + 伪距差分 - - + + SBAS广域差分 - - + + 广域差分 - - + + RTK_FLOAT - - + + RTK_INT - - + + PPP_FLOAT - - + + PPP_INT - - + + FIXED @@ -2605,17 +2605,17 @@ 未支持 - + flight mode 飞行模式 - + 连接内置惯导 - + 连接SBG @@ -2761,38 +2761,38 @@ 界面 - + save 保存 - + insert 插入 - + upload 上传 - + add 增加 - + download downlload 下载 - + load 打开 - + delete 删除 @@ -2802,7 +2802,7 @@ 围栏 - + clean 清空 @@ -2852,153 +2852,186 @@ 起飞 - + number 航点 - + command 类型 - + par1 参数1 - + par2 参数2 - + par3 参数3 - + par4 参数4 - - + + lat 纬度 - - + + addCircle + 添加圆形 + + + + addPolygon + 添加多边形 + + + + delCircle + 删除圆形 + + + + delPolygon + 删除多边形 + + + + lng 经度 - + group 组别 - - - + + + + + inclusion 包含 - + par 参数 - + type 类型 - + alt 海拔 - + + + + + + Circle 圆形 - - + + + + exclusion 除外 - + + + + + Polygon 多边形 - - + + 航点 - - + + 返航 - - + + 降落 - - + + 起飞 - - + + 保持 - - + + 表速 - - + + 快升 - - + + 开加力 - - + + 关加力 - - + + Selete Way Point File... 选择载入文件... - - + + plan file (*.plan) 任务文件 (*.plan) @@ -5101,87 +5134,87 @@ p, li { white-space: pre-wrap; } - - - + + + Relative 相对 - - - + + + Absolutely 绝对 - + param1 - + param2 - + param3 - + param4 - + param5 - + param6 - + param7 - + set 设置 - + Altitude 海拔 - + setLatitude 设置纬度 - + setLongitude 设置经度 - - + + plan file (*.plan) 任务文件 (*.plan) - + click to clear all points 点击清除所有航点 - + Measuring 测量中 @@ -5237,7 +5270,7 @@ p, li { white-space: pre-wrap; } - + Measure 测量 @@ -5251,8 +5284,8 @@ p, li { white-space: pre-wrap; } 组别 - - + + Selete Way Point File... Select Loading File... 选择载入文件... diff --git a/App/MissionUI/MissionUI.cpp b/App/MissionUI/MissionUI.cpp index c79edf3..6f6fcd8 100644 --- a/App/MissionUI/MissionUI.cpp +++ b/App/MissionUI/MissionUI.cpp @@ -17,6 +17,28 @@ MissionUI::MissionUI(QWidget *parent) : this->setStyleSheet(stylesheet); file.close(); + //围栏编辑 + CustomButton *btn_addCircle = new CustomButton(this); + CustomButton *btn_addPolygon = new CustomButton(this); + CustomButton *btn_deleteCircle = new CustomButton(this); + CustomButton *btn_deletePolygon = new CustomButton(this); + + btn_addCircle->setText(tr("addCircle")); + btn_addPolygon->setText(tr("addPolygon")); + btn_deleteCircle->setText(tr("delCircle")); + btn_deletePolygon->setText(tr("delPolygon")); + + btn_addCircle->setFixedSize(100,40); + btn_addPolygon->setFixedSize(100,40); + btn_deleteCircle->setFixedSize(100,40); + btn_deletePolygon->setFixedSize(100,40); + + btn_addCircle->hide(); + btn_addPolygon->hide(); + btn_deleteCircle->hide(); + btn_deletePolygon->hide(); + + //航线编辑 CustomButton *btn_load = new CustomButton(this); CustomButton *btn_save = new CustomButton(this); CustomButton *btn_upload = new CustomButton(this); @@ -35,26 +57,32 @@ MissionUI::MissionUI(QWidget *parent) : btn_clean->setText(tr("clean")); btn_add->setText(tr("add")); - btn_load->setFixedSize(80,40); - btn_save->setFixedSize(80,40); - btn_upload->setFixedSize(80,40); - btn_download->setFixedSize(80,40); - btn_insert->setFixedSize(80,40); - btn_delete->setFixedSize(80,40); - btn_clean->setFixedSize(80,40); - btn_add->setFixedSize(80,40); + btn_load->setFixedSize(100,40); + btn_save->setFixedSize(100,40); + btn_upload->setFixedSize(100,40); + btn_download->setFixedSize(100,40); + btn_insert->setFixedSize(100,40); + btn_delete->setFixedSize(100,40); + btn_clean->setFixedSize(100,40); + btn_add->setFixedSize(100,40); + int btn_Count = 0; + ui->gridLayout_btn->addWidget(btn_load, btn_Count++,0,1,1); + ui->gridLayout_btn->addWidget(btn_save, btn_Count++,0,1,1); + ui->gridLayout_btn->addWidget(btn_upload, btn_Count++,0,1,1); + ui->gridLayout_btn->addWidget(btn_download,btn_Count++,0,1,1); + ui->gridLayout_btn->addWidget(btn_insert, btn_Count++,0,1,1); + ui->gridLayout_btn->addWidget(btn_delete, btn_Count++,0,1,1); + ui->gridLayout_btn->addWidget(btn_clean, btn_Count++,0,1,1); + ui->gridLayout_btn->addWidget(btn_add, btn_Count++,0,1,1); - ui->gridLayout_btn->addWidget(btn_load, 0,0,1,1); - ui->gridLayout_btn->addWidget(btn_save, 1,0,1,1); - ui->gridLayout_btn->addWidget(btn_upload, 2,0,1,1); - ui->gridLayout_btn->addWidget(btn_download,3,0,1,1); - ui->gridLayout_btn->addWidget(btn_insert, 4,0,1,1); - ui->gridLayout_btn->addWidget(btn_delete, 5,0,1,1); - ui->gridLayout_btn->addWidget(btn_clean, 6,0,1,1); - ui->gridLayout_btn->addWidget(btn_add, 7,0,1,1); - ui->gridLayout_btn->setRowStretch(8,1); + ui->gridLayout_btn->addWidget(btn_addCircle, btn_Count++,0,1,1); + ui->gridLayout_btn->addWidget(btn_deleteCircle, btn_Count++,0,1,1); + ui->gridLayout_btn->addWidget(btn_addPolygon, btn_Count++,0,1,1); + ui->gridLayout_btn->addWidget(btn_deletePolygon, btn_Count++,0,1,1); + + ui->gridLayout_btn->setRowStretch(btn_Count++,1); connect(btn_load,&CustomButton::clicked,[=](){ @@ -327,6 +355,70 @@ MissionUI::MissionUI(QWidget *parent) : } } + + connect(ui->tabWidget,&QTabWidget::tabBarClicked,[=](int index){ + int group = 3; + + switch (index) { + case 0: + group = 1; + break; + case 1: + group = 3; + break; + case 2: + group = 4; + break; + case 3: + group = 5; + break; + case 4: + group = 6; + break; + default: + break; + } + + if(index == 0) + { + btn_addCircle->show(); + btn_addPolygon->show(); + btn_deleteCircle->show(); + btn_deletePolygon->show(); + + btn_load->hide(); + btn_save->hide(); + //btn_upload->hide(); + //btn_download->hide(); + btn_insert->hide(); + btn_delete->hide(); + btn_clean->hide(); + btn_add->hide(); + } + else + { + btn_addCircle->hide(); + btn_addPolygon->hide(); + btn_deleteCircle->hide(); + btn_deletePolygon->hide(); + + btn_load->show(); + btn_save->show(); + //btn_upload->show(); + //btn_download->show(); + btn_insert->show(); + btn_delete->show(); + btn_clean->show(); + btn_add->show(); + } + + + QTableWidget *widget = tablelist.value(group); + int idx = widget->currentRow() + 1; + qDebug() << "tabWidget_currentChanged" << group << idx; + emit waypointSelect(group,idx); + }); + } MissionUI::~MissionUI() @@ -645,70 +737,6 @@ void MissionUI::settableGroup(int group) ui->tabWidget->setCurrentIndex(index); } -void MissionUI::on_tabWidget_tabBarClicked(int index) -{ - int group = 3; - - switch (index) { - case 0: - group = 1; - break; - case 1: - group = 3; - break; - case 2: - group = 4; - break; - case 3: - group = 5; - break; - case 4: - group = 6; - break; - default: - break; - } - - QTableWidget *widget = tablelist.value(group); - int idx = widget->currentRow() + 1; - - qDebug() << "tabWidget_currentChanged" << group << idx; - - emit waypointSelect(group,idx); -} - - -void MissionUI::on_tabWidget_currentChanged(int index) -{ - int group = 3; - - switch (index) { - case 0: - group = 1; - break; - case 1: - group = 3; - break; - case 2: - group = 4; - break; - case 3: - group = 5; - break; - case 4: - group = 6; - break; - default: - break; - } - - QTableWidget *widget = tablelist.value(group); - int idx = widget->currentRow() + 1; - - qDebug() << "tabWidget_currentChanged" << group << idx; - - //emit waypointSelect(group,idx); -} void MissionUI::itemSelectionChanged() { diff --git a/App/MissionUI/MissionUI.h b/App/MissionUI/MissionUI.h index 0e4085a..ff98974 100644 --- a/App/MissionUI/MissionUI.h +++ b/App/MissionUI/MissionUI.h @@ -59,15 +59,9 @@ protected slots: private slots: void itemSelectionChanged(); - void on_tabWidget_currentChanged(int index); - void itemClicked(QTableWidgetItem *item); void itemDoubleClicked(QTableWidgetItem *item); - - - void on_tabWidget_tabBarClicked(int index); - signals: void setCommand(QVariant value); diff --git a/opmap/MAP_zh_CN.ts b/opmap/MAP_zh_CN.ts index c1f7090..eb24b88 100644 --- a/opmap/MAP_zh_CN.ts +++ b/opmap/MAP_zh_CN.ts @@ -83,27 +83,27 @@ Please first select the area of the map to rip with <CTRL>+Left mouse clic - + 开始上传航点,总数%1 - + 上传失败%1 - + polygons - + circles - + recieve way point group:%1 seq:%2 收到航点:第%1组,第%2点 diff --git a/opmap/mapwidget/geoFencecircle.cpp b/opmap/mapwidget/geoFencecircle.cpp index 2ebc1b4..441ae47 100644 --- a/opmap/mapwidget/geoFencecircle.cpp +++ b/opmap/mapwidget/geoFencecircle.cpp @@ -59,11 +59,11 @@ void geoFencecircle::paint(QPainter *painter, const QStyleOptionGraphicsItem *op if(m_inclusion) { - painter->setBrush(m_brush); + painter->setBrush(Qt::NoBrush); } else { - painter->setBrush(Qt::NoBrush); + painter->setBrush(m_brush); } painter->drawPoint(0, 0); diff --git a/opmap/mapwidget/geoFenceitem.cpp b/opmap/mapwidget/geoFenceitem.cpp index 78f0bc5..bfeb2a5 100644 --- a/opmap/mapwidget/geoFenceitem.cpp +++ b/opmap/mapwidget/geoFenceitem.cpp @@ -43,11 +43,11 @@ void geoFenceitem::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti if(m_inclusion) { - painter->setBrush(m_brush); + painter->setBrush(Qt::NoBrush); } else { - painter->setBrush(Qt::NoBrush); + painter->setBrush(m_brush); } painter->drawPoint(0, 0); diff --git a/opmap/mapwidget/opmapwidget.cpp b/opmap/mapwidget/opmapwidget.cpp index f3f4003..e36c6ac 100644 --- a/opmap/mapwidget/opmapwidget.cpp +++ b/opmap/mapwidget/opmapwidget.cpp @@ -2022,11 +2022,7 @@ void OPMapWidget::WPFollowPrevious(bool flag,WayPointItem *w) { WPLineCreate(w,next_item,Qt::green,false,2); } - - - } - } void OPMapWidget::setFenceCircle(int group,qreal radius, bool inclusion, qreal lat, qreal lng) @@ -2036,20 +2032,9 @@ void OPMapWidget::setFenceCircle(int group,qreal radius, bool inclusion, qreal l foreach(QGraphicsItem * i, map->childItems()) { geoFencecircle *w = qgraphicsitem_cast(i); if ((w)&&(w->Group() == group)) { - - /* - w->setInclusion(inclusion); - w->setRadius(radius); - w->setLatitude(lat); - w->setLongitude(lng); - */ - w->setParameter(group,radius,inclusion,lat,lng); - - qDebug() << "set Circle value" << group << radius << inclusion << lat << lng; } } - qDebug() << "set Circle"; } void OPMapWidget::setFencePolygon(int group,qreal vertex,bool inclusion,QList latlng) @@ -2073,11 +2058,8 @@ void OPMapWidget::setFencePolygon(int group,qreal vertex,bool inclusion,QListsetInclusion(inclusion); w->setVertex(vertex); w->setPoints(p); - qDebug() << "set Polygon value"; } } - - qDebug() << "set Polygon"; } @@ -2123,13 +2105,7 @@ void OPMapWidget::WPLoad(QString path)//带文件目录参数 //生成一个⚪ - - - //geoFenceitem *centeritem = new geoFenceitem(fenceCount,inclusion,version,internals::PointLatLng(lat,lng),QColor("#FF8000"),map); - geoFencecircle *c = new geoFencecircle(fenceCount,inclusion,version,internals::PointLatLng(lat,lng),radius,QColor("#FF8000"),map); - - emit createFenceCircle(fenceCount++,radius,inclusion,lat,lng); } @@ -2405,50 +2381,57 @@ void OPMapWidget::WPDownload(void) void OPMapWidget::WPUpload(void) { - //发送第一个 - QList list; - //先发送一个清空指令 - foreach(QGraphicsItem * i, map->childItems()) { - WayPointItem *w = qgraphicsitem_cast(i); - if (w) { - //上传当前选中的航线 - if(w->MissionType() == currentGroup) - { - list.append(w); - w->emitWPProperty(); + if(currentGroup == 1)//这是栅栏 + { - //w->setVisible(false); + } + else + { + //发送第一个 + QList list; + //先发送一个清空指令 + foreach(QGraphicsItem * i, map->childItems()) { + WayPointItem *w = qgraphicsitem_cast(i); + if (w) { + //上传当前选中的航线 + if(w->MissionType() == currentGroup) + { + list.append(w); + w->emitWPProperty(); + + //w->setVisible(false); + } } } - } - if(list.size() <= 0) - { - emit showMessage("请先载入任务航线"); - return; - } + if(list.size() <= 0) + { + emit showMessage("请先载入任务航线"); + return; + } - emit showMessage(tr("开始上传航点,总数%1").arg(list.size())); + emit showMessage(tr("开始上传航点,总数%1").arg(list.size())); - //选择当前ID号 + //选择当前ID号 - int sysid = 0; - int compid = 0; + int sysid = 0; + int compid = 0; - foreach(QGraphicsItem * i, map->childItems()) { - UAVItem *u = qgraphicsitem_cast(i); - if (u) { - if(u->Select() == true) - { - sysid = u->SysID(); - compid = u->CompID(); + foreach(QGraphicsItem * i, map->childItems()) { + UAVItem *u = qgraphicsitem_cast(i); + if (u) { + if(u->Select() == true) + { + sysid = u->SysID(); + compid = u->CompID(); - //如果有选中,那么就发送,选中几个就发几个 - emit signal_WPUpload(sysid,compid,list.size(),currentGroup);//直接发送全部航点到 + //如果有选中,那么就发送,选中几个就发几个 + emit signal_WPUpload(sysid,compid,list.size(),currentGroup);//直接发送全部航点到 + } } } - } + } } //飞行界面收到的当前航点的消息 @@ -2669,115 +2652,225 @@ void OPMapWidget::receivedPoint(float param1,float param2,float param3,float par switch (mission_type - 2) { case -1: - typestr = tr("polygons"); - break; - case 0: - typestr = tr("circles"); - break; + { + typestr = tr("fence"); + }break; default: + { typestr = QString::number(mission_type - 2); - break; + }break; } - emit showMessage(tr("recieve way point group:%1 seq:%2").arg(typestr).arg(seq + 1)); + if((mission_type - 2) == -1) + { + qDebug() << command << param1 << param2 << param3 << param4 << x << y; - //qDebug() << "receivers Point" << x * 10e-8 << y * 10e-8 << 10e-8; + if(command == MAV_CMD_NAV_FENCE_POLYGON_VERTEX_INCLUSION ) + { + static int PolygonCount = 0; + static QList PolygonPoints; - bool isExist = false; + PolygonCount ++; + bool inclusion = true; - foreach(QGraphicsItem * i, map->childItems()) { - WayPointItem *w = qgraphicsitem_cast(i); - if (w) { - if(w->MissionType() == mission_type)//如果组别一样,那么就赋值 + PolygonPoints.push_back(internals::PointLatLng(x * 10e-8,y * 10e-8)); + + + if(PolygonCount >= param1) { - if(w->Number() == (seq+1)) + + QList latlng; + qreal lat_sum = 0; + qreal lng_sum = 0; + + for (internals::PointLatLng point: PolygonPoints) { + qreal lat = point.Lat(); + qreal lng = point.Lng(); + + lat_sum += lat; + lng_sum += lng; + + latlng.push_back(QPointF(lat,lng)); + } + + internals::PointLatLng center; + + center.SetLat(lat_sum/latlng.size()); + center.SetLng(lng_sum/latlng.size()); + + geoFenceitem *polyitem = new geoFenceitem(PolygonCount,inclusion,0,center,QColor("#FF8000"),map); + + polyitem->setPoints(PolygonPoints); + + emit createFencePolygon(PolygonCount,PolygonPoints.size(),inclusion,latlng); + + PolygonCount = 0; + PolygonPoints.clear(); + } + } + else if(command == MAV_CMD_NAV_FENCE_POLYGON_VERTEX_EXCLUSION ) + { + static int PolygonCount = 0; + static QList PolygonPoints; + + PolygonCount ++; + bool inclusion = false; + + + PolygonPoints.push_back(internals::PointLatLng(x * 10e-8,y * 10e-8)); + + + if(PolygonCount >= param1) + { + + QList latlng; + qreal lat_sum = 0; + qreal lng_sum = 0; + + for (internals::PointLatLng point: PolygonPoints) { + qreal lat = point.Lat(); + qreal lng = point.Lng(); + + lat_sum += lat; + lng_sum += lng; + + latlng.push_back(QPointF(lat,lng)); + } + + internals::PointLatLng center; + + center.SetLat(lat_sum/latlng.size()); + center.SetLng(lng_sum/latlng.size()); + + geoFenceitem *polyitem = new geoFenceitem(PolygonCount,inclusion,0,center,QColor("#FF8000"),map); + + polyitem->setPoints(PolygonPoints); + + emit createFencePolygon(PolygonCount,PolygonPoints.size(),inclusion,latlng); + + PolygonCount = 0; + PolygonPoints.clear(); + } + } + else if(command == MAV_CMD_NAV_FENCE_CIRCLE_INCLUSION ) + { + bool inclusion = true; + qreal radius = param1; + + geoFencecircle *c = new geoFencecircle(1,inclusion,0,internals::PointLatLng(x * 10e-8,y * 10e-8),radius,QColor("#FF8000"),map); + emit createFenceCircle(0,radius,inclusion,x * 10e-8,y * 10e-8); + + } + else if(command == MAV_CMD_NAV_FENCE_CIRCLE_EXCLUSION ) + { + bool inclusion = false; + qreal radius = param1; + + geoFencecircle *c = new geoFencecircle(1,inclusion,0,internals::PointLatLng(x * 10e-8,y * 10e-8),radius,QColor("#FF8000"),map); + emit createFenceCircle(0,radius,inclusion,x * 10e-8,y * 10e-8); + } + else if(command == MAV_CMD_NAV_RALLY_POINT ) + { + + } + } + else + { + bool isExist = false; + foreach(QGraphicsItem * i, map->childItems()) { + WayPointItem *w = qgraphicsitem_cast(i); + if (w) { + if(w->MissionType() == mission_type)//如果组别一样,那么就赋值 { - qDebug() << "waypoint exist:" << w->Number() << seq+1; + if(w->Number() == (seq+1)) + { + qDebug() << "waypoint exist:" << w->Number() << seq+1; - isExist = true; + isExist = true; - internals::PointLatLng LatLng; + internals::PointLatLng LatLng; - LatLng.SetLat(x * 10e-8); - LatLng.SetLng(y * 10e-8); + LatLng.SetLat(x * 10e-8); + LatLng.SetLng(y * 10e-8); - w->SetLat(LatLng.Lat()); - LatLng.SetLng(LatLng.Lng()); - w->SetNumber(seq+1); + w->SetLat(LatLng.Lat()); + LatLng.SetLng(LatLng.Lng()); + w->SetNumber(seq+1); - emit setWPProperty(param1,param2,param3,param4, - x,y,z, - seq+1, - group, - command, - target_system, - target_component, - frame, - current, - autocontinue, - mission_type); + emit setWPProperty(param1,param2,param3,param4, + x,y,z, + seq+1, + group, + command, + target_system, + target_component, + frame, + current, + autocontinue, + mission_type); - w->emitWPProperty(); + w->emitWPProperty(); + } } } } - } - if(!isExist) - { - internals::PointLatLng LatLng; + if(!isExist) + { + internals::PointLatLng LatLng; - LatLng.SetLat(x * 10e-8); - LatLng.SetLng(y * 10e-8); + LatLng.SetLat(x * 10e-8); + LatLng.SetLng(y * 10e-8); - //获取当前组下面的seq最大值 - WayPointItem *Item = new WayPointItem(LatLng, z,seq+1,mission_type, map); + //获取当前组下面的seq最大值 + WayPointItem *Item = new WayPointItem(LatLng, z,seq+1,mission_type, map); - ConnectWP(Item); - Item->setParentItem(map); - Item->SetMissionType(mission_type); - int position = Item->Number(); - emit WPCreated(position, Item); - setOverlayOpacity(overlayOpacity); + ConnectWP(Item); + Item->setParentItem(map); + Item->SetMissionType(mission_type); + int position = Item->Number(); + emit WPCreated(position, Item); + setOverlayOpacity(overlayOpacity); - emit setWPProperty(param1,param2,param3,param4, - x,y,z, - seq+1, - group, - command, - target_system, - target_component, - frame, - current, - autocontinue, - mission_type); + emit setWPProperty(param1,param2,param3,param4, + x,y,z, + seq+1, + group, + command, + target_system, + target_component, + frame, + current, + autocontinue, + mission_type); - Item->emitWPProperty(); - Item->setisShowTip(isShowTip); + Item->emitWPProperty(); + Item->setisShowTip(isShowTip); - qDebug() << "waypoint not exist:" << Item->Number() << seq+1 <Number() << seq+1 <MissionType(),Item->Number() - 1); + WayPointItem *w_last = WPFind(Item->MissionType(),Item->Number() - 1); - if(w_last) - { - WPLineCreate(w_last,Item,Qt::green,false,2); - } - } + if(w_last) + { + WPLineCreate(w_last,Item,Qt::green,false,2); + } + } - qDebug() << "Exist" << isExist; + qDebug() << "Exist" << isExist; + } }