some improvements
This commit is contained in:
parent
03b6a03557
commit
02ea0c98f1
|
@ -189,7 +189,7 @@ inline void Data::SaveBuffer(const char * fileName){
|
|||
fwrite(buffer, nByte, 1, haha);
|
||||
|
||||
presentFileSizeByte = ftell(haha);
|
||||
printf("=========== file Size : %u Byte = %.2f MB\n", presentFileSizeByte, presentFileSizeByte/1024./1024.);
|
||||
///printf("=========== file Size : %u Byte = %.2f MB\n", presentFileSizeByte, presentFileSizeByte/1024./1024.);
|
||||
|
||||
fclose(haha);
|
||||
}
|
||||
|
|
|
@ -728,7 +728,7 @@ void Digitizer::SaveSettingAsText(std::string fileName){
|
|||
if( haha.GetType() == RW::ReadWrite ) typeStr = "R/W";
|
||||
if( haha.GetType() == RW::ReadONLY ) typeStr = "R ";
|
||||
if( haha.GetType() == RW::WriteONLY ) typeStr = " W";
|
||||
fprintf( txtFile, "0x%04X %30s 0x%08X %s %d\n", actualAddress,
|
||||
fprintf( txtFile, "0x%04X %30s 0x%08X %s %u\n", actualAddress,
|
||||
haha.GetNameChar(),
|
||||
setting[i],
|
||||
typeStr.c_str(),
|
||||
|
|
32
FSUDAQ.cpp
32
FSUDAQ.cpp
|
@ -178,6 +178,7 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
|
|||
chIDEntry = new TGNumberEntry(hfg1, 0, 0, 0, TGNumberFormat::kNESInteger, TGNumberFormat::kNEAAnyNumber); hfg1->AddFrame(chIDEntry, haha);
|
||||
chIDEntry->SetWidth(50);
|
||||
chIDEntry->SetState(false);
|
||||
chIDEntry->Connect("Modified()", "MainWindow", this, "ChangePlot()");
|
||||
|
||||
bPlotSingleTrace = new TGTextButton(hfg1,"Plot Trace"); hfg1->AddFrame(bPlotSingleTrace, haha);
|
||||
bPlotSingleTrace->Connect("Clicked()", "MainWindow", this, "PlotSingleTrace()");
|
||||
|
@ -226,8 +227,8 @@ MainWindow::MainWindow(const TGWindow *p,UInt_t w,UInt_t h) {
|
|||
LogMsg((char*)"Please \"Open Digitizers\" to start.");
|
||||
|
||||
HandleMenu(M_DIGITIZER_OPEN);
|
||||
HandleMenu(M_BOARD_SETTINGS);
|
||||
HandleMenu(M_CH_SETTING_PHA);
|
||||
//HandleMenu(M_BOARD_SETTINGS);
|
||||
//HandleMenu(M_CH_SETTING_PHA);
|
||||
//HandleMenu(M_CH_SETTING_PSD);
|
||||
//HandleMenu(M_REGISTER_SETTING);
|
||||
//HandleMenu(M_TRIGGER_SUMMARY);
|
||||
|
@ -490,6 +491,7 @@ void MainWindow::LoadSettingFromFile(){
|
|||
void MainWindow::ChangeBoard(){
|
||||
int boardID = boardIDEntry->GetNumber();
|
||||
chIDEntry->SetLimits(TGNumberFormat::kNELLimitMinMax, 0, digi[boardID]->GetNChannel() -1 );
|
||||
ChangePlot();
|
||||
}
|
||||
|
||||
void MainWindow::GoodBye(){
|
||||
|
@ -519,8 +521,10 @@ void MainWindow::StartRun(){
|
|||
bPlotSingleTrace->SetEnabled(false);
|
||||
bFitTrace->SetEnabled(false);
|
||||
|
||||
if( cbMode->GetSelected() == Mode_DataRun ) cbMode->SetEnabled(false);
|
||||
|
||||
if( cbMode->GetSelected() == Mode_DataRun ) {
|
||||
cbMode->SetEnabled(false);
|
||||
HandleMenu(M_TRIGGER_SUMMARY);
|
||||
}
|
||||
|
||||
bool threadFlag = false;
|
||||
for( int i = 0 ; i < nDigi; i++) {
|
||||
|
@ -553,6 +557,8 @@ void MainWindow::StopRun(){
|
|||
bFitTrace->SetEnabled(true);
|
||||
cbMode->SetEnabled(true);
|
||||
|
||||
if( triggerSummary != NULL ) triggerSummary->CloseWindow();
|
||||
|
||||
if( cbMode->GetSelected() == Mode_DataRun ){
|
||||
int runID = runIDEntry->GetNumber();
|
||||
runIDEntry->SetNumber(runID +1);
|
||||
|
@ -598,7 +604,6 @@ void MainWindow::LogMsg(char * msg){
|
|||
|
||||
teLog->AddLine(outMsg);
|
||||
printf("%s\n", outMsg.Data());
|
||||
//teLog->LineDown();
|
||||
teLog->ShowBottom();
|
||||
|
||||
}
|
||||
|
@ -789,14 +794,21 @@ void * MainWindow::RunThread(void * ptr){
|
|||
// Rate graph?
|
||||
data->SaveBuffer(dataFileName.Data());
|
||||
data->DecodeBuffer(true, 0);
|
||||
|
||||
CurrentTime = get_time();
|
||||
if( CurrentTime - PreviousTime > 1000 ){
|
||||
std::string msg = Form("File Size : %.2f MB", data->GetPresentFileSize() / 1024./1024. );
|
||||
teLog->AddLine(msg.c_str());
|
||||
teLog->LineDown();
|
||||
teLog->ShowBottom();
|
||||
PreviousTime = CurrentTime;
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
data->DecodeBuffer(false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if( cbMode->GetSelected() != Mode_DataRun){
|
||||
|
||||
fEcanvas->GetCanvas()->cd();
|
||||
|
||||
|
@ -823,9 +835,6 @@ void * MainWindow::RunThread(void * ptr){
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
CurrentTime = get_time();
|
||||
ElapsedTime = CurrentTime - PreviousTime; /// milliseconds
|
||||
|
||||
|
@ -846,12 +855,13 @@ void * MainWindow::RunThread(void * ptr){
|
|||
|
||||
data->ClearData();
|
||||
PreviousTime = CurrentTime;
|
||||
|
||||
}
|
||||
|
||||
fEcanvas->GetCanvas()->Update();
|
||||
gSystem->ProcessEvents();
|
||||
}
|
||||
|
||||
data->ClearData();
|
||||
}
|
||||
|
||||
return ptr;
|
||||
|
|
|
@ -83,7 +83,7 @@ BoardSetting::BoardSetting(const TGWindow *p, UInt_t w, UInt_t h, Digitizer ** d
|
|||
TGLabel * lbSettingFile = new TGLabel(hframe1, "Setting file :"); hframe1->AddFrame(lbSettingFile, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5,5,4,2));
|
||||
txtSettingFile = new TGTextEntry(hframe1, ""); hframe1->AddFrame(txtSettingFile, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 5,5,3,3));
|
||||
txtSettingFile->SetEnabled(false);
|
||||
txtSettingFile->Resize(650, 20);
|
||||
txtSettingFile->Resize(550, 20);
|
||||
if( digi != NULL ) txtSettingFile->SetText( digi[boardID]->GetSettingFileName().c_str());
|
||||
|
||||
}
|
||||
|
@ -1501,6 +1501,7 @@ void BoardSetting::ProgramBoardFromFile(){
|
|||
void BoardSetting::SaveSettingFile(){
|
||||
|
||||
const char *filetypes[] = { "Setting File", "*.bin",
|
||||
"Text File", "*.txt",
|
||||
0, 0};
|
||||
|
||||
static TString dir(".");
|
||||
|
@ -1514,15 +1515,24 @@ void BoardSetting::SaveSettingFile(){
|
|||
|
||||
if( fi.fFilename == NULL) return;
|
||||
|
||||
txtSettingFile->SetText(fi.fFilename);
|
||||
TString temp = fi.fFilename;
|
||||
int len = temp.Length();
|
||||
temp.Remove(0, len-3);
|
||||
|
||||
if( temp == "bin" ){
|
||||
txtSettingFile->SetText(fi.fFilename);
|
||||
if( digi == NULL ) {
|
||||
|
||||
}else{
|
||||
int boardID = boardIDEntry->GetNumber();
|
||||
//TODO saev as same file
|
||||
digi[boardID]->OpenSettingBinary( fi.fFilename );
|
||||
}
|
||||
}else if( temp == "txt") {
|
||||
int boardID = boardIDEntry->GetNumber();
|
||||
digi[boardID]->SaveSettingAsText( fi.fFilename );
|
||||
}else{
|
||||
LogMsg("Invalid file extension.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -116,6 +116,8 @@ TriggerSummary::~TriggerSummary(){
|
|||
|
||||
updateFlag = false;
|
||||
|
||||
thread->Join();
|
||||
|
||||
///delete thread; /// Don;t delete the thread, otherwise, thread will not run after close and reopen.
|
||||
|
||||
fMain->Cleanup();
|
||||
|
|
Loading…
Reference in New Issue
Block a user