mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 11:05:33 +08:00
Inject global weather grid to Flight Simulators via FSUIPC
In the short term FSUIPC is used for all MSFS simulators, but in the mid term this will be superceded by the Simconnect Weather API. refs #579
This commit is contained in:
@@ -32,6 +32,7 @@ using namespace BlackMisc::PhysicalQuantities;
|
||||
using namespace BlackMisc::Geo;
|
||||
using namespace BlackMisc::Simulation;
|
||||
using namespace BlackMisc::Simulation::FsCommon;
|
||||
using namespace BlackMisc::Weather;
|
||||
using namespace BlackSimPlugin::Fs9;
|
||||
using namespace BlackSimPlugin::FsCommon;
|
||||
|
||||
@@ -133,6 +134,11 @@ namespace BlackSimPlugin
|
||||
m_fsuipc->connect(); // connect FSUIPC too
|
||||
}
|
||||
m_dispatchTimerId = startTimer(50);
|
||||
|
||||
// Pull weather data from core.
|
||||
// Since we don't get weather data from core yet, use hard coded weather.
|
||||
injectWeatherGrid(CWeatherGrid::getCavokGrid());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -361,6 +367,11 @@ namespace BlackSimPlugin
|
||||
}
|
||||
}
|
||||
|
||||
void CSimulatorFs9::injectWeatherGrid(const Weather::CWeatherGrid &weatherGrid)
|
||||
{
|
||||
m_fsuipc->write(weatherGrid);
|
||||
}
|
||||
|
||||
CSimulatorFs9Listener::CSimulatorFs9Listener(const CSimulatorPluginInfo &info,
|
||||
const QSharedPointer<CFs9Host> &fs9Host,
|
||||
const QSharedPointer<CLobbyClient> &lobbyClient) :
|
||||
|
||||
@@ -105,6 +105,9 @@ namespace BlackSimPlugin
|
||||
|
||||
void disconnectAllClients();
|
||||
|
||||
//! Inject weather grid to simulator
|
||||
void injectWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid);
|
||||
|
||||
QHash<BlackMisc::Aviation::CCallsign, QPointer<CFs9Client>> m_hashFs9Clients;
|
||||
QMetaObject::Connection m_connectionHostMessages;
|
||||
int m_dispatchTimerId = -1;
|
||||
|
||||
Reference in New Issue
Block a user