swift
Loading...
Searching...
No Matches
xplanempaircraft.cpp
1// SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
4#include "xplanempaircraft.h"
5
6#include "core/simulator.h"
8
9using namespace swift::core;
10using namespace swift::misc;
11using namespace swift::misc::aviation;
12using namespace swift::misc::simulation;
13
14namespace swift::simplugin::xplane
15{
18 : m_aircraft(aircraft),
19 m_interpolator(QSharedPointer<CInterpolatorMulti>::create(aircraft.getCallsign(), simulator, simulator,
20 simulator->getRemoteAircraftProvider(), logger))
21 {
22 m_interpolator->attachLogger(logger);
23 m_interpolator->initCorrespondingModel(aircraft.getModel());
24 }
25
27 {
28 m_aircraft = simulatedAircraft;
29 }
30
32 {
33 Q_ASSERT(m_interpolator);
34 return m_interpolator->getInterpolatorInfo(mode);
35 }
36
38 {
39 Q_ASSERT(m_interpolator);
40 m_interpolator->attachLogger(logger);
41 }
42
45 uint32_t aircraftNumber) const
46 {
47 Q_ASSERT(m_interpolator);
48 return m_interpolator->getInterpolation(currentTimeSinceEpoch, setup, aircraftNumber);
49 }
50
56
57 CCallsignSet CXPlaneMPAircraftObjects::getAllCallsigns() const // cppcheck-suppress functionStatic
58 {
59 return { this->keys() };
60 }
61
66} // namespace swift::simplugin::xplane
Interface to a simulator.
Definition simulator.h:59
Status messages, e.g. from Core -> GUI.
Value object for a set of callsigns.
Definition callsignset.h:26
QStringList getCallsignStrings(bool sorted=false) const
The callsign strings.
Value object for interpolator and rendering per callsign.
Record internal state of interpolator for debugging.
Multiplexed interpolator which allows switching between modes at runtime.
const CStatusMessageList & getInterpolationMessages(CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const
Interpolation messages.
Comprehensive information of an aircraft.
const simulation::CAircraftModel & getModel() const
Get model (model used for mapping).
const swift::misc::aviation::CCallsign & getCallsign() const
Get callsign.
QString getInterpolatorInfo(swift::misc::simulation::CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const
Get an interpolator info string (for debug info).
void attachInterpolatorLogger(swift::misc::simulation::CInterpolationLogger *logger) const
Attach an observer to read the interpolator's state for debugging.
void setSimulatedAircraft(const swift::misc::simulation::CSimulatedAircraft &simulatedAircraft)
Set simulated aircraft.
swift::misc::CStatusMessageList getInterpolationMessages(swift::misc::simulation::CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const
Interpolation messages.
swift::misc::simulation::CInterpolationResult getInterpolation(qint64 currentTimeSinceEpoch, const swift::misc::simulation::CInterpolationAndRenderingSetupPerCallsign &setup, uint32_t aircraftNumber) const
Get interpolated situation.
swift::misc::simulation::CInterpolatorMulti * getInterpolator() const
Interpolator.
QStringList getAllCallsignStrings(bool sorted=false) const
Get all callsign strings.
swift::misc::aviation::CCallsignSet getAllCallsigns() const
Get all callsigns.
Backend services of the swift project, like dealing with the network or the simulators.
Definition actionbind.cpp:7
Free functions in swift::misc.
QList< swift::misc::aviation::CCallsign > keys() const const