mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 09:45:44 +08:00
Ref T270, changes to context/and interpolation log display so we can display "internals" of airspace monitor
This commit is contained in:
@@ -124,6 +124,23 @@ namespace BlackCore
|
|||||||
virtual bool setClientGndCapability(const BlackMisc::Aviation::CCallsign &callsign, bool supportGndFlag) override;
|
virtual bool setClientGndCapability(const BlackMisc::Aviation::CCallsign &callsign, bool supportGndFlag) override;
|
||||||
//! @}
|
//! @}
|
||||||
|
|
||||||
|
//! \copydoc IContextNetwork::connectRawFsdMessageSignal
|
||||||
|
virtual QMetaObject::Connection connectRawFsdMessageSignal(QObject *receiver, RawFsdMessageReceivedSlot rawFsdMessageReceivedSlot) override;
|
||||||
|
|
||||||
|
//! Gracefully shut down, e.g. for thread safety
|
||||||
|
void gracefulShutdown();
|
||||||
|
|
||||||
|
//! \protected
|
||||||
|
//! \remarks normally only for core facade internal usage
|
||||||
|
//! \remarks public so values can be logged/monitored
|
||||||
|
//! @{
|
||||||
|
//! Network library
|
||||||
|
INetwork *network() const { return m_network; }
|
||||||
|
|
||||||
|
//! Airspace
|
||||||
|
CAirspaceMonitor *airspace() const { return m_airspace; }
|
||||||
|
//! @}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// from context and provider interface
|
// from context and provider interface
|
||||||
//! \ingroup remoteaircraftprovider
|
//! \ingroup remoteaircraftprovider
|
||||||
@@ -222,13 +239,6 @@ namespace BlackCore
|
|||||||
//! @}
|
//! @}
|
||||||
// --------------------- IContextNetwork implementations ---------------------
|
// --------------------- IContextNetwork implementations ---------------------
|
||||||
|
|
||||||
//! Gracefully shut down, e.g. for thread safety
|
|
||||||
void gracefulShutdown();
|
|
||||||
|
|
||||||
public:
|
|
||||||
//! \copydoc IContextNetwork::connectRawFsdMessageSignal
|
|
||||||
virtual QMetaObject::Connection connectRawFsdMessageSignal(QObject *receiver, RawFsdMessageReceivedSlot rawFsdMessageReceivedSlot) override;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! Constructor, with link to runtime
|
//! Constructor, with link to runtime
|
||||||
CContextNetwork(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime);
|
CContextNetwork(CCoreFacadeConfig::ContextMode, CCoreFacade *runtime);
|
||||||
@@ -236,14 +246,6 @@ namespace BlackCore
|
|||||||
//! Register myself in DBus
|
//! Register myself in DBus
|
||||||
CContextNetwork *registerWithDBus(BlackMisc::CDBusServer *server);
|
CContextNetwork *registerWithDBus(BlackMisc::CDBusServer *server);
|
||||||
|
|
||||||
//! Network library
|
|
||||||
//! \remarks normally only for core facade internal usage
|
|
||||||
INetwork *network() const { return m_network; }
|
|
||||||
|
|
||||||
//! Airspace
|
|
||||||
//! \remarks normally only for core facade internal usage
|
|
||||||
CAirspaceMonitor *airspace() const { return m_airspace; }
|
|
||||||
|
|
||||||
//! Set the provider
|
//! Set the provider
|
||||||
void setSimulationEnvironmentProvider(BlackMisc::Simulation::ISimulationEnvironmentProvider *provider);
|
void setSimulationEnvironmentProvider(BlackMisc::Simulation::ISimulationEnvironmentProvider *provider);
|
||||||
|
|
||||||
|
|||||||
@@ -9,11 +9,20 @@
|
|||||||
|
|
||||||
#include "interpolationlogdisplay.h"
|
#include "interpolationlogdisplay.h"
|
||||||
#include "ui_interpolationlogdisplay.h"
|
#include "ui_interpolationlogdisplay.h"
|
||||||
|
#include "blackgui/guiapplication.h"
|
||||||
|
#include "blackcore/context/contextnetworkimpl.h"
|
||||||
|
#include "blackcore/airspacemonitor.h"
|
||||||
#include "blackmisc/simulation/interpolationlogger.h"
|
#include "blackmisc/simulation/interpolationlogger.h"
|
||||||
|
#include "blackmisc/stringutils.h"
|
||||||
|
|
||||||
using namespace BlackCore;
|
using namespace BlackCore;
|
||||||
|
using namespace BlackCore::Context;
|
||||||
|
using namespace BlackMisc;
|
||||||
using namespace BlackMisc::Aviation;
|
using namespace BlackMisc::Aviation;
|
||||||
|
using namespace BlackMisc::Geo;
|
||||||
|
using namespace BlackMisc::Network;
|
||||||
using namespace BlackMisc::Simulation;
|
using namespace BlackMisc::Simulation;
|
||||||
|
using namespace BlackMisc::PhysicalQuantities;
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
@@ -24,6 +33,7 @@ namespace BlackGui
|
|||||||
ui(new Ui::CInterpolationLogDisplay)
|
ui(new Ui::CInterpolationLogDisplay)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
ui->tw_LogTabs->setCurrentIndex(TabFlow);
|
||||||
constexpr int timeSecs = 5;
|
constexpr int timeSecs = 5;
|
||||||
ui->hs_UpdateTime->setValue(timeSecs);
|
ui->hs_UpdateTime->setValue(timeSecs);
|
||||||
this->onSliderChanged(timeSecs);
|
this->onSliderChanged(timeSecs);
|
||||||
@@ -32,6 +42,12 @@ namespace BlackGui
|
|||||||
connect(ui->pb_StartStop, &QPushButton::released, this, &CInterpolationLogDisplay::toggleStartStop);
|
connect(ui->pb_StartStop, &QPushButton::released, this, &CInterpolationLogDisplay::toggleStartStop);
|
||||||
connect(ui->comp_CallsignCompleter, &CCallsignCompleter::validCallsignEntered, this, &CInterpolationLogDisplay::onCallsignEntered);
|
connect(ui->comp_CallsignCompleter, &CCallsignCompleter::validCallsignEntered, this, &CInterpolationLogDisplay::onCallsignEntered);
|
||||||
|
|
||||||
|
CLedWidget::LedShape shape = CLedWidget::Rounded;
|
||||||
|
ui->led_Parts->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Parts received", "", 14);
|
||||||
|
ui->led_Situation->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Situation received", "", 14);
|
||||||
|
ui->led_Elevation->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Elevation received", "", 14);
|
||||||
|
ui->led_Running->setValues(CLedWidget::Yellow, CLedWidget::Black, shape, "Running", "Stopped", 14);
|
||||||
|
|
||||||
m_callsign = ui->comp_CallsignCompleter->getCallsign();
|
m_callsign = ui->comp_CallsignCompleter->getCallsign();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,21 +56,59 @@ namespace BlackGui
|
|||||||
|
|
||||||
void CInterpolationLogDisplay::setSimulator(CSimulatorCommon *simulatorCommon)
|
void CInterpolationLogDisplay::setSimulator(CSimulatorCommon *simulatorCommon)
|
||||||
{
|
{
|
||||||
|
if (simulatorCommon && simulatorCommon == m_simulatorCommon) { return; } // same
|
||||||
|
if (m_simulatorCommon)
|
||||||
|
{
|
||||||
|
this->disconnect(m_simulatorCommon);
|
||||||
|
m_simulatorCommon->disconnect(this);
|
||||||
|
}
|
||||||
m_simulatorCommon = simulatorCommon;
|
m_simulatorCommon = simulatorCommon;
|
||||||
|
connect(m_simulatorCommon, &CSimulatorCommon::receivedRequestedElevation, this, &CInterpolationLogDisplay::onElevationReceived);
|
||||||
|
connect(m_simulatorCommon, &CSimulatorCommon::requestedElevation, this, &CInterpolationLogDisplay::onElevationRequested);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CInterpolationLogDisplay::setAirspaceMonitor(CAirspaceMonitor *airspaceMonitor)
|
||||||
|
{
|
||||||
|
if (airspaceMonitor && airspaceMonitor == m_airspaceMonitor) { return; } // same
|
||||||
|
if (m_airspaceMonitor)
|
||||||
|
{
|
||||||
|
this->disconnect(m_airspaceMonitor);
|
||||||
|
m_airspaceMonitor->disconnect(this);
|
||||||
|
}
|
||||||
|
m_airspaceMonitor = airspaceMonitor;
|
||||||
|
|
||||||
|
connect(m_airspaceMonitor, &CAirspaceMonitor::addedAircraftSituation, this, &CInterpolationLogDisplay::onSituationAdded, Qt::QueuedConnection);
|
||||||
|
connect(m_airspaceMonitor, &CAirspaceMonitor::addedAircraftParts, this, &CInterpolationLogDisplay::onPartsAdded, Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInterpolationLogDisplay::updateLog()
|
void CInterpolationLogDisplay::updateLog()
|
||||||
{
|
{
|
||||||
const bool hasLogger = m_simulatorCommon;
|
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||||
if (hasLogger && !m_callsign.isEmpty())
|
const bool hasLogger = m_simulatorCommon && m_airspaceMonitor;
|
||||||
|
if (!hasLogger || m_callsign.isEmpty())
|
||||||
|
{
|
||||||
|
ui->te_TextLog->setText("No logger attached or no callsign");
|
||||||
|
this->stop();
|
||||||
|
this->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// only display visible tab
|
||||||
|
if (ui->tw_LogTabs->currentWidget() == ui->tb_TextLog)
|
||||||
{
|
{
|
||||||
const QString log = m_simulatorCommon->latestLoggedDataFormatted(m_callsign);
|
const QString log = m_simulatorCommon->latestLoggedDataFormatted(m_callsign);
|
||||||
ui->te_Log->setText(log);
|
ui->te_TextLog->setText(log);
|
||||||
}
|
}
|
||||||
else
|
else if (ui->tw_LogTabs->currentWidget() == ui->tb_DataFlow)
|
||||||
{
|
{
|
||||||
ui->te_Log->setText("No logger attached or no callsign");
|
ui->le_CG->setText(m_airspaceMonitor->getCG(m_callsign).valueRoundedWithUnit(CLengthUnit::ft(), 1));
|
||||||
this->stop();
|
ui->le_CG->home(false);
|
||||||
|
ui->le_Parts->setText(boolToYesNo(m_airspaceMonitor->isRemoteAircraftSupportingParts(m_callsign)));
|
||||||
|
|
||||||
|
static const QString avgUpdateTime("%1ms");
|
||||||
|
ui->le_AvgUpdateTimeMs->setText(avgUpdateTime.arg(m_simulatorCommon->getStatisticsAverageUpdateTimeMs()));
|
||||||
|
|
||||||
|
const CClient client = m_airspaceMonitor->getClientOrDefaultForCallsign(m_callsign);
|
||||||
|
ui->le_GndFlag->setText(boolToYesNo(client.hasGndFlagCapability()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,12 +127,14 @@ namespace BlackGui
|
|||||||
this->stop();
|
this->stop();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (m_callsign == cs) { return; }
|
||||||
|
|
||||||
// clear last callsign
|
// clear last callsign
|
||||||
if (!m_callsign.isEmpty())
|
if (!m_callsign.isEmpty())
|
||||||
{
|
{
|
||||||
m_simulatorCommon->setLogInterpolation(false, m_callsign); // stop logging "old" callsign
|
m_simulatorCommon->setLogInterpolation(false, m_callsign); // stop logging "old" callsign
|
||||||
m_callsign = CCallsign(); // clear callsign
|
m_callsign = CCallsign(); // clear callsign
|
||||||
|
this->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
// set new callsign or stop
|
// set new callsign or stop
|
||||||
@@ -95,14 +151,8 @@ namespace BlackGui
|
|||||||
void CInterpolationLogDisplay::toggleStartStop()
|
void CInterpolationLogDisplay::toggleStartStop()
|
||||||
{
|
{
|
||||||
const bool running = m_updateTimer.isActive();
|
const bool running = m_updateTimer.isActive();
|
||||||
if (running)
|
if (running) { this->stop(); }
|
||||||
{
|
else { this->start(); }
|
||||||
this->stop();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->start();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInterpolationLogDisplay::start()
|
void CInterpolationLogDisplay::start()
|
||||||
@@ -110,12 +160,79 @@ namespace BlackGui
|
|||||||
const int interval = ui->hs_UpdateTime->value() * 1000;
|
const int interval = ui->hs_UpdateTime->value() * 1000;
|
||||||
m_updateTimer.start(interval);
|
m_updateTimer.start(interval);
|
||||||
ui->pb_StartStop->setText(stopText());
|
ui->pb_StartStop->setText(stopText());
|
||||||
|
ui->led_Running->setOn(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInterpolationLogDisplay::stop()
|
void CInterpolationLogDisplay::stop()
|
||||||
{
|
{
|
||||||
m_updateTimer.stop();
|
m_updateTimer.stop();
|
||||||
ui->pb_StartStop->setText(startText());
|
ui->pb_StartStop->setText(startText());
|
||||||
|
ui->led_Running->setOn(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CInterpolationLogDisplay::logCallsign(const CCallsign &cs) const
|
||||||
|
{
|
||||||
|
if (!sGui || sGui->isShuttingDown()) { return false; }
|
||||||
|
if (!m_airspaceMonitor || !m_simulatorCommon || m_callsign.isEmpty()) { return false; }
|
||||||
|
if (cs != m_callsign) { return false; }
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CInterpolationLogDisplay::onSituationAdded(const CAircraftSituation &situation)
|
||||||
|
{
|
||||||
|
const CCallsign cs = situation.getCallsign();
|
||||||
|
if (!this->logCallsign(cs)) { return; }
|
||||||
|
const CAircraftSituationList situations = m_airspaceMonitor->remoteAircraftSituations(cs);
|
||||||
|
ui->tvp_AircraftSituations->updateContainerAsync(situations);
|
||||||
|
ui->led_Situation->blink();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CInterpolationLogDisplay::onPartsAdded(const CCallsign &callsign, const CAircraftParts &parts)
|
||||||
|
{
|
||||||
|
if (!this->logCallsign(callsign)) { return; }
|
||||||
|
Q_UNUSED(parts);
|
||||||
|
const CAircraftPartsList partsList = m_airspaceMonitor->remoteAircraftParts(callsign);
|
||||||
|
ui->tvp_AircraftParts->updateContainerAsync(partsList);
|
||||||
|
ui->led_Parts->blink();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CInterpolationLogDisplay::onElevationReceived(const CElevationPlane &plane, const CCallsign &callsign)
|
||||||
|
{
|
||||||
|
if (!this->logCallsign(callsign)) { return; }
|
||||||
|
m_elvReceived++;
|
||||||
|
ui->le_Elevation->setText(plane.toQString());
|
||||||
|
ui->led_Elevation->blink();
|
||||||
|
ui->le_ElevationRec->setText(QString::number(m_elvReceived));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CInterpolationLogDisplay::onElevationRequested(const CCallsign &callsign)
|
||||||
|
{
|
||||||
|
if (!this->logCallsign(callsign)) { return; }
|
||||||
|
m_elvRequested++;
|
||||||
|
ui->led_Elevation->blink();
|
||||||
|
ui->le_ElevationReq->setText(QString::number(m_elvRequested));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CInterpolationLogDisplay::clear()
|
||||||
|
{
|
||||||
|
ui->tvp_AircraftParts->clear();
|
||||||
|
ui->tvp_AircraftSituations->clear();
|
||||||
|
ui->te_TextLog->clear();
|
||||||
|
ui->le_CG->clear();
|
||||||
|
ui->le_Elevation->clear();
|
||||||
|
ui->le_ElevationRec->clear();
|
||||||
|
ui->le_ElevationReq->clear();
|
||||||
|
ui->le_Parts->clear();
|
||||||
|
ui->le_AvgUpdateTimeMs->clear();
|
||||||
|
m_elvReceived = m_elvRequested = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CInterpolationLogDisplay::linkWithAirspaceMonitor()
|
||||||
|
{
|
||||||
|
if (!sGui || sGui->isShuttingDown() || !sGui->supportsContexts()) { return; }
|
||||||
|
if (!sGui->getCoreFacade() || !sGui->getCoreFacade()->getCContextNetwork()) { return; }
|
||||||
|
const CContextNetwork *cn = sGui->getCoreFacade()->getCContextNetwork();
|
||||||
|
this->setAirspaceMonitor(cn->airspace());
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &CInterpolationLogDisplay::startText()
|
const QString &CInterpolationLogDisplay::startText()
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
|
|
||||||
|
namespace BlackCore { class CAirspaceMonitor; }
|
||||||
namespace Ui { class CInterpolationLogDisplay; }
|
namespace Ui { class CInterpolationLogDisplay; }
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
@@ -33,6 +34,13 @@ namespace BlackGui
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
//! Tabs
|
||||||
|
enum Tab
|
||||||
|
{
|
||||||
|
TabFlow,
|
||||||
|
TabTextLog
|
||||||
|
};
|
||||||
|
|
||||||
//! Constructor
|
//! Constructor
|
||||||
explicit CInterpolationLogDisplay(QWidget *parent = nullptr);
|
explicit CInterpolationLogDisplay(QWidget *parent = nullptr);
|
||||||
|
|
||||||
@@ -42,6 +50,12 @@ namespace BlackGui
|
|||||||
//! Set simulator
|
//! Set simulator
|
||||||
void setSimulator(BlackCore::CSimulatorCommon *simulatorCommon);
|
void setSimulator(BlackCore::CSimulatorCommon *simulatorCommon);
|
||||||
|
|
||||||
|
//! Set corresponding airspace monitor
|
||||||
|
void setAirspaceMonitor(BlackCore::CAirspaceMonitor *airspaceMonitor);
|
||||||
|
|
||||||
|
//! If possible link with airspace monitor
|
||||||
|
void linkWithAirspaceMonitor();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Update log.
|
//! Update log.
|
||||||
void updateLog();
|
void updateLog();
|
||||||
@@ -61,10 +75,31 @@ namespace BlackGui
|
|||||||
//! Stop displaying
|
//! Stop displaying
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
|
//! Log the current callsign
|
||||||
|
bool logCallsign(const BlackMisc::Aviation::CCallsign &cs) const;
|
||||||
|
|
||||||
|
//! \copydoc BlackCore::CAirspaceMonitor::addedAircraftSituation
|
||||||
|
void onSituationAdded(const BlackMisc::Aviation::CAircraftSituation &situation);
|
||||||
|
|
||||||
|
//! \copydoc BlackCore::CAirspaceMonitor::addedAircraftSituation
|
||||||
|
void onPartsAdded(const BlackMisc::Aviation::CCallsign &callsign, const BlackMisc::Aviation::CAircraftParts &parts);
|
||||||
|
|
||||||
|
//! \copydoc BlackCore::CSimulatorCommon::receivedRequestedElevation
|
||||||
|
void onElevationReceived(const BlackMisc::Geo::CElevationPlane &plane, const BlackMisc::Aviation::CCallsign &callsign);
|
||||||
|
|
||||||
|
//! \copydoc BlackCore::CSimulatorCommon::requestedElevation
|
||||||
|
void onElevationRequested(const BlackMisc::Aviation::CCallsign &callsign);
|
||||||
|
|
||||||
|
//! Clear
|
||||||
|
void clear();
|
||||||
|
|
||||||
QScopedPointer<Ui::CInterpolationLogDisplay> ui;
|
QScopedPointer<Ui::CInterpolationLogDisplay> ui;
|
||||||
QTimer m_updateTimer;
|
QTimer m_updateTimer;
|
||||||
QPointer<BlackCore::CSimulatorCommon> m_simulatorCommon = nullptr; //!< related simulator
|
QPointer<BlackCore::CSimulatorCommon> m_simulatorCommon; //!< related simulator
|
||||||
|
QPointer<BlackCore::CAirspaceMonitor> m_airspaceMonitor; //!< related airspace monitor
|
||||||
BlackMisc::Aviation::CCallsign m_callsign; //!< current callsign
|
BlackMisc::Aviation::CCallsign m_callsign; //!< current callsign
|
||||||
|
int m_elvRequested = 0;
|
||||||
|
int m_elvReceived = 0;
|
||||||
|
|
||||||
static const QString &startText();
|
static const QString &startText();
|
||||||
static const QString &stopText();
|
static const QString &stopText();
|
||||||
|
|||||||
@@ -6,19 +6,57 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>640</width>
|
<width>800</width>
|
||||||
<height>480</height>
|
<height>600</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Interpolation log. display</string>
|
<string>Interpolation log. display</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="vl_InterpolationLog">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="fr_Top">
|
<widget class="QGroupBox" name="gb_LogCallsign">
|
||||||
<layout class="QHBoxLayout" name="hl_Top" stretch="2,4,1,1">
|
<property name="title">
|
||||||
|
<string>Log.callsign</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="hl_LogCallsign" stretch="2,1,4,1">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="BlackGui::Components::CCallsignCompleter" name="comp_CallsignCompleter"/>
|
<widget class="BlackGui::Components::CCallsignCompleter" name="comp_CallsignCompleter">
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::StrongFocus</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="le_UpdateTime">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QSlider" name="hs_UpdateTime">
|
<widget class="QSlider" name="hs_UpdateTime">
|
||||||
@@ -39,13 +77,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<widget class="QLineEdit" name="le_UpdateTime">
|
|
||||||
<property name="readOnly">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPushButton" name="pb_StartStop">
|
<widget class="QPushButton" name="pb_StartStop">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -57,10 +88,328 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTextEdit" name="te_Log">
|
<widget class="QGroupBox" name="gb_Status">
|
||||||
<property name="readOnly">
|
<property name="title">
|
||||||
<bool>true</bool>
|
<string>Status</string>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="hl_Status">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_RunningLed">
|
||||||
|
<property name="text">
|
||||||
|
<string>Running</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::CLedWidget" name="led_Running" native="true"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="hs_LedBar">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>352</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_SituationsLed">
|
||||||
|
<property name="text">
|
||||||
|
<string>Situations</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::CLedWidget" name="led_Situation" native="true"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_PartsLed">
|
||||||
|
<property name="text">
|
||||||
|
<string>Parts</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::CLedWidget" name="led_Parts" native="true"/>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_ElevationLed">
|
||||||
|
<property name="text">
|
||||||
|
<string>Elevation</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::CLedWidget" name="led_Elevation" native="true"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QTabWidget" name="tw_LogTabs">
|
||||||
|
<property name="currentIndex">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="tb_DataFlow">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Data flow</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QGroupBox" name="gb_InboundSituations">
|
||||||
|
<property name="title">
|
||||||
|
<string>Inbound situations</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="vl_InboundSituations">
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::Views::CAircraftSituationView" name="tvp_AircraftSituations">
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::SingleSelection</enum>
|
||||||
|
</property>
|
||||||
|
<property name="selectionBehavior">
|
||||||
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
|
</property>
|
||||||
|
<attribute name="verticalHeaderVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QGroupBox" name="gb_DataMisc">
|
||||||
|
<property name="title">
|
||||||
|
<string>Misc.</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="vl_Misc" stretch="0,0">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="fr_Misc1">
|
||||||
|
<layout class="QHBoxLayout" name="hl_Misc1">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_CG">
|
||||||
|
<property name="text">
|
||||||
|
<string>CG:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="le_CG">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>CG</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_Parts">
|
||||||
|
<property name="text">
|
||||||
|
<string>Parts:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="le_Parts">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>parts?</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_GndFlag">
|
||||||
|
<property name="text">
|
||||||
|
<string>Gnd.flag:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="le_GndFlag">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>gnd.flag?</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_AverageUpdateTime">
|
||||||
|
<property name="text">
|
||||||
|
<string>Avg.time:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="le_AvgUpdateTimeMs">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_ElevationRequested">
|
||||||
|
<property name="text">
|
||||||
|
<string>req.:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="le_ElevationReq">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>elevation requested</string>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>req.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_ElevationReceived">
|
||||||
|
<property name="text">
|
||||||
|
<string>Rec.:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="le_ElevationRec">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>elevation received</string>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>rec.</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="fr_Misc2">
|
||||||
|
<layout class="QHBoxLayout" name="hl_Misc2">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="lbl_Elevation">
|
||||||
|
<property name="text">
|
||||||
|
<string>Elevation:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QLineEdit" name="le_Elevation">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>elevation</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QGroupBox" name="gb_InboundParts">
|
||||||
|
<property name="title">
|
||||||
|
<string>Inbound parts</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="vl_InboundParts">
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::Views::CAircraftPartsView" name="tvp_AircraftParts">
|
||||||
|
<property name="selectionMode">
|
||||||
|
<enum>QAbstractItemView::SingleSelection</enum>
|
||||||
|
</property>
|
||||||
|
<property name="selectionBehavior">
|
||||||
|
<enum>QAbstractItemView::SelectRows</enum>
|
||||||
|
</property>
|
||||||
|
<attribute name="verticalHeaderVisible">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QWidget" name="tb_TextLog">
|
||||||
|
<attribute name="title">
|
||||||
|
<string>Text log.</string>
|
||||||
|
</attribute>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QTextEdit" name="te_TextLog">
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -72,7 +421,39 @@
|
|||||||
<header>blackgui/components/callsigncompleter.h</header>
|
<header>blackgui/components/callsigncompleter.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::Views::CAircraftPartsView</class>
|
||||||
|
<extends>QTableView</extends>
|
||||||
|
<header>blackgui/views/aircraftpartsview.h</header>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::Views::CAircraftSituationView</class>
|
||||||
|
<extends>QTableView</extends>
|
||||||
|
<header>blackgui/views/aircraftsituationview.h</header>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::CLedWidget</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>blackgui/led.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
|
<tabstops>
|
||||||
|
<tabstop>comp_CallsignCompleter</tabstop>
|
||||||
|
<tabstop>le_UpdateTime</tabstop>
|
||||||
|
<tabstop>hs_UpdateTime</tabstop>
|
||||||
|
<tabstop>le_CG</tabstop>
|
||||||
|
<tabstop>le_Parts</tabstop>
|
||||||
|
<tabstop>le_GndFlag</tabstop>
|
||||||
|
<tabstop>le_ElevationReq</tabstop>
|
||||||
|
<tabstop>le_Elevation</tabstop>
|
||||||
|
<tabstop>tvp_AircraftSituations</tabstop>
|
||||||
|
<tabstop>tvp_AircraftParts</tabstop>
|
||||||
|
<tabstop>tw_LogTabs</tabstop>
|
||||||
|
<tabstop>te_TextLog</tabstop>
|
||||||
|
<tabstop>le_ElevationRec</tabstop>
|
||||||
|
<tabstop>pb_StartStop</tabstop>
|
||||||
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -17,13 +17,22 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
CInterpolationLogDisplayDialog::CInterpolationLogDisplayDialog(CSimulatorCommon *simulatorCommon, QWidget *parent) :
|
CInterpolationLogDisplayDialog::CInterpolationLogDisplayDialog(CSimulatorCommon *simulatorCommon, CAirspaceMonitor *airspaceMonitor, QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::CInterpolationLogDisplayDialog)
|
ui(new Ui::CInterpolationLogDisplayDialog)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||||
this->setSimulator(simulatorCommon);
|
this->setSimulator(simulatorCommon);
|
||||||
|
|
||||||
|
if (airspaceMonitor)
|
||||||
|
{
|
||||||
|
this->setAirspaceMonitor(airspaceMonitor);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->comp_InterpolationLogDisplay->linkWithAirspaceMonitor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CInterpolationLogDisplayDialog::~CInterpolationLogDisplayDialog()
|
CInterpolationLogDisplayDialog::~CInterpolationLogDisplayDialog()
|
||||||
@@ -33,5 +42,10 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
ui->comp_InterpolationLogDisplay->setSimulator(simulatorCommon);
|
ui->comp_InterpolationLogDisplay->setSimulator(simulatorCommon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CInterpolationLogDisplayDialog::setAirspaceMonitor(CAirspaceMonitor *airspaceMonitor)
|
||||||
|
{
|
||||||
|
ui->comp_InterpolationLogDisplay->setAirspaceMonitor(airspaceMonitor);
|
||||||
|
}
|
||||||
} // ns
|
} // ns
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -16,8 +16,12 @@
|
|||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace BlackCore
|
||||||
|
{
|
||||||
|
class CSimulatorCommon;
|
||||||
|
class CAirspaceMonitor;
|
||||||
|
}
|
||||||
namespace Ui { class CInterpolationLogDisplayDialog; }
|
namespace Ui { class CInterpolationLogDisplayDialog; }
|
||||||
namespace BlackCore { class CSimulatorCommon; }
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
{
|
{
|
||||||
namespace Components
|
namespace Components
|
||||||
@@ -31,7 +35,9 @@ namespace BlackGui
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
//! Constructor
|
//! Constructor
|
||||||
explicit CInterpolationLogDisplayDialog(BlackCore::CSimulatorCommon *simulatorCommon, QWidget *parent = nullptr);
|
explicit CInterpolationLogDisplayDialog(
|
||||||
|
BlackCore::CSimulatorCommon *simulatorCommon, BlackCore::CAirspaceMonitor *airspaceMonitor,
|
||||||
|
QWidget *parent = nullptr);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
virtual ~CInterpolationLogDisplayDialog();
|
virtual ~CInterpolationLogDisplayDialog();
|
||||||
@@ -39,6 +45,9 @@ namespace BlackGui
|
|||||||
//! Set simulator
|
//! Set simulator
|
||||||
void setSimulator(BlackCore::CSimulatorCommon *simulatorCommon);
|
void setSimulator(BlackCore::CSimulatorCommon *simulatorCommon);
|
||||||
|
|
||||||
|
//! Set airspace monitor
|
||||||
|
void setAirspaceMonitor(BlackCore::CAirspaceMonitor *airspaceMonitor);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QScopedPointer<Ui::CInterpolationLogDisplayDialog> ui;
|
QScopedPointer<Ui::CInterpolationLogDisplayDialog> ui;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>260</width>
|
<width>299</width>
|
||||||
<height>276</height>
|
<height>341</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace BlackSimPlugin
|
|||||||
if (!m_interpolationDisplay)
|
if (!m_interpolationDisplay)
|
||||||
{
|
{
|
||||||
QWidget *parentWidget = sGui ? sGui->mainApplicationWidget() : nullptr;
|
QWidget *parentWidget = sGui ? sGui->mainApplicationWidget() : nullptr;
|
||||||
CInterpolationLogDisplayDialog *dialog = new CInterpolationLogDisplayDialog(this, parentWidget);
|
CInterpolationLogDisplayDialog *dialog = new CInterpolationLogDisplayDialog(this, nullptr, parentWidget);
|
||||||
m_interpolationDisplay = dialog;
|
m_interpolationDisplay = dialog;
|
||||||
}
|
}
|
||||||
m_interpolationDisplay->show();
|
m_interpolationDisplay->show();
|
||||||
|
|||||||
Reference in New Issue
Block a user