mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 16:55:36 +08:00
Issue #94 Implement $SF packet to toggle visual pilot data sending
Still send a visual pilot data update at the slow rate of every 5 seconds when visual pilot data update is disabled.
This commit is contained in:
@@ -38,6 +38,7 @@
|
||||
#include "blackcore/fsd/servererror.h"
|
||||
#include "blackcore/fsd/interimpilotdataupdate.h"
|
||||
#include "blackcore/fsd/visualpilotdataupdate.h"
|
||||
#include "blackcore/fsd/visualpilotdatatoggle.h"
|
||||
#include "blackcore/fsd/planeinforequest.h"
|
||||
#include "blackcore/fsd/planeinformation.h"
|
||||
#include "blackcore/fsd/planeinforequestfsinn.h"
|
||||
@@ -86,6 +87,7 @@ namespace BlackMiscTest
|
||||
void testPBH();
|
||||
void testPilotDataUpdate();
|
||||
void testVisualPilotDataUpdate();
|
||||
void testVisualPilotDataToggle();
|
||||
void testPing();
|
||||
void testPlaneInfoRequest();
|
||||
void testPlaneInformation();
|
||||
@@ -543,6 +545,25 @@ namespace BlackMiscTest
|
||||
QCOMPARE(0.0, messageFromTokens.m_noseGearAngle);
|
||||
}
|
||||
|
||||
void CTestFsdMessages::testVisualPilotDataToggle()
|
||||
{
|
||||
const VisualPilotDataToggle message("SERVER", "ABCD", true);
|
||||
|
||||
QCOMPARE(QString("SERVER"), message.sender());
|
||||
QCOMPARE(QString("ABCD"), message.m_client);
|
||||
QCOMPARE(true, message.m_active);
|
||||
|
||||
QString stringRef("SERVER:ABCD:1");
|
||||
QString str = message.toTokens().join(":");
|
||||
QCOMPARE(str, stringRef);
|
||||
|
||||
QStringList tokens = QString("SERVER:ABCD:1").split(':');
|
||||
auto messageFromTokens = VisualPilotDataToggle::fromTokens(tokens);
|
||||
QCOMPARE(QString("SERVER"), messageFromTokens.sender());
|
||||
QCOMPARE(QString("ABCD"), messageFromTokens.m_client);
|
||||
QCOMPARE(true, messageFromTokens.m_active);
|
||||
}
|
||||
|
||||
void CTestFsdMessages::testPing()
|
||||
{
|
||||
const Ping message("ABCD", "SERVER", "85275222");
|
||||
|
||||
Reference in New Issue
Block a user