2024-08-06 14:16:57 +02:00
# ifndef DIALOGDEVICES_H
2024-01-19 17:07:41 +01:00
# define DIALOGDEVICES_H
# include <QDialog>
# include <QSettings>
# include <QShowEvent>
2024-08-06 14:16:57 +02:00
# include <QVector> // Include QVector for calibration data storage
2024-08-07 15:40:32 +02:00
# include <QTableWidgetItem>
2024-01-19 17:07:41 +01:00
namespace Ui {
class DialogDevices ;
}
class DialogDevices : public QDialog
{
Q_OBJECT
public :
explicit DialogDevices ( QWidget * parent = 0 ) ;
~ DialogDevices ( ) ;
QSettings * deviceSettings = NULL ;
2024-08-06 15:06:06 +02:00
QVector < QVector < unsigned short > > getAllCalibrationFactors ( ) const ; // Declaration of the method
2024-01-19 17:07:41 +01:00
public slots :
void showEvent ( QShowEvent * event ) ;
void accept ( ) ;
protected :
int validateAndSave ( ) ;
2024-08-07 15:40:32 +02:00
bool loadCalibrationFactorsFromFile ( const QString & filePath , QVector < unsigned short > & calibrationFactors ) ; // Function to load calibration factors from a file
2024-08-06 14:16:57 +02:00
void applyCalibrationDataToDevice ( int dev_nr , const QVector < unsigned short > & data ) ; // Function to apply calibration data to a device
2024-01-19 17:07:41 +01:00
void importSettings ( ) ;
int last_nr_devices = - 1 ;
int initialized = 0 ;
2024-08-06 15:06:06 +02:00
QVector < QVector < unsigned short > > deviceCalibrationData ; // Storage for calibration data for each device
2024-01-19 17:07:41 +01:00
private slots :
void on_spinNrDevices_valueChanged ( int arg1 ) ;
2024-08-06 14:16:57 +02:00
void selectCalibrationFile ( int dev_nr ) ; // Slot for handling calibration file selection
2024-01-19 17:07:41 +01:00
private :
Ui : : DialogDevices * ui ;
2024-08-06 14:16:57 +02:00
2024-01-19 17:07:41 +01:00
} ;
# endif // DIALOGDEVICES_H