mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
139 lines
6.3 KiB
C++
139 lines
6.3 KiB
C++
/* Copyright (C) 2015
|
|
* swift project Community / Contributors
|
|
*
|
|
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
|
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
|
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
|
* contained in the LICENSE file.
|
|
*/
|
|
|
|
//! \file
|
|
|
|
#ifndef BLACKMISC_SIMULATION_OWNAIRCRAFTPROVIDER_H
|
|
#define BLACKMISC_SIMULATION_OWNAIRCRAFTPROVIDER_H
|
|
|
|
#include "blackmisc/blackmiscexport.h"
|
|
#include "blackmisc/originator.h"
|
|
#include "blackmisc/simulation/simulatedaircraft.h"
|
|
|
|
namespace BlackMisc
|
|
{
|
|
namespace Simulation
|
|
{
|
|
|
|
//! Direct threadsafe in memory access to own aircraft
|
|
class BLACKMISC_EXPORT IOwnAircraftProvider
|
|
{
|
|
public:
|
|
|
|
//! Own aircraft
|
|
//! \threadsafe
|
|
virtual CSimulatedAircraft getOwnAircraft() const = 0;
|
|
|
|
//! Own aircraft's position
|
|
//! \threadsafe
|
|
virtual BlackMisc::Geo::CCoordinateGeodetic getOwnAircraftPosition() const = 0;
|
|
|
|
//! Own aircraft's parts
|
|
//! \threadsafe
|
|
virtual BlackMisc::Aviation::CAircraftParts getOwnAircraftParts() const = 0;
|
|
|
|
//! Own aircraft model
|
|
//! \threadsafe
|
|
virtual BlackMisc::Simulation::CAircraftModel getOwnAircraftModel() const = 0;
|
|
|
|
//! Distance to own aircraft
|
|
//! \threadsafe
|
|
virtual BlackMisc::PhysicalQuantities::CLength getDistanceToOwnAircraft(const BlackMisc::Geo::ICoordinateGeodetic &position) const = 0;
|
|
|
|
//! Update aircraft's callsign
|
|
//! \threadsafe
|
|
virtual bool updateOwnCallsign(const BlackMisc::Aviation::CCallsign &callsign) = 0;
|
|
|
|
//! Update ICAO data
|
|
//! \threadsafe
|
|
virtual bool updateOwnIcaoData(const BlackMisc::Aviation::CAircraftIcaoData &icaoData) = 0;
|
|
|
|
//! Update model
|
|
//! \threadsafe
|
|
virtual bool updateOwnModel(const BlackMisc::Simulation::CAircraftModel &model) = 0;
|
|
|
|
//! Update own situation
|
|
virtual bool updateOwnSituation(const BlackMisc::Aviation::CAircraftSituation &situation) = 0;
|
|
|
|
//! Update own parts
|
|
virtual bool updateOwnParts(const BlackMisc::Aviation::CAircraftParts &parts) = 0;
|
|
|
|
// ------------------------------------------------------------------------
|
|
// cockpit / aircraft related updates, which can come from multiple sources
|
|
// and are subject of roundtrips -> originator
|
|
// ------------------------------------------------------------------------
|
|
|
|
//! Update cockpit, but send signals when applicable
|
|
//! \threadsafe
|
|
virtual bool updateCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder, const BlackMisc::COriginator &originator) = 0;
|
|
|
|
//! Update cockpit, but send signals when applicable
|
|
//! \threadsafe
|
|
virtual bool updateActiveComFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency, int comUnit, const BlackMisc::COriginator &originator) = 0;
|
|
|
|
//! Update cockpit, but send signals when applicable
|
|
//! \threadsafe
|
|
virtual bool updateSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::COriginator &originator) = 0;
|
|
|
|
};
|
|
|
|
//! Delegating class which can be directly used to access an \sa IOwnAircraftProvider instance
|
|
class BLACKMISC_EXPORT COwnAircraftAware
|
|
{
|
|
public:
|
|
//! \copydoc IOwnAircraftProvider::getOwnAircraft
|
|
virtual const CSimulatedAircraft getOwnAircraft() const;
|
|
|
|
//! \copydoc IOwnAircraftProvider::getOwnAircraftPosition
|
|
virtual BlackMisc::Geo::CCoordinateGeodetic getOwnAircraftPosition() const;
|
|
|
|
//! \copydoc IOwnAircraftProvider::getOwnAircraftParts
|
|
virtual BlackMisc::Aviation::CAircraftParts getOwnAircraftParts() const;
|
|
|
|
//! \copydoc IOwnAircraftProvider::getOwnAircraftModel
|
|
virtual BlackMisc::Simulation::CAircraftModel getOwnAircraftModel() const;
|
|
|
|
//! \copydoc IOwnAircraftProvider::getDistanceToOwnAircraft
|
|
virtual BlackMisc::PhysicalQuantities::CLength getDistanceToOwnAircraft(const BlackMisc::Geo::ICoordinateGeodetic &position) const;
|
|
|
|
//! \copydoc IOwnAircraftProvider::updateCockpit
|
|
virtual bool updateCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder, const BlackMisc::COriginator &originator);
|
|
|
|
//! \copydoc IOwnAircraftProvider::updateComFrequency
|
|
virtual bool updateActiveComFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency, int comUnit, const BlackMisc::COriginator &originator);
|
|
|
|
//! \copydoc IOwnAircraftProvider::updateSelcal
|
|
virtual bool updateSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::COriginator &originator);
|
|
|
|
//! \copydoc IOwnAircraftProvider::updateOwnCallsign
|
|
virtual bool updateOwnCallsign(const BlackMisc::Aviation::CCallsign &callsign);
|
|
|
|
//! \copydoc IOwnAircraftProvider::updateOwnIcaoData
|
|
virtual bool updateOwnIcaoData(const BlackMisc::Aviation::CAircraftIcaoData &icaoData);
|
|
|
|
//! \copydoc IOwnAircraftProvider::updateOwnModel
|
|
virtual bool updateOwnModel(const BlackMisc::Simulation::CAircraftModel &model);
|
|
|
|
//! \copydoc IOwnAircraftProvider::updateOwnSituation
|
|
virtual bool updateOwnSituation(const BlackMisc::Aviation::CAircraftSituation &situation);
|
|
|
|
//! \copydoc IOwnAircraftProvider::updateOwnParts
|
|
virtual bool updateOwnParts(const BlackMisc::Aviation::CAircraftParts &parts);
|
|
|
|
protected:
|
|
//! Constructor
|
|
COwnAircraftAware(IOwnAircraftProvider *ownAircraftProvider) : m_ownAircraftProvider(ownAircraftProvider) { Q_ASSERT(ownAircraftProvider); }
|
|
IOwnAircraftProvider *m_ownAircraftProvider = nullptr; //!< access to object
|
|
};
|
|
|
|
} // namespace
|
|
} // namespace
|
|
|
|
#endif // guard
|