6#include <XPLM/XPLMPlanes.h>
7#include <XPLM/XPLMUtilities.h>
20using namespace swift::misc::simulation::xplane::qtfreeutils;
25 struct CService::FramePeriodSampler :
public CDrawable
27 DataRef<xplane::data::sim::operation::misc::frame_rate_period> m_thisFramePeriod;
28 DataRef<xplane::data::sim::time::framerate_period> m_thisFramePeriodXP11;
29 DataRef<xplane::data::sim::time::total_flight_time_sec> m_secondsSinceReset;
30 DataRef<xplane::data::sim::flightmodel::position::groundspeed> m_groundSpeed;
32 std::vector<float> m_samples;
34 float m_totalOverBudget = 0;
35 float m_totalMetersShort = 0;
36 float m_totalSecondsLate = 0;
37 size_t m_lastSampleIndex = 0;
38 static constexpr size_t c_maxSampleCount = 500;
39 static constexpr float c_framePeriodBudget = 0.05f;
41 FramePeriodSampler() :
CDrawable(xplm_Phase_Window, true) {}
49 const float fps = m_samples.size() / m_total;
50 const float ratio = 1 - m_totalOverBudget / m_total;
51 const float miles = m_totalMetersShort / 1852.0f;
52 const float minutes = m_totalSecondsLate / 60.0f;
54 m_totalOverBudget = 0;
56 m_lastSampleIndex = 0;
57 return std::make_tuple(fps, ratio, miles, minutes);
61 virtual void draw() override
64 m_thisFramePeriodXP11.isValid() ? m_thisFramePeriodXP11.get() : m_thisFramePeriod.get();
66 ++m_lastSampleIndex %= c_maxSampleCount;
67 if (m_samples.size() == c_maxSampleCount)
69 auto &oldSample = m_samples[m_lastSampleIndex];
71 if (oldSample > c_framePeriodBudget)
73 m_totalOverBudget -= oldSample - c_framePeriodBudget;
79 m_samples.push_back(current);
83 if (current > c_framePeriodBudget)
85 m_totalOverBudget += current - c_framePeriodBudget;
87 if (m_secondsSinceReset.get() > 10)
89 const float metersShort = m_groundSpeed.get() * std::max(0.0f, current - c_framePeriodBudget);
90 m_totalMetersShort += metersShort;
91 if (m_groundSpeed.get() > 1.0f)
93 m_totalSecondsLate += std::max(0.0f, current - c_framePeriodBudget);
101 :
CDBusObject(settingsProvider), m_framePeriodSampler(std::make_unique<FramePeriodSampler>())
103 this->updateMessageBoxFromSettings();
104 m_framePeriodSampler->show();
105 m_swiftNetworkConnected.set(0);
106 m_swiftCallsign.set(
"");
116 XPLMGetNthAircraftModel(XPLM_USER_AIRCRAFT, filename, path);
117 if (std::strlen(filename) < 1 || std::strlen(path) < 1)
119 WARNING_LOG(
"Aircraft changed, but NO path or file name");
135 if (!m_framePeriodSampler)
139 const auto result = m_framePeriodSampler->getFrameStats();
140 return std::make_tuple(
static_cast<double>(std::get<0>(result)),
static_cast<double>(std::get<1>(result)),
141 static_cast<double>(std::get<2>(result)),
static_cast<double>(std::get<3>(result)));
146 if (m_framePeriodSampler)
148 m_framePeriodSampler->m_totalMetersShort = 0;
149 m_framePeriodSampler->m_totalSecondsLate = 0;
164 const unsigned lineLength = m_messages.maxLineLength() - 1;
167 U8It
begin(text.begin(), text.end());
168 auto characters = std::distance(
begin, U8It(text.end(), text.end()));
169 std::vector<CMessage::string> wrappedLines;
171 for (; characters > lineLength; characters -= lineLength)
173 auto end = std::next(
begin, lineLength);
174 wrappedLines.emplace_back(
begin.base,
end.base);
175 wrappedLines.back() += ellipsis;
180 wrappedLines.emplace_back(
begin.base, text.end());
182 for (
const auto &line : wrappedLines)
184 m_messages.addMessage(
185 { line,
static_cast<float>(red),
static_cast<float>(green),
static_cast<float>(blue) });
188 if (!m_messages.isVisible() && m_popupMessageWindow)
193 if (m_disappearMessageWindow)
195 m_disappearMessageWindowTime = std::chrono::system_clock::now() +
196 std::chrono::milliseconds(std::max(m_disapperMessageWindowTimeMs, 1500));
204 XPLMGetNthAircraftModel(XPLM_USER_AIRCRAFT, filename, path);
212 XPLMGetNthAircraftModel(XPLM_USER_AIRCRAFT, filename, path);
220 XPLMGetNthAircraftModel(XPLM_USER_AIRCRAFT, filename, path);
229 XPLMGetNthAircraftModel(XPLM_USER_AIRCRAFT, filename, path);
236 std::string liveryPath = m_liveryPath.get();
237 if (liveryPath.empty())
243 liveryPath.pop_back();
250 XPLMGetVersions(&version,
nullptr,
nullptr);
255 return version / 100;
261 XPLMGetVersions(&version,
nullptr,
nullptr);
266 return version % 100;
272 XPLMGetSystemPath(path);
279 XPLMGetPrefsPath(path);
293 this->updateMessageBoxFromSettings();
297 INFO_LOG(
"Written new config file");
301 static const char *introspection_service = DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
302#include "org.swift_project.xswiftbus.service.xml"
309 const std::string sender = message.getSender();
310 const dbus_uint32_t serial = message.getSerial();
311 const bool wantsReply = message.wantsReply();
313 if (message.getInterfaceName() == DBUS_INTERFACE_INTROSPECTABLE)
315 if (message.getMethodName() ==
"Introspect")
320 else if (message.getInterfaceName() == XSWIFTBUS_SERVICE_INTERFACENAME)
322 if (message.getMethodName() ==
"getVersionNumber")
326 else if (message.getMethodName() ==
"getCommitHash")
330 else if (message.getMethodName() ==
"addTextMessage")
337 message.beginArgumentRead();
338 message.getArgument(text);
339 message.getArgument(red);
340 message.getArgument(green);
341 message.getArgument(blue);
345 else if (message.getMethodName() ==
"getOwnAircraftSituationData")
348 const double lat = m_latitude.get();
349 const double lon = m_longitude.get();
350 const double alt = m_elevation.get();
351 const double gs = m_groundSpeed.get();
352 const double pitch = m_pitch.get();
353 const double roll = m_roll.get();
354 const double trueHeading = m_heading.get();
355 const double qnh = m_qnhInhg.get();
357 reply.beginArgumentWrite();
358 reply.appendArgument(lat);
359 reply.appendArgument(lon);
360 reply.appendArgument(alt);
361 reply.appendArgument(gs);
362 reply.appendArgument(pitch);
363 reply.appendArgument(roll);
364 reply.appendArgument(trueHeading);
365 reply.appendArgument(qnh);
369 else if (message.getMethodName() ==
"getOwnAircraftVelocityData")
372 const double velocityX = m_velocityX.get();
373 const double velocityY = m_velocityY.get();
374 const double velocityZ = m_velocityZ.get();
375 const double pitchVelocity = m_pitchVelocity.get();
376 const double rollVelocity = m_rollVelocity.get();
377 const double headingVelocity = m_headingVelocity.get();
379 reply.beginArgumentWrite();
380 reply.appendArgument(velocityX);
381 reply.appendArgument(velocityY);
382 reply.appendArgument(velocityZ);
383 reply.appendArgument(pitchVelocity);
384 reply.appendArgument(rollVelocity);
385 reply.appendArgument(headingVelocity);
389 else if (message.getMethodName() ==
"getOwnAircraftCom1Data")
392 const int active = m_com1Active.get();
393 const int standby = m_com1Standby.get();
394 const double volume = m_com1Volume.get();
398 reply.beginArgumentWrite();
399 reply.appendArgument(active);
400 reply.appendArgument(standby);
401 reply.appendArgument(volume);
402 reply.appendArgument(rec);
403 reply.appendArgument(tx);
407 else if (message.getMethodName() ==
"getOwnAircraftCom2Data")
410 const int active = m_com2Active.get();
411 const int standby = m_com2Standby.get();
412 const double volume = m_com2Volume.get();
416 reply.beginArgumentWrite();
417 reply.appendArgument(active);
418 reply.appendArgument(standby);
419 reply.appendArgument(volume);
420 reply.appendArgument(rec);
421 reply.appendArgument(tx);
425 else if (message.getMethodName() ==
"getOwnAircraftXpdr")
428 const int code = m_xpdrCode.get();
429 const int mode = m_xpdrMode.get();
430 const bool id = m_xpdrIdent.get();
432 reply.beginArgumentWrite();
433 reply.appendArgument(code);
434 reply.appendArgument(mode);
435 reply.appendArgument(
id);
439 else if (message.getMethodName() ==
"getOwnAircraftLights")
442 const bool beaconLightsOn = m_beaconLightsOn.get();
443 const bool landingLightsOn = m_landingLightsOn.get();
444 const bool navLightsOn = m_navLightsOn.get();
445 const bool strobeLightsOn = m_strobeLightsOn.get();
446 const bool taxiLightsOn = m_taxiLightsOn.get();
448 reply.beginArgumentWrite();
449 reply.appendArgument(beaconLightsOn);
450 reply.appendArgument(landingLightsOn);
451 reply.appendArgument(navLightsOn);
452 reply.appendArgument(strobeLightsOn);
453 reply.appendArgument(taxiLightsOn);
457 else if (message.getMethodName() ==
"getOwnAircraftParts")
460 const double flapsReployRatio = m_flapsReployRatio.get();
461 const double gearReployRatio = m_gearReployRatio.getAt(0);
462 const double speedBrakeRatio = m_speedBrakeRatio.get();
465 reply.beginArgumentWrite();
466 reply.appendArgument(flapsReployRatio);
467 reply.appendArgument(gearReployRatio);
468 reply.appendArgument(speedBrakeRatio);
469 reply.appendArgument(enginesN1Percentage);
473 else if (message.getMethodName() ==
"getOwnAircraftModelData")
479 reply.beginArgumentWrite();
480 reply.appendArgument(aircraftModelPath);
481 reply.appendArgument(aircraftIcaoCode);
485 else if (message.getMethodName() ==
"getAircraftModelPath")
489 else if (message.getMethodName() ==
"getAircraftModelFilename")
493 else if (message.getMethodName() ==
"getAircraftModelString")
497 else if (message.getMethodName() ==
"getAircraftName")
501 else if (message.getMethodName() ==
"getAircraftLivery")
505 else if (message.getMethodName() ==
"getAircraftIcaoCode")
509 else if (message.getMethodName() ==
"getAircraftDescription")
513 else if (message.getMethodName() ==
"getXPlaneVersionMajor")
517 else if (message.getMethodName() ==
"getXPlaneVersionMinor")
521 else if (message.getMethodName() ==
"getXPlaneInstallationPath")
525 else if (message.getMethodName() ==
"getXPlanePreferencesPath")
529 else if (message.getMethodName() ==
"isPaused")
533 else if (message.getMethodName() ==
"isUsingRealTime")
537 else if (message.getMethodName() ==
"getFrameStats")
542 reply.beginArgumentWrite();
543 reply.appendArgument(std::get<0>(stats));
544 reply.appendArgument(std::get<1>(stats));
545 reply.appendArgument(std::get<2>(stats));
546 reply.appendArgument(std::get<3>(stats));
550 else if (message.getMethodName() ==
"resetFrameTotals")
555 else if (message.getMethodName() ==
"setFlightNetworkConnected")
558 bool connected =
false;
559 message.beginArgumentRead();
560 message.getArgument(connected);
563 else if (message.getMethodName() ==
"setOwnCallsign")
566 std::string callsign;
567 message.beginArgumentRead();
568 message.getArgument(callsign);
571 else if (message.getMethodName() ==
"getLatitudeDeg")
575 else if (message.getMethodName() ==
"getLongitudeDeg")
579 else if (message.getMethodName() ==
"getAltitudeMslM")
583 else if (message.getMethodName() ==
"getPressureAltitudeFt")
587 else if (message.getMethodName() ==
"getHeightAglM")
591 else if (message.getMethodName() ==
"getGroundSpeedMps")
595 else if (message.getMethodName() ==
"getIndicatedAirspeedKias")
599 else if (message.getMethodName() ==
"getTrueAirspeedKias")
603 else if (message.getMethodName() ==
"getPitchDeg")
607 else if (message.getMethodName() ==
"getRollDeg")
611 else if (message.getMethodName() ==
"getTrueHeadingDeg")
615 else if (message.getMethodName() ==
"getLocalXVelocityXMps")
619 else if (message.getMethodName() ==
"getLocalYVelocityYMps")
623 else if (message.getMethodName() ==
"getLocalZVelocityZMps")
627 else if (message.getMethodName() ==
"getPitchRadPerSec")
631 else if (message.getMethodName() ==
"getRollRadPerSec")
635 else if (message.getMethodName() ==
"getHeadingRadPerSec")
639 else if (message.getMethodName() ==
"getAnyWheelOnGround")
643 else if (message.getMethodName() ==
"getAllWheelsOnGround")
647 else if (message.getMethodName() ==
"getGroundElevation")
651 else if (message.getMethodName() ==
"getCom1ActiveKhz")
655 else if (message.getMethodName() ==
"getCom1StandbyKhz")
659 else if (message.getMethodName() ==
"getCom2ActiveKhz")
663 else if (message.getMethodName() ==
"getCom2StandbyKhz")
667 else if (message.getMethodName() ==
"isCom1Receiving")
671 else if (message.getMethodName() ==
"isCom1Transmitting")
675 else if (message.getMethodName() ==
"getCom1Volume")
679 else if (message.getMethodName() ==
"isCom2Receiving")
683 else if (message.getMethodName() ==
"isCom2Transmitting")
687 else if (message.getMethodName() ==
"getCom2Volume")
691 else if (message.getMethodName() ==
"getTransponderCode")
695 else if (message.getMethodName() ==
"getTransponderMode")
699 else if (message.getMethodName() ==
"getTransponderIdent")
703 else if (message.getMethodName() ==
"getBeaconLightsOn")
707 else if (message.getMethodName() ==
"getLandingLightsOn")
711 else if (message.getMethodName() ==
"getTaxiLightsOn")
715 else if (message.getMethodName() ==
"getNavLightsOn")
719 else if (message.getMethodName() ==
"getStrobeLightsOn")
723 else if (message.getMethodName() ==
"getQNHInHg")
727 else if (message.getMethodName() ==
"setCom1ActiveKhz")
731 message.beginArgumentRead();
732 message.getArgument(frequency);
735 else if (message.getMethodName() ==
"setCom1StandbyKhz")
739 message.beginArgumentRead();
740 message.getArgument(frequency);
743 else if (message.getMethodName() ==
"setCom2ActiveKhz")
747 message.beginArgumentRead();
748 message.getArgument(frequency);
751 else if (message.getMethodName() ==
"setCom2StandbyKhz")
755 message.beginArgumentRead();
756 message.getArgument(frequency);
759 else if (message.getMethodName() ==
"setTransponderCode")
763 message.beginArgumentRead();
764 message.getArgument(code);
767 else if (message.getMethodName() ==
"setTransponderMode")
771 message.beginArgumentRead();
772 message.getArgument(mode);
775 else if (message.getMethodName() ==
"getFlapsDeployRatio")
779 else if (message.getMethodName() ==
"getGearDeployRatio")
783 else if (message.getMethodName() ==
"getNumberOfEngines")
787 else if (message.getMethodName() ==
"getEngineN1Percentage")
794 else if (message.getMethodName() ==
"getSpeedBrakeRatio")
798 else if (message.getMethodName() ==
"getSettingsJson")
802 else if (message.getMethodName() ==
"setSettingsJson")
806 message.beginArgumentRead();
807 message.getArgument(json);
813 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
816 return DBUS_HANDLER_RESULT_HANDLED;
821 if (m_sceneryIsLoading.get() != m_sceneryWasLoading)
823 if (!m_sceneryIsLoading.get())
827 m_sceneryWasLoading = m_sceneryIsLoading.get();
832 if (m_disappearMessageWindowTime != std::chrono::system_clock::time_point() &&
833 std::chrono::system_clock::now() > m_disappearMessageWindowTime && m_messages.isVisible())
836 m_disappearMessageWindowTime = std::chrono::system_clock::time_point();
842 void CService::emitAircraftModelChanged(
const std::string &path,
const std::string &filename,
843 const std::string &livery,
const std::string &icao,
844 const std::string &modelString,
const std::string &name,
845 const std::string &description)
848 XSWIFTBUS_SERVICE_OBJECTPATH, XSWIFTBUS_SERVICE_INTERFACENAME,
"aircraftModelChanged");
849 signalAircraftModelChanged.beginArgumentWrite();
850 signalAircraftModelChanged.appendArgument(path);
851 signalAircraftModelChanged.appendArgument(filename);
852 signalAircraftModelChanged.appendArgument(livery);
853 signalAircraftModelChanged.appendArgument(icao);
854 signalAircraftModelChanged.appendArgument(modelString);
855 signalAircraftModelChanged.appendArgument(name);
856 signalAircraftModelChanged.appendArgument(description);
860 void CService::emitSceneryLoaded()
862 CDBusMessage signal =
867 void CService::updateMessageBoxFromSettings()
871 if (values.size() >= 6)
873 m_messages.setValues(values[0], values[1], values[2], values[3], values[4], values[5]);
static CDBusMessage createReply(const std::string &destination, dbus_uint32_t serial)
Creates a DBus message containing a DBus reply.
static CDBusMessage createSignal(const std::string &path, const std::string &interfaceName, const std::string &signalName)
Creates a DBus message containing a DBus signal.
void queueDBusCall(const std::function< void()> &func)
Queue a DBus call to be executed in a different thread.
void maybeSendEmptyDBusReply(bool wantsReply, const std::string &destination, dbus_uint32_t serial)
Maybe sends an empty DBus reply (acknowledgement).
void sendDBusMessage(const CDBusMessage &message)
Send DBus message.
void invokeQueuedDBusCalls()
Invoke all pending DBus calls. They will be executed in the calling thread.
void sendDBusReply(const std::string &destination, dbus_uint32_t serial, const T &argument)
Send DBus reply.
CDBusObject(CSettingsProvider *settingsProvider)
Constructor.
Class-based interface to X-Plane's drawing callback API.
virtual void draw()=0
Callback to draw the thing.
CDrawable(XPLMDrawingPhase phase, bool before)
Constructor.
bool isCom1Transmitting() const
Is COM1 transmitting?
double getRollDeg() const
Get aircraft roll in degrees.
float getCom1Volume() const
Get the COM1 volume 0..1.
double getFlapsDeployRatio() const
Get flaps deploy ratio, where 0.0 is flaps fully retracted, and 1.0 is flaps fully extended.
static std::string getCommitHash()
Returns the SHA1 of the last commit that could influence xswiftbus.
float getCom2Volume() const
Get the COM2 volume 0..1.
int getCom1ActiveKhz() const
Get the current COM1 active frequency in kHz.
virtual ~CService()
Destructor.
double getLongitudeDeg() const
Get aircraft longitude in degrees.
double getAltitudeMslM() const
Get aircraft altitude in meters.
double getGroundSpeedMps() const
Get aircraft groundspeed in meters per second.
std::string getAircraftIcaoCode() const
Get the ICAO code of the current aircraft model.
static std::string getAircraftModelPath()
Get full path to current aircraft model.
static int getXPlaneVersionMinor()
Get minor version number.
bool isPaused() const
True if sim is paused.
int getCom2StandbyKhz() const
Get the current COM2 standby frequency in kHz.
void setFlightNetworkConnected(bool connected)
Set the current connection state.
double getTrueAirspeedKias() const
Get aircraft TAS in meters per second.
double getRollRadPerSec() const
Get aircraft angular velocity in radians per second.
bool isCom2Receiving() const
Is COM2 receiving?
std::tuple< double, double, double, double > getFrameStats()
Frames-per-second, averaged over the last 500 frames, or since this function was last called,...
void resetFrameTotals()
Reset the monitoring of total miles and minutes lost due to low frame rate.
double getLocalZVelocityMps() const
Get aircraft local velocity in world coordinates meters per second.
CService(CSettingsProvider *settingsProvider)
Constructor.
DBusHandlerResult dbusMessageHandler(const CDBusMessage &message)
DBus message handler.
bool getTaxiLightsOn() const
Get whether taxi lights are on.
double getPitchRadPerSec() const
Get aircraft angular velocity in radians per second.
double getSpeedBrakeRatio() const
Get the ratio how much the speedbrakes surfaces are extended (0.0 is fully retracted,...
double getHeadingRadPerSec() const
Get aircraft angular velocity in radians per second.
double getPitchDeg() const
Get aircraft pitch in degrees above horizon.
void onAircraftModelChanged()
Called by XPluginReceiveMessage when the model changes.
int getTransponderCode() const
Get the current transponder code in decimal.
double getGearDeployRatio() const
Get gear deploy ratio, where 0 is up and 1 is down.
double getLocalYVelocityMps() const
Get aircraft local velocity in world coordinates meters per second.
bool getTransponderIdent() const
Get whether we are currently squawking ident.
int getCom1StandbyKhz() const
Get the current COM1 standby frequency in kHz.
static std::string getVersionNumber()
Returns the xswiftbus version number.
static int getXPlaneVersionMajor()
Get major version number.
static std::string getXPlaneInstallationPath()
Get root of X-Plane install path.
void setOwnCallsign(const std::string &callsign)
Set the current own callsign.
bool getAnyWheelOnGround() const
Get whether any wheel is on the ground.
void setTransponderMode(int mode)
Set the current transponder mode (depends on the aircraft, 0 and 1 usually mean standby,...
void setCom1StandbyKhz(int freq)
Set the current COM1 standby frequency in kHz.
bool getLandingLightsOn() const
Get whether landing lights are on.
std::vector< double > getEngineN1Percentage() const
Get the N1 speed as percent of max (per engine).
bool isCom1Receiving() const
Is COM1 receiving?
void onSceneryLoaded()
Called by XPluginReceiveMessage when some scenery is loaded.
double getHeightAglM() const
Get aircraft height in meters.
std::string getAircraftDescription() const
Get the description of the current aircraft model.
void setTransponderCode(int code)
Set the current transponder code in decimal.
void setDisappearMessageWindowTimeMs(int durationMs)
Enable/disable message window disappearing after x ms.
double getIndicatedAirspeedKias() const
Get aircraft IAS in knots.
void setCom2ActiveKhz(int freq)
Set the current COM2 active frequency in kHz.
double getLocalXVelocityMps() const
Get aircraft local velocity in world coordinates meters per second.
bool getBeaconLightsOn() const
Get whether beacon lights are on.
int process()
Perform generic processing.
double getPressureAltitudeFt() const
Get aircraft pressure altitude in feet in standard atmosphere in X-Plane 12. NaN in earlier versions ...
bool getStrobeLightsOn() const
Get whether strobe lights are on.
void addTextMessage(const std::string &text, double red, double green, double blue)
Add a text message to the on-screen display, with RGB components in the range [0,1].
double getLatitudeDeg() const
Get aircraft latitude in degrees.
int getCom2ActiveKhz() const
Get the current COM2 active frequency in kHz.
bool isCom2Transmitting() const
Is COM2 transmitting?
static std::string getAircraftModelFilename()
Get base filename of current aircraft model.
double getTrueHeadingDeg() const
Get aircraft true heading in degrees.
static std::string getXPlanePreferencesPath()
Get full path to X-Plane preferences file.
std::string getAircraftLivery() const
Get current aircraft livery.
double getQNHInHg() const
Get barometric pressure at sea level in inches of mercury.
static std::string getAircraftModelString()
Get canonical swift model string of current aircraft model.
void setCom1ActiveKhz(int freq)
Set the current COM1 active frequency in kHz.
void setCom2StandbyKhz(int freq)
Set the current COM2 standby frequency in kHz.
int getTransponderMode() const
Get the current transponder mode (depends on the aircraft, 0 and 1 usually mean standby,...
int getNumberOfEngines() const
Get the number of engines of current aircraft.
std::string getSettingsJson() const
Get settings in JSON format.
bool isUsingRealTime() const
True if sim time is tracking operating system time.
double getGroundElevation() const
Get elevation of ground under the plane in meters.
static std::string getAircraftName()
Get name of current aircraft model.
void setSettingsJson(const std::string &jsonString)
Set settings.
bool getAllWheelsOnGround() const
Get whether all wheels are on the ground.
bool getNavLightsOn() const
Get whether nav lights are on.
void setSettings(const CSettings &settings)
Set settings.
CSettings getSettings() const
Get settings.
bool writeConfig(bool tcas, bool debug)
Write a config file with these new values.
xswiftbus/swift side settings class, JSON capable, shared among all services
Something owning the settings.
std::vector< int > getMessageBoxValuesVector() const
Left, top, right, bottom, lines, duration, color(freq, priv, serv, stat, sup).
bool isLogRenderPhases() const
Debug messages?
bool isTcasEnabled() const
TCAS functionality?
std::string convertToString() const
Convert to string.
std::string toXSwiftBusJsonString() const
As JSON string.
bool parseXSwiftBusString(const std::string &json)
Load and parse config file.
Plugin loaded by X-Plane which publishes a DBus service.
T::const_iterator begin(const LockFreeReader< T > &reader)
Non-member begin() and end() for so LockFree containers can be used in ranged for loops.
T::const_iterator end(const LockFreeReader< T > &reader)
Non-member begin() and end() for so LockFree containers can be used in ranged for loops.
AcfProperties extractAcfProperties(const std::string &filePath)
Extract ACF properties from an aircraft file.
std::string getFileName(const std::string &filePath)
Get filename (including all extensions) from a filePath.
decltype(Private::empty_u8string()) string
String type.
std::string modelString
Generated model string.
std::string modelName
Model name.
Encoding-aware iterator adaptor for std::u8string.
#define INFO_LOG(msg)
Logger convenience macros.
#define WARNING_LOG(msg)
Logger convenience macros.