diff --git a/slsDetectorSoftware/MySocketTCP/genericSocket.h b/slsDetectorSoftware/MySocketTCP/genericSocket.h index 6c706e616..00d5dc497 100644 --- a/slsDetectorSoftware/MySocketTCP/genericSocket.h +++ b/slsDetectorSoftware/MySocketTCP/genericSocket.h @@ -93,7 +93,15 @@ enum communicationProtocol{ genericSocket(const char* const host_ip_or_name, unsigned short int const port_number, communicationProtocol p, int ps = DEFAULT_PACKET_SIZE, int t = DEFAULT_PACKETS_PER_FRAME) : // portno(port_number), -protocol(p), is_a_server(0), socketDescriptor(-1),file_des(-1), packet_size(ps),packets_per_frame(t)// sender (client): where to? ip + protocol(p), + is_a_server(0), + socketDescriptor(-1), + file_des(-1), + packet_size(ps), + nsending(0), + nsent(0), + total_sent(0), + packets_per_frame(t)// sender (client): where to? ip { // strcpy(hostname,host_ip_or_name); @@ -142,7 +150,16 @@ protocol(p), is_a_server(0), socketDescriptor(-1),file_des(-1), packet_size(ps), genericSocket(unsigned short int const port_number, communicationProtocol p, int ps = DEFAULT_PACKET_SIZE, int t = DEFAULT_PACKETS_PER_FRAME, const char *eth=NULL): //portno(port_number), - protocol(p), is_a_server(1),socketDescriptor(-1), file_des(-1), packet_size(ps), packets_per_frame(t){ + protocol(p), + is_a_server(1), + socketDescriptor(-1), + file_des(-1), + packet_size(ps), + nsending(0), + nsent(0), + total_sent(0), + packets_per_frame(t) + { /* // you can specify an IP address: */ /* */ diff --git a/slsDetectorSoftware/moenchDetectorServer/firmware_funcs.c b/slsDetectorSoftware/moenchDetectorServer/firmware_funcs.c index 08d3c0008..47cf00f26 100755 --- a/slsDetectorSoftware/moenchDetectorServer/firmware_funcs.c +++ b/slsDetectorSoftware/moenchDetectorServer/firmware_funcs.c @@ -1517,7 +1517,21 @@ int stopStateMachine(){ #endif bus_w16(CONTROL_REG, STOP_ACQ_BIT); bus_w16(CONTROL_REG, 0x0); - usleep(500); + /* + int i; + for(i=0;i<10;i++){ + if(!(bus_r(STATUS_REG)&RUNMACHINE_BUSY_BIT)){ + printf("stoppped\n"); + break; + }else{ + usleep(5000); + printf("trying to stop again\n"); + bus_w16(CONTROL_REG, STOP_ACQ_BIT); + bus_w16(CONTROL_REG, 0x0); + } + } + */ + usleep(5000); // if (!runBusy()) if(!(bus_r(STATUS_REG)&RUNMACHINE_BUSY_BIT)) return OK; diff --git a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp index 008c60b03..4d71d5cef 100644 --- a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp +++ b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.cpp @@ -108,6 +108,18 @@ slsReceiverFunctionList::slsReceiverFunctionList(detectorType det,bool moenchwit +slsReceiverFunctionList::~slsReceiverFunctionList(){ + if(latestData) delete [] latestData; + if(fifofree) delete [] fifofree; + if(fifo) delete [] fifo; + if(guiFileName) delete [] guiFileName; + if(eth) delete [] eth; + if(mem0) free(mem0); +} + + + + int slsReceiverFunctionList::setEnableFileWrite(int i){ if(i!=-1) enableFileWrite=i; @@ -322,6 +334,10 @@ int slsReceiverFunctionList::startListening(){ if (strchr(eth,'.')!=NULL) strcpy(eth,""); if(!strlen(eth)){ cout<<"warning:eth is empty.listening to all"<Disconnect(); - #ifdef VERBOSE cout << "listening_thread_running:" << listening_thread_running << endl; #endif diff --git a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.h b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.h index 70716b7ab..97b716737 100644 --- a/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.h +++ b/slsDetectorSoftware/slsReceiver/slsReceiverFunctionList.h @@ -34,7 +34,7 @@ public: /** * Destructor */ - virtual ~slsReceiverFunctionList(){ if(latestData) delete latestData;}; + virtual ~slsReceiverFunctionList(); /** * Set UDP Port Number diff --git a/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.cpp b/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.cpp index e0fbfa63b..37d2b2750 100644 --- a/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.cpp +++ b/slsDetectorSoftware/slsReceiver/slsReceiver_funcs.cpp @@ -267,7 +267,6 @@ int slsReceiverFuncs::function_table(){ flist[F_GET_FRAME_INDEX] = &slsReceiverFuncs::get_frame_index; flist[F_RESET_FRAMES_CAUGHT] = &slsReceiverFuncs::reset_frames_caught; flist[F_READ_FRAME] = &slsReceiverFuncs::read_frame; - flist[F_READ_ALL] = &slsReceiverFuncs::read_all; flist[F_READ_RECEIVER_FREQUENCY]= &slsReceiverFuncs::set_read_frequency; flist[F_ENABLE_FILE_WRITE] = &slsReceiverFuncs::enable_file_write; flist[F_GET_ID] = &slsReceiverFuncs::get_version; @@ -922,8 +921,6 @@ int slsReceiverFuncs::moench_read_frame(){ int bufferSize = MOENCH_BUFFER_SIZE; - char* raw = new char[bufferSize]; - int rnel = bufferSize/(sizeof(int)); int* retval = new int[rnel]; int* origVal = new int[rnel]; @@ -931,6 +928,7 @@ int slsReceiverFuncs::moench_read_frame(){ for(i=0;i