mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
refs #395, integrated aircraft airspace snapshot / analyzer into remote provider
* added snapshot class * added snapshot in analyzer, signal for new snapshot * made all provider signals available in CSimulator * added finders in CSimulatedAircraftList * moved COwnAircraftProviderDummy into own file
This commit is contained in:
committed by
Mathew Sutcliffe
parent
6570a0c966
commit
018c5ae1bf
104
src/blackmisc/simulation/ownaircraftproviderdummy.cpp
Normal file
104
src/blackmisc/simulation/ownaircraftproviderdummy.cpp
Normal file
@@ -0,0 +1,104 @@
|
||||
/* 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.
|
||||
*/
|
||||
|
||||
#include "ownaircraftproviderdummy.h"
|
||||
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
|
||||
Geo::CCoordinateGeodetic COwnAircraftProviderDummy::getOwnAircraftPosition() const
|
||||
{
|
||||
return m_ownAircraft.getPosition();
|
||||
}
|
||||
|
||||
CAircraftParts COwnAircraftProviderDummy::getOwnAircraftParts() const
|
||||
{
|
||||
return m_ownAircraft.getParts();
|
||||
}
|
||||
|
||||
CAircraftModel COwnAircraftProviderDummy::getOwnAircraftModel() const
|
||||
{
|
||||
return m_ownAircraft.getModel();
|
||||
}
|
||||
|
||||
CLength COwnAircraftProviderDummy::getDistanceToOwnAircraft(const Geo::ICoordinateGeodetic &position) const
|
||||
{
|
||||
return m_ownAircraft.calculateGreatCircleDistance(position);
|
||||
}
|
||||
|
||||
bool COwnAircraftProviderDummy::updateCockpit(const Aviation::CComSystem &com1, const Aviation::CComSystem &com2, const Aviation::CTransponder &transponder, const QString &originator)
|
||||
{
|
||||
m_ownAircraft.setCom1System(com1);
|
||||
m_ownAircraft.setCom2System(com2);
|
||||
m_ownAircraft.setTransponder(transponder);
|
||||
Q_UNUSED(originator);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool COwnAircraftProviderDummy::updateActiveComFrequency(const PhysicalQuantities::CFrequency &frequency, int comUnit, const QString &originator)
|
||||
{
|
||||
if (!CComSystem::isValidComFrequency(frequency)) { return false; }
|
||||
CComSystem::ComUnit comUnitEnum = static_cast<CComSystem::ComUnit>(comUnit);
|
||||
CComSystem com = m_ownAircraft.getComSystem(comUnitEnum);
|
||||
com.setFrequencyActive(frequency);
|
||||
m_ownAircraft.setComSystem(com, comUnitEnum);
|
||||
Q_UNUSED(originator);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool COwnAircraftProviderDummy::updateSelcal(const CSelcal &selcal, const QString &originator)
|
||||
{
|
||||
m_ownAircraft.setSelcal(selcal);
|
||||
Q_UNUSED(originator);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool COwnAircraftProviderDummy::updateOwnModel(const CAircraftModel &model)
|
||||
{
|
||||
m_ownAircraft.setModel(model);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool COwnAircraftProviderDummy::updateOwnSituation(const CAircraftSituation &situation)
|
||||
{
|
||||
m_ownAircraft.setSituation(situation);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool COwnAircraftProviderDummy::updateOwnParts(const CAircraftParts &parts)
|
||||
{
|
||||
m_ownAircraft.setParts(parts);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool COwnAircraftProviderDummy::updateOwnCallsign(const CCallsign &callsign)
|
||||
{
|
||||
m_ownAircraft.setCallsign(callsign);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool COwnAircraftProviderDummy::updateOwnIcaoData(const CAircraftIcao &icaoData)
|
||||
{
|
||||
m_ownAircraft.setIcaoInfo(icaoData);
|
||||
return true;
|
||||
}
|
||||
|
||||
COwnAircraftProviderDummy *COwnAircraftProviderDummy::instance()
|
||||
{
|
||||
static COwnAircraftProviderDummy *dummy = new COwnAircraftProviderDummy();
|
||||
return dummy;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace
|
||||
Reference in New Issue
Block a user