forked from Ivasoft/DSView
fix: On repeate mode, it unable to refresh correctly
This commit is contained in:
@@ -620,8 +620,10 @@ namespace pv
|
||||
((uint64_t)status.captured_cnt2 << 16) +
|
||||
((uint64_t)status.captured_cnt3 << 24) +
|
||||
(captured_cnt << 32));
|
||||
|
||||
if (_device_agent.get_work_mode() == DSO)
|
||||
captured_cnt = captured_cnt * _signals.size() / get_ch_num(SR_CHANNEL_DSO);
|
||||
|
||||
if (triggered)
|
||||
progress = (sample_limits - captured_cnt) * 100.0 / sample_limits;
|
||||
else
|
||||
@@ -948,7 +950,7 @@ namespace pv
|
||||
return;
|
||||
}
|
||||
|
||||
receive_data(o.length * 8 / get_ch_num(SR_CHANNEL_LOGIC));
|
||||
set_receive_data_len(o.length * 8 / get_ch_num(SR_CHANNEL_LOGIC));
|
||||
|
||||
_data_updated = true;
|
||||
}
|
||||
@@ -1022,7 +1024,7 @@ namespace pv
|
||||
_trigger_ch = o.trig_ch;
|
||||
|
||||
//Trigger update()
|
||||
receive_data(o.num_samples);
|
||||
set_receive_data_len(o.num_samples);
|
||||
|
||||
if (!_is_instant)
|
||||
{
|
||||
@@ -1067,7 +1069,7 @@ namespace pv
|
||||
return;
|
||||
}
|
||||
|
||||
receive_data(o.num_samples);
|
||||
set_receive_data_len(o.num_samples);
|
||||
_data_updated = true;
|
||||
}
|
||||
|
||||
@@ -1700,7 +1702,7 @@ namespace pv
|
||||
{
|
||||
case DS_EV_DEVICE_RUNNING:
|
||||
_device_status = ST_RUNNING;
|
||||
receive_data(0);
|
||||
set_receive_data_len(0);
|
||||
break;
|
||||
|
||||
case DS_EV_DEVICE_STOPPED:
|
||||
|
||||
@@ -377,6 +377,10 @@ public:
|
||||
return _map_zoom;
|
||||
}
|
||||
|
||||
inline bool is_single_buffer(){
|
||||
return _view_data == _capture_data;
|
||||
}
|
||||
|
||||
void auto_end();
|
||||
bool have_hardware_data();
|
||||
struct ds_device_base_info* get_device_list(int &out_count, int &actived_index);
|
||||
@@ -400,7 +404,7 @@ private:
|
||||
_callback->signals_changed();
|
||||
}
|
||||
|
||||
inline void receive_data(quint64 len){
|
||||
inline void set_receive_data_len(quint64 len){
|
||||
_callback->receive_data_len(len);
|
||||
}
|
||||
|
||||
|
||||
@@ -1136,7 +1136,7 @@ void View::repeat_show()
|
||||
_viewbottom->update();
|
||||
}
|
||||
|
||||
void View::set_capture_status()
|
||||
void View::update_capture_status()
|
||||
{
|
||||
bool triggered;
|
||||
int progress;
|
||||
|
||||
@@ -280,7 +280,7 @@ public:
|
||||
|
||||
void viewport_update();
|
||||
|
||||
void set_capture_status();
|
||||
void update_capture_status();
|
||||
|
||||
bool get_dso_trig_moved();
|
||||
|
||||
|
||||
@@ -140,10 +140,10 @@ void Viewport::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
(void)event;
|
||||
|
||||
doPaint(true);
|
||||
doPaint();
|
||||
}
|
||||
|
||||
void Viewport::doPaint(bool bForce)
|
||||
void Viewport::doPaint()
|
||||
{
|
||||
using pv::view::Signal;
|
||||
|
||||
@@ -175,13 +175,13 @@ void Viewport::doPaint(bool bForce)
|
||||
paintSignals(p, fore, back);
|
||||
}
|
||||
else if (_view.session().is_realtime_mode())
|
||||
{
|
||||
if (_view.session().have_new_realtime_refresh(false) || bForce)
|
||||
paintSignals(p, fore, back);
|
||||
{
|
||||
_view.session().have_new_realtime_refresh(false); // Try to reset refresh timer.
|
||||
paintSignals(p, fore, back);
|
||||
}
|
||||
else if (_view.session().is_running_status()){
|
||||
if (_view.session().is_repeat_mode() && !_transfer_started) {
|
||||
_view.set_capture_status();
|
||||
if (_view.session().is_repeat_mode())// && !_transfer_started)
|
||||
{
|
||||
paintSignals(p, fore, back);
|
||||
}
|
||||
else if (_type == TIME_VIEW) {
|
||||
@@ -1202,7 +1202,7 @@ void Viewport::set_receive_len(quint64 length)
|
||||
_sample_received = _view.session().cur_samplelimits();
|
||||
else
|
||||
_sample_received += length;
|
||||
}
|
||||
}
|
||||
|
||||
if (_view.session().get_device()->get_work_mode() == LOGIC)
|
||||
{
|
||||
@@ -1210,11 +1210,16 @@ void Viewport::set_receive_len(quint64 length)
|
||||
return;
|
||||
}
|
||||
|
||||
// On repeate mode, Not to refresh view when capturring.
|
||||
if (_view.session().is_repeat_mode()){
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (_view.session().is_repeat_mode())
|
||||
{
|
||||
_view.update_capture_status();
|
||||
|
||||
// On repeate mode, Not to refresh view when capturring.
|
||||
if (_view.session().is_single_buffer() == false){
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Received new data, and refresh the view.
|
||||
update();
|
||||
|
||||
@@ -92,8 +92,7 @@ public:
|
||||
int get_total_height();
|
||||
QPoint get_mouse_point();
|
||||
QString get_measure(QString option);
|
||||
void set_measure_en(int enable);
|
||||
void start_trigger_timer(int msec);
|
||||
void set_measure_en(int enable);
|
||||
void stop_trigger_timer();
|
||||
|
||||
void clear_measure();
|
||||
@@ -109,7 +108,7 @@ protected:
|
||||
void paintEvent(QPaintEvent *event) override;
|
||||
|
||||
private:
|
||||
void doPaint(bool bForce);
|
||||
void doPaint();
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
void mouseReleaseEvent(QMouseEvent *event) override;
|
||||
@@ -124,6 +123,7 @@ private:
|
||||
void paintMeasure(QPainter &p, QColor fore, QColor back);
|
||||
|
||||
void measure();
|
||||
void start_trigger_timer(int msec);
|
||||
|
||||
private slots:
|
||||
void on_trigger_timer();
|
||||
|
||||
@@ -55,16 +55,14 @@ public:
|
||||
|
||||
QJsonArray get_session();
|
||||
void load_session(QJsonArray meausre_array);
|
||||
|
||||
signals:
|
||||
void set_capture_status(bool triggered, int progess);
|
||||
|
||||
public slots:
|
||||
void clear();
|
||||
void reload();
|
||||
void repeat_unshow();
|
||||
void set_trig_time(QDateTime time);
|
||||
void set_rle_depth(uint64_t depth);
|
||||
void set_capture_status(bool triggered, int progess);
|
||||
void set_rle_depth(uint64_t depth);
|
||||
|
||||
private:
|
||||
SigSession *_session;
|
||||
|
||||
Reference in New Issue
Block a user