航点传输完成,但不能跟随地图移动
This commit is contained in:
@@ -308,7 +308,7 @@ void OPMapWidget::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
p = map->mapFromParent(p);
|
||||
internals::PointLatLng LatLng;
|
||||
LatLng = map->FromLocalToLatLng(p.x(), p.y());
|
||||
WayPointItem *Item = WPCreate(LatLng,0);
|
||||
WayPointItem *Item = WPCreate(LatLng,50);
|
||||
|
||||
WPLineCreate(WPFind(Item->Number() - 1),Item,Qt::green,false,2);
|
||||
//qDebug() << "OPMapWidget" << Item->Number() <<QString::number(LatLng.Lat(),'f',8) << QString::number(LatLng.Lng(),'f',8);
|
||||
@@ -875,29 +875,89 @@ void OPMapWidget::setWPCreate(bool const & value)
|
||||
isWPCreate = value;
|
||||
}
|
||||
|
||||
void OPMapWidget::WPLoad(void)
|
||||
void OPMapWidget::WPLoad(void)//带文件目录参数
|
||||
{
|
||||
|
||||
qDebug() << "WPLoad";
|
||||
}
|
||||
|
||||
void OPMapWidget::WPSave(void)
|
||||
void OPMapWidget::WPSave(void)//带文件目录参数
|
||||
{
|
||||
|
||||
qDebug() << "WPSave";
|
||||
}
|
||||
|
||||
void OPMapWidget::WPDownload(void)
|
||||
{
|
||||
//请求读取航点
|
||||
qDebug() << "WPDownload";
|
||||
|
||||
WPDeleteAll();
|
||||
|
||||
emit signal_WPDownload(1,0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void OPMapWidget::WPUpload(void)
|
||||
{
|
||||
//发送第一个
|
||||
QList<mapcontrol::WayPointItem *> list;
|
||||
|
||||
//QMap<int,QVector<QVariant>> list;
|
||||
|
||||
|
||||
//先发送一个清空指令
|
||||
|
||||
foreach(QGraphicsItem * i, map->childItems()) {
|
||||
WayPointItem *w = qgraphicsitem_cast<WayPointItem *>(i);
|
||||
if (w) {
|
||||
list.append(w);
|
||||
w->emitWPProperty();
|
||||
}
|
||||
}
|
||||
|
||||
qDebug() << "WPUpload" << list.size();
|
||||
|
||||
emit signal_WPUpload(1,0,list.size());//直接发送全部航点到
|
||||
|
||||
}
|
||||
|
||||
void OPMapWidget::receivedPoint(float param1,float param2,float param3,float param4,
|
||||
int32_t x,int32_t y,float z,
|
||||
uint16_t seq,
|
||||
uint16_t group,
|
||||
uint16_t command,
|
||||
uint8_t target_system,
|
||||
uint8_t target_component,
|
||||
uint8_t frame,
|
||||
uint8_t current,
|
||||
uint8_t autocontinue,
|
||||
uint8_t mission_type)
|
||||
{
|
||||
|
||||
qDebug() << "receivers Point" << x * 10e-8 << y * 10e-8 << 10e-8;
|
||||
|
||||
internals::PointLatLng LatLng;
|
||||
|
||||
LatLng.SetLat(x * 10e-8);
|
||||
LatLng.SetLng(y * 10e-8);
|
||||
|
||||
WayPointItem *Item = WPCreate(LatLng,z);
|
||||
|
||||
emit setWPProperty(param1,param2,param3,param4,
|
||||
x,y,z,
|
||||
seq,
|
||||
group,
|
||||
command,
|
||||
target_system,
|
||||
target_component,
|
||||
frame,
|
||||
current,
|
||||
autocontinue,
|
||||
mission_type);
|
||||
|
||||
|
||||
WPLineCreate(WPFind(Item->Number() - 1),Item,Qt::green,false,2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -524,9 +524,39 @@ signals:
|
||||
|
||||
|
||||
|
||||
void signal_WPDownload(uint8_t m_sysid, uint8_t m_compid);
|
||||
void signal_WPUpload(uint8_t m_sysid, uint8_t m_compid, uint32_t count);
|
||||
|
||||
|
||||
void transmitPoint(float param1,float param2,float param3,float param4,
|
||||
int32_t x,int32_t y,float z,
|
||||
uint16_t seq,
|
||||
uint16_t group,
|
||||
uint16_t command,
|
||||
uint8_t target_system,
|
||||
uint8_t target_component,
|
||||
uint8_t frame,
|
||||
uint8_t current,
|
||||
uint8_t autocontinue,
|
||||
uint8_t mission_type);
|
||||
|
||||
|
||||
public slots:
|
||||
|
||||
|
||||
void receivedPoint(float param1,float param2,float param3,float param4,
|
||||
int32_t x,int32_t y,float z,
|
||||
uint16_t seq,
|
||||
uint16_t group,
|
||||
uint16_t command,
|
||||
uint8_t target_system,
|
||||
uint8_t target_component,
|
||||
uint8_t frame,
|
||||
uint8_t current,
|
||||
uint8_t autocontinue,
|
||||
uint8_t mission_type);
|
||||
|
||||
|
||||
void WPLineDelete(WayPointItem *from, WayPointItem *to);
|
||||
WayPointLine *WPLineFind(WayPointItem *from, WayPointItem *to);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user