From 4145b248aed3dde5ccc02c9b7e389b5cb67c547d Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Mon, 27 May 2013 09:24:48 +0100 Subject: [PATCH] Added trigger buttons to LogicSignal context bar. --- icons/trigger-change.svg | 76 +++++++++++++++++++++++++++++++++++++++ icons/trigger-falling.svg | 36 +++++++++++++++++++ icons/trigger-high.svg | 36 +++++++++++++++++++ icons/trigger-low.svg | 36 +++++++++++++++++++ icons/trigger-none.svg | 35 ++++++++++++++++++ icons/trigger-rising.svg | 36 +++++++++++++++++++ pulseview.qrc | 6 ++++ pv/view/logicsignal.cpp | 32 ++++++++++++++++- pv/view/logicsignal.h | 15 ++++++++ 9 files changed, 307 insertions(+), 1 deletion(-) create mode 100644 icons/trigger-change.svg create mode 100644 icons/trigger-falling.svg create mode 100644 icons/trigger-high.svg create mode 100644 icons/trigger-low.svg create mode 100644 icons/trigger-none.svg create mode 100644 icons/trigger-rising.svg diff --git a/icons/trigger-change.svg b/icons/trigger-change.svg new file mode 100644 index 00000000..1786d4b9 --- /dev/null +++ b/icons/trigger-change.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/icons/trigger-falling.svg b/icons/trigger-falling.svg new file mode 100644 index 00000000..24bd4f6a --- /dev/null +++ b/icons/trigger-falling.svg @@ -0,0 +1,36 @@ + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/icons/trigger-high.svg b/icons/trigger-high.svg new file mode 100644 index 00000000..d2150d85 --- /dev/null +++ b/icons/trigger-high.svg @@ -0,0 +1,36 @@ + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/icons/trigger-low.svg b/icons/trigger-low.svg new file mode 100644 index 00000000..aa71a986 --- /dev/null +++ b/icons/trigger-low.svg @@ -0,0 +1,36 @@ + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/icons/trigger-none.svg b/icons/trigger-none.svg new file mode 100644 index 00000000..196264dd --- /dev/null +++ b/icons/trigger-none.svg @@ -0,0 +1,35 @@ + + + + + + + + + image/svg+xml + + + + + + + diff --git a/icons/trigger-rising.svg b/icons/trigger-rising.svg new file mode 100644 index 00000000..ac1550fe --- /dev/null +++ b/icons/trigger-rising.svg @@ -0,0 +1,36 @@ + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/pulseview.qrc b/pulseview.qrc index 3e8a9acf..2cf39ba2 100644 --- a/pulseview.qrc +++ b/pulseview.qrc @@ -7,6 +7,12 @@ icons/status-green.svg icons/status-grey.svg icons/status-red.svg + icons/trigger-change.svg + icons/trigger-falling.svg + icons/trigger-high.svg + icons/trigger-low.svg + icons/trigger-none.svg + icons/trigger-rising.svg icons/zoom-in.png icons/zoom-out.png diff --git a/pv/view/logicsignal.cpp b/pv/view/logicsignal.cpp index e0b21309..b684210b 100644 --- a/pv/view/logicsignal.cpp +++ b/pv/view/logicsignal.cpp @@ -55,9 +55,29 @@ const QColor LogicSignal::SignalColours[10] = { LogicSignal::LogicSignal(const sr_probe *const probe, shared_ptr data) : Signal(probe), - _data(data) + _data(data), + _separator(this), + _icon_trigger_none(":/icons/trigger-none.svg"), + _trigger_none(_icon_trigger_none, tr("No trigger"), this), + _icon_trigger_rising(":/icons/trigger-rising.svg"), + _trigger_rising(_icon_trigger_rising, + tr("Trigger on rising edge"), this), + _icon_trigger_high(":/icons/trigger-high.svg"), + _trigger_high(_icon_trigger_high, + tr("Trigger on high level"), this), + _icon_trigger_falling(":/icons/trigger-falling.svg"), + _trigger_falling(_icon_trigger_falling, + tr("Trigger on falling edge"), this), + _icon_trigger_low(":/icons/trigger-low.svg"), + _trigger_low(_icon_trigger_low, + tr("Trigger on low level"), this), + _icon_trigger_change(":/icons/trigger-change.svg"), + _trigger_change(_icon_trigger_change, + tr("Trigger on rising or falling edge"), this) { _colour = SignalColours[probe->index % countof(SignalColours)]; + + _separator.setSeparator(true); } LogicSignal::~LogicSignal() @@ -68,6 +88,16 @@ const list LogicSignal::get_context_bar_actions() { list actions; actions.push_back(&_name_action); + + actions.push_back(&_separator); + + actions.push_back(&_trigger_none); + actions.push_back(&_trigger_rising); + actions.push_back(&_trigger_high); + actions.push_back(&_trigger_falling); + actions.push_back(&_trigger_low); + actions.push_back(&_trigger_change); + return actions; } diff --git a/pv/view/logicsignal.h b/pv/view/logicsignal.h index ed561e6f..c1b83d0b 100644 --- a/pv/view/logicsignal.h +++ b/pv/view/logicsignal.h @@ -74,6 +74,21 @@ private: private: boost::shared_ptr _data; + + QAction _separator; + + QIcon _icon_trigger_none; + QAction _trigger_none; + QIcon _icon_trigger_rising; + QAction _trigger_rising; + QIcon _icon_trigger_high; + QAction _trigger_high; + QIcon _icon_trigger_falling; + QAction _trigger_falling; + QIcon _icon_trigger_low; + QAction _trigger_low; + QIcon _icon_trigger_change; + QAction _trigger_change; }; } // namespace view -- 2.30.2