Skip to content

Commit

Permalink
fix: Discard visual FSD updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ltoenning committed Feb 1, 2024
1 parent 7e6f3f0 commit 0970134
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions src/blackcore/fsd/fsdclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,36 +1282,36 @@ namespace BlackCore::Fsd
emit euroscopeSimDataUpdatedReceived(situation, parts, currentOffsetTime(data.sender()), data.m_model, data.m_livery);
}

void CFSDClient::handleVisualPilotDataUpdate(const QStringList &tokens, MessageType messageType)
{
VisualPilotDataUpdate dataUpdate;
switch (messageType)
{
case MessageType::VisualPilotDataUpdate: dataUpdate = VisualPilotDataUpdate::fromTokens(tokens); break;
case MessageType::VisualPilotDataPeriodic: dataUpdate = VisualPilotDataPeriodic::fromTokens(tokens).toUpdate(); break;
case MessageType::VisualPilotDataStopped: dataUpdate = VisualPilotDataStopped::fromTokens(tokens).toUpdate(); break;
default: qFatal("Precondition violated"); break;
}
const CCallsign callsign(dataUpdate.sender(), CCallsign::Aircraft);

CAircraftSituation situation(
callsign,
CCoordinateGeodetic(dataUpdate.m_latitude, dataUpdate.m_longitude, dataUpdate.m_altitudeTrue),
CHeading(dataUpdate.m_heading, CHeading::True, CAngleUnit::deg()),
CAngle(dataUpdate.m_pitch, CAngleUnit::deg()),
CAngle(dataUpdate.m_bank, CAngleUnit::deg()));
void CFSDClient::handleVisualPilotDataUpdate(const QStringList & /*tokens*/, MessageType /*messageType*/)
{
// VisualPilotDataUpdate dataUpdate;
// switch (messageType)
// {
// case MessageType::VisualPilotDataUpdate: dataUpdate = VisualPilotDataUpdate::fromTokens(tokens); break;
// case MessageType::VisualPilotDataPeriodic: dataUpdate = VisualPilotDataPeriodic::fromTokens(tokens).toUpdate(); break;
// case MessageType::VisualPilotDataStopped: dataUpdate = VisualPilotDataStopped::fromTokens(tokens).toUpdate(); break;
// default: qFatal("Precondition violated"); break;
// }
// const CCallsign callsign(dataUpdate.sender(), CCallsign::Aircraft);

// CAircraftSituation situation(
// callsign,
// CCoordinateGeodetic(dataUpdate.m_latitude, dataUpdate.m_longitude, dataUpdate.m_altitudeTrue),
// CHeading(dataUpdate.m_heading, CHeading::True, CAngleUnit::deg()),
// CAngle(dataUpdate.m_pitch, CAngleUnit::deg()),
// CAngle(dataUpdate.m_bank, CAngleUnit::deg()));

// not used
// situation.setVelocity(CAircraftVelocity(
// dataUpdate.m_xVelocity, dataUpdate.m_yVelocity, dataUpdate.m_zVelocity, CSpeedUnit::m_s(),
// dataUpdate.m_pitchRadPerSec, dataUpdate.m_bankRadPerSec, dataUpdate.m_headingRadPerSec, CAngleUnit::rad(), CTimeUnit::s()));

// Ref T297, default offset time
situation.setCurrentUtcTime();
const qint64 offsetTimeMs = receivedPositionFixTsAndGetOffsetTime(situation.getCallsign(), situation.getMSecsSinceEpoch());
situation.setTimeOffsetMs(offsetTimeMs);
// situation.setCurrentUtcTime();
// const qint64 offsetTimeMs = receivedPositionFixTsAndGetOffsetTime(situation.getCallsign(), situation.getMSecsSinceEpoch());
// situation.setTimeOffsetMs(offsetTimeMs);

emit visualPilotDataUpdateReceived(situation);
// emit visualPilotDataUpdateReceived(situation);
}

void CFSDClient::handleVisualPilotDataToggle(const QStringList &tokens)
Expand Down

0 comments on commit 0970134

Please sign in to comment.