FSUDAQ_Qt6/DigiSettingsPanel.h
2023-04-28 18:18:34 -04:00

124 lines
3.9 KiB
C++

#ifndef DigiSettings_H
#define DigiSettings_H
#include <QMainWindow>
#include <QTabWidget>
#include <QLineEdit>
#include <QGridLayout>
#include <QCheckBox>
#include <QGroupBox>
#include <QPushButton>
#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:
void UpdatePanelFromMemory();
void ReadSettingsFromBoard();
signals:
void SendLogMsg(const QString &msg);
private:
void SetUpInfo(QString label, std::string value, QGridLayout *gLayout, int row, int col);
void SetUpCheckBox(QCheckBox * &chkBox, QString label, QGridLayout *gLayout, int row, int col, Register::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, Register::Reg para, std::pair<unsigned short, unsigned short> bit);
void SetUpComboBox(RComboBox * &cb, QString label, QGridLayout *gLayout, int row, int col, Register::Reg para);
void SetUpSpinBox(RSpinBox * &sb, QString label, QGridLayout *gLayout, int row, int col, Register::Reg para);
void CleanUpGroupBox(QGroupBox * & gBox);
void SetUpPHABoard();
void SetUpPHAChannel();
void SetUpPSDBoard();
Digitizer ** digi;
unsigned int nDigi;
unsigned short ID;
bool enableSignalSlot;
QTabWidget * tabWidget;
QGroupBox * infoBox[MaxNDigitizer];
QGridLayout * infoLayout[MaxNDigitizer];
QLineEdit * leSaveFilePath;
QPushButton * bnRefreshSetting; // read setting from board
QPushButton * bnProgramPreDefined;
QPushButton * bnClearBuffer;
QPushButton * bnSendSoftwareTriggerSignal;
QPushButton * bnSendSoftwareClockSyncSignal;
QPushButton * bnSaveSettings;
QPushButton * bnLoadSettings;
/// ============================= Board Configure
QGroupBox * boardSettingBox[MaxNDigitizer];
QGridLayout * settingLayout[MaxNDigitizer];
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];
QPushButton * bnChEnableMask[MaxNDigitizer][MaxNChannels];
RComboBox * cbAggOrg[MaxNDigitizer];
RSpinBox * sbAggNum[MaxNDigitizer];
QCheckBox * chkEnableExternalTrigger[MaxNDigitizer];
RSpinBox * sbRunDelay[MaxNDigitizer];
RComboBox * cbAnalogMonitorMode[MaxNDigitizer];
RSpinBox * sbBufferGain[MaxNDigitizer];
RComboBox * cbStartStopMode[MaxNDigitizer];
RComboBox * cbAcqStartArm[MaxNDigitizer];
RComboBox * cbPLLRefClock[MaxNDigitizer];
RComboBox * cbLEMOMode[MaxNDigitizer];
RComboBox * cbTRGOUTMode[MaxNDigitizer];
/// ============================= board Status
QPushButton * bnACQStatus[MaxNDigitizer][9];
QPushButton * bnBdFailStatus[MaxNDigitizer][3];
QPushButton * bnReadOutStatus[MaxNDigitizer][3];
/// ============================= Trigger Configure
QGridLayout * triggerLayout[MaxNDigitizer];
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
/// ============================ Channel
QWidget * chAllSetting;
//QPushButton * bnTriggerValidMask[MaxNDigitizer][MaxNChannels/2];
};
#endif