diff --git a/ClassDigitizer.cpp b/ClassDigitizer.cpp index 7b0bc6b..828a57c 100644 --- a/ClassDigitizer.cpp +++ b/ClassDigitizer.cpp @@ -113,9 +113,9 @@ int Digitizer::OpenDigitizer(int boardID, int portID, bool program, bool verbose } if( ret == 0 ){ - if( LinkType == CAEN_DGTZ_USB ) printf("Open digitizer via USB, board : %d\n", boardID); - if( LinkType == CAEN_DGTZ_OpticalLink ) printf("Open digitizer via Optical Link, port : %d, board : %d\n", portID, boardID); - if( LinkType == CAEN_DGTZ_USB_A4818 ) printf("Open digitizer via A4818, port : %d, board : %d\n", portID, boardID); + if( LinkType == CAEN_DGTZ_USB ) printf("### Open digitizer via USB, board : %d\n", boardID); + if( LinkType == CAEN_DGTZ_OpticalLink ) printf("### Open digitizer via Optical Link, port : %d, board : %d\n", portID, boardID); + if( LinkType == CAEN_DGTZ_USB_A4818 ) printf("### Open digitizer via A4818, port : %d, board : %d\n", portID, boardID); } if (ret != 0) { diff --git a/Scope.cpp b/Scope.cpp index d8c7071..3e228ab 100644 --- a/Scope.cpp +++ b/Scope.cpp @@ -466,7 +466,24 @@ void Scope::StopScope(){ //restore setting digi[ID]->SetBits(DPP::BoardConfiguration, DPP::Bit_BoardConfig::RecordTrace, traceOn[ID], -1); - //TODO ============= + int ch = cbScopeCh->currentIndex(); + + if( digi[ID]->GetDPPType() == DPPTypeCode::DPP_PHA_CODE ){ + digi[ID]->WriteRegister(DPP::DPPAlgorithmControl, dppAlg, ch); + digi[ID]->WriteRegister(DPP::PHA::DPPAlgorithmControl2_G, dppAlg2, ch); + digi[ID]->WriteRegister(DPP::RegChannelEnableMask, chMask); + } + + if( digi[ID]->GetDPPType() == DPPTypeCode::DPP_PSD_CODE ){ + digi[ID]->WriteRegister(DPP::DPPAlgorithmControl, dppAlg, ch); + digi[ID]->WriteRegister(DPP::PSD::DPPAlgorithmControl2_G, dppAlg2, ch); + digi[ID]->WriteRegister(DPP::RegChannelEnableMask, chMask); + } + + if( digi[ID]->GetDPPType() == DPPTypeCode::DPP_QDC_CODE ){ + digi[ID]->WriteRegister(DPP::QDC::DPPAlgorithmControl, dppAlg, ch); + digi[ID]->WriteRegister(DPP::RegChannelEnableMask, chMask); + } }else{