From 87d2b5992d400239240709adc6503e500ea7e058 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 5 Feb 2017 11:49:06 +0100 Subject: gui, logic: allow for limiting max X on translation axis also --- gui/mapping-window.cpp | 13 +++--- gui/mapping-window.ui | 114 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+), 5 deletions(-) (limited to 'gui') diff --git a/gui/mapping-window.cpp b/gui/mapping-window.cpp index 7e5ad6e3..05ccddda 100644 --- a/gui/mapping-window.cpp +++ b/gui/mapping-window.cpp @@ -55,12 +55,15 @@ void MapWidget::load() { nullptr, Yaw, nullptr, false } }; + using a = axis_opts::max_clamp; + for (QComboBox* x : { ui.max_yaw_rotation, ui.max_pitch_rotation, ui.max_roll_rotation }) - { - using a = axis_opts::max_rotation; - for (a y : { a::r180, a::r90, a::r60, a::r45, a::r30, a::r20 }) + for (a y : { a::r180, a::r90, a::r60, a::r45, a::r30, a::r25, a::r20, a::r15, a::r10 }) x->addItem(QString::number(y) + "°", y); - } + + for (QComboBox* x : { ui.max_x_translation, ui.max_y_translation, ui.max_z_translation }) + for (a y : { a::t30, a::t20, a::t15, a::t10 }) + x->addItem(QStringLiteral("%1 mm").arg(int(y)), y); for (int i = 0; qfcs[i].qfc; i++) { @@ -76,7 +79,7 @@ void MapWidget::load() static_cast(&base_value::valueChanged), this, [&](bool f) -> void {qfc.setEnabled(f); qfc.force_redraw();}); - qfc.setEnabled(qfcs[i].checkbox->isChecked()); + qfc.setEnabled(axis.opts.altp); qfc.force_redraw(); } diff --git a/gui/mapping-window.ui b/gui/mapping-window.ui index dc43ab8a..befa0194 100644 --- a/gui/mapping-window.ui +++ b/gui/mapping-window.ui @@ -314,6 +314,44 @@ X + + + + + 0 + 0 + + + + QFrame::NoFrame + + + + + + + 0 + 0 + + + + Max translation + + + + + + + + 0 + 0 + + + + + + + @@ -364,6 +402,44 @@ Y + + + + + 0 + 0 + + + + QFrame::NoFrame + + + + + + + 0 + 0 + + + + Max translation + + + + + + + + 0 + 0 + + + + + + + @@ -414,6 +490,44 @@ Z + + + + + 0 + 0 + + + + QFrame::NoFrame + + + + + + + 0 + 0 + + + + Max translation + + + + + + + + 0 + 0 + + + + + + + -- cgit v1.2.3