mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 09:18:54 -05:00
AIS - Handle ShipStaticData being received before position
This commit is contained in:
parent
267ae13534
commit
73848c94e4
@ -663,8 +663,10 @@ void AISGUI::updateVessels(AISMessage *ais, QDateTime dateTime)
|
||||
QString status = statusItem->text();
|
||||
|
||||
// Only update model if change in type - so we don't keeping picking new
|
||||
// random models
|
||||
if ((previousType != type) || (previousShipType != shipType)) {
|
||||
// random models.
|
||||
// Check if image is empty to handle case where ShipStaticData is received
|
||||
// before position
|
||||
if ((previousType != type) || (previousShipType != shipType) || vessel->m_image.isEmpty()) {
|
||||
getImageAndModel(type, shipType, length, status, vessel);
|
||||
}
|
||||
|
||||
@ -712,7 +714,6 @@ void AISGUI::updateVessels(AISMessage *ais, QDateTime dateTime)
|
||||
if (!status.isEmpty()) {
|
||||
text.append(QString("Status: %1").arg(status));
|
||||
}
|
||||
|
||||
// Send to map feature
|
||||
sendToMap(mmsiItem->text(), callsign,
|
||||
vessel->m_image, text.join("<br>"),
|
||||
@ -724,7 +725,7 @@ void AISGUI::updateVessels(AISMessage *ais, QDateTime dateTime)
|
||||
|
||||
void AISGUI::getImageAndModel(const QString &type, const QString &shipType, int length, const QString &status, Vessel *vessel)
|
||||
{
|
||||
if (type == "Aircraft")
|
||||
if (type == "Aircraft")
|
||||
{
|
||||
// I presume search and rescue aircraft are more likely to be helicopters
|
||||
vessel->m_image = "helicopter.png";
|
||||
@ -766,7 +767,7 @@ void AISGUI::getImageAndModel(const QString &type, const QString &shipType, int
|
||||
vessel->m_model = "ship_65m.glbe";
|
||||
}
|
||||
}
|
||||
else if ((shipType == "Tug") || (shipType == "Port tender") || (shipType == "Pilot vessel"))
|
||||
else if ((shipType == "Tug") || (shipType == "Port tender") || (shipType == "Pilot vessel") || (shipType == "Vessel - Towing"))
|
||||
{
|
||||
vessel->m_image = "tug.png";
|
||||
if (length < 25)
|
||||
|
Loading…
Reference in New Issue
Block a user