mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Ref T129, created CFlightPlanRemarks as value object and removed flight plan utils
* CFlightPlanRemarks supports the functionality of utils, but is also a valid value object * deleted CFlightPlanUtils .h/.cpp * CFlightPlan uses CFlightPlanRemarks * changed classes like VATSIM data reader to use CFlightPlanRemarks (instead of utils)
This commit is contained in:
committed by
Mathew Sutcliffe
parent
27281e438d
commit
3c24d5c7f9
@@ -22,7 +22,6 @@
|
||||
#include "blackmisc/aviation/comsystem.h"
|
||||
#include "blackmisc/aviation/modulator.h"
|
||||
#include "blackmisc/aviation/transponder.h"
|
||||
#include "blackmisc/aviation/flightplanutils.h"
|
||||
#include "blackmisc/geo/elevationplane.h"
|
||||
#include "blackmisc/network/user.h"
|
||||
#include "blackmisc/network/voicecapabilities.h"
|
||||
@@ -923,17 +922,17 @@ namespace BlackCore
|
||||
CAirlineIcaoCode airlineIcao(airlineIcaoString);
|
||||
if (!fpRemarks.isEmpty())
|
||||
{
|
||||
const CFlightPlanUtils::FlightPlanRemarks ar = CFlightPlanUtils::parseFlightPlanRemarks(fpRemarks);
|
||||
if (ar.hasAirlineRemarks())
|
||||
const CFlightPlanRemarks ar(fpRemarks);
|
||||
if (ar.hasParsedAirlineRemarks())
|
||||
{
|
||||
const QString airlineName = CAircraftMatcher::reverseLookupAirlineName(ar.flightOperator, callsign, log);
|
||||
const QString airlineName = CAircraftMatcher::reverseLookupAirlineName(ar.getFlightOperator(), callsign, log);
|
||||
if (!airlineName.isEmpty())
|
||||
{
|
||||
airlineIcao.setName(airlineName);
|
||||
this->addReverseLookupMessage(callsign, QString("Setting airline name '%1'").arg(airlineName));
|
||||
}
|
||||
|
||||
const QString telephony = CAircraftMatcher::reverseLookupTelephonyDesignator(ar.radioTelephony, callsign, log);
|
||||
const QString telephony = CAircraftMatcher::reverseLookupTelephonyDesignator(ar.getRadioTelephony(), callsign, log);
|
||||
if (!telephony.isEmpty())
|
||||
{
|
||||
airlineIcao.setTelephonyDesignator(telephony);
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/aviation/altitude.h"
|
||||
#include "blackmisc/aviation/atcstation.h"
|
||||
#include "blackmisc/aviation/flightplanutils.h"
|
||||
#include "blackmisc/geo/coordinategeodetic.h"
|
||||
#include "blackmisc/network/entityflags.h"
|
||||
#include "blackmisc/network/server.h"
|
||||
@@ -135,12 +134,12 @@ namespace BlackCore
|
||||
return m_flightPlanRemarks.value(callsign);
|
||||
}
|
||||
|
||||
CFlightPlanUtils::FlightPlanRemarks CVatsimDataFileReader::getParsedFlightPlanRemarksForCallsign(const CCallsign &callsign) const
|
||||
CFlightPlanRemarks CVatsimDataFileReader::getParsedFlightPlanRemarksForCallsign(const CCallsign &callsign) const
|
||||
{
|
||||
if (callsign.isEmpty()) return CFlightPlanUtils::parseFlightPlanRemarks("");
|
||||
if (callsign.isEmpty()) { return CFlightPlanRemarks(); }
|
||||
const QString remarks = this->getFlightPlanRemarksForCallsign(callsign);
|
||||
const CVoiceCapabilities vc = this->getVoiceCapabilityForCallsign(callsign);
|
||||
return CFlightPlanUtils::parseFlightPlanRemarks(remarks, vc);
|
||||
return CFlightPlanRemarks(remarks, vc);
|
||||
}
|
||||
|
||||
void CVatsimDataFileReader::updateWithVatsimDataFileData(CSimulatedAircraft &aircraftToBeUdpated) const
|
||||
@@ -318,7 +317,7 @@ namespace BlackCore
|
||||
const QString equipmentCodeAndAircraft = clientPartsMap["planned_aircraft"].trimmed();
|
||||
if (!equipmentCodeAndAircraft.isEmpty())
|
||||
{
|
||||
const QString aircraftIcaoCode = CFlightPlanUtils::aircraftIcaoCodeFromEquipmentCode(equipmentCodeAndAircraft);
|
||||
const QString aircraftIcaoCode = CFlightPlanRemarks::aircraftIcaoCodeFromEquipmentCode(equipmentCodeAndAircraft);
|
||||
if (CAircraftIcaoCode::isValidDesignator(aircraftIcaoCode))
|
||||
{
|
||||
currentAircraft.setAircraftIcaoDesignator(aircraftIcaoCode);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#include "blackmisc/aviation/airlineicaocode.h"
|
||||
#include "blackmisc/aviation/atcstationlist.h"
|
||||
#include "blackmisc/aviation/callsignset.h"
|
||||
#include "blackmisc/aviation/flightplanutils.h"
|
||||
#include "blackmisc/aviation/flightplan.h"
|
||||
#include "blackmisc/network/entityflags.h"
|
||||
#include "blackmisc/network/serverlist.h"
|
||||
#include "blackmisc/network/userlist.h"
|
||||
@@ -115,7 +115,7 @@ namespace BlackCore
|
||||
|
||||
//! Parsed flight plan remarks for callsign
|
||||
//! \threadsafe
|
||||
BlackMisc::Aviation::CFlightPlanUtils::FlightPlanRemarks getParsedFlightPlanRemarksForCallsign(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||
BlackMisc::Aviation::CFlightPlanRemarks getParsedFlightPlanRemarksForCallsign(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||
|
||||
//! Update aircraft with VATSIM aircraft data from data file
|
||||
//! \threadsafe
|
||||
|
||||
Reference in New Issue
Block a user