Browse Source

minor fixes

QGC4.4
pixhawk 15 years ago
parent
commit
1528a1c194
  1. 3
      src/comm/MAVLinkSimulationLink.cc
  2. 6
      src/uas/UAS.cc
  3. 3
      src/ui/linechart/LinechartPlot.cc
  4. 7
      src/ui/linechart/LinechartPlot.h

3
src/comm/MAVLinkSimulationLink.cc

@ -523,6 +523,9 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size) @@ -523,6 +523,9 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
{
mavlink_action_t action;
mavlink_msg_action_decode(&msg, &action);
qDebug() << "SIM" << "received action" << action.action << "for system" << action.target;
switch (action.action)
{
case MAV_ACTION_LAUNCH:

6
src/uas/UAS.cc

@ -834,10 +834,10 @@ void UAS::setWaypoint(Waypoint* wp) @@ -834,10 +834,10 @@ void UAS::setWaypoint(Waypoint* wp)
mavlink_message_t msg;
mavlink_waypoint_set_t set;
set.id = wp->id;
QString name = wp->name;
//QString name = wp->name;
// FIXME Check if this works properly
name.truncate(MAVLINK_MSG_WAYPOINT_SET_FIELD_NAME_LEN);
strcpy((char*)set.name, name.toStdString().c_str());
//name.truncate(MAVLINK_MSG_WAYPOINT_SET_FIELD_NAME_LEN);
//strcpy((char*)set.name, name.toStdString().c_str());
set.autocontinue = wp->autocontinue;
set.target_component = 0;
set.target_system = uasId;

3
src/ui/linechart/LinechartPlot.cc

@ -715,6 +715,7 @@ void TimeSeriesData::append(quint64 ms, double value) @@ -715,6 +715,7 @@ void TimeSeriesData::append(quint64 ms, double value)
}
this->ms[count] = ms;
this->value[count] = value;
this->lastValue = value;
this->mean = 0;
QList<double> medianList = QList<double>();
for (unsigned int i = 0; (i < averageWindow) && (((int)count - (int)i) >= 0); ++i)
@ -824,7 +825,7 @@ double TimeSeriesData::getMedian() @@ -824,7 +825,7 @@ double TimeSeriesData::getMedian()
double TimeSeriesData::getCurrentValue()
{
return ms.last();
return lastValue;
}
/**

7
src/ui/linechart/LinechartPlot.h

@ -149,9 +149,10 @@ protected: @@ -149,9 +149,10 @@ protected:
quint64 plotCount;
QString friendlyName;
double minValue;
double maxValue;
double zeroValue;
double lastValue; ///< The last inserted value
double minValue; ///< The smallest value in the dataset
double maxValue; ///< The largest value in the dataset
double zeroValue; ///< The expected value in the dataset
QMutex dataMutex;

Loading…
Cancel
Save