From be62125e77430ecff6115a4f9d1d12262953f4fc Mon Sep 17 00:00:00 2001 From: "Calem@RAISOR" Date: Sat, 14 Sep 2024 17:41:50 -0500 Subject: [PATCH] bug fix when open digitizer to set no trace --- .gitignore | 2 ++ ClassDigitizer.cpp | 2 +- ClassDigitizer.h | 2 +- FSUDAQ | 6 +++++- FSUDAQ.cpp | 7 ++++--- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index c2361b7..bfee048 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ *.fsu *.root *.bin +*.log core.* @@ -30,6 +31,7 @@ Bin2Root data Data raw_binary +log *.d *.pcm diff --git a/ClassDigitizer.cpp b/ClassDigitizer.cpp index 1c3bb54..8046c4f 100644 --- a/ClassDigitizer.cpp +++ b/ClassDigitizer.cpp @@ -1331,7 +1331,7 @@ void Digitizer::SetBits(Reg address, unsigned int bitValue, unsigned int bitLeng DebugPrint("%s", "Digitizer"); if( softwareDisable ) return; if( AcqRun ) return; - ///printf("address : 0x%X, value : 0x%X, len : %d, pos : %d, ch : %d \n", address, bitValue, bitLength, bitSmallestPos, ch); + // printf("address : 0x%X, value : 0x%X, len : %d, pos : %d, ch : %d \n", address, bitValue, bitLength, bitSmallestPos, ch); uint32_t bit ; uint32_t bitmask = (uint(pow(2, bitLength)-1) << bitSmallestPos); int tempCh = ch; diff --git a/ClassDigitizer.h b/ClassDigitizer.h index 6087493..6af912b 100644 --- a/ClassDigitizer.h +++ b/ClassDigitizer.h @@ -207,7 +207,7 @@ class Digitizer{ } void SetTrace(bool onOff){ - SetBits(DPP::BoardConfiguration, DPP::Bit_BoardConfig::RecordTrace, onOff, -1); + SetBits(DPP::BoardConfiguration, DPP::Bit_BoardConfig::RecordTrace, (short) onOff, -1); } }; diff --git a/FSUDAQ b/FSUDAQ index 04a3b23..a990aef 100755 --- a/FSUDAQ +++ b/FSUDAQ @@ -2,6 +2,10 @@ timestamp=$(date +%Y%m%d_%H%M%S) -outFile=program_${timestamp}.log +outFile=log/program_${timestamp}.log + +mkdir -p "$(dirname "$outFile")" + +echo "FSUDAQ, save stdout to $outFile" stdbuf -oL ./FSUDAQ_Qt6 | tee $outFile \ No newline at end of file diff --git a/FSUDAQ.cpp b/FSUDAQ.cpp index 8a6a089..afa5524 100644 --- a/FSUDAQ.cpp +++ b/FSUDAQ.cpp @@ -693,9 +693,6 @@ void FSUDAQ::OpenDigitizers(){ digi[i] = new Digitizer(portList[i].first, portList[i].second); //digi[i]->Reset(); - //===== set no trace, even when FSQDAQ segfault at scope, the digitizer will save no trace - digi[i]->SetTrace(false); - if( cbOpenMethod->currentData().toInt() == 2 ) { digi[i]->ProgramBoard(); } @@ -740,6 +737,10 @@ void FSUDAQ::OpenDigitizers(){ } digi[i]->ReadAllSettingsFromBoard(true); + //===== set no trace, even when FSQDAQ segfault at scope, the digitizer will save no trace + digi[i]->SetTrace(false); + // if( digi[i]->GetDPPType() == V1730_DPP_PHA_CODE) digi[i]->WriteRegister(DPP::BoardConfiguration, 0xE8915); + readDataThread[i] = new ReadDataThread(digi[i], i); connect(readDataThread[i], &ReadDataThread::sendMsg, this, &FSUDAQ::LogMsg);