Browse Source

Minor fix to simulation link

QGC4.4
lm 14 years ago
parent
commit
221a43af8b
  1. 17
      src/comm/MAVLinkSimulationLink.cc
  2. 4
      src/ui/QGCParamWidget.cc

17
src/comm/MAVLinkSimulationLink.cc

@ -845,11 +845,14 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
break; break;
case MAVLINK_MSG_ID_PARAM_SET: case MAVLINK_MSG_ID_PARAM_SET:
{ {
qDebug() << "SIMULATION RECEIVED COMMAND TO SET PARAMETER"; // Drop on even milliseconds
mavlink_param_set_t set; if (QGC::groundTimeMilliseconds() % 2 == 0)
mavlink_msg_param_set_decode(&msg, &set); {
// if (set.target_system == systemId) qDebug() << "SIMULATION RECEIVED COMMAND TO SET PARAMETER";
// { mavlink_param_set_t set;
mavlink_msg_param_set_decode(&msg, &set);
// if (set.target_system == systemId)
// {
QString key = QString((char*)set.param_id); QString key = QString((char*)set.param_id);
if (onboardParams.contains(key)) if (onboardParams.contains(key))
{ {
@ -864,8 +867,10 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size)
memcpy(stream+streampointer,buffer, bufferlength); memcpy(stream+streampointer,buffer, bufferlength);
streampointer+=bufferlength; streampointer+=bufferlength;
} }
// } // }
}
} }
break;
case MAVLINK_MSG_ID_PARAM_REQUEST_READ: case MAVLINK_MSG_ID_PARAM_REQUEST_READ:
{ {
qDebug() << "SIMULATION RECEIVED COMMAND TO SEND PARAMETER"; qDebug() << "SIMULATION RECEIVED COMMAND TO SEND PARAMETER";

4
src/ui/QGCParamWidget.cc

@ -282,7 +282,7 @@ void QGCParamWidget::addParameter(int uas, int component, int paramCount, int pa
else if (justWritten && writeMismatch) else if (justWritten && writeMismatch)
{ {
// Mismatch, tell user // Mismatch, tell user
statusLabel->setText(tr("FAILURE: Wrote %1: sent %2 != onboard %3").arg(parameterName).arg(map->value(parameterName), value)); statusLabel->setText(tr("FAILURE: Wrote %1: sent %2 != onboard %3").arg(parameterName).arg(map->value(parameterName)).arg(value));
} }
else else
{ {
@ -704,7 +704,7 @@ void QGCParamWidget::retransmissionGuardTick()
{ {
// Re-request write operation // Re-request write operation
emit parameterChanged(component, key, missingParams->value(key)); emit parameterChanged(component, key, missingParams->value(key));
statusLabel->setText(tr("Re-requested write: %1: %2").arg(key).arg(missingParams->value(key))); statusLabel->setText(tr("Requested rewrite of: %1: %2").arg(key).arg(missingParams->value(key)));
count++; count++;
} }
else else

Loading…
Cancel
Save