支持多个飞机连接,指令发送,接收等
This commit is contained in:
@@ -469,6 +469,22 @@ void OPMapWidget::setUAVSpeed(int sysid,int compid,qreal Ma,qreal Speed)
|
||||
}
|
||||
}
|
||||
|
||||
void OPMapWidget::setUAVCurrent(int sysid)
|
||||
{
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
UAVItem *u = qgraphicsitem_cast<UAVItem *>(i);
|
||||
if (u) {
|
||||
if(u->SysID() == sysid)
|
||||
{
|
||||
u->setSelect(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
u->setSelect(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int OPMapWidget::getUAVCurrent(void)
|
||||
@@ -1656,7 +1672,7 @@ void OPMapWidget::userRipMap(bool start, qreal lat_l, qreal lng_l, qreal lat_r,
|
||||
if(start == true)
|
||||
{
|
||||
|
||||
//生成16个线程
|
||||
//根据CPU数量分配线程,例如生成16个线程
|
||||
|
||||
|
||||
//每个线程分配不同的矩形
|
||||
@@ -1859,25 +1875,32 @@ void OPMapWidget::setWPLock(bool const & lock)
|
||||
}
|
||||
|
||||
|
||||
void OPMapWidget::WPSetCurrent(int seq)
|
||||
void OPMapWidget::WPSetCurrent(int sysid,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->MissionType() == group)
|
||||
{
|
||||
if(w->Number() == num)
|
||||
if(getUAVCurrent() == sysid)
|
||||
{
|
||||
int group = seq /1000 + 3;
|
||||
int num = seq %1000;
|
||||
|
||||
//qDebug() << "sysid opmap" << sysid << getUAVCurrent() << group << num;
|
||||
|
||||
groupchanged(group);
|
||||
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
if (w) {
|
||||
if(w->MissionType() == group)
|
||||
{
|
||||
w->WPSetCurrent(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
w->WPSetCurrent(false);
|
||||
if(w->Number() == num)
|
||||
{
|
||||
w->WPSetCurrent(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
w->WPSetCurrent(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3566,6 +3589,11 @@ void OPMapWidget::vehicleChanged(float param1,float param2,float param3,float pa
|
||||
|
||||
w->emitWPProperty();
|
||||
|
||||
if(isWPCreate == false)
|
||||
{
|
||||
w->WPSetEdit(false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3589,6 +3617,7 @@ void OPMapWidget::vehicleChanged(float param1,float param2,float param3,float pa
|
||||
emit WPCreated(position, Item);
|
||||
setOverlayOpacity(overlayOpacity);
|
||||
|
||||
setSelectedWP(Item);
|
||||
|
||||
emit setWPProperty(param1,param2,param3,param4,
|
||||
x,y,z,
|
||||
@@ -3606,6 +3635,10 @@ void OPMapWidget::vehicleChanged(float param1,float param2,float param3,float pa
|
||||
Item->emitWPProperty();
|
||||
Item->setisShowTip(isShowTip);
|
||||
|
||||
if(isWPCreate == false)
|
||||
{
|
||||
Item->WPSetEdit(false);
|
||||
}
|
||||
//===========连线
|
||||
WayPointItem *w_last = WPFind(Item->MissionType(),Item->Number() - 1);
|
||||
|
||||
|
||||
@@ -463,6 +463,8 @@ public:
|
||||
void setUAVPos(int sysid,int compid,double x,double y,double z);
|
||||
void setUAVHeading(int sysid,int compid,float Heading);
|
||||
void setUAVSpeed(int sysid,int compid,qreal Ma,qreal Speed);
|
||||
|
||||
|
||||
void DeleteTrail(void);
|
||||
|
||||
|
||||
@@ -672,7 +674,6 @@ signals:
|
||||
void measureState(bool);
|
||||
|
||||
|
||||
|
||||
void createFenceCircle(int group,qreal radius,bool inclusion,qreal lat,qreal lng);
|
||||
void createFencePolygon(int group,qreal vertex,bool inclusion,QList<QPointF> latlng);
|
||||
|
||||
@@ -722,7 +723,7 @@ public slots:
|
||||
|
||||
void addUAV(int sysid, int compid);
|
||||
|
||||
|
||||
void setUAVCurrent(int sysid);
|
||||
|
||||
|
||||
void getMapTypes(void);
|
||||
@@ -784,7 +785,7 @@ public slots:
|
||||
|
||||
void WPFollowPrevious(bool flag,WayPointItem *waypoint);
|
||||
|
||||
void WPSetCurrent(int seq);
|
||||
void WPSetCurrent(int sysid, int seq);
|
||||
|
||||
|
||||
void WPLoad(QString path);
|
||||
|
||||
Reference in New Issue
Block a user