]> sigrok.org Git - pulseview.git/blobdiff - pv/view/logicsignal.cpp
LogicSignal: Added set_logic_data
[pulseview.git] / pv / view / logicsignal.cpp
index c6b7cffa361253495c2a2d7c541de7920660a292..0d31696100545ae99e80c4fd0f64bc749bc67b48 100644 (file)
@@ -140,6 +140,11 @@ shared_ptr<pv::data::Logic> LogicSignal::logic_data() const
        return data_;
 }
 
+void LogicSignal::set_logic_data(std::shared_ptr<pv::data::Logic> data)
+{
+       data_ = data;
+}
+
 std::pair<int, int> LogicSignal::v_extents() const
 {
        return make_pair(-SignalHeight - SignalMargin, SignalMargin);
@@ -384,21 +389,23 @@ void LogicSignal::populate_popup_form(QWidget *parent, QFormLayout *form)
 {
        Signal::populate_popup_form(parent, form);
 
-       trigger_bar_ = new QToolBar(parent);
-       init_trigger_actions(trigger_bar_);
-       trigger_bar_->addAction(trigger_none_);
-       trigger_none_->setChecked(!trigger_match_);
-
        const vector<int32_t> trig_types = get_trigger_types();
-       for (auto type_id : trig_types) {
-               const TriggerMatchType *const type =
-                       TriggerMatchType::get(type_id);
-               QAction *const action = action_from_trigger_type(type);
-               trigger_bar_->addAction(action);
-               action->setChecked(trigger_match_ == type);
-       }
-       form->addRow(tr("Trigger"), trigger_bar_);
 
+       if (!trig_types.empty()) {
+               trigger_bar_ = new QToolBar(parent);
+               init_trigger_actions(trigger_bar_);
+               trigger_bar_->addAction(trigger_none_);
+               trigger_none_->setChecked(!trigger_match_);
+
+               for (auto type_id : trig_types) {
+                       const TriggerMatchType *const type =
+                               TriggerMatchType::get(type_id);
+                       QAction *const action = action_from_trigger_type(type);
+                       trigger_bar_->addAction(action);
+                       action->setChecked(trigger_match_ == type);
+               }
+               form->addRow(tr("Trigger"), trigger_bar_);
+       }
 }
 
 void LogicSignal::modify_trigger()