2023-06-02 15:41:26 -04:00
|
|
|
#ifndef SINGLE_SPECTR_H
|
|
|
|
#define SINGLE_SPECTR_H
|
2023-05-17 17:40:32 -04:00
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QChart>
|
|
|
|
#include <QChartView>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QGridLayout>
|
|
|
|
#include <QGroupBox>
|
2024-04-05 22:33:05 -04:00
|
|
|
#include <QVector>
|
|
|
|
#include <QRandomGenerator>
|
2023-05-17 17:40:32 -04:00
|
|
|
|
|
|
|
#include "macro.h"
|
|
|
|
#include "ClassDigitizer.h"
|
|
|
|
#include "CustomThreads.h"
|
|
|
|
#include "CustomWidgets.h"
|
2023-06-02 18:13:47 -04:00
|
|
|
#include "Histogram1D.h"
|
2023-11-06 17:46:43 -05:00
|
|
|
#include "Histogram2D.h"
|
2023-05-17 17:40:32 -04:00
|
|
|
|
|
|
|
|
|
|
|
//^====================================================
|
|
|
|
//^====================================================
|
2023-06-02 15:41:26 -04:00
|
|
|
class SingleSpectra : public QMainWindow{
|
2023-05-17 17:40:32 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2023-06-02 15:41:26 -04:00
|
|
|
SingleSpectra(Digitizer ** digi, unsigned int nDigi, QString rawDataPath, QMainWindow * parent = nullptr);
|
|
|
|
~SingleSpectra();
|
|
|
|
|
2023-08-16 17:54:35 -04:00
|
|
|
void ClearInternalDataCount();
|
2023-06-02 15:41:26 -04:00
|
|
|
void SetFillHistograms(bool onOff) { fillHistograms = onOff;}
|
|
|
|
bool IsFillHistograms() const {return fillHistograms;}
|
|
|
|
|
|
|
|
void LoadSetting();
|
|
|
|
void SaveSetting();
|
2023-05-17 17:40:32 -04:00
|
|
|
|
2024-03-22 12:43:17 -04:00
|
|
|
void SetMaxFillTime(unsigned short milliSec) { maxFillTimeinMilliSec = milliSec;}
|
|
|
|
unsigned short GetMaxFillTime() const {return maxFillTimeinMilliSec;};
|
|
|
|
|
2024-04-05 22:33:05 -04:00
|
|
|
QVector<int> generateNonRepeatedCombination(int size);
|
|
|
|
|
2023-05-18 17:14:24 -04:00
|
|
|
public slots:
|
2023-06-02 15:41:26 -04:00
|
|
|
void FillHistograms();
|
2023-05-19 16:23:04 -04:00
|
|
|
void ChangeHistView();
|
2023-05-17 17:40:32 -04:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
Digitizer ** digi;
|
|
|
|
unsigned short nDigi;
|
|
|
|
|
2023-10-17 17:01:57 -04:00
|
|
|
Histogram1D * hist[MaxNDigitizer][MaxNChannels];
|
2023-11-06 17:46:43 -05:00
|
|
|
Histogram2D * hist2D[MaxNDigitizer];
|
|
|
|
|
|
|
|
bool histVisibility[MaxNDigitizer][MaxNChannels];
|
|
|
|
bool hist2DVisibility[MaxNDigitizer];
|
2023-05-19 16:23:04 -04:00
|
|
|
|
|
|
|
RComboBox * cbDivision;
|
|
|
|
|
|
|
|
RComboBox * cbDigi;
|
|
|
|
RComboBox * cbCh;
|
|
|
|
|
|
|
|
QGroupBox * histBox;
|
|
|
|
QGridLayout * histLayout;
|
|
|
|
int oldBd, oldCh;
|
2023-05-17 17:40:32 -04:00
|
|
|
|
2023-10-17 17:01:57 -04:00
|
|
|
int lastFilledIndex[MaxNDigitizer][MaxNChannels];
|
|
|
|
int loopFilledIndex[MaxNDigitizer][MaxNChannels];
|
2023-06-01 17:51:00 -04:00
|
|
|
|
2023-06-02 15:41:26 -04:00
|
|
|
bool fillHistograms;
|
|
|
|
|
2024-06-17 17:44:31 -04:00
|
|
|
QString settingPath;
|
2023-06-02 15:41:26 -04:00
|
|
|
|
2024-03-22 12:43:17 -04:00
|
|
|
unsigned short maxFillTimeinMilliSec;
|
2024-04-05 22:33:05 -04:00
|
|
|
unsigned short maxFillTimePerDigi;
|
2024-03-22 12:43:17 -04:00
|
|
|
|
2023-10-26 17:57:06 -04:00
|
|
|
bool isSignalSlotActive;
|
|
|
|
|
2023-05-17 17:40:32 -04:00
|
|
|
};
|
|
|
|
#endif
|