From eaca06711bc06ae5820be9189cd45c45a2a0bb34 Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Thu, 11 Apr 2024 23:01:24 +0200 Subject: [PATCH] refactor(fs9): Remove unused code --- src/plugins/simulator/fs9/simulatorfs9.cpp | 66 ---------------------- 1 file changed, 66 deletions(-) diff --git a/src/plugins/simulator/fs9/simulatorfs9.cpp b/src/plugins/simulator/fs9/simulatorfs9.cpp index 9cd344892..94b4b4366 100644 --- a/src/plugins/simulator/fs9/simulatorfs9.cpp +++ b/src/plugins/simulator/fs9/simulatorfs9.cpp @@ -36,72 +36,6 @@ using namespace BlackConfig; namespace BlackSimPlugin::Fs9 { - /* DOES NOT SEEM to be used, - * see https://discordapp.com/channels/539048679160676382/539925070550794240/707203002951270455 - - CAircraftSituation aircraftSituationFromFS9(const MPPositionVelocity &positionVelocity) - { - double dHigh = positionVelocity.lat_i; - double dLow = positionVelocity.lat_f; - - dLow = dLow / 65536.0; - if (dHigh > 0) - { - dHigh = dHigh + dLow; - } - else - { - dHigh = dHigh - dLow; - } - - CCoordinateGeodetic position; - position.setLatitude(CLatitude(dHigh * 90.0 / 10001750.0, CAngleUnit::deg())); - - dHigh = positionVelocity.lon_hi; - dLow = positionVelocity.lon_lo; - - dLow = dLow / 65536.0; - if (dHigh > 0) - { - dHigh = dHigh + dLow; - } - else - { - dHigh = dHigh - dLow; - } - - position.setLongitude(CLongitude(dHigh * 360.0 / (65536.0 * 65536.0), CAngleUnit::deg())); - - dHigh = positionVelocity.alt_i; - dLow = positionVelocity.alt_f; - - dLow = dLow / 65536.0; - - CAircraftSituation situation; - situation.setPosition(position); - situation.setAltitude(CAltitude(dHigh + dLow, CAltitude::MeanSeaLevel, CLengthUnit::m())); - const double groundSpeed = positionVelocity.ground_velocity / 65536.0; - situation.setGroundSpeed(CSpeed(groundSpeed, CSpeedUnit::m_s())); - - FS_PBH pbhstrct; - pbhstrct.pbh = positionVelocity.pbh; - int pitch = qRound(std::floor(pbhstrct.pitch / CFs9Sdk::pitchMultiplier())); - if (pitch < -90 || pitch > 89) { CLogMessage().warning(u"FS9: Pitch value out of limits: %1") << pitch; } - int bank = qRound(std::floor(pbhstrct.bank / CFs9Sdk::bankMultiplier())); - - // MSFS has inverted pitch and bank angles - // ~ and NOT -: https://dev.swift-project.org/rSWIFTPILOTCLIENT7f90652b - // The problem with - is that -(-512) is 512 but the maximum is 511 so this overflows back to -512 and causes a visual glitch. - pitch = ~pitch; - bank = ~bank; - situation.setPitch(CAngle(pitch, CAngleUnit::deg())); - situation.setBank(CAngle(bank, CAngleUnit::deg())); - situation.setHeading(CHeading(pbhstrct.hdg / CFs9Sdk::headingMultiplier(), CHeading::Magnetic, CAngleUnit::deg())); - - return situation; - } - */ - CSimulatorFs9::CSimulatorFs9(const CSimulatorPluginInfo &info, const QSharedPointer &fs9Host, const QSharedPointer &lobbyClient,