FSUDAQ_Qt6/Analyser.h

72 lines
1.6 KiB
C
Raw Normal View History

#ifndef ANALYZER_H
#define ANALYZER_H
2023-05-26 18:06:37 -04:00
#include <QMainWindow>
#include <QChart>
#include <QChartView>
#include <QLabel>
#include <QPushButton>
#include <QCheckBox>
#include <QLineEdit>
#include <QGridLayout>
#include <QGroupBox>
#include "macro.h"
#include "ClassDigitizer.h"
#include "CustomThreads.h"
#include "CustomWidgets.h"
#include "OnlineEventBuilder.h"
/**************************************
This class is for, obviously, Online analysis.
It provides essential event building, histograms, and filling.
This is the mother of all other derivative analysis class.
derivative class should define the SetUpCanvas() and UpdateHistogram();
***************************************/
#include "Histogram1D.h"
#include "Histogram2D.h"
2023-05-26 18:06:37 -04:00
//^==============================================
//^==============================================
class Analyzer : public QMainWindow{
2023-05-26 18:06:37 -04:00
Q_OBJECT
public:
Analyzer(Digitizer ** digi, unsigned int nDigi, QMainWindow * parent = nullptr);
virtual ~Analyzer();
2023-05-26 18:06:37 -04:00
virtual void SetUpCanvas();
2023-06-12 16:32:01 -04:00
OnlineEventBuilder * GetEventBuilder() {return oeb[digiID];}
2023-05-26 18:06:37 -04:00
public slots:
void StartThread();
void StopThread();
2023-06-12 16:32:01 -04:00
virtual void UpdateHistograms(); // where event-building, analysis, and ploting
2023-05-26 18:06:37 -04:00
private slots:
2023-06-12 16:32:01 -04:00
protected:
QGridLayout * layout;
void BuildEvents();
void SetDigiID(int ID) { digiID = ID;}
void SetUpdateTimeInSec(double sec = 1.0) {waitTimeinSec = sec; buildTimerThread->SetWaitTimeinSec(waitTimeinSec);}
2023-05-26 18:06:37 -04:00
2023-06-12 16:32:01 -04:00
private:
2023-05-26 18:06:37 -04:00
Digitizer ** digi;
unsigned short nDigi;
2023-06-12 16:32:01 -04:00
int digiID; // the digi that will event
double waitTimeinSec;
2023-05-26 18:06:37 -04:00
OnlineEventBuilder ** oeb;
TimingThread * buildTimerThread;
};
#endif