From: Soeren Apel Date: Sun, 15 Nov 2020 19:58:40 +0000 (+0100) Subject: Fix #1637 by auto-assigning only to unused signals X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8ff61402dc4ac33630deeb077e8a744a7daba6a4;p=pulseview.git Fix #1637 by auto-assigning only to unused signals --- diff --git a/pv/data/decodesignal.cpp b/pv/data/decodesignal.cpp index ed29cafe..bda8d51e 100644 --- a/pv/data/decodesignal.cpp +++ b/pv/data/decodesignal.cpp @@ -308,7 +308,13 @@ void DecodeSignal::auto_assign_signals(const shared_ptr dec) } } - if (match) { + // Prevent using a signal more than once as D1 would match e.g. D1 and D10 + bool signal_not_already_used = true; + for (decode::DecodeChannel& ch : channels_) + if (ch.assigned_signal && (ch.assigned_signal == match)) + signal_not_already_used = false; + + if (match && signal_not_already_used) { ch.assigned_signal = match; new_assignment = true; }