diff --git a/DSView/pv/sigsession.cpp b/DSView/pv/sigsession.cpp index 5f56193c..21e4acf2 100644 --- a/DSView/pv/sigsession.cpp +++ b/DSView/pv/sigsession.cpp @@ -102,6 +102,7 @@ namespace pv _is_action = false; _decoder_pannel = NULL; _is_triged = false; + _dso_status_valid = false; _data_list.push_back(new SessionData()); _data_list.push_back(new SessionData()); @@ -531,6 +532,7 @@ namespace pv _is_stream_mode = false; _capture_times = 0; _dso_packet_count = 0; + _dso_status_valid = false; _capture_data = _view_data; set_cur_snap_samplerate(_device_agent.get_sample_rate()); @@ -1202,6 +1204,15 @@ namespace pv return; // This dso packet was not expected. } + if (_is_instant == false){ + sr_status status; + + if (_device_agent.get_device_status(status, false)){ + _dso_status_valid = true; + _dso_status = status; + } + } + _dso_packet_count++; if (!_is_triged && o.num_samples > 0) @@ -1403,13 +1414,22 @@ namespace pv _callback->trigger_message(DSV_MSG_REV_END_PACKET); } else{ + if (mode == DSO && _is_instant){ + sr_status status; + + if (_device_agent.get_device_status(status, false)){ + _dso_status_valid = true; + _dso_status = status; + } + } + _callback->frame_ended(); } - } + } break; } - } + } } void SigSession::data_feed_callback(const struct sr_dev_inst *sdi, diff --git a/DSView/pv/sigsession.h b/DSView/pv/sigsession.h index 1ae39acd..d53aeb16 100644 --- a/DSView/pv/sigsession.h +++ b/DSView/pv/sigsession.h @@ -431,6 +431,14 @@ public: void update_dso_data_scale(); + inline sr_status get_dso_status(){ + return _dso_status; + } + + inline bool dso_status_is_valid(){ + return _dso_status_valid; + } + private: void set_cur_samplelimits(uint64_t samplelimits); void set_cur_snap_samplerate(uint64_t samplerate); @@ -596,6 +604,8 @@ private: SessionData *_capture_data; std::vector _data_list; IDecoderPannel *_decoder_pannel; + sr_status _dso_status; + bool _dso_status_valid; private: // TODO: This should not be necessary. Multiple concurrent diff --git a/DSView/pv/storesession.cpp b/DSView/pv/storesession.cpp index 35d5c8b0..7899d82b 100644 --- a/DSView/pv/storesession.cpp +++ b/DSView/pv/storesession.cpp @@ -590,8 +590,10 @@ bool StoreSession::meta_gen(data::Snapshot *snapshot, std::string &str) sprintf(meta, " vTrig%d = %d\n", probecnt, probe->trig_value); str += meta; - if (_session->get_device()->get_device_status(status, false)) + if (_session->dso_status_is_valid()) { + sr_status status = _session->get_dso_status(); + if (probe->index == 0) { sprintf(meta, " period%d = %" PRIu32 "\n", probecnt, status.ch0_cyc_tlen); diff --git a/DSView/pv/view/dsosignal.cpp b/DSView/pv/view/dsosignal.cpp index 1ac02efc..bbf66a4c 100644 --- a/DSView/pv/view/dsosignal.cpp +++ b/DSView/pv/view/dsosignal.cpp @@ -815,10 +815,12 @@ void DsoSignal::paint_mid(QPainter &p, int left, int right, QColor fore, QColor pixels_offset, samples_per_pixel, enabled_channels); } - sr_status status; + sr_status status; - if (session->get_device()->get_device_status(status, false)) { + if (session->dso_status_is_valid()) { _mValid = true; + status = session->get_dso_status(); + if (status.measure_valid) { _min = (index == 0) ? status.ch0_min : status.ch1_min; _max = (index == 0) ? status.ch0_max : status.ch1_max; @@ -1419,7 +1421,7 @@ void DsoSignal::auto_start() } bool DsoSignal::measure(const QPointF &p) -{ +{ _hover_en = false; if (!enabled() || !show())