mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-10 05:55:33 +08:00
Ref T683, style
This commit is contained in:
@@ -284,7 +284,7 @@ namespace BlackCore
|
|||||||
bool CContextOwnAircraft::updateOwnParts(const CAircraftParts &parts)
|
bool CContextOwnAircraft::updateOwnParts(const CAircraftParts &parts)
|
||||||
{
|
{
|
||||||
QWriteLocker l(&m_lockAircraft);
|
QWriteLocker l(&m_lockAircraft);
|
||||||
bool changed = (m_ownAircraft.getParts() != parts);
|
const bool changed = (m_ownAircraft.getParts() != parts);
|
||||||
if (!changed) { return false; }
|
if (!changed) { return false; }
|
||||||
m_ownAircraft.setParts(parts);
|
m_ownAircraft.setParts(parts);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -845,10 +845,10 @@ namespace BlackCore
|
|||||||
this->rememberGroundElevation(callsign, elevation);
|
this->rememberGroundElevation(callsign, elevation);
|
||||||
}
|
}
|
||||||
|
|
||||||
const CLength cgO = this->overriddenCGorDefault(simulatorCG, modelString);
|
const CLength cgOvr = this->overriddenCGorDefault(simulatorCG, modelString);
|
||||||
if (!cgO.isNull() && !this->hasSameSimulatorCG(cgO, callsign))
|
if (!cgOvr.isNull() && !this->hasSameSimulatorCG(cgOvr, callsign))
|
||||||
{
|
{
|
||||||
this->insertCG(cgO, modelString, callsign); // per model string and CG
|
this->insertCG(cgOvr, modelString, callsign); // per model string and CG
|
||||||
|
|
||||||
// here we know we have a valid model and CG
|
// here we know we have a valid model and CG
|
||||||
m_autoPublishing.insert(modelString, simulatorCG); // still using CG here, not the overridden value
|
m_autoPublishing.insert(modelString, simulatorCG); // still using CG here, not the overridden value
|
||||||
@@ -1210,7 +1210,7 @@ namespace BlackCore
|
|||||||
|
|
||||||
void ISimulator::reverseLookupAndUpdateOwnAircraftModel(const QString &modelString)
|
void ISimulator::reverseLookupAndUpdateOwnAircraftModel(const QString &modelString)
|
||||||
{
|
{
|
||||||
CAircraftModel model = getOwnAircraftModel();
|
CAircraftModel model = this->getOwnAircraftModel();
|
||||||
model.setModelString(modelString);
|
model.setModelString(modelString);
|
||||||
this->reverseLookupAndUpdateOwnAircraftModel(model);
|
this->reverseLookupAndUpdateOwnAircraftModel(model);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -454,7 +454,7 @@ namespace BlackMisc
|
|||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case IndexValue: return CVariant::from(m_value);
|
case IndexValue: return CVariant::from(m_value);
|
||||||
case IndexUnit: return CVariant::from(m_unit);
|
case IndexUnit: return CVariant::from(m_unit);
|
||||||
case IndexValueRounded0DigitsWithUnit: return CVariant::from(this->valueRoundedWithUnit(0));
|
case IndexValueRounded0DigitsWithUnit: return CVariant::from(this->valueRoundedWithUnit(0));
|
||||||
case IndexValueRounded1DigitsWithUnit: return CVariant::from(this->valueRoundedWithUnit(1));
|
case IndexValueRounded1DigitsWithUnit: return CVariant::from(this->valueRoundedWithUnit(1));
|
||||||
case IndexValueRounded2DigitsWithUnit: return CVariant::from(this->valueRoundedWithUnit(2));
|
case IndexValueRounded2DigitsWithUnit: return CVariant::from(this->valueRoundedWithUnit(2));
|
||||||
|
|||||||
@@ -534,6 +534,7 @@ namespace BlackMisc
|
|||||||
bool CSimulatedAircraft::setCG(const CLength &cg)
|
bool CSimulatedAircraft::setCG(const CLength &cg)
|
||||||
{
|
{
|
||||||
if (cg.isNull()) { return false; }
|
if (cg.isNull()) { return false; }
|
||||||
|
// ???? set to both models, or only the matched model ????
|
||||||
const int c = m_models.setCG(cg);
|
const int c = m_models.setCG(cg);
|
||||||
return c > 0;
|
return c > 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -347,8 +347,8 @@ namespace BlackMisc
|
|||||||
{
|
{
|
||||||
QWriteLocker l(&m_lockElvCoordinates);
|
QWriteLocker l(&m_lockElvCoordinates);
|
||||||
m_statsCurrentElevRequestTimeMs = -1;
|
m_statsCurrentElevRequestTimeMs = -1;
|
||||||
m_statsMaxElevRequestTimeMs = -1;
|
m_statsMaxElevRequestTimeMs = -1;
|
||||||
m_elvFound = m_elvMissed = 0;
|
m_elvFound = m_elvMissed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ISimulationEnvironmentProvider::ISimulationEnvironmentProvider(const CSimulatorPluginInfo &pluginInfo) :
|
ISimulationEnvironmentProvider::ISimulationEnvironmentProvider(const CSimulatorPluginInfo &pluginInfo) :
|
||||||
@@ -447,7 +447,7 @@ namespace BlackMisc
|
|||||||
m_pendingElevationRequests.clear();
|
m_pendingElevationRequests.clear();
|
||||||
m_statsCurrentElevRequestTimeMs = -1;
|
m_statsCurrentElevRequestTimeMs = -1;
|
||||||
m_statsMaxElevRequestTimeMs = -1;
|
m_statsMaxElevRequestTimeMs = -1;
|
||||||
m_elvFound = m_elvMissed = 0;
|
m_elvFound = m_elvMissed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ISimulationEnvironmentProvider::clearCGs()
|
void ISimulationEnvironmentProvider::clearCGs()
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ namespace BlackSimPlugin
|
|||||||
// Updates
|
// Updates
|
||||||
// Do not update ICAO codes, as this overrides reverse lookups
|
// Do not update ICAO codes, as this overrides reverse lookups
|
||||||
// updateOwnIcaoCodes(m_flightgearData.aircraftIcaoCode, CAirlineIcaoCode());
|
// updateOwnIcaoCodes(m_flightgearData.aircraftIcaoCode, CAirlineIcaoCode());
|
||||||
updateOwnSituation(situation);
|
this->updateOwnSituation(situation);
|
||||||
|
|
||||||
// defaults
|
// defaults
|
||||||
CSimulatedAircraft myAircraft(getOwnAircraft());
|
CSimulatedAircraft myAircraft(getOwnAircraft());
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ namespace BlackSimPlugin
|
|||||||
positionSlewMode.lat_f = static_cast<quint16>(qAbs((latitude - positionSlewMode.lat_i) * 65536));
|
positionSlewMode.lat_f = static_cast<quint16>(qAbs((latitude - positionSlewMode.lat_i) * 65536));
|
||||||
|
|
||||||
// Longitude - integer and decimal places
|
// Longitude - integer and decimal places
|
||||||
const double longitude = situation.getPosition().longitude().value(CAngleUnit::deg()) * (65536.0 * 65536.0) / 360.0;
|
const double longitude = situation.getPosition().longitude().value(CAngleUnit::deg()) * (65536.0 * 65536.0) / 360.0;
|
||||||
positionSlewMode.lon_hi = static_cast<qint32>(longitude);
|
positionSlewMode.lon_hi = static_cast<qint32>(longitude);
|
||||||
positionSlewMode.lon_lo = static_cast<quint16>(qAbs((longitude - positionSlewMode.lon_hi) * 65536));
|
positionSlewMode.lon_lo = static_cast<quint16>(qAbs((longitude - positionSlewMode.lon_hi) * 65536));
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ namespace BlackSimPlugin
|
|||||||
pbhstrct.bank = qRound(std::floor(situation.getBank().value(CAngleUnit::deg()) * CFs9Sdk::bankMultiplier()));
|
pbhstrct.bank = qRound(std::floor(situation.getBank().value(CAngleUnit::deg()) * CFs9Sdk::bankMultiplier()));
|
||||||
// MSFS has inverted pitch and bank angles
|
// MSFS has inverted pitch and bank angles
|
||||||
pbhstrct.pitch = ~pbhstrct.pitch;
|
pbhstrct.pitch = ~pbhstrct.pitch;
|
||||||
pbhstrct.bank = ~pbhstrct.bank;
|
pbhstrct.bank = ~pbhstrct.bank;
|
||||||
|
|
||||||
pbhstrct.onground = situation.isOnGround() ? 1 : 0;
|
pbhstrct.onground = situation.isOnGround() ? 1 : 0;
|
||||||
positionSlewMode.pbh = pbhstrct.pbh;
|
positionSlewMode.pbh = pbhstrct.pbh;
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ namespace BlackSimPlugin
|
|||||||
data.append(qPrintable(value), value.size() + 1);
|
data.append(qPrintable(value), value.size() + 1);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
} // ns
|
||||||
}
|
} // ns
|
||||||
}
|
} // ns
|
||||||
}
|
|
||||||
|
|||||||
@@ -90,8 +90,10 @@ namespace BlackSimPlugin
|
|||||||
int bank = qRound(std::floor(pbhstrct.bank / CFs9Sdk::bankMultiplier()));
|
int bank = qRound(std::floor(pbhstrct.bank / CFs9Sdk::bankMultiplier()));
|
||||||
|
|
||||||
// MSFS has inverted pitch and bank angles
|
// 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;
|
pitch = ~pitch;
|
||||||
bank = ~bank;
|
bank = ~bank;
|
||||||
situation.setPitch(CAngle(pitch, CAngleUnit::deg()));
|
situation.setPitch(CAngle(pitch, CAngleUnit::deg()));
|
||||||
situation.setBank(CAngle(bank, CAngleUnit::deg()));
|
situation.setBank(CAngle(bank, CAngleUnit::deg()));
|
||||||
situation.setHeading(CHeading(pbhstrct.hdg / CFs9Sdk::headingMultiplier(), CHeading::Magnetic, CAngleUnit::deg()));
|
situation.setHeading(CHeading(pbhstrct.hdg / CFs9Sdk::headingMultiplier(), CHeading::Magnetic, CAngleUnit::deg()));
|
||||||
@@ -233,9 +235,9 @@ namespace BlackSimPlugin
|
|||||||
const CTransponder newTransponder = ownAircraft.getTransponder();
|
const CTransponder newTransponder = ownAircraft.getTransponder();
|
||||||
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
if (newCom1.getFrequencyActive() != m_simCom1.getFrequencyActive()) { changed = true; }
|
if (newCom1.getFrequencyActive() != m_simCom1.getFrequencyActive()) { changed = true; }
|
||||||
if (newCom1.getFrequencyStandby() != m_simCom1.getFrequencyStandby()) { changed = true; }
|
if (newCom1.getFrequencyStandby() != m_simCom1.getFrequencyStandby()) { changed = true; }
|
||||||
if (newCom2.getFrequencyActive() != m_simCom2.getFrequencyActive()) { changed = true; }
|
if (newCom2.getFrequencyActive() != m_simCom2.getFrequencyActive()) { changed = true; }
|
||||||
if (newCom2.getFrequencyStandby() != m_simCom2.getFrequencyStandby()) { changed = true; }
|
if (newCom2.getFrequencyStandby() != m_simCom2.getFrequencyStandby()) { changed = true; }
|
||||||
if (newTransponder.getTransponderCode() != m_simTransponder.getTransponderCode()) { changed = true; }
|
if (newTransponder.getTransponderCode() != m_simTransponder.getTransponderCode()) { changed = true; }
|
||||||
if (newTransponder.getTransponderMode() != m_simTransponder.getTransponderMode()) { changed = true; }
|
if (newTransponder.getTransponderMode() != m_simTransponder.getTransponderMode()) { changed = true; }
|
||||||
@@ -258,7 +260,7 @@ namespace BlackSimPlugin
|
|||||||
if (selcal != m_selcal)
|
if (selcal != m_selcal)
|
||||||
{
|
{
|
||||||
//! KB 2018-11 that would need to go to updateOwnAircraftFromSimulator if the simulator ever supports SELCAL
|
//! KB 2018-11 that would need to go to updateOwnAircraftFromSimulator if the simulator ever supports SELCAL
|
||||||
//! KB 2018-11 als we would need to send the value to FS9/FSX (currently we only deal with it on FS9/FSX level)
|
//! KB 2018-11 as we would need to send the value to FS9/FSX (currently we only deal with it on FS9/FSX level)
|
||||||
m_selcal = selcal;
|
m_selcal = selcal;
|
||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
@@ -378,7 +380,7 @@ namespace BlackSimPlugin
|
|||||||
m_skipCockpitUpdateCycles--;
|
m_skipCockpitUpdateCycles--;
|
||||||
}
|
}
|
||||||
|
|
||||||
CAircraftSituation aircraftSituation = simDataOwnAircraft.getSituation();
|
const CAircraftSituation aircraftSituation = simDataOwnAircraft.getSituation();
|
||||||
this->updateOwnSituation(aircraftSituation);
|
this->updateOwnSituation(aircraftSituation);
|
||||||
|
|
||||||
if (m_isWeatherActivated)
|
if (m_isWeatherActivated)
|
||||||
|
|||||||
@@ -490,9 +490,9 @@ namespace BlackSimPlugin
|
|||||||
const double lonCorrectionFactor = 360.0 / (65536.0 * 65536.0 * 65536.0 * 65536.0);
|
const double lonCorrectionFactor = 360.0 / (65536.0 * 65536.0 * 65536.0 * 65536.0);
|
||||||
CAircraftSituation situation = aircraft.getSituation();
|
CAircraftSituation situation = aircraft.getSituation();
|
||||||
CCoordinateGeodetic position = situation.getPosition();
|
CCoordinateGeodetic position = situation.getPosition();
|
||||||
CLatitude lat(latitudeRaw * latCorrectionFactor, CAngleUnit::deg());
|
CLatitude lat(latitudeRaw * latCorrectionFactor, CAngleUnit::deg());
|
||||||
CLongitude lon(longitudeRaw * lonCorrectionFactor, CAngleUnit::deg());
|
CLongitude lon(longitudeRaw * lonCorrectionFactor, CAngleUnit::deg());
|
||||||
CAltitude groundAltitude(groundAltitudeRaw / 256.0, CLengthUnit::m());
|
CAltitude groundAltitude(groundAltitudeRaw / 256.0, CLengthUnit::m());
|
||||||
position.setLatitude(lat);
|
position.setLatitude(lat);
|
||||||
position.setLongitude(lon);
|
position.setLongitude(lon);
|
||||||
position.setGeodeticHeight(groundAltitude);
|
position.setGeodeticHeight(groundAltitude);
|
||||||
@@ -509,7 +509,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
// speeds, situation
|
// speeds, situation
|
||||||
CAngle pitch = CAngle(pitchRaw, CAngleUnit::deg());
|
CAngle pitch = CAngle(pitchRaw, CAngleUnit::deg());
|
||||||
CAngle bank = CAngle(bankRaw, CAngleUnit::deg());
|
CAngle bank = CAngle(bankRaw, CAngleUnit::deg());
|
||||||
CHeading heading = CHeading(headingRaw * angleCorrectionFactor, CHeading::True, CAngleUnit::deg());
|
CHeading heading = CHeading(headingRaw * angleCorrectionFactor, CHeading::True, CAngleUnit::deg());
|
||||||
CSpeed groundspeed(groundspeedRaw / 65536.0, CSpeedUnit::m_s());
|
CSpeed groundspeed(groundspeedRaw / 65536.0, CSpeedUnit::m_s());
|
||||||
CAltitude altitude(altitudeRaw / (65536.0 * 65536.0), CAltitude::MeanSeaLevel, CLengthUnit::m());
|
CAltitude altitude(altitudeRaw / (65536.0 * 65536.0), CAltitude::MeanSeaLevel, CLengthUnit::m());
|
||||||
|
|||||||
@@ -80,8 +80,8 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
CFsuipc *m_fsuipc = nullptr; //!< FSUIPC
|
CFsuipc *m_fsuipc = nullptr; //!< FSUIPC
|
||||||
bool m_useFsuipc = false; //!< use FSUIPC
|
bool m_useFsuipc = false; //!< use FSUIPC
|
||||||
bool m_simPaused = false; //!< Simulator paused?
|
bool m_simPaused = false; //!< simulator paused?
|
||||||
bool m_simTimeSynced = false; //!< Time synchronized?
|
bool m_simTimeSynced = false; //!< time synchronized?
|
||||||
BlackMisc::PhysicalQuantities::CTime m_syncTimeOffset; //!< time offset
|
BlackMisc::PhysicalQuantities::CTime m_syncTimeOffset; //!< time offset
|
||||||
BlackMisc::Aviation::CAirportList m_airportsInRangeFromSimulator; //!< airports in range of own aircraft
|
BlackMisc::Aviation::CAirportList m_airportsInRangeFromSimulator; //!< airports in range of own aircraft
|
||||||
|
|
||||||
|
|||||||
@@ -29,17 +29,17 @@ namespace BlackSimPlugin
|
|||||||
//! \sa SimConnect events http://msdn.microsoft.com/en-us/library/cc526980.aspx
|
//! \sa SimConnect events http://msdn.microsoft.com/en-us/library/cc526980.aspx
|
||||||
struct DataDefinitionOwnAircraft
|
struct DataDefinitionOwnAircraft
|
||||||
{
|
{
|
||||||
double latitude; //!< Latitude (deg)
|
double latitudeDeg; //!< Latitude (deg)
|
||||||
double longitude; //!< Longitude (deg)
|
double longitudeDeg; //!< Longitude (deg)
|
||||||
double altitude; //!< Altitude (ft)
|
double altitudeFt; //!< Altitude (ft)
|
||||||
double altitudeAGL; //!< Altitude above ground (ft)
|
double altitudeAGLFt; //!< Altitude above ground (ft)
|
||||||
double pressureAltitude; //!< Pressure altitude (m)
|
double pressureAltitudeM; //!< Pressure altitude (m)
|
||||||
double cgToGround; //!< Static CG to ground (ft)
|
double cgToGroundFt; //!< Static CG to ground (ft)
|
||||||
double trueHeading; //!< True heading (deg)
|
double trueHeadingDeg; //!< True heading (deg)
|
||||||
double pitch; //!< Pitch (deg)
|
double pitchDeg; //!< Pitch (deg)
|
||||||
double bank; //!< Bank (deg)
|
double bankDeg; //!< Bank (deg)
|
||||||
double velocity; //!< Ground velocity
|
double velocity; //!< Ground velocity
|
||||||
double elevation; //!< Elevation (ft)
|
double elevationFt; //!< Elevation (ft)
|
||||||
double simOnGround; //!< Is aircraft on ground?
|
double simOnGround; //!< Is aircraft on ground?
|
||||||
// 12
|
// 12
|
||||||
double lightStrobe; //!< Is strobe light on?
|
double lightStrobe; //!< Is strobe light on?
|
||||||
|
|||||||
@@ -54,10 +54,10 @@ namespace BlackSimPlugin
|
|||||||
namespace FsxCommon
|
namespace FsxCommon
|
||||||
{
|
{
|
||||||
CSimulatorFsxCommon::CSimulatorFsxCommon(const CSimulatorPluginInfo &info,
|
CSimulatorFsxCommon::CSimulatorFsxCommon(const CSimulatorPluginInfo &info,
|
||||||
IOwnAircraftProvider *ownAircraftProvider,
|
IOwnAircraftProvider *ownAircraftProvider,
|
||||||
IRemoteAircraftProvider *remoteAircraftProvider,
|
IRemoteAircraftProvider *remoteAircraftProvider,
|
||||||
IWeatherGridProvider *weatherGridProvider,
|
IWeatherGridProvider *weatherGridProvider,
|
||||||
IClientProvider *clientProvider,
|
IClientProvider *clientProvider,
|
||||||
QObject *parent) :
|
QObject *parent) :
|
||||||
CSimulatorFsCommon(info, ownAircraftProvider, remoteAircraftProvider, weatherGridProvider, clientProvider, parent)
|
CSimulatorFsCommon(info, ownAircraftProvider, remoteAircraftProvider, weatherGridProvider, clientProvider, parent)
|
||||||
{
|
{
|
||||||
@@ -373,9 +373,9 @@ namespace BlackSimPlugin
|
|||||||
m_dispatchTimeMs = -1;
|
m_dispatchTimeMs = -1;
|
||||||
m_dispatchProcTimeMs = -1;
|
m_dispatchProcTimeMs = -1;
|
||||||
m_requestSimObjectDataCount = 0;
|
m_requestSimObjectDataCount = 0;
|
||||||
m_dispatchReceiveIdLast = SIMCONNECT_RECV_ID_NULL;
|
m_dispatchReceiveIdLast = SIMCONNECT_RECV_ID_NULL;
|
||||||
m_dispatchReceiveIdMaxTime = SIMCONNECT_RECV_ID_NULL;
|
m_dispatchReceiveIdMaxTime = SIMCONNECT_RECV_ID_NULL;
|
||||||
m_dispatchRequestIdLast = CSimConnectDefinitions::RequestEndMarker;
|
m_dispatchRequestIdLast = CSimConnectDefinitions::RequestEndMarker;
|
||||||
m_dispatchRequestIdMaxTime = CSimConnectDefinitions::RequestEndMarker;
|
m_dispatchRequestIdMaxTime = CSimConnectDefinitions::RequestEndMarker;
|
||||||
CSimulatorPluginCommon::resetAircraftStatistics();
|
CSimulatorPluginCommon::resetAircraftStatistics();
|
||||||
}
|
}
|
||||||
@@ -632,24 +632,24 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
CSimulatedAircraft myAircraft(getOwnAircraft());
|
CSimulatedAircraft myAircraft(getOwnAircraft());
|
||||||
CCoordinateGeodetic position;
|
CCoordinateGeodetic position;
|
||||||
position.setLatitude(CLatitude(simulatorOwnAircraft.latitude, CAngleUnit::deg()));
|
position.setLatitude(CLatitude(simulatorOwnAircraft.latitudeDeg, CAngleUnit::deg()));
|
||||||
position.setLongitude(CLongitude(simulatorOwnAircraft.longitude, CAngleUnit::deg()));
|
position.setLongitude(CLongitude(simulatorOwnAircraft.longitudeDeg, CAngleUnit::deg()));
|
||||||
|
|
||||||
if (simulatorOwnAircraft.pitch < -90.0 || simulatorOwnAircraft.pitch >= 90.0)
|
if (simulatorOwnAircraft.pitchDeg < -90.0 || simulatorOwnAircraft.pitchDeg >= 90.0)
|
||||||
{
|
{
|
||||||
CLogMessage(this).warning(u"FSX: Pitch value (own aircraft) out of limits: %1") << simulatorOwnAircraft.pitch;
|
CLogMessage(this).warning(u"FSX: Pitch value (own aircraft) out of limits: %1") << simulatorOwnAircraft.pitchDeg;
|
||||||
}
|
}
|
||||||
CAircraftSituation aircraftSituation;
|
CAircraftSituation aircraftSituation;
|
||||||
aircraftSituation.setMSecsSinceEpoch(ts);
|
aircraftSituation.setMSecsSinceEpoch(ts);
|
||||||
aircraftSituation.setPosition(position);
|
aircraftSituation.setPosition(position);
|
||||||
// MSFS has inverted pitch and bank angles
|
// MSFS has inverted pitch and bank angles
|
||||||
aircraftSituation.setPitch(CAngle(-simulatorOwnAircraft.pitch, CAngleUnit::deg()));
|
aircraftSituation.setPitch(CAngle(-simulatorOwnAircraft.pitchDeg, CAngleUnit::deg()));
|
||||||
aircraftSituation.setBank(CAngle(-simulatorOwnAircraft.bank, CAngleUnit::deg()));
|
aircraftSituation.setBank(CAngle(-simulatorOwnAircraft.bankDeg, CAngleUnit::deg()));
|
||||||
aircraftSituation.setHeading(CHeading(simulatorOwnAircraft.trueHeading, CHeading::True, CAngleUnit::deg()));
|
aircraftSituation.setHeading(CHeading(simulatorOwnAircraft.trueHeadingDeg, CHeading::True, CAngleUnit::deg()));
|
||||||
aircraftSituation.setGroundSpeed(CSpeed(simulatorOwnAircraft.velocity, CSpeedUnit::kts()));
|
aircraftSituation.setGroundSpeed(CSpeed(simulatorOwnAircraft.velocity, CSpeedUnit::kts()));
|
||||||
aircraftSituation.setGroundElevation(CAltitude(simulatorOwnAircraft.elevation, CAltitude::MeanSeaLevel, CLengthUnit::ft()), CAircraftSituation::FromProvider);
|
aircraftSituation.setGroundElevation(CAltitude(simulatorOwnAircraft.elevationFt, CAltitude::MeanSeaLevel, CLengthUnit::ft()), CAircraftSituation::FromProvider);
|
||||||
aircraftSituation.setAltitude(CAltitude(simulatorOwnAircraft.altitude, CAltitude::MeanSeaLevel, CLengthUnit::ft()));
|
aircraftSituation.setAltitude(CAltitude(simulatorOwnAircraft.altitudeFt, CAltitude::MeanSeaLevel, CLengthUnit::ft()));
|
||||||
aircraftSituation.setPressureAltitude(CAltitude(simulatorOwnAircraft.pressureAltitude, CAltitude::MeanSeaLevel, CAltitude::PressureAltitude, CLengthUnit::m()));
|
aircraftSituation.setPressureAltitude(CAltitude(simulatorOwnAircraft.pressureAltitudeM, CAltitude::MeanSeaLevel, CAltitude::PressureAltitude, CLengthUnit::m()));
|
||||||
// set on ground also in situation for consistency and future usage
|
// set on ground also in situation for consistency and future usage
|
||||||
// it is duplicated in parts
|
// it is duplicated in parts
|
||||||
aircraftSituation.setOnGround(dtb(simulatorOwnAircraft.simOnGround) ? CAircraftSituation::OnGround : CAircraftSituation::NotOnGround, CAircraftSituation::OutOnGroundOwnAircraft);
|
aircraftSituation.setOnGround(dtb(simulatorOwnAircraft.simOnGround) ? CAircraftSituation::OnGround : CAircraftSituation::NotOnGround, CAircraftSituation::OutOnGroundOwnAircraft);
|
||||||
@@ -765,11 +765,16 @@ namespace BlackSimPlugin
|
|||||||
m_simulatorInternals.setValue(QStringLiteral("fsx/sb3"), boolToEnabledDisabled(m_useSbOffsets));
|
m_simulatorInternals.setValue(QStringLiteral("fsx/sb3"), boolToEnabledDisabled(m_useSbOffsets));
|
||||||
m_simulatorInternals.setValue(QStringLiteral("fsx/sb3packets"), m_useSbOffsets ? QString::number(m_sbDataReceived) : QStringLiteral("disabled"));
|
m_simulatorInternals.setValue(QStringLiteral("fsx/sb3packets"), m_useSbOffsets ? QString::number(m_sbDataReceived) : QStringLiteral("disabled"));
|
||||||
|
|
||||||
|
// CG
|
||||||
|
const CLength cg(simulatorOwnAircraft.cgToGroundFt, CLengthUnit::ft());
|
||||||
|
this->updateOwnCG(cg);
|
||||||
|
|
||||||
// Simulated objects instead of NON ATC
|
// Simulated objects instead of NON ATC
|
||||||
m_simulatorInternals.setValue(QStringLiteral("fsx/addAsSimulatedObject"), boolToEnabledDisabled(m_useAddSimulatedObj));
|
m_simulatorInternals.setValue(QStringLiteral("fsx/addAsSimulatedObject"), boolToEnabledDisabled(m_useAddSimulatedObj));
|
||||||
}
|
|
||||||
|
|
||||||
m_ownAircraftUpdateCycles++; // with 50updates/sec long enough even for 32bit
|
} // slow updates
|
||||||
|
|
||||||
|
m_ownAircraftUpdateCycles++; // with 50 updates/sec long enough even for 32bit
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimulatorFsxCommon::triggerUpdateRemoteAircraftFromSimulator(const CSimConnectObject &simObject, const DataDefinitionPosData &remoteAircraftData)
|
void CSimulatorFsxCommon::triggerUpdateRemoteAircraftFromSimulator(const CSimConnectObject &simObject, const DataDefinitionPosData &remoteAircraftData)
|
||||||
@@ -2488,16 +2493,15 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
// reset values
|
// reset values
|
||||||
m_simulatingChangedTs = -1;
|
m_simulatingChangedTs = -1;
|
||||||
m_simConnected = false;
|
m_simConnected = false;
|
||||||
m_simSimulating = false;
|
m_simSimulating = false;
|
||||||
m_sbDataReceived = 0;
|
m_sbDataReceived = 0;
|
||||||
m_syncTimeDeferredCounter = 0;
|
m_syncTimeDeferredCounter = 0;
|
||||||
m_skipCockpitUpdateCycles = 0;
|
m_skipCockpitUpdateCycles = 0;
|
||||||
m_ownAircraftUpdateCycles = 0;
|
|
||||||
m_requestIdSimObjAircraft = static_cast<SIMCONNECT_DATA_REQUEST_ID>(RequestSimObjAircraftStart);
|
m_requestIdSimObjAircraft = static_cast<SIMCONNECT_DATA_REQUEST_ID>(RequestSimObjAircraftStart);
|
||||||
m_dispatchErrors = 0;
|
m_dispatchErrors = 0;
|
||||||
m_receiveExceptionCount = 0;
|
m_receiveExceptionCount = 0;
|
||||||
m_addedProbes = 0;
|
m_addedProbes = 0;
|
||||||
m_initFsxTerrainProbes = false;
|
m_initFsxTerrainProbes = false;
|
||||||
m_sendIdTraces.clear();
|
m_sendIdTraces.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ namespace BlackSimPlugin
|
|||||||
// Updates
|
// Updates
|
||||||
// Do not update ICAO codes, as this overrides reverse lookups
|
// Do not update ICAO codes, as this overrides reverse lookups
|
||||||
// updateOwnIcaoCodes(m_xplaneData.aircraftIcaoCode, CAirlineIcaoCode());
|
// updateOwnIcaoCodes(m_xplaneData.aircraftIcaoCode, CAirlineIcaoCode());
|
||||||
updateOwnSituation(situation);
|
this->updateOwn(situation);
|
||||||
|
|
||||||
// defaults
|
// defaults
|
||||||
CSimulatedAircraft myAircraft(getOwnAircraft());
|
CSimulatedAircraft myAircraft(getOwnAircraft());
|
||||||
|
|||||||
Reference in New Issue
Block a user