mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 08:28:21 +08:00
refs #322, included context menu and methods for injecting test data (ATC stations) in GUI
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "airspace_monitor.h"
|
||||
#include "blackcore/blackcorefreefunctions.h"
|
||||
#include "blackmisc/project.h"
|
||||
#include "blackmisc/testing.h"
|
||||
#include "blackmisc/indexvariantmap.h"
|
||||
|
||||
namespace BlackCore
|
||||
@@ -218,6 +219,14 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
void CAirspaceMonitor::testCreateDummyOnlineAtcStations(int number)
|
||||
{
|
||||
this->m_atcStationsOnline.push_back(
|
||||
BlackMisc::Aviation::CTesting::createAtcStations(number)
|
||||
);
|
||||
emit this->changedAtcStationsOnline();
|
||||
}
|
||||
|
||||
void CAirspaceMonitor::ps_realNameReplyReceived(const CCallsign &callsign, const QString &realname)
|
||||
{
|
||||
if (realname.isEmpty()) return;
|
||||
|
||||
@@ -72,6 +72,9 @@ namespace BlackCore
|
||||
//! Request to update ATC stations' ATIS data from the network
|
||||
void requestAtisUpdates();
|
||||
|
||||
//! Create dummy entries for performance tests
|
||||
void testCreateDummyOnlineAtcStations(int number);
|
||||
|
||||
signals:
|
||||
//! Online ATC stations were changed
|
||||
void changedAtcStationsOnline();
|
||||
|
||||
@@ -183,6 +183,9 @@ namespace BlackCore
|
||||
//! Request ATIS updates (for all stations)
|
||||
virtual void requestAtisUpdates() = 0;
|
||||
|
||||
//! Create dummy ATC stations for performance tests etc.
|
||||
virtual void testCreateDummyOnlineAtcStations(int number) = 0;
|
||||
|
||||
protected:
|
||||
//! Constructor
|
||||
IContextNetwork(CRuntimeConfig::ContextMode mode, CRuntime *runtime) : CContext(mode, runtime) {}
|
||||
|
||||
@@ -381,6 +381,14 @@ namespace BlackCore
|
||||
this->m_airspace->requestAtisUpdates();
|
||||
}
|
||||
|
||||
/*
|
||||
* Create dummy ATC stations
|
||||
*/
|
||||
void CContextNetwork::testCreateDummyOnlineAtcStations(int number)
|
||||
{
|
||||
this->m_airspace->testCreateDummyOnlineAtcStations(number);
|
||||
}
|
||||
|
||||
/*
|
||||
* Request METAR
|
||||
*/
|
||||
|
||||
@@ -128,6 +128,9 @@ namespace BlackCore
|
||||
//! \copydoc IContextNetwork::requestAtisUpdates
|
||||
virtual void requestAtisUpdates() override;
|
||||
|
||||
//! \copydoc IContextNetwork::testCreateDummyOnlineAtcStations
|
||||
virtual void testCreateDummyOnlineAtcStations(int number) override;
|
||||
|
||||
//! Gracefully shut down, e.g. for thread safety
|
||||
void gracefulShutdown();
|
||||
|
||||
|
||||
@@ -126,6 +126,11 @@ namespace BlackCore
|
||||
this->m_dBusInterface->callDBus(QLatin1Literal("requestAtisUpdates"));
|
||||
}
|
||||
|
||||
void CContextNetworkProxy::testCreateDummyOnlineAtcStations(int number)
|
||||
{
|
||||
this->m_dBusInterface->callDBus(QLatin1Literal("testCreateDummyOnlineAtcStations"), number);
|
||||
}
|
||||
|
||||
BlackMisc::CStatusMessageList CContextNetworkProxy::connectToNetwork(uint loginMode)
|
||||
{
|
||||
return this->m_dBusInterface->callDBusRet<BlackMisc::CStatusMessageList>(QLatin1Literal("connectToNetwork"), loginMode);
|
||||
|
||||
@@ -106,6 +106,10 @@ namespace BlackCore
|
||||
|
||||
//! \copydoc IContextNetwork::requestAtisUpdates
|
||||
virtual void requestAtisUpdates() override;
|
||||
|
||||
//! \copydoc IContextNetwork::testCreateDummyOnlineAtcStations
|
||||
virtual void testCreateDummyOnlineAtcStations(int number) override;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user