From: Soeren Apel Date: Sat, 10 Jun 2017 13:37:45 +0000 (+0200) Subject: Adjust trace view namespace X-Git-Tag: pulseview-0.4.0~10 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f23c46921d031dba4c96062164cc9f3ca3c4809c;p=pulseview.git Adjust trace view namespace --- diff --git a/pv/mainwindow.cpp b/pv/mainwindow.cpp index e925bd63..a11d5286 100644 --- a/pv/mainwindow.cpp +++ b/pv/mainwindow.cpp @@ -152,7 +152,7 @@ shared_ptr MainWindow::add_view(const QString &title, if (type == views::ViewTypeTrace) // This view will be the main view if there's no main bar yet - v = make_shared(session, + v = make_shared(session, (main_bar ? false : true), dock_main); if (!v) @@ -180,8 +180,8 @@ shared_ptr MainWindow::add_view(const QString &title, SLOT(trigger_event(util::Timestamp))); if (type == views::ViewTypeTrace) { - views::TraceView::View *tv = - qobject_cast(v.get()); + views::trace::View *tv = + qobject_cast(v.get()); tv->enable_coloured_bg(settings.value(GlobalSettings::Key_View_ColouredBG).toBool()); tv->enable_show_sampling_points(settings.value(GlobalSettings::Key_View_ShowSamplingPoints).toBool()); @@ -799,8 +799,8 @@ void MainWindow::on_settingViewColouredBg_changed(const QVariant new_value) shared_ptr viewbase = entry.second; // Only trace views have this setting - views::TraceView::View* view = - qobject_cast(viewbase.get()); + views::trace::View* view = + qobject_cast(viewbase.get()); if (view) view->enable_coloured_bg(state); } @@ -814,8 +814,8 @@ void MainWindow::on_settingViewShowSamplingPoints_changed(const QVariant new_val shared_ptr viewbase = entry.second; // Only trace views have this setting - views::TraceView::View* view = - qobject_cast(viewbase.get()); + views::trace::View* view = + qobject_cast(viewbase.get()); if (view) view->enable_show_sampling_points(state); } @@ -829,8 +829,8 @@ void MainWindow::on_settingViewShowAnalogMinorGrid_changed(const QVariant new_va shared_ptr viewbase = entry.second; // Only trace views have this setting - views::TraceView::View* view = - qobject_cast(viewbase.get()); + views::trace::View* view = + qobject_cast(viewbase.get()); if (view) view->enable_show_analog_minor_grid(state); } diff --git a/pv/session.cpp b/pv/session.cpp index 66d80f1a..aa528d19 100644 --- a/pv/session.cpp +++ b/pv/session.cpp @@ -734,22 +734,22 @@ void Session::update_signals() // Make the signals list for (shared_ptr viewbase : views_) { - views::TraceView::View *trace_view = - qobject_cast(viewbase.get()); + views::trace::View *trace_view = + qobject_cast(viewbase.get()); if (trace_view) { - unordered_set< shared_ptr > + unordered_set< shared_ptr > prev_sigs(trace_view->signals()); trace_view->clear_signals(); for (auto channel : sr_dev->channels()) { shared_ptr signalbase; - shared_ptr signal; + shared_ptr signal; // Find the channel in the old signals const auto iter = find_if( prev_sigs.cbegin(), prev_sigs.cend(), - [&](const shared_ptr &s) { + [&](const shared_ptr &s) { return s->base()->channel() == channel; }); if (iter != prev_sigs.end()) { @@ -777,8 +777,8 @@ void Session::update_signals() signalbase.get(), SLOT(on_capture_state_changed(int))); } - signal = shared_ptr( - new views::TraceView::LogicSignal(*this, + signal = shared_ptr( + new views::trace::LogicSignal(*this, device_, signalbase)); trace_view->add_signal(signal); break; @@ -798,8 +798,8 @@ void Session::update_signals() signalbase.get(), SLOT(on_capture_state_changed(int))); } - signal = shared_ptr( - new views::TraceView::AnalogSignal( + signal = shared_ptr( + new views::trace::AnalogSignal( *this, signalbase)); trace_view->add_signal(signal); break; diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index 76cd8ea1..22ed3988 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -87,7 +87,7 @@ const char *MainBar::SettingOpenDirectory = "MainWindow/OpenDirectory"; const char *MainBar::SettingSaveDirectory = "MainWindow/SaveDirectory"; MainBar::MainBar(Session &session, QWidget *parent, - pv::views::TraceView::View *view) : + pv::views::trace::View *view) : StandardBar(session, parent, view, false), action_new_view_(new QAction(this)), action_open_(new QAction(this)), @@ -595,8 +595,8 @@ void MainBar::export_file(shared_ptr format, bool selection_only) // Selection only? Verify that the cursors are active and fetch their values if (selection_only) { - views::TraceView::View *trace_view = - qobject_cast(session_.main_view().get()); + views::trace::View *trace_view = + qobject_cast(session_.main_view().get()); if (!trace_view->cursors()->enabled()) { show_session_error(tr("Missing Cursors"), tr("You need to set the " \ diff --git a/pv/toolbars/mainbar.hpp b/pv/toolbars/mainbar.hpp index fd4d94b8..810cab27 100644 --- a/pv/toolbars/mainbar.hpp +++ b/pv/toolbars/mainbar.hpp @@ -56,7 +56,7 @@ class MainWindow; class Session; namespace views { -namespace TraceView { +namespace trace { class View; } } @@ -86,7 +86,7 @@ private: public: MainBar(Session &session, QWidget *parent, - pv::views::TraceView::View *view); + pv::views::trace::View *view); void update_device_list(); diff --git a/pv/views/trace/standardbar.cpp b/pv/views/trace/standardbar.cpp index fa02d167..bc2c3ba8 100644 --- a/pv/views/trace/standardbar.cpp +++ b/pv/views/trace/standardbar.cpp @@ -26,7 +26,7 @@ #include -using pv::views::TraceView::View; +using pv::views::trace::View; namespace pv { namespace views { diff --git a/pv/views/trace/standardbar.hpp b/pv/views/trace/standardbar.hpp index 7a76a639..09c7907f 100644 --- a/pv/views/trace/standardbar.hpp +++ b/pv/views/trace/standardbar.hpp @@ -36,7 +36,7 @@ class Session; namespace views { -namespace TraceView { +namespace trace { class View; } @@ -48,7 +48,7 @@ class StandardBar : public QToolBar public: StandardBar(Session &session, QWidget *parent, - TraceView::View *view, bool add_default_widgets = true); + trace::View *view, bool add_default_widgets = true); Session &session() const; @@ -62,7 +62,7 @@ protected: virtual void add_toolbar_widgets(); Session &session_; - TraceView::View *view_; + trace::View *view_; QAction *const action_view_zoom_in_; QAction *const action_view_zoom_out_; diff --git a/test/view/ruler.cpp b/test/view/ruler.cpp index 9287975c..37ba9c86 100644 --- a/test/view/ruler.cpp +++ b/test/view/ruler.cpp @@ -23,7 +23,7 @@ #include "pv/views/trace/ruler.hpp" #include "test/test.hpp" -using namespace pv::views::TraceView; +using namespace pv::views::trace; namespace { QString format(const pv::util::Timestamp& t)