From ba217fed57f848cb7dd5ffb864ae6be6f2f95df9 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 31 May 2014 02:05:35 +0200 Subject: [PATCH] refs #242, fixed slot logging --- samples/blackcore/tool.cpp | 2 +- src/blackcore/context_ownaircraft_impl.cpp | 15 ++++++++++++++- src/blackcore/context_ownaircraft_impl.h | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/samples/blackcore/tool.cpp b/samples/blackcore/tool.cpp index 07a42b387..54160e0d1 100644 --- a/samples/blackcore/tool.cpp +++ b/samples/blackcore/tool.cpp @@ -132,7 +132,7 @@ namespace BlackMiscTest if (line.startsWith("app")) runtime->slotLogForApplication(enable); else if (line.startsWith("aud")) runtime->slotLogForAudio(enable); else if (line.startsWith("net")) runtime->slotLogForNetwork(enable); - else if (line.startsWith("own")) runtime->signalLogForOwnAircraft(enable); + else if (line.startsWith("own")) runtime->slotLogForOwnAircraft(enable); else if (line.startsWith("set")) runtime->slotLogForSettings(enable); else if (line.startsWith("sim")) runtime->slotLogForSimulator(enable); else if (line.startsWith("all")) runtime->slotLog(enable); diff --git a/src/blackcore/context_ownaircraft_impl.cpp b/src/blackcore/context_ownaircraft_impl.cpp index eb8480963..60f40f592 100644 --- a/src/blackcore/context_ownaircraft_impl.cpp +++ b/src/blackcore/context_ownaircraft_impl.cpp @@ -119,7 +119,7 @@ namespace BlackCore */ bool CContextOwnAircraft::updateOwnPosition(const BlackMisc::Geo::CCoordinateGeodetic &position, const BlackMisc::Aviation::CAltitude &altitude, const QString &originator) { - if (this->getRuntime()->isSlotLogForOwnAircraftEnabled()) this->getRuntime()->logSlot(Q_FUNC_INFO, position.toQString(), altitude.toQString()); + if (this->getRuntime()->isSlotLogForOwnAircraftEnabled()) this->getRuntime()->logSlot(Q_FUNC_INFO, position.toQString(), altitude.toQString(), originator); bool changed = (this->m_ownAircraft.getPosition() == position); if (changed) this->m_ownAircraft.setPosition(position); @@ -179,6 +179,8 @@ namespace BlackCore void CContextOwnAircraft::setAudioOutputVolumes(int outputVolumeCom1, int outputVolumeCom2) { + if (this->getRuntime()->isSlotLogForOwnAircraftEnabled()) this->getRuntime()->logSlot(Q_FUNC_INFO, QString::number(outputVolumeCom1), QString::number(outputVolumeCom2)); + CComSystem com1 = this->m_ownAircraft.getCom1System(); com1.setVolumeOutput(outputVolumeCom1); this->m_ownAircraft.setCom1System(com1); @@ -207,11 +209,22 @@ namespace BlackCore */ void CContextOwnAircraft::setAudioVoiceRoomOverrideUrls(const QString &voiceRoom1Url, const QString &voiceRoom2Url) { + if (this->getRuntime()->isSlotLogForOwnAircraftEnabled()) this->getRuntime()->logSlot(Q_FUNC_INFO, voiceRoom1Url, voiceRoom2Url); + this->m_voiceRoom1UrlOverride = voiceRoom1Url.trimmed(); this->m_voiceRoom2UrlOverride = voiceRoom2Url.trimmed(); this->resolveVoiceRooms(); } + /* + * Voice room resolution + */ + void CContextOwnAircraft::enableAutomaticVoiceRoomResolution(bool enable) + { + if (this->getRuntime()->isSlotLogForOwnAircraftEnabled()) this->getRuntime()->logSlot(Q_FUNC_INFO, enable); + this->m_automaticVoiceRoomResolution = enable; + } + /* * Own aircraft */ diff --git a/src/blackcore/context_ownaircraft_impl.h b/src/blackcore/context_ownaircraft_impl.h index 1e6e06706..1379a60ca 100644 --- a/src/blackcore/context_ownaircraft_impl.h +++ b/src/blackcore/context_ownaircraft_impl.h @@ -55,7 +55,7 @@ namespace BlackCore virtual void setAudioVoiceRoomOverrideUrls(const QString &voiceRoom1Url, const QString &voiceRoom2Url) override; //! \copydoc IContextOwnAircraft::enableAutomaticVoiceRoomResolution - virtual void enableAutomaticVoiceRoomResolution(bool enable) override { this->m_automaticVoiceRoomResolution = enable; } + virtual void enableAutomaticVoiceRoomResolution(bool enable) override; protected: //! Constructor, with link to runtime