mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Ref T335, style and CLANG warnings
This commit is contained in:
@@ -7,12 +7,15 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "blackcore/context/contextownaircraft.h"
|
||||
#include "blackcore/context/contextsimulator.h"
|
||||
#include "ui_simulatorcomponent.h"
|
||||
#include "blackcore/simulator.h"
|
||||
#include "blackgui/components/simulatorcomponent.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/views/namevariantpairview.h"
|
||||
#include "blackcore/context/contextownaircraft.h"
|
||||
#include "blackcore/context/contextsimulator.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "blackmisc/aviation/aircraftsituation.h"
|
||||
#include "blackmisc/aviation/altitude.h"
|
||||
#include "blackmisc/aviation/comsystem.h"
|
||||
@@ -22,9 +25,7 @@
|
||||
#include "blackmisc/pq/angle.h"
|
||||
#include "blackmisc/pq/frequency.h"
|
||||
#include "blackmisc/pq/speed.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/simulation/simulatorplugininfo.h"
|
||||
#include "ui_simulatorcomponent.h"
|
||||
#include "blackmisc/stringutils.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
|
||||
@@ -29,10 +29,7 @@ namespace BlackMisc
|
||||
{
|
||||
class CIcon;
|
||||
class CStatusMessageList;
|
||||
namespace Simulation
|
||||
{
|
||||
class CSimulatedAircraft;
|
||||
}
|
||||
namespace Simulation { class CSimulatedAircraft; }
|
||||
}
|
||||
namespace Ui { class CSimulatorComponent; }
|
||||
namespace BlackGui
|
||||
|
||||
@@ -144,8 +144,8 @@ namespace BlackGui
|
||||
|
||||
BlackMisc::Simulation::IModelsForSimulatorSetable *modelsTargetSetable() const;
|
||||
BlackMisc::Simulation::IModelsForSimulatorUpdatable *modelsTargetUpdatable() const;
|
||||
BlackMisc::Simulation::ISimulatorSelectable *simulatorSelectable() const;
|
||||
BlackGui::Components::CDbMappingComponent *getMappingComponent() const;
|
||||
BlackMisc::Simulation::ISimulatorSelectable *simulatorSelectable() const;
|
||||
BlackGui::Components::CDbMappingComponent *getMappingComponent() const;
|
||||
|
||||
QObject *m_modelsTarget = nullptr; //!< optional target for setting/updating the models
|
||||
QAction *m_consolidateAll = nullptr; //!< consolidate data with DB (all)
|
||||
|
||||
@@ -689,7 +689,7 @@ namespace BlackGui
|
||||
if (containerSizeDependent < ResizeSubsetThreshold) { return -1; }
|
||||
}
|
||||
m_showingLoadIndicator = true;
|
||||
emit loadIndicatorVisibilityChanged(m_showingLoadIndicator);
|
||||
emit this->loadIndicatorVisibilityChanged(m_showingLoadIndicator);
|
||||
|
||||
if (!m_loadIndicator)
|
||||
{
|
||||
|
||||
@@ -26,8 +26,18 @@ namespace BlackMisc
|
||||
//! Dtor
|
||||
virtual ~IProvider();
|
||||
|
||||
//! Copy constructor
|
||||
IProvider(const IProvider &) = delete;
|
||||
|
||||
//! Copy assignment operator
|
||||
IProvider &operator =(const IProvider &) = delete;
|
||||
|
||||
//! Return as QObject
|
||||
virtual QObject *asQObject() { return nullptr; }
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
IProvider() {}
|
||||
};
|
||||
|
||||
//! Base class of provider aware classes
|
||||
|
||||
@@ -25,6 +25,13 @@ namespace BlackMisc
|
||||
public:
|
||||
//! Set models
|
||||
virtual void setModels(const CAircraftModelList &models) = 0;
|
||||
|
||||
//! Ctor, dtor, copy operators (CLANG warnings) @{
|
||||
IModelsSetable() {}
|
||||
virtual ~IModelsSetable() {}
|
||||
IModelsSetable(const IModelsSetable &) = default;
|
||||
IModelsSetable &operator =(const IModelsSetable &) = default;
|
||||
//! @}
|
||||
};
|
||||
|
||||
//! Interface to "something" backing models, which can be modified (updated)
|
||||
@@ -33,6 +40,13 @@ namespace BlackMisc
|
||||
public:
|
||||
//! Update models
|
||||
virtual int updateModels(const CAircraftModelList &models) = 0;
|
||||
|
||||
//! Ctor, dtor, copy operators (CLANG warnings) @{
|
||||
IModelsUpdatable() {}
|
||||
virtual ~IModelsUpdatable() {}
|
||||
IModelsUpdatable(const IModelsUpdatable &) = default;
|
||||
IModelsUpdatable &operator =(const IModelsUpdatable &) = default;
|
||||
//! @}
|
||||
};
|
||||
|
||||
//! Interface to "something" backing models, which can be set
|
||||
@@ -41,6 +55,13 @@ namespace BlackMisc
|
||||
public:
|
||||
//! Set models
|
||||
virtual void setModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) = 0;
|
||||
|
||||
//! Ctor, dtor, copy operators (CLANG warnings) @{
|
||||
IModelsForSimulatorSetable() {}
|
||||
virtual ~IModelsForSimulatorSetable() {}
|
||||
IModelsForSimulatorSetable(const IModelsForSimulatorSetable &) = default;
|
||||
IModelsForSimulatorSetable &operator =(const IModelsForSimulatorSetable &) = default;
|
||||
//! @}
|
||||
};
|
||||
|
||||
//! Interface to "something" backing models, which can be modified (updated)
|
||||
@@ -49,6 +70,13 @@ namespace BlackMisc
|
||||
public:
|
||||
//! Set models
|
||||
virtual int updateModelsForSimulator(const CAircraftModelList &models, const CSimulatorInfo &simulator) = 0;
|
||||
|
||||
//! Ctor, dtor, copy operators (CLANG warnings) @{
|
||||
IModelsForSimulatorUpdatable() {}
|
||||
virtual ~IModelsForSimulatorUpdatable() {}
|
||||
IModelsForSimulatorUpdatable(const IModelsForSimulatorUpdatable &) = default;
|
||||
IModelsForSimulatorUpdatable &operator =(const IModelsForSimulatorUpdatable &) = default;
|
||||
//! @}
|
||||
};
|
||||
|
||||
//! Interface to "something" allowing a simulator selection
|
||||
@@ -57,6 +85,13 @@ namespace BlackMisc
|
||||
public:
|
||||
//! Simulator
|
||||
virtual BlackMisc::Simulation::CSimulatorInfo getSelectedSimulator() const = 0;
|
||||
|
||||
//! Ctor, dtor, copy operators (CLANG warnings) @{
|
||||
ISimulatorSelectable() {}
|
||||
virtual ~ISimulatorSelectable() {}
|
||||
ISimulatorSelectable(const ISimulatorSelectable &) = default;
|
||||
ISimulatorSelectable &operator =(const ISimulatorSelectable &) = default;
|
||||
//! @}
|
||||
};
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace BlackMisc
|
||||
};
|
||||
|
||||
//! Last selection
|
||||
struct TSimulatorLastSelection : public BlackMisc::TDataTrait<CSimulatorInfo>
|
||||
struct TSimulatorLastSelection : public TDataTrait<CSimulatorInfo>
|
||||
{
|
||||
//! First load is synchronous
|
||||
static constexpr bool isPinned() { return true; }
|
||||
@@ -128,7 +128,7 @@ namespace BlackMisc
|
||||
};
|
||||
|
||||
//! Last selections
|
||||
struct TSimulatorLastSelections : public BlackMisc::TDataTrait<CSimulatorInfo>
|
||||
struct TSimulatorLastSelections : public TDataTrait<CSimulatorInfo>
|
||||
{
|
||||
//! First load is synchronous
|
||||
static constexpr bool isPinned() { return true; }
|
||||
|
||||
@@ -24,6 +24,9 @@ namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
IRemoteAircraftProvider::IRemoteAircraftProvider()
|
||||
{ }
|
||||
|
||||
IRemoteAircraftProvider::~IRemoteAircraftProvider()
|
||||
{ }
|
||||
|
||||
@@ -33,7 +36,10 @@ namespace BlackMisc
|
||||
return cats;
|
||||
}
|
||||
|
||||
CRemoteAircraftProvider::CRemoteAircraftProvider(QObject *parent) : QObject(parent), CIdentifiable(this)
|
||||
CRemoteAircraftProvider::CRemoteAircraftProvider(QObject *parent) :
|
||||
QObject(parent),
|
||||
IRemoteAircraftProvider(),
|
||||
CIdentifiable(this)
|
||||
{ }
|
||||
|
||||
CSimulatedAircraftList CRemoteAircraftProvider::getAircraftInRange() const
|
||||
|
||||
@@ -54,6 +54,12 @@ namespace BlackMisc
|
||||
//! Destructor
|
||||
virtual ~IRemoteAircraftProvider();
|
||||
|
||||
//! Copy constructor
|
||||
IRemoteAircraftProvider(const IRemoteAircraftProvider &) = delete;
|
||||
|
||||
//! Copy assignment operator
|
||||
IRemoteAircraftProvider &operator =(const IRemoteAircraftProvider &) = delete;
|
||||
|
||||
//! All remote aircraft
|
||||
//! \threadsafe
|
||||
virtual CSimulatedAircraftList getAircraftInRange() const = 0;
|
||||
@@ -143,14 +149,22 @@ namespace BlackMisc
|
||||
//! \threadsafe
|
||||
virtual int remoteAircraftSituationChangesCount(const Aviation::CCallsign &callsign) const = 0;
|
||||
|
||||
//! Enable/disable enabled aircraft
|
||||
//! Enable/disable aircraft
|
||||
//! \threadsafe
|
||||
virtual bool updateAircraftEnabled(const Aviation::CCallsign &callsign, bool enabledForRendering) = 0;
|
||||
|
||||
//! Aircraft rendered?
|
||||
//! Enable/disable aircraft
|
||||
//! \threadsafe
|
||||
virtual int updateMultipleAircraftEnabled(const Aviation::CCallsignSet &callsigns, bool enabledForRendering) = 0;
|
||||
|
||||
//! Set aircraft rendered
|
||||
//! \threadsafe
|
||||
virtual bool updateAircraftRendered(const Aviation::CCallsign &callsign, bool rendered) = 0;
|
||||
|
||||
//! Set aircraft rendered
|
||||
//! \threadsafe
|
||||
virtual int updateMultipleAircraftRendered(const Aviation::CCallsignSet &callsigns, bool rendered) = 0;
|
||||
|
||||
//! Mark all as not rendered
|
||||
//! \threadsafe
|
||||
virtual void updateMarkAllAsNotRendered() = 0;
|
||||
@@ -236,6 +250,10 @@ namespace BlackMisc
|
||||
|
||||
//! Remove outdated aircraft parts, but never the most recent one
|
||||
static void removeOutdatedParts(Aviation::CAircraftPartsList &partsList);
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
IRemoteAircraftProvider();
|
||||
};
|
||||
} //s
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user