mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 01:05:35 +08:00
Ref T385, not all "_OBS" observers are ATC, they can be copilots too
This commit is contained in:
@@ -84,7 +84,16 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
if (m_callsign.isAtcCallsign())
|
if (m_callsign.isAtcCallsign())
|
||||||
{
|
{
|
||||||
m_homebase = m_callsign.getIcaoCode();
|
// option 1: real ATC station
|
||||||
|
// option 2: a copilot cmoning in Observer
|
||||||
|
if (m_callsign.isObserverCallsign())
|
||||||
|
{
|
||||||
|
// copilot
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_homebase = m_callsign.getIcaoCode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,10 +111,8 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
// only apply stripping if home base is not explicitly given
|
// only apply stripping if home base is not explicitly given
|
||||||
// try to strip homebase: I understand the limitations, but we will have more correct hits as failures I assume
|
// try to strip homebase: I understand the limitations, but we will have more correct hits as failures I assume
|
||||||
static QThreadStorage<QRegularExpression> tsRegex;
|
thread_local QRegularExpression tsRegex("(-\\s*|\\s)([A-Z]{4})$");
|
||||||
if (! tsRegex.hasLocalData()) { tsRegex.setLocalData(QRegularExpression("(-\\s*|\\s)([A-Z]{4})$")); }
|
const QRegularExpressionMatch match = tsRegex.match(rn);
|
||||||
const auto ®ex = tsRegex.localData();
|
|
||||||
const QRegularExpressionMatch match = regex.match(rn);
|
|
||||||
if (match.hasMatch())
|
if (match.hasMatch())
|
||||||
{
|
{
|
||||||
const int pos = match.capturedStart(0);
|
const int pos = match.capturedStart(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user