mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 14:57:13 +02:00
zmq streaming should work with external gui now
This commit is contained in:
@ -1,9 +1,9 @@
|
|||||||
Path: slsDetectorsPackage/slsDetectorSoftware
|
Path: slsDetectorsPackage/slsDetectorSoftware
|
||||||
URL: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
|
URL: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
|
||||||
Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
|
Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git
|
||||||
Repsitory UUID: 1fd03e9cdd01efd75e3ab8641be71d61b2e1aa10
|
Repsitory UUID: ea284699983c3811852b1bcea3708d952803020d
|
||||||
Revision: 1566
|
Revision: 1611
|
||||||
Branch: 3.0.1
|
Branch: zmqchange
|
||||||
Last Changed Author: Dhanya_Maliakal
|
Last Changed Author: Dhanya_Maliakal
|
||||||
Last Changed Rev: 1571
|
Last Changed Rev: 1619
|
||||||
Last Changed Date: 2017-10-03 14:12:22.000000002 +0200 ./slsDetector/slsDetector.cpp
|
Last Changed Date: 2017-11-27 14:45:39.000000002 +0100 ./slsDetector/slsDetectorBase.h
|
||||||
|
@ -208,7 +208,7 @@ multiSlsDetector::multiSlsDetector(int id) : slsDetectorUtils(), shmId(-1)
|
|||||||
|
|
||||||
thisMultiDetector->acquiringFlag = false;
|
thisMultiDetector->acquiringFlag = false;
|
||||||
thisMultiDetector->externalgui = false;
|
thisMultiDetector->externalgui = false;
|
||||||
thisMultiDetector->receiver_datastream = false;
|
thisMultiDetector->receiver_upstream = false;
|
||||||
thisMultiDetector->alreadyExisting=1;
|
thisMultiDetector->alreadyExisting=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -274,7 +274,7 @@ multiSlsDetector::multiSlsDetector(int id) : slsDetectorUtils(), shmId(-1)
|
|||||||
|
|
||||||
getNMods();
|
getNMods();
|
||||||
getMaxMods();
|
getMaxMods();
|
||||||
client_datastream = false;
|
client_downstream = false;
|
||||||
for(int i=0;i<MAXDET;++i)
|
for(int i=0;i<MAXDET;++i)
|
||||||
zmqSocket[i] = 0;
|
zmqSocket[i] = 0;
|
||||||
threadpool = 0;
|
threadpool = 0;
|
||||||
@ -3690,21 +3690,6 @@ string multiSlsDetector::getNetworkParameter(networkParameter p) {
|
|||||||
*/
|
*/
|
||||||
string multiSlsDetector::setNetworkParameter(networkParameter p, string s){
|
string multiSlsDetector::setNetworkParameter(networkParameter p, string s){
|
||||||
|
|
||||||
// disable data streaming before changing zmq port (but only if they were on)
|
|
||||||
int prev_streaming = 0;
|
|
||||||
switch (p) {
|
|
||||||
case CLIENT_STREAMING_PORT:
|
|
||||||
prev_streaming = enableDataStreamingToClient();
|
|
||||||
if (enableDataStreamingToClient()) enableDataStreamingToClient(0);
|
|
||||||
break;
|
|
||||||
case RECEIVER_STREAMING_PORT:
|
|
||||||
prev_streaming = enableDataStreamingFromReceiver();
|
|
||||||
if (enableDataStreamingFromReceiver()) enableDataStreamingFromReceiver(0);
|
|
||||||
break;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (s.find('+')==string::npos) {
|
if (s.find('+')==string::npos) {
|
||||||
|
|
||||||
if(!threadpool){
|
if(!threadpool){
|
||||||
@ -3757,19 +3742,6 @@ string multiSlsDetector::setNetworkParameter(networkParameter p, string s){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//enable data streaming if it was on
|
|
||||||
if (prev_streaming) {
|
|
||||||
switch (p) {
|
|
||||||
case CLIENT_STREAMING_PORT:
|
|
||||||
enableDataStreamingToClient(1);
|
|
||||||
break;
|
|
||||||
case RECEIVER_STREAMING_PORT:
|
|
||||||
enableDataStreamingFromReceiver(1);
|
|
||||||
break;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return getNetworkParameter(p);
|
return getNetworkParameter(p);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -5680,7 +5652,7 @@ int multiSlsDetector::createReceivingDataSockets(const bool destroy){
|
|||||||
zmqSocket[i] = 0;
|
zmqSocket[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
client_datastream = false;
|
client_downstream = false;
|
||||||
cout << "Destroyed Receiving Data Socket(s)" << endl;
|
cout << "Destroyed Receiving Data Socket(s)" << endl;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -5701,7 +5673,7 @@ int multiSlsDetector::createReceivingDataSockets(const bool destroy){
|
|||||||
printf("Zmq Client[%d] at %s\n",i, zmqSocket[i]->GetZmqServerAddress());
|
printf("Zmq Client[%d] at %s\n",i, zmqSocket[i]->GetZmqServerAddress());
|
||||||
}
|
}
|
||||||
|
|
||||||
client_datastream = true;
|
client_downstream = true;
|
||||||
cout << "Receiving Data Socket(s) created" << endl;
|
cout << "Receiving Data Socket(s) created" << endl;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -6192,7 +6164,7 @@ int multiSlsDetector::enableDataStreamingToClient(int enable) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return client_datastream;
|
return client_downstream;
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::enableDataStreamingFromReceiver(int enable){
|
int multiSlsDetector::enableDataStreamingFromReceiver(int enable){
|
||||||
@ -6228,10 +6200,10 @@ int multiSlsDetector::enableDataStreamingFromReceiver(int enable){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
thisMultiDetector->receiver_datastream = ret;
|
thisMultiDetector->receiver_upstream = ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return thisMultiDetector->receiver_datastream;
|
return thisMultiDetector->receiver_upstream;
|
||||||
}
|
}
|
||||||
|
|
||||||
int multiSlsDetector::enableReceiverCompression(int i){
|
int multiSlsDetector::enableReceiverCompression(int i){
|
||||||
|
@ -205,7 +205,7 @@ class multiSlsDetector : public slsDetectorUtils {
|
|||||||
int receiverOnlineFlag;
|
int receiverOnlineFlag;
|
||||||
|
|
||||||
/** data streaming (up stream) enable in receiver */
|
/** data streaming (up stream) enable in receiver */
|
||||||
bool receiver_datastream;
|
bool receiver_upstream;
|
||||||
|
|
||||||
} sharedMultiSlsDetector;
|
} sharedMultiSlsDetector;
|
||||||
|
|
||||||
@ -998,6 +998,15 @@ class multiSlsDetector : public slsDetectorUtils {
|
|||||||
|
|
||||||
|
|
||||||
string getNetworkParameter(networkParameter);
|
string getNetworkParameter(networkParameter);
|
||||||
|
|
||||||
|
/**
|
||||||
|
sets the network parameters
|
||||||
|
must restart streaming in client/receiver if to do with zmq after calling this function
|
||||||
|
\param i network parameter type
|
||||||
|
\param s value to be set
|
||||||
|
\returns parameter
|
||||||
|
|
||||||
|
*/
|
||||||
string setNetworkParameter(networkParameter, std::string);
|
string setNetworkParameter(networkParameter, std::string);
|
||||||
int setPort(portType, int);
|
int setPort(portType, int);
|
||||||
int lockServer(int);
|
int lockServer(int);
|
||||||
@ -1490,7 +1499,7 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
/** data streaming (down stream) enabled in client (zmq sckets created) */
|
/** data streaming (down stream) enabled in client (zmq sckets created) */
|
||||||
bool client_datastream;
|
bool client_downstream;
|
||||||
|
|
||||||
/** ZMQ Socket - Receiver to Client */
|
/** ZMQ Socket - Receiver to Client */
|
||||||
ZmqSocket* zmqSocket[MAXDET];
|
ZmqSocket* zmqSocket[MAXDET];
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
//#define SVNPATH ""
|
//#define SVNPATH ""
|
||||||
#define SVNURLLIB "git@git.psi.ch:sls_detectors_software/sls_detector_software.git"
|
#define SVNURLLIB "git@git.psi.ch:sls_detectors_software/sls_detector_software.git"
|
||||||
//#define SVNREPPATH ""
|
//#define SVNREPPATH ""
|
||||||
#define SVNREPUUIDLIB "1fd03e9cdd01efd75e3ab8641be71d61b2e1aa10"
|
#define SVNREPUUIDLIB "ea284699983c3811852b1bcea3708d952803020d"
|
||||||
//#define SVNREV 0x1571
|
//#define SVNREV 0x1619
|
||||||
//#define SVNKIND ""
|
//#define SVNKIND ""
|
||||||
//#define SVNSCHED ""
|
//#define SVNSCHED ""
|
||||||
#define SVNAUTHLIB "Dhanya_Maliakal"
|
#define SVNAUTHLIB "Dhanya_Maliakal"
|
||||||
#define SVNREVLIB 0x1571
|
#define SVNREVLIB 0x1619
|
||||||
#define SVNDATELIB 0x20171003
|
#define SVNDATELIB 0x20171127
|
||||||
//
|
//
|
||||||
|
@ -779,7 +779,7 @@ int slsDetector::initializeDetectorSize(detectorType type) {
|
|||||||
thisDetector->flippedData[1] = 0;
|
thisDetector->flippedData[1] = 0;
|
||||||
thisDetector->zmqport = 0;
|
thisDetector->zmqport = 0;
|
||||||
thisDetector->receiver_zmqport = 0;
|
thisDetector->receiver_zmqport = 0;
|
||||||
thisDetector->receiver_datastream = false;
|
thisDetector->receiver_upstream = false;
|
||||||
thisDetector->receiver_read_freq = 0;
|
thisDetector->receiver_read_freq = 0;
|
||||||
|
|
||||||
for (int ia=0; ia<MAX_ACTIONS; ++ia) {
|
for (int ia=0; ia<MAX_ACTIONS; ++ia) {
|
||||||
@ -8283,7 +8283,7 @@ int slsDetector::updateReceiverNoWait() {
|
|||||||
|
|
||||||
// receiver streaming enable
|
// receiver streaming enable
|
||||||
n += dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
|
n += dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
|
||||||
thisDetector->receiver_datastream = ind;
|
thisDetector->receiver_upstream = ind;
|
||||||
|
|
||||||
if (!n) printf("n: %d\n", n);
|
if (!n) printf("n: %d\n", n);
|
||||||
|
|
||||||
@ -8599,14 +8599,14 @@ int slsDetector::enableDataStreamingFromReceiver(int enable){
|
|||||||
cout << "could not set data streaming in receiver to " << enable <<" Returned:" << retval << endl;
|
cout << "could not set data streaming in receiver to " << enable <<" Returned:" << retval << endl;
|
||||||
setErrorMask((getErrorMask())|(DATA_STREAMING));
|
setErrorMask((getErrorMask())|(DATA_STREAMING));
|
||||||
} else {
|
} else {
|
||||||
thisDetector->receiver_datastream = retval;
|
thisDetector->receiver_upstream = retval;
|
||||||
if(ret==FORCE_UPDATE)
|
if(ret==FORCE_UPDATE)
|
||||||
updateReceiver();
|
updateReceiver();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return thisDetector->receiver_datastream;
|
return thisDetector->receiver_upstream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
/** tcp port from receiver to gui/different process (only data) */
|
/** tcp port from receiver to gui/different process (only data) */
|
||||||
int receiver_zmqport;
|
int receiver_zmqport;
|
||||||
/** data streaming (up stream) enable in receiver */
|
/** data streaming (up stream) enable in receiver */
|
||||||
bool receiver_datastream;
|
bool receiver_upstream;
|
||||||
/* Receiver read frequency */
|
/* Receiver read frequency */
|
||||||
int receiver_read_freq;
|
int receiver_read_freq;
|
||||||
|
|
||||||
@ -446,7 +446,8 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
sets the network parameters
|
sets the network parameters
|
||||||
\param i network parameter type can be RECEIVER_IP, RECEIVER_MAC, SERVER_MAC
|
must restart streaming in client/receiver if to do with zmq after calling this function
|
||||||
|
\param i network parameter type
|
||||||
\param s value to be set
|
\param s value to be set
|
||||||
\returns parameter
|
\returns parameter
|
||||||
|
|
||||||
@ -1781,6 +1782,16 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
|||||||
*/
|
*/
|
||||||
int setReceiverReadTimer(int time_in_ms=500);
|
int setReceiverReadTimer(int time_in_ms=500);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable data streaming to client
|
||||||
|
* @param enable 0 to disable, 1 to enable, -1 to get the value
|
||||||
|
* @returns data streaming to client enable
|
||||||
|
*/
|
||||||
|
int enableDataStreamingToClient(int enable=-1) {
|
||||||
|
cprintf(RED,"ERROR: Must be called from the multi Detector level\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/** Enable or disable streaming data from receiver to client
|
/** Enable or disable streaming data from receiver to client
|
||||||
* @param enable 0 to disable 1 to enable -1 to only get the value
|
* @param enable 0 to disable 1 to enable -1 to only get the value
|
||||||
* @returns data streaming from receiver enable
|
* @returns data streaming from receiver enable
|
||||||
|
@ -574,9 +574,15 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
|
|||||||
|
|
||||||
/** Reads frames from receiver through a constant socket
|
/** Reads frames from receiver through a constant socket
|
||||||
*/
|
*/
|
||||||
// virtual int* readFrameFromReceiver(char* fName, int &acquisitionIndex, int &frameIndex, int &subFrameIndex)=0;
|
|
||||||
virtual void readFrameFromReceiver()=0;
|
virtual void readFrameFromReceiver()=0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable data streaming to client
|
||||||
|
* @param enable 0 to disable, 1 to enable, -1 to get the value
|
||||||
|
* @returns data streaming to client enable
|
||||||
|
*/
|
||||||
|
virtual int enableDataStreamingToClient(int enable=-1)=0;
|
||||||
|
|
||||||
/** Sets the read receiver frequency
|
/** Sets the read receiver frequency
|
||||||
if data required from receiver randomly readRxrFrequency=0,
|
if data required from receiver randomly readRxrFrequency=0,
|
||||||
else every nth frame to be sent to gui
|
else every nth frame to be sent to gui
|
||||||
|
@ -1887,14 +1887,14 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
|||||||
++i;
|
++i;
|
||||||
|
|
||||||
/*! \page network
|
/*! \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). 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). 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_pFuncName="zmqport"; //
|
||||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter;
|
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter;
|
||||||
++i;
|
++i;
|
||||||
|
|
||||||
/*! \page network
|
/*! \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_pFuncName="rx_zmqport"; //
|
||||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter;
|
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter;
|
||||||
@ -2316,15 +2316,6 @@ string slsDetectorCommand::cmdAcquire(int narg, char *args[], int action) {
|
|||||||
myDet->setOnline(ONLINE_FLAG);
|
myDet->setOnline(ONLINE_FLAG);
|
||||||
int r_online = myDet->setReceiverOnline(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)
|
if(myDet->acquire() == FAIL)
|
||||||
return string("acquire unsuccessful");
|
return string("acquire unsuccessful");
|
||||||
if(r_online){
|
if(r_online){
|
||||||
@ -3892,6 +3883,7 @@ string slsDetectorCommand::cmdNetworkParameter(int narg, char *args[], int actio
|
|||||||
|
|
||||||
networkParameter t;
|
networkParameter t;
|
||||||
int i;
|
int i;
|
||||||
|
int prev_streaming = 0;
|
||||||
if (action==HELP_ACTION)
|
if (action==HELP_ACTION)
|
||||||
return helpNetworkParameter(narg,args,action);
|
return helpNetworkParameter(narg,args,action);
|
||||||
|
|
||||||
@ -3955,11 +3947,19 @@ string slsDetectorCommand::cmdNetworkParameter(int narg, char *args[], int actio
|
|||||||
if (action==PUT_ACTION){
|
if (action==PUT_ACTION){
|
||||||
if (!(sscanf(args[1],"%d",&i)))
|
if (!(sscanf(args[1],"%d",&i)))
|
||||||
return ("cannot parse argument") + string(args[1]);
|
return ("cannot parse argument") + string(args[1]);
|
||||||
|
// if streaming, switch it off
|
||||||
|
prev_streaming = myDet->enableDataStreamingFromReceiver();
|
||||||
|
if (prev_streaming) myDet->enableDataStreamingFromReceiver(0);
|
||||||
}
|
}
|
||||||
}else return ("unknown network parameter")+cmd;
|
}else return ("unknown network parameter")+cmd;
|
||||||
|
|
||||||
if (action==PUT_ACTION)
|
if (action==PUT_ACTION) {
|
||||||
myDet->setNetworkParameter(t, args[1]);
|
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);
|
return myDet->getNetworkParameter(t);
|
||||||
}
|
}
|
||||||
@ -3981,8 +3981,12 @@ string slsDetectorCommand::helpNetworkParameter(int narg, char *args[], int acti
|
|||||||
os << "txndelay_right port \n sets detector transmission delay of the right port"<< std::endl;
|
os << "txndelay_right port \n sets detector transmission delay of the right port"<< std::endl;
|
||||||
os << "txndelay_frame port \n sets detector transmission delay of the entire frame"<< std::endl;
|
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 << "flowcontrol_10g port \n sets flow control for 10g for eiger"<< std::endl;
|
||||||
os << "zmqport port \n sets zmq port (data to client from receiver/different process); setting via multidetector command calculates port for individual detectors"<< std::endl;
|
os << "zmqport port \n sets zmq port (data to client from receiver/different process); \n"
|
||||||
os << "rx_zmqport port \n sets zmq port (data from receiver to client/different process); setting via multidetector command calculates port for individual detectors"<< std::endl;
|
"setting via multidetector command calculates port for individual detectors\n"
|
||||||
|
"must restart streaming in client with new port from gui/external gui"<< std::endl;
|
||||||
|
os << "rx_zmqport port \n sets zmq port (data from receiver to client/different process); \n"
|
||||||
|
"setting via multidetector command calculates port for individual detectors\n"
|
||||||
|
"restarts streaming in receiver with new port"<< std::endl;
|
||||||
}
|
}
|
||||||
if (action==GET_ACTION || action==HELP_ACTION) {
|
if (action==GET_ACTION || action==HELP_ACTION) {
|
||||||
os << "detectormac \n gets detector mac "<< std::endl;
|
os << "detectormac \n gets detector mac "<< std::endl;
|
||||||
@ -5891,19 +5895,11 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) {
|
|||||||
|
|
||||||
|
|
||||||
myDet->setOnline(ONLINE_FLAG);
|
myDet->setOnline(ONLINE_FLAG);
|
||||||
int r_online = myDet->setReceiverOnline(ONLINE_FLAG);
|
myDet->setReceiverOnline(ONLINE_FLAG);
|
||||||
|
|
||||||
if(cmd=="receiver"){
|
if(cmd=="receiver"){
|
||||||
if (action==PUT_ACTION) {
|
if (action==PUT_ACTION) {
|
||||||
if(!strcasecmp(args[1],"start")) {
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
myDet->startReceiver();
|
myDet->startReceiver();
|
||||||
}
|
}
|
||||||
else if(!strcasecmp(args[1],"stop"))
|
else if(!strcasecmp(args[1],"stop"))
|
||||||
|
@ -200,8 +200,9 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
|
|||||||
virtual string getNetworkParameter(networkParameter i)=0;
|
virtual string getNetworkParameter(networkParameter i)=0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
sets the network parameters (implemented for gotthard)
|
sets the network parameters
|
||||||
\param i network parameter type can be RECEIVER_IP, RECEIVER_MAC, SERVER_MAC
|
must restart streaming in client/receiver if to do with zmq after calling this function
|
||||||
|
\param i network parameter type
|
||||||
\param s value to be set
|
\param s value to be set
|
||||||
\returns parameter
|
\returns parameter
|
||||||
|
|
||||||
@ -773,6 +774,13 @@ virtual ROI* getROI(int &n)=0;
|
|||||||
*/
|
*/
|
||||||
virtual int setReadReceiverFrequency(int freq=-1)=0;
|
virtual int setReadReceiverFrequency(int freq=-1)=0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable data streaming to client
|
||||||
|
* @param enable 0 to disable, 1 to enable, -1 to get the value
|
||||||
|
* @returns data streaming to client enable
|
||||||
|
*/
|
||||||
|
virtual int enableDataStreamingToClient(int enable=-1)=0;
|
||||||
|
|
||||||
/** Enable or disable streaming data from receiver to client
|
/** Enable or disable streaming data from receiver to client
|
||||||
* @param enable 0 to disable 1 to enable -1 to only get the value
|
* @param enable 0 to disable 1 to enable -1 to only get the value
|
||||||
* @returns data streaming from receiver enable
|
* @returns data streaming from receiver enable
|
||||||
|
@ -509,11 +509,9 @@ void* postProcessing::processData(int delflag) {
|
|||||||
pthread_mutex_unlock(&mg);
|
pthread_mutex_unlock(&mg);
|
||||||
//cprintf(RED,"In post processing threads\n");
|
//cprintf(RED,"In post processing threads\n");
|
||||||
|
|
||||||
|
if(dataReady) {
|
||||||
if(dataReady){
|
|
||||||
readFrameFromReceiver();
|
readFrameFromReceiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
//only update progress
|
//only update progress
|
||||||
else{
|
else{
|
||||||
int caught = -1;
|
int caught = -1;
|
||||||
|
@ -238,7 +238,7 @@ s
|
|||||||
void ResetPositionIndex(){pthread_mutex_lock(&mp); resetPositionIndex(); pthread_mutex_unlock(&mp);};
|
void ResetPositionIndex(){pthread_mutex_lock(&mp); resetPositionIndex(); pthread_mutex_unlock(&mp);};
|
||||||
|
|
||||||
|
|
||||||
void registerDataCallback(int( *userCallback)(detectorData*, int, int, void*), void *pArg) {dataReady = userCallback; pCallbackArg = pArg;};
|
void registerDataCallback(int( *userCallback)(detectorData*, int, int, void*), void *pArg) {dataReady = userCallback; pCallbackArg = pArg;enableDataStreamingToClient(1);};
|
||||||
|
|
||||||
|
|
||||||
void registerRawDataCallback(int( *userCallback)(double*, int, void*), void *pArg) {rawDataReady = userCallback; pRawDataArg = pArg;};
|
void registerRawDataCallback(int( *userCallback)(double*, int, void*), void *pArg) {rawDataReady = userCallback; pRawDataArg = pArg;};
|
||||||
|
Reference in New Issue
Block a user