mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Ref T421, function to get interpolation messages from the simulator drivers
This commit is contained in:
@@ -168,6 +168,12 @@ namespace BlackSimPlugin
|
||||
}
|
||||
}
|
||||
|
||||
CStatusMessageList CFs9Client::getInterpolationMessages(CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const
|
||||
{
|
||||
if (!this->getInterpolator()) { return CStatusMessageList(); }
|
||||
return this->getInterpolator()->getInterpolationMessages(mode);
|
||||
}
|
||||
|
||||
void CFs9Client::timerEvent(QTimerEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
|
||||
@@ -47,13 +47,18 @@ namespace BlackSimPlugin
|
||||
BlackCore::ISimulator *simulator);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CFs9Client();
|
||||
virtual ~CFs9Client() override;
|
||||
|
||||
//! Set DirectPlay host address
|
||||
void setHostAddress(const QString &hostAddress);
|
||||
|
||||
//! Get interpolator
|
||||
//! Get interpolator @{
|
||||
BlackMisc::Simulation::CInterpolatorMulti *getInterpolator() { return &m_interpolator; }
|
||||
const BlackMisc::Simulation::CInterpolatorMulti *getInterpolator() const { return &m_interpolator; }
|
||||
//! @}
|
||||
|
||||
//! \copydoc BlackMisc::Simulation::CInterpolator::getInterpolationMessages
|
||||
BlackMisc::CStatusMessageList getInterpolationMessages(BlackMisc::Simulation::CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const;
|
||||
|
||||
public slots:
|
||||
//! Send new text message
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include "multiplayerpackets.h"
|
||||
#include "multiplayerpacketparser.h"
|
||||
#include "registermetadata.h"
|
||||
#include "blackmisc/simulation/interpolatorlinear.h"
|
||||
#include "blackmisc/network/textmessage.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
@@ -281,6 +280,15 @@ namespace BlackSimPlugin
|
||||
this->displayStatusMessage(message.asStatusMessage(true, true));
|
||||
}
|
||||
|
||||
CStatusMessageList CSimulatorFs9::getInterpolationMessages(const CCallsign &callsign) const
|
||||
{
|
||||
if (!m_hashFs9Clients.contains(callsign)) { return CStatusMessageList(); }
|
||||
const CFs9Client *client = m_hashFs9Clients[callsign].data();
|
||||
if (!client) { return CStatusMessageList(); }
|
||||
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(callsign);
|
||||
return client->getInterpolationMessages(setup.getInterpolatorMode());
|
||||
}
|
||||
|
||||
bool CSimulatorFs9::isPhysicallyRenderedAircraft(const CCallsign &callsign) const
|
||||
{
|
||||
return m_hashFs9Clients.contains(callsign);
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace BlackSimPlugin
|
||||
virtual bool updateOwnSimulatorSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::CIdentifier &originator) override;
|
||||
virtual void displayStatusMessage(const BlackMisc::CStatusMessage &message) const override;
|
||||
virtual void displayTextMessage(const BlackMisc::Network::CTextMessage &message) const override;
|
||||
virtual BlackMisc::CStatusMessageList getInterpolationMessages(const BlackMisc::Aviation::CCallsign &callsign) const override;
|
||||
//! \@}
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user