swift
src
gui
components
networkaircraftvaluescomponent.cpp
1
// SPDX-FileCopyrightText: Copyright (C) 2019 swift Project Community / Contributors
2
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
4
#include "
networkaircraftvaluescomponent.h
"
5
6
#include "ui_networkaircraftvaluescomponent.h"
7
8
#include "
core/context/contextnetwork.h
"
9
#include "
core/context/contextownaircraft.h
"
10
#include "
gui/guiapplication.h
"
11
12
using namespace
swift::core::context;
13
14
namespace
swift::gui::components
15
{
16
CNetworkAircraftValuesComponent::CNetworkAircraftValuesComponent(QWidget *parent)
17
: QFrame(parent), ui(new Ui::
CNetworkAircraftValuesComponent
)
18
{
19
ui->setupUi(
this
);
20
}
21
22
CNetworkAircraftValuesComponent::~CNetworkAircraftValuesComponent
()
23
{
24
// void
25
}
26
27
void
CNetworkAircraftValuesComponent::showValues
()
28
{
29
if
(!
sGui
||
sGui
->
isShuttingDown
()) {
return
; }
30
if
(!
sGui
->
getIContextOwnAircraft
() || !
sGui
->
getIContextNetwork
()) {
return
; }
31
32
ui->le_SimModel->setText(
sGui
->
getIContextOwnAircraft
()->
getOwnAircraft
().
getModelString
());
33
const
QStringList values =
sGui
->
getIContextNetwork
()->
getNetworkPresetValues
();
34
if
(values.size() >= 5)
35
{
36
ui->le_SentModel->setText(values.at(0));
37
ui->le_SentLivery->setText(values.at(1));
38
ui->le_Aircraft->setText(values.at(2));
39
ui->le_Airline->setText(values.at(3));
40
ui->le_Callsign->setText(values.at(4));
41
}
42
}
43
}
// namespace swift::gui::components
swift::core::CApplication::getIContextOwnAircraft
const context::IContextOwnAircraft * getIContextOwnAircraft() const
Direct access to contexts if a CCoreFacade has been initialized.
Definition:
application.cpp:1158
swift::core::CApplication::getIContextNetwork
const context::IContextNetwork * getIContextNetwork() const
Direct access to contexts if a CCoreFacade has been initialized.
Definition:
application.cpp:1134
swift::core::CApplication::isShuttingDown
bool isShuttingDown() const
Is application shutting down?
Definition:
application.cpp:240
swift::core::context::IContextNetwork::getNetworkPresetValues
virtual QStringList getNetworkPresetValues() const =0
Network preset values.
swift::core::context::IContextOwnAircraft::getOwnAircraft
virtual swift::misc::simulation::CSimulatedAircraft getOwnAircraft() const =0
Get own aircraft.
swift::gui::components::CNetworkAircraftValuesComponent
Display the network aircraft values as sent.
Definition:
networkaircraftvaluescomponent.h:20
swift::gui::components::CNetworkAircraftValuesComponent::showValues
void showValues()
Show the current values.
Definition:
networkaircraftvaluescomponent.cpp:27
swift::gui::components::CNetworkAircraftValuesComponent::~CNetworkAircraftValuesComponent
virtual ~CNetworkAircraftValuesComponent()
Destructor.
Definition:
networkaircraftvaluescomponent.cpp:22
swift::misc::simulation::CSimulatedAircraft::getModelString
const QString & getModelString() const
Get model string.
Definition:
simulatedaircraft.h:410
contextnetwork.h
contextownaircraft.h
guiapplication.h
sGui
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
Definition:
guiapplication.cpp:65
swift::gui::components
High level reusable GUI components.
Definition:
aboutdialog.cpp:13
networkaircraftvaluescomponent.h
Generated on Mon Mar 24 2025 16:42:20 for swift by
1.9.1