X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fsubwindows%2Fsubwindowbase.cpp;fp=pv%2Fsubwindows%2Fsubwindowbase.cpp;h=8606d65775339177ea8727fdd5562bc827acda38;hp=0000000000000000000000000000000000000000;hb=97378470ded88af84edaa0f1063d10d834475665;hpb=58cd5b584f5bcb19d7c9bd28391c53dd2488fc59 diff --git a/pv/subwindows/subwindowbase.cpp b/pv/subwindows/subwindowbase.cpp new file mode 100644 index 0000000..8606d65 --- /dev/null +++ b/pv/subwindows/subwindowbase.cpp @@ -0,0 +1,106 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2018 Soeren Apel + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + */ + +#ifdef ENABLE_DECODE +#include +#endif + +#include + +#include "pv/session.hpp" +#include "pv/subwindows/subwindowbase.hpp" + +using std::shared_ptr; + +namespace pv { +namespace subwindows { + +SubWindowBase::SubWindowBase(Session &session, QWidget *parent) : + QWidget(parent), + session_(session) +{ + connect(&session_, SIGNAL(signals_changed()), this, SLOT(on_signals_changed())); +} + +bool SubWindowBase::has_toolbar() const +{ + return false; +} + +QToolBar* SubWindowBase::create_toolbar(QWidget *parent) const +{ + (void)parent; + + return nullptr; +} + +Session& SubWindowBase::session() +{ + return session_; +} + +const Session& SubWindowBase::session() const +{ + return session_; +} + +unordered_set< shared_ptr > SubWindowBase::signalbases() const +{ + return signalbases_; +} + +void SubWindowBase::clear_signalbases() +{ + for (shared_ptr signalbase : signalbases_) { + disconnect(signalbase.get(), SIGNAL(samples_cleared()), + this, SLOT(on_data_updated())); + disconnect(signalbase.get(), SIGNAL(samples_added(uint64_t, uint64_t, uint64_t)), + this, SLOT(on_samples_added(uint64_t, uint64_t, uint64_t))); + } + + signalbases_.clear(); +} + +void SubWindowBase::add_signalbase(const shared_ptr signalbase) +{ + signalbases_.insert(signalbase); +} + +#ifdef ENABLE_DECODE +void SubWindowBase::clear_decode_signals() +{ +} + +void SubWindowBase::add_decode_signal(shared_ptr signal) +{ + (void)signal; +} + +void SubWindowBase::remove_decode_signal(shared_ptr signal) +{ + (void)signal; +} +#endif + +void SubWindowBase::on_signals_changed() +{ +} + +} // namespace subwindows +} // namespace pv