mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 00:25:35 +08:00
Ref T259, Ref T243 prepared sim.env.provider to request elevations
This commit is contained in:
@@ -922,7 +922,7 @@ namespace BlackCore
|
||||
CAircraftSituation correctedSituation(situation);
|
||||
if (!correctedSituation.hasGroundElevation() && !correctedSituation.canLikelySkipNearGroundInterpolation())
|
||||
{
|
||||
const CElevationPlane ep = this->findClosestElevationWithinRange(correctedSituation, correctedSituation.getDistancePerTime(1000));
|
||||
const CElevationPlane ep = this->findClosestElevationWithinRange(correctedSituation, correctedSituation.getDistancePerTime(1000), true);
|
||||
correctedSituation.setGroundElevation(ep);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,14 @@ namespace BlackCore
|
||||
return setup;
|
||||
}
|
||||
|
||||
bool ISimulator::requestElevation(const Geo::ICoordinateGeodetic &reference) const
|
||||
{
|
||||
if (this->isShuttingDown()) { return false; }
|
||||
if (reference.isNull()) { return false; }
|
||||
Q_UNUSED(reference);
|
||||
return false;
|
||||
}
|
||||
|
||||
void ISimulator::registerHelp()
|
||||
{
|
||||
if (CSimpleCommandParser::registered("BlackCore::ISimulator")) { return; }
|
||||
@@ -56,11 +64,11 @@ namespace BlackCore
|
||||
QString ISimulator::statusToString(SimulatorStatus status)
|
||||
{
|
||||
QStringList s;
|
||||
if (status.testFlag(Unspecified)) s << "Unspecified";
|
||||
if (status.testFlag(Disconnected)) s << "Disconnected";
|
||||
if (status.testFlag(Connected)) s << "Connected";
|
||||
if (status.testFlag(Simulating)) s << "Simulating";
|
||||
if (status.testFlag(Paused)) s << "Paused";
|
||||
if (status.testFlag(Unspecified)) { s << QStringLiteral("Unspecified"); }
|
||||
if (status.testFlag(Disconnected)) { s << QStringLiteral("Disconnected"); }
|
||||
if (status.testFlag(Connected)) { s << QStringLiteral("Connected"); }
|
||||
if (status.testFlag(Simulating)) { s << QStringLiteral("Simulating"); }
|
||||
if (status.testFlag(Paused)) { s << QStringLiteral("Paused"); }
|
||||
return s.join(", ");
|
||||
}
|
||||
|
||||
|
||||
@@ -180,6 +180,10 @@ namespace BlackCore
|
||||
//! Is overall (swift) application shutting down
|
||||
virtual bool isShuttingDown() const = 0;
|
||||
|
||||
//! \copydoc BlackMisc::Simulation::ISimulationEnvironmentProvider::requestElevation
|
||||
//! \remark needs to be overridden if the concrete driver supports such an option
|
||||
virtual bool requestElevation(const BlackMisc::Geo::ICoordinateGeodetic &reference) const override;
|
||||
|
||||
//! \copydoc BlackMisc::IProvider::asQObject
|
||||
virtual QObject *asQObject() override { return this; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user