FSUDAQ_Qt6/DigiSettingsPanel.h

253 lines
10 KiB
C
Raw Normal View History

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, QString rawDataPath, QMainWindow * parent = nullptr);
2023-04-24 17:37:03 -04:00
~DigiSettingsPanel();
private slots:
2023-04-25 17:04:46 -04:00
void UpdatePanelFromMemory();
void ReadSettingsFromBoard();
void SaveSetting(int opt);
void LoadSetting();
2023-04-24 17:37:03 -04:00
signals:
void SendLogMsg(const QString &msg);
private:
2023-04-25 17:04:46 -04:00
void SetUpInfo(QString label, std::string value, QGridLayout *gLayout, int row, int col);
2023-05-09 12:16:08 -04:00
void SetUpCheckBox(QCheckBox * &chkBox, QString label, QGridLayout *gLayout, int row, int col, Reg para, std::pair<unsigned short, unsigned short> bit, int ch = -1, int colSpan = 1);
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, int ch = -1);
void SetUpComboBox(RComboBox * &cb, QString label, QGridLayout *gLayout, int row, int col, Reg para, int ch = -1);
void SetUpSpinBox(RSpinBox * &sb, QString label, QGridLayout *gLayout, int row, int col, Reg para, int ch = -1);
2023-04-25 17:04:46 -04:00
void CleanUpGroupBox(QGroupBox * & gBox);
2023-05-09 12:16:08 -04:00
void SetUpChannelMask();
void SetUpACQReadOutTab();
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-05-09 12:16:08 -04:00
void SetUpPSDChannel();
2023-04-24 17:37:03 -04:00
void UpdateSpinBox(RSpinBox * &sb, Reg para, int ch);
void UpdateComboBox(RComboBox * &cb, Reg para, int ch);
void UpdateComboBoxBit(RComboBox * &cb, uint32_t fullBit, std::pair<unsigned short, unsigned short> bit);
2023-05-05 18:18:09 -04:00
void SyncSpinBox(RSpinBox *(&spb)[][MaxNChannels+1]);
void SyncComboBox(RComboBox *(&cb)[][MaxNChannels+1]);
void SyncCheckBox(QCheckBox *(&chk)[][MaxNChannels+1]);
void SyncAllChannelsTab_PHA();
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
QString rawDataPath;
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];
QLineEdit * leSaveFilePath[MaxNDigitizer];
2023-04-28 18:18:12 -04:00
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;
QPushButton * bnSaveSettingsToText;
2023-04-26 16:39:54 -04:00
2023-04-28 18:18:12 -04:00
/// ============================= Board Configure
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];
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];
RComboBox * cbTRGINMode[MaxNDigitizer];
RComboBox * cbTRINMezzanines[MaxNDigitizer];
RSpinBox * sbVMEInterruptLevel[MaxNDigitizer];
QCheckBox * chkEnableOpticalInterrupt[MaxNDigitizer];
QCheckBox * chkEnableVMEReadoutStatus[MaxNDigitizer];
QCheckBox * chkEnableVME64Aligment[MaxNDigitizer];
QCheckBox * chkEnableAddRelocation[MaxNDigitizer];
RComboBox * cbInterruptMode[MaxNDigitizer];
QCheckBox * chkEnableExtendedBlockTransfer[MaxNDigitizer];
/// ============================= trigger validation mask
RComboBox * cbMaskLogic[MaxNDigitizer][MaxNChannels/2];
RSpinBox * sbMaskMajorLevel[MaxNDigitizer][MaxNChannels/2];
QCheckBox * chkMaskExtTrigger[MaxNDigitizer][MaxNChannels/2];
QCheckBox * chkMaskSWTrigger[MaxNDigitizer][MaxNChannels/2];
QPushButton * bnTriggerMask[MaxNDigitizer][MaxNChannels/2][MaxNChannels/2];
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
/// ============================= Mask Configure
2023-04-28 18:18:12 -04:00
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
2023-05-09 12:16:08 -04:00
QTabWidget * chTab;
2023-04-25 17:04:46 -04:00
RComboBox * chSelection[MaxNDigitizer];
2023-05-09 12:16:08 -04:00
//----------- common for PHA and PSD
RSpinBox * sbRecordLength[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbDynamicRange[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbPreTrigger[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbThreshold[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbDCOffset[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbPolarity[MaxNDigitizer][MaxNChannels + 1];
2023-05-09 12:16:08 -04:00
RSpinBox * sbShapedTrigWidth[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbTriggerHoldOff[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbTrigMode[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbBaseLineAvg[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbNumEventAgg[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbVetoWidth[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbVetoStep[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbLocalShapedTrigger[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbLocalTriggerValid[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbExtra2Option[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbVetoSource[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkDisableSelfTrigger[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbTrigCount[MaxNDigitizer][MaxNChannels + 1];
//---------- PHA
RComboBox * cbRCCR2Smoothing[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbInputRiseTime[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbRiseTimeValidWin[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbTrapRiseTime[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbTrapFlatTop[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbDecay[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbTrapScaling[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbPeaking[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbPeakingHoldOff[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbPeakAvg[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkActiveBaseline[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkBaselineRestore[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbFineGain[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkEnableRollOver[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkEnablePileUp[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkTagCorrelation[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbDecimateTrace[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbDecimateGain[MaxNDigitizer][MaxNChannels + 1];
2023-05-09 12:16:08 -04:00
//---------------- PSD
RComboBox * cbChargeSensitivity[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkChargePedestal[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbTriggerOpt[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbDiscriMode[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkPileUpInGate[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkTestPule[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbTestPulseRate[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkBaseLineCal[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkDiscardQLong[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkRejPileUp[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkCutBelow[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkCutAbove[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkRejOverRange[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkDisableTriggerHysteresis[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkDisableOppositePulse[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbChargeZeroSupZero[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbShortGate[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbLongGate[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbGateOffset[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbFixedBaseline[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbTriggerLatency[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbPSDCutThreshold[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbPURGAPThreshold[MaxNDigitizer][MaxNChannels + 1];
RSpinBox * sbCFDDely[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbCFDFraction[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbCFDInterpolation[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbSmoothedChargeIntegration[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkMarkSaturation[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbAdditionLocalTrigValid[MaxNDigitizer][MaxNChannels + 1];
RComboBox * cbVetoMode[MaxNDigitizer][MaxNChannels + 1];
QCheckBox * chkResetTimestampByTRGIN[MaxNDigitizer][MaxNChannels + 1];
//---------------- channel status
QPushButton * bnChStatus[MaxNDigitizer][MaxNChannels][3];
QLineEdit * leADCTemp[MaxNDigitizer][MaxNChannels];
2023-04-24 17:37:03 -04:00
};
#endif