mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
Ref T362, Ref T348 improved matcher saves removed models (if any) when destructed and improved UI
This commit is contained in:
@@ -48,14 +48,7 @@ namespace BlackCore
|
||||
|
||||
CAircraftMatcher::~CAircraftMatcher()
|
||||
{
|
||||
if (!m_removedModels.isEmpty())
|
||||
{
|
||||
// log the models
|
||||
const QString fileName("removed models %1.json");
|
||||
const QString ts = QDateTime::currentDateTimeUtc().toString("yyyyMMddHHmmss");
|
||||
const QString json = m_removedModels.toJsonString();
|
||||
CFileUtils::writeStringToFile(json, CFileUtils::appendFilePathsAndFixUnc(CDirectoryUtils::logDirectory(), fileName.arg(ts)));
|
||||
}
|
||||
this->saveRemovedModels();
|
||||
}
|
||||
|
||||
bool CAircraftMatcher::setSetup(const CAircraftMatcherSetup &setup)
|
||||
@@ -688,6 +681,16 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
bool CAircraftMatcher::saveRemovedModels()
|
||||
{
|
||||
if (m_removedModels.isEmpty()) { return false; }
|
||||
// log the models
|
||||
const QString fileName("removed models %1.json");
|
||||
const QString ts = QDateTime::currentDateTimeUtc().toString("yyyyMMddHHmmss");
|
||||
const QString json = m_removedModels.toJsonString();
|
||||
return CFileUtils::writeStringToFile(json, CFileUtils::appendFilePathsAndFixUnc(CDirectoryUtils::logDirectory(), fileName.arg(ts)));
|
||||
}
|
||||
|
||||
CAircraftModelList CAircraftMatcher::getClosestMatchStepwiseReduceImplementation(const CAircraftModelList &modelSet, const CAircraftMatcherSetup &setup, const CSimulatedAircraft &remoteAircraft, CStatusMessageList *log)
|
||||
{
|
||||
CAircraftModelList matchedModels(modelSet);
|
||||
|
||||
Reference in New Issue
Block a user