mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 02:55:44 +08:00
Some formatting like "this->m_" => "m_"
During Ref T203
This commit is contained in:
@@ -25,7 +25,7 @@ namespace BlackCore
|
|||||||
namespace Db
|
namespace Db
|
||||||
{
|
{
|
||||||
//! Read information about data from Database or shared files
|
//! Read information about data from Database or shared files
|
||||||
//! like when updated and number of entries.
|
//! such as when updated and number of entries.
|
||||||
//! \see BlackMisc::Db::CDbInfo
|
//! \see BlackMisc::Db::CDbInfo
|
||||||
class BLACKCORE_EXPORT CInfoDataReader : public CDatabaseReader
|
class BLACKCORE_EXPORT CInfoDataReader : public CDatabaseReader
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -129,5 +129,6 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAltitude)
|
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAltitude)
|
||||||
|
Q_DECLARE_METATYPE(BlackMisc::Aviation::CAltitude::ReferenceDatum)
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
CAtcStation::CAtcStation(const QString &callsign) : m_callsign(callsign)
|
CAtcStation::CAtcStation(const QString &callsign) : m_callsign(callsign)
|
||||||
{
|
{
|
||||||
this->m_callsign.setTypeHint(CCallsign::Atc);
|
m_callsign.setTypeHint(CCallsign::Atc);
|
||||||
}
|
}
|
||||||
|
|
||||||
CAtcStation::CAtcStation(const CCallsign &callsign, const CUser &controller, const CFrequency &frequency,
|
CAtcStation::CAtcStation(const CCallsign &callsign, const CUser &controller, const CFrequency &frequency,
|
||||||
@@ -48,21 +48,21 @@ namespace BlackMisc
|
|||||||
m_atis(atis), m_metar(metar)
|
m_atis(atis), m_metar(metar)
|
||||||
{
|
{
|
||||||
// sync callsigns
|
// sync callsigns
|
||||||
this->m_callsign.setTypeHint(CCallsign::Atc);
|
m_callsign.setTypeHint(CCallsign::Atc);
|
||||||
if (!this->m_controller.hasValidCallsign() && !callsign.isEmpty())
|
if (!m_controller.hasValidCallsign() && !callsign.isEmpty())
|
||||||
{
|
{
|
||||||
this->m_controller.setCallsign(m_callsign);
|
m_controller.setCallsign(m_callsign);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAtcStation::hasBookingTimes() const
|
bool CAtcStation::hasBookingTimes() const
|
||||||
{
|
{
|
||||||
return !(this->m_bookedFromUtc.isNull() && this->m_bookedUntilUtc.isNull());
|
return !(m_bookedFromUtc.isNull() && m_bookedUntilUtc.isNull());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CAtcStation::hasMetar() const
|
bool CAtcStation::hasMetar() const
|
||||||
{
|
{
|
||||||
return this->m_metar.hasMessage();
|
return m_metar.hasMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CAtcStation::getCallsignSuffix() const
|
QString CAtcStation::getCallsignSuffix() const
|
||||||
@@ -72,14 +72,14 @@ namespace BlackMisc
|
|||||||
|
|
||||||
void CAtcStation::setCallsign(const CCallsign &callsign)
|
void CAtcStation::setCallsign(const CCallsign &callsign)
|
||||||
{
|
{
|
||||||
this->m_callsign = callsign;
|
m_callsign = callsign;
|
||||||
this->m_controller.setCallsign(callsign);
|
m_controller.setCallsign(callsign);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAtcStation::setController(const CUser &controller)
|
void CAtcStation::setController(const CUser &controller)
|
||||||
{
|
{
|
||||||
this->m_controller = controller;
|
m_controller = controller;
|
||||||
this->m_controller.setCallsign(this->m_callsign);
|
m_controller.setCallsign(m_callsign);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CAtcStation::convertToQString(bool i18n) const
|
QString CAtcStation::convertToQString(bool i18n) const
|
||||||
@@ -90,28 +90,28 @@ namespace BlackMisc
|
|||||||
static const QString untilUtcI18n(QCoreApplication::translate("Aviation", "until(UTC)"));
|
static const QString untilUtcI18n(QCoreApplication::translate("Aviation", "until(UTC)"));
|
||||||
|
|
||||||
const QString s = (i18n ? atcI18n : QLatin1String("ATC station")) %
|
const QString s = (i18n ? atcI18n : QLatin1String("ATC station")) %
|
||||||
QLatin1Char(' ') % this->m_callsign.toQString(i18n) %
|
QLatin1Char(' ') % m_callsign.toQString(i18n) %
|
||||||
QLatin1Char(' ') % this->m_position.toQString(i18n) %
|
QLatin1Char(' ') % m_position.toQString(i18n) %
|
||||||
QLatin1String(" online: ") % boolToYesNo(m_isOnline) %
|
QLatin1String(" online: ") % boolToYesNo(m_isOnline) %
|
||||||
|
|
||||||
// controller
|
// controller
|
||||||
(!this->m_controller.isValid() ? QStringLiteral("") :
|
(!m_controller.isValid() ? QStringLiteral("") :
|
||||||
QStringLiteral(" ") % this->m_controller.toQString(i18n)) %
|
QStringLiteral(" ") % m_controller.toQString(i18n)) %
|
||||||
|
|
||||||
// frequency
|
// frequency
|
||||||
QLatin1Char(' ') % this->m_frequency.valueRoundedWithUnit(3, i18n) %
|
QLatin1Char(' ') % m_frequency.valueRoundedWithUnit(3, i18n) %
|
||||||
|
|
||||||
// ATIS
|
// ATIS
|
||||||
(!this->hasAtis() ? QStringLiteral("") :
|
(!this->hasAtis() ? QStringLiteral("") :
|
||||||
QStringLiteral(" ") % this->m_atis.toQString(i18n)) %
|
QStringLiteral(" ") % m_atis.toQString(i18n)) %
|
||||||
|
|
||||||
// METAR
|
// METAR
|
||||||
(!this->hasMetar() ? QStringLiteral("") :
|
(!this->hasMetar() ? QStringLiteral("") :
|
||||||
QStringLiteral(" ") % this->m_metar.toQString(i18n)) %
|
QStringLiteral(" ") % m_metar.toQString(i18n)) %
|
||||||
|
|
||||||
// range
|
// range
|
||||||
QLatin1Char(' ') % (i18n ? rangeI18n : QLatin1String("range")) %
|
QLatin1Char(' ') % (i18n ? rangeI18n : QLatin1String("range")) %
|
||||||
QLatin1Char(' ') % this->m_range.toQString(i18n) %
|
QLatin1Char(' ') % m_range.toQString(i18n) %
|
||||||
|
|
||||||
// distance / bearing
|
// distance / bearing
|
||||||
QLatin1Char(' ') % ICoordinateWithRelativePosition::convertToQString(i18n) %
|
QLatin1Char(' ') % ICoordinateWithRelativePosition::convertToQString(i18n) %
|
||||||
@@ -120,12 +120,12 @@ namespace BlackMisc
|
|||||||
QLatin1Char(' ') %
|
QLatin1Char(' ') %
|
||||||
(i18n ? fromUtcI18n : QLatin1String("from(UTC)")) %
|
(i18n ? fromUtcI18n : QLatin1String("from(UTC)")) %
|
||||||
QLatin1Char(' ') %
|
QLatin1Char(' ') %
|
||||||
(this->m_bookedFromUtc.isNull() ? QLatin1String("-") : this->m_bookedFromUtc.toString("yy-MM-dd HH:mm")) %
|
(m_bookedFromUtc.isNull() ? QLatin1String("-") : m_bookedFromUtc.toString("yy-MM-dd HH:mm")) %
|
||||||
|
|
||||||
QLatin1Char(' ') %
|
QLatin1Char(' ') %
|
||||||
(i18n ? untilUtcI18n : QLatin1String("until(UTC)")) %
|
(i18n ? untilUtcI18n : QLatin1String("until(UTC)")) %
|
||||||
QLatin1Char(' ') %
|
QLatin1Char(' ') %
|
||||||
(this->m_bookedUntilUtc.isNull() ? QLatin1String("-") : this->m_bookedUntilUtc.toString("yy-MM-dd HH:mm"));
|
(m_bookedUntilUtc.isNull() ? QLatin1String("-") : m_bookedUntilUtc.toString("yy-MM-dd HH:mm"));
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
|
||||||
@@ -142,15 +142,15 @@ namespace BlackMisc
|
|||||||
|
|
||||||
void CAtcStation::setFrequency(const CFrequency &frequency)
|
void CAtcStation::setFrequency(const CFrequency &frequency)
|
||||||
{
|
{
|
||||||
this->m_frequency = frequency;
|
m_frequency = frequency;
|
||||||
this->m_frequency.setUnit(CFrequencyUnit::MHz());
|
m_frequency.setUnit(CFrequencyUnit::MHz());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAtcStation::synchronizeControllerData(CAtcStation &otherStation)
|
void CAtcStation::synchronizeControllerData(CAtcStation &otherStation)
|
||||||
{
|
{
|
||||||
if (this->m_controller == otherStation.getController()) { return; }
|
if (m_controller == otherStation.getController()) { return; }
|
||||||
CUser otherController = otherStation.getController();
|
CUser otherController = otherStation.getController();
|
||||||
this->m_controller.synchronizeData(otherController);
|
m_controller.synchronizeData(otherController);
|
||||||
otherStation.setController(otherController);
|
otherStation.setController(otherController);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,8 +238,8 @@ namespace BlackMisc
|
|||||||
|
|
||||||
bool CAtcStation::hasValidBookingTimes() const
|
bool CAtcStation::hasValidBookingTimes() const
|
||||||
{
|
{
|
||||||
return !this->m_bookedFromUtc.isNull() && this->m_bookedFromUtc.isValid() &&
|
return !m_bookedFromUtc.isNull() && m_bookedFromUtc.isValid() &&
|
||||||
!this->m_bookedUntilUtc.isNull() && this->m_bookedUntilUtc.isValid();
|
!m_bookedUntilUtc.isNull() && m_bookedUntilUtc.isValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAtcStation::setBookedFromUntil(const CAtcStation &otherStation)
|
void CAtcStation::setBookedFromUntil(const CAtcStation &otherStation)
|
||||||
@@ -252,8 +252,8 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
if (!this->hasValidBookingTimes()) { return false; }
|
if (!this->hasValidBookingTimes()) { return false; }
|
||||||
QDateTime now = QDateTime::currentDateTimeUtc();
|
QDateTime now = QDateTime::currentDateTimeUtc();
|
||||||
if (this->m_bookedFromUtc > now) { return false; }
|
if (m_bookedFromUtc > now) { return false; }
|
||||||
if (now > this->m_bookedUntilUtc) { return false; }
|
if (now > m_bookedUntilUtc) { return false; }
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -267,13 +267,13 @@ namespace BlackMisc
|
|||||||
if (!this->hasValidBookingTimes()) { return CTime(0, nullptr); }
|
if (!this->hasValidBookingTimes()) { return CTime(0, nullptr); }
|
||||||
QDateTime now = QDateTime::currentDateTimeUtc();
|
QDateTime now = QDateTime::currentDateTimeUtc();
|
||||||
qint64 diffMs;
|
qint64 diffMs;
|
||||||
if (this->m_bookedFromUtc > now)
|
if (m_bookedFromUtc > now)
|
||||||
{
|
{
|
||||||
// future
|
// future
|
||||||
diffMs = now.msecsTo(this->m_bookedFromUtc);
|
diffMs = now.msecsTo(m_bookedFromUtc);
|
||||||
return CTime(diffMs / 1000.0, CTimeUnit::s());
|
return CTime(diffMs / 1000.0, CTimeUnit::s());
|
||||||
}
|
}
|
||||||
else if (this->m_bookedUntilUtc > now)
|
else if (m_bookedUntilUtc > now)
|
||||||
{
|
{
|
||||||
// now
|
// now
|
||||||
return CTime(0.0, CTimeUnit::s());
|
return CTime(0.0, CTimeUnit::s());
|
||||||
@@ -298,17 +298,17 @@ namespace BlackMisc
|
|||||||
|
|
||||||
const CAltitude &CAtcStation::geodeticHeight() const
|
const CAltitude &CAtcStation::geodeticHeight() const
|
||||||
{
|
{
|
||||||
return this->m_position.geodeticHeight();
|
return m_position.geodeticHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector3D CAtcStation::normalVector() const
|
QVector3D CAtcStation::normalVector() const
|
||||||
{
|
{
|
||||||
return this->m_position.normalVector();
|
return m_position.normalVector();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::array<double, 3> CAtcStation::normalVectorDouble() const
|
std::array<double, 3> CAtcStation::normalVectorDouble() const
|
||||||
{
|
{
|
||||||
return this->m_position.normalVectorDouble();
|
return m_position.normalVectorDouble();
|
||||||
}
|
}
|
||||||
|
|
||||||
CVariant CAtcStation::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
CVariant CAtcStation::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||||
@@ -318,33 +318,33 @@ namespace BlackMisc
|
|||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case IndexBookedFrom:
|
case IndexBookedFrom:
|
||||||
return CVariant::from(this->m_bookedFromUtc);
|
return CVariant::from(m_bookedFromUtc);
|
||||||
case IndexBookedUntil:
|
case IndexBookedUntil:
|
||||||
return CVariant::from(this->m_bookedUntilUtc);
|
return CVariant::from(m_bookedUntilUtc);
|
||||||
case IndexCallsign:
|
case IndexCallsign:
|
||||||
return this->m_callsign.propertyByIndex(index.copyFrontRemoved());
|
return m_callsign.propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexController:
|
case IndexController:
|
||||||
return this->m_controller.propertyByIndex(index.copyFrontRemoved());
|
return m_controller.propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexFrequency:
|
case IndexFrequency:
|
||||||
return this->m_frequency.propertyByIndex(index.copyFrontRemoved());
|
return m_frequency.propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexIsOnline:
|
case IndexIsOnline:
|
||||||
return CVariant::from(this->m_isOnline);
|
return CVariant::from(m_isOnline);
|
||||||
case IndexLatitude:
|
case IndexLatitude:
|
||||||
return this->latitude().propertyByIndex(index.copyFrontRemoved());
|
return this->latitude().propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexLongitude:
|
case IndexLongitude:
|
||||||
return this->longitude().propertyByIndex(index.copyFrontRemoved());
|
return this->longitude().propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexPosition:
|
case IndexPosition:
|
||||||
return this->m_position.propertyByIndex(index.copyFrontRemoved());
|
return m_position.propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexRange:
|
case IndexRange:
|
||||||
return this->m_range.propertyByIndex(index.copyFrontRemoved());
|
return m_range.propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexIsInRange:
|
case IndexIsInRange:
|
||||||
return CVariant::fromValue(isInRange());
|
return CVariant::fromValue(isInRange());
|
||||||
case IndexAtis:
|
case IndexAtis:
|
||||||
return this->m_atis.propertyByIndex(index.copyFrontRemoved());
|
return m_atis.propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexMetar:
|
case IndexMetar:
|
||||||
return this->m_metar.propertyByIndex(index.copyFrontRemoved());
|
return m_metar.propertyByIndex(index.copyFrontRemoved());
|
||||||
case IndexVoiceRoom:
|
case IndexVoiceRoom:
|
||||||
return this->m_voiceRoom.propertyByIndex(index.copyFrontRemoved());
|
return m_voiceRoom.propertyByIndex(index.copyFrontRemoved());
|
||||||
default:
|
default:
|
||||||
return (ICoordinateWithRelativePosition::canHandleIndex(index)) ?
|
return (ICoordinateWithRelativePosition::canHandleIndex(index)) ?
|
||||||
ICoordinateWithRelativePosition::propertyByIndex(index) :
|
ICoordinateWithRelativePosition::propertyByIndex(index) :
|
||||||
@@ -365,31 +365,31 @@ namespace BlackMisc
|
|||||||
this->setBookedUntilUtc(variant.value<QDateTime>());
|
this->setBookedUntilUtc(variant.value<QDateTime>());
|
||||||
break;
|
break;
|
||||||
case IndexCallsign:
|
case IndexCallsign:
|
||||||
this->m_callsign.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
m_callsign.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||||
break;
|
break;
|
||||||
case IndexController:
|
case IndexController:
|
||||||
this->m_controller.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
m_controller.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||||
break;
|
break;
|
||||||
case IndexFrequency:
|
case IndexFrequency:
|
||||||
this->m_frequency.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
m_frequency.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||||
break;
|
break;
|
||||||
case IndexIsOnline:
|
case IndexIsOnline:
|
||||||
this->setOnline(variant.value<bool>());
|
this->setOnline(variant.value<bool>());
|
||||||
break;
|
break;
|
||||||
case IndexPosition:
|
case IndexPosition:
|
||||||
this->m_position.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
m_position.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||||
break;
|
break;
|
||||||
case IndexRange:
|
case IndexRange:
|
||||||
this->m_range.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
m_range.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||||
break;
|
break;
|
||||||
case IndexAtis:
|
case IndexAtis:
|
||||||
this->m_atis.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
m_atis.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||||
break;
|
break;
|
||||||
case IndexMetar:
|
case IndexMetar:
|
||||||
this->m_metar.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
m_metar.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||||
break;
|
break;
|
||||||
case IndexVoiceRoom:
|
case IndexVoiceRoom:
|
||||||
this->m_voiceRoom.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
m_voiceRoom.setPropertyByIndex(index.copyFrontRemoved(), variant);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (ICoordinateWithRelativePosition::canHandleIndex(index))
|
if (ICoordinateWithRelativePosition::canHandleIndex(index))
|
||||||
@@ -415,11 +415,11 @@ namespace BlackMisc
|
|||||||
case IndexBookedUntil:
|
case IndexBookedUntil:
|
||||||
return Compare::compare(this->getBookedUntilUtc(), compareValue.getBookedUntilUtc());
|
return Compare::compare(this->getBookedUntilUtc(), compareValue.getBookedUntilUtc());
|
||||||
case IndexCallsign:
|
case IndexCallsign:
|
||||||
return this->m_callsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign());
|
return m_callsign.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getCallsign());
|
||||||
case IndexController:
|
case IndexController:
|
||||||
return this->m_controller.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getController());
|
return m_controller.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getController());
|
||||||
case IndexFrequency:
|
case IndexFrequency:
|
||||||
return this->m_frequency.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getFrequency());
|
return m_frequency.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getFrequency());
|
||||||
case IndexIsOnline:
|
case IndexIsOnline:
|
||||||
return Compare::compare(this->isOnline(), compareValue.isOnline());
|
return Compare::compare(this->isOnline(), compareValue.isOnline());
|
||||||
case IndexLatitude:
|
case IndexLatitude:
|
||||||
@@ -427,15 +427,15 @@ namespace BlackMisc
|
|||||||
case IndexLongitude:
|
case IndexLongitude:
|
||||||
return this->longitude().comparePropertyByIndex(index.copyFrontRemoved(), compareValue.longitude());
|
return this->longitude().comparePropertyByIndex(index.copyFrontRemoved(), compareValue.longitude());
|
||||||
case IndexPosition:
|
case IndexPosition:
|
||||||
return this->m_position.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getPosition());
|
return m_position.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getPosition());
|
||||||
case IndexRange:
|
case IndexRange:
|
||||||
return this->m_range.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getRange());
|
return m_range.comparePropertyByIndex(index.copyFrontRemoved(), compareValue.getRange());
|
||||||
case IndexIsInRange:
|
case IndexIsInRange:
|
||||||
return Compare::compare(this->isInRange(), compareValue.isInRange());
|
return Compare::compare(this->isInRange(), compareValue.isInRange());
|
||||||
case IndexAtis:
|
case IndexAtis:
|
||||||
return this->m_atis.getMessage().compare(compareValue.getAtis().getMessage());
|
return m_atis.getMessage().compare(compareValue.getAtis().getMessage());
|
||||||
case IndexMetar:
|
case IndexMetar:
|
||||||
return this->m_metar.getMessage().compare(compareValue.getMetar().getMessage());
|
return m_metar.getMessage().compare(compareValue.getMetar().getMessage());
|
||||||
case IndexVoiceRoom:
|
case IndexVoiceRoom:
|
||||||
return this->getVoiceRoom().getVoiceRoomUrl().compare(compareValue.getVoiceRoom().getVoiceRoomUrl());
|
return this->getVoiceRoom().getVoiceRoomUrl().compare(compareValue.getVoiceRoom().getVoiceRoomUrl());
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ namespace BlackMisc
|
|||||||
bool hasBookingTimes() const;
|
bool hasBookingTimes() const;
|
||||||
|
|
||||||
//! Has ATIS?
|
//! Has ATIS?
|
||||||
bool hasAtis() const { return this->m_atis.hasMessage(); }
|
bool hasAtis() const { return m_atis.hasMessage(); }
|
||||||
|
|
||||||
//! Has METAR?
|
//! Has METAR?
|
||||||
bool hasMetar() const;
|
bool hasMetar() const;
|
||||||
@@ -111,31 +111,31 @@ namespace BlackMisc
|
|||||||
void setController(const BlackMisc::Network::CUser &controller);
|
void setController(const BlackMisc::Network::CUser &controller);
|
||||||
|
|
||||||
//! Set controller's name
|
//! Set controller's name
|
||||||
void setControllerRealName(const QString &controllerName) { this->m_controller.setRealName(controllerName); }
|
void setControllerRealName(const QString &controllerName) { m_controller.setRealName(controllerName); }
|
||||||
|
|
||||||
//! Set controller's id
|
//! Set controller's id
|
||||||
void setControllerId(const QString &controllerId) { this->m_controller.setId(controllerId); }
|
void setControllerId(const QString &controllerId) { m_controller.setId(controllerId); }
|
||||||
|
|
||||||
//! Has valid realname?
|
//! Has valid realname?
|
||||||
bool hasValidRealName() const { return this->m_controller.hasValidRealName(); }
|
bool hasValidRealName() const { return m_controller.hasValidRealName(); }
|
||||||
|
|
||||||
//! Has valid id?
|
//! Has valid id?
|
||||||
bool hasValidId() const { return this->m_controller.hasValidId(); }
|
bool hasValidId() const { return m_controller.hasValidId(); }
|
||||||
|
|
||||||
//! Valid COM frequency
|
//! Valid COM frequency
|
||||||
bool hasValidFrequency() const { return BlackMisc::Aviation::CComSystem::isValidCivilAviationFrequency(this->getFrequency()); }
|
bool hasValidFrequency() const { return BlackMisc::Aviation::CComSystem::isValidCivilAviationFrequency(this->getFrequency()); }
|
||||||
|
|
||||||
//! Get frequency.
|
//! Get frequency.
|
||||||
const BlackMisc::PhysicalQuantities::CFrequency &getFrequency() const { return m_frequency; }
|
const PhysicalQuantities::CFrequency &getFrequency() const { return m_frequency; }
|
||||||
|
|
||||||
//! Set frequency
|
//! Set frequency
|
||||||
void setFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency);
|
void setFrequency(const BlackMisc::PhysicalQuantities::CFrequency &frequency);
|
||||||
|
|
||||||
//! Get the position of the center of the controller's area of visibility.
|
//! Get the position of the center of the controller's area of visibility.
|
||||||
const BlackMisc::Geo::CCoordinateGeodetic &getPosition() const { return m_position; }
|
const Geo::CCoordinateGeodetic &getPosition() const { return m_position; }
|
||||||
|
|
||||||
//! Set position
|
//! Set position
|
||||||
void setPosition(const BlackMisc::Geo::CCoordinateGeodetic &position) { this->m_position = position; }
|
void setPosition(const BlackMisc::Geo::CCoordinateGeodetic &position) { m_position = position; }
|
||||||
|
|
||||||
//! Synchronize controller data
|
//! Synchronize controller data
|
||||||
//! Updates two stations (normally a booked and online ATC station) with complementary data
|
//! Updates two stations (normally a booked and online ATC station) with complementary data
|
||||||
@@ -147,10 +147,10 @@ namespace BlackMisc
|
|||||||
void synchronizeWithBookedStation(CAtcStation &bookedStation);
|
void synchronizeWithBookedStation(CAtcStation &bookedStation);
|
||||||
|
|
||||||
//! Get the radius of the controller's area of visibility.
|
//! Get the radius of the controller's area of visibility.
|
||||||
const BlackMisc::PhysicalQuantities::CLength &getRange() const { return m_range; }
|
const PhysicalQuantities::CLength &getRange() const { return m_range; }
|
||||||
|
|
||||||
//! Set range
|
//! Set range
|
||||||
void setRange(const BlackMisc::PhysicalQuantities::CLength &range) { this->m_range = range; }
|
void setRange(const PhysicalQuantities::CLength &range) { m_range = range; }
|
||||||
|
|
||||||
//! In range? If range and distance to own aircraft are not available false
|
//! In range? If range and distance to own aircraft are not available false
|
||||||
bool isInRange() const;
|
bool isInRange() const;
|
||||||
@@ -159,19 +159,19 @@ namespace BlackMisc
|
|||||||
bool isOnline() const { return m_isOnline; }
|
bool isOnline() const { return m_isOnline; }
|
||||||
|
|
||||||
//! Set online
|
//! Set online
|
||||||
void setOnline(bool online) { this->m_isOnline = online; }
|
void setOnline(bool online) { m_isOnline = online; }
|
||||||
|
|
||||||
//! Get voice room
|
//! Get voice room
|
||||||
const BlackMisc::Audio::CVoiceRoom &getVoiceRoom() const { return this->m_voiceRoom; }
|
const Audio::CVoiceRoom &getVoiceRoom() const { return m_voiceRoom; }
|
||||||
|
|
||||||
//! Set voice room
|
//! Set voice room
|
||||||
void setVoiceRoom(const BlackMisc::Audio::CVoiceRoom &voiceRoom) { this->m_voiceRoom = voiceRoom; }
|
void setVoiceRoom(const Audio::CVoiceRoom &voiceRoom) { m_voiceRoom = voiceRoom; }
|
||||||
|
|
||||||
//! Set voice room URL
|
//! Set voice room URL
|
||||||
void setVoiceRoomUrl(const QString &url) { this->m_voiceRoom.setVoiceRoomUrl(url); }
|
void setVoiceRoomUrl(const QString &url) { m_voiceRoom.setVoiceRoomUrl(url); }
|
||||||
|
|
||||||
//! Valid voice room?
|
//! Valid voice room?
|
||||||
bool hasValidVoiceRoom() const { return this->m_voiceRoom.isValid(); }
|
bool hasValidVoiceRoom() const { return m_voiceRoom.isValid(); }
|
||||||
|
|
||||||
//! Booked date/time if any.
|
//! Booked date/time if any.
|
||||||
//! This represents the closest booking within a time frame as there can be multiple bookings.
|
//! This represents the closest booking within a time frame as there can be multiple bookings.
|
||||||
@@ -185,7 +185,7 @@ namespace BlackMisc
|
|||||||
bool hasValidBookingTimes() const;
|
bool hasValidBookingTimes() const;
|
||||||
|
|
||||||
//! Set booked from
|
//! Set booked from
|
||||||
void setBookedFromUtc(const QDateTime &from) { this->m_bookedFromUtc = from; }
|
void setBookedFromUtc(const QDateTime &from) { m_bookedFromUtc = from; }
|
||||||
|
|
||||||
//! Transfer booking times
|
//! Transfer booking times
|
||||||
void setBookedFromUntil(const CAtcStation &otherStation);
|
void setBookedFromUntil(const CAtcStation &otherStation);
|
||||||
@@ -200,37 +200,37 @@ namespace BlackMisc
|
|||||||
//! negative values mean booking in past,
|
//! negative values mean booking in past,
|
||||||
//! positive values mean booking in future,
|
//! positive values mean booking in future,
|
||||||
//! no booking dates will result in null time
|
//! no booking dates will result in null time
|
||||||
BlackMisc::PhysicalQuantities::CTime bookedWhen() const;
|
PhysicalQuantities::CTime bookedWhen() const;
|
||||||
|
|
||||||
//! Get ATIS
|
//! Get ATIS
|
||||||
const CInformationMessage &getAtis() const { return m_atis; }
|
const CInformationMessage &getAtis() const { return m_atis; }
|
||||||
|
|
||||||
//! Set ATIS
|
//! Set ATIS
|
||||||
void setAtis(const CInformationMessage &atis) { this->m_atis = atis;}
|
void setAtis(const CInformationMessage &atis) { m_atis = atis;}
|
||||||
|
|
||||||
//! Set ATIS Message
|
//! Set ATIS Message
|
||||||
void setAtisMessage(const QString &atis) { this->m_atis.setMessage(atis); }
|
void setAtisMessage(const QString &atis) { m_atis.setMessage(atis); }
|
||||||
|
|
||||||
//! Get METAR
|
//! Get METAR
|
||||||
const CInformationMessage &getMetar() const { return m_metar; }
|
const CInformationMessage &getMetar() const { return m_metar; }
|
||||||
|
|
||||||
//! Set METAR
|
//! Set METAR
|
||||||
void setMetar(const CInformationMessage &metar) { this->m_metar = metar;}
|
void setMetar(const CInformationMessage &metar) { m_metar = metar;}
|
||||||
|
|
||||||
//! Set METAR Message
|
//! Set METAR Message
|
||||||
void setMetarMessage(const QString &metar) { this->m_metar.setMessage(metar); }
|
void setMetarMessage(const QString &metar) { m_metar.setMessage(metar); }
|
||||||
|
|
||||||
//! Set booked until
|
//! Set booked until
|
||||||
void setBookedUntilUtc(const QDateTime &until) { this->m_bookedUntilUtc = until; }
|
void setBookedUntilUtc(const QDateTime &until) { m_bookedUntilUtc = until; }
|
||||||
|
|
||||||
//! \copydoc Geo::ICoordinateGeodetic::latitude
|
//! \copydoc Geo::ICoordinateGeodetic::latitude
|
||||||
virtual BlackMisc::Geo::CLatitude latitude() const override;
|
virtual Geo::CLatitude latitude() const override;
|
||||||
|
|
||||||
//! \copydoc Geo::ICoordinateGeodetic::longitude
|
//! \copydoc Geo::ICoordinateGeodetic::longitude
|
||||||
virtual BlackMisc::Geo::CLongitude longitude() const override;
|
virtual Geo::CLongitude longitude() const override;
|
||||||
|
|
||||||
//! \copydoc Geo::ICoordinateGeodetic::geodeticHeight
|
//! \copydoc Geo::ICoordinateGeodetic::geodeticHeight
|
||||||
const BlackMisc::Aviation::CAltitude &geodeticHeight() const override;
|
const Aviation::CAltitude &geodeticHeight() const override;
|
||||||
|
|
||||||
//! \copydoc Geo::ICoordinateGeodetic::normalVector
|
//! \copydoc Geo::ICoordinateGeodetic::normalVector
|
||||||
virtual QVector3D normalVector() const override;
|
virtual QVector3D normalVector() const override;
|
||||||
@@ -239,7 +239,7 @@ namespace BlackMisc
|
|||||||
virtual std::array<double, 3> normalVectorDouble() const override;
|
virtual std::array<double, 3> normalVectorDouble() const override;
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
CVariant propertyByIndex(const CPropertyIndex &index) const;
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||||
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
void setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant);
|
||||||
@@ -251,20 +251,20 @@ namespace BlackMisc
|
|||||||
QString convertToQString(bool i18n = false) const;
|
QString convertToQString(bool i18n = false) const;
|
||||||
|
|
||||||
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
//! \copydoc BlackMisc::Mixin::Icon::toIcon()
|
||||||
BlackMisc::CIcon toIcon() const { return this->m_callsign.toIcon(); }
|
BlackMisc::CIcon toIcon() const { return m_callsign.toIcon(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CCallsign m_callsign;
|
CCallsign m_callsign;
|
||||||
BlackMisc::Network::CUser m_controller;
|
Network::CUser m_controller;
|
||||||
BlackMisc::PhysicalQuantities::CFrequency m_frequency;
|
PhysicalQuantities::CFrequency m_frequency;
|
||||||
BlackMisc::Geo::CCoordinateGeodetic m_position;
|
Geo::CCoordinateGeodetic m_position;
|
||||||
BlackMisc::PhysicalQuantities::CLength m_range;
|
PhysicalQuantities::CLength m_range;
|
||||||
bool m_isOnline = false;
|
bool m_isOnline = false;
|
||||||
QDateTime m_bookedFromUtc;
|
QDateTime m_bookedFromUtc;
|
||||||
QDateTime m_bookedUntilUtc;
|
QDateTime m_bookedUntilUtc;
|
||||||
CInformationMessage m_atis { CInformationMessage::ATIS };
|
CInformationMessage m_atis { CInformationMessage::ATIS };
|
||||||
CInformationMessage m_metar { CInformationMessage::METAR };
|
CInformationMessage m_metar { CInformationMessage::METAR };
|
||||||
BlackMisc::Audio::CVoiceRoom m_voiceRoom;
|
Audio::CVoiceRoom m_voiceRoom;
|
||||||
|
|
||||||
BLACK_METACLASS(
|
BLACK_METACLASS(
|
||||||
CAtcStation,
|
CAtcStation,
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace BlackMisc
|
|||||||
QString CCallsign::convertToQString(bool i18n) const
|
QString CCallsign::convertToQString(bool i18n) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(i18n);
|
Q_UNUSED(i18n);
|
||||||
return this->m_callsign;
|
return m_callsign;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CCallsign::unifyCallsign(const QString &callsign)
|
QString CCallsign::unifyCallsign(const QString &callsign)
|
||||||
@@ -73,7 +73,7 @@ namespace BlackMisc
|
|||||||
bool CCallsign::isSupervisorCallsign() const
|
bool CCallsign::isSupervisorCallsign() const
|
||||||
{
|
{
|
||||||
if (this->getTypeHint() == Aircraft) { return false; }
|
if (this->getTypeHint() == Aircraft) { return false; }
|
||||||
return this->m_callsign.endsWith("SUP");
|
return m_callsign.endsWith("SUP");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CCallsign::getIcaoCode() const
|
QString CCallsign::getIcaoCode() const
|
||||||
@@ -122,11 +122,11 @@ namespace BlackMisc
|
|||||||
|
|
||||||
QString CCallsign::getAirlineSuffix() const
|
QString CCallsign::getAirlineSuffix() const
|
||||||
{
|
{
|
||||||
if (this->m_callsign.length() < 3) { return ""; }
|
if (m_callsign.length() < 3) { return ""; }
|
||||||
if (this->isAtcCallsign()) { return ""; }
|
if (this->isAtcCallsign()) { return ""; }
|
||||||
|
|
||||||
thread_local const QRegularExpression regExp("^[A-Z]{3,}");
|
thread_local const QRegularExpression regExp("^[A-Z]{3,}");
|
||||||
QRegularExpressionMatch match = regExp.match(this->m_callsign);
|
QRegularExpressionMatch match = regExp.match(m_callsign);
|
||||||
if (!match.hasMatch()) { return QString(); }
|
if (!match.hasMatch()) { return QString(); }
|
||||||
const QString airline = match.captured(0);
|
const QString airline = match.captured(0);
|
||||||
|
|
||||||
@@ -178,13 +178,13 @@ namespace BlackMisc
|
|||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case IndexCallsignString:
|
case IndexCallsignString:
|
||||||
this->m_callsign = variant.toQString();
|
m_callsign = variant.toQString();
|
||||||
break;
|
break;
|
||||||
case IndexCallsignStringAsSet:
|
case IndexCallsignStringAsSet:
|
||||||
this->m_callsignAsSet = variant.toQString();
|
m_callsignAsSet = variant.toQString();
|
||||||
break;
|
break;
|
||||||
case IndexTelephonyDesignator:
|
case IndexTelephonyDesignator:
|
||||||
this->m_telephonyDesignator = variant.toQString();
|
m_telephonyDesignator = variant.toQString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
CValueObject::setPropertyByIndex(index, variant);
|
CValueObject::setPropertyByIndex(index, variant);
|
||||||
@@ -193,16 +193,16 @@ namespace BlackMisc
|
|||||||
|
|
||||||
int CCallsign::comparePropertyByIndex(const CPropertyIndex &index, const CCallsign &compareValue) const
|
int CCallsign::comparePropertyByIndex(const CPropertyIndex &index, const CCallsign &compareValue) const
|
||||||
{
|
{
|
||||||
if (index.isMyself()) { return this->m_callsign.compare(compareValue.m_callsign, Qt::CaseInsensitive); }
|
if (index.isMyself()) { return m_callsign.compare(compareValue.m_callsign, Qt::CaseInsensitive); }
|
||||||
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
const ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case IndexCallsignString:
|
case IndexCallsignString:
|
||||||
return this->m_callsign.compare(compareValue.m_callsign, Qt::CaseInsensitive);
|
return m_callsign.compare(compareValue.m_callsign, Qt::CaseInsensitive);
|
||||||
case IndexCallsignStringAsSet:
|
case IndexCallsignStringAsSet:
|
||||||
return this->m_callsignAsSet.compare(compareValue.m_callsignAsSet, Qt::CaseInsensitive);
|
return m_callsignAsSet.compare(compareValue.m_callsignAsSet, Qt::CaseInsensitive);
|
||||||
case IndexTelephonyDesignator:
|
case IndexTelephonyDesignator:
|
||||||
return this->m_telephonyDesignator.compare(compareValue.m_telephonyDesignator, Qt::CaseInsensitive);
|
return m_telephonyDesignator.compare(compareValue.m_telephonyDesignator, Qt::CaseInsensitive);
|
||||||
case IndexSuffix:
|
case IndexSuffix:
|
||||||
return this->getSuffix().compare(compareValue.getSuffix(), Qt::CaseInsensitive);
|
return this->getSuffix().compare(compareValue.getSuffix(), Qt::CaseInsensitive);
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ namespace BlackMisc
|
|||||||
//! Indexes
|
//! Indexes
|
||||||
enum ColumnIndex
|
enum ColumnIndex
|
||||||
{
|
{
|
||||||
IndexCallsignString = BlackMisc::CPropertyIndex::GlobalIndexCCallsign,
|
IndexCallsignString = CPropertyIndex::GlobalIndexCCallsign,
|
||||||
IndexCallsignStringAsSet,
|
IndexCallsignStringAsSet,
|
||||||
IndexTelephonyDesignator,
|
IndexTelephonyDesignator,
|
||||||
IndexSuffix
|
IndexSuffix
|
||||||
@@ -69,7 +69,7 @@ namespace BlackMisc
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
//! Is empty?
|
//! Is empty?
|
||||||
bool isEmpty() const { return this->m_callsignAsSet.isEmpty(); }
|
bool isEmpty() const { return m_callsignAsSet.isEmpty(); }
|
||||||
|
|
||||||
//! ATC callsign
|
//! ATC callsign
|
||||||
//! \sa atcCallsignSuffixes()
|
//! \sa atcCallsignSuffixes()
|
||||||
@@ -86,19 +86,19 @@ namespace BlackMisc
|
|||||||
bool isSupervisorCallsign() const;
|
bool isSupervisorCallsign() const;
|
||||||
|
|
||||||
//! Get callsign (normalized)
|
//! Get callsign (normalized)
|
||||||
const QString &asString() const { return this->m_callsign; }
|
const QString &asString() const { return m_callsign; }
|
||||||
|
|
||||||
//! Get callsign.
|
//! Get callsign.
|
||||||
const QString &getStringAsSet() const { return this->m_callsignAsSet; }
|
const QString &getStringAsSet() const { return m_callsignAsSet; }
|
||||||
|
|
||||||
//! Get callsign telephony designator (how callsign is pronounced)
|
//! Get callsign telephony designator (how callsign is pronounced)
|
||||||
const QString &getTelephonyDesignator() const { return this->m_telephonyDesignator; }
|
const QString &getTelephonyDesignator() const { return m_telephonyDesignator; }
|
||||||
|
|
||||||
//! Type hint
|
//! Type hint
|
||||||
TypeHint getTypeHint() const { return m_typeHint; }
|
TypeHint getTypeHint() const { return m_typeHint; }
|
||||||
|
|
||||||
//! Type hint
|
//! Type hint
|
||||||
void setTypeHint(TypeHint hint) { this->m_typeHint = hint; }
|
void setTypeHint(TypeHint hint) { m_typeHint = hint; }
|
||||||
|
|
||||||
//! Get ICAO code, if this makes sense (EDDF_TWR -> EDDF)
|
//! Get ICAO code, if this makes sense (EDDF_TWR -> EDDF)
|
||||||
QString getIcaoCode() const;
|
QString getIcaoCode() const;
|
||||||
@@ -181,5 +181,6 @@ namespace BlackMisc
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(BlackMisc::Aviation::CCallsign)
|
Q_DECLARE_METATYPE(BlackMisc::Aviation::CCallsign)
|
||||||
|
Q_DECLARE_METATYPE(BlackMisc::Aviation::CCallsign::TypeHint)
|
||||||
|
|
||||||
#endif // guard
|
#endif // guard
|
||||||
|
|||||||
@@ -27,9 +27,7 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
namespace Network
|
namespace Network
|
||||||
{
|
{
|
||||||
class CRemoteFile;
|
//! Value object encapsulating a list of remote files.
|
||||||
|
|
||||||
//! Value object encapsulating a list of servers.
|
|
||||||
class BLACKMISC_EXPORT CRemoteFileList :
|
class BLACKMISC_EXPORT CRemoteFileList :
|
||||||
public CSequence<CRemoteFile>,
|
public CSequence<CRemoteFile>,
|
||||||
public BlackMisc::Mixin::MetaType<CRemoteFileList>
|
public BlackMisc::Mixin::MetaType<CRemoteFileList>
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
#include "testprocess.h"
|
#include "testprocess.h"
|
||||||
#include "blackmisc/processinfo.h"
|
#include "blackmisc/processinfo.h"
|
||||||
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
@@ -24,7 +23,6 @@ using namespace BlackMisc;
|
|||||||
|
|
||||||
namespace BlackMiscTest
|
namespace BlackMiscTest
|
||||||
{
|
{
|
||||||
|
|
||||||
void CTestProcess::processInfo()
|
void CTestProcess::processInfo()
|
||||||
{
|
{
|
||||||
CProcessInfo invalid;
|
CProcessInfo invalid;
|
||||||
@@ -37,7 +35,6 @@ namespace BlackMiscTest
|
|||||||
QVERIFY2(current1 == current2, "Current process equals process with current PID");
|
QVERIFY2(current1 == current2, "Current process equals process with current PID");
|
||||||
QVERIFY2(current1 == current3, "Current process equals process with current PID and name");
|
QVERIFY2(current1 == current3, "Current process equals process with current PID and name");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! \endcond
|
//! \endcond
|
||||||
|
|||||||
Reference in New Issue
Block a user