Changeset 51 for drsdaq/DAQReadout.cc
- Timestamp:
- 05/28/09 15:44:05 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
drsdaq/DAQReadout.cc
r49 r51 1019 1019 vsnprintf(Textbuffer, sizeof(Textbuffer), Format, ArgumentPointer); 1020 1020 1021 // Print to console and generate new prompt1021 // Print to console 1022 1022 if(Target & MsgToConsole) { 1023 if(strlen(Textbuffer)>0 && Textbuffer[strlen(Textbuffer)-1]=='\n') printf("\r%s", Textbuffer); 1023 if(strlen(Textbuffer)>0 && Textbuffer[strlen(Textbuffer)-1]=='\n') { 1024 printf("\r%s%s", Textbuffer, Prompt); // New prompt 1025 fflush(stdout); 1026 } 1024 1027 else printf("%s", Textbuffer); 1025 1026 // New prompt only after newline 1027 if(Textbuffer[strlen(Textbuffer)-1]=='\n' || strlen(Textbuffer)==0) { 1028 if (NumBoards == 0) printf("\rDAQ> "); 1029 else if (FirstBoard == LastBoard) printf("\rDAQ|B%d> ",FirstBoard); 1030 else printf("\rDAQ|B%d-%d> ",FirstBoard,LastBoard); 1031 fflush(stdout); 1032 } 1033 } 1034 1035 // Print to log file and socket only if length not zero (then only prompt) 1036 if (strlen(Textbuffer)>0) { 1037 if((Target & MsgToLog) && Logfile!=NULL) { 1038 fprintf(Logfile, "%s", Textbuffer); 1039 fflush(Logfile); 1040 } 1041 if((Target & MsgToSocket) && Socket!=-1) write(Socket, Textbuffer, strlen(Textbuffer)); 1042 } 1028 } 1029 // Print to log file 1030 if((Target & MsgToLog) && Logfile!=NULL) { 1031 fprintf(Logfile, "%s", Textbuffer); 1032 fflush(Logfile); 1033 } 1034 // Print to socket 1035 if((Target & MsgToSocket) && Socket!=-1) write(Socket, Textbuffer, strlen(Textbuffer)); 1043 1036 } 1044 1037
Note:
See TracChangeset
for help on using the changeset viewer.