Commit 5ceb7b27 authored by Susurrus's avatar Susurrus

Merge pull request #1347 from Susurrus/audio_imps

Audio improvements
parents ed9c6f45 8fad0044
...@@ -561,7 +561,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -561,7 +561,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
if (statechanged && ((int)state.system_status == (int)MAV_STATE_CRITICAL || state.system_status == (int)MAV_STATE_EMERGENCY)) if (statechanged && ((int)state.system_status == (int)MAV_STATE_CRITICAL || state.system_status == (int)MAV_STATE_EMERGENCY))
{ {
GAudioOutput::instance()->say(QString("emergency for system %1").arg(this->getUASID()), GAudioOutput::AUDIO_SEVERITY_EMERGENCY); GAudioOutput::instance()->say(QString("Emergency for system %1").arg(this->getUASID()), GAudioOutput::AUDIO_SEVERITY_EMERGENCY);
QTimer::singleShot(3000, GAudioOutput::instance(), SLOT(startEmergency())); QTimer::singleShot(3000, GAudioOutput::instance(), SLOT(startEmergency()));
} }
else if (modechanged || statechanged) else if (modechanged || statechanged)
...@@ -617,7 +617,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -617,7 +617,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
/* warn only every 12 seconds */ /* warn only every 12 seconds */
&& (QGC::groundTimeUsecs() - lastVoltageWarning) > 12000000) && (QGC::groundTimeUsecs() - lastVoltageWarning) > 12000000)
{ {
GAudioOutput::instance()->say(QString("voltage warning: %1 volts").arg(lpVoltage, 0, 'f', 1, QChar(' '))); GAudioOutput::instance()->say(QString("Voltage warning for system %1: %2 volts").arg(getUASID()).arg(lpVoltage, 0, 'f', 1, QChar(' ')));
lastVoltageWarning = QGC::groundTimeUsecs(); lastVoltageWarning = QGC::groundTimeUsecs();
lastTickVoltageValue = tickLowpassVoltage; lastTickVoltageValue = tickLowpassVoltage;
} }
...@@ -1209,7 +1209,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -1209,7 +1209,7 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
mavlink_mission_item_reached_t wpr; mavlink_mission_item_reached_t wpr;
mavlink_msg_mission_item_reached_decode(&message, &wpr); mavlink_msg_mission_item_reached_decode(&message, &wpr);
waypointManager.handleWaypointReached(message.sysid, message.compid, &wpr); waypointManager.handleWaypointReached(message.sysid, message.compid, &wpr);
QString text = QString("System %1 reached waypoint %2").arg(getUASName()).arg(wpr.seq); QString text = QString("System %1 reached waypoint %2").arg(getUASID()).arg(wpr.seq);
GAudioOutput::instance()->say(text); GAudioOutput::instance()->say(text);
emit textMessageReceived(message.sysid, message.compid, MAV_SEVERITY_INFO, text); emit textMessageReceived(message.sysid, message.compid, MAV_SEVERITY_INFO, text);
} }
...@@ -3360,7 +3360,7 @@ void UAS::startLowBattAlarm() ...@@ -3360,7 +3360,7 @@ void UAS::startLowBattAlarm()
{ {
if (!lowBattAlarm) if (!lowBattAlarm)
{ {
GAudioOutput::instance()->alert(tr("system %1 has low battery").arg(getUASName())); GAudioOutput::instance()->alert(tr("System %1 has low battery").arg(getUASID()));
QTimer::singleShot(3000, GAudioOutput::instance(), SLOT(startEmergency())); QTimer::singleShot(3000, GAudioOutput::instance(), SLOT(startEmergency()));
lowBattAlarm = true; lowBattAlarm = true;
} }
......
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