Ref T663, avoid ASSERT when simulator is NO single simulator in mapping tool

This commit is contained in:
Klaus Basan
2019-05-18 17:48:23 +02:00
parent 8c1e10824c
commit 9cd0d5554c
2 changed files with 24 additions and 4 deletions

View File

@@ -187,8 +187,18 @@ namespace BlackGui
void COwnModelSetForm::setSimulator(const CSimulatorInfo &simulator)
{
Q_ASSERT_X(simulator.isSingleSimulator(), Q_FUNC_INFO, "Need single simulator");
m_simulator = simulator;
// Ref T663, avoid ASSERT in some weird cases
if (simulator.isSingleSimulator())
{
m_simulator = simulator;
}
else
{
const CSimulatorInfo resetSim = m_simulator.isSingleSimulator() ? m_simulator : CSimulatorInfo::guessDefaultSimulator();
const QString msg = QStringLiteral("Set invalid simulator, continue to use '%1'").arg(resetSim.toQString(true));
this->showOverlayHTMLMessage(msg);
m_simulator = resetSim;
}
}
bool COwnModelSetForm::hasDistributorPreferences() const