From dd587207fe10c69f8b20132663f2c48c2b9dd4c3 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Mon, 27 Oct 2014 13:16:32 +0100 Subject: [PATCH] Formatting, renaming --- src/blackcore/context_audio.h | 12 ++++++--- src/blackcore/context_audio_impl.h | 14 ++++++++--- src/blackcore/context_audio_proxy.h | 14 ++++++++--- src/blackcore/context_network_impl.cpp | 3 +++ src/blackcore/context_ownaircraft.h | 12 ++++++--- src/blackcore/context_ownaircraft_impl.h | 25 ++++++++++++++++--- src/blackcore/context_ownaircraft_proxy.h | 14 ++++++++--- src/blackcore/context_simulator.h | 12 ++++++--- src/blackcore/context_simulator_impl.cpp | 4 +-- src/blackcore/context_simulator_impl.h | 18 ++++++++----- src/blackcore/context_simulator_proxy.h | 14 ++++++++--- .../components/cockpitcomcomponent.cpp | 4 +-- src/blackgui/components/cockpitcomcomponent.h | 9 +++++-- .../components/flightplancomponent.cpp | 16 ++++++------ src/blackgui/components/flightplancomponent.h | 17 +++++++------ .../components/infowindowcomponent.cpp | 2 +- src/blackgui/components/infowindowcomponent.h | 2 +- src/blackgui/transpondercodespinbox.h | 1 + src/blackgui/views/viewbase.h | 4 +-- src/blackmisc/aviocomsystem.h | 5 ++-- src/plugins/simulator/fsx/simulator_fsx.cpp | 4 +-- 21 files changed, 139 insertions(+), 67 deletions(-) diff --git a/src/blackcore/context_audio.h b/src/blackcore/context_audio.h index 16e58703a..febb8cfde 100644 --- a/src/blackcore/context_audio.h +++ b/src/blackcore/context_audio.h @@ -1,7 +1,11 @@ -/* Copyright (C) 2013x VATSIM Community / authors - * 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. + */ //! \file diff --git a/src/blackcore/context_audio_impl.h b/src/blackcore/context_audio_impl.h index de3ae6303..7da7a1787 100644 --- a/src/blackcore/context_audio_impl.h +++ b/src/blackcore/context_audio_impl.h @@ -1,7 +1,13 @@ -/* Copyright (C) 2013 VATSIM Community / authors - * 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. + */ + +//! \file #ifndef BLACKCORE_CONTEXTAUDIO_IMPL_H #define BLACKCORE_CONTEXTAUDIO_IMPL_H diff --git a/src/blackcore/context_audio_proxy.h b/src/blackcore/context_audio_proxy.h index 290abb700..6c7ce5abd 100644 --- a/src/blackcore/context_audio_proxy.h +++ b/src/blackcore/context_audio_proxy.h @@ -1,7 +1,13 @@ -/* Copyright (C) 2013x VATSIM Community / authors - * 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. + */ + +//! \file #ifndef BLACKCORE_CONTEXTVOICE_PROXY_H #define BLACKCORE_CONTEXTVOICE_PROXY_H diff --git a/src/blackcore/context_network_impl.cpp b/src/blackcore/context_network_impl.cpp index 56f5d1643..42a506d9f 100644 --- a/src/blackcore/context_network_impl.cpp +++ b/src/blackcore/context_network_impl.cpp @@ -173,6 +173,9 @@ namespace BlackCore return this->m_network->isConnected(); } + /* + * Pending connection + */ bool CContextNetwork::isPendingConnection() const { // if underlying class says pending, we believe it. But not all states (e.g. disconnecting) are covered diff --git a/src/blackcore/context_ownaircraft.h b/src/blackcore/context_ownaircraft.h index e446e12cf..36d34db26 100644 --- a/src/blackcore/context_ownaircraft.h +++ b/src/blackcore/context_ownaircraft.h @@ -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. + */ //! \file diff --git a/src/blackcore/context_ownaircraft_impl.h b/src/blackcore/context_ownaircraft_impl.h index bd0ea3fb2..65fa3fd1b 100644 --- a/src/blackcore/context_ownaircraft_impl.h +++ b/src/blackcore/context_ownaircraft_impl.h @@ -1,7 +1,13 @@ -/* Copyright (C) 2013 VATSIM Community / authors - * 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. + */ + +//! \file #ifndef BLACKCORE_CONTEXTOWNAIRCRAFT_IMPL_H #define BLACKCORE_CONTEXTOWNAIRCRAFT_IMPL_H @@ -61,6 +67,17 @@ namespace BlackCore //! \copydoc IContextOwnAircraft::enableAutomaticVoiceRoomResolution virtual void enableAutomaticVoiceRoomResolution(bool enable) override; + //! \addtogroup commandline + //! @{ + //!
+        //! .x    .xpdr  code       set transponder code    CContextOwnAircraft
+        //! .com1 .com2  frequency  set COM1/2 frequency    CContextOwnAircraft
+        //! .selcal      code       set SELCAL code         CContextOwnAircraft
+        //! 
+ //! @} + //! \copydoc IContextOwnAircraft::parseCommandLine + virtual bool parseCommandLine(const QString &commandLine) override; + protected: //! Constructor, with link to runtime CContextOwnAircraft(CRuntimeConfig::ContextMode, CRuntime *runtime); diff --git a/src/blackcore/context_ownaircraft_proxy.h b/src/blackcore/context_ownaircraft_proxy.h index f5d5a6041..e40c6e127 100644 --- a/src/blackcore/context_ownaircraft_proxy.h +++ b/src/blackcore/context_ownaircraft_proxy.h @@ -1,7 +1,13 @@ -/* Copyright (C) 2013 VATSIM Community / authors - * 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. + */ + +//! \file #ifndef BLACKCORE_OWNAIRCRAFT_PROXY_H #define BLACKCORE_OWNAIRCRAFT_PROXY_H diff --git a/src/blackcore/context_simulator.h b/src/blackcore/context_simulator.h index 0efd2ed67..2ece6cfd9 100644 --- a/src/blackcore/context_simulator.h +++ b/src/blackcore/context_simulator.h @@ -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. + */ //! \file diff --git a/src/blackcore/context_simulator_impl.cpp b/src/blackcore/context_simulator_impl.cpp index da75ac57c..0e4e1a3c6 100644 --- a/src/blackcore/context_simulator_impl.cpp +++ b/src/blackcore/context_simulator_impl.cpp @@ -164,7 +164,7 @@ namespace BlackCore this->unloadSimulatorPlugin(); // old plugin unloaded m_simulator = newSimulator; - connect(m_simulator, &ISimulator::statusChanged, this, &CContextSimulator::ps_setConnectionStatus); + connect(m_simulator, &ISimulator::statusChanged, this, &CContextSimulator::ps_onConnectionStatusChanged); connect(m_simulator, &ISimulator::aircraftModelChanged, this, &IContextSimulator::ownAircraftModelChanged); connect(CLogHandler::instance(), &CLogHandler::localMessageLogged, m_simulator, &ISimulator::displayStatusMessage); connect(CLogHandler::instance(), &CLogHandler::remoteMessageLogged, m_simulator, &ISimulator::displayStatusMessage); @@ -288,7 +288,7 @@ namespace BlackCore this->m_simulator->updateOwnSimulatorCockpit(ownAircraft); } - void CContextSimulator::ps_setConnectionStatus(ISimulator::Status status) + void CContextSimulator::ps_onConnectionStatusChanged(ISimulator::Status status) { if (status == ISimulator::Connected) { diff --git a/src/blackcore/context_simulator_impl.h b/src/blackcore/context_simulator_impl.h index 22912cfe3..5afc36943 100644 --- a/src/blackcore/context_simulator_impl.h +++ b/src/blackcore/context_simulator_impl.h @@ -1,7 +1,13 @@ -/* 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. + */ + +//! \file #ifndef BLACKCORE_CONTEXTSIMULATOR_IMPL_H #define BLACKCORE_CONTEXTSIMULATOR_IMPL_H @@ -115,8 +121,8 @@ namespace BlackCore //! \remarks set by runtime, only to be used locally (not via DBus) void ps_updateCockpitFromContext(const BlackMisc::Aviation::CAircraft &ownAircraft, const QString &originator); - //! Set new connection status - void ps_setConnectionStatus(ISimulator::Status status); + //! Handle new connection status + void ps_onConnectionStatusChanged(ISimulator::Status status); //! Status message received void ps_statusMessageReceived(const BlackMisc::CStatusMessage &statusMessage); diff --git a/src/blackcore/context_simulator_proxy.h b/src/blackcore/context_simulator_proxy.h index 9cf6eed61..d4ce7908a 100644 --- a/src/blackcore/context_simulator_proxy.h +++ b/src/blackcore/context_simulator_proxy.h @@ -1,7 +1,13 @@ -/* Copyright (C) 2013 VATSIM Community / authors - * 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. + */ + +//! \file #ifndef BLACKCORE_CONTEXTSIMULATOR_PROXY_H #define BLACKCORE_CONTEXTSIMULATOR_PROXY_H diff --git a/src/blackgui/components/cockpitcomcomponent.cpp b/src/blackgui/components/cockpitcomcomponent.cpp index 9863f070f..bfa3234a4 100644 --- a/src/blackgui/components/cockpitcomcomponent.cpp +++ b/src/blackgui/components/cockpitcomcomponent.cpp @@ -280,10 +280,10 @@ namespace BlackGui Q_UNUSED(connected); } - const QString CCockpitComComponent::cockpitOriginator() + const QString &CCockpitComComponent::cockpitOriginator() { // string is generated once, the timestamp allows to use multiple - // components (as long as they are not generated in the same ms) + // components (as long as they are not generated at the same ms) static const QString o = QString("COCKPITCOMCOMPONENT:").append(QString::number(QDateTime::currentMSecsSinceEpoch())); return o; } diff --git a/src/blackgui/components/cockpitcomcomponent.h b/src/blackgui/components/cockpitcomcomponent.h index bd1051dfc..b6b5a2efe 100644 --- a/src/blackgui/components/cockpitcomcomponent.h +++ b/src/blackgui/components/cockpitcomcomponent.h @@ -61,12 +61,18 @@ namespace BlackGui //! Cockpit values have been changed in GUI void ps_guiChangedCockpitValues(); + //! SELCAL changed in GUI + void ps_guiChangedSelcal(); + //! Update cockpit from context void ps_updateCockpitFromContext(const BlackMisc::Aviation::CAircraft &ownAircraft, const QString &originator); //! Cockpit values have been changed in GUI void ps_testSelcal(); + //! SELCAL was changed + void ps_onChangedSelcal(const BlackMisc::Aviation::CSelcal &selcal, const QString &originator); + //! Update voice room related information void ps_onChangedVoiceRoomStatus(const BlackMisc::Audio::CVoiceRoomList &selectedVoiceRooms, bool connected); @@ -90,8 +96,7 @@ namespace BlackGui void updateFrequencyDisplaysFromComSystems(const BlackMisc::Aviation::CComSystem &com1, const BlackMisc::Aviation::CComSystem &com2); //! Identifies sender of cockpit updates - // TODO: Check if to be migrated to COriginator - static const QString cockpitOriginator(); + static const QString &cockpitOriginator(); QScopedPointer ui; }; diff --git a/src/blackgui/components/flightplancomponent.cpp b/src/blackgui/components/flightplancomponent.cpp index be06e1198..b0e1c181f 100644 --- a/src/blackgui/components/flightplancomponent.cpp +++ b/src/blackgui/components/flightplancomponent.cpp @@ -225,7 +225,7 @@ namespace BlackGui return messages; } - void CFlightPlanComponent::sendFlightPlan() + void CFlightPlanComponent::ps_sendFlightPlan() { CFlightPlan flightPlan; CStatusMessageList messages = this->validateAndInitializeFlightPlan(flightPlan); @@ -249,13 +249,13 @@ namespace BlackGui } } - void CFlightPlanComponent::validateFlightPlan() + void CFlightPlanComponent::ps_validateFlightPlan() { CFlightPlan flightPlan; CStatusMessageList messages = this->validateAndInitializeFlightPlan(flightPlan); } - void CFlightPlanComponent::resetFlightPlan() + void CFlightPlanComponent::ps_resetFlightPlan() { if (this->getIContextNetwork()) { @@ -275,7 +275,9 @@ namespace BlackGui this->ui->le_TakeOffTimePlanned->setText(QDateTime::currentDateTimeUtc().addSecs(30 * 60).toString("hh:mm")); } - void CFlightPlanComponent::loadFlightPlanFromNetwork() + void CFlightPlanComponent::ps_setSelcalInOwnAircraft() + { + void CFlightPlanComponent::ps_loadFlightPlanFromNetwork() { if (!this->getIContextNetwork()) { @@ -301,7 +303,7 @@ namespace BlackGui } } - void CFlightPlanComponent::buildRemarkString() + void CFlightPlanComponent::ps_buildRemarksString() { QString rem; QString v = this->ui->cb_VoiceCapabilities->currentText().toUpper(); @@ -374,13 +376,13 @@ namespace BlackGui this->ui->pte_RemarksGenerated->setPlainText(rem); } - void CFlightPlanComponent::copyRemarks() + void CFlightPlanComponent::ps_copyRemarks() { this->ui->pte_Remarks->setPlainText(this->ui->pte_RemarksGenerated->toPlainText()); CLogMessage(this).info("Copied remarks"); } - void CFlightPlanComponent::currentTabGenerator() + void CFlightPlanComponent::ps_currentTabGenerator() { this->setCurrentWidget(this->ui->tb_RemarksGenerator); } diff --git a/src/blackgui/components/flightplancomponent.h b/src/blackgui/components/flightplancomponent.h index 97146d832..3ba4d2014 100644 --- a/src/blackgui/components/flightplancomponent.h +++ b/src/blackgui/components/flightplancomponent.h @@ -65,25 +65,28 @@ namespace BlackGui private slots: //! Send flightplan - void sendFlightPlan(); + void ps_sendFlightPlan(); //! Reset Flightplan - void resetFlightPlan(); + void ps_resetFlightPlan(); + + //! Set SELCAL in own aircrafr + void ps_setSelcalInOwnAircraft(); //! Load Flightplan - void loadFlightPlanFromNetwork(); + void ps_loadFlightPlanFromNetwork(); //! Validate Flightplan - void validateFlightPlan(); + void ps_validateFlightPlan(); //! Remark - void buildRemarkString(); + void ps_buildRemarksString(); //! Copy over - void copyRemarks(); + void ps_copyRemarks(); //! Show generator tab page - void currentTabGenerator(); + void ps_currentTabGenerator(); }; } diff --git a/src/blackgui/components/infowindowcomponent.cpp b/src/blackgui/components/infowindowcomponent.cpp index 283d5c0cb..00eaacda5 100644 --- a/src/blackgui/components/infowindowcomponent.cpp +++ b/src/blackgui/components/infowindowcomponent.cpp @@ -27,7 +27,7 @@ namespace BlackGui * Constructor */ CInfoWindowComponent::CInfoWindowComponent(QWidget *parent) : - QWizardPage(parent), ui(new Ui::InfoWindow), m_hideTimer(nullptr) + QWizardPage(parent), ui(new Ui::InfoWindow) { ui->setupUi(this); this->hide(); diff --git a/src/blackgui/components/infowindowcomponent.h b/src/blackgui/components/infowindowcomponent.h index 100c44e70..0d33e892e 100644 --- a/src/blackgui/components/infowindowcomponent.h +++ b/src/blackgui/components/infowindowcomponent.h @@ -58,7 +58,7 @@ namespace BlackGui private: QScopedPointer ui; //!< user interface - QTimer *m_hideTimer; + QTimer *m_hideTimer = nullptr; //! Init the window void initWindow(); diff --git a/src/blackgui/transpondercodespinbox.h b/src/blackgui/transpondercodespinbox.h index 333d55cd0..76890f31f 100644 --- a/src/blackgui/transpondercodespinbox.h +++ b/src/blackgui/transpondercodespinbox.h @@ -22,6 +22,7 @@ namespace BlackGui { Q_OBJECT public: + //! Constructor explicit CTransponderCodeSpinBox(QWidget *parent = nullptr); //! \copydoc QDoubleSpinBox::textFromValue diff --git a/src/blackgui/views/viewbase.h b/src/blackgui/views/viewbase.h index 15ca2113e..2e10cb941 100644 --- a/src/blackgui/views/viewbase.h +++ b/src/blackgui/views/viewbase.h @@ -100,7 +100,7 @@ namespace BlackGui //! Helper method with template free signature //! \param variant contains the container //! \param sort - //! \param resize + //! \param performResizing virtual int performUpdateContainer(const QVariant &variant, bool sort, bool performResizing) = 0; //! Skip resizing because of size? @@ -116,7 +116,7 @@ namespace BlackGui int m_resizeCount = 0; //!< flag / counter, how many resize activities int m_skipResizeThreshold = 40; //!< when to skip resize (rows count) int m_resizeAutoNthTime = 1; //!< with ResizeAuto, resize every n-th time - bool m_forceStretchLastColumnWhenResized = false; //! a small table might (few columns) might to fail stretching, force again + bool m_forceStretchLastColumnWhenResized = false; //!< a small table might (few columns) might to fail stretching, force again protected slots: //! Helper method with template free signature serving as callback from threaded worker diff --git a/src/blackmisc/aviocomsystem.h b/src/blackmisc/aviocomsystem.h index 34e7003a2..e0121205d 100644 --- a/src/blackmisc/aviocomsystem.h +++ b/src/blackmisc/aviocomsystem.h @@ -11,6 +11,7 @@ #ifndef BLACKMISC_AVIOCOMSYSTEM_H #define BLACKMISC_AVIOCOMSYSTEM_H + #include "blackmisc/aviomodulator.h" namespace BlackMisc @@ -62,13 +63,13 @@ namespace BlackMisc //! Is active frequency within 8.3383kHz channel? bool isActiveFrequencyWithin8_33kHzChannel(const BlackMisc::PhysicalQuantities::CFrequency &comFrequency) const { - return CComSystem::isWithinChannelSpacing(this->getFrequencyActive(), comFrequency, ChannelSpacing8_33KHz); + return isWithinChannelSpacing(this->getFrequencyActive(), comFrequency, ChannelSpacing8_33KHz); } //! Is active frequency within 25kHz channel? bool isActiveFrequencyWithin25kHzChannel(const BlackMisc::PhysicalQuantities::CFrequency &comFrequency) const { - return CComSystem::isWithinChannelSpacing(this->getFrequencyActive(), comFrequency, ChannelSpacing25KHz); + return isWithinChannelSpacing(this->getFrequencyActive(), comFrequency, ChannelSpacing25KHz); } //! Set UNICOM frequency as active diff --git a/src/plugins/simulator/fsx/simulator_fsx.cpp b/src/plugins/simulator/fsx/simulator_fsx.cpp index d2f5fc376..a4d127fbd 100644 --- a/src/plugins/simulator/fsx/simulator_fsx.cpp +++ b/src/plugins/simulator/fsx/simulator_fsx.cpp @@ -112,8 +112,7 @@ namespace BlackSimPlugin bool CSimulatorFsx::disconnectFrom() { - if (!m_isConnected) - return true; + if (!m_isConnected) { return true; } emit statusChanged(Disconnected); if (m_hSimConnect) @@ -142,7 +141,6 @@ namespace BlackSimPlugin return false; } SimConnect_Close(m_hSimConnect); - return true; }