diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-08-18 08:31:38 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-08-18 08:33:40 +0200 |
commit | 775199ec9da3bae2c16f0a7fe52a3ddb1addb36d (patch) | |
tree | b23e194cae428f9f478d50600ab0747ef1fec687 /logic | |
parent | 72992a8b45987a46d8eaff90a46a87e765117302 (diff) |
logic/pipeline: fix toggle button
Issue: #1210
Diffstat (limited to 'logic')
-rw-r--r-- | logic/pipeline.cpp | 11 | ||||
-rw-r--r-- | logic/pipeline.hpp | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/logic/pipeline.cpp b/logic/pipeline.cpp index 658c62bb..39c75e99 100644 --- a/logic/pipeline.cpp +++ b/logic/pipeline.cpp @@ -442,14 +442,13 @@ void pipeline::logic() nan_check(value); } - if (!hold_ordered) - goto ok; + goto ok; error: { QMutexLocker foo(&mtx); - value = output_pose; + value = last_value; raw = raw_6dof; // for widget last value display @@ -465,8 +464,10 @@ ok: for (int i = 0; i < 6; i++) value(i) = 0; - if (hold_ordered) value = output_pose; - else value = apply_zero_pos(value); + if (hold_ordered) + value = last_value; + last_value = value; + value = apply_zero_pos(value); ev.run_events(EV::ev_finished, value); libs.pProtocol->pose(value, raw); diff --git a/logic/pipeline.hpp b/logic/pipeline.hpp index 7775054e..fc1f2060 100644 --- a/logic/pipeline.hpp +++ b/logic/pipeline.hpp @@ -87,7 +87,7 @@ class OTR_LOGIC_EXPORT pipeline : private QThread event_handler& ev; Timer t; - Pose output_pose, raw_6dof; + Pose output_pose, raw_6dof, last_value; Pose newpose; runtime_libraries const& libs; |