diff --git a/src/blackcore/aircraftmatcher.cpp b/src/blackcore/aircraftmatcher.cpp index cb7cdcfa4..22b9fecbd 100644 --- a/src/blackcore/aircraftmatcher.cpp +++ b/src/blackcore/aircraftmatcher.cpp @@ -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); diff --git a/src/blackcore/aircraftmatcher.h b/src/blackcore/aircraftmatcher.h index 73b804383..8971c2a83 100644 --- a/src/blackcore/aircraftmatcher.h +++ b/src/blackcore/aircraftmatcher.h @@ -185,6 +185,9 @@ namespace BlackCore void setupChanged(); private: + //! Save the removed models if any + bool saveRemovedModels(); + //! The search based implementation static BlackMisc::Simulation::CAircraftModelList getClosestMatchStepwiseReduceImplementation(const BlackMisc::Simulation::CAircraftModelList &modelSet, const BlackMisc::Simulation::CAircraftMatcherSetup &setup, const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft, BlackMisc::CStatusMessageList *log = nullptr); diff --git a/src/blackgui/components/settingsmatchingcomponent.ui b/src/blackgui/components/settingsmatchingcomponent.ui index 9b0f5bf08..dcf84120e 100644 --- a/src/blackgui/components/settingsmatchingcomponent.ui +++ b/src/blackgui/components/settingsmatchingcomponent.ui @@ -37,7 +37,7 @@ 0 0 296 - 400 + 450 @@ -58,7 +58,7 @@ 0 - 400 + 450 @@ -89,7 +89,7 @@ do matching for all models again - re-matching + re-matching