diff --git a/plugins/channelrx/demodm17/m17demod.h b/plugins/channelrx/demodm17/m17demod.h index e5177b2a9..42810b5a5 100644 --- a/plugins/channelrx/demodm17/m17demod.h +++ b/plugins/channelrx/demodm17/m17demod.h @@ -246,6 +246,8 @@ public: m_basebandSink->getBERT(bertErrors, bertBits); } + void resetPRBS() { m_basebandSink->resetPRBS(); } + uint32_t getLSFCount() const { return m_basebandSink->getLSFCount(); } const QString& getSrcCall() const { return m_basebandSink->getSrcCall(); } const QString& getDestcCall() const { return m_basebandSink->getDestcCall(); } diff --git a/plugins/channelrx/demodm17/m17demodbaseband.h b/plugins/channelrx/demodm17/m17demodbaseband.h index 884438657..7cb548652 100644 --- a/plugins/channelrx/demodm17/m17demodbaseband.h +++ b/plugins/channelrx/demodm17/m17demodbaseband.h @@ -107,6 +107,8 @@ public: m_sink.getBERT(bertErrors, bertBits); } + void resetPRBS() { m_sink.resetPRBS(); } + uint32_t getLSFCount() const { return m_sink.getLSFCount(); } const QString& getSrcCall() const { return m_sink.getSrcCall(); } const QString& getDestcCall() const { return m_sink.getDestcCall(); } diff --git a/plugins/channelrx/demodm17/m17demodgui.cpp b/plugins/channelrx/demodm17/m17demodgui.cpp index 593c02c1d..e258d6b3b 100644 --- a/plugins/channelrx/demodm17/m17demodgui.cpp +++ b/plugins/channelrx/demodm17/m17demodgui.cpp @@ -311,6 +311,15 @@ void M17DemodGUI::on_berButton_toggled(bool checked) m_showBERNumbersOrRates = !checked; } +void M17DemodGUI::on_berReset_clicked() +{ + m_m17Demod->resetPRBS(); + m_lastBERErrors = 0; + m_lastBERBits = 0; + m_berPoints.clear(); + m_currentErrors.clear(); +} + void M17DemodGUI::onWidgetRolled(QWidget* widget, bool rollDown) { (void) widget; @@ -826,15 +835,6 @@ void M17DemodGUI::tick() series->attachAxis(berChartYAxis); } } - else - { - // qDebug("M17DemodGUI::tick: BER reset: status: %d sync_word_type: %d", status, sync_word_type); - m_lastBERErrors = 0; - m_lastBERBits = 0; - m_berPoints.clear(); - m_currentErrors.clear(); - } - } m_tickCount++; @@ -973,6 +973,7 @@ void M17DemodGUI::makeUIConnections() QObject::connect(ui->curButton, &ButtonSwitch::toggled, this, &M17DemodGUI::on_curButton_toggled); QObject::connect(ui->berButton, &ButtonSwitch::toggled, this, &M17DemodGUI::on_berButton_toggled); QObject::connect(ui->berHistory, &QDial::valueChanged, this, &M17DemodGUI::on_berHistory_valueChanged); + QObject::connect(ui->berReset, &QPushButton::clicked, this, &M17DemodGUI::on_berReset_clicked); } void M17DemodGUI::updateAbsoluteCenterFrequency() diff --git a/plugins/channelrx/demodm17/m17demodgui.h b/plugins/channelrx/demodm17/m17demodgui.h index a8ae0feb5..8ca9d9c3c 100644 --- a/plugins/channelrx/demodm17/m17demodgui.h +++ b/plugins/channelrx/demodm17/m17demodgui.h @@ -158,6 +158,7 @@ private slots: void on_curButton_toggled(bool checked); void on_berButton_toggled(bool checked); void on_berHistory_valueChanged(int value); + void on_berReset_clicked(); void onWidgetRolled(QWidget* widget, bool rollDown); void onMenuDialogCalled(const QPoint& p); void on_viewStatusLog_clicked(); diff --git a/plugins/channelrx/demodm17/m17demodgui.ui b/plugins/channelrx/demodm17/m17demodgui.ui index 49ba3ced0..aa21bc777 100644 --- a/plugins/channelrx/demodm17/m17demodgui.ui +++ b/plugins/channelrx/demodm17/m17demodgui.ui @@ -1847,6 +1847,26 @@ BER + + + + 440 + 10 + 28 + 28 + + + + Reset BER (PRBS) + + + + + + + :/recycle.png:/recycle.png + + diff --git a/plugins/channelrx/demodm17/m17demodprocessor.cpp b/plugins/channelrx/demodm17/m17demodprocessor.cpp index 95f0cf59c..bebed35ea 100644 --- a/plugins/channelrx/demodm17/m17demodprocessor.cpp +++ b/plugins/channelrx/demodm17/m17demodprocessor.cpp @@ -138,10 +138,6 @@ void M17DemodProcessor::diagnostic_callback( qDebug() << "M17DemodProcessor::diagnostic_callback: " << oss.str().c_str(); } - if ((!dcd) && m_this->m_prbs.sync()) { // Seems like there should be a better way to do this. - m_this->m_prbs.reset(); - } - if (m_this->m_prbs.sync() && !quiet) { std::ostringstream oss; diff --git a/plugins/channelrx/demodm17/m17demodprocessor.h b/plugins/channelrx/demodm17/m17demodprocessor.h index 867d86027..45244e091 100644 --- a/plugins/channelrx/demodm17/m17demodprocessor.h +++ b/plugins/channelrx/demodm17/m17demodprocessor.h @@ -98,6 +98,10 @@ public: bertBits = m_prbs.bits(); } + void resetPRBS() { + m_prbs.reset(); + } + private: std::vector m_currentPacket; size_t m_packetFrameCounter; diff --git a/plugins/channelrx/demodm17/m17demodsink.h b/plugins/channelrx/demodm17/m17demodsink.h index aab2fefbb..6c699d2ac 100644 --- a/plugins/channelrx/demodm17/m17demodsink.h +++ b/plugins/channelrx/demodm17/m17demodsink.h @@ -109,6 +109,8 @@ public: m_m17DemodProcessor.getBERT(bertErrors, bertBits); } + void resetPRBS() { m_m17DemodProcessor.resetPRBS(); } + uint32_t getLSFCount() const { return m_m17DemodProcessor.getLSFCount(); } const QString& getSrcCall() const { return m_m17DemodProcessor.getSrcCall(); } const QString& getDestcCall() const { return m_m17DemodProcessor.getDestcCall(); } diff --git a/plugins/channeltx/modm17/m17modprocessor.cpp b/plugins/channeltx/modm17/m17modprocessor.cpp index 8d9b6c248..970f96719 100644 --- a/plugins/channeltx/modm17/m17modprocessor.cpp +++ b/plugins/channeltx/modm17/m17modprocessor.cpp @@ -72,7 +72,7 @@ bool M17ModProcessor::handleMessage(const Message& cmd) if (notif.getInsertPosition()) { if (m_insertPositionToggle) { - strData += "!" + formatAPRSPosition(); + strData = "!" + formatAPRSPosition(); } else { strData = notif.getData(); }