diff --git a/ClassDigitizer2Gen.cpp b/ClassDigitizer2Gen.cpp index 0fb1080..2e5bbf2 100644 --- a/ClassDigitizer2Gen.cpp +++ b/ClassDigitizer2Gen.cpp @@ -561,7 +561,7 @@ void Digitizer2Gen::SaveDataToFile(){ CloseOutFile(); outFileIndex ++; sprintf(outFileName, "%s_%03d.sol", outFileNameBase.c_str(), outFileIndex); - outFile = fopen(outFileName, "a+b"); + outFile = fopen(outFileName, "wb"); //overwrite binary } if( evt->dataType == 0){ diff --git a/ClassDigitizer2Gen.h b/ClassDigitizer2Gen.h index 7fa1f41..d291bb6 100644 --- a/ClassDigitizer2Gen.h +++ b/ClassDigitizer2Gen.h @@ -121,7 +121,7 @@ class Digitizer2Gen { uint64_t GetHandle() const {return handle;} Event *evt; // should be evt[MaxNumber], when full or stopACQ, save into file - void OpenOutFile(std::string fileName, const char * mode = "w"); + void OpenOutFile(std::string fileName, const char * mode = "wb"); //overwrite binary void CloseOutFile(); void SaveDataToFile(); unsigned int GetFileSize() const {return outFileSize;} diff --git a/mainwindow.cpp b/mainwindow.cpp index 1c5d113..6e1865d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -199,7 +199,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ bnOpenScope->setEnabled(true); chkSaveRun->setEnabled(true); if(chkSaveRun->isChecked() ) cbAutoRun->setEnabled(true); - if( digiSetting ) digiSetting->EnableControl(); }); @@ -563,6 +562,10 @@ void MainWindow::AutoRun(){ bnStartACQ->setEnabled(true); bnStopACQ->setEnabled(false); bnComment->setEnabled(false); + bnOpenScope->setEnabled(true); + chkSaveRun->setEnabled(true); + cbAutoRun->setEnabled(true); + if( digiSetting ) digiSetting->EnableControl(); }else{ LogMsg("Wait for 10 sec for next Run....");