forked from Ivasoft/DSView
fix conflict issue when read status from hardware
This commit is contained in:
@@ -443,7 +443,7 @@ bool SigSession::get_capture_status(bool &triggered, int &progress)
|
||||
{
|
||||
uint64_t sample_limits = cur_samplelimits();
|
||||
sr_status status;
|
||||
if (sr_status_get(_dev_inst->dev_inst(), &status, SR_STATUS_TRIG_BEGIN, SR_STATUS_TRIG_END) == SR_OK){
|
||||
if (sr_status_get(_dev_inst->dev_inst(), &status, true, SR_STATUS_TRIG_BEGIN, SR_STATUS_TRIG_END) == SR_OK){
|
||||
triggered = status.trig_hit & 0x01;
|
||||
uint64_t captured_cnt = status.trig_hit >> 2;
|
||||
captured_cnt = ((uint64_t)status.captured_cnt0 +
|
||||
|
||||
@@ -344,7 +344,7 @@ QString StoreSession::meta_gen(boost::shared_ptr<data::Snapshot> snapshot)
|
||||
fprintf(meta, " vFactor%d = %d\n", probe->index, probe->vfactor);
|
||||
fprintf(meta, " vPos%d = %lf\n", probe->index, probe->vpos);
|
||||
fprintf(meta, " vTrig%d = %d\n", probe->index, probe->trig_value);
|
||||
if (sr_status_get(sdi, &status, 0, 0) == SR_OK) {
|
||||
if (sr_status_get(sdi, &status, false, 0, 0) == SR_OK) {
|
||||
if (probe->index == 0) {
|
||||
fprintf(meta, " period%d = %" PRIu64 "\n", probe->index, status.ch0_period);
|
||||
fprintf(meta, " pcnt%d = %" PRIu32 "\n", probe->index, status.ch0_pcnt);
|
||||
|
||||
@@ -1343,7 +1343,7 @@ void DsoSignal::paint_measure(QPainter &p)
|
||||
int index = get_index();
|
||||
const int st_begin = (index == 0) ? SR_STATUS_CH0_BEGIN : SR_STATUS_CH1_BEGIN;
|
||||
const int st_end = (index == 0) ? SR_STATUS_CH0_END : SR_STATUS_CH1_END;
|
||||
if (sr_status_get(_dev_inst->dev_inst(), &status, st_begin, st_end) == SR_OK) {
|
||||
if (sr_status_get(_dev_inst->dev_inst(), &status, false, st_begin, st_end) == SR_OK) {
|
||||
_max = (index == 0) ? status.ch0_max : status.ch1_max;
|
||||
_min = (index == 0) ? status.ch0_min : status.ch1_min;
|
||||
const uint64_t period = (index == 0) ? status.ch0_period : status.ch1_period;
|
||||
|
||||
@@ -1129,33 +1129,6 @@ void View::repeat_show()
|
||||
_viewbottom->update();
|
||||
}
|
||||
|
||||
bool View::get_capture_status(bool &triggered, int &progress)
|
||||
{
|
||||
uint64_t sample_limits = _session.cur_samplelimits();
|
||||
sr_status status;
|
||||
if (sr_status_get(_session.get_device()->dev_inst(), &status, SR_STATUS_TRIG_BEGIN, SR_STATUS_TRIG_END) == SR_OK){
|
||||
triggered = status.trig_hit & 0x01;
|
||||
const bool captured_cnt_dec = status.trig_hit & 0x02;
|
||||
uint64_t captured_cnt = status.trig_hit >> 2;
|
||||
captured_cnt = ((uint64_t)status.captured_cnt0 +
|
||||
((uint64_t)status.captured_cnt1 << 8) +
|
||||
((uint64_t)status.captured_cnt2 << 16) +
|
||||
((uint64_t)status.captured_cnt3 << 24) +
|
||||
(captured_cnt << 32));
|
||||
if (_session.get_device()->dev_inst()->mode == DSO)
|
||||
captured_cnt = captured_cnt * _session.get_signals().size() / _session.get_ch_num(SR_CHANNEL_DSO);
|
||||
if (captured_cnt_dec)
|
||||
progress = (sample_limits - captured_cnt) * 100.0 / sample_limits;
|
||||
else
|
||||
progress = captured_cnt * 100.0 / sample_limits;
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void View::set_capture_status()
|
||||
{
|
||||
bool triggered;
|
||||
|
||||
@@ -192,7 +192,6 @@ public:
|
||||
|
||||
void viewport_update();
|
||||
|
||||
bool get_capture_status(bool &triggered, int &progress);
|
||||
void set_capture_status();
|
||||
|
||||
bool get_dso_trig_moved() const;
|
||||
|
||||
Reference in New Issue
Block a user