diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 073c940eeb739298ebe158371f26061d3f1f93ed..39882258ea5bacfba6d44d239abd31752fb35c1e 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -1259,8 +1259,10 @@ void UAS::enableExtra3Transmission(int rate) * @param id Name of the parameter * @param value Parameter value */ -void UAS::setParameter(int component, QString id, float value) -{ +void UAS::setParameter(const int component, const QString& id, const float value) +{ + if (!id.isNull()) + { mavlink_message_t msg; mavlink_param_set_t p; p.param_value = value; @@ -1288,6 +1290,7 @@ void UAS::setParameter(int component, QString id, float value) } mavlink_msg_param_set_encode(mavlink->getSystemId(), mavlink->getComponentId(), &msg, &p); sendMessage(msg); + } } /** diff --git a/src/uas/UAS.h b/src/uas/UAS.h index 410b15e4a23362a93946744c8972ce72b16979dd..bb0333184ae68410628a12f1e62d25d5e3f5862c 100644 --- a/src/uas/UAS.h +++ b/src/uas/UAS.h @@ -239,7 +239,7 @@ public slots: void requestParameters(); /** @brief Set a system parameter */ - void setParameter(int component, QString id, float value); + void setParameter(const int component, const QString& id, const float value); /** @brief Write parameters to permanent storage */ void writeParametersToStorage(); diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h index 8bbc716b981360663a4592aecf532689384f3a62..0b00419907cbe0d5b7f3af47a2f9250683bbb325 100644 --- a/src/uas/UASInterface.h +++ b/src/uas/UASInterface.h @@ -214,7 +214,7 @@ public slots: * @warning The length of the ID string is limited by the MAVLink format! Take care to not exceed it * @param value Value of the parameter, IEEE 754 single precision floating point */ - virtual void setParameter(int component, QString id, float value) = 0; + virtual void setParameter(const int component, const QString& id, const float value) = 0; /** * @brief Add a link to the list of current links @@ -327,8 +327,14 @@ signals: * @param value the value that changed * @param msec the timestamp of the message, in milliseconds */ + + // FIXME Exchange the lines below against the commented ones void valueChanged(int uasId, QString name, double value, quint64 msec); void valueChanged(UASInterface* uas, QString name, double value, quint64 msec); + +// void valueChanged(const int uasId, const QString& name, const double value, const quint64 msec); +// //void valueChanged(UASInterface* uas, QString name, double value, quint64 msec); + void voltageChanged(int uasId, double voltage); void waypointUpdated(int uasId, int id, double x, double y, double z, double yaw, bool autocontinue, bool active); void waypointSelected(int uasId, int id); diff --git a/src/ui/HUD.cc b/src/ui/HUD.cc index 0832671744731c374bdd5f588fa47834a9c5a907..2d57262366913602c610f7d03373abf9178f9230 100644 --- a/src/ui/HUD.cc +++ b/src/ui/HUD.cc @@ -285,7 +285,7 @@ void HUD::updateAttitudeThrustSetPoint(UASInterface*, double rollDesired, double void HUD::updateAttitude(UASInterface* uas, double roll, double pitch, double yaw, quint64 timestamp) { - qDebug() << __FILE__ << __LINE__ << "ROLL" << yaw; + //qDebug() << __FILE__ << __LINE__ << "YAW" << yaw; updateValue(uas, "roll", roll, timestamp); updateValue(uas, "pitch", pitch, timestamp); updateValue(uas, "yaw", yaw, timestamp); diff --git a/src/ui/linechart/LinechartPlot.cc b/src/ui/linechart/LinechartPlot.cc index 49194b5fab210ea896fd8501cc37a83e90925250..606c3bddf61be9313659c276b2e481b0c196b077 100644 --- a/src/ui/linechart/LinechartPlot.cc +++ b/src/ui/linechart/LinechartPlot.cc @@ -254,7 +254,8 @@ void LinechartPlot::appendData(QString dataname, quint64 ms, double value) if(ms < minTime) minTime = ms; if(ms > maxTime) maxTime = ms; storageInterval = maxTime - minTime; - lastTime = time; + + if(time > lastTime) lastTime = time; // if (value < minValue) minValue = value; @@ -276,6 +277,8 @@ void LinechartPlot::appendData(QString dataname, quint64 ms, double value) void LinechartPlot::enforceGroundTime(bool enforce) { m_groundTime = enforce; + + lastTime = QGC::groundTimeUsecs()/1000; } /**