上传功能完成,下载部分需要调整默认的参数设置
This commit is contained in:
@@ -804,7 +804,7 @@ void OPMapWidget::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
WayPointItem *OPMapWidget::WPCreate()
|
||||
{
|
||||
//获取当前组下面的seq最大值
|
||||
int seq = getWaypointSize(currentGroup);
|
||||
int seq = getWaypointSize(currentGroup) + 1;
|
||||
|
||||
WayPointItem *item = new WayPointItem(this->CurrentPosition(), 0,seq,currentGroup, map);
|
||||
|
||||
@@ -818,7 +818,7 @@ WayPointItem *OPMapWidget::WPCreate()
|
||||
WayPointItem *OPMapWidget::magicWPCreate()
|
||||
{
|
||||
//获取当前组下面的seq最大值
|
||||
int seq = getWaypointSize(currentGroup);
|
||||
int seq = getWaypointSize(currentGroup) + 1;
|
||||
|
||||
WayPointItem *item = new WayPointItem(seq,currentGroup,map, true);
|
||||
|
||||
@@ -839,7 +839,7 @@ void OPMapWidget::WPCreate(WayPointItem *item)
|
||||
WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int const & altitude)
|
||||
{
|
||||
//获取当前组下面的seq最大值
|
||||
int seq = getWaypointSize(currentGroup);
|
||||
int seq = getWaypointSize(currentGroup) + 1;
|
||||
|
||||
WayPointItem *item = new WayPointItem(coord, altitude,seq,currentGroup, map);
|
||||
|
||||
@@ -854,7 +854,7 @@ WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int co
|
||||
WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int const & altitude, QString const & description)
|
||||
{
|
||||
//获取当前组下面的seq最大值
|
||||
int seq = getWaypointSize(currentGroup);
|
||||
int seq = getWaypointSize(currentGroup) + 1;
|
||||
|
||||
WayPointItem *item = new WayPointItem(coord, altitude,seq,currentGroup, description, map);
|
||||
|
||||
@@ -869,7 +869,7 @@ WayPointItem *OPMapWidget::WPCreate(internals::PointLatLng const & coord, int co
|
||||
WayPointItem *OPMapWidget::WPCreate(const distBearingAltitude &relativeCoord, const QString &description)
|
||||
{
|
||||
//获取当前组下面的seq最大值
|
||||
int seq = getWaypointSize(currentGroup);
|
||||
int seq = getWaypointSize(currentGroup) + 1;
|
||||
|
||||
WayPointItem *item = new WayPointItem(relativeCoord,seq,currentGroup, description, map);
|
||||
|
||||
@@ -1174,10 +1174,13 @@ void OPMapWidget::WPSetVisibleAll(bool value)
|
||||
{
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
|
||||
if (w) {
|
||||
if (w->Number() != -1) {
|
||||
w->setVisible(value);
|
||||
|
||||
if(w->MissionType() == currentGroup)
|
||||
{
|
||||
if (w->Number() != -1) {
|
||||
w->setVisible(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2022,10 +2025,14 @@ void OPMapWidget::WPUpload(void)
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
if (w) {
|
||||
list.append(w);
|
||||
w->emitWPProperty();
|
||||
//上传当前选中的航线
|
||||
if(w->MissionType() == currentGroup)
|
||||
{
|
||||
list.append(w);
|
||||
w->emitWPProperty();
|
||||
|
||||
//w->setVisible(false);
|
||||
//w->setVisible(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2212,7 +2219,6 @@ 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));
|
||||
@@ -2225,35 +2231,40 @@ void OPMapWidget::receivedPoint(float param1,float param2,float param3,float par
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
if (w) {
|
||||
if(w->Number() == (seq+1))
|
||||
if(w->MissionType() == mission_type)//如果组别一样,那么就赋值
|
||||
{
|
||||
isExist = true;
|
||||
if(w->Number() == (seq+1))
|
||||
{
|
||||
qDebug() << "waypoint exist:" << w->Number() << seq+1;
|
||||
|
||||
internals::PointLatLng LatLng;
|
||||
isExist = true;
|
||||
|
||||
LatLng.SetLat(x * 10e-8);
|
||||
LatLng.SetLng(y * 10e-8);
|
||||
internals::PointLatLng LatLng;
|
||||
|
||||
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();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2261,15 +2272,24 @@ void OPMapWidget::receivedPoint(float param1,float param2,float param3,float par
|
||||
if(!isExist)
|
||||
{
|
||||
|
||||
|
||||
|
||||
internals::PointLatLng LatLng;
|
||||
|
||||
LatLng.SetLat(x * 10e-8);
|
||||
LatLng.SetLng(y * 10e-8);
|
||||
|
||||
//设置好当前的航线
|
||||
currentGroup = mission_type;
|
||||
|
||||
|
||||
//生成的时候默认设定不对,导致下载时切换过去
|
||||
WayPointItem *Item = WPCreate(LatLng,z);
|
||||
|
||||
Item->SetNumber(seq+1);
|
||||
|
||||
qDebug() << "waypoint not exist:" << Item->Number() << seq+1 <<currentGroup << mission_type;
|
||||
|
||||
emit setWPProperty(param1,param2,param3,param4,
|
||||
x,y,z,
|
||||
seq+1,
|
||||
@@ -2284,6 +2304,24 @@ void OPMapWidget::receivedPoint(float param1,float param2,float param3,float par
|
||||
|
||||
|
||||
Item->emitWPProperty();
|
||||
|
||||
|
||||
//===========连线
|
||||
/*
|
||||
WayPointItem *w_last = WPFind(mission_type,Item->Number() - 1);
|
||||
if(w_last)
|
||||
{
|
||||
WPLineCreate(w_last,Item,Qt::green,false,2);
|
||||
}
|
||||
|
||||
|
||||
WayPointItem *w_next = WPFind(group,Item->Number() + 1);
|
||||
if(w_next)
|
||||
{
|
||||
WPLineCreate(item,w_next,Qt::green,false,2);
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
qDebug() << "Exist" << isExist;
|
||||
|
||||
@@ -734,7 +734,7 @@ void WayPointItem::setWPProperty(float param1,float param2,float param3,float pa
|
||||
|
||||
qDebug() << this->Number();
|
||||
|
||||
emit WPFollowPrevious(isFollowPrevious,this);
|
||||
//emit WPFollowPrevious(isFollowPrevious,this);
|
||||
|
||||
ElevationTrig();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user