]> sigrok.org Git - pulseview.git/commitdiff
Fix #1270 by replacing insignificant characters before comparing
authorSoeren Apel <redacted>
Thu, 6 Sep 2018 07:25:13 +0000 (09:25 +0200)
committerSoeren Apel <redacted>
Thu, 6 Sep 2018 20:54:38 +0000 (22:54 +0200)
pv/data/decodesignal.cpp

index 405e06e145b50ed15743af7e47892125c297613d..9b40540c7032b058f988f8cb8d903d6763b3d97f 100644 (file)
@@ -303,14 +303,16 @@ void DecodeSignal::auto_assign_signals(const shared_ptr<Decoder> dec)
                if (ch.assigned_signal)
                        continue;
 
-               const QString ch_name = ch.name.toLower();
+               QString ch_name = ch.name.toLower();
+               ch_name = ch_name.replace(QRegExp("[-_.]"), " ");
 
                shared_ptr<data::SignalBase> match;
                for (shared_ptr<data::SignalBase> s : session_.signalbases()) {
                        if (!s->enabled())
                                continue;
 
-                       const QString s_name = s->name().toLower();
+                       QString s_name = s->name().toLower();
+                       s_name = s_name.replace(QRegExp("[-_.]"), " ");
 
                        if (s->logic_data() &&
                                ((ch_name.contains(s_name)) || (s_name.contains(ch_name)))) {