From 66437f0262d73869718e179a818155b80ad70176 Mon Sep 17 00:00:00 2001 From: "carina@hades" Date: Tue, 17 Oct 2023 17:01:57 -0400 Subject: [PATCH] bugs fix after tested ANASEN, for some reason, no scalar, but can take data. --- DigiSettingsPanel.h | 2 +- FSUDAQ.cpp | 11 +++++++---- Scope.cpp | 4 ++-- SingleSpectra.h | 6 +++--- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/DigiSettingsPanel.h b/DigiSettingsPanel.h index 768c429..d62a237 100644 --- a/DigiSettingsPanel.h +++ b/DigiSettingsPanel.h @@ -24,6 +24,7 @@ public: public slots: void UpdatePanelFromMemory(); void ReadSettingsFromBoard(); + void UpdateBoardAndChannelsStatus(); // will ReadRegister void SaveSetting(int opt); void LoadSetting(); @@ -64,7 +65,6 @@ private: void SyncComboBox(RComboBox *(&cb)[][MaxRegChannel+1]); void SyncCheckBox(QCheckBox *(&chk)[][MaxRegChannel+1]); - void UpdateBoardAndChannelsStatus(); // ReadRegister void SyncAllChannelsTab_PHA(); void UpdateSettings_PHA(); diff --git a/FSUDAQ.cpp b/FSUDAQ.cpp index 6bafa8a..63f4694 100644 --- a/FSUDAQ.cpp +++ b/FSUDAQ.cpp @@ -656,11 +656,11 @@ void MainWindow::OpenDigitizers(){ LogMsg("Found " + fileName + " for digitizer settings."); // if( digi[i]->LoadSettingBinaryToMemory(fileName.toStdString().c_str()) == 0 ){ - // LogMsg("Loaded settings file " + fileName + " for Digi-" + QString::number(digi[i]->GetSerialNumber())); - // digi[i]->ProgramSettingsToBoard(); - // + // LogMsg("Loaded settings file " + fileName + " for Digi-" + QString::number(digi[i]->GetSerialNumber())); + // digi[i]->ProgramSettingsToBoard(); + // }else{ - // LogMsg("Fail to Loaded settings file " + fileName + " for Digi-" + QString::number(digi[i]->GetSerialNumber())); + // LogMsg("Fail to Loaded settings file " + fileName + " for Digi-" + QString::number(digi[i]->GetSerialNumber())); // } } digi[i]->ReadAllSettingsFromBoard(true); @@ -967,6 +967,9 @@ void MainWindow::UpdateScalar(){ } } } + + //if( digiSettings && digiSettings->isVisible()) digiSettings->UpdateBoardAndChannelsStatus(); + digiMTX[iDigi].unlock(); } diff --git a/Scope.cpp b/Scope.cpp index aa89fd0..fa118e2 100644 --- a/Scope.cpp +++ b/Scope.cpp @@ -78,7 +78,7 @@ Scope::Scope(Digitizer ** digi, unsigned int nDigi, ReadDataThread ** readDataTh ID = 0; cbScopeDigi->setCurrentIndex(0); - for( int i = 0; i < digi[0]->GetNumRegChannels(); i++) cbScopeCh->addItem("Ch-" + QString::number(i)); + for( int i = 0; i < digi[0]->GetNumInputCh(); i++) cbScopeCh->addItem("Ch-" + QString::number(i)); tick2ns = digi[ID]->GetTick2ns(); factor = digi[ID]->IsDualTrace_PHA() ? 2 : 1; @@ -95,7 +95,7 @@ Scope::Scope(Digitizer ** digi, unsigned int nDigi, ReadDataThread ** readDataTh enableSignalSlot = false; //---setup cbScopeCh cbScopeCh->clear(); - for( int i = 0; i < digi[ID]->GetNumRegChannels(); i++) cbScopeCh->addItem("Ch-" + QString::number(i)); + for( int i = 0; i < digi[ID]->GetNumInputCh(); i++) cbScopeCh->addItem("Ch-" + QString::number(i)); //---Setup SettingGroup CleanUpSettingsGroupBox(); diff --git a/SingleSpectra.h b/SingleSpectra.h index 4a9e60b..95fec55 100644 --- a/SingleSpectra.h +++ b/SingleSpectra.h @@ -43,7 +43,7 @@ private: Digitizer ** digi; unsigned short nDigi; - Histogram1D * hist[MaxNDigitizer][MaxRegChannel]; + Histogram1D * hist[MaxNDigitizer][MaxNChannels]; RComboBox * cbDivision; @@ -54,8 +54,8 @@ private: QGridLayout * histLayout; int oldBd, oldCh; - int lastFilledIndex[MaxNDigitizer][MaxRegChannel]; - int loopFilledIndex[MaxNDigitizer][MaxRegChannel]; + int lastFilledIndex[MaxNDigitizer][MaxNChannels]; + int loopFilledIndex[MaxNDigitizer][MaxNChannels]; bool fillHistograms;