mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 09:45:44 +08:00
Ref T111, set situation from form in simulator
This commit is contained in:
committed by
Mathew Sutcliffe
parent
c8a21629f1
commit
6572c12016
@@ -12,6 +12,8 @@
|
|||||||
#include "ui_simulatorswiftmonitordialog.h"
|
#include "ui_simulatorswiftmonitordialog.h"
|
||||||
|
|
||||||
using namespace BlackMisc;
|
using namespace BlackMisc;
|
||||||
|
using namespace BlackMisc::Aviation;
|
||||||
|
using namespace BlackGui::Editors;
|
||||||
|
|
||||||
namespace BlackSimPlugin
|
namespace BlackSimPlugin
|
||||||
{
|
{
|
||||||
@@ -37,6 +39,7 @@ namespace BlackSimPlugin
|
|||||||
connect(ui->cb_Connected, &QCheckBox::released, this, &CSimulatorSwiftMonitorDialog::onSimulatorValuesChanged);
|
connect(ui->cb_Connected, &QCheckBox::released, this, &CSimulatorSwiftMonitorDialog::onSimulatorValuesChanged);
|
||||||
connect(ui->cb_Paused, &QCheckBox::released, this, &CSimulatorSwiftMonitorDialog::onSimulatorValuesChanged);
|
connect(ui->cb_Paused, &QCheckBox::released, this, &CSimulatorSwiftMonitorDialog::onSimulatorValuesChanged);
|
||||||
connect(ui->cb_Simulating, &QCheckBox::released, this, &CSimulatorSwiftMonitorDialog::onSimulatorValuesChanged);
|
connect(ui->cb_Simulating, &QCheckBox::released, this, &CSimulatorSwiftMonitorDialog::onSimulatorValuesChanged);
|
||||||
|
connect(ui->comp_Situation, &CSituationForm::changeAircraftSituation, this, &CSimulatorSwiftMonitorDialog::changeSituation);
|
||||||
|
|
||||||
this->setSimulatorUiValues();
|
this->setSimulatorUiValues();
|
||||||
ui->comp_Situation->setSituation(m_simulator->getOwnAircraftSituation());
|
ui->comp_Situation->setSituation(m_simulator->getOwnAircraftSituation());
|
||||||
@@ -90,6 +93,20 @@ namespace BlackSimPlugin
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSimulatorSwiftMonitorDialog::changeSituation()
|
||||||
|
{
|
||||||
|
if (!m_simulator) { return; }
|
||||||
|
const CAircraftSituation s(ui->editor_Situation->getSituation());
|
||||||
|
m_simulator->updateOwnSituation(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CSimulatorSwiftMonitorDialog::changeParts()
|
||||||
|
{
|
||||||
|
if (!m_simulator) { return; }
|
||||||
|
const CAircraftParts p(ui->editor_AircraftParts->getAircraftPartsFromGui());
|
||||||
|
m_simulator->updateOwnParts(p);
|
||||||
|
}
|
||||||
|
|
||||||
void CSimulatorSwiftMonitorDialog::setSimulatorUiValues()
|
void CSimulatorSwiftMonitorDialog::setSimulatorUiValues()
|
||||||
{
|
{
|
||||||
ui->cb_Connected->setChecked(m_simulator->isConnected());
|
ui->cb_Connected->setChecked(m_simulator->isConnected());
|
||||||
|
|||||||
@@ -54,6 +54,12 @@ namespace BlackSimPlugin
|
|||||||
//! UI values changed
|
//! UI values changed
|
||||||
void onSimulatorValuesChanged();
|
void onSimulatorValuesChanged();
|
||||||
|
|
||||||
|
//! Update aircraft situation
|
||||||
|
void changeSituation();
|
||||||
|
|
||||||
|
//! Change the aircraft parts
|
||||||
|
void changeParts();
|
||||||
|
|
||||||
//! UI values
|
//! UI values
|
||||||
void setSimulatorUiValues();
|
void setSimulatorUiValues();
|
||||||
|
|
||||||
|
|||||||
@@ -34,19 +34,6 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
|
||||||
<spacer name="vs_Situation">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>40</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="tb_Simulator">
|
<widget class="QWidget" name="tb_Simulator">
|
||||||
@@ -148,6 +135,19 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="vs_Situation">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QDialogButtonBox" name="bb_SwiftMonitorDialog">
|
<widget class="QDialogButtonBox" name="bb_SwiftMonitorDialog">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|||||||
Reference in New Issue
Block a user