complete Scope for PHA
This commit is contained in:
parent
50a8bbcdd6
commit
a041b11cb8
|
@ -851,77 +851,6 @@ void Digitizer::ErrorMsg(std::string header){
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
void Digitizer::SetRecordLength(unsigned int ns, int ch){
|
||||
WriteRegister( Register::DPP::RecordLength_G, ns / ch2ns / 8 , ch);
|
||||
if( ch >= 0 ) WriteRegister( Register::DPP::RecordLength_G, ns / ch2ns / 8 , ch + int(pow(-1, ch)));
|
||||
ErrorMsg(__func__);
|
||||
}
|
||||
|
||||
void Digitizer::SetAggregateOrganization(unsigned int bit){
|
||||
WriteRegister(Register::DPP::AggregateOrganization, bit & 0x7);
|
||||
ErrorMsg(__func__);
|
||||
}
|
||||
|
||||
|
||||
void Digitizer::SetEventAggregation(unsigned int numEvent, int ch){
|
||||
WriteRegister( Register::DPP::NumberEventsPerAggregate_G,numEvent, ch);
|
||||
if( ch >= 0 ) WriteRegister( Register::DPP::NumberEventsPerAggregate_G,numEvent, ch + int(pow(-1, ch)));
|
||||
ErrorMsg(__func__);
|
||||
}
|
||||
|
||||
void Digitizer::SetMaxAggregatePerBlockTransfer(unsigned int numEvent){
|
||||
WriteRegister( Register::DPP::MaxAggregatePerBlockTransfer,numEvent);
|
||||
ErrorMsg(__func__);
|
||||
}
|
||||
|
||||
|
||||
void Digitizer::SetACQControl(uint32_t bit){
|
||||
WriteRegister( Register::DPP::AcquisitionControl, bit);
|
||||
ErrorMsg(__func__);
|
||||
}
|
||||
|
||||
void Digitizer::SetGlobalTriggerMask(uint32_t bit){
|
||||
WriteRegister( Register::DPP::GlobalTriggerMask, bit);
|
||||
ErrorMsg(__func__);
|
||||
}
|
||||
|
||||
void Digitizer::SetFrontPanelTRGOUTMask(uint32_t bit){
|
||||
WriteRegister( Register::DPP::FrontPanelTRGOUTEnableMask, bit);
|
||||
ErrorMsg(__func__);
|
||||
}
|
||||
|
||||
void Digitizer::SetFrontPanelIOControl(uint32_t bit){
|
||||
WriteRegister( Register::DPP::FrontPanelIOControl, bit);
|
||||
ErrorMsg(__func__);
|
||||
}
|
||||
|
||||
void Digitizer::SetTriggerValidationMask(uint32_t bit){
|
||||
WriteRegister( Register::DPP::TriggerValidationMask_G, bit);
|
||||
ErrorMsg(__func__);
|
||||
}
|
||||
|
||||
void Digitizer::SetInputDynamicRange(unsigned int TwoVol_0_or_halfVol_1, int ch){ WriteRegister( Register::DPP::InputDynamicRange, TwoVol_0_or_halfVol_1, ch); ErrorMsg(__func__);}
|
||||
void Digitizer::SetPreTriggerSample(unsigned int nSample, int ch) { WriteRegister( Register::DPP::PreTrigger, nSample / 4, ch); ErrorMsg(__func__);}
|
||||
void Digitizer::SetPreTriggerDuration(unsigned int ns, int ch) { WriteRegister( Register::DPP::PreTrigger, ns / ch2ns / 4, ch); ErrorMsg(__func__);}
|
||||
void Digitizer::SetDCOffset(float offsetPrecentage, int ch) { WriteRegister( Register::DPP::ChannelDCOffset, uint( 0xFFFF * (1.0-offsetPrecentage)), ch ); ErrorMsg(__func__);}
|
||||
void Digitizer::SetVetoWidth(uint32_t bit, int ch) { WriteRegister( Register::DPP::VetoWidth, bit, ch); ErrorMsg(__func__);}
|
||||
|
||||
|
||||
void Digitizer::SetTriggerPolarity(bool RiseingIsZero, int ch ){
|
||||
if( !isConnected ) return;
|
||||
if ( DPPType >= 128 ) return; /// do thing for DPP firmware
|
||||
if( ch < 0 ) {
|
||||
ret = 0;
|
||||
for (int i = 0; i < NChannel; i++){
|
||||
ret |= CAEN_DGTZ_SetTriggerPolarity(handle, i, CAEN_DGTZ_TriggerPolarity_t(RiseingIsZero));
|
||||
}
|
||||
}else{
|
||||
ret = CAEN_DGTZ_SetTriggerPolarity(handle, ch, CAEN_DGTZ_TriggerPolarity_t(RiseingIsZero));
|
||||
}
|
||||
if( ret != 0 ) ErrorMsg(__func__);
|
||||
}
|
||||
|
||||
//============================== DPP-Alpgorthm Control
|
||||
void Digitizer::SetDPPAlgorithmControl(uint32_t bit, int ch){
|
||||
WriteRegister( Register::DPP::DPPAlgorithmControl, bit, ch);
|
||||
|
@ -950,17 +879,3 @@ void Digitizer::SetBits(Register::Reg address, unsigned int bitValue, unsigned i
|
|||
if( ret != 0 ) ErrorMsg(__func__);
|
||||
}
|
||||
|
||||
int Digitizer::GetChTemperature(int ch){
|
||||
if( !isConnected ) return -404;
|
||||
if( BoardInfo.Model != CAEN_DGTZ_V1730 &&
|
||||
BoardInfo.Model != CAEN_DGTZ_V1725 &&
|
||||
BoardInfo.Model != CAEN_DGTZ_V1751 ) return -404;
|
||||
|
||||
uint32_t * temp;
|
||||
ret |= CAEN_DGTZ_ReadTemperature(handle, ch, temp);
|
||||
if( ret != 0 ) ErrorMsg(__func__);
|
||||
return temp[0];
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
|
|
@ -140,10 +140,10 @@ class Digitizer{
|
|||
unsigned int ReadSettingFromFile (Register::Reg registerAddress, unsigned short ch = 0); /// read from setting binary
|
||||
|
||||
//============ old methods, that only manipulate digitizer register, not setting in memory
|
||||
// void SetTriggerPolarity(bool RiseingIsZero, int ch );
|
||||
// void SetDPPAlgorithmControl(uint32_t bit, int ch);
|
||||
// unsigned int ReadBits(Register::Reg address, unsigned int bitLength, unsigned int bitSmallestPos, int ch );
|
||||
// void SetBits(Register::Reg address, unsigned int bitValue, unsigned int bitLength, unsigned int bitSmallestPos, int ch);
|
||||
void SetDPPAlgorithmControl(uint32_t bit, int ch);
|
||||
unsigned int ReadBits(Register::Reg address, unsigned int bitLength, unsigned int bitSmallestPos, int ch );
|
||||
void SetBits(Register::Reg address, unsigned int bitValue, unsigned int bitLength, unsigned int bitSmallestPos, int ch);
|
||||
void SetBits(Register::Reg address, std::pair<unsigned short, unsigned short> bit, unsigned int bitValue, int ch){ SetBits(address, bitValue, bit.first, bit.second, ch);}
|
||||
|
||||
//====== Board Config breakDown
|
||||
bool IsEnabledAutoDataFlush() {return ( GetSettingFromMemory(Register::DPP::BoardConfiguration) & 0x1 );}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
///=======
|
||||
/// All 0x1XXX registers are either indiviual or Group
|
||||
|
@ -198,6 +199,32 @@ inline uint32_t Reg::CalAddress(unsigned int index){
|
|||
///====== Common for PHA and PSD
|
||||
namespace DPP {
|
||||
|
||||
namespace BoardConfigBit{
|
||||
const std::pair<unsigned short, unsigned short> EnableAutoDataFlush = {1, 0} ; /// length, smallest pos
|
||||
const std::pair<unsigned short, unsigned short> DecimateTrace = {1, 1} ;
|
||||
const std::pair<unsigned short, unsigned short> TrigPropagation = {1, 2} ;
|
||||
const std::pair<unsigned short, unsigned short> DualTrace = {1, 11} ;
|
||||
const std::pair<unsigned short, unsigned short> AnalogProbe1 = {2, 12} ;
|
||||
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> EnableExtra2 = {1, 17} ;
|
||||
const std::pair<unsigned short, unsigned short> DigiProbel1 = {4, 20} ;
|
||||
const std::pair<unsigned short, unsigned short> DigiProbel2 = {3, 26} ;
|
||||
}
|
||||
|
||||
namespace DPPAlgorithmControlBit {
|
||||
const std::pair<unsigned short, unsigned short> TrapRescaling = {6, 0} ; /// length, smallest pos
|
||||
const std::pair<unsigned short, unsigned short> TraceDecimation = {2, 8};
|
||||
const std::pair<unsigned short, unsigned short> TraceDeciGain = {2, 10,};
|
||||
const std::pair<unsigned short, unsigned short> PeakMean = {2, 12};
|
||||
const std::pair<unsigned short, unsigned short> Polarity = {1, 16};
|
||||
const std::pair<unsigned short, unsigned short> TriggerMode = {2, 18};
|
||||
const std::pair<unsigned short, unsigned short> BaselineAvg = {3, 20};
|
||||
const std::pair<unsigned short, unsigned short> DisableSelfTrigger = {1, 24};
|
||||
const std::pair<unsigned short, unsigned short> EnableRollOverFlag = {1, 26};
|
||||
const std::pair<unsigned short, unsigned short> EnablePileUpFlag = {1, 27};
|
||||
}
|
||||
|
||||
const Reg RecordLength_G ("RecordLength_G" , 0x1020, RW::ReadWrite, true, 0x3FFF, 8); /// R/W
|
||||
const Reg InputDynamicRange ("InputDynamicRange" , 0x1028, RW::ReadWrite, false, {{"2 Vpp", 0},{"0.5 Vpp", 1}}); /// R/W
|
||||
const Reg NumberEventsPerAggregate_G ("NumberEventsPerAggregate_G" , 0x1034, RW::ReadWrite, true, 0x3FF, -1); /// R/W
|
||||
|
|
207
Scope.cpp
207
Scope.cpp
|
@ -108,7 +108,6 @@ Scope::Scope(Digitizer ** digi, unsigned int nDigi, ReadDataThread ** readDataTh
|
|||
|
||||
//---Setup SettingGroup
|
||||
CleanUpSettingsGroupBox();
|
||||
SetUpGeneralPanel();
|
||||
if( digi[ID]->GetDPPType() == V1730_DPP_PHA_CODE ) SetUpPHAPanel();
|
||||
if( digi[ID]->GetDPPType() == V1730_DPP_PSD_CODE ) SetUpPSDPanel();
|
||||
|
||||
|
@ -127,7 +126,6 @@ Scope::Scope(Digitizer ** digi, unsigned int nDigi, ReadDataThread ** readDataTh
|
|||
settingLayout = new QGridLayout(settingGroup);
|
||||
settingLayout->setSpacing(0);
|
||||
|
||||
SetUpGeneralPanel();
|
||||
if( digi[ID]->GetDPPType() == V1730_DPP_PHA_CODE ) SetUpPHAPanel();
|
||||
|
||||
}
|
||||
|
@ -383,6 +381,10 @@ void Scope::SetUpSpinBox(RSpinBox * &sb, QString str, int row, int col, const Re
|
|||
value = uint16_t((1.0 - sb->value()/100.) * 0xFFFF);
|
||||
}
|
||||
|
||||
if( para == Register::DPP::PHA::TriggerThreshold ){
|
||||
value = sb->value();
|
||||
}
|
||||
|
||||
msg += " | 0x" + QString::number(value, 16);
|
||||
|
||||
digiMTX[ID].lock();
|
||||
|
@ -411,46 +413,41 @@ void Scope::CleanUpSettingsGroupBox(){
|
|||
|
||||
}
|
||||
|
||||
void Scope::SetUpGeneralPanel(){
|
||||
|
||||
printf("--- %s \n", __func__);
|
||||
|
||||
SetUpSpinBox(sbReordLength, "Record Length [ns]", 0, 0, Register::DPP::RecordLength_G);
|
||||
SetUpSpinBox(sbPreTrigger, "Pre Trigger [ns]", 0, 2, Register::DPP::PreTrigger);
|
||||
SetUpSpinBox(sbDCOffset, "DC offset [%]", 0, 4, Register::DPP::ChannelDCOffset);
|
||||
sbDCOffset->setDecimals(2);
|
||||
SetUpComboBox(cbDynamicRange, "Dynamic Range", 0, 6, Register::DPP::InputDynamicRange);
|
||||
|
||||
|
||||
SetUpComboBoxSimple(cbPolarity, "Polarity ", 1, 0);
|
||||
cbPolarity->addItem("Positive", 0);
|
||||
cbPolarity->addItem("Negative", 1);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void Scope::SetUpPHAPanel(){
|
||||
printf("--- %s \n", __func__);
|
||||
|
||||
SetUpSpinBox(sbInputRiseTime, "Input Rise Time [ns]", 2, 0, Register::DPP::PHA::InputRiseTime);
|
||||
SetUpSpinBox(sbThreshold, "Threshold [LSB]", 2, 2, Register::DPP::PHA::TriggerThreshold);
|
||||
SetUpSpinBox(sbTriggerHoldOff,"Trigger HoldOff [ns]", 2, 4, Register::DPP::PHA::TriggerHoldOffWidth);
|
||||
SetUpComboBox(cbSmoothingFactor, "Smooth Factor", 2, 6, Register::DPP::PHA::RCCR2SmoothingFactor);
|
||||
enableSignalSlot = false;
|
||||
|
||||
SetUpSpinBox(sbTrapRiseTime, "Trap. Rise Time [ns]", 3, 0, Register::DPP::PHA::TrapezoidRiseTime);
|
||||
SetUpSpinBox(sbTrapFlatTop, "Trap. FlatTop [ns]", 3, 2, Register::DPP::PHA::TrapezoidFlatTop);
|
||||
SetUpSpinBox(sbDecayTime, "Decay Time [ns]", 3, 4, Register::DPP::PHA::DecayTime);
|
||||
SetUpSpinBox(sbPeakingTime, "Peaking Time [ns]", 3, 6, Register::DPP::PHA::PeakingTime);
|
||||
int rowID = 0;
|
||||
SetUpSpinBox(sbReordLength, "Record Length [ns] ", rowID, 0, Register::DPP::RecordLength_G);
|
||||
SetUpSpinBox(sbPreTrigger, "Pre Trigger [ns] ", rowID, 2, Register::DPP::PreTrigger);
|
||||
SetUpSpinBox(sbDCOffset, "DC offset [%] ", rowID, 4, Register::DPP::ChannelDCOffset);
|
||||
sbDCOffset->setDecimals(2);
|
||||
SetUpComboBox(cbDynamicRange, "Dynamic Range ", rowID, 6, Register::DPP::InputDynamicRange);
|
||||
|
||||
SetUpSpinBox(sbPeakHoldOff, "Peak HoldOff [ns]", 4, 6, Register::DPP::PHA::PeakHoldOff);
|
||||
rowID ++; //=============================================================
|
||||
SetUpSpinBox(sbInputRiseTime, "Input Rise Time [ns] ", rowID, 0, Register::DPP::PHA::InputRiseTime);
|
||||
SetUpSpinBox(sbThreshold, "Threshold [LSB] ", rowID, 2, Register::DPP::PHA::TriggerThreshold);
|
||||
SetUpSpinBox(sbTriggerHoldOff,"Trigger HoldOff [ns] ", rowID, 4, Register::DPP::PHA::TriggerHoldOffWidth);
|
||||
SetUpComboBox(cbSmoothingFactor, "Smooth Factor ", rowID, 6, Register::DPP::PHA::RCCR2SmoothingFactor);
|
||||
|
||||
SetUpComboBoxSimple(cbPeakAvg, "Peak Avg.", 4, 4);
|
||||
cbPeakAvg->addItem("1 sample", 0);
|
||||
cbPeakAvg->addItem("4 sample", 1);
|
||||
cbPeakAvg->addItem("16 sample", 2);
|
||||
cbPeakAvg->addItem("64 sample", 3);
|
||||
rowID ++; //=============================================================
|
||||
SetUpSpinBox(sbTrapRiseTime, "Trap. Rise Time [ns] ", rowID, 0, Register::DPP::PHA::TrapezoidRiseTime);
|
||||
SetUpSpinBox(sbTrapFlatTop, "Trap. FlatTop [ns] ", rowID, 2, Register::DPP::PHA::TrapezoidFlatTop);
|
||||
SetUpSpinBox(sbDecayTime, "Decay Time [ns] ", rowID, 4, Register::DPP::PHA::DecayTime);
|
||||
SetUpSpinBox(sbPeakingTime, "Peaking Time [ns] ", rowID, 6, Register::DPP::PHA::PeakingTime);
|
||||
|
||||
SetUpComboBoxSimple(cbBaselineAvg, "Baseline Avg.", 4, 2);
|
||||
rowID ++; //=============================================================
|
||||
SetUpComboBoxSimple(cbPolarity, "Polarity ", rowID, 0);
|
||||
cbPolarity->addItem("Positive", 0);
|
||||
cbPolarity->addItem("Negative", 1);
|
||||
connect(cbPolarity, &RComboBox::currentIndexChanged, this, [=](){
|
||||
if( !enableSignalSlot ) return;
|
||||
digi[ID]->SetBits(Register::DPP::DPPAlgorithmControl, Register::DPP::DPPAlgorithmControlBit::Polarity, cbPolarity->currentData().toInt(), cbScopeCh->currentIndex());
|
||||
});
|
||||
|
||||
SetUpComboBoxSimple(cbBaselineAvg, "Baseline Avg. ", rowID, 2);
|
||||
cbBaselineAvg->addItem("Not evaluated", 0);
|
||||
cbBaselineAvg->addItem("16 sample", 1);
|
||||
cbBaselineAvg->addItem("64 sample", 2);
|
||||
|
@ -458,11 +455,93 @@ void Scope::SetUpPHAPanel(){
|
|||
cbBaselineAvg->addItem("1024 sample", 4);
|
||||
cbBaselineAvg->addItem("4096 sample", 5);
|
||||
cbBaselineAvg->addItem("16384 sample", 6);
|
||||
connect(cbBaselineAvg, &RComboBox::currentIndexChanged, this, [=](){
|
||||
if( !enableSignalSlot ) return;
|
||||
digi[ID]->SetBits(Register::DPP::DPPAlgorithmControl, Register::DPP::DPPAlgorithmControlBit::BaselineAvg, cbBaselineAvg->currentData().toInt(), cbScopeCh->currentIndex());
|
||||
});
|
||||
|
||||
SetUpComboBoxSimple(cbPeakAvg, "Peak Avg. ", rowID, 4);
|
||||
cbPeakAvg->addItem("1 sample", 0);
|
||||
cbPeakAvg->addItem("4 sample", 1);
|
||||
cbPeakAvg->addItem("16 sample", 2);
|
||||
cbPeakAvg->addItem("64 sample", 3);
|
||||
connect(cbPeakAvg, &RComboBox::currentIndexChanged, this, [=](){
|
||||
if( !enableSignalSlot ) return;
|
||||
digi[ID]->SetBits(Register::DPP::DPPAlgorithmControl, Register::DPP::DPPAlgorithmControlBit::PeakMean, cbPeakAvg->currentData().toInt(), cbScopeCh->currentIndex());
|
||||
});
|
||||
|
||||
SetUpSpinBox(sbPeakHoldOff, "Peak HoldOff [ns] ", rowID, 6, Register::DPP::PHA::PeakHoldOff);
|
||||
|
||||
|
||||
rowID ++; //=============================================================
|
||||
SetUpComboBoxSimple(cbAnaProbe1, "Ana. Probe 1 ", rowID, 0);
|
||||
cbAnaProbe1->addItem("Input", 0);
|
||||
cbAnaProbe1->addItem("RC-CR", 1);
|
||||
cbAnaProbe1->addItem("RC-CR2", 2);
|
||||
cbAnaProbe1->addItem("Trap.", 3);
|
||||
connect(cbAnaProbe1, &RComboBox::currentIndexChanged, this, [=](){
|
||||
if( !enableSignalSlot ) return;
|
||||
digi[ID]->SetBits(Register::DPP::BoardConfiguration, Register::DPP::BoardConfigBit::AnalogProbe1, cbAnaProbe1->currentData().toInt(), cbScopeCh->currentIndex());
|
||||
dataTrace[0]->setName(cbAnaProbe1->currentText());
|
||||
});
|
||||
|
||||
SetUpComboBoxSimple(cbAnaProbe2, "Ana. Probe 2 ", rowID, 2);
|
||||
cbAnaProbe2->addItem("Input", 0);
|
||||
cbAnaProbe2->addItem("Threshold", 1);
|
||||
cbAnaProbe2->addItem("Trap.-Baseline", 2);
|
||||
cbAnaProbe2->addItem("Baseline", 3);
|
||||
connect(cbAnaProbe2, &RComboBox::currentIndexChanged, this, [=](){
|
||||
if( !enableSignalSlot ) return;
|
||||
digi[ID]->SetBits(Register::DPP::BoardConfiguration, Register::DPP::BoardConfigBit::AnalogProbe2, cbAnaProbe2->currentData().toInt(), cbScopeCh->currentIndex());
|
||||
dataTrace[1]->setName(cbAnaProbe2->currentText());
|
||||
});
|
||||
|
||||
SetUpComboBoxSimple(cbDigiProbe1, "Digi. Probe 1 ", rowID, 4);
|
||||
cbDigiProbe1->addItem("Peaking", 0);
|
||||
cbDigiProbe1->addItem("Armed", 1);
|
||||
cbDigiProbe1->addItem("Peak Run", 2);
|
||||
cbDigiProbe1->addItem("Pile Up", 3);
|
||||
cbDigiProbe1->addItem("peaking", 4);
|
||||
cbDigiProbe1->addItem("TRG Valid. Win", 5);
|
||||
cbDigiProbe1->addItem("Baseline Freeze", 6);
|
||||
cbDigiProbe1->addItem("TRG Holdoff", 7);
|
||||
cbDigiProbe1->addItem("TRG Valid.", 8);
|
||||
cbDigiProbe1->addItem("ACQ Busy", 9);
|
||||
cbDigiProbe1->addItem("Zero Cross", 10);
|
||||
cbDigiProbe1->addItem("Ext. TRG", 11);
|
||||
cbDigiProbe1->addItem("Budy", 12);
|
||||
connect(cbDigiProbe1, &RComboBox::currentIndexChanged, this, [=](){
|
||||
if( !enableSignalSlot ) return;
|
||||
digi[ID]->SetBits(Register::DPP::BoardConfiguration, Register::DPP::BoardConfigBit::DigiProbel1, cbDigiProbe1->currentData().toInt(), cbScopeCh->currentIndex());
|
||||
dataTrace[2]->setName(cbDigiProbe2->currentText());
|
||||
});
|
||||
|
||||
SetUpComboBoxSimple(cbDigiProbe2, "Digi. Probe 2 ", rowID, 6);
|
||||
cbDigiProbe2->addItem("Trigger", 0);
|
||||
dataTrace[3]->setName(cbDigiProbe2->currentText());
|
||||
cbDigiProbe2->setEnabled(false);
|
||||
|
||||
enableSignalSlot = true;
|
||||
|
||||
}
|
||||
|
||||
void Scope::SetUpPSDPanel(){
|
||||
|
||||
int rowID = 0;
|
||||
SetUpSpinBox(sbReordLength, "Record Length [ns] ", rowID, 0, Register::DPP::RecordLength_G);
|
||||
SetUpSpinBox(sbPreTrigger, "Pre Trigger [ns] ", rowID, 2, Register::DPP::PreTrigger);
|
||||
SetUpSpinBox(sbDCOffset, "DC offset [%] ", rowID, 4, Register::DPP::ChannelDCOffset);
|
||||
sbDCOffset->setDecimals(2);
|
||||
SetUpComboBox(cbDynamicRange, "Dynamic Range ", rowID, 6, Register::DPP::InputDynamicRange);
|
||||
|
||||
rowID ++; //=============================================================
|
||||
SetUpComboBoxSimple(cbPolarity, "Polarity ", rowID, 0);
|
||||
cbPolarity->addItem("Positive", 0);
|
||||
cbPolarity->addItem("Negative", 1);
|
||||
connect(cbPolarity, &RComboBox::currentIndexChanged, this, [=](){
|
||||
if( !enableSignalSlot ) return;
|
||||
digi[ID]->SetBits(Register::DPP::DPPAlgorithmControl, Register::DPP::DPPAlgorithmControlBit::Polarity, cbPolarity->currentData().toInt(), cbScopeCh->currentIndex());
|
||||
});
|
||||
}
|
||||
|
||||
void Scope::EnableControl(bool enable){
|
||||
|
@ -475,6 +554,7 @@ void Scope::EnableControl(bool enable){
|
|||
sbDecayTime->setEnabled(enable);
|
||||
|
||||
sbInputRiseTime->setEnabled(enable);
|
||||
cbSmoothingFactor->setEnabled(enable);
|
||||
|
||||
}
|
||||
|
||||
|
@ -497,7 +577,7 @@ void Scope::UpdateComobox(RComboBox * &cb, const Register::Reg para){
|
|||
}
|
||||
}
|
||||
|
||||
enableSignalSlot = true;
|
||||
//enableSignalSlot = true;
|
||||
}
|
||||
|
||||
void Scope::UpdateSpinBox(RSpinBox * &sb, const Register::Reg para){
|
||||
|
@ -507,12 +587,13 @@ void Scope::UpdateSpinBox(RSpinBox * &sb, const Register::Reg para){
|
|||
unsigned int haha = digi[ID]->GetSettingFromMemory(para, ch);
|
||||
if( para.GetPartialStep() > 0 ) sb->setValue(haha * para.GetPartialStep() * ch2ns);
|
||||
if( para.GetPartialStep() == -1 ) sb->setValue(haha);
|
||||
enableSignalSlot = true;
|
||||
//enableSignalSlot = true;
|
||||
}
|
||||
|
||||
|
||||
void Scope::UpdatePanelFromMomeory(){
|
||||
|
||||
enableSignalSlot = false;
|
||||
int ch = cbScopeCh->currentIndex();
|
||||
|
||||
int factor = digi[ID]->IsDualTrace() ? 2 : 1; // if dual trace,
|
||||
|
@ -528,6 +609,13 @@ void Scope::UpdatePanelFromMomeory(){
|
|||
|
||||
UpdateComobox(cbDynamicRange, Register::DPP::InputDynamicRange);
|
||||
|
||||
uint32_t DPPAlg = digi[ID]->GetSettingFromMemory(Register::DPP::DPPAlgorithmControl, ch);
|
||||
if( (DPPAlg >> Register::DPP::DPPAlgorithmControlBit::Polarity.second) & 0x1 ){
|
||||
cbPolarity->setCurrentIndex(1);
|
||||
}else{
|
||||
cbPolarity->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
if( digi[ID]->GetDPPType() == V1730_DPP_PHA_CODE ){
|
||||
UpdateSpinBox(sbInputRiseTime, Register::DPP::PHA::InputRiseTime);
|
||||
UpdateSpinBox(sbThreshold, Register::DPP::PHA::TriggerThreshold);
|
||||
|
@ -540,8 +628,55 @@ void Scope::UpdatePanelFromMomeory(){
|
|||
|
||||
UpdateComobox(cbSmoothingFactor, Register::DPP::PHA::RCCR2SmoothingFactor);
|
||||
|
||||
int temp = (DPPAlg >> Register::DPP::DPPAlgorithmControlBit::BaselineAvg.second) & 0x7;
|
||||
for(int i = 0; i < cbBaselineAvg->count(); i++){
|
||||
if( cbBaselineAvg->itemData(i).toInt() == temp) {
|
||||
cbBaselineAvg->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
temp = (DPPAlg >> Register::DPP::DPPAlgorithmControlBit::PeakMean.second) & 0x3;
|
||||
for(int i = 0; i < cbPeakAvg->count(); i++){
|
||||
if( cbPeakAvg->itemData(i).toInt() == temp) {
|
||||
cbPeakAvg->setCurrentIndex(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t BdCfg = digi[ID]->GetSettingFromMemory(Register::DPP::BoardConfiguration, ch);
|
||||
|
||||
qDebug() << QString::number(BdCfg, 16);
|
||||
|
||||
temp = (BdCfg >> Register::DPP::BoardConfigBit::AnalogProbe1.second) & 0x3;
|
||||
for(int i = 0; i < cbAnaProbe1->count(); i++){
|
||||
if( cbAnaProbe1->itemData(i).toInt() == temp) {
|
||||
cbAnaProbe1->setCurrentIndex(i);
|
||||
dataTrace[0]->setName(cbAnaProbe1->currentText());
|
||||
break;
|
||||
}
|
||||
}
|
||||
temp = (BdCfg >> Register::DPP::BoardConfigBit::AnalogProbe2.second) & 0x3;
|
||||
for(int i = 0; i < cbAnaProbe2->count(); i++){
|
||||
if( cbAnaProbe2->itemData(i).toInt() == temp) {
|
||||
cbAnaProbe2->setCurrentIndex(i);
|
||||
dataTrace[1]->setName(cbAnaProbe2->currentText());
|
||||
break;
|
||||
}
|
||||
}
|
||||
temp = (BdCfg >> Register::DPP::BoardConfigBit::DigiProbel1.second) & 0x3;
|
||||
for(int i = 0; i < cbDigiProbe1->count(); i++){
|
||||
if( cbDigiProbe1->itemData(i).toInt() == temp) {
|
||||
cbDigiProbe1->setCurrentIndex(i);
|
||||
dataTrace[2]->setName(cbDigiProbe1->currentText());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
enableSignalSlot = true;
|
||||
}
|
||||
|
||||
void Scope::ReadSettingsFromBoard(){
|
||||
|
|
7
Scope.h
7
Scope.h
|
@ -43,13 +43,11 @@ signals:
|
|||
|
||||
private:
|
||||
|
||||
|
||||
void SetUpComboBoxSimple(RComboBox * &cb, QString str, int row, int col);
|
||||
void SetUpComboBox(RComboBox * &cb, QString str, int row, int col, const Register::Reg para);
|
||||
void SetUpSpinBox(RSpinBox * &sb, QString str, int row, int col, const Register::Reg para);
|
||||
|
||||
void CleanUpSettingsGroupBox();
|
||||
void SetUpGeneralPanel();
|
||||
void SetUpPHAPanel();
|
||||
void SetUpPSDPanel();
|
||||
void EnableControl(bool enable);
|
||||
|
@ -107,6 +105,11 @@ private:
|
|||
RComboBox * cbPeakAvg;
|
||||
RComboBox * cbBaselineAvg;
|
||||
|
||||
RComboBox * cbAnaProbe1;
|
||||
RComboBox * cbAnaProbe2;
|
||||
RComboBox * cbDigiProbe1;
|
||||
RComboBox * cbDigiProbe2;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user