From eb83854f69998db559a820f7ee1465fc11f59656 Mon Sep 17 00:00:00 2001 From: "carina@hades" Date: Fri, 23 Sep 2022 12:36:31 -0400 Subject: [PATCH] fixed LogMsg bug --- FSUDAQ.cpp | 12 ++++++------ FSUDAQ.h | 2 +- Makefile | 4 ++-- boardSetting.cpp | 4 ++-- boardSetting.h | 2 +- channelSetting.cpp | 6 +++--- channelSetting.h | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/FSUDAQ.cpp b/FSUDAQ.cpp index 9b05039..39b35fb 100644 --- a/FSUDAQ.cpp +++ b/FSUDAQ.cpp @@ -228,7 +228,7 @@ void MainWindow::HandleMenu(Int_t id){ ///========================= Channel setting case M_CH_SETTING: channelSetting = new ChannelSetting(gClient->GetRoot(), 600, 600, digi, nDigi); - channelSetting->Connect("ChLogMsg(TString)", "MainWindow", this, "LogMsg(TString)"); + channelSetting->Connect("LogMsg(char*)", "MainWindow", this, "LogMsg(char*)"); break; @@ -236,11 +236,11 @@ void MainWindow::HandleMenu(Int_t id){ case M_BOARD_SETTINGS:{ if( boardSetting == NULL ) { boardSetting = new BoardSetting(gClient->GetRoot(), 600, 600, digi, nDigi); - boardSetting->Connect("BdLogMsg(TString)", "MainWindow", this, "LogMsg(TString)"); + boardSetting->Connect("LogMsg(char*)", "MainWindow", this, "LogMsg(char*)"); }else{ if ( boardSetting->IsOpen() == false ){ boardSetting = new BoardSetting(gClient->GetRoot(), 600, 600, digi, nDigi); - boardSetting->Connect("BdLogMsg(TString)", "MainWindow", this, "LogMsg(TString)"); + //boardSetting->Connect("BdLogMsg(TString)", "MainWindow", this, "LogMsg(TString)"); } } }break; @@ -326,7 +326,7 @@ void MainWindow::GoodBye(){ } -void MainWindow::LogMsg(TString msg){ +void MainWindow::LogMsg(char * msg){ time_t now = time(0); tm * ltm = localtime(&now); @@ -337,10 +337,10 @@ void MainWindow::LogMsg(TString msg){ int minute = ltm->tm_min; int secound = ltm->tm_sec; - TString outMsg = Form("[%4d-%02d-%02d %02d:%02d:%02d] ", year, month, day, hour, minute, secound) + msg; + TString outMsg = Form("[%4d-%02d-%02d %02d:%02d:%02d] %s", year, month, day, hour, minute, secound, msg); teLog->AddLine(outMsg); - printf("%s", outMsg.Data()); + printf("%s\n", outMsg.Data()); teLog->LineDown(); teLog->ShowBottom(); diff --git a/FSUDAQ.h b/FSUDAQ.h index 9944ab9..c158d37 100644 --- a/FSUDAQ.h +++ b/FSUDAQ.h @@ -89,6 +89,6 @@ public: //void ChangeMod(); //void ChangeChannel(); - void LogMsg(TString); + void LogMsg(char * ); void GoodBye(); }; diff --git a/Makefile b/Makefile index a19b0c4..95c46f8 100755 --- a/Makefile +++ b/Makefile @@ -25,10 +25,10 @@ ClassDigitizer.o : ClassDigitizer.cpp ClassDigitizer.h RegisterAddress.h macro.h $(CC) $(COPTS) -c ClassDigitizer.cpp DigitizerPHA.o : DigitizerPHA.cpp DigitizerPHA.h ClassDigitizer.o - $(CC) $(COPTS) -c DigitizerPHA.cpp + $(CC) $(COPTS) -c DigitizerPHA.cpp DigitizerPSD.o : DigitizerPSD.cpp DigitizerPSD.h ClassDigitizer.o - $(CC) $(COPTS) -c DigitizerPSD.cpp + $(CC) $(COPTS) -c DigitizerPSD.cpp test : test.cpp ClassDigitizer.o DigitizerPHA.o DigitizerPSD.o @echo "--------- making test" diff --git a/boardSetting.cpp b/boardSetting.cpp index db3f645..27aaa9e 100644 --- a/boardSetting.cpp +++ b/boardSetting.cpp @@ -724,8 +724,8 @@ BoardSetting::~BoardSetting(){ } -void BoardSetting::BdLogMsg(TString msg){ - Emit("BdLogMsg(TString)", msg); +void BoardSetting::LogMsg(TString msg){ + Emit("LogMsg(char*)", msg.Data()); } void * BoardSetting::ReadStatus(void * ptr){ diff --git a/boardSetting.h b/boardSetting.h index b87a954..a6fb66d 100644 --- a/boardSetting.h +++ b/boardSetting.h @@ -170,7 +170,7 @@ class BoardSetting{ ///==== Readout Control void SetReadOutControl(); - void BdLogMsg(TString); // *SIGNAL* + void LogMsg(TString msg); // *SIGNAL* }; #endif diff --git a/channelSetting.cpp b/channelSetting.cpp index 4d01a1b..4109118 100644 --- a/channelSetting.cpp +++ b/channelSetting.cpp @@ -403,8 +403,8 @@ ChannelSetting::~ChannelSetting(){ } -void ChannelSetting::ChLogMsg(TString msg){ - Emit("ChLogMsg(TString)", msg); +void ChannelSetting::LogMsg(TString msg){ + Emit("LogMsg(char*)", msg.Data()); } void ChannelSetting::ChangeBoard(){ @@ -418,7 +418,7 @@ void ChannelSetting::ChangeBoard(){ void ChannelSetting::ChangeCh(){ - ChLogMsg("dsadasdsa"); + LogMsg(Form("========== Change to Channel %d", (int)chIDEntry->GetNumber())); if ( digi == NULL ) return; diff --git a/channelSetting.h b/channelSetting.h index ed6b13c..2fb316f 100644 --- a/channelSetting.h +++ b/channelSetting.h @@ -107,7 +107,7 @@ class ChannelSetting{ void SetPeaking(); void SetPeakHoldOff(); - void ChLogMsg(TString); // *SIGNAL* + void LogMsg(TString msg); // *SIGNAL* }; #endif