added debug code and solve the peak average issue
This commit is contained in:
parent
c20771567b
commit
58dcd0d717
|
@ -398,6 +398,7 @@ inline void Data::DecodeBuffer(bool fastDecode, int verbose){
|
|||
///Calculate trigger rate and first and last Timestamp
|
||||
for(int ch = 0; ch < MaxNChannels; ch++){
|
||||
if( NumEventsDecoded[ch] > 0 ) {
|
||||
// printf("%s | ch %d | %d %d \n", __func__, ch, LoopIndex[ch], DataIndex[ch]);
|
||||
IsNotRollOverFakeAgg = true;
|
||||
}else{
|
||||
continue;
|
||||
|
|
|
@ -501,7 +501,7 @@ int Digitizer::ReadData(){
|
|||
|
||||
ret = CAEN_DGTZ_ReadData(handle, CAEN_DGTZ_SLAVE_TERMINATED_READOUT_MBLT, data->buffer, &(data->nByte));
|
||||
//uint32_t EventSize = ReadRegister(DPP::EventSize); // Is it as same as data->nByte?
|
||||
//printf("Read Buffer size %d byte, Event Size : %d byte \n", data->nByte, EventSize);
|
||||
// if( data->nByte > 0 ) printf("Read Buffer size %d byte \n", data->nByte);
|
||||
|
||||
if (ret || data->nByte == 0) {
|
||||
ErrorMsg(__func__);
|
||||
|
|
|
@ -98,6 +98,9 @@ Those file can be compiled using
|
|||
|
||||
`make -f Makefile_test`
|
||||
|
||||
# Known Issues
|
||||
|
||||
* for PHA firmware, when the peak average changed, the Events per Agg need to be changed.
|
||||
|
||||
# Known Bugs
|
||||
|
||||
* for PHA firmware, when the peak average changed, trace disapear and causing program lag.
|
||||
|
|
27
Scope.cpp
27
Scope.cpp
|
@ -104,6 +104,7 @@ Scope::Scope(Digitizer ** digi, unsigned int nDigi, ReadDataThread ** readDataTh
|
|||
cbScopeDigi->setCurrentIndex(0);
|
||||
for( int i = 0; i < digi[0]->GetNChannels(); i++) cbScopeCh->addItem("Ch-" + QString::number(i));
|
||||
tick2ns = digi[ID]->GetTick2ns();
|
||||
factor = digi[ID]->IsDualTrace_PHA() ? 2 : 1;
|
||||
|
||||
connect(cbScopeDigi, &RComboBox::currentIndexChanged, this, [=](int index){
|
||||
if( !enableSignalSlot ) return;
|
||||
|
@ -113,6 +114,8 @@ Scope::Scope(Digitizer ** digi, unsigned int nDigi, ReadDataThread ** readDataTh
|
|||
|
||||
ID = index;
|
||||
tick2ns = digi[ID]->GetTick2ns();
|
||||
factor = digi[ID]->IsDualTrace_PHA() ? 2 : 1;
|
||||
|
||||
//---setup cbScopeCh
|
||||
cbScopeCh->clear();
|
||||
for( int i = 0; i < digi[ID]->GetNChannels(); i++) cbScopeCh->addItem("Ch-" + QString::number(i));
|
||||
|
@ -253,6 +256,7 @@ void Scope::StartScope(){
|
|||
if( !digi ) return;
|
||||
|
||||
//TODO set other channel to be no trace;
|
||||
emit UpdateOtherPanels();
|
||||
|
||||
for( unsigned int iDigi = 0; iDigi < nDigi; iDigi ++){
|
||||
|
||||
|
@ -269,10 +273,9 @@ void Scope::StartScope(){
|
|||
readDataThread[iDigi]->SetScopeMode(true);
|
||||
readDataThread[iDigi]->SetSaveData(false);
|
||||
readDataThread[iDigi]->start();
|
||||
printf("----- readDataThread running ? %d.\n", readDataThread[iDigi]->isRunning());
|
||||
}
|
||||
|
||||
emit UpdateOtherPanels();
|
||||
|
||||
updateTraceThread->start();
|
||||
|
||||
bnScopeStart->setEnabled(false);
|
||||
|
@ -335,8 +338,7 @@ void Scope::UpdateScope(){
|
|||
|
||||
if( digi[ID]->GetChannelOnOff(ch) == false) return;
|
||||
|
||||
int tick2ns = digi[ID]->GetTick2ns();
|
||||
int factor = digi[ID]->IsDualTrace_PHA() ? 2 : 1;
|
||||
// printf("### %d %d \n", ch, digi[ID]->GetData()->DataIndex[ch]);
|
||||
|
||||
digiMTX[ID].lock();
|
||||
Data * data = digi[ID]->GetData();
|
||||
|
@ -344,18 +346,17 @@ void Scope::UpdateScope(){
|
|||
//leTriggerRate->setText(QString::number(data->TriggerRate[ch]) + " [" + QString::number(data->NumEventsDecoded[ch]) + "]");
|
||||
leTriggerRate->setText(QString::number(data->TriggerRate[ch]));
|
||||
|
||||
unsigned short index = data->DataIndex[ch];
|
||||
unsigned short traceLength = data->Waveform1[ch][index].size();
|
||||
int index = data->DataIndex[ch];
|
||||
int traceLength = data->Waveform1[ch][index].size();
|
||||
|
||||
// printf("--- %s| %d, %d, %d | %d | %d, %d\n", __func__, ch, data->LoopIndex[ch], index, traceLength, factor, tick2ns );
|
||||
if( data->TriggerRate[ch] > 0 ){
|
||||
|
||||
//printf("--- %d | %d \n", index, traceLength );
|
||||
|
||||
QVector<QPointF> points[4];
|
||||
if( digi[ID]->GetDPPType() == V1730_DPP_PHA_CODE ) {
|
||||
for( int i = 0; i < (int) (data->Waveform1[ch][index]).size() ; i++ ) {
|
||||
for( int i = 0; i < traceLength ; i++ ) {
|
||||
points[0].append(QPointF(tick2ns * i * factor, (data->Waveform1[ch][index])[i]));
|
||||
if( i < (int) data->Waveform2[ch][index].size() ) points[1].append(QPointF(tick2ns * i * factor, (data->Waveform2[ch][index])[i]));
|
||||
if( i < (int) data->Waveform2[ch][index].size() ) points[1].append(QPointF(tick2ns * i * factor, (data->Waveform2[ch][index])[i]));
|
||||
if( i < (int) data->DigiWaveform1[ch][index].size() ) points[2].append(QPointF(tick2ns * i * factor, (data->DigiWaveform1[ch][index])[i] * 1000));
|
||||
if( i < (int) data->DigiWaveform2[ch][index].size() ) points[3].append(QPointF(tick2ns * i * factor, (data->DigiWaveform2[ch][index])[i] * 1000 + 500));
|
||||
}
|
||||
|
@ -364,9 +365,9 @@ void Scope::UpdateScope(){
|
|||
if( digi[ID]->GetDPPType() == V1730_DPP_PSD_CODE ) {
|
||||
for( int i = 0; i < (int) (data->DigiWaveform1[ch][index]).size() ; i++ ) {
|
||||
points[0].append(QPointF(tick2ns * i * factor, (data->Waveform1[ch][index])[i]));
|
||||
if( i < (int) data->Waveform2[ch][index].size() ) points[1].append(QPointF(tick2ns * i * factor, (data->Waveform2[ch][index])[i]));
|
||||
if( i < (int) data->DigiWaveform1[ch][index].size() ) points[2].append(QPointF(tick2ns * i, (data->DigiWaveform1[ch][index])[i] * 1000));
|
||||
if( i < (int) data->DigiWaveform2[ch][index].size() ) points[3].append(QPointF(tick2ns * i, (data->DigiWaveform2[ch][index])[i] * 1000 + 500));
|
||||
if( i < (int) data->Waveform2[ch][index].size() ) points[1].append(QPointF(tick2ns * i * factor, (data->Waveform2[ch][index])[i]));
|
||||
if( i < (int) data->DigiWaveform1[ch][index].size() ) points[2].append(QPointF(tick2ns * i, (data->DigiWaveform1[ch][index])[i] * 1000));
|
||||
if( i < (int) data->DigiWaveform2[ch][index].size() ) points[3].append(QPointF(tick2ns * i, (data->DigiWaveform2[ch][index])[i] * 1000 + 500));
|
||||
}
|
||||
}
|
||||
dataTrace[0]->replace(points[0]);
|
||||
|
|
Loading…
Reference in New Issue
Block a user