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:
Roland Winklmeier
2016-03-01 23:09:21 +01:00
parent 16315ec2ec
commit 99ab20bcc5
7 changed files with 238 additions and 4 deletions

View File

@@ -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) :

View File

@@ -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;