From 14192585e253119052f01ab13f77be00adef9df5 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Mon, 11 Nov 2019 03:37:39 +0100 Subject: [PATCH] [FSD] Correctly set queried frequency --- src/blackcore/fsd/fsdclient.cpp | 7 +++++-- src/blackcore/fsd/fsdclient.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/blackcore/fsd/fsdclient.cpp b/src/blackcore/fsd/fsdclient.cpp index 14d99393a..8ac58413e 100644 --- a/src/blackcore/fsd/fsdclient.cpp +++ b/src/blackcore/fsd/fsdclient.cpp @@ -1186,8 +1186,11 @@ namespace BlackCore } else if (clientResponse.m_queryType == ClientQueryType::Com1Freq) { - emit com1FrequencyResponseReceived(clientResponse.sender(), responseData1); - return; + if (responseData1.isEmpty()) { return; } + bool ok; + const double freqMHz = responseData1.toDouble(&ok); + if (!ok) { return; } + emit com1FrequencyResponseReceived(clientResponse.sender(), CFrequency(freqMHz, CFrequencyUnit::MHz())); } else if (clientResponse.m_queryType == ClientQueryType::RealName) { diff --git a/src/blackcore/fsd/fsdclient.h b/src/blackcore/fsd/fsdclient.h index 0426dae0e..6edddf7d1 100644 --- a/src/blackcore/fsd/fsdclient.h +++ b/src/blackcore/fsd/fsdclient.h @@ -206,7 +206,7 @@ namespace BlackCore void aircraftConfigReceived(const QString &sender, const QJsonObject &config, qint64 currentOffsetTimeMs); void validAtcResponseReceived(const QString &callsign, bool isValidAtc); void capabilityResponseReceived(const BlackMisc::Aviation::CCallsign &sender, BlackMisc::Network::CClient::Capabilities capabilities); - void com1FrequencyResponseReceived(const QString &sender, const QString &frequency); + void com1FrequencyResponseReceived(const QString &sender, const BlackMisc::PhysicalQuantities::CFrequency &frequency); void realNameResponseReceived(const QString &sender, const QString &realName); void serverResponseReceived(const QString &sender, const QString &hostName); void planeInformationReceived(const QString &sender, const QString &aircraft, const QString &airline, const QString &livery);