Skip to content

Commit

Permalink
fix signal detection
Browse files Browse the repository at this point in the history
  • Loading branch information
josevcm committed Nov 23, 2024
1 parent ca07392 commit 7516972
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/nfc-app/app-qt/src/main/cpp/QtWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <QClipboard>
#include <QComboBox>
#include <QTimer>
#include <QDateTime>
#include <QStandardPaths>
#include <QScreen>
#include <QRegularExpression>
Expand All @@ -34,8 +33,6 @@
#include <hw/SignalType.h>
#include <hw/SignalBuffer.h>

#include <lab/nfc/Nfc.h>

#include <model/StreamFilter.h>
#include <model/StreamModel.h>
#include <model/ParserModel.h>
Expand Down Expand Up @@ -923,12 +920,21 @@ struct QtWindow::Impl
bool signalSelected = ui->logicView->selectionSizeRange() > 0 || ui->radioView->selectionSizeRange() > 0;
bool signalPresent = logicSignalPresent || radioSignalPresent;
bool signalWide = logicSignalWide || radioSignalWide;
bool decoderEnabled = logicDecoderEnabled || radioDecoderEnabled;

// update signal label
if (signalPresent && !decoderEnabled)
ui->signalLabel->setText(tr("Enable decoder to view acquired signal"));
else if (!decoderEnabled)
ui->signalLabel->setText(tr("Enable decoder and start acquisition or open a trace file"));
else
ui->signalLabel->setText(tr("Start acquisition or open a trace file"));

// show views based on selected features
ui->logicView->setVisible(logicSignalPresent);
ui->radioView->setVisible(radioSignalPresent);
ui->signalScroll->setVisible(signalPresent);
ui->signalLabel->setVisible(!signalPresent);
ui->logicView->setVisible(logicSignalPresent && logicDecoderEnabled);
ui->radioView->setVisible(radioSignalPresent && radioDecoderEnabled);
ui->signalScroll->setVisible(signalPresent && decoderEnabled);
ui->signalLabel->setVisible(!signalPresent || !decoderEnabled);
ui->frequencyView->setEnabled(spectrumEnabled);

// if no data is present, disable related actions
Expand Down

0 comments on commit 7516972

Please sign in to comment.