Skip to content

Commit 934dba2

Browse files
committed
Warn if amp already running at 500 Hz or 1 kHz because we won't know if anti-aliasing is enabled.
1 parent 8100835 commit 934dba2

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

src/gui/EGIAmpWindow.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ void EGIAmpWindow::linkAmpserver() {
174174
// Unlink
175175
client_->stopStreaming();
176176
client_->disconnect();
177+
ui->statusBar->clearMessage();
178+
ui->statusBar->setStyleSheet("");
177179
emit fieldsEnabled(true);
178180
emit setLinkButtonText("Link");
179181
emit sensorLayoutUpdated("");
@@ -209,6 +211,16 @@ void EGIAmpWindow::linkAmpserver() {
209211
// Update sensor layout from detected net code
210212
egiamp::NetCode netCode = client_->detectedNetCode();
211213
emit sensorLayoutUpdated(QString::fromUtf8(egiamp::netCodeName(netCode)));
214+
215+
// Show persistent warning in status bar for ambiguous rates where we
216+
// cannot detect whether the FPGA anti-alias filter is active
217+
if (detectedRate == 500 || detectedRate == 1000) {
218+
ui->statusBar->setStyleSheet("QStatusBar { color: #b35900; }");
219+
ui->statusBar->showMessage(
220+
QString("Warning: Amp started externally at %1 Hz — "
221+
"filter mode unknown, timestamp alignment may be inaccurate")
222+
.arg(detectedRate));
223+
}
212224
}
213225

214226
if (!client_->startStreaming()) {
@@ -228,6 +240,8 @@ void EGIAmpWindow::displayError(QString description) {
228240

229241
void EGIAmpWindow::unlockUI() {
230242
ui->linkButton->setEnabled(true);
243+
ui->statusBar->clearMessage();
244+
ui->statusBar->setStyleSheet("");
231245
emit setLinkButtonText("Link");
232246
emit fieldsEnabled(true);
233247
ui->actionShutdown_Amp_Server->setEnabled(true);

0 commit comments

Comments
 (0)