refs #391, allow to send aircraft parts from GUI

* GUI component for aircraft parts
* remote aircraft selector component
* Adjusted GUI for internals component
* Enable / disable debug messages from GUI
* Allow to init engines directly
* Removed unused async sort in sequence

In same step fixed found issues in interpolator
* allow to set max rendered aircraft
This commit is contained in:
Klaus Basan
2015-03-07 03:34:17 +01:00
parent f31445e873
commit 5ed95aee3d
63 changed files with 1575 additions and 165 deletions

View File

@@ -242,16 +242,6 @@ namespace BlackSimPlugin
return empty;
}
int CSimulatorFsCommon::getMaxRenderedAircraft() const
{
return this->m_maxRenderedAircraft;
}
void CSimulatorFsCommon::setMaxRenderedAircraft(int maxRenderedAircraft)
{
this->m_maxRenderedAircraft = maxRenderedAircraft;
}
bool CSimulatorFsCommon::changeRemoteAircraftModel(const CSimulatedAircraft &aircraft, const QString &originator)
{
if (originator == simulatorOriginator()) { return false; }
@@ -275,5 +265,14 @@ namespace BlackSimPlugin
return true;
}
void CSimulatorFsCommon::enableDebugMessages(bool driver, bool interpolator)
{
if (this->m_interpolator)
{
this->m_interpolator->enableDebugMessages(interpolator);
}
CSimulatorCommon::enableDebugMessages(driver, interpolator);
}
} // namespace
} // namespace

View File

@@ -13,6 +13,7 @@
#define BLACKSIMPLUGIN_SIMULATOR_COMMON_H
#include "blackcore/simulator.h"
#include "blackcore/interpolator.h"
#include "blacksim/fscommon/aircraftmapper.h"
#include "fsuipc.h"
@@ -67,18 +68,15 @@ namespace BlackSimPlugin
//! \copydoc IContextSimulator::iconForModel
virtual BlackMisc::CPixmap iconForModel(const QString &modelString) const override;
//! \copydoc ISimulator::getMaxRenderedAircraft
virtual int getMaxRenderedAircraft() const override;
//! \copydoc ISimulator::setMaxRenderedAircraft
virtual void setMaxRenderedAircraft(int maxRenderedAircraft) override;
//! \copydoc ISimulator::changeRenderedAircraftModel
virtual bool changeRemoteAircraftModel(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const QString &originator) override;
//! \copydoc ISimulator::changeAircraftEnabled
virtual bool changeAircraftEnabled(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, const QString &originator) override;
//! \copydoc ISimulator::enableDebuggingMessages
virtual void enableDebugMessages(bool driver, bool interpolator) override;
protected:
//! Constructor
CSimulatorFsCommon(
@@ -94,6 +92,7 @@ namespace BlackSimPlugin
bool m_simTimeSynced = false; //!< Time synchronized?
BlackMisc::PhysicalQuantities::CTime m_syncTimeOffset; //!< time offset
BlackMisc::Aviation::CAirportList m_airportsInRange; //!< aiports in range of own aircraft
BlackCore::IInterpolator *m_interpolator = nullptr; //!< interpolator instance
// cockpit as set in SIM
BlackMisc::Aviation::CComSystem m_simCom1; //!< cockpit COM1 state in simulator

View File

@@ -660,7 +660,7 @@ namespace BlackSimPlugin
if (interpolatorStatus.interpolationSucceeded)
{
// aircraft parts
// inside interpolator if, as no parts can be sent without position
// inside "interpolator if", as no parts can be sent without position
updateRemoteAircraftParts(simObj, parts, partsStatus, interpolatedSituation, isOnGround); // update and retrieve parts in the same step
}

View File

@@ -191,7 +191,6 @@ namespace BlackSimPlugin
HANDLE m_hSimConnect = nullptr; //!< Handle to SimConnect object
uint m_nextObjID = 1; //!< object ID TODO: also used as request id, where to we place other request ids as for facilities
BlackMisc::PhysicalQuantities::CTime m_syncTimeOffset; //!< Time offset (if synchronized)
BlackCore::IInterpolator *m_interpolator = nullptr; //!< interpolator instance
QHash<BlackMisc::Aviation::CCallsign, CSimConnectObject> m_simConnectObjects;
QFutureWatcher<bool> m_watcherConnect;