mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 06:35:52 +08:00
Ref T786, FSX/P3D METAR (weather inject)
* allow to select which layers are converted to METAR string * allow to pass sim.flag (FSX/P3D) * winds aloft seem to crash FSX, disabled(!)
This commit is contained in:
committed by
Mat Sutcliffe
parent
17cebfb8d3
commit
f9bb71c8ee
@@ -2410,13 +2410,21 @@ namespace BlackSimPlugin
|
||||
}
|
||||
|
||||
// So far, there is only global weather
|
||||
auto glob = weatherGrid.frontOrDefault();
|
||||
const bool isFSX = this->getSimulatorPluginInfo().getSimulatorInfo().isFSX();
|
||||
CGridPoint glob = weatherGrid.frontOrDefault();
|
||||
glob.setIdentifier("GLOB");
|
||||
const QString metar = CSimConnectUtilities::convertToSimConnectMetar(glob);
|
||||
const QString metar = CSimConnectUtilities::convertToSimConnectMetar(glob, isFSX);
|
||||
const QByteArray metarBa = toFsxChar(metar);
|
||||
|
||||
// send
|
||||
SimConnect_WeatherSetModeCustom(m_hSimConnect);
|
||||
SimConnect_WeatherSetModeGlobal(m_hSimConnect);
|
||||
SimConnect_WeatherSetObservation(m_hSimConnect, 0, metarBa.constData());
|
||||
|
||||
if (!metarBa.isEmpty())
|
||||
{
|
||||
// Q_ASSERT_X(metarBa.back() == 0, Q_FUNC_INFO, "Need 0 terminated string");
|
||||
SimConnect_WeatherSetObservation(m_hSimConnect, 0, metarBa.constData());
|
||||
}
|
||||
}
|
||||
|
||||
bool CSimulatorFsxCommon::requestPositionDataForSimObject(const CSimConnectObject &simObject, SIMCONNECT_PERIOD period)
|
||||
|
||||
Reference in New Issue
Block a user