mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
refs #316 Changed blackcore to use CLogMessage to emit messages.
Also changed functions which always returned CStatusMessageList containing a single CStatusMessage, to return CStatusMessage instead for simplicity.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "context_audio.h"
|
||||
#include "context_runtime.h"
|
||||
#include "context_settings.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::PhysicalQuantities;
|
||||
@@ -70,7 +71,7 @@ namespace BlackCore
|
||||
*/
|
||||
void CContextOwnAircraft::resolveVoiceRooms()
|
||||
{
|
||||
this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO);
|
||||
CLogMessage().debug(this) << Q_FUNC_INFO;
|
||||
if (this->m_voiceRoom1UrlOverride.isEmpty() && this->m_voiceRoom2UrlOverride.isEmpty() && !this->m_automaticVoiceRoomResolution) return;
|
||||
if (!this->getIContextNetwork()) return; // no chance to resolve rooms
|
||||
if (!this->getIContextAudio()) return; // no place to set rooms
|
||||
@@ -93,7 +94,7 @@ namespace BlackCore
|
||||
*/
|
||||
void CContextOwnAircraft::updateOwnAircraft(const BlackMisc::Aviation::CAircraft &aircraft, const QString &originator)
|
||||
{
|
||||
this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO, { ownAircraft().toQString(), originator });
|
||||
CLogMessage().debug(this) << Q_FUNC_INFO << ownAircraft() << originator;
|
||||
|
||||
// trigger the correct signals
|
||||
bool changedCockpit = this->updateOwnCockpit(aircraft.getCom1System(), aircraft.getCom2System(), aircraft.getTransponder(), originator);
|
||||
@@ -120,7 +121,7 @@ namespace BlackCore
|
||||
*/
|
||||
bool CContextOwnAircraft::updateOwnPosition(const BlackMisc::Geo::CCoordinateGeodetic &position, const BlackMisc::Aviation::CAltitude &altitude, const QString &originator)
|
||||
{
|
||||
this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO, { position.toQString(), altitude.toQString(), originator });
|
||||
CLogMessage().debug(this) << Q_FUNC_INFO << position << altitude << originator;
|
||||
bool changed = (this->m_ownAircraft.getPosition() != position);
|
||||
if (changed) this->m_ownAircraft.setPosition(position);
|
||||
|
||||
@@ -143,7 +144,7 @@ namespace BlackCore
|
||||
*/
|
||||
bool CContextOwnAircraft::updateOwnSituation(const BlackMisc::Aviation::CAircraftSituation &situation, const QString &originator)
|
||||
{
|
||||
this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO, situation.toQString());
|
||||
CLogMessage().debug(this) << Q_FUNC_INFO << situation;
|
||||
bool changed = this->m_ownAircraft.getSituation() != situation;
|
||||
if (!changed) return changed;
|
||||
|
||||
@@ -161,7 +162,7 @@ namespace BlackCore
|
||||
*/
|
||||
bool CContextOwnAircraft::updateOwnCockpit(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2, const BlackMisc::Aviation::CTransponder &transponder, const QString &originator)
|
||||
{
|
||||
this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO, { com1.toQString(), com2.toQString(), transponder.toQString() });
|
||||
CLogMessage().debug(this) << Q_FUNC_INFO << com1 << com2 << transponder;
|
||||
bool changed = this->m_ownAircraft.hasChangedCockpitData(com1, com2, transponder);
|
||||
if (changed)
|
||||
{
|
||||
@@ -183,7 +184,7 @@ namespace BlackCore
|
||||
|
||||
void CContextOwnAircraft::setAudioOutputVolumes(int outputVolumeCom1, int outputVolumeCom2)
|
||||
{
|
||||
this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO, { QString::number(outputVolumeCom1), QString::number(outputVolumeCom2) });
|
||||
CLogMessage().debug(this) << Q_FUNC_INFO << outputVolumeCom1 << outputVolumeCom2;
|
||||
|
||||
CComSystem com1 = this->m_ownAircraft.getCom1System();
|
||||
com1.setVolumeOutput(outputVolumeCom1);
|
||||
@@ -213,7 +214,7 @@ namespace BlackCore
|
||||
*/
|
||||
void CContextOwnAircraft::setAudioVoiceRoomOverrideUrls(const QString &voiceRoom1Url, const QString &voiceRoom2Url)
|
||||
{
|
||||
this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO, { voiceRoom1Url, voiceRoom2Url });
|
||||
CLogMessage().debug(this) << Q_FUNC_INFO << voiceRoom1Url << voiceRoom2Url;
|
||||
|
||||
this->m_voiceRoom1UrlOverride = voiceRoom1Url.trimmed();
|
||||
this->m_voiceRoom2UrlOverride = voiceRoom2Url.trimmed();
|
||||
@@ -225,7 +226,7 @@ namespace BlackCore
|
||||
*/
|
||||
void CContextOwnAircraft::enableAutomaticVoiceRoomResolution(bool enable)
|
||||
{
|
||||
this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO, enable);
|
||||
CLogMessage().debug(this) << Q_FUNC_INFO << enable;
|
||||
this->m_automaticVoiceRoomResolution = enable;
|
||||
}
|
||||
|
||||
@@ -234,7 +235,7 @@ namespace BlackCore
|
||||
*/
|
||||
CAircraft CContextOwnAircraft::getOwnAircraft() const
|
||||
{
|
||||
this->getRuntime()->logSlot(c_logContext, Q_FUNC_INFO, this->m_ownAircraft.toQString());
|
||||
CLogMessage().debug(this) << Q_FUNC_INFO << this->m_ownAircraft;
|
||||
return this->m_ownAircraft;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user