]> sigrok.org Git - pulseview.git/commitdiff
Fix #979 by querying trigger types only once and storing them
authorSoeren Apel <redacted>
Sun, 10 Jun 2018 06:54:46 +0000 (08:54 +0200)
committerUwe Hermann <redacted>
Fri, 15 Jun 2018 19:42:29 +0000 (21:42 +0200)
pv/views/trace/logicsignal.cpp
pv/views/trace/logicsignal.hpp

index 870af9c5fce2caa04dc718afd66209ae7b1c23e9..79065ebd4740fbb7ffc215abcded4f18d53d15b9 100644 (file)
@@ -103,6 +103,7 @@ LogicSignal::LogicSignal(
        shared_ptr<data::SignalBase> base) :
        Signal(session, base),
        device_(device),
+       trigger_types_(get_trigger_types()),
        trigger_none_(nullptr),
        trigger_rising_(nullptr),
        trigger_high_(nullptr),
@@ -295,9 +296,8 @@ void LogicSignal::paint_fore(QPainter &p, ViewItemPaintParams &pp)
        // Draw the trigger marker
        if (base_->enabled() && trigger_match_) {
                const int y = get_visual_y();
-               const vector<int32_t> trig_types = get_trigger_types();
 
-               for (int32_t type_id : trig_types) {
+               for (int32_t type_id : trigger_types_) {
                        const TriggerMatchType *const type =
                                TriggerMatchType::get(type_id);
                        if (trigger_match_ != type || type_id < 0 ||
index e49d69b3d6fac6d408f0efe3ba78bc5f5a1f66da..45e815bae79e0d4e3fc8a68916be14a39183a9cd 100644 (file)
@@ -147,6 +147,7 @@ private:
        QSpinBox *signal_height_sb_;
 
        const sigrok::TriggerMatchType *trigger_match_;
+       const vector<int32_t> trigger_types_;
        QToolBar *trigger_bar_;
        QAction *trigger_none_;
        QAction *trigger_rising_;