FlightGear next
service.cpp
Go to the documentation of this file.
1/*
2 * Service module for swift<->FG connection
3 * SPDX-FileCopyrightText: (C) 2019-2022 swift Project Community / Contributors (https://swift-project.org/)
4 * SPDX-FileCopyrightText: (C) 2019-2022 Lars Toenning <dev@ltoenning.de>
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
8#include "service.h"
9#include <Main/fg_props.hxx>
10#include <iostream>
11#include <simgear/constants.h>
12#include <simgear/debug/logstream.hxx>
13#include <simgear/structure/commands.hxx>
14
15#define FGSWIFTBUS_API_VERSION 3;
16
17namespace flightgear::swift {
18
19static const std::string k_fgswiftbus_service_interfacename = "org.swift_project.fgswiftbus.service";
20static const std::string k_fgswiftbus_service_objectpath = "/fgswiftbus/service";
21
23{
24 // Initialize node pointers
25 m_textMessageNode = fgGetNode("/sim/messages/copilot", true);
26 m_aircraftModelPathNode = fgGetNode("/sim/aircraft-dir", true);
27 m_aircraftDescriptionNode = fgGetNode("/sim/description", true);
28 m_isPausedNode = fgGetNode("/sim/freeze/master", true);
29 m_latitudeNode = fgGetNode("/position/latitude-deg", true);
30 m_longitudeNode = fgGetNode("/position/longitude-deg", true);
31 m_altitudeMSLNode = fgGetNode("/position/altitude-ft", true);
32 m_heightAGLNode = fgGetNode("/position/altitude-agl-ft", true);
33 m_groundSpeedNode = fgGetNode("/velocities/groundspeed-kt", true);
34 m_pitchNode = fgGetNode("/orientation/pitch-deg", true);
35 m_rollNode = fgGetNode("/orientation/roll-deg", true);
36 m_trueHeadingNode = fgGetNode("/orientation/heading-deg", true);
37 m_wheelsOnGroundNode = fgGetNode("/gear/gear/wow", true);
38 m_com1ActiveNode = fgGetNode("/instrumentation/comm/frequencies/selected-mhz", true);
39 m_com1StandbyNode = fgGetNode("/instrumentation/comm/frequencies/standby-mhz", true);
40 m_com2ActiveNode = fgGetNode("/instrumentation/comm[1]/frequencies/selected-mhz", true);
41 m_com2StandbyNode = fgGetNode("/instrumentation/comm[1]/frequencies/standby-mhz", true);
42 m_transponderCodeNode = fgGetNode("/instrumentation/transponder/id-code", true);
43 m_transponderModeNode = fgGetNode("/instrumentation/transponder/inputs/knob-mode", true);
44 m_transponderIdentNode = fgGetNode("/instrumentation/transponder/ident", true);
45 m_beaconLightsNode = fgGetNode("/controls/lighting/beacon", true);
46 m_landingLightsNode = fgGetNode("/controls/lighting/landing-lights", true);
47 m_navLightsNode = fgGetNode("/controls/lighting/nav-lights", true);
48 m_strobeLightsNode = fgGetNode("/controls/lighting/strobe", true);
49 m_taxiLightsNode = fgGetNode("/controls/lighting/taxi-light", true);
50 m_altimeterServiceableNode = fgGetNode("/instrumentation/altimeter/serviceable", true);
51 m_pressAltitudeFtNode = fgGetNode("/instrumentation/altimeter/pressure-alt-ft", true);
52 m_flapsDeployRatioNode = fgGetNode("/surface-positions/flap-pos-norm", true);
53 m_gearDeployRatioNode = fgGetNode("/gear/gear/position-norm", true);
54 m_speedBrakeDeployRatioNode = fgGetNode("/surface-positions/speedbrake-pos-norm", true);
55 m_aircraftNameNode = fgGetNode("/sim/aircraft", true);
56 m_groundElevationNode = fgGetNode("/position/ground-elev-m", true);
57 m_velocityXNode = fgGetNode("/velocities/speed-east-fps", true);
58 m_velocityYNode = fgGetNode("/velocities/speed-down-fps", true);
59 m_velocityZNode = fgGetNode("/velocities/speed-north-fps", true);
60 m_rollRateNode = fgGetNode("/orientation/roll-rate-degps", true);
61 m_pichRateNode = fgGetNode("/orientation/pitch-rate-degps", true);
62 m_yawRateNode = fgGetNode("/orientation/yaw-rate-degps", true);
63 m_com1VolumeNode = fgGetNode("/instrumentation/comm/volume", true);
64 m_com2VolumeNode = fgGetNode("/instrumentation/comm[1]/volume", true);
65
66 SG_LOG(SG_NETWORK, SG_INFO, "FGSwiftBus Service initialized");
67}
68
69const std::string& CService::InterfaceName()
70{
72}
73
74const std::string& CService::ObjectPath()
75{
77}
78
79// Static method
84
85void CService::addTextMessage(const std::string& text)
86{
87 if (text.empty()) { return; }
88 m_textMessageNode->setStringValue(text);
89}
90
92{
93 return m_aircraftModelPathNode->getStringValue();
94}
95
96std::string CService::getAircraftLivery() const
97{
98 return "";
99}
100
102{
103 return "";
104}
105
107{
108 return m_aircraftDescriptionNode->getStringValue();
109}
110
112{
113 return m_isPausedNode->getBoolValue();
114}
115
117{
118 return m_latitudeNode->getDoubleValue();
119}
120
122{
123 return m_longitudeNode->getDoubleValue();
124}
125
127{
128 return m_altitudeMSLNode->getDoubleValue();
129}
130
132{
133 return m_heightAGLNode->getDoubleValue();
134}
135
137{
138 return m_groundSpeedNode->getDoubleValue();
139}
140
141double CService::getPitch() const
142{
143 return m_pitchNode->getDoubleValue();
144}
145
146double CService::getRoll() const
147{
148 return m_rollNode->getDoubleValue();
149}
150
152{
153 return m_trueHeadingNode->getDoubleValue();
154}
155
157{
158 return m_wheelsOnGroundNode->getBoolValue();
159}
160
162{
163 return (int)(m_com1ActiveNode->getDoubleValue() * 1000);
164}
165
167{
168 return (int)(m_com1StandbyNode->getDoubleValue() * 1000);
169}
170
172{
173 return (int)(m_com2ActiveNode->getDoubleValue() * 1000);
174}
175
177{
178 return (int)(m_com2StandbyNode->getDoubleValue() * 1000);
179}
180
182{
183 return m_transponderCodeNode->getIntValue();
184}
185
187{
188 return m_transponderModeNode->getIntValue();
189}
190
192{
193 return m_transponderIdentNode->getBoolValue();
194}
195
197{
198 return m_beaconLightsNode->getBoolValue();
199}
200
202{
203 return m_landingLightsNode->getBoolValue();
204}
205
207{
208 return m_navLightsNode->getBoolValue();
209}
210
211
213{
214 return m_strobeLightsNode->getBoolValue();
215}
216
218{
219 return m_taxiLightsNode->getBoolValue();
220}
221
223{
224 if (m_altimeterServiceableNode->getBoolValue()) {
225 return m_pressAltitudeFtNode->getDoubleValue();
226 } else {
227 return m_altitudeMSLNode->getDoubleValue();
228 }
229}
230
232{
233 m_com1ActiveNode->setDoubleValue(freq / (double)1000);
234}
235
237{
238 m_com1StandbyNode->setDoubleValue(freq / (double)1000);
239}
240
242{
243 m_com2ActiveNode->setDoubleValue(freq / (double)1000);
244}
245
247{
248 m_com2StandbyNode->setDoubleValue(freq / (double)1000);
249}
250
252{
253 m_transponderCodeNode->setIntValue(code);
254}
255
257{
258 m_transponderModeNode->setIntValue(mode);
259}
260
262{
263 return m_flapsDeployRatioNode->getFloatValue();
264}
265
267{
268 return m_gearDeployRatioNode->getFloatValue();
269}
270
272{
273 // TODO Use correct property
274 return 2;
275}
276
277std::vector<double> CService::getEngineN1Percentage() const
278{
279 // TODO use correct engine numbers
280 std::vector<double> list;
281 const auto number = static_cast<unsigned int>(getNumberOfEngines());
282 list.reserve(number);
283 for (unsigned int engineNumber = 0; engineNumber < number; ++engineNumber) {
284 list.push_back(fgGetDouble("/engine/engine/n1"));
285 }
286 return list;
287}
288
290{
291 return m_speedBrakeDeployRatioNode->getFloatValue();
292}
293
295{
296 return m_groundElevationNode->getDoubleValue();
297}
298
300{
301 std::string modelFileName = getAircraftName();
302 modelFileName.append("-set.xml");
303 return modelFileName;
304}
305
307{
308 std::string modelName = getAircraftName();
309 std::string modelString = "FG " + modelName;
310 return modelString;
311}
312
313std::string CService::getAircraftName() const
314{
315 return m_aircraftNameNode->getStringValue();
316}
317
319{
320 return m_velocityXNode->getDoubleValue() * SG_FEET_TO_METER;
321}
322
324{
325 return m_velocityYNode->getDoubleValue() * SG_FEET_TO_METER * -1; // + (up), - (down)
326}
327
329{
330 return m_velocityZNode->getDoubleValue() * SG_FEET_TO_METER;
331}
332
334{
335 return m_rollRateNode->getDoubleValue() * SG_DEGREES_TO_RADIANS;
336}
338{
339 return m_pichRateNode->getDoubleValue() * SG_DEGREES_TO_RADIANS;
340}
341
343{
344 return m_yawRateNode->getDoubleValue() * SG_DEGREES_TO_RADIANS;
345}
346
348{
349 return m_com1VolumeNode->getDoubleValue();
350}
351
353{
354 return m_com2VolumeNode->getDoubleValue();
355}
356
357
358static const char* introspection_service = DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE;
359
360DBusHandlerResult CService::dbusMessageHandler(const CDBusMessage& message_)
361{
362 CDBusMessage message(message_);
363 const std::string sender = message.getSender();
364 const dbus_uint32_t serial = message.getSerial();
365 const bool wantsReply = message.wantsReply();
366
367 if (message.getInterfaceName() == DBUS_INTERFACE_INTROSPECTABLE) {
368 if (message.getMethodName() == "Introspect") {
369 sendDBusReply(sender, serial, introspection_service);
370 }
372 if (message.getMethodName() == "addTextMessage") {
373 maybeSendEmptyDBusReply(wantsReply, sender, serial);
374 std::string text;
375 message.beginArgumentRead();
376 message.getArgument(text);
377
378 queueDBusCall([=]() {
379 addTextMessage(text);
380 });
381 } else if (message.getMethodName() == "getOwnAircraftSituationData") {
382 queueDBusCall([=]() {
383 double lat = getLatitude();
384 double lon = getLongitude();
385 double alt = getAltitudeMSL();
386 double gs = getGroundSpeed();
387 double pitch = getPitch();
388 double roll = getRoll();
389 double trueHeading = getTrueHeading();
390 double pressAlt = getPressAlt();
391 CDBusMessage reply = CDBusMessage::createReply(sender, serial);
392 reply.beginArgumentWrite();
393 reply.appendArgument(lat);
394 reply.appendArgument(lon);
395 reply.appendArgument(alt);
396 reply.appendArgument(gs);
397 reply.appendArgument(pitch);
398 reply.appendArgument(roll);
399 reply.appendArgument(trueHeading);
400 reply.appendArgument(pressAlt);
401 sendDBusMessage(reply);
402 });
403 } else if (message.getMethodName() == "getOwnAircraftVelocityData") {
404 queueDBusCall([=]() {
405 double velocityX = getVelocityX();
406 double velocityY = getVelocityY();
407 double velocityZ = getVelocityZ();
408 double pitchVelocity = getPitchRate();
409 double rollVelocity = getRollRate();
410 double yawVelocity = getYawRate();
411 CDBusMessage reply = CDBusMessage::createReply(sender, serial);
412 reply.beginArgumentWrite();
413 reply.appendArgument(velocityX);
414 reply.appendArgument(velocityY);
415 reply.appendArgument(velocityZ);
416 reply.appendArgument(pitchVelocity);
417 reply.appendArgument(rollVelocity);
418 reply.appendArgument(yawVelocity);
419 sendDBusMessage(reply);
420 });
421 } else if (message.getMethodName() == "getVersionNumber") {
422 queueDBusCall([=]() {
423 sendDBusReply(sender, serial, getVersionNumber());
424 });
425 } else if (message.getMethodName() == "getAircraftModelPath") {
426 queueDBusCall([=]() {
427 sendDBusReply(sender, serial, getAircraftModelPath());
428 });
429 } else if (message.getMethodName() == "getAircraftModelFilename") {
430 queueDBusCall([=]() {
431 sendDBusReply(sender, serial, getAircraftModelFilename());
432 });
433 } else if (message.getMethodName() == "getAircraftModelString") {
434 queueDBusCall([=]() {
435 sendDBusReply(sender, serial, getAircraftModelString());
436 });
437 } else if (message.getMethodName() == "getAircraftName") {
438 queueDBusCall([=]() {
439 sendDBusReply(sender, serial, getAircraftName());
440 });
441 } else if (message.getMethodName() == "getAircraftLivery") {
442 queueDBusCall([=]() {
443 sendDBusReply(sender, serial, getAircraftLivery());
444 });
445 } else if (message.getMethodName() == "getAircraftIcaoCode") {
446 queueDBusCall([=]() {
447 sendDBusReply(sender, serial, getAircraftIcaoCode());
448 });
449 } else if (message.getMethodName() == "getAircraftDescription") {
450 queueDBusCall([=]() {
451 sendDBusReply(sender, serial, getAircraftDescription());
452 });
453 } else if (message.getMethodName() == "isPaused") {
454 queueDBusCall([=]() {
455 sendDBusReply(sender, serial, isPaused());
456 });
457 } else if (message.getMethodName() == "getLatitudeDeg") {
458 queueDBusCall([=]() {
459 sendDBusReply(sender, serial, getLatitude());
460 });
461 } else if (message.getMethodName() == "getLongitudeDeg") {
462 queueDBusCall([=]() {
463 sendDBusReply(sender, serial, getLongitude());
464 });
465 } else if (message.getMethodName() == "getAltitudeMslFt") {
466 queueDBusCall([=]() {
467 sendDBusReply(sender, serial, getAltitudeMSL());
468 });
469 } else if (message.getMethodName() == "getHeightAglFt") {
470 queueDBusCall([=]() {
471 sendDBusReply(sender, serial, getHeightAGL());
472 });
473 } else if (message.getMethodName() == "getGroundSpeedKts") {
474 queueDBusCall([=]() {
475 sendDBusReply(sender, serial, getGroundSpeed());
476 });
477 } else if (message.getMethodName() == "getPitchDeg") {
478 queueDBusCall([=]() {
479 sendDBusReply(sender, serial, getPitch());
480 });
481 } else if (message.getMethodName() == "getRollDeg") {
482 queueDBusCall([=]() {
483 sendDBusReply(sender, serial, getRoll());
484 });
485 } else if (message.getMethodName() == "getAllWheelsOnGround") {
486 queueDBusCall([=]() {
487 sendDBusReply(sender, serial, getAllWheelsOnGround());
488 });
489 } else if (message.getMethodName() == "getCom1ActiveKhz") {
490 queueDBusCall([=]() {
491 sendDBusReply(sender, serial, getCom1Active());
492 });
493 } else if (message.getMethodName() == "getCom1StandbyKhz") {
494 queueDBusCall([=]() {
495 sendDBusReply(sender, serial, getCom1Standby());
496 });
497 } else if (message.getMethodName() == "getCom2ActiveKhz") {
498 queueDBusCall([=]() {
499 sendDBusReply(sender, serial, getCom2Active());
500 });
501 } else if (message.getMethodName() == "getCom2StandbyKhz") {
502 queueDBusCall([=]() {
503 sendDBusReply(sender, serial, getCom2Standby());
504 });
505 } else if (message.getMethodName() == "getTransponderCode") {
506 queueDBusCall([=]() {
507 sendDBusReply(sender, serial, getTransponderCode());
508 });
509 } else if (message.getMethodName() == "getTransponderMode") {
510 queueDBusCall([=]() {
511 sendDBusReply(sender, serial, getTransponderMode());
512 });
513 } else if (message.getMethodName() == "getTransponderIdent") {
514 queueDBusCall([=]() {
515 sendDBusReply(sender, serial, getTransponderIdent());
516 });
517 } else if (message.getMethodName() == "getBeaconLightsOn") {
518 queueDBusCall([=]() {
519 sendDBusReply(sender, serial, getBeaconLightsOn());
520 });
521 } else if (message.getMethodName() == "getLandingLightsOn") {
522 queueDBusCall([=]() {
523 sendDBusReply(sender, serial, getLandingLightsOn());
524 });
525 } else if (message.getMethodName() == "getNavLightsOn") {
526 queueDBusCall([=]() {
527 sendDBusReply(sender, serial, getNavLightsOn());
528 });
529 } else if (message.getMethodName() == "getStrobeLightsOn") {
530 queueDBusCall([=]() {
531 sendDBusReply(sender, serial, getStrobeLightsOn());
532 });
533 } else if (message.getMethodName() == "getTaxiLightsOn") {
534 queueDBusCall([=]() {
535 sendDBusReply(sender, serial, getTaxiLightsOn());
536 });
537 } else if (message.getMethodName() == "getPressAlt") {
538 queueDBusCall([=]() {
539 sendDBusReply(sender, serial, getPressAlt());
540 });
541 } else if (message.getMethodName() == "getGroundElevation") {
542 queueDBusCall([=]() {
543 sendDBusReply(sender, serial, getGroundElevation());
544 });
545 } else if (message.getMethodName() == "setCom1ActiveKhz") {
546 maybeSendEmptyDBusReply(wantsReply, sender, serial);
547 int frequency = 0;
548 message.beginArgumentRead();
549 message.getArgument(frequency);
550 queueDBusCall([=]() {
551 setCom1Active(frequency);
552 });
553 } else if (message.getMethodName() == "setCom1StandbyKhz") {
554 maybeSendEmptyDBusReply(wantsReply, sender, serial);
555 int frequency = 0;
556 message.beginArgumentRead();
557 message.getArgument(frequency);
558 queueDBusCall([=]() {
559 setCom1Standby(frequency);
560 });
561 } else if (message.getMethodName() == "setCom2ActiveKhz") {
562 maybeSendEmptyDBusReply(wantsReply, sender, serial);
563 int frequency = 0;
564 message.beginArgumentRead();
565 message.getArgument(frequency);
566 queueDBusCall([=]() {
567 setCom2Active(frequency);
568 });
569 } else if (message.getMethodName() == "setCom2StandbyKhz") {
570 maybeSendEmptyDBusReply(wantsReply, sender, serial);
571 int frequency = 0;
572 message.beginArgumentRead();
573 message.getArgument(frequency);
574 queueDBusCall([=]() {
575 setCom2Standby(frequency);
576 });
577 } else if (message.getMethodName() == "setTransponderCode") {
578 maybeSendEmptyDBusReply(wantsReply, sender, serial);
579 int code = 0;
580 message.beginArgumentRead();
581 message.getArgument(code);
582 queueDBusCall([=]() {
583 setTransponderCode(code);
584 });
585 } else if (message.getMethodName() == "setTransponderMode") {
586 maybeSendEmptyDBusReply(wantsReply, sender, serial);
587 int mode = 0;
588 message.beginArgumentRead();
589 message.getArgument(mode);
590 queueDBusCall([=]() {
591 setTransponderMode(mode);
592 });
593 } else if (message.getMethodName() == "getFlapsDeployRatio") {
594 queueDBusCall([=]() {
595 sendDBusReply(sender, serial, getFlapsDeployRatio());
596 });
597 } else if (message.getMethodName() == "getGearDeployRatio") {
598 queueDBusCall([=]() {
599 sendDBusReply(sender, serial, getGearDeployRatio());
600 });
601 } else if (message.getMethodName() == "getEngineN1Percentage") {
602 queueDBusCall([=]() {
603 std::vector<double> array = getEngineN1Percentage();
604 sendDBusReply(sender, serial, array);
605 });
606 } else if (message.getMethodName() == "getSpeedBrakeRatio") {
607 queueDBusCall([=]() {
608 sendDBusReply(sender, serial, getSpeedBrakeRatio());
609 });
610 } else if (message.getMethodName() == "getCom1Volume") {
611 queueDBusCall([=]() {
612 sendDBusReply(sender, serial, getCom1Volume());
613 });
614 } else if (message.getMethodName() == "getCom2Volume") {
615 queueDBusCall([=]() {
616 sendDBusReply(sender, serial, getCom2Volume());
617 });
618 } else {
619 // Unknown message. Tell DBus that we cannot handle it
620 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
621 }
622 }
623 return DBUS_HANDLER_RESULT_HANDLED;
624}
625
626
628{
630
631 return 1;
632}
633
634} // namespace flightgear::swift
void appendArgument(bool value)
Append argument.
static CDBusMessage createReply(const std::string &destination, dbus_uint32_t serial)
Creates a DBus message containing a DBus reply.
std::string getSender() const
Get the message sender.
dbus_uint32_t getSerial() const
Get the message serial. This is usally required for reply message.
std::string getMethodName() const
Get the called method name.
std::string getInterfaceName() const
Get the called interface name.
bool wantsReply() const
Does this message want a reply?
void getArgument(int &value)
Read single argument.
void beginArgumentRead()
Begin reading arguments.
void beginArgumentWrite()
Begin writing argument.
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.
Definition dbusobject.h:53
void maybeSendEmptyDBusReply(bool wantsReply, const std::string &destination, dbus_uint32_t serial)
Maybe sends an empty DBus reply (acknowledgement)
void queueDBusCall(const std::function< void()> &func)
Queue a DBus call to be executed in a different thread.
std::string getAircraftIcaoCode() const
Get the ICAO code of the current aircraft model.
Definition service.cpp:101
std::string getAircraftLivery() const
Definition service.cpp:96
void setCom1Standby(int freq)
Set the current COM1 standby frequency in kHz.
Definition service.cpp:236
double getHeightAGL() const
Get aircraft height in feet.
Definition service.cpp:131
double getFlapsDeployRatio() const
Get flaps deploy ratio, where 0.0 is flaps fully retracted, and 1.0 is flaps fully extended.
Definition service.cpp:261
void setCom2Active(int freq)
Set the current COM2 active frequency in kHz.
Definition service.cpp:241
void setCom2Standby(int freq)
Set the current COM2 standby frequency in kHz.
Definition service.cpp:246
double getPressAlt() const
Get pressure altitude in ft.
Definition service.cpp:222
double getVelocityX() const
Get x velocity in m/s.
Definition service.cpp:318
double getAltitudeMSL() const
Get aircraft altitude in feet.
Definition service.cpp:126
void setTransponderCode(int code)
Definition service.cpp:251
bool getBeaconLightsOn() const
Get whether beacon lights are on.
Definition service.cpp:196
double getGroundSpeed() const
Get aircraft groundspeed in knots.
Definition service.cpp:136
void setTransponderMode(int mode)
Definition service.cpp:256
double getGroundElevation() const
Get ground elevation at aircraft current position.
Definition service.cpp:294
bool getStrobeLightsOn() const
Get whether strobe lights are on.
Definition service.cpp:212
double getPitch() const
Get aircraft pitch in degrees above horizon.
Definition service.cpp:141
bool getLandingLightsOn() const
Get whether landing lights are on.
Definition service.cpp:201
static const std::string & ObjectPath()
DBus object path.
Definition service.cpp:74
double getVelocityY() const
Get y velocity in m/s.
Definition service.cpp:323
DBusHandlerResult dbusMessageHandler(const CDBusMessage &message) override
DBus message handler.
Definition service.cpp:360
bool getTaxiLightsOn() const
Get whether taxi lights are on.
Definition service.cpp:217
std::string getAircraftModelFilename() const
Definition service.cpp:299
std::string getAircraftDescription() const
Definition service.cpp:106
std::string getAircraftModelPath() const
Definition service.cpp:91
void setCom1Active(int freq)
Set the current COM1 active frequency in kHz.
Definition service.cpp:231
int process()
Perform generic processing.
Definition service.cpp:627
int getTransponderMode() const
Get the current transponder mode (depends on the aircraft, 0-2 usually mean standby,...
Definition service.cpp:186
double getSpeedBrakeRatio() const
Get the ratio how much the speedbrakes surfaces are extended (0.0 is fully retracted,...
Definition service.cpp:289
int getCom2Active() const
Get the current COM2 active frequency in kHz.
Definition service.cpp:171
double getRollRate() const
Get roll rate in rad/sec.
Definition service.cpp:333
double getPitchRate() const
Get pitch rate in rad/sec.
Definition service.cpp:337
int getCom2Standby() const
Get the current COM2 standby frequency in kHz.
Definition service.cpp:176
int getTransponderCode() const
Get the current transponder code in decimal.
Definition service.cpp:181
static int getVersionNumber()
Getting flightgear version.
Definition service.cpp:80
std::vector< double > getEngineN1Percentage() const
Get the N1 speed as percent of max (per engine)
Definition service.cpp:277
double getTrueHeading() const
Get aircraft true heading in degrees.
Definition service.cpp:151
double getLatitude() const
Get aircraft latitude in degrees.
Definition service.cpp:116
double getVelocityZ() const
Get z velocity in m/s.
Definition service.cpp:328
std::string getAircraftModelString() const
Definition service.cpp:306
bool getAllWheelsOnGround() const
Get whether all wheels are on the ground.
Definition service.cpp:156
double getGearDeployRatio() const
Get gear deploy ratio, where 0 is up and 1 is down.
Definition service.cpp:266
bool isPaused() const
True if sim is paused.
Definition service.cpp:111
double getLongitude() const
Get aircraft longitude in degrees.
Definition service.cpp:121
double getYawRate() const
Get yaw rate in rad/sec.
Definition service.cpp:342
int getNumberOfEngines() const
Get the number of engines of current aircraft.
Definition service.cpp:271
int getCom1Active() const
Get the current COM1 active frequency in kHz.
Definition service.cpp:161
bool getNavLightsOn() const
Get whether nav lights are on.
Definition service.cpp:206
bool getTransponderIdent() const
Get whether we are currently squawking ident.
Definition service.cpp:191
double getCom2Volume() const
Definition service.cpp:352
double getRoll() const
Get aircraft roll in degrees.
Definition service.cpp:146
void addTextMessage(const std::string &text)
Definition service.cpp:85
int getCom1Standby() const
Get the current COM1 standby frequency in kHz.
Definition service.cpp:166
std::string getAircraftName() const
Definition service.cpp:313
static const std::string & InterfaceName()
DBus interface name.
Definition service.cpp:69
double getCom1Volume() const
Definition service.cpp:347
static const char * introspection_service
Definition service.cpp:358
static const std::string k_fgswiftbus_service_interfacename
Definition service.cpp:19
static const std::string k_fgswiftbus_service_objectpath
Definition service.cpp:20
double fgGetDouble(const char *name, double defaultValue)
Get a double value for a property.
Definition proptest.cpp:30
SGPropertyNode * fgGetNode(const char *path, bool create)
Get a property node.
Definition proptest.cpp:27
#define FGSWIFTBUS_API_VERSION
Definition service.cpp:15