mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
refs #239, aircraft component
This commit is contained in:
29
src/blackgui/aircraftcomponent.cpp
Normal file
29
src/blackgui/aircraftcomponent.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
#include "aircraftcomponent.h"
|
||||
#include "ui_aircraftcomponent.h"
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
|
||||
CAircraftComponent::CAircraftComponent(QWidget *parent) :
|
||||
QTabWidget(parent), CRuntimeBasedComponent(nullptr, false), ui(new Ui::CAircraftComponent), m_timerComponent(nullptr)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
m_timerComponent = new CTimerBasedComponent(SLOT(update()), this);
|
||||
}
|
||||
|
||||
CAircraftComponent::~CAircraftComponent()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void CAircraftComponent::update()
|
||||
{
|
||||
Q_ASSERT(this->ui->tvp_AircraftsInRange);
|
||||
Q_ASSERT(this->getIContextNetwork());
|
||||
|
||||
if (this->getIContextNetwork()->isConnected())
|
||||
{
|
||||
this->ui->tvp_AircraftsInRange->update(this->getIContextNetwork()->getAircraftsInRange());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user