|
|
|
@ -141,6 +141,7 @@ Vehicle::Vehicle(LinkInterface* link,
@@ -141,6 +141,7 @@ Vehicle::Vehicle(LinkInterface* link,
|
|
|
|
|
connect(this, &Vehicle::_sendMessageOnThread, this, &Vehicle::_sendMessage, Qt::QueuedConnection); |
|
|
|
|
connect(this, &Vehicle::_sendMessageOnLinkOnThread, this, &Vehicle::_sendMessageOnLink, Qt::QueuedConnection); |
|
|
|
|
connect(this, &Vehicle::flightModeChanged, this, &Vehicle::_announceflightModeChanged); |
|
|
|
|
connect(this, &Vehicle::armedChanged, this, &Vehicle::_announceArmedChanged); |
|
|
|
|
|
|
|
|
|
_uas = new UAS(_mavlink, this, _firmwarePluginManager); |
|
|
|
|
|
|
|
|
@ -224,6 +225,9 @@ Vehicle::Vehicle(LinkInterface* link,
@@ -224,6 +225,9 @@ Vehicle::Vehicle(LinkInterface* link,
|
|
|
|
|
_batteryFactGroup.setVehicle(this); |
|
|
|
|
_windFactGroup.setVehicle(this); |
|
|
|
|
_vibrationFactGroup.setVehicle(this); |
|
|
|
|
|
|
|
|
|
_announceArmedChanged(armed()); |
|
|
|
|
_announceflightModeChanged(flightMode()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Disconnected Vehicle
|
|
|
|
@ -467,7 +471,7 @@ void Vehicle::_handleSysStatus(mavlink_message_t& message)
@@ -467,7 +471,7 @@ void Vehicle::_handleSysStatus(mavlink_message_t& message)
|
|
|
|
|
if (sysStatus.battery_remaining > 0 && sysStatus.battery_remaining < _batteryFactGroup.percentRemainingAnnounce()->rawValue().toInt()) { |
|
|
|
|
if (!_lowBatteryAnnounceTimer.isValid() || _lowBatteryAnnounceTimer.elapsed() > _lowBatteryAnnounceRepeatMSecs) { |
|
|
|
|
_lowBatteryAnnounceTimer.restart(); |
|
|
|
|
_say(QString("Low battery on %1: %2 percent remaining").arg(_vehicleIdSpeech()).arg(sysStatus.battery_remaining)); |
|
|
|
|
_say(QString("%1 low battery: %2 percent remaining").arg(_vehicleIdSpeech()).arg(sysStatus.battery_remaining)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1288,7 +1292,7 @@ void Vehicle::_connectionLostTimeout(void)
@@ -1288,7 +1292,7 @@ void Vehicle::_connectionLostTimeout(void)
|
|
|
|
|
_connectionLost = true; |
|
|
|
|
_heardFrom = false; |
|
|
|
|
emit connectionLostChanged(true); |
|
|
|
|
_say(QString("communication lost to %1").arg(_vehicleIdSpeech())); |
|
|
|
|
_say(QString("%1 communication lost").arg(_vehicleIdSpeech())); |
|
|
|
|
if (_autoDisconnect) { |
|
|
|
|
disconnectInactiveVehicle(); |
|
|
|
|
} |
|
|
|
@ -1301,7 +1305,7 @@ void Vehicle::_connectionActive(void)
@@ -1301,7 +1305,7 @@ void Vehicle::_connectionActive(void)
|
|
|
|
|
if (_connectionLost) { |
|
|
|
|
_connectionLost = false; |
|
|
|
|
emit connectionLostChanged(false); |
|
|
|
|
_say(QString("communication regained to %1").arg(_vehicleIdSpeech())); |
|
|
|
|
_say(QString("% 1 communication regained").arg(_vehicleIdSpeech())); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1344,15 +1348,26 @@ QString Vehicle::_vehicleIdSpeech(void)
@@ -1344,15 +1348,26 @@ QString Vehicle::_vehicleIdSpeech(void)
|
|
|
|
|
if (qgcApp()->toolbox()->multiVehicleManager()->vehicles()->count() > 1) { |
|
|
|
|
return QString("vehicle %1").arg(id()); |
|
|
|
|
} else { |
|
|
|
|
return QStringLiteral("vehicle"); |
|
|
|
|
return QString(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Vehicle::_announceflightModeChanged(const QString& flightMode) |
|
|
|
|
{ |
|
|
|
|
_say(QString("%1 is now in %2 flight mode").arg(_vehicleIdSpeech()).arg(flightMode)); |
|
|
|
|
_say(QString("%1 %2 flight mode").arg(_vehicleIdSpeech()).arg(flightMode)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Vehicle::_announceArmedChanged(bool armed) |
|
|
|
|
{ |
|
|
|
|
_say(QString("%1 %2").arg(_vehicleIdSpeech()).arg(armed ? QStringLiteral("armed") : QStringLiteral("disarmed"))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Vehicle::clearTrajectoryPoints(void) |
|
|
|
|
{ |
|
|
|
|
_mapTrajectoryList.clearAndDeleteContents(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const char* VehicleGPSFactGroup::_hdopFactName = "hdop"; |
|
|
|
|
const char* VehicleGPSFactGroup::_vdopFactName = "vdop"; |
|
|
|
|
const char* VehicleGPSFactGroup::_courseOverGroundFactName = "courseOverGround"; |
|
|
|
|