mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
Implement followAircraft for X-Plane
ref T266
This commit is contained in:
committed by
Klaus Basan
parent
794137fc94
commit
33963041cc
@@ -393,6 +393,14 @@ namespace XSwiftBus
|
||||
}
|
||||
}
|
||||
|
||||
void CTraffic::setFollowedAircraft(const std::string &callsign)
|
||||
{
|
||||
auto planeIt = m_planesByCallsign.find(callsign);
|
||||
if (planeIt == m_planesByCallsign.end()) { return; }
|
||||
|
||||
orbitRemotePlane(callsign);
|
||||
}
|
||||
|
||||
const char *introspection_traffic =
|
||||
DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE
|
||||
#include "org.swift_project.xswiftbus.traffic.xml"
|
||||
@@ -655,6 +663,17 @@ namespace XSwiftBus
|
||||
; sendDBusMessage(reply);
|
||||
});
|
||||
}
|
||||
else if (message.getMethodName() == "setFollowedAircraft")
|
||||
{
|
||||
maybeSendEmptyDBusReply(wantsReply, sender, serial);
|
||||
std::string callsign;
|
||||
message.beginArgumentRead();
|
||||
message.getArgument(callsign);
|
||||
queueDBusCall([ = ]()
|
||||
{
|
||||
setFollowedAircraft(callsign);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unknown message. Tell DBus that we cannot handle it
|
||||
|
||||
Reference in New Issue
Block a user