forked from Ivasoft/DSView
Reset the measure value after change the scope param
This commit is contained in:
@@ -76,6 +76,7 @@ void AnalogSnapshot::init_all()
|
||||
_ring_sample_count = 0;
|
||||
_memory_failed = false;
|
||||
_last_ended = true;
|
||||
|
||||
for (unsigned int i = 0; i < _channel_num; i++) {
|
||||
for (unsigned int level = 0; level < ScaleStepCount; level++) {
|
||||
_envelope_levels[i][level].length = 0;
|
||||
@@ -103,7 +104,6 @@ void AnalogSnapshot::clear()
|
||||
free_data();
|
||||
free_envelop();
|
||||
init_all();
|
||||
_have_data = false;
|
||||
}
|
||||
|
||||
void AnalogSnapshot::first_payload(const sr_datafeed_analog &analog, uint64_t total_sample_count, GSList *channels)
|
||||
@@ -179,8 +179,6 @@ void AnalogSnapshot::append_payload(
|
||||
// Generate the first mip-map from the data
|
||||
if (analog.num_samples != 0) // guarantee new samples to compute
|
||||
append_payload_to_envelope_levels();
|
||||
|
||||
_have_data = true;
|
||||
}
|
||||
|
||||
void AnalogSnapshot::append_data(void *data, uint64_t samples, uint16_t pitch)
|
||||
|
||||
@@ -99,7 +99,6 @@ void DsoSnapshot::clear()
|
||||
free_data();
|
||||
free_envelop();
|
||||
init_all();
|
||||
_have_data = false;
|
||||
_envelope_en = false;
|
||||
}
|
||||
|
||||
@@ -224,8 +223,6 @@ void DsoSnapshot::append_payload(const sr_datafeed_dso &dso)
|
||||
// Generate the first mip-map from the data
|
||||
if (_envelope_en)
|
||||
append_payload_to_envelope_levels(dso.samplerate_tog);
|
||||
|
||||
_have_data = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -109,7 +109,6 @@ void LogicSnapshot::clear()
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
free_data();
|
||||
init_all();
|
||||
_have_data = false;
|
||||
}
|
||||
|
||||
void LogicSnapshot::first_payload(const sr_datafeed_logic &logic, uint64_t total_sample_count, GSList *channels, bool able_free)
|
||||
@@ -202,8 +201,6 @@ void LogicSnapshot::append_payload(const sr_datafeed_logic &logic)
|
||||
std::lock_guard<std::mutex> lock(_mutex);
|
||||
|
||||
append_cross_payload(logic);
|
||||
|
||||
_have_data = true;
|
||||
}
|
||||
|
||||
void LogicSnapshot::append_cross_payload(const sr_datafeed_logic &logic)
|
||||
|
||||
@@ -43,7 +43,6 @@ Snapshot::Snapshot(int unit_size, uint64_t total_sample_count, unsigned int chan
|
||||
_last_ended = true;
|
||||
_unit_bytes = 1;
|
||||
_unit_pitch = 0;
|
||||
_have_data = false;
|
||||
}
|
||||
|
||||
Snapshot::~Snapshot()
|
||||
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
}
|
||||
|
||||
inline bool have_data(){
|
||||
return _have_data;
|
||||
return !empty();
|
||||
}
|
||||
|
||||
inline double samplerate(){
|
||||
@@ -106,7 +106,6 @@ protected:
|
||||
uint16_t _unit_pitch;
|
||||
bool _memory_failed;
|
||||
bool _last_ended;
|
||||
bool _have_data;
|
||||
double _samplerate;
|
||||
};
|
||||
|
||||
|
||||
@@ -521,6 +521,10 @@ QString DsoSignal::get_measure(enum DSO_MEASURE_TYPE type)
|
||||
const QString mNone = "--";
|
||||
QString mString;
|
||||
|
||||
if (_data->empty()){
|
||||
return mNone;
|
||||
}
|
||||
|
||||
if (_mValid) {
|
||||
const int hw_offset = get_hw_offset();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user