From 1cff13075e5a7b34740779839d72dc8a7ba4ac48 Mon Sep 17 00:00:00 2001 From: dreamsourcelabTAI Date: Tue, 7 Feb 2023 16:21:22 +0800 Subject: [PATCH] fix: The mathematical function is set incorrectly when the data is empty --- DSView/pv/sigsession.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/DSView/pv/sigsession.cpp b/DSView/pv/sigsession.cpp index 11a175cb..57fc78c1 100644 --- a/DSView/pv/sigsession.cpp +++ b/DSView/pv/sigsession.cpp @@ -1433,9 +1433,12 @@ namespace pv if (_math_trace && _math_trace->enabled()) { - _math_trace->get_math_stack()->set_samplerate(_view_data->get_dso()->samplerate()); - _math_trace->get_math_stack()->realloc(_device_agent.get_sample_limit()); - _math_trace->get_math_stack()->calc_math(); + int rt = _view_data->get_dso()->samplerate(); + if (rt > 0){ + _math_trace->get_math_stack()->set_samplerate(rt); + _math_trace->get_math_stack()->realloc(_device_agent.get_sample_limit()); + _math_trace->get_math_stack()->calc_math(); + } } signals_changed(); }