Browse Source

Expanded documentation for UASInfoWidget::update*Loss.

Changed the drop rate from a SYS_STATUS message to follow the MAVLink specs along with some extra range checking.
QGC4.4
Bryant Mairs 13 years ago
parent
commit
b03070d0d6
  1. 12
      src/uas/UAS.cc
  2. 14
      src/ui/uas/UASInfoWidget.h

12
src/uas/UAS.cc

@ -428,9 +428,15 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) @@ -428,9 +428,15 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
stopLowBattAlarm();
}
// COMMUNICATIONS DROP RATE
// FIXME
emit dropRateChanged(this->getUASID(), state.drop_rate_comm/10000.0f);
// Trigger drop rate updates as needed. Here we convert the incoming
// drop_rate_comm value from 1/100 of a percent in a uint16 to a true
// percentage as a float. We also cap the incoming value at 100% as defined
// by the MAVLink specifications.
if (state.drop_rate_comm > 10000) {
emit dropRateChanged(this->getUASID(), 100.0f);
} else {
emit dropRateChanged(this->getUASID(), state.drop_rate_comm/100.0f);
}
}
break;
case MAVLINK_MSG_ID_ATTITUDE:

14
src/ui/uas/UASInfoWidget.h

@ -57,10 +57,20 @@ public slots: @@ -57,10 +57,20 @@ public slots:
void updateBattery(UASInterface* uas, double voltage, double percent, int seconds);
void updateCPULoad(UASInterface* uas, double load);
/** @brief Set the loss rate of packets received by the MAV */
/**
* @brief Set the loss rate of packets received by the MAV.
* @param uasId UNUSED
* @param receiveLoss A percentage value (0-100) of how many message the UAS has failed to receive.
*/
void updateReceiveLoss(int uasId, float receiveLoss);
/** @brief Set the loss rate of packets sent from the MAV */
/**
* @brief Set the loss rate of packets sent from the MAV
* @param uasId UNUSED
* @param sendLoss A percentage value (0-100) of how many message QGC has failed to receive.
*/
void updateSendLoss(int uasId, float sendLoss);
/** @brief Update the error count */
void updateErrorCount(int uasid, QString component, QString device, int count);

Loading…
Cancel
Save