From 9921fbdd344873e330c0d18a766aab3b8a081d2a Mon Sep 17 00:00:00 2001 From: splitPoleDAQ Date: Fri, 19 Jan 2024 14:40:59 -0500 Subject: [PATCH] DigiPlanel: change button send clock sync to AutoSet reading conf. --- ClassData.h | 13 ------------- ClassDigitizer.cpp | 6 +----- ClassDigitizer.h | 2 +- DigiSettingsPanel.cpp | 19 ++++++++++++------- DigiSettingsPanel.h | 3 ++- 5 files changed, 16 insertions(+), 27 deletions(-) diff --git a/ClassData.h b/ClassData.h index a4a3d2c..72c6628 100644 --- a/ClassData.h +++ b/ClassData.h @@ -52,19 +52,6 @@ class Data{ int LoopIndex[MaxNChannels]; /// number of loop in the circular memory int DataIndex[MaxNChannels]; - //unsigned long long Timestamp[MaxNChannels][MaxNData]; /// 47 bit - // unsigned short fineTime [MaxNChannels][MaxNData]; /// 10 bits, in unit of tick2ns / 1000 = ps - // unsigned short Energy [MaxNChannels][MaxNData]; /// 15 bit - // unsigned short Energy2 [MaxNChannels][MaxNData]; /// 15 bit, in PSD, Energy = Qshort, Energy2 = Qlong - // bool PileUp [MaxNChannels][MaxNData]; /// pile up flag - - // std::vector Waveform1 [MaxNChannels][MaxNData]; // used at least 14 MB - // std::vector Waveform2 [MaxNChannels][MaxNData]; - // std::vector DigiWaveform1[MaxNChannels][MaxNData]; - // std::vector DigiWaveform2[MaxNChannels][MaxNData]; - // std::vector DigiWaveform3[MaxNChannels][MaxNData]; - // std::vector DigiWaveform4[MaxNChannels][MaxNData]; - uShort GetDataSize() const {return dataSize;} ullong ** Timestamp; /// 47 bit uShort ** fineTime; /// 10 bits, in unit of tick2ns / 1000 = ps diff --git a/ClassDigitizer.cpp b/ClassDigitizer.cpp index 12f2c0d..cc9a872 100644 --- a/ClassDigitizer.cpp +++ b/ClassDigitizer.cpp @@ -297,7 +297,7 @@ int Digitizer::ProgramBoard_PHA(){ ret = CAEN_DGTZ_WriteRegister(handle, DPP::RecordLength_G + 0x7000, 62); //ret = CAEN_DGTZ_WriteRegister(handle, DPP::BoardConfiguration, 0x0F8915); /// has Extra2, dual trace, input and trap-baseline ret = CAEN_DGTZ_WriteRegister(handle, DPP::BoardConfiguration, 0x0E8915); /// has Extra2, no trace - ///ret = CAEN_DGTZ_WriteRegister(handle, DPP::BoardConfiguration, 0x0D8115); /// diable Extra2 + //ret = CAEN_DGTZ_WriteRegister(handle, DPP::BoardConfiguration, 0x0D8115); /// diable Extra2 //TODO change to write register ret = CAEN_DGTZ_SetAcquisitionMode(handle, CAEN_DGTZ_SW_CONTROLLED); /// software command @@ -343,10 +343,6 @@ int Digitizer::ProgramBoard_PHA(){ ret |= CAEN_DGTZ_WriteRegister(handle, (uint32_t)(DPP::PreTrigger) + 0x7000 , 32 ); ret |= CAEN_DGTZ_WriteRegister(handle, (uint32_t)(DPP::InputDynamicRange) + 0x7000 , 0x0 ); - - //ret |= CAEN_DGTZ_WriteRegister(handle, (int32_t)(DPP::NumberEventsPerAggregate_G) + 0x7000, 10); - //ret |= CAEN_DGTZ_WriteRegister(handle, (int32_t)(DPP::AggregateOrganization), 0); - //ret |= CAEN_DGTZ_WriteRegister(handle, (int32_t)(DPP::MaxAggregatePerBlockTransfer), 100); ret |= CAEN_DGTZ_WriteRegister(handle, (int32_t)(DPP::DPPAlgorithmControl) + 0x7000, 0x030200f); if( ret != 0 ) { printf("!!!!!!!! set channels error.\n");} diff --git a/ClassDigitizer.h b/ClassDigitizer.h index 311af07..6610a43 100644 --- a/ClassDigitizer.h +++ b/ClassDigitizer.h @@ -91,7 +91,7 @@ class Digitizer{ void PrintBoard(); void ProgramBoard(); void AutoSetDPPEventAggregation(){ - ret = CAEN_DGTZ_SetDPPAcquisitionMode(handle, CAEN_DGTZ_DPP_ACQ_MODE_List, CAEN_DGTZ_DPP_SAVE_PARAM_EnergyAndTime); + //ret = CAEN_DGTZ_SetDPPAcquisitionMode(handle, CAEN_DGTZ_DPP_ACQ_MODE_List, CAEN_DGTZ_DPP_SAVE_PARAM_EnergyAndTime); ret |= CAEN_DGTZ_SetNumEventsPerAggregate(handle, 10); ret |= CAEN_DGTZ_SetDPPEventAggregation(handle, 0, 0); // AutoSet if( ret != 0 ) { printf("!!!!!!!! set %s error.\n", __func__);} diff --git a/DigiSettingsPanel.cpp b/DigiSettingsPanel.cpp index 6285ac6..b167084 100644 --- a/DigiSettingsPanel.cpp +++ b/DigiSettingsPanel.cpp @@ -208,13 +208,14 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QStr buttonLayout->addWidget(bnSendSoftwareTriggerSignal, rowID, 0); connect(bnSendSoftwareTriggerSignal, &QPushButton::clicked, this, [=](){ digi[ID]->WriteRegister(DPP::SoftwareTrigger_W, 1); UpdateBoardAndChannelsStatus();}); - bnSendSoftwareClockSyncSignal = new QPushButton("Send SW Clock-Sync Signal", this); - buttonLayout->addWidget(bnSendSoftwareClockSyncSignal, rowID, 1); - connect(bnSendSoftwareClockSyncSignal, &QPushButton::clicked, this, [=](){ digi[ID]->WriteRegister(DPP::SoftwareClockSync_W, 1); UpdateBoardAndChannelsStatus();}); + bhAutoSetEventPulling = new QPushButton("Autoset Reading Conf.", this); + buttonLayout->addWidget(bhAutoSetEventPulling, rowID, 1); + connect(bhAutoSetEventPulling, &QPushButton::clicked, this, [=](){ digi[ID]->AutoSetDPPEventAggregation(); UpdateBoardAndChannelsStatus();}); + + // bnSendSoftwareClockSyncSignal = new QPushButton("Send SW Clock-Sync Signal", this); + // buttonLayout->addWidget(bnSendSoftwareClockSyncSignal, rowID, 1); + // connect(bnSendSoftwareClockSyncSignal, &QPushButton::clicked, this, [=](){ digi[ID]->WriteRegister(DPP::SoftwareClockSync_W, 1); UpdateBoardAndChannelsStatus();}); - bnSaveSettings = new QPushButton("Save Settings (bin)", this); - buttonLayout->addWidget(bnSaveSettings, rowID, 2); - connect(bnSaveSettings, &QPushButton::clicked, this, [=](){ SaveSetting(0);}); // bnSaveSettingsToText = new QPushButton("Save Settings (txt)", this); // buttonLayout->addWidget(bnSaveSettingsToText, rowID, 3); @@ -222,7 +223,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QStr //checkBox, to coupled or decouple the setting file. chkCoupledSettingFile = new QCheckBox("Update Setting", this); - buttonLayout->addWidget(chkCoupledSettingFile, rowID, 3); + buttonLayout->addWidget(chkCoupledSettingFile, rowID, 2); chkCoupledSettingFile->setCheckState(Qt::CheckState::Unchecked); connect(chkCoupledSettingFile, &QCheckBox::stateChanged, this, [=](int state){ digi[ID]->SetSettingFileUpdate(state); @@ -231,6 +232,10 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QStr digi[ID]->SaveAllSettingsAsBin(filePath); } }); + + bnSaveSettings = new QPushButton("Save Settings", this); + buttonLayout->addWidget(bnSaveSettings, rowID, 3); + connect(bnSaveSettings, &QPushButton::clicked, this, [=](){ SaveSetting(0);}); } {//^======================= Board Settings diff --git a/DigiSettingsPanel.h b/DigiSettingsPanel.h index 07a0e65..cf9477a 100644 --- a/DigiSettingsPanel.h +++ b/DigiSettingsPanel.h @@ -107,7 +107,8 @@ private: QPushButton * bnClearBuffer; QPushButton * bnSendSoftwareTriggerSignal; - QPushButton * bnSendSoftwareClockSyncSignal; + QPushButton * bhAutoSetEventPulling; + //QPushButton * bnSendSoftwareClockSyncSignal; QPushButton * bnSaveSettings; QPushButton * bnLoadSettings; //QPushButton * bnSaveSettingsToText;