mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 03:35: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()
|
CAircraftMatcher::~CAircraftMatcher()
|
||||||
{
|
{
|
||||||
if (!m_removedModels.isEmpty())
|
this->saveRemovedModels();
|
||||||
{
|
|
||||||
// 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)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAircraftMatcher::setSetup(const CAircraftMatcherSetup &setup)
|
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 CAircraftMatcher::getClosestMatchStepwiseReduceImplementation(const CAircraftModelList &modelSet, const CAircraftMatcherSetup &setup, const CSimulatedAircraft &remoteAircraft, CStatusMessageList *log)
|
||||||
{
|
{
|
||||||
CAircraftModelList matchedModels(modelSet);
|
CAircraftModelList matchedModels(modelSet);
|
||||||
|
|||||||
@@ -185,6 +185,9 @@ namespace BlackCore
|
|||||||
void setupChanged();
|
void setupChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
//! Save the removed models if any
|
||||||
|
bool saveRemovedModels();
|
||||||
|
|
||||||
//! The search based implementation
|
//! 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);
|
static BlackMisc::Simulation::CAircraftModelList getClosestMatchStepwiseReduceImplementation(const BlackMisc::Simulation::CAircraftModelList &modelSet, const BlackMisc::Simulation::CAircraftMatcherSetup &setup, const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft, BlackMisc::CStatusMessageList *log = nullptr);
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>296</width>
|
<width>296</width>
|
||||||
<height>400</height>
|
<height>450</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="vl_ScrollAreaContent">
|
<layout class="QVBoxLayout" name="vl_ScrollAreaContent">
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
<height>400</height>
|
<height>450</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
Reference in New Issue
Block a user