tested with PSD. seem OK
This commit is contained in:
parent
e01d9fe4e6
commit
fa896b674a
15
ClassData.h
15
ClassData.h
|
@ -334,7 +334,7 @@ inline void Data::DecodeBuffer(bool fastDecode, int verbose){
|
||||||
if ( DecodePHADualChannelBlock(chMask, fastDecode, verbose) < 0 ) break;
|
if ( DecodePHADualChannelBlock(chMask, fastDecode, verbose) < 0 ) break;
|
||||||
}
|
}
|
||||||
if( DPPType == V1730_DPP_PSD_CODE ) {
|
if( DPPType == V1730_DPP_PSD_CODE ) {
|
||||||
if ( DecodePHADualChannelBlock(chMask, fastDecode, verbose) < 0 ) break;
|
if ( DecodePSDDualChannelBlock(chMask, fastDecode, verbose) < 0 ) break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
@ -412,6 +412,8 @@ inline void Data::DecodeBuffer(bool fastDecode, int verbose){
|
||||||
//*=================================================
|
//*=================================================
|
||||||
inline int Data::DecodePHADualChannelBlock(unsigned int ChannelMask, bool fastDecode, int verbose){
|
inline int Data::DecodePHADualChannelBlock(unsigned int ChannelMask, bool fastDecode, int verbose){
|
||||||
|
|
||||||
|
//printf("======= %s\n", __func__);
|
||||||
|
|
||||||
nw = nw + 1;
|
nw = nw + 1;
|
||||||
unsigned int word = ReadBuffer(nw, verbose);
|
unsigned int word = ReadBuffer(nw, verbose);
|
||||||
|
|
||||||
|
@ -647,6 +649,8 @@ inline int Data::DecodePHADualChannelBlock(unsigned int ChannelMask, bool fastDe
|
||||||
//*=================================================
|
//*=================================================
|
||||||
inline int Data::DecodePSDDualChannelBlock(unsigned int ChannelMask, bool fastDecode, int verbose){
|
inline int Data::DecodePSDDualChannelBlock(unsigned int ChannelMask, bool fastDecode, int verbose){
|
||||||
|
|
||||||
|
//printf("======= %s\n", __func__);
|
||||||
|
|
||||||
nw = nw + 1;
|
nw = nw + 1;
|
||||||
unsigned int word = ReadBuffer(nw, verbose);
|
unsigned int word = ReadBuffer(nw, verbose);
|
||||||
|
|
||||||
|
@ -746,7 +750,7 @@ inline int Data::DecodePSDDualChannelBlock(unsigned int ChannelMask, bool fastDe
|
||||||
nw += nSample/2;
|
nw += nSample/2;
|
||||||
}else{
|
}else{
|
||||||
for( unsigned int wi = 0; wi < nSample/2; wi++){
|
for( unsigned int wi = 0; wi < nSample/2; wi++){
|
||||||
nw = nw +1 ; word = ReadBuffer(nw, verbose - 2);
|
nw = nw +1 ; word = ReadBuffer(nw, verbose-4);
|
||||||
bool dp2b = (( word >> 31 ) & 0x1 );
|
bool dp2b = (( word >> 31 ) & 0x1 );
|
||||||
bool dp1b = (( word >> 30 ) & 0x1 );
|
bool dp1b = (( word >> 30 ) & 0x1 );
|
||||||
unsigned short waveb = (( word >> 16) & 0x3FFF);
|
unsigned short waveb = (( word >> 16) & 0x3FFF);
|
||||||
|
@ -786,9 +790,9 @@ inline int Data::DecodePSDDualChannelBlock(unsigned int ChannelMask, bool fastDe
|
||||||
nw = nw +1 ; word = ReadBuffer(nw, verbose);
|
nw = nw +1 ; word = ReadBuffer(nw, verbose);
|
||||||
unsigned int Qlong = (( word >> 16) & 0xFFFF);
|
unsigned int Qlong = (( word >> 16) & 0xFFFF);
|
||||||
unsigned int Qshort = (word & 0x7FFF);
|
unsigned int Qshort = (word & 0x7FFF);
|
||||||
bool isEnergyCorrect = ((word >> 15) & 0x1);
|
bool isEnergyCorrect = ((word >> 15) & 0x1); // the PUR, either pileup or saturated
|
||||||
|
|
||||||
if( isEnergyCorrect == 1 ) {
|
if( isEnergyCorrect == 0 ) {
|
||||||
EventIndex[channel] ++;
|
EventIndex[channel] ++;
|
||||||
if( EventIndex[channel] > MaxNData ) EventIndex[channel] = 0;
|
if( EventIndex[channel] > MaxNData ) EventIndex[channel] = 0;
|
||||||
|
|
||||||
|
@ -799,8 +803,6 @@ inline int Data::DecodePSDDualChannelBlock(unsigned int ChannelMask, bool fastDe
|
||||||
Energy2[channel][EventIndex[channel]] = Qlong;
|
Energy2[channel][EventIndex[channel]] = Qlong;
|
||||||
Timestamp[channel][EventIndex[channel]] = timeStamp;
|
Timestamp[channel][EventIndex[channel]] = timeStamp;
|
||||||
|
|
||||||
//TODO pile up
|
|
||||||
|
|
||||||
if( SaveWaveToMemory ) {
|
if( SaveWaveToMemory ) {
|
||||||
if( hasDualTrace ){
|
if( hasDualTrace ){
|
||||||
Waveform1[channel][EventIndex[channel]] = tempWaveform1;
|
Waveform1[channel][EventIndex[channel]] = tempWaveform1;
|
||||||
|
@ -810,6 +812,7 @@ inline int Data::DecodePSDDualChannelBlock(unsigned int ChannelMask, bool fastDe
|
||||||
}
|
}
|
||||||
DigiWaveform1[channel][EventIndex[channel]] = tempDigiWaveform1;
|
DigiWaveform1[channel][EventIndex[channel]] = tempDigiWaveform1;
|
||||||
DigiWaveform2[channel][EventIndex[channel]] = tempDigiWaveform2;
|
DigiWaveform2[channel][EventIndex[channel]] = tempDigiWaveform2;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1278,8 +1278,8 @@ void DigiSettingsPanel::SetUpPHABoard(){
|
||||||
|
|
||||||
SetUpComboBoxBit(cbAnaProbe1[ID], "Ana. Probe 1 ", bdCfgLayout[ID], 1, 2, DPP::Bit_BoardConfig::ListAnaProbe1_PHA, DPP::BoardConfiguration, DPP::Bit_BoardConfig::AnalogProbe1, 1, 0);
|
SetUpComboBoxBit(cbAnaProbe1[ID], "Ana. Probe 1 ", bdCfgLayout[ID], 1, 2, DPP::Bit_BoardConfig::ListAnaProbe1_PHA, DPP::BoardConfiguration, DPP::Bit_BoardConfig::AnalogProbe1, 1, 0);
|
||||||
SetUpComboBoxBit(cbAnaProbe2[ID], "Ana. Probe 2 ", bdCfgLayout[ID], 2, 2, DPP::Bit_BoardConfig::ListAnaProbe2_PHA, DPP::BoardConfiguration, DPP::Bit_BoardConfig::AnalogProbe2, 1, 0);
|
SetUpComboBoxBit(cbAnaProbe2[ID], "Ana. Probe 2 ", bdCfgLayout[ID], 2, 2, DPP::Bit_BoardConfig::ListAnaProbe2_PHA, DPP::BoardConfiguration, DPP::Bit_BoardConfig::AnalogProbe2, 1, 0);
|
||||||
SetUpComboBoxBit(cbDigiProbe1[ID], "Digi. Probe 1 ", bdCfgLayout[ID], 3, 2, DPP::Bit_BoardConfig::ListDigiProbe1_PHA, DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel1, 1, 0);
|
SetUpComboBoxBit(cbDigiProbe1[ID], "Digi. Probe 1 ", bdCfgLayout[ID], 3, 2, DPP::Bit_BoardConfig::ListDigiProbe1_PHA, DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel1_PHA, 1, 0);
|
||||||
SetUpComboBoxBit(cbDigiProbe2[ID], "Digi. Probe 2 ", bdCfgLayout[ID], 4, 2, DPP::Bit_BoardConfig::ListDigiProbe2_PHA, DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel2, 1, 0);
|
SetUpComboBoxBit(cbDigiProbe2[ID], "Digi. Probe 2 ", bdCfgLayout[ID], 4, 2, DPP::Bit_BoardConfig::ListDigiProbe2_PHA, DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel2_PHA, 1, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1715,14 +1715,14 @@ void DigiSettingsPanel::SetUpPSDBoard(){
|
||||||
|
|
||||||
SetUpCheckBox(chkAutoDataFlush[ID], "Auto Data Flush", bdCfgLayout[ID], 1, 0, DPP::BoardConfiguration, DPP::Bit_BoardConfig::EnableAutoDataFlush);
|
SetUpCheckBox(chkAutoDataFlush[ID], "Auto Data Flush", bdCfgLayout[ID], 1, 0, DPP::BoardConfiguration, DPP::Bit_BoardConfig::EnableAutoDataFlush);
|
||||||
SetUpCheckBox(chkTrigPropagation[ID], "Trig. Propagate", bdCfgLayout[ID], 2, 0, DPP::BoardConfiguration, DPP::Bit_BoardConfig::TrigPropagation);
|
SetUpCheckBox(chkTrigPropagation[ID], "Trig. Propagate", bdCfgLayout[ID], 2, 0, DPP::BoardConfiguration, DPP::Bit_BoardConfig::TrigPropagation);
|
||||||
SetUpCheckBox(chkDecimateTrace[ID], "Disable Digi. Trace", bdCfgLayout[ID], 3, 0, DPP::BoardConfiguration, DPP::Bit_BoardConfig::DisableDigiTrace);
|
SetUpCheckBox(chkDecimateTrace[ID], "Disable Digi. Trace", bdCfgLayout[ID], 3, 0, DPP::BoardConfiguration, DPP::Bit_BoardConfig::DisableDigiTrace_PSD);
|
||||||
|
|
||||||
SetUpCheckBox(chkTraceRecording[ID], "Record Trace", bdCfgLayout[ID], 2, 1, DPP::BoardConfiguration, DPP::Bit_BoardConfig::RecordTrace);
|
SetUpCheckBox(chkTraceRecording[ID], "Record Trace", bdCfgLayout[ID], 2, 1, DPP::BoardConfiguration, DPP::Bit_BoardConfig::RecordTrace);
|
||||||
SetUpCheckBox(chkEnableExtra2[ID], "Enable Extra", bdCfgLayout[ID], 3, 1, DPP::BoardConfiguration, DPP::Bit_BoardConfig::EnableExtra2);
|
SetUpCheckBox(chkEnableExtra2[ID], "Enable Extra", bdCfgLayout[ID], 3, 1, DPP::BoardConfiguration, DPP::Bit_BoardConfig::EnableExtra2);
|
||||||
|
|
||||||
SetUpComboBoxBit(cbAnaProbe1[ID], "Ana. Probe ", bdCfgLayout[ID], 1, 2, DPP::Bit_BoardConfig::ListAnaProbe_PSD, DPP::BoardConfiguration, DPP::Bit_BoardConfig::AnaProbe_PSD, 1, 0);
|
SetUpComboBoxBit(cbAnaProbe1[ID], "Ana. Probe ", bdCfgLayout[ID], 1, 2, DPP::Bit_BoardConfig::ListAnaProbe_PSD, DPP::BoardConfiguration, DPP::Bit_BoardConfig::AnaProbe_PSD, 1, 0);
|
||||||
SetUpComboBoxBit(cbDigiProbe1[ID], "Digi. Probe 1 ", bdCfgLayout[ID], 3, 2, DPP::Bit_BoardConfig::ListDigiProbe1_PSD, DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel1, 1, 0);
|
SetUpComboBoxBit(cbDigiProbe1[ID], "Digi. Probe 1 ", bdCfgLayout[ID], 3, 2, DPP::Bit_BoardConfig::ListDigiProbe1_PSD, DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel1_PHA, 1, 0);
|
||||||
SetUpComboBoxBit(cbDigiProbe2[ID], "Digi. Probe 2 ", bdCfgLayout[ID], 4, 2, DPP::Bit_BoardConfig::ListDigiProbe2_PSD, DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel2, 1, 0);
|
SetUpComboBoxBit(cbDigiProbe2[ID], "Digi. Probe 2 ", bdCfgLayout[ID], 4, 2, DPP::Bit_BoardConfig::ListDigiProbe2_PSD, DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel2_PHA, 1, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2371,26 +2371,12 @@ void DigiSettingsPanel::UpdatePanelFromMemory(){
|
||||||
chkEnableExtra2[ID]->setChecked( Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::EnableExtra2) );
|
chkEnableExtra2[ID]->setChecked( Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::EnableExtra2) );
|
||||||
|
|
||||||
|
|
||||||
int temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DigiProbel1);
|
|
||||||
for(int i = 0; i < cbDigiProbe1[ID]->count(); i++){
|
|
||||||
if( cbDigiProbe1[ID]->itemData(i).toInt() == temp) {
|
|
||||||
cbDigiProbe1[ID]->setCurrentIndex(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DigiProbel2);
|
|
||||||
for(int i = 0; i < cbDigiProbe2[ID]->count(); i++){
|
|
||||||
if( cbDigiProbe2[ID]->itemData(i).toInt() == temp) {
|
|
||||||
cbDigiProbe2[ID]->setCurrentIndex(i);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if( digi[ID]->GetDPPType() == V1730_DPP_PHA_CODE ) {
|
if( digi[ID]->GetDPPType() == V1730_DPP_PHA_CODE ) {
|
||||||
chkDecimateTrace[ID]->setChecked( Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DecimateTrace) );
|
chkDecimateTrace[ID]->setChecked( Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DecimateTrace) );
|
||||||
chkDualTrace[ID]->setChecked( Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DualTrace) );
|
chkDualTrace[ID]->setChecked( Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DualTrace) );
|
||||||
|
|
||||||
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::AnalogProbe1);
|
int temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::AnalogProbe1);
|
||||||
for( int i = 0; i < cbAnaProbe1[ID]->count(); i++){
|
for( int i = 0; i < cbAnaProbe1[ID]->count(); i++){
|
||||||
if( cbAnaProbe1[ID]->itemData(i).toInt() == temp) {
|
if( cbAnaProbe1[ID]->itemData(i).toInt() == temp) {
|
||||||
cbAnaProbe1[ID]->setCurrentIndex(i);
|
cbAnaProbe1[ID]->setCurrentIndex(i);
|
||||||
|
@ -2405,17 +2391,46 @@ void DigiSettingsPanel::UpdatePanelFromMemory(){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DigiProbel1_PHA);
|
||||||
|
for(int i = 0; i < cbDigiProbe1[ID]->count(); i++){
|
||||||
|
if( cbDigiProbe1[ID]->itemData(i).toInt() == temp) {
|
||||||
|
cbDigiProbe1[ID]->setCurrentIndex(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DigiProbel2_PHA);
|
||||||
|
for(int i = 0; i < cbDigiProbe2[ID]->count(); i++){
|
||||||
|
if( cbDigiProbe2[ID]->itemData(i).toInt() == temp) {
|
||||||
|
cbDigiProbe2[ID]->setCurrentIndex(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( digi[ID]->GetDPPType() == V1730_DPP_PSD_CODE ) {
|
if( digi[ID]->GetDPPType() == V1730_DPP_PSD_CODE ) {
|
||||||
chkDecimateTrace[ID]->setChecked( Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DisableDigiTrace) );
|
chkDecimateTrace[ID]->setChecked( Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DisableDigiTrace_PSD) );
|
||||||
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::AnaProbe_PSD);
|
int temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::AnaProbe_PSD);
|
||||||
for( int i = 0; i < cbAnaProbe1[ID]->count(); i++){
|
for( int i = 0; i < cbAnaProbe1[ID]->count(); i++){
|
||||||
if( cbAnaProbe1[ID]->itemData(i).toInt() == temp) {
|
if( cbAnaProbe1[ID]->itemData(i).toInt() == temp) {
|
||||||
cbAnaProbe1[ID]->setCurrentIndex(i);
|
cbAnaProbe1[ID]->setCurrentIndex(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DigiProbel1_PSD);
|
||||||
|
for(int i = 0; i < cbDigiProbe1[ID]->count(); i++){
|
||||||
|
if( cbDigiProbe1[ID]->itemData(i).toInt() == temp) {
|
||||||
|
cbDigiProbe1[ID]->setCurrentIndex(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DigiProbel2_PSD);
|
||||||
|
for(int i = 0; i < cbDigiProbe2[ID]->count(); i++){
|
||||||
|
if( cbDigiProbe2[ID]->itemData(i).toInt() == temp) {
|
||||||
|
cbDigiProbe2[ID]->setCurrentIndex(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//*========================================
|
//*========================================
|
||||||
uint32_t chMask = digi[ID]->GetSettingFromMemory(DPP::ChannelEnableMask);
|
uint32_t chMask = digi[ID]->GetSettingFromMemory(DPP::ChannelEnableMask);
|
||||||
|
|
|
@ -613,6 +613,7 @@ void MainWindow::StartACQ(){
|
||||||
readDataThread[i]->SetSaveData(chkSaveData->isChecked());
|
readDataThread[i]->SetSaveData(chkSaveData->isChecked());
|
||||||
}
|
}
|
||||||
digi[i]->StartACQ();
|
digi[i]->StartACQ();
|
||||||
|
readDataThread[i]->SetSaveData(false);
|
||||||
readDataThread[i]->start();
|
readDataThread[i]->start();
|
||||||
}
|
}
|
||||||
if( chkSaveData->isChecked() ) SaveLastRunFile();
|
if( chkSaveData->isChecked() ) SaveLastRunFile();
|
||||||
|
|
|
@ -206,9 +206,8 @@ namespace DPP {
|
||||||
const std::pair<unsigned short, unsigned short> AnalogProbe2 = {2, 14} ;
|
const std::pair<unsigned short, unsigned short> AnalogProbe2 = {2, 14} ;
|
||||||
const std::pair<unsigned short, unsigned short> RecordTrace = {1, 16} ;
|
const std::pair<unsigned short, unsigned short> RecordTrace = {1, 16} ;
|
||||||
const std::pair<unsigned short, unsigned short> EnableExtra2 = {1, 17} ;
|
const std::pair<unsigned short, unsigned short> EnableExtra2 = {1, 17} ;
|
||||||
const std::pair<unsigned short, unsigned short> DigiProbel1 = {4, 20} ;
|
const std::pair<unsigned short, unsigned short> DigiProbel1_PHA = {4, 20} ;
|
||||||
const std::pair<unsigned short, unsigned short> DigiProbel2 = {3, 26} ;
|
const std::pair<unsigned short, unsigned short> DigiProbel2_PHA = {3, 26} ;
|
||||||
const std::pair<unsigned short, unsigned short> DisableDigiTrace = {1, 31} ;
|
|
||||||
|
|
||||||
const std::vector<std::pair<std::string, unsigned int>> ListAnaProbe1_PHA = {{"Input", 0},
|
const std::vector<std::pair<std::string, unsigned int>> ListAnaProbe1_PHA = {{"Input", 0},
|
||||||
{"RC-CR", 1},
|
{"RC-CR", 1},
|
||||||
|
@ -238,6 +237,9 @@ namespace DPP {
|
||||||
///--------------------------
|
///--------------------------
|
||||||
|
|
||||||
const std::pair<unsigned short, unsigned short> AnaProbe_PSD = {3, 11} ;
|
const std::pair<unsigned short, unsigned short> AnaProbe_PSD = {3, 11} ;
|
||||||
|
const std::pair<unsigned short, unsigned short> DigiProbel1_PSD = {3, 23} ;
|
||||||
|
const std::pair<unsigned short, unsigned short> DigiProbel2_PSD = {3, 26} ;
|
||||||
|
const std::pair<unsigned short, unsigned short> DisableDigiTrace_PSD = {1, 31} ;
|
||||||
const std::vector<std::pair<std::string, unsigned int>> ListAnaProbe_PSD = {{"Input + N/A", 0},
|
const std::vector<std::pair<std::string, unsigned int>> ListAnaProbe_PSD = {{"Input + N/A", 0},
|
||||||
{"CFD + N/A", 2},
|
{"CFD + N/A", 2},
|
||||||
{"Input + Baseline",1},
|
{"Input + Baseline",1},
|
||||||
|
|
53
Scope.cpp
53
Scope.cpp
|
@ -125,6 +125,15 @@ Scope::Scope(Digitizer ** digi, unsigned int nDigi, ReadDataThread ** readDataTh
|
||||||
layout->addWidget(bnReadSettingsFromBoard, rowID, 2);
|
layout->addWidget(bnReadSettingsFromBoard, rowID, 2);
|
||||||
connect(bnReadSettingsFromBoard, &QPushButton::clicked, this, &Scope::ReadSettingsFromBoard);
|
connect(bnReadSettingsFromBoard, &QPushButton::clicked, this, &Scope::ReadSettingsFromBoard);
|
||||||
|
|
||||||
|
|
||||||
|
QPushButton * bnClearMemory = new QPushButton("Clear Memory", this);
|
||||||
|
layout->addWidget(bnClearMemory, rowID, 3);
|
||||||
|
connect(bnClearMemory, &QPushButton::clicked, this, [=](){
|
||||||
|
digiMTX[ID].lock();
|
||||||
|
digi[ID]->GetData()->ClearData();
|
||||||
|
digiMTX[ID].unlock();
|
||||||
|
});
|
||||||
|
|
||||||
//================ Trace settings
|
//================ Trace settings
|
||||||
rowID ++;
|
rowID ++;
|
||||||
{
|
{
|
||||||
|
@ -290,11 +299,22 @@ void Scope::UpdateScope(){
|
||||||
//printf("--- %d | %d \n", index, traceLength );
|
//printf("--- %d | %d \n", index, traceLength );
|
||||||
|
|
||||||
QVector<QPointF> points[4];
|
QVector<QPointF> points[4];
|
||||||
for( int i = 0; i < (int) (data->Waveform1[ch][index]).size() ; i++ ) {
|
if( digi[ID]->GetDPPType() == V1730_DPP_PHA_CODE ) {
|
||||||
points[0].append(QPointF(ch2ns * i * factor, (data->Waveform1[ch][index])[i]));
|
for( int i = 0; i < (int) (data->Waveform1[ch][index]).size() ; i++ ) {
|
||||||
if( i < (int) data->Waveform2[ch][index].size() ) points[1].append(QPointF(ch2ns * i * factor, (data->Waveform2[ch][index])[i]));
|
points[0].append(QPointF(ch2ns * i * factor, (data->Waveform1[ch][index])[i]));
|
||||||
if( i < (int) data->DigiWaveform1[ch][index].size() ) points[2].append(QPointF(ch2ns * i * factor, (data->DigiWaveform1[ch][index])[i] * 1000));
|
points[1].append(QPointF(ch2ns * i * factor, (data->Waveform2[ch][index])[i]));
|
||||||
if( i < (int) data->DigiWaveform2[ch][index].size() ) points[3].append(QPointF(ch2ns * i * factor, (data->DigiWaveform2[ch][index])[i] * 1000 + 500));
|
points[2].append(QPointF(ch2ns * i * factor, (data->DigiWaveform1[ch][index])[i] * 1000));
|
||||||
|
points[3].append(QPointF(ch2ns * i * factor, (data->DigiWaveform2[ch][index])[i] * 1000 + 500));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if( digi[ID]->GetDPPType() == V1730_DPP_PSD_CODE ) {
|
||||||
|
for( int i = 0; i < (int) (data->DigiWaveform1[ch][index]).size() ; i++ ) {
|
||||||
|
if( i < (int) data->Waveform1[ch][index].size() ) points[0].append(QPointF(ch2ns * i * factor, (data->Waveform1[ch][index])[i]));
|
||||||
|
if( i < (int) data->Waveform2[ch][index].size() ) points[1].append(QPointF(ch2ns * i * factor, (data->Waveform2[ch][index])[i]));
|
||||||
|
if( i < (int) data->DigiWaveform1[ch][index].size() ) points[2].append(QPointF(ch2ns * i, (data->DigiWaveform1[ch][index])[i] * 1000));
|
||||||
|
if( i < (int) data->DigiWaveform2[ch][index].size() ) points[3].append(QPointF(ch2ns * i, (data->DigiWaveform2[ch][index])[i] * 1000 + 500));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dataTrace[0]->replace(points[0]);
|
dataTrace[0]->replace(points[0]);
|
||||||
dataTrace[1]->replace(points[1]);
|
dataTrace[1]->replace(points[1]);
|
||||||
|
@ -517,7 +537,7 @@ void Scope::SetUpPHAPanel(){
|
||||||
}
|
}
|
||||||
connect(cbDigiProbe1, &RComboBox::currentIndexChanged, this, [=](){
|
connect(cbDigiProbe1, &RComboBox::currentIndexChanged, this, [=](){
|
||||||
if( !enableSignalSlot ) return;
|
if( !enableSignalSlot ) return;
|
||||||
digi[ID]->SetBits(DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel1, cbDigiProbe1->currentData().toInt(), cbScopeCh->currentIndex());
|
digi[ID]->SetBits(DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel1_PHA, cbDigiProbe1->currentData().toInt(), cbScopeCh->currentIndex());
|
||||||
dataTrace[2]->setName(cbDigiProbe1->currentText());
|
dataTrace[2]->setName(cbDigiProbe1->currentText());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -566,7 +586,16 @@ void Scope::SetUpPSDPanel(){
|
||||||
connect(cbAnaProbe1, &RComboBox::currentIndexChanged, this, [=](){
|
connect(cbAnaProbe1, &RComboBox::currentIndexChanged, this, [=](){
|
||||||
if( !enableSignalSlot ) return;
|
if( !enableSignalSlot ) return;
|
||||||
digi[ID]->SetBits(DPP::BoardConfiguration, DPP::Bit_BoardConfig::AnaProbe_PSD, cbAnaProbe1->currentData().toInt(), cbScopeCh->currentIndex());
|
digi[ID]->SetBits(DPP::BoardConfiguration, DPP::Bit_BoardConfig::AnaProbe_PSD, cbAnaProbe1->currentData().toInt(), cbScopeCh->currentIndex());
|
||||||
dataTrace[0]->setName(cbAnaProbe1->currentText());
|
//dataTrace[0]->setName(cbAnaProbe1->currentText());
|
||||||
|
|
||||||
|
switch( cbAnaProbe1->currentIndex() ){
|
||||||
|
case 0 : dataTrace[0]->setName("input"); dataTrace[1]->setName("N/A"); break;
|
||||||
|
case 1 : dataTrace[0]->setName("CFD"); dataTrace[1]->setName("N/A"); break;
|
||||||
|
case 2 : dataTrace[0]->setName("baseline"); dataTrace[1]->setName("input"); break;
|
||||||
|
case 3 : dataTrace[0]->setName("baseline"); dataTrace[1]->setName("CFD"); break;
|
||||||
|
case 4 : dataTrace[0]->setName("CFD"); dataTrace[1]->setName("input"); break;
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
SetUpComboBoxSimple(cbDigiProbe1, "Digi. Probe 1 ", rowID, 4);
|
SetUpComboBoxSimple(cbDigiProbe1, "Digi. Probe 1 ", rowID, 4);
|
||||||
|
@ -575,7 +604,7 @@ void Scope::SetUpPSDPanel(){
|
||||||
}
|
}
|
||||||
connect(cbDigiProbe1, &RComboBox::currentIndexChanged, this, [=](){
|
connect(cbDigiProbe1, &RComboBox::currentIndexChanged, this, [=](){
|
||||||
if( !enableSignalSlot ) return;
|
if( !enableSignalSlot ) return;
|
||||||
digi[ID]->SetBits(DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel1, cbDigiProbe1->currentData().toInt(), cbScopeCh->currentIndex());
|
digi[ID]->SetBits(DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel1_PSD, cbDigiProbe1->currentData().toInt(), cbScopeCh->currentIndex());
|
||||||
dataTrace[2]->setName(cbDigiProbe1->currentText());
|
dataTrace[2]->setName(cbDigiProbe1->currentText());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -585,7 +614,7 @@ void Scope::SetUpPSDPanel(){
|
||||||
}
|
}
|
||||||
connect(cbDigiProbe2, &RComboBox::currentIndexChanged, this, [=](){
|
connect(cbDigiProbe2, &RComboBox::currentIndexChanged, this, [=](){
|
||||||
if( !enableSignalSlot ) return;
|
if( !enableSignalSlot ) return;
|
||||||
digi[ID]->SetBits(DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel1, cbDigiProbe1->currentData().toInt(), cbScopeCh->currentIndex());
|
digi[ID]->SetBits(DPP::BoardConfiguration, DPP::Bit_BoardConfig::DigiProbel1_PSD, cbDigiProbe1->currentData().toInt(), cbScopeCh->currentIndex());
|
||||||
dataTrace[3]->setName(cbDigiProbe2->currentText());
|
dataTrace[3]->setName(cbDigiProbe2->currentText());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -724,7 +753,7 @@ void Scope::UpdatePHAPanel(){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DigiProbel1);
|
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DigiProbel1_PHA);
|
||||||
for(int i = 0; i < cbDigiProbe1->count(); i++){
|
for(int i = 0; i < cbDigiProbe1->count(); i++){
|
||||||
if( cbDigiProbe1->itemData(i).toInt() == temp) {
|
if( cbDigiProbe1->itemData(i).toInt() == temp) {
|
||||||
cbDigiProbe1->setCurrentIndex(i);
|
cbDigiProbe1->setCurrentIndex(i);
|
||||||
|
@ -764,7 +793,7 @@ void Scope::UpdatePSDPanel(){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DigiProbel1);
|
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DigiProbel1_PSD);
|
||||||
for( int i = 0; i < cbDigiProbe1->count(); i++){
|
for( int i = 0; i < cbDigiProbe1->count(); i++){
|
||||||
if( cbDigiProbe1->itemData(i).toInt() == temp ) {
|
if( cbDigiProbe1->itemData(i).toInt() == temp ) {
|
||||||
cbDigiProbe1->setCurrentIndex(i);
|
cbDigiProbe1->setCurrentIndex(i);
|
||||||
|
@ -772,7 +801,7 @@ void Scope::UpdatePSDPanel(){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DigiProbel2);
|
temp = Digitizer::ExtractBits(BdCfg, DPP::Bit_BoardConfig::DigiProbel2_PSD);
|
||||||
for( int i = 0; i < cbDigiProbe2->count(); i++){
|
for( int i = 0; i < cbDigiProbe2->count(); i++){
|
||||||
if( cbDigiProbe2->itemData(i).toInt() == temp ) {
|
if( cbDigiProbe2->itemData(i).toInt() == temp ) {
|
||||||
cbDigiProbe2->setCurrentIndex(i);
|
cbDigiProbe2->setCurrentIndex(i);
|
||||||
|
|
6
test.cpp
6
test.cpp
|
@ -40,12 +40,14 @@ int main(int argc, char* argv[]){
|
||||||
|
|
||||||
Data * data = dig[0]->GetData();
|
Data * data = dig[0]->GetData();
|
||||||
|
|
||||||
|
printf("################# DPP Type : %d , %s\n", data->DPPType, data->DPPTypeStr.c_str());
|
||||||
|
|
||||||
dig[0]->StartACQ();
|
dig[0]->StartACQ();
|
||||||
|
|
||||||
for( int i = 0; i < 50; i ++ ){
|
for( int i = 0; i < 5; i ++ ){
|
||||||
usleep(100*1000);
|
usleep(100*1000);
|
||||||
dig[0]->ReadData();
|
dig[0]->ReadData();
|
||||||
data->DecodeBuffer(false, 3);
|
data->DecodeBuffer(false, 5);
|
||||||
data->PrintStat();
|
data->PrintStat();
|
||||||
|
|
||||||
int index = data->NumEventsDecoded[0];
|
int index = data->NumEventsDecoded[0];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user