Ref T261, allow to enable/disable "fix scenery offset" via setup

* added UI functions
* fixed setup model
* use setup in interpolator
This commit is contained in:
Klaus Basan
2018-05-08 09:38:18 +02:00
committed by Roland Winklmeier
parent ea585ae166
commit 2e7e210010
7 changed files with 85 additions and 55 deletions

View File

@@ -42,7 +42,8 @@ namespace BlackGui
ui->cb_EnableParts->setChecked(setup.isAircraftPartsEnabled());
ui->cb_ForceFullInterpolation->setChecked(setup.isForcingFullInterpolation());
ui->cb_EnableGndFlag->setChecked(setup.isGndFlagEnabled());
ui->cb_SendGndFlagToSim->setChecked(setup.sendGndFlagToSimulator());
ui->cb_SendGndFlagToSim->setChecked(setup.isSendingGndFlagToSimulator());
ui->cb_FixSceneryOffset->setChecked(setup.isFixingSceneryOffset());
const QString im = setup.getInterpolatorModeAsString();
if (im.contains("linear", Qt::CaseInsensitive)) { ui->co_InterpolatorMode->setCurrentIndex(1); }
@@ -56,8 +57,9 @@ namespace BlackGui
setup.setEnabledGndFLag(ui->cb_EnableGndFlag->isChecked());
setup.setForceFullInterpolation(ui->cb_ForceFullInterpolation->isChecked());
setup.setLogInterpolation(ui->cb_LogInterpolation->isChecked());
setup.setSendGndFlagToSimulator(ui->cb_SendGndFlagToSim->isChecked());
setup.setSendingGndFlagToSimulator(ui->cb_SendGndFlagToSim->isChecked());
setup.setSimulatorDebuggingMessages(ui->cb_DebugDriver->isChecked());
setup.setFixingSceneryOffset(ui->cb_FixSceneryOffset->isChecked());
setup.setInterpolatorMode(ui->co_InterpolatorMode->currentText());
return setup;
}
@@ -70,6 +72,7 @@ namespace BlackGui
CGuiUtility::checkBoxReadOnly(ui->cb_ForceFullInterpolation, readonly);
CGuiUtility::checkBoxReadOnly(ui->cb_EnableGndFlag, readonly);
CGuiUtility::checkBoxReadOnly(ui->cb_SendGndFlagToSim, readonly);
CGuiUtility::checkBoxReadOnly(ui->cb_FixSceneryOffset, readonly);
ui->co_InterpolatorMode->setEnabled(!readonly);
}

View File

@@ -14,13 +14,6 @@
<string>Frame</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="0">
<widget class="QCheckBox" name="cb_ForceFullInterpolation">
<property name="text">
<string>force full interpolation</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="cb_DebugDriver">
<property name="text">
@@ -28,23 +21,6 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="cb_EnableGndFlag">
<property name="text">
<string>use gnd.flag</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cb_EnableParts">
<property name="text">
<string>enable parts</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="cb_LogInterpolation">
<property name="text">
@@ -52,13 +28,6 @@
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="cb_SendGndFlagToSim">
<property name="text">
<string>send gnd.to simulator</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QComboBox" name="co_InterpolatorMode">
<item>
@@ -73,6 +42,44 @@
</item>
</widget>
</item>
<item row="0" column="1">
<widget class="QCheckBox" name="cb_EnableParts">
<property name="text">
<string>enable parts</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="cb_EnableGndFlag">
<property name="text">
<string>use (network) gnd.flag</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="cb_SendGndFlagToSim">
<property name="text">
<string>send gnd.to simulator</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="cb_ForceFullInterpolation">
<property name="text">
<string>force full interpolation</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="cb_FixSceneryOffset">
<property name="text">
<string>fix scenery offset</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@@ -25,13 +25,14 @@ namespace BlackGui
CListModelCallsignObjects("CInterpolationSetupListModel", parent)
{
m_columns.addColumn(CColumn::standardValueObject("cs.", "callsign", CInterpolationAndRenderingSetupPerCallsign::IndexCallsign, CCallsign::IndexCallsignString));
this->m_columns.addColumn(CColumn::standardString("interpolator", CInterpolationAndRenderingSetupPerCallsign::IndexInterpolatorModeAsString));
m_columns.addColumn(CColumn("parts", "aircraft parts", CInterpolationAndRenderingSetupPerCallsign::IndexEnabledAircraftParts, new CBoolIconFormatter("parts", "aircraft parts")));
m_columns.addColumn(CColumn("en.gnd.", "enable gnd (network)", CInterpolationAndRenderingSetupPerCallsign::IndexEnableGndFlag, new CBoolIconFormatter("en.gnd.", "enable gnd.")));
m_columns.addColumn(CColumn("send gnd.", "send gnd.", CInterpolationAndRenderingSetupPerCallsign::IndexSendGndFlagToSimulator, new CBoolIconFormatter("send gnd.", "send gnd.")));
m_columns.addColumn(CColumn("sc.os.", "fix scenery offset", CInterpolationAndRenderingSetupPerCallsign::IndexFixSceneryOffset, new CBoolIconFormatter("sc.os.", "fix scenery offset")));
m_columns.addColumn(CColumn("full", "full int.", CInterpolationAndRenderingSetupPerCallsign::IndexForceFullInterpolation, new CBoolIconFormatter("full", "full int.")));
m_columns.addColumn(CColumn("sim.dbg.", "simulator debug", CInterpolationAndRenderingSetupPerCallsign::IndexSimulatorDebugMessages, new CBoolIconFormatter("sim.dbg.", "simulator debug")));
m_columns.addColumn(CColumn("log.int.", "log.interpolation", CInterpolationAndRenderingSetupPerCallsign::IndexLogInterpolation, new CBoolIconFormatter("log.int.", "log.interpolation")));
m_columns.addColumn(CColumn("parts", "aircraft parts", CInterpolationAndRenderingSetupPerCallsign::IndexEnabledAircraftParts, new CBoolIconFormatter("parts", "aircraft parts")));
m_columns.addColumn(CColumn("log.int.", "log.interpolation", CInterpolationAndRenderingSetupPerCallsign::IndexEnableGndFlag, new CBoolIconFormatter("log.int.", "log.interpolation")));
m_columns.addColumn(CColumn("send gnd.", "send gnd.", CInterpolationAndRenderingSetupPerCallsign::IndexSendGndFlagToSimulator, new CBoolIconFormatter("send gnd.", "send gnd.")));
m_columns.addColumn(CColumn("full", "full int.", CInterpolationAndRenderingSetupPerCallsign::IndexForceFullInterpolation, new CBoolIconFormatter("full", "full int.")));
// default sort order
this->setSortColumnByPropertyIndex(CCountry::IndexIsoCode);
m_sortOrder = Qt::AscendingOrder;