forked from Ivasoft/DSView
Fix vertical scale issue after stop capturing @dso mode
This commit is contained in:
@@ -62,7 +62,6 @@ DsoSignal::DsoSignal(boost::shared_ptr<pv::device::DevInst> dev_inst,
|
||||
Signal(dev_inst, probe),
|
||||
_data(data),
|
||||
_scale(0),
|
||||
_stop_scale(1),
|
||||
_en_lock(false),
|
||||
_show(true),
|
||||
_vDialActive(false),
|
||||
@@ -121,7 +120,7 @@ boost::shared_ptr<pv::data::Dso> DsoSignal::dso_data() const
|
||||
|
||||
void DsoSignal::set_scale(int height)
|
||||
{
|
||||
_scale = height / (_ref_max - _ref_min) * _stop_scale;
|
||||
_scale = height / (_ref_max - _ref_min) * _view->session().stop_scale();
|
||||
}
|
||||
|
||||
float DsoSignal::get_scale()
|
||||
@@ -218,7 +217,7 @@ bool DsoSignal::go_vDialPre(bool manul)
|
||||
_dev_inst->set_config(_probe, NULL, SR_CONF_PROBE_VDIV,
|
||||
g_variant_new_uint64(_vDial->get_value()));
|
||||
if (_view->session().get_capture_state() == SigSession::Stopped) {
|
||||
_stop_scale *= pre_vdiv/_vDial->get_value();
|
||||
_view->session().set_stop_scale(_view->session().stop_scale() * (pre_vdiv/_vDial->get_value()));
|
||||
set_scale(get_view_rect().height());
|
||||
}
|
||||
_dev_inst->set_config(_probe, NULL, SR_CONF_PROBE_OFFSET,
|
||||
@@ -248,7 +247,7 @@ bool DsoSignal::go_vDialNext(bool manul)
|
||||
_dev_inst->set_config(_probe, NULL, SR_CONF_PROBE_VDIV,
|
||||
g_variant_new_uint64(_vDial->get_value()));
|
||||
if (_view->session().get_capture_state() == SigSession::Stopped) {
|
||||
_stop_scale *= pre_vdiv/_vDial->get_value();
|
||||
_view->session().set_stop_scale(_view->session().stop_scale() * (pre_vdiv/_vDial->get_value()));
|
||||
set_scale(get_view_rect().height());
|
||||
}
|
||||
_dev_inst->set_config(_probe, NULL, SR_CONF_PROBE_OFFSET,
|
||||
@@ -839,9 +838,6 @@ void DsoSignal::paint_mid(QPainter &p, int left, int right, QColor fore, QColor
|
||||
assert(_view);
|
||||
assert(right >= left);
|
||||
|
||||
if (_view->session().get_capture_state() == SigSession::Running)
|
||||
_stop_scale = 1;
|
||||
|
||||
if (enabled()) {
|
||||
const int index = get_index();
|
||||
const int width = right - left;
|
||||
|
||||
Reference in New Issue
Block a user