| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#pragma once |
| 9 |
|
| 10 |
|
| 11 |
#include "dbusobject.h" |
| 12 |
#include <Main/fg_props.hxx> |
| 13 |
#include <chrono> |
| 14 |
#include <simgear/compiler.h> |
| 15 |
#include <simgear/debug/logstream.hxx> |
| 16 |
#include <simgear/io/raw_socket.hxx> |
| 17 |
#include <simgear/misc/stdint.hxx> |
| 18 |
#include <simgear/props/props.hxx> |
| 19 |
#include <simgear/structure/commands.hxx> |
| 20 |
#include <simgear/structure/event_mgr.hxx> |
| 21 |
#include <simgear/structure/subsystem_mgr.hxx> |
| 22 |
#include <simgear/timing/timestamp.hxx> |
| 23 |
#include <string> |
| 24 |
|
| 25 |
|
| 26 |
namespace flightgear::swift { |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
class CService : public CDBusObject |
| 32 |
{ |
| 33 |
public: |
| 34 |
|
| 35 |
CService(); |
| 36 |
|
| 37 |
|
| 38 |
static const std::string& InterfaceName(); |
| 39 |
|
| 40 |
|
| 41 |
static const std::string& ObjectPath(); |
| 42 |
|
| 43 |
|
| 44 |
static int getVersionNumber(); |
| 45 |
|
| 46 |
|
| 47 |
void addTextMessage(const std::string& text); |
| 48 |
|
| 49 |
|
| 50 |
std::string getAircraftModelPath() const; |
| 51 |
|
| 52 |
|
| 53 |
std::string getAircraftModelFilename() const; |
| 54 |
|
| 55 |
|
| 56 |
std::string getAircraftModelString() const; |
| 57 |
|
| 58 |
|
| 59 |
std::string getAircraftName() const; |
| 60 |
|
| 61 |
|
| 62 |
std::string getAircraftLivery() const; |
| 63 |
|
| 64 |
|
| 65 |
std::string getAircraftIcaoCode() const; |
| 66 |
|
| 67 |
|
| 68 |
std::string getAircraftDescription() const; |
| 69 |
|
| 70 |
|
| 71 |
bool isPaused() const; |
| 72 |
|
| 73 |
|
| 74 |
double getLatitude() const; |
| 75 |
|
| 76 |
|
| 77 |
double getLongitude() const; |
| 78 |
|
| 79 |
|
| 80 |
double getAltitudeMSL() const; |
| 81 |
|
| 82 |
|
| 83 |
double getHeightAGL() const; |
| 84 |
|
| 85 |
|
| 86 |
double getGroundSpeed() const; |
| 87 |
|
| 88 |
|
| 89 |
double getPitch() const; |
| 90 |
|
| 91 |
|
| 92 |
double getRoll() const; |
| 93 |
|
| 94 |
|
| 95 |
double getTrueHeading() const; |
| 96 |
|
| 97 |
|
| 98 |
bool getAllWheelsOnGround() const; |
| 99 |
|
| 100 |
|
| 101 |
int getCom1Active() const; |
| 102 |
|
| 103 |
|
| 104 |
int getCom1Standby() const; |
| 105 |
|
| 106 |
|
| 107 |
int getCom2Active() const; |
| 108 |
|
| 109 |
|
| 110 |
int getCom2Standby() const; |
| 111 |
|
| 112 |
|
| 113 |
int getTransponderCode() const; |
| 114 |
|
| 115 |
|
| 116 |
int getTransponderMode() const; |
| 117 |
|
| 118 |
|
| 119 |
bool getTransponderIdent() const; |
| 120 |
|
| 121 |
|
| 122 |
bool getBeaconLightsOn() const; |
| 123 |
|
| 124 |
|
| 125 |
bool getLandingLightsOn() const; |
| 126 |
|
| 127 |
|
| 128 |
bool getNavLightsOn() const; |
| 129 |
|
| 130 |
|
| 131 |
bool getStrobeLightsOn() const; |
| 132 |
|
| 133 |
|
| 134 |
bool getTaxiLightsOn() const; |
| 135 |
|
| 136 |
|
| 137 |
double getPressAlt() const; |
| 138 |
|
| 139 |
|
| 140 |
void setCom1Active(int freq); |
| 141 |
|
| 142 |
|
| 143 |
void setCom1Standby(int freq); |
| 144 |
|
| 145 |
|
| 146 |
void setCom2Active(int freq); |
| 147 |
|
| 148 |
|
| 149 |
void setCom2Standby(int freq); |
| 150 |
|
| 151 |
|
| 152 |
void setTransponderCode(int code); |
| 153 |
|
| 154 |
|
| 155 |
void setTransponderMode(int mode); |
| 156 |
|
| 157 |
|
| 158 |
double getFlapsDeployRatio() const; |
| 159 |
|
| 160 |
|
| 161 |
double getGearDeployRatio() const; |
| 162 |
|
| 163 |
|
| 164 |
int getNumberOfEngines() const; |
| 165 |
|
| 166 |
|
| 167 |
std::vector<double> getEngineN1Percentage() const; |
| 168 |
|
| 169 |
|
| 170 |
double getSpeedBrakeRatio() const; |
| 171 |
|
| 172 |
|
| 173 |
double getGroundElevation() const; |
| 174 |
|
| 175 |
|
| 176 |
double getVelocityX() const; |
| 177 |
|
| 178 |
|
| 179 |
double getVelocityY() const; |
| 180 |
|
| 181 |
|
| 182 |
double getVelocityZ() const; |
| 183 |
|
| 184 |
|
| 185 |
double getRollRate() const; |
| 186 |
|
| 187 |
|
| 188 |
double getPitchRate() const; |
| 189 |
|
| 190 |
|
| 191 |
double getYawRate() const; |
| 192 |
|
| 193 |
double getCom1Volume() const; |
| 194 |
double getCom2Volume() const; |
| 195 |
|
| 196 |
|
| 197 |
int process(); |
| 198 |
|
| 199 |
protected: |
| 200 |
DBusHandlerResult dbusMessageHandler(const CDBusMessage& message) override; |
| 201 |
|
| 202 |
private: |
| 203 |
SGPropertyNode_ptr m_textMessageNode; |
| 204 |
SGPropertyNode_ptr m_aircraftModelPathNode; |
| 205 |
|
| 206 |
|
| 207 |
SGPropertyNode_ptr m_aircraftDescriptionNode; |
| 208 |
SGPropertyNode_ptr m_isPausedNode; |
| 209 |
SGPropertyNode_ptr m_latitudeNode; |
| 210 |
SGPropertyNode_ptr m_longitudeNode; |
| 211 |
SGPropertyNode_ptr m_altitudeMSLNode; |
| 212 |
SGPropertyNode_ptr m_heightAGLNode; |
| 213 |
SGPropertyNode_ptr m_groundSpeedNode; |
| 214 |
SGPropertyNode_ptr m_pitchNode; |
| 215 |
SGPropertyNode_ptr m_rollNode; |
| 216 |
SGPropertyNode_ptr m_trueHeadingNode; |
| 217 |
SGPropertyNode_ptr m_wheelsOnGroundNode; |
| 218 |
SGPropertyNode_ptr m_com1ActiveNode; |
| 219 |
SGPropertyNode_ptr m_com1StandbyNode; |
| 220 |
SGPropertyNode_ptr m_com2ActiveNode; |
| 221 |
SGPropertyNode_ptr m_com2StandbyNode; |
| 222 |
SGPropertyNode_ptr m_transponderCodeNode; |
| 223 |
SGPropertyNode_ptr m_transponderModeNode; |
| 224 |
SGPropertyNode_ptr m_transponderIdentNode; |
| 225 |
SGPropertyNode_ptr m_beaconLightsNode; |
| 226 |
SGPropertyNode_ptr m_landingLightsNode; |
| 227 |
SGPropertyNode_ptr m_navLightsNode; |
| 228 |
SGPropertyNode_ptr m_strobeLightsNode; |
| 229 |
SGPropertyNode_ptr m_taxiLightsNode; |
| 230 |
SGPropertyNode_ptr m_altimeterServiceableNode; |
| 231 |
SGPropertyNode_ptr m_pressAltitudeFtNode; |
| 232 |
SGPropertyNode_ptr m_flapsDeployRatioNode; |
| 233 |
SGPropertyNode_ptr m_gearDeployRatioNode; |
| 234 |
SGPropertyNode_ptr m_speedBrakeDeployRatioNode; |
| 235 |
SGPropertyNode_ptr m_groundElevationNode; |
| 236 |
|
| 237 |
|
| 238 |
SGPropertyNode_ptr m_aircraftNameNode; |
| 239 |
SGPropertyNode_ptr m_velocityXNode; |
| 240 |
SGPropertyNode_ptr m_velocityYNode; |
| 241 |
SGPropertyNode_ptr m_velocityZNode; |
| 242 |
SGPropertyNode_ptr m_rollRateNode; |
| 243 |
SGPropertyNode_ptr m_pichRateNode; |
| 244 |
SGPropertyNode_ptr m_yawRateNode; |
| 245 |
SGPropertyNode_ptr m_com1VolumeNode; |
| 246 |
SGPropertyNode_ptr m_com2VolumeNode; |
| 247 |
}; |
| 248 |
} |