From 78e49002435686519ba797e308aa33878293a355 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Tue, 2 Dec 2014 17:25:58 +0100 Subject: [PATCH] refs #349, housekeeping * formatting * tweaks (such as changing to new log style), * Doxygen * int instead of qint --- src/blackcore/context_ownaircraft_impl.cpp | 2 +- src/blackcore/simulator.cpp | 2 +- .../components/cockpitcomcomponent.cpp | 6 +- src/blackgui/dockwidget.h | 4 +- src/blackmisc/aviotransponder.h | 2 +- .../fs9/blacksimplugin_freefunctions.cpp | 7 +- .../fs9/blacksimplugin_freefunctions.h | 11 +- src/plugins/simulator/fs9/directplay_peer.cpp | 102 +++++++++--------- src/plugins/simulator/fs9/fs9_client.cpp | 2 +- src/plugins/simulator/fscommon/fsuipc.cpp | 16 +-- src/plugins/simulator/fscommon/fsuipc.h | 3 + .../fsx/simconnect_datadefinition.cpp | 12 ++- .../simulator/fsx/simconnect_object.cpp | 12 ++- src/plugins/simulator/fsx/simulator_fsx.cpp | 9 +- .../fsx/simulator_fsx_simconnectproc.cpp | 20 ++-- src/swiftgui_standard/swiftguistd.h | 4 +- 16 files changed, 120 insertions(+), 94 deletions(-) diff --git a/src/blackcore/context_ownaircraft_impl.cpp b/src/blackcore/context_ownaircraft_impl.cpp index 926933f11..b8634b014 100644 --- a/src/blackcore/context_ownaircraft_impl.cpp +++ b/src/blackcore/context_ownaircraft_impl.cpp @@ -64,7 +64,7 @@ namespace BlackCore // TODO: This would need to come from somewhere (mappings) // Own callsign, plane ICAO status, model used - this->m_ownAircraft.setCallsign(CCallsign("BLACK")); + this->m_ownAircraft.setCallsign(CCallsign("SWIFT")); this->m_ownAircraft.setIcaoInfo(CAircraftIcao("C172", "L1P", "GA", "GA", "0000ff")); // voice rooms diff --git a/src/blackcore/simulator.cpp b/src/blackcore/simulator.cpp index aedc01338..fe9e21aac 100644 --- a/src/blackcore/simulator.cpp +++ b/src/blackcore/simulator.cpp @@ -18,4 +18,4 @@ namespace BlackCore { emit simulatorStatusChanged(isConnected(), isRunning(), isPaused()); } -} +} // namespace diff --git a/src/blackgui/components/cockpitcomcomponent.cpp b/src/blackgui/components/cockpitcomcomponent.cpp index 057e419b5..9425601da 100644 --- a/src/blackgui/components/cockpitcomcomponent.cpp +++ b/src/blackgui/components/cockpitcomcomponent.cpp @@ -127,9 +127,11 @@ namespace BlackGui this->updateFrequencyDisplaysFromComSystems(com1, com2); // update transponder - qint32 tc = transponder.getTransponderCode(); - if (tc != static_cast(this->ui->sbp_ComPanelTransponder->value())) + int tc = transponder.getTransponderCode(); + if (tc != this->ui->sbp_ComPanelTransponder->value()) + { this->ui->sbp_ComPanelTransponder->setValue(tc); + } this->ui->cbp_ComPanelTransponderMode->setSelectedTransponderMode(transponder.getTransponderMode()); diff --git a/src/blackgui/dockwidget.h b/src/blackgui/dockwidget.h index 19aa96ea7..8755c6af7 100644 --- a/src/blackgui/dockwidget.h +++ b/src/blackgui/dockwidget.h @@ -121,10 +121,10 @@ namespace BlackGui //! \copydoc QWidget::paintEvent virtual void paintEvent(QPaintEvent *event) override; - //! \copy QMainWindow::mouseMoveEvent + //! \copydoc QMainWindow::mouseMoveEvent virtual void mouseMoveEvent(QMouseEvent *event) override { if (!handleMouseMoveEvent(event)) { QDockWidget::mouseMoveEvent(event); } ; } - //! \copy QMainWindow::mousePressEvent + //! \copydoc QMainWindow::mousePressEvent virtual void mousePressEvent(QMouseEvent *event) override { if (!handleMousePressEvent(event)) { QDockWidget::mousePressEvent(event); } } //! Contribute to menu diff --git a/src/blackmisc/aviotransponder.h b/src/blackmisc/aviotransponder.h index ac5ccd3be..cfd44034a 100644 --- a/src/blackmisc/aviotransponder.h +++ b/src/blackmisc/aviotransponder.h @@ -116,7 +116,7 @@ namespace BlackMisc QString getTransponderCodeAndModeFormatted() const; //! Set transponder code - void setTransponderCode(qint32 transponderCode) { this->m_transponderCode = transponderCode; } + void setTransponderCode(int transponderCode) { this->m_transponderCode = transponderCode; } //! Set transponder code void setTransponderCode(const QString &transponderCode); diff --git a/src/plugins/simulator/fs9/blacksimplugin_freefunctions.cpp b/src/plugins/simulator/fs9/blacksimplugin_freefunctions.cpp index 3ca171c59..f1121b0aa 100644 --- a/src/plugins/simulator/fs9/blacksimplugin_freefunctions.cpp +++ b/src/plugins/simulator/fs9/blacksimplugin_freefunctions.cpp @@ -81,7 +81,7 @@ namespace BlackSimPlugin return situation; } - MPPositionVelocity aircraftSituationtoFS9(const CAircraftSituation &oldSituation, const CAircraftSituation &newSituation, double updateInterval) + MPPositionVelocity aircraftSituationToFS9(const CAircraftSituation &oldSituation, const CAircraftSituation &newSituation, double updateInterval) { MPPositionVelocity positionVelocity; @@ -137,7 +137,7 @@ namespace BlackSimPlugin return positionVelocity; } - MPPositionSlewMode aircraftSituationtoFS9(const CAircraftSituation &situation) + MPPositionSlewMode aircraftSituationToFS9(const CAircraftSituation &situation) { MPPositionSlewMode positionSlewMode; @@ -208,7 +208,8 @@ namespace BlackSimPlugin break; } - BlackMisc::CLogMessage().error(errorMessage); + errorMessage = "DirectPlay: " + errorMessage; + BlackMisc::CLogMessage("swift.fs9.freefunctions").error(errorMessage); return error; } diff --git a/src/plugins/simulator/fs9/blacksimplugin_freefunctions.h b/src/plugins/simulator/fs9/blacksimplugin_freefunctions.h index 142f00a46..05bf53052 100644 --- a/src/plugins/simulator/fs9/blacksimplugin_freefunctions.h +++ b/src/plugins/simulator/fs9/blacksimplugin_freefunctions.h @@ -7,6 +7,8 @@ * contained in the LICENSE file. */ +//! \file + #ifndef BLACKSIMPLUGIN_FREEFUNCTIONS_H #define BLACKSIMPLUGIN_FREEFUNCTIONS_H @@ -51,18 +53,17 @@ namespace BlackSimPlugin BlackMisc::Aviation::CAircraftSituation aircraftSituationfromFS9(const MPPositionVelocity &positionVelocity); //! Convert an aircraft situation to a FS9 struct - MPPositionVelocity aircraftSituationtoFS9(const BlackMisc::Aviation::CAircraftSituation &oldSituation, + MPPositionVelocity aircraftSituationToFS9(const BlackMisc::Aviation::CAircraftSituation &oldSituation, const BlackMisc::Aviation::CAircraftSituation &newSituation, double updateInterval); //! Convert an aircraft situation to a FS9 struct - MPPositionSlewMode aircraftSituationtoFS9(const BlackMisc::Aviation::CAircraftSituation &situation); - + MPPositionSlewMode aircraftSituationToFS9(const BlackMisc::Aviation::CAircraftSituation &situation); + //! Print the direct play error HRESULT printDirectPlayError(HRESULT error); - } } -#endif //BLACKSIMPLUGIN_FREEFUNCTIONS_H +#endif // guard diff --git a/src/plugins/simulator/fs9/directplay_peer.cpp b/src/plugins/simulator/fs9/directplay_peer.cpp index c9a8e5ed2..c31919bc1 100644 --- a/src/plugins/simulator/fs9/directplay_peer.cpp +++ b/src/plugins/simulator/fs9/directplay_peer.cpp @@ -10,6 +10,7 @@ #include "directplay_peer.h" #include "multiplayer_packet_parser.h" #include "blacksimplugin_freefunctions.h" +#include "blackmisc/logmessage.h" #include #include #include @@ -17,6 +18,8 @@ #include #include +using namespace BlackMisc; + namespace BlackSimPlugin { namespace Fs9 @@ -48,36 +51,36 @@ namespace BlackSimPlugin switch (messageId) { - case DPN_MSGID_CREATE_PLAYER: + case DPN_MSGID_CREATE_PLAYER: { - DPNMSG_CREATE_PLAYER* pCreatePlayerMsg = static_cast(msgBuffer); + DPNMSG_CREATE_PLAYER *pCreatePlayerMsg = static_cast(msgBuffer); HRESULT hr; // Get the peer info and extract its name DWORD dwSize = 0; - DPN_PLAYER_INFO* pdpPlayerInfo = nullptr; + DPN_PLAYER_INFO *pdpPlayerInfo = nullptr; hr = DPNERR_CONNECTING; // GetPeerInfo might return DPNERR_CONNECTING when connecting, // so just keep calling it if it does - while( hr == DPNERR_CONNECTING ) - hr = m_directPlayPeer->GetPeerInfo( pCreatePlayerMsg->dpnidPlayer, pdpPlayerInfo, &dwSize, 0 ); + while (hr == DPNERR_CONNECTING) + hr = m_directPlayPeer->GetPeerInfo(pCreatePlayerMsg->dpnidPlayer, pdpPlayerInfo, &dwSize, 0); - if( hr == DPNERR_BUFFERTOOSMALL ) + if (hr == DPNERR_BUFFERTOOSMALL) { QScopedArrayPointer memPtr(new unsigned char[dwSize]); - pdpPlayerInfo = reinterpret_cast(memPtr.data()); - if( pdpPlayerInfo == nullptr) + pdpPlayerInfo = reinterpret_cast(memPtr.data()); + if (pdpPlayerInfo == nullptr) { break; } - ZeroMemory( pdpPlayerInfo, dwSize ); + ZeroMemory(pdpPlayerInfo, dwSize); pdpPlayerInfo->dwSize = sizeof(DPN_PLAYER_INFO); - hr = m_directPlayPeer->GetPeerInfo( pCreatePlayerMsg->dpnidPlayer, pdpPlayerInfo, &dwSize, 0 ); - if( SUCCEEDED(hr)) + hr = m_directPlayPeer->GetPeerInfo(pCreatePlayerMsg->dpnidPlayer, pdpPlayerInfo, &dwSize, 0); + if (SUCCEEDED(hr)) { if (pdpPlayerInfo->dwPlayerFlags & DPNPLAYER_LOCAL) m_playerLocal = pCreatePlayerMsg->dpnidPlayer; @@ -96,33 +99,33 @@ namespace BlackSimPlugin break; } - case DPN_MSGID_RECEIVE: + case DPN_MSGID_RECEIVE: { PDPNMSG_RECEIVE pReceiveMsg = static_cast(msgBuffer); // Proceeed only, if the sender is our local player if (pReceiveMsg->dpnidSender == m_playerUser) { - QByteArray messageData = QByteArray((char*)pReceiveMsg->pReceiveData, pReceiveMsg->dwReceiveDataSize); + QByteArray messageData = QByteArray((char *)pReceiveMsg->pReceiveData, pReceiveMsg->dwReceiveDataSize); emit customPacketReceived(messageData); } break; } - case DPN_MSGID_ENUM_HOSTS_RESPONSE: + case DPN_MSGID_ENUM_HOSTS_RESPONSE: { PDPNMSG_ENUM_HOSTS_RESPONSE enumHostsResponseMsg = static_cast(msgBuffer); const DPN_APPLICATION_DESC *applicationDescription = enumHostsResponseMsg->pApplicationDescription; QMutexLocker locker(&m_mutexHostList); - auto iterator = std::find_if(m_hostNodeList.begin(), m_hostNodeList.end(), [&] (const CHostNode &hostNode) + auto iterator = std::find_if(m_hostNodeList.begin(), m_hostNodeList.end(), [&](const CHostNode & hostNode) { return applicationDescription->guidInstance == hostNode.getApplicationDesc().guidInstance; }); - if(iterator == m_hostNodeList.end()) + if (iterator == m_hostNodeList.end()) { // This host session is not in the list then so insert it. @@ -130,7 +133,7 @@ namespace BlackSimPlugin HRESULT hr; // Copy the Host Address - if( FAILED( hr = enumHostsResponseMsg->pAddressSender->Duplicate( hostNode.getHostAddressPtr() ) ) ) + if (FAILED(hr = enumHostsResponseMsg->pAddressSender->Duplicate(hostNode.getHostAddressPtr()))) { qWarning() << "Failed to duplicate host address!"; return hr; @@ -169,25 +172,25 @@ namespace BlackSimPlugin CoInitializeEx(nullptr, COINIT_MULTITHREADED); // Create the IDirectPlay8Peer Object - if( FAILED( hr = CoCreateInstance(CLSID_DirectPlay8Peer, - nullptr, - CLSCTX_INPROC_SERVER, - IID_IDirectPlay8Peer, - reinterpret_cast(&m_directPlayPeer) ) ) ) + if (FAILED(hr = CoCreateInstance(CLSID_DirectPlay8Peer, + nullptr, + CLSCTX_INPROC_SERVER, + IID_IDirectPlay8Peer, + reinterpret_cast(&m_directPlayPeer)))) { qWarning() << "Failed to create DirectPlay8Peer object!"; return hr; } // Init DirectPlay - if( FAILED( hr = m_directPlayPeer->Initialize(&m_callbackWrapper, m_callbackWrapper.messageHandler, 0 ) ) ) + if (FAILED(hr = m_directPlayPeer->Initialize(&m_callbackWrapper, m_callbackWrapper.messageHandler, 0))) { qWarning() << "Failed to initialize directplay peer!"; return hr; } // Ensure that TCP/IP is a valid Service Provider - if( !isServiceProviderValid( &CLSID_DP8SP_TCPIP ) ) + if (!isServiceProviderValid(&CLSID_DP8SP_TCPIP)) { hr = E_FAIL; qWarning() << "Service provider is invalid!"; @@ -197,7 +200,7 @@ namespace BlackSimPlugin return hr; } - bool CDirectPlayPeer::isServiceProviderValid(const GUID* /*pGuidSP*/) + bool CDirectPlayPeer::isServiceProviderValid(const GUID * /*pGuidSP*/) { DWORD dwItems = 0; DWORD dwSize = 0; @@ -205,7 +208,7 @@ namespace BlackSimPlugin // The first call is to retrieve the size of the DPN_SERVICE_PROVIDER_INFO array HRESULT hr = m_directPlayPeer->EnumServiceProviders(&CLSID_DP8SP_TCPIP, nullptr, nullptr, &dwSize, &dwItems, 0); - if( hr != DPNERR_BUFFERTOOSMALL) + if (hr != DPNERR_BUFFERTOOSMALL) { qWarning() << "Failed to enumerate service providers!"; return false; @@ -214,18 +217,18 @@ namespace BlackSimPlugin // Allocating an array with new DPN_SERVICE_PROVIDER_INFO[items] does not work, because the struct has // several pointers in it. Hence EnumServiceProviders tells us how much memory it exactly needs. QScopedArrayPointer memPtr(new unsigned char[dwSize]); - DPN_SERVICE_PROVIDER_INFO* dpnSPInfo = reinterpret_cast(memPtr.data()); + DPN_SERVICE_PROVIDER_INFO *dpnSPInfo = reinterpret_cast(memPtr.data()); - if( FAILED( hr = m_directPlayPeer->EnumServiceProviders(&CLSID_DP8SP_TCPIP, nullptr, dpnSPInfo, &dwSize, &dwItems, 0 ) ) ) + if (FAILED(hr = m_directPlayPeer->EnumServiceProviders(&CLSID_DP8SP_TCPIP, nullptr, dpnSPInfo, &dwSize, &dwItems, 0))) { qWarning() << "Failed to enumerate service providers!"; return false; } // There are no items returned so the requested SP is not available - if( dwItems == 0) hr = E_FAIL; + if (dwItems == 0) hr = E_FAIL; - if( SUCCEEDED(hr) ) return true; + if (SUCCEEDED(hr)) return true; else return false; } @@ -234,17 +237,17 @@ namespace BlackSimPlugin HRESULT hr = S_OK; // Create our IDirectPlay8Address Device Address - if( FAILED( hr = CoCreateInstance( CLSID_DirectPlay8Address, nullptr, - CLSCTX_INPROC_SERVER, - IID_IDirectPlay8Address, - reinterpret_cast(&m_deviceAddress) ) ) ) + if (FAILED(hr = CoCreateInstance(CLSID_DirectPlay8Address, nullptr, + CLSCTX_INPROC_SERVER, + IID_IDirectPlay8Address, + reinterpret_cast(&m_deviceAddress)))) { qWarning() << "Failed to create DirectPlay8Address instance!"; return hr; } // Set the SP for our Device Address - if( FAILED( hr = m_deviceAddress->SetSP( &CLSID_DP8SP_TCPIP ) ) ) + if (FAILED(hr = m_deviceAddress->SetSP(&CLSID_DP8SP_TCPIP))) { qWarning() << "Failed to set SP!"; return hr; @@ -258,38 +261,37 @@ namespace BlackSimPlugin HRESULT hr = S_OK; // Create our IDirectPlay8Address Device Address - if( FAILED( hr = CoCreateInstance( CLSID_DirectPlay8Address, nullptr, - CLSCTX_INPROC_SERVER, - IID_IDirectPlay8Address, - reinterpret_cast(&m_deviceAddress) ) ) ) + if (FAILED(hr = CoCreateInstance(CLSID_DirectPlay8Address, nullptr, + CLSCTX_INPROC_SERVER, + IID_IDirectPlay8Address, + reinterpret_cast(&m_deviceAddress)))) return printDirectPlayError(hr); // Set the SP for our Device Address - if( FAILED( hr = m_deviceAddress->SetSP( &CLSID_DP8SP_TCPIP ) ) ) + if (FAILED(hr = m_deviceAddress->SetSP(&CLSID_DP8SP_TCPIP))) return printDirectPlayError(hr); return S_OK; } - HRESULT CDirectPlayPeer::sendMessage( const QByteArray &message) + HRESULT CDirectPlayPeer::sendMessage(const QByteArray &message) { HRESULT hr = S_OK; DPN_BUFFER_DESC dpBufferDesc; - if( ( dpBufferDesc.dwBufferSize = message.size() ) == 0 ) return S_FALSE; + if ((dpBufferDesc.dwBufferSize = message.size()) == 0) return S_FALSE; - dpBufferDesc.pBufferData = (BYTE*)message.data(); + dpBufferDesc.pBufferData = (BYTE *)message.data(); // If m_playerUser is non zero, send it only to him - if( FAILED( hr = m_directPlayPeer->SendTo( m_playerUser, - &dpBufferDesc, - 1, 0, - nullptr, nullptr, - DPNSEND_SYNC | DPNSEND_NOLOOPBACK ) ) ) + if (FAILED(hr = m_directPlayPeer->SendTo(m_playerUser, + &dpBufferDesc, + 1, 0, + nullptr, nullptr, + DPNSEND_SYNC | DPNSEND_NOLOOPBACK))) { - qWarning() << "Failed to send message!"; + CLogMessage(this).warning("DirectPlay: Failed to send message!"); } - return hr; } } diff --git a/src/plugins/simulator/fs9/fs9_client.cpp b/src/plugins/simulator/fs9/fs9_client.cpp index 7111de177..12aaba23b 100644 --- a/src/plugins/simulator/fs9/fs9_client.cpp +++ b/src/plugins/simulator/fs9/fs9_client.cpp @@ -85,7 +85,7 @@ namespace BlackSimPlugin if (m_interpolator.hasEnoughAircraftSituations()) { CAircraftSituation situation = m_interpolator.getCurrentSituation(); - MPPositionSlewMode positionSlewMode = aircraftSituationtoFS9(situation); + MPPositionSlewMode positionSlewMode = aircraftSituationToFS9(situation); QByteArray positionMessage; MultiPlayerPacketParser::writeType(positionMessage, CFs9Sdk::MULTIPLAYER_PACKET_ID_POSITION_SLEWMODE); diff --git a/src/plugins/simulator/fscommon/fsuipc.cpp b/src/plugins/simulator/fscommon/fsuipc.cpp index d963ce2a3..5cd5621da 100644 --- a/src/plugins/simulator/fscommon/fsuipc.cpp +++ b/src/plugins/simulator/fscommon/fsuipc.cpp @@ -14,12 +14,14 @@ #include "FSUIPC/FSUIPC_User.h" #include "blacksim/fscommon/bcdconversions.h" +#include "blackmisc/logmessage.h" #include #include #include using namespace BlackSim::FsCommon; using namespace BlackMisc::Aviation; +using namespace BlackMisc; using namespace BlackMisc::Network; using namespace BlackMisc::Geo; using namespace BlackMisc::PhysicalQuantities; @@ -58,16 +60,14 @@ namespace BlackSimPlugin .arg(QLatin1Char(48 + (0x0f & (FSUIPC_Version >> 16)))) .arg((FSUIPC_Version & 0xffff) ? "a" + (FSUIPC_Version & 0xff) - 1 : ""); this->m_fsuipcVersion = QString("FSUIPC %1 (%2)").arg(ver).arg(sim); - // KB_REMOVE: Remove this later - qDebug() << "FSUIPC connected" << this->m_fsuipcVersion; + CLogMessage(this).info("FSUIPC connected: %1") << this->m_fsuipcVersion; } else { this->m_connected = false; int index = static_cast(result); this->m_lastErrorMessage = CFsuipc::errorMessages().at(index); - // KB_REMOVE: Remove this later - qDebug() << "FSUIPC" << this->m_lastErrorMessage; + CLogMessage(this).info("FSUIPC not connected: %1") << this->m_lastErrorMessage; } return this->m_connected; } @@ -174,16 +174,18 @@ namespace BlackSimPlugin transponderCodeRaw = CBcdConversions::bcd2Dec(transponderCodeRaw); xpdr.setTransponderCode(transponderCodeRaw); // Mode by SB3 - if (xpdrIdentSb3Raw > 0) + if (xpdrIdentSb3Raw != 0) { - // TODO: Reset value + //! \todo Reset value for FSUIPC xpdr.setTransponderMode(CTransponder::StateIdent); + // qDebug() << "xpdr ident" << xpdrIdentSb3Raw; } else { xpdr.setTransponderMode( xpdrModeSb3Raw == 0 ? CTransponder::ModeC : CTransponder::StateStandby ); + // qDebug() << "xpdr mode" << xpdrModeSb3Raw; } this->m_aircraft.setCockpit(com1, com2, xpdr); @@ -213,8 +215,6 @@ namespace BlackSimPlugin situation.setGroundspeed(groundspeed); situation.setAltitude(altitude); this->m_aircraft.setSituation(situation); - - // qDebug() << m_aircraft; } else { diff --git a/src/plugins/simulator/fscommon/fsuipc.h b/src/plugins/simulator/fscommon/fsuipc.h index 366231998..5aff20d57 100644 --- a/src/plugins/simulator/fscommon/fsuipc.h +++ b/src/plugins/simulator/fscommon/fsuipc.h @@ -83,6 +83,9 @@ namespace BlackSimPlugin return sims; } + //! Log message category + static QString getMessageCategory() { return "swift.fscommon.fsuipc"; } + private: bool m_connected; bool m_validReadValues; diff --git a/src/plugins/simulator/fsx/simconnect_datadefinition.cpp b/src/plugins/simulator/fsx/simconnect_datadefinition.cpp index 08bc389f1..852e354b5 100644 --- a/src/plugins/simulator/fsx/simconnect_datadefinition.cpp +++ b/src/plugins/simulator/fsx/simconnect_datadefinition.cpp @@ -1,7 +1,11 @@ -/* Copyright (C) 2013 VATSIM Community / contributors - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* Copyright (C) 2013 + * swift Project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ #include "simconnect_datadefinition.h" diff --git a/src/plugins/simulator/fsx/simconnect_object.cpp b/src/plugins/simulator/fsx/simconnect_object.cpp index 56dadcf27..033fddae5 100644 --- a/src/plugins/simulator/fsx/simconnect_object.cpp +++ b/src/plugins/simulator/fsx/simconnect_object.cpp @@ -1,7 +1,11 @@ -/* Copyright (C) 2013 VATSIM Community / contributors - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* Copyright (C) 2013 + * swift Project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ #include "simconnect_object.h" #include "blackcore/interpolator_linear.h" diff --git a/src/plugins/simulator/fsx/simulator_fsx.cpp b/src/plugins/simulator/fsx/simulator_fsx.cpp index 3b7bc7f7d..d5c4bfb1a 100644 --- a/src/plugins/simulator/fsx/simulator_fsx.cpp +++ b/src/plugins/simulator/fsx/simulator_fsx.cpp @@ -514,12 +514,13 @@ namespace BlackSimPlugin position.Heading = situation.getHeading().value(CAngleUnit::deg()); position.Airspeed = situation.getGroundSpeed().value(CSpeedUnit::kts()); - // TODO: epic fail for helicopters and VTOPs! + //! \todo : epic fail for helicopters and VTOPs! position.OnGround = position.Airspeed < 30 ? 1 : 0; DataDefinitionRemoteAircraftSituation ddAircraftSituation; ddAircraftSituation.position = position; + //! \todo Gear handling with new protocol extension DataDefinitionGearHandlePosition gearHandle; gearHandle.gearHandlePosition = position.Altitude < 1000 ? 1 : 0; @@ -563,11 +564,11 @@ namespace BlackSimPlugin if (hr != S_OK) { - qWarning() << "Sending time sync failed!"; + CLogMessage(this).warning("Sending time sync failed!"); } m_syncDeferredCounter = 5; // allow some time to sync CLogMessage(this).info("Synchronized time to UTC: %1") << myTime.toString(); } - } -} + } // namespace +} // namespace diff --git a/src/plugins/simulator/fsx/simulator_fsx_simconnectproc.cpp b/src/plugins/simulator/fsx/simulator_fsx_simconnectproc.cpp index 2d23e3bf9..39a74fe71 100644 --- a/src/plugins/simulator/fsx/simulator_fsx_simconnectproc.cpp +++ b/src/plugins/simulator/fsx/simulator_fsx_simconnectproc.cpp @@ -1,7 +1,11 @@ -/* Copyright (C) 2013 VATSIM Community / contributors - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +/* Copyright (C) 2013 + * swift Project Community / Contributors + * + * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level + * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, + * including this file, may be copied, modified, propagated, or distributed except according to the terms + * contained in the LICENSE file. + */ #include "simulator_fsx.h" #include "simconnect_datadefinition.h" @@ -48,8 +52,9 @@ namespace BlackSimPlugin ex.sprintf("Exception=%d SendID=%d Index=%d cbData=%d", static_cast(exception->dwException), static_cast(exception->dwSendID), static_cast(exception->dwIndex), static_cast(cbData)); - qDebug() << "Caught simConnect exception: " << CSimConnectUtilities::simConnectExceptionToString((SIMCONNECT_EXCEPTION)exception->dwException); - qDebug() << ex; + CLogMessage(static_cast(nullptr)).error("Caught simConnect exception: %1 %2") + << CSimConnectUtilities::simConnectExceptionToString((SIMCONNECT_EXCEPTION)exception->dwException) + << ex; break; } case SIMCONNECT_RECV_ID_QUIT: @@ -178,5 +183,8 @@ namespace BlackSimPlugin break; } // main switch } // method + + } // namespace +} // namespace } } diff --git a/src/swiftgui_standard/swiftguistd.h b/src/swiftgui_standard/swiftguistd.h index a7bbbdfe2..e944d6df6 100644 --- a/src/swiftgui_standard/swiftguistd.h +++ b/src/swiftgui_standard/swiftguistd.h @@ -82,10 +82,10 @@ signals: void currentMainInfoAreaChanged(const QWidget *currentWidget); protected: - //! \copy QMainWindow::mouseMoveEvent + //! \copydoc QMainWindow::mouseMoveEvent virtual void mouseMoveEvent(QMouseEvent *event) override { if (!handleMouseMoveEvent(event)) { QMainWindow::mouseMoveEvent(event); } ; } - //! \copy QMainWindow::mousePressEvent + //! \copydoc QMainWindow::mousePressEvent virtual void mousePressEvent(QMouseEvent *event) override { if (!handleMousePressEvent(event)) { QMainWindow::mousePressEvent(event); } } //! \copydoc QMainWindow::closeEvent