refs #369, adjusted simulator drivers

* common base class BlackCore::CSimulatorCommon
* using providers IOwnAircraftProvider, IRenderedAircraftProvider
* using revers lookup in mapping
* using CSimulatedAircraft / CSimulatedAircraftList
* return values (success/failed) for member functions (e.g. setTimeSynchronization)
* getMaxRenderedAircraft / setMaxRenderedAircraft prepared
This commit is contained in:
Klaus Basan
2015-02-06 00:26:58 +01:00
parent f56a401505
commit 8c3547c33d
12 changed files with 347 additions and 215 deletions

View File

@@ -9,13 +9,33 @@
#include "simulator.h"
using namespace BlackMisc::Aviation;
using namespace BlackSim;
namespace BlackCore
{
ISimulator::ISimulator(QObject *parent) : QObject(parent)
{ }
void ISimulator::emitSimulatorCombinedStatus()
{
emit simulatorStatusChanged(isConnected(), isSimulating(), isPaused());
}
CSimulatorCommon::CSimulatorCommon(const BlackSim::CSimulatorInfo &simInfo, BlackMisc::Simulation::IOwnAircraftProvider *ownAircraftProvider, BlackMisc::Simulation::IRenderedAircraftProvider *renderedAircraftProvider, QObject *parent)
: ISimulator(parent), COwnAircraftProviderSupport(ownAircraftProvider), CRenderedAircraftProviderSupport(renderedAircraftProvider), m_simulatorInfo(simInfo)
{ }
int CSimulatorCommon::getMaxRenderedAircraft() const
{
return m_maxRenderedAircraft;
}
void CSimulatorCommon::setMaxRenderedAircraft(int maxRenderedAircraft)
{
m_maxRenderedAircraft = maxRenderedAircraft;
}
CSimulatorInfo CSimulatorCommon::getSimulatorInfo() const
{
return m_simulatorInfo;
}
} // namespace