fixed bug in config reading; added printout in MAkefile

This commit is contained in:
sala 2014-09-12 16:09:43 +02:00
parent eb1f9db9af
commit e0ee1fb386
2 changed files with 20 additions and 11 deletions

View File

@ -23,6 +23,13 @@ MAIN_SRC = main.cpp
OBJS=$(SRC_CLNT:%.cpp=$(BUILDDIR)/%.o) OBJS=$(SRC_CLNT:%.cpp=$(BUILDDIR)/%.o)
$(info )
$(info #######################################)
$(info # Compiling slsReceiverSoftware #)
$(info #######################################)
$(info )
.PHONY: all intdoc package eigerReceiver clean .PHONY: all intdoc package eigerReceiver clean
all: lib receiver all: lib receiver

View File

@ -30,7 +30,7 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success){
*/ */
//creating base receiver //creating base receiver
int tcpip_port_no = 1984; int tcpip_port_no = 1954;
success=OK; success=OK;
string fname = ""; string fname = "";
string udp_interface_type = "standard"; string udp_interface_type = "standard";
@ -85,18 +85,20 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success){
} }
// if required fname parameter not available, fail // if required fname parameter not available, fail
if (fname == "") //if (fname == "")
success = FAIL; // success = FAIL;
if((!fname.empty()) && (success == OK)){ if( !fname.empty() ){
try{
FILE_LOG(logINFO) << "config file name " << fname; FILE_LOG(logINFO) << "config file name " << fname;
success = read_config_file(fname, &tcpip_port_no); success = read_config_file(fname, &tcpip_port_no);
//VERBOSE_PRINT("Read configuration file of " + iline + " lines"); //VERBOSE_PRINT("Read configuration file of " + iline + " lines");
} }
else { catch(...){
FILE_LOG(logERROR) << "Error opening configuration file " << fname ; FILE_LOG(logERROR) << "Error opening configuration file " << fname ;
success = FAIL; success = FAIL;
} }
}
if(success != OK){ if(success != OK){
@ -104,7 +106,7 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success){
} }
if (success==OK){ if (success==OK){
cout << "SLS Receiver starting " << udp_interface_type << endl; FILE_LOG(logINFO) << "SLS Receiver starting " << udp_interface_type << " on port " << tcpip_port_no << endl;
udp_interface = UDPInterface::create(udp_interface_type); udp_interface = UDPInterface::create(udp_interface_type);
tcpipInterface = new slsReceiverTCPIPInterface(success, udp_interface, tcpip_port_no); tcpipInterface = new slsReceiverTCPIPInterface(success, udp_interface, tcpip_port_no);
//tcp ip interface //tcp ip interface