mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 02:45:33 +08:00
Issue #17 Fix aircraft labels setting not being updated in xswiftbus
Also related tidying up.
This commit is contained in:
@@ -34,6 +34,7 @@ namespace XSwiftBus
|
||||
//! Register the draw callback.
|
||||
void show()
|
||||
{
|
||||
if (m_visible) { return; }
|
||||
m_visible = true;
|
||||
XPLMRegisterDrawCallback(callback, m_phase, m_before, static_cast<void*>(this));
|
||||
}
|
||||
@@ -41,6 +42,7 @@ namespace XSwiftBus
|
||||
//! Unregister the draw callback.
|
||||
void hide()
|
||||
{
|
||||
if (!m_visible) { return; }
|
||||
m_visible = false;
|
||||
XPLMUnregisterDrawCallback(callback, m_phase, m_before, static_cast<void*>(this));
|
||||
}
|
||||
|
||||
@@ -36,10 +36,12 @@ namespace XSwiftBus
|
||||
public:
|
||||
//! Get settings
|
||||
//! \threadsafe
|
||||
//! \fixme Does this really need to be threadsafe?
|
||||
CSettings getSettings() const;
|
||||
|
||||
//! Set settings
|
||||
//! \threadsafe
|
||||
//! \fixme Does this really need to be threadsafe?
|
||||
void setSettings(const CSettings &settings);
|
||||
|
||||
//! Get settings from xswiftbus.conf (needed during plugin initialization)
|
||||
|
||||
@@ -605,24 +605,6 @@ namespace XSwiftBus
|
||||
setDefaultIcao(defaultIcao);
|
||||
});
|
||||
}
|
||||
else if (message.getMethodName() == "setDrawingLabels")
|
||||
{
|
||||
maybeSendEmptyDBusReply(wantsReply, sender, serial);
|
||||
bool drawing = true;
|
||||
message.beginArgumentRead();
|
||||
message.getArgument(drawing);
|
||||
queueDBusCall([ = ]()
|
||||
{
|
||||
setDrawingLabels(drawing);
|
||||
});
|
||||
}
|
||||
else if (message.getMethodName() == "isDrawingLabels")
|
||||
{
|
||||
queueDBusCall([ = ]()
|
||||
{
|
||||
sendDBusReply(sender, serial, isDrawingLabels());
|
||||
});
|
||||
}
|
||||
else if (message.getMethodName() == "setMaxPlanes")
|
||||
{
|
||||
maybeSendEmptyDBusReply(wantsReply, sender, serial);
|
||||
@@ -844,6 +826,7 @@ namespace XSwiftBus
|
||||
{
|
||||
invokeQueuedDBusCalls();
|
||||
doPlaneUpdates();
|
||||
setDrawingLabels(getSettings().isDrawingLabels());
|
||||
emitSimFrame();
|
||||
m_countFrame++;
|
||||
return 1;
|
||||
@@ -876,7 +859,6 @@ namespace XSwiftBus
|
||||
void CTraffic::interpolatePosition(Plane *plane)
|
||||
{
|
||||
std::memcpy(&plane->positions[3], &plane->positions[2], sizeof(plane->positions[2]));
|
||||
return;
|
||||
|
||||
const auto now = std::chrono::steady_clock::now();
|
||||
const auto t1 = plane->positionTimes[2] - plane->positionTimes[0];
|
||||
|
||||
Reference in New Issue
Block a user