mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-15 09:15:34 +08:00
Ref T259, Ref T243 moved the "awareness" classes to the interfaces
* allows access to the awareness objects if only the interface is available * can change the provider via the interface
This commit is contained in:
@@ -84,7 +84,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
CNetworkVatlib::CNetworkVatlib(IOwnAircraftProvider *ownAircraft, QObject *parent)
|
||||
: INetwork(parent), COwnAircraftAware(ownAircraft),
|
||||
: INetwork(ownAircraft, parent),
|
||||
m_loginMode(LoginNormal),
|
||||
m_status(vatStatusDisconnected),
|
||||
m_tokenBucket(10, CTime(5, CTimeUnit::s()), 1)
|
||||
@@ -828,9 +828,9 @@ namespace BlackCore
|
||||
void CNetworkVatlib::onTextMessageReceived(VatFsdClient *, const char *from, const char *to, const char *msg, void *cbvar)
|
||||
{
|
||||
auto *self = cbvar_cast(cbvar);
|
||||
CCallsign sender(self->fromFSD(from));
|
||||
CCallsign receiver(self->fromFSD(to));
|
||||
QString message(self->fromFSD(msg));
|
||||
const CCallsign sender(self->fromFSD(from));
|
||||
const CCallsign receiver(self->fromFSD(to));
|
||||
const QString message(self->fromFSD(msg));
|
||||
|
||||
// Other FSD servers send the controller ATIS as text message. The following conditions need to be met:
|
||||
// * non-VATSIM server. VATSIM has a specific ATIS message
|
||||
@@ -881,7 +881,7 @@ namespace BlackCore
|
||||
emit cbvar_cast(cbvar)->atcDisconnected(CCallsign(cbvar_cast(cbvar)->fromFSD(callsign), CCallsign::Atc));
|
||||
}
|
||||
|
||||
void CNetworkVatlib::onPilotPositionUpdate(VatFsdClient *, const char *callsignChar , const VatPilotPosition *position, void *cbvar)
|
||||
void CNetworkVatlib::onPilotPositionUpdate(VatFsdClient *, const char *callsignChar, const VatPilotPosition *position, void *cbvar)
|
||||
{
|
||||
auto *self = cbvar_cast(cbvar);
|
||||
|
||||
@@ -892,8 +892,7 @@ namespace BlackCore
|
||||
CHeading(position->heading, CHeading::True, CAngleUnit::deg()),
|
||||
CAngle(position->pitch, CAngleUnit::deg()),
|
||||
CAngle(position->bank, CAngleUnit::deg()),
|
||||
CSpeed(position->groundSpeed, CSpeedUnit::kts()),
|
||||
CAltitude({ 0, nullptr }, CAltitude::MeanSeaLevel)
|
||||
CSpeed(position->groundSpeed, CSpeedUnit::kts())
|
||||
);
|
||||
|
||||
//! we set a dynamically updating offset time here
|
||||
@@ -942,7 +941,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
auto *self = cbvar_cast(cbvar);
|
||||
CCallsign callsign(self->fromFSD(callsignChar), CCallsign::Aircraft);
|
||||
const CCallsign callsign(self->fromFSD(callsignChar), CCallsign::Aircraft);
|
||||
const QJsonObject packet = doc.object();
|
||||
if (packet == JsonPackets::aircraftConfigRequest())
|
||||
{
|
||||
@@ -966,8 +965,7 @@ namespace BlackCore
|
||||
CHeading(position->heading, CHeading::True, CAngleUnit::deg()),
|
||||
CAngle(position->pitch, CAngleUnit::deg()),
|
||||
CAngle(position->bank, CAngleUnit::deg()),
|
||||
CSpeed(0.0, nullptr), // There is no speed information in a interim packet
|
||||
CAltitude({ 0, nullptr }, CAltitude::MeanSeaLevel)
|
||||
CSpeed::null() // There is no speed information in a interim packet
|
||||
);
|
||||
situation.setCurrentUtcTime();
|
||||
situation.setTimeOffsetMs(c_interimPositionTimeOffsetMsec);
|
||||
@@ -1091,7 +1089,6 @@ namespace BlackCore
|
||||
Vat_SetFsdMessageHandler(m_net.data(), CNetworkVatlib::onRawFsdMessage, this);
|
||||
|
||||
if (setting.getFileWriteMode() == CRawFsdMessageSettings::None || setting.getFileDir().isEmpty()) { return; }
|
||||
|
||||
if (setting.getFileWriteMode() == CRawFsdMessageSettings::Truncate)
|
||||
{
|
||||
QString filePath = CFileUtils::appendFilePaths(setting.getFileDir(), "rawfsdmessages.log");
|
||||
@@ -1258,7 +1255,7 @@ namespace BlackCore
|
||||
int flags = 0;
|
||||
if (capabilityFlags & vatCapsAtcInfo) { flags |= AcceptsAtisResponses; }
|
||||
if (capabilityFlags & vatCapsFastPos) { flags |= SupportsInterimPosUpdates; }
|
||||
if (capabilityFlags & vatCapsAircraftInfo) { flags |= SupportsIcaoCodes; }
|
||||
if (capabilityFlags & vatCapsAircraftInfo) { flags |= SupportsIcaoCodes; }
|
||||
if (capabilityFlags & vatCapsAircraftConfig) { flags |= SupportsAircraftConfigs; }
|
||||
auto *self = cbvar_cast(cbvar);
|
||||
emit self->capabilitiesReplyReceived(self->fromFSD(callsign), flags);
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
#include "blackcore/blackcoreexport.h"
|
||||
#include "blackcore/network.h"
|
||||
#include "blackcore/vatsim/vatsimsettings.h"
|
||||
#include "blackmisc/tokenbucket.h"
|
||||
#include "blackmisc/simulation/ownaircraftprovider.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/aviation/aircrafticaocode.h"
|
||||
#include "blackmisc/aviation/aircraftparts.h"
|
||||
@@ -26,6 +24,7 @@
|
||||
#include "blackmisc/aviation/callsignset.h"
|
||||
#include "blackmisc/network/server.h"
|
||||
#include "blackmisc/network/textmessagelist.h"
|
||||
#include "blackmisc/tokenbucket.h"
|
||||
#include "blackmisc/settingscache.h"
|
||||
#include "blackmisc/digestsignal.h"
|
||||
|
||||
@@ -56,9 +55,7 @@ namespace BlackCore
|
||||
namespace Vatsim
|
||||
{
|
||||
//! Implementation of INetwork using the vatlib shim
|
||||
class BLACKCORE_EXPORT CNetworkVatlib :
|
||||
public INetwork,
|
||||
public BlackMisc::Simulation::COwnAircraftAware // network vatlib consumes own aircraft data and sets ICAO/callsign data
|
||||
class BLACKCORE_EXPORT CNetworkVatlib : public INetwork
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user