]> sigrok.org Git - pulseview.git/blob - pv/views/viewbase.cpp
Change namespace for the trace view and implement ViewBase
[pulseview.git] / pv / views / viewbase.cpp
1 /*
2  * This file is part of the PulseView project.
3  *
4  * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
5  * Copyright (C) 2016 Soeren Apel <soeren@apelpie.net>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
20  */
21
22 #ifdef ENABLE_DECODE
23 #include <libsigrokdecode/libsigrokdecode.h>
24 #endif
25
26 #include <libsigrokcxx/libsigrokcxx.hpp>
27
28 #include "pv/session.hpp"
29 #include "pv/util.hpp"
30
31 using std::shared_ptr;
32
33 namespace pv {
34 namespace views {
35
36 ViewBase::ViewBase(Session &session, QWidget *parent) :
37         session_(session)
38 {
39         (void)parent;
40
41         connect(&session_, SIGNAL(signals_changed()),
42                 this, SLOT(signals_changed()));
43         connect(&session_, SIGNAL(capture_state_changed(int)),
44                 this, SLOT(capture_state_updated(int)));
45         connect(&session_, SIGNAL(data_received()),
46                 this, SLOT(data_updated()));
47         connect(&session_, SIGNAL(frame_ended()),
48                 this, SLOT(data_updated()));
49 }
50
51 Session& ViewBase::session()
52 {
53         return session_;
54 }
55
56 const Session& ViewBase::session() const
57 {
58         return session_;
59 }
60
61 void ViewBase::clear_signals()
62 {
63 }
64
65 #ifdef ENABLE_DECODE
66 void ViewBase::clear_decode_signals()
67 {
68 }
69
70 void ViewBase::add_decode_signal(shared_ptr<data::SignalBase> signalbase)
71 {
72         (void)signalbase;
73 }
74
75 void ViewBase::remove_decode_signal(shared_ptr<data::SignalBase> signalbase)
76 {
77         (void)signalbase;
78 }
79 #endif
80
81 void ViewBase::save_settings(QSettings &settings) const
82 {
83         (void)settings;
84 }
85
86 void ViewBase::restore_settings(QSettings &settings)
87 {
88         (void)settings;
89 }
90
91 void ViewBase::trigger_event(util::Timestamp location)
92 {
93         (void)location;
94 }
95
96 void ViewBase::signals_changed()
97 {
98 }
99
100 void ViewBase::capture_state_updated(int state)
101 {
102         (void)state;
103 }
104
105 void ViewBase::data_updated()
106 {
107 }
108
109 } // namespace view
110 } // namespace pv