From f9a51294302d5b606c1b39babb08baa48674a638 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp
Date: Mon, 6 May 2024 17:24:14 +0200
Subject: [PATCH 1/5] Port application to Qt6
---
Engine/API/Abstract/abstractrhxcontroller.cpp | 2 +-
.../API/Synthetic/synthdatablockgenerator.cpp | 2 +-
.../DataFileReaders/fileperchannelmanager.cpp | 1 +
Engine/Processing/datastreamfifo.cpp | 6 +-
Engine/Processing/xmlinterface.cpp | 20 +++----
Engine/Threads/audiothread.cpp | 58 +++++++++----------
Engine/Threads/audiothread.h | 15 +++--
Engine/Threads/usbdatathread.cpp | 4 +-
GUI/Dialogs/boardselectdialog.cpp | 3 -
GUI/Dialogs/renamechanneldialog.cpp | 7 ++-
GUI/Widgets/filterdisplayselector.cpp | 8 +--
GUI/Widgets/pageview.cpp | 6 +-
GUI/Widgets/pageview.h | 2 +-
GUI/Widgets/testcontrolpanel.cpp | 14 +++--
GUI/Widgets/waveformdisplaycolumn.cpp | 2 +-
GUI/Windows/controlwindow.cpp | 16 ++---
GUI/Windows/probemapwindow.cpp | 2 +-
IntanRHX.pro | 2 +-
contrib/ci/Dockerfile-debian | 2 +-
contrib/ci/Dockerfile-ubuntu | 2 +-
contrib/ci/install-deps-deb.sh | 7 +--
contrib/debian/changelog | 4 +-
contrib/debian/control | 11 ++--
contrib/debian/rules | 2 +-
24 files changed, 99 insertions(+), 99 deletions(-)
diff --git a/Engine/API/Abstract/abstractrhxcontroller.cpp b/Engine/API/Abstract/abstractrhxcontroller.cpp
index 1af6440..93cf351 100644
--- a/Engine/API/Abstract/abstractrhxcontroller.cpp
+++ b/Engine/API/Abstract/abstractrhxcontroller.cpp
@@ -62,7 +62,7 @@ AbstractRHXController::AbstractRHXController(ControllerType type_, AmplifierSamp
pipeReadErrorCode(0)
{
usbBufferSize = MaxNumBlocksToRead * BytesPerWord * RHXDataBlock::dataBlockSizeInWords(type, maxNumDataStreams());
- cout << "RHXController: Allocating " << usbBufferSize / 1.0e6 << " MBytes for USB buffer.\n";
+ std::cout << "RHXController: Allocating " << usbBufferSize / 1.0e6 << " MBytes for USB buffer." << std::endl;
usbBuffer = nullptr;
usbBuffer = new uint8_t [usbBufferSize];
numDataStreams = 0;
diff --git a/Engine/API/Synthetic/synthdatablockgenerator.cpp b/Engine/API/Synthetic/synthdatablockgenerator.cpp
index 5de6fff..f86f95d 100644
--- a/Engine/API/Synthetic/synthdatablockgenerator.cpp
+++ b/Engine/API/Synthetic/synthdatablockgenerator.cpp
@@ -228,7 +228,7 @@ SynthDataBlockGenerator::SynthDataBlockGenerator(ControllerType type_, double sa
{
int bufferSizeInWords = MaxNumBlocksToRead *
RHXDataBlock::dataBlockSizeInWords(type, AbstractRHXController::maxNumDataStreams(type));
- cout << "SynthDataBlockGenerator: Allocating " << BytesPerWord * bufferSizeInWords / 1.0e6 << " MBytes for synthetic USB data generator.\n";
+ std::cout << "SynthDataBlockGenerator: Allocating " << BytesPerWord * bufferSizeInWords / 1.0e6 << " MBytes for synthetic USB data generator." << std::endl;
usbWords = nullptr;
usbWords = new uint16_t [bufferSizeInWords];
dataBlockPeriodInNsec = 1.0e9 * ((double)RHXDataBlock::samplesPerDataBlock(type)) / sampleRate;
diff --git a/Engine/Processing/DataFileReaders/fileperchannelmanager.cpp b/Engine/Processing/DataFileReaders/fileperchannelmanager.cpp
index 77dd5ed..f4e0460 100644
--- a/Engine/Processing/DataFileReaders/fileperchannelmanager.cpp
+++ b/Engine/Processing/DataFileReaders/fileperchannelmanager.cpp
@@ -30,6 +30,7 @@
#include
#include
+#include
#include "rhxglobals.h"
#include "datafilereader.h"
#include "fileperchannelmanager.h"
diff --git a/Engine/Processing/datastreamfifo.cpp b/Engine/Processing/datastreamfifo.cpp
index 8fb235c..d97e424 100644
--- a/Engine/Processing/datastreamfifo.cpp
+++ b/Engine/Processing/datastreamfifo.cpp
@@ -45,7 +45,7 @@ DataStreamFifo::DataStreamFifo(int bufferSize_, int maxReadLength_) :
{
int bufferSizeWithExtra = bufferSize + maxReadLength;
memoryNeededGB = sizeof(uint16_t) * bufferSizeWithExtra / (1024.0 * 1024.0 * 1024.0);
- cout << "DataStreamFifo: Allocating " << 2 * bufferSizeWithExtra / 1.0e6 << " MBytes for FIFO buffer." << '\n';
+ std::cout << "DataStreamFifo: Allocating " << 2 * bufferSizeWithExtra / 1.0e6 << " MBytes for FIFO buffer." << std::endl;
buffer = nullptr;
memoryAllocated = true;
@@ -53,11 +53,11 @@ DataStreamFifo::DataStreamFifo(int bufferSize_, int maxReadLength_) :
buffer = new uint16_t [bufferSizeWithExtra];
} catch (std::bad_alloc&) {
memoryAllocated = false;
- cerr << "Error: DataStreamFifo constructor could not allocate " << memoryNeededGB << " GB of memory." << '\n';
+ std::cerr << "Error: DataStreamFifo constructor could not allocate " << memoryNeededGB << " GB of memory." << std::endl;
}
if (!buffer) {
- cerr << "Error: DataStreamFifo constructor could not allocate " << 2 * bufferSizeWithExtra << " bytes of memory." << '\n';
+ std::cerr << "Error: DataStreamFifo constructor could not allocate " << 2 * bufferSizeWithExtra << " bytes of memory." << std::endl;
}
resetBuffer();
}
diff --git a/Engine/Processing/xmlinterface.cpp b/Engine/Processing/xmlinterface.cpp
index 84149ab..dc22512 100644
--- a/Engine/Processing/xmlinterface.cpp
+++ b/Engine/Processing/xmlinterface.cpp
@@ -445,7 +445,7 @@ bool XMLInterface::checkConsistentChannels(const QByteArray &byteArray, QString
while (!stream.atEnd()) {
// Make sure we enter at least the first SignalGroup element. If we've gone past all the SignalGroups and are at the end of the document, just return
- while (stream.name() != "SignalGroup") {
+ while (stream.name() != QStringLiteral("SignalGroup")) {
QXmlStreamReader::TokenType token = stream.readNext();
// Handle if no signal groups at all are present by giving a warning and returning
@@ -504,7 +504,7 @@ bool XMLInterface::checkConsistentChannels(const QByteArray &byteArray, QString
while (!stream.atEnd()) {
// Make sure we enter at least the first Channel element. If we've gone past all the Channels and are at the end of the document, just return.
- while (stream.name() != "Channel") {
+ while (stream.name() != QStringLiteral("Channel")) {
QXmlStreamReader::TokenType token = stream.readNext();
if (token == QXmlStreamReader::EndDocument) {
@@ -594,7 +594,7 @@ bool XMLInterface::parseGeneralConfig(const QByteArray &byteArray, QString &erro
if (!validDocumentStart) return false;
// Parse GeneralConfig
- while (stream.name() != "GeneralConfig") {
+ while (stream.name() != QStringLiteral("GeneralConfig")) {
stream.readNextStartElement();
if (stream.atEnd()) return true;
}
@@ -697,7 +697,7 @@ bool XMLInterface::parseSignalGroups(const QByteArray &byteArray, QString &error
while (!stream.atEnd()) {
// Make sure we enter at least the first SignalGroup element. If we've gone past all the SignalGroups and are at the end of the document, just return.
- while (stream.name() != "SignalGroup") {
+ while (stream.name() != QStringLiteral("SignalGroup")) {
QXmlStreamReader::TokenType token = stream.readNext();
if (token == QXmlStreamReader::EndDocument) {
return true;
@@ -797,7 +797,7 @@ bool XMLInterface::parseSignalGroups(const QByteArray &byteArray, QString &error
while (!stream.atEnd()) {
// Make sure we enter at least the first Channel element. If we've gone past all the Channels and are at the end of the document, just return.
- while (stream.name() != "Channel") {
+ while (stream.name() != QStringLiteral("Channel")) {
QXmlStreamReader::TokenType token = stream.readNext();
if (token == QXmlStreamReader::EndDocument) {
return true;
@@ -889,7 +889,7 @@ bool XMLInterface::parseStimParameters(const QByteArray &byteArray, QString &err
if (!validDocumentStart) return false;
// Parse StimParameters.
- while (stream.name() != "StimParameters") {
+ while (stream.name() != QStringLiteral("StimParameters")) {
stream.readNextStartElement();
if (stream.atEnd()) return true;
}
@@ -898,7 +898,7 @@ bool XMLInterface::parseStimParameters(const QByteArray &byteArray, QString &err
while (!stream.atEnd()) {
// Make sure we enter at least the first StimChannel element. If we've gone past all the StimChannels and are at the end of the document, just return.
- while (stream.name() != "StimChannel") {
+ while (stream.name() != QStringLiteral("StimChannel")) {
QXmlStreamReader::TokenType token = stream.readNext();
if (token == QXmlStreamReader::EndDocument) {
return true;
@@ -911,7 +911,7 @@ bool XMLInterface::parseStimParameters(const QByteArray &byteArray, QString &err
// Try to find the StimChannel's name.
QString nativeChannelName("");
for (auto attribute : attributes) {
- if (attribute.name().toString().toLower() == "nativechannelname") {
+ if (attribute.name().toString().toLower() == QStringLiteral("nativechannelname")) {
nativeChannelName = attribute.value().toString();
break;
}
@@ -962,7 +962,7 @@ bool XMLInterface::parseStimParameters(const QByteArray &byteArray, QString &err
bool XMLInterface::parseStimLegacy(const QByteArray &byteArray, QString &errorMessage) const
{
QXmlStreamReader stream(byteArray);
- if (!stream.readNextStartElement() || stream.name() != "xstim" || stream.attributes().value("", "version").toString() != "1.0") {
+ if (!stream.readNextStartElement() || stream.name() != QStringLiteral("xstim") || stream.attributes().value("", "version").toString() != "1.0") {
errorMessage.append("Error: invalid xstim element and version attribute");
return false;
}
@@ -971,7 +971,7 @@ bool XMLInterface::parseStimLegacy(const QByteArray &byteArray, QString &errorMe
state->holdUpdate();
- while (stream.readNextStartElement() && stream.name() == "channel") {
+ while (stream.readNextStartElement() && stream.name() == QStringLiteral("channel")) {
QString channelName = stream.attributes().value("", "name").toString();
channel = state->signalSources->channelByName(channelName);
diff --git a/Engine/Threads/audiothread.cpp b/Engine/Threads/audiothread.cpp
index 9de492f..fdb8099 100644
--- a/Engine/Threads/audiothread.cpp
+++ b/Engine/Threads/audiothread.cpp
@@ -28,10 +28,11 @@
//
//------------------------------------------------------------------------------
-#include
#include "signalsources.h"
#include "audiothread.h"
+#include
+
AudioThread::AudioThread(SystemState *state_, WaveformFifo *waveformFifo_, const double sampleRate_, QObject *parent) :
QThread(parent),
state(state_),
@@ -52,7 +53,6 @@ AudioThread::AudioThread(SystemState *state_, WaveformFifo *waveformFifo_, const
void AudioThread::initialize()
{
// Initialize variables.
- mDevice = QAudioDeviceInfo::defaultOutputDevice();
currentValue = 0.0F;
nextValue = 0.0F;
interpRatio = 0.0;
@@ -87,21 +87,19 @@ void AudioThread::initialize()
// Set up audio format.
mFormat.setSampleRate(44100);
mFormat.setChannelCount(1);
- mFormat.setSampleSize(16);
- mFormat.setCodec("audio/pcm");
- mFormat.setByteOrder(QAudioFormat::LittleEndian);
- mFormat.setSampleType(QAudioFormat::SignedInt);
- QAudioDeviceInfo info(mDevice);
- if (!info.isFormatSupported(mFormat)) {
- qWarning() << "Default format not supported - trying to use nearest";
- mFormat = info.nearestFormat(mFormat);
+ mFormat.setSampleFormat(QAudioFormat::Int16);
+
+ QAudioDevice defaultDevice(QMediaDevices::defaultAudioOutput());
+ if (!defaultDevice.isFormatSupported(mFormat)) {
+ qWarning() << "Default format not supported - trying to use preferred";
+ mFormat = defaultDevice.preferredFormat();
+ mFormat.setChannelCount(1);
}
// Create audio IO and output device.
- buf = new QByteArray();
- s = new QDataStream(buf, QIODevice::ReadWrite);
- mAudioOutput = new QAudioOutput(mDevice, mFormat);
- connect(mAudioOutput, SIGNAL(stateChanged(QAudio::State)), this, SLOT(catchError()));
+ mAudioSink = std::make_unique(defaultDevice, mFormat);
+ mAudioSink->setBufferSize(NumSoundBytes);
+ connect(mAudioSink.get(), SIGNAL(stateChanged(QAudio::State)), this, SLOT(catchError()));
}
void AudioThread::run()
@@ -113,8 +111,16 @@ void AudioThread::run()
// Any 'start up' code goes here.
initialize();
+ QDataStream *s = nullptr;
while (keepGoing && !stopThread) {
+ // Start audio (if it's not started already)
+ if (mAudioSink->state() != QAudio::ActiveState || s == nullptr) {
+ if (s)
+ delete s;
+ s = new QDataStream(mAudioSink->start());
+ }
+
// Wait for samples to arrive from WaveformFifo (enough where, when scaled to 44.1 kHz audio, NumSoundSamples can be written)
if (waveformFifo->requestReadNewData(WaveformFifo::ReaderAudio, rawBlockSampleSize)) {
s->device()->seek(0);
@@ -130,12 +136,6 @@ void AudioThread::run()
// Populate finalSoundBytesBuffer from rawData
processAudioData();
- // Start audio (if it's not started already)
- if (mAudioOutput->state() != QAudio::ActiveState) {
- mAudioOutput->start(s->device());
- }
- qApp->processEvents();
-
} else {
// Probably could sleep here for a while
qApp->processEvents();
@@ -143,14 +143,15 @@ void AudioThread::run()
}
// Any 'finish up' code goes here.
- mAudioOutput->stop();
+ mAudioSink->stop();
+
+ if (s)
+ delete s;
delete [] rawData;
delete [] interpFloats;
delete [] interpInts;
delete [] finalSoundBytesBuffer;
- delete s;
- delete buf;
running = false;
} else {
@@ -223,7 +224,6 @@ void AudioThread::processAudioData()
originalSamplesCopied = 0;
soundSamplesCopied = 0;
while (originalSamplesCopied < rawBlockSampleSize) {
- qApp->processEvents();
currentValue = nextValue;
nextValue = rawData[originalSamplesCopied];
@@ -282,21 +282,21 @@ void AudioThread::processAudioData()
void AudioThread::catchError()
{
- QAudio::Error errorValue = mAudioOutput->error();
+ QAudio::Error errorValue = mAudioSink->error();
switch (errorValue) {
case QAudio::NoError:
break;
case QAudio::OpenError:
- qDebug() << "Open Error";
+ qDebug().noquote() << "rhx-audio: Open Error";
break;
case QAudio::IOError:
- qDebug() << "IO Error";
+ qDebug().noquote() << "rhx-audio: IO Error";
break;
case QAudio::UnderrunError:
- qDebug() << "Underrun Error";
+ qDebug().noquote() << "rhx-audio: Underrun Error";
break;
case QAudio::FatalError:
- qDebug() << "Fatal Error";
+ qDebug().noquote() << "rhx-audio: Fatal Error";
break;
}
}
diff --git a/Engine/Threads/audiothread.h b/Engine/Threads/audiothread.h
index 89cc1b2..948833a 100644
--- a/Engine/Threads/audiothread.h
+++ b/Engine/Threads/audiothread.h
@@ -32,7 +32,8 @@
#define AUDIOTHREAD_H
#include
-#include
+#include
+#include
#include
#include
#include "systemstate.h"
@@ -94,20 +95,18 @@ private slots:
int originalSamplesCopied;
int soundSamplesCopied;
- volatile bool keepGoing;
- volatile bool running;
- volatile bool stopThread;
+ std::atomic_bool keepGoing;
+ std::atomic_bool running;
+ std::atomic_bool stopThread;
float currentValue;
float nextValue;
double interpRatio;
int interpLength;
- QAudioDeviceInfo mDevice;
- QByteArray* buf;
- QDataStream* s;
- QAudioOutput* mAudioOutput;
QAudioFormat mFormat;
+ std::unique_ptr mAudioSink;
+ QDataStream* s;
QString currentChannelString;
diff --git a/Engine/Threads/usbdatathread.cpp b/Engine/Threads/usbdatathread.cpp
index c058696..c162e83 100644
--- a/Engine/Threads/usbdatathread.cpp
+++ b/Engine/Threads/usbdatathread.cpp
@@ -46,7 +46,7 @@ USBDataThread::USBDataThread(AbstractRHXController* controller_, DataStreamFifo*
bufferSize = (BufferSizeInBlocks + 1) * BytesPerWord *
RHXDataBlock::dataBlockSizeInWords(controller->getType(), controller->maxNumDataStreams());
memoryNeededGB = sizeof(uint8_t) * bufferSize / (1024.0 * 1024.0 * 1024.0);
- cout << "USBDataThread: Allocating " << bufferSize / 1.0e6 << " MBytes for USB buffer." << '\n';
+ std::cout << "USBDataThread: Allocating " << bufferSize / 1.0e6 << " MBytes for USB buffer." << std::endl;
usbBuffer = nullptr;
memoryAllocated = true;
@@ -54,7 +54,7 @@ USBDataThread::USBDataThread(AbstractRHXController* controller_, DataStreamFifo*
usbBuffer = new uint8_t [bufferSize];
} catch (std::bad_alloc&) {
memoryAllocated = false;
- cerr << "Error: USBDataThread constructor could not allocate " << memoryNeededGB << " GB of memory." << '\n';
+ std::cerr << "Error: USBDataThread constructor could not allocate " << memoryNeededGB << " GB of memory." << std::endl;
}
// cout << "Ideal thread count: " << QThread::idealThreadCount() << EndOfLine;
diff --git a/GUI/Dialogs/boardselectdialog.cpp b/GUI/Dialogs/boardselectdialog.cpp
index 788da1f..665cb40 100644
--- a/GUI/Dialogs/boardselectdialog.cpp
+++ b/GUI/Dialogs/boardselectdialog.cpp
@@ -387,9 +387,6 @@ BoardSelectDialog::BoardSelectDialog(QWidget *parent) :
QCoreApplication::setOrganizationDomain(OrganizationDomain);
QCoreApplication::setApplicationName(ApplicationName);
- // Globally disable unused Context Help buttons from windows/dialogs
- QApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton);
-
// Initialize Board Identifier.
boardIdentifier = new BoardIdentifier(this);
diff --git a/GUI/Dialogs/renamechanneldialog.cpp b/GUI/Dialogs/renamechanneldialog.cpp
index 0ce48ac..04254a8 100644
--- a/GUI/Dialogs/renamechanneldialog.cpp
+++ b/GUI/Dialogs/renamechanneldialog.cpp
@@ -30,6 +30,8 @@
#include "renamechanneldialog.h"
+#include
+
RenameChannelDialog::RenameChannelDialog(const QString& nativeName, const QString& oldName, QWidget* parent) :
QDialog(parent)
{
@@ -40,8 +42,9 @@ RenameChannelDialog::RenameChannelDialog(const QString& nativeName, const QStrin
oldNameLayout->addWidget(new QLabel(tr("Old channel name: ") + oldName + addNativeName, this));
nameLineEdit = new QLineEdit;
- QRegExp regExp("[\\w-\\+\\./]{1,16}"); // Name must be 1-16 characters, alphanumeric or _-+./
- nameLineEdit->setValidator(new QRegExpValidator(regExp, this));
+ QRegularExpression regExp("[\\w-\\+\\./]{1,16}"); // Name must be 1-16 characters, alphanumeric or _-+./
+ auto reValidator = new QRegularExpressionValidator(regExp, this);
+ nameLineEdit->setValidator(reValidator);
connect(nameLineEdit, SIGNAL(textChanged(const QString &)),
this, SLOT(onLineEditTextChanged()));
diff --git a/GUI/Widgets/filterdisplayselector.cpp b/GUI/Widgets/filterdisplayselector.cpp
index 6132f9a..a9cb75c 100644
--- a/GUI/Widgets/filterdisplayselector.cpp
+++ b/GUI/Widgets/filterdisplayselector.cpp
@@ -136,10 +136,10 @@ FilterDisplaySelector::FilterDisplaySelector(SystemState* state_, QWidget* paren
connect(order3CheckBox, SIGNAL(clicked(bool)), this, SLOT(filterOrderChanged()));
connect(order4CheckBox, SIGNAL(clicked(bool)), this, SLOT(filterOrderChanged()));
- connect(order1ButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(filterOrderChanged()));
- connect(order2ButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(filterOrderChanged()));
- connect(order3ButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(filterOrderChanged()));
- connect(order4ButtonGroup, SIGNAL(buttonClicked(int)), this, SLOT(filterOrderChanged()));
+ connect(order1ButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(filterOrderChanged()));
+ connect(order2ButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(filterOrderChanged()));
+ connect(order3ButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(filterOrderChanged()));
+ connect(order4ButtonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(filterOrderChanged()));
order1CheckBox->setChecked(true);
order2CheckBox->setChecked(false);
diff --git a/GUI/Widgets/pageview.cpp b/GUI/Widgets/pageview.cpp
index 2df48f4..4fd2c11 100644
--- a/GUI/Widgets/pageview.cpp
+++ b/GUI/Widgets/pageview.cpp
@@ -401,7 +401,7 @@ void PageView::mousePressEvent(QMouseEvent *event)
QWidget::mousePressEvent(event);
// If mouse wheel is clicked (regardless of mouse mode), start scrolling.
- if (event->button() == Qt::MidButton) {
+ if (event->button() == Qt::MiddleButton) {
scrolling = true;
scrollStartX = xPixelsToUnitValue(event->pos().x());
scrollStartY = yPixelsToUnitValue(event->pos().y());
@@ -451,7 +451,7 @@ void PageView::mouseReleaseEvent(QMouseEvent *event)
QWidget::mouseReleaseEvent(event);
// If mouse wheel was unclicked (regardless of mouse mode), end scrolling.
- if (event->button() == Qt::MidButton) {
+ if (event->button() == Qt::MiddleButton) {
scrolling = false;
if (mouseMode == Scroll) {
this->setCursor(Qt::OpenHandCursor);
@@ -587,7 +587,7 @@ void PageView::resizeEvent(QResizeEvent* /* event */)
update();
}
-void PageView::enterEvent(QEvent* /* event */)
+void PageView::enterEvent(QEnterEvent* /* event */)
{
mousePresent = true;
diff --git a/GUI/Widgets/pageview.h b/GUI/Widgets/pageview.h
index ce83a99..a57cd80 100644
--- a/GUI/Widgets/pageview.h
+++ b/GUI/Widgets/pageview.h
@@ -93,7 +93,7 @@ public slots:
void mouseMoveEvent(QMouseEvent *event) override;
void wheelEvent(QWheelEvent *event) override;
void resizeEvent(QResizeEvent *event) override;
- void enterEvent(QEvent *event) override;
+ void enterEvent(QEnterEvent *event) override;
void leaveEvent(QEvent *event) override;
private:
diff --git a/GUI/Widgets/testcontrolpanel.cpp b/GUI/Widgets/testcontrolpanel.cpp
index d37160f..63caeeb 100644
--- a/GUI/Widgets/testcontrolpanel.cpp
+++ b/GUI/Widgets/testcontrolpanel.cpp
@@ -2,6 +2,8 @@
#include "testcontrolpanel.h"
#include "controlwindow.h"
+#include
+
HelpDialogCheckInputWave::HelpDialogCheckInputWave(QWidget *parent) :
QDialog(parent)
{
@@ -1704,7 +1706,7 @@ double TestControlPanel::median(const QVector &arr)
}
//Arrange 'arrCopy' lowest to highest
- qSort(arrCopy);
+ std::sort(arrCopy.begin(), arrCopy.end());
//if odd # of elements...
if ((arrCopy.size() % 2) == 1)
@@ -2642,9 +2644,9 @@ void TestControlPanel::saveReport()
}
QTextStream out(&csvFile);
if (state->getControllerTypeEnum() == ControllerStimRecord) {
- out << "Channel Number,Triangle Error,Stim Error,Avg Positive Voltage, Avg Negative Voltage" << endl;
+ out << "Channel Number,Triangle Error,Stim Error,Avg Positive Voltage, Avg Negative Voltage" << Qt::endl;
} else {
- out << "Channel Number,Triangle Error,Settle Error" << endl;
+ out << "Channel Number,Triangle Error,Settle Error" << Qt::endl;
}
for (int channel = 0; channel < report.size(); channel++) {
@@ -2653,11 +2655,11 @@ void TestControlPanel::saveReport()
if (state->getControllerTypeEnum() == ControllerStimRecord) {
out << report.at(channel)->variableError << ",";
out << report.at(channel)->posAvg << ",";
- out << report.at(channel)->negAvg << endl;
+ out << report.at(channel)->negAvg << Qt::endl;
} else {
- out << report.at(channel)->variableError << endl;
+ out << report.at(channel)->variableError << Qt::endl;
}
- //out << report.at(channel)->variableError << endl;
+ //out << report.at(channel)->variableError << Qt::endl;
}
csvFile.close();
}
diff --git a/GUI/Widgets/waveformdisplaycolumn.cpp b/GUI/Widgets/waveformdisplaycolumn.cpp
index e06947c..ccf8864 100644
--- a/GUI/Widgets/waveformdisplaycolumn.cpp
+++ b/GUI/Widgets/waveformdisplaycolumn.cpp
@@ -52,7 +52,7 @@ WaveformDisplayColumn::WaveformDisplayColumn(int columnIndex_, WaveformDisplayMa
portComboBox->addItems(state->signalSources->populatedGroupListWithChannelCounts());
waveformPlot = new MultiWaveformPlot(columnIndex, waveformManager, controllerInterface, state, this);
- connect(portComboBox, SIGNAL(currentIndexChanged(QString)), waveformPlot, SLOT(updateFromState()));
+ connect(portComboBox, SIGNAL(currentIndexChanged(int)), waveformPlot, SLOT(updateFromState()));
if (state->testMode->getValue()) {
portComboBox->setFocusProxy(waveformPlot);
}
diff --git a/GUI/Windows/controlwindow.cpp b/GUI/Windows/controlwindow.cpp
index cb895f2..7d77c18 100644
--- a/GUI/Windows/controlwindow.cpp
+++ b/GUI/Windows/controlwindow.cpp
@@ -640,9 +640,9 @@ void ControlWindow::createActions()
QPixmap jumpToEndPixmap(":/images/tostarticon.png");
- QMatrix rm;
- rm.rotate(180);
- jumpToEndPixmap = jumpToEndPixmap.transformed(rm);
+ QTransform transform;
+ transform.rotate(180);
+ jumpToEndPixmap = jumpToEndPixmap.transformed(transform);
QIcon jumpToEndIcon(jumpToEndPixmap);
jumpToEndAction = new QAction(jumpToEndIcon, tr("Jump to End"), this);
connect(jumpToEndAction, SIGNAL(triggered()), this, SLOT(jumpToEndSlot()));
@@ -1541,22 +1541,22 @@ void ControlWindow::keyPressEvent(QKeyEvent *event)
if (!state->running) {
((TestControlPanel*) controlPanel)->viewReport();
}
- break;
}
+ break;
case Qt::Key_U:
if (state->testMode->getValue()) {
if (!state->running && state->getControllerTypeEnum() == ControllerStimRecord) {
((TestControlPanel*) controlPanel)->uploadStimManual();
}
- break;
}
+ break;
case Qt::Key_C:
if (state->testMode->getValue()) {
if (!state->running) {
((TestControlPanel*) controlPanel)->checkInputWave();
}
- break;
}
+ break;
case Qt::Key_Space:
if (state->testMode->getValue()) {
if (!state->running) {
@@ -1564,15 +1564,15 @@ void ControlWindow::keyPressEvent(QKeyEvent *event)
} else {
stopControllerSlot();
}
- break;
}
+ break;
case Qt::Key_R:
if (state->testMode->getValue()) {
if (!state->running) {
((TestControlPanel*) controlPanel)->rescanPorts();
}
- break;
}
+ break;
default:
QWidget::keyPressEvent(event);
diff --git a/GUI/Windows/probemapwindow.cpp b/GUI/Windows/probemapwindow.cpp
index 8608784..d14b6e7 100644
--- a/GUI/Windows/probemapwindow.cpp
+++ b/GUI/Windows/probemapwindow.cpp
@@ -305,7 +305,7 @@ void ProbeMapWindow::updateForStop()
void ProbeMapWindow::catchSpikeReport(QString names)
{
// Separate QString out using ','
- QStringList nameList = names.split(',', QString::SkipEmptyParts);
+ QStringList nameList = names.split(',', Qt::SkipEmptyParts);
// Insert or assign each name within nameList
for (QStringList::const_iterator it = nameList.constBegin(); it != nameList.constEnd(); ++it) {
diff --git a/IntanRHX.pro b/IntanRHX.pro
index 458ae34..b323dd3 100644
--- a/IntanRHX.pro
+++ b/IntanRHX.pro
@@ -4,7 +4,7 @@
#
#-------------------------------------------------
-QT += core gui xml multimedia network widgets
+QT += core gui xml multimedia network widgets
TARGET = IntanRHX
TEMPLATE = app
diff --git a/contrib/ci/Dockerfile-debian b/contrib/ci/Dockerfile-debian
index 4690a2f..ddca5e0 100644
--- a/contrib/ci/Dockerfile-debian
+++ b/contrib/ci/Dockerfile-debian
@@ -1,7 +1,7 @@
#
# Docker file for Intan RHX CI
#
-FROM debian:bullseye
+FROM debian:trixie
# prepare
RUN mkdir -p /build/ci/
diff --git a/contrib/ci/Dockerfile-ubuntu b/contrib/ci/Dockerfile-ubuntu
index 12f4cbe..fb53dc5 100644
--- a/contrib/ci/Dockerfile-ubuntu
+++ b/contrib/ci/Dockerfile-ubuntu
@@ -1,7 +1,7 @@
#
# Docker file for Intan RHX CI
#
-FROM ubuntu:focal
+FROM ubuntu:noble
# prepare
RUN mkdir -p /build/ci/
diff --git a/contrib/ci/install-deps-deb.sh b/contrib/ci/install-deps-deb.sh
index bff3eed..2d5fee8 100755
--- a/contrib/ci/install-deps-deb.sh
+++ b/contrib/ci/install-deps-deb.sh
@@ -34,8 +34,7 @@ eatmydata apt-get install -yq --no-install-recommends \
# Intan RHX build dependencies
eatmydata apt-get install -yq --no-install-recommends \
- libqt5xmlpatterns5-dev \
ocl-icd-opencl-dev \
- qt5-qmake \
- qtbase5-dev \
- qtmultimedia5-dev
+ qmake6 \
+ qt6-base-dev \
+ qt6-multimedia-dev
diff --git a/contrib/debian/changelog b/contrib/debian/changelog
index 35c0219..4641558 100644
--- a/contrib/debian/changelog
+++ b/contrib/debian/changelog
@@ -1,5 +1,5 @@
-intan-rhx (3.0.2) UNRELEASED; urgency=medium
+intan-rhx (3.2.0) UNRELEASED; urgency=medium
* Permanent dummy release
- -- Matthias Klumpp Mon, 05 Apr 2021 12:38:32 +0200
+ -- Matthias Klumpp Mon, 08 Apr 2024 12:38:32 +0200
diff --git a/contrib/debian/control b/contrib/debian/control
index c6dfec4..81451ce 100644
--- a/contrib/debian/control
+++ b/contrib/debian/control
@@ -2,13 +2,12 @@ Source: intan-rhx
Section: non-free/science
Priority: optional
Maintainer: Intan Technologies
-Build-Depends: debhelper-compat (= 12),
- libqt5xmlpatterns5-dev,
+Build-Depends: debhelper-compat (= 13),
ocl-icd-opencl-dev,
- qt5-qmake,
- qtbase5-dev,
- qtmultimedia5-dev
-Standards-Version: 4.5.0
+ qmake6,
+ qt6-base-dev,
+ qt6-multimedia-dev
+Standards-Version: 4.6.2
Package: intan-rhx
Architecture: any
diff --git a/contrib/debian/rules b/contrib/debian/rules
index e984e9b..1b159fb 100755
--- a/contrib/debian/rules
+++ b/contrib/debian/rules
@@ -2,4 +2,4 @@
# -*- mode: makefile; coding: utf-8 -*-
%:
- dh $@
+ dh $@ --buildsystem=qmake6
From d077aecdca11b03a93b9d1716c0239c376ad337f Mon Sep 17 00:00:00 2001
From: Matthias Klumpp
Date: Mon, 6 May 2024 18:01:58 +0200
Subject: [PATCH 2/5] Resolve a compiler warnings and make compiler more strict
---
Engine/API/Hardware/rhxcontroller.cpp | 4 +-
.../DataFileReaders/fileperchannelmanager.cpp | 2 +-
.../DataFileReaders/fileperchannelmanager.h | 2 +-
.../traditionalintanfilemanager.cpp | 2 +-
.../Processing/XPUInterfaces/gpuinterface.cpp | 6 ++-
.../XPUInterfaces/xpucontroller.cpp | 10 +++--
Engine/Processing/commandparser.cpp | 8 +++-
Engine/Processing/controllerinterface.cpp | 2 +-
.../Processing/softwarereferenceprocessor.cpp | 2 +-
Engine/Processing/stateitem.h | 2 +-
Engine/Processing/waveformfifo.cpp | 6 +--
Engine/Processing/waveformfifo.h | 3 +-
Engine/Processing/xmlinterface.cpp | 4 +-
Engine/Threads/tcpdataoutputthread.cpp | 4 +-
GUI/Dialogs/advancedstartupdialog.cpp | 6 +--
GUI/Dialogs/advancedstartupdialog.h | 2 +-
GUI/Dialogs/anoutdialog.h | 2 +-
GUI/Dialogs/boardselectdialog.cpp | 6 +--
GUI/Dialogs/digoutdialog.h | 2 +-
GUI/Dialogs/stimparamdialog.h | 2 +-
GUI/Widgets/abstractpanel.cpp | 4 +-
GUI/Widgets/anoutfigure.h | 6 +--
GUI/Widgets/controlpanel.cpp | 5 +--
GUI/Widgets/controlpanelconfiguretab.cpp | 2 +-
GUI/Widgets/digfigure.h | 6 +--
GUI/Widgets/smartspinbox.h | 20 +++++-----
GUI/Widgets/testcontrolpanel.cpp | 10 ++---
GUI/Widgets/waveformdisplaymanager.cpp | 6 +--
GUI/Windows/controlwindow.cpp | 6 +--
GUI/Windows/probemapwindow.cpp | 4 +-
IntanRHX.pro | 40 ++++++++++++++-----
31 files changed, 108 insertions(+), 78 deletions(-)
diff --git a/Engine/API/Hardware/rhxcontroller.cpp b/Engine/API/Hardware/rhxcontroller.cpp
index 33ef436..ce5d178 100644
--- a/Engine/API/Hardware/rhxcontroller.cpp
+++ b/Engine/API/Hardware/rhxcontroller.cpp
@@ -160,8 +160,8 @@ bool RHXController::uploadFPGABitfile(const string& filename)
boardId = dev->GetWireOutValue(WireOutBoardId);
boardVersion = dev->GetWireOutValue(WireOutBoardVersion);
- cout << "Rhythm configuration file successfully loaded. Rhythm version number: " <<
- boardVersion << "\n\n";
+ std::cout << "Rhythm configuration file successfully loaded. Rhythm version number: " <<
+ boardVersion << "\n" << std::endl;
return true;
}
diff --git a/Engine/Processing/DataFileReaders/fileperchannelmanager.cpp b/Engine/Processing/DataFileReaders/fileperchannelmanager.cpp
index f4e0460..d1fbc69 100644
--- a/Engine/Processing/DataFileReaders/fileperchannelmanager.cpp
+++ b/Engine/Processing/DataFileReaders/fileperchannelmanager.cpp
@@ -512,7 +512,7 @@ void FilePerChannelManager::updateEndOfData()
// TODO - polish up to get the actual end of all data, not just assume from end of shortest amp file
int tempTotalNumSamples = 0;
for (int stream = 0; stream < info->numDataStreams; ++stream) {
- for (int channel = 0; channel < amplifierFiles[stream].size(); ++channel) {
+ for (uint channel = 0; channel < amplifierFiles[stream].size(); ++channel) {
if (amplifierWasSaved[stream][channel]) {
int64_t numAmpSamples = amplifierFiles[stream][channel]->fileSize() / 2;
if (numAmpSamples < tempTotalNumSamples || tempTotalNumSamples == 0) {
diff --git a/Engine/Processing/DataFileReaders/fileperchannelmanager.h b/Engine/Processing/DataFileReaders/fileperchannelmanager.h
index fedccb3..40d7f0f 100644
--- a/Engine/Processing/DataFileReaders/fileperchannelmanager.h
+++ b/Engine/Processing/DataFileReaders/fileperchannelmanager.h
@@ -49,7 +49,7 @@ class FilePerChannelManager : public DataFileManager
DataFileReader* parent);
~FilePerChannelManager();
- long readDataBlocksRaw(int numBlocks, uint8_t* buffer);
+ long readDataBlocksRaw(int numBlocks, uint8_t* buffer) override;
int64_t getLastTimeStamp() override;
int64_t jumpToTimeStamp(int64_t target) override;
void loadDataFrame() override;
diff --git a/Engine/Processing/DataFileReaders/traditionalintanfilemanager.cpp b/Engine/Processing/DataFileReaders/traditionalintanfilemanager.cpp
index ff1e835..1e62116 100644
--- a/Engine/Processing/DataFileReaders/traditionalintanfilemanager.cpp
+++ b/Engine/Processing/DataFileReaders/traditionalintanfilemanager.cpp
@@ -379,7 +379,7 @@ int64_t TraditionalIntanFileManager::blocksPresent()
{
// Should remain accurate even if data file continues growing
int dataSizeBytes = 0;
- for (int i = 0; i < consecutiveFiles.size(); i++) {
+ for (uint i = 0; i < consecutiveFiles.size(); i++) {
dataSizeBytes += QFileInfo(consecutiveFiles[i].fileName).size() - info->headerSizeInBytes;
}
return dataSizeBytes / info->bytesPerDataBlock;
diff --git a/Engine/Processing/XPUInterfaces/gpuinterface.cpp b/Engine/Processing/XPUInterfaces/gpuinterface.cpp
index f3b1e0e..9d94544 100644
--- a/Engine/Processing/XPUInterfaces/gpuinterface.cpp
+++ b/Engine/Processing/XPUInterfaces/gpuinterface.cpp
@@ -539,8 +539,12 @@ bool GPUInterface::createKernel(int devIndex)
state->writeToLog("Completed clCreateContext()");
state->writeToLog("About to call clCreateCommandQueue");
+ cl_queue_properties properties[] = {
+ CL_QUEUE_PROPERTIES,
+ 0 // Terminates the list
+ };
// Create command queue.
- commandQueue = clCreateCommandQueue(context, id, 0, &ret);
+ commandQueue = clCreateCommandQueueWithProperties(context, id, properties, &ret);
if (ret != CL_SUCCESS) {
state->writeToLog("Failure creating OpenCL commandqueue. Ret: " + QString::number(ret));
gpuErrorMessage("Error creating OpenCL commandqueue. Returned error code: " + QString::number(ret));
diff --git a/Engine/Processing/XPUInterfaces/xpucontroller.cpp b/Engine/Processing/XPUInterfaces/xpucontroller.cpp
index 1ad3ef1..9a496ff 100644
--- a/Engine/Processing/XPUInterfaces/xpucontroller.cpp
+++ b/Engine/Processing/XPUInterfaces/xpucontroller.cpp
@@ -32,9 +32,9 @@
XPUController::XPUController(SystemState *state_, bool useOpenCL_, QObject *parent) :
QObject(parent),
+ useOpenCL(useOpenCL_),
state(state_),
- usedXPUIndex(-1),
- useOpenCL(useOpenCL_)
+ usedXPUIndex(-1)
{
state->writeToLog("Entered XPUController ctor");
connect(state, SIGNAL(stateChanged()), this, SLOT(updateFromState()));
@@ -126,7 +126,11 @@ void XPUController::updateFromState()
if (state->usedXPUIndex() != usedXPUIndex) {
activeInterface->cleanupMemory();
usedXPUIndex = state->usedXPUIndex();
- activeInterface = (usedXPUIndex == 0) ? activeInterface = cpuInterface : activeInterface = gpuInterface;
+ if (usedXPUIndex == 0) {
+ activeInterface = cpuInterface;
+ } else {
+ activeInterface = gpuInterface;
+ }
activeInterface->setupMemory();
}
activeInterface->updateFromState();
diff --git a/Engine/Processing/commandparser.cpp b/Engine/Processing/commandparser.cpp
index 394e273..47cc176 100644
--- a/Engine/Processing/commandparser.cpp
+++ b/Engine/Processing/commandparser.cpp
@@ -33,8 +33,8 @@
CommandParser::CommandParser(SystemState* state_, ControllerInterface *controllerInterface_, QObject *parent) :
QObject(parent),
- controllerInterface(controllerInterface_),
controlWindow(nullptr),
+ controllerInterface(controllerInterface_),
state(state_)
{
// These connections allow for interactions with communicators that may live in another thread
@@ -871,6 +871,8 @@ QString CommandParser::validateStimParams(StimParameters *stimParams) const
if (stimParams->pulseTrainPeriod->getValue() < stimDuration)
return "PulseTrainPeriodMicroseconds cannot be less than total pulse duration (sum of all phases used for this Shape)";
+ break;
+
case BoardDacSignal:
// PulseTrainPeriod cannot be less than stimDuration (which depends on Shape)
// Biphasic: stimDuration = FirstPhaseDuration + SecondPhaseDuration
@@ -888,11 +890,15 @@ QString CommandParser::validateStimParams(StimParameters *stimParams) const
if (stimParams->pulseTrainPeriod->getValue() < stimDuration)
return "PulseTrainPeriodMicroseconds cannot be less than total pulse duration (sum of all phases used for this Shape)";
+ break;
+
case BoardDigitalOutSignal:
// PulseTrainPeriod cannot be less than FirstPhaseDuration
if (stimParams->pulseTrainPeriod->getValue() < stimParams->firstPhaseDuration->getValue())
return "PulseTrainPeriodMicroseconds cannot be less than pulse duration (FirstPhaseDurationMicroseconds)";
+ break;
+
default:
break;
}
diff --git a/Engine/Processing/controllerinterface.cpp b/Engine/Processing/controllerinterface.cpp
index 75abad9..fc830c2 100644
--- a/Engine/Processing/controllerinterface.cpp
+++ b/Engine/Processing/controllerinterface.cpp
@@ -298,7 +298,7 @@ int ControllerInterface::scanPorts(vector &chipType, vector &port
state->previousDelaySelectedPort->getValue(),
state->lastDetectedChip->getValue());
- for (int i = 0; i < chipType.size(); i++) {
+ for (uint i = 0; i < chipType.size(); i++) {
if (chipType[i] != NoChip) {
state->lastDetectedChip->setValue((int) chipType[i]);
break;
diff --git a/Engine/Processing/softwarereferenceprocessor.cpp b/Engine/Processing/softwarereferenceprocessor.cpp
index 10a5ee0..0188946 100644
--- a/Engine/Processing/softwarereferenceprocessor.cpp
+++ b/Engine/Processing/softwarereferenceprocessor.cpp
@@ -342,7 +342,7 @@ void SoftwareReferenceProcessor::readReferenceSamples(vector
{
const uint16_t* pRead;
- for (int i = 0; i < addresses.size(); ++i) {
+ for (uint i = 0; i < addresses.size(); ++i) {
pRead = start;
pRead += 6; // Skip header and timestamp.
pRead += misoWordSize * (numDataStreams * 3); // Skip auxiliary channels.
diff --git a/Engine/Processing/stateitem.h b/Engine/Processing/stateitem.h
index 7a83a6f..63a0a5b 100644
--- a/Engine/Processing/stateitem.h
+++ b/Engine/Processing/stateitem.h
@@ -142,7 +142,7 @@ class StateFilenameItem : public StateItem
bool isValid() const { return !path.isEmpty() && !baseFilename.isEmpty(); }
QString getFullFilename() const { return isValid() ? path + "/" + baseFilename : ""; }
- QString getValidValues() const { return "Path: [path/to/file], BaseFilename: [filename.rhx]"; }
+ QString getValidValues() const override { return "Path: [path/to/file], BaseFilename: [filename.rhx]"; }
private:
QString path;
diff --git a/Engine/Processing/waveformfifo.cpp b/Engine/Processing/waveformfifo.cpp
index 432e121..2946ea5 100644
--- a/Engine/Processing/waveformfifo.cpp
+++ b/Engine/Processing/waveformfifo.cpp
@@ -35,12 +35,12 @@
#include "waveformfifo.h"
WaveformFifo::WaveformFifo(SignalSources *signalSources_, int bufferSizeInDataBlocks_, int memorySizeInDataBlocks_, int maxWriteSizeInDataBlocks_, SystemState* state_) :
+ state(state_),
signalSources(signalSources_),
bufferSizeInDataBlocks(bufferSizeInDataBlocks_),
memorySizeInDataBlocks(memorySizeInDataBlocks_),
maxWriteSizeInDataBlocks(maxWriteSizeInDataBlocks_),
- numReaders(NumberOfReaders),
- state(state_)
+ numReaders(NumberOfReaders)
{
if (numReaders < 1) {
cerr << "WaveformFifo constructor: numReaders must be one or greater." << '\n';
@@ -64,7 +64,7 @@ WaveformFifo::WaveformFifo(SignalSources *signalSources_, int bufferSizeInDataBl
bufferAllocateSize = bufferSize + maxWriteSizeInSamples;
bufferAllocateSizeInBlocks = bufferSizeInDataBlocks + maxWriteSizeInDataBlocks;
- usedWordsNewData = new Semaphore [numReaders];
+ usedWordsNewData = new Semaphore[numReaders];
bufferReadIndex.resize(numReaders);
bufferMemoryIndex.resize(numReaders);
numWordsToBeRead.resize(numReaders);
diff --git a/Engine/Processing/waveformfifo.h b/Engine/Processing/waveformfifo.h
index 814e8fc..d2c836b 100644
--- a/Engine/Processing/waveformfifo.h
+++ b/Engine/Processing/waveformfifo.h
@@ -36,7 +36,6 @@
#include
+ https://intantech.com/RHX_software.html
+
com.intantech.intan_rhx.desktop
https://intantech.com/image-src/RHX_screenshot2_940.PNG
+
+
From 7e5e21be55441cde4e17993293b2a40cb67295b6 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp
Date: Mon, 6 May 2024 18:36:32 +0200
Subject: [PATCH 4/5] ci: Update actions versions
---
.github/workflows/build.yml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 47a0ad0..8b0b55c 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -8,7 +8,7 @@ jobs:
name: Validate Metadata
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Create Build Environment
run: cd contrib/ci/ && podman build -t intanrhx_validate -f ./Dockerfile-debian-testing .
@@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
@@ -40,7 +40,7 @@ jobs:
./contrib/ci/auto-build-deb.sh
- name: Upload Debian package artifact
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
with:
name: Debian Package
path: |
@@ -53,7 +53,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
@@ -66,7 +66,7 @@ jobs:
./contrib/ci/auto-build-deb.sh
- name: Upload Ubuntu package artifact
- uses: actions/upload-artifact@v2
+ uses: actions/upload-artifact@v4
with:
name: Ubuntu LTS Package
path: |
From 3ead6dfb5a54498924001aad940f5474dac471b2 Mon Sep 17 00:00:00 2001
From: Matthias Klumpp
Date: Tue, 9 Jul 2024 20:18:15 +0200
Subject: [PATCH 5/5] Resolve a few more compiler warnings and Qt6 deprecations
---
Engine/API/Abstract/abstractrhxcontroller.cpp | 7 +++----
Engine/API/Hardware/rhxregisters.cpp | 8 ++++----
Engine/Processing/xmlinterface.cpp | 6 +++---
GUI/Widgets/pageview.cpp | 4 ++--
GUI/Widgets/testcontrolpanel.cpp | 12 ++++--------
5 files changed, 16 insertions(+), 21 deletions(-)
diff --git a/Engine/API/Abstract/abstractrhxcontroller.cpp b/Engine/API/Abstract/abstractrhxcontroller.cpp
index 26611ff..09a991a 100644
--- a/Engine/API/Abstract/abstractrhxcontroller.cpp
+++ b/Engine/API/Abstract/abstractrhxcontroller.cpp
@@ -665,14 +665,13 @@ unsigned int AbstractRHXController::fifoCapacityInWords()
// Print a command list to the console in readable form.
void AbstractRHXController::printCommandList(const vector &commandList) const
{
- unsigned int i, cmd;
int channel, reg, data, uFlag, mFlag, dFlag, hFlag;
cout << '\n';
- for (i = 0; i < commandList.size(); ++i) {
- cmd = commandList[i];
+ for (uint i = 0; i < commandList.size(); ++i) {
+ auto cmd = commandList[i];
if (type != ControllerStimRecord) {
- if (cmd < 0 || cmd > 0xffff) {
+ if ((int)cmd < 0 || cmd > 0xffff) {
cout << " command[" << i << "] = INVALID COMMAND: " << cmd << '\n';
} else if ((cmd & 0xc000) == 0x0000) {
channel = (cmd & 0x3f00) >> 8;
diff --git a/Engine/API/Hardware/rhxregisters.cpp b/Engine/API/Hardware/rhxregisters.cpp
index 2d4b882..6a9a26e 100644
--- a/Engine/API/Hardware/rhxregisters.cpp
+++ b/Engine/API/Hardware/rhxregisters.cpp
@@ -1122,7 +1122,7 @@ unsigned int RHXRegisters::createRHXCommand(RHXCommandType commandType, unsigned
} else {
switch (commandType) {
case RHXCommandConvert:
- if ((arg1 < 0) || (arg1 > 63)) {
+ if (((int)arg1 < 0) || (arg1 > 63)) {
cerr << "Error in RHXRegisters::createRHXCommand: " <<
"Channel number out of range.\n";
return -1;
@@ -1130,7 +1130,7 @@ unsigned int RHXRegisters::createRHXCommand(RHXCommandType commandType, unsigned
return 0x0000 + (arg1 << 8); // 00cccccc0000000h; if the command is 'Convert',
// arg1 is the channel number.
case RHXCommandRegRead:
- if ((arg1 < 0) || (arg1 > 63)) {
+ if (((int)arg1 < 0) || (arg1 > 63)) {
cerr << "Error in RHXRegisters::createRHXCommand: " <<
"Register address out of range.\n";
return -1;
@@ -1182,12 +1182,12 @@ unsigned int RHXRegisters::createRHXCommand(RHXCommandType commandType, unsigned
} else {
switch (commandType) {
case RHXCommandRegWrite:
- if ((arg1 < 0) || (arg1 > 63)) {
+ if (((int)arg1 < 0) || (arg1 > 63)) {
cerr << "Error in RHXRegisters::createRHXCommand: " <<
"Register address out of range.\n";
return -1;
}
- if ((arg2 < 0) || (arg2 > 255)) {
+ if (((int)arg2 < 0) || (arg2 > 255)) {
cerr << "Error in RHXRegisters::createRHXCommand: " <<
"Register data out of range.\n";
return -1;
diff --git a/Engine/Processing/xmlinterface.cpp b/Engine/Processing/xmlinterface.cpp
index 2fff4b3..cb10990 100644
--- a/Engine/Processing/xmlinterface.cpp
+++ b/Engine/Processing/xmlinterface.cpp
@@ -884,7 +884,7 @@ void XMLInterface::parseSignalGroupsAttributes(const QByteArray &byteArray, QStr
{
QXmlStreamReader stream(byteArray);
while (!stream.atEnd()) {
- while (stream.name() != "SignalGroup") {
+ while (stream.name() != QStringLiteral("SignalGroup")) {
QXmlStreamReader::TokenType token = stream.readNext();
if (token == QXmlStreamReader::EndDocument) {
return;
@@ -894,7 +894,7 @@ void XMLInterface::parseSignalGroupsAttributes(const QByteArray &byteArray, QStr
QXmlStreamAttributes attributes = stream.attributes();
QString portName("");
for (auto attribute : attributes) {
- if (attribute.name().toString().toLower() == "prefix") {
+ if (attribute.name().toString().toLower() == QStringLiteral("prefix")) {
portName = "Port " + attribute.value().toString();
break;
}
@@ -910,7 +910,7 @@ void XMLInterface::parseSignalGroupsAttributes(const QByteArray &byteArray, QStr
QString attributeName = attribute.name().toString();
QString attributeValue = attribute.value().toString();
- if (attributeValue != "N/A") {
+ if (attributeValue != QStringLiteral("N/A")) {
StateSingleItem *singleItem = state->locateStateSingleItem(thisSignalGroup->portItems, attributeName);
// If the attribute is a StateSingleItem, set it according to XMLIncludeParameters.
diff --git a/GUI/Widgets/pageview.cpp b/GUI/Widgets/pageview.cpp
index 66cd247..c797995 100644
--- a/GUI/Widgets/pageview.cpp
+++ b/GUI/Widgets/pageview.cpp
@@ -1266,8 +1266,8 @@ QString PageView::getSiteShape(int port, int site)
void PageView::overwriteColor(QColor &color, const QString& colorName)
{
- if (color.isValidColor(colorName))
- color.setNamedColor(colorName);
+ if (color.isValidColorName(colorName))
+ color = QColor::fromString(colorName);
}
void PageView::overwriteFloat(float &original, float newValue) {
diff --git a/GUI/Widgets/testcontrolpanel.cpp b/GUI/Widgets/testcontrolpanel.cpp
index 9e3bdca..9628766 100644
--- a/GUI/Widgets/testcontrolpanel.cpp
+++ b/GUI/Widgets/testcontrolpanel.cpp
@@ -94,8 +94,8 @@ TestControlPanel::TestControlPanel(ControllerInterface *controllerInterface_, Ab
helpDialogCheckInputWave(nullptr),
helpDialogTestChip(nullptr),
helpDialogUploadTestStimParameters(nullptr),
- previousDelay(-1),
portComboBox(nullptr),
+ previousDelay(-1),
auxIn1Min(3.3),
auxIn1Max(0),
auxIn1Median(0),
@@ -830,13 +830,11 @@ void TestControlPanel::recordDummySegment(double duration, int portIndex)
void TestControlPanel::allocateDoubleArray3D(QVector > > &array3D,
int xSize, int ySize, int zSize)
{
- int i, j;
-
if (xSize == 0) return;
array3D.resize(xSize);
- for (i = 0; i < xSize; ++i) {
+ for (int i = 0; i < xSize; ++i) {
array3D[i].resize(ySize);
- for (j = 0; j < ySize; ++j) {
+ for (int j = 0; j < ySize; ++j) {
array3D[i][j].resize(zSize);
}
}
@@ -846,11 +844,9 @@ void TestControlPanel::allocateDoubleArray3D(QVector > >
void TestControlPanel::allocateDoubleArray2D(QVector > &array2D,
int xSize, int ySize)
{
- int i, j;
-
if (xSize == 0) return;
array2D.resize(xSize);
- for (i = 0; i < xSize; ++i) {
+ for (int i = 0; i < xSize; ++i) {
array2D[i].resize(ySize);
}
}