mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
[FSD] Style
This commit is contained in:
committed by
Mat Sutcliffe
parent
59c6a7ad93
commit
f38bfc5cf9
@@ -25,8 +25,7 @@ namespace BlackCore
|
||||
m_rating(rating),
|
||||
m_protocolRevision(protocolRevision),
|
||||
m_realName(realName)
|
||||
{
|
||||
}
|
||||
{ }
|
||||
|
||||
QStringList AddAtc::toTokens() const
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace BlackCore
|
||||
{ }
|
||||
|
||||
AtcDataUpdate::AtcDataUpdate(const QString &sender, int frequencykHz, CFacilityType facility, int visibleRange, AtcRating rating,
|
||||
double latitude, double longitude, int elevation) :
|
||||
double latitude, double longitude, int elevation) :
|
||||
MessageBase(sender, {}),
|
||||
m_frequencykHz(frequencykHz),
|
||||
m_facility(facility),
|
||||
@@ -40,7 +40,7 @@ namespace BlackCore
|
||||
tokens.push_back(toQString(m_facility));
|
||||
tokens.push_back(QString::number(m_visibleRange));
|
||||
tokens.push_back(toQString(m_rating));
|
||||
tokens.push_back(QString::number(m_latitude, 'f', 5));
|
||||
tokens.push_back(QString::number(m_latitude, 'f', 5));
|
||||
tokens.push_back(QString::number(m_longitude, 'f', 5));
|
||||
tokens.push_back(QString::number(m_elevation));
|
||||
return tokens;
|
||||
@@ -55,7 +55,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
AtcDataUpdate packet(tokens[0], tokens[1].toInt() + 100000, fromQString<CFacilityType>(tokens[2]), tokens[3].toInt(), fromQString<AtcRating>(tokens[4]),
|
||||
tokens[5].toDouble(), tokens[6].toDouble(), tokens[7].toInt());
|
||||
tokens[5].toDouble(), tokens[6].toDouble(), tokens[7].toInt());
|
||||
return packet;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace BlackCore
|
||||
{
|
||||
BlackMisc::CLogMessage(static_cast<AuthChallenge *>(nullptr)).warning(u"Wrong number of arguments.");
|
||||
return {};
|
||||
};
|
||||
}
|
||||
return AuthChallenge(tokens[0], tokens[1], tokens[2]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ namespace BlackCore
|
||||
sendMessage(clientQuery);
|
||||
}
|
||||
|
||||
this->increaseStatisticsValue(QStringLiteral("sendClientQuery"), toQString(queryType));
|
||||
increaseStatisticsValue(QStringLiteral("sendClientQuery"), toQString(queryType));
|
||||
}
|
||||
|
||||
void CFSDClient::sendTextMessages(const CTextMessageList &messages)
|
||||
@@ -504,7 +504,7 @@ namespace BlackCore
|
||||
else { return; }
|
||||
const TextMessage textMessage(m_ownCallsign.asString(), receiver, message);
|
||||
sendMessage(textMessage);
|
||||
this->increaseStatisticsValue(QStringLiteral("sendTextMessages"));
|
||||
increaseStatisticsValue(QStringLiteral("sendTextMessages"));
|
||||
}
|
||||
|
||||
void CFSDClient::sendTextMessage(const QString &receiver, const QString &message)
|
||||
@@ -576,7 +576,7 @@ namespace BlackCore
|
||||
|
||||
void CFSDClient::sendPlaneInfoRequest(const CCallsign &receiver)
|
||||
{
|
||||
PlaneInfoRequest planeInfoRequest(m_ownCallsign.asString(), receiver.toQString());
|
||||
const PlaneInfoRequest planeInfoRequest(m_ownCallsign.asString(), receiver.toQString());
|
||||
sendMessage(planeInfoRequest);
|
||||
increaseStatisticsValue(QStringLiteral("sendPlaneInfoRequest"));
|
||||
}
|
||||
|
||||
@@ -80,16 +80,10 @@ namespace BlackCore
|
||||
void setValid(bool isValid) { m_isValid = isValid; }
|
||||
|
||||
protected:
|
||||
|
||||
// Meta data
|
||||
// MessageType messageType = MessageType::Unknown;
|
||||
|
||||
QString m_sender; //!< message sender
|
||||
QString m_receiver; //!< message receiver
|
||||
|
||||
bool m_isValid = true; //!< is valid?
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // guard
|
||||
|
||||
Reference in New Issue
Block a user