mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 19:30:03 +02:00
conflict resolution with developer
This commit is contained in:
commit
e54767b69d
@ -33,10 +33,12 @@ class BinaryFile : private virtual slsReceiverDefs, public File, public BinaryFi
|
||||
* @param nf pointer to number of images in acquisition
|
||||
* @param dr pointer to dynamic range
|
||||
* @param portno pointer to udp port number for logging
|
||||
* @param smode pointer to silent mode
|
||||
*/
|
||||
BinaryFile(int ind, uint32_t maxf, const uint32_t* ppf,
|
||||
int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable,
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno);
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno,
|
||||
bool* smode);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
|
@ -64,6 +64,12 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
||||
*/
|
||||
static void ResetRunningMask();
|
||||
|
||||
/**
|
||||
* Set Silent Mode
|
||||
* @param mode 1 sets 0 unsets
|
||||
*/
|
||||
static void SetSilentMode(bool mode);
|
||||
|
||||
//*** non static functions ***
|
||||
//*** getters ***
|
||||
/**
|
||||
@ -284,6 +290,9 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
||||
/** Fifo structure */
|
||||
Fifo* fifo;
|
||||
|
||||
/** Silent Mode */
|
||||
static bool SilentMode;
|
||||
|
||||
|
||||
//individual members
|
||||
/** File writer implemented as binary or hdf5 File */
|
||||
|
@ -51,6 +51,12 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
|
||||
*/
|
||||
static void ResetRunningMask();
|
||||
|
||||
/**
|
||||
* Set Silent Mode
|
||||
* @param mode 1 sets 0 unsets
|
||||
*/
|
||||
static void SetSilentMode(bool mode);
|
||||
|
||||
//*** non static functions ***
|
||||
//*** getters ***
|
||||
|
||||
@ -181,6 +187,11 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
|
||||
/** Fifo structure */
|
||||
Fifo* fifo;
|
||||
|
||||
/** Silent Mode */
|
||||
static bool SilentMode;
|
||||
|
||||
|
||||
|
||||
/** ZMQ Socket - Receiver to Client */
|
||||
ZmqSocket* zmqSocket;
|
||||
|
||||
|
@ -33,10 +33,12 @@ class File : private virtual slsReceiverDefs {
|
||||
* @param nf pointer to number of images in acquisition
|
||||
* @param dr pointer to dynamic range
|
||||
* @param portno pointer to udp port number for logging
|
||||
* @param smode pointer to silent mode
|
||||
*/
|
||||
File(int ind, uint32_t maxf, const uint32_t* ppf,
|
||||
int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable,
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno);
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno,
|
||||
bool* smode);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
@ -213,5 +215,8 @@ class File : private virtual slsReceiverDefs {
|
||||
/** UDP Port Number for logging */
|
||||
uint32_t* udpPortNumber;
|
||||
|
||||
/** Silent Mode */
|
||||
bool silentMode;
|
||||
|
||||
};
|
||||
|
||||
|
@ -41,11 +41,13 @@ class HDF5File : private virtual slsReceiverDefs, public File, public HDF5FileSt
|
||||
* @param portno pointer to udp port number for logging
|
||||
* @param nx number of pixels in x direction
|
||||
* @param ny number of pixels in y direction
|
||||
* @param smode pointer to silent mode
|
||||
*/
|
||||
HDF5File(int ind, uint32_t maxf, const uint32_t* ppf,
|
||||
int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable,
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno,
|
||||
uint32_t nx, uint32_t ny);
|
||||
uint32_t nx, uint32_t ny,
|
||||
bool* smode);
|
||||
|
||||
/**
|
||||
* Destructor
|
||||
|
@ -57,6 +57,12 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
||||
*/
|
||||
static void ResetRunningMask();
|
||||
|
||||
/**
|
||||
* Set Silent Mode
|
||||
* @param mode 1 sets 0 unsets
|
||||
*/
|
||||
static void SetSilentMode(bool mode);
|
||||
|
||||
|
||||
//*** non static functions ***
|
||||
//*** getters ***
|
||||
@ -217,6 +223,9 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
||||
/** Fifo structure */
|
||||
Fifo* fifo;
|
||||
|
||||
/** Silent Mode */
|
||||
static bool SilentMode;
|
||||
|
||||
|
||||
// individual members
|
||||
/** Detector Type */
|
||||
@ -258,7 +267,7 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
||||
uint64_t firstMeasurementIndex;
|
||||
|
||||
|
||||
// for statistics
|
||||
// for acquisition summary
|
||||
/** Number of complete Packets caught for each real time acquisition (eg. for each scan (start& stop of receiver)) */
|
||||
volatile uint64_t numPacketsCaught;
|
||||
|
||||
@ -287,8 +296,12 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
||||
/** if the udp socket is connected */
|
||||
bool udpSocketAlive;
|
||||
|
||||
|
||||
// for print progress during acqusition
|
||||
/** number of packets for statistic */
|
||||
uint32_t numPacketsStatistic;
|
||||
|
||||
/** number of images for statistic */
|
||||
uint32_t numFramesStatistic;
|
||||
};
|
||||
|
||||
|
@ -245,6 +245,12 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
||||
*/
|
||||
runStatus getStatus() const;
|
||||
|
||||
/**
|
||||
* Get Silent Mode
|
||||
* @return silent mode
|
||||
*/
|
||||
uint32_t getSilentMode() const;
|
||||
|
||||
/**
|
||||
* Get activate
|
||||
* If deactivated, receiver will write dummy packets 0xFF
|
||||
@ -456,6 +462,12 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
||||
*/
|
||||
int setFifoDepth(const uint32_t i);
|
||||
|
||||
//***receiver parameters***
|
||||
/**
|
||||
* Set Silent Mode
|
||||
* @param i silent mode. 1 sets, 0 unsets
|
||||
*/
|
||||
void setSilentMode(const uint32_t i);
|
||||
|
||||
/*************************************************************************
|
||||
* Behavioral functions***************************************************
|
||||
@ -671,6 +683,11 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
||||
/** streaming port */
|
||||
char streamingSrcIP[MAX_STR_LENGTH];
|
||||
|
||||
//***receiver parameters***
|
||||
uint32_t silentMode;
|
||||
|
||||
|
||||
|
||||
//***callback parameters***
|
||||
/**
|
||||
* Call back for start acquisition
|
||||
|
@ -331,6 +331,12 @@ class UDPInterface {
|
||||
*/
|
||||
virtual slsReceiverDefs::runStatus getStatus() const = 0;
|
||||
|
||||
/**
|
||||
* Get Silent Mode
|
||||
* @return silent mode
|
||||
*/
|
||||
virtual uint32_t getSilentMode() const = 0;
|
||||
|
||||
/**
|
||||
* Get activate
|
||||
* If deactivated, receiver will write dummy packets 0xFF
|
||||
@ -543,6 +549,14 @@ class UDPInterface {
|
||||
virtual int setFifoDepth(const uint32_t i) = 0;
|
||||
|
||||
|
||||
//***receiver parameters***
|
||||
/**
|
||||
* Set Silent Mode
|
||||
* @param i silent mode. 1 sets, 0 unsets
|
||||
*/
|
||||
virtual void setSilentMode(const uint32_t i) = 0;
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* Behavioral functions***************************************************
|
||||
* They may modify the status of the receiver ****************************
|
||||
|
@ -115,6 +115,12 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
|
||||
*/
|
||||
int setFifoDepth(const uint32_t i);
|
||||
|
||||
/**
|
||||
* Set Silent Mode
|
||||
* @param i silent mode. 1 sets, 0 unsets
|
||||
*/
|
||||
void setSilentMode(const uint32_t i);
|
||||
|
||||
/**
|
||||
* Set receiver type (and corresponding detector variables in derived STANDARD class)
|
||||
* It is the first function called by the client when connecting to receiver
|
||||
|
@ -261,6 +261,9 @@ class slsReceiverTCPIPInterface : private virtual slsReceiverDefs {
|
||||
/** set streaming source ip */
|
||||
int set_streaming_source_ip();
|
||||
|
||||
/** set silent mode */
|
||||
int set_silent_mode();
|
||||
|
||||
/** enable gap pixels */
|
||||
int enable_gap_pixels();
|
||||
|
||||
|
@ -60,6 +60,7 @@ enum recFuncs{
|
||||
F_SEND_RECEIVER_MULTIDETSIZE, /** < sets the multi detector size to the receiver */
|
||||
F_SET_RECEIVER_STREAMING_PORT, /** < sets the receiver streaming port */
|
||||
F_RECEIVER_STREAMING_SRC_IP, /** < sets the receiver streaming source IP */
|
||||
F_SET_RECEIVER_SILENT_MODE, /** < sets the receiver silent mode */
|
||||
F_ENABLE_GAPPIXELS_IN_RECEIVER, /** < sets gap pixels in the receiver */
|
||||
/* Always append functions hereafter!!! */
|
||||
|
||||
|
@ -16,9 +16,9 @@ FILE* BinaryFile::masterfd = 0;
|
||||
|
||||
BinaryFile::BinaryFile(int ind, uint32_t maxf, const uint32_t* ppf,
|
||||
int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable,
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno):
|
||||
|
||||
File(ind, maxf, ppf, nd, fname, fpath, findex, owenable, dindex, nunits, nf, dr, portno),
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno,
|
||||
bool* smode):
|
||||
File(ind, maxf, ppf, nd, fname, fpath, findex, owenable, dindex, nunits, nf, dr, portno, smode),
|
||||
filefd(0),
|
||||
numFramesInFile(0),
|
||||
numActualPacketsInFile(0)
|
||||
@ -53,7 +53,8 @@ int BinaryFile::CreateFile(uint64_t fnum) {
|
||||
if (BinaryFileStatic::CreateDataFile(filefd, *overWriteEnable, currentFileName, FILE_BUFFER_SIZE) == FAIL)
|
||||
return FAIL;
|
||||
|
||||
FILE_LOG(logINFO) << "[" << *udpPortNumber << "]: Binary File created: " << currentFileName;
|
||||
if(!silentMode)
|
||||
FILE_LOG(logINFO) << "[" << *udpPortNumber << "]: Binary File created: " << currentFileName;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -89,7 +90,8 @@ int BinaryFile::CreateMasterFile(bool en, uint32_t size,
|
||||
|
||||
if (master && (*detIndex==0)) {
|
||||
masterFileName = BinaryFileStatic::CreateMasterFileName(filePath, fileNamePrefix, *fileIndex);
|
||||
FILE_LOG(logINFO) << "Master File: " << masterFileName;
|
||||
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);
|
||||
|
@ -30,6 +30,8 @@ uint64_t DataProcessor::RunningMask(0x0);
|
||||
|
||||
pthread_mutex_t DataProcessor::Mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
bool DataProcessor::SilentMode(false);
|
||||
|
||||
|
||||
DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool* fwenable, bool* dsEnable,
|
||||
uint32_t* freq, uint32_t* timer,
|
||||
@ -90,6 +92,10 @@ void DataProcessor::ResetRunningMask() {
|
||||
RunningMask = 0x0;
|
||||
}
|
||||
|
||||
void DataProcessor::SetSilentMode(bool mode) {
|
||||
SilentMode = mode;
|
||||
}
|
||||
|
||||
/** non static functions */
|
||||
/** getters */
|
||||
string DataProcessor::GetType(){
|
||||
@ -237,13 +243,13 @@ void DataProcessor::SetupFileWriter(int* nd, char* fname, char* fpath, uint64_t*
|
||||
file = new HDF5File(index, generalData->maxFramesPerFile, &generalData->packetsPerFrame,
|
||||
nd, fname, fpath, findex, owenable,
|
||||
dindex, nunits, nf, dr, portno,
|
||||
generalData->nPixelsX, generalData->nPixelsY);
|
||||
generalData->nPixelsX, generalData->nPixelsY, &SilentMode);
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
file = new BinaryFile(index, generalData->maxFramesPerFile, &generalData->packetsPerFrame,
|
||||
nd, fname, fpath, findex, owenable,
|
||||
dindex, nunits, nf, dr, portno);
|
||||
dindex, nunits, nf, dr, portno, &SilentMode);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,8 @@ uint64_t DataStreamer::RunningMask(0x0);
|
||||
|
||||
pthread_mutex_t DataStreamer::Mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
bool DataStreamer::SilentMode(false);
|
||||
|
||||
|
||||
DataStreamer::DataStreamer(Fifo*& f, uint32_t* dr, int* sEnable) :
|
||||
ThreadObject(NumberofDataStreamers),
|
||||
@ -71,6 +73,11 @@ void DataStreamer::ResetRunningMask() {
|
||||
RunningMask = 0x0;
|
||||
}
|
||||
|
||||
void DataStreamer::SetSilentMode(bool mode) {
|
||||
SilentMode = mode;
|
||||
}
|
||||
|
||||
|
||||
/** non static functions */
|
||||
/** getters */
|
||||
string DataStreamer::GetType(){
|
||||
|
@ -12,7 +12,8 @@ using namespace std;
|
||||
|
||||
File::File(int ind, uint32_t maxf, const uint32_t* ppf,
|
||||
int* nd, char* fname, char* fpath, uint64_t* findex, bool* owenable,
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno):
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno,
|
||||
bool* smode):
|
||||
index(ind),
|
||||
maxFramesPerFile(maxf),
|
||||
packetsPerFrame(ppf),
|
||||
@ -26,7 +27,8 @@ File::File(int ind, uint32_t maxf, const uint32_t* ppf,
|
||||
numUnitsPerDetector(nunits),
|
||||
numImages(nf),
|
||||
dynamicRange(dr),
|
||||
udpPortNumber(portno)
|
||||
udpPortNumber(portno),
|
||||
silentMode(smode)
|
||||
|
||||
{
|
||||
master = index?false:true;
|
||||
@ -56,7 +58,8 @@ void File::PrintMembers() {
|
||||
<< "Dynamic Range: " << *dynamicRange << endl
|
||||
<< "UDP Port number: " << *udpPortNumber << endl
|
||||
<< "Master File Name: " << masterFileName << endl
|
||||
<< "Current File Name: " << currentFileName;
|
||||
<< "Current File Name: " << currentFileName << endl
|
||||
<< "Silent Mode: " << silentMode;
|
||||
}
|
||||
|
||||
|
||||
|
@ -25,9 +25,10 @@ HDF5File::HDF5File(int ind, uint32_t maxf, const uint32_t* ppf,
|
||||
int* nd, char* fname, char* fpath, uint64_t* findex,
|
||||
bool* frindexenable, bool* owenable,
|
||||
int* dindex, int* nunits, uint64_t* nf, uint32_t* dr, uint32_t* portno,
|
||||
uint32_t nx, uint32_t ny):
|
||||
uint32_t nx, uint32_t ny,
|
||||
bool* smode):
|
||||
|
||||
File(ind, maxf, ppf, nd, fname, fpath, findex, frindexenable, owenable, dindex, nunits, nf, dr, portno),
|
||||
File(ind, maxf, ppf, nd, fname, fpath, findex, frindexenable, owenable, dindex, nunits, nf, dr, portno, smode),
|
||||
filefd(0),
|
||||
dataspace(0),
|
||||
dataset(0),
|
||||
@ -110,7 +111,8 @@ int HDF5File::CreateFile(uint64_t fnum) {
|
||||
if (dataspace == NULL)
|
||||
bprintf(RED,"Got nothing!\n");
|
||||
|
||||
FILE_LOG(logINFO) << *udpPortNumber << ": HDF5 File created: " << currentFileName;
|
||||
if(!silentMode)
|
||||
FILE_LOG(logINFO) << *udpPortNumber << ": HDF5 File created: " << currentFileName;
|
||||
|
||||
return OK;
|
||||
}
|
||||
@ -171,7 +173,8 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size,
|
||||
if (master && (*detIndex==0)) {
|
||||
virtualfd = 0;
|
||||
masterFileName = HDF5FileStatic::CreateMasterFileName(filePath, fileNamePrefix, *fileIndex);
|
||||
FILE_LOG(logINFO) << "Master File: " << masterFileName;
|
||||
if(!silentMode)
|
||||
FILE_LOG(logINFO) << "Master File: " << masterFileName;
|
||||
pthread_mutex_lock(&Mutex);
|
||||
int ret = HDF5FileStatic::CreateMasterDataFile(masterfd, masterFileName, *overWriteEnable,
|
||||
*dynamicRange, en, size, nx, ny, *numImages, at, st, ap, HDF5_WRITER_VERSION);
|
||||
|
@ -26,6 +26,8 @@ uint64_t Listener::RunningMask(0x0);
|
||||
|
||||
pthread_mutex_t Listener::Mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
bool Listener::SilentMode(false);
|
||||
|
||||
|
||||
Listener::Listener(detectorType dtype, Fifo*& f, runStatus* s, uint32_t* portno, char* e, int* act, uint64_t* nf, uint32_t* dr) :
|
||||
ThreadObject(NumberofListeners),
|
||||
@ -93,6 +95,9 @@ void Listener::ResetRunningMask() {
|
||||
RunningMask = 0x0;
|
||||
}
|
||||
|
||||
void Listener::SetSilentMode(bool mode) {
|
||||
SilentMode = mode;
|
||||
}
|
||||
|
||||
/** non static functions */
|
||||
/** getters */
|
||||
@ -183,10 +188,13 @@ void Listener::RecordFirstIndices(uint64_t fnum) {
|
||||
acquisitionStartedFlag = true;
|
||||
firstAcquisitionIndex = fnum;
|
||||
}
|
||||
if (!index) bprintf(BLUE,"%d First Acquisition Index:%lu\n"
|
||||
"%d First Measurement Index:%lu\n",
|
||||
index, firstAcquisitionIndex,
|
||||
index, firstMeasurementIndex);
|
||||
|
||||
if(!SilentMode) {
|
||||
if (!index) bprintf(BLUE,"%d First Acquisition Index:%lu\n"
|
||||
"%d First Measurement Index:%lu\n",
|
||||
index, firstAcquisitionIndex,
|
||||
index, firstMeasurementIndex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -299,9 +307,11 @@ void Listener::ThreadExecution() {
|
||||
fifo->PushAddress(buffer);
|
||||
|
||||
//Statistics
|
||||
numFramesStatistic++;
|
||||
if (numFramesStatistic >= generalData->maxFramesPerFile)
|
||||
PrintFifoStatistics();
|
||||
if(!SilentMode) {
|
||||
numFramesStatistic++;
|
||||
if (numFramesStatistic >= generalData->maxFramesPerFile)
|
||||
PrintFifoStatistics();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -82,6 +82,10 @@ void UDPBaseImplementation::initializeMembers(){
|
||||
dataStreamEnable = false;
|
||||
streamingPort = 0;
|
||||
memset(streamingSrcIP, 0, sizeof(streamingSrcIP));
|
||||
|
||||
//***receiver parameters***
|
||||
silentMode = 0;
|
||||
|
||||
}
|
||||
|
||||
UDPBaseImplementation::~UDPBaseImplementation(){}
|
||||
@ -212,6 +216,8 @@ uint32_t UDPBaseImplementation::getFifoDepth() const{ FILE_LOG(logDEBUG) << __AT
|
||||
/***receiver status***/
|
||||
slsReceiverDefs::runStatus UDPBaseImplementation::getStatus() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; return status;}
|
||||
|
||||
uint32_t UDPBaseImplementation::getSilentMode() const{ FILE_LOG(logDEBUG) << __AT__ << " starting"; return silentMode;}
|
||||
|
||||
int UDPBaseImplementation::getActivate() const{FILE_LOG(logDEBUG) << __AT__ << " starting"; return activated;}
|
||||
|
||||
uint32_t UDPBaseImplementation::getStreamingPort() const{FILE_LOG(logDEBUG) << __AT__ << " starting"; return streamingPort;}
|
||||
@ -491,6 +497,14 @@ int UDPBaseImplementation::setFifoDepth(const uint32_t i){
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***receiver parameters***/
|
||||
void UDPBaseImplementation::setSilentMode(const uint32_t i){
|
||||
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
||||
|
||||
silentMode = i;
|
||||
FILE_LOG(logINFO) << "Silent Mode: " << i;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* Behavioral functions***************************************************
|
||||
* They may modify the status of the receiver ****************************
|
||||
|
@ -292,6 +292,16 @@ int UDPStandardImplementation::setFifoDepth(const uint32_t i) {
|
||||
}
|
||||
|
||||
|
||||
void UDPStandardImplementation::setSilentMode(const uint32_t i){
|
||||
silentMode = i;
|
||||
|
||||
Listener::SetSilentMode(i);
|
||||
DataProcessor::SetSilentMode(i);
|
||||
DataStreamer::SetSilentMode(i);
|
||||
|
||||
FILE_LOG(logINFO) << "Silent Mode: " << i;
|
||||
}
|
||||
|
||||
|
||||
int UDPStandardImplementation::setDetectorType(const detectorType d) {
|
||||
FILE_LOG (logDEBUG) << "Setting receiver type";
|
||||
@ -357,9 +367,8 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) {
|
||||
//set up writer and callbacks
|
||||
for (vector<Listener*>::const_iterator it = listener.begin(); it != listener.end(); ++it)
|
||||
(*it)->SetGeneralData(generalData);
|
||||
for (vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it) {
|
||||
for (vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it)
|
||||
(*it)->SetGeneralData(generalData);
|
||||
}
|
||||
|
||||
SetThreadPriorities();
|
||||
|
||||
|
@ -279,6 +279,8 @@ const char* slsReceiverTCPIPInterface::getFunctionName(enum recFuncs func) {
|
||||
case F_SET_RECEIVER_FILE_FORMAT: return "F_SET_RECEIVER_FILE_FORMAT";
|
||||
case F_SEND_RECEIVER_DETPOSID: return "F_SEND_RECEIVER_DETPOSID";
|
||||
case F_SEND_RECEIVER_MULTIDETSIZE: return "F_SEND_RECEIVER_MULTIDETSIZE";
|
||||
case F_SET_RECEIVER_STREAMING_PORT: return "F_SET_RECEIVER_STREAMING_PORT";
|
||||
case F_SET_RECEIVER_SILENT_MODE: return "F_SET_RECEIVER_SILENT_MODE";
|
||||
case F_RECEIVER_STREAMING_SRC_IP: return "F_RECEIVER_STREAMING_SRC_IP";
|
||||
case F_ENABLE_GAPPIXELS_IN_RECEIVER:return "F_ENABLE_GAPPIXELS_IN_RECEIVER";
|
||||
|
||||
@ -326,8 +328,10 @@ int slsReceiverTCPIPInterface::function_table(){
|
||||
flist[F_SEND_RECEIVER_DETPOSID] = &slsReceiverTCPIPInterface::set_detector_posid;
|
||||
flist[F_SEND_RECEIVER_MULTIDETSIZE] = &slsReceiverTCPIPInterface::set_multi_detector_size;
|
||||
flist[F_SET_RECEIVER_STREAMING_PORT] = &slsReceiverTCPIPInterface::set_streaming_port;
|
||||
flist[F_SET_RECEIVER_SILENT_MODE] = &slsReceiverTCPIPInterface::set_silent_mode;
|
||||
flist[F_RECEIVER_STREAMING_SRC_IP] = &slsReceiverTCPIPInterface::set_streaming_source_ip;
|
||||
flist[F_ENABLE_GAPPIXELS_IN_RECEIVER] = &slsReceiverTCPIPInterface::enable_gap_pixels;
|
||||
|
||||
#ifdef VERYVERBOSE
|
||||
for (int i = 0; i < NUM_REC_FUNCTIONS ; i++) {
|
||||
FILE_LOG(logINFO) << "function fnum: " << i << " (" << getFunctionName((enum recFuncs)i) << ") located at " << (unsigned int)flist[i];
|
||||
@ -2327,6 +2331,7 @@ int slsReceiverTCPIPInterface::set_streaming_port() {
|
||||
|
||||
|
||||
|
||||
|
||||
int slsReceiverTCPIPInterface::set_streaming_source_ip() {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
@ -2370,6 +2375,57 @@ int slsReceiverTCPIPInterface::set_streaming_source_ip() {
|
||||
mySock->SendDataOnly(retval,MAX_STR_LENGTH);
|
||||
delete[] retval;
|
||||
|
||||
// return ok/fail
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int slsReceiverTCPIPInterface::set_silent_mode() {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int value = -1;
|
||||
int retval = -1;
|
||||
|
||||
// receive arguments
|
||||
if (mySock->ReceiveDataOnly(&value,sizeof(value)) < 0 )
|
||||
return printSocketReadError();
|
||||
|
||||
// execute action
|
||||
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
|
||||
if (receiverBase == NULL)
|
||||
invalidReceiverObject();
|
||||
else {
|
||||
// set
|
||||
if(value >= 0) {
|
||||
if (mySock->differentClients && lockStatus)
|
||||
receiverlocked();
|
||||
else if (receiverBase->getStatus() != IDLE)
|
||||
receiverNotIdle();
|
||||
else {
|
||||
receiverBase->setSilentMode(value); // no check required
|
||||
}
|
||||
}
|
||||
//get
|
||||
retval = receiverBase->getSilentMode(); // no check required
|
||||
}
|
||||
#endif
|
||||
#ifdef VERYVERBOSE
|
||||
FILE_LOG(logDEBUG1) << "silent mode:" << retval;
|
||||
#endif
|
||||
|
||||
if (ret == OK && mySock->differentClients)
|
||||
ret = FORCE_UPDATE;
|
||||
|
||||
// send answer
|
||||
mySock->SendDataOnly(&ret,sizeof(ret));
|
||||
if (ret == FAIL)
|
||||
mySock->SendDataOnly(mess,sizeof(mess));
|
||||
mySock->SendDataOnly(&retval,sizeof(retval));
|
||||
|
||||
// return ok/fail
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user