]> sigrok.org Git - pulseview.git/blob - pv/view/decodesignal.cpp
44144d1b8b8e31a37648e6d44fb03221e20e94bb
[pulseview.git] / pv / view / decodesignal.cpp
1 /*
2  * This file is part of the PulseView project.
3  *
4  * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
19  */
20
21 extern "C" {
22 #include <libsigrokdecode/libsigrokdecode.h>
23 }
24
25 #include "decodesignal.h"
26
27 #include <pv/data/decoder.h>
28 #include <pv/view/view.h>
29
30 using namespace boost;
31 using namespace std;
32
33 namespace pv {
34 namespace view {
35
36 DecodeSignal::DecodeSignal(pv::SigSession &session,
37         boost::shared_ptr<pv::data::Decoder> decoder) :
38         Trace(session, QString(decoder->get_decoder()->name)),
39         _decoder(decoder)
40 {
41         assert(_decoder);
42
43         _colour = Qt::red;
44 }
45
46 void DecodeSignal::init_context_bar_actions(QWidget *parent)
47 {
48         (void)parent;
49 }
50
51 bool DecodeSignal::enabled() const
52 {
53         return true;
54 }
55
56 void DecodeSignal::set_view(pv::view::View *view)
57 {
58         assert(view);
59         Trace::set_view(view);
60 }
61
62 void DecodeSignal::paint(QPainter &p, int left, int right)
63 {
64         (void)p;
65         (void)left;
66         (void)right;
67 }
68
69 const list<QAction*> DecodeSignal::get_context_bar_actions()
70 {
71         list<QAction*> actions;
72         return actions;
73 }
74
75 } // namespace view
76 } // namespace pv