2023-04-24 17:37:03 -04:00
|
|
|
#ifndef DigiSettings_H
|
|
|
|
#define DigiSettings_H
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QTabWidget>
|
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QGridLayout>
|
2023-04-25 17:04:46 -04:00
|
|
|
#include <QCheckBox>
|
|
|
|
#include <QGroupBox>
|
|
|
|
#include <QPushButton>
|
2023-04-24 17:37:03 -04:00
|
|
|
|
|
|
|
#include "macro.h"
|
|
|
|
#include "ClassDigitizer.h"
|
|
|
|
#include "CustomWidgets.h"
|
|
|
|
|
|
|
|
class DigiSettingsPanel : public QMainWindow{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QMainWindow * parent = nullptr);
|
|
|
|
~DigiSettingsPanel();
|
|
|
|
|
|
|
|
private slots:
|
2023-04-25 17:04:46 -04:00
|
|
|
void UpdatePanelFromMemory();
|
|
|
|
void ReadSettingsFromBoard();
|
|
|
|
|
2023-04-24 17:37:03 -04:00
|
|
|
signals:
|
|
|
|
void SendLogMsg(const QString &msg);
|
|
|
|
|
2023-04-25 17:04:46 -04:00
|
|
|
|
2023-04-24 17:37:03 -04:00
|
|
|
private:
|
|
|
|
|
2023-04-25 17:04:46 -04:00
|
|
|
void SetUpInfo(QString label, std::string value, QGridLayout *gLayout, int row, int col);
|
2023-05-01 16:20:16 -04:00
|
|
|
void SetUpCheckBox(QCheckBox * &chkBox, QString label, QGridLayout *gLayout, int row, int col, Reg para, std::pair<unsigned short, unsigned short> bit);
|
|
|
|
void SetUpComboBoxBit(RComboBox * &cb, QString label, QGridLayout *gLayout, int row, int col, std::vector<std::pair<std::string, unsigned int>> items, Reg para, std::pair<unsigned short, unsigned short> bit, int colspan = 1);
|
|
|
|
void SetUpComboBox(RComboBox * &cb, QString label, QGridLayout *gLayout, int row, int col, Reg para);
|
|
|
|
void SetUpSpinBox(RSpinBox * &sb, QString label, QGridLayout *gLayout, int row, int col, Reg para);
|
2023-04-25 17:04:46 -04:00
|
|
|
|
|
|
|
void CleanUpGroupBox(QGroupBox * & gBox);
|
2023-05-01 18:29:36 -04:00
|
|
|
void SetUpGlobalTriggerMaskAndFrontPanelMask(QGridLayout * & gLayout);
|
|
|
|
|
2023-04-25 17:04:46 -04:00
|
|
|
void SetUpPHABoard();
|
2023-04-28 18:18:34 -04:00
|
|
|
void SetUpPHAChannel();
|
|
|
|
|
2023-04-25 17:04:46 -04:00
|
|
|
void SetUpPSDBoard();
|
2023-04-24 17:37:03 -04:00
|
|
|
|
2023-04-28 18:18:34 -04:00
|
|
|
|
2023-05-01 16:20:16 -04:00
|
|
|
|
|
|
|
void UpdatePHASetting();
|
|
|
|
|
|
|
|
|
2023-04-24 17:37:03 -04:00
|
|
|
Digitizer ** digi;
|
|
|
|
unsigned int nDigi;
|
2023-04-25 17:04:46 -04:00
|
|
|
unsigned short ID;
|
2023-04-24 17:37:03 -04:00
|
|
|
|
|
|
|
bool enableSignalSlot;
|
|
|
|
|
|
|
|
QTabWidget * tabWidget;
|
|
|
|
|
2023-04-25 17:04:46 -04:00
|
|
|
QGroupBox * infoBox[MaxNDigitizer];
|
|
|
|
QGridLayout * infoLayout[MaxNDigitizer];
|
|
|
|
|
2023-04-28 18:18:12 -04:00
|
|
|
QLineEdit * leSaveFilePath;
|
|
|
|
|
2023-04-25 17:04:46 -04:00
|
|
|
QPushButton * bnRefreshSetting; // read setting from board
|
2023-04-26 16:39:54 -04:00
|
|
|
QPushButton * bnProgramPreDefined;
|
|
|
|
QPushButton * bnClearBuffer;
|
|
|
|
|
|
|
|
QPushButton * bnSendSoftwareTriggerSignal;
|
|
|
|
QPushButton * bnSendSoftwareClockSyncSignal;
|
|
|
|
QPushButton * bnSaveSettings;
|
|
|
|
QPushButton * bnLoadSettings;
|
|
|
|
|
2023-04-28 18:18:12 -04:00
|
|
|
/// ============================= Board Configure
|
2023-05-01 18:29:36 -04:00
|
|
|
// QGroupBox * boardSettingBox[MaxNDigitizer];
|
|
|
|
QGridLayout * bdCfgLayout[MaxNDigitizer];
|
|
|
|
QGridLayout * bdACQLayout[MaxNDigitizer];
|
|
|
|
QGridLayout * bdGlbTRGOUTLayout[MaxNDigitizer];
|
|
|
|
QGridLayout * bdTriggerLayout[MaxNDigitizer];
|
|
|
|
QGridLayout * bdLVDSLayout[MaxNDigitizer];
|
2023-04-25 17:04:46 -04:00
|
|
|
|
|
|
|
QCheckBox * chkAutoDataFlush[MaxNDigitizer];
|
|
|
|
QCheckBox * chkDecimateTrace[MaxNDigitizer];
|
|
|
|
QCheckBox * chkTrigPropagation[MaxNDigitizer];
|
|
|
|
QCheckBox * chkDualTrace[MaxNDigitizer];
|
|
|
|
QCheckBox * chkTraceRecording[MaxNDigitizer];
|
|
|
|
QCheckBox * chkEnableExtra2[MaxNDigitizer];
|
|
|
|
|
|
|
|
RComboBox * cbAnaProbe1[MaxNDigitizer];
|
|
|
|
RComboBox * cbAnaProbe2[MaxNDigitizer];
|
|
|
|
RComboBox * cbDigiProbe1[MaxNDigitizer];
|
|
|
|
RComboBox * cbDigiProbe2[MaxNDigitizer];
|
|
|
|
|
2023-04-26 16:39:54 -04:00
|
|
|
QPushButton * bnChEnableMask[MaxNDigitizer][MaxNChannels];
|
2023-04-25 17:04:46 -04:00
|
|
|
RComboBox * cbAggOrg[MaxNDigitizer];
|
2023-04-26 16:39:54 -04:00
|
|
|
RSpinBox * sbAggNum[MaxNDigitizer];
|
|
|
|
QCheckBox * chkEnableExternalTrigger[MaxNDigitizer];
|
|
|
|
RSpinBox * sbRunDelay[MaxNDigitizer];
|
|
|
|
RComboBox * cbAnalogMonitorMode[MaxNDigitizer];
|
|
|
|
RSpinBox * sbBufferGain[MaxNDigitizer];
|
2023-05-01 18:29:36 -04:00
|
|
|
RSpinBox * sbVoltageLevel[MaxNDigitizer];
|
2023-04-26 16:39:54 -04:00
|
|
|
|
|
|
|
RComboBox * cbStartStopMode[MaxNDigitizer];
|
|
|
|
RComboBox * cbAcqStartArm[MaxNDigitizer];
|
|
|
|
RComboBox * cbPLLRefClock[MaxNDigitizer];
|
|
|
|
|
2023-04-28 18:18:12 -04:00
|
|
|
RComboBox * cbLEMOMode[MaxNDigitizer];
|
|
|
|
RComboBox * cbTRGOUTMode[MaxNDigitizer];
|
|
|
|
|
2023-05-01 18:29:36 -04:00
|
|
|
RComboBox * cbTRGINMode[MaxNDigitizer];
|
|
|
|
RComboBox * cbTRINMezzanines[MaxNDigitizer];
|
|
|
|
|
2023-04-28 18:18:12 -04:00
|
|
|
/// ============================= board Status
|
2023-04-26 16:39:54 -04:00
|
|
|
QPushButton * bnACQStatus[MaxNDigitizer][9];
|
|
|
|
QPushButton * bnBdFailStatus[MaxNDigitizer][3];
|
|
|
|
QPushButton * bnReadOutStatus[MaxNDigitizer][3];
|
2023-04-25 17:04:46 -04:00
|
|
|
|
2023-04-28 18:18:12 -04:00
|
|
|
/// ============================= Trigger Configure
|
|
|
|
QPushButton * bnGlobalTriggerMask[MaxNDigitizer][MaxNChannels/2];
|
|
|
|
RSpinBox * sbGlbMajCoinWin[MaxNDigitizer];
|
|
|
|
RSpinBox * sbGlbMajLvl[MaxNDigitizer];
|
|
|
|
RComboBox * cbGlbUseOtherTriggers[MaxNDigitizer]; // combine bit 30, 31
|
|
|
|
|
|
|
|
QPushButton * bnTRGOUTMask[MaxNDigitizer][MaxNChannels/2];
|
|
|
|
RSpinBox * sbTRGOUTMajLvl[MaxNDigitizer];
|
|
|
|
RComboBox * cbTRGOUTLogic[MaxNDigitizer];
|
|
|
|
RComboBox * cbTRGOUTUseOtherTriggers[MaxNDigitizer]; // combine bit 30, 31
|
|
|
|
|
2023-04-28 18:18:34 -04:00
|
|
|
/// ============================ Channel
|
|
|
|
QWidget * chAllSetting;
|
2023-05-01 18:29:36 -04:00
|
|
|
QWidget * chStatus;
|
|
|
|
QWidget * chInput;
|
|
|
|
QWidget * chTrap;
|
|
|
|
QWidget * chOthers;
|
2023-04-25 17:04:46 -04:00
|
|
|
|
2023-05-01 16:20:16 -04:00
|
|
|
//---------- PHA
|
|
|
|
RSpinBox * sbRecordLength[MaxNChannels + 1];
|
|
|
|
RComboBox * cbDynamicRange[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbPreTrigger[MaxNChannels + 1];
|
|
|
|
RComboBox * cbRCCR2Smoothing[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbInputRiseTime[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbThreshold[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbRiseTimeValidWin[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbTriggerHoldOff[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbShapedTrigWidth[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbDCOffset[MaxNChannels + 1];
|
|
|
|
RComboBox * cbPolarity[MaxNChannels + 1];
|
|
|
|
|
|
|
|
RSpinBox * sbTrapRiseTime[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbTrapFlatTop[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbDecay[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbTrapScaling[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbPeaking[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbPeakingHoldOff[MaxNChannels + 1];
|
|
|
|
RComboBox * cbPeakAvg[MaxNChannels + 1];
|
|
|
|
RComboBox * cBaseLineAvg[MaxNChannels + 1];
|
|
|
|
QCheckBox * chkActiveBaseline[MaxNChannels + 1];
|
|
|
|
QCheckBox * chkBaselineRestore[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbFineGain[MaxNChannels + 1];
|
|
|
|
|
|
|
|
QCheckBox * chkDisableSelfTrigger[MaxNChannels + 1];
|
|
|
|
QCheckBox * chkEnableRollOver[MaxNChannels + 1];
|
|
|
|
QCheckBox * chkEnablePileUp[MaxNChannels + 1];
|
|
|
|
QCheckBox * chkTagCorrelation[MaxNChannels + 1];
|
|
|
|
RComboBox * cbDecimateTrace[MaxNChannels + 1];
|
|
|
|
RComboBox * cbDecimateGain[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbNumEventAgg[MaxNChannels + 1];
|
|
|
|
RComboBox * cbTriggerValid[MaxNChannels + 1];
|
|
|
|
RComboBox * cbTrigCount[MaxNChannels + 1];
|
|
|
|
RComboBox * cbTrigMode[MaxNChannels + 1];
|
|
|
|
RComboBox * cbShapedTrigger[MaxNChannels + 1];
|
|
|
|
RComboBox * cbExtra2Option[MaxNChannels + 1];
|
|
|
|
RComboBox * cbVetoSource[MaxNChannels + 1];
|
|
|
|
RSpinBox * sbVetoWidth[MaxNChannels + 1];
|
|
|
|
RComboBox * cbVetoStep[MaxNChannels + 1];
|
|
|
|
|
|
|
|
|
2023-04-28 18:18:12 -04:00
|
|
|
//QPushButton * bnTriggerValidMask[MaxNDigitizer][MaxNChannels/2];
|
2023-04-24 17:37:03 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|