diff --git a/hit2023v2/dialoglogsettings.ui b/hit2023v2/dialoglogsettings.ui index 568c05f..29a09fc 100644 --- a/hit2023v2/dialoglogsettings.ui +++ b/hit2023v2/dialoglogsettings.ui @@ -99,7 +99,7 @@ - Display + BPMDisplay diff --git a/hit2023v2/display.cpp b/hit2023v2/display.cpp index e871eac..fc38aa5 100644 --- a/hit2023v2/display.cpp +++ b/hit2023v2/display.cpp @@ -4,7 +4,7 @@ #include #include -Display::Display(QWidget *parent) : +BPMDisplay::BPMDisplay(QWidget *parent) : QDialog(parent), ui(new Ui::display) { @@ -27,12 +27,12 @@ Display::Display(QWidget *parent) : // Connect the buttonClicked signal of the button group connect(buttonGroup, SIGNAL(buttonClicked(QAbstractButton*)), this, SLOT(onButtonClicked(QAbstractButton*))); - connect(ui->pushButton_savebkg, &QPushButton::clicked, this, &Display::onSaveBackgroundClicked); - connect(ui->pushButton_loadbkg, &QPushButton::clicked, this, &Display::onLoadBackgroundClicked); - connect(ui->checkBox_subbkg, &QCheckBox::stateChanged, this, &Display::onCheckBoxStateChanged); - connect(ui->pushButton_savecalib, &QPushButton::clicked, this, &Display::onSaveCalibrationClicked); - connect(ui->pushButton_loadcalib, &QPushButton::clicked, this, &Display::onLoadCalibrationClicked); - connect(ui->checkBox_expertmode, &QCheckBox::stateChanged, this, &Display::onExpertModeStateChanged); + connect(ui->pushButton_savebkg, &QPushButton::clicked, this, &BPMDisplay::onSaveBackgroundClicked); + connect(ui->pushButton_loadbkg, &QPushButton::clicked, this, &BPMDisplay::onLoadBackgroundClicked); + connect(ui->checkBox_subbkg, &QCheckBox::stateChanged, this, &BPMDisplay::onCheckBoxStateChanged); + connect(ui->pushButton_savecalib, &QPushButton::clicked, this, &BPMDisplay::onSaveCalibrationClicked); + connect(ui->pushButton_loadcalib, &QPushButton::clicked, this, &BPMDisplay::onLoadCalibrationClicked); + connect(ui->checkBox_expertmode, &QCheckBox::stateChanged, this, &BPMDisplay::onExpertModeStateChanged); // Enable or disable the "Save Background" and "Save Calib" buttons accordingly ui->pushButton_savebkg->setEnabled(expertModeEnabled); @@ -45,12 +45,12 @@ Display::Display(QWidget *parent) : } -Display::~Display() +BPMDisplay::~BPMDisplay() { delete ui; } -void Display::showEvent(QShowEvent * event) +void BPMDisplay::showEvent(QShowEvent * event) { if (!event->spontaneous()) { @@ -62,7 +62,7 @@ void Display::showEvent(QShowEvent * event) //*********************************************** -void Display::plot(const QVector &data) +void BPMDisplay::plot(const QVector &data) { //resize data vectors and fill X values - only if needed if (data.length() != nrPoints) @@ -138,18 +138,18 @@ void Display::plot(const QVector &data) ui->plot->replot(); } -void Display::plot() +void BPMDisplay::plot() { plot(buffer); } -void Display::setTitle(QString title) +void BPMDisplay::setTitle(QString title) { ui->lineTitle->setText(title); } // Slot to handle button clicks -void Display::onButtonClicked(QAbstractButton *button) +void BPMDisplay::onButtonClicked(QAbstractButton *button) { // Handle button clicks here if (button == radioButtonFixedScale) @@ -170,7 +170,7 @@ void Display::onButtonClicked(QAbstractButton *button) } } -void Display::onSaveBackgroundClicked() +void BPMDisplay::onSaveBackgroundClicked() { // Check if there is data to save if (buffer.isEmpty()) { @@ -208,7 +208,7 @@ void Display::onSaveBackgroundClicked() } } -void Display::onLoadBackgroundClicked() +void BPMDisplay::onLoadBackgroundClicked() { // Get the plane's name (you might need to adjust how you retrieve it) QString planeName = ui->lineTitle->text(); @@ -246,13 +246,13 @@ void Display::onLoadBackgroundClicked() } } -void Display::onCheckBoxStateChanged(int state) +void BPMDisplay::onCheckBoxStateChanged(int state) { // The state argument will be Qt::Unchecked (0) or Qt::Checked (2) subtractBackground = (state == Qt::Checked); } -void Display::onSaveCalibrationClicked() +void BPMDisplay::onSaveCalibrationClicked() { // Check if there is data to save @@ -291,7 +291,7 @@ void Display::onSaveCalibrationClicked() } } -void Display::onLoadCalibrationClicked() +void BPMDisplay::onLoadCalibrationClicked() { // Get the plane's name (you might need to adjust how you retrieve it) QString planeName = ui->lineTitle->text(); @@ -361,14 +361,14 @@ void Display::onLoadCalibrationClicked() } } -void Display::onCalibrationCheckBoxChanged(int state) { +void BPMDisplay::onCalibrationCheckBoxChanged(int state) { // Check the state and update the subtractCalibration flag accordingly applyCalibration = (state == Qt::Checked); } // Slot to handle the state change of the "Expert Mode" checkbox -void Display::onExpertModeStateChanged(int state) +void BPMDisplay::onExpertModeStateChanged(int state) { // Check if the checkbox is checked (Expert Mode enabled) expertModeEnabled = (state == Qt::Checked); diff --git a/hit2023v2/display.h b/hit2023v2/display.h index 68548f8..c34f4a2 100644 --- a/hit2023v2/display.h +++ b/hit2023v2/display.h @@ -13,13 +13,13 @@ namespace Ui { class display; } -class Display : public QDialog +class BPMDisplay : public QDialog { Q_OBJECT public: - explicit Display(QWidget *parent = 0); - ~Display(); + explicit BPMDisplay(QWidget *parent = 0); + ~BPMDisplay(); void plot(const QVector &data); diff --git a/hit2023v2/display.ui b/hit2023v2/display.ui index b0e7302..4c7a43d 100644 --- a/hit2023v2/display.ui +++ b/hit2023v2/display.ui @@ -17,7 +17,7 @@ - Online Display + Online BPMDisplay diff --git a/hit2023v2/displayserver.cpp b/hit2023v2/displayserver.cpp index 7948b17..2d5f9a2 100644 --- a/hit2023v2/displayserver.cpp +++ b/hit2023v2/displayserver.cpp @@ -66,7 +66,7 @@ void DisplayServer::show() displays.clear(); for (int plane = 0; plane < planeConfig.length(); plane++) { - Display* newDisplay = new Display; + BPMDisplay* newDisplay = new BPMDisplay; newDisplay->setTitle(planeConfig[plane]->name); newDisplay->show(); displays.append(newDisplay); diff --git a/hit2023v2/displayserver.h b/hit2023v2/displayserver.h index 41091b1..68d7a98 100644 --- a/hit2023v2/displayserver.h +++ b/hit2023v2/displayserver.h @@ -38,7 +38,7 @@ protected: int active = 0; HW* theHW; QVector planeConfig; - QVector displays; + QVector displays; PlaneConfig *findPlane(int plane_nr); }; diff --git a/hit2023v2/release/hit2023v2.exe b/hit2023v2/release/hit2023v2.exe index 837f400..1b7a495 100644 Binary files a/hit2023v2/release/hit2023v2.exe and b/hit2023v2/release/hit2023v2.exe differ