mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 05:28:09 +08:00
[XSwiftBus] Add getVersionNumber to DBus API
This allows to get the version number of XSwiftBus itself. It maintains the same version as swift (e.g. 0.8.7 without the time stamp) and can be used to compare it for compatibility reasons. ref T394
This commit is contained in:
committed by
Klaus Basan
parent
e959075a56
commit
55c2e2e559
@@ -1,5 +1,8 @@
|
||||
R"(<node>
|
||||
<interface name="org.swift_project.xswiftbus.service">
|
||||
<method name="getVersionNumber">
|
||||
<arg type="s" direction="out"/>
|
||||
</method>
|
||||
<method name="addTextMessage">
|
||||
<arg name="text" type="s" direction="in"/>
|
||||
<arg name="red" type="d" direction="in"/>
|
||||
|
||||
@@ -207,7 +207,14 @@ namespace XSwiftBus
|
||||
}
|
||||
else if (message.getInterfaceName() == XSWIFTBUS_SERVICE_INTERFACENAME)
|
||||
{
|
||||
if (message.getMethodName() == "addTextMessage")
|
||||
if (message.getMethodName() == "getVersionNumber")
|
||||
{
|
||||
queueDBusCall([ = ]()
|
||||
{
|
||||
sendDBusReply(sender, serial, getVersionNumber());
|
||||
});
|
||||
}
|
||||
else if (message.getMethodName() == "addTextMessage")
|
||||
{
|
||||
maybeSendEmptyDBusReply(wantsReply, sender, serial);
|
||||
std::string text;
|
||||
|
||||
@@ -61,6 +61,9 @@ namespace XSwiftBus
|
||||
//! Called by XPluginReceiveMessage when the model changes.
|
||||
void onAircraftModelChanged();
|
||||
|
||||
//! Returns the XSwiftBus version number
|
||||
std::string getVersionNumber() const { return XSWIFTBUS_VERSION; }
|
||||
|
||||
//! Add a text message to the on-screen display, with RGB components in the range [0,1]
|
||||
void addTextMessage(const std::string &text, double red, double green, double blue);
|
||||
|
||||
|
||||
@@ -72,6 +72,8 @@ DEFINES += XPLM210=1
|
||||
DEFINES += XPMP_CLIENT_NAME=\\\"xswiftbus\\\"
|
||||
DEFINES += XPMP_CLIENT_LONGNAME=\\\"xswiftbus\\\"
|
||||
|
||||
DEFINES += XSWIFTBUS_VERSION=\\\"$${BLACK_VERSION}\\\"
|
||||
|
||||
# X-Plane plugins must follow a prescribed filename and directory structure.
|
||||
TARGET_EXT = .xpl
|
||||
win32:TARGET = win
|
||||
|
||||
Reference in New Issue
Block a user