Commit a33541b9 authored by lm's avatar lm

Improved performance of 2D map, trails need further debugging

parent 2c92489b
...@@ -144,9 +144,6 @@ muted(false) ...@@ -144,9 +144,6 @@ muted(false)
GAudioOutput::~GAudioOutput() GAudioOutput::~GAudioOutput()
{ {
QSettings settings;
settings.setValue(QGC_GAUDIOOUTPUT_KEY+"muted", muted);
settings.sync();
#ifdef _MSC_VER2 #ifdef _MSC_VER2
::CoUninitialize(); ::CoUninitialize();
#endif #endif
...@@ -155,6 +152,9 @@ GAudioOutput::~GAudioOutput() ...@@ -155,6 +152,9 @@ GAudioOutput::~GAudioOutput()
void GAudioOutput::mute(bool mute) void GAudioOutput::mute(bool mute)
{ {
this->muted = mute; this->muted = mute;
QSettings settings;
settings.setValue(QGC_GAUDIOOUTPUT_KEY+"muted", muted);
settings.sync();
} }
bool GAudioOutput::isMuted() bool GAudioOutput::isMuted()
......
...@@ -117,6 +117,9 @@ HUD::HUD(int width, int height, QWidget* parent) ...@@ -117,6 +117,9 @@ HUD::HUD(int width, int height, QWidget* parent)
// Set auto fill to false // Set auto fill to false
setAutoFillBackground(false); setAutoFillBackground(false);
// Set minimum size
setMinimumSize(80, 60);
// Fill with black background // Fill with black background
QImage fill = QImage(width, height, QImage::Format_Indexed8); QImage fill = QImage(width, height, QImage::Format_Indexed8);
fill.setNumColors(3); fill.setNumColors(3);
......
...@@ -703,7 +703,7 @@ void MainWindow::connectCommonWidgets() ...@@ -703,7 +703,7 @@ void MainWindow::connectCommonWidgets()
if (mapWidget && waypointsDockWidget->widget()) if (mapWidget && waypointsDockWidget->widget())
{ {
// clear path create on the map // clear path create on the map
connect(waypointsDockWidget->widget(), SIGNAL(clearPathclicked()), mapWidget, SLOT(clearPath())); connect(waypointsDockWidget->widget(), SIGNAL(clearPathclicked()), mapWidget, SLOT(clearWaypoints()));
// add Waypoint widget in the WaypointList widget when mouse clicked // add Waypoint widget in the WaypointList widget when mouse clicked
connect(mapWidget, SIGNAL(captureMapCoordinateClick(QPointF)), waypointsDockWidget->widget(), SLOT(addWaypointMouse(QPointF))); connect(mapWidget, SIGNAL(captureMapCoordinateClick(QPointF)), waypointsDockWidget->widget(), SLOT(addWaypointMouse(QPointF)));
......
This diff is collapsed.
...@@ -71,7 +71,9 @@ public slots: ...@@ -71,7 +71,9 @@ public slots:
void updateCameraPosition(double distance, double bearing, QString dir); void updateCameraPosition(double distance, double bearing, QString dir);
QPointF getPointxBearing_Range(double lat1, double lon1, double bearing, double distance); QPointF getPointxBearing_Range(double lat1, double lon1, double bearing, double distance);
//ROCA /** @brief Clear the waypoints overlay layer */
void clearWaypoints();
/** @brief Clear the UAV tracks on the map */
void clearPath(); void clearPath();
void changeGlobalWaypointPositionBySpinBox(int index, float lat, float lon); void changeGlobalWaypointPositionBySpinBox(int index, float lat, float lon);
void drawBorderCamAtMap(bool status); void drawBorderCamAtMap(bool status);
...@@ -96,6 +98,7 @@ protected: ...@@ -96,6 +98,7 @@ protected:
QPushButton* followgps; QPushButton* followgps;
QPushButton* createPath; QPushButton* createPath;
QPushButton* clearTracking;
QLabel* gpsposition; QLabel* gpsposition;
QMenu* mapMenu; QMenu* mapMenu;
QPushButton* mapButton; QPushButton* mapButton;
...@@ -104,6 +107,7 @@ protected: ...@@ -104,6 +107,7 @@ protected:
qmapcontrol::MapAdapter* mapadapter; ///< Adapter to load the map data qmapcontrol::MapAdapter* mapadapter; ///< Adapter to load the map data
qmapcontrol::Layer* l; ///< Current map layer (background) qmapcontrol::Layer* l; ///< Current map layer (background)
qmapcontrol::Layer* overlay; ///< Street overlay (foreground) qmapcontrol::Layer* overlay; ///< Street overlay (foreground)
qmapcontrol::Layer* tracks; ///< Layer for UAV tracks
qmapcontrol::GeometryLayer* geomLayer; ///< Layer for waypoints qmapcontrol::GeometryLayer* geomLayer; ///< Layer for waypoints
//only for experiment //only for experiment
...@@ -132,9 +136,6 @@ protected: ...@@ -132,9 +136,6 @@ protected:
void createWaypointGraphAtMap (const QPointF coordinate); void createWaypointGraphAtMap (const QPointF coordinate);
void mapproviderSelected(QAction* action); void mapproviderSelected(QAction* action);
signals: signals:
//void movePoint(QPointF newCoord); //void movePoint(QPointF newCoord);
void captureMapCoordinateClick(const QPointF coordinate); //ROCA void captureMapCoordinateClick(const QPointF coordinate); //ROCA
...@@ -145,8 +146,8 @@ protected: ...@@ -145,8 +146,8 @@ protected:
private: private:
Ui::MapWidget *m_ui; Ui::MapWidget *m_ui;
QList<qmapcontrol::Point*> wps; QList<qmapcontrol::Point*> wps;
qmapcontrol::LineString* waypointPath;
QHash <QString, qmapcontrol::Point*> wpIndex; QHash <QString, qmapcontrol::Point*> wpIndex;
qmapcontrol::LineString* path;
QPen* pointPen; QPen* pointPen;
int wpExists(const QPointF coordinate); int wpExists(const QPointF coordinate);
bool waypointIsDrag; bool waypointIsDrag;
......
...@@ -307,7 +307,8 @@ void QGCDataPlot2D::selectFile() ...@@ -307,7 +307,8 @@ void QGCDataPlot2D::selectFile()
void QGCDataPlot2D::loadRawLog(QString file, QString xAxisName, QString yAxisFilter) void QGCDataPlot2D::loadRawLog(QString file, QString xAxisName, QString yAxisFilter)
{ {
qDebug() << "LOADING RAW LOG!"; Q_UNUSED(xAxisName);
Q_UNUSED(yAxisFilter);
if (logFile != NULL) if (logFile != NULL)
{ {
...@@ -320,23 +321,6 @@ void QGCDataPlot2D::loadRawLog(QString file, QString xAxisName, QString yAxisFil ...@@ -320,23 +321,6 @@ void QGCDataPlot2D::loadRawLog(QString file, QString xAxisName, QString yAxisFil
connect(compressor, SIGNAL(logProcessingStatusChanged(QString)), MainWindow::instance(), SLOT(showStatusMessage(QString))); connect(compressor, SIGNAL(logProcessingStatusChanged(QString)), MainWindow::instance(), SLOT(showStatusMessage(QString)));
connect(compressor, SIGNAL(finishedFile(QString)), this, SLOT(loadFile(QString))); connect(compressor, SIGNAL(finishedFile(QString)), this, SLOT(loadFile(QString)));
compressor->startCompression(); compressor->startCompression();
// // Block UI
// QProgressDialog progress("Transforming RAW log file to CSV", "Abort Transformation", 0, 1, this);
// progress.setWindowModality(Qt::WindowModal);
// while (!compressor->isFinished())
// {
// MG::SLEEP::usleep(100000);
//// progress.setMaximum(compressor->getDataLines());
//// progress.setValue(compressor->getCurrentLine());
// }
// // Enforce end
// progress.setMaximum(compressor->getDataLines());
// progress.setValue(compressor->getDataLines());
// Done with preprocessing - now load csv log
//loadFile(logFile->fileName());
} }
/** /**
......
...@@ -197,20 +197,28 @@ void WaypointList::add() ...@@ -197,20 +197,28 @@ void WaypointList::add()
{ {
const QVector<Waypoint *> &waypoints = uas->getWaypointManager().getWaypointList(); const QVector<Waypoint *> &waypoints = uas->getWaypointManager().getWaypointList();
Waypoint *wp;
if (waypoints.size() > 0) if (waypoints.size() > 0)
{ {
// Create waypoint with last frame
Waypoint *last = waypoints.at(waypoints.size()-1); Waypoint *last = waypoints.at(waypoints.size()-1);
Waypoint *wp = new Waypoint(0, last->getX(), last->getY(), last->getZ(), last->getYaw(), last->getAutoContinue(), false, last->getOrbit(), wp = new Waypoint(0, last->getX(), last->getY(), last->getZ(), last->getYaw(), last->getAutoContinue(), false, last->getOrbit(),
last->getHoldTime(), last->getFrame(), last->getAction()); last->getHoldTime(), last->getFrame(), last->getAction());
uas->getWaypointManager().addWaypoint(wp); uas->getWaypointManager().addWaypoint(wp);
} }
else else
{ {
//isLocalWP = true; // Create global frame waypoint per default
Waypoint *wp = new Waypoint(0, uas->getLongitude(), uas->getLatitude(), uas->getAltitude(), wp = new Waypoint(0, uas->getLongitude(), uas->getLatitude(), uas->getAltitude(),
0.0, true, true, 0.15, 2000); 0.0, true, true, 0.15, 2000);
uas->getWaypointManager().addWaypoint(wp); uas->getWaypointManager().addWaypoint(wp);
} }
if (wp->getFrame() == MAV_FRAME_GLOBAL)
{
emit createWaypointAtMap(QPointF(wp->getX(), wp->getY()));
}
} }
} }
} }
......
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