projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert threshold display setting to a multi-value choice
[pulseview.git]
/
pv
/
views
/
trace
/
analogsignal.cpp
diff --git
a/pv/views/trace/analogsignal.cpp
b/pv/views/trace/analogsignal.cpp
index a78d65541ba6544713793d884bff0c8309002e1c..ef6581fc1dd90ba46edfa27a2a886d3da914f471 100644
(file)
--- a/
pv/views/trace/analogsignal.cpp
+++ b/
pv/views/trace/analogsignal.cpp
@@
-113,12
+113,12
@@
AnalogSignal::AnalogSignal(
connect(analog_data, SIGNAL(min_max_changed(float, float)),
this, SLOT(on_min_max_changed(float, float)));
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_settingView
ShowConversionThresholds
_changed, this, _1));
+ GlobalSettings::register_change_handler(GlobalSettings::Key_View_
ConversionThresholdDispMode
,
+ bind(&AnalogSignal::on_settingView
ConversionThresholdDispMode
_changed, this, _1));
GlobalSettings gs;
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();
div_height_ = gs.value(GlobalSettings::Key_View_DefaultDivHeight).toInt();
@@
-206,10
+206,13
@@
void AnalogSignal::paint_back(QPainter &p, ViewItemPaintParams &pp)
if (!base_->enabled())
return;
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
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();
((display_type_ == DisplayAnalog) || (display_type_ == DisplayBoth))) {
const int visual_y = get_visual_y();
@@
-1073,9
+1076,9
@@
void AnalogSignal::on_display_type_changed(int index)
owner_->row_item_appearance_changed(false, true);
}
owner_->row_item_appearance_changed(false, true);
}
-void AnalogSignal::on_settingView
ShowConversionThresholds
_changed(const QVariant new_value)
+void AnalogSignal::on_settingView
ConversionThresholdDispMode
_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);
if (owner_)
owner_->row_item_appearance_changed(false, true);