]> sigrok.org Git - pulseview.git/blob - pv/views/decoder_output/view.cpp
DecoderOutput: Add basic view skeleton
[pulseview.git] / pv / views / decoder_output / view.cpp
1 /*
2  * This file is part of the PulseView project.
3  *
4  * Copyright (C) 2019 Soeren Apel <soeren@apelpie.net>
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, see <http://www.gnu.org/licenses/>.
18  */
19
20 #include <libsigrokdecode/libsigrokdecode.h>
21
22 #include <QMenu>
23 #include <QVBoxLayout>
24
25 #include "view.hpp"
26
27 #include "pv/session.hpp"
28 #include "pv/util.hpp"
29
30 using pv::util::TimeUnit;
31 using pv::util::Timestamp;
32
33 using std::shared_ptr;
34
35 namespace pv {
36 namespace views {
37 namespace decoder_output {
38
39 View::View(Session &session, bool is_main_view, QWidget *parent) :
40         ViewBase(session, is_main_view, parent)
41
42         // Note: Place defaults in View::reset_view_state(), not here
43 {
44         QVBoxLayout *root_layout = new QVBoxLayout(this);
45         root_layout->setContentsMargins(0, 0, 0, 0);
46
47         reset_view_state();
48 }
49
50 View::~View()
51 {
52 }
53
54 void View::reset_view_state()
55 {
56         ViewBase::reset_view_state();
57 }
58
59 void View::clear_signals()
60 {
61         ViewBase::clear_signalbases();
62 }
63
64 void View::clear_decode_signals()
65 {
66 }
67
68 void View::add_decode_signal(shared_ptr<data::DecodeSignal> signal)
69 {
70         connect(signal.get(), SIGNAL(name_changed(const QString&)),
71                 this, SLOT(on_signal_name_changed()));
72 }
73
74 void View::remove_decode_signal(shared_ptr<data::DecodeSignal> signal)
75 {
76         (void)signal;
77 }
78
79 void View::save_settings(QSettings &settings) const
80 {
81         (void)settings;
82 }
83
84 void View::restore_settings(QSettings &settings)
85 {
86         // Note: It is assumed that this function is only called once,
87         // immediately after restoring a previous session.
88         (void)settings;
89 }
90
91 void View::on_signal_name_changed()
92 {
93 }
94
95 } // namespace decoder_output
96 } // namespace views
97 } // namespace pv