pv/view/viewitempaintparams.cpp
pv/view/viewport.cpp
pv/view/viewwidget.cpp
+ pv/views/viewbase.cpp
pv/widgets/colourbutton.cpp
pv/widgets/colourpopup.cpp
pv/widgets/devicetoolbutton.cpp
pv/view/viewitem.hpp
pv/view/viewport.hpp
pv/view/viewwidget.hpp
+ pv/views/viewbase.hpp
pv/widgets/colourbutton.hpp
pv/widgets/colourpopup.hpp
pv/widgets/devicetoolbutton.hpp
// Remove the QMainWindow
dock->setWidget(0);
- const std::shared_ptr<pv::view::View> view = entry.second;
+ const std::shared_ptr<views::ViewBase> view = entry.second;
for (shared_ptr<Session> session : sessions_)
if (session->has_view(view))
return action_about_;
}
-shared_ptr<pv::view::View> MainWindow::get_active_view() const
+shared_ptr<views::ViewBase> MainWindow::get_active_view() const
{
// If there's only one view, use it...
if (view_docks_.size() == 1)
return nullptr;
}
-shared_ptr<pv::view::View> MainWindow::add_view(const QString &title,
- view::ViewType type, Session &session)
+shared_ptr<views::ViewBase> MainWindow::add_view(const QString &title,
+ views::ViewType type, Session &session)
{
- shared_ptr<pv::view::View> v;
-
- if (type == pv::view::TraceView) {
+ if (type == views::ViewTypeTrace) {
shared_ptr<QDockWidget> dock = make_shared<QDockWidget>(title, this);
dock->setObjectName(title);
addDockWidget(Qt::TopDockWidgetArea, dock.get());
QMainWindow *dock_main = new QMainWindow(dock.get());
dock_main->setWindowFlags(Qt::Widget); // Remove Qt::Window flag
- v = make_shared<pv::view::View>(session, dock_main);
+ shared_ptr<views::TraceView::View> v =
+ make_shared<views::TraceView::View>(session, dock_main);
view_docks_[dock] = v;
session.register_view(v);
connect(close_btn, SIGNAL(clicked(bool)),
this, SLOT(on_view_close_clicked()));
- if (type == view::TraceView) {
- connect(&session, SIGNAL(trigger_event(util::Timestamp)), v.get(),
+ if (type == views::ViewTypeTrace) {
+ connect(&session, SIGNAL(trigger_event(util::Timestamp)),
+ qobject_cast<views::ViewBase*>(v.get()),
SLOT(trigger_event(util::Timestamp)));
v->enable_sticky_scrolling(action_view_sticky_scrolling_->isChecked());
connect(v.get(), SIGNAL(always_zoom_to_fit_changed(bool)),
main_bar.get(), SLOT(on_always_zoom_to_fit_changed(bool)));
}
+
+ return v;
}
- return v;
+ return nullptr;
}
shared_ptr<Session> MainWindow::add_session()
shared_ptr<Session> session = make_shared<Session>(device_manager_, name);
- connect(session.get(), SIGNAL(add_view(const QString&, view::ViewType, Session*)),
- this, SLOT(on_add_view(const QString&, view::ViewType, Session*)));
+ connect(session.get(), SIGNAL(add_view(const QString&, views::ViewType, Session*)),
+ this, SLOT(on_add_view(const QString&, views::ViewType, Session*)));
connect(session.get(), SIGNAL(name_changed()),
this, SLOT(on_session_name_changed()));
sessions_.push_back(session);
- shared_ptr<view::View> main_view =
- add_view(name, pv::view::TraceView, *session);
+ shared_ptr<views::ViewBase> main_view =
+ add_view(name, views::ViewTypeTrace, *session);
return session;
}
void MainWindow::remove_session(shared_ptr<Session> session)
{
- for (shared_ptr<view::View> view : session->views()) {
+ for (shared_ptr<views::ViewBase> view : session->views()) {
// Find the dock the view is contained in and close it
for (auto entry : view_docks_)
if (entry.second == view)
return false;
}
-void MainWindow::on_add_view(const QString &title, view::ViewType type,
+void MainWindow::on_add_view(const QString &title, views::ViewType type,
Session *session)
{
// We get a pointer and need a reference
void MainWindow::on_focus_changed()
{
- shared_ptr<view::View> view;
+ shared_ptr<views::ViewBase> view;
bool title_set = false;
view = get_active_view();
Session *session = qobject_cast<Session*>(QObject::sender());
assert(session);
- for (shared_ptr<view::View> view : session->views()) {
+ for (shared_ptr<views::ViewBase> view : session->views()) {
// Get the dock that contains the view
for (auto entry : view_docks_)
if (entry.second == view) {
// We get a pointer and need a reference
for (std::shared_ptr<Session> s : sessions_)
if (s.get() == session)
- add_view(session->name(), pv::view::TraceView, *s);
+ add_view(session->name(), views::ViewTypeTrace, *s);
}
void MainWindow::on_view_close_clicked()
}
// Get the view contained in the dock widget
- shared_ptr<view::View> view;
+ shared_ptr<views::ViewBase> view;
for (auto entry : view_docks_)
if (entry.first.get() == dock)
void MainWindow::on_actionViewStickyScrolling_triggered()
{
- shared_ptr<pv::view::View> view = get_active_view();
+ shared_ptr<views::ViewBase> viewbase = get_active_view();
+ views::TraceView::View* view =
+ qobject_cast<views::TraceView::View*>(viewbase.get());
if (view)
view->enable_sticky_scrolling(action_view_sticky_scrolling_->isChecked());
}
void MainWindow::on_actionViewColouredBg_triggered()
{
- shared_ptr<pv::view::View> view = get_active_view();
+ shared_ptr<views::ViewBase> viewbase = get_active_view();
+ views::TraceView::View* view =
+ qobject_cast<views::TraceView::View*>(viewbase.get());
if (view)
view->enable_coloured_bg(action_view_coloured_bg_->isChecked());
}
#include <QMainWindow>
#include "session.hpp"
-#include "view/viewwidget.hpp"
+#include "views/viewbase.hpp"
struct srd_decoder;
QAction* action_view_coloured_bg() const;
QAction* action_about() const;
- std::shared_ptr<pv::view::View> get_active_view() const;
+ std::shared_ptr<views::ViewBase> get_active_view() const;
- std::shared_ptr<pv::view::View> add_view(const QString &title,
- view::ViewType type, Session &session);
+ std::shared_ptr<views::ViewBase> add_view(const QString &title,
+ views::ViewType type, Session &session);
std::shared_ptr<Session> add_session();
virtual bool restoreState(const QByteArray &state, int version = 0);
private Q_SLOTS:
- void on_add_view(const QString &title, view::ViewType type,
+ void on_add_view(const QString &title, views::ViewType type,
Session *session);
void on_focus_changed();
std::list< std::shared_ptr<Session> > sessions_;
std::map< std::shared_ptr<QDockWidget>,
- std::shared_ptr<pv::view::View> > view_docks_;
+ std::shared_ptr<views::ViewBase> > view_docks_;
QAction *const action_view_sticky_scrolling_;
QAction *const action_view_coloured_bg_;
name_changed();
}
-const std::list< std::shared_ptr<pv::view::View> > Session::views() const
+const std::list< std::shared_ptr<views::ViewBase> > Session::views() const
{
return views_;
}
-std::shared_ptr<pv::view::View> Session::main_view() const
+std::shared_ptr<views::ViewBase> Session::main_view() const
{
return main_view_;
}
main_view_->save_settings(settings);
settings.endGroup();
- for (shared_ptr<view::View> view : views_) {
+ for (shared_ptr<views::ViewBase> view : views_) {
if (view != main_view_) {
settings.beginGroup("view" + QString::number(views++));
view->save_settings(settings);
settings.beginGroup("view" + QString::number(i));
if (i > 0) {
- view::ViewType type = (view::ViewType)settings.value("type").toInt();
+ views::ViewType type = (views::ViewType)settings.value("type").toInt();
add_view(name_, type, this);
views_.back()->restore_settings(settings);
} else
name_changed();
// Remove all stored data
- for (std::shared_ptr<pv::view::View> view : views_) {
+ for (std::shared_ptr<views::ViewBase> view : views_) {
view->clear_signals();
#ifdef ENABLE_DECODE
- view->clear_decode_traces();
+ view->clear_decode_signals();
#endif
}
for (const shared_ptr<data::SignalData> d : all_signal_data_)
sampling_thread_.join();
}
-void Session::register_view(std::shared_ptr<pv::view::View> view)
+void Session::register_view(std::shared_ptr<views::ViewBase> view)
{
if (views_.empty()) {
main_view_ = view;
update_signals();
}
-void Session::deregister_view(std::shared_ptr<pv::view::View> view)
+void Session::deregister_view(std::shared_ptr<views::ViewBase> view)
{
- views_.remove_if([&](std::shared_ptr<pv::view::View> v) {
+ views_.remove_if([&](std::shared_ptr<views::ViewBase> v) {
return v == view; });
if (views_.empty()) {
}
}
-bool Session::has_view(std::shared_ptr<pv::view::View> view)
+bool Session::has_view(std::shared_ptr<views::ViewBase> view)
{
- for (std::shared_ptr<pv::view::View> v : views_)
+ for (std::shared_ptr<views::ViewBase> v : views_)
if (v == view)
return true;
signalbase->set_decoder_stack(decoder_stack);
signalbases_.insert(signalbase);
- for (std::shared_ptr<pv::view::View> view : views_)
- view->add_decode_trace(signalbase);
+ for (std::shared_ptr<views::ViewBase> view : views_)
+ view->add_decode_signal(signalbase);
} catch (std::runtime_error e) {
return false;
}
void Session::remove_decode_signal(shared_ptr<data::SignalBase> signalbase)
{
- for (std::shared_ptr<pv::view::View> view : views_)
- view->remove_decode_trace(signalbase);
+ for (std::shared_ptr<views::ViewBase> view : views_)
+ view->remove_decode_signal(signalbase);
}
#endif
if (!device_) {
signalbases_.clear();
logic_data_.reset();
- for (std::shared_ptr<pv::view::View> view : views_) {
+ for (std::shared_ptr<views::ViewBase> view : views_) {
view->clear_signals();
#ifdef ENABLE_DECODE
- view->clear_decode_traces();
+ view->clear_decode_signals();
#endif
}
return;
if (!sr_dev) {
signalbases_.clear();
logic_data_.reset();
- for (std::shared_ptr<pv::view::View> view : views_) {
+ for (std::shared_ptr<views::ViewBase> view : views_) {
view->clear_signals();
#ifdef ENABLE_DECODE
- view->clear_decode_traces();
+ view->clear_decode_signals();
#endif
}
return;
}
// Make the signals list
- for (std::shared_ptr<pv::view::View> view : views_) {
- unordered_set< shared_ptr<view::Signal> > prev_sigs(view->signals());
- view->clear_signals();
-
- for (auto channel : sr_dev->channels()) {
- shared_ptr<data::SignalBase> signalbase;
- shared_ptr<view::Signal> signal;
-
- // Find the channel in the old signals
- const auto iter = std::find_if(
- prev_sigs.cbegin(), prev_sigs.cend(),
- [&](const shared_ptr<view::Signal> &s) {
- return s->base()->channel() == channel;
- });
- if (iter != prev_sigs.end()) {
- // Copy the signal from the old set to the new
- signal = *iter;
- view->add_signal(signal);
- } else {
- // Find the signalbase for this channel if possible
- signalbase.reset();
- for (const shared_ptr<data::SignalBase> b : signalbases_)
- if (b->channel() == channel)
- signalbase = b;
-
- switch(channel->type()->id()) {
- case SR_CHANNEL_LOGIC:
- if (!signalbase) {
- signalbase = shared_ptr<data::SignalBase>(
- new data::SignalBase(channel));
- signalbases_.insert(signalbase);
-
- all_signal_data_.insert(logic_data_);
- signalbase->set_data(logic_data_);
+ for (std::shared_ptr<views::ViewBase> viewbase : views_) {
+ views::TraceView::View *trace_view =
+ qobject_cast<views::TraceView::View*>(viewbase.get());
+
+ if (trace_view) {
+ unordered_set< shared_ptr<views::TraceView::Signal> >
+ prev_sigs(trace_view->signals());
+ trace_view->clear_signals();
+
+ for (auto channel : sr_dev->channels()) {
+ shared_ptr<data::SignalBase> signalbase;
+ shared_ptr<views::TraceView::Signal> signal;
+
+ // Find the channel in the old signals
+ const auto iter = std::find_if(
+ prev_sigs.cbegin(), prev_sigs.cend(),
+ [&](const shared_ptr<views::TraceView::Signal> &s) {
+ return s->base()->channel() == channel;
+ });
+ if (iter != prev_sigs.end()) {
+ // Copy the signal from the old set to the new
+ signal = *iter;
+ trace_view->add_signal(signal);
+ } else {
+ // Find the signalbase for this channel if possible
+ signalbase.reset();
+ for (const shared_ptr<data::SignalBase> b : signalbases_)
+ if (b->channel() == channel)
+ signalbase = b;
+
+ switch(channel->type()->id()) {
+ case SR_CHANNEL_LOGIC:
+ if (!signalbase) {
+ signalbase = shared_ptr<data::SignalBase>(
+ new data::SignalBase(channel));
+ signalbases_.insert(signalbase);
+
+ all_signal_data_.insert(logic_data_);
+ signalbase->set_data(logic_data_);
+ }
+
+ signal = shared_ptr<views::TraceView::Signal>(
+ new views::TraceView::LogicSignal(*this,
+ device_, signalbase));
+ trace_view->add_signal(signal);
+ break;
+
+ case SR_CHANNEL_ANALOG:
+ {
+ if (!signalbase) {
+ signalbase = shared_ptr<data::SignalBase>(
+ new data::SignalBase(channel));
+ signalbases_.insert(signalbase);
+
+ shared_ptr<data::Analog> data(new data::Analog());
+ all_signal_data_.insert(data);
+ signalbase->set_data(data);
+ }
+
+ signal = shared_ptr<views::TraceView::Signal>(
+ new views::TraceView::AnalogSignal(
+ *this, signalbase));
+ trace_view->add_signal(signal);
+ break;
}
- signal = shared_ptr<view::Signal>(
- new view::LogicSignal(*this,
- device_, signalbase));
- view->add_signal(signal);
- break;
-
- case SR_CHANNEL_ANALOG:
- {
- if (!signalbase) {
- signalbase = shared_ptr<data::SignalBase>(
- new data::SignalBase(channel));
- signalbases_.insert(signalbase);
-
- shared_ptr<data::Analog> data(new data::Analog());
- all_signal_data_.insert(data);
- signalbase->set_data(data);
+ default:
+ assert(0);
+ break;
}
-
- signal = shared_ptr<view::Signal>(
- new view::AnalogSignal(
- *this, signalbase));
- view->add_signal(signal);
- break;
- }
-
- default:
- assert(0);
- break;
}
}
}
#include <QString>
#include "util.hpp"
-#include "view/viewwidget.hpp"
+#include "views/viewbase.hpp"
struct srd_decoder;
struct srd_channel;
class MainBar;
}
-namespace view {
-class View;
+namespace views {
+class ViewBase;
}
class Session : public QObject
void set_name(QString name);
- const std::list< std::shared_ptr<pv::view::View> > views() const;
+ const std::list< std::shared_ptr<views::ViewBase> > views() const;
- std::shared_ptr<pv::view::View> main_view() const;
+ std::shared_ptr<views::ViewBase> main_view() const;
void set_main_bar(std::shared_ptr<pv::toolbars::MainBar> main_bar);
double get_samplerate() const;
- void register_view(std::shared_ptr<pv::view::View> view);
+ void register_view(std::shared_ptr<views::ViewBase> view);
- void deregister_view(std::shared_ptr<pv::view::View> view);
+ void deregister_view(std::shared_ptr<views::ViewBase> view);
- bool has_view(std::shared_ptr<pv::view::View> view);
+ bool has_view(std::shared_ptr<views::ViewBase> view);
const std::unordered_set< std::shared_ptr<data::SignalBase> >
signalbases() const;
std::shared_ptr<devices::Device> device_;
QString default_name_, name_;
- std::list< std::shared_ptr<pv::view::View> > views_;
- std::shared_ptr<pv::view::View> main_view_;
+ std::list< std::shared_ptr<views::ViewBase> > views_;
+ std::shared_ptr<pv::views::ViewBase> main_view_;
std::shared_ptr<pv::toolbars::MainBar> main_bar_;
void frame_ended();
- void add_view(const QString &title, view::ViewType type,
+ void add_view(const QString &title, views::ViewType type,
Session *session);
};
// Selection only? Verify that the cursors are active and fetch their values
if (selection_only) {
- if (!session_.main_view()->cursors()->enabled()) {
+ views::TraceView::View *trace_view =
+ qobject_cast<views::TraceView::View*>(session_.main_view().get());
+
+ if (!trace_view->cursors()->enabled()) {
show_session_error(tr("Missing Cursors"), tr("You need to set the " \
"cursors before you can save the data enclosed by them " \
"to a session file (e.g. using ALT-V - Show Cursors)."));
const double samplerate = session_.get_samplerate();
- const pv::util::Timestamp& start_time = session_.main_view()->cursors()->first()->time();
- const pv::util::Timestamp& end_time = session_.main_view()->cursors()->second()->time();
+ const pv::util::Timestamp& start_time = trace_view->cursors()->first()->time();
+ const pv::util::Timestamp& end_time = trace_view->cursors()->second()->time();
const uint64_t start_sample =
std::max((double)0, start_time.convert_to<double>() * samplerate);
void MainBar::on_actionViewZoomIn_triggered()
{
- session_.main_view()->zoom(1);
+ views::TraceView::View *trace_view =
+ qobject_cast<views::TraceView::View*>(session_.main_view().get());
+
+ trace_view->zoom(1);
}
void MainBar::on_actionViewZoomOut_triggered()
{
- session_.main_view()->zoom(-1);
+ views::TraceView::View *trace_view =
+ qobject_cast<views::TraceView::View*>(session_.main_view().get());
+
+ trace_view->zoom(-1);
}
void MainBar::on_actionViewZoomFit_triggered()
{
- session_.main_view()->zoom_fit(action_view_zoom_fit_->isChecked());
+ views::TraceView::View *trace_view =
+ qobject_cast<views::TraceView::View*>(session_.main_view().get());
+
+ trace_view->zoom_fit(action_view_zoom_fit_->isChecked());
}
void MainBar::on_actionViewZoomOneToOne_triggered()
{
- session_.main_view()->zoom_one_to_one();
+ views::TraceView::View *trace_view =
+ qobject_cast<views::TraceView::View*>(session_.main_view().get());
+
+ trace_view->zoom_one_to_one();
}
void MainBar::on_actionViewShowCursors_triggered()
{
- const bool show = !session_.main_view()->cursors_shown();
+ views::TraceView::View *trace_view =
+ qobject_cast<views::TraceView::View*>(session_.main_view().get());
+
+ const bool show = !trace_view->cursors_shown();
if (show)
- session_.main_view()->centre_cursors();
+ trace_view->centre_cursors();
- session_.main_view()->show_cursors(show);
+ trace_view->show_cursors(show);
}
void MainBar::on_always_zoom_to_fit_changed(bool state)
using std::deque;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QColor AnalogSignal::SignalColours[4] = {
QColor(0xC4, 0xA0, 0x00), // Yellow
owner_->row_item_appearance_changed(false, true);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_ANALOGSIGNAL_HPP
-#define PULSEVIEW_PV_VIEW_ANALOGSIGNAL_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_ANALOGSIGNAL_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_ANALOGSIGNAL_HPP
#include "signal.hpp"
class SignalBase;
}
-namespace view {
+namespace views {
+namespace TraceView {
class AnalogSignal : public Signal
{
float resolution_; // e.g. 10 for 10 V/div
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_ANALOGSIGNAL_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_ANALOGSIGNAL_HPP
using std::numeric_limits;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QColor Cursor::FillColour(52, 101, 164);
cursors->second() : cursors->first();
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_CURSOR_HPP
-#define PULSEVIEW_PV_VIEW_CURSOR_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_CURSOR_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_CURSOR_HPP
#include "timemarker.hpp"
class QPainter;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class Cursor : public TimeMarker
{
std::shared_ptr<Cursor> get_other_cursor() const;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_CURSOR_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_CURSOR_HPP
using std::pair;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const int CursorPair::DeltaPadding = 8;
const QColor CursorPair::ViewportFillColour(220, 231, 243);
((second_->time() - view_.offset()) / view_.scale()).convert_to<float>());
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_CURSORPAIR_HPP
-#define PULSEVIEW_PV_VIEW_CURSORPAIR_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_CURSORPAIR_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_CURSORPAIR_HPP
#include "cursor.hpp"
class QPainter;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class CursorPair : public TimeItem
{
QSizeF text_size_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_CURSORPAIR_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_CURSORPAIR_HPP
using std::vector;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QColor DecodeTrace::DecodeColours[4] = {
QColor(0xEF, 0x29, 0x29), // Red
owner_->row_item_appearance_changed(false, true);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_DECODETRACE_HPP
-#define PULSEVIEW_PV_VIEW_DECODETRACE_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_DECODETRACE_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_DECODETRACE_HPP
#include "trace.hpp"
class DecoderGroupBox;
}
-namespace view {
+namespace views {
+namespace TraceView {
class DecodeTrace : public Trace
{
QSignalMapper delete_mapper_, show_hide_mapper_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_DECODETRACE_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_DECODETRACE_HPP
using std::shared_ptr;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QColor Flag::FillColour(0x73, 0xD2, 0x16);
Flag::Flag(const Flag &flag) :
TimeMarker(flag.view_, FillColour, flag.time_),
- std::enable_shared_from_this<pv::view::Flag>(flag)
+ std::enable_shared_from_this<Flag>(flag)
{
}
view_.time_item_appearance_changed(true, false);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_FLAG_HPP
-#define PULSEVIEW_PV_VIEW_FLAG_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_FLAG_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_FLAG_HPP
#include <memory>
class QMenu;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class Flag : public TimeMarker,
- public std::enable_shared_from_this<pv::view::Flag>
+ public std::enable_shared_from_this<Flag>
{
Q_OBJECT
QString text_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_FLAG_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_FLAG_HPP
using std::vector;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const int Header::Padding = 12;
const int Header::BaselineOffset = 5;
} while (restart);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_HEADER_HPP
-#define PULSEVIEW_PV_VIEW_HEADER_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_HEADER_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_HEADER_HPP
#include <list>
#include <memory>
#include "marginwidget.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class TraceTreeItem;
class View;
/**
* Gets the row items.
*/
- std::vector< std::shared_ptr<pv::view::ViewItem> > items();
+ std::vector< std::shared_ptr<ViewItem> > items();
/**
* Gets the first view item which has a label that contains @c pt .
* @return the view item that has been found, or and empty
* @c shared_ptr if no item was found.
*/
- std::shared_ptr<pv::view::ViewItem> get_mouse_over_item(
- const QPoint &pt);
+ std::shared_ptr<ViewItem> get_mouse_over_item(const QPoint &pt);
private:
void paintEvent(QPaintEvent *event);
void on_ungroup();
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_HEADER_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_HEADER_HPP
using sigrok::TriggerMatchType;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const float LogicSignal::Oversampling = 2.0f;
modify_trigger();
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_LOGICSIGNAL_HPP
-#define PULSEVIEW_PV_VIEW_LOGICSIGNAL_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_LOGICSIGNAL_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_LOGICSIGNAL_HPP
#include <QCache>
class Logic;
}
-namespace view {
+namespace views {
+namespace TraceView {
class LogicSignal : public Signal
{
static QCache<QString, const QPixmap> pixmap_cache_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_LOGICSIGNAL_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_LOGICSIGNAL_HPP
using std::shared_ptr;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
MarginWidget::MarginWidget(View &parent) :
ViewWidget(parent)
}
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
#include "viewwidget.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class ViewItem;
Q_OBJECT
public:
- MarginWidget(pv::view::View &parent);
+ MarginWidget(View &parent);
/**
* The extended area that the margin widget would like to be sized to.
* @param item the view item that has been clicked.
*/
virtual void item_clicked(
- const std::shared_ptr<pv::view::ViewItem> &item);
+ const std::shared_ptr<ViewItem> &item);
/**
* Shows the popup of a the specified @c ViewItem .
virtual void keyPressEvent(QKeyEvent *event);
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
#endif // PULSEVIEW_PV_MARGINWIDGET_HPP
#include "rowitem.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
void RowItem::hover_point_changed()
{
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_ROWITEM_HPP
-#define PULSEVIEW_PV_VIEW_ROWITEM_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_ROWITEM_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_ROWITEM_HPP
-#include "viewitem.hpp"
+#include <pv/view/viewitem.hpp>
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class RowItem : public ViewItem
{
virtual void hover_point_changed();
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_ROWITEM_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_ROWITEM_HPP
using std::vector;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const float Ruler::RulerHeight = 2.5f; // x Text Height
const int Ruler::MinorTickSubdivision = 4;
invalidate_tick_position_cache();
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_RULER_HPP
-#define PULSEVIEW_PV_VIEW_RULER_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_RULER_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_RULER_HPP
#include <functional>
#include <memory>
}
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class TimeItem;
class ViewItem;
/**
* Gets the time items.
*/
- std::vector< std::shared_ptr<pv::view::ViewItem> > items() override;
+ std::vector< std::shared_ptr<ViewItem> > items() override;
/**
* Gets the first view item which has a label that contains @c pt .
* @return the view item that has been found, or and empty
* @c shared_ptr if no item was found.
*/
- std::shared_ptr<pv::view::ViewItem> get_mouse_over_item(
+ std::shared_ptr<ViewItem> get_mouse_over_item(
const QPoint &pt) override;
void paintEvent(QPaintEvent *event) override;
void invalidate_tick_position_cache();
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_RULER_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_RULER_HPP
using std::make_shared;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const char *const ChannelNames[] = {
"CLK",
owner_->extents_changed(true, true);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_SIGNAL_HPP
-#define PULSEVIEW_PV_VIEW_SIGNAL_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNAL_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNAL_HPP
#include <memory>
class SignalData;
}
-namespace view {
+namespace views {
+namespace TraceView {
class Signal : public Trace, public ViewItemOwner
{
QComboBox *name_widget_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_SIGNAL_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNAL_HPP
using std::min;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
SignalScaleHandle::SignalScaleHandle(Signal &owner) :
owner_(owner)
p.drawEllipse(r);
}
-} // view
-} // pv
+} // namespace TraceView
+} // namespace views
+} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_SIGNALSCALEHANDLE_HPP
-#define PULSEVIEW_PV_VIEW_SIGNALSCALEHANDLE_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNALSCALEHANDLE_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNALSCALEHANDLE_HPP
#include "rowitem.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class Signal;
Signal &owner_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_SIGNALSCALEHANDLE_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_SIGNALSCALEHANDLE_HPP
#include "view.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
TimeItem::TimeItem(View &view) :
view_(view) {
view_.scale());
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_TIMEITEM_HPP
-#define PULSEVIEW_PV_VIEW_TIMEITEM_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_TIMEITEM_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_TIMEITEM_HPP
#include "viewitem.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class View;
View &view_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_TIMEITEM_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_TIMEITEM_HPP
using std::min;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const int TimeMarker::ArrowSize = 4;
set_time(value);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_MARKER_HPP
-#define PULSEVIEW_PV_VIEW_MARKER_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_MARKER_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_MARKER_HPP
#include <QColor>
#include <QDoubleSpinBox>
class TimestampSpinBox;
}
-namespace view {
+namespace views {
+namespace TraceView {
class View;
bool updating_value_widget_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_MARKER_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_MARKER_HPP
#include <pv/widgets/popup.hpp>
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QPen Trace::AxisPen(QColor(0, 0, 0, 30*256/100));
const int Trace::LabelHitPadding = 2;
QRectF Trace::label_rect(const QRectF &rect) const
{
- using pv::view::View;
-
QFontMetrics m(QApplication::font());
const QSize text_size(
m.boundingRect(QRect(), 0, base_->name()).width(), m.height());
set_colour(colour);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_TRACE_HPP
-#define PULSEVIEW_PV_VIEW_TRACE_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACE_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACE_HPP
#include <QColor>
#include <QPainter>
class Popup;
}
-namespace view {
+namespace views {
+namespace TraceView {
class Trace : public TraceTreeItem
{
QFormLayout *popup_form_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_TRACE_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACE_HPP
using std::vector;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const int TraceGroup::Padding = 8;
const int TraceGroup::Width = 12;
return owner_->session();
}
-pv::view::View* TraceGroup::view()
+View* TraceGroup::view()
{
assert(owner_);
return owner_->view();
}
-const pv::view::View* TraceGroup::view() const
+const View* TraceGroup::view() const
{
assert(owner_);
return owner_->view();
owner_->extents_changed(horz, vert);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_TRACEGROUP_HPP
-#define PULSEVIEW_PV_VIEW_TRACEGROUP_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACEGROUP_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACEGROUP_HPP
#include "tracetreeitem.hpp"
#include "tracetreeitemowner.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class TraceGroup : public TraceTreeItem, public TraceTreeItemOwner
{
/**
* Returns the view of the owner.
*/
- virtual pv::view::View* view();
+ virtual View* view();
/**
* Returns the view of the owner.
*/
- virtual const pv::view::View* view() const;
+ virtual const View* view() const;
/**
* Computes the vertical extents of the contents of this row item.
void on_ungroup();
};
-} // view
-} // pv
+} // namespace TraceView
+} // namespace views
+} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_TRACEGROUP_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACEGROUP_HPP
#include "tracepalette.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QColor TracePalette::Colours[Cols * Rows] = {
QColor(0xFF, 0xFF, 0xFF), // White
};
-} // view
-} // pv
+} // namespace TraceView
+} // namespace views
+} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_TRACEPALETTE_HPP
-#define PULSEVIEW_PV_TRACEPALETTE_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACEPALETTE_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACEPALETTE_HPP
#include <QColor>
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class TracePalette
{
static const QColor Colours[Cols * Rows];
};
+} // namespace TraceView
+} // namespace views
+} // namespace pv
-} // view
-} // pv
-
-#endif // PULSEVIEW_PV_VIEW_TRACEPALETTE_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACEPALETTE_HPP
#include "tracetreeitem.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
TraceTreeItem::TraceTreeItem() :
owner_(nullptr),
bgcolour_state_ = state;
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_TRACETREEITEM_HPP
-#define PULSEVIEW_PV_VIEW_TRACETREEITEM_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACETREEITEM_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACETREEITEM_HPP
#include <memory>
#include "rowitem.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class TraceTreeItemOwner;
class TraceTreeItem : public RowItem,
- public std::enable_shared_from_this<pv::view::TraceTreeItem>
+ public std::enable_shared_from_this<TraceTreeItem>
{
Q_OBJECT
Q_PROPERTY(int visual_v_offset
* Sets the owner this trace in the view trace hierachy.
* @param The new owner of the trace.
*/
- void set_owner(pv::view::TraceTreeItemOwner *owner);
+ void set_owner(TraceTreeItemOwner *owner);
/**
* Gets the visual y-offset of the axis.
QPropertyAnimation v_offset_animation_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_TRACETREEITEM_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACETREEITEM_HPP
using std::vector;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const ViewItemOwner::item_list& TraceTreeItemOwner::child_items() const
{
{
}
-} // view
-} // pv
+} // namespace TraceView
+} // namespace views
+} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_TRACETREEITEMOWNER_HPP
-#define PULSEVIEW_PV_VIEW_TRACETREEITEMOWNER_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACETREEITEMOWNER_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACETREEITEMOWNER_HPP
#include "viewitemowner.hpp"
#include "tracetreeitem.hpp"
class Session;
-namespace view {
+namespace views {
+namespace TraceView {
class TraceTreeItem;
class View;
/**
* Returns the view of the owner.
*/
- virtual pv::view::View* view() = 0;
+ virtual View* view() = 0;
/**
* Returns the view of the owner.
*/
- virtual const pv::view::View* view() const = 0;
+ virtual const View* view() const = 0;
virtual int owner_visual_v_offset() const = 0;
/**
- * Returns the session of the onwer.
+ * Returns the session of the owner.
*/
- virtual pv::Session& session() = 0;
+ virtual Session& session() = 0;
/**
* Returns the session of the owner.
*/
- virtual const pv::Session& session() const = 0;
+ virtual const Session& session() const = 0;
/**
* Returns the number of nested parents that this row item owner has.
virtual void extents_changed(bool horz, bool vert) = 0;
};
-} // view
-} // pv
+} // namespace TraceView
+} // namespace views
+} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_TRACETREEITEMOWNER_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_TRACETREEITEMOWNER_HPP
#include "view.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QColor TriggerMarker::Colour(0x00, 0x00, 0xB0);
p.drawLine(QPointF(x, pp.top()), QPointF(x, pp.bottom()));
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_TRIGGER_MARKER_HPP
-#define PULSEVIEW_PV_VIEW_TRIGGER_MARKER_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_TRIGGER_MARKER_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_TRIGGER_MARKER_HPP
#include "timeitem.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class TriggerMarker : public TimeItem
{
pv::util::Timestamp time_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_TRIGGER_MARKER_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_TRIGGER_MARKER_HPP
#include <boost/thread/locks.hpp>
#include <QApplication>
+#include <QHBoxLayout>
#include <QEvent>
#include <QFontMetrics>
#include <QMouseEvent>
using std::weak_ptr;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const Timestamp View::MaxScale("1e9");
const Timestamp View::MinScale("1e-12");
const int View::ScaleUnits[3] = {1, 2, 5};
+
+CustomAbstractScrollArea::CustomAbstractScrollArea(QWidget *parent) :
+ QAbstractScrollArea(parent)
+{
+}
+
+void CustomAbstractScrollArea::setViewportMargins(int left, int top, int right, int bottom)
+{
+ QAbstractScrollArea::setViewportMargins(left, top, right, bottom);
+}
+
+bool CustomAbstractScrollArea::viewportEvent(QEvent *event)
+{
+ switch (event->type()) {
+ case QEvent::Paint:
+ case QEvent::MouseButtonPress:
+ case QEvent::MouseButtonRelease:
+ case QEvent::MouseButtonDblClick:
+ case QEvent::MouseMove:
+ case QEvent::Wheel:
+ case QEvent::TouchBegin:
+ case QEvent::TouchUpdate:
+ case QEvent::TouchEnd:
+ return false;
+ default:
+ return QAbstractScrollArea::viewportEvent(event);
+ }
+}
+
View::View(Session &session, QWidget *parent) :
- QAbstractScrollArea(parent),
- session_(session),
+ ViewBase(session, parent),
viewport_(new Viewport(*this)),
ruler_(new Ruler(*this)),
header_(new Header(*this)),
+ scrollarea_(this),
scale_(1e-3),
offset_(0),
updating_scroll_(false),
trigger_markers_(),
hover_point_(-1, -1)
{
- connect(horizontalScrollBar(), SIGNAL(valueChanged(int)),
+ connect(scrollarea_.horizontalScrollBar(), SIGNAL(valueChanged(int)),
this, SLOT(h_scroll_value_changed(int)));
- connect(verticalScrollBar(), SIGNAL(valueChanged(int)),
+ connect(scrollarea_.verticalScrollBar(), SIGNAL(valueChanged(int)),
this, SLOT(v_scroll_value_changed()));
- connect(&session_, SIGNAL(signals_changed()),
- this, SLOT(signals_changed()));
- connect(&session_, SIGNAL(capture_state_changed(int)),
- this, SLOT(capture_state_updated(int)));
- connect(&session_, SIGNAL(data_received()),
- this, SLOT(data_updated()));
- connect(&session_, SIGNAL(frame_ended()),
- this, SLOT(data_updated()));
-
connect(header_, SIGNAL(selection_changed()),
ruler_, SLOT(clear_selection()));
connect(ruler_, SIGNAL(selection_changed()),
delayed_view_updater_.setSingleShot(true);
delayed_view_updater_.setInterval(1000 / MaxViewAutoUpdateRate);
- setViewport(viewport_);
+ /* To let the scroll area fill up the parent QWidget (this), we need a layout */
+ QHBoxLayout *layout = new QHBoxLayout(this);
+ setLayout(layout);
+ layout->setContentsMargins(0, 0, 0, 0);
+ layout->addWidget(&scrollarea_);
+
+ scrollarea_.setViewport(viewport_);
viewport_->installEventFilter(this);
ruler_->installEventFilter(this);
return session_;
}
-std::unordered_set< std::shared_ptr<view::Signal> > View::signals() const
+std::unordered_set< std::shared_ptr<Signal> > View::signals() const
{
return signals_;
}
signals_.clear();
}
-void View::add_signal(const shared_ptr<view::Signal> signal)
+void View::add_signal(const shared_ptr<Signal> signal)
{
signals_.insert(signal);
}
#ifdef ENABLE_DECODE
-void View::clear_decode_traces()
+void View::clear_decode_signals()
{
decode_traces_.clear();
}
-void View::add_decode_trace(shared_ptr<data::SignalBase> signalbase)
+void View::add_decode_signal(shared_ptr<data::SignalBase> signalbase)
{
- shared_ptr<view::DecodeTrace> d(
- new view::DecodeTrace(session_, signalbase, decode_traces_.size()));
+ shared_ptr<DecodeTrace> d(
+ new DecodeTrace(session_, signalbase, decode_traces_.size()));
decode_traces_.push_back(d);
}
-void View::remove_decode_trace(shared_ptr<data::SignalBase> signalbase)
+void View::remove_decode_signal(shared_ptr<data::SignalBase> signalbase)
{
for (auto i = decode_traces_.begin(); i != decode_traces_.end(); i++)
if ((*i)->base() == signalbase) {
oa << boost::serialization::make_nvp("offset", offset_);
settings.setValue("offset", QString::fromStdString(ss.str()));
- for (shared_ptr<view::Signal> signal : signals_) {
+ for (shared_ptr<Signal> signal : signals_) {
settings.beginGroup(signal->base()->internal_name());
signal->save_settings(settings);
settings.endGroup();
set_offset(offset);
}
- for (shared_ptr<view::Signal> signal : signals_) {
+ for (shared_ptr<Signal> signal : signals_) {
settings.beginGroup(signal->base()->internal_name());
signal->restore_settings(settings);
settings.endGroup();
int View::owner_visual_v_offset() const
{
- return -verticalScrollBar()->sliderPosition();
+ return -scrollarea_.verticalScrollBar()->sliderPosition();
}
void View::set_v_offset(int offset)
{
- verticalScrollBar()->setSliderPosition(offset);
+ scrollarea_.verticalScrollBar()->setSliderPosition(offset);
header_->update();
viewport_->update();
}
void View::update_scroll()
{
assert(viewport_);
+ QScrollBar *hscrollbar = scrollarea_.horizontalScrollBar();
+ QScrollBar *vscrollbar = scrollarea_.verticalScrollBar();
const QSize areaSize = viewport_->size();
int major_tick_distance = (tick_period_ / scale_).convert_to<int>();
- horizontalScrollBar()->setPageStep(areaSize.width() / 2);
- horizontalScrollBar()->setSingleStep(major_tick_distance);
+ hscrollbar->setPageStep(areaSize.width() / 2);
+ hscrollbar->setSingleStep(major_tick_distance);
updating_scroll_ = true;
if (length < MaxScrollValue) {
- horizontalScrollBar()->setRange(0, length);
- horizontalScrollBar()->setSliderPosition(offset.convert_to<double>());
+ hscrollbar->setRange(0, length);
+ hscrollbar->setSliderPosition(offset.convert_to<double>());
} else {
- horizontalScrollBar()->setRange(0, MaxScrollValue);
- horizontalScrollBar()->setSliderPosition(
+ hscrollbar->setRange(0, MaxScrollValue);
+ hscrollbar->setSliderPosition(
(offset_ * MaxScrollValue / (scale_ * length)).convert_to<double>());
}
updating_scroll_ = false;
// Set the vertical scrollbar
- verticalScrollBar()->setPageStep(areaSize.height());
- verticalScrollBar()->setSingleStep(areaSize.height() / 8);
+ vscrollbar->setPageStep(areaSize.height());
+ vscrollbar->setSingleStep(areaSize.height() / 8);
const pair<int, int> extents = v_extents();
// Don't change the scrollbar range if there are no traces
if (extents.first != extents.second)
- verticalScrollBar()->setRange(extents.first - areaSize.height(),
+ vscrollbar->setRange(extents.first - areaSize.height(),
extents.second);
if (scroll_needs_defaults)
void View::reset_scroll()
{
- verticalScrollBar()->setRange(0, 0);
+ scrollarea_.verticalScrollBar()->setRange(0, 0);
}
void View::set_scroll_default()
void View::update_layout()
{
- setViewportMargins(
- header_->sizeHint().width() - pv::view::Header::BaselineOffset,
+ scrollarea_.setViewportMargins(
+ header_->sizeHint().width() - Header::BaselineOffset,
ruler_->sizeHint().height(), 0, 0);
ruler_->setGeometry(viewport_->x(), 0,
viewport_->width(), ruler_->extended_size_hint().height());
return QObject::eventFilter(object, event);
}
-bool View::viewportEvent(QEvent *event)
-{
- switch (event->type()) {
- case QEvent::Paint:
- case QEvent::MouseButtonPress:
- case QEvent::MouseButtonRelease:
- case QEvent::MouseButtonDblClick:
- case QEvent::MouseMove:
- case QEvent::Wheel:
- case QEvent::TouchBegin:
- case QEvent::TouchUpdate:
- case QEvent::TouchEnd:
- return false;
- default:
- return QAbstractScrollArea::viewportEvent(event);
- }
-}
-
void View::resizeEvent(QResizeEvent*)
{
update_layout();
sticky_scrolling_changed(false);
}
- const int range = horizontalScrollBar()->maximum();
+ const int range = scrollarea_.horizontalScrollBar()->maximum();
if (range < MaxScrollValue)
set_offset(scale_ * value);
else {
// Do we need to set the vertical scrollbar to its default position later?
// We do if there are no traces, i.e. the scroll bar has no range set
bool reset_scrollbar =
- verticalScrollBar()->minimum() == verticalScrollBar()->maximum();
+ (scrollarea_.verticalScrollBar()->minimum() ==
+ scrollarea_.verticalScrollBar()->maximum());
if (!session_.device()) {
reset_scroll();
r->hover_point_changed();
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_VIEW_HPP
-#define PULSEVIEW_PV_VIEW_VIEW_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEW_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEW_HPP
#include <stdint.h>
#include <QTimer>
#include <pv/data/signaldata.hpp>
+#include <pv/views/viewbase.hpp>
#include <pv/util.hpp>
#include "cursorpair.hpp"
class Session;
-namespace view {
+namespace views {
+
+namespace TraceView {
class CursorHeader;
class DecodeTrace;
class Viewport;
class TriggerMarker;
-class View : public QAbstractScrollArea, public TraceTreeItemOwner {
+class CustomAbstractScrollArea : public QAbstractScrollArea {
+ Q_OBJECT
+
+public:
+ CustomAbstractScrollArea(QWidget *parent = 0);
+ void setViewportMargins(int left, int top, int right, int bottom);
+ bool viewportEvent(QEvent *event);
+};
+
+class View : public ViewBase, public TraceTreeItemOwner {
Q_OBJECT
private:
/**
* Returns the signals contained in this view.
*/
- std::unordered_set< std::shared_ptr<view::Signal> > signals() const;
+ std::unordered_set< std::shared_ptr<Signal> > signals() const;
- void clear_signals();
+ virtual void clear_signals();
- void add_signal(const std::shared_ptr<view::Signal> signal);
+ virtual void add_signal(const std::shared_ptr<Signal> signal);
#ifdef ENABLE_DECODE
- void clear_decode_traces();
+ virtual void clear_decode_signals();
- void add_decode_trace(std::shared_ptr<data::SignalBase> signalbase);
+ virtual void add_decode_signal(std::shared_ptr<data::SignalBase> signalbase);
- void remove_decode_trace(std::shared_ptr<data::SignalBase> signalbase);
+ virtual void remove_decode_signal(std::shared_ptr<data::SignalBase> signalbase);
#endif
/**
* Returns the view of the owner.
*/
- virtual pv::view::View* view();
+ virtual View* view();
/**
* Returns the view of the owner.
*/
- virtual const pv::view::View* view() const;
+ virtual const View* view() const;
Viewport* viewport();
const Viewport* viewport() const;
- void save_settings(QSettings &settings) const;
+ virtual void save_settings(QSettings &settings) const;
- void restore_settings(QSettings &settings);
+ virtual void restore_settings(QSettings &settings);
/**
* Gets a list of time markers.
bool eventFilter(QObject *object, QEvent *event);
- bool viewportEvent(QEvent *event);
-
void resizeEvent(QResizeEvent *event);
public:
void set_time_unit(pv::util::TimeUnit time_unit);
private:
- Session &session_;
-
Viewport *viewport_;
Ruler *ruler_;
Header *header_;
- std::unordered_set< std::shared_ptr<view::Signal> > signals_;
+ std::unordered_set< std::shared_ptr<Signal> > signals_;
#ifdef ENABLE_DECODE
- std::vector< std::shared_ptr<view::DecodeTrace> > decode_traces_;
+ std::vector< std::shared_ptr<DecodeTrace> > decode_traces_;
#endif
+ CustomAbstractScrollArea scrollarea_;
+
/// The view time scale in seconds per pixel.
double scale_;
bool scroll_needs_defaults;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_VIEW_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEW_HPP
#include <QPalette>
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
const QSizeF ViewItem::LabelPadding(4, 0);
const int ViewItem::HighlightRadius = 3;
return (background.lightness() > 110) ? Qt::black : Qt::white;
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
class Popup;
}
-namespace view {
+namespace views {
+namespace TraceView {
class ViewItemOwner;
bool selected_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
#endif // PULSEVIEW_PV_VIEWITEM_HPP
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_VIEWITEMITERATOR_HPP
-#define PULSEVIEW_PV_VIEW_VIEWITEMITERATOR_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMITERATOR_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMITERATOR_HPP
#include <algorithm>
#include <cassert>
#include <pv/session.hpp>
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
template<class Owner, class Item> class ViewItemIterator
{
a.swap(b);
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_VIEWITEMITERATOR_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMITERATOR_HPP
using std::vector;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
ViewItemOwner::iterator ViewItemOwner::begin()
{
return const_iterator(this);
}
-} // view
-} // pv
+} // namespace TraceView
+} // namespace views
+} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_VIEWITEMOWNER_HPP
-#define PULSEVIEW_PV_VIEW_VIEWITEMOWNER_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMOWNER_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMOWNER_HPP
#include <memory>
#include <vector>
class Session;
-namespace view {
+namespace views {
+namespace TraceView {
class ViewItem;
class View;
item_list items_;
};
-} // view
-} // pv
+} // namespace TraceView
+} // namespace views
+} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_VIEWITEMOWNER_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMOWNER_HPP
#include "viewitempaintparams.hpp"
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
ViewItemPaintParams::ViewItemPaintParams(
const QRect &rect, double scale, const pv::util::Timestamp& offset) :
return QFontMetrics(font()).height();
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_VIEWITEMPAINTPARAMS_HPP
-#define PULSEVIEW_PV_VIEW_VIEWITEMPAINTPARAMS_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMPAINTPARAMS_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMPAINTPARAMS_HPP
#include "pv/util.hpp"
#include <QRect>
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class ViewItemPaintParams
{
pv::util::Timestamp offset_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_VIEWITEMPAINTPARAMS_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWITEMPAINTPARAMS_HPP
#include <QMouseEvent>
+#include <QDebug>
+
using std::abs;
using std::back_inserter;
using std::copy;
using std::vector;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
Viewport::Viewport(View &parent) :
ViewWidget(parent),
}
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_VIEWPORT_HPP
-#define PULSEVIEW_PV_VIEW_VIEWPORT_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWPORT_HPP
+#define PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWPORT_HPP
#include <boost/optional.hpp>
class Session;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
class View;
* @param item The item that is being hovered over, or @c nullptr
* if no view item is being hovered over.
*/
- void item_hover(const std::shared_ptr<pv::view::ViewItem> &item);
+ void item_hover(const std::shared_ptr<ViewItem> &item);
/**
* Gets the first view item which has a hit-box that contains @c pt .
* @return the view item that has been found, or and empty
* @c shared_ptr if no item was found.
*/
- std::shared_ptr<pv::view::ViewItem> get_mouse_over_item(
- const QPoint &pt);
+ std::shared_ptr<ViewItem> get_mouse_over_item(const QPoint &pt);
/**
* Sets this item into the dragged state.
/**
* Gets the items in the view widget.
*/
- std::vector< std::shared_ptr<pv::view::ViewItem> > items();
+ std::vector< std::shared_ptr<ViewItem> > items();
/**
* Handles touch begin update and end events.
bool pinch_zoom_active_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_VIEWPORT_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_VIEWPORT_HPP
using std::vector;
namespace pv {
-namespace view {
+namespace views {
+namespace TraceView {
ViewWidget::ViewWidget(View &parent) :
QWidget(&parent),
update();
}
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
class QTouchEvent;
namespace pv {
-namespace view {
-
-enum ViewType {
- TraceView,
- TabularDecodeView
-};
+namespace views {
+namespace TraceView {
class View;
class ViewItem;
* @remarks the default implementation does nothing.
*/
virtual void item_hover(
- const std::shared_ptr<pv::view::ViewItem> &item);
+ const std::shared_ptr<ViewItem> &item);
/**
* Indicates the event an a view item has been clicked.
* @remarks the default implementation does nothing.
*/
virtual void item_clicked(
- const std::shared_ptr<pv::view::ViewItem> &item);
+ const std::shared_ptr<ViewItem> &item);
/**
* Returns true if the selection of row items allows dragging.
/**
* Gets the items in the view widget.
*/
- virtual std::vector< std::shared_ptr<pv::view::ViewItem> > items() = 0;
+ virtual std::vector< std::shared_ptr<ViewItem> > items() = 0;
/**
* Gets the first view item which has a hit-box that contains @c pt .
* @return the view item that has been found, or and empty
* @c shared_ptr if no item was found.
*/
- virtual std::shared_ptr<pv::view::ViewItem> get_mouse_over_item(
+ virtual std::shared_ptr<ViewItem> get_mouse_over_item(
const QPoint &pt) = 0;
/**
void selection_changed();
protected:
- pv::view::View &view_;
+ pv::views::TraceView::View &view_;
QPoint mouse_point_;
QPoint mouse_down_point_;
std::shared_ptr<ViewItem> mouse_down_item_;
bool item_dragging_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
#endif // PULSEVIEW_PV_VIEWWIDGET_HPP
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ * Copyright (C) 2016 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef ENABLE_DECODE
+#include <libsigrokdecode/libsigrokdecode.h>
+#endif
+
+#include <libsigrokcxx/libsigrokcxx.hpp>
+
+#include "pv/session.hpp"
+#include "pv/util.hpp"
+
+using std::shared_ptr;
+
+namespace pv {
+namespace views {
+
+ViewBase::ViewBase(Session &session, QWidget *parent) :
+ session_(session)
+{
+ (void)parent;
+
+ connect(&session_, SIGNAL(signals_changed()),
+ this, SLOT(signals_changed()));
+ connect(&session_, SIGNAL(capture_state_changed(int)),
+ this, SLOT(capture_state_updated(int)));
+ connect(&session_, SIGNAL(data_received()),
+ this, SLOT(data_updated()));
+ connect(&session_, SIGNAL(frame_ended()),
+ this, SLOT(data_updated()));
+}
+
+Session& ViewBase::session()
+{
+ return session_;
+}
+
+const Session& ViewBase::session() const
+{
+ return session_;
+}
+
+void ViewBase::clear_signals()
+{
+}
+
+#ifdef ENABLE_DECODE
+void ViewBase::clear_decode_signals()
+{
+}
+
+void ViewBase::add_decode_signal(shared_ptr<data::SignalBase> signalbase)
+{
+ (void)signalbase;
+}
+
+void ViewBase::remove_decode_signal(shared_ptr<data::SignalBase> signalbase)
+{
+ (void)signalbase;
+}
+#endif
+
+void ViewBase::save_settings(QSettings &settings) const
+{
+ (void)settings;
+}
+
+void ViewBase::restore_settings(QSettings &settings)
+{
+ (void)settings;
+}
+
+void ViewBase::trigger_event(util::Timestamp location)
+{
+ (void)location;
+}
+
+void ViewBase::signals_changed()
+{
+}
+
+void ViewBase::capture_state_updated(int state)
+{
+ (void)state;
+}
+
+void ViewBase::data_updated()
+{
+}
+
+} // namespace view
+} // namespace pv
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
+ * Copyright (C) 2016 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef PULSEVIEW_PV_VIEWS_VIEWBASE_HPP
+#define PULSEVIEW_PV_VIEWS_VIEWBASE_HPP
+
+#include <stdint.h>
+
+#include <memory>
+#include <set>
+#include <vector>
+
+#include <QWidget>
+
+#include <pv/data/signalbase.hpp>
+#include <pv/util.hpp>
+
+namespace pv {
+
+class Session;
+
+namespace view {
+class DecodeTrace;
+class Signal;
+}
+
+namespace views {
+
+enum ViewType {
+ ViewTypeTrace,
+ ViewTypeTabularDecode
+};
+
+class ViewBase : public QWidget {
+ Q_OBJECT
+
+public:
+ explicit ViewBase(Session &session, QWidget *parent = 0);
+
+ Session& session();
+ const Session& session() const;
+
+ virtual void clear_signals();
+
+#ifdef ENABLE_DECODE
+ virtual void clear_decode_signals();
+
+ virtual void add_decode_signal(std::shared_ptr<data::SignalBase> signalbase);
+
+ virtual void remove_decode_signal(std::shared_ptr<data::SignalBase> signalbase);
+#endif
+
+ virtual void save_settings(QSettings &settings) const;
+
+ virtual void restore_settings(QSettings &settings);
+
+public Q_SLOTS:
+ virtual void trigger_event(util::Timestamp location);
+ virtual void signals_changed();
+ virtual void capture_state_updated(int state);
+ virtual void data_updated();
+
+protected:
+ Session &session_;
+
+ util::TimeUnit time_unit_;
+};
+
+} // namespace views
+} // namespace pv
+
+#endif // PULSEVIEW_PV_VIEWS_VIEWBASE_HPP