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