pv/subwindows/decoder_selector/item.cpp
pv/subwindows/decoder_selector/model.cpp
pv/subwindows/decoder_selector/subwindow.cpp
+ pv/views/decoder_output/view.cpp
pv/views/trace/decodetrace.cpp
pv/widgets/decodergroupbox.cpp
pv/widgets/decodermenu.cpp
list(APPEND pulseview_HEADERS
pv/data/decodesignal.hpp
pv/subwindows/decoder_selector/subwindow.hpp
+ pv/views/decoder_output/view.hpp
pv/views/trace/decodetrace.hpp
pv/widgets/decodergroupbox.hpp
pv/widgets/decodermenu.hpp
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2019 Soeren Apel <soeren@apelpie.net>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include <libsigrokdecode/libsigrokdecode.h>
+
+#include <QMenu>
+#include <QVBoxLayout>
+
+#include "view.hpp"
+
+#include "pv/session.hpp"
+#include "pv/util.hpp"
+
+using pv::util::TimeUnit;
+using pv::util::Timestamp;
+
+using std::shared_ptr;
+
+namespace pv {
+namespace views {
+namespace decoder_output {
+
+View::View(Session &session, bool is_main_view, QWidget *parent) :
+ ViewBase(session, is_main_view, parent)
+
+ // Note: Place defaults in View::reset_view_state(), not here
+{
+ QVBoxLayout *root_layout = new QVBoxLayout(this);
+ root_layout->setContentsMargins(0, 0, 0, 0);
+
+ reset_view_state();
+}
+
+View::~View()
+{
+}
+
+void View::reset_view_state()
+{
+ ViewBase::reset_view_state();
+}
+
+void View::clear_signals()
+{
+ ViewBase::clear_signalbases();
+}
+
+void View::clear_decode_signals()
+{
+}
+
+void View::add_decode_signal(shared_ptr<data::DecodeSignal> signal)
+{
+ connect(signal.get(), SIGNAL(name_changed(const QString&)),
+ this, SLOT(on_signal_name_changed()));
+}
+
+void View::remove_decode_signal(shared_ptr<data::DecodeSignal> signal)
+{
+ (void)signal;
+}
+
+void View::save_settings(QSettings &settings) const
+{
+ (void)settings;
+}
+
+void View::restore_settings(QSettings &settings)
+{
+ // Note: It is assumed that this function is only called once,
+ // immediately after restoring a previous session.
+ (void)settings;
+}
+
+void View::on_signal_name_changed()
+{
+}
+
+} // namespace decoder_output
+} // namespace views
+} // namespace pv
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2019 Soeren Apel <soeren@apelpie.net>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef PULSEVIEW_PV_VIEWS_DECODEROUTPUT_VIEW_HPP
+#define PULSEVIEW_PV_VIEWS_DECODEROUTPUT_VIEW_HPP
+
+#include <pv/views/viewbase.hpp>
+
+namespace pv {
+
+class Session;
+
+namespace views {
+
+namespace decoder_output {
+
+class View : public ViewBase
+{
+ Q_OBJECT
+
+public:
+ explicit View(Session &session, bool is_main_view=false, QWidget *parent = nullptr);
+
+ ~View();
+
+ /**
+ * Resets the view to its default state after construction. It does however
+ * not reset the signal bases or any other connections with the session.
+ */
+ virtual void reset_view_state();
+
+ virtual void clear_signals();
+
+ virtual void clear_decode_signals();
+ virtual void add_decode_signal(shared_ptr<data::DecodeSignal> signal);
+ virtual void remove_decode_signal(shared_ptr<data::DecodeSignal> signal);
+
+ virtual void save_settings(QSettings &settings) const;
+ virtual void restore_settings(QSettings &settings);
+
+private Q_SLOTS:
+ void on_signal_name_changed();
+
+};
+
+} // namespace decoder_output
+} // namespace views
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEWS_DECODEROUTPUT_VIEW_HPP
*/
virtual void reset_view_state();
- Session& session();
- const Session& session() const;
+ Session& session(); // This method is needed for TraceTreeItemOwner, not ViewBase
+ const Session& session() const; // This method is needed for TraceTreeItemOwner, not ViewBase
/**
* Returns the signals contained in this view.