From e0866f30d25abd62fadb4b29fff90143c288e9ff Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 18 Jan 2018 23:08:30 +0100 Subject: logic: change relative translation triggering Relative translation mode now has three states: - disabled - always enabled - enabled when not aiming In the third mode, looking very close to center disables reltrans. The exact values aren't final. --- gui/settings-dialog.ui | 89 ++++++++++++++++++++++++++++++++++---------------- gui/settings.cpp | 23 +++++++++---- 2 files changed, 77 insertions(+), 35 deletions(-) (limited to 'gui') diff --git a/gui/settings-dialog.ui b/gui/settings-dialog.ui index 363edb3a..20a1b524 100644 --- a/gui/settings-dialog.ui +++ b/gui/settings-dialog.ui @@ -1785,13 +1785,47 @@ - - - - - - Enable - + + + + + + + 10 + 0 + + + + Mode + + + + + + + + 4 + 0 + + + + + Disabled + + + + + Enabled + + + + + Enabled when not aiming + + + + + @@ -1825,7 +1859,7 @@ 0 - + 3 @@ -1836,12 +1870,12 @@ - Disable for X + Disable for Y - - + + 3 @@ -1852,40 +1886,40 @@ - Disable for Y + Disable for X - - + + - 3 + 2 0 - - - - Disable for Z (for zoom on Z axis) + Disable effect by roll - - + + - 2 + 3 0 + + + - Disable effect by yaw + Disable for Z (for zoom on Z axis) - + @@ -1898,8 +1932,8 @@ - - + + 2 @@ -1907,7 +1941,7 @@ - Disable effect by roll + Disable effect by yaw @@ -2147,7 +2181,6 @@ src_z invert_z tracklogging_enabled - tcomp_enable tcomp_tx_disable tcomp_ty_disable tcomp_tz_disable diff --git a/gui/settings.cpp b/gui/settings.cpp index fe0b3261..fc7cde19 100644 --- a/gui/settings.cpp +++ b/gui/settings.cpp @@ -54,15 +54,24 @@ options_dialog::options_dialog(std::function pause_keybindings) : tie_setting(main.center_at_startup, ui.center_at_startup); - tie_setting(main.tcomp_p, ui.tcomp_enable); + const reltrans_state reltrans_modes[] = { + reltrans_disabled, + reltrans_enabled, + reltrans_non_center, + }; + + for (unsigned k = 0; k < 3; k++) + ui.reltrans_mode->setItemData(k, int(reltrans_modes[k])); + + tie_setting(main.reltrans_mode, ui.reltrans_mode); - tie_setting(main.tcomp_disable_tx, ui.tcomp_tx_disable); - tie_setting(main.tcomp_disable_ty, ui.tcomp_ty_disable); - tie_setting(main.tcomp_disable_tz, ui.tcomp_tz_disable); + tie_setting(main.reltrans_disable_tx, ui.tcomp_tx_disable); + tie_setting(main.reltrans_disable_ty, ui.tcomp_ty_disable); + tie_setting(main.reltrans_disable_tz, ui.tcomp_tz_disable); - tie_setting(main.tcomp_disable_src_yaw, ui.tcomp_src_yaw_disable); - tie_setting(main.tcomp_disable_src_pitch, ui.tcomp_src_pitch_disable); - tie_setting(main.tcomp_disable_src_roll, ui.tcomp_src_roll_disable); + tie_setting(main.reltrans_disable_src_yaw, ui.tcomp_src_yaw_disable); + tie_setting(main.reltrans_disable_src_pitch, ui.tcomp_src_pitch_disable); + tie_setting(main.reltrans_disable_src_roll, ui.tcomp_src_roll_disable); tie_setting(main.neck_z, ui.neck_z); -- cgit v1.2.3