Commit 618f7c92 authored by DreamSourceLab's avatar DreamSourceLab

fix instant sample issue when no start operations @ DSO module

parent 44051a29
......@@ -51,5 +51,9 @@
<file>icons/trigger_cn.png</file>
<file>icons/trigger_dis_cn.png</file>
<file>icons/protocol_cn.png</file>
<file>icons/instant_dis.png</file>
<file>icons/instant_dis_cn.png</file>
<file>icons/start_dis.png</file>
<file>icons/start_dis_cn.png</file>
</qresource>
</RCC>
......@@ -942,6 +942,15 @@ void SigSession::feed_in_dso(const sr_datafeed_dso &dso)
if (!_cur_dso_snapshot)
{
// reset scale of dso signal
BOOST_FOREACH(const boost::shared_ptr<view::Signal> s, _signals)
{
assert(s);
boost::shared_ptr<view::DsoSignal> dsoSig;
if (dsoSig = dynamic_pointer_cast<view::DsoSignal>(s))
dsoSig->set_scale(dsoSig->get_view_rect().height() / 256.0f);
}
// Create a new data snapshot
_cur_dso_snapshot = boost::shared_ptr<data::DsoSnapshot>(
new data::DsoSnapshot(dso, _dev_inst->get_sample_limit(), get_ch_num(SR_CHANNEL_DSO), _instant));
......
......@@ -92,10 +92,14 @@ SamplingBar::SamplingBar(SigSession &session, QWidget *parent) :
_icon_stop(":/icons/stop_cn.png"),
_icon_start(":/icons/start_cn.png"),
_icon_instant(":/icons/instant_cn.png"),
_icon_start_dis(":/icons/start_dis_cn.png"),
_icon_instant_dis(":/icons/instant_dis_cn.png"),
#else
_icon_stop(":/icons/stop.png"),
_icon_start(":/icons/start.png"),
_icon_instant(":/icons/instant.png"),
_icon_start_dis(":/icons/start_dis.png"),
_icon_instant_dis(":/icons/instant_dis.png"),
#endif
_run_stop_button(this),
_instant_button(this),
......@@ -295,10 +299,13 @@ void SamplingBar::update_sample_rate()
void SamplingBar::set_sampling(bool sampling)
{
if (_instant)
if (_instant) {
_instant_button.setIcon(sampling ? _icon_stop : _icon_instant);
else
_run_stop_button.setIcon(sampling ? _icon_start_dis : _icon_start);
} else {
_run_stop_button.setIcon(sampling ? _icon_stop : _icon_start);
_instant_button.setIcon(sampling ? _icon_instant_dis : _icon_instant);
}
if (!sampling) {
g_usleep(100000);
......
......@@ -140,6 +140,8 @@ private:
QIcon _icon_stop;
QIcon _icon_start;
QIcon _icon_instant;
QIcon _icon_start_dis;
QIcon _icon_instant_dis;
QToolButton _run_stop_button;
QToolButton _instant_button;
......
......@@ -738,9 +738,6 @@ void DsoSignal::paint_mid(QPainter &p, int left, int right)
_data->get_snapshots();
if (snapshots.empty())
return;
if (_view->session().get_capture_state() == SigSession::Running)
_scale = height * 1.0f / 256;
const boost::shared_ptr<pv::data::DsoSnapshot> &snapshot =
snapshots.front();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment