mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-27 16:50:02 +02:00
merge conflict from 3.0.1
This commit is contained in:
commit
1dee950870
@ -8,9 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "ansi.h"
|
||||
#include "sls_receiver_defs.h"
|
||||
|
||||
//#define ZMQ_DETAIL
|
||||
|
||||
#include <zmq.h>
|
||||
#include <errno.h>
|
||||
@ -21,7 +19,8 @@
|
||||
#include <unistd.h> //usleep in some machines
|
||||
using namespace rapidjson;
|
||||
|
||||
#define DEFAULT_ZMQ_PORTNO 30001
|
||||
|
||||
//#define ZMQ_DETAIL
|
||||
|
||||
class ZmqSocket {
|
||||
|
||||
|
@ -51,27 +51,21 @@ class sockaddr_in;
|
||||
#include <ifaddrs.h>
|
||||
|
||||
#endif
|
||||
#include <stdlib.h> /******exit */
|
||||
|
||||
#include <stdlib.h> /******exit */
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <iostream>
|
||||
|
||||
#include <math.h>
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define DEFAULT_PACKET_SIZE 1286
|
||||
/*#define SOCKET_BUFFER_SIZE (100*1024*1024) //100MB*/
|
||||
#define SOCKET_BUFFER_SIZE (2000*1024*1024) //100MB
|
||||
#define DEFAULT_PORTNO 1952
|
||||
#define DEFAULT_BACKLOG 5
|
||||
#define DEFAULT_UDP_PORTNO 50001
|
||||
#define DEFAULT_GUI_PORTNO 65000
|
||||
//#define DEFAULT_ZMQ_PORTNO defined in zmqSocket.h (40001)
|
||||
|
||||
|
||||
class genericSocket{
|
||||
|
||||
@ -109,7 +103,7 @@ enum communicationProtocol{
|
||||
struct addrinfo *result;
|
||||
if (!ConvertHostnameToInternetAddress(host_ip_or_name, &result)) {
|
||||
serverAddress.sin_family = result->ai_family;
|
||||
memcpy((char *) &serverAddress.sin_addr.s_addr, &((struct sockaddr_in *) result->ai_addr)->sin_addr, result->ai_addrlen);
|
||||
memcpy((char *) &serverAddress.sin_addr.s_addr, &((struct sockaddr_in *) result->ai_addr)->sin_addr, sizeof(in_addr_t));
|
||||
freeaddrinfo(result);
|
||||
serverAddress.sin_port = htons(port_number);
|
||||
socketDescriptor=0;
|
||||
|
@ -29,6 +29,13 @@ typedef int int32_t;
|
||||
|
||||
#define DEFAULT_STREAMING_TIMER_IN_MS 200
|
||||
|
||||
/** default ports */
|
||||
#define DEFAULT_PORTNO 1952
|
||||
#define DEFAULT_UDP_PORTNO 50001
|
||||
#define DEFAULT_GUI_PORTNO 65001
|
||||
#define DEFAULT_ZMQ_CL_PORTNO 30001
|
||||
#define DEFAULT_ZMQ_RX_PORTNO 30001
|
||||
|
||||
/**
|
||||
\file sls_receiver_defs.h
|
||||
This file contains all the basic definitions common to the slsReceiver class
|
||||
|
@ -53,8 +53,9 @@ int BinaryFile::CreateFile(uint64_t fnum) {
|
||||
if (BinaryFileStatic::CreateDataFile(filefd, *overWriteEnable, currentFileName, FILE_BUFFER_SIZE) == FAIL)
|
||||
return FAIL;
|
||||
|
||||
if(!silentMode)
|
||||
if(!silentMode) {
|
||||
FILE_LOG(logINFO) << "[" << *udpPortNumber << "]: Binary File created: " << currentFileName;
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -90,8 +91,9 @@ int BinaryFile::CreateMasterFile(bool en, uint32_t size,
|
||||
|
||||
if (master && (*detIndex==0)) {
|
||||
masterFileName = BinaryFileStatic::CreateMasterFileName(filePath, fileNamePrefix, *fileIndex);
|
||||
if(!silentMode)
|
||||
if(!silentMode) {
|
||||
FILE_LOG(logINFO) << "Master File: " << masterFileName;
|
||||
}
|
||||
return BinaryFileStatic::CreateMasterDataFile(masterfd, masterFileName, *overWriteEnable,
|
||||
*dynamicRange, en, size, nx, ny, *numImages,
|
||||
at, st, ap, BINARY_WRITER_VERSION);
|
||||
|
@ -585,11 +585,7 @@ int UDPBaseImplementation::setActivate(int enable){
|
||||
}
|
||||
|
||||
void UDPBaseImplementation::setStreamingPort(const uint32_t i) {
|
||||
|
||||
if (streamingPort == 0)
|
||||
streamingPort = DEFAULT_ZMQ_PORTNO + (detID * ((myDetectorType == EIGER) ? 2 : 1) ); // multiplied by 2 as eiger has 2 ports
|
||||
else
|
||||
streamingPort = i;
|
||||
streamingPort = i;
|
||||
|
||||
FILE_LOG(logINFO) << "Streaming Port: " << streamingPort;
|
||||
}
|
||||
|
@ -221,9 +221,6 @@ int UDPStandardImplementation::setDataStreamEnable(const bool enable) {\
|
||||
for ( int i = 0; i < numThreads; ++i ) {
|
||||
dataStreamer.push_back(new DataStreamer(fifo[i], &dynamicRange, &shortFrameEnable, &fileIndex));
|
||||
dataStreamer[i]->SetGeneralData(generalData);
|
||||
// check again
|
||||
if (streamingPort == 0)
|
||||
streamingPort = DEFAULT_ZMQ_PORTNO + (detID * ((myDetectorType == EIGER) ? 2 : 1) ); // multiplied by 2 as eiger has 2 ports
|
||||
if (dataStreamer[i]->CreateZmqSockets(&numThreads, streamingPort, streamingSrcIP) == FAIL) {
|
||||
error = true;
|
||||
break;
|
||||
|
@ -685,6 +685,11 @@ int slsReceiverTCPIPInterface::send_update() {
|
||||
#endif
|
||||
mySock->SendDataOnly(&ind,sizeof(ind));
|
||||
|
||||
// data streaming enable
|
||||
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
|
||||
ind=(int)receiverBase->getDataStreamEnable();
|
||||
#endif
|
||||
|
||||
// streaming source ip
|
||||
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
|
||||
path = receiverBase->getStreamingSourceIP();
|
||||
@ -2304,11 +2309,6 @@ int slsReceiverTCPIPInterface::set_streaming_port() {
|
||||
}
|
||||
//get
|
||||
retval=receiverBase->getStreamingPort();
|
||||
if(port > 0 && retval != port) { //if port = 0, its actual value calculated
|
||||
ret = FAIL;
|
||||
strcpy(mess, "Could not set streaming port\n");
|
||||
FILE_LOG(logERROR) << "Warning: " << mess;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifdef VERYVERBOSE
|
||||
|
Loading…
x
Reference in New Issue
Block a user