9 namespace swift::core::fsd
11 InterimPilotDataUpdate::InterimPilotDataUpdate() : MessageBase() {}
13 InterimPilotDataUpdate::InterimPilotDataUpdate(
const QString &sender,
const QString &receiver,
double latitude,
14 double longitude,
int altitudeTrue,
int groundSpeed,
double pitch,
15 double bank,
double heading,
bool onGround)
16 :
MessageBase(sender, receiver), m_latitude(latitude), m_longitude(longitude), m_altitudeTrue(altitudeTrue),
17 m_groundSpeed(groundSpeed), m_pitch(pitch), m_bank(bank), m_heading(heading), m_onGround(onGround)
25 auto tokens = QStringList {};
32 tokens.push_back(
"VI");
33 tokens.push_back(QString::number(
m_latitude,
'f', 5));
34 tokens.push_back(QString::number(
m_longitude,
'f', 5));
37 tokens.push_back(QString::number(pbh));
43 if (tokens.size() < 8)
46 .
debug(u
"Wrong number of arguments.");
53 bool onGround =
false;
54 unpackPBH(tokens[7].toUInt(), pitch, bank, heading, onGround);
57 tokens[5].toInt(), tokens[6].toInt(), pitch, bank, heading, onGround);
Interim pilot data update sent to specific receivers faster than the standard broadcast update.
double m_longitude
Properties.
QStringList toTokens() const
Message converted to tokens.
double m_pitch
Properties.
double m_heading
Properties.
int m_groundSpeed
Properties.
double m_latitude
Properties.
int m_altitudeTrue
Properties.
static InterimPilotDataUpdate fromTokens(const QStringList &tokens)
Construct from tokens.
bool m_onGround
Properties.
QString m_receiver
message receiver
QString m_sender
message sender
Class for emitting a log message.
Derived & debug()
Set the severity to debug.
void unpackPBH(quint32 pbh, double &pitch, double &bank, double &heading, bool &onGround)
Unpack pitch, bank, heading and onGround from 32 bit integer.
void packPBH(double pitch, double bank, double heading, bool onGround, quint32 &pbh)
Pack pitch, bank, heading and onGround into 32 bit integer.