From 74a17b07de214a4b99dd60f76a59e8e8bba92ba2 Mon Sep 17 00:00:00 2001 From: "Ryan@SOLARIS-DAQ" Date: Tue, 14 Mar 2023 16:17:22 -0400 Subject: [PATCH] complete the digiSetting Panel --- ClassDigitizer2Gen.cpp | 28 +- DigiParameters.h | 6 +- digiSettingsPanel.cpp | 796 +++++++++++++++++++++++------------------ digiSettingsPanel.h | 14 +- mainwindow.cpp | 6 +- scope.cpp | 118 +++--- test.cpp | 2 +- 7 files changed, 528 insertions(+), 442 deletions(-) diff --git a/ClassDigitizer2Gen.cpp b/ClassDigitizer2Gen.cpp index 550cb92..a5fe720 100644 --- a/ClassDigitizer2Gen.cpp +++ b/ClassDigitizer2Gen.cpp @@ -37,13 +37,13 @@ void Digitizer2Gen::Initialization(){ acqON = false; settingFileName = ""; - boardSettings = DIGIPARA::DIG::AllSettings; - for( int ch = 0; ch < MaxNumberOfChannel ; ch ++) chSettings[ch] = DIGIPARA::CH::AllSettings; - for( int index = 0 ; index < 4; index ++) VGASetting[index] = DIGIPARA::VGA::VGAGain; + boardSettings = PHA::DIG::AllSettings; + for( int ch = 0; ch < MaxNumberOfChannel ; ch ++) chSettings[ch] = PHA::CH::AllSettings; + for( int index = 0 ; index < 4; index ++) VGASetting[index] = PHA::VGA::VGAGain; //build map - for( int i = 0; i < (int) DIGIPARA::DIG::AllSettings.size(); i++) boardMap[DIGIPARA::DIG::AllSettings[i].GetPara()] = i; - for( int i = 0; i < (int) DIGIPARA::CH::AllSettings.size(); i++) chMap[DIGIPARA::CH::AllSettings[i].GetPara()] = i; + for( int i = 0; i < (int) PHA::DIG::AllSettings.size(); i++) boardMap[PHA::DIG::AllSettings[i].GetPara()] = i; + for( int i = 0; i < (int) PHA::CH::AllSettings.size(); i++) chMap[PHA::CH::AllSettings[i].GetPara()] = i; } @@ -215,21 +215,21 @@ int Digitizer2Gen::OpenDigitizer(const char * url){ ReadAllSettings(); serialNumber = atoi(ReadValue("/par/SerialNum").c_str()); - FPGAType = GetSettingValue(DIGIPARA::DIG::FirmwareType); + FPGAType = GetSettingValue(PHA::DIG::FirmwareType); nChannels = atoi(ReadValue("/par/NumCh").c_str()); - int adcRate = atoi(GetSettingValue(DIGIPARA::DIG::ADC_SampleRate).c_str()); + int adcRate = atoi(GetSettingValue(PHA::DIG::ADC_SampleRate).c_str()); ch2ns = 1000/adcRate; - printf(" IP address : %s\n", GetSettingValue(DIGIPARA::DIG::IPAddress).c_str()); - printf(" Net Mask : %s\n", GetSettingValue(DIGIPARA::DIG::NetMask).c_str()); - printf(" Gateway : %s\n", GetSettingValue(DIGIPARA::DIG::Gateway).c_str()); + printf(" IP address : %s\n", GetSettingValue(PHA::DIG::IPAddress).c_str()); + printf(" Net Mask : %s\n", GetSettingValue(PHA::DIG::NetMask).c_str()); + printf(" Gateway : %s\n", GetSettingValue(PHA::DIG::Gateway).c_str()); - printf(" Model name : %s\n", GetSettingValue(DIGIPARA::DIG::ModelName).c_str()); - printf(" CUP version : %s\n", GetSettingValue(DIGIPARA::DIG::CupVer).c_str()); - printf(" DPP Type : %s\n", GetSettingValue(DIGIPARA::DIG::FirmwareType).c_str()); + printf(" Model name : %s\n", GetSettingValue(PHA::DIG::ModelName).c_str()); + printf(" CUP version : %s\n", GetSettingValue(PHA::DIG::CupVer).c_str()); + printf(" DPP Type : %s\n", GetSettingValue(PHA::DIG::FirmwareType).c_str()); printf(" DPP Version : %s\n", FPGAType.c_str()); printf("Serial number : %d\n", serialNumber); - printf(" ADC bits : %s\n", GetSettingValue(DIGIPARA::DIG::ADC_bit).c_str()); + printf(" ADC bits : %s\n", GetSettingValue(PHA::DIG::ADC_bit).c_str()); printf(" ADC rate : %d Msps, ch2ns : %d ns\n", adcRate, ch2ns); printf(" Channels : %d\n", nChannels); diff --git a/DigiParameters.h b/DigiParameters.h index 17b4c80..346816a 100644 --- a/DigiParameters.h +++ b/DigiParameters.h @@ -104,13 +104,9 @@ class Reg { //^==================== Some digitizer parameters - -// To avoid typo - -namespace DIGIPARA{ +namespace PHA{ const unsigned short TraceStep = 8; - namespace DIG{ ///============== read only diff --git a/digiSettingsPanel.cpp b/digiSettingsPanel.cpp index d479234..0d862cb 100644 --- a/digiSettingsPanel.cpp +++ b/digiSettingsPanel.cpp @@ -6,18 +6,18 @@ #include #include -std::vector> infoIndex = {{"Serial Num : ", DIGIPARA::DIG::SerialNumber}, - {"IP : ", DIGIPARA::DIG::IPAddress}, - {"Model Name : ", DIGIPARA::DIG::ModelName}, - {"FPGA version : ", DIGIPARA::DIG::FPGA_firmwareVersion}, - {"DPP Type : ", DIGIPARA::DIG::FirmwareType}, - {"CUP version : ", DIGIPARA::DIG::CupVer}, - {"ADC bits : ", DIGIPARA::DIG::ADC_bit}, - {"ADC rate [Msps] : ", DIGIPARA::DIG::ADC_SampleRate}, - {"Num. of Channel : ", DIGIPARA::DIG::NumberOfChannel}, - {"Input range [Vpp] : ", DIGIPARA::DIG::InputDynamicRange}, - {"Input Type : ", DIGIPARA::DIG::InputType}, - {"Input Impedance [Ohm] : ", DIGIPARA::DIG::InputImpedance} +std::vector> infoIndex = {{"Serial Num : ", PHA::DIG::SerialNumber}, + {"IP : ", PHA::DIG::IPAddress}, + {"Model Name : ", PHA::DIG::ModelName}, + {"FPGA version : ", PHA::DIG::FPGA_firmwareVersion}, + {"DPP Type : ", PHA::DIG::FirmwareType}, + {"CUP version : ", PHA::DIG::CupVer}, + {"ADC bits : ", PHA::DIG::ADC_bit}, + {"ADC rate [Msps] : ", PHA::DIG::ADC_SampleRate}, + {"Num. of Channel : ", PHA::DIG::NumberOfChannel}, + {"Input range [Vpp] : ", PHA::DIG::InputDynamicRange}, + {"Input Type : ", PHA::DIG::InputType}, + {"Input Impedance [Ohm] : ", PHA::DIG::InputImpedance} }; QStringList LEDToolTip = { "LED_JESD_Y_PASS" , @@ -213,23 +213,23 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi rowId ++; bnClearData[iDigi] = new QPushButton("Clear Data", tab); bnLayout->addWidget(bnClearData[iDigi], rowId, 0, 1, 2); - connect(bnClearData[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(DIGIPARA::DIG::ClearData); }); + connect(bnClearData[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(PHA::DIG::ClearData); }); bnArmACQ[iDigi] = new QPushButton("Arm ACQ", tab); bnLayout->addWidget(bnArmACQ[iDigi], rowId, 2, 1, 2); - connect(bnArmACQ[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(DIGIPARA::DIG::ArmACQ); }); + connect(bnArmACQ[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(PHA::DIG::ArmACQ); }); bnDisarmACQ[iDigi] = new QPushButton("Disarm ACQ", tab); bnLayout->addWidget(bnDisarmACQ[iDigi], rowId, 4, 1, 2); - connect(bnDisarmACQ[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(DIGIPARA::DIG::DisarmACQ); }); + connect(bnDisarmACQ[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(PHA::DIG::DisarmACQ); }); bnSoftwareStart[iDigi] = new QPushButton("Software Start ACQ", tab); bnLayout->addWidget(bnSoftwareStart[iDigi], rowId, 6, 1, 2); - connect(bnSoftwareStart[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(DIGIPARA::DIG::SoftwareStartACQ); }); + connect(bnSoftwareStart[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(PHA::DIG::SoftwareStartACQ); }); bnSoftwareStop[iDigi] = new QPushButton("Software Stop ACQ", tab); bnLayout->addWidget(bnSoftwareStop[iDigi], rowId, 8, 1, 2); - connect(bnSoftwareStop[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(DIGIPARA::DIG::SoftwareStopACQ); }); + connect(bnSoftwareStop[iDigi], &QPushButton::clicked, this, [=](){ digi[ID]->SendCommand(PHA::DIG::SoftwareStopACQ); }); //--------------- @@ -254,7 +254,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi int rowId = 0; //------------------------------------- - SetupComboBox(cbbClockSource[iDigi], DIGIPARA::DIG::ClockSource, -1, true, "Clock Source :", boardLayout, rowId, 0, 1, 2); + SetupComboBox(cbbClockSource[iDigi], PHA::DIG::ClockSource, -1, true, "Clock Source :", boardLayout, rowId, 0, 1, 2); //------------------------------------- rowId ++; @@ -262,8 +262,8 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi lbStartSource->setAlignment(Qt::AlignRight); boardLayout->addWidget(lbStartSource, rowId, 0); - for( int i = 0; i < (int) DIGIPARA::DIG::StartSource.GetAnswers().size(); i++){ - ckbStartSource[iDigi][i] = new QCheckBox( QString::fromStdString((DIGIPARA::DIG::StartSource.GetAnswers())[i].second), tab); + for( int i = 0; i < (int) PHA::DIG::StartSource.GetAnswers().size(); i++){ + ckbStartSource[iDigi][i] = new QCheckBox( QString::fromStdString((PHA::DIG::StartSource.GetAnswers())[i].second), tab); boardLayout->addWidget(ckbStartSource[iDigi][i], rowId, 1 + i); connect(ckbStartSource[iDigi][i], &QCheckBox::stateChanged, this, &DigiSettingsPanel::SetStartSource); } @@ -274,19 +274,19 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi lbGlobalTrgSource->setAlignment(Qt::AlignRight); boardLayout->addWidget(lbGlobalTrgSource, rowId, 0); - for( int i = 0; i < (int) DIGIPARA::DIG::GlobalTriggerSource.GetAnswers().size(); i++){ - ckbGlbTrgSource[iDigi][i] = new QCheckBox( QString::fromStdString((DIGIPARA::DIG::GlobalTriggerSource.GetAnswers())[i].second), tab); + for( int i = 0; i < (int) PHA::DIG::GlobalTriggerSource.GetAnswers().size(); i++){ + ckbGlbTrgSource[iDigi][i] = new QCheckBox( QString::fromStdString((PHA::DIG::GlobalTriggerSource.GetAnswers())[i].second), tab); boardLayout->addWidget(ckbGlbTrgSource[iDigi][i], rowId, 1 + i); connect(ckbGlbTrgSource[iDigi][i], &QCheckBox::stateChanged, this, &DigiSettingsPanel::SetGlobalTriggerSource); } //------------------------------------- rowId ++; - SetupComboBox(cbbTrgOut[iDigi], DIGIPARA::DIG::TrgOutMode, -1, true, "Trg-OUT Mode :", boardLayout, rowId, 0, 1, 2); + SetupComboBox(cbbTrgOut[iDigi], PHA::DIG::TrgOutMode, -1, true, "Trg-OUT Mode :", boardLayout, rowId, 0, 1, 2); //------------------------------------- rowId ++; - SetupComboBox(cbbGPIO[iDigi], DIGIPARA::DIG::GPIOMode, -1, true, "GPIO Mode :", boardLayout, rowId, 0, 1, 2); + SetupComboBox(cbbGPIO[iDigi], PHA::DIG::GPIOMode, -1, true, "GPIO Mode :", boardLayout, rowId, 0, 1, 2); //------------------------------------- QLabel * lbAutoDisarmAcq = new QLabel("Auto disarm ACQ :", tab); @@ -295,14 +295,14 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi cbbAutoDisarmAcq[iDigi] = new RComboBox(tab); boardLayout->addWidget(cbbAutoDisarmAcq[iDigi], rowId, 6); - SetupShortComboBox(cbbAutoDisarmAcq[iDigi], DIGIPARA::DIG::EnableAutoDisarmACQ); + SetupShortComboBox(cbbAutoDisarmAcq[iDigi], PHA::DIG::EnableAutoDisarmACQ); connect(cbbAutoDisarmAcq[iDigi], &RComboBox::currentIndexChanged, this, [=](){ if( !enableSignalSlot ) return; //printf("%s %d %s \n", para.GetPara().c_str(), ch_index, cbb->currentData().toString().toStdString().c_str()); QString msg; - msg = QString::fromStdString(DIGIPARA::DIG::EnableAutoDisarmACQ.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); + msg = QString::fromStdString(PHA::DIG::EnableAutoDisarmACQ.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); msg += " = " + cbbAutoDisarmAcq[ID]->currentData().toString(); - if( digi[ID]->WriteValue(DIGIPARA::DIG::EnableAutoDisarmACQ, cbbAutoDisarmAcq[ID]->currentData().toString().toStdString())){ + if( digi[ID]->WriteValue(PHA::DIG::EnableAutoDisarmACQ, cbbAutoDisarmAcq[ID]->currentData().toString().toStdString())){ SendLogMsg(msg + "|OK."); cbbAutoDisarmAcq[ID]->setStyleSheet(""); }else{ @@ -313,7 +313,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi //------------------------------------- rowId ++; - SetupComboBox(cbbBusyIn[iDigi], DIGIPARA::DIG::BusyInSource, -1, true, "Busy In Source :", boardLayout, rowId, 0, 1, 2); + SetupComboBox(cbbBusyIn[iDigi], PHA::DIG::BusyInSource, -1, true, "Busy In Source :", boardLayout, rowId, 0, 1, 2); QLabel * lbStatEvents = new QLabel("Stat. Event :", tab); lbStatEvents->setAlignment(Qt::AlignRight); @@ -321,13 +321,13 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi cbbStatEvents[iDigi] = new RComboBox(tab); boardLayout->addWidget(cbbStatEvents[iDigi], rowId, 6); - SetupShortComboBox(cbbStatEvents[iDigi], DIGIPARA::DIG::EnableStatisticEvents); + SetupShortComboBox(cbbStatEvents[iDigi], PHA::DIG::EnableStatisticEvents); connect(cbbStatEvents[iDigi], &RComboBox::currentIndexChanged, this, [=](){ if( !enableSignalSlot ) return; QString msg; - msg = QString::fromStdString(DIGIPARA::DIG::EnableStatisticEvents.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); + msg = QString::fromStdString(PHA::DIG::EnableStatisticEvents.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); msg += " = " + cbbStatEvents[ID]->currentData().toString(); - if( digi[ID]->WriteValue(DIGIPARA::DIG::EnableStatisticEvents, cbbStatEvents[ID]->currentData().toString().toStdString()) ){ + if( digi[ID]->WriteValue(PHA::DIG::EnableStatisticEvents, cbbStatEvents[ID]->currentData().toString().toStdString()) ){ SendLogMsg(msg + "|OK."); cbbStatEvents[ID]->setStyleSheet(""); }else{ @@ -338,11 +338,11 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi //------------------------------------- rowId ++; - SetupComboBox(cbbSyncOut[iDigi], DIGIPARA::DIG::SyncOutMode, -1, true, "Sync Out mode :", boardLayout, rowId, 0, 1, 2); + SetupComboBox(cbbSyncOut[iDigi], PHA::DIG::SyncOutMode, -1, true, "Sync Out mode :", boardLayout, rowId, 0, 1, 2); //------------------------------------- rowId ++; - SetupComboBox(cbbBoardVetoSource[iDigi], DIGIPARA::DIG::BoardVetoSource, -1, true, "Board Veto Source :", boardLayout, rowId, 0, 1, 2); + SetupComboBox(cbbBoardVetoSource[iDigi], PHA::DIG::BoardVetoSource, -1, true, "Board Veto Source :", boardLayout, rowId, 0, 1, 2); QLabel * lbBdVetoWidth = new QLabel("Board Veto Width [ns] :", tab); lbBdVetoWidth->setAlignment(Qt::AlignRight); @@ -361,9 +361,9 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi if( !enableSignalSlot ) return; //printf("%s %d %d \n", para.GetPara().c_str(), ch_index, spb->value()); QString msg; - msg = QString::fromStdString(DIGIPARA::DIG::BoardVetoWidth.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); + msg = QString::fromStdString(PHA::DIG::BoardVetoWidth.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); msg += " = " + QString::number(dsbBdVetoWidth[iDigi]->value()); - if( digi[ID]->WriteValue(DIGIPARA::DIG::BoardVetoWidth, std::to_string(dsbBdVetoWidth[iDigi]->value()), -1) ){ + if( digi[ID]->WriteValue(PHA::DIG::BoardVetoWidth, std::to_string(dsbBdVetoWidth[iDigi]->value()), -1) ){ dsbBdVetoWidth[ID]->setStyleSheet(""); SendLogMsg(msg + "|OK."); }else{ @@ -374,11 +374,11 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi cbbBdVetoPolarity[iDigi] = new RComboBox(tab); boardLayout->addWidget(cbbBdVetoPolarity[iDigi], rowId, 6); - SetupShortComboBox(cbbBdVetoPolarity[iDigi], DIGIPARA::DIG::BoardVetoPolarity); + SetupShortComboBox(cbbBdVetoPolarity[iDigi], PHA::DIG::BoardVetoPolarity); //------------------------------------- rowId ++; - SetupSpinBox(spbRunDelay[iDigi], DIGIPARA::DIG::RunDelay, -1, "Run Delay [ns] :", boardLayout, rowId, 0); + SetupSpinBox(spbRunDelay[iDigi], PHA::DIG::RunDelay, -1, false, "Run Delay [ns] :", boardLayout, rowId, 0); //------------------------------------- QLabel * lbClockOutDelay = new QLabel("Temp. Clock Out Delay [ps] :", tab); @@ -402,9 +402,9 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi double value = dsbVolatileClockOutDelay[ID]->value(); dsbVolatileClockOutDelay[ID]->setValue( (std::round(value/step) * step) ); QString msg; - msg = QString::fromStdString(DIGIPARA::DIG::VolatileClockOutDelay.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); + msg = QString::fromStdString(PHA::DIG::VolatileClockOutDelay.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); msg += " = " + QString::number(dsbVolatileClockOutDelay[iDigi]->value()); - if( digi[ID]->WriteValue(DIGIPARA::DIG::VolatileClockOutDelay, std::to_string(dsbVolatileClockOutDelay[ID]->value()), -1) ){ + if( digi[ID]->WriteValue(PHA::DIG::VolatileClockOutDelay, std::to_string(dsbVolatileClockOutDelay[ID]->value()), -1) ){ dsbVolatileClockOutDelay[ID]->setStyleSheet(""); SendLogMsg(msg + "|OK."); }else{ @@ -415,7 +415,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi //------------------------------------- rowId ++; - SetupComboBox(cbbIOLevel[iDigi], DIGIPARA::DIG::IO_Level, -1, true, "IO Level :", boardLayout, rowId, 0, 1, 2); + SetupComboBox(cbbIOLevel[iDigi], PHA::DIG::IO_Level, -1, true, "IO Level :", boardLayout, rowId, 0, 1, 2); QLabel * lbClockOutDelay2 = new QLabel("Perm. Clock Out Delay [ps] :", tab); lbClockOutDelay2->setAlignment(Qt::AlignRight); @@ -438,9 +438,9 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi double value = dsbClockOutDelay[ID]->value(); dsbClockOutDelay[ID]->setValue( (std::round(value/step) * step) ); QString msg; - msg = QString::fromStdString(DIGIPARA::DIG::PermanentClockOutDelay.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); + msg = QString::fromStdString(PHA::DIG::PermanentClockOutDelay.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); msg += " = " + QString::number(dsbClockOutDelay[iDigi]->value()); - if( digi[ID]->WriteValue(DIGIPARA::DIG::PermanentClockOutDelay, std::to_string(dsbClockOutDelay[ID]->value()), -1) ){ + if( digi[ID]->WriteValue(PHA::DIG::PermanentClockOutDelay, std::to_string(dsbClockOutDelay[ID]->value()), -1) ){ dsbClockOutDelay[ID]->setStyleSheet(""); SendLogMsg(msg + "|OK."); }else{ @@ -457,10 +457,10 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi testPulseLayout->setAlignment(Qt::AlignLeft); testPulseLayout->setVerticalSpacing(0); - SetupSpinBox(dsbTestPuslePeriod[iDigi], DIGIPARA::DIG::TestPulsePeriod, -1, "Period [ns] :", testPulseLayout, 0, 0); - SetupSpinBox(dsbTestPusleWidth[iDigi], DIGIPARA::DIG::TestPulseWidth, -1, "Width [ns] :", testPulseLayout, 0, 2); - SetupSpinBox(spbTestPusleLowLevel[iDigi], DIGIPARA::DIG::TestPulseLowLevel, -1, "Low Lvl. [LSB] :", testPulseLayout, 0, 4); - SetupSpinBox(spbTestPusleHighLevel[iDigi], DIGIPARA::DIG::TestPulseHighLevel, -1, "High Lvl. [LSB] :", testPulseLayout, 0, 6); + SetupSpinBox(dsbTestPuslePeriod[iDigi], PHA::DIG::TestPulsePeriod, -1, false, "Period [ns] :", testPulseLayout, 0, 0); + SetupSpinBox(dsbTestPusleWidth[iDigi], PHA::DIG::TestPulseWidth, -1, false, "Width [ns] :", testPulseLayout, 0, 2); + SetupSpinBox(spbTestPusleLowLevel[iDigi], PHA::DIG::TestPulseLowLevel, -1, false, "Low Lvl. [LSB] :", testPulseLayout, 0, 4); + SetupSpinBox(spbTestPusleHighLevel[iDigi], PHA::DIG::TestPulseHighLevel, -1, false, "High Lvl. [LSB] :", testPulseLayout, 0, 6); dsbTestPuslePeriod[iDigi]->setFixedSize(110, 30); dsbTestPuslePeriod[iDigi]->setDecimals(0); @@ -498,10 +498,10 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi double value = VGA[ID][k]->value(); VGA[ID][k]->setValue( (std::round(value/step) * step) ); QString msg; - msg = QString::fromStdString(DIGIPARA::VGA::VGAGain.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); - if( DIGIPARA::VGA::VGAGain.GetType() == TYPE::VGA ) msg += ",VGA:" + QString::number(k); + msg = QString::fromStdString(PHA::VGA::VGAGain.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); + if( PHA::VGA::VGAGain.GetType() == TYPE::VGA ) msg += ",VGA:" + QString::number(k); msg += " = " + QString::number(VGA[ID][k]->value()); - if( digi[ID]->WriteValue(DIGIPARA::VGA::VGAGain, std::to_string(VGA[ID][k]->value()), k)){ + if( digi[ID]->WriteValue(PHA::VGA::VGAGain, std::to_string(VGA[ID][k]->value()), k)){ VGA[ID][k]->setStyleSheet(""); SendLogMsg(msg + "|OK."); }else{ @@ -546,7 +546,6 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi cbChPick[iDigi]->addItem("All", -1); for( int i = 0; i < ch; i++) cbChPick[iDigi]->addItem("Ch-" + QString::number(i), i); layout0->addWidget(cbChPick[iDigi], 0, 1); - //TODO================ connect(cbChPick[iDigi], &RComboBox::currentIndexChanged, this, [=](){ int index = cbChPick[ID]->currentData().toInt(); if(index == -1) { @@ -556,48 +555,48 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi enableSignalSlot = false; unsigned short ch = digi[iDigi]->GetNChannels(); printf("index = %d, ch = %d\n", index, ch); - FillComboBoxValueFromMemory(cbbOnOff[ID][ch], DIGIPARA::CH::ChannelEnable, index); - FillSpinBoxValueFromMemory(spbDCOffset[ID][ch], DIGIPARA::CH::DC_Offset, index); - FillSpinBoxValueFromMemory(spbThreshold[ID][ch], DIGIPARA::CH::TriggerThreshold, index); - FillComboBoxValueFromMemory(cbbParity[ID][ch], DIGIPARA::CH::Polarity, index); - FillSpinBoxValueFromMemory(spbRecordLength[ID][ch], DIGIPARA::CH::RecordLength, index); - FillSpinBoxValueFromMemory(spbPreTrigger[ID][ch], DIGIPARA::CH::PreTrigger, index); - FillSpinBoxValueFromMemory(spbInputRiseTime[ID][ch], DIGIPARA::CH::TimeFilterRiseTime, index); - FillSpinBoxValueFromMemory(spbTriggerGuard[ID][ch], DIGIPARA::CH::TimeFilterRetriggerGuard, index); - FillComboBoxValueFromMemory(cbbLowFilter[ID][ch], DIGIPARA::CH::EnergyFilterLowFreqFilter, index); - FillComboBoxValueFromMemory(cbbWaveSource[ID][ch], DIGIPARA::CH::WaveDataSource, index); - FillComboBoxValueFromMemory(cbbWaveRes[ID][ch], DIGIPARA::CH::WaveResolution, index); - FillComboBoxValueFromMemory(cbbWaveSave[ID][ch], DIGIPARA::CH::WaveSaving, index); + FillComboBoxValueFromMemory(cbbOnOff[ID][ch], PHA::CH::ChannelEnable, index); + FillSpinBoxValueFromMemory(spbDCOffset[ID][ch], PHA::CH::DC_Offset, index); + FillSpinBoxValueFromMemory(spbThreshold[ID][ch], PHA::CH::TriggerThreshold, index); + FillComboBoxValueFromMemory(cbbParity[ID][ch], PHA::CH::Polarity, index); + FillSpinBoxValueFromMemory(spbRecordLength[ID][ch], PHA::CH::RecordLength, index); + FillSpinBoxValueFromMemory(spbPreTrigger[ID][ch], PHA::CH::PreTrigger, index); + FillSpinBoxValueFromMemory(spbInputRiseTime[ID][ch], PHA::CH::TimeFilterRiseTime, index); + FillSpinBoxValueFromMemory(spbTriggerGuard[ID][ch], PHA::CH::TimeFilterRetriggerGuard, index); + FillComboBoxValueFromMemory(cbbLowFilter[ID][ch], PHA::CH::EnergyFilterLowFreqFilter, index); + FillComboBoxValueFromMemory(cbbWaveSource[ID][ch], PHA::CH::WaveDataSource, index); + FillComboBoxValueFromMemory(cbbWaveRes[ID][ch], PHA::CH::WaveResolution, index); + FillComboBoxValueFromMemory(cbbWaveSave[ID][ch], PHA::CH::WaveSaving, index); - FillSpinBoxValueFromMemory(spbTrapRiseTime[ID][ch], DIGIPARA::CH::EnergyFilterRiseTime, index); - FillSpinBoxValueFromMemory(spbTrapFlatTop[ID][ch], DIGIPARA::CH::EnergyFilterFlatTop, index); - FillSpinBoxValueFromMemory(spbTrapPoleZero[ID][ch], DIGIPARA::CH::EnergyFilterPoleZero, index); - FillSpinBoxValueFromMemory(spbPeaking[ID][ch], DIGIPARA::CH::EnergyFilterPeakingPosition, index); - FillComboBoxValueFromMemory(cbbPeakingAvg[ID][ch], DIGIPARA::CH::EnergyFilterPeakingAvg, index); - FillComboBoxValueFromMemory(cbbBaselineAvg[ID][ch], DIGIPARA::CH::EnergyFilterBaselineAvg, index); - FillSpinBoxValueFromMemory(spbFineGain[ID][ch], DIGIPARA::CH::EnergyFilterFineGain, index); - FillSpinBoxValueFromMemory(spbBaselineGuard[ID][ch], DIGIPARA::CH::EnergyFilterBaselineGuard, index); - FillSpinBoxValueFromMemory(spbPileupGuard[ID][ch], DIGIPARA::CH::EnergyFilterPileUpGuard, index); + FillSpinBoxValueFromMemory(spbTrapRiseTime[ID][ch], PHA::CH::EnergyFilterRiseTime, index); + FillSpinBoxValueFromMemory(spbTrapFlatTop[ID][ch], PHA::CH::EnergyFilterFlatTop, index); + FillSpinBoxValueFromMemory(spbTrapPoleZero[ID][ch], PHA::CH::EnergyFilterPoleZero, index); + FillSpinBoxValueFromMemory(spbPeaking[ID][ch], PHA::CH::EnergyFilterPeakingPosition, index); + FillComboBoxValueFromMemory(cbbPeakingAvg[ID][ch], PHA::CH::EnergyFilterPeakingAvg, index); + FillComboBoxValueFromMemory(cbbBaselineAvg[ID][ch], PHA::CH::EnergyFilterBaselineAvg, index); + FillSpinBoxValueFromMemory(spbFineGain[ID][ch], PHA::CH::EnergyFilterFineGain, index); + FillSpinBoxValueFromMemory(spbBaselineGuard[ID][ch], PHA::CH::EnergyFilterBaselineGuard, index); + FillSpinBoxValueFromMemory(spbPileupGuard[ID][ch], PHA::CH::EnergyFilterPileUpGuard, index); - FillComboBoxValueFromMemory(cbbAnaProbe0[ID][ch], DIGIPARA::CH::WaveAnalogProbe0, index); - FillComboBoxValueFromMemory(cbbAnaProbe1[ID][ch], DIGIPARA::CH::WaveAnalogProbe1, index); - FillComboBoxValueFromMemory(cbbDigProbe0[ID][ch], DIGIPARA::CH::WaveDigitalProbe0, index); - FillComboBoxValueFromMemory(cbbDigProbe1[ID][ch], DIGIPARA::CH::WaveDigitalProbe1, index); - FillComboBoxValueFromMemory(cbbDigProbe2[ID][ch], DIGIPARA::CH::WaveDigitalProbe2, index); - FillComboBoxValueFromMemory(cbbDigProbe3[ID][ch], DIGIPARA::CH::WaveDigitalProbe3, index); + FillComboBoxValueFromMemory(cbbAnaProbe0[ID][ch], PHA::CH::WaveAnalogProbe0, index); + FillComboBoxValueFromMemory(cbbAnaProbe1[ID][ch], PHA::CH::WaveAnalogProbe1, index); + FillComboBoxValueFromMemory(cbbDigProbe0[ID][ch], PHA::CH::WaveDigitalProbe0, index); + FillComboBoxValueFromMemory(cbbDigProbe1[ID][ch], PHA::CH::WaveDigitalProbe1, index); + FillComboBoxValueFromMemory(cbbDigProbe2[ID][ch], PHA::CH::WaveDigitalProbe2, index); + FillComboBoxValueFromMemory(cbbDigProbe3[ID][ch], PHA::CH::WaveDigitalProbe3, index); - FillComboBoxValueFromMemory(cbbEventSelector[ID][ch], DIGIPARA::CH::EventSelector, index); - FillComboBoxValueFromMemory(cbbWaveSelector[ID][ch], DIGIPARA::CH::WaveSelector, index); - FillSpinBoxValueFromMemory(spbEnergySkimLow[ID][ch], DIGIPARA::CH::EnergySkimLowDiscriminator, index); - FillSpinBoxValueFromMemory(spbEnergySkimHigh[ID][ch], DIGIPARA::CH::EnergySkimHighDiscriminator, index); + FillComboBoxValueFromMemory(cbbEventSelector[ID][ch], PHA::CH::EventSelector, index); + FillComboBoxValueFromMemory(cbbWaveSelector[ID][ch], PHA::CH::WaveSelector, index); + FillSpinBoxValueFromMemory(spbEnergySkimLow[ID][ch], PHA::CH::EnergySkimLowDiscriminator, index); + FillSpinBoxValueFromMemory(spbEnergySkimHigh[ID][ch], PHA::CH::EnergySkimHighDiscriminator, index); - FillComboBoxValueFromMemory(cbbEvtTrigger[ID][ch], DIGIPARA::CH::EventTriggerSource, index); - FillComboBoxValueFromMemory(cbbWaveTrigger[ID][ch], DIGIPARA::CH::WaveTriggerSource, index); - FillComboBoxValueFromMemory(cbbChVetoSrc[ID][ch], DIGIPARA::CH::ChannelVetoSource, index); - FillComboBoxValueFromMemory(cbbCoinMask[ID][ch], DIGIPARA::CH::CoincidenceMask, index); - FillComboBoxValueFromMemory(cbbAntiCoinMask[ID][ch], DIGIPARA::CH::AntiCoincidenceMask, index); - FillSpinBoxValueFromMemory(spbCoinLength[ID][ch], DIGIPARA::CH::CoincidenceLength, index); - FillSpinBoxValueFromMemory(spbADCVetoWidth[ID][ch], DIGIPARA::CH::ADCVetoWidth, index); + FillComboBoxValueFromMemory(cbbEvtTrigger[ID][ch], PHA::CH::EventTriggerSource, index); + FillComboBoxValueFromMemory(cbbWaveTrigger[ID][ch], PHA::CH::WaveTriggerSource, index); + FillComboBoxValueFromMemory(cbbChVetoSrc[ID][ch], PHA::CH::ChannelVetoSource, index); + FillComboBoxValueFromMemory(cbbCoinMask[ID][ch], PHA::CH::CoincidenceMask, index); + FillComboBoxValueFromMemory(cbbAntiCoinMask[ID][ch], PHA::CH::AntiCoincidenceMask, index); + FillSpinBoxValueFromMemory(spbCoinLength[ID][ch], PHA::CH::CoincidenceLength, index); + FillSpinBoxValueFromMemory(spbADCVetoWidth[ID][ch], PHA::CH::ADCVetoWidth, index); enableSignalSlot = true; } @@ -612,28 +611,28 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi QGridLayout * layout1 = new QGridLayout(box1); rowID = 0; - SetupComboBox(cbbOnOff[iDigi][ch], DIGIPARA::CH::ChannelEnable, -1, true, "On/Off", layout1, rowID, 0); - SetupComboBox(cbbWaveSource[iDigi][ch], DIGIPARA::CH::WaveDataSource, -1, true, "Wave Data Source", layout1, rowID, 2); + SetupComboBox(cbbOnOff[iDigi][ch], PHA::CH::ChannelEnable, -1, true, "On/Off", layout1, rowID, 0); + SetupComboBox(cbbWaveSource[iDigi][ch], PHA::CH::WaveDataSource, -1, true, "Wave Data Source", layout1, rowID, 2); rowID ++; - SetupComboBox(cbbWaveRes[iDigi][ch], DIGIPARA::CH::WaveResolution, -1, true, "Wave Resol.", layout1, rowID, 0); - SetupComboBox(cbbWaveSave[iDigi][ch], DIGIPARA::CH::WaveSaving, -1, true, "Wave Save", layout1, rowID, 2); + SetupComboBox(cbbWaveRes[iDigi][ch], PHA::CH::WaveResolution, -1, true, "Wave Resol.", layout1, rowID, 0); + SetupComboBox(cbbWaveSave[iDigi][ch], PHA::CH::WaveSaving, -1, true, "Wave Save", layout1, rowID, 2); rowID ++; - SetupComboBox(cbbParity[iDigi][ch], DIGIPARA::CH::Polarity, -1, true, "Parity", layout1, rowID, 0); - SetupComboBox(cbbLowFilter[iDigi][ch], DIGIPARA::CH::EnergyFilterLowFreqFilter, -1, true, "Low Freq. Filter", layout1, rowID, 2); + SetupComboBox(cbbParity[iDigi][ch], PHA::CH::Polarity, -1, true, "Parity", layout1, rowID, 0); + SetupComboBox(cbbLowFilter[iDigi][ch], PHA::CH::EnergyFilterLowFreqFilter, -1, true, "Low Freq. Filter", layout1, rowID, 2); rowID ++; - SetupSpinBox(spbDCOffset[iDigi][ch], DIGIPARA::CH::DC_Offset, -1, "DC Offset [%]", layout1, rowID, 0); - SetupSpinBox(spbThreshold[iDigi][ch], DIGIPARA::CH::TriggerThreshold, -1, "Threshold [LSB]", layout1, rowID, 2); + SetupSpinBox(spbDCOffset[iDigi][ch], PHA::CH::DC_Offset, -1, false, "DC Offset [%]", layout1, rowID, 0); + SetupSpinBox(spbThreshold[iDigi][ch], PHA::CH::TriggerThreshold, -1, false, "Threshold [LSB]", layout1, rowID, 2); rowID ++; - SetupSpinBox(spbInputRiseTime[iDigi][ch], DIGIPARA::CH::TimeFilterRiseTime, -1, "Input Rise Time [ns]", layout1, rowID, 0); - SetupSpinBox(spbTriggerGuard[iDigi][ch], DIGIPARA::CH::TimeFilterRetriggerGuard, -1, "Trigger Guard [ns]", layout1, rowID, 2); + SetupSpinBox(spbInputRiseTime[iDigi][ch], PHA::CH::TimeFilterRiseTime, -1, false, "Input Rise Time [ns]", layout1, rowID, 0); + SetupSpinBox(spbTriggerGuard[iDigi][ch], PHA::CH::TimeFilterRetriggerGuard, -1, false, "Trigger Guard [ns]", layout1, rowID, 2); rowID ++; - SetupSpinBox(spbRecordLength[iDigi][ch], DIGIPARA::CH::RecordLength, -1, "Record Length [ns]", layout1, rowID, 0); - SetupSpinBox(spbPreTrigger[iDigi][ch], DIGIPARA::CH::PreTrigger, -1, "Pre Trigger [ns]", layout1, rowID, 2); + SetupSpinBox(spbRecordLength[iDigi][ch], PHA::CH::RecordLength, -1, false, "Record Length [ns]", layout1, rowID, 0); + SetupSpinBox(spbPreTrigger[iDigi][ch], PHA::CH::PreTrigger, -1, false, "Pre Trigger [ns]", layout1, rowID, 2); } @@ -644,21 +643,21 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi //------------------------------ rowID = 0; - SetupSpinBox(spbTrapRiseTime[iDigi][ch], DIGIPARA::CH::EnergyFilterRiseTime, -1, "Trap. Rise Time [ns]", layout3, rowID, 0); - SetupSpinBox(spbTrapFlatTop[iDigi][ch], DIGIPARA::CH::EnergyFilterFlatTop, -1, "Trap. Flat Top [ns]", layout3, rowID, 2); - SetupSpinBox(spbTrapPoleZero[iDigi][ch], DIGIPARA::CH::EnergyFilterPoleZero, -1, "Trap. Pole Zero [ns]", layout3, rowID, 4); + SetupSpinBox(spbTrapRiseTime[iDigi][ch], PHA::CH::EnergyFilterRiseTime, -1, false, "Trap. Rise Time [ns]", layout3, rowID, 0); + SetupSpinBox(spbTrapFlatTop[iDigi][ch], PHA::CH::EnergyFilterFlatTop, -1, false, "Trap. Flat Top [ns]", layout3, rowID, 2); + SetupSpinBox(spbTrapPoleZero[iDigi][ch], PHA::CH::EnergyFilterPoleZero, -1, false, "Trap. Pole Zero [ns]", layout3, rowID, 4); //------------------------------ rowID ++; - SetupSpinBox(spbPeaking[iDigi][ch], DIGIPARA::CH::EnergyFilterPeakingPosition, -1, "Peaking [%]", layout3, rowID, 0); - SetupSpinBox(spbBaselineGuard[iDigi][ch], DIGIPARA::CH::EnergyFilterBaselineGuard, -1, "Baseline Guard [ns]", layout3, rowID, 2); - SetupSpinBox(spbPileupGuard[iDigi][ch], DIGIPARA::CH::EnergyFilterPileUpGuard, -1, "Pile-up Guard [ns]", layout3, rowID, 4); + SetupSpinBox(spbPeaking[iDigi][ch], PHA::CH::EnergyFilterPeakingPosition, -1, false, "Peaking [%]", layout3, rowID, 0); + SetupSpinBox(spbBaselineGuard[iDigi][ch], PHA::CH::EnergyFilterBaselineGuard, -1, false, "Baseline Guard [ns]", layout3, rowID, 2); + SetupSpinBox(spbPileupGuard[iDigi][ch], PHA::CH::EnergyFilterPileUpGuard, -1, false, "Pile-up Guard [ns]", layout3, rowID, 4); //------------------------------ rowID ++; - SetupComboBox(cbbPeakingAvg[iDigi][ch], DIGIPARA::CH::EnergyFilterPeakingAvg, -1, true, "Peak Avg", layout3, rowID, 0); - SetupComboBox(cbbBaselineAvg[iDigi][ch], DIGIPARA::CH::EnergyFilterBaselineAvg, -1, true, "Baseline Avg", layout3, rowID, 2); - SetupSpinBox(spbFineGain[iDigi][ch], DIGIPARA::CH::EnergyFilterFineGain, -1, "Fine Gain", layout3, rowID, 4); + SetupComboBox(cbbPeakingAvg[iDigi][ch], PHA::CH::EnergyFilterPeakingAvg, -1, true, "Peak Avg", layout3, rowID, 0); + SetupComboBox(cbbBaselineAvg[iDigi][ch], PHA::CH::EnergyFilterBaselineAvg, -1, true, "Baseline Avg", layout3, rowID, 2); + SetupSpinBox(spbFineGain[iDigi][ch], PHA::CH::EnergyFilterFineGain, -1, false, "Fine Gain", layout3, rowID, 4); } @@ -669,18 +668,18 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi //------------------------------ rowID = 0; - SetupComboBox(cbbAnaProbe0[iDigi][ch], DIGIPARA::CH::WaveAnalogProbe0, -1, true, "Analog Prob. 0", layout4, rowID, 0, 1, 2); - SetupComboBox(cbbAnaProbe1[iDigi][ch], DIGIPARA::CH::WaveAnalogProbe1, -1, true, "Analog Prob. 1", layout4, rowID, 3, 1, 2); + SetupComboBox(cbbAnaProbe0[iDigi][ch], PHA::CH::WaveAnalogProbe0, -1, true, "Analog Prob. 0", layout4, rowID, 0, 1, 2); + SetupComboBox(cbbAnaProbe1[iDigi][ch], PHA::CH::WaveAnalogProbe1, -1, true, "Analog Prob. 1", layout4, rowID, 3, 1, 2); //------------------------------ rowID ++; - SetupComboBox(cbbDigProbe0[iDigi][ch], DIGIPARA::CH::WaveDigitalProbe0, -1, true, "Digitial Prob. 0", layout4, rowID, 0, 1, 2); - SetupComboBox(cbbDigProbe1[iDigi][ch], DIGIPARA::CH::WaveDigitalProbe1, -1, true, "Digitial Prob. 1", layout4, rowID, 3, 1, 2); + SetupComboBox(cbbDigProbe0[iDigi][ch], PHA::CH::WaveDigitalProbe0, -1, true, "Digitial Prob. 0", layout4, rowID, 0, 1, 2); + SetupComboBox(cbbDigProbe1[iDigi][ch], PHA::CH::WaveDigitalProbe1, -1, true, "Digitial Prob. 1", layout4, rowID, 3, 1, 2); //------------------------------ rowID ++; - SetupComboBox(cbbDigProbe2[iDigi][ch], DIGIPARA::CH::WaveDigitalProbe2, -1, true, "Digitial Prob. 2", layout4, rowID, 0, 1, 2); - SetupComboBox(cbbDigProbe3[iDigi][ch], DIGIPARA::CH::WaveDigitalProbe3, -1, true, "Digitial Prob. 3", layout4, rowID, 3, 1, 2); + SetupComboBox(cbbDigProbe2[iDigi][ch], PHA::CH::WaveDigitalProbe2, -1, true, "Digitial Prob. 2", layout4, rowID, 0, 1, 2); + SetupComboBox(cbbDigProbe3[iDigi][ch], PHA::CH::WaveDigitalProbe3, -1, true, "Digitial Prob. 3", layout4, rowID, 3, 1, 2); } @@ -691,22 +690,22 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi //------------------------------ rowID = 0; - SetupComboBox(cbbEvtTrigger[iDigi][ch], DIGIPARA::CH::EventTriggerSource, -1, true, "Event Trig. Source", layout5, rowID, 0); - SetupComboBox(cbbWaveTrigger[iDigi][ch], DIGIPARA::CH::WaveTriggerSource, -1, true, "Wave Trig. Source", layout5, rowID, 2); + SetupComboBox(cbbEvtTrigger[iDigi][ch], PHA::CH::EventTriggerSource, -1, true, "Event Trig. Source", layout5, rowID, 0); + SetupComboBox(cbbWaveTrigger[iDigi][ch], PHA::CH::WaveTriggerSource, -1, true, "Wave Trig. Source", layout5, rowID, 2); //------------------------------ rowID ++; - SetupComboBox(cbbChVetoSrc[iDigi][ch], DIGIPARA::CH::ChannelVetoSource, -1, true, "Veto Source", layout5, rowID, 0); + SetupComboBox(cbbChVetoSrc[iDigi][ch], PHA::CH::ChannelVetoSource, -1, true, "Veto Source", layout5, rowID, 0); //------------------------------ rowID ++; - SetupComboBox(cbbCoinMask[iDigi][ch], DIGIPARA::CH::CoincidenceMask, -1, true, "Coin. Mask", layout5, rowID, 0); - SetupComboBox(cbbAntiCoinMask[iDigi][ch], DIGIPARA::CH::AntiCoincidenceMask, -1, true, "Anti-Coin. Mask", layout5, rowID, 2); + SetupComboBox(cbbCoinMask[iDigi][ch], PHA::CH::CoincidenceMask, -1, true, "Coin. Mask", layout5, rowID, 0); + SetupComboBox(cbbAntiCoinMask[iDigi][ch], PHA::CH::AntiCoincidenceMask, -1, true, "Anti-Coin. Mask", layout5, rowID, 2); //------------------------------ rowID ++; - SetupSpinBox(spbCoinLength[iDigi][ch], DIGIPARA::CH::CoincidenceLength, -1, "Coin. Length [ns]", layout5, rowID, 0); - SetupSpinBox(spbADCVetoWidth[iDigi][ch], DIGIPARA::CH::ADCVetoWidth, -1, "ADC Veto Length [ns]", layout5, rowID, 2); + SetupSpinBox(spbCoinLength[iDigi][ch], PHA::CH::CoincidenceLength, -1, false, "Coin. Length [ns]", layout5, rowID, 0); + SetupSpinBox(spbADCVetoWidth[iDigi][ch], PHA::CH::ADCVetoWidth, -1, false, "ADC Veto Length [ns]", layout5, rowID, 2); for( int i = 0; i < layout5->columnCount(); i++) layout5->setColumnStretch(i, 1); @@ -719,13 +718,13 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi //------------------------------ rowID = 0 ; - SetupComboBox(cbbEventSelector[iDigi][ch], DIGIPARA::CH::EventSelector, -1, true, "Event Selector", layout6, rowID, 0); - SetupComboBox(cbbWaveSelector[iDigi][ch], DIGIPARA::CH::WaveSelector, -1, true, "Wave Selector", layout6, rowID, 2); + SetupComboBox(cbbEventSelector[iDigi][ch], PHA::CH::EventSelector, -1, true, "Event Selector", layout6, rowID, 0); + SetupComboBox(cbbWaveSelector[iDigi][ch], PHA::CH::WaveSelector, -1, true, "Wave Selector", layout6, rowID, 2); //------------------------------ rowID ++; - SetupSpinBox(spbEnergySkimLow[iDigi][ch], DIGIPARA::CH::EnergySkimLowDiscriminator, -1, "Energy Skim Low", layout6, rowID, 0); - SetupSpinBox(spbEnergySkimHigh[iDigi][ch], DIGIPARA::CH::EnergySkimHighDiscriminator, -1, "Energy Skim High", layout6, rowID, 2); + SetupSpinBox(spbEnergySkimLow[iDigi][ch], PHA::CH::EnergySkimLowDiscriminator, -1, false, "Energy Skim Low", layout6, rowID, 0); + SetupSpinBox(spbEnergySkimHigh[iDigi][ch], PHA::CH::EnergySkimHighDiscriminator, -1, false, "Energy Skim High", layout6, rowID, 2); } } @@ -776,18 +775,18 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi inputTab = new QTabWidget(tab); chTabWidget->addTab(inputTab, "Input"); - SetupComboBoxTab(cbbOnOff, DIGIPARA::CH::ChannelEnable, "On/Off", inputTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbDCOffset, DIGIPARA::CH::DC_Offset, "DC Offset [%]", inputTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbThreshold, DIGIPARA::CH::TriggerThreshold, "Threshold [LSB]", inputTab, iDigi, digi[iDigi]->GetNChannels()); - SetupComboBoxTab(cbbParity, DIGIPARA::CH::Polarity, "Parity", inputTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbRecordLength, DIGIPARA::CH::RecordLength, "Record Length [ns]", inputTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbPreTrigger, DIGIPARA::CH::PreTrigger, "PreTrigger [ns]", inputTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbInputRiseTime, DIGIPARA::CH::TimeFilterRiseTime, "Input Rise Time [ns]", inputTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbTriggerGuard, DIGIPARA::CH::TimeFilterRetriggerGuard, "Trigger Guard [ns]", inputTab, iDigi, digi[iDigi]->GetNChannels()); - SetupComboBoxTab(cbbLowFilter, DIGIPARA::CH::EnergyFilterLowFreqFilter, "Low Freq. Filter", inputTab, iDigi, digi[iDigi]->GetNChannels()); - SetupComboBoxTab(cbbWaveSource, DIGIPARA::CH::WaveDataSource, "Wave Data Dource", inputTab, iDigi, digi[iDigi]->GetNChannels(), 2); - SetupComboBoxTab(cbbWaveRes, DIGIPARA::CH::WaveResolution, "Wave Resol.", inputTab, iDigi, digi[iDigi]->GetNChannels()); - SetupComboBoxTab(cbbWaveSave, DIGIPARA::CH::WaveSaving, "Wave Save", inputTab, iDigi, digi[iDigi]->GetNChannels()); + SetupComboBoxTab(cbbOnOff, PHA::CH::ChannelEnable, "On/Off", inputTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbDCOffset, PHA::CH::DC_Offset, "DC Offset [%]", inputTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbThreshold, PHA::CH::TriggerThreshold, "Threshold [LSB]", inputTab, iDigi, digi[iDigi]->GetNChannels()); + SetupComboBoxTab(cbbParity, PHA::CH::Polarity, "Parity", inputTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbRecordLength, PHA::CH::RecordLength, "Record Length [ns]", inputTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbPreTrigger, PHA::CH::PreTrigger, "PreTrigger [ns]", inputTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbInputRiseTime, PHA::CH::TimeFilterRiseTime, "Input Rise Time [ns]", inputTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbTriggerGuard, PHA::CH::TimeFilterRetriggerGuard, "Trigger Guard [ns]", inputTab, iDigi, digi[iDigi]->GetNChannels()); + SetupComboBoxTab(cbbLowFilter, PHA::CH::EnergyFilterLowFreqFilter, "Low Freq. Filter", inputTab, iDigi, digi[iDigi]->GetNChannels()); + SetupComboBoxTab(cbbWaveSource, PHA::CH::WaveDataSource, "Wave Data Dource", inputTab, iDigi, digi[iDigi]->GetNChannels(), 2); + SetupComboBoxTab(cbbWaveRes, PHA::CH::WaveResolution, "Wave Resol.", inputTab, iDigi, digi[iDigi]->GetNChannels()); + SetupComboBoxTab(cbbWaveSave, PHA::CH::WaveSaving, "Wave Save", inputTab, iDigi, digi[iDigi]->GetNChannels()); for( int ch = 0; ch < digi[iDigi]->GetNChannels(); ch++){ //Set color of some combox @@ -805,51 +804,50 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi trapTab = new QTabWidget(tab); chTabWidget->addTab(trapTab, "Trapezoid"); - SetupSpinBoxTab(spbTrapRiseTime, DIGIPARA::CH::EnergyFilterRiseTime, "Trap. Rise Time [ns]", trapTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbTrapFlatTop, DIGIPARA::CH::EnergyFilterFlatTop, "Trap. Flat Top [ns]", trapTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbTrapPoleZero, DIGIPARA::CH::EnergyFilterPoleZero, "Trap. Pole Zero [ns]", trapTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbPeaking, DIGIPARA::CH::EnergyFilterPeakingPosition, "Peaking [%]", trapTab, iDigi, digi[iDigi]->GetNChannels()); - SetupComboBoxTab(cbbPeakingAvg, DIGIPARA::CH::EnergyFilterPeakingAvg, "Peak Avg.", trapTab, iDigi, digi[iDigi]->GetNChannels()); - SetupComboBoxTab(cbbBaselineAvg, DIGIPARA::CH::EnergyFilterBaselineAvg, "Baseline Avg.", trapTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbFineGain, DIGIPARA::CH::EnergyFilterFineGain, "Fine Gain", trapTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbBaselineGuard, DIGIPARA::CH::EnergyFilterBaselineGuard, "Baseline Guard [ns]", trapTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbPileupGuard, DIGIPARA::CH::EnergyFilterPileUpGuard, "Pile-up Guard [ns]", trapTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbTrapRiseTime, PHA::CH::EnergyFilterRiseTime, "Trap. Rise Time [ns]", trapTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbTrapFlatTop, PHA::CH::EnergyFilterFlatTop, "Trap. Flat Top [ns]", trapTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbTrapPoleZero, PHA::CH::EnergyFilterPoleZero, "Trap. Pole Zero [ns]", trapTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbPeaking, PHA::CH::EnergyFilterPeakingPosition, "Peaking [%]", trapTab, iDigi, digi[iDigi]->GetNChannels()); + SetupComboBoxTab(cbbPeakingAvg, PHA::CH::EnergyFilterPeakingAvg, "Peak Avg.", trapTab, iDigi, digi[iDigi]->GetNChannels()); + SetupComboBoxTab(cbbBaselineAvg, PHA::CH::EnergyFilterBaselineAvg, "Baseline Avg.", trapTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbFineGain, PHA::CH::EnergyFilterFineGain, "Fine Gain", trapTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbBaselineGuard, PHA::CH::EnergyFilterBaselineGuard, "Baseline Guard [ns]", trapTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbPileupGuard, PHA::CH::EnergyFilterPileUpGuard, "Pile-up Guard [ns]", trapTab, iDigi, digi[iDigi]->GetNChannels()); } {//@============== Probe tab probeTab = new QTabWidget(tab); chTabWidget->addTab(probeTab, "Probe"); - SetupComboBoxTab(cbbAnaProbe0, DIGIPARA::CH::WaveAnalogProbe0, "Analog Prob. 0", probeTab, iDigi, digi[iDigi]->GetNChannels(), 4); - SetupComboBoxTab(cbbAnaProbe1, DIGIPARA::CH::WaveAnalogProbe1, "Analog Prob. 1", probeTab, iDigi, digi[iDigi]->GetNChannels(), 4); - SetupComboBoxTab(cbbDigProbe0, DIGIPARA::CH::WaveDigitalProbe0, "Digital Prob. 0", probeTab, iDigi, digi[iDigi]->GetNChannels(), 4); - SetupComboBoxTab(cbbDigProbe1, DIGIPARA::CH::WaveDigitalProbe1, "Digital Prob. 1", probeTab, iDigi, digi[iDigi]->GetNChannels(), 4); - SetupComboBoxTab(cbbDigProbe2, DIGIPARA::CH::WaveDigitalProbe2, "Digital Prob. 2", probeTab, iDigi, digi[iDigi]->GetNChannels(), 4); - SetupComboBoxTab(cbbDigProbe3, DIGIPARA::CH::WaveDigitalProbe3, "Digital Prob. 3", probeTab, iDigi, digi[iDigi]->GetNChannels(), 4); + SetupComboBoxTab(cbbAnaProbe0, PHA::CH::WaveAnalogProbe0, "Analog Prob. 0", probeTab, iDigi, digi[iDigi]->GetNChannels(), 4); + SetupComboBoxTab(cbbAnaProbe1, PHA::CH::WaveAnalogProbe1, "Analog Prob. 1", probeTab, iDigi, digi[iDigi]->GetNChannels(), 4); + SetupComboBoxTab(cbbDigProbe0, PHA::CH::WaveDigitalProbe0, "Digital Prob. 0", probeTab, iDigi, digi[iDigi]->GetNChannels(), 4); + SetupComboBoxTab(cbbDigProbe1, PHA::CH::WaveDigitalProbe1, "Digital Prob. 1", probeTab, iDigi, digi[iDigi]->GetNChannels(), 4); + SetupComboBoxTab(cbbDigProbe2, PHA::CH::WaveDigitalProbe2, "Digital Prob. 2", probeTab, iDigi, digi[iDigi]->GetNChannels(), 4); + SetupComboBoxTab(cbbDigProbe3, PHA::CH::WaveDigitalProbe3, "Digital Prob. 3", probeTab, iDigi, digi[iDigi]->GetNChannels(), 4); } {//@============== Other tab otherTab = new QTabWidget(tab); chTabWidget->addTab(otherTab, "Others"); - SetupComboBoxTab(cbbEventSelector, DIGIPARA::CH::EventSelector, "Event Selector", otherTab, iDigi, digi[iDigi]->GetNChannels()); - SetupComboBoxTab(cbbWaveSelector, DIGIPARA::CH::WaveSelector, "Wave Selector", otherTab, iDigi, digi[iDigi]->GetNChannels(), 2 ); - SetupSpinBoxTab(spbEnergySkimLow, DIGIPARA::CH::EnergySkimLowDiscriminator, "Energy Skim Low", otherTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbEnergySkimHigh, DIGIPARA::CH::EnergySkimHighDiscriminator, "Energy Skim High", otherTab, iDigi, digi[iDigi]->GetNChannels()); + SetupComboBoxTab(cbbEventSelector, PHA::CH::EventSelector, "Event Selector", otherTab, iDigi, digi[iDigi]->GetNChannels()); + SetupComboBoxTab(cbbWaveSelector, PHA::CH::WaveSelector, "Wave Selector", otherTab, iDigi, digi[iDigi]->GetNChannels(), 2 ); + SetupSpinBoxTab(spbEnergySkimLow, PHA::CH::EnergySkimLowDiscriminator, "Energy Skim Low", otherTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbEnergySkimHigh, PHA::CH::EnergySkimHighDiscriminator, "Energy Skim High", otherTab, iDigi, digi[iDigi]->GetNChannels()); } - {//@============== Trigger tab triggerTab = new QTabWidget(tab); chTabWidget->addTab(triggerTab, "Trigger"); - SetupComboBoxTab(cbbEvtTrigger, DIGIPARA::CH::EventTriggerSource, "Event Trig. Source", triggerTab, iDigi, digi[iDigi]->GetNChannels(), 2); - SetupComboBoxTab(cbbWaveTrigger, DIGIPARA::CH::WaveTriggerSource, "Wave Trig. Source", triggerTab, iDigi, digi[iDigi]->GetNChannels(), 2); - SetupComboBoxTab(cbbChVetoSrc, DIGIPARA::CH::ChannelVetoSource, "Veto Source", triggerTab, iDigi, digi[iDigi]->GetNChannels(), 2); - SetupComboBoxTab(cbbCoinMask, DIGIPARA::CH::CoincidenceMask, "Coin. Mask", triggerTab, iDigi, digi[iDigi]->GetNChannels()); - SetupComboBoxTab(cbbAntiCoinMask, DIGIPARA::CH::AntiCoincidenceMask, "Anti-Coin. Mask", triggerTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbCoinLength, DIGIPARA::CH::CoincidenceLength, "Coin. Length [ns]", triggerTab, iDigi, digi[iDigi]->GetNChannels()); - SetupSpinBoxTab(spbADCVetoWidth, DIGIPARA::CH::ADCVetoWidth, "ADC Veto Length [ns]", triggerTab, iDigi, digi[iDigi]->GetNChannels()); + SetupComboBoxTab(cbbEvtTrigger, PHA::CH::EventTriggerSource, "Event Trig. Source", triggerTab, iDigi, digi[iDigi]->GetNChannels(), 2); + SetupComboBoxTab(cbbWaveTrigger, PHA::CH::WaveTriggerSource, "Wave Trig. Source", triggerTab, iDigi, digi[iDigi]->GetNChannels(), 2); + SetupComboBoxTab(cbbChVetoSrc, PHA::CH::ChannelVetoSource, "Veto Source", triggerTab, iDigi, digi[iDigi]->GetNChannels(), 2); + SetupComboBoxTab(cbbCoinMask, PHA::CH::CoincidenceMask, "Coin. Mask", triggerTab, iDigi, digi[iDigi]->GetNChannels()); + SetupComboBoxTab(cbbAntiCoinMask, PHA::CH::AntiCoincidenceMask, "Anti-Coin. Mask", triggerTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbCoinLength, PHA::CH::CoincidenceLength, "Coin. Length [ns]", triggerTab, iDigi, digi[iDigi]->GetNChannels()); + SetupSpinBoxTab(spbADCVetoWidth, PHA::CH::ADCVetoWidth, "ADC Veto Length [ns]", triggerTab, iDigi, digi[iDigi]->GetNChannels()); } for( int ch = 0; ch < digi[ID]->GetNChannels() + 1; ch++) { @@ -936,54 +934,85 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi chTabWidget->addTab(triggerMapTab, "Trigger Map"); QGridLayout * triggerLayout = new QGridLayout(triggerMapTab); - triggerLayout->setAlignment(Qt::AlignCenter); - triggerLayout->setSpacing(0); - - QLabel * instr = new QLabel("Reading: Column (C) represents a trigger channel for Row (R) channel.\nFor example, R3C1 = ch-3 trigger source is ch-1.\n", tab); - triggerLayout->addWidget(instr, 0, 0, 1, 64+15); + triggerLayout->setAlignment(Qt::AlignTop); + + int rowID = 0; + //---------------------------- + SetupComboBox( cbAllEvtTrigger, PHA::CH::EventTriggerSource, -1, false, "Event Trigger Source (all ch.)", triggerLayout, rowID, 0); + SetupComboBox( cbAllWaveTrigger, PHA::CH::WaveTriggerSource, -1, false, "Wave Trigger Source (all ch.)", triggerLayout, rowID, 2); + + //---------------------------- + rowID ++; + SetupComboBox( cbAllCoinMask, PHA::CH::CoincidenceMask, -1, false, "Coincident Mask (all ch.)", triggerLayout, rowID, 0); + SetupSpinBox( sbAllCoinLength, PHA::CH::CoincidenceLength, -1, false, "Coincident Length [ns] (all ch.)", triggerLayout, rowID, 2); + QSignalMapper * triggerMapper = new QSignalMapper(tab); connect(triggerMapper, &QSignalMapper::mappedInt, this, &DigiSettingsPanel::onTriggerClick); - int rowID = 1; + //---------------------------- + rowID ++; + QGroupBox * triggerBox = new QGroupBox("Trigger Mask", tab); + triggerLayout->addWidget(triggerBox, rowID, 0, 1, 4); + + QGridLayout * tbLayout = new QGridLayout(triggerBox); + tbLayout->setAlignment(Qt::AlignCenter); + tbLayout->setSpacing(0); + + //---------------------------- + rowID = 0; + QLabel * instr = new QLabel("Reading: Column (C) represents a trigger channel for Row (R) channel.\nFor example, R3C1 = ch-3 trigger source is ch-1.\n", tab); + instr->setAlignment(Qt::AlignLeft); + tbLayout->addWidget(instr, rowID, 0, 1, 64+15); + + rowID ++; int colID = 0; for(int i = 0; i < digi[iDigi]->GetNChannels(); i++){ - colID = 0; + colID = 1; + + if( i % 4 == 0){ + QLabel * lllba = new QLabel(QString::number(i), tab); + lllba->setAlignment(Qt::AlignTop | Qt::AlignRight); + tbLayout->addWidget(lllba, i + 2 + i/4, 0, 4, 1); + } + + if( i == 0 ){ + for( int j = 0; j < digi[iDigi]->GetNChannels(); j++){ + if( j % 4 == 0) { + QLabel * lllb = new QLabel(QString::number(j), tab); + lllb->setAlignment(Qt::AlignLeft); + tbLayout->addWidget(lllb, rowID, 1 + j + j/4, 1, 4); + } + } + rowID ++; + } + for(int j = 0; j < digi[iDigi]->GetNChannels(); j++){ - - bn[i][j] = new QPushButton(tab); - bn[i][j]->setFixedSize(QSize(10,10)); - bnClickStatus[i][j] = false; - //if( i%4 != 0 && j == (i/4)*4) { - // bn[i][j]->setStyleSheet("background-color: red;"); - // bnClickStatus[i][j] = true; - //} - triggerLayout->addWidget(bn[i][j], rowID, colID); + trgMap[i][j] = new QPushButton(tab); + trgMap[i][j]->setFixedSize(QSize(10,10)); + trgMapClickStatus[i][j] = false; + tbLayout->addWidget(trgMap[i][j], rowID, colID); - triggerMapper->setMapping(bn[i][j], (iDigi << 12) + (i << 8) + j); - connect(bn[i][j], SIGNAL(clicked()), triggerMapper, SLOT(map())); + triggerMapper->setMapping(trgMap[i][j], (iDigi << 16) + (i << 8) + j); + connect(trgMap[i][j], SIGNAL(clicked()), triggerMapper, SLOT(map())); colID ++; - if( j%4 == 3 && j!= digi[iDigi]->GetNChannels() - 1){ QFrame * vSeparator = new QFrame(tab); vSeparator->setFrameShape(QFrame::VLine); - triggerLayout->addWidget(vSeparator, rowID, colID); + tbLayout->addWidget(vSeparator, rowID, colID); colID++; } } rowID++; - if( i%4 == 3 && i != digi[iDigi]->GetNChannels() - 1){ QFrame * hSeparator = new QFrame(tab); hSeparator->setFrameShape(QFrame::HLine); - triggerLayout->addWidget(hSeparator, rowID, 0, 1, digi[iDigi]->GetNChannels() + 15); + tbLayout->addWidget(hSeparator, rowID, 1, 1, digi[iDigi]->GetNChannels() + 15); rowID++; } - - } } @@ -1041,8 +1070,8 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi }); cbBdSettings = new RComboBox(ICTab); - for( int i = 0; i < (int) DIGIPARA::DIG::AllSettings.size(); i++ ){ - cbBdSettings->addItem( QString::fromStdString( DIGIPARA::DIG::AllSettings[i].GetPara() ), i); + for( int i = 0; i < (int) PHA::DIG::AllSettings.size(); i++ ){ + cbBdSettings->addItem( QString::fromStdString( PHA::DIG::AllSettings[i].GetPara() ), i); } inquiryLayout->addWidget(cbBdSettings, rowID, 1); connect(cbBdSettings, &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::ReadBoardSetting); @@ -1078,7 +1107,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi leBdSettingsWrite->setText(QString::fromStdString(value)); leBdSettingsWrite->setStyleSheet(""); - Reg para = DIGIPARA::DIG::AllSettings[cbBdSettings->currentIndex()]; + Reg para = PHA::DIG::AllSettings[cbBdSettings->currentIndex()]; ID = cbIQDigi->currentIndex(); QString msg; msg = QString::fromStdString(para.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); @@ -1107,7 +1136,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi sbBdSettingsWrite->setValue( (std::round(value/step) * step) ); } - Reg para = DIGIPARA::DIG::AllSettings[cbBdSettings->currentIndex()]; + Reg para = PHA::DIG::AllSettings[cbBdSettings->currentIndex()]; ID = cbIQDigi->currentIndex(); QString msg; msg = QString::fromStdString(para.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); @@ -1132,7 +1161,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi connect(leBdSettingsWrite, &QLineEdit::returnPressed, this, [=](){ if( !enableSignalSlot ) return; std::string value = leBdSettingsWrite->text().toStdString(); - Reg para = DIGIPARA::DIG::AllSettings[cbBdSettings->currentIndex()]; + Reg para = PHA::DIG::AllSettings[cbBdSettings->currentIndex()]; ID = cbIQDigi->currentIndex(); QString msg; msg = QString::fromStdString(para.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); @@ -1159,8 +1188,8 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi connect(cbIQCh, &RComboBox::currentIndexChanged, this, [=](){ ReadChannelSetting(cbChSettings->currentIndex()); }); cbChSettings = new RComboBox(ICTab); - for( int i = 0; i < (int) DIGIPARA::CH::AllSettings.size(); i++ ){ - cbChSettings->addItem( QString::fromStdString( DIGIPARA::CH::AllSettings[i].GetPara() ), i); + for( int i = 0; i < (int) PHA::CH::AllSettings.size(); i++ ){ + cbChSettings->addItem( QString::fromStdString( PHA::CH::AllSettings[i].GetPara() ), i); } inquiryLayout->addWidget(cbChSettings, rowID, 1); connect(cbChSettings, &RComboBox::currentIndexChanged, this, &DigiSettingsPanel::ReadChannelSetting); @@ -1192,7 +1221,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi leChSettingsWrite->setText(QString::fromStdString(value)); leChSettingsWrite->setStyleSheet(""); - Reg para = DIGIPARA::CH::AllSettings[cbChSettings->currentIndex()]; + Reg para = PHA::CH::AllSettings[cbChSettings->currentIndex()]; ID = cbIQDigi->currentIndex(); int ch_index = cbIQCh->currentIndex(); QString msg; @@ -1223,7 +1252,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi sbChSettingsWrite->setValue( (std::round(value/step) * step) ); } - Reg para = DIGIPARA::CH::AllSettings[cbBdSettings->currentIndex()]; + Reg para = PHA::CH::AllSettings[cbBdSettings->currentIndex()]; ID = cbIQDigi->currentIndex(); int ch_index = cbIQCh->currentIndex(); QString msg; @@ -1249,7 +1278,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi connect(leChSettingsWrite, &QLineEdit::returnPressed, this, [=](){ if( !enableSignalSlot ) return; std::string value = leChSettingsWrite->text().toStdString(); - Reg para = DIGIPARA::CH::AllSettings[cbChSettings->currentIndex()]; + Reg para = PHA::CH::AllSettings[cbChSettings->currentIndex()]; ID = cbIQDigi->currentIndex(); int ch_index = cbIQCh->currentIndex(); QString msg; @@ -1310,7 +1339,25 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi pbCopyChannel->setFixedSize(200, 50); cpLayout->addWidget(pbCopyChannel, 1, 1); pbCopyChannel->setEnabled(false); - connect(pbCopyChannel, &QPushButton::clicked, this, &DigiSettingsPanel::CopyChannelSettings); + connect(pbCopyChannel, &QPushButton::clicked, this, [=](){ + + int chFromIndex = -1; + for( int i = 0 ; i < MaxNumberOfChannel ; i++){ + if( rbCopyChFrom[i]->isChecked() ){ + chFromIndex = i; + break; + } + } + if( chFromIndex < 0 ) return; + + for( int i = 0; i < MaxNumberOfChannel; i++){ + if( chkChTo[i]->isChecked() ) CopyChannelSettings(cbCopyDigiFrom->currentIndex(), chFromIndex, cbCopyDigiTo->currentIndex(), i ); + } + SendLogMsg("------ done"); + + ID = cbCopyDigiTo->currentIndex(); + ShowSettingsToPanel(); + }); pbCopyBoard = new QPushButton("Copy Board Settings", ICTab); pbCopyBoard->setFixedSize(200, 50); @@ -1378,19 +1425,64 @@ DigiSettingsPanel::~DigiSettingsPanel(){ //^================================================================ void DigiSettingsPanel::onTriggerClick(int haha){ - unsigned short iDig = haha >> 12; - unsigned short ch = (haha >> 8 ) & 0xF; + unsigned short iDig = haha >> 16; + unsigned short ch = (haha >> 8 ) & 0xFF; unsigned short ch2 = haha & 0xFF; qDebug() << "Digi-" << iDig << ", Ch-" << ch << ", " << ch2; - if(bnClickStatus[ch][ch2]){ - bn[ch][ch2]->setStyleSheet(""); - bnClickStatus[ch][ch2] = false; + if(trgMapClickStatus[ch][ch2]){ + trgMap[ch][ch2]->setStyleSheet(""); + trgMapClickStatus[ch][ch2] = false; }else{ - bn[ch][ch2]->setStyleSheet("background-color: red;"); - bnClickStatus[ch][ch2] = true; + trgMap[ch][ch2]->setStyleSheet("background-color: red;"); + trgMapClickStatus[ch][ch2] = true; } + + //format triggermask for ch; + unsigned long mask = 0; + for( int i = 0; i < digi[ID]->GetNChannels(); i++){ + if( trgMapClickStatus[ch][i] ) mask += (1 << i); + } + + QString kaka = "0x"+QString::number(mask, 16); + + QString msg; + msg = QString::fromStdString(PHA::CH::ChannelsTriggerMask.GetPara() ) + "|DIG:" + QString::number(digi[iDig]->GetNChannels()) + ",CH:" + QString::number(ch) + " = " + kaka; + + if( digi[iDig]->WriteValue(PHA::CH::ChannelsTriggerMask, kaka.toStdString(), ch) ){ + SendLogMsg(msg + "|OK."); + }else{ + SendLogMsg(msg + "|Fail."); + digi[iDig]->ReadValue(PHA::CH::ChannelsTriggerMask, ch); + ShowSettingsToPanel(); + } + +} + +void DigiSettingsPanel::ReadTriggerMap(){ + + enableSignalSlot = false; + + cbAllEvtTrigger->setCurrentIndex(cbbEvtTrigger[ID][MaxNumberOfChannel]->currentIndex()); + cbAllWaveTrigger->setCurrentIndex(cbbWaveTrigger[ID][MaxNumberOfChannel]->currentIndex()); + cbAllCoinMask->setCurrentIndex(cbbCoinMask[ID][MaxNumberOfChannel]->currentIndex()); + sbAllCoinLength->setValue(spbCoinLength[ID][MaxNumberOfChannel]->value()); + + for( int ch = 0; ch < (int) digi[ID]->GetNChannels(); ch ++){ + unsigned long mask = std::stoul(digi[ID]->GetSettingValue(PHA::CH::ChannelsTriggerMask, ch)); + + for( int k = 0; k < (int) digi[ID]->GetNChannels(); k ++ ){ + trgMapClickStatus[ch][k] = ( (mask >> k) & 0x1 ); + if( (mask >> k) & 0x1 ){ + trgMap[ch][k]->setStyleSheet("background-color: red;"); + }else{ + trgMap[ch][k]->setStyleSheet(""); + } + } + } + + enableSignalSlot = true; } //^================================================================ @@ -1515,7 +1607,7 @@ void DigiSettingsPanel::ShowSettingsToPanel(){ } //--------- LED Status - unsigned int ledStatus = atoi(digi[ID]->GetSettingValue(DIGIPARA::DIG::LED_status).c_str()); + unsigned int ledStatus = atoi(digi[ID]->GetSettingValue(PHA::DIG::LED_status).c_str()); for( int i = 0; i < 19; i++){ if( (ledStatus >> i) & 0x1 ) { LEDStatus[ID][i]->setStyleSheet("background-color:green;"); @@ -1525,7 +1617,7 @@ void DigiSettingsPanel::ShowSettingsToPanel(){ } //--------- ACQ Status - unsigned int acqStatus = atoi(digi[ID]->GetSettingValue(DIGIPARA::DIG::ACQ_status).c_str()); + unsigned int acqStatus = atoi(digi[ID]->GetSettingValue(PHA::DIG::ACQ_status).c_str()); for( int i = 0; i < 7; i++){ if( (acqStatus >> i) & 0x1 ) { ACQStatus[ID][i]->setStyleSheet("background-color:green;"); @@ -1536,61 +1628,61 @@ void DigiSettingsPanel::ShowSettingsToPanel(){ //-------- temperature for( int i = 0; i < 8; i++){ - leTemp[ID][i]->setText(QString::fromStdString(digi[ID]->GetSettingValue(DIGIPARA::DIG::TempSensADC[i]))); + leTemp[ID][i]->setText(QString::fromStdString(digi[ID]->GetSettingValue(PHA::DIG::TempSensADC[i]))); } //-------- board settings - FillComboBoxValueFromMemory(cbbClockSource[ID], DIGIPARA::DIG::ClockSource); + FillComboBoxValueFromMemory(cbbClockSource[ID], PHA::DIG::ClockSource); - QString result = QString::fromStdString(digi[ID]->GetSettingValue(DIGIPARA::DIG::StartSource)); + QString result = QString::fromStdString(digi[ID]->GetSettingValue(PHA::DIG::StartSource)); QStringList resultList = result.remove(QChar(' ')).split("|"); //qDebug() << resultList << "," << resultList.count(); - for( int j = 0; j < (int) DIGIPARA::DIG::StartSource.GetAnswers().size(); j++){ + for( int j = 0; j < (int) PHA::DIG::StartSource.GetAnswers().size(); j++){ ckbStartSource[ID][j]->setChecked(false); for( int i = 0; i < resultList.count(); i++){ //qDebug() << resultList[i] << ", " << QString::fromStdString((DIGIPARA::DIG::StartSource.GetAnswers())[j].first); - if( resultList[i] == QString::fromStdString((DIGIPARA::DIG::StartSource.GetAnswers())[j].first) ) ckbStartSource[ID][j]->setChecked(true); + if( resultList[i] == QString::fromStdString((PHA::DIG::StartSource.GetAnswers())[j].first) ) ckbStartSource[ID][j]->setChecked(true); } } - result = QString::fromStdString(digi[ID]->GetSettingValue(DIGIPARA::DIG::GlobalTriggerSource)); + result = QString::fromStdString(digi[ID]->GetSettingValue(PHA::DIG::GlobalTriggerSource)); resultList = result.remove(QChar(' ')).split("|"); testPulseBox->setEnabled(false); - for( int j = 0; j < (int) DIGIPARA::DIG::StartSource.GetAnswers().size(); j++){ + for( int j = 0; j < (int) PHA::DIG::StartSource.GetAnswers().size(); j++){ ckbGlbTrgSource[ID][j]->setChecked(false); for( int i = 0; i < resultList.count(); i++){ - if( resultList[i] == QString::fromStdString((DIGIPARA::DIG::GlobalTriggerSource.GetAnswers())[j].first) ) { + if( resultList[i] == QString::fromStdString((PHA::DIG::GlobalTriggerSource.GetAnswers())[j].first) ) { ckbGlbTrgSource[ID][j]->setChecked(true); if( resultList[i] == "TestPulse" ) testPulseBox->setEnabled(true); } } } - FillComboBoxValueFromMemory(cbbTrgOut[ID], DIGIPARA::DIG::TrgOutMode); - FillComboBoxValueFromMemory(cbbGPIO[ID], DIGIPARA::DIG::GPIOMode); - FillComboBoxValueFromMemory(cbbBusyIn[ID], DIGIPARA::DIG::BusyInSource); - FillComboBoxValueFromMemory(cbbSyncOut[ID], DIGIPARA::DIG::SyncOutMode); - FillComboBoxValueFromMemory(cbbAutoDisarmAcq[ID], DIGIPARA::DIG::EnableAutoDisarmACQ); - FillComboBoxValueFromMemory(cbbStatEvents[ID], DIGIPARA::DIG::EnableStatisticEvents); - FillComboBoxValueFromMemory(cbbBdVetoPolarity[ID], DIGIPARA::DIG::BoardVetoPolarity); - FillComboBoxValueFromMemory(cbbBoardVetoSource[ID], DIGIPARA::DIG::BoardVetoSource); - FillComboBoxValueFromMemory(cbbIOLevel[ID], DIGIPARA::DIG::IO_Level); + FillComboBoxValueFromMemory(cbbTrgOut[ID], PHA::DIG::TrgOutMode); + FillComboBoxValueFromMemory(cbbGPIO[ID], PHA::DIG::GPIOMode); + FillComboBoxValueFromMemory(cbbBusyIn[ID], PHA::DIG::BusyInSource); + FillComboBoxValueFromMemory(cbbSyncOut[ID], PHA::DIG::SyncOutMode); + FillComboBoxValueFromMemory(cbbAutoDisarmAcq[ID], PHA::DIG::EnableAutoDisarmACQ); + FillComboBoxValueFromMemory(cbbStatEvents[ID], PHA::DIG::EnableStatisticEvents); + FillComboBoxValueFromMemory(cbbBdVetoPolarity[ID], PHA::DIG::BoardVetoPolarity); + FillComboBoxValueFromMemory(cbbBoardVetoSource[ID], PHA::DIG::BoardVetoSource); + FillComboBoxValueFromMemory(cbbIOLevel[ID], PHA::DIG::IO_Level); - FillSpinBoxValueFromMemory(dsbBdVetoWidth[ID], DIGIPARA::DIG::BoardVetoWidth); - FillSpinBoxValueFromMemory(spbRunDelay[ID], DIGIPARA::DIG::RunDelay); - FillSpinBoxValueFromMemory(dsbVolatileClockOutDelay[ID], DIGIPARA::DIG::VolatileClockOutDelay); - FillSpinBoxValueFromMemory(dsbClockOutDelay[ID], DIGIPARA::DIG::PermanentClockOutDelay); + FillSpinBoxValueFromMemory(dsbBdVetoWidth[ID], PHA::DIG::BoardVetoWidth); + FillSpinBoxValueFromMemory(spbRunDelay[ID], PHA::DIG::RunDelay); + FillSpinBoxValueFromMemory(dsbVolatileClockOutDelay[ID], PHA::DIG::VolatileClockOutDelay); + FillSpinBoxValueFromMemory(dsbClockOutDelay[ID], PHA::DIG::PermanentClockOutDelay); //------------- test pulse - FillSpinBoxValueFromMemory(dsbTestPuslePeriod[ID], DIGIPARA::DIG::TestPulsePeriod); - FillSpinBoxValueFromMemory(dsbTestPusleWidth[ID], DIGIPARA::DIG::TestPulseWidth); - FillSpinBoxValueFromMemory(spbTestPusleLowLevel[ID], DIGIPARA::DIG::TestPulseLowLevel); - FillSpinBoxValueFromMemory(spbTestPusleHighLevel[ID], DIGIPARA::DIG::TestPulseHighLevel); + FillSpinBoxValueFromMemory(dsbTestPuslePeriod[ID], PHA::DIG::TestPulsePeriod); + FillSpinBoxValueFromMemory(dsbTestPusleWidth[ID], PHA::DIG::TestPulseWidth); + FillSpinBoxValueFromMemory(spbTestPusleLowLevel[ID], PHA::DIG::TestPulseLowLevel); + FillSpinBoxValueFromMemory(spbTestPusleHighLevel[ID], PHA::DIG::TestPulseHighLevel); //@============================== Channel setting/ status for( int ch = 0; ch < digi[ID]->GetNChannels(); ch++){ - unsigned int status = atoi(digi[ID]->GetSettingValue(DIGIPARA::CH::ChannelStatus).c_str()); + unsigned int status = atoi(digi[ID]->GetSettingValue(PHA::CH::ChannelStatus).c_str()); for( int i = 0; i < 9; i++){ if( (status >> i) & 0x1 ) { chStatus[ID][ch][i]->setStyleSheet("background-color:green;"); @@ -1599,51 +1691,51 @@ void DigiSettingsPanel::ShowSettingsToPanel(){ } } - chGainFactor[ID][ch]->setText(QString::fromStdString(digi[ID]->GetSettingValue(DIGIPARA::CH::GainFactor, ch))); - chADCToVolts[ID][ch]->setText(QString::fromStdString(digi[ID]->GetSettingValue(DIGIPARA::CH::ADCToVolts, ch))); + chGainFactor[ID][ch]->setText(QString::fromStdString(digi[ID]->GetSettingValue(PHA::CH::GainFactor, ch))); + chADCToVolts[ID][ch]->setText(QString::fromStdString(digi[ID]->GetSettingValue(PHA::CH::ADCToVolts, ch))); - FillComboBoxValueFromMemory(cbbOnOff[ID][ch], DIGIPARA::CH::ChannelEnable, ch); - FillSpinBoxValueFromMemory(spbDCOffset[ID][ch], DIGIPARA::CH::DC_Offset, ch); - FillSpinBoxValueFromMemory(spbThreshold[ID][ch], DIGIPARA::CH::TriggerThreshold, ch); - FillComboBoxValueFromMemory(cbbParity[ID][ch], DIGIPARA::CH::Polarity, ch); - FillSpinBoxValueFromMemory(spbRecordLength[ID][ch], DIGIPARA::CH::RecordLength, ch); - FillSpinBoxValueFromMemory(spbPreTrigger[ID][ch], DIGIPARA::CH::PreTrigger, ch); - FillSpinBoxValueFromMemory(spbInputRiseTime[ID][ch], DIGIPARA::CH::TimeFilterRiseTime, ch); - FillSpinBoxValueFromMemory(spbTriggerGuard[ID][ch], DIGIPARA::CH::TimeFilterRetriggerGuard, ch); - FillComboBoxValueFromMemory(cbbLowFilter[ID][ch], DIGIPARA::CH::EnergyFilterLowFreqFilter, ch); - FillComboBoxValueFromMemory(cbbWaveSource[ID][ch], DIGIPARA::CH::WaveDataSource, ch); - FillComboBoxValueFromMemory(cbbWaveRes[ID][ch], DIGIPARA::CH::WaveResolution, ch); - FillComboBoxValueFromMemory(cbbWaveSave[ID][ch], DIGIPARA::CH::WaveSaving, ch); + FillComboBoxValueFromMemory(cbbOnOff[ID][ch], PHA::CH::ChannelEnable, ch); + FillSpinBoxValueFromMemory(spbDCOffset[ID][ch], PHA::CH::DC_Offset, ch); + FillSpinBoxValueFromMemory(spbThreshold[ID][ch], PHA::CH::TriggerThreshold, ch); + FillComboBoxValueFromMemory(cbbParity[ID][ch], PHA::CH::Polarity, ch); + FillSpinBoxValueFromMemory(spbRecordLength[ID][ch], PHA::CH::RecordLength, ch); + FillSpinBoxValueFromMemory(spbPreTrigger[ID][ch], PHA::CH::PreTrigger, ch); + FillSpinBoxValueFromMemory(spbInputRiseTime[ID][ch], PHA::CH::TimeFilterRiseTime, ch); + FillSpinBoxValueFromMemory(spbTriggerGuard[ID][ch], PHA::CH::TimeFilterRetriggerGuard, ch); + FillComboBoxValueFromMemory(cbbLowFilter[ID][ch], PHA::CH::EnergyFilterLowFreqFilter, ch); + FillComboBoxValueFromMemory(cbbWaveSource[ID][ch], PHA::CH::WaveDataSource, ch); + FillComboBoxValueFromMemory(cbbWaveRes[ID][ch], PHA::CH::WaveResolution, ch); + FillComboBoxValueFromMemory(cbbWaveSave[ID][ch], PHA::CH::WaveSaving, ch); - FillSpinBoxValueFromMemory(spbTrapRiseTime[ID][ch], DIGIPARA::CH::EnergyFilterRiseTime, ch); - FillSpinBoxValueFromMemory(spbTrapFlatTop[ID][ch], DIGIPARA::CH::EnergyFilterFlatTop, ch); - FillSpinBoxValueFromMemory(spbTrapPoleZero[ID][ch], DIGIPARA::CH::EnergyFilterPoleZero, ch); - FillSpinBoxValueFromMemory(spbPeaking[ID][ch], DIGIPARA::CH::EnergyFilterPeakingPosition, ch); - FillComboBoxValueFromMemory(cbbPeakingAvg[ID][ch], DIGIPARA::CH::EnergyFilterPeakingAvg, ch); - FillComboBoxValueFromMemory(cbbBaselineAvg[ID][ch], DIGIPARA::CH::EnergyFilterBaselineAvg, ch); - FillSpinBoxValueFromMemory(spbFineGain[ID][ch], DIGIPARA::CH::EnergyFilterFineGain, ch); - FillSpinBoxValueFromMemory(spbBaselineGuard[ID][ch], DIGIPARA::CH::EnergyFilterBaselineGuard, ch); - FillSpinBoxValueFromMemory(spbPileupGuard[ID][ch], DIGIPARA::CH::EnergyFilterPileUpGuard, ch); + FillSpinBoxValueFromMemory(spbTrapRiseTime[ID][ch], PHA::CH::EnergyFilterRiseTime, ch); + FillSpinBoxValueFromMemory(spbTrapFlatTop[ID][ch], PHA::CH::EnergyFilterFlatTop, ch); + FillSpinBoxValueFromMemory(spbTrapPoleZero[ID][ch], PHA::CH::EnergyFilterPoleZero, ch); + FillSpinBoxValueFromMemory(spbPeaking[ID][ch], PHA::CH::EnergyFilterPeakingPosition, ch); + FillComboBoxValueFromMemory(cbbPeakingAvg[ID][ch], PHA::CH::EnergyFilterPeakingAvg, ch); + FillComboBoxValueFromMemory(cbbBaselineAvg[ID][ch], PHA::CH::EnergyFilterBaselineAvg, ch); + FillSpinBoxValueFromMemory(spbFineGain[ID][ch], PHA::CH::EnergyFilterFineGain, ch); + FillSpinBoxValueFromMemory(spbBaselineGuard[ID][ch], PHA::CH::EnergyFilterBaselineGuard, ch); + FillSpinBoxValueFromMemory(spbPileupGuard[ID][ch], PHA::CH::EnergyFilterPileUpGuard, ch); - FillComboBoxValueFromMemory(cbbAnaProbe0[ID][ch], DIGIPARA::CH::WaveAnalogProbe0, ch); - FillComboBoxValueFromMemory(cbbAnaProbe1[ID][ch], DIGIPARA::CH::WaveAnalogProbe1, ch); - FillComboBoxValueFromMemory(cbbDigProbe0[ID][ch], DIGIPARA::CH::WaveDigitalProbe0, ch); - FillComboBoxValueFromMemory(cbbDigProbe1[ID][ch], DIGIPARA::CH::WaveDigitalProbe1, ch); - FillComboBoxValueFromMemory(cbbDigProbe2[ID][ch], DIGIPARA::CH::WaveDigitalProbe2, ch); - FillComboBoxValueFromMemory(cbbDigProbe3[ID][ch], DIGIPARA::CH::WaveDigitalProbe3, ch); + FillComboBoxValueFromMemory(cbbAnaProbe0[ID][ch], PHA::CH::WaveAnalogProbe0, ch); + FillComboBoxValueFromMemory(cbbAnaProbe1[ID][ch], PHA::CH::WaveAnalogProbe1, ch); + FillComboBoxValueFromMemory(cbbDigProbe0[ID][ch], PHA::CH::WaveDigitalProbe0, ch); + FillComboBoxValueFromMemory(cbbDigProbe1[ID][ch], PHA::CH::WaveDigitalProbe1, ch); + FillComboBoxValueFromMemory(cbbDigProbe2[ID][ch], PHA::CH::WaveDigitalProbe2, ch); + FillComboBoxValueFromMemory(cbbDigProbe3[ID][ch], PHA::CH::WaveDigitalProbe3, ch); - FillComboBoxValueFromMemory(cbbEventSelector[ID][ch], DIGIPARA::CH::EventSelector, ch); - FillComboBoxValueFromMemory(cbbWaveSelector[ID][ch], DIGIPARA::CH::WaveSelector, ch); - FillSpinBoxValueFromMemory(spbEnergySkimLow[ID][ch], DIGIPARA::CH::EnergySkimLowDiscriminator, ch); - FillSpinBoxValueFromMemory(spbEnergySkimHigh[ID][ch], DIGIPARA::CH::EnergySkimHighDiscriminator, ch); + FillComboBoxValueFromMemory(cbbEventSelector[ID][ch], PHA::CH::EventSelector, ch); + FillComboBoxValueFromMemory(cbbWaveSelector[ID][ch], PHA::CH::WaveSelector, ch); + FillSpinBoxValueFromMemory(spbEnergySkimLow[ID][ch], PHA::CH::EnergySkimLowDiscriminator, ch); + FillSpinBoxValueFromMemory(spbEnergySkimHigh[ID][ch], PHA::CH::EnergySkimHighDiscriminator, ch); - FillComboBoxValueFromMemory(cbbEvtTrigger[ID][ch], DIGIPARA::CH::EventTriggerSource, ch); - FillComboBoxValueFromMemory(cbbWaveTrigger[ID][ch], DIGIPARA::CH::WaveTriggerSource, ch); - FillComboBoxValueFromMemory(cbbChVetoSrc[ID][ch], DIGIPARA::CH::ChannelVetoSource, ch); - FillComboBoxValueFromMemory(cbbCoinMask[ID][ch], DIGIPARA::CH::CoincidenceMask, ch); - FillComboBoxValueFromMemory(cbbAntiCoinMask[ID][ch], DIGIPARA::CH::AntiCoincidenceMask, ch); - FillSpinBoxValueFromMemory(spbCoinLength[ID][ch], DIGIPARA::CH::CoincidenceLength, ch); - FillSpinBoxValueFromMemory(spbADCVetoWidth[ID][ch], DIGIPARA::CH::ADCVetoWidth, ch); + FillComboBoxValueFromMemory(cbbEvtTrigger[ID][ch], PHA::CH::EventTriggerSource, ch); + FillComboBoxValueFromMemory(cbbWaveTrigger[ID][ch], PHA::CH::WaveTriggerSource, ch); + FillComboBoxValueFromMemory(cbbChVetoSrc[ID][ch], PHA::CH::ChannelVetoSource, ch); + FillComboBoxValueFromMemory(cbbCoinMask[ID][ch], PHA::CH::CoincidenceMask, ch); + FillComboBoxValueFromMemory(cbbAntiCoinMask[ID][ch], PHA::CH::AntiCoincidenceMask, ch); + FillSpinBoxValueFromMemory(spbCoinLength[ID][ch], PHA::CH::CoincidenceLength, ch); + FillSpinBoxValueFromMemory(spbADCVetoWidth[ID][ch], PHA::CH::ADCVetoWidth, ch); } @@ -1691,6 +1783,8 @@ void DigiSettingsPanel::ShowSettingsToPanel(){ SyncSpinBox(spbCoinLength , -1); SyncSpinBox(spbADCVetoWidth , -1); + ReadTriggerMap(); + } //^########################################################################### @@ -1698,21 +1792,21 @@ void DigiSettingsPanel::SetStartSource(){ if( !enableSignalSlot ) return; std::string value = ""; - for( int i = 0; i < (int) DIGIPARA::DIG::StartSource.GetAnswers().size(); i++){ + for( int i = 0; i < (int) PHA::DIG::StartSource.GetAnswers().size(); i++){ if( ckbStartSource[ID][i]->isChecked() ){ //printf("----- %s \n", DIGIPARA::DIG::StartSource.GetAnswers()[i].first.c_str()); if( value != "" ) value += " | "; - value += DIGIPARA::DIG::StartSource.GetAnswers()[i].first; + value += PHA::DIG::StartSource.GetAnswers()[i].first; } } //printf("================ %s\n", value.c_str()); QString msg; - msg = QString::fromStdString(DIGIPARA::DIG::StartSource.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); + msg = QString::fromStdString(PHA::DIG::StartSource.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); msg += " = " + QString::fromStdString(value); SendLogMsg(msg); - digi[ID]->WriteValue(DIGIPARA::DIG::StartSource, value); + digi[ID]->WriteValue(PHA::DIG::StartSource, value); } void DigiSettingsPanel::SetGlobalTriggerSource(){ @@ -1720,22 +1814,22 @@ void DigiSettingsPanel::SetGlobalTriggerSource(){ std::string value = ""; testPulseBox->setEnabled(false); - for( int i = 0; i < (int) DIGIPARA::DIG::GlobalTriggerSource.GetAnswers().size(); i++){ + for( int i = 0; i < (int) PHA::DIG::GlobalTriggerSource.GetAnswers().size(); i++){ if( ckbGlbTrgSource[ID][i]->isChecked() ){ //printf("----- %s \n", DIGIPARA::DIG::StartSource.GetAnswers()[i].first.c_str()); if( value != "" ) value += " | "; - value += DIGIPARA::DIG::GlobalTriggerSource.GetAnswers()[i].first; - if( DIGIPARA::DIG::GlobalTriggerSource.GetAnswers()[i].first == "TestPulse" ) testPulseBox->setEnabled(true); + value += PHA::DIG::GlobalTriggerSource.GetAnswers()[i].first; + if( PHA::DIG::GlobalTriggerSource.GetAnswers()[i].first == "TestPulse" ) testPulseBox->setEnabled(true); } } //printf("================ %s\n", value.c_str()); QString msg; - msg = QString::fromStdString(DIGIPARA::DIG::GlobalTriggerSource.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); + msg = QString::fromStdString(PHA::DIG::GlobalTriggerSource.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); msg += " = " + QString::fromStdString(value); SendLogMsg(msg); - digi[ID]->WriteValue(DIGIPARA::DIG::GlobalTriggerSource, value); + digi[ID]->WriteValue(PHA::DIG::GlobalTriggerSource, value); } @@ -1756,15 +1850,15 @@ void DigiSettingsPanel::SetupComboBox(RComboBox *&cbb, const Reg para, int ch_in for( int i = 0 ; i < (int) para.GetAnswers().size(); i++){ cbb->addItem(QString::fromStdString((para.GetAnswers())[i].second), QString::fromStdString((para.GetAnswers())[i].first)); } - if( isMaster && para.GetType() == TYPE::CH ) cbb->addItem(""); + if( ch_index == -1 && para.GetType() == TYPE::CH ) cbb->addItem(""); connect(cbb, &RComboBox::currentIndexChanged, this, [=](){ if( !enableSignalSlot ) return; - int index = ( ch_index == -1 ? cbChPick[ID]->currentData().toInt() : ch_index); + int index = ( ch_index == -1 && isMaster ? cbChPick[ID]->currentData().toInt() : ch_index); //int index = ch_index; //printf("%s %d %s \n", para.GetPara().c_str(), index, cbb->currentData().toString().toStdString().c_str()); QString msg; msg = QString::fromStdString(para.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); - if( para.GetType() == TYPE::CH ) msg += ",CH:" + QString::number(index); + if( para.GetType() == TYPE::CH ) msg += ",CH:" + (index == -1 ? "All" : QString::number(index)); if( para.GetType() == TYPE::VGA ) msg += ",VGA:" + QString::number(index); msg += " = " + cbb->currentData().toString(); if( digi[ID]->WriteValue(para, cbb->currentData().toString().toStdString(), index)){ @@ -1778,15 +1872,15 @@ void DigiSettingsPanel::SetupComboBox(RComboBox *&cbb, const Reg para, int ch_in }); } -void DigiSettingsPanel::SetupSpinBox(RSpinBox *&spb, const Reg para, int ch_index, QString labelTxt, QGridLayout *layout, int row, int col, int srow, int scol){ +void DigiSettingsPanel::SetupSpinBox(RSpinBox *&spb, const Reg para, int ch_index, bool isMaster, QString labelTxt, QGridLayout *layout, int row, int col, int srow, int scol){ QLabel * lb = new QLabel(labelTxt, this); layout->addWidget(lb, row, col); lb->setAlignment(Qt::AlignRight| Qt::AlignCenter); spb = new RSpinBox(this); - if( para.GetType() == TYPE::DIG || ch_index >= 0 ){ - spb->setMinimum(atof( para.GetAnswers()[0].first.c_str())); - }else{ + if( isMaster ){ spb->setMinimum(qMin(-1.0, atof( para.GetAnswers()[0].first.c_str()))); + }else{ + spb->setMinimum(atof( para.GetAnswers()[0].first.c_str())); } spb->setMaximum(atof( para.GetAnswers()[1].first.c_str())); if( para.GetAnswers().size() >= 3 ) { @@ -1808,7 +1902,7 @@ void DigiSettingsPanel::SetupSpinBox(RSpinBox *&spb, const Reg para, int ch_inde double value = spb->value(); spb->setValue( (std::round(value/step) * step) ); } - int index = ( ch_index == -1 ? cbChPick[ID]->currentData().toInt() : ch_index); + int index = ( ch_index == -1 && isMaster ? cbChPick[ID]->currentData().toInt() : ch_index); QString msg; msg = QString::fromStdString(para.GetPara()) + "|DIG:"+ QString::number(digi[ID]->GetSerialNumber()); if( para.GetType() == TYPE::CH ) msg += ",CH:" + (index == -1 ? "All" : QString::number(index)); @@ -1893,7 +1987,7 @@ void DigiSettingsPanel::SetupSpinBoxTab(RSpinBox *(&spb)[][MaxNumberOfChannel+1] allLayout->setHorizontalSpacing(10); allLayout->setVerticalSpacing(0); for( int ch = 0; ch < nChannel; ch++){ - SetupSpinBox(spb[iDigi][ch], para, ch, "ch-"+QString::number(ch)+ " ", allLayout, ch/4, ch%4 * 2); + SetupSpinBox(spb[iDigi][ch], para, ch, false, "ch-"+QString::number(ch)+ " ", allLayout, ch/4, ch%4 * 2); } } @@ -1930,17 +2024,17 @@ void DigiSettingsPanel::ReadBoardSetting(int cbIndex){ enableSignalSlot = false; QString type; - switch (DIGIPARA::DIG::AllSettings[cbIndex].ReadWrite()) { + switch (PHA::DIG::AllSettings[cbIndex].ReadWrite()) { case RW::ReadOnly : type ="Read Only"; break; case RW::WriteOnly : type ="Write Only"; break; case RW::ReadWrite : type ="Read/Write"; break; } leBdSettingsType->setText(type); - leBdSettingsRead->setText(QString::fromStdString(digi[cbIQDigi->currentIndex()]->ReadValue(DIGIPARA::DIG::AllSettings[cbIndex]))); - leBdSettingsUnit->setText(QString::fromStdString(DIGIPARA::DIG::AllSettings[cbIndex].GetUnit())); + leBdSettingsRead->setText(QString::fromStdString(digi[cbIQDigi->currentIndex()]->ReadValue(PHA::DIG::AllSettings[cbIndex]))); + leBdSettingsUnit->setText(QString::fromStdString(PHA::DIG::AllSettings[cbIndex].GetUnit())); - ANSTYPE haha = DIGIPARA::DIG::AllSettings[cbIndex].GetAnswerType(); - if( DIGIPARA::DIG::AllSettings[cbIndex].ReadWrite() != RW::ReadOnly && haha != ANSTYPE::NONE ){ + ANSTYPE haha = PHA::DIG::AllSettings[cbIndex].GetAnswerType(); + if( PHA::DIG::AllSettings[cbIndex].ReadWrite() != RW::ReadOnly && haha != ANSTYPE::NONE ){ if( haha == ANSTYPE::FLOAT || haha == ANSTYPE::INTEGER ){ cbBdAns->clear(); @@ -1948,9 +2042,9 @@ void DigiSettingsPanel::ReadBoardSetting(int cbIndex){ leBdSettingsWrite->setEnabled(false); leBdSettingsWrite->clear(); sbBdSettingsWrite->setEnabled(true); - sbBdSettingsWrite->setMinimum(atof(DIGIPARA::DIG::AllSettings[cbIndex].GetAnswers()[0].first.c_str())); - sbBdSettingsWrite->setMaximum(atof(DIGIPARA::DIG::AllSettings[cbIndex].GetAnswers()[1].first.c_str())); - sbBdSettingsWrite->setSingleStep(atof(DIGIPARA::DIG::AllSettings[cbIndex].GetAnswers()[2].first.c_str())); + sbBdSettingsWrite->setMinimum(atof(PHA::DIG::AllSettings[cbIndex].GetAnswers()[0].first.c_str())); + sbBdSettingsWrite->setMaximum(atof(PHA::DIG::AllSettings[cbIndex].GetAnswers()[1].first.c_str())); + sbBdSettingsWrite->setSingleStep(atof(PHA::DIG::AllSettings[cbIndex].GetAnswers()[2].first.c_str())); sbBdSettingsWrite->setValue(00); sbBdSettingsWrite->setDecimals(0); } @@ -1958,9 +2052,9 @@ void DigiSettingsPanel::ReadBoardSetting(int cbIndex){ if( haha == ANSTYPE::LIST){ cbBdAns->setEnabled(true); cbBdAns->clear(); - for( int i = 0; i < (int) DIGIPARA::DIG::AllSettings[cbIndex].GetAnswers().size(); i++){ - cbBdAns->addItem(QString::fromStdString(DIGIPARA::DIG::AllSettings[cbIndex].GetAnswers()[i].second), - QString::fromStdString(DIGIPARA::DIG::AllSettings[cbIndex].GetAnswers()[i].first)); + for( int i = 0; i < (int) PHA::DIG::AllSettings[cbIndex].GetAnswers().size(); i++){ + cbBdAns->addItem(QString::fromStdString(PHA::DIG::AllSettings[cbIndex].GetAnswers()[i].second), + QString::fromStdString(PHA::DIG::AllSettings[cbIndex].GetAnswers()[i].first)); } sbBdSettingsWrite->setEnabled(false); sbBdSettingsWrite->setValue(0); @@ -1984,8 +2078,8 @@ void DigiSettingsPanel::ReadBoardSetting(int cbIndex){ leBdSettingsWrite->clear(); } - if( DIGIPARA::DIG::AllSettings[cbIndex].GetPara() == DIGIPARA::DIG::StartSource.GetPara() - || DIGIPARA::DIG::AllSettings[cbIndex].GetPara() == DIGIPARA::DIG::GlobalTriggerSource.GetPara() ){ + if( PHA::DIG::AllSettings[cbIndex].GetPara() == PHA::DIG::StartSource.GetPara() + || PHA::DIG::AllSettings[cbIndex].GetPara() == PHA::DIG::GlobalTriggerSource.GetPara() ){ leBdSettingsWrite->setEnabled(true); leBdSettingsWrite->clear(); @@ -1998,18 +2092,18 @@ void DigiSettingsPanel::ReadChannelSetting(int cbIndex){ enableSignalSlot = false; QString type; - switch (DIGIPARA::CH::AllSettings[cbIndex].ReadWrite()) { + switch (PHA::CH::AllSettings[cbIndex].ReadWrite()) { case RW::ReadOnly : type ="Read Only"; break; case RW::WriteOnly : type ="Write Only"; break; case RW::ReadWrite : type ="Read/Write"; break; } leChSettingsType->setText(type); - leChSettingsRead->setText(QString::fromStdString(digi[cbIQDigi->currentIndex()]->ReadValue(DIGIPARA::CH::AllSettings[cbIndex], cbIQCh->currentData().toInt()))); - leChSettingsUnit->setText(QString::fromStdString(DIGIPARA::CH::AllSettings[cbIndex].GetUnit())); + leChSettingsRead->setText(QString::fromStdString(digi[cbIQDigi->currentIndex()]->ReadValue(PHA::CH::AllSettings[cbIndex], cbIQCh->currentData().toInt()))); + leChSettingsUnit->setText(QString::fromStdString(PHA::CH::AllSettings[cbIndex].GetUnit())); - ANSTYPE haha = DIGIPARA::CH::AllSettings[cbIndex].GetAnswerType(); + ANSTYPE haha = PHA::CH::AllSettings[cbIndex].GetAnswerType(); - if( DIGIPARA::CH::AllSettings[cbIndex].ReadWrite() != RW::ReadOnly && haha != ANSTYPE::NONE ){ + if( PHA::CH::AllSettings[cbIndex].ReadWrite() != RW::ReadOnly && haha != ANSTYPE::NONE ){ if( haha == ANSTYPE::FLOAT || haha == ANSTYPE::INTEGER ){ cbChAns->clear(); @@ -2017,9 +2111,9 @@ void DigiSettingsPanel::ReadChannelSetting(int cbIndex){ leChSettingsWrite->setEnabled(false); leChSettingsWrite->clear(); sbChSettingsWrite->setEnabled(true); - sbChSettingsWrite->setMinimum(atof(DIGIPARA::CH::AllSettings[cbIndex].GetAnswers()[0].first.c_str())); - sbChSettingsWrite->setMaximum(atof(DIGIPARA::CH::AllSettings[cbIndex].GetAnswers()[1].first.c_str())); - sbChSettingsWrite->setSingleStep(atof(DIGIPARA::CH::AllSettings[cbIndex].GetAnswers()[2].first.c_str())); + sbChSettingsWrite->setMinimum(atof(PHA::CH::AllSettings[cbIndex].GetAnswers()[0].first.c_str())); + sbChSettingsWrite->setMaximum(atof(PHA::CH::AllSettings[cbIndex].GetAnswers()[1].first.c_str())); + sbChSettingsWrite->setSingleStep(atof(PHA::CH::AllSettings[cbIndex].GetAnswers()[2].first.c_str())); sbChSettingsWrite->setValue(00); sbChSettingsWrite->setDecimals(0); } @@ -2027,9 +2121,9 @@ void DigiSettingsPanel::ReadChannelSetting(int cbIndex){ if( haha == ANSTYPE::LIST){ cbChAns->setEnabled(true); cbChAns->clear(); - for( int i = 0; i < (int) DIGIPARA::CH::AllSettings[cbIndex].GetAnswers().size(); i++){ - cbChAns->addItem(QString::fromStdString(DIGIPARA::CH::AllSettings[cbIndex].GetAnswers()[i].second), - QString::fromStdString(DIGIPARA::CH::AllSettings[cbIndex].GetAnswers()[i].first)); + for( int i = 0; i < (int) PHA::CH::AllSettings[cbIndex].GetAnswers().size(); i++){ + cbChAns->addItem(QString::fromStdString(PHA::CH::AllSettings[cbIndex].GetAnswers()[i].second), + QString::fromStdString(PHA::CH::AllSettings[cbIndex].GetAnswers()[i].first)); } sbChSettingsWrite->setEnabled(false); sbChSettingsWrite->setValue(0); @@ -2058,63 +2152,45 @@ void DigiSettingsPanel::ReadChannelSetting(int cbIndex){ void DigiSettingsPanel::CheckRadioAndCheckedButtons(){ - int chFromIndex = -1; for( int i = 0 ; i < MaxNumberOfChannel ; i++){ + rbCopyChFrom[i]->setStyleSheet(""); if( rbCopyChFrom[i]->isChecked() ){ chFromIndex = i; - break; + rbCopyChFrom[i]->setStyleSheet("color : red;"); + chkChTo[i]->setChecked(false); + chkChTo[i]->setStyleSheet(""); } } - for( int i = 0 ; i < MaxNumberOfChannel ; i++) chkChTo[i]->setEnabled(true); + for( int i = 0 ; i < MaxNumberOfChannel ; i++) chkChTo[i]->setEnabled(true); if( chFromIndex >= 0 ) chkChTo[chFromIndex]->setEnabled(false); bool isToIndexCleicked = false; for( int i = 0 ; i < MaxNumberOfChannel ; i++){ - if( i == chFromIndex ) continue; if( chkChTo[i]->isChecked() ){ isToIndexCleicked = true; - break; + chkChTo[i]->setStyleSheet("color : red;"); + }else{ + chkChTo[i]->setStyleSheet(""); } } - if( chFromIndex >= 0 && isToIndexCleicked ) pbCopyChannel->setEnabled(true); + pbCopyChannel->setEnabled(chFromIndex >= 0 && isToIndexCleicked ); } -bool DigiSettingsPanel::CopyChannelSettings() -{ - int digiFromIndex = cbCopyDigiFrom->currentIndex(); - int digiToIndex = cbCopyDigiTo->currentIndex(); +bool DigiSettingsPanel::CopyChannelSettings(int digiFrom, int chFrom, int digiTo, int chTo){ - int chFromIndex = -1; - for( int i = 0 ; i < MaxNumberOfChannel ; i++){ - if( rbCopyChFrom[i]->isChecked() ){ - chFromIndex = i; + SendLogMsg("Copy Settings from DIG:" + QString::number(digi[digiFrom]->GetSerialNumber()) + ", CH:" + QString::number(chFrom) + " ---> DIG:" + QString::number(digi[digiTo]->GetSerialNumber()) + ", CH:" + QString::number(chTo)); + for( int k = 0; k < (int) PHA::CH::AllSettings.size(); k ++){ + if( PHA::CH::AllSettings[k].ReadWrite() != RW::ReadWrite ) continue; + if( !digi[digiTo]->WriteValue( PHA::CH::AllSettings[k], digi[digiFrom]->GetSettingValue(PHA::CH::AllSettings[k], chFrom) , chTo ) ){ + SendLogMsg("something wrong when copying setting : " + QString::fromStdString( PHA::CH::AllSettings[k].GetPara())) ; + return false; break; } } - if( chFromIndex < 0 ) return false; - - SendLogMsg("Copy Settings from DIG:" + QString::number(digi[digiFromIndex]->GetSerialNumber()) + ", CH:" + QString::number(chFromIndex) + " to ... "); - for( int i = 0; i < MaxNumberOfChannel; i++){ - if( chkChTo[i]->isChecked() ){ - //Copy setting - SendLogMsg(" ---> DIG:" + QString::number(digi[digiToIndex]->GetSerialNumber()) + ", CH:" + QString::number(i)); - for( int k = 0; k < (int) DIGIPARA::CH::AllSettings.size(); k ++){ - if( DIGIPARA::CH::AllSettings[k].ReadWrite() != RW::ReadWrite ) continue; - if( !digi[digiToIndex]->WriteValue( DIGIPARA::CH::AllSettings[k], digi[digiFromIndex]->GetSettingValue(DIGIPARA::CH::AllSettings[k], chFromIndex) , i ) ){ - SendLogMsg("something wrong when copying setting : " + QString::fromStdString( DIGIPARA::CH::AllSettings[k].GetPara())) ; - return false; - break; - } - } - } - } - SendLogMsg("------ done"); - ID = digiToIndex; - ShowSettingsToPanel(); return true; } @@ -2126,10 +2202,10 @@ bool DigiSettingsPanel::CopyBoardSettings(){ for( int i = 0; i < MaxNumberOfChannel; i++){ if( chkChTo[i]->isChecked() ){ //Copy setting - for( int k = 0; k < (int) DIGIPARA::DIG::AllSettings.size(); k ++){ - if( DIGIPARA::DIG::AllSettings[k].ReadWrite() != RW::ReadWrite ) continue; - if( ! digi[digiToIndex]->WriteValue( DIGIPARA::DIG::AllSettings[k], digi[digiFromIndex]->GetSettingValue(DIGIPARA::DIG::AllSettings[k])) ){ - SendLogMsg("something wrong when copying setting : " + QString::fromStdString( DIGIPARA::DIG::AllSettings[k].GetPara())) ; + for( int k = 0; k < (int) PHA::DIG::AllSettings.size(); k ++){ + if( PHA::DIG::AllSettings[k].ReadWrite() != RW::ReadWrite ) continue; + if( ! digi[digiToIndex]->WriteValue( PHA::DIG::AllSettings[k], digi[digiFromIndex]->GetSettingValue(PHA::DIG::AllSettings[k])) ){ + SendLogMsg("something wrong when copying setting : " + QString::fromStdString( PHA::DIG::AllSettings[k].GetPara())) ; return false; break; } @@ -2143,5 +2219,13 @@ bool DigiSettingsPanel::CopyBoardSettings(){ } bool DigiSettingsPanel::CopyWholeDigitizer(){ - return CopyChannelSettings() | CopyBoardSettings(); + if( !CopyBoardSettings() ) return false; + + int digiTo = cbCopyDigiTo->currentIndex(); + + for( int ch = 0; ch < digi[ID]->GetNChannels() ; ch ++){ + if ( ! CopyChannelSettings(cbCopyDigiFrom->currentIndex(), ch, digiTo, ch ) ) return false; + } + + return true; } diff --git a/digiSettingsPanel.h b/digiSettingsPanel.h index 3cf637e..4b678fe 100644 --- a/digiSettingsPanel.h +++ b/digiSettingsPanel.h @@ -34,6 +34,7 @@ public: private slots: void onTriggerClick(int haha); + void ReadTriggerMap(); void SaveSettings(); void LoadSettings(); @@ -156,8 +157,12 @@ private: RSpinBox * VGA[MaxNumberOfDigitizer][4]; //--------------- trigger map - QPushButton *bn[MaxNumberOfChannel][MaxNumberOfChannel]; - bool bnClickStatus[MaxNumberOfChannel][MaxNumberOfChannel]; + RComboBox * cbAllEvtTrigger; + RComboBox * cbAllWaveTrigger; + RComboBox * cbAllCoinMask; + RSpinBox * sbAllCoinLength; + QPushButton * trgMap[MaxNumberOfChannel][MaxNumberOfChannel]; + bool trgMapClickStatus[MaxNumberOfChannel][MaxNumberOfChannel]; //--------------- Channel status QPushButton * chStatus[MaxNumberOfDigitizer][MaxNumberOfChannel][9]; @@ -221,6 +226,7 @@ private: //------------------------- QLineEdit * leSettingFile[MaxNumberOfDigitizer]; + void SetStartSource(); void SetGlobalTriggerSource(); @@ -228,7 +234,7 @@ private: void SetupShortComboBox(RComboBox * &cbb, Reg para); void SetupComboBox(RComboBox * &cbb, const Reg para, int ch_index, bool isMaster, QString labelTxt, QGridLayout * layout, int row, int col, int srow = 1, int scol = 1); - void SetupSpinBox(RSpinBox * &spb, const Reg para, int ch_index, QString labelTxt, QGridLayout * layout, int row, int col, int srow = 1, int scol = 1); + void SetupSpinBox(RSpinBox * &spb, const Reg para, int ch_index, bool isMaster, QString labelTxt, QGridLayout * layout, int row, int col, int srow = 1, int scol = 1); void SyncComboBox(RComboBox *(&cbb)[][MaxNumberOfChannel+1], int ch); void SyncSpinBox(RSpinBox *(&spb)[][MaxNumberOfChannel+1], int ch); @@ -243,7 +249,7 @@ private: void ReadChannelSetting(int cbIndex); void CheckRadioAndCheckedButtons(); - bool CopyChannelSettings(); + bool CopyChannelSettings(int digiFrom, int chFrom, int digiTo, int chTo); bool CopyBoardSettings(); bool CopyWholeDigitizer(); diff --git a/mainwindow.cpp b/mainwindow.cpp index b227b01..359f077 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -748,10 +748,10 @@ void MainWindow::UpdateScalar(){ //=========== another method, directly readValue digiMTX.lock(); for( int ch = 0; ch < digi[iDigi]->GetNChannels(); ch ++){ - std::string time = digi[iDigi]->ReadValue(DIGIPARA::CH::ChannelRealtime, ch); // for refreashing SelfTrgRate and SavedCount - haha[ch] = digi[iDigi]->ReadValue(DIGIPARA::CH::SelfTrgRate, ch); + std::string time = digi[iDigi]->ReadValue(PHA::CH::ChannelRealtime, ch); // for refreashing SelfTrgRate and SavedCount + haha[ch] = digi[iDigi]->ReadValue(PHA::CH::SelfTrgRate, ch); leTrigger[iDigi][ch]->setText(QString::fromStdString(haha[ch])); - std::string kaka = digi[iDigi]->ReadValue(DIGIPARA::CH::ChannelSavedCount, ch); + std::string kaka = digi[iDigi]->ReadValue(PHA::CH::ChannelSavedCount, ch); acceptRate[ch] = atoi(kaka.c_str())*1e9*1.0 / atol(time.c_str()); //if( kaka != "0" ) printf("%s, %s | %.2f\n", time.c_str(), kaka.c_str(), acceptRate); leAccept[iDigi][ch]->setText(QString::number(acceptRate[ch],'f', 1)); diff --git a/scope.cpp b/scope.cpp index ffdb487..c2b82cc 100644 --- a/scope.cpp +++ b/scope.cpp @@ -82,8 +82,8 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat int iDigi = cbScopeDigi->currentIndex(); int ch = cbScopeCh->currentIndex(); digiMTX.lock(); - digi[iDigi]->WriteValue(DIGIPARA::CH::ChannelEnable, "False", -1); - digi[iDigi]->WriteValue(DIGIPARA::CH::ChannelEnable, "True", ch); + digi[iDigi]->WriteValue(PHA::CH::ChannelEnable, "False", -1); + digi[iDigi]->WriteValue(PHA::CH::ChannelEnable, "True", ch); ReadScopeSettings(); UpdateSettingsPanel(); digiMTX.unlock(); @@ -123,9 +123,9 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat rowID ++; //TODO --- add None cbAnaProbe[0] = new RComboBox(this); - for( int i = 0; i < (int) DIGIPARA::CH::WaveAnalogProbe0.GetAnswers().size(); i++ ) { - cbAnaProbe[0]->addItem(QString::fromStdString((DIGIPARA::CH::WaveAnalogProbe0.GetAnswers())[i].second), - QString::fromStdString((DIGIPARA::CH::WaveAnalogProbe0.GetAnswers())[i].first)); + for( int i = 0; i < (int) PHA::CH::WaveAnalogProbe0.GetAnswers().size(); i++ ) { + cbAnaProbe[0]->addItem(QString::fromStdString((PHA::CH::WaveAnalogProbe0.GetAnswers())[i].second), + QString::fromStdString((PHA::CH::WaveAnalogProbe0.GetAnswers())[i].first)); } cbAnaProbe[1] = new RComboBox(this); @@ -144,7 +144,7 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat int ch = cbScopeCh->currentIndex(); if( chkSetAllChannel->isChecked() ) ch = -1; digiMTX.lock(); - digi[iDigi]->WriteValue(DIGIPARA::CH::WaveAnalogProbe0, (cbAnaProbe[0]->currentData()).toString().toStdString(), ch); + digi[iDigi]->WriteValue(PHA::CH::WaveAnalogProbe0, (cbAnaProbe[0]->currentData()).toString().toStdString(), ch); digiMTX.unlock(); }); @@ -154,15 +154,15 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat int ch = cbScopeCh->currentIndex(); if( chkSetAllChannel->isChecked() ) ch = -1; digiMTX.lock(); - digi[iDigi]->WriteValue(DIGIPARA::CH::WaveAnalogProbe1, (cbAnaProbe[1]->currentData()).toString().toStdString(), ch); + digi[iDigi]->WriteValue(PHA::CH::WaveAnalogProbe1, (cbAnaProbe[1]->currentData()).toString().toStdString(), ch); digiMTX.unlock(); }); //TODO --- add None cbDigProbe[0] = new RComboBox(this); - for( int i = 0; i < (int) DIGIPARA::CH::WaveDigitalProbe0.GetAnswers().size(); i++ ) { - cbDigProbe[0]->addItem(QString::fromStdString((DIGIPARA::CH::WaveDigitalProbe0.GetAnswers())[i].second), - QString::fromStdString((DIGIPARA::CH::WaveDigitalProbe0.GetAnswers())[i].first)); + for( int i = 0; i < (int) PHA::CH::WaveDigitalProbe0.GetAnswers().size(); i++ ) { + cbDigProbe[0]->addItem(QString::fromStdString((PHA::CH::WaveDigitalProbe0.GetAnswers())[i].second), + QString::fromStdString((PHA::CH::WaveDigitalProbe0.GetAnswers())[i].first)); } cbDigProbe[1] = new RComboBox(this); @@ -191,7 +191,7 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat int ch = cbScopeCh->currentIndex(); if( chkSetAllChannel->isChecked() ) ch = -1; digiMTX.lock(); - digi[iDigi]->WriteValue(DIGIPARA::CH::WaveDigitalProbe0, (cbDigProbe[0]->currentData()).toString().toStdString(), ch); + digi[iDigi]->WriteValue(PHA::CH::WaveDigitalProbe0, (cbDigProbe[0]->currentData()).toString().toStdString(), ch); digiMTX.unlock(); }); connect(cbDigProbe[1], &RComboBox::currentIndexChanged, this, [=](){ @@ -200,7 +200,7 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat int ch = cbScopeCh->currentIndex(); if( chkSetAllChannel->isChecked() ) ch = -1; digiMTX.lock(); - digi[iDigi]->WriteValue(DIGIPARA::CH::WaveDigitalProbe1, (cbDigProbe[1]->currentData()).toString().toStdString(), ch); + digi[iDigi]->WriteValue(PHA::CH::WaveDigitalProbe1, (cbDigProbe[1]->currentData()).toString().toStdString(), ch); digiMTX.unlock(); }); connect(cbDigProbe[2], &RComboBox::currentIndexChanged, this, [=](){ @@ -209,7 +209,7 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat int ch = cbScopeCh->currentIndex(); if( chkSetAllChannel->isChecked() ) ch = -1; digiMTX.lock(); - digi[iDigi]->WriteValue(DIGIPARA::CH::WaveDigitalProbe2, (cbDigProbe[2]->currentData()).toString().toStdString(), ch); + digi[iDigi]->WriteValue(PHA::CH::WaveDigitalProbe2, (cbDigProbe[2]->currentData()).toString().toStdString(), ch); digiMTX.unlock(); }); connect(cbDigProbe[3], &RComboBox::currentIndexChanged, this, [=](){ @@ -218,7 +218,7 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat int ch = cbScopeCh->currentIndex(); if( chkSetAllChannel->isChecked() ) ch = -1; digiMTX.lock(); - digi[iDigi]->WriteValue(DIGIPARA::CH::WaveDigitalProbe3, (cbDigProbe[3]->currentData()).toString().toStdString(), ch); + digi[iDigi]->WriteValue(PHA::CH::WaveDigitalProbe3, (cbDigProbe[3]->currentData()).toString().toStdString(), ch); digiMTX.unlock(); }); @@ -240,30 +240,30 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat QGridLayout * bLayout = new QGridLayout(box); bLayout->setSpacing(0); - ScopeMakeSpinBox(sbRL, "Record Lenght [ns] ", bLayout, 0, 0, DIGIPARA::CH::RecordLength); - ScopeMakeSpinBox(sbThreshold, "Threshold [LSB] ", bLayout, 0, 2, DIGIPARA::CH::TriggerThreshold); - ScopeMakeComoBox(cbPolarity, "Polarity ", bLayout, 0, 4, DIGIPARA::CH::Polarity); - ScopeMakeComoBox(cbWaveRes, "Wave Re. ", bLayout, 0, 6, DIGIPARA::CH::WaveResolution); + ScopeMakeSpinBox(sbRL, "Record Lenght [ns] ", bLayout, 0, 0, PHA::CH::RecordLength); + ScopeMakeSpinBox(sbThreshold, "Threshold [LSB] ", bLayout, 0, 2, PHA::CH::TriggerThreshold); + ScopeMakeComoBox(cbPolarity, "Polarity ", bLayout, 0, 4, PHA::CH::Polarity); + ScopeMakeComoBox(cbWaveRes, "Wave Re. ", bLayout, 0, 6, PHA::CH::WaveResolution); //------------------ next row - ScopeMakeSpinBox(sbPT, "Pre Trigger [ns] ", bLayout, 1, 0, DIGIPARA::CH::PreTrigger); - ScopeMakeSpinBox(sbDCOffset, "DC offset [%] ", bLayout, 1, 2, DIGIPARA::CH::DC_Offset); - ScopeMakeSpinBox(sbTimeRiseTime, "Trigger Rise Time [ns] ", bLayout, 1, 4, DIGIPARA::CH::TimeFilterRiseTime); - ScopeMakeSpinBox(sbTimeGuard, "Trigger Guard [ns] ", bLayout, 1, 6, DIGIPARA::CH::TimeFilterRetriggerGuard); + ScopeMakeSpinBox(sbPT, "Pre Trigger [ns] ", bLayout, 1, 0, PHA::CH::PreTrigger); + ScopeMakeSpinBox(sbDCOffset, "DC offset [%] ", bLayout, 1, 2, PHA::CH::DC_Offset); + ScopeMakeSpinBox(sbTimeRiseTime, "Trigger Rise Time [ns] ", bLayout, 1, 4, PHA::CH::TimeFilterRiseTime); + ScopeMakeSpinBox(sbTimeGuard, "Trigger Guard [ns] ", bLayout, 1, 6, PHA::CH::TimeFilterRetriggerGuard); //----------------- next row - ScopeMakeSpinBox(sbTrapRiseTime, "Trap. Rise Time [ns] ", bLayout, 2, 0, DIGIPARA::CH::EnergyFilterRiseTime); - ScopeMakeSpinBox(sbTrapFlatTop, "Trap. Flat Top [ns] ", bLayout, 2, 2, DIGIPARA::CH::EnergyFilterFlatTop); - ScopeMakeSpinBox(sbTrapPoleZero, "Trap. Pole Zero [ns] ", bLayout, 2, 4, DIGIPARA::CH::EnergyFilterPoleZero); - ScopeMakeSpinBox(sbEnergyFineGain, "Energy Fine Gain ", bLayout, 2, 6, DIGIPARA::CH::EnergyFilterFineGain); + ScopeMakeSpinBox(sbTrapRiseTime, "Trap. Rise Time [ns] ", bLayout, 2, 0, PHA::CH::EnergyFilterRiseTime); + ScopeMakeSpinBox(sbTrapFlatTop, "Trap. Flat Top [ns] ", bLayout, 2, 2, PHA::CH::EnergyFilterFlatTop); + ScopeMakeSpinBox(sbTrapPoleZero, "Trap. Pole Zero [ns] ", bLayout, 2, 4, PHA::CH::EnergyFilterPoleZero); + ScopeMakeSpinBox(sbEnergyFineGain, "Energy Fine Gain ", bLayout, 2, 6, PHA::CH::EnergyFilterFineGain); //----------------- next row - ScopeMakeSpinBox(sbTrapPeaking, "Trap. Peaking [%] ", bLayout, 3, 0, DIGIPARA::CH::EnergyFilterPeakingPosition); - ScopeMakeComoBox(cbTrapPeakAvg, "Trap. Peaking ", bLayout, 3, 2, DIGIPARA::CH::EnergyFilterPeakingAvg); - ScopeMakeSpinBox(sbBaselineGuard, "Baseline Guard [ns] ", bLayout, 3, 4, DIGIPARA::CH::EnergyFilterBaselineGuard); - ScopeMakeComoBox(cbBaselineAvg, "Baseline Avg ", bLayout, 3, 6, DIGIPARA::CH::EnergyFilterBaselineAvg); - ScopeMakeSpinBox(sbPileUpGuard, "Pile-up Guard [ns] ", bLayout, 4, 0, DIGIPARA::CH::EnergyFilterPileUpGuard); - ScopeMakeComoBox(cbLowFreqFilter, "Low Freq. Filter ", bLayout, 4, 2, DIGIPARA::CH::EnergyFilterLowFreqFilter); + ScopeMakeSpinBox(sbTrapPeaking, "Trap. Peaking [%] ", bLayout, 3, 0, PHA::CH::EnergyFilterPeakingPosition); + ScopeMakeComoBox(cbTrapPeakAvg, "Trap. Peaking ", bLayout, 3, 2, PHA::CH::EnergyFilterPeakingAvg); + ScopeMakeSpinBox(sbBaselineGuard, "Baseline Guard [ns] ", bLayout, 3, 4, PHA::CH::EnergyFilterBaselineGuard); + ScopeMakeComoBox(cbBaselineAvg, "Baseline Avg ", bLayout, 3, 6, PHA::CH::EnergyFilterBaselineAvg); + ScopeMakeSpinBox(sbPileUpGuard, "Pile-up Guard [ns] ", bLayout, 4, 0, PHA::CH::EnergyFilterPileUpGuard); + ScopeMakeComoBox(cbLowFreqFilter, "Low Freq. Filter ", bLayout, 4, 2, PHA::CH::EnergyFilterLowFreqFilter); } @@ -283,7 +283,7 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat layout->addWidget(lbinfo, rowID, 5); rowID ++; - QLabel * lbinfo2 = new QLabel("Maximum time range is " + QString::number(MaxDisplayTraceDataLength * DIGIPARA::TraceStep) + " ns due to processing speed.", this); + QLabel * lbinfo2 = new QLabel("Maximum time range is " + QString::number(MaxDisplayTraceDataLength * PHA::TraceStep) + " ns due to processing speed.", this); layout->addWidget(lbinfo2, rowID, 0, 1, 5); @@ -343,32 +343,32 @@ void Scope::ReadScopeSettings(){ allowChange = false; for( int i = 0 ; i < 2; i++){ - ScopeReadComboBoxValue(iDigi, ch, cbAnaProbe[i], DIGIPARA::CH::AnalogProbe[i]); + ScopeReadComboBoxValue(iDigi, ch, cbAnaProbe[i], PHA::CH::AnalogProbe[i]); } for( int i = 0 ; i < 4; i++){ - ScopeReadComboBoxValue(iDigi, ch, cbDigProbe[i], DIGIPARA::CH::DigitalProbe[i]); + ScopeReadComboBoxValue(iDigi, ch, cbDigProbe[i], PHA::CH::DigitalProbe[i]); } - ScopeReadComboBoxValue(iDigi, ch, cbPolarity, DIGIPARA::CH::Polarity); - ScopeReadComboBoxValue(iDigi, ch, cbWaveRes, DIGIPARA::CH::WaveResolution); - ScopeReadComboBoxValue(iDigi, ch, cbTrapPeakAvg, DIGIPARA::CH::EnergyFilterPeakingAvg); - ScopeReadComboBoxValue(iDigi, ch, cbBaselineAvg, DIGIPARA::CH::EnergyFilterBaselineAvg); - ScopeReadComboBoxValue(iDigi, ch, cbLowFreqFilter, DIGIPARA::CH::EnergyFilterLowFreqFilter); + ScopeReadComboBoxValue(iDigi, ch, cbPolarity, PHA::CH::Polarity); + ScopeReadComboBoxValue(iDigi, ch, cbWaveRes, PHA::CH::WaveResolution); + ScopeReadComboBoxValue(iDigi, ch, cbTrapPeakAvg, PHA::CH::EnergyFilterPeakingAvg); + ScopeReadComboBoxValue(iDigi, ch, cbBaselineAvg, PHA::CH::EnergyFilterBaselineAvg); + ScopeReadComboBoxValue(iDigi, ch, cbLowFreqFilter, PHA::CH::EnergyFilterLowFreqFilter); - ScopeReadSpinBoxValue(iDigi, ch, sbRL, DIGIPARA::CH::RecordLength); - ScopeReadSpinBoxValue(iDigi, ch, sbPT, DIGIPARA::CH::PreTrigger); - ScopeReadSpinBoxValue(iDigi, ch, sbDCOffset, DIGIPARA::CH::DC_Offset); - ScopeReadSpinBoxValue(iDigi, ch, sbThreshold, DIGIPARA::CH::TriggerThreshold); - ScopeReadSpinBoxValue(iDigi, ch, sbTimeRiseTime, DIGIPARA::CH::TimeFilterRiseTime); - ScopeReadSpinBoxValue(iDigi, ch, sbTimeGuard, DIGIPARA::CH::TimeFilterRetriggerGuard); - ScopeReadSpinBoxValue(iDigi, ch, sbTrapRiseTime, DIGIPARA::CH::EnergyFilterRiseTime); - ScopeReadSpinBoxValue(iDigi, ch, sbTrapFlatTop, DIGIPARA::CH::EnergyFilterFlatTop); - ScopeReadSpinBoxValue(iDigi, ch, sbTrapPoleZero, DIGIPARA::CH::EnergyFilterPoleZero); - ScopeReadSpinBoxValue(iDigi, ch, sbEnergyFineGain, DIGIPARA::CH::EnergyFilterFineGain); - ScopeReadSpinBoxValue(iDigi, ch, sbTrapPeaking, DIGIPARA::CH::EnergyFilterPeakingPosition); - ScopeReadSpinBoxValue(iDigi, ch, sbBaselineGuard, DIGIPARA::CH::EnergyFilterBaselineGuard); - ScopeReadSpinBoxValue(iDigi, ch, sbPileUpGuard, DIGIPARA::CH::EnergyFilterPileUpGuard); + ScopeReadSpinBoxValue(iDigi, ch, sbRL, PHA::CH::RecordLength); + ScopeReadSpinBoxValue(iDigi, ch, sbPT, PHA::CH::PreTrigger); + ScopeReadSpinBoxValue(iDigi, ch, sbDCOffset, PHA::CH::DC_Offset); + ScopeReadSpinBoxValue(iDigi, ch, sbThreshold, PHA::CH::TriggerThreshold); + ScopeReadSpinBoxValue(iDigi, ch, sbTimeRiseTime, PHA::CH::TimeFilterRiseTime); + ScopeReadSpinBoxValue(iDigi, ch, sbTimeGuard, PHA::CH::TimeFilterRetriggerGuard); + ScopeReadSpinBoxValue(iDigi, ch, sbTrapRiseTime, PHA::CH::EnergyFilterRiseTime); + ScopeReadSpinBoxValue(iDigi, ch, sbTrapFlatTop, PHA::CH::EnergyFilterFlatTop); + ScopeReadSpinBoxValue(iDigi, ch, sbTrapPoleZero, PHA::CH::EnergyFilterPoleZero); + ScopeReadSpinBoxValue(iDigi, ch, sbEnergyFineGain, PHA::CH::EnergyFilterFineGain); + ScopeReadSpinBoxValue(iDigi, ch, sbTrapPeaking, PHA::CH::EnergyFilterPeakingPosition); + ScopeReadSpinBoxValue(iDigi, ch, sbBaselineGuard, PHA::CH::EnergyFilterBaselineGuard); + ScopeReadSpinBoxValue(iDigi, ch, sbPileUpGuard, PHA::CH::EnergyFilterPileUpGuard); sbRL->setStyleSheet(""); sbPT->setStyleSheet(""); @@ -403,8 +403,8 @@ void Scope::StartScope(){ ReadScopeSettings(); - digi[iDigi]->WriteValue(DIGIPARA::CH::ChannelEnable, "False", -1); - digi[iDigi]->WriteValue(DIGIPARA::CH::ChannelEnable, "True", ch); + digi[iDigi]->WriteValue(PHA::CH::ChannelEnable, "False", -1); + digi[iDigi]->WriteValue(PHA::CH::ChannelEnable, "True", ch); digi[iDigi]->SetPHADataFormat(0); digi[iDigi]->StartACQ(); @@ -433,7 +433,7 @@ void Scope::StopScope(){ if( digi[i]->IsDummy() ) continue; digiMTX.lock(); digi[i]->StopACQ(); - digi[i]->WriteValue(DIGIPARA::CH::ChannelEnable, "True", -1); + digi[i]->WriteValue(PHA::CH::ChannelEnable, "True", -1); digiMTX.unlock(); readDataThread[i]->quit(); @@ -452,15 +452,15 @@ void Scope::UpdateScope(){ int iDigi = cbScopeDigi->currentIndex(); int ch = cbScopeCh->currentIndex(); - int sample2ns = DIGIPARA::TraceStep * (1 << cbWaveRes->currentIndex()); + int sample2ns = PHA::TraceStep * (1 << cbWaveRes->currentIndex()); emit UpdateScalar(); if( digi ){ digiMTX.lock(); - std::string time = digi[iDigi]->ReadValue(DIGIPARA::CH::ChannelRealtime, ch); // for refreashing SelfTrgRate and SavedCount - std::string haha = digi[iDigi]->ReadValue(DIGIPARA::CH::SelfTrgRate, ch); + std::string time = digi[iDigi]->ReadValue(PHA::CH::ChannelRealtime, ch); // for refreashing SelfTrgRate and SavedCount + std::string haha = digi[iDigi]->ReadValue(PHA::CH::SelfTrgRate, ch); leTriggerRate->setText(QString::fromStdString(haha)); if( atoi(haha.c_str()) == 0 ) { digiMTX.unlock(); diff --git a/test.cpp b/test.cpp index 6a05d92..6c780e4 100644 --- a/test.cpp +++ b/test.cpp @@ -98,7 +98,7 @@ int main(int argc, char* argv[]){ //printf("===================================\n"); - printf("======== index : %d \n", digi->FindIndex(DIGIPARA::CH::ChannelEnable)); + printf("======== index : %d \n", digi->FindIndex(PHA::CH::ChannelEnable)); //digi->LoadSettingsFromFile("settings_21245.dat"); //printf("%s \n", digi->ReadValue("/ch/0/par/ChRealtimeMonitor").c_str());