Commit 16a64ab0 authored by Don Gagne's avatar Don Gagne

Merge pull request #1799 from Prioria/bugfixes

QGC bugfixes 
parents 33d375bb 9e047cc0
......@@ -106,6 +106,7 @@ void SetupView::showFirmware(void)
"showFirmwarePanel",
Q_RETURN_ARG(QVariant, returnedValue));
Q_ASSERT(success);
Q_UNUSED(success);
#endif
}
......@@ -116,6 +117,7 @@ void SetupView::showParameters(void)
"showParametersPanel",
Q_RETURN_ARG(QVariant, returnedValue));
Q_ASSERT(success);
Q_UNUSED(success);
}
void SetupView::showSummary(void)
......@@ -125,6 +127,7 @@ void SetupView::showSummary(void)
"showSummaryPanel",
Q_RETURN_ARG(QVariant, returnedValue));
Q_ASSERT(success);
Q_UNUSED(success);
}
void SetupView::showVehicleComponentSetup(VehicleComponent* vehicleComponent)
......@@ -135,6 +138,7 @@ void SetupView::showVehicleComponentSetup(VehicleComponent* vehicleComponent)
Q_RETURN_ARG(QVariant, returnedValue),
Q_ARG(QVariant, QVariant::fromValue((VehicleComponent*)vehicleComponent)));
Q_ASSERT(success);
Q_UNUSED(success);
}
#endif
......
......@@ -49,7 +49,7 @@ class VehicleComponent : public QObject
Q_PROPERTY(QString setupStateDescription READ setupStateDescription STORED false)
Q_PROPERTY(QString iconResource READ iconResource CONSTANT)
Q_PROPERTY(QUrl setupSource READ setupSource CONSTANT)
Q_PROPERTY(QUrl summaryQmlSource READ summaryQmlSource CONSTANT);
Q_PROPERTY(QUrl summaryQmlSource READ summaryQmlSource CONSTANT)
Q_PROPERTY(QString prerequisiteSetup READ prerequisiteSetup)
public:
......
......@@ -70,6 +70,7 @@ QGCFlightGearLink::QGCFlightGearLink(UASInterface* mav, QString startupArguments
// We need a mechanism so show error message from our FGLink thread on the UI thread. This signal connection will do that for us.
connect(this, &QGCFlightGearLink::showCriticalMessageFromThread, qgcApp(), &QGCApplication::criticalMessageBoxOnMainThread);
connect(this, &QGCFlightGearLink::disconnectSim, this, &QGCFlightGearLink::disconnectSimulation);
}
QGCFlightGearLink::~QGCFlightGearLink()
......@@ -496,13 +497,13 @@ bool QGCFlightGearLink::disconnectSimulation()
if (_fgProcess)
{
_fgProcess->close();
delete _fgProcess;
_fgProcess->deleteLater();
_fgProcess = NULL;
}
if (_udpCommSocket)
{
_udpCommSocket->close();
delete _udpCommSocket;
_udpCommSocket->deleteLater();
_udpCommSocket = NULL;
}
......
......@@ -83,6 +83,11 @@ signals:
**/
void simulationDisconnected();
/**
* @brief Thread safe signal to disconnect simulator from other threads
**/
void disconnectSim();
/**
* @brief This signal is emitted instantly when the link status changes
**/
......
......@@ -3227,7 +3227,7 @@ void UAS::startHil()
void UAS::stopHil()
{
if (simulation && simulation->isConnected()) {
simulation->disconnectSimulation();
simulation->disconnectSim();
setMode(base_mode & ~MAV_MODE_FLAG_HIL_ENABLED, custom_mode);
qDebug() << __FILE__ << __LINE__ << "HIL is onboard not enabled, trying to disable.";
}
......
......@@ -786,14 +786,9 @@ void TimeSeriesData::setAverageWindowSize(int windowSize)
void TimeSeriesData::append(quint64 ms, double value)
{
dataMutex.lock();
// Pre- allocate new space
// FIXME Check this for validity
if(static_cast<quint64>(size()) < (count + 100)) {
this->ms.resize(size() + 10000);
this->value.resize(size() + 10000);
}
this->ms[count] = ms;
this->value[count] = value;
// Qt will automatically use a smart growth strategy: http://doc.qt.io/qt-5/containers.html#growth-strategies
this->ms.append(ms);
this->value.append(value);
this->lastValue = value;
this->mean = 0;
//QList<double> medianList = QList<double>();
......
......@@ -361,6 +361,7 @@ void LinechartWidget::appendData(int uasId, const QString& curve, const QString&
timeButton->blockSignals(false);
if (activePlot) activePlot->enforceGroundTime(true);
}
lastTimestamp = usec;
}
// Log data
......
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