diff --git a/mainwindow.cpp b/mainwindow.cpp index 0f4225b..a0df9ec 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -713,16 +713,16 @@ void MainWindow::CloseDigitizers(){ if( digi == NULL) return; - if(scalar && nDigiConnected > 0 ){ // scalar is child of this - scalar->close(); - CleanUpScalar(); // this use digi->GetNChannels(); - } - if( scope ){ scope->close(); delete scope; scope = NULL; } + + if(scalar && nDigiConnected > 0 ){ // scalar is child of this, This MUST after scope, because scope tell scalar to update ACQ status + scalar->close(); + CleanUpScalar(); // this use digi->GetNChannels(); + } if( digiSetting ){ digiSetting->close(); diff --git a/scope.cpp b/scope.cpp index ba8537f..32e54aa 100644 --- a/scope.cpp +++ b/scope.cpp @@ -55,6 +55,7 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat xaxis->setTitleText("Time [ns]"); updateTraceThread = new TimingThread(); + updateTraceThread->SetWaitTimeSec(0.2); connect(updateTraceThread, &TimingThread::TimeUp, this, &Scope::UpdateScope); //*================ add Widgets @@ -322,7 +323,7 @@ Scope::Scope(Digitizer2Gen **digi, unsigned int nDigi, ReadDataThread ** readDat } Scope::~Scope(){ - //printf("------- %s \n", __func__); + printf("------- %s \n", __func__); StopScope(); updateTraceThread->Stop(); updateTraceThread->quit(); @@ -330,6 +331,7 @@ Scope::~Scope(){ delete updateTraceThread; for( int i = 0; i < 6; i++) delete dataTrace[i]; delete plot; + printf("------- end of %s \n", __func__); } void Scope::ReadScopeSettings(){