Commit d28aa046 authored by Lorenz Meier's avatar Lorenz Meier

Minor polishing on error messages and fixed link outage time announcement

parent d19ac386
...@@ -204,11 +204,16 @@ void UAS::updateState() ...@@ -204,11 +204,16 @@ void UAS::updateState()
emit heartbeatTimeout(heartbeatInterval); emit heartbeatTimeout(heartbeatInterval);
emit heartbeatTimeout(); emit heartbeatTimeout();
connectionLost = true; connectionLost = true;
connectionLossTime = heartbeatInterval;
QString audiostring = QString("Link lost to system %1").arg(this->getUASID()); QString audiostring = QString("Link lost to system %1").arg(this->getUASID());
GAudioOutput::instance()->say(audiostring.toLower()); GAudioOutput::instance()->say(audiostring.toLower());
} }
// Update connection loss time on each iteration
if (connectionLost && (heartbeatInterval > timeoutIntervalHeartbeat))
{
connectionLossTime = heartbeatInterval;
}
// Connection gained // Connection gained
if (connectionLost && (heartbeatInterval < timeoutIntervalHeartbeat)) if (connectionLost && (heartbeatInterval < timeoutIntervalHeartbeat))
{ {
...@@ -1182,6 +1187,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -1182,6 +1187,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
case MAVLINK_MSG_ID_NAMED_VALUE_FLOAT: case MAVLINK_MSG_ID_NAMED_VALUE_FLOAT:
case MAVLINK_MSG_ID_NAMED_VALUE_INT: case MAVLINK_MSG_ID_NAMED_VALUE_INT:
case MAVLINK_MSG_ID_MANUAL_CONTROL: case MAVLINK_MSG_ID_MANUAL_CONTROL:
case MAVLINK_MSG_ID_HIGHRES_IMU:
break; break;
default: default:
{ {
......
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