Changeset 10291 for fact/FADctrl
- Timestamp:
- 04/06/11 12:19:38 (14 years ago)
- Location:
- fact/FADctrl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/FADctrl/FAD.cc
r10290 r10291 753 753 void FAD::cmd_stop() { 754 754 755 static char Stop[] = "stop ";755 static char Stop[] = "stop\n"; 756 756 757 757 if (Mode == idle) { … … 767 767 if (Mode == datarun) { 768 768 // Inform event thread to stop run in case datarun active 769 if (write(Pipe[1], Stop, strlen(Stop) +1) == -1) {769 if (write(Pipe[1], Stop, strlen(Stop)) == -1) { 770 770 Message(ERROR, "write() to Pipe[1] failed in FAD::cmd_cancel() (%s)", strerror(errno)); 771 771 } … … 896 896 // Update loop 897 897 while (!ExitRequest) { 898 // Removed processed data from IDString 899 size_t LastLF = IDString.find_last_of("\n"); 900 if (LastLF != string::npos) IDString = IDString.substr(LastLF+1); 901 898 902 // Wait for data from TCP/IP reading threads 899 903 if ((Ret=read(Pipe[0], Buffer, sizeof(Buffer))) == -1) Message(FATAL, "read() from Pipe[0] failed in FAD::EventThread() (%s)", strerror(errno)); … … 901 905 // Check if pipe closed 902 906 if (Ret == 0) break; 903 904 IDString = string(Buffer, Ret);907 908 IDString.append(string(Buffer, Ret)); 905 909 906 910 // If amplitude calibration mode, check if board finished procedure … … 939 943 940 944 if (lseek(Datafile, 0, SEEK_SET) == -1) { 941 PrintMessage("Error: Could not rewind file to write updated run header (%s)\n", strerror(errno));945 Message(ERROR, "Could not rewind file to write updated run header (%s)", strerror(errno)); 942 946 } 943 947 else if (write(Datafile, RHeader, sizeof(RunHeader)) != sizeof(RunHeader)) { 944 PrintMessage("Error: Could not write updated run header (%s)\n", strerror(errno));948 Message(ERROR, "Could not write updated run header (%s)", strerror(errno)); 945 949 } 946 950 947 951 // Close data file and terminate run 948 if(close(Datafile) == -1) PrintMessage("Error: Could not close data file (%s)\n", strerror(errno));952 if(close(Datafile) == -1) Message(ERROR, "Could not close data file (%s)", strerror(errno)); 949 953 else PrintMessage("Data file closed (size %.1f MByte).\n", FileSize/1024.0/1024); 950 954 -
fact/FADctrl/FADBoard.cc
r10290 r10291 84 84 } 85 85 86 // Delete condition variable 87 if ((Ret = pthread_cond_destroy(&CondVar)) != 0) { 88 m->Message(m->ERROR, "pthread_cond_destroy() failed for %s in ~FADBoard (%s)", Name, strerror(Ret)); 89 } 90 91 // Delete mutex 92 if ((Ret = pthread_mutex_destroy(&Mutex)) != 0) { 93 m->Message(m->ERROR, "pthread_mutex_destroy() failed for %s in ~FADBoard (%s)", Name, strerror(Ret)); 94 } 95 86 96 delete DIM_Name; 87 97 delete DIM_Status; … … 93 103 delete DIM_ROI; 94 104 delete[] Name; 95 96 // Delete condition variable97 if ((Ret = pthread_cond_destroy(&CondVar)) != 0) {98 m->Message(m->ERROR, "pthread_cond_destroy() failed in ~FADBoard (%s)", strerror(Ret));99 }100 101 // Delete mutex102 if ((Ret = pthread_mutex_destroy(&Mutex)) != 0) {103 m->Message(m->ERROR, "pthread_mutex_destroy() failed in ~FADBoard (%s)", strerror(Ret));104 }105 105 } 106 106 … … 162 162 vector<unsigned short> ROICmd; 163 163 unsigned short DACCmd[] = {htons(CMD_Write | (BADDR_DAC + 1)), 0, htons(CMD_Write | (BADDR_DAC + 2)), 0, htons(CMD_Write | (BADDR_DAC + 3)), 0}; 164 string Message = string("ACALIBDONE")+Name ;164 string Message = string("ACALIBDONE")+Name+"\n"; 165 165 166 166 switch (State) { … … 540 540 541 541 // Inform event thread of new data 542 string Message = string("EVENT")+Name ;542 string Message = string("EVENT")+Name+"\n"; 543 543 if (write(m->Pipe[1], Message.data(), Message.size()) == -1) { 544 544 m->Message(m->ERROR, "write() to Pipe[1] failed in class FADBoard (%s)", strerror(errno)); 545 m->ExitRequest = true;546 } 545 break; 546 } 547 547 } 548 548 else SetStatus("End package flag incorrect, removing corrupt event"); -
fact/FADctrl/History.txt
r10290 r10291 21 21 Limited update rate of slow control data to 1 second or interval set by 'update' 22 22 1/4/2011 Added DIM frequency service 23 5/4/2011 Added DIM rate service for each board 23 5/4/2011 Added DIM rate service for each board 24 6/4/2011 Bug fix in internal pipe communication
Note:
See TracChangeset
for help on using the changeset viewer.