mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Formatting, comments typos, doxygen
This commit is contained in:
@@ -27,10 +27,10 @@ namespace BlackMisc
|
||||
class CAircraftList : public CSequence<CAircraft>
|
||||
{
|
||||
public:
|
||||
//! \brief Default constructor.
|
||||
//! Default constructor.
|
||||
CAircraftList();
|
||||
|
||||
//! \brief Construct from a base class object.
|
||||
//! Construct from a base class object.
|
||||
CAircraftList(const CSequence<CAircraft> &other);
|
||||
|
||||
//! \copydoc CValueObject::toQVariant
|
||||
@@ -39,18 +39,19 @@ namespace BlackMisc
|
||||
return QVariant::fromValue(*this);
|
||||
}
|
||||
|
||||
//! \brief Find 0..n stations by callsign
|
||||
//! Find 0..n stations by callsign
|
||||
CAircraftList findByCallsign(const CCallsign &callsign) const;
|
||||
|
||||
//! All pilots (with valid data)
|
||||
/*!
|
||||
* \brief Find 0..n stations within range of given coordinate
|
||||
* Find 0..n stations within range of given coordinate
|
||||
* \param coordinate other position
|
||||
* \param range within range of other position
|
||||
* \return
|
||||
*/
|
||||
CAircraftList findWithinRange(const BlackMisc::Geo::ICoordinateGeodetic &coordinate, const BlackMisc::PhysicalQuantities::CLength &range) const;
|
||||
|
||||
//! \brief Register metadata
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
//! \brief Update aircraft with data from VATSIM data file
|
||||
|
||||
@@ -27,10 +27,10 @@ namespace BlackMisc
|
||||
class CAtcStationList : public CSequence<CAtcStation>
|
||||
{
|
||||
public:
|
||||
//! \brief Default constructor.
|
||||
//! Default constructor.
|
||||
CAtcStationList();
|
||||
|
||||
//! \brief Construct from a base class object.
|
||||
//! Construct from a base class object.
|
||||
CAtcStationList(const CSequence<CAtcStation> &other);
|
||||
|
||||
//! \copydoc CValueObject::toQVariant()
|
||||
@@ -39,26 +39,27 @@ namespace BlackMisc
|
||||
return QVariant::fromValue(*this);
|
||||
}
|
||||
|
||||
//! \brief Find 0..n stations by callsign
|
||||
//! Find 0..n stations by callsign
|
||||
CAtcStationList findByCallsign(const CCallsign &callsign) const;
|
||||
|
||||
//! \brief Find 0..n stations within range of given coordinate
|
||||
//! Find 0..n stations within range of given coordinate
|
||||
CAtcStationList findWithinRange(const BlackMisc::Geo::ICoordinateGeodetic &coordinate, const BlackMisc::PhysicalQuantities::CLength &range) const;
|
||||
|
||||
//! \brief Find 0..n stations tune in frequency of COM unit (with 25kHt channel spacing
|
||||
//! Find 0..n stations tune in frequency of COM unit (with 25kHt channel spacing
|
||||
CAtcStationList findIfComUnitTunedIn25KHz(const BlackMisc::Aviation::CComSystem &comUnit) const;
|
||||
|
||||
//! \brief Update distances to coordinate, usually own aircraft's position
|
||||
//! All controllers (with valid data)
|
||||
//! Update distances to coordinate, usually own aircraft's position
|
||||
void calculateDistancesToPlane(const BlackMisc::Geo::CCoordinateGeodetic &position);
|
||||
|
||||
//! \brief Register metadata
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
//! \brief Merge with ATC station representing booking information
|
||||
//! Merge with ATC station representing booking information
|
||||
//! \remarks Can be used if the stored data in this list are online ATC stations
|
||||
int mergeWithBooking(CAtcStation &bookedAtcStation);
|
||||
|
||||
//! \brief Merge with the data from the VATSIM data file
|
||||
//! Merge with the data from the VATSIM data file
|
||||
//! \remarks Can be used if the stored data in this list are VATSIM data file stations
|
||||
int updateFromVatsimDataFileStation(CAtcStation &stationToBeUpdated) const;
|
||||
};
|
||||
|
||||
@@ -18,12 +18,12 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Hardware
|
||||
{
|
||||
//! \brief Value object representing a keyboard key.
|
||||
//! Value object representing a keyboard key.
|
||||
class CKeyboardKey : public CValueObject
|
||||
{
|
||||
public:
|
||||
|
||||
//! \brief Properties by index
|
||||
//! Properties by index
|
||||
enum ColumnIndex
|
||||
{
|
||||
IndexKey = 0,
|
||||
@@ -99,110 +99,110 @@ namespace BlackMisc
|
||||
//! \copydoc TupleConverter<>::jsonMembers()
|
||||
static const QStringList &jsonMembers();
|
||||
|
||||
//! \brief Equal?
|
||||
//! Equal?
|
||||
bool operator ==(const CKeyboardKey &other) const;
|
||||
|
||||
//! \brief Unequal operator !=
|
||||
//! Unequal operator !=
|
||||
bool operator !=(const CKeyboardKey &other) const;
|
||||
|
||||
//! \brief <
|
||||
//! <
|
||||
bool operator<(CKeyboardKey const &other) const;
|
||||
|
||||
//! \brief Get key code
|
||||
//! Get key code
|
||||
Qt::Key getKey() const { return this->m_qtKey; }
|
||||
|
||||
//! \brief Get key code
|
||||
//! Get key code
|
||||
QString getKeyAsString() const { return QString(this->getKey()); }
|
||||
|
||||
//! \brief Get key code
|
||||
//! Get key code
|
||||
QString getKeyAsStringRepresentation() const { return CKeyboardKey::toStringRepresentation(this->m_qtKey); }
|
||||
|
||||
//! \brief As Qt::Key
|
||||
//! As Qt::Key
|
||||
Qt::Key getKeyAsQtKey() const { return static_cast<Qt::Key>(this->m_qtKey);}
|
||||
|
||||
//! \brief Set key code
|
||||
//! Set key code
|
||||
void setKey(const QString &key);
|
||||
|
||||
//! \brief Set key code
|
||||
//! Set key code
|
||||
void setKey(const QChar &key);
|
||||
|
||||
//! \brief Set key code
|
||||
//! Set key code
|
||||
void setKey(const Qt::Key key) { this->m_qtKey = key; }
|
||||
|
||||
//! \brief Set key code
|
||||
//! Set key code
|
||||
void setKey(int key) { this->m_qtKey = static_cast<Qt::Key>(key); }
|
||||
|
||||
//! \brief Native virtual key
|
||||
//! Native virtual key
|
||||
void setNativeVirtualKey(quint32 virtualKey) { this->m_nativeVirtualKey = virtualKey; }
|
||||
|
||||
//! \brief Native virtual key
|
||||
//! Native virtual key
|
||||
quint32 getNativeVirtualKey() const { return this->m_nativeVirtualKey; }
|
||||
|
||||
/*!
|
||||
* \brief Add modifier
|
||||
* Add modifier
|
||||
* \param modifier
|
||||
* \return True if modifier was added
|
||||
*/
|
||||
bool addModifier(const Modifier &modifier);
|
||||
|
||||
/*!
|
||||
* \brief add modifier
|
||||
* add modifier
|
||||
* \param modifier
|
||||
* \return True if modifier was added
|
||||
*/
|
||||
bool addModifier(const QString &modifier);
|
||||
|
||||
//! \brief number of modifiers
|
||||
//! number of modifiers
|
||||
int numberOfModifiers() const;
|
||||
|
||||
//! \brief Function (optional)
|
||||
//! Function (optional)
|
||||
HotkeyFunction getFunction() const { return this->m_function; }
|
||||
|
||||
//! \brief Modifier 1
|
||||
//! Modifier 1
|
||||
Modifier getModifier1() const { return this->m_modifier1; }
|
||||
|
||||
//! \brief Modifier 2
|
||||
//! Modifier 2
|
||||
Modifier getModifier2() const { return this->m_modifier2; }
|
||||
|
||||
//! \brief Modifier 1
|
||||
//! Modifier 1
|
||||
QString getModifier1AsString() const { return modifierToString(this->m_modifier1); }
|
||||
|
||||
//! \brief Modifier 2
|
||||
//! Modifier 2
|
||||
QString getModifier2AsString() const { return modifierToString(this->m_modifier2); }
|
||||
|
||||
/*!
|
||||
* \brief Remove modifier from key
|
||||
* Remove modifier from key
|
||||
* \param modifier
|
||||
* \return True if modifier was removed
|
||||
*/
|
||||
bool removeModifier(const Modifier &modifier);
|
||||
|
||||
/*!
|
||||
* \brief Remove modifier from key
|
||||
* Remove modifier from key
|
||||
* \param modifier
|
||||
* \return True if modifier was removed
|
||||
*/
|
||||
bool removeModifier(const QString &modifier);
|
||||
|
||||
//! \brief Set modifier 1
|
||||
//! Set modifier 1
|
||||
void setModifier1(const QString &modifier) { this->m_modifier1 = modifierFromString(modifier); }
|
||||
|
||||
//! \brief Set modifier 1
|
||||
//! Set modifier 1
|
||||
void setModifier1(const Modifier &modifier) { this->m_modifier1 = modifier; }
|
||||
|
||||
//! \brief Set modifier 2
|
||||
//! Set modifier 2
|
||||
void setModifier2(const QString &modifier) { this->m_modifier2 = modifierFromString(modifier); }
|
||||
|
||||
//! \brief Set modifier 2
|
||||
//! Set modifier 2
|
||||
void setModifier2(const Modifier &modifier) { this->m_modifier2 = modifier; }
|
||||
|
||||
//! \brief Modifier?
|
||||
//! Modifier?
|
||||
bool hasModifier() const
|
||||
{
|
||||
return this->m_modifier1 != ModifierNone || this->m_modifier2 != ModifierNone;
|
||||
}
|
||||
|
||||
//! \brief Do we have this modifier?
|
||||
//! Do we have this modifier?
|
||||
bool hasModifier(Modifier modifier) const
|
||||
{
|
||||
return m_modifier1 == modifier || m_modifier2 == modifier;
|
||||
@@ -223,13 +223,13 @@ namespace BlackMisc
|
||||
//! Order Modifiers
|
||||
void cleanup();
|
||||
|
||||
//! \brief Function (optional)
|
||||
//! Function (optional)
|
||||
QString getFunctionAsString() const;
|
||||
|
||||
//! \brief Set key object
|
||||
//! Set key object
|
||||
void setKeyObject(const BlackMisc::Hardware::CKeyboardKey &key);
|
||||
|
||||
//! \brief Set function
|
||||
//! Set function
|
||||
void setFunction(const HotkeyFunction &function) { this->m_function = function; }
|
||||
|
||||
//! \copydoc CValueObject::setPropertyByIndex
|
||||
@@ -238,20 +238,20 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::propertyByIndex
|
||||
virtual QVariant propertyByIndex(int index) const;
|
||||
|
||||
//! \brief Modifier to string
|
||||
//! Modifier to string
|
||||
static QString modifierToString(Modifier modifier);
|
||||
|
||||
//! \brief Modifier from string
|
||||
//! Modifier from string
|
||||
static Modifier modifierFromString(const QString &modifier);
|
||||
|
||||
//! \brief Modifier from Qt::Modifier
|
||||
//! Modifier from Qt::Modifier
|
||||
static Modifier modifierFromQtModifier(Qt::Modifier qtModifier);
|
||||
|
||||
//! \brief all modifiers
|
||||
//! all modifiers
|
||||
static const QStringList &modifiers();
|
||||
|
||||
/*!
|
||||
* \brief CKeyboardKey::toStringRepresentation
|
||||
* CKeyboardKey::toStringRepresentation
|
||||
* \param key
|
||||
* \return
|
||||
*/
|
||||
@@ -279,7 +279,7 @@ namespace BlackMisc
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CKeyboardKey)
|
||||
Qt::Key m_qtKey; //!< code similar to Qt::Key
|
||||
quint32 m_nativeVirtualKey; //!< virtual key code
|
||||
quint32 m_nativeVirtualKey; //!< virtual key code TODO: Risk in platform independent comparisons
|
||||
Modifier m_modifier1;
|
||||
Modifier m_modifier2;
|
||||
HotkeyFunction m_function;
|
||||
|
||||
@@ -25,9 +25,11 @@ namespace BlackMisc
|
||||
/*
|
||||
* Contains this hotkey function?
|
||||
*/
|
||||
bool CKeyboardKeyList::containsFunction(CKeyboardKey::HotkeyFunction key)
|
||||
bool CKeyboardKeyList::containsFunction(CKeyboardKey::HotkeyFunction function) const
|
||||
{
|
||||
return CSequence::contains(&CKeyboardKey::getFunction, key);
|
||||
return CSequence::contains(&CKeyboardKey::getFunction, function);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -37,14 +37,15 @@ namespace BlackMisc
|
||||
return QVariant::fromValue(*this);
|
||||
}
|
||||
|
||||
//! \brief contains given hotkey function?
|
||||
bool containsFunction(CKeyboardKey::HotkeyFunction key);
|
||||
//! Contains given hotkey function?
|
||||
bool containsFunction(CKeyboardKey::HotkeyFunction function) const;
|
||||
|
||||
//! \brief Register metadata
|
||||
//! Key for given function
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
/*!
|
||||
* \brief Fill the list with hotkeys
|
||||
* Fill the list with hotkeys
|
||||
* \param reset true, list will be be reset, otherwise values will not be overridde
|
||||
*/
|
||||
void initAsHotkeyList(bool reset = true);
|
||||
|
||||
Reference in New Issue
Block a user