Remove ISimulator::getSimulatorInfo()

To provide maximum flexibility, the simulator info is specified by each
plugin in the JSON metadata file.

* Renamed SCimulatorInfo to CSimulatorPluginInfo
* Removed pre-defined simulator infos (UnspecifiedSim, FSX, etc)
* CContextSimulator keeps track of which plugin is loaded and its info
* QSignalMapper keeps track of which listener emitted the simulatorStared() signal
* CSimulatorPluginInfo contains name, simulator name and description
* TODO: GUI part
* TODO: CTestFsCommon
This commit is contained in:
Michał Garapich
2015-03-13 16:24:00 +01:00
committed by Roland Winklmeier
parent 3897fb2d1a
commit 63e48ae332
38 changed files with 620 additions and 475 deletions

View File

@@ -256,13 +256,16 @@ namespace BlackCore
return escaped;
}
VatSimType CNetworkVatlib::convertToSimType(CSimulatorInfo &simInfo)
VatSimType CNetworkVatlib::convertToSimType(CSimulatorPluginInfo &simInfo)
{
if (simInfo.isUnspecified()) { return vatSimTypeUnknown; }
if (CSimulatorInfo::FS9().isSameSimulator(simInfo)) { return vatSimTypeMSCFS; }
if (CSimulatorInfo::FSX().isSameSimulator(simInfo)) { return vatSimTypeMSCFS; }
if (CSimulatorInfo::XP().isSameSimulator(simInfo)) { return vatSimTypeXPLANE; }
return vatSimTypeUnknown;
/* TODO Define recognized simulators somewhere */
if (simInfo.simulator() == "fs9" || simInfo.simulator() == "fsx") {
return vatSimTypeMSCFS;
} else if (simInfo.simulator() == "xplane") {
return vatSimTypeXPLANE;
} else {
return vatSimTypeUnknown;
}
}
/********************************** * * * * * * * * * * * * * * * * * * * ************************************/
@@ -275,7 +278,7 @@ namespace BlackCore
m_server = server;
}
void CNetworkVatlib::presetSimulatorInfo(const CSimulatorInfo &simInfo)
void CNetworkVatlib::presetSimulatorInfo(const CSimulatorPluginInfo &simInfo)
{
Q_ASSERT_X(isDisconnected(), "CNetworkVatlib", "Can't change server details while still connected");
m_simulatorInfo = simInfo;