changed Display class to BPMDisplay to resolve qt conflict

This commit is contained in:
Blake Leverington 2023-09-16 14:48:46 +02:00
parent 7b63d9d661
commit 99ed8f54d6
7 changed files with 27 additions and 27 deletions

View File

@ -99,7 +99,7 @@
<item row="0" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Display</string>
<string>BPMDisplay</string>
</property>
</widget>
</item>

View File

@ -4,7 +4,7 @@
#include <QFileDialog>
#include <QCheckBox>
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<unsigned short> &data)
void BPMDisplay::plot(const QVector<unsigned short> &data)
{
//resize data vectors and fill X values - only if needed
if (data.length() != nrPoints)
@ -138,18 +138,18 @@ void Display::plot(const QVector<unsigned short> &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);

View File

@ -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<unsigned short> &data);

View File

@ -17,7 +17,7 @@
</sizepolicy>
</property>
<property name="windowTitle">
<string>Online Display</string>
<string>Online BPMDisplay</string>
</property>
<widget class="QWidget" name="verticalLayoutWidget">
<property name="geometry">

View File

@ -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);

View File

@ -38,7 +38,7 @@ protected:
int active = 0;
HW* theHW;
QVector<PlaneConfig*> planeConfig;
QVector<Display*> displays;
QVector<BPMDisplay*> displays;
PlaneConfig *findPlane(int plane_nr);
};

Binary file not shown.