Changeset 51 for drsdaq/DAQReadout.cc


Ignore:
Timestamp:
05/28/09 15:44:05 (15 years ago)
Author:
ogrimm
Message:
Added command line editing
File:
1 edited

Legend:

Unmodified
Added
Removed
  • drsdaq/DAQReadout.cc

    r49 r51  
    10191019  vsnprintf(Textbuffer, sizeof(Textbuffer), Format, ArgumentPointer);
    10201020 
    1021   // Print to console and generate new prompt
     1021  // Print to console
    10221022  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    }
    10241027    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));
    10431036}
    10441037
Note: See TracChangeset for help on using the changeset viewer.