mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Ref T260, changed elevation handling in provider, simulator and FSX common driver
* split functions, added findClosestElevationWithinRangeOrRequest * obtain elevation ids (separate ids are easier to track) * also added experimental "physicallyAddAITerrainProbe" (FSX) for the FSX elevation probing * callback / signal when requested elevation is received (async)
This commit is contained in:
committed by
Roland Winklmeier
parent
dcc348c9d9
commit
6061a61d50
@@ -91,7 +91,7 @@ namespace BlackMisc
|
||||
return delta;
|
||||
}
|
||||
|
||||
CElevationPlane ISimulationEnvironmentProvider::findClosestElevationWithinRange(const ICoordinateGeodetic &reference, const PhysicalQuantities::CLength &range, bool autoRequest) const
|
||||
CElevationPlane ISimulationEnvironmentProvider::findClosestElevationWithinRange(const ICoordinateGeodetic &reference, const PhysicalQuantities::CLength &range) const
|
||||
{
|
||||
const CCoordinateGeodetic coordinate = this->getElevationCoordinates().findClosestWithinRange(reference, minRange(range));
|
||||
const bool found = !coordinate.isNull();
|
||||
@@ -100,14 +100,24 @@ namespace BlackMisc
|
||||
if (found)
|
||||
{
|
||||
m_elvFound++;
|
||||
return CElevationPlane(coordinate, reference); // plane with radis = distance to reference
|
||||
}
|
||||
else
|
||||
{
|
||||
m_elvMissed++;
|
||||
if (autoRequest) { this->requestElevation(reference); }
|
||||
return CElevationPlane::null();
|
||||
}
|
||||
}
|
||||
return CElevationPlane(coordinate, reference); // plane with radis = distance to reference
|
||||
}
|
||||
|
||||
CElevationPlane ISimulationEnvironmentProvider::findClosestElevationWithinRangeOrRequest(const ICoordinateGeodetic &reference, const CLength &range, const CCallsign &callsign)
|
||||
{
|
||||
const CElevationPlane ep = ISimulationEnvironmentProvider::findClosestElevationWithinRange(reference, range);
|
||||
if (ep.isNull())
|
||||
{
|
||||
this->requestElevation(reference, callsign);
|
||||
}
|
||||
return ep;
|
||||
}
|
||||
|
||||
QPair<int, int> ISimulationEnvironmentProvider::getElevationsFoundMissed() const
|
||||
@@ -196,16 +206,22 @@ namespace BlackMisc
|
||||
this->clearCGs();
|
||||
}
|
||||
|
||||
CElevationPlane CSimulationEnvironmentAware::findClosestElevationWithinRange(const ICoordinateGeodetic &reference, const PhysicalQuantities::CLength &range, bool autoRequest) const
|
||||
CElevationPlane CSimulationEnvironmentAware::findClosestElevationWithinRange(const ICoordinateGeodetic &reference, const PhysicalQuantities::CLength &range) const
|
||||
{
|
||||
if (!this->hasProvider()) { return CElevationPlane::null(); }
|
||||
return this->provider()->findClosestElevationWithinRange(reference, range, autoRequest);
|
||||
return this->provider()->findClosestElevationWithinRange(reference, range);
|
||||
}
|
||||
|
||||
bool CSimulationEnvironmentAware::requestElevation(const ICoordinateGeodetic &reference) const
|
||||
CElevationPlane CSimulationEnvironmentAware::findClosestElevationWithinRangeOrRequest(const ICoordinateGeodetic &reference, const CLength &range, const CCallsign &callsign)
|
||||
{
|
||||
if (!this->hasProvider()) { return CElevationPlane::null(); }
|
||||
return this->provider()->findClosestElevationWithinRangeOrRequest(reference, range, callsign);
|
||||
}
|
||||
|
||||
bool CSimulationEnvironmentAware::requestElevation(const ICoordinateGeodetic &reference, const CCallsign &callsign)
|
||||
{
|
||||
if (!this->hasProvider()) { return false; }
|
||||
return this->provider()->requestElevation(reference);
|
||||
return this->provider()->requestElevation(reference, callsign);
|
||||
}
|
||||
|
||||
QPair<int, int> CSimulationEnvironmentAware::getElevationsFoundMissed() const
|
||||
|
||||
Reference in New Issue
Block a user