mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 18:55:38 +08:00
Style
This commit is contained in:
@@ -369,7 +369,7 @@ namespace BlackCore
|
|||||||
if (callsign.hasSuffix())
|
if (callsign.hasSuffix())
|
||||||
{
|
{
|
||||||
// very likely and ATC callsign
|
// very likely and ATC callsign
|
||||||
const CPropertyIndexVariantMap vm = CPropertyIndexVariantMap({CAtcStation::IndexController, CUser::IndexRealName}, realname);
|
const CPropertyIndexVariantMap vm = CPropertyIndexVariantMap({ CAtcStation::IndexController, CUser::IndexRealName }, realname);
|
||||||
const int c1 = this->updateOnlineStation(callsign, vm, false, true);
|
const int c1 = this->updateOnlineStation(callsign, vm, false, true);
|
||||||
const int c2 = this->updateBookedStation(callsign, vm, false, true);
|
const int c2 = this->updateBookedStation(callsign, vm, false, true);
|
||||||
wasAtc = c1 > 0 || c2 > 0;
|
wasAtc = c1 > 0 || c2 > 0;
|
||||||
@@ -382,8 +382,9 @@ namespace BlackCore
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Client
|
// Client
|
||||||
|
if (!sApp || !sApp->getWebDataServices()) { return; }
|
||||||
const CVoiceCapabilities voiceCaps = sApp->getWebDataServices()->getVoiceCapabilityForCallsign(callsign);
|
const CVoiceCapabilities voiceCaps = sApp->getWebDataServices()->getVoiceCapabilityForCallsign(callsign);
|
||||||
CPropertyIndexVariantMap vm = CPropertyIndexVariantMap({CClient::IndexUser, CUser::IndexRealName}, realname);
|
CPropertyIndexVariantMap vm = CPropertyIndexVariantMap({ CClient::IndexUser, CUser::IndexRealName }, realname);
|
||||||
vm.addValue({ CClient::IndexVoiceCapabilities }, voiceCaps);
|
vm.addValue({ CClient::IndexVoiceCapabilities }, voiceCaps);
|
||||||
this->updateOrAddClient(callsign, vm, false);
|
this->updateOrAddClient(callsign, vm, false);
|
||||||
}
|
}
|
||||||
@@ -548,7 +549,7 @@ namespace BlackCore
|
|||||||
station.setFrequency(frequency);
|
station.setFrequency(frequency);
|
||||||
station.setPosition(position);
|
station.setPosition(position);
|
||||||
station.setOnline(true);
|
station.setOnline(true);
|
||||||
station.calculcateAndUpdateRelativeDistanceAndBearing(getOwnAircraftPosition());
|
station.calculcateAndUpdateRelativeDistanceAndBearing(this->getOwnAircraftPosition());
|
||||||
|
|
||||||
// sync with bookings
|
// sync with bookings
|
||||||
if (m_atcStationsBooked.containsCallsign(callsign))
|
if (m_atcStationsBooked.containsCallsign(callsign))
|
||||||
@@ -1151,7 +1152,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
CLength CAirspaceMonitor::calculateDistanceToOwnAircraft(const CAircraftSituation &situation) const
|
CLength CAirspaceMonitor::calculateDistanceToOwnAircraft(const CAircraftSituation &situation) const
|
||||||
{
|
{
|
||||||
CLength distance = getOwnAircraft().calculateGreatCircleDistance(situation);
|
CLength distance = this->getOwnAircraft().calculateGreatCircleDistance(situation);
|
||||||
distance.switchUnit(CLengthUnit::NM());
|
distance.switchUnit(CLengthUnit::NM());
|
||||||
return distance;
|
return distance;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@
|
|||||||
<string>copy (materialize) defaults</string>
|
<string>copy (materialize) defaults</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>copy def.</string>
|
<string> copy def. </string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ namespace BlackMisc
|
|||||||
bool ICoordinateGeodetic::isWithinRange(const ICoordinateGeodetic &otherCoordinate, const CLength &range) const
|
bool ICoordinateGeodetic::isWithinRange(const ICoordinateGeodetic &otherCoordinate, const CLength &range) const
|
||||||
{
|
{
|
||||||
if (range.isNull()) { return false; }
|
if (range.isNull()) { return false; }
|
||||||
const CLength distance = calculateGreatCircleDistance(otherCoordinate);
|
const CLength distance = this->calculateGreatCircleDistance(otherCoordinate);
|
||||||
if (distance.isNull()) { return false; }
|
if (distance.isNull()) { return false; }
|
||||||
return distance <= range;
|
return distance <= range;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
if (this->isEmpty()) { return CUrl(); }
|
if (this->isEmpty()) { return CUrl(); }
|
||||||
if (this->size() == 1) { return this->front();}
|
if (this->size() == 1) { return this->front();}
|
||||||
int i = CMathUtils::randomInteger(0, this->size() - 1);
|
const int i = CMathUtils::randomInteger(0, this->size() - 1);
|
||||||
return (*this)[i];
|
return (*this)[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -54,7 +54,7 @@ namespace BlackMisc
|
|||||||
if (timeoutMs < 0) { timeoutMs = CNetworkUtils::getTimeoutMs(); }
|
if (timeoutMs < 0) { timeoutMs = CNetworkUtils::getTimeoutMs(); }
|
||||||
for (int t = 0; t < maxTrials && t < this->size(); t++)
|
for (int t = 0; t < maxTrials && t < this->size(); t++)
|
||||||
{
|
{
|
||||||
CUrl url(getRandomWithout(trials));
|
const CUrl url(this->getRandomWithout(trials));
|
||||||
trials.push_back(url);
|
trials.push_back(url);
|
||||||
QString message;
|
QString message;
|
||||||
if (CNetworkUtils::canConnect(url, message, timeoutMs)) { return url; }
|
if (CNetworkUtils::canConnect(url, message, timeoutMs)) { return url; }
|
||||||
|
|||||||
Reference in New Issue
Block a user