2 * This file is part of the PulseView project.
4 * Copyright (C) 2018 Soeren Apel <soeren@apelpie.net>
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.
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.
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/>.
21 #include <libsigrokdecode/libsigrokdecode.h>
26 #include "pv/session.hpp"
27 #include "pv/subwindows/subwindowbase.hpp"
29 using std::shared_ptr;
32 namespace subwindows {
34 SubWindowBase::SubWindowBase(Session &session, QWidget *parent) :
38 connect(&session_, SIGNAL(signals_changed()), this, SLOT(on_signals_changed()));
41 bool SubWindowBase::has_toolbar() const
46 QToolBar* SubWindowBase::create_toolbar(QWidget *parent) const
53 Session& SubWindowBase::session()
58 const Session& SubWindowBase::session() const
63 unordered_set< shared_ptr<data::SignalBase> > SubWindowBase::signalbases() const
68 void SubWindowBase::clear_signalbases()
70 for (shared_ptr<data::SignalBase> signalbase : signalbases_) {
71 disconnect(signalbase.get(), SIGNAL(samples_cleared()),
72 this, SLOT(on_data_updated()));
73 disconnect(signalbase.get(), SIGNAL(samples_added(uint64_t, uint64_t, uint64_t)),
74 this, SLOT(on_samples_added(uint64_t, uint64_t, uint64_t)));
80 void SubWindowBase::add_signalbase(const shared_ptr<data::SignalBase> signalbase)
82 signalbases_.insert(signalbase);
86 void SubWindowBase::clear_decode_signals()
90 void SubWindowBase::add_decode_signal(shared_ptr<data::DecodeSignal> signal)
95 void SubWindowBase::remove_decode_signal(shared_ptr<data::DecodeSignal> signal)
101 void SubWindowBase::on_signals_changed()
105 } // namespace subwindows