mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Aircraft ICAO data should use ICAO code as attribute, this somehow got lost in the merge session, re-applied
This commit is contained in:
@@ -260,20 +260,20 @@ namespace BlackCore
|
||||
situation.setGroundspeed(CSpeed(groundspeed, CSpeedUnit::kts()));
|
||||
CAircraft currentAircraft(user.getCallsign().getStringAsSet(), user, situation);
|
||||
|
||||
QString icaoCode = clientPartsMap["planned_aircraft"];
|
||||
if (!icaoCode.isEmpty())
|
||||
QString aircraftIcaoCode = clientPartsMap["planned_aircraft"];
|
||||
if (!aircraftIcaoCode.isEmpty())
|
||||
{
|
||||
// http://uk.flightaware.com/about/faq_aircraft_flight_plan_suffix.rvt
|
||||
// we expect something like H/B772/F B773 B773/F
|
||||
static const QRegularExpression reg("/.");
|
||||
icaoCode = icaoCode.replace(reg, "").trimmed().toUpper();
|
||||
if (CAircraftIcaoData::isValidDesignator(icaoCode))
|
||||
aircraftIcaoCode = aircraftIcaoCode.replace(reg, "").trimmed().toUpper();
|
||||
if (CAircraftIcaoCode::isValidDesignator(aircraftIcaoCode))
|
||||
{
|
||||
currentAircraft.setIcaoInfo(CAircraftIcaoData(icaoCode));
|
||||
currentAircraft.setAircraftIcaoDesignator(aircraftIcaoCode);
|
||||
}
|
||||
else
|
||||
{
|
||||
illegalIcaoCodes.append(icaoCode);
|
||||
illegalIcaoCodes.append(aircraftIcaoCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user