]> sigrok.org Git - pulseview.git/commitdiff
Added trigger buttons to LogicSignal context bar.
authorJoel Holdsworth <redacted>
Mon, 27 May 2013 08:24:48 +0000 (09:24 +0100)
committerJoel Holdsworth <redacted>
Mon, 27 May 2013 09:24:08 +0000 (10:24 +0100)
icons/trigger-change.svg [new file with mode: 0644]
icons/trigger-falling.svg [new file with mode: 0644]
icons/trigger-high.svg [new file with mode: 0644]
icons/trigger-low.svg [new file with mode: 0644]
icons/trigger-none.svg [new file with mode: 0644]
icons/trigger-rising.svg [new file with mode: 0644]
pulseview.qrc
pv/view/logicsignal.cpp
pv/view/logicsignal.h

diff --git a/icons/trigger-change.svg b/icons/trigger-change.svg
new file mode 100644 (file)
index 0000000..1786d4b
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   version="1.1"
+   width="22"
+   height="22"
+   id="svg2989"
+   inkscape:version="0.48.3.1 r9886"
+   sodipodi:docname="trigger-rising.svg">
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1680"
+     inkscape:window-height="995"
+     id="namedview7"
+     showgrid="true"
+     inkscape:zoom="36.791193"
+     inkscape:cx="7.942203"
+     inkscape:cy="10.877688"
+     inkscape:window-x="1278"
+     inkscape:window-y="-3"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="svg2989">
+    <inkscape:grid
+       type="xygrid"
+       id="grid2984"
+       empspacing="2"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true" />
+  </sodipodi:namedview>
+  <defs
+     id="defs2991" />
+  <metadata
+     id="metadata2994">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     transform="translate(0,-1030.3622)"
+     id="layer1">
+    <path
+       d="m 4,1048.3622 5,0 4,-14 5,0"
+       id="path3007"
+       style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cccc" />
+    <path
+       sodipodi:nodetypes="cccc"
+       inkscape:connector-curvature="0"
+       style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1"
+       id="path3012"
+       d="m 4,1034.3622 5,0 4,14 5,0" />
+  </g>
+</svg>
diff --git a/icons/trigger-falling.svg b/icons/trigger-falling.svg
new file mode 100644 (file)
index 0000000..24bd4f6
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   version="1.1"
+   width="22"
+   height="22"
+   id="svg2989">
+  <defs
+     id="defs2991" />
+  <metadata
+     id="metadata2994">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     transform="translate(0,-1030.3622)"
+     id="layer1">
+    <path
+       d="m 18,1048.3622 -5,0 -4,-14 -5,0"
+       id="path3007"
+       style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1" />
+  </g>
+</svg>
diff --git a/icons/trigger-high.svg b/icons/trigger-high.svg
new file mode 100644 (file)
index 0000000..d2150d8
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   version="1.1"
+   width="22"
+   height="22"
+   id="svg2989">
+  <defs
+     id="defs2991" />
+  <metadata
+     id="metadata2994">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     transform="translate(0,-1030.3622)"
+     id="layer1">
+    <path
+       d="m 4,1034.3622 14,0"
+       id="path3007"
+       style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1" />
+  </g>
+</svg>
diff --git a/icons/trigger-low.svg b/icons/trigger-low.svg
new file mode 100644 (file)
index 0000000..aa71a98
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   version="1.1"
+   width="22"
+   height="22"
+   id="svg2989">
+  <defs
+     id="defs2991" />
+  <metadata
+     id="metadata2994">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     transform="translate(0,-1030.3622)"
+     id="layer1">
+    <path
+       d="m 4,1048.3622 14,0"
+       id="path3007"
+       style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1" />
+  </g>
+</svg>
diff --git a/icons/trigger-none.svg b/icons/trigger-none.svg
new file mode 100644 (file)
index 0000000..196264d
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   version="1.1"
+   width="22"
+   height="22"
+   id="svg2989">
+  <defs
+     id="defs2991" />
+  <metadata
+     id="metadata2994">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <rect
+     width="4"
+     height="4"
+     x="9"
+     y="9"
+     id="rect3033"
+     style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none" />
+</svg>
diff --git a/icons/trigger-rising.svg b/icons/trigger-rising.svg
new file mode 100644 (file)
index 0000000..ac1550f
--- /dev/null
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   version="1.1"
+   width="22"
+   height="22"
+   id="svg2989">
+  <defs
+     id="defs2991" />
+  <metadata
+     id="metadata2994">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     transform="translate(0,-1030.3622)"
+     id="layer1">
+    <path
+       d="m 4,1048.3622 5,0 4,-14 5,0"
+       id="path3007"
+       style="fill:none;stroke:#000000;stroke-width:2;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1" />
+  </g>
+</svg>
index 3e8a9acf12213373901f811f4b54f859cbd7cd0f..2cf39ba2c57738d773945c2763d455f4a525418f 100644 (file)
@@ -7,6 +7,12 @@
        <file>icons/status-green.svg</file>
        <file>icons/status-grey.svg</file>
        <file>icons/status-red.svg</file>
+       <file>icons/trigger-change.svg</file>
+       <file>icons/trigger-falling.svg</file>
+       <file>icons/trigger-high.svg</file>
+       <file>icons/trigger-low.svg</file>
+       <file>icons/trigger-none.svg</file>
+       <file>icons/trigger-rising.svg</file>
        <file>icons/zoom-in.png</file>
        <file>icons/zoom-out.png</file>
     </qresource>
index e0b21309cc9841d5064a309920c187dc89251d88..b684210b26667e3fcf7ee30e3447867d1708bb68 100644 (file)
@@ -55,9 +55,29 @@ const QColor LogicSignal::SignalColours[10] = {
 LogicSignal::LogicSignal(const sr_probe *const probe,
        shared_ptr<data::Logic> 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<QAction*> LogicSignal::get_context_bar_actions()
 {
        list<QAction*> 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;
 }
 
index ed561e6fd842cd1dfba56549f37d5e8c47a12829..c1b83d0ba5a64259624f21e62271dc3799e4f458 100644 (file)
@@ -74,6 +74,21 @@ private:
 
 private:
        boost::shared_ptr<pv::data::Logic> _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