Commit deb6ba86 authored by tecnosapiens's avatar tecnosapiens

change view when add Slugs Link

parent 1ef9ae7b
......@@ -153,6 +153,7 @@ void UASWaypointManager::handleWaypoint(quint8 systemId, quint8 compId, mavlink_
current_partner_compid = 0;
protocol_timer.stop();
emit readGlobalWPFromUAS(false);
emit updateStatusString("done.");
qDebug() << "got all waypoints from ID " << systemId;
......@@ -294,6 +295,7 @@ void UASWaypointManager::localAddWaypoint(Waypoint *wp)
{
wp->setId(waypoints.size());
waypoints.insert(waypoints.size(), wp);
emit waypointListChanged();
}
}
......@@ -417,6 +419,7 @@ void UASWaypointManager::clearWaypointList()
void UASWaypointManager::readWaypoints()
{
emit readGlobalWPFromUAS(true);
if(current_state == WP_IDLE)
{
while(waypoints.size()>0)
......@@ -424,6 +427,7 @@ void UASWaypointManager::readWaypoints()
Waypoint *t = waypoints.back();
delete t;
waypoints.pop_back();
}
protocol_timer.start(PROTOCOL_TIMEOUT_MS);
......@@ -435,6 +439,7 @@ void UASWaypointManager::readWaypoints()
current_partner_compid = MAV_COMP_ID_WAYPOINTPLANNER;
sendWaypointRequestList();
}
}
......@@ -570,6 +575,8 @@ void UASWaypointManager::sendWaypointRequestList()
MG::SLEEP::usleep(PROTOCOL_DELAY_MS * 1000);
qDebug() << "sent waypoint list request to ID " << wprl.target_system;
}
void UASWaypointManager::sendWaypointRequest(quint16 seq)
......
......@@ -122,6 +122,7 @@ signals:
void updateStatusString(const QString &); ///< emits the current status string
void loadWPFile(); ///< emits signal that a file wp has been load
void readGlobalWPFromUAS(bool value); ///< emits signal when finish to read Global WP from UAS
private:
UAS &uas; ///< Reference to the corresponding UAS
......
......@@ -573,7 +573,8 @@ void MainWindow::UASCreated(UASInterface* uas)
SlugsMAV* mav2 = dynamic_cast<SlugsMAV*>(uas);
if (mav2) {
dataWidget->addUAS(uas);
loadSlugsView();
//loadSlugsView();
loadGlobalOperatorView();
}
}
}
......
......@@ -92,6 +92,7 @@ WaypointList::WaypointList(QWidget *parent, UASInterface* uas) :
isGlobalWP = false;
isLocalWP = false;
loadFileGlobalWP = false;
readGlobalWP = false;
centerMapCoordinate.setX(0.0);
centerMapCoordinate.setY(0.0);
......@@ -133,6 +134,8 @@ void WaypointList::setUAS(UASInterface* uas)
connect(&uas->getWaypointManager(), SIGNAL(waypointListChanged(void)), this, SLOT(waypointListChanged(void)));
connect(&uas->getWaypointManager(), SIGNAL(currentWaypointChanged(quint16)), this, SLOT(currentWaypointChanged(quint16)));
connect(&uas->getWaypointManager(),SIGNAL(loadWPFile()),this,SLOT(setIsLoadFileWP()));
connect(&uas->getWaypointManager(),SIGNAL(readGlobalWPFromUAS(bool)),this,SLOT(setIsReadGlobalWP(bool)));
}
}
......@@ -250,6 +253,8 @@ void WaypointList::addCurrentPositonWaypoint()
void WaypointList::updateStatusLabel(const QString &string)
{
m_ui->statusLabel->setText(string);
}
void WaypointList::changeCurrentWaypoint(quint16 seq)
......@@ -341,7 +346,7 @@ void WaypointList::waypointListChanged()
WaypointGlobalView *wpgv = wpGlobalViews.value(wp);
wpgv->updateValues();
listLayout->addWidget(wpgv);
if(loadFileGlobalWP)
if(loadFileGlobalWP || readGlobalWP)
{
emit createWaypointAtMap(QPointF(wp->getX(),wp->getY()));
qDebug()<<"Emitiendo Pos: "<<wp->getX()<<" - "<<wp->getY();
......@@ -637,3 +642,8 @@ void WaypointList::setIsLoadFileWP()
{
loadFileGlobalWP = true;
}
void WaypointList::setIsReadGlobalWP(bool value)
{
readGlobalWP = value;
}
......@@ -103,6 +103,7 @@ public slots:
void removeWaypoint(Waypoint* wp);
void setIsLoadFileWP();
void setIsReadGlobalWP(bool value);
......@@ -131,6 +132,7 @@ protected:
bool isLocalWP;
QPointF centerMapCoordinate;
bool loadFileGlobalWP;
bool readGlobalWP;
private:
Ui::WaypointList *m_ui;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment