mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 10:45:37 +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
|
// Validation
|
||||||
m_validator = new CBackgroundValidation(this);
|
m_validator = new CBackgroundValidation(this);
|
||||||
m_validator->setCurrentSimulator(this->getSimulatorPluginInfo().getSimulator());
|
this->setValidator(this->getSimulatorPluginInfo().getSimulator());
|
||||||
connect(this, &CContextSimulator::simulatorChanged, m_validator, &CBackgroundValidation::setCurrentSimulator);
|
connect(this, &CContextSimulator::simulatorChanged, this, &CContextSimulator::setValidator);
|
||||||
connect(m_validator, &CBackgroundValidation::validated, this, &CContextSimulator::validatedModelSet, Qt::QueuedConnection);
|
connect(m_validator, &CBackgroundValidation::validated, this, &CContextSimulator::validatedModelSet, Qt::QueuedConnection);
|
||||||
|
|
||||||
m_validator->start(QThread::LowestPriority);
|
m_validator->start(QThread::LowestPriority);
|
||||||
m_validator->startUpdating(60);
|
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)
|
CContextSimulator *CContextSimulator::registerWithDBus(CDBusServer *server)
|
||||||
{
|
{
|
||||||
if (!server || m_mode != CCoreFacadeConfig::LocalInDBusServer) { return this; }
|
if (!server || m_mode != CCoreFacadeConfig::LocalInDBusServer) { return this; }
|
||||||
@@ -1054,7 +1067,8 @@ namespace BlackCore
|
|||||||
if (!myself) { return; }
|
if (!myself) { return; }
|
||||||
if (m_aircraftMatcher.getModelSetCount() > MatchingLogMaxModelSetSize)
|
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
|
//! Load the last know model set
|
||||||
void initByLastUsedModelSet();
|
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
|
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, BlackMisc::CStatusMessageList> m_matchingMessages; //!< all matching log messages per callsign
|
||||||
QMap<BlackMisc::Aviation::CCallsign, int> m_failoverAddingCounts;
|
QMap<BlackMisc::Aviation::CCallsign, int> m_failoverAddingCounts;
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CAircraftModelValidationDialog::validate()
|
void CAircraftModelValidationDialog::validate()
|
||||||
{
|
{
|
||||||
|
// in view validation of models
|
||||||
ui->comp_StatusMessage->clear();
|
ui->comp_StatusMessage->clear();
|
||||||
if (m_models.isEmpty()) { return; }
|
if (m_models.isEmpty()) { return; }
|
||||||
|
|
||||||
@@ -56,7 +57,7 @@ namespace BlackGui
|
|||||||
const bool ignoreEmpty = false;
|
const bool ignoreEmpty = false;
|
||||||
const int maxFailedFiles = 25;
|
const int maxFailedFiles = 25;
|
||||||
bool wasStopped = false;
|
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->clear();
|
||||||
ui->comp_StatusMessage->appendStatusMessagesToList(msgs);
|
ui->comp_StatusMessage->appendStatusMessagesToList(msgs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -548,7 +548,7 @@ namespace BlackMisc
|
|||||||
CStatusMessage m;
|
CStatusMessage m;
|
||||||
sorted.sortByFileName();
|
sorted.sortByFileName();
|
||||||
stopped = false;
|
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; }
|
if (stopped || validModels.isEmpty()) { return msgs; }
|
||||||
|
|
||||||
const CAircraftModelList nonFsModels = validModels.findNonFsFamilyModels();
|
const CAircraftModelList nonFsModels = validModels.findNonFsFamilyModels();
|
||||||
|
|||||||
Reference in New Issue
Block a user