From 503e90b95aa3a0693045f45d516744d88606db2a Mon Sep 17 00:00:00 2001 From: Kizarm Date: Sun, 17 Nov 2024 17:12:36 +0100 Subject: [PATCH] change display --- V203/usb/scope/software/displaywidget.cpp | 24 ++++++++++++++++++----- V203/usb/scope/software/displaywidget.h | 4 +++- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/V203/usb/scope/software/displaywidget.cpp b/V203/usb/scope/software/displaywidget.cpp index 42c5c87..590a06a 100644 --- a/V203/usb/scope/software/displaywidget.cpp +++ b/V203/usb/scope/software/displaywidget.cpp @@ -11,6 +11,10 @@ static const double TimeBaseSteps [] = { 2.0e-6, 5.0e-6, 1.0e-5, 2.0e-5, 5.0e-5, 1.0e-4, 2.0e-4, 5.0e-4, 1.0e-3, 2.0e-3, 5.0e-3, 1.0e-2, 2.0e-2, 5.0e-2, 1.0e-1, 2.0e-1, 5.0e-1, 1.0, }; +static const int TimeBaseCounts [] = { + 0, 0, 0, 0, 0, 0, 0, 0, 10, + 5, 2, 1, 1, 1, 1, 1, 1, 1, +}; static const double ChannelsSteps [] = { 0.1, 0.2, 0.5, 1.0, 2.0, 5.0, @@ -41,7 +45,9 @@ DisplayWidget::DisplayWidget(QWidget * p) : QWidget(p), pcol(), ACopy(), BCopy() for (QPointF & e : ChA) { const QPointF p (n++, 0); e = p; } n = 0; for (QPointF & e : ChB) { const QPointF p (n++, 0); e = p; } - m_continual = false; + m_continual = false; + m_cont_limit = 0; + m_cont_pass = 0; } DisplayWidget::~DisplayWidget() { } @@ -189,10 +195,9 @@ void DisplayWidget::setTrigger(TrigerSettings * ts) { void DisplayWidget::DispChannels(QVector cha, QVector chb) { ACopy = cha; BCopy = chb; - reloadData(); - update(); + if (reloadData()) update(); } -void DisplayWidget::reloadData () { +bool DisplayWidget::reloadData () { const size_t Alen = ACopy.size(); const size_t Blen = BCopy.size(); const size_t Amin = Alen < T_SIZE ? Alen : T_SIZE; @@ -204,7 +209,13 @@ void DisplayWidget::reloadData () { ChB[m_timeCount] = ptb; m_timeCount += 1u; m_timeCount &= T_MASK; - return; + m_cont_pass += 1; + if (m_cont_pass >= m_cont_limit) { + m_cont_pass = 0; + return true; + } else { + return false; + } } m_continual = false; for (unsigned n=0u; n