mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
Weather support in emulated driver
This commit is contained in:
committed by
Mat Sutcliffe
parent
926684fb87
commit
d96c5e51e3
@@ -120,6 +120,15 @@ namespace BlackSimPlugin
|
||||
return ISimulator::physicallyRemoveMultipleRemoteAircraft(callsigns);
|
||||
}
|
||||
|
||||
void CSimulatorEmulated::injectWeatherGrid(const CWeatherGrid &weatherGrid)
|
||||
{
|
||||
const QString wg = QStringLiteral("Weather grid with %1 entries").arg(weatherGrid.size());
|
||||
if (canLog()) m_monitorWidget->appendReceivingCall(Q_FUNC_INFO, wg);
|
||||
m_monitorWidget->receivedWeather(weatherGrid);
|
||||
|
||||
// remark see CWeatherDataPrinter
|
||||
}
|
||||
|
||||
bool CSimulatorEmulated::changeRemoteAircraftModel(const CSimulatedAircraft &aircraft)
|
||||
{
|
||||
if (canLog()) { m_monitorWidget->appendReceivingCall(Q_FUNC_INFO, aircraft.toQString()); }
|
||||
@@ -570,6 +579,17 @@ namespace BlackSimPlugin
|
||||
this->finishUpdateRemoteAircraftAndSetStatistics(now);
|
||||
}
|
||||
|
||||
void CSimulatorEmulated::requestWeather()
|
||||
{
|
||||
if (!m_isWeatherActivated) { return; }
|
||||
|
||||
const CWeatherScenario s = m_weatherScenarioSettings.get();
|
||||
this->getOwnAircraftPosition();
|
||||
const CCoordinateGeodetic currentPosition = this->getOwnAircraftPosition();
|
||||
const auto weatherGrid = CWeatherGrid { { "GLOB", currentPosition } };
|
||||
this->requestWeatherGrid(weatherGrid, { this, &CSimulatorEmulated::injectWeatherGrid });
|
||||
}
|
||||
|
||||
CSimulatorEmulatedListener::CSimulatorEmulatedListener(const CSimulatorPluginInfo &info)
|
||||
: ISimulatorListener(info)
|
||||
{ }
|
||||
|
||||
Reference in New Issue
Block a user