]> sigrok.org Git - pulseview.git/blob - pv/view/decodesignal.cpp
Added skeleton pv::view::DecodeSignal
[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 using namespace boost;
28 using namespace std;
29
30 namespace pv {
31 namespace view {
32
33 DecodeSignal::DecodeSignal(pv::SigSession &session, srd_decoder *const dec) :
34         Trace(session, QString(dec->name)),
35         _decoder(dec)
36 {
37         _colour = Qt::red;
38 }
39
40 bool DecodeSignal::enabled() const
41 {
42         return true;
43 }
44
45 void DecodeSignal::paint(QPainter &p, int y, int left, int right,
46         double scale, double offset)
47 {
48         (void)p;
49         (void)y;
50         (void)left;
51         (void)right;
52         (void)offset;
53
54         assert(scale > 0);
55 }
56
57 const list<QAction*> DecodeSignal::get_context_bar_actions()
58 {
59         list<QAction*> actions;
60         return actions;
61 }
62
63 } // namespace view
64 } // namespace pv