add all connections for combox and spinbox

This commit is contained in:
Ryan Tang 2023-03-01 18:27:17 -05:00
parent 44897f79d2
commit eba1f5da52
3 changed files with 170 additions and 140 deletions

View File

@ -43,8 +43,6 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
//@========================== Tab for each digitizer //@========================== Tab for each digitizer
for(unsigned short iDigi = 0; iDigi < this->nDigi; iDigi++){ for(unsigned short iDigi = 0; iDigi < this->nDigi; iDigi++){
const int nChannel = digi[iDigi]->GetNChannels();
QScrollArea * scrollArea = new QScrollArea(this); QScrollArea * scrollArea = new QScrollArea(this);
scrollArea->setWidgetResizable(true); scrollArea->setWidgetResizable(true);
scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
@ -208,6 +206,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
} }
{//^====================== Group Board settings {//^====================== Group Board settings
QGroupBox * digiBox = new QGroupBox("Board Settings", tab); QGroupBox * digiBox = new QGroupBox("Board Settings", tab);
//digiBox->setSizePolicy(sizePolicy); //digiBox->setSizePolicy(sizePolicy);
@ -216,7 +215,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
int rowId = 0; int rowId = 0;
//------------------------------------- //-------------------------------------
SetupComboBox(cbbClockSource[iDigi], DIGIPARA::DIG::ClockSource, -1, "Clock Source :", boardLayout, rowId, 0, 1, 2); SetupComboBox(cbbClockSource[iDigi], DIGIPARA::DIG::ClockSource, -1, true, "Clock Source :", boardLayout, rowId, 0, 1, 2);
//------------------------------------- //-------------------------------------
rowId ++; rowId ++;
@ -243,11 +242,11 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
//------------------------------------- //-------------------------------------
rowId ++; rowId ++;
SetupComboBox(cbbTrgOut[iDigi], DIGIPARA::DIG::TrgOutMode, -1, "Trg-OUT Mode :", boardLayout, rowId, 0, 1, 2); SetupComboBox(cbbTrgOut[iDigi], DIGIPARA::DIG::TrgOutMode, -1, true, "Trg-OUT Mode :", boardLayout, rowId, 0, 1, 2);
//------------------------------------- //-------------------------------------
rowId ++; rowId ++;
SetupComboBox(cbbGPIO[iDigi], DIGIPARA::DIG::GPIOMode, -1, "GPIO Mode :", boardLayout, rowId, 0, 1, 2); SetupComboBox(cbbGPIO[iDigi], DIGIPARA::DIG::GPIOMode, -1, true, "GPIO Mode :", boardLayout, rowId, 0, 1, 2);
//------------------------------------- //-------------------------------------
QLabel * lbAutoDisarmAcq = new QLabel("Auto disarm ACQ :", tab); QLabel * lbAutoDisarmAcq = new QLabel("Auto disarm ACQ :", tab);
@ -260,7 +259,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
//------------------------------------- //-------------------------------------
rowId ++; rowId ++;
SetupComboBox(cbbBusyIn[iDigi], DIGIPARA::DIG::BusyInSource, -1, "Busy In Source :", boardLayout, rowId, 0, 1, 2); SetupComboBox(cbbBusyIn[iDigi], DIGIPARA::DIG::BusyInSource, -1, true, "Busy In Source :", boardLayout, rowId, 0, 1, 2);
QLabel * lbStatEvents = new QLabel("Stat. Event :", tab); QLabel * lbStatEvents = new QLabel("Stat. Event :", tab);
lbStatEvents->setAlignment(Qt::AlignRight); lbStatEvents->setAlignment(Qt::AlignRight);
@ -276,11 +275,11 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
//------------------------------------- //-------------------------------------
rowId ++; rowId ++;
SetupComboBox(cbbSyncOut[iDigi], DIGIPARA::DIG::SyncOutMode, -1, "Sync Out mode :", boardLayout, rowId, 0, 1, 2); SetupComboBox(cbbSyncOut[iDigi], DIGIPARA::DIG::SyncOutMode, -1, true, "Sync Out mode :", boardLayout, rowId, 0, 1, 2);
//------------------------------------- //-------------------------------------
rowId ++; rowId ++;
SetupComboBox(cbbBoardVetoSource[iDigi], DIGIPARA::DIG::BoardVetoSource, -1, "Board Veto Source :", boardLayout, rowId, 0, 1, 2); SetupComboBox(cbbBoardVetoSource[iDigi], DIGIPARA::DIG::BoardVetoSource, -1, true, "Board Veto Source :", boardLayout, rowId, 0, 1, 2);
QLabel * lbBdVetoWidth = new QLabel("Board Veto Width [ns] :", tab); QLabel * lbBdVetoWidth = new QLabel("Board Veto Width [ns] :", tab);
lbBdVetoWidth->setAlignment(Qt::AlignRight); lbBdVetoWidth->setAlignment(Qt::AlignRight);
@ -291,8 +290,11 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
spbBdVetoWidth[iDigi]->setMaximum(38360); spbBdVetoWidth[iDigi]->setMaximum(38360);
spbBdVetoWidth[iDigi]->setSingleStep(20); spbBdVetoWidth[iDigi]->setSingleStep(20);
boardLayout->addWidget(spbBdVetoWidth[iDigi], rowId, 5); boardLayout->addWidget(spbBdVetoWidth[iDigi], rowId, 5);
//TODO---- make connection connect(spbBdVetoWidth[iDigi], &QSpinBox::valueChanged, this, [=](){
if( !enableSignalSlot ) return;
//printf("%s %d %d \n", para.GetPara().c_str(), ch_index, spb->value());
digi[ID]->WriteValue(DIGIPARA::DIG::BoardVetoWidth, std::to_string(spbBdVetoWidth[iDigi]->value()), -1);
});
cbbBdVetoPolarity[iDigi] = new QComboBox(tab); cbbBdVetoPolarity[iDigi] = new QComboBox(tab);
boardLayout->addWidget(cbbBdVetoPolarity[iDigi], rowId, 6); boardLayout->addWidget(cbbBdVetoPolarity[iDigi], rowId, 6);
@ -300,7 +302,6 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
//------------------------------------- //-------------------------------------
rowId ++; rowId ++;
spbRunDelay[iDigi] = new QSpinBox(tab);
SetupSpinBox(spbRunDelay[iDigi], DIGIPARA::DIG::RunDelay, -1, "Run Delay [ns] :", boardLayout, rowId, 0); SetupSpinBox(spbRunDelay[iDigi], DIGIPARA::DIG::RunDelay, -1, "Run Delay [ns] :", boardLayout, rowId, 0);
//------------------------------------- //-------------------------------------
@ -313,11 +314,15 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
dsbVolatileClockOutDelay[iDigi]->setMaximum(18888.888); dsbVolatileClockOutDelay[iDigi]->setMaximum(18888.888);
dsbVolatileClockOutDelay[iDigi]->setValue(0); dsbVolatileClockOutDelay[iDigi]->setValue(0);
boardLayout->addWidget(dsbVolatileClockOutDelay[iDigi], rowId, 5); boardLayout->addWidget(dsbVolatileClockOutDelay[iDigi], rowId, 5);
connect(dsbVolatileClockOutDelay[iDigi], &QDoubleSpinBox::valueChanged, this, [=](){
if( !enableSignalSlot ) return;
//printf("%s %d %d \n", para.GetPara().c_str(), ch_index, spb->value());
digi[ID]->WriteValue(DIGIPARA::DIG::VolatileClockOutDelay, std::to_string(dsbVolatileClockOutDelay[iDigi]->value()), -1);
});
//------------------------------------- //-------------------------------------
rowId ++; rowId ++;
SetupComboBox(cbbIOLevel[iDigi], DIGIPARA::DIG::IO_Level, -1, "IO Level :", boardLayout, rowId, 0, 1, 2); SetupComboBox(cbbIOLevel[iDigi], DIGIPARA::DIG::IO_Level, -1, true, "IO Level :", boardLayout, rowId, 0, 1, 2);
QLabel * lbClockOutDelay2 = new QLabel("Perm. Clock Out Delay [ps] :", tab); QLabel * lbClockOutDelay2 = new QLabel("Perm. Clock Out Delay [ps] :", tab);
lbClockOutDelay2->setAlignment(Qt::AlignRight); lbClockOutDelay2->setAlignment(Qt::AlignRight);
@ -328,7 +333,11 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
dsbClockOutDelay[iDigi]->setMaximum(18888.888); dsbClockOutDelay[iDigi]->setMaximum(18888.888);
dsbClockOutDelay[iDigi]->setValue(0); dsbClockOutDelay[iDigi]->setValue(0);
boardLayout->addWidget(dsbClockOutDelay[iDigi], rowId, 5); boardLayout->addWidget(dsbClockOutDelay[iDigi], rowId, 5);
connect(dsbClockOutDelay[iDigi], &QDoubleSpinBox::valueChanged, this, [=](){
if( !enableSignalSlot ) return;
//printf("%s %d %d \n", para.GetPara().c_str(), ch_index, spb->value());
digi[ID]->WriteValue(DIGIPARA::DIG::VolatileClockOutDelay, std::to_string(dsbClockOutDelay[iDigi]->value()), -1);
});
} }
{//^====================== Test Pulse settings {//^====================== Test Pulse settings
@ -376,7 +385,6 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
testPulseLayout->addWidget(spbTestPusleHighLevel[iDigi], 1, 3); testPulseLayout->addWidget(spbTestPusleHighLevel[iDigi], 1, 3);
} }
{//^====================== Group channel settings {//^====================== Group channel settings
QGroupBox * chBox = new QGroupBox("Channel Settings", tab); QGroupBox * chBox = new QGroupBox("Channel Settings", tab);
//chBox->setSizePolicy(sizePolicy); //chBox->setSizePolicy(sizePolicy);
@ -385,9 +393,6 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
QTabWidget * chTabWidget = new QTabWidget(tab); chLayout->addWidget(chTabWidget); QTabWidget * chTabWidget = new QTabWidget(tab); chLayout->addWidget(chTabWidget);
QSignalMapper * onOffMapper = new QSignalMapper(tab);
connect(onOffMapper, &QSignalMapper::mappedInt, this, &DigiSettingsPanel::onChannelonOff);
{//@.......... All Settings tab {//@.......... All Settings tab
QWidget * tab_All = new QWidget(tab); QWidget * tab_All = new QWidget(tab);
//tab_All->setStyleSheet("background-color: #EEEEEE"); //tab_All->setStyleSheet("background-color: #EEEEEE");
@ -405,28 +410,18 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
QGridLayout * layout1 = new QGridLayout(box1); QGridLayout * layout1 = new QGridLayout(box1);
rowID = 0; rowID = 0;
ckbChEnabled = new QCheckBox **[nDigi]; SetupComboBox(cbbOnOff[iDigi][ch], DIGIPARA::CH::ChannelEnable, -1, true, "On/Off", layout1, rowID, 0);
for( int i = 0; i < nDigi; i++) {
ckbChEnabled[i] = new QCheckBox * [nChannel + 1];
for( int j = 0; j < nChannel + 1; j ++){
ckbChEnabled[i][j] = new QCheckBox("On/Off", tab);
}
}
ckbChEnabled[iDigi][ch]->setLayoutDirection(Qt::RightToLeft);
layout1->addWidget(ckbChEnabled[iDigi][ch], rowID, 0);
onOffMapper->setMapping(ckbChEnabled[iDigi][ch], (iDigi << 12) + ch);
connect(ckbChEnabled[iDigi][ch], SIGNAL(clicked()), onOffMapper, SLOT(map()));
SetupComboBox(cbbWaveSource[iDigi][ch], DIGIPARA::CH::WaveDataSource, -1, "Wave Data Source", layout1, rowID, 1, 1, 2);
rowID ++; rowID ++;
SetupComboBox(cbbWaveRes[iDigi][ch], DIGIPARA::CH::WaveResolution, -1, "Wave Resol.", layout1, rowID, 0); SetupComboBox(cbbWaveSource[iDigi][ch], DIGIPARA::CH::WaveDataSource, -1, true, "Wave Data Source", layout1, rowID, 0, 1, 2);
SetupComboBox(cbbWaveSave[iDigi][ch], DIGIPARA::CH::WaveSaving, -1, "Wave Save", layout1, rowID, 2);
rowID ++; rowID ++;
SetupComboBox(cbbParity[iDigi][ch], DIGIPARA::CH::Polarity, -1, "Parity", layout1, rowID, 0); SetupComboBox(cbbWaveRes[iDigi][ch], DIGIPARA::CH::WaveResolution, -1, true, "Wave Resol.", layout1, rowID, 0);
SetupComboBox(cbbLowFilter[iDigi][ch], DIGIPARA::CH::EnergyFilterLowFreqFilter, -1, "Low Freq. Filter", layout1, rowID, 2); SetupComboBox(cbbWaveSave[iDigi][ch], DIGIPARA::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);
rowID ++; rowID ++;
SetupSpinBox(spbDCOffset[iDigi][ch], DIGIPARA::CH::DC_Offset, -1, "DC Offset [%]", layout1, rowID, 0); SetupSpinBox(spbDCOffset[iDigi][ch], DIGIPARA::CH::DC_Offset, -1, "DC Offset [%]", layout1, rowID, 0);
@ -461,8 +456,8 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
//------------------------------ //------------------------------
rowID ++; rowID ++;
SetupComboBox(cbbPeakingAvg[iDigi][ch], DIGIPARA::CH::EnergyFilterPeakingAvg, -1, "Peak Avg", layout3, rowID, 0); SetupComboBox(cbbPeakingAvg[iDigi][ch], DIGIPARA::CH::EnergyFilterPeakingAvg, -1, true, "Peak Avg", layout3, rowID, 0);
SetupComboBox(cbbBaselineAvg[iDigi][ch], DIGIPARA::CH::EnergyFilterBaselineAvg, -1, "Baseline Avg", layout3, rowID, 2); 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); SetupSpinBox(spbFineGain[iDigi][ch], DIGIPARA::CH::EnergyFilterFineGain, -1, "Fine Gain", layout3, rowID, 4);
} }
@ -474,18 +469,18 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
//------------------------------ //------------------------------
rowID = 0; rowID = 0;
SetupComboBox(cbbAnaProbe0[iDigi][ch], DIGIPARA::CH::WaveAnalogProbe0, -1, "Analog Prob. 0", layout4, rowID, 0, 1, 2); 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, "Analog Prob. 1", layout4, rowID, 3, 1, 2); SetupComboBox(cbbAnaProbe1[iDigi][ch], DIGIPARA::CH::WaveAnalogProbe1, -1, true, "Analog Prob. 1", layout4, rowID, 3, 1, 2);
//------------------------------ //------------------------------
rowID ++; rowID ++;
SetupComboBox(cbbDigProbe0[iDigi][ch], DIGIPARA::CH::WaveDigitalProbe0, -1, "Digitial Prob. 0", layout4, rowID, 0, 1, 2); SetupComboBox(cbbDigProbe0[iDigi][ch], DIGIPARA::CH::WaveDigitalProbe0, -1, true, "Digitial Prob. 0", layout4, rowID, 0, 1, 2);
SetupComboBox(cbbDigProbe0[iDigi][ch], DIGIPARA::CH::WaveDigitalProbe1, -1, "Digitial Prob. 1", layout4, rowID, 3, 1, 2); SetupComboBox(cbbDigProbe1[iDigi][ch], DIGIPARA::CH::WaveDigitalProbe1, -1, true, "Digitial Prob. 1", layout4, rowID, 3, 1, 2);
//------------------------------ //------------------------------
rowID ++; rowID ++;
SetupComboBox(cbbDigProbe0[iDigi][ch], DIGIPARA::CH::WaveDigitalProbe2, -1, "Digitial Prob. 2", layout4, rowID, 0, 1, 2); SetupComboBox(cbbDigProbe2[iDigi][ch], DIGIPARA::CH::WaveDigitalProbe2, -1, true, "Digitial Prob. 2", layout4, rowID, 0, 1, 2);
SetupComboBox(cbbDigProbe0[iDigi][ch], DIGIPARA::CH::WaveDigitalProbe3, -1, "Digitial Prob. 3", layout4, rowID, 3, 1, 2); SetupComboBox(cbbDigProbe3[iDigi][ch], DIGIPARA::CH::WaveDigitalProbe3, -1, true, "Digitial Prob. 3", layout4, rowID, 3, 1, 2);
} }
@ -496,12 +491,12 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
//------------------------------ //------------------------------
rowID = 0; rowID = 0;
SetupComboBox(cbbEvtTrigger[iDigi][ch], DIGIPARA::CH::EventTriggerSource, -1, "Event Trig. Source", layout5, 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, "Wave Trig. Source", layout5, rowID, 2); SetupComboBox(cbbWaveTrigger[iDigi][ch], DIGIPARA::CH::WaveTriggerSource, -1, true, "Wave Trig. Source", layout5, rowID, 2);
//------------------------------ //------------------------------
rowID ++; rowID ++;
SetupComboBox(cbbChVetoSrc[iDigi][ch], DIGIPARA::CH::ChannelVetoSource, -1, "Veto Source", layout5, rowID, 0); SetupComboBox(cbbChVetoSrc[iDigi][ch], DIGIPARA::CH::ChannelVetoSource, -1, true, "Veto Source", layout5, rowID, 0);
QLabel * lbTriggerMask = new QLabel("Trigger Mask", tab); QLabel * lbTriggerMask = new QLabel("Trigger Mask", tab);
lbTriggerMask->setAlignment(Qt::AlignCenter | Qt::AlignRight); lbTriggerMask->setAlignment(Qt::AlignCenter | Qt::AlignRight);
@ -512,8 +507,8 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
//------------------------------ //------------------------------
rowID ++; rowID ++;
SetupComboBox(cbbCoinMask[iDigi][ch], DIGIPARA::CH::CoincidenceMask, -1, "Coin. Mask", layout5, rowID, 0); SetupComboBox(cbbCoinMask[iDigi][ch], DIGIPARA::CH::CoincidenceMask, -1, true, "Coin. Mask", layout5, rowID, 0);
SetupComboBox(cbbAntiCoinMask[iDigi][ch], DIGIPARA::CH::AntiCoincidenceMask, -1, "Anti-Coin. Mask", layout5, rowID, 2); SetupComboBox(cbbAntiCoinMask[iDigi][ch], DIGIPARA::CH::AntiCoincidenceMask, -1, true, "Anti-Coin. Mask", layout5, rowID, 2);
//------------------------------ //------------------------------
rowID ++; rowID ++;
@ -531,16 +526,14 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
//------------------------------ //------------------------------
rowID = 0 ; rowID = 0 ;
SetupComboBox(cbbEventSelector[iDigi][ch], DIGIPARA::CH::EventSelector, -1, "Event Selector", layout6, rowID, 0); SetupComboBox(cbbEventSelector[iDigi][ch], DIGIPARA::CH::EventSelector, -1, true, "Event Selector", layout6, rowID, 0);
SetupComboBox(cbbWaveSelector[iDigi][ch], DIGIPARA::CH::WaveSelector, -1, "Wave Selector", layout6, rowID, 2); SetupComboBox(cbbWaveSelector[iDigi][ch], DIGIPARA::CH::WaveSelector, -1, true, "Wave Selector", layout6, rowID, 2);
//------------------------------ //------------------------------
rowID ++; rowID ++;
SetupSpinBox(spbEnergySkimLow[iDigi][ch], DIGIPARA::CH::EnergySkimLowDiscriminator, -1, "Energy Skim Low", layout6, rowID, 0); 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(spbEnergySkimHigh[iDigi][ch], DIGIPARA::CH::EnergySkimHighDiscriminator, -1, "Energy Skim High", layout6, rowID, 2);
} }
} }
{//@============== Status tab {//@============== Status tab
@ -555,25 +548,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
QTabWidget * inputTab = new QTabWidget(tab); QTabWidget * inputTab = new QTabWidget(tab);
chTabWidget->addTab(inputTab, "Input"); chTabWidget->addTab(inputTab, "Input");
{//.......... Ch On/Off SetupComboBoxTab(cbbOnOff, DIGIPARA::CH::ChannelEnable, "On/Off", inputTab, iDigi, digi[iDigi]->GetNChannels());
QWidget * tab_onOff = new QWidget(tab);
//tab_onOff->setStyleSheet("background-color: #EEEEEE");
inputTab->addTab(tab_onOff, "On/Off");
QGridLayout * allLayout = new QGridLayout(tab_onOff);
allLayout->setAlignment(Qt::AlignTop);
allLayout->setVerticalSpacing(0);
for( int ch = 0; ch < digi[iDigi]->GetNChannels(); ch++){
ckbChEnabled[iDigi][ch]->setText(QString::number(ch));
allLayout->addWidget(ckbChEnabled[iDigi][ch], ch/4, ch%4);
ckbChEnabled[iDigi][ch]->setLayoutDirection(Qt::RightToLeft);
onOffMapper->setMapping(ckbChEnabled[iDigi][ch], (iDigi << 12) + ch);
connect(ckbChEnabled[iDigi][ch], SIGNAL(clicked()), onOffMapper, SLOT(map()));
}
}
SetupSpinBoxTab(spbDCOffset, DIGIPARA::CH::DC_Offset, "DC Offset [%]", 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()); SetupSpinBoxTab(spbThreshold, DIGIPARA::CH::TriggerThreshold, "Threshold [LSB]", inputTab, iDigi, digi[iDigi]->GetNChannels());
SetupComboBoxTab(cbbParity, DIGIPARA::CH::Polarity, "Parity", inputTab, iDigi, digi[iDigi]->GetNChannels()); SetupComboBoxTab(cbbParity, DIGIPARA::CH::Polarity, "Parity", inputTab, iDigi, digi[iDigi]->GetNChannels());
@ -600,7 +575,6 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
SetupSpinBoxTab(spbFineGain, DIGIPARA::CH::EnergyFilterFineGain, "Fine Gain", 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(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(spbPileupGuard, DIGIPARA::CH::EnergyFilterPileUpGuard, "Pile-up Guard [ns]", trapTab, iDigi, digi[iDigi]->GetNChannels());
} }
{//@============== Probe tab {//@============== Probe tab
@ -613,7 +587,6 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
SetupComboBoxTab(cbbDigProbe1, DIGIPARA::CH::WaveDigitalProbe1, "Digital Prob. 1", probeTab, iDigi, digi[iDigi]->GetNChannels(), 2); SetupComboBoxTab(cbbDigProbe1, DIGIPARA::CH::WaveDigitalProbe1, "Digital Prob. 1", probeTab, iDigi, digi[iDigi]->GetNChannels(), 2);
SetupComboBoxTab(cbbDigProbe2, DIGIPARA::CH::WaveDigitalProbe2, "Digital Prob. 2", probeTab, iDigi, digi[iDigi]->GetNChannels(), 2); SetupComboBoxTab(cbbDigProbe2, DIGIPARA::CH::WaveDigitalProbe2, "Digital Prob. 2", probeTab, iDigi, digi[iDigi]->GetNChannels(), 2);
SetupComboBoxTab(cbbDigProbe3, DIGIPARA::CH::WaveDigitalProbe3, "Digital Prob. 3", probeTab, iDigi, digi[iDigi]->GetNChannels(), 2); SetupComboBoxTab(cbbDigProbe3, DIGIPARA::CH::WaveDigitalProbe3, "Digital Prob. 3", probeTab, iDigi, digi[iDigi]->GetNChannels(), 2);
} }
{//@============== Other tab {//@============== Other tab
@ -638,7 +611,52 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
SetupComboBoxTab(cbbAntiCoinMask, DIGIPARA::CH::AntiCoincidenceMask, "Anti-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(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()); SetupSpinBoxTab(spbADCVetoWidth, DIGIPARA::CH::ADCVetoWidth, "ADC Veto Length [ns]", triggerTab, iDigi, digi[iDigi]->GetNChannels());
}
for( int ch = 0; ch < digi[ID]->GetNChannels() + 1; ch++) {
connect(cbbOnOff[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbOnOff, ch);});
connect(spbDCOffset[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbDCOffset, ch);});
connect(spbThreshold[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbThreshold, ch);});
connect(cbbParity[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbParity, ch);});
connect(spbRecordLength[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbRecordLength, ch);});
connect(spbPreTrigger[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbPreTrigger, ch);});
connect(spbInputRiseTime[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbInputRiseTime, ch);});
connect(spbTriggerGuard[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbTriggerGuard, ch);});
connect(cbbLowFilter[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbLowFilter, ch);});
connect(cbbWaveSource[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbWaveSource, ch);});
connect(cbbWaveRes[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbWaveRes, ch);});
connect(cbbWaveSave[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbWaveSave, ch);});
connect(spbTrapRiseTime[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbTrapRiseTime, ch);});
connect(spbTrapFlatTop[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbTrapFlatTop, ch);});
connect(spbTrapPoleZero[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbTrapPoleZero, ch);});
connect(spbPeaking[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbPeaking, ch);});
connect(cbbPeakingAvg[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbPeakingAvg, ch);});
connect(cbbBaselineAvg[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbBaselineAvg, ch);});
connect(spbFineGain[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbFineGain, ch);});
connect(spbBaselineGuard[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbBaselineGuard, ch);});
connect(spbPileupGuard[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbPileupGuard, ch);});
connect(cbbAnaProbe0[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbAnaProbe0, ch);});
connect(cbbAnaProbe1[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbAnaProbe1, ch);});
connect(cbbDigProbe0[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbDigProbe0, ch);});
connect(cbbDigProbe1[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbDigProbe1, ch);});
connect(cbbDigProbe2[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbDigProbe2, ch);});
connect(cbbDigProbe3[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbDigProbe3, ch);});
connect(cbbEventSelector[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbEventSelector, ch);});
connect(cbbWaveSelector[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbWaveSelector, ch);});
connect(spbEnergySkimLow[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbEnergySkimLow, ch);});
connect(spbEnergySkimHigh[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbEnergySkimHigh, ch);});
connect(cbbEvtTrigger[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbEvtTrigger, ch);});
connect(cbbWaveTrigger[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbWaveTrigger, ch);});
connect(cbbChVetoSrc[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbChVetoSrc, ch);});
connect(cbbCoinMask[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbCoinMask, ch);});
connect(cbbAntiCoinMask[iDigi][ch], &QComboBox::currentIndexChanged, this, [=](){ SyncComboBox(cbbAntiCoinMask, ch);});
connect(spbCoinLength[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbCoinLength, ch);});
connect(spbADCVetoWidth[iDigi][ch], &QSpinBox::valueChanged, this, [=](){ SyncSpinBox(spbADCVetoWidth, ch);});
} }
@ -699,6 +717,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
} }
} //=== end of channel group } //=== end of channel group
} //=== end of tab } //=== end of tab
enableSignalSlot = true; enableSignalSlot = true;
@ -709,29 +728,6 @@ DigiSettingsPanel::~DigiSettingsPanel(){
printf("%s\n", __func__); printf("%s\n", __func__);
for( int iDig = 0; iDig < nDigi; iDig ++){
/*
for( int i = 0; i < 12; i++) delete leInfo[iDig][i];
for( int i = 0; i < 19; i++) {
delete LEDStatus[iDig][i];
delete ACQStatus[iDig][i];
}
for( int i = 0; i < 8; i++) delete leTemp[iDig][i];
delete cbbClockSource[iDig];
for( int i = 0; i < 5; i++) {
delete ckbStartSource[iDig][i];
delete ckbGlbTrgSource[iDig][i];
}
*/
for( int i =0 ; i < MaxNumberOfChannel; i++){
if( ckbChEnabled[iDig][i] != NULL) delete ckbChEnabled[iDig][i];
}
}
} }
//^================================================================ //^================================================================
@ -752,36 +748,6 @@ void DigiSettingsPanel::onTriggerClick(int haha){
} }
} }
void DigiSettingsPanel::onChannelonOff(int haha){
unsigned short iDig = haha >> 12;
qDebug()<< "nDigi-" << iDig << ", ch-" << (haha & 0xFF);
if( (haha & 0xFF) == 64){
if( ckbChEnabled[iDig][64]->isChecked() ){
for( int i = 0 ; i < digi[iDig]->GetNChannels() ; i++){
ckbChEnabled[iDig][i]->setChecked(true);
}
}else{
for( int i = 0 ; i < digi[iDig]->GetNChannels() ; i++){
ckbChEnabled[iDig][i]->setChecked(false);
}
}
}else{
unsigned int nOn = 0;
for( int i = 0; i < digi[iDig]->GetNChannels(); i++){
nOn += (ckbChEnabled[iDig][i]->isChecked() ? 1 : 0);
}
if( nOn == 64){
ckbChEnabled[iDig][64]->setChecked(true);
}else{
ckbChEnabled[iDig][64]->setChecked(false);
}
}
}
//^================================================================ //^================================================================
void DigiSettingsPanel::RefreshSettings(){ void DigiSettingsPanel::RefreshSettings(){
@ -792,7 +758,6 @@ void DigiSettingsPanel::RefreshSettings(){
void DigiSettingsPanel::SaveSettings(){ void DigiSettingsPanel::SaveSettings(){
} }
void DigiSettingsPanel::LoadSettings(){ void DigiSettingsPanel::LoadSettings(){
@ -953,7 +918,7 @@ void DigiSettingsPanel::SetupShortComboBox(QComboBox *cbb, Reg para){
} }
} }
void DigiSettingsPanel::SetupComboBox(QComboBox *&cbb, const Reg para, int ch_index, QString labelTxt, QGridLayout *layout, int row, int col, int srow, int scol){ void DigiSettingsPanel::SetupComboBox(QComboBox *&cbb, 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); QLabel * lb = new QLabel(labelTxt, this);
layout->addWidget(lb, row, col); layout->addWidget(lb, row, col);
lb->setAlignment(Qt::AlignRight | Qt::AlignCenter); lb->setAlignment(Qt::AlignRight | Qt::AlignCenter);
@ -962,9 +927,10 @@ void DigiSettingsPanel::SetupComboBox(QComboBox *&cbb, const Reg para, int ch_in
for( int i = 0 ; i < (int) para.GetAnswers().size(); i++){ for( int i = 0 ; i < (int) para.GetAnswers().size(); i++){
cbb->addItem(QString::fromStdString((para.GetAnswers())[i].second), QString::fromStdString((para.GetAnswers())[i].first)); cbb->addItem(QString::fromStdString((para.GetAnswers())[i].second), QString::fromStdString((para.GetAnswers())[i].first));
} }
if( isMaster && para.GetType() == TYPE::CH ) cbb->addItem("");
connect(cbb, &QComboBox::currentIndexChanged, this, [=](){ connect(cbb, &QComboBox::currentIndexChanged, this, [=](){
if( !enableSignalSlot ) return; if( !enableSignalSlot ) return;
printf("%s %d %s \n", para.GetPara().c_str(), ch_index, cbb->currentData().toString().toStdString().c_str()); //printf("%s %d %s \n", para.GetPara().c_str(), ch_index, cbb->currentData().toString().toStdString().c_str());
digi[ID]->WriteValue(para, cbb->currentData().toString().toStdString(), ch_index); digi[ID]->WriteValue(para, cbb->currentData().toString().toStdString(), ch_index);
}); });
} }
@ -979,11 +945,69 @@ void DigiSettingsPanel::SetupSpinBox(QSpinBox *&spb, const Reg para, int ch_inde
layout->addWidget(spb, row, col + 1, srow, scol); layout->addWidget(spb, row, col + 1, srow, scol);
connect(spb, &QSpinBox::valueChanged, this, [=](){ connect(spb, &QSpinBox::valueChanged, this, [=](){
if( !enableSignalSlot ) return; if( !enableSignalSlot ) return;
printf("%s %d %d \n", para.GetPara().c_str(), ch_index, spb->value()); //printf("%s %d %d \n", para.GetPara().c_str(), ch_index, spb->value());
digi[ID]->WriteValue(para, std::to_string(spb->value()), ch_index); digi[ID]->WriteValue(para, std::to_string(spb->value()), ch_index);
}); });
} }
void DigiSettingsPanel::SyncComboBox(QComboBox *(&cbb)[][MaxNumberOfChannel + 1], int ch){
if( !enableSignalSlot ) return;
const int nCh = digi[ID]->GetNChannels();
if( ch == nCh ){
const int index = cbb[ID][nCh]->currentIndex();
if( cbb[ID][nCh]->currentText() == "" ) return;
enableSignalSlot = false;
for( int i = 0; i < nCh; i++) cbb[ID][i]->setCurrentIndex(index);
enableSignalSlot = true;
}else{
//check is all ComboBox has same index;
int count = 1;
const int index = cbb[ID][0]->currentIndex();
for( int i = 1; i < nCh; i ++){
if( cbb[ID][i]->currentIndex() == index ) count++;
}
enableSignalSlot = false;
if( count != nCh ){
cbb[ID][nCh]->setCurrentText("");
}else{
cbb[ID][nCh]->setCurrentIndex(index);
}
enableSignalSlot = true;
}
}
void DigiSettingsPanel::SyncSpinBox(QSpinBox *(&spb)[][MaxNumberOfChannel+1], int ch){
if( !enableSignalSlot ) return;
const int nCh = digi[ID]->GetNChannels();
if( ch == nCh ){
const int value = spb[ID][nCh]->value();
if( spb[ID][nCh]->value() == -999 ) return;
enableSignalSlot = false;
for( int i = 0; i < nCh; i++) spb[ID][i]->setValue(value);
enableSignalSlot = true;
}else{
//check is all ComboBox has same index;
int count = 1;
const int value = spb[ID][0]->value();
for( int i = 1; i < nCh; i ++){
if( spb[ID][i]->value() == value ) count++;
}
enableSignalSlot = false;
if( count != nCh ){
spb[ID][nCh]->setValue(-999);
}else{
spb[ID][nCh]->setValue(value);
}
enableSignalSlot = true;
}
}
void DigiSettingsPanel::SetupSpinBoxTab(QSpinBox *(&spb)[][MaxNumberOfChannel+1], const Reg para, QString text, QTabWidget *tabWidget, int iDigi, int nChannel){ void DigiSettingsPanel::SetupSpinBoxTab(QSpinBox *(&spb)[][MaxNumberOfChannel+1], const Reg para, QString text, QTabWidget *tabWidget, int iDigi, int nChannel){
QWidget * tabPage = new QWidget(this); tabWidget->addTab(tabPage, text); QWidget * tabPage = new QWidget(this); tabWidget->addTab(tabPage, text);
QGridLayout * allLayout = new QGridLayout(tabPage); QGridLayout * allLayout = new QGridLayout(tabPage);
@ -1004,7 +1028,7 @@ void DigiSettingsPanel::SetupComboBoxTab(QComboBox *(&cbb)[][MaxNumberOfChannel
allLayout->setHorizontalSpacing(10); allLayout->setHorizontalSpacing(10);
allLayout->setVerticalSpacing(0); allLayout->setVerticalSpacing(0);
for( int ch = 0; ch < nChannel; ch++){ for( int ch = 0; ch < nChannel; ch++){
SetupComboBox(cbb[iDigi][ch], para, ch, "ch-"+QString::number(ch) + " ", allLayout, ch/nCol, ch%nCol * 3); SetupComboBox(cbb[iDigi][ch], para, ch, false, "ch-"+QString::number(ch) + " ", allLayout, ch/nCol, ch%nCol * 3);
} }
} }

View File

@ -32,7 +32,6 @@ private slots:
void onTriggerClick(int haha); void onTriggerClick(int haha);
void onChannelonOff(int haha);
void RefreshSettings(); void RefreshSettings();
void SaveSettings(); void SaveSettings();
@ -89,7 +88,7 @@ private:
bool bnClickStatus[MaxNumberOfChannel][MaxNumberOfChannel]; bool bnClickStatus[MaxNumberOfChannel][MaxNumberOfChannel];
//--------------- Channel settings //--------------- Channel settings
QCheckBox *** ckbChEnabled; QComboBox * cbbOnOff[MaxNumberOfDigitizer][MaxNumberOfChannel + 1];
QSpinBox * spbRecordLength[MaxNumberOfDigitizer][MaxNumberOfChannel + 1]; QSpinBox * spbRecordLength[MaxNumberOfDigitizer][MaxNumberOfChannel + 1];
QSpinBox * spbPreTrigger[MaxNumberOfDigitizer][MaxNumberOfChannel + 1]; QSpinBox * spbPreTrigger[MaxNumberOfDigitizer][MaxNumberOfChannel + 1];
@ -119,6 +118,7 @@ private:
QComboBox * cbbAnaProbe0[MaxNumberOfDigitizer][MaxNumberOfChannel + 1]; QComboBox * cbbAnaProbe0[MaxNumberOfDigitizer][MaxNumberOfChannel + 1];
QComboBox * cbbAnaProbe1[MaxNumberOfDigitizer][MaxNumberOfChannel + 1]; QComboBox * cbbAnaProbe1[MaxNumberOfDigitizer][MaxNumberOfChannel + 1];
QComboBox * cbbDigProbe0[MaxNumberOfDigitizer][MaxNumberOfChannel + 1]; QComboBox * cbbDigProbe0[MaxNumberOfDigitizer][MaxNumberOfChannel + 1];
QComboBox * cbbDigProbe1[MaxNumberOfDigitizer][MaxNumberOfChannel + 1]; QComboBox * cbbDigProbe1[MaxNumberOfDigitizer][MaxNumberOfChannel + 1];
QComboBox * cbbDigProbe2[MaxNumberOfDigitizer][MaxNumberOfChannel + 1]; QComboBox * cbbDigProbe2[MaxNumberOfDigitizer][MaxNumberOfChannel + 1];
@ -149,12 +149,14 @@ private:
void SetStartSource(); void SetStartSource();
void SetGlobalTriggerSource(); void SetGlobalTriggerSource();
void SetupShortComboBox(QComboBox * cbb, Reg para); void SetupShortComboBox(QComboBox * cbb, Reg para);
void SetupComboBox(QComboBox * &cbb, const Reg para, int ch_index, QString labelTxt, QGridLayout * layout, int row, int col, int srow = 1, int scol = 1); void SetupComboBox(QComboBox * &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(QSpinBox * &spb, const Reg para, int ch_index, QString labelTxt, QGridLayout * layout, int row, int col, int srow = 1, int scol = 1); void SetupSpinBox(QSpinBox * &spb, const Reg para, int ch_index, QString labelTxt, QGridLayout * layout, int row, int col, int srow = 1, int scol = 1);
void SyncComboBox(QComboBox *(&cbb)[][MaxNumberOfChannel+1], int ch);
void SyncSpinBox(QSpinBox *(&spb)[][MaxNumberOfChannel+1], int ch);
void SetupSpinBoxTab(QSpinBox *(&spb)[][MaxNumberOfChannel+1], const Reg para, QString text, QTabWidget * tabWidget, int iDigi, int nChannel); void SetupSpinBoxTab(QSpinBox *(&spb)[][MaxNumberOfChannel+1], const Reg para, QString text, QTabWidget * tabWidget, int iDigi, int nChannel);
void SetupComboBoxTab(QComboBox *(&cbb)[][MaxNumberOfChannel+1], const Reg para, QString text, QTabWidget * tabWidget, int iDigi, int nChannel, int nCol = 4); void SetupComboBoxTab(QComboBox *(&cbb)[][MaxNumberOfChannel+1], const Reg para, QString text, QTabWidget * tabWidget, int iDigi, int nChannel, int nCol = 4);

View File

@ -28,7 +28,7 @@ Digitizer2Gen ** MainWindow::digi = NULL;
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
setWindowTitle("SOLARIS DAQ"); setWindowTitle("FSU SOLARIS DAQ");
setGeometry(500, 100, 1000, 500); setGeometry(500, 100, 1000, 500);
QIcon icon("SOLARIS_favicon.png"); QIcon icon("SOLARIS_favicon.png");
setWindowIcon(icon); setWindowIcon(icon);
@ -528,6 +528,10 @@ void MainWindow::CloseDigitizers(){
scalar->close(); scalar->close();
DeleteTriggerLineEdit(); // this use digi->GetNChannels(); DeleteTriggerLineEdit(); // this use digi->GetNChannels();
digiSetting->close();
delete digiSetting;
digiSetting = NULL;
for( int i = 0; i < nDigi; i++){ for( int i = 0; i < nDigi; i++){
if( digi[i] == NULL) return; if( digi[i] == NULL) return;
digi[i]->CloseDigitizer(); digi[i]->CloseDigitizer();