mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-24 09:54:16 +08:00
Ref T259, Ref T243 improved utility function to store elevations in multiple providers
This commit is contained in:
@@ -78,6 +78,13 @@ namespace BlackCore
|
|||||||
ISimulator::registerHelp();
|
ISimulator::registerHelp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ISimulator::rememberElevationAndCG(const CCallsign &callsign, const Geo::CElevationPlane &elevation, const CLength &cg)
|
||||||
|
{
|
||||||
|
if (callsign.isEmpty()) { return; }
|
||||||
|
if (!elevation.isNull()) { this->rememberGroundElevation(elevation); }
|
||||||
|
if (!cg.isNull() && !this->hasSameCG(cg, callsign)) { this->insertCG(cg, callsign); }
|
||||||
|
}
|
||||||
|
|
||||||
void ISimulator::emitSimulatorCombinedStatus(SimulatorStatus oldStatus)
|
void ISimulator::emitSimulatorCombinedStatus(SimulatorStatus oldStatus)
|
||||||
{
|
{
|
||||||
const SimulatorStatus newStatus = this->getSimulatorStatus();
|
const SimulatorStatus newStatus = this->getSimulatorStatus();
|
||||||
|
|||||||
@@ -258,6 +258,9 @@ namespace BlackCore
|
|||||||
//! Remove all remote aircraft
|
//! Remove all remote aircraft
|
||||||
virtual int physicallyRemoveAllRemoteAircraft() = 0;
|
virtual int physicallyRemoveAllRemoteAircraft() = 0;
|
||||||
|
|
||||||
|
//! Set elevation and CG in the providers
|
||||||
|
void rememberElevationAndCG(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Geo::CElevationPlane &elevation, const BlackMisc::PhysicalQuantities::CLength &cg);
|
||||||
|
|
||||||
//! Emit the combined status
|
//! Emit the combined status
|
||||||
//! \param oldStatus optionally one can capture and provide the old status for comparison. In case of equal status values no signal will be sent
|
//! \param oldStatus optionally one can capture and provide the old status for comparison. In case of equal status values no signal will be sent
|
||||||
//! \sa simulatorStatusChanged;
|
//! \sa simulatorStatusChanged;
|
||||||
|
|||||||
@@ -485,12 +485,9 @@ namespace BlackSimPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CElevationPlane: deg, deg, feet
|
// CElevationPlane: deg, deg, feet
|
||||||
CElevationPlane elevation(remoteAircraftData.latitude, remoteAircraftData.longitude, remoteAircraftData.elevation);
|
CElevationPlane elevation(remoteAircraftData.latitudeDeg, remoteAircraftData.longitudeDeg, remoteAircraftData.elevationFt);
|
||||||
elevation.setSinglePointRadius();
|
elevation.setSinglePointRadius();
|
||||||
|
this->rememberElevationAndCG(simObject.getCallsign(), elevation, CLength(remoteAircraftData.cgToGroundFt, CLengthUnit::ft()));
|
||||||
// set it in the remote aircraft provider and in elevation provider
|
|
||||||
this->updateAircraftGroundElevation(simObject.getCallsign(), elevation);
|
|
||||||
this->rememberGroundElevation(elevation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimulatorFsxCommon::updateOwnAircraftFromSimulator(const DataDefinitionClientAreaSb &sbDataArea)
|
void CSimulatorFsxCommon::updateOwnAircraftFromSimulator(const DataDefinitionClientAreaSb &sbDataArea)
|
||||||
|
|||||||
@@ -923,11 +923,7 @@ namespace BlackSimPlugin
|
|||||||
|
|
||||||
CElevationPlane elevation(CLatitude(latitudeDeg, CAngleUnit::deg()), CLongitude(longitudeDeg, CAngleUnit::deg()), CAltitude(elevationMeters, CLengthUnit::m()));
|
CElevationPlane elevation(CLatitude(latitudeDeg, CAngleUnit::deg()), CLongitude(longitudeDeg, CAngleUnit::deg()), CAltitude(elevationMeters, CLengthUnit::m()));
|
||||||
elevation.setSinglePointRadius();
|
elevation.setSinglePointRadius();
|
||||||
this->rememberGroundElevation(elevation);
|
this->rememberElevationAndCG(callsign, elevation, CLength(modelVerticalOffsetMeters, CLengthUnit::m()));
|
||||||
this->insertCG(CLength(modelVerticalOffsetMeters, CLengthUnit::m()), callsign);
|
|
||||||
|
|
||||||
// set it in the remote aircraft provider
|
|
||||||
this->updateAircraftGroundElevation(cs, elevation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BlackCore::ISimulator *CSimulatorXPlaneFactory::create(const CSimulatorPluginInfo &info,
|
BlackCore::ISimulator *CSimulatorXPlaneFactory::create(const CSimulatorPluginInfo &info,
|
||||||
|
|||||||
Reference in New Issue
Block a user