mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
Formatting
This commit is contained in:
@@ -135,24 +135,17 @@ namespace BlackCore
|
|||||||
if (m_highlightedAircraft.isEmpty() || m_highlightEndTimeMsEpoch < 1) { return; }
|
if (m_highlightedAircraft.isEmpty() || m_highlightEndTimeMsEpoch < 1) { return; }
|
||||||
m_blinkCycle = !m_blinkCycle;
|
m_blinkCycle = !m_blinkCycle;
|
||||||
|
|
||||||
if (QDateTime::currentMSecsSinceEpoch() < m_highlightEndTimeMsEpoch)
|
if (QDateTime::currentMSecsSinceEpoch() > m_highlightEndTimeMsEpoch)
|
||||||
{
|
{
|
||||||
|
this->stopHighlighting();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// blink mode, toggle aircraft
|
// blink mode, toggle aircraft
|
||||||
for (const CSimulatedAircraft &aircraft : as_const(m_highlightedAircraft))
|
for (const CSimulatedAircraft &aircraft : as_const(m_highlightedAircraft))
|
||||||
{
|
{
|
||||||
if (m_blinkCycle)
|
if (m_blinkCycle) { this->callPhysicallyRemoveRemoteAircraft(aircraft.getCallsign()); }
|
||||||
{
|
else { this->callPhysicallyAddRemoteAircraft(aircraft); }
|
||||||
this->callPhysicallyRemoveRemoteAircraft(aircraft.getCallsign());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->callPhysicallyAddRemoteAircraft(aircraft); // blink
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->stopHighlighting();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef DBLOADDATADIALOG_H
|
#ifndef BLACKGUI_COMPONENTS_DBLOADDATADIALOG_H
|
||||||
#define DBLOADDATADIALOG_H
|
#define BLACKGUI_COMPONENTS_DBLOADDATADIALOG_H
|
||||||
|
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/blackguiexport.h"
|
||||||
#include "blackmisc/network/entityflags.h"
|
#include "blackmisc/network/entityflags.h"
|
||||||
@@ -43,14 +43,6 @@ namespace BlackGui
|
|||||||
bool newerOrEmptyEntitiesDetected(BlackMisc::Network::CEntityFlags::Entity loadEntities);
|
bool newerOrEmptyEntitiesDetected(BlackMisc::Network::CEntityFlags::Entity loadEntities);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CDbLoadDataDialog> ui;
|
|
||||||
BlackMisc::Network::CEntityFlags::Entity m_pendingEntities = BlackMisc::Network::CEntityFlags::NoEntity;
|
|
||||||
BlackMisc::Simulation::Data::CModelSetCaches m_sets { true, this }; //!< caches
|
|
||||||
BlackMisc::Simulation::Data::CModelCaches m_models { true, this }; //!< models
|
|
||||||
int m_pendingEntitiesCount = -1;
|
|
||||||
bool m_consolidating = false; //! currently consolidating
|
|
||||||
bool m_autoConsolidate = false;
|
|
||||||
|
|
||||||
//! The string list model
|
//! The string list model
|
||||||
QStringListModel *entitiesModel() const;
|
QStringListModel *entitiesModel() const;
|
||||||
|
|
||||||
@@ -68,6 +60,14 @@ namespace BlackGui
|
|||||||
|
|
||||||
//! Consolidate
|
//! Consolidate
|
||||||
void consolidate();
|
void consolidate();
|
||||||
|
|
||||||
|
QScopedPointer<Ui::CDbLoadDataDialog> ui;
|
||||||
|
BlackMisc::Network::CEntityFlags::Entity m_pendingEntities = BlackMisc::Network::CEntityFlags::NoEntity;
|
||||||
|
BlackMisc::Simulation::Data::CModelSetCaches m_sets { true, this }; //!< caches
|
||||||
|
BlackMisc::Simulation::Data::CModelCaches m_models { true, this }; //!< models
|
||||||
|
int m_pendingEntitiesCount = -1;
|
||||||
|
bool m_consolidating = false; //! currently consolidating
|
||||||
|
bool m_autoConsolidate = false;
|
||||||
};
|
};
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -6,14 +6,26 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>240</width>
|
<width>231</width>
|
||||||
<height>102</height>
|
<height>96</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Frame</string>
|
<string>Frame</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gl_InterpolationSetupForm">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QCheckBox" name="cb_DebugDriver">
|
<widget class="QCheckBox" name="cb_DebugDriver">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|||||||
@@ -10,11 +10,11 @@
|
|||||||
#include "blackgui/models/clientlistmodel.h"
|
#include "blackgui/models/clientlistmodel.h"
|
||||||
#include "blackgui/models/columnformatters.h"
|
#include "blackgui/models/columnformatters.h"
|
||||||
#include "blackgui/models/columns.h"
|
#include "blackgui/models/columns.h"
|
||||||
#include "blackmisc/compare.h"
|
#include "blackmisc/simulation/aircraftmodel.h"
|
||||||
#include "blackmisc/network/user.h"
|
#include "blackmisc/network/user.h"
|
||||||
|
#include "blackmisc/compare.h"
|
||||||
#include "blackmisc/propertyindex.h"
|
#include "blackmisc/propertyindex.h"
|
||||||
#include "blackmisc/propertyindexvariantmap.h"
|
#include "blackmisc/propertyindexvariantmap.h"
|
||||||
#include "blackmisc/simulation/aircraftmodel.h"
|
|
||||||
|
|
||||||
#include <Qt>
|
#include <Qt>
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
@@ -27,21 +27,18 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
namespace Models
|
namespace Models
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* Constructor
|
|
||||||
*/
|
|
||||||
CClientListModel::CClientListModel(QObject *parent) :
|
CClientListModel::CClientListModel(QObject *parent) :
|
||||||
CListModelBase<BlackMisc::Network::CClient, BlackMisc::Network::CClientList>("ViewClientList", parent)
|
CListModelBase<CClient, CClientList>("ViewClientList", parent)
|
||||||
{
|
{
|
||||||
this->m_columns.addColumn(CColumn("client", CClient::IndexIcon));
|
m_columns.addColumn(CColumn("client", CClient::IndexIcon));
|
||||||
this->m_columns.addColumn(CColumn::standardValueObject("callsign", CClient::IndexCallsign));
|
m_columns.addColumn(CColumn::standardValueObject("callsign", CClient::IndexCallsign));
|
||||||
this->m_columns.addColumn(CColumn::standardString("realname", { CClient::IndexUser, CUser::IndexRealName }));
|
m_columns.addColumn(CColumn::standardString("realname", { CClient::IndexUser, CUser::IndexRealName }));
|
||||||
this->m_columns.addColumn(CColumn("vo.", "voice capabilities", CClient::IndexVoiceCapabilitiesIcon, new CPixmapFormatter()));
|
m_columns.addColumn(CColumn("vo.", "voice capabilities", CClient::IndexVoiceCapabilitiesIcon, new CPixmapFormatter()));
|
||||||
this->m_columns.addColumn(CColumn::standardString("capabilities", CClient::IndexCapabilitiesString));
|
m_columns.addColumn(CColumn::standardString("capabilities", CClient::IndexCapabilitiesString));
|
||||||
this->m_columns.addColumn(CColumn::standardString("model", CClient::IndexModelString));
|
m_columns.addColumn(CColumn::standardString("model", CClient::IndexModelString));
|
||||||
this->m_columns.addColumn(CColumn("q.?", "queried", {CClient::IndexModelString, CAircraftModel::IndexHasQueriedModelString},
|
m_columns.addColumn(CColumn("q.?", "queried", {CClient::IndexModelString, CAircraftModel::IndexHasQueriedModelString},
|
||||||
new CBoolIconFormatter("queried", "not queried")));
|
new CBoolIconFormatter("queried", "not queried")));
|
||||||
this->m_columns.addColumn(CColumn::standardString("server", CClient::IndexServer));
|
m_columns.addColumn(CColumn::standardString("server", CClient::IndexServer));
|
||||||
|
|
||||||
// force strings for translation in resource files
|
// force strings for translation in resource files
|
||||||
(void)QT_TRANSLATE_NOOP("ViewClientList", "callsign");
|
(void)QT_TRANSLATE_NOOP("ViewClientList", "callsign");
|
||||||
@@ -56,26 +53,20 @@ namespace BlackGui
|
|||||||
static const CPropertyIndex ms({CClient::IndexModelString, CAircraftModel::IndexModelString});
|
static const CPropertyIndex ms({CClient::IndexModelString, CAircraftModel::IndexModelString});
|
||||||
static const CPropertyIndex qf({CClient::IndexModelString, CAircraftModel::IndexHasQueriedModelString});
|
static const CPropertyIndex qf({CClient::IndexModelString, CAircraftModel::IndexHasQueriedModelString});
|
||||||
if (role != Qt::DisplayRole && role != Qt::DecorationRole) { return CListModelBase::data(index, role); }
|
if (role != Qt::DisplayRole && role != Qt::DecorationRole) { return CListModelBase::data(index, role); }
|
||||||
CPropertyIndex pi = modelIndexToPropertyIndex(index);
|
const CPropertyIndex pi = modelIndexToPropertyIndex(index);
|
||||||
if (pi == ms && role == Qt::DisplayRole)
|
if (pi == ms && role == Qt::DisplayRole)
|
||||||
{
|
{
|
||||||
// no model string for ATC
|
// no model string for ATC
|
||||||
const CClient client = this->at(index);
|
const CClient client = this->at(index);
|
||||||
bool atc = client.isAtc();
|
const bool atc = client.isAtc();
|
||||||
if (atc)
|
if (atc) { return QVariant("ATC"); }
|
||||||
{
|
|
||||||
return QVariant("ATC");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (pi == qf && role == Qt::DecorationRole)
|
else if (pi == qf && role == Qt::DecorationRole)
|
||||||
{
|
{
|
||||||
// no symbol for ATC
|
// no symbol for ATC
|
||||||
const CClient client = this->at(index);
|
const CClient client = this->at(index);
|
||||||
bool atc = client.isAtc();
|
const bool atc = client.isAtc();
|
||||||
if (atc)
|
if (atc) { return QVariant(); }
|
||||||
{
|
|
||||||
return QVariant();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return CListModelBase::data(index, role);
|
return CListModelBase::data(index, role);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,12 +9,11 @@
|
|||||||
|
|
||||||
//! \file
|
//! \file
|
||||||
|
|
||||||
#ifndef BLACKGUI_CLIENTLISTMODEL_H
|
#ifndef BLACKGUI_MODELS_CLIENTLISTMODEL_H
|
||||||
#define BLACKGUI_CLIENTLISTMODEL_H
|
#define BLACKGUI_MODELS_CLIENTLISTMODEL_H
|
||||||
|
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/blackguiexport.h"
|
||||||
#include "blackgui/models/listmodelbase.h"
|
#include "blackgui/models/listmodelbase.h"
|
||||||
#include "blackmisc/network/client.h"
|
|
||||||
#include "blackmisc/network/clientlist.h"
|
#include "blackmisc/network/clientlist.h"
|
||||||
|
|
||||||
#include <QVariant>
|
#include <QVariant>
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
#include "listmodelcallsignobjects.h"
|
#include "listmodelcallsignobjects.h"
|
||||||
#include "allmodelcontainers.h"
|
#include "allmodelcontainers.h"
|
||||||
#include "blackmisc/db/datastoreobjectlist.h"
|
|
||||||
#include "blackmisc/orderable.h"
|
#include "blackmisc/orderable.h"
|
||||||
|
|
||||||
#include <QBrush>
|
#include <QBrush>
|
||||||
|
|||||||
@@ -12,19 +12,18 @@
|
|||||||
#ifndef BLACKGUI_VIEWS_COUNTRYVIEW_H
|
#ifndef BLACKGUI_VIEWS_COUNTRYVIEW_H
|
||||||
#define BLACKGUI_VIEWS_COUNTRYVIEW_H
|
#define BLACKGUI_VIEWS_COUNTRYVIEW_H
|
||||||
|
|
||||||
#include "blackgui/blackguiexport.h"
|
|
||||||
#include "blackgui/models/countrylistmodel.h"
|
|
||||||
#include "blackgui/views/viewbase.h"
|
#include "blackgui/views/viewbase.h"
|
||||||
|
#include "blackgui/models/countrylistmodel.h"
|
||||||
|
#include "blackgui/blackguiexport.h"
|
||||||
#include "blackmisc/countrylist.h"
|
#include "blackmisc/countrylist.h"
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
namespace BlackMisc { class CCountry; }
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
namespace Views
|
namespace Views
|
||||||
{
|
{
|
||||||
//! Distributors
|
//! Countries
|
||||||
class BLACKGUI_EXPORT CCountryView : public CViewBase<Models::CCountryListModel, BlackMisc::CCountryList, BlackMisc::CCountry>
|
class BLACKGUI_EXPORT CCountryView : public CViewBase<Models::CCountryListModel, BlackMisc::CCountryList, BlackMisc::CCountry>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -13,17 +13,17 @@
|
|||||||
#define BLACKGUI_VIEWBASE_H
|
#define BLACKGUI_VIEWBASE_H
|
||||||
|
|
||||||
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
#include "blackgui/components/enablefordockwidgetinfoarea.h"
|
||||||
#include "blackgui/menus/menuaction.h"
|
|
||||||
#include "blackgui/models/modelfilter.h"
|
#include "blackgui/models/modelfilter.h"
|
||||||
#include "blackgui/models/selectionmodel.h"
|
#include "blackgui/models/selectionmodel.h"
|
||||||
#include "blackgui/settings/guisettings.h"
|
#include "blackgui/settings/guisettings.h"
|
||||||
#include "blackgui/settings/viewdirectorysettings.h"
|
#include "blackgui/settings/viewdirectorysettings.h"
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/menus/menuaction.h"
|
||||||
#include "blackmisc/namevariantpairlist.h"
|
#include "blackmisc/namevariantpairlist.h"
|
||||||
#include "blackmisc/propertyindex.h"
|
#include "blackmisc/propertyindex.h"
|
||||||
#include "blackmisc/propertyindexvariantmap.h"
|
#include "blackmisc/propertyindexvariantmap.h"
|
||||||
#include "blackmisc/statusmessage.h"
|
#include "blackmisc/statusmessage.h"
|
||||||
#include "blackmisc/variant.h"
|
#include "blackmisc/variant.h"
|
||||||
|
#include "blackgui/blackguiexport.h"
|
||||||
|
|
||||||
#include <QAbstractItemView>
|
#include <QAbstractItemView>
|
||||||
#include <QFlags>
|
#include <QFlags>
|
||||||
|
|||||||
@@ -242,11 +242,11 @@ namespace BlackMisc
|
|||||||
qint64 m_currentTimeMsSinceEpoch = -1; //!< current time
|
qint64 m_currentTimeMsSinceEpoch = -1; //!< current time
|
||||||
Aviation::CAircraftSituationList m_currentSituations; //!< current situations
|
Aviation::CAircraftSituationList m_currentSituations; //!< current situations
|
||||||
Aviation::CAircraftSituationChange m_currentSituationChange; //!< situations change
|
Aviation::CAircraftSituationChange m_currentSituationChange; //!< situations change
|
||||||
PhysicalQuantities::CLength m_currentSceneryOffset = PhysicalQuantities::CLength::null(); //!< calculated scenery offset if any
|
|
||||||
CInterpolationAndRenderingSetupPerCallsign m_currentSetup; //!< used setup
|
CInterpolationAndRenderingSetupPerCallsign m_currentSetup; //!< used setup
|
||||||
CInterpolationStatus m_currentInterpolationStatus; //!< this step's status
|
CInterpolationStatus m_currentInterpolationStatus; //!< this step's status
|
||||||
CPartsStatus m_currentPartsStatus; //!< this step's status
|
CPartsStatus m_currentPartsStatus; //!< this step's status
|
||||||
Aviation::CAircraftSituation m_lastInterpolation { Aviation::CAircraftSituation::null() }; //!< latest interpolation
|
Aviation::CAircraftSituation m_lastInterpolation { Aviation::CAircraftSituation::null() }; //!< latest interpolation
|
||||||
|
PhysicalQuantities::CLength m_currentSceneryOffset { PhysicalQuantities::CLength::null() }; //!< calculated scenery offset if any
|
||||||
|
|
||||||
qint64 m_situationsLastModified { -1 }; //!< when situations were last modified
|
qint64 m_situationsLastModified { -1 }; //!< when situations were last modified
|
||||||
qint64 m_situationsLastModifiedUsed { -1 }; //!< interpolant based on situations last updated
|
qint64 m_situationsLastModifiedUsed { -1 }; //!< interpolant based on situations last updated
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ namespace BlackMisc
|
|||||||
|
|
||||||
CSimulatedAircraftList m_aircraftInRange; //!< aircraft, thread safe access required
|
CSimulatedAircraftList m_aircraftInRange; //!< aircraft, thread safe access required
|
||||||
QMap<Aviation::CCallsign, CStatusMessageList> m_reverseLookupMessages;
|
QMap<Aviation::CCallsign, CStatusMessageList> m_reverseLookupMessages;
|
||||||
QMap<Aviation::CCallsign, CStatusMessageList> m_aircraftPartsHistory;
|
QMap<Aviation::CCallsign, CStatusMessageList> m_aircraftPartsHistory; //!< JSON aircraft parts history
|
||||||
QMap<Aviation::CCallsign, qint64> m_situationsLastModified;
|
QMap<Aviation::CCallsign, qint64> m_situationsLastModified;
|
||||||
QMap<Aviation::CCallsign, qint64> m_partsLastModified;
|
QMap<Aviation::CCallsign, qint64> m_partsLastModified;
|
||||||
QMap<Aviation::CCallsign, PhysicalQuantities::CLength> m_testOffset;
|
QMap<Aviation::CCallsign, PhysicalQuantities::CLength> m_testOffset;
|
||||||
|
|||||||
Reference in New Issue
Block a user