refs #393, allow to highlight a certain aircraft by blinking

* signatures in contexts
* some specialized functions in aircraft list
* context menus in aircraft view
* default "blinking" implementation in driver common base class
This commit is contained in:
Klaus Basan
2015-03-23 19:50:15 +01:00
parent 66da4d7353
commit 70670b74c6
38 changed files with 557 additions and 78 deletions

View File

@@ -20,6 +20,7 @@ using namespace BlackGui::Views;
using namespace BlackGui::Models;
using namespace BlackCore;
using namespace BlackMisc::Simulation;
using namespace BlackMisc::PhysicalQuantities;
namespace BlackGui
{
@@ -33,11 +34,14 @@ namespace BlackGui
ui->setupUi(this);
this->tabBar()->setExpanding(false);
this->ui->tvp_AirportsInRange->setResizeMode(CAirportView::ResizingOnce);
m_updateTimer = new CUpdateTimer(&CAircraftComponent::update, this);
this->ui->tvp_AircraftInRange->setAircraftMode(CSimulatedAircraftListModel::InfoMode);
this->ui->tvp_AircraftInRange->configureMenu(true, false, false);
connect(this->ui->tvp_AircraftInRange, &CSimulatedAircraftView::rowCountChanged, this, &CAircraftComponent::ps_onRowCountChanged);
connect(this->ui->tvp_AircraftInRange, &CSimulatedAircraftView::requestTextMessageWidget, this, &CAircraftComponent::requestTextMessageWidget);
connect(this->ui->tvp_AircraftInRange, &CSimulatedAircraftView::requestHighlightInSimulator, this, &CAircraftComponent::ps_onMenuHighlightInSimulator);
connect(this->ui->tvp_AirportsInRange, &CSimulatedAircraftView::rowCountChanged, this, &CAircraftComponent::ps_onRowCountChanged);
}
@@ -125,5 +129,13 @@ namespace BlackGui
}
}
void CAircraftComponent::ps_onMenuHighlightInSimulator(const CSimulatedAircraft &aircraft)
{
if (getIContextSimulator())
{
getIContextSimulator()->highlightAircraft(aircraft, true, IContextSimulator::HighlightTime());
}
}
} // namespace
} // namespace

View File

@@ -80,6 +80,9 @@ namespace BlackGui
//! Connection status has been changed
void ps_connectionStatusChanged(int from, int to);
//! Highlight in simulator
void ps_onMenuHighlightInSimulator(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
private:
QScopedPointer<Ui::CAircraftComponent> ui;
CUpdateTimer *m_updateTimer = nullptr;

View File

@@ -24,6 +24,7 @@ using namespace BlackMisc;
using namespace BlackMisc::Simulation;
using namespace BlackMisc::Network;
using namespace BlackMisc::Aviation;
using namespace BlackMisc::PhysicalQuantities;
using namespace BlackCore;
using namespace BlackGui;
using namespace BlackGui::Views;
@@ -54,6 +55,7 @@ namespace BlackGui
connect(this->ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::requestTextMessageWidget, this, &CMappingComponent::requestTextMessageWidget);
connect(this->ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::requestEnableAircraft, this, &CMappingComponent::ps_onMenuEnableAircraft);
connect(this->ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::requestFastPositionUpdates, this, &CMappingComponent::ps_onMenuChangeFastPositionUpdates);
connect(this->ui->tvp_SimulatedAircraft, &CSimulatedAircraftView::requestHighlightInSimulator, this, &CMappingComponent::ps_onMenuHighlightInSimulator);
connect(this->ui->pb_SaveAircraft, &QPushButton::clicked, this, &CMappingComponent::ps_onSaveAircraft);
@@ -93,8 +95,8 @@ namespace BlackGui
Q_ASSERT(getIContextNetwork());
connect(getIContextSimulator(), &IContextSimulator::installedAircraftModelsChanged, this, &CMappingComponent::ps_onAircraftModelsLoaded);
connect(getIContextSimulator(), &IContextSimulator::modelMatchingCompleted, this, &CMappingComponent::ps_onModelMatchingCompleted);
connect(getIContextNetwork(), &IContextNetwork::changedRenderedAircraftModel, this, &CMappingComponent::ps_onRenderedAircraftModelChanged);
connect(getIContextNetwork(), &IContextNetwork::changedAircraftEnabled, this, &CMappingComponent::ps_onChangedAircraftEnabled);
connect(getIContextNetwork(), &IContextNetwork::changedRemoteAircraftModel, this, &CMappingComponent::ps_onRenderedAircraftModelChanged);
connect(getIContextNetwork(), &IContextNetwork::changedRemoteAircraftEnabled, this, &CMappingComponent::ps_onChangedAircraftEnabled);
connect(getIContextNetwork(), &IContextNetwork::changedFastPositionUpdates, this, &CMappingComponent::ps_onFastPositionUpdatesEnabled);
connect(getIContextNetwork(), &IContextNetwork::connectionStatusChanged, this, &CMappingComponent::ps_onConnectionStatusChanged);
@@ -339,6 +341,14 @@ namespace BlackGui
}
}
void CMappingComponent::ps_onMenuHighlightInSimulator(const CSimulatedAircraft &aircraft)
{
if (getIContextSimulator())
{
getIContextSimulator()->highlightAircraft(aircraft, true, IContextSimulator::HighlightTime());
}
}
void CMappingComponent::ps_onMenuEnableAircraft(const CSimulatedAircraft &aircraft)
{
if (getIContextNetwork())

View File

@@ -112,6 +112,9 @@ namespace BlackGui
//! Reload models
void ps_onMenuRequestModelReload();
//! Highlight in simulator
void ps_onMenuHighlightInSimulator(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
private:
static const QString &mappingtOriginator();
void updateSimulatedAircraftView();