fix: error trig position on repeat mode

This commit is contained in:
DreamSourceLab 2023-09-21 19:27:32 -07:00
parent 862462c1d6
commit f0db0ac47a
4 changed files with 16 additions and 9 deletions

View File

@ -63,6 +63,7 @@ namespace pv
{
_cur_snap_samplerate = 0;
_cur_samplelimits = 0;
_trig_pos = 0;
}
void SessionData::clear()
@ -70,6 +71,7 @@ namespace pv
logic.clear();
analog.clear();
dso.clear();
_trig_pos = 0;
}
// TODO: This should not be necessary
@ -1082,7 +1084,6 @@ namespace pv
void SigSession::feed_in_header(const sr_dev_inst *sdi)
{
(void)sdi;
_trigger_pos = 0;
_callback->receive_header();
}
@ -1107,19 +1108,21 @@ namespace pv
void SigSession::feed_in_trigger(const ds_trigger_pos &trigger_pos)
{
_hw_replied = true;
if (_device_agent.get_work_mode() != DSO)
{
_trigger_flag = (trigger_pos.status & 0x01);
if (_trigger_flag)
{
_trigger_pos = trigger_pos.real_pos;
_callback->receive_trigger(_trigger_pos);
_capture_data->_trig_pos = trigger_pos.real_pos;
_callback->receive_trigger(_capture_data->_trig_pos);
}
}
else
{
int probe_count = 0;
int probe_en_count = 0;
for (const GSList *l = _device_agent.get_channels(); l; l = l->next)
{
const sr_channel *const probe = (const sr_channel *)l->data;
@ -1130,8 +1133,9 @@ namespace pv
probe_en_count++;
}
}
_trigger_pos = trigger_pos.real_pos * probe_count / probe_en_count;
_callback->receive_trigger(_trigger_pos);
_capture_data->_trig_pos = trigger_pos.real_pos * probe_count / probe_en_count;
_callback->receive_trigger(_capture_data->_trig_pos);
}
}

View File

@ -110,6 +110,7 @@ public:
public:
uint64_t _cur_snap_samplerate;
uint64_t _cur_samplelimits;
uint64_t _trig_pos;
private:
data::LogicSnapshot logic;
@ -197,7 +198,7 @@ public:
}
inline uint64_t get_trigger_pos(){
return _trigger_pos;
return _view_data->_trig_pos;
}
bool is_first_store_confirm();
@ -555,7 +556,6 @@ private:
QDateTime _session_time;
QDateTime _trig_time;
bool _is_triged;
uint64_t _trigger_pos;
bool _trigger_flag;
uint8_t _trigger_ch;
bool _hw_replied;

View File

@ -486,8 +486,11 @@ void View::receive_end()
_time_viewport->unshow_wait_trigger();
}
void View::receive_trigger(quint64 trig_pos)
void View::receive_trigger(quint64 trig_pos1)
{
(void)trig_pos1;
uint64_t trig_pos = _session->get_trigger_pos();
const double time = trig_pos * 1.0 / _session->cur_snap_samplerate();
_trig_cursor->set_index(trig_pos);

View File

@ -380,7 +380,7 @@ public slots:
//
void header_updated();
void receive_trigger(quint64 trig_pos);
void receive_trigger(quint64 trig_pos1);
void receive_end();