AIS feature: use course if heading is not available for ship image orientation in Map feature

pull/951/head
f4exb 2021-07-04 11:25:53 +02:00
rodzic 103f6f6181
commit 268318e02c
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -538,8 +538,11 @@ void AISGUI::updateVessels(AISMessage *ais)
if (!destination.isEmpty()) {
text.append(QString("Destination: %1").arg(destination));
}
if (!courseV.isNull()) {
text.append(QString("Course: %1%2").arg(courseV.toFloat()).arg(QChar(0xb0)));
if (!courseV.isNull())
{
float course = courseV.toFloat();
text.append(QString("Course: %1%2").arg(course).arg(QChar(0xb0)));
swgMapItem->setImageRotation(course);
}
if (!speedV.isNull()) {
text.append(QString("Speed: %1 knts").arg(speedV.toFloat()));
@ -548,7 +551,7 @@ void AISGUI::updateVessels(AISMessage *ais)
{
float heading = headingV.toFloat();
text.append(QString("Heading: %1%2").arg(heading).arg(QChar(0xb0)));
swgMapItem->setImageRotation(heading);
swgMapItem->setImageRotation(heading); // heading takes precedence over course
}
if (!shipType.isEmpty()) {
text.append(QString("Ship type: %1").arg(shipType));