8 #include "ui_settingsmatchingcomponent.h"
16 using namespace swift::misc::simulation;
17 using namespace swift::core::context;
21 CSettingsMatchingComponent::CSettingsMatchingComponent(QWidget *parent)
25 connect(ui->pb_Save, &QPushButton::released,
this, &CSettingsMatchingComponent::onSavePressed);
26 connect(ui->pb_Reload, &QPushButton::released,
this, &CSettingsMatchingComponent::onReloadPressed);
27 connect(ui->pb_MatchingAgain, &QPushButton::released,
this,
28 &CSettingsMatchingComponent::onMatchingsAgainPressed);
34 connect(simContext, &IContextSimulator::matchingSetupChanged,
this,
35 &CSettingsMatchingComponent::onSetupChanged, Qt::QueuedConnection);
36 this->deferredReload(5000);
47 ui->form_Matching->setValue(setup);
52 void CSettingsMatchingComponent::onSavePressed()
const
55 if (!simContext) {
return; }
60 void CSettingsMatchingComponent::onReloadPressed() { this->deferredReload(0); }
62 void CSettingsMatchingComponent::onMatchingsAgainPressed()
66 CLogMessage(
this).
info(u
"Triggered re-apping of %1 aircraft") << reMatchedNo;
69 void CSettingsMatchingComponent::onSetupChanged()
72 if (!simContext) {
return; }
73 this->deferredReload(0);
76 void CSettingsMatchingComponent::deferredReload(
int deferMs)
79 if (!simContext) {
return; }
83 ui->form_Matching->setValue(setup);
87 QPointer<CSettingsMatchingComponent> myself(
this);
89 if (!myself) {
return; }
90 this->deferredReload(0);
QPointer< ISimulator > getISimulator() const
The simulator plugin, if available.
bool isShuttingDown() const
Is application shutting down?
const context::IContextSimulator * getIContextSimulator() const
Direct access to contexts if a CCoreFacade has been initialized.
virtual int doMatchingsAgain()=0
Repeat all matchings.
virtual swift::misc::simulation::CAircraftMatcherSetup getMatchingSetup() const =0
Get matching setup.
virtual void setMatchingSetup(const swift::misc::simulation::CAircraftMatcherSetup &setup)=0
Set matching setup.
Settings for matching component.
void setMatchingSetup(const swift::misc::simulation::CAircraftMatcherSetup &setup)
Set setup.
swift::misc::simulation::CAircraftMatcherSetup getMatchingSetup() const
Get setup.
void showButtons(bool show)
Show buttons.
virtual ~CSettingsMatchingComponent()
Destructor.
Class for emitting a log message.
Derived & info(const char16_t(&format)[N])
Set the severity to info, providing a format string.
SWIFT_GUI_EXPORT swift::gui::CGuiApplication * sGui
Single instance of GUI application object.
High level reusable GUI components.
Free functions in swift::misc.
auto singleShot(int msec, QObject *target, F &&task)
Starts a single-shot timer which will call a task in the thread of the given object when it times out...