2023-04-18 13:12:05 -04:00
|
|
|
#ifndef SCOPE_H
|
|
|
|
#define SCOPE_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QChart>
|
|
|
|
#include <QChartView>
|
|
|
|
#include <QSpinBox>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QComboBox>
|
|
|
|
#include <QGridLayout>
|
2023-04-19 14:46:10 -04:00
|
|
|
#include <QGroupBox>
|
2023-04-18 13:12:05 -04:00
|
|
|
#include <QLineSeries>
|
|
|
|
#include <QRubberBand>
|
|
|
|
#include <QMouseEvent>
|
|
|
|
#include <QGestureEvent>
|
|
|
|
|
|
|
|
#include "macro.h"
|
|
|
|
#include "ClassDigitizer.h"
|
|
|
|
#include "CustomThreads.h"
|
|
|
|
#include "CustomWidgets.h"
|
|
|
|
|
|
|
|
//^====================================================
|
|
|
|
//^====================================================
|
|
|
|
class Scope : public QMainWindow{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
Scope(Digitizer ** digi, unsigned int nDigi, ReadDataThread ** readDataThread, QMainWindow * parent = nullptr);
|
|
|
|
~Scope();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void StartScope();
|
|
|
|
void StopScope();
|
2023-04-19 18:08:20 -04:00
|
|
|
void UpdateScope();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2023-04-18 13:12:05 -04:00
|
|
|
|
2023-04-19 14:46:10 -04:00
|
|
|
void SetUpComboBox(RComboBox * &cb, QString str, int row, int col, const Register::Reg para);
|
|
|
|
void SetUpSpinBox(RSpinBox * &sb, QString str, int row, int col, const Register::Reg para);
|
|
|
|
|
|
|
|
void CleanUpSettingsGroupBox();
|
|
|
|
void SetUpPHAPanel();
|
2023-04-19 18:08:20 -04:00
|
|
|
void SetUpPSDPanel();
|
2023-04-18 13:12:05 -04:00
|
|
|
|
|
|
|
Digitizer ** digi;
|
|
|
|
unsigned short nDigi;
|
2023-04-19 13:41:43 -04:00
|
|
|
unsigned short ID; // the id of digi, index of cbScopeDigi
|
|
|
|
int ch2ns;
|
2023-04-18 13:12:05 -04:00
|
|
|
|
|
|
|
ReadDataThread ** readDataThread;
|
2023-04-19 16:21:14 -04:00
|
|
|
TimingThread * updateTraceThread;
|
2023-04-18 13:12:05 -04:00
|
|
|
|
|
|
|
bool enableSignalSlot;
|
|
|
|
|
|
|
|
Trace * plot;
|
|
|
|
QLineSeries * dataTrace[MaxNumberOfTrace]; // 2 analog, 2 digi
|
|
|
|
|
|
|
|
RComboBox * cbScopeDigi;
|
|
|
|
RComboBox * cbScopeCh;
|
|
|
|
|
|
|
|
QPushButton * bnScopeStart;
|
|
|
|
QPushButton * bnScopeStop;
|
|
|
|
|
|
|
|
QLineEdit * leTriggerRate;
|
|
|
|
|
2023-04-19 14:46:10 -04:00
|
|
|
QGroupBox * settingGroup;
|
|
|
|
QGridLayout * settingLayout;
|
|
|
|
|
|
|
|
/// common to PSD and PHA
|
2023-04-19 13:41:43 -04:00
|
|
|
RSpinBox * sbReordLength;
|
2023-04-19 14:46:10 -04:00
|
|
|
RSpinBox * sbPreTrigger;
|
2023-04-19 13:41:43 -04:00
|
|
|
|
2023-04-19 14:46:10 -04:00
|
|
|
RSpinBox * sbDCOffset;
|
2023-04-19 13:41:43 -04:00
|
|
|
//RComboBox * cbDynamicRange;
|
|
|
|
|
2023-04-19 14:46:10 -04:00
|
|
|
/// PHA
|
|
|
|
RSpinBox * sbInputRiseTime;
|
|
|
|
RSpinBox * sbTriggerHoldOff;
|
|
|
|
RSpinBox * sbThreshold;
|
|
|
|
//RComboBox * cbSmoothingFactor;
|
|
|
|
|
|
|
|
RSpinBox * sbTrapRiseTime;
|
|
|
|
RSpinBox * sbTrapFlatTop;
|
|
|
|
RSpinBox * sbDecayTime;
|
|
|
|
RSpinBox * sbPeakingTime;
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-04-18 13:12:05 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|