added SoftwareDisable Digitizer, Replace SW trigger button with SetNoTrace button

This commit is contained in:
Ryan Tang 2024-04-09 15:18:48 -04:00
parent 6d7daaa13c
commit 03c3e79497
6 changed files with 47 additions and 7 deletions

View File

@ -1341,6 +1341,7 @@ void Digitizer::SetOptimialAggOrg(){
uint32_t EventAgg = ReadRegister(DPP::QDC::NumberEventsPerAggregate, 0);
uint32_t chMask = ReadRegister(DPP::QDC::GroupEnableMask);
uint32_t RecordLen = ReadRegister(DPP::QDC::RecordLength_R, 0);
if( RecordLen == 0 ) SetBits(DPP::BoardConfiguration, DPP::Bit_BoardConfig::RecordTrace, 0, -1);
uint32_t AggRead = ReadRegister(DPP::MaxAggregatePerBlockTransfer);
uint32_t boardCfg = ReadRegister(DPP::BoardConfiguration);
@ -1359,6 +1360,7 @@ void Digitizer::SetOptimialAggOrg(){
printf(" Record Length (bit) : %u = %u sample = %u ns\n", RecordLen, RecordLen*8, RecordLen*8*16);
printf("==============================================================\n");
int eventSize = 6 + 2 * Ex + traceOn * RecordLen * 8; // sample
double maxAggOrg = log2( MemorySizekSample * 1024 / eventSize / EventAgg );
printf(" max Agg. Org. should be less than %.2f\n", maxAggOrg);

View File

@ -90,6 +90,7 @@ class Digitizer{
bool IsConnected() {return isConnected;}
void DisableBoard() {softwareDisable = true;}
void EnableBoard() {softwareDisable = false;}
bool IsBoardDisabled() const {return softwareDisable;}
void PrintBoard();

View File

@ -38,6 +38,10 @@ public:
// ta = t0;
t1 = t0;
digiMTX[ID].lock();
digi->ReadACQStatus();
digiMTX[ID].unlock();
printf("ReadDataThread for digi-%d running.\n", digi->GetSerialNumber());
do{
@ -90,7 +94,6 @@ public:
// ta = tb;
// }
// }
}while(!stop);
printf("ReadDataThread for digi-%d stopped.\n", digi->GetSerialNumber());
}
@ -104,7 +107,6 @@ private:
bool isSaveData;
bool isScope;
unsigned long readCount;
};
//^#======================================================= Timing Thread

View File

@ -219,9 +219,17 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QStr
connect(bnLoadSettings, &QPushButton::clicked, this, &DigiSettingsPanel::LoadSetting);
rowID ++; //---------------------------
bnSendSoftwareTriggerSignal = new QPushButton("Send SW Trigger Signal", this);
buttonLayout->addWidget(bnSendSoftwareTriggerSignal, rowID, 0);
connect(bnSendSoftwareTriggerSignal, &QPushButton::clicked, this, [=](){ digi[ID]->WriteRegister(DPP::SoftwareTrigger_W, 1); UpdateBoardAndChannelsStatus();});
// bnSendSoftwareTriggerSignal = new QPushButton("Send SW Trigger Signal", this);
// buttonLayout->addWidget(bnSendSoftwareTriggerSignal, rowID, 0);
// connect(bnSendSoftwareTriggerSignal, &QPushButton::clicked, this, [=](){ digi[ID]->WriteRegister(DPP::SoftwareTrigger_W, 1); UpdateBoardAndChannelsStatus();});
bnSetNoTrace = new QPushButton("Set No Trace", this);
buttonLayout->addWidget(bnSetNoTrace, rowID, 0);
connect(bnSetNoTrace, &QPushButton::clicked, this, [=](){
for( unsigned int i = 0; i < nDigi; i++){
chkTraceRecording[i]->setChecked(false);
}
});
bhAutoSetEventPulling = new QPushButton("Autoset Reading Conf.", this);
buttonLayout->addWidget(bhAutoSetEventPulling, rowID, 1);
@ -330,7 +338,6 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer ** digi, unsigned int nDigi, QStr
ID = index;
//if( digi[ID]->GetDPPType() == V1730_DPP_PHA_CODE ) UpdatePanelFromMemory();
UpdatePanelFromMemory();
}
});
@ -1375,7 +1382,28 @@ void DigiSettingsPanel::SetUpChannelMask(unsigned int digiID){
emit UpdateOtherPanels();
});
}
QLabel * blank = new QLabel(" ", this);
chLayout->addWidget(blank, 1, nChGrp );
cbDigiEnable[digiID] = new QCheckBox("Enable Digitizer",this);
cbDigiEnable[digiID]->setChecked(true);
chLayout->addWidget(cbDigiEnable[digiID], 1, nChGrp + 2 );
connect(cbDigiEnable[digiID], &QCheckBox::stateChanged, this, [=](int state){
if( state == Qt::Checked ){
digi[digiID]->EnableBoard();
cbDigiEnable[digiID]->setStyleSheet("");
tabWidget->setTabText(digiID, "Digi-" + QString::number(digi[digiID]->GetSerialNumber()));
}else{
digi[digiID]->DisableBoard();
cbDigiEnable[digiID]->setStyleSheet("color: red");
tabWidget->setTabText(digiID, "Digi-" + QString::number(digi[digiID]->GetSerialNumber()) + "(D)");
}
UpdateBoardAndChannelsStatus();
});
}
void DigiSettingsPanel::SetUpACQReadOutTab(){

View File

@ -106,7 +106,8 @@ private:
QPushButton * bnProgramPreDefined;
QPushButton * bnClearBuffer;
QPushButton * bnSendSoftwareTriggerSignal;
// QPushButton * bnSendSoftwareTriggerSignal;
QPushButton * bnSetNoTrace;
QPushButton * bhAutoSetEventPulling;
//QPushButton * bnSendSoftwareClockSyncSignal;
QPushButton * bnSaveSettings;
@ -134,6 +135,7 @@ private:
RComboBox * cbDigiProbe2[MaxNDigitizer];
QPushButton * bnChEnableMask[MaxNDigitizer][MaxRegChannel];
QCheckBox * cbDigiEnable[MaxNDigitizer];
RComboBox * cbAggOrg[MaxNDigitizer];
RSpinBox * sbAggNum[MaxNDigitizer];
QCheckBox * chkEnableExternalTrigger[MaxNDigitizer];

View File

@ -1105,6 +1105,7 @@ void MainWindow::StartACQ(){
bnStopACQ->setStyleSheet("background-color: red;");
bnOpenScope->setEnabled(false);
cbAutoRun->setEnabled(false);
bnSync->setEnabled(false);
if( digiSettings ) digiSettings->setEnabled(false);
@ -1134,6 +1135,9 @@ void MainWindow::StartACQ(){
void MainWindow::StopACQ(){
DebugPrint("%s", "FSUDAQ");
QCoreApplication::processEvents();
if( digi == nullptr ) return;
bool commentResult = true;
@ -1183,6 +1187,7 @@ void MainWindow::StopACQ(){
bnStopACQ->setStyleSheet("");
bnOpenScope->setEnabled(true);
cbAutoRun->setEnabled(true);
bnSync->setEnabled(true);
if( scalar ){
for( unsigned int iDigi = 0; iDigi < nDigi; iDigi ++){