bugfix NeutronGamma; if scalarThred running + Analyzer created -> start updateHistograms thread

This commit is contained in:
Ryan Tang 2024-08-22 12:42:08 -04:00
parent 82de3763a9
commit 1cb60d1aa4
2 changed files with 6 additions and 2 deletions

View File

@ -1833,6 +1833,9 @@ void FSUDAQ::OpenAnalyzer(){
if( id == 4 ) onlineAnalyzer = new MUSIC(digi, nDigi);
if( id == 5 ) onlineAnalyzer = new NeutronGamma(digi, nDigi, rawDataPath);
if( id >= 0 ) onlineAnalyzer->show();
if( scalarThread->isRunning() ) onlineAnalyzer->StartThread();
}else{
delete onlineAnalyzer;
@ -1842,11 +1845,12 @@ void FSUDAQ::OpenAnalyzer(){
if( id == 2 ) onlineAnalyzer = new Encore(digi, nDigi);
if( id == 3 ) onlineAnalyzer = new RAISOR(digi, nDigi);
if( id == 4 ) onlineAnalyzer = new MUSIC(digi, nDigi);
if( id == 4 ) onlineAnalyzer = new NeutronGamma(digi, nDigi, rawDataPath);
if( id == 5 ) onlineAnalyzer = new NeutronGamma(digi, nDigi, rawDataPath);
if( id >= 0 ){
onlineAnalyzer->show();
onlineAnalyzer->activateWindow();
if( scalarThread->isRunning() ) onlineAnalyzer->StartThread();
}
}

View File

@ -118,7 +118,6 @@ inline void NeutronGamma::SetUpCanvas(){
connect( cbDigi, &RComboBox::currentIndexChanged, this, [=](int index){
isSignalSlotActive = false;
cbCh->clear();
cbCh->addItem("All Ch", digi[index]->GetNumInputCh() );
for( int i = 0; i < digi[index]->GetNumInputCh(); i++) cbCh->addItem("ch-" + QString::number( i ), i);
hist2D->Clear();
@ -185,6 +184,7 @@ inline void NeutronGamma::ClearInternalDataCount(){
}
inline void NeutronGamma::UpdateHistograms(){
printf("%s | %d \n", __func__, fillHistograms);
if( !fillHistograms ) return;
if( this->isVisible() == false ) return;