mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
INetwork builds up the ATIS as it is received, line-by-line, keeping this implementation detail more encapsulated
refs #81
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
#include "blackmisc/nwserverlist.h"
|
||||
#include "blackmisc/nwtextmessagelist.h"
|
||||
#include "blackmisc/statusmessagelist.h"
|
||||
#include "blackmisc/avinformationmessage.h"
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QMap>
|
||||
@@ -94,7 +95,7 @@ namespace BlackCore
|
||||
const BlackMisc::Geo::CCoordinateGeodetic &pos, const BlackMisc::PhysicalQuantities::CLength &range);
|
||||
void atcDisconnected(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void atcQueryReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, bool isATC);
|
||||
void atisQueryReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const QString &data);
|
||||
void atisQueryReplyReceived(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CInformationMessage &atis);
|
||||
void metarReceived(const QString &data);
|
||||
|
||||
// Aircraft
|
||||
|
||||
@@ -594,7 +594,18 @@ namespace BlackCore
|
||||
|
||||
void CNetworkVatlib::onAtisReplyReceived(Cvatlib_Network *, const char *callsign, Cvatlib_Network::atisLineType lineType, const char *data, void *cbvar)
|
||||
{
|
||||
emit cbvar_cast(cbvar)->atisQueryReplyReceived(cbvar_cast(cbvar)->fromFSD(callsign), cbvar_cast(cbvar)->fromFSD(data));
|
||||
auto &atis = cbvar_cast(cbvar)->m_atisParts[cbvar_cast(cbvar)->fromFSD(callsign)];
|
||||
|
||||
if (lineType == Cvatlib_Network::atisLineType_LineCount)
|
||||
{
|
||||
atis.setType(CInformationMessage::ATIS);
|
||||
emit cbvar_cast(cbvar)->atisQueryReplyReceived(cbvar_cast(cbvar)->fromFSD(callsign), atis);
|
||||
cbvar_cast(cbvar)->m_atisParts.remove(cbvar_cast(cbvar)->fromFSD(callsign));
|
||||
}
|
||||
else
|
||||
{
|
||||
atis.appendMessage("\n" + cbvar_cast(cbvar)->fromFSD(data));
|
||||
}
|
||||
}
|
||||
|
||||
void CNetworkVatlib::onTemperatureDataReceived(Cvatlib_Network *, Cvatlib_Network::TempLayer /** layers **/ [4], INT /** pressure **/, void * /** cbvar **/)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <QTimer>
|
||||
#include <QTextCodec>
|
||||
#include <QByteArray>
|
||||
#include <QMap>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
@@ -115,6 +116,7 @@ namespace BlackCore
|
||||
QScopedPointer<Cvatlib_Network, VatlibQScopedPointerDeleter> m_net;
|
||||
Cvatlib_Network::connStatus m_status;
|
||||
BlackMisc::Network::CServer m_server;
|
||||
QMap<BlackMisc::Aviation::CCallsign, BlackMisc::Aviation::CInformationMessage> m_atisParts;
|
||||
|
||||
QTimer m_processingTimer;
|
||||
QTimer m_updateTimer;
|
||||
|
||||
Reference in New Issue
Block a user