mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-21 20:26:42 +01:00
makng the zmq work without external flag
This commit is contained in:
@@ -1895,14 +1895,14 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
||||
++i;
|
||||
|
||||
/*! \page network
|
||||
- <b>zmqport [port]</b> sets/gets the 0MQ (TCP) port of the client to where final data is streamed to (eg. for GUI). The default already connects with rx_zmqport for the GUI. This command to change from default can be used from command line when sockets are not already open as the command line is not aware/create the 0mq sockets in the client side. Use single-detector command to set individually or multi-detector command to calculate based on \c port for the rest. \c Returns \c (int)
|
||||
- <b>zmqport [port]</b> sets/gets the 0MQ (TCP) port of the client to where final data is streamed to (eg. for GUI). The default already connects with rx_zmqport for the GUI. Use single-detector command to set individually or multi-detector command to calculate based on \c port for the rest. Must restart zmq client streaming in gui/external gui \c Returns \c (int)
|
||||
*/
|
||||
descrToFuncMap[i].m_pFuncName="zmqport"; //
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter;
|
||||
++i;
|
||||
|
||||
/*! \page network
|
||||
- <b>rx_zmqport [port]</b> sets/gets the 0MQ (TCP) port of the receiver from where data is streamed from (eg. to GUI or another process for further processing). Use single-detector command to set individually or multi-detector command to calculate based on \c port for the rest. \c Returns \c (int)
|
||||
- <b>rx_zmqport [port]</b> sets/gets the 0MQ (TCP) port of the receiver from where data is streamed from (eg. to GUI or another process for further processing). Use single-detector command to set individually or multi-detector command to calculate based on \c port for the rest. put restarts streaming in receiver with new port. \c Returns \c (int)
|
||||
*/
|
||||
descrToFuncMap[i].m_pFuncName="rx_zmqport"; //
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter;
|
||||
@@ -2338,15 +2338,6 @@ string slsDetectorCommand::cmdAcquire(int narg, char *args[], int action) {
|
||||
myDet->setOnline(ONLINE_FLAG);
|
||||
int r_online = myDet->setReceiverOnline(ONLINE_FLAG);
|
||||
|
||||
// switch off data streaming to prevent extra images in zmq gui buffer
|
||||
/*if (r_online == ONLINE_FLAG) {
|
||||
if (myDet->enableDataStreamingFromReceiver() != 0) {
|
||||
if (myDet->enableDataStreamingFromReceiver(0) != 0) {
|
||||
std::cout << "Error: Unable to switch off data streaming in receiver. If GUI on, extra image(s) in zmq GUI buffer" << std::endl;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if(myDet->acquire() == FAIL)
|
||||
return string("acquire unsuccessful");
|
||||
if(r_online){
|
||||
@@ -3914,6 +3905,7 @@ string slsDetectorCommand::cmdNetworkParameter(int narg, char *args[], int actio
|
||||
|
||||
networkParameter t;
|
||||
int i;
|
||||
int prev_streaming = 0;
|
||||
if (action==HELP_ACTION)
|
||||
return helpNetworkParameter(narg,args,action);
|
||||
|
||||
@@ -3977,6 +3969,9 @@ string slsDetectorCommand::cmdNetworkParameter(int narg, char *args[], int actio
|
||||
if (action==PUT_ACTION){
|
||||
if (!(sscanf(args[1],"%d",&i)))
|
||||
return ("cannot parse argument") + string(args[1]);
|
||||
// if streaming, switch it off
|
||||
prev_streaming = myDet->enableDataStreamingFromReceiver();
|
||||
if (prev_streaming) myDet->enableDataStreamingFromReceiver(0);
|
||||
}
|
||||
}else if (cmd=="zmqip") {
|
||||
t=CLIENT_STREAMING_SRC_IP;
|
||||
@@ -3985,8 +3980,13 @@ string slsDetectorCommand::cmdNetworkParameter(int narg, char *args[], int actio
|
||||
}
|
||||
else return ("unknown network parameter")+cmd;
|
||||
|
||||
if (action==PUT_ACTION)
|
||||
if (action==PUT_ACTION) {
|
||||
myDet->setNetworkParameter(t, args[1]);
|
||||
// switch it back on, if it had been switched on
|
||||
if (prev_streaming && t == RECEIVER_STREAMING_PORT)
|
||||
myDet->enableDataStreamingFromReceiver(1);
|
||||
|
||||
}
|
||||
|
||||
return myDet->getNetworkParameter(t);
|
||||
}
|
||||
@@ -4009,15 +4009,17 @@ string slsDetectorCommand::helpNetworkParameter(int narg, char *args[], int acti
|
||||
os << "txndelay_frame port \n sets detector transmission delay of the entire frame"<< std::endl;
|
||||
os << "flowcontrol_10g port \n sets flow control for 10g for eiger"<< std::endl;
|
||||
os << "zmqport port \n sets the 0MQ (TCP) port of the client to where final data is streamed to (eg. for GUI). The default already connects with rx_zmqport for the GUI. "
|
||||
"This command to change from default can be used from command line when sockets are not already open as the command line is not aware/create the 0mq sockets in the client side. "
|
||||
"Use single-detector command to set individually or multi-detector command to calculate based on port for the rest."<< std::endl;
|
||||
"Use single-detector command to set individually or multi-detector command to calculate based on port for the rest."
|
||||
"Must restart streaming in client with new port from gui/external gui"<< std::endl;
|
||||
os << "rx_zmqport port \n sets the 0MQ (TCP) port of the receiver from where data is streamed from (eg. to GUI or another process for further processing). "
|
||||
"Use single-detector command to set individually or multi-detector command to calculate based on port for the rest."<< std::endl;
|
||||
"Use single-detector command to set individually or multi-detector command to calculate based on port for the rest."
|
||||
"Restarts streaming in receiver with new port"<< std::endl;
|
||||
os << "zmqip ip \n sets the 0MQ (TCP) ip of the client to where final data is streamed to (eg. for GUI). Default is ip of rx_hostname and works for GUI. "
|
||||
"This command to change from default can be used from command line when sockets are not already open as the command line is not aware/create the 0mq sockets in the client side. "
|
||||
"This is usually used to stream in from an external process." << std::endl;
|
||||
"This is usually used to stream in from an external process."
|
||||
"Must restart streaming in client with new port from gui/external gui. " << std::endl;
|
||||
os << "rx_zmqip ip \n sets/gets the 0MQ (TCP) ip of the receiver from where data is streamed from (eg. to GUI or another process for further processing). "
|
||||
"Default is ip of rx_hostname and works for GUI. This is usually used to stream out to an external process for further processing." << std::endl;
|
||||
"Default is ip of rx_hostname and works for GUI. This is usually used to stream out to an external process for further processing."
|
||||
"restarts streaming in receiver with new port" << std::endl;
|
||||
}
|
||||
if (action==GET_ACTION || action==HELP_ACTION) {
|
||||
os << "detectormac \n gets detector mac "<< std::endl;
|
||||
@@ -5943,21 +5945,12 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) {
|
||||
|
||||
|
||||
myDet->setOnline(ONLINE_FLAG);
|
||||
int r_online = myDet->setReceiverOnline(ONLINE_FLAG);
|
||||
myDet->setReceiverOnline(ONLINE_FLAG);
|
||||
|
||||
if(cmd=="receiver"){
|
||||
if (action==PUT_ACTION) {
|
||||
if(!strcasecmp(args[1],"start")) {
|
||||
/*// switch off data streaming to prevent extra images in zmq gui buffer
|
||||
if (r_online == ONLINE_FLAG) {
|
||||
if (myDet->enableDataStreamingFromReceiver() != 0) {
|
||||
if (myDet->enableDataStreamingFromReceiver(0) != 0) {
|
||||
std::cout << "Error: Unable to switch off data streaming in receiver. If GUI on, extra image(s) in zmq GUI buffer" << std::endl;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
if(!strcasecmp(args[1],"start"))
|
||||
myDet->startReceiver();
|
||||
}
|
||||
else if(!strcasecmp(args[1],"stop"))
|
||||
myDet->stopReceiver();
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user