.B "."
Show / hide sampling points.
.TP
+.B "g"
+Show / hide analog minor grid (in addition to the vdiv grid).
+.TP
.B "c"
Show / hide cursors.
.TP
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);
+ QCheckBox *show_analog_minor_grid_cb = new QCheckBox();
+ show_analog_minor_grid_cb->setChecked(settings.value(GlobalSettings::Key_View_ShowAnalogMinorGrid).toBool());
+ connect(show_analog_minor_grid_cb, SIGNAL(stateChanged(int)), this, SLOT(on_view_showAnalogMinorGrid_changed(int)));
+ trace_view_layout->addRow(tr("Show analog minor grid in addition to vdiv grid"), show_analog_minor_grid_cb);
+
return form;
}
settings.setValue(GlobalSettings::Key_View_ShowSamplingPoints, state ? true : false);
}
+void Settings::on_view_showAnalogMinorGrid_changed(int state)
+{
+ GlobalSettings settings;
+ settings.setValue(GlobalSettings::Key_View_ShowAnalogMinorGrid, state ? true : false);
+}
+
} // namespace dialogs
} // namespace pv
void on_view_colouredBG_changed(int state);
void on_view_stickyScrolling_changed(int state);
void on_view_showSamplingPoints_changed(int state);
+ void on_view_showAnalogMinorGrid_changed(int state);
private:
DeviceManager &device_manager_;
const QString GlobalSettings::Key_View_ColouredBG = "View_ColouredBG";
const QString GlobalSettings::Key_View_StickyScrolling = "View_StickyScrolling";
const QString GlobalSettings::Key_View_ShowSamplingPoints = "View_ShowSamplingPoints";
+const QString GlobalSettings::Key_View_ShowAnalogMinorGrid = "View_ShowAnalogMinorGrid";
multimap< QString, function<void(QVariant)> > GlobalSettings::callbacks_;
bool GlobalSettings::tracking_ = false;
static const QString Key_View_ColouredBG;
static const QString Key_View_StickyScrolling;
static const QString Key_View_ShowSamplingPoints;
+ static const QString Key_View_ShowAnalogMinorGrid;
public:
GlobalSettings();
GlobalSettings::register_change_handler(GlobalSettings::Key_View_ShowSamplingPoints,
bind(&MainWindow::on_settingViewShowSamplingPoints_changed, this, _1));
+ GlobalSettings::register_change_handler(GlobalSettings::Key_View_ShowAnalogMinorGrid,
+ bind(&MainWindow::on_settingViewShowAnalogMinorGrid_changed, this, _1));
+
setup_ui();
restore_ui_settings();
tv->enable_coloured_bg(settings.value(GlobalSettings::Key_View_ColouredBG).toBool());
tv->enable_show_sampling_points(settings.value(GlobalSettings::Key_View_ShowSamplingPoints).toBool());
+ tv->enable_show_analog_minor_grid(settings.value(GlobalSettings::Key_View_ShowAnalogMinorGrid).toBool());
if (!main_bar) {
/* Initial view, create the main bar */
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_show_analog_minor_grid_shortcut_ = new QShortcut(QKeySequence(Qt::Key_G), this, SLOT(on_view_show_analog_minor_grid_shortcut()));
+ view_show_analog_minor_grid_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_ShowSamplingPoints, !state);
}
+void MainWindow::on_view_show_analog_minor_grid_shortcut()
+{
+ GlobalSettings settings;
+
+ bool state = settings.value(GlobalSettings::Key_View_ShowAnalogMinorGrid).toBool();
+ settings.setValue(GlobalSettings::Key_View_ShowAnalogMinorGrid, !state);
+}
+
void MainWindow::on_settingViewColouredBg_changed(const QVariant new_value)
{
bool state = new_value.toBool();
}
}
+void MainWindow::on_settingViewShowAnalogMinorGrid_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_analog_minor_grid(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_view_show_analog_minor_grid_shortcut();
void on_settingViewColouredBg_changed(const QVariant new_value);
void on_settingViewShowSamplingPoints_changed(const QVariant new_value);
+ void on_settingViewShowAnalogMinorGrid_changed(const QVariant new_value);
void on_close_current_tab();
QShortcut *view_sticky_scrolling_shortcut_;
QShortcut *view_show_sampling_points_shortcut_;
+ QShortcut *view_show_analog_minor_grid_shortcut_;
QShortcut *view_coloured_bg_shortcut_;
QShortcut *run_stop_shortcut_;
QShortcut *close_application_shortcut_;
{
p.setRenderHint(QPainter::Antialiasing, false);
+ GlobalSettings settings;
+ const bool show_analog_minor_grid =
+ settings.value(GlobalSettings::Key_View_ShowAnalogMinorGrid).toBool();
+
if (pos_vdivs_ > 0) {
p.setPen(QPen(GridMajorColor, 1, Qt::DashLine));
for (int i = 1; i <= pos_vdivs_; i++) {
const float dy = i * div_height_;
p.drawLine(QLineF(left, y - dy, right, y - dy));
}
+ }
+ if ((pos_vdivs_ > 0) && show_analog_minor_grid) {
p.setPen(QPen(GridMinorColor, 1, Qt::DashLine));
for (int i = 0; i < pos_vdivs_; i++) {
const float dy = i * div_height_;
const float dy = i * div_height_;
p.drawLine(QLineF(left, y + dy, right, y + dy));
}
+ }
+ if ((pos_vdivs_ > 0) && show_analog_minor_grid) {
p.setPen(QPen(GridMinorColor, 1, Qt::DashLine));
for (int i = 0; i < neg_vdivs_; i++) {
const float dy = i * div_height_;
viewport_->update();
}
+void View::enable_show_analog_minor_grid(bool state)
+{
+ (void)state;
+
+ viewport_->update();
+}
+
void View::enable_coloured_bg(bool state)
{
const vector<shared_ptr<TraceTreeItem>> items(
*/
void enable_show_sampling_points(bool state);
+ /**
+ * Enable or disable showing the analog minor grid.
+ */
+ void enable_show_analog_minor_grid(bool state);
+
/**
* Returns true if cursors are displayed. false otherwise.
*/