FSUDAQ_Qt6/Analyser.h

75 lines
1.7 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"
#include "MultiBuilder.h"
2023-05-26 18:06:37 -04:00
/**************************************
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();
MultiBuilder * GetEventBuilder() { return mb;}
void RedefineEventBuilder(std::vector<int> idList);
void SetBackwardBuild(bool TF) { isBuildBackward = TF;}
2023-06-12 16:32:01 -04:00
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 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
double waitTimeinSec;
MultiBuilder * mb;
bool isBuildBackward;
2023-05-26 18:06:37 -04:00
TimingThread * buildTimerThread;
};
#endif