Ref T709, added DBus signatures and use CSettings class in service class

* CSettings objects will be shared among all services (traffic, weather, service)
* It is "global" for plugin
This commit is contained in:
Klaus Basan
2019-07-25 16:34:27 +02:00
committed by Mat Sutcliffe
parent 94f519961b
commit f6690136f2
10 changed files with 118 additions and 45 deletions

View File

@@ -19,6 +19,7 @@
#include "datarefs.h"
#include "messages.h"
#include "navdatareference.h"
#include "settings.h"
#include <XPLM/XPLMNavigation.h>
#include <string>
#include <chrono>
@@ -37,7 +38,7 @@ namespace XSwiftBus
{
public:
//! Constructor
CService();
CService(CSettings &settings);
//! Destructor
~CService() override = default;
@@ -234,6 +235,12 @@ namespace XSwiftBus
//! Enable/disable message window disappearing again after 5 seconds
void setDisappearMessageWindow(bool enabled) { m_disappearMessageWindow = enabled; }
//! Get settings in JSON format
std::string getSettings() const;
//! Set settings
void setSettings(const std::string &jsonString);
//! Perform generic processing
int process();
@@ -249,12 +256,13 @@ namespace XSwiftBus
const std::vector<double> &lats, const std::vector<double> &lons, const std::vector<double> &alts);
CMessageBoxControl m_messages { 16, 16, 16 };
bool m_popupMessageWindow = true;
bool m_popupMessageWindow = true;
bool m_disappearMessageWindow = true;
std::chrono::system_clock::time_point m_disappearMessageWindowTime;
std::vector<CNavDataReference> m_airports;
void readAirportsDatabase();
CSettings &m_pluginSettings;
void readAirportsDatabase();
std::vector<CNavDataReference> findClosestAirports(int number, double latitude, double longitude);
StringDataRef<xplane::data::sim::aircraft::view::acf_livery_path> m_liveryPath;