mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 08:36:52 +08:00
Aligned signatures for context and dialog to use sim.directory in validator
Ref T247 follow up
This commit is contained in:
committed by
Mat Sutcliffe
parent
347e584998
commit
d51b26cf8d
@@ -94,14 +94,27 @@ namespace BlackCore
|
||||
|
||||
// Validation
|
||||
m_validator = new CBackgroundValidation(this);
|
||||
m_validator->setCurrentSimulator(this->getSimulatorPluginInfo().getSimulator());
|
||||
connect(this, &CContextSimulator::simulatorChanged, m_validator, &CBackgroundValidation::setCurrentSimulator);
|
||||
this->setValidator(this->getSimulatorPluginInfo().getSimulator());
|
||||
connect(this, &CContextSimulator::simulatorChanged, this, &CContextSimulator::setValidator);
|
||||
connect(m_validator, &CBackgroundValidation::validated, this, &CContextSimulator::validatedModelSet, Qt::QueuedConnection);
|
||||
|
||||
m_validator->start(QThread::LowestPriority);
|
||||
m_validator->startUpdating(60);
|
||||
}
|
||||
|
||||
void CContextSimulator::setValidator(const CSimulatorInfo &simulator)
|
||||
{
|
||||
if (simulator.isSingleSimulator())
|
||||
{
|
||||
const QString simDir = m_simulatorSettings.getSimulatorDirectoryOrDefault(simulator);
|
||||
m_validator->setCurrentSimulator(simulator, simDir);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_validator->setCurrentSimulator(CSimulatorInfo::None, {});
|
||||
}
|
||||
}
|
||||
|
||||
CContextSimulator *CContextSimulator::registerWithDBus(CDBusServer *server)
|
||||
{
|
||||
if (!server || m_mode != CCoreFacadeConfig::LocalInDBusServer) { return this; }
|
||||
@@ -1054,7 +1067,8 @@ namespace BlackCore
|
||||
if (!myself) { return; }
|
||||
if (m_aircraftMatcher.getModelSetCount() > MatchingLogMaxModelSetSize)
|
||||
{
|
||||
this->enableMatchingMessages(false);
|
||||
const MatchingLog log = CBuildConfig::isDebugBuild() ? MatchingLogAll : MatchingLogSimplified;
|
||||
this->enableMatchingMessages(log);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -257,6 +257,9 @@ namespace BlackCore
|
||||
//! Load the last know model set
|
||||
void initByLastUsedModelSet();
|
||||
|
||||
//! Init and set validator
|
||||
void setValidator(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
QPair<BlackMisc::Simulation::CSimulatorPluginInfo, QPointer<ISimulator>> m_simulatorPlugin; //!< Currently loaded simulator plugin
|
||||
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::CStatusMessageList> m_matchingMessages; //!< all matching log messages per callsign
|
||||
QMap<BlackMisc::Aviation::CCallsign, int> m_failoverAddingCounts;
|
||||
|
||||
@@ -48,15 +48,16 @@ namespace BlackGui
|
||||
|
||||
void CAircraftModelValidationDialog::validate()
|
||||
{
|
||||
// in view validation of models
|
||||
ui->comp_StatusMessage->clear();
|
||||
if (m_models.isEmpty()) { return; }
|
||||
|
||||
CAircraftModelList valid;
|
||||
CAircraftModelList invalid;
|
||||
const bool ignoreEmpty = false;
|
||||
const int maxFailedFiles = 25;
|
||||
const int maxFailedFiles = 25;
|
||||
bool wasStopped = false;
|
||||
const CStatusMessageList msgs = CAircraftModelUtilities::validateModelFiles(m_models, valid, invalid, ignoreEmpty, maxFailedFiles, wasStopped);
|
||||
const CStatusMessageList msgs = CAircraftModelUtilities::validateModelFiles(m_models, valid, invalid, ignoreEmpty, maxFailedFiles, wasStopped, "");
|
||||
ui->comp_StatusMessage->clear();
|
||||
ui->comp_StatusMessage->appendStatusMessagesToList(msgs);
|
||||
}
|
||||
|
||||
@@ -548,7 +548,7 @@ namespace BlackMisc
|
||||
CStatusMessage m;
|
||||
sorted.sortByFileName();
|
||||
stopped = false;
|
||||
CStatusMessageList msgs = sorted.validateFiles(validModels, invalidModels, ignoreEmpty, stopAtFailedFiles, stopped, true);
|
||||
CStatusMessageList msgs = sorted.validateFiles(validModels, invalidModels, ignoreEmpty, stopAtFailedFiles, stopped, "", true);
|
||||
if (stopped || validModels.isEmpty()) { return msgs; }
|
||||
|
||||
const CAircraftModelList nonFsModels = validModels.findNonFsFamilyModels();
|
||||
|
||||
Reference in New Issue
Block a user