diff --git a/FSUDAQ.cpp b/FSUDAQ.cpp index 45f68e2..48b7211 100644 --- a/FSUDAQ.cpp +++ b/FSUDAQ.cpp @@ -60,6 +60,8 @@ TRootEmbeddedCanvas * MainWindow::fEcanvas = NULL; TGNumberEntry * MainWindow::boardIDEntry = NULL; TGNumberEntry * MainWindow::chIDEntry = NULL; TGComboBox* MainWindow::cbMode = NULL; +TGTextEntry * MainWindow::dataPrefix; +TGNumberEntry * MainWindow::runIDEntry; TH1F * MainWindow::hEnergy[MaxNBoards][MaxNChannels] = {NULL}; TH1F * MainWindow::hChannel[MaxNBoards] = {NULL}; @@ -446,17 +448,12 @@ void MainWindow::StartRun(){ bPlotSingleTrace->SetEnabled(false); bFitTrace->SetEnabled(false); + if( cbMode->GetSelected() == Mode_DataRun ) cbMode->SetEnabled(false); + digi[0]->StartACQ(); - if( digi[0]->IsRunning() ) { - int mode = cbMode->GetSelected(); + if( digi[0]->IsRunning() ) fillHistThread->Run(); - if( mode == Mode_DataRun){ - - }else{ - fillHistThread->Run(); - } - } } void MainWindow::StopRun(){ @@ -471,6 +468,7 @@ void MainWindow::StopRun(){ runIDEntry->SetState(true); bPlotSingleTrace->SetEnabled(true); bFitTrace->SetEnabled(true); + cbMode->SetEnabled(true); if( cbMode->GetSelected() == Mode_DataRun ){ int runID = runIDEntry->GetNumber(); @@ -647,6 +645,11 @@ void * MainWindow::FillHistogram(void * ptr){ uint32_t CurrentTime = 0; uint32_t ElapsedTime = 0; + TString dataFileName = dataPrefix->GetText(); + dataFileName += Form("_run_%03d.bin", (int) runIDEntry->GetNumber()); + + printf("|%s|\n", dataFileName.Data()); + Data * data = digi[boardID]->GetData(); data->AllocateMemory(); @@ -664,7 +667,7 @@ void * MainWindow::FillHistogram(void * ptr){ if( cbMode->GetSelected() == Mode_DataRun ){ // Rate graph? - + data->SaveBuffer(dataFileName.Data()); }else{ diff --git a/FSUDAQ.h b/FSUDAQ.h index c47209a..d47ce8d 100644 --- a/FSUDAQ.h +++ b/FSUDAQ.h @@ -46,8 +46,8 @@ private: TGTextButton *bStartRun; TGTextButton *bStopRun; static TGComboBox* cbMode; - TGTextEntry * dataPrefix; - TGNumberEntry * runIDEntry; + static TGTextEntry * dataPrefix; + static TGNumberEntry * runIDEntry; TGTextButton *bPlotSingleTrace; TGTextButton *bFitTrace;