.B "s"
Enable / disable sticky scrolling.
.TP
+.B "."
+Show / hide sampling points.
+.TP
.B "c"
Show / hide cursors.
.TP
connect(sticky_scrolling_cb, SIGNAL(stateChanged(int)), this, SLOT(on_view_stickyScrolling_changed(int)));
trace_view_layout->addRow(tr("Always keep &newest samples at the right edge during capture"), sticky_scrolling_cb);
+ QCheckBox *show_sampling_points_cb = new QCheckBox();
+ show_sampling_points_cb->setChecked(settings.value(GlobalSettings::Key_View_ShowSamplingPoints).toBool());
+ connect(show_sampling_points_cb, SIGNAL(stateChanged(int)), this, SLOT(on_view_showSamplingPoints_changed(int)));
+ trace_view_layout->addRow(tr("Show data &sampling points"), show_sampling_points_cb);
+
return form;
}
settings.setValue(GlobalSettings::Key_View_StickyScrolling, state ? true : false);
}
+void Settings::on_view_showSamplingPoints_changed(int state)
+{
+ GlobalSettings settings;
+ settings.setValue(GlobalSettings::Key_View_ShowSamplingPoints, state ? true : false);
+}
} // namespace dialogs
} // namespace pv
void on_view_alwaysZoomToFit_changed(int state);
void on_view_colouredBG_changed(int state);
void on_view_stickyScrolling_changed(int state);
+ void on_view_showSamplingPoints_changed(int state);
private:
DeviceManager &device_manager_;
const QString GlobalSettings::Key_View_AlwaysZoomToFit = "View_AlwaysZoomToFit";
const QString GlobalSettings::Key_View_ColouredBG = "View_ColouredBG";
const QString GlobalSettings::Key_View_StickyScrolling = "View_StickyScrolling";
+const QString GlobalSettings::Key_View_ShowSamplingPoints = "View_ShowSamplingPoints";
std::multimap< QString, std::function<void(QVariant)> > GlobalSettings::callbacks_;
bool GlobalSettings::tracking_ = false;
static const QString Key_View_AlwaysZoomToFit;
static const QString Key_View_ColouredBG;
static const QString Key_View_StickyScrolling;
+ static const QString Key_View_ShowSamplingPoints;
public:
GlobalSettings();
GlobalSettings::register_change_handler(GlobalSettings::Key_View_ColouredBG,
bind(&MainWindow::on_settingViewColouredBg_changed, this, _1));
+ GlobalSettings::register_change_handler(GlobalSettings::Key_View_ShowSamplingPoints,
+ bind(&MainWindow::on_settingViewShowSamplingPoints_changed, this, _1));
+
setup_ui();
restore_ui_settings();
qobject_cast<views::TraceView::View*>(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());
if (!main_bar) {
/* Initial view, create the main bar */
view_sticky_scrolling_shortcut_ = new QShortcut(QKeySequence(Qt::Key_S), this, SLOT(on_view_sticky_scrolling_shortcut()));
view_sticky_scrolling_shortcut_->setAutoRepeat(false);
+ view_show_sampling_points_shortcut_ = new QShortcut(QKeySequence(Qt::Key_Period), this, SLOT(on_view_show_sampling_points_shortcut()));
+ view_show_sampling_points_shortcut_->setAutoRepeat(false);
+
view_coloured_bg_shortcut_ = new QShortcut(QKeySequence(Qt::Key_B), this, SLOT(on_view_coloured_bg_shortcut()));
view_coloured_bg_shortcut_->setAutoRepeat(false);
settings.setValue(GlobalSettings::Key_View_StickyScrolling, !state);
}
+void MainWindow::on_view_show_sampling_points_shortcut()
+{
+ GlobalSettings settings;
+
+ bool state = settings.value(GlobalSettings::Key_View_ShowSamplingPoints).toBool();
+ settings.setValue(GlobalSettings::Key_View_ShowSamplingPoints, !state);
+}
+
void MainWindow::on_settingViewColouredBg_changed(const QVariant new_value)
{
bool state = new_value.toBool();
}
}
+void MainWindow::on_settingViewShowSamplingPoints_changed(const QVariant new_value)
+{
+ bool state = new_value.toBool();
+
+ for (auto entry : view_docks_) {
+ shared_ptr<views::ViewBase> viewbase = entry.second;
+
+ // Only trace views have this setting
+ views::TraceView::View* view =
+ qobject_cast<views::TraceView::View*>(viewbase.get());
+ if (view)
+ view->enable_show_sampling_points(state);
+ }
+}
+
void MainWindow::on_close_current_tab()
{
int tab = session_selector_.currentIndex();
void on_view_coloured_bg_shortcut();
void on_view_sticky_scrolling_shortcut();
+ void on_view_show_sampling_points_shortcut();
void on_settingViewColouredBg_changed(const QVariant new_value);
+ void on_settingViewShowSamplingPoints_changed(const QVariant new_value);
void on_close_current_tab();
QIcon icon_grey_;
QShortcut *view_sticky_scrolling_shortcut_;
+ QShortcut *view_show_sampling_points_shortcut_;
QShortcut *view_coloured_bg_shortcut_;
QShortcut *run_stop_shortcut_;
QShortcut *close_application_shortcut_;
#include <pv/data/logicsegment.hpp>
#include <pv/data/signalbase.hpp>
#include <pv/view/view.hpp>
+#include <pv/globalsettings.hpp>
#include <libsigrokcxx/libsigrokcxx.hpp>
delete[] cap_lines;
+ // Return if we don't need to paint the sampling points
+ GlobalSettings settings;
+ const bool show_sampling_points =
+ settings.value(GlobalSettings::Key_View_ShowSamplingPoints).toBool();
+ if (!show_sampling_points)
+ return;
+
// Paint the sampling points
const uint64_t sampling_points_count = end_sample - start_sample + 1;
QRectF *const sampling_points = new QRectF[sampling_points_count];
return make_pair(*left_time, *right_time);
}
+void View::enable_show_sampling_points(bool state)
+{
+ (void)state;
+
+ viewport_->update();
+}
+
void View::enable_coloured_bg(bool state)
{
const vector<shared_ptr<TraceTreeItem>> items(
*/
void enable_coloured_bg(bool state);
+ /**
+ * Enable or disable showing sampling points.
+ */
+ void enable_show_sampling_points(bool state);
+
/**
* Returns true if cursors are displayed. false otherwise.
*/