mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Style
This commit is contained in:
@@ -18,11 +18,14 @@
|
||||
class CAfvClientBridge : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
//! Bridge properties @{
|
||||
Q_PROPERTY(double inputVolumePeakVU READ getInputVolumePeakVU NOTIFY inputVolumePeakVU)
|
||||
Q_PROPERTY(double outputVolumePeakVU READ getOutputVolumePeakVU NOTIFY outputVolumePeakVU)
|
||||
Q_PROPERTY(BlackCore::Afv::Clients::CAfvClient::ConnectionStatus connectionStatus READ getConnectionStatus NOTIFY connectionStatusChanged)
|
||||
Q_PROPERTY(QString receivingCallsignsCom1 READ getReceivingCallsignsCom1 NOTIFY receivingCallsignsChanged)
|
||||
Q_PROPERTY(QString receivingCallsignsCom2 READ getReceivingCallsignsCom2 NOTIFY receivingCallsignsChanged)
|
||||
//! @}
|
||||
|
||||
public:
|
||||
//! Ctor
|
||||
|
||||
@@ -9,8 +9,9 @@
|
||||
//! \file
|
||||
|
||||
#include "input.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blacksound/audioutilities.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/verify.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
#include <QStringBuilder>
|
||||
|
||||
@@ -48,11 +48,14 @@ namespace BlackCore
|
||||
class BLACKCORE_EXPORT CAfvClient final : public BlackMisc::CContinuousWorker
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
//! AFV client properties @{
|
||||
Q_PROPERTY(double inputVolumePeakVU READ getInputVolumePeakVU NOTIFY inputVolumePeakVU)
|
||||
Q_PROPERTY(double outputVolumePeakVU READ getOutputVolumePeakVU NOTIFY outputVolumePeakVU)
|
||||
Q_PROPERTY(BlackCore::Afv::Clients::CAfvClient::ConnectionStatus connectionStatus READ getConnectionStatus NOTIFY connectionStatusChanged)
|
||||
Q_PROPERTY(QString receivingCallsignsCom1 READ getReceivingCallsignsCom1 NOTIFY receivingCallsignsChanged)
|
||||
Q_PROPERTY(QString receivingCallsignsCom2 READ getReceivingCallsignsCom2 NOTIFY receivingCallsignsChanged)
|
||||
//! @}
|
||||
|
||||
public:
|
||||
//! Categories
|
||||
|
||||
@@ -827,8 +827,7 @@ namespace BlackCore
|
||||
{
|
||||
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "not in main thread");
|
||||
if (!this->isConnectedAndNotShuttingDown()) { return; }
|
||||
|
||||
BLACK_VERIFY_X(callsign.isValid(), Q_FUNC_INFO, "invalid callsign");
|
||||
if (CBuildConfig::isLocalDeveloperDebugBuild()) { BLACK_VERIFY_X(callsign.isValid(), Q_FUNC_INFO, "invalid callsign"); }
|
||||
if (!callsign.isValid()) { return; }
|
||||
const ReverseLookupLogging reverseLookupEnabled = this->isReverseLookupMessagesEnabled();
|
||||
CStatusMessageList reverseLookupMessages;
|
||||
@@ -1204,7 +1203,7 @@ namespace BlackCore
|
||||
|
||||
void CAirspaceMonitor::onConnectionStatusChanged(CConnectionStatus oldStatus, CConnectionStatus newStatus)
|
||||
{
|
||||
Q_UNUSED(oldStatus);
|
||||
Q_UNUSED(oldStatus)
|
||||
if (newStatus.isDisconnected()) { clear(); }
|
||||
}
|
||||
|
||||
|
||||
@@ -507,7 +507,7 @@ namespace BlackCore
|
||||
QStringList receivers;
|
||||
for (const int &frequency : frequencies)
|
||||
{
|
||||
receivers.push_back(QString("@%1").arg(frequency - 100000));
|
||||
receivers.push_back(QStringLiteral("@%1").arg(frequency - 100000));
|
||||
}
|
||||
|
||||
TextMessage radioMessage(m_ownCallsign.asString(), receivers.join('&'), message);
|
||||
@@ -562,7 +562,7 @@ namespace BlackCore
|
||||
this->increaseStatisticsValue(QStringLiteral("sendFlightPlan"));
|
||||
}
|
||||
|
||||
void CFSDClient::sendPlaneInfoRequest(const BlackMisc::Aviation::CCallsign &receiver)
|
||||
void CFSDClient::sendPlaneInfoRequest(const CCallsign &receiver)
|
||||
{
|
||||
PlaneInfoRequest planeInfoRequest(m_ownCallsign.asString(), receiver.toQString());
|
||||
sendMessage(planeInfoRequest);
|
||||
@@ -1010,8 +1010,8 @@ namespace BlackCore
|
||||
CAltitude cruiseAlt;
|
||||
cruiseAlt.parseFromString(cruiseAltString, CPqString::SeparatorBestGuess);
|
||||
|
||||
const QString depTimePlanned = QString("0000").append(QString::number(fp.m_estimatedDepTime)).right(4);
|
||||
const QString depTimeActual = QString("0000").append(QString::number(fp.m_actualDepTime)).right(4);
|
||||
const QString depTimePlanned = QStringLiteral("0000").append(QString::number(fp.m_estimatedDepTime)).right(4);
|
||||
const QString depTimeActual = QStringLiteral("0000").append(QString::number(fp.m_actualDepTime)).right(4);
|
||||
|
||||
const CCallsign callsign(fp.sender(), CCallsign::Aircraft);
|
||||
const CFlightPlan flightPlan(
|
||||
@@ -1543,8 +1543,7 @@ namespace BlackCore
|
||||
if (reLogoff.match(message).hasMatch())
|
||||
{
|
||||
emit atisLogoffTimeReplyReceived(sender, message);
|
||||
CInformationMessage atisMessage;
|
||||
atisMessage.setType(CInformationMessage::ATIS);
|
||||
CInformationMessage atisMessage(CInformationMessage::ATIS);
|
||||
for (const auto &line : as_const(pendingQuery.m_atisMessage))
|
||||
{
|
||||
if (!atisMessage.isEmpty()) atisMessage.appendMessage("\n");
|
||||
@@ -1565,13 +1564,13 @@ namespace BlackCore
|
||||
if (setting.getFileWriteMode() == CRawFsdMessageSettings::None || setting.getFileDir().isEmpty()) { return; }
|
||||
if (setting.getFileWriteMode() == CRawFsdMessageSettings::Truncate)
|
||||
{
|
||||
QString filePath = CFileUtils::appendFilePaths(setting.getFileDir(), "rawfsdmessages.log");
|
||||
const QString filePath = CFileUtils::appendFilePaths(setting.getFileDir(), "rawfsdmessages.log");
|
||||
m_rawFsdMessageLogFile.setFileName(filePath);
|
||||
m_rawFsdMessageLogFile.open(QIODevice::Text | QIODevice::WriteOnly);
|
||||
}
|
||||
else if (setting.getFileWriteMode() == CRawFsdMessageSettings::Append)
|
||||
{
|
||||
QString filePath = CFileUtils::appendFilePaths(setting.getFileDir(), "rawfsdmessages.log");
|
||||
const QString filePath = CFileUtils::appendFilePaths(setting.getFileDir(), "rawfsdmessages.log");
|
||||
m_rawFsdMessageLogFile.setFileName(filePath);
|
||||
m_rawFsdMessageLogFile.open(QIODevice::Text | QIODevice::WriteOnly | QIODevice::Append);
|
||||
}
|
||||
@@ -1581,7 +1580,7 @@ namespace BlackCore
|
||||
filename += QLatin1String("_");
|
||||
filename += QDateTime::currentDateTime().toString(QStringLiteral("yyMMddhhmmss"));
|
||||
filename += QLatin1String(".log");
|
||||
QString filePath = CFileUtils::appendFilePaths(setting.getFileDir(), filename);
|
||||
const QString filePath = CFileUtils::appendFilePaths(setting.getFileDir(), filename);
|
||||
m_rawFsdMessageLogFile.setFileName(filePath);
|
||||
m_rawFsdMessageLogFile.open(QIODevice::Text | QIODevice::WriteOnly);
|
||||
}
|
||||
@@ -1672,8 +1671,8 @@ namespace BlackCore
|
||||
{
|
||||
while (m_socket.canReadLine())
|
||||
{
|
||||
QByteArray dataEncoded = m_socket.readLine();
|
||||
QString data = m_fsdTextCodec->toUnicode(dataEncoded);
|
||||
const QByteArray dataEncoded = m_socket.readLine();
|
||||
const QString data = m_fsdTextCodec->toUnicode(dataEncoded);
|
||||
parseMessage(data);
|
||||
}
|
||||
}
|
||||
@@ -1699,13 +1698,12 @@ namespace BlackCore
|
||||
if (messageType != MessageType::Unknown)
|
||||
{
|
||||
// Cutoff the cmd from the beginning
|
||||
QString payload = line.mid(cmd.size()).trimmed();
|
||||
const QString payload = line.mid(cmd.size()).trimmed();
|
||||
|
||||
// We expected a payload, but there is nothing
|
||||
if (payload.length() == 0) return;
|
||||
|
||||
QStringList tokens = payload.split(':');
|
||||
|
||||
const QStringList tokens = payload.split(':');
|
||||
switch (messageType)
|
||||
{
|
||||
case MessageType::AddAtc: /* ignore */ return;
|
||||
@@ -1746,7 +1744,7 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
QString prefix = isSent ? "FSD Sent=>" : "FSD Recv=>";
|
||||
const QString prefix = isSent ? "FSD Sent=>" : "FSD Recv=>";
|
||||
CRawFsdMessage rawMessage(prefix + fsdMessageFiltered);
|
||||
rawMessage.setCurrentUtcTime();
|
||||
if (m_rawFsdMessageLogFile.isOpen())
|
||||
@@ -1813,9 +1811,7 @@ namespace BlackCore
|
||||
// emit atisVoiceRoomReplyReceived(cs, m_mapAtisMessages[callsign].voiceRoom);
|
||||
emit atisLogoffTimeReplyReceived(cs, m_mapAtisMessages[callsign].zuluLogoff);
|
||||
|
||||
CInformationMessage atisMessage;
|
||||
atisMessage.setType(CInformationMessage::ATIS);
|
||||
|
||||
CInformationMessage atisMessage(CInformationMessage::ATIS);
|
||||
for (const QString &tm : m_mapAtisMessages[callsign].textLines)
|
||||
{
|
||||
const QString fixed = tm.trimmed();
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace BlackGui
|
||||
explicit CAudioVolumeComponent(QWidget *parent = nullptr);
|
||||
|
||||
//! Destructor
|
||||
virtual ~CAudioVolumeComponent();
|
||||
virtual ~CAudioVolumeComponent() override;
|
||||
|
||||
private:
|
||||
//! Mute toggleBlackGui::Components::CHotkeyDialog
|
||||
|
||||
Reference in New Issue
Block a user