- _trigger_bar = new QToolBar(parent);
- init_trigger_actions(_trigger_bar);
- _trigger_bar->addAction(_trigger_none);
- trig_matches = (const int32_t *)g_variant_get_fixed_array(gvar,
- &num_opts, sizeof(int32_t));
- for (i = 0; i < num_opts; i++) {
- _trigger_bar->addAction(match_action(trig_matches[i]));
- is_checked = _trigger_match == trig_matches[i];
- match_action(trig_matches[i])->setChecked(is_checked);
+}
+
+void LogicSignal::modify_trigger()
+{
+ auto trigger = session_.session()->trigger();
+ auto new_trigger = session_.device_manager().context()->create_trigger("pulseview");
+
+ if (trigger) {
+ for (auto stage : trigger->stages()) {
+ const auto &matches = stage->matches();
+ if (std::none_of(begin(matches), end(matches),
+ [&](shared_ptr<TriggerMatch> match) {
+ return match->channel() != channel_; }))
+ continue;
+
+ auto new_stage = new_trigger->add_stage();
+ for (auto match : stage->matches()) {
+ if (match->channel() == channel_)
+ continue;
+ new_stage->add_match(match->channel(), match->type());
+ }
+ }