diff --git a/slsReceiverSoftware/include/UDPBaseImplementation.h b/slsReceiverSoftware/include/UDPBaseImplementation.h index 4801c751e..ed7889ae8 100644 --- a/slsReceiverSoftware/include/UDPBaseImplementation.h +++ b/slsReceiverSoftware/include/UDPBaseImplementation.h @@ -65,6 +65,11 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter */ int setDetectorType(detectorType det); + /** + * Set bottom to bot + * @param bot = 1 if bottom + */ + void setBottom(int bot); //Frame indices and numbers caught /** diff --git a/slsReceiverSoftware/include/UDPInterface.h b/slsReceiverSoftware/include/UDPInterface.h index 8f3ce3f41..8952396f3 100644 --- a/slsReceiverSoftware/include/UDPInterface.h +++ b/slsReceiverSoftware/include/UDPInterface.h @@ -225,6 +225,12 @@ class UDPInterface { **************************************** Added by Dhanya ********************************************************* *******************************************************************************************************************/ + /** + * Set bottom to bot + * @param bot = 1 if bottom + */ + virtual void setBottom(int bot)= 0; + /** * Returns File Index */ diff --git a/slsReceiverSoftware/src/UDPBaseImplementation.cpp b/slsReceiverSoftware/src/UDPBaseImplementation.cpp index c70be5b7d..bbb8b331d 100644 --- a/slsReceiverSoftware/src/UDPBaseImplementation.cpp +++ b/slsReceiverSoftware/src/UDPBaseImplementation.cpp @@ -143,7 +143,7 @@ int UDPBaseImplementation::setDetectorType(detectorType det){ - +void UDPBaseImplementation::setBottom(int bot){bottom=bot;}; /*Frame indices and numbers caught*/ diff --git a/slsReceiverSoftware/src/slsReceiver.cpp b/slsReceiverSoftware/src/slsReceiver.cpp index 6ffc2fdf9..e43820613 100644 --- a/slsReceiverSoftware/src/slsReceiver.cpp +++ b/slsReceiverSoftware/src/slsReceiver.cpp @@ -36,6 +36,7 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success){ string fname = ""; string udp_interface_type = "standard"; string rest_hostname = "localhost:8081"; + udp_interface = NULL; bool bottom = false; //TODO: properly set new parameter -> mode? //parse command line for config @@ -128,10 +129,11 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success){ if (success==OK){ FILE_LOG(logINFO) << "SLS Receiver starting " << udp_interface_type << " on port " << tcpip_port_no << " with mode " << bottom << endl; +#ifdef REST udp_interface = UDPInterface::create(udp_interface_type); udp_interface->configure(configuration_map); +#endif tcpipInterface = new slsReceiverTCPIPInterface(success, udp_interface, tcpip_port_no, bottom); - //tcp ip interface } } diff --git a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp index 54a52cc90..c12e82ff2 100644 --- a/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp +++ b/slsReceiverSoftware/src/slsReceiverTCPIPInterface.cpp @@ -45,7 +45,7 @@ slsReceiverTCPIPInterface::slsReceiverTCPIPInterface(int &success, UDPInterface* bottom(bot){ int port_no=portNumber; - + if(receiverBase == NULL) receiverBase = 0; if (pn>0) port_no = pn; @@ -198,11 +198,12 @@ void slsReceiverTCPIPInterface::startTCPServer(){ //if tcp command was to exit server if(v==GOODBYE){ cout << "Shutting down UDP Socket" << endl; - if(receiverBase) + if(receiverBase){ receiverBase->shutDownUDPSockets(); - cout << "Closing Files... " << endl; - receiverBase->closeFile(); + cout << "Closing Files... " << endl; + receiverBase->closeFile(); + } pthread_exit(NULL); } @@ -364,6 +365,10 @@ int slsReceiverTCPIPInterface::set_detector_type(){ } else{ myDetectorType = dr; +#ifndef REST + receiverBase = UDPInterface::create("standard"); + receiverBase->setBottom(bottom); +#endif ret=receiverBase->setDetectorType(dr); retval = myDetectorType; }