forked from Ivasoft/DSView
fix: The measure param have not save to the dsl file
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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<SessionData*> _data_list;
|
||||
IDecoderPannel *_decoder_pannel;
|
||||
sr_status _dso_status;
|
||||
bool _dso_status_valid;
|
||||
|
||||
private:
|
||||
// TODO: This should not be necessary. Multiple concurrent
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user