mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-08-01 13:32:33 -04:00
Remove ships from map on close.
This commit is contained in:
parent
40f560daec
commit
a522653676
@ -239,6 +239,16 @@ AISGUI::AISGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *featur
|
|||||||
|
|
||||||
AISGUI::~AISGUI()
|
AISGUI::~AISGUI()
|
||||||
{
|
{
|
||||||
|
// Remove all ships from map
|
||||||
|
for (int row = ui->vessels->rowCount() - 1; row >= 0; row--)
|
||||||
|
{
|
||||||
|
QString mmsi = ui->vessels->item(row, VESSEL_COL_MMSI)->text();
|
||||||
|
sendToMap(mmsi, "",
|
||||||
|
"", "",
|
||||||
|
"", 0.0f, 0.0f,
|
||||||
|
0.0f, 0.0f, QDateTime(),
|
||||||
|
0.0f);
|
||||||
|
}
|
||||||
qDeleteAll(m_vessels);
|
qDeleteAll(m_vessels);
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
@ -343,8 +353,8 @@ void AISGUI::removeOldVessels()
|
|||||||
0.0f);
|
0.0f);
|
||||||
// Remove from table
|
// Remove from table
|
||||||
ui->vessels->removeRow(row);
|
ui->vessels->removeRow(row);
|
||||||
// Remove from hash
|
// Remove from hash and free memory
|
||||||
m_vessels.remove(mmsi);
|
delete m_vessels.take(mmsi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -458,8 +468,11 @@ void AISGUI::sendToMap(const QString &name, const QString &label,
|
|||||||
swgMapItem->setAltitude(0);
|
swgMapItem->setAltitude(0);
|
||||||
swgMapItem->setAltitudeReference(1); // CLAMP_TO_GROUND
|
swgMapItem->setAltitudeReference(1); // CLAMP_TO_GROUND
|
||||||
|
|
||||||
if (positionDateTime.isValid()) {
|
if (positionDateTime.isValid())
|
||||||
|
{
|
||||||
swgMapItem->setPositionDateTime(new QString(positionDateTime.toString(Qt::ISODateWithMs)));
|
swgMapItem->setPositionDateTime(new QString(positionDateTime.toString(Qt::ISODateWithMs)));
|
||||||
|
swgMapItem->setOrientationDateTime(new QString(positionDateTime.toString(Qt::ISODateWithMs)));
|
||||||
|
swgMapItem->setAvailableUntil(new QString(positionDateTime.addSecs(10*60).toString(Qt::ISODateWithMs)));
|
||||||
}
|
}
|
||||||
|
|
||||||
swgMapItem->setImageRotation(heading);
|
swgMapItem->setImageRotation(heading);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user