mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +02:00
Merge branch 'developer' of git.psi.ch:sls_detectors_software/sls_detector_software into developer
This commit is contained in:
@ -559,8 +559,10 @@ int slsDetector::initializeDetectorSize(detectorType type) {
|
||||
/** set detector ip address */
|
||||
memset(thisDetector->detectorIP,0,MAX_STR_LENGTH);
|
||||
strcpy(thisDetector->detectorIP,DEFAULT_DET_IP);
|
||||
/** set zmq tcp src ip address */
|
||||
memset(thisDetector->zmqsrcip,0,MAX_STR_LENGTH);
|
||||
/** set zmq tcp src ip address in client */
|
||||
memset(thisDetector->zmqip,0,MAX_STR_LENGTH);
|
||||
/** set zmq tcp src ip address in receiver*/
|
||||
memset(thisDetector->receiver_zmqip,0,MAX_STR_LENGTH);
|
||||
|
||||
|
||||
/** sets onlineFlag to OFFLINE_FLAG */
|
||||
@ -712,17 +714,23 @@ int slsDetector::initializeDetectorSize(detectorType type) {
|
||||
thisDetector->timerValue[CYCLES_NUMBER]=1;
|
||||
thisDetector->timerValue[SAMPLES_JCTB]=1;
|
||||
|
||||
// calculating databytes (special when with gap pixels, jctb, mythen in 24bit mode or using probes)
|
||||
thisDetector->dataBytes=thisDetector->nMod[X]*thisDetector->nMod[Y]*thisDetector->nChips*thisDetector->nChans*thisDetector->dynamicRange/8;
|
||||
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y) * thisDetector->dynamicRange/8;
|
||||
thisDetector->dataBytesInclGapPixels =
|
||||
(thisDetector->nMod[X] * thisDetector->nChip[X] * thisDetector->nChan[X] + thisDetector->gappixels * thisDetector->nGappixels[X]) *
|
||||
(thisDetector->nMod[Y] * thisDetector->nChip[Y] * thisDetector->nChan[Y] + thisDetector->gappixels * thisDetector->nGappixels[Y]) *
|
||||
thisDetector->dynamicRange/8;
|
||||
|
||||
if(thisDetector->myDetectorType==JUNGFRAUCTB) {
|
||||
getTotalNumberOfChannels();
|
||||
// thisDetector->dataBytes=getTotalNumberOfChannels()*thisDetector->dynamicRange/8*thisDetector->timerValue[SAMPLES_JCTB];
|
||||
if(thisDetector->myDetectorType==JUNGFRAUCTB){
|
||||
getTotalNumberOfChannels();
|
||||
}
|
||||
if(thisDetector->myDetectorType==MYTHEN){
|
||||
else if(thisDetector->myDetectorType==MYTHEN){
|
||||
if (thisDetector->dynamicRange==24 || thisDetector->timerValue[PROBES_NUMBER]>0) {
|
||||
thisDetector->dataBytes=thisDetector->nMod[X]*thisDetector->nMod[Y]*thisDetector->nChips*thisDetector->nChans*4;
|
||||
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y) * thisDetector->nChans*4;
|
||||
thisDetector->dataBytesInclGapPixels =
|
||||
(thisDetector->nMod[X] * thisDetector->nChip[X] * thisDetector->nChan[X] + thisDetector->gappixels * thisDetector->nGappixels[X]) *
|
||||
(thisDetector->nMod[Y] * thisDetector->nChip[Y] * thisDetector->nChan[Y] + thisDetector->gappixels * thisDetector->nGappixels[Y]) *
|
||||
4;
|
||||
}
|
||||
}
|
||||
|
||||
@ -788,6 +796,8 @@ int slsDetector::initializeDetectorSize(detectorType type) {
|
||||
thisDetector->flippedData[0] = 0;
|
||||
thisDetector->flippedData[1] = 0;
|
||||
thisDetector->zmqport = 0;
|
||||
thisDetector->receiver_zmqport = 0;
|
||||
thisDetector->receiver_datastream = false;
|
||||
|
||||
for (int ia=0; ia<MAX_ACTIONS; ++ia) {
|
||||
strcpy(thisDetector->actionScript[ia],"none");
|
||||
@ -820,16 +830,8 @@ int slsDetector::initializeDetectorSize(detectorType type) {
|
||||
thisDetector->gainoff=thisDetector->chanoff+sizeof(int)*thisDetector->nGain*thisDetector->nModsMax;
|
||||
thisDetector->offsetoff=thisDetector->gainoff+sizeof(int)*thisDetector->nOffset*thisDetector->nModsMax;
|
||||
|
||||
//update?!?!?!?
|
||||
|
||||
if(thisDetector->myDetectorType==JUNGFRAUCTB) {
|
||||
// cout << "here2" << endl;
|
||||
getTotalNumberOfChannels();
|
||||
//thisDetector->nChan[X]=32;
|
||||
//thisDetector->nChans=thisDetector->nChan[X]*thisDetector->nChan[Y];
|
||||
|
||||
//thisDetector->dataBytes=getTotalNumberOfChannels()*thisDetector->dynamicRange/8*thisDetector->timerValue[SAMPLES_JCTB];
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -932,6 +934,14 @@ int slsDetector::initializeDetectorSize(detectorType type) {
|
||||
delete thisReceiver;
|
||||
thisReceiver = new receiverInterface(dataSocket);
|
||||
|
||||
// zmq ports
|
||||
if (posId != -1) {
|
||||
if (thisDetector->zmqport == 0)
|
||||
thisDetector->zmqport = DEFAULT_ZMQ_CL_PORTNO + (posId * ((thisDetector->myDetectorType == EIGER) ? 2 : 1));
|
||||
if (thisDetector->receiver_zmqport == 0)
|
||||
thisDetector->receiver_zmqport = DEFAULT_ZMQ_RX_PORTNO + (posId * ((thisDetector->myDetectorType == EIGER) ? 2 : 1));
|
||||
}
|
||||
|
||||
// setAngularConversionPointer(thisDetector->angOff,&thisDetector->nMods, thisDetector->nChans*thisDetector->nChips);
|
||||
|
||||
#ifdef VERBOSE
|
||||
@ -1746,11 +1756,7 @@ int slsDetector::getTotalNumberOfChannels() {
|
||||
}
|
||||
thisDetector->nChans=thisDetector->nChan[X];
|
||||
thisDetector->dataBytes=thisDetector->nChans*thisDetector->nChips*thisDetector->nMods*2*thisDetector->timerValue[SAMPLES_JCTB];
|
||||
// cout << "Total number of channels is "<< thisDetector->nChans*thisDetector->nChips*thisDetector->nMods << " data bytes is " << thisDetector->dataBytes << endl;
|
||||
thisDetector->dataBytesInclGapPixels =
|
||||
(thisDetector->nChan[X]*thisDetector->nChip[X]*thisDetector->nMod[X]) + (thisDetector->gappixels * thisDetector->nGappixels[X]) *
|
||||
(thisDetector->nChan[Y]*thisDetector->nChip[Y]*thisDetector->nMod[Y]) + (thisDetector->gappixels * thisDetector->nGappixels[Y]) *
|
||||
2*thisDetector->timerValue[SAMPLES_JCTB];
|
||||
thisDetector->dataBytesInclGapPixels = thisDetector->dataBytes;
|
||||
} else {
|
||||
#ifdef VERBOSE
|
||||
cout << "det type is "<< thisDetector->myDetectorType << endl;
|
||||
@ -1768,7 +1774,7 @@ int slsDetector::getTotalNumberOfChannels(dimension d) {
|
||||
|
||||
int slsDetector::getTotalNumberOfChannelsInclGapPixels(dimension d) {
|
||||
getTotalNumberOfChannels();
|
||||
return (thisDetector->nChan[d]*thisDetector->nChip[d]*thisDetector->nMod[d]) + (thisDetector->gappixels * thisDetector->nGappixels[d]);
|
||||
return (thisDetector->nChan[d] * thisDetector->nChip[d] + thisDetector->gappixels * thisDetector->nGappixels[d]) * thisDetector->nMod[d];
|
||||
}
|
||||
|
||||
|
||||
@ -1790,7 +1796,7 @@ int slsDetector::getMaxNumberOfChannelsInclGapPixels(dimension d) {
|
||||
if (d==X) return 36*thisDetector->nChip[d]*thisDetector->nModMax[d];
|
||||
else return 1*thisDetector->nChip[d]*thisDetector->nModMax[d];
|
||||
}
|
||||
return (thisDetector->nChan[d]*thisDetector->nChip[d]*thisDetector->nModMax[d]) + (thisDetector->gappixels * thisDetector->nGappixels[d]);
|
||||
return (thisDetector->nChan[d] * thisDetector->nChip[d] + thisDetector->gappixels * thisDetector->nGappixels[d]) * thisDetector->nModMax[d];
|
||||
}
|
||||
|
||||
/* needed to set/get the size of the detector */
|
||||
@ -1873,19 +1879,23 @@ int slsDetector::setNumberOfModules(int n, dimension d){
|
||||
dr=32;
|
||||
|
||||
thisDetector->dataBytes=thisDetector->nMod[X]*thisDetector->nMod[Y]*thisDetector->nChips*thisDetector->nChans*dr/8;
|
||||
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y) *dr/8;
|
||||
thisDetector->dataBytesInclGapPixels =
|
||||
(thisDetector->nMod[X] * thisDetector->nChip[X] * thisDetector->nChan[X] + thisDetector->gappixels * thisDetector->nGappixels[X]) *
|
||||
(thisDetector->nMod[Y] * thisDetector->nChip[Y] * thisDetector->nChan[Y] + thisDetector->gappixels * thisDetector->nGappixels[Y]) *
|
||||
thisDetector->dynamicRange/8;
|
||||
|
||||
if(thisDetector->myDetectorType==MYTHEN){
|
||||
if (thisDetector->timerValue[PROBES_NUMBER]!=0) {
|
||||
thisDetector->dataBytes=thisDetector->nMod[X]*thisDetector->nMod[Y]*thisDetector->nChips*thisDetector->nChans*4;
|
||||
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y) *4;
|
||||
thisDetector->dataBytesInclGapPixels =
|
||||
(thisDetector->nMod[X] * thisDetector->nChip[X] * thisDetector->nChan[X] + thisDetector->gappixels * thisDetector->nGappixels[X]) *
|
||||
(thisDetector->nMod[Y] * thisDetector->nChip[Y] * thisDetector->nChan[Y] + thisDetector->gappixels * thisDetector->nGappixels[Y]) *
|
||||
4;
|
||||
}
|
||||
}
|
||||
|
||||
if(thisDetector->myDetectorType==JUNGFRAUCTB){
|
||||
getTotalNumberOfChannels();
|
||||
//thisDetector->dataBytes=getTotalNumberOfChannels()*thisDetector->nChans*dr/8*thisDetector->nChips*thisDetector->timerValue[SAMPLES_JCTB];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -2042,13 +2052,19 @@ int slsDetector::enableGapPixels(int val) {
|
||||
thisDetector->dataBytesInclGapPixels = 0;
|
||||
|
||||
if (thisDetector->dynamicRange != 4) {
|
||||
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y) * (thisDetector->dynamicRange/8);
|
||||
// set data bytes for other detector ( for future use)
|
||||
thisDetector->dataBytesInclGapPixels =
|
||||
(thisDetector->nMod[X] * thisDetector->nChip[X] * thisDetector->nChan[X] + thisDetector->gappixels * thisDetector->nGappixels[X]) *
|
||||
(thisDetector->nMod[Y] * thisDetector->nChip[Y] * thisDetector->nChan[Y] + thisDetector->gappixels * thisDetector->nGappixels[Y]) *
|
||||
thisDetector->dynamicRange/8;
|
||||
// set data bytes for other detector ( for future use)
|
||||
if(thisDetector->myDetectorType==JUNGFRAUCTB)
|
||||
getTotalNumberOfChannels();
|
||||
if(thisDetector->myDetectorType==MYTHEN){
|
||||
else if(thisDetector->myDetectorType==MYTHEN){
|
||||
if (thisDetector->dynamicRange==24 || thisDetector->timerValue[PROBES_NUMBER]>0) {
|
||||
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y) * thisDetector->nChans*4;
|
||||
thisDetector->dataBytesInclGapPixels =
|
||||
(thisDetector->nMod[X] * thisDetector->nChip[X] * thisDetector->nChan[X] + thisDetector->gappixels * thisDetector->nGappixels[X]) *
|
||||
(thisDetector->nMod[Y] * thisDetector->nChip[Y] * thisDetector->nChan[Y] + thisDetector->gappixels * thisDetector->nGappixels[Y]) *
|
||||
4;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5136,7 +5152,10 @@ int slsDetector::setDynamicRange(int n){
|
||||
|
||||
|
||||
thisDetector->dataBytes=thisDetector->nMod[X]*thisDetector->nMod[Y]*thisDetector->nChips*thisDetector->nChans*retval/8;
|
||||
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y)*retval/8;
|
||||
thisDetector->dataBytesInclGapPixels =
|
||||
(thisDetector->nMod[X] * thisDetector->nChip[X] * thisDetector->nChan[X] + thisDetector->gappixels * thisDetector->nGappixels[X]) *
|
||||
(thisDetector->nMod[Y] * thisDetector->nChip[Y] * thisDetector->nChan[Y] + thisDetector->gappixels * thisDetector->nGappixels[Y]) *
|
||||
thisDetector->dynamicRange/8;
|
||||
|
||||
if (thisDetector->myDetectorType==JUNGFRAUCTB) {
|
||||
// thisDetector->nChip[X]=retval/16;
|
||||
@ -5149,7 +5168,10 @@ int slsDetector::setDynamicRange(int n){
|
||||
if(thisDetector->myDetectorType==MYTHEN){
|
||||
if (thisDetector->timerValue[PROBES_NUMBER]!=0) {
|
||||
thisDetector->dataBytes=thisDetector->nMod[X]*thisDetector->nMod[Y]*thisDetector->nChips*thisDetector->nChans*4;
|
||||
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y)*4;
|
||||
thisDetector->dataBytesInclGapPixels =
|
||||
(thisDetector->nMod[X] * thisDetector->nChip[X] * thisDetector->nChan[X] + thisDetector->gappixels * thisDetector->nGappixels[X]) *
|
||||
(thisDetector->nMod[Y] * thisDetector->nChip[Y] * thisDetector->nChan[Y] + thisDetector->gappixels * thisDetector->nGappixels[Y]) *
|
||||
4;
|
||||
}
|
||||
|
||||
if (retval==32)
|
||||
@ -6017,11 +6039,14 @@ string slsDetector::setNetworkParameter(networkParameter index, string value) {
|
||||
case FLOW_CONTROL_10G:
|
||||
sscanf(value.c_str(),"%d",&i);
|
||||
return setDetectorNetworkParameter(index, i);
|
||||
case CLIENT_STREAMING_PORT:
|
||||
return setClientStreamingPort(value);
|
||||
case RECEIVER_STREAMING_PORT:
|
||||
setReceiverStreamingPort(value);
|
||||
return getReceiverStreamingPort();
|
||||
return setReceiverStreamingPort(value);
|
||||
case CLIENT_STREAMING_SRC_IP:
|
||||
return setClientStreamingIP(value);
|
||||
case RECEIVER_STREAMING_SRC_IP:
|
||||
return setReceiverStreamingSourceIP(value);
|
||||
return setReceiverStreamingIP(value);
|
||||
default:
|
||||
return (char*)("unknown network parameter");
|
||||
}
|
||||
@ -6052,10 +6077,14 @@ string slsDetector::getNetworkParameter(networkParameter index) {
|
||||
case DETECTOR_TXN_DELAY_FRAME:
|
||||
case FLOW_CONTROL_10G:
|
||||
return setDetectorNetworkParameter(index, -1);
|
||||
case CLIENT_STREAMING_PORT:
|
||||
return getClientStreamingPort();
|
||||
case RECEIVER_STREAMING_PORT:
|
||||
return getReceiverStreamingPort();
|
||||
case RECEIVER_STREAMING_SRC_IP:
|
||||
return getReceiverStreamingSourceIP();
|
||||
case CLIENT_STREAMING_SRC_IP:
|
||||
return getClientStreamingIP();
|
||||
case RECEIVER_STREAMING_SRC_IP:
|
||||
return getReceiverStreamingIP();
|
||||
default:
|
||||
return (char*)("unknown network parameter");
|
||||
}
|
||||
@ -6155,9 +6184,10 @@ string slsDetector::setReceiver(string receiverIP){
|
||||
std::cout << "dynamic range:" << thisDetector->dynamicRange << endl << endl;
|
||||
std::cout << "flippeddatax:" << thisDetector->flippedData[d] << endl;
|
||||
std::cout << "10GbE:" << thisDetector->tenGigaEnable << endl << endl;
|
||||
std::cout << "streaming port:" << thisDetector->zmqport << endl;
|
||||
std::cout << "streaming source ip:" << thisDetector->zmqsrcip << endl;
|
||||
std::cout << "rx streaming source ip:" << thisDetector->receiver_zmqip << endl;
|
||||
std::cout << "enable gap pixels:" << thisDetector->gappixels << endl;
|
||||
std::cout << "rx streaming port:" << thisDetector->receiver_zmqport << endl;
|
||||
|
||||
//std::cout << "dataStreaming:" << enableDataStreamingFromReceiver(-1) << endl << endl;
|
||||
/** enable compresison, */
|
||||
#endif
|
||||
@ -6200,20 +6230,8 @@ string slsDetector::setReceiver(string receiverIP){
|
||||
|
||||
// data streaming
|
||||
setReceiverStreamingPort(getReceiverStreamingPort());
|
||||
setReceiverStreamingSourceIP(getReceiverStreamingSourceIP());
|
||||
int clientSockets = parentDet->getStreamingSocketsCreatedInClient();
|
||||
int recSockets = enableDataStreamingFromReceiver(-1);
|
||||
if(clientSockets != recSockets) {
|
||||
pthread_mutex_lock(&ms);
|
||||
if(clientSockets)
|
||||
printf("Enabling Data Streaming\n");
|
||||
else
|
||||
printf("Disabling Data Streaming\n");
|
||||
// push client state to receiver
|
||||
/*parentDet->enableDataStreamingFromReceiver(clientSockets);*/
|
||||
enableDataStreamingFromReceiver(clientSockets);
|
||||
pthread_mutex_unlock(&ms);
|
||||
}
|
||||
setReceiverStreamingIP(getReceiverStreamingIP());
|
||||
enableDataStreamingFromReceiver(enableDataStreamingFromReceiver(-1));
|
||||
}
|
||||
}
|
||||
|
||||
@ -6312,7 +6330,29 @@ int slsDetector::setReceiverUDPPort2(int udpport){
|
||||
}
|
||||
|
||||
|
||||
int slsDetector::setReceiverStreamingPort(string port) {
|
||||
string slsDetector::setClientStreamingPort(string port) {
|
||||
int defaultport = 0;
|
||||
int numsockets = (thisDetector->myDetectorType == EIGER) ? 2:1;
|
||||
int arg = 0;
|
||||
|
||||
//multi command, calculate individual ports
|
||||
size_t found = port.find("multi");
|
||||
if(found != string::npos) {
|
||||
port.erase(found,5);
|
||||
sscanf(port.c_str(),"%d",&defaultport);
|
||||
arg = defaultport + (posId * numsockets);
|
||||
}
|
||||
else
|
||||
sscanf(port.c_str(),"%d",&arg);
|
||||
thisDetector->zmqport = arg;
|
||||
|
||||
return getClientStreamingPort();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
string slsDetector::setReceiverStreamingPort(string port) {
|
||||
int defaultport = 0;
|
||||
int numsockets = (thisDetector->myDetectorType == EIGER) ? 2:1;
|
||||
int arg = 0;
|
||||
@ -6340,24 +6380,69 @@ int slsDetector::setReceiverStreamingPort(string port) {
|
||||
disconnectData();
|
||||
}
|
||||
if(ret!=FAIL)
|
||||
thisDetector->zmqport = retval;
|
||||
thisDetector->receiver_zmqport = retval;
|
||||
if(ret==FORCE_UPDATE)
|
||||
updateReceiver();
|
||||
}
|
||||
|
||||
return thisDetector->zmqport;
|
||||
return getReceiverStreamingPort();
|
||||
}
|
||||
|
||||
string slsDetector::setReceiverStreamingSourceIP(string sourceIP) {
|
||||
string slsDetector::setClientStreamingIP(string sourceIP) {
|
||||
|
||||
struct addrinfo *result;
|
||||
// on failure to convert to a valid ip
|
||||
if (dataSocket->ConvertHostnameToInternetAddress(sourceIP.c_str(), &result)) {
|
||||
std::cout << "Warning: Could not convert zmqip into a valid IP" << sourceIP << std::endl;
|
||||
setErrorMask((getErrorMask())|(COULDNOT_SET_NETWORK_PARAMETER));
|
||||
return getClientStreamingIP();
|
||||
}
|
||||
// on success put IP as string into arg
|
||||
else {
|
||||
memset(thisDetector->zmqip, 0, MAX_STR_LENGTH);
|
||||
dataSocket->ConvertInternetAddresstoIpString(result, thisDetector->zmqip, MAX_STR_LENGTH);
|
||||
}
|
||||
|
||||
return getClientStreamingIP();
|
||||
}
|
||||
|
||||
|
||||
string slsDetector::setReceiverStreamingIP(string sourceIP) {
|
||||
|
||||
int fnum=F_RECEIVER_STREAMING_SRC_IP;
|
||||
int ret = FAIL;
|
||||
char arg[MAX_STR_LENGTH];
|
||||
memset(arg,0, sizeof(arg));
|
||||
strcpy(arg,sourceIP.c_str());
|
||||
memset(arg,0,sizeof(arg));
|
||||
char retval[MAX_STR_LENGTH];
|
||||
memset(retval,0, sizeof(retval));
|
||||
|
||||
// if empty, give rx_hostname
|
||||
if (sourceIP.empty()) {
|
||||
if(!strcmp(thisDetector->receiver_hostname,"none")) {
|
||||
std::cout << "Receiver hostname not set yet. Cannot create rx_zmqip from none\n" << endl;
|
||||
setErrorMask((getErrorMask())|(COULDNOT_SET_NETWORK_PARAMETER));
|
||||
return getReceiverStreamingIP();
|
||||
}
|
||||
sourceIP.assign(thisDetector->receiver_hostname);
|
||||
}
|
||||
|
||||
// verify the ip
|
||||
{
|
||||
struct addrinfo *result;
|
||||
// on failure to convert to a valid ip
|
||||
if (dataSocket->ConvertHostnameToInternetAddress(sourceIP.c_str(), &result)) {
|
||||
std::cout << "Warning: Could not convert rx_zmqip into a valid IP" << sourceIP << std::endl;
|
||||
setErrorMask((getErrorMask())|(COULDNOT_SET_NETWORK_PARAMETER));
|
||||
return getReceiverStreamingIP();
|
||||
}
|
||||
// on success put IP as string into arg
|
||||
else {
|
||||
memset(thisDetector->zmqip, 0, MAX_STR_LENGTH);
|
||||
dataSocket->ConvertInternetAddresstoIpString(result, arg, MAX_STR_LENGTH);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Sending receiver streaming source ip to receiver " << arg << std::endl;
|
||||
@ -6367,16 +6452,21 @@ string slsDetector::setReceiverStreamingSourceIP(string sourceIP) {
|
||||
disconnectData();
|
||||
}
|
||||
if(ret!=FAIL) {
|
||||
memset(thisDetector->zmqsrcip, 0, MAX_STR_LENGTH);
|
||||
strcpy(thisDetector->zmqsrcip, retval);
|
||||
memset(thisDetector->receiver_zmqip, 0, MAX_STR_LENGTH);
|
||||
strcpy(thisDetector->receiver_zmqip, retval);
|
||||
// if zmqip is empty, update it
|
||||
if (! strlen(thisDetector->zmqip))
|
||||
strcpy(thisDetector->zmqip, retval);
|
||||
}
|
||||
if(ret==FORCE_UPDATE)
|
||||
updateReceiver();
|
||||
}
|
||||
|
||||
return getReceiverStreamingSourceIP();
|
||||
return getReceiverStreamingIP();
|
||||
}
|
||||
|
||||
|
||||
|
||||
string slsDetector::setDetectorNetworkParameter(networkParameter index, int delay){
|
||||
int fnum = F_SET_NETWORK_PARAMETER;
|
||||
int ret = FAIL;
|
||||
@ -8400,13 +8490,17 @@ int slsDetector::updateReceiverNoWait() {
|
||||
parentDet->enableOverwriteMask(ind);
|
||||
pthread_mutex_unlock(&ms);
|
||||
|
||||
// streaming port
|
||||
// receiver streaming port
|
||||
n += dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
|
||||
thisDetector->zmqport = ind;
|
||||
thisDetector->receiver_zmqport = ind;
|
||||
|
||||
// receiver streaming enable
|
||||
n += dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
|
||||
thisDetector->receiver_datastream = ind;
|
||||
|
||||
// streaming source ip
|
||||
n += dataSocket->ReceiveDataOnly(path,MAX_STR_LENGTH);
|
||||
strcpy(thisDetector->zmqsrcip, path);
|
||||
strcpy(thisDetector->receiver_zmqip, path);
|
||||
|
||||
// gap pixels
|
||||
n += dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
|
||||
|
@ -269,11 +269,16 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
||||
bool acquiringFlag;
|
||||
/** flipped data across x or y axis */
|
||||
int flippedData[2];
|
||||
/** tcp port between receiver and gui (only data) */
|
||||
/** tcp port from gui/different process to receiver (only data) */
|
||||
int zmqport;
|
||||
/** zmq tcp src ip address between receiver and gui (only data) **/
|
||||
char zmqsrcip[MAX_STR_LENGTH];
|
||||
|
||||
/** tcp port from receiver to gui/different process (only data) */
|
||||
int receiver_zmqport;
|
||||
/** data streaming (up stream) enable in receiver */
|
||||
bool receiver_datastream;
|
||||
/** zmq tcp src ip address in client (only data) **/
|
||||
char zmqip[MAX_STR_LENGTH];
|
||||
/** zmq tcp src ip address in receiver (only data) **/
|
||||
char receiver_zmqip[MAX_STR_LENGTH];
|
||||
/** gap pixels enable */
|
||||
int gappixels;
|
||||
/** gap pixels in each direction */
|
||||
@ -1670,7 +1675,7 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
||||
/** gets the number of frames caught by any one receiver (to avoid using threadpool)
|
||||
\returns number of frames caught by any one receiver (master receiver if exists)
|
||||
*/
|
||||
int getFramesCaughtByAnyReceiver() {getFramesCaughtByReceiver();};
|
||||
int getFramesCaughtByAnyReceiver() {return getFramesCaughtByReceiver();};
|
||||
|
||||
/** gets the current frame index of receiver
|
||||
\returns current frame index of receiver
|
||||
@ -1757,10 +1762,14 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
||||
string getReceiverUDPPort() {ostringstream ss; ss << thisDetector->receiverUDPPort; string s = ss.str(); return s;};
|
||||
/** returns the receiver UDP2 for Eiger IP address \sa sharedSlsDetector */
|
||||
string getReceiverUDPPort2() {ostringstream ss; ss << thisDetector->receiverUDPPort2; string s = ss.str(); return s;};
|
||||
/** returns the zmq port \sa sharedSlsDetector */
|
||||
string getReceiverStreamingPort() {ostringstream ss; ss << thisDetector->zmqport; string s = ss.str(); return s;};
|
||||
/** gets the zmq source ip in client and receiver, returns "none" if default setting and no custom ip set*/
|
||||
string getReceiverStreamingSourceIP(){return string(thisDetector->zmqsrcip);};
|
||||
/** returns the client zmq port \sa sharedSlsDetector */
|
||||
string getClientStreamingPort() {ostringstream ss; ss << thisDetector->zmqport; string s = ss.str(); return s;};
|
||||
/** returns the receiver zmq port \sa sharedSlsDetector */
|
||||
string getReceiverStreamingPort() {ostringstream ss; ss << thisDetector->receiver_zmqport; string s = ss.str(); return s;};
|
||||
/** gets the zmq source ip in client, returns "none" if default setting and no custom ip set*/
|
||||
string getClientStreamingIP(){return string(thisDetector->zmqip);};
|
||||
/** gets the zmq source ip in receiver, returns "none" if default setting and no custom ip set*/
|
||||
string getReceiverStreamingIP(){return string(thisDetector->receiver_zmqip);};
|
||||
|
||||
/** validates the format of detector MAC address and sets it \sa sharedSlsDetector */
|
||||
string setDetectorMAC(string detectorMAC);
|
||||
@ -1776,10 +1785,15 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
||||
int setReceiverUDPPort(int udpport);
|
||||
/** sets the receiver udp port2 for Eiger \sa sharedSlsDetector */
|
||||
int setReceiverUDPPort2(int udpport);
|
||||
/** sets the zmq port in client and receiver (includes "multi" at the end if it should calculate individual ports \sa sharedSlsDetector */
|
||||
int setReceiverStreamingPort(string port);
|
||||
/** sets the zmq source ip in client and receiver */
|
||||
string setReceiverStreamingSourceIP(string sourceIP);
|
||||
/** sets the zmq port in client (includes "multi" at the end if it should calculate individual ports \sa sharedSlsDetector */
|
||||
string setClientStreamingPort(string port);
|
||||
/** sets the zmq port in receiver (includes "multi" at the end if it should calculate individual ports \sa sharedSlsDetector */
|
||||
string setReceiverStreamingPort(string port);
|
||||
/** sets the zmq source ip in client */
|
||||
string setClientStreamingIP(string sourceIP);
|
||||
/** sets the zmq source ip in receiver. if empty, uses rx_hostname*/
|
||||
string setReceiverStreamingIP(string sourceIP);
|
||||
|
||||
/** sets the transmission delay for left or right port or for an entire frame*/
|
||||
string setDetectorNetworkParameter(networkParameter index, int delay);
|
||||
|
||||
@ -1802,8 +1816,8 @@ class slsDetector : public slsDetectorUtils, public energyConversion {
|
||||
int setReceiverReadTimer(int time_in_ms=500);
|
||||
|
||||
/** Enable or disable streaming data from receiver to client
|
||||
* @param enable 0 to disable 1 to enable -1 to only get the value
|
||||
* @returns data streaming
|
||||
* @param enable 0 to disable 1 to enable -1 to only get the value
|
||||
* @returns data streaming from receiver enable
|
||||
*/
|
||||
int enableDataStreamingFromReceiver(int enable=-1);
|
||||
|
||||
|
@ -425,7 +425,6 @@ class slsDetectorBase : public virtual slsDetectorDefs, public virtual errorDef
|
||||
*/
|
||||
int setHighVoltage(int val){return setDAC(val, HV_NEW, 0, -1);} \
|
||||
|
||||
|
||||
/**
|
||||
set dacs value
|
||||
\param val value
|
||||
|
@ -255,13 +255,6 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
||||
commands to configure detector data structure
|
||||
*/
|
||||
|
||||
/*! \page config
|
||||
- <b> externalgui </b>sets/gets external gui flag. 1 sets and enables the 0MQ data stream (0MQ threads created) from receiver to client, while 0 unsets and disables. \c Returns \c (int)
|
||||
*/
|
||||
descrToFuncMap[i].m_pFuncName="externalgui"; //
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDataStream;
|
||||
++i;
|
||||
|
||||
/*! \page config
|
||||
- \b free Free shared memory on the control PC
|
||||
*/
|
||||
@ -1902,19 +1895,39 @@ slsDetectorCommand::slsDetectorCommand(slsDetectorUtils *det) {
|
||||
++i;
|
||||
|
||||
/*! \page network
|
||||
- <b>zmqport [port]</b> sets/gets the 0MQ (TCP) port of the receiver from where data is streamed to the client. 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. 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)
|
||||
*/
|
||||
descrToFuncMap[i].m_pFuncName="zmqport"; //
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter;
|
||||
++i;
|
||||
|
||||
/*! \page network
|
||||
- <b>zmqsrcip [ip]</b> sets/gets the 0MQ (TCP) ip of the receiver from where data is streamed to the client. Default is ip of rx_hostname. Use this only with external gui. \c Returns \c (string)
|
||||
- <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)
|
||||
*/
|
||||
descrToFuncMap[i].m_pFuncName="zmqsrcip"; //
|
||||
descrToFuncMap[i].m_pFuncName="rx_zmqport"; //
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter;
|
||||
++i;
|
||||
|
||||
/*! \page network
|
||||
- <b> rx_datastream </b>enables/disables data streaming from receiver. 1 enables 0MQ data stream from receiver (creates streamer threads), while 0 disables (destroys streamer threads). Switching to Gui enables data streaming in receiver and switching back to command line acquire will require disabling data streaming in receiver for fast applications \c Returns \c (int)
|
||||
*/
|
||||
descrToFuncMap[i].m_pFuncName="rx_datastream"; //
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdDataStream;
|
||||
++i;
|
||||
|
||||
/*! \page network
|
||||
- <b>zmqip [ip]</b> sets/gets the 0MQ (TCP) ip of the client to where final data is streamed to (eg. for GUI). For Experts only! 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. . If no custom ip, empty until first time connect to receiver. \c Returns \c (string)
|
||||
*/
|
||||
descrToFuncMap[i].m_pFuncName="zmqip"; //
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter;
|
||||
i++;
|
||||
|
||||
/*! \page network
|
||||
- <b>rx_zmqip [ip]</b> sets/gets the 0MQ (TCP) ip of the receiver from where data is streamed from (eg. to GUI or another process for further processing). For Experts only! Default is ip of rx_hostname and works for GUI. This is usually used to stream out to an external process for further processing. . If no custom ip, empty until first time connect to receiver. \c Returns \c (string)
|
||||
*/
|
||||
descrToFuncMap[i].m_pFuncName="rx_zmqip"; //
|
||||
descrToFuncMap[i].m_pFuncPtr=&slsDetectorCommand::cmdNetworkParameter;
|
||||
i++;
|
||||
|
||||
/*! \page network
|
||||
- <b>configuremac [i]</b> configures the MAC of the detector with these parameters: detectorip, detectormac, rx_udpip, rx_udpmac, rx_udpport, rx_udpport2 (if applicable). This command is already included in \c rx_hsotname. Only put!. \c Returns \c (int)
|
||||
@ -2318,19 +2331,13 @@ string slsDetectorCommand::cmdAcquire(int narg, char *args[], int action) {
|
||||
#endif
|
||||
|
||||
|
||||
if (action==HELP_ACTION) {
|
||||
return helpAcquire(narg,args,HELP_ACTION);
|
||||
}
|
||||
|
||||
myDet->setOnline(ONLINE_FLAG);
|
||||
int r_online = myDet->setReceiverOnline(ONLINE_FLAG);
|
||||
|
||||
if ((!myDet->getExternalGuiFlag()) && (r_online == ONLINE_FLAG)) {
|
||||
// command line: must be off, if receiver on or there was -1, then
|
||||
if (myDet->enableDataStreamingFromReceiver(-1) != 0){
|
||||
//switch it off, if error
|
||||
if (myDet->enableDataStreamingFromReceiver(0) != 0) {
|
||||
return string("could not disable data streaming in receiver\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(myDet->acquire() == FAIL)
|
||||
return string("acquire unsuccessful");
|
||||
if(r_online){
|
||||
@ -2495,18 +2502,11 @@ string slsDetectorCommand::cmdDataStream(int narg, char *args[], int action) {
|
||||
|
||||
if (action==PUT_ACTION) {
|
||||
if (!sscanf(args[1],"%d",&ival))
|
||||
return string ("cannot scan externalgui mode");
|
||||
myDet->setExternalGuiFlag(ival>0?true:false);
|
||||
return string ("cannot scan rx_datastream mode");
|
||||
myDet->enableDataStreamingFromReceiver(ival);
|
||||
}
|
||||
|
||||
int retval = myDet->getExternalGuiFlag();
|
||||
//if external gui on and datastreaming off
|
||||
if (retval && !myDet->enableDataStreamingFromReceiver()) {
|
||||
retval=-1;
|
||||
printf("Error: data streaming in receiver is switched off while external gui flag in shared memory is off.\n");
|
||||
}
|
||||
sprintf(ans,"%d",myDet->getExternalGuiFlag());
|
||||
sprintf(ans,"%d",myDet->enableDataStreamingFromReceiver());
|
||||
return string(ans);
|
||||
}
|
||||
|
||||
@ -2515,9 +2515,9 @@ string slsDetectorCommand::helpDataStream(int narg, char *args[], int action) {
|
||||
|
||||
ostringstream os;
|
||||
if (action==GET_ACTION || action==HELP_ACTION)
|
||||
os << string("externalgui \t gets external gui flag. 1/0 means the 0MQ data stream (0MQ threads created) from receiver to client is enabled/disabled. -1 for inconsistency. \n");
|
||||
os << string("rx_datastream \t enables/disables data streaming from receiver. 1 is 0MQ data stream from receiver enabled, while 0 is 0MQ disabled. -1 for inconsistency between multiple receivers. \n");
|
||||
if (action==PUT_ACTION || action==HELP_ACTION)
|
||||
os << string("externalgui i\t sets external gui flag. 1/0 means the 0MQ data stream (0MQ threads created) from receiver to client is enabled/disabled. \n");
|
||||
os << string("rx_datastream i\t enables/disables data streaming from receiver. i is 1 enables 0MQ data stream from receiver (creates streamer threads), while 0 disables (destroys streamer threads). \n");
|
||||
return os.str();
|
||||
}
|
||||
|
||||
@ -3958,13 +3958,21 @@ string slsDetectorCommand::cmdNetworkParameter(int narg, char *args[], int actio
|
||||
return ("cannot parse argument") + string(args[1]);
|
||||
}
|
||||
}else if (cmd=="zmqport") {
|
||||
t=CLIENT_STREAMING_PORT;
|
||||
if (action==PUT_ACTION){
|
||||
if (!(sscanf(args[1],"%d",&i)))
|
||||
return ("cannot parse argument") + string(args[1]);
|
||||
}
|
||||
}else if (cmd=="rx_zmqport") {
|
||||
t=RECEIVER_STREAMING_PORT;
|
||||
if (action==PUT_ACTION){
|
||||
if (!(sscanf(args[1],"%d",&i)))
|
||||
return ("cannot parse argument") + string(args[1]);
|
||||
}
|
||||
}else if (cmd=="zmqsrcip") {
|
||||
t=RECEIVER_STREAMING_SRC_IP;
|
||||
}else if (cmd=="zmqip") {
|
||||
t=CLIENT_STREAMING_SRC_IP;
|
||||
}else if (cmd=="rx_zmqip") {
|
||||
t=RECEIVER_STREAMING_SRC_IP;
|
||||
}
|
||||
else return ("unknown network parameter")+cmd;
|
||||
|
||||
@ -3991,8 +3999,16 @@ 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_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 zmq port (data from receiver to client); setting via multidetector command calculates port for individual detectors"<< std::endl;
|
||||
os << "zmqsrcip ip \n sets/gets the 0MQ (TCP) ip of the receiver from where data is streamed to the client. Default is ip of rx_hostname. Use this only with external gui." << 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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
}
|
||||
if (action==GET_ACTION || action==HELP_ACTION) {
|
||||
os << "detectormac \n gets detector mac "<< std::endl;
|
||||
@ -4005,8 +4021,10 @@ string slsDetectorCommand::helpNetworkParameter(int narg, char *args[], int acti
|
||||
os << "txndelay_right \n gets detector transmission delay of the right port"<< std::endl;
|
||||
os << "txndelay_frame \n gets detector transmission delay of the entire frame"<< std::endl;
|
||||
os << "flowcontrol_10g \n gets flow control for 10g for eiger"<< std::endl;
|
||||
os << "zmqport \n gets zmq port (data from receiver to client)"<< std::endl;
|
||||
os << "zmqsrcip \n gets zmq source ip (data from receiver to client), none if default setting and no custom ip" << std::endl;
|
||||
os << "zmqport \n gets the 0MQ (TCP) port of the client to where final data is streamed to"<< std::endl;
|
||||
os << "rx_zmqport \n gets the 0MQ (TCP) port of the receiver from where data is streamed from"<< std::endl;
|
||||
os << "zmqip \n gets the 0MQ (TCP) ip of the client to where final data is streamed to.If no custom ip, empty until first time connect to receiver" << std::endl;
|
||||
os << "rx_zmqip \n gets/gets the 0MQ (TCP) ip of the receiver from where data is streamed from. If no custom ip, empty until first time connect to receiver" << std::endl;
|
||||
}
|
||||
return os.str();
|
||||
|
||||
@ -5916,33 +5934,14 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) {
|
||||
|
||||
|
||||
myDet->setOnline(ONLINE_FLAG);
|
||||
int receivers = myDet->setReceiverOnline(ONLINE_FLAG);
|
||||
myDet->setReceiverOnline(ONLINE_FLAG);
|
||||
|
||||
if(cmd=="receiver"){
|
||||
if (action==PUT_ACTION) {
|
||||
if(!strcasecmp(args[1],"start")) {
|
||||
//to ensure data streaming enable is the same across client and receiver
|
||||
if ((!myDet->getExternalGuiFlag()) && (receivers == ONLINE_FLAG)) {
|
||||
//if it was not off
|
||||
if (myDet->enableDataStreamingFromReceiver(-1) != 0){
|
||||
//switch it off, if error
|
||||
if (myDet->enableDataStreamingFromReceiver(0) != 0) {
|
||||
return string("could not disable data streaming in receiver\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!strcasecmp(args[1],"start"))
|
||||
myDet->startReceiver();
|
||||
}
|
||||
else if(!strcasecmp(args[1],"stop")){
|
||||
//myDet->stopReceiver();
|
||||
// myDet->startReceiverReadout();
|
||||
/*runStatus s = myDet->getReceiverStatus();
|
||||
while(s != RUN_FINISHED){
|
||||
usleep(50000);
|
||||
s = myDet->getReceiverStatus();
|
||||
}*/
|
||||
else if(!strcasecmp(args[1],"stop"))
|
||||
myDet->stopReceiver();
|
||||
}
|
||||
else
|
||||
return helpReceiver(narg, args, action);
|
||||
}
|
||||
|
@ -227,6 +227,18 @@ int slsDetectorUsers::enableDataStreamingFromReceiver(int i){
|
||||
return myDetector->enableDataStreamingFromReceiver(i);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::enableDataStreamingToClient(int i){
|
||||
return myDetector->enableDataStreamingToClient(i);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setReceiverDataStreamingOutPort(int i){
|
||||
return myDetector->setReceiverDataStreamingOutPort(i);
|
||||
}
|
||||
|
||||
int slsDetectorUsers::setClientDataStreamingInPort(int i){
|
||||
return myDetector->setClientDataStreamingInPort(i);
|
||||
}
|
||||
|
||||
int64_t slsDetectorUsers::getModuleFirmwareVersion(){
|
||||
return myDetector->getModuleFirmwareVersion();
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ class slsDetectorUsers
|
||||
|
||||
/**
|
||||
@short enable/disable count rate corrections
|
||||
\param i 0 disables, 1 enable, -1 gets
|
||||
\param i 0 disables, 1 enables with default values, -1 gets
|
||||
\returns 0 if count corrections disabled, 1 if enabled
|
||||
*/
|
||||
int enableCountRateCorrection(int i=-1);
|
||||
@ -439,13 +439,34 @@ class slsDetectorUsers
|
||||
virtual void finalizeDataset(double *a, double *v, double *e, int &np);
|
||||
|
||||
|
||||
/**
|
||||
Enable data streaming from receiver (zmq)
|
||||
\param i 1 to set, 0 to reset and -1 to get
|
||||
\returns data streaming enable
|
||||
*/
|
||||
/** Enable or disable streaming data from receiver (creates transmitting sockets)
|
||||
* @param enable 0 to disable 1 to enable -1 to only get the value
|
||||
* @returns data streaming from receiver enable
|
||||
*/
|
||||
int enableDataStreamingFromReceiver(int i=-1);
|
||||
|
||||
/**
|
||||
* Enable data streaming to client (creates receiving sockets)
|
||||
* @param i 0 to disable, 1 to enable, -1 to get the value
|
||||
* @returns data streaming to client enable
|
||||
*/
|
||||
int enableDataStreamingToClient(int i=-1);
|
||||
|
||||
/**
|
||||
* Set/Get receiver streaming out ZMQ port
|
||||
* For multi modules, it calculates (increments) and sets the ports
|
||||
* @param i sets, -1 gets
|
||||
* @returns receiver streaming out ZMQ port ()
|
||||
*/
|
||||
int setReceiverDataStreamingOutPort(int i=-1);
|
||||
|
||||
/**
|
||||
* Set/Get client streaming in ZMQ port
|
||||
* For multi modules, it calculates (increments) and sets the ports
|
||||
* @param i sets, -1 gets
|
||||
* @returns client streaming in ZMQ port
|
||||
*/
|
||||
int setClientDataStreamingInPort(int i=-1);
|
||||
|
||||
/**
|
||||
get get Module Firmware Version
|
||||
|
@ -30,6 +30,7 @@ extern "C" {
|
||||
#include <queue>
|
||||
#include <math.h>
|
||||
#include <semaphore.h>
|
||||
#include <cstdlib>
|
||||
using namespace std;
|
||||
|
||||
|
||||
@ -98,8 +99,33 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing {
|
||||
|
||||
int enableFlatFieldCorrection(int i=-1) {if (i>0) setFlatFieldCorrectionFile("default"); else if (i==0) setFlatFieldCorrectionFile(""); return getFlatFieldCorrection();};
|
||||
int enablePixelMaskCorrection(int i=-1) {if (i>0) setBadChannelCorrection("default"); else if (i==0) setBadChannelCorrection(""); return getBadChannelCorrection();};
|
||||
int enableCountRateCorrection(int i=-1) {if (i>0) setRateCorrection(i); else if (i==0) setRateCorrection(0); return getRateCorrection();};
|
||||
// string getFilePath(){return fileIO::getFilePath();};;
|
||||
int enableCountRateCorrection(int i=-1) {if (i>0) setRateCorrection(-1); else if (i==0) setRateCorrection(0); return getRateCorrection();};
|
||||
|
||||
|
||||
/**
|
||||
* Set/Get receiver streaming out ZMQ port
|
||||
* For multi modules, it calculates (increments) and sets the ports
|
||||
* @param i sets, -1 gets
|
||||
* @returns receiver streaming out ZMQ port
|
||||
*/
|
||||
int setReceiverDataStreamingOutPort(int i) { \
|
||||
if (i >= 0) { ostringstream ss; ss << i; string s = ss.str(); \
|
||||
setNetworkParameter(RECEIVER_STREAMING_PORT, s);} \
|
||||
return atoi(getNetworkParameter(RECEIVER_STREAMING_PORT).c_str());}; \
|
||||
|
||||
/**
|
||||
* Set/Get client streaming in ZMQ port
|
||||
* For multi modules, it calculates (increments) and sets the ports
|
||||
* @param i sets, -1 gets
|
||||
* @returns client streaming in ZMQ port
|
||||
*/
|
||||
int setClientDataStreamingInPort(int i){ \
|
||||
if (i >= 0) { ostringstream ss; ss << i; string s = ss.str(); \
|
||||
setNetworkParameter(CLIENT_STREAMING_PORT, s);} \
|
||||
return atoi(getNetworkParameter(CLIENT_STREAMING_PORT).c_str());}; \
|
||||
|
||||
|
||||
// string getFilePath(){return fileIO::getFilePath();};;
|
||||
// string setFilePath(string s){return fileIO::setFilePath(s);};
|
||||
|
||||
// string getFileName(){return fileIO::getFileName();};
|
||||
@ -760,9 +786,9 @@ virtual ROI* getROI(int &n)=0;
|
||||
*/
|
||||
virtual int setReadReceiverFrequency(int getFromReceiver, int freq=-1)=0;
|
||||
|
||||
/** Enable or disable streaming of data from receiver to client
|
||||
* @param enable 0 to disable 1 to enable -1 to only get the value
|
||||
* @returns data streaming
|
||||
/** Enable or disable streaming data from receiver to client
|
||||
* @param enable 0 to disable 1 to enable -1 to only get the value
|
||||
* @returns data streaming from receiver enable
|
||||
*/
|
||||
virtual int enableDataStreamingFromReceiver(int enable=-1)=0;
|
||||
|
||||
|
Reference in New Issue
Block a user