mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
refactor(fs9): Remove unused code
This commit is contained in:
@@ -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<CFs9Host> &fs9Host,
|
||||
const QSharedPointer<CLobbyClient> &lobbyClient,
|
||||
|
||||
Reference in New Issue
Block a user