#include <boost/version.hpp>
#include <QApplication>
+#include <QComboBox>
#include <QDialogButtonBox>
#include <QFormLayout>
#include <QGroupBox>
cb = create_checkbox(GlobalSettings::Key_View_ShowAnalogMinorGrid,
SLOT(on_view_showAnalogMinorGrid_changed(int)));
- trace_view_layout->addRow(tr("Show analog minor grid in addition to vdiv grid"), cb);
-
- cb = create_checkbox(GlobalSettings::Key_View_ShowConversionThresholds,
- SLOT(on_view_showConversionThresholds_changed(int)));
- trace_view_layout->addRow(tr("Show conversion thresholds in analog traces"), cb);
+ trace_view_layout->addRow(tr("Show analog minor grid in addition to div grid"), cb);
+
+ QComboBox *thr_disp_mode_cb = new QComboBox();
+ thr_disp_mode_cb->addItem(tr("None"), GlobalSettings::ConvThrDispMode_None);
+ thr_disp_mode_cb->addItem(tr("Background"), GlobalSettings::ConvThrDispMode_Background);
+ thr_disp_mode_cb->addItem(tr("Dots"), GlobalSettings::ConvThrDispMode_Dots);
+ thr_disp_mode_cb->setCurrentIndex(
+ settings.value(GlobalSettings::Key_View_ConversionThresholdDispMode).toInt());
+ connect(thr_disp_mode_cb, SIGNAL(currentIndexChanged(int)),
+ this, SLOT(on_view_conversionThresholdDispMode_changed(int)));
+ trace_view_layout->addRow(tr("Conversion threshold display mode (analog traces only)"), thr_disp_mode_cb);
QSpinBox *default_div_height_sb = new QSpinBox();
default_div_height_sb->setRange(20, 1000);
settings.setValue(GlobalSettings::Key_View_ShowAnalogMinorGrid, state ? true : false);
}
-void Settings::on_view_showConversionThresholds_changed(int state)
+void Settings::on_view_conversionThresholdDispMode_changed(int state)
{
GlobalSettings settings;
- settings.setValue(GlobalSettings::Key_View_ShowConversionThresholds, state ? true : false);
+ settings.setValue(GlobalSettings::Key_View_ConversionThresholdDispMode, state);
}
void Settings::on_view_defaultDivHeight_changed(int value)
void on_view_stickyScrolling_changed(int state);
void on_view_showSamplingPoints_changed(int state);
void on_view_showAnalogMinorGrid_changed(int state);
- void on_view_showConversionThresholds_changed(int state);
+ void on_view_conversionThresholdDispMode_changed(int state);
void on_view_defaultDivHeight_changed(int value);
void on_view_defaultLogicHeight_changed(int value);
void on_dec_initialStateConfigurable_changed(int state);
const QString GlobalSettings::Key_View_StickyScrolling = "View_StickyScrolling";
const QString GlobalSettings::Key_View_ShowSamplingPoints = "View_ShowSamplingPoints";
const QString GlobalSettings::Key_View_ShowAnalogMinorGrid = "View_ShowAnalogMinorGrid";
-const QString GlobalSettings::Key_View_ShowConversionThresholds = "View_ShowConversionThresholds";
+const QString GlobalSettings::Key_View_ConversionThresholdDispMode = "View_ConversionThresholdDispMode";
const QString GlobalSettings::Key_View_DefaultDivHeight = "View_DefaultDivHeight";
const QString GlobalSettings::Key_View_DefaultLogicHeight = "View_DefaultLogicHeight";
const QString GlobalSettings::Key_Dec_InitialStateConfigurable = "Dec_InitialStateConfigurable";
static const QString Key_View_StickyScrolling;
static const QString Key_View_ShowSamplingPoints;
static const QString Key_View_ShowAnalogMinorGrid;
- static const QString Key_View_ShowConversionThresholds;
+ static const QString Key_View_ConversionThresholdDispMode;
static const QString Key_View_DefaultDivHeight;
static const QString Key_View_DefaultLogicHeight;
static const QString Key_Dec_InitialStateConfigurable;
+ enum ConvThrDispMode {
+ ConvThrDispMode_None = 0,
+ ConvThrDispMode_Background,
+ ConvThrDispMode_Dots
+ };
+
public:
GlobalSettings();
connect(analog_data, SIGNAL(min_max_changed(float, float)),
this, SLOT(on_min_max_changed(float, float)));
- GlobalSettings::register_change_handler(GlobalSettings::Key_View_ShowConversionThresholds,
- bind(&AnalogSignal::on_settingViewShowConversionThresholds_changed, this, _1));
+ GlobalSettings::register_change_handler(GlobalSettings::Key_View_ConversionThresholdDispMode,
+ bind(&AnalogSignal::on_settingViewConversionThresholdDispMode_changed, this, _1));
GlobalSettings gs;
- show_conversion_thresholds_ =
- gs.value(GlobalSettings::Key_View_ShowConversionThresholds).toBool();
+ conversion_threshold_disp_mode_ =
+ gs.value(GlobalSettings::Key_View_ConversionThresholdDispMode).toInt();
div_height_ = gs.value(GlobalSettings::Key_View_DefaultDivHeight).toInt();
if (!base_->enabled())
return;
+ bool paint_thr_bg =
+ conversion_threshold_disp_mode_ == GlobalSettings::ConvThrDispMode_Background;
+
const vector<double> thresholds = base_->get_conversion_thresholds();
// Only display thresholds if we have some and we show analog samples
- if ((thresholds.size() > 0) && show_conversion_thresholds_ &&
+ if ((thresholds.size() > 0) && paint_thr_bg &&
((display_type_ == DisplayAnalog) || (display_type_ == DisplayBoth))) {
const int visual_y = get_visual_y();
owner_->row_item_appearance_changed(false, true);
}
-void AnalogSignal::on_settingViewShowConversionThresholds_changed(const QVariant new_value)
+void AnalogSignal::on_settingViewConversionThresholdDispMode_changed(const QVariant new_value)
{
- show_conversion_thresholds_ = new_value.toBool();
+ conversion_threshold_disp_mode_ = new_value.toInt();
if (owner_)
owner_->row_item_appearance_changed(false, true);
void on_display_type_changed(int index);
- void on_settingViewShowConversionThresholds_changed(const QVariant new_value);
+ void on_settingViewConversionThresholdDispMode_changed(const QVariant new_value);
private:
QComboBox *resolution_cb_, *conversion_cb_, *conv_threshold_cb_,
DisplayType display_type_;
bool autoranging_;
- bool show_conversion_thresholds_;
+ int conversion_threshold_disp_mode_;
};
} // namespace trace