mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-29 12:45:40 +08:00
Ref T335, UI to enable/disable terrain probe
This commit is contained in:
@@ -25,7 +25,10 @@ namespace BlackSimPlugin
|
|||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->cb_TraceSimConnectCalls->setChecked(false);
|
ui->cb_TraceSimConnectCalls->setChecked(false);
|
||||||
|
|
||||||
connect(ui->cb_TraceSimConnectCalls, &QCheckBox::released, this, &CFsxSettingsComponent::onSimConnectTraceChanged);
|
connect(ui->cb_TraceSimConnectCalls, &QCheckBox::released, this, &CFsxSettingsComponent::onSimConnectTraceChanged);
|
||||||
|
connect(ui->cb_EnableTerrainProbe, &QCheckBox::released, this, &CFsxSettingsComponent::onEnableTerrainProbeChanged);
|
||||||
|
|
||||||
const CSimulatorFsxCommon *fsx = this->getFsxSimulator();
|
const CSimulatorFsxCommon *fsx = this->getFsxSimulator();
|
||||||
if (fsx)
|
if (fsx)
|
||||||
{
|
{
|
||||||
@@ -43,9 +46,16 @@ namespace BlackSimPlugin
|
|||||||
fsx->setTractingSendId(ui->cb_TraceSimConnectCalls->isChecked());
|
fsx->setTractingSendId(ui->cb_TraceSimConnectCalls->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CFsxSettingsComponent::onEnableTerrainProbeChanged()
|
||||||
|
{
|
||||||
|
CSimulatorFsxCommon *fsx = this->getFsxSimulator();
|
||||||
|
if (!fsx) { return; }
|
||||||
|
fsx->setUsingFsxTerrainProbe(ui->cb_EnableTerrainProbe->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
CSimulatorFsxCommon *CFsxSettingsComponent::getFsxSimulator() const
|
CSimulatorFsxCommon *CFsxSettingsComponent::getFsxSimulator() const
|
||||||
{
|
{
|
||||||
if (!sGui || !sGui->getISimulator()) { return nullptr; }
|
if (!sGui || !sGui->getISimulator() || sGui->isShuttingDown()) { return nullptr; }
|
||||||
ISimulator *sim = sGui->getISimulator();
|
ISimulator *sim = sGui->getISimulator();
|
||||||
if (!sim->getSimulatorInfo().isFsxP3DFamily()) { return nullptr; }
|
if (!sim->getSimulatorInfo().isFsxP3DFamily()) { return nullptr; }
|
||||||
if (sim->getSimulatorInfo() != m_simulator) { return nullptr; }
|
if (sim->getSimulatorInfo() != m_simulator) { return nullptr; }
|
||||||
|
|||||||
@@ -39,9 +39,12 @@ namespace BlackSimPlugin
|
|||||||
void setSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator) { m_simulator = simulator; }
|
void setSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator) { m_simulator = simulator; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
//! Checkbox change
|
//! Trace checkbox changed
|
||||||
void onSimConnectTraceChanged();
|
void onSimConnectTraceChanged();
|
||||||
|
|
||||||
|
//! Terrain probe checkbox changed
|
||||||
|
void onEnableTerrainProbeChanged();
|
||||||
|
|
||||||
//! Access the concrete implementation
|
//! Access the concrete implementation
|
||||||
CSimulatorFsxCommon *getFsxSimulator () const;
|
CSimulatorFsxCommon *getFsxSimulator () const;
|
||||||
|
|
||||||
|
|||||||
@@ -6,22 +6,22 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>326</width>
|
<width>180</width>
|
||||||
<height>47</height>
|
<height>64</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>FSX settings</string>
|
<string>FSX settings</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="hl_FsxSettingsComponent" stretch="0,1">
|
<layout class="QGridLayout" name="gl_FsxSettingsComponent">
|
||||||
<item>
|
<item row="0" column="0">
|
||||||
<widget class="QCheckBox" name="cb_TraceSimConnectCalls">
|
<widget class="QCheckBox" name="cb_TraceSimConnectCalls">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="lbl_TraceSimConnectCalls">
|
<widget class="QLabel" name="lbl_TraceSimConnectCalls">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Trace simConnect calls (this will trace sendId calls and provide further information)</string>
|
<string>Trace simConnect calls (this will trace sendId calls and provide further information)</string>
|
||||||
@@ -31,6 +31,20 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QCheckBox" name="cb_EnableTerrainProbe">
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QLabel" name="lbl_TraceTerrainProbe">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use the terrain probe</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace BlackSimPlugin
|
|||||||
CSimulatorFsxConfig(QObject *parent = nullptr);
|
CSimulatorFsxConfig(QObject *parent = nullptr);
|
||||||
|
|
||||||
//! Dtor
|
//! Dtor
|
||||||
virtual ~CSimulatorFsxConfig() {}
|
virtual ~CSimulatorFsxConfig() override {}
|
||||||
|
|
||||||
//! \copydoc BlackGui::IPluginConfig::createConfigWindow()
|
//! \copydoc BlackGui::IPluginConfig::createConfigWindow()
|
||||||
BlackGui::CPluginConfigWindow *createConfigWindow(QWidget *parent) override;
|
BlackGui::CPluginConfigWindow *createConfigWindow(QWidget *parent) override;
|
||||||
|
|||||||
Reference in New Issue
Block a user