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 #include #include -#include "rhxglobals.h" #include "semaphore.h" #include "minmax.h" #include "signalsources.h" @@ -76,7 +75,7 @@ const uint8_t SpikeIdLikelyArtifact = 0x80u; class WaveformFifo { public: - enum Reader { + enum Reader : uint { ReaderDisplay = 0, ReaderDisk, ReaderAudio, diff --git a/Engine/Processing/xmlinterface.cpp b/Engine/Processing/xmlinterface.cpp index dc22512..4613257 100644 --- a/Engine/Processing/xmlinterface.cpp +++ b/Engine/Processing/xmlinterface.cpp @@ -517,7 +517,7 @@ bool XMLInterface::checkConsistentChannels(const QByteArray &byteArray, QString errorMessage.append("\n"); } errorMessage.append("Warning: The following channels are currently detected by the Intan controller but are not included in the settings file:"); - for (int i = 0; i < uninitializedChannels.size(); ++i) { + for (uint i = 0; i < uninitializedChannels.size(); ++i) { errorMessage.append("\n" + QString::fromStdString(uninitializedChannels[i])); } } @@ -576,7 +576,7 @@ bool XMLInterface::checkConsistentChannels(const QByteArray &byteArray, QString vector XMLInterface::findUninitializedChannels(vector allChannels, vector channelsInitializedFromXML) const { vector uninitializedChannels; - for (int i = 0; i < allChannels.size(); ++i) { + for (uint i = 0; i < allChannels.size(); ++i) { if (!channelsInitializedFromXML[i]) { uninitializedChannels.push_back(allChannels[i]); } diff --git a/Engine/Threads/tcpdataoutputthread.cpp b/Engine/Threads/tcpdataoutputthread.cpp index b2b688b..89062e2 100644 --- a/Engine/Threads/tcpdataoutputthread.cpp +++ b/Engine/Threads/tcpdataoutputthread.cpp @@ -34,6 +34,7 @@ TCPDataOutputThread::TCPDataOutputThread(WaveformFifo *waveformFifo_, const doub QThread(parent), tcpWaveformDataCommunicator(state_->tcpWaveformDataCommunicator), tcpSpikeDataCommunicator(state_->tcpSpikeDataCommunicator), + previousSample(nullptr), waveformFifo(waveformFifo_), signalSources(state_->signalSources), sampleRate(sampleRate_), @@ -42,8 +43,7 @@ TCPDataOutputThread::TCPDataOutputThread(WaveformFifo *waveformFifo_, const doub stopThread(false), parentObject(parent), connected(false), - state(state_), - previousSample(nullptr) + state(state_) { } diff --git a/GUI/Dialogs/advancedstartupdialog.cpp b/GUI/Dialogs/advancedstartupdialog.cpp index f43a30a..571ae7a 100644 --- a/GUI/Dialogs/advancedstartupdialog.cpp +++ b/GUI/Dialogs/advancedstartupdialog.cpp @@ -16,11 +16,11 @@ AdvancedStartupDialog::AdvancedStartupDialog(bool &useOpenCL_, uint8_t &playback playbackFCheckBox(nullptr), playbackGCheckBox(nullptr), playbackHCheckBox(nullptr), - playbackPorts(&playbackPorts_), - demoMode(demoMode_), buttonBox(nullptr), useOpenCL(&useOpenCL_), - tempUseOpenCL(useOpenCL_) + tempUseOpenCL(useOpenCL_), + playbackPorts(&playbackPorts_), + demoMode(demoMode_) { useOpenCLDescription = new QLabel(tr( "OpenCL is a platform-independent framework that allows the CPU to\n" diff --git a/GUI/Dialogs/advancedstartupdialog.h b/GUI/Dialogs/advancedstartupdialog.h index 1fbfd69..f6e0be3 100644 --- a/GUI/Dialogs/advancedstartupdialog.h +++ b/GUI/Dialogs/advancedstartupdialog.h @@ -17,7 +17,7 @@ class AdvancedStartupDialog : public QDialog static uint8_t portsBoolToInt(QVector portsBool); public slots: - void accept(); + void accept() override; private slots: void changeUseOpenCL(bool use); diff --git a/GUI/Dialogs/anoutdialog.h b/GUI/Dialogs/anoutdialog.h index 8153722..1a38212 100644 --- a/GUI/Dialogs/anoutdialog.h +++ b/GUI/Dialogs/anoutdialog.h @@ -55,7 +55,7 @@ class AnOutDialog : public QDialog void loadParameters(StimParameters* parameters); public slots: - void accept(); + void accept() override; void notifyFocusChanged(QWidget *lostFocus, QWidget *gainedFocus); private: diff --git a/GUI/Dialogs/boardselectdialog.cpp b/GUI/Dialogs/boardselectdialog.cpp index 665cb40..4b4bd19 100644 --- a/GUI/Dialogs/boardselectdialog.cpp +++ b/GUI/Dialogs/boardselectdialog.cpp @@ -369,8 +369,6 @@ BoardSelectDialog::BoardSelectDialog(QWidget *parent) : openButton(nullptr), playbackButton(nullptr), advancedButton(nullptr), - useOpenCL(true), - playbackPorts(255), defaultSampleRateCheckBox(nullptr), defaultSettingsFileCheckBox(nullptr), splash(nullptr), @@ -380,7 +378,9 @@ BoardSelectDialog::BoardSelectDialog(QWidget *parent) : state(nullptr), controllerInterface(nullptr), parser(nullptr), - controlWindow(nullptr) + controlWindow(nullptr), + useOpenCL(true), + playbackPorts(255) { // Information used by QSettings to save basic settings across sessions. QCoreApplication::setOrganizationName(OrganizationName); diff --git a/GUI/Dialogs/digoutdialog.h b/GUI/Dialogs/digoutdialog.h index 2e8e8ac..1e04b57 100644 --- a/GUI/Dialogs/digoutdialog.h +++ b/GUI/Dialogs/digoutdialog.h @@ -54,7 +54,7 @@ class DigOutDialog : public QDialog void loadParameters(StimParameters* parameters); public slots: - void accept(); + void accept() override; void notifyFocusChanged(QWidget *lostFocus, QWidget *gainedFocus); private: diff --git a/GUI/Dialogs/stimparamdialog.h b/GUI/Dialogs/stimparamdialog.h index eb2090c..167b0f3 100644 --- a/GUI/Dialogs/stimparamdialog.h +++ b/GUI/Dialogs/stimparamdialog.h @@ -57,7 +57,7 @@ class StimParamDialog : public QDialog void activate(); public slots: - void accept(); + void accept() override; private slots: void notifyFocusChanged(QWidget* lostFocus, QWidget* gainedFocus); diff --git a/GUI/Widgets/abstractpanel.cpp b/GUI/Widgets/abstractpanel.cpp index e9a5c3c..b184912 100644 --- a/GUI/Widgets/abstractpanel.cpp +++ b/GUI/Widgets/abstractpanel.cpp @@ -32,10 +32,10 @@ void ColorWidget::setColor(QColor color) } AbstractPanel::AbstractPanel(ControllerInterface* controllerInterface_, SystemState* state_, CommandParser* parser_, ControlWindow *parent) : - controlWindow(parent), - controllerInterface(controllerInterface_), state(state_), parser(parser_), + controlWindow(parent), + controllerInterface(controllerInterface_), filterDisplaySelector(nullptr), tabWidget(nullptr), configureTab(nullptr), diff --git a/GUI/Widgets/anoutfigure.h b/GUI/Widgets/anoutfigure.h index a52e727..16764ae 100644 --- a/GUI/Widgets/anoutfigure.h +++ b/GUI/Widgets/anoutfigure.h @@ -40,7 +40,7 @@ class AnOutFigure : public AbstractFigure Q_OBJECT public: explicit AnOutFigure(StimParameters* stimParameters, QWidget *parent = nullptr); - void uniqueRedraw(QPainter &painter); + void uniqueRedraw(QPainter &painter) override; public slots: void updateMonophasicAndPositive(bool logicValue); @@ -51,8 +51,8 @@ public slots: void highlightBaselineVoltage(bool highlight); private: - QSize sizeHint() const; - QSize minimumSizeHint() const; + QSize sizeHint() const override; + QSize minimumSizeHint() const override; bool localMonophasicAndPositive; QColor oldColor; }; diff --git a/GUI/Widgets/controlpanel.cpp b/GUI/Widgets/controlpanel.cpp index b41386d..6dcccd8 100644 --- a/GUI/Widgets/controlpanel.cpp +++ b/GUI/Widgets/controlpanel.cpp @@ -28,9 +28,6 @@ // //------------------------------------------------------------------------------ -#include "stimparamdialog.h" -#include "anoutdialog.h" -#include "digoutdialog.h" #include "controlpanelbandwidthtab.h" #include "controlpanelimpedancetab.h" #include "controlpanelaudioanalogtab.h" @@ -182,6 +179,8 @@ QString ControlPanel::currentTabName() const } else { qDebug() << "Unrecognized tab widget."; } + + return QString(); } QHBoxLayout* ControlPanel::createSelectionLayout() diff --git a/GUI/Widgets/controlpanelconfiguretab.cpp b/GUI/Widgets/controlpanelconfiguretab.cpp index efe764c..7522cab 100644 --- a/GUI/Widgets/controlpanelconfiguretab.cpp +++ b/GUI/Widgets/controlpanelconfiguretab.cpp @@ -37,13 +37,13 @@ ControlPanelConfigureTab::ControlPanelConfigureTab(ControllerInterface* controllerInterface_, SystemState* state_, CommandParser* parser_, QWidget *parent) : QWidget(parent), + fastSettleCheckBox(nullptr), state(state_), parser(parser_), controllerInterface(controllerInterface_), scanButton(nullptr), setCableDelayButton(nullptr), digOutButton(nullptr), - fastSettleCheckBox(nullptr), externalFastSettleCheckBox(nullptr), externalFastSettleSpinBox(nullptr), note1LineEdit(nullptr), diff --git a/GUI/Widgets/digfigure.h b/GUI/Widgets/digfigure.h index 0f8d4e3..9dd5a24 100644 --- a/GUI/Widgets/digfigure.h +++ b/GUI/Widgets/digfigure.h @@ -40,11 +40,11 @@ class DigFigure : public AbstractFigure Q_OBJECT public: explicit DigFigure(StimParameters* stimParameters, QWidget* parent = nullptr); - void uniqueRedraw(QPainter &painter); + void uniqueRedraw(QPainter &painter) override; private: - QSize sizeHint() const; - QSize minimumSizeHint() const; + QSize sizeHint() const override; + QSize minimumSizeHint() const override; }; diff --git a/GUI/Widgets/smartspinbox.h b/GUI/Widgets/smartspinbox.h index 69788b9..474f46b 100644 --- a/GUI/Widgets/smartspinbox.h +++ b/GUI/Widgets/smartspinbox.h @@ -71,15 +71,15 @@ class CurrentSpinBox : public SmartSpinBox Q_OBJECT public: explicit CurrentSpinBox(double step_, QWidget *parent = nullptr); - void setTrueMinimum(double min); + void setTrueMinimum(double min) override; public slots: - void loadValue(double val); - void roundValue(); + void loadValue(double val) override; + void roundValue() override; private slots: - void scaleUnits(double val); - void sendSignalValueMicro(double val); + void scaleUnits(double val) override; + void sendSignalValueMicro(double val) override; }; @@ -88,15 +88,15 @@ class TimeSpinBox : public SmartSpinBox Q_OBJECT public: explicit TimeSpinBox(double step_, QWidget *parent = nullptr); - void setTrueMinimum(double min); + void setTrueMinimum(double min) override; public slots: - void loadValue(double val); - void roundValue(); + void loadValue(double val) override; + void roundValue() override; private slots: - void scaleUnits(double val); - void sendSignalValueMicro(double val); + void scaleUnits(double val) override; + void sendSignalValueMicro(double val) override; }; #endif // SMARTSPINBOX_H diff --git a/GUI/Widgets/testcontrolpanel.cpp b/GUI/Widgets/testcontrolpanel.cpp index 63caeeb..06c64e1 100644 --- a/GUI/Widgets/testcontrolpanel.cpp +++ b/GUI/Widgets/testcontrolpanel.cpp @@ -91,12 +91,12 @@ TestControlPanel::TestControlPanel(ControllerInterface *controllerInterface_, Ab rhxController(rhxController_), multiColumnDisplay(multiColumnDisplay_), stimParametersInterface(stimParametersInterface_), - reportPresent(false), helpDialogCheckInputWave(nullptr), helpDialogTestChip(nullptr), helpDialogUploadTestStimParameters(nullptr), - previousDelay(-1), - portComboBox(nullptr) + reportPresent(false), + portComboBox(nullptr), + previousDelay(-1) { setFocusPolicy(Qt::StrongFocus); this->setFocus(); @@ -2385,7 +2385,7 @@ void TestControlPanel::validateFastSettleChannels(QVector > &fas int TestControlPanel::amoeba(QVector &t, QVector &ytarget, QVector > &p, QVector &y, int ndim, double ftol) { int i, ihi, ilo, inhi, j, mpts = ndim + 1; - double rtol, sum, swap, ysave, ytry; + double rtol, sum; QVector psum; psum.resize(ndim); @@ -2718,7 +2718,7 @@ double TestControlPanel::vectorAvg(QVector vect, int start, int end) ReportDialog::ReportDialog(QWidget *parent) { - + Q_UNUSED(parent); } void ReportDialog::keyPressEvent(QKeyEvent *event) diff --git a/GUI/Widgets/waveformdisplaymanager.cpp b/GUI/Widgets/waveformdisplaymanager.cpp index 9004580..1e0ae49 100644 --- a/GUI/Widgets/waveformdisplaymanager.cpp +++ b/GUI/Widgets/waveformdisplaymanager.cpp @@ -32,12 +32,12 @@ #include "waveformdisplaymanager.h" WaveformDisplayManager::WaveformDisplayManager(SystemState* state_, int maxWidthInPixels_, int numRefreshZones_) : - state(state_), - needsFullReset(true), needsFullRedraw(true), + needsFullReset(true), + numColumns(0), + state(state_), finishedRedraws(0), finishedResets(0), - numColumns(0), maxWidthInPixels(maxWidthInPixels_), numRefreshZones(numRefreshZones_) { diff --git a/GUI/Windows/controlwindow.cpp b/GUI/Windows/controlwindow.cpp index 7d77c18..16b5575 100644 --- a/GUI/Windows/controlwindow.cpp +++ b/GUI/Windows/controlwindow.cpp @@ -44,6 +44,7 @@ using namespace std; ControlWindow::ControlWindow(SystemState* state_, CommandParser* parser_, ControllerInterface* controllerInterface_, AbstractRHXController* rhxController_) : QMainWindow(nullptr), // Since the parent isn't a QMainWindow but a QDialog, just pass a nullptr + stimParametersInterface(nullptr), state(state_), controllerInterface(controllerInterface_), rhxController(rhxController_), @@ -76,8 +77,8 @@ ControlWindow::ControlWindow(SystemState* state_, CommandParser* parser_, Contro rewindAction(nullptr), fastForwardAction(nullptr), fastPlaybackAction(nullptr), - jumpToStartAction(nullptr), jumpToEndAction(nullptr), + jumpToStartAction(nullptr), jumpBack1SecAction(nullptr), jumpBack10SecAction(nullptr), jumpAction(nullptr), @@ -139,7 +140,6 @@ ControlWindow::ControlWindow(SystemState* state_, CommandParser* parser_, Contro tcpDisplay(nullptr), showHideRow(nullptr), showHideStretch(nullptr), - stimParametersInterface(nullptr), stimClipboard(nullptr), currentlyRunning(false), currentlyRecording(false), @@ -1534,8 +1534,8 @@ void ControlWindow::keyPressEvent(QKeyEvent *event) if (!state->running) { ((TestControlPanel*) controlPanel)->testChip(); } - break; } + break; case Qt::Key_V: if (state->testMode->getValue()) { if (!state->running) { diff --git a/GUI/Windows/probemapwindow.cpp b/GUI/Windows/probemapwindow.cpp index d14b6e7..85388eb 100644 --- a/GUI/Windows/probemapwindow.cpp +++ b/GUI/Windows/probemapwindow.cpp @@ -72,11 +72,11 @@ ProbeMapWindow::ProbeMapWindow(SystemState* state_, ControllerInterface* control bestFitAction->setShortcuts(bestFitShortcuts); zoomInAction = new QAction(QIcon(":/images/zoomin.png"), "Zoom in. Shortcut: 'MouseWheelUp' or 'Shift+UpArrow' or 'Ctrl+UpArrow' or '+'", this); - QList zoomInShortcuts = QList() << Qt::Key_Plus << Qt::Key_Equal << (Qt::SHIFT + Qt::Key_Up) << (Qt::CTRL + Qt::Key_Up); + QList zoomInShortcuts = QList() << Qt::Key_Plus << Qt::Key_Equal << (Qt::SHIFT | Qt::Key_Up) << (Qt::CTRL | Qt::Key_Up); zoomInAction->setShortcuts(zoomInShortcuts); zoomOutAction = new QAction(QIcon(":/images/zoomout.png"), "Zoom out. Shortcut: 'MouseWheelDown' or 'Shift+DownArrow' or 'Ctrl+DownArrow' or '-'", this); - QList zoomOutShortcuts = QList() << Qt::Key_Minus << Qt::Key_Underscore << (Qt::SHIFT + Qt::Key_Down) << (Qt::CTRL + Qt::Key_Down); + QList zoomOutShortcuts = QList() << Qt::Key_Minus << Qt::Key_Underscore << (Qt::SHIFT | Qt::Key_Down) << (Qt::CTRL | Qt::Key_Down); zoomOutAction->setShortcuts(zoomOutShortcuts); scrollUpAction = new QAction(QIcon(":/images/uparrow.png"), "Scroll up. Shortcut: 'Shift+MouseWheelUp' or 'UpArrow' or 'PageUp'", this); diff --git a/IntanRHX.pro b/IntanRHX.pro index b323dd3..93373a5 100644 --- a/IntanRHX.pro +++ b/IntanRHX.pro @@ -4,6 +4,8 @@ # #------------------------------------------------- +CONFIG += c++17 + QT += core gui xml multimedia network widgets TARGET = IntanRHX @@ -267,25 +269,41 @@ DISTFILES += kernel.cl INCLUDEPATH += $$PWD/includes/ +unix { + # Catch common issues on Linux/MacOS + QMAKE_CXXFLAGS += -Werror=empty-body \ + -Werror=pointer-arith \ + -Werror=missing-declarations \ + -Werror=return-type \ + -Werror=misleading-indentation \ + -Werror=format-security \ + -Werror=suggest-override \ + -Werror=implicit-fallthrough \ + -Werror=reorder + + # Ignore some overly pedantic warnings + QMAKE_CXXFLAGS += -Wno-unused-parameter +} + # Windows win32: { -LIBS += -L$$PWD/libraries/Windows/ -lOpenCL # OpenCL library -LIBS += -L$$PWD/libraries/Windows/ -lokFrontPanel # Opal Kelly Front Panel library -LIBS += -L$$PWD/libraries/Windows/ -ldelayimp # Microsoft's Delay Import library -QMAKE_LFLAGS += /DELAYLOAD:okFrontPanel.dll # Use delayimp to only load okFrontPanel.dll when necessary, - # so we can give an error message when okFrontPanel.dll is missing + LIBS += -L$$PWD/libraries/Windows/ -lOpenCL # OpenCL library + LIBS += -L$$PWD/libraries/Windows/ -lokFrontPanel # Opal Kelly Front Panel library + LIBS += -L$$PWD/libraries/Windows/ -ldelayimp # Microsoft's Delay Import library + QMAKE_LFLAGS += /DELAYLOAD:okFrontPanel.dll # Use delayimp to only load okFrontPanel.dll when necessary, + # so we can give an error message when okFrontPanel.dll is missing } # Mac mac: { -LIBS += -framework OpenCL # Mac OS X built-in OpenCL library -LIBS += -L$$PWD/libraries/Mac/ -lokFrontPanel # Opal Kelly Front Panel library + LIBS += -framework OpenCL # Mac OS X built-in OpenCL library + LIBS += -L$$PWD/libraries/Mac/ -lokFrontPanel # Opal Kelly Front Panel library } # Linux unix:!macx: { -LIBS += -L$$PWD/libraries/Linux/ -lOpenCL # OpenCL library -LIBS += -L$$PWD/libraries/Linux/ -lokFrontPanel # Opal Kelly Front Panel library -QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN\'' # Flag that at runtime, look for shared libraries (like - # libokFrontPanel.so) at the same directory as the binary + LIBS += -L$$PWD/libraries/Linux/ -lOpenCL # OpenCL library + LIBS += -L$$PWD/libraries/Linux/ -lokFrontPanel # Opal Kelly Front Panel library + QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN\'' # Flag that at runtime, look for shared libraries (like + # libokFrontPanel.so) at the same directory as the binary }