mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 16:56:53 +08:00
@@ -110,6 +110,7 @@ namespace BlackSimPlugin
|
||||
));
|
||||
|
||||
resetData();
|
||||
ps_reloadSettings();
|
||||
}
|
||||
|
||||
// convert xplane squawk mode to swift squawk mode
|
||||
@@ -165,7 +166,8 @@ namespace BlackSimPlugin
|
||||
);
|
||||
|
||||
const auto currentPosition = CCoordinateGeodetic { situation.latitude(), situation.longitude(), {0} };
|
||||
if (calculateGreatCircleDistance(m_lastWeatherPosition, currentPosition).value(CLengthUnit::mi()) > 20)
|
||||
if (CWeatherScenario::isRealWeatherScenario(m_weatherScenarioSettings.get()) &&
|
||||
calculateGreatCircleDistance(m_lastWeatherPosition, currentPosition).value(CLengthUnit::mi()) > 20)
|
||||
{
|
||||
m_lastWeatherPosition = currentPosition;
|
||||
const auto weatherGrid = CWeatherGrid { { "", currentPosition } };
|
||||
@@ -229,6 +231,16 @@ namespace BlackSimPlugin
|
||||
}
|
||||
}
|
||||
|
||||
void CSimulatorXPlane::ps_reloadSettings()
|
||||
{
|
||||
auto selectedWeatherScenario = m_weatherScenarioSettings.get();
|
||||
if (CWeatherScenario::isRealWeatherScenario(selectedWeatherScenario))
|
||||
{
|
||||
m_lastWeatherPosition = {};
|
||||
injectWeatherGrid(CWeatherGrid::getByScenario(selectedWeatherScenario));
|
||||
}
|
||||
}
|
||||
|
||||
bool CSimulatorXPlane::isConnected() const
|
||||
{
|
||||
return m_service && m_traffic && m_weather;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "blackcore/simulator.h"
|
||||
#include "blackcore/simulatorcommon.h"
|
||||
#include "blackcore/settings/simulator.h"
|
||||
#include "blackmisc/aviation/airportlist.h"
|
||||
#include "blackmisc/aviation/callsignset.h"
|
||||
#include "blackmisc/geo/coordinategeodetic.h"
|
||||
@@ -133,6 +134,8 @@ namespace BlackSimPlugin
|
||||
void ps_fastTimerTimeout();
|
||||
void ps_slowTimerTimeout();
|
||||
void ps_installedModelsUpdated(const QStringList &modelStrings, const QStringList &icaos, const QStringList &airlines, const QStringList &liveries);
|
||||
void ps_reloadSettings();
|
||||
|
||||
|
||||
private:
|
||||
//! Inject weather grid to simulator
|
||||
@@ -149,6 +152,7 @@ namespace BlackSimPlugin
|
||||
BlackMisc::Simulation::CAircraftModelList m_installedModels; //!< \todo Do we still need this, as we now focus on model set
|
||||
|
||||
BlackMisc::Geo::CCoordinateGeodetic m_lastWeatherPosition; //!< Own aircraft position at which weather was fetched and injected last
|
||||
BlackMisc::CSetting<BlackCore::Settings::Simulator::SelectedWeatherScenario> m_weatherScenarioSettings { this, &CSimulatorXPlane::ps_reloadSettings };
|
||||
|
||||
//! \todo Add units to members? pitchDeg?, altitudeFt?
|
||||
struct // data is written by DBus async method callbacks
|
||||
|
||||
Reference in New Issue
Block a user