4 #ifndef SWIFT_MISC_SIMULATION_SETTINGS_CXSWIFTBUSSETTINGSQTFREE_H
5 #define SWIFT_MISC_SIMULATION_SETTINGS_CXSWIFTBUSSETTINGSQTFREE_H
12 namespace swift::misc::simulation::settings
63 int freqRgb,
int privRgb,
int servRgb,
int statRgb,
int supRgb)
65 if (topPx >= 0) { bottomPx = -1; }
66 if (lines < 3) { lines = 3; }
68 std::to_string(leftPx) +
";" + std::to_string(topPx) +
";" + std::to_string(rightPx) +
";" +
69 std::to_string(bottomPx) +
";" + std::to_string(lines) +
";" + std::to_string(durationMs) +
";" +
70 std::to_string(freqRgb) +
";" + std::to_string(privRgb) +
";" + std::to_string(servRgb) +
";" +
71 std::to_string(statRgb) +
";" + std::to_string(supRgb));
80 constexpr
int partCount = 11;
81 std::vector<int> partsInt = { 20, 20, 20, -1, 5, 5000, 0x00ff00, 0xff00ff, 0xda70d6, 0x00ffff, 0xffff00 };
82 const std::vector<std::string> parts = xplane::qtfreeutils::split(
m_msgBox, partCount,
";");
85 for (
const std::string &p : parts)
87 const int i = std::stoi(p);
121 if (xplane::qtfreeutils::isFuzzyEqual(nauticalMiles,
m_maxDrawDistanceNM)) {
return false; }
159 using namespace std::chrono;
160 const milliseconds ms = duration_cast<milliseconds>(system_clock::now().time_since_epoch());
186 "tcp:host=127.0.0.1,port=45001"
190 "20;20;20;-1;5;5000;65280;16711935;14315734;65535;16776960"
xswiftbus/swift side settings class, JSON capable, shared among all services
static constexpr char JsonBundleTaxiLandingLights[]
The JSON members.
bool isDrawingLabels() const
Get whether the plugin draws type and callsign labels above aircraft.
static constexpr char JsonTerrainProbe[]
The JSON members.
int update(const CXSwiftBusSettingsQtFree &newValues)
Update only changed values.
void setBundlingTaxiAndLandingLights(bool bundle)
Bundle taxi and landing lights.
std::vector< int > getMessageBoxValuesVector() const
Left, top, right, bottom, lines, duration, color(freq, priv, serv, stat, sup)
int getLabelColor() const
Get the color to draw the callsign labels above aircraft.
bool setMaxPlanes(int planes)
Set the maximum number of aircraft.
int m_followAircraftDistanceM
follow aircraft in distance
static constexpr char JsonTcas[]
The JSON members.
const std::string & getMessageBoxValues() const
Left, top, right, bottom, lines, duration, color(freq, priv, serv, stat, sup)
double getMaxDrawDistanceNM() const
Set the maximum distance at which to draw aircraft (nautical miles).
void setTerrainProbeEnabled(bool enabled)
Terrain probe to query ground elevation enabled?
virtual ~CXSwiftBusSettingsQtFree()
Destructor.
void setDrawingLabels(bool drawing)
Set whether the plugin draws type and callsign labels above aircraft.
bool isTerrainProbeEnabled() const
Terrain probe to query ground elevation enabled?
static constexpr char JsonTimestamp[]
The JSON members.
CXSwiftBusSettingsQtFree()
Constructor.
static constexpr char JsonMaxPlanes[]
The JSON members.
int64_t m_msSinceEpochQtFree
timestamp
static constexpr char JsonLogRenderPhases[]
The JSON members.
static constexpr char JsonLabelColor[]
The JSON members.
virtual void objectUpdated()=0
Object has been updated.
bool isLogRenderPhases() const
Debug messages?
static constexpr char JsonMessageBox[]
The JSON members.
int m_labelColor
labels in XPlane
void setDBusServerAddress(const std::string &dBusServer)
Set DBus server.
static constexpr char JsonFollowAircraftDistanceM[]
The JSON members.
int getFollowAircraftDistanceM() const
Get follow aircraft distance.
void setTcasEnabled(bool tcas)
TCAS functionality?
void setLogRenderPhases(bool log)
Debug messages?
bool isBundlingTaxiAndLandingLights() const
Bundle taxi and landing lights.
std::string m_dBusServerAddress
DBus server (also in class CXSwiftBusConfigWriter)
static constexpr char JsonDBusServerAddress[]
The JSON members.
bool isTcasEnabled() const
TCAS functionality?
std::string m_nightTextureMode
night texture mode
std::string m_msgBox
left, top, right, bottom, lines, duration, colors
bool m_bundleTaxiLandingLights
bundle taxi and landing lights
const std::string & getDBusServerAddress() const
DBus server.
bool m_logRenderPhases
render phases debug messages
bool m_tcasEnabled
TCAS functionality.
void setNightTextureMode(const std::string &mode)
The the night texture mode.
std::string convertToString() const
Convert to string.
static constexpr char JsonNightTextureMode[]
The JSON members.
bool setMaxDrawDistanceNM(double nauticalMiles)
Set the maximum distance at which to draw aircraft (nautical miles).
static constexpr char JsonDrawingLabels[]
The JSON members.
bool m_terrainProbeEnabled
terrain probe to establish ground elevation
void setMessageBoxValues(int leftPx, int topPx, int rightPx, int bottomPx, int lines, int durationMs, int freqRgb, int privRgb, int servRgb, int statRgb, int supRgb)
Left, top, right, bottom, lines, duration, color(freq, priv, serv, stat, sup)
virtual void setCurrentUtcTime()
Sets timestamp to now.
int getMaxPlanes() const
Get the maximum number of aircraft.
double m_maxDrawDistanceNM
distance in XPlane
void setMessageBoxValues(const std::string &positions)
Left, top, right, bottom, lines, duration, color(freq, priv, serv, stat, sup)
std::string toXSwiftBusJsonString() const
As JSON string.
bool setFollowAircraftDistanceM(int meters)
Set follow aircraft distance.
static constexpr char JsonMaxDrawDistance[]
The JSON members.
bool parseXSwiftBusString(const std::string &json)
Load and parse config file.
void setLabelColor(int rgb)
Set the color to draw the callsign labels above aircraft.
const std::string & getNightTextureMode() const
The the night texture mode.
bool m_drawingLabels
labels in XPlane