mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 05:17:13 +02:00
a version of receiver for gemma with bottom
This commit is contained in:
@ -47,7 +47,7 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
|
|||||||
*/
|
*/
|
||||||
virtual ~UDPStandardImplementation();
|
virtual ~UDPStandardImplementation();
|
||||||
|
|
||||||
|
void configure(map<string, string> config_map);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* delete and free member parameters
|
* delete and free member parameters
|
||||||
|
@ -91,6 +91,22 @@ UDPStandardImplementation::UDPStandardImplementation()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void UDPStandardImplementation::configure(map<string, string> config_map){
|
||||||
|
FILE_LOG(logWARNING) << __AT__ << " called";
|
||||||
|
|
||||||
|
map<string, string>::const_iterator pos;
|
||||||
|
pos = config_map.find("mode");
|
||||||
|
if (pos != config_map.end() ){
|
||||||
|
int b;
|
||||||
|
if(!sscanf(pos->second.c_str(), "%d", &b)){
|
||||||
|
cout << "Warning: Could not parse mode. Assuming top mode." << endl;
|
||||||
|
b = 0;
|
||||||
|
}
|
||||||
|
bottom = b!= 0;
|
||||||
|
cout << "bottom:"<< bottom << endl;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void UDPStandardImplementation::initializeMembers(){
|
void UDPStandardImplementation::initializeMembers(){
|
||||||
myDetectorType = GENERIC;
|
myDetectorType = GENERIC;
|
||||||
maxPacketsPerFile = 0;
|
maxPacketsPerFile = 0;
|
||||||
@ -945,12 +961,12 @@ int UDPStandardImplementation::createUDPSockets(){
|
|||||||
port[1] = server_port[1];
|
port[1] = server_port[1];
|
||||||
|
|
||||||
/** eiger specific */
|
/** eiger specific */
|
||||||
/*
|
|
||||||
if(bottom){
|
if(bottom){
|
||||||
port[0] = server_port[1];
|
port[0] = server_port[1];
|
||||||
port[1] = server_port[0];
|
port[1] = server_port[0];
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
//if eth is mistaken with ip address
|
//if eth is mistaken with ip address
|
||||||
if (strchr(eth,'.')!=NULL)
|
if (strchr(eth,'.')!=NULL)
|
||||||
strcpy(eth,"");
|
strcpy(eth,"");
|
||||||
|
@ -65,6 +65,13 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success){
|
|||||||
|
|
||||||
switch(c){
|
switch(c){
|
||||||
|
|
||||||
|
case 'm':
|
||||||
|
int b;
|
||||||
|
sscanf(optarg, "%d", &b);
|
||||||
|
bottom = b != 0;
|
||||||
|
configuration_map["mode"] = optarg;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'f':
|
case 'f':
|
||||||
fname = optarg;
|
fname = optarg;
|
||||||
//cout << long_options[option_index].name << " " << optarg << endl;
|
//cout << long_options[option_index].name << " " << optarg << endl;
|
||||||
@ -86,7 +93,7 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success){
|
|||||||
string help_message = """\nSLS Receiver Server\n\n""";
|
string help_message = """\nSLS Receiver Server\n\n""";
|
||||||
help_message += """usage: slsReceiver --config config_fname [--rx_tcpport port]\n\n""";
|
help_message += """usage: slsReceiver --config config_fname [--rx_tcpport port]\n\n""";
|
||||||
help_message += """\t--config:\t configuration filename for SLS Detector receiver\n""";
|
help_message += """\t--config:\t configuration filename for SLS Detector receiver\n""";
|
||||||
help_message += """\t--mode:\t ???\n""";
|
help_message += """\t--mode:\t 1 for bottom and 0 for top\n""";
|
||||||
help_message += """\t--rx_tcpport:\t TCP Communication Port with the client. Default: 1954.\n\n""";
|
help_message += """\t--rx_tcpport:\t TCP Communication Port with the client. Default: 1954.\n\n""";
|
||||||
help_message += """\t--rest_hostname:\t Receiver hostname:port. It applies only to REST receivers, and indicates the hostname of the REST backend. Default: localhost:8081.\n\n""";
|
help_message += """\t--rest_hostname:\t Receiver hostname:port. It applies only to REST receivers, and indicates the hostname of the REST backend. Default: localhost:8081.\n\n""";
|
||||||
|
|
||||||
@ -120,10 +127,10 @@ slsReceiver::slsReceiver(int argc, char *argv[], int &success){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (success==OK){
|
if (success==OK){
|
||||||
FILE_LOG(logINFO) << "SLS Receiver starting " << udp_interface_type << " on port " << tcpip_port_no << endl;
|
FILE_LOG(logINFO) << "SLS Receiver starting " << udp_interface_type << " on port " << tcpip_port_no << " with mode " << bottom << endl;
|
||||||
udp_interface = UDPInterface::create(udp_interface_type);
|
udp_interface = UDPInterface::create(udp_interface_type);
|
||||||
udp_interface->configure(configuration_map);
|
udp_interface->configure(configuration_map);
|
||||||
tcpipInterface = new slsReceiverTCPIPInterface(success, udp_interface, tcpip_port_no);
|
tcpipInterface = new slsReceiverTCPIPInterface(success, udp_interface, tcpip_port_no, bottom);
|
||||||
//tcp ip interface
|
//tcp ip interface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user