mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
client and receiver: silent mode put into shared memory, works properly now
This commit is contained in:
@ -751,6 +751,7 @@ void slsDetector::initializeDetectorStructure(detectorType type) {
|
|||||||
thisDetector->receiver_framePadding = 1;
|
thisDetector->receiver_framePadding = 1;
|
||||||
thisDetector->activated = true;
|
thisDetector->activated = true;
|
||||||
thisDetector->receiver_deactivatedPaddingEnable = true;
|
thisDetector->receiver_deactivatedPaddingEnable = true;
|
||||||
|
thisDetector->receiver_silentMode = false;
|
||||||
|
|
||||||
// get the detector parameters based on type
|
// get the detector parameters based on type
|
||||||
detParameterList detlist;
|
detParameterList detlist;
|
||||||
@ -5273,6 +5274,7 @@ string slsDetector::setReceiver(string receiverIP) {
|
|||||||
std::cout << "activated: " << thisDetector->activated << endl;
|
std::cout << "activated: " << thisDetector->activated << endl;
|
||||||
std::cout << "receiver deactivated padding: " << thisDetector->receiver_deactivatedPaddingEnable << endl;
|
std::cout << "receiver deactivated padding: " << thisDetector->receiver_deactivatedPaddingEnable << endl;
|
||||||
}
|
}
|
||||||
|
std::cout << "silent Mode:" << thisDetector->receiver_silentMode << endl;
|
||||||
std::cout << "10GbE:" << thisDetector->tenGigaEnable << endl;
|
std::cout << "10GbE:" << thisDetector->tenGigaEnable << endl;
|
||||||
std::cout << "Gap pixels: " << thisDetector->gappixels << endl;
|
std::cout << "Gap pixels: " << thisDetector->gappixels << endl;
|
||||||
std::cout << "rx streaming source ip:" << thisDetector->receiver_zmqip << endl;
|
std::cout << "rx streaming source ip:" << thisDetector->receiver_zmqip << endl;
|
||||||
@ -5321,6 +5323,7 @@ string slsDetector::setReceiver(string receiverIP) {
|
|||||||
activate(-1);
|
activate(-1);
|
||||||
setDeactivatedRxrPaddingMode(thisDetector->receiver_deactivatedPaddingEnable);
|
setDeactivatedRxrPaddingMode(thisDetector->receiver_deactivatedPaddingEnable);
|
||||||
}
|
}
|
||||||
|
setReceiverSilentMode(thisDetector->receiver_silentMode);
|
||||||
|
|
||||||
if(thisDetector->myDetectorType == EIGER)
|
if(thisDetector->myDetectorType == EIGER)
|
||||||
enableTenGigabitEthernet(thisDetector->tenGigaEnable);
|
enableTenGigabitEthernet(thisDetector->tenGigaEnable);
|
||||||
@ -8613,6 +8616,10 @@ int slsDetector::updateReceiverNoWait() {
|
|||||||
n += dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
|
n += dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
|
||||||
thisDetector->receiver_deactivatedPaddingEnable = ind;
|
thisDetector->receiver_deactivatedPaddingEnable = ind;
|
||||||
|
|
||||||
|
// silent mode
|
||||||
|
n += dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
|
||||||
|
thisDetector->receiver_silentMode = ind;
|
||||||
|
|
||||||
if (!n) printf("n: %d\n", n);
|
if (!n) printf("n: %d\n", n);
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
@ -9536,8 +9543,10 @@ int slsDetector::setReceiverSilentMode(int i) {
|
|||||||
}
|
}
|
||||||
if(ret==FAIL)
|
if(ret==FAIL)
|
||||||
setErrorMask((getErrorMask())|(RECEIVER_PARAMETER_NOT_SET));
|
setErrorMask((getErrorMask())|(RECEIVER_PARAMETER_NOT_SET));
|
||||||
|
else
|
||||||
|
thisDetector->receiver_silentMode = retval;
|
||||||
}
|
}
|
||||||
return retval;
|
return thisDetector->receiver_silentMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -381,6 +381,9 @@ private:
|
|||||||
/** padding enable in deactivated receiver */
|
/** padding enable in deactivated receiver */
|
||||||
bool receiver_deactivatedPaddingEnable;
|
bool receiver_deactivatedPaddingEnable;
|
||||||
|
|
||||||
|
/** silent receiver */
|
||||||
|
bool receiver_silentMode;
|
||||||
|
|
||||||
} sharedSlsDetector;
|
} sharedSlsDetector;
|
||||||
|
|
||||||
|
|
||||||
|
@ -37,6 +37,7 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
* @param fp pointer to frame padding enable
|
* @param fp pointer to frame padding enable
|
||||||
* @param act pointer to activated
|
* @param act pointer to activated
|
||||||
* @param depaden pointer to deactivated padding enable
|
* @param depaden pointer to deactivated padding enable
|
||||||
|
* @param sm pointer to silent mode
|
||||||
* @param dataReadycb pointer to data ready call back function
|
* @param dataReadycb pointer to data ready call back function
|
||||||
* @param dataModifyReadycb pointer to data ready call back function with modified
|
* @param dataModifyReadycb pointer to data ready call back function with modified
|
||||||
* @param pDataReadycb pointer to arguments of data ready call back function. To write/stream a smaller size of processed data, change this value (only smaller value is allowed).
|
* @param pDataReadycb pointer to arguments of data ready call back function. To write/stream a smaller size of processed data, change this value (only smaller value is allowed).
|
||||||
@ -44,7 +45,7 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
DataProcessor(int ind, detectorType dtype, Fifo*& f, fileFormat* ftype,
|
DataProcessor(int ind, detectorType dtype, Fifo*& f, fileFormat* ftype,
|
||||||
bool fwenable, bool* dsEnable, bool* gpEnable, uint32_t* dr,
|
bool fwenable, bool* dsEnable, bool* gpEnable, uint32_t* dr,
|
||||||
uint32_t* freq, uint32_t* timer,
|
uint32_t* freq, uint32_t* timer,
|
||||||
bool* fp, bool* act, bool* depaden,
|
bool* fp, bool* act, bool* depaden, bool* sm,
|
||||||
void (*dataReadycb)(char*, char*, uint32_t, void*),
|
void (*dataReadycb)(char*, char*, uint32_t, void*),
|
||||||
void (*dataModifyReadycb)(char*, char*, uint32_t &, void*),
|
void (*dataModifyReadycb)(char*, char*, uint32_t &, void*),
|
||||||
void *pDataReadycb);
|
void *pDataReadycb);
|
||||||
@ -202,11 +203,6 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
*/
|
*/
|
||||||
void SetPixelDimension();
|
void SetPixelDimension();
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Silent Mode
|
|
||||||
* @param mode 1 sets 0 unsets
|
|
||||||
*/
|
|
||||||
void SetSilentMode(bool mode);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -342,6 +338,11 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
/** Deactivated padding enable */
|
/** Deactivated padding enable */
|
||||||
bool* deactivatedPaddingEnable;
|
bool* deactivatedPaddingEnable;
|
||||||
|
|
||||||
|
/** Silent Mode */
|
||||||
|
bool* silentMode;
|
||||||
|
|
||||||
|
/** frame padding */
|
||||||
|
bool* framePadding;
|
||||||
|
|
||||||
//acquisition start
|
//acquisition start
|
||||||
/** Aquisition Started flag */
|
/** Aquisition Started flag */
|
||||||
@ -368,12 +369,6 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
uint64_t currentFrameIndex;
|
uint64_t currentFrameIndex;
|
||||||
|
|
||||||
|
|
||||||
/** Silent Mode */
|
|
||||||
bool silentMode;
|
|
||||||
|
|
||||||
/** frame padding */
|
|
||||||
bool* framePadding;
|
|
||||||
|
|
||||||
//call back
|
//call back
|
||||||
/**
|
/**
|
||||||
* Call back for raw data
|
* Call back for raw data
|
||||||
@ -385,7 +380,6 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
void (*rawDataReadyCallBack)(char*,
|
void (*rawDataReadyCallBack)(char*,
|
||||||
char*, uint32_t, void*);
|
char*, uint32_t, void*);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call back for raw data (modified)
|
* Call back for raw data (modified)
|
||||||
* args to raw data ready callback are
|
* args to raw data ready callback are
|
||||||
|
@ -27,8 +27,10 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
* @param fi pointer to file index
|
* @param fi pointer to file index
|
||||||
* @param fd flipped data enable for x and y dimensions
|
* @param fd flipped data enable for x and y dimensions
|
||||||
* @param ajh additional json header
|
* @param ajh additional json header
|
||||||
|
* @param sm pointer to silent mode
|
||||||
*/
|
*/
|
||||||
DataStreamer(int ind, Fifo*& f, uint32_t* dr, int* sEnable, uint64_t* fi, int* fd, char* ajh);
|
DataStreamer(int ind, Fifo*& f, uint32_t* dr, int* sEnable,
|
||||||
|
uint64_t* fi, int* fd, char* ajh, bool* sm);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
@ -104,11 +106,6 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
*/
|
*/
|
||||||
int RestreamStop();
|
int RestreamStop();
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Silent Mode
|
|
||||||
* @param mode 1 sets 0 unsets
|
|
||||||
*/
|
|
||||||
void SetSilentMode(bool mode);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@ -181,6 +178,16 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
/** Pointer to file index */
|
/** Pointer to file index */
|
||||||
uint64_t* fileIndex;
|
uint64_t* fileIndex;
|
||||||
|
|
||||||
|
/** flipped data across both dimensions enable */
|
||||||
|
int* flippedData;
|
||||||
|
|
||||||
|
/** additional json header */
|
||||||
|
char* additionJsonHeader;
|
||||||
|
|
||||||
|
/** Silent Mode */
|
||||||
|
bool* silentMode;
|
||||||
|
|
||||||
|
|
||||||
/** Aquisition Started flag */
|
/** Aquisition Started flag */
|
||||||
bool acquisitionStartedFlag;
|
bool acquisitionStartedFlag;
|
||||||
|
|
||||||
@ -199,13 +206,5 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
/** Complete buffer used for roi, eg. shortGotthard */
|
/** Complete buffer used for roi, eg. shortGotthard */
|
||||||
char* completeBuffer;
|
char* completeBuffer;
|
||||||
|
|
||||||
/** flipped data across both dimensions enable */
|
|
||||||
int* flippedData;
|
|
||||||
|
|
||||||
/** additional json header */
|
|
||||||
char* additionJsonHeader;
|
|
||||||
|
|
||||||
/** Silent Mode */
|
|
||||||
bool silentMode;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ class File : private virtual slsReceiverDefs {
|
|||||||
uint32_t* udpPortNumber;
|
uint32_t* udpPortNumber;
|
||||||
|
|
||||||
/** Silent Mode */
|
/** Silent Mode */
|
||||||
bool silentMode;
|
bool* silentMode;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -534,6 +534,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Create virtual file
|
* Create virtual file
|
||||||
* (in C because H5Pset_virtual doesnt exist yet in C++)
|
* (in C because H5Pset_virtual doesnt exist yet in C++)
|
||||||
|
* @param virtualFileName virtual file name
|
||||||
* @param fd virtual file handle
|
* @param fd virtual file handle
|
||||||
* @param masterFileName master file name
|
* @param masterFileName master file name
|
||||||
* @param fpath file path
|
* @param fpath file path
|
||||||
@ -556,6 +557,7 @@ public:
|
|||||||
* @returns 0 for success and 1 for fail
|
* @returns 0 for success and 1 for fail
|
||||||
*/
|
*/
|
||||||
static int CreateVirtualDataFile(
|
static int CreateVirtualDataFile(
|
||||||
|
string virtualFileName,
|
||||||
hid_t& fd, string masterFileName,
|
hid_t& fd, string masterFileName,
|
||||||
char* fpath, char* fnameprefix, uint64_t findex, bool frindexenable,
|
char* fpath, char* fnameprefix, uint64_t findex, bool frindexenable,
|
||||||
int dindex, int numunits,
|
int dindex, int numunits,
|
||||||
@ -566,10 +568,6 @@ public:
|
|||||||
vector <const char*> parameterNames,
|
vector <const char*> parameterNames,
|
||||||
vector <DataType> parameterDataTypes)
|
vector <DataType> parameterDataTypes)
|
||||||
{
|
{
|
||||||
//virtual names
|
|
||||||
string virtualFileName = CreateVirtualFileName(fpath, fnameprefix, findex);
|
|
||||||
FILE_LOG(logINFO) << "Virtual File: " << virtualFileName;
|
|
||||||
|
|
||||||
//file
|
//file
|
||||||
hid_t dfal = H5Pcreate (H5P_FILE_ACCESS);
|
hid_t dfal = H5Pcreate (H5P_FILE_ACCESS);
|
||||||
if (dfal < 0)
|
if (dfal < 0)
|
||||||
|
@ -35,11 +35,12 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
* @param fdp frame discard policy
|
* @param fdp frame discard policy
|
||||||
* @param act pointer to activated
|
* @param act pointer to activated
|
||||||
* @param depaden pointer to deactivated padding enable
|
* @param depaden pointer to deactivated padding enable
|
||||||
|
* @param sm pointer to silent mode
|
||||||
*/
|
*/
|
||||||
Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
|
Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
|
||||||
uint32_t* portno, char* e, uint64_t* nf, uint32_t* dr,
|
uint32_t* portno, char* e, uint64_t* nf, uint32_t* dr,
|
||||||
uint32_t* us, uint32_t* as, uint32_t* fpf,
|
uint32_t* us, uint32_t* as, uint32_t* fpf,
|
||||||
frameDiscardPolicy* fdp, bool* act, bool* depaden);
|
frameDiscardPolicy* fdp, bool* act, bool* depaden, bool* sm);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
@ -131,12 +132,6 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
*/
|
*/
|
||||||
void ShutDownUDPSocket();
|
void ShutDownUDPSocket();
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Silent Mode
|
|
||||||
* @param mode 1 sets 0 unsets
|
|
||||||
*/
|
|
||||||
void SetSilentMode(bool mode);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create & closes a dummy UDP socket
|
* Create & closes a dummy UDP socket
|
||||||
* to set & get actual buffer size
|
* to set & get actual buffer size
|
||||||
@ -253,6 +248,9 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
/** Deactivated padding enable */
|
/** Deactivated padding enable */
|
||||||
bool* deactivatedPaddingEnable;
|
bool* deactivatedPaddingEnable;
|
||||||
|
|
||||||
|
/** Silent Mode */
|
||||||
|
bool* silentMode;
|
||||||
|
|
||||||
/** x coord hardcoded as 1D or 2d,
|
/** x coord hardcoded as 1D or 2d,
|
||||||
* if detector does not send them yet or
|
* if detector does not send them yet or
|
||||||
* missing packets/deactivated (eiger/jungfrau sends 2d pos) **/
|
* missing packets/deactivated (eiger/jungfrau sends 2d pos) **/
|
||||||
@ -313,8 +311,5 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
|
|
||||||
/** number of images for statistic */
|
/** number of images for statistic */
|
||||||
uint32_t numFramesStatistic;
|
uint32_t numFramesStatistic;
|
||||||
|
|
||||||
/** Silent Mode */
|
|
||||||
bool silentMode;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -273,7 +273,7 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
|||||||
* Get Silent Mode
|
* Get Silent Mode
|
||||||
* @return silent mode
|
* @return silent mode
|
||||||
*/
|
*/
|
||||||
uint32_t getSilentMode() const;
|
bool getSilentMode() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get activate
|
* Get activate
|
||||||
@ -540,9 +540,9 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
|||||||
//***receiver parameters***
|
//***receiver parameters***
|
||||||
/**
|
/**
|
||||||
* Set Silent Mode
|
* Set Silent Mode
|
||||||
* @param i silent mode. 1 sets, 0 unsets
|
* @param i silent mode. true sets, false unsets
|
||||||
*/
|
*/
|
||||||
void setSilentMode(const uint32_t i);
|
void setSilentMode(const bool i);
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* Behavioral functions***************************************************
|
* Behavioral functions***************************************************
|
||||||
@ -801,7 +801,7 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
|
|||||||
char additionalJsonHeader[MAX_STR_LENGTH];
|
char additionalJsonHeader[MAX_STR_LENGTH];
|
||||||
|
|
||||||
//***receiver parameters***
|
//***receiver parameters***
|
||||||
uint32_t silentMode;
|
bool silentMode;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -361,7 +361,7 @@ class UDPInterface {
|
|||||||
* Get Silent Mode
|
* Get Silent Mode
|
||||||
* @return silent mode
|
* @return silent mode
|
||||||
*/
|
*/
|
||||||
virtual uint32_t getSilentMode() const = 0;
|
virtual bool getSilentMode() const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get activate
|
* Get activate
|
||||||
@ -629,9 +629,9 @@ class UDPInterface {
|
|||||||
//***receiver parameters***
|
//***receiver parameters***
|
||||||
/**
|
/**
|
||||||
* Set Silent Mode
|
* Set Silent Mode
|
||||||
* @param i silent mode. 1 sets, 0 unsets
|
* @param i silent mode. true sets, false unsets
|
||||||
*/
|
*/
|
||||||
virtual void setSilentMode(const uint32_t i) = 0;
|
virtual void setSilentMode(const bool i) = 0;
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
@ -122,11 +122,6 @@ 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)
|
||||||
|
@ -53,7 +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) {
|
if(!(*silentMode)) {
|
||||||
FILE_LOG(logINFO) << "[" << *udpPortNumber << "]: Binary File created: " << currentFileName;
|
FILE_LOG(logINFO) << "[" << *udpPortNumber << "]: Binary File created: " << currentFileName;
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
@ -125,7 +125,7 @@ int BinaryFile::CreateMasterFile(bool en, uint32_t size,
|
|||||||
if (master && (*detIndex==0)) {
|
if (master && (*detIndex==0)) {
|
||||||
masterFileName = BinaryFileStatic::CreateMasterFileName(filePath,
|
masterFileName = BinaryFileStatic::CreateMasterFileName(filePath,
|
||||||
fileNamePrefix, *fileIndex);
|
fileNamePrefix, *fileIndex);
|
||||||
if(!silentMode) {
|
if(!(*silentMode)) {
|
||||||
FILE_LOG(logINFO) << "Master File: " << masterFileName;
|
FILE_LOG(logINFO) << "Master File: " << masterFileName;
|
||||||
}
|
}
|
||||||
return BinaryFileStatic::CreateMasterDataFile(masterfd, masterFileName,
|
return BinaryFileStatic::CreateMasterDataFile(masterfd, masterFileName,
|
||||||
|
@ -27,7 +27,7 @@ DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo*& f,
|
|||||||
fileFormat* ftype, bool fwenable,
|
fileFormat* ftype, bool fwenable,
|
||||||
bool* dsEnable, bool* gpEnable, uint32_t* dr,
|
bool* dsEnable, bool* gpEnable, uint32_t* dr,
|
||||||
uint32_t* freq, uint32_t* timer,
|
uint32_t* freq, uint32_t* timer,
|
||||||
bool* fp, bool* act, bool* depaden,
|
bool* fp, bool* act, bool* depaden, bool* sm,
|
||||||
void (*dataReadycb)(char*, char*, uint32_t, void*),
|
void (*dataReadycb)(char*, char*, uint32_t, void*),
|
||||||
void (*dataModifyReadycb)(char*, char*, uint32_t &, void*),
|
void (*dataModifyReadycb)(char*, char*, uint32_t &, void*),
|
||||||
void *pDataReadycb) :
|
void *pDataReadycb) :
|
||||||
@ -49,6 +49,8 @@ DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo*& f,
|
|||||||
tempBuffer(0),
|
tempBuffer(0),
|
||||||
activated(act),
|
activated(act),
|
||||||
deactivatedPaddingEnable(depaden),
|
deactivatedPaddingEnable(depaden),
|
||||||
|
silentMode(sm),
|
||||||
|
framePadding(fp),
|
||||||
acquisitionStartedFlag(false),
|
acquisitionStartedFlag(false),
|
||||||
measurementStartedFlag(false),
|
measurementStartedFlag(false),
|
||||||
firstAcquisitionIndex(0),
|
firstAcquisitionIndex(0),
|
||||||
@ -56,8 +58,6 @@ DataProcessor::DataProcessor(int ind, detectorType dtype, Fifo*& f,
|
|||||||
numTotalFramesCaught(0),
|
numTotalFramesCaught(0),
|
||||||
numFramesCaught(0),
|
numFramesCaught(0),
|
||||||
currentFrameIndex(0),
|
currentFrameIndex(0),
|
||||||
silentMode(false),
|
|
||||||
framePadding(fp),
|
|
||||||
rawDataReadyCallBack(dataReadycb),
|
rawDataReadyCallBack(dataReadycb),
|
||||||
rawDataModifyReadyCallBack(dataModifyReadycb),
|
rawDataModifyReadyCallBack(dataModifyReadycb),
|
||||||
pRawDataReady(pDataReadycb)
|
pRawDataReady(pDataReadycb)
|
||||||
@ -236,13 +236,13 @@ void DataProcessor::SetupFileWriter(bool fwe, int* nd, uint32_t* maxf,
|
|||||||
file = new HDF5File(index, maxf,
|
file = new HDF5File(index, maxf,
|
||||||
nd, fname, fpath, findex, owenable,
|
nd, fname, fpath, findex, owenable,
|
||||||
dindex, nunits, nf, dr, portno,
|
dindex, nunits, nf, dr, portno,
|
||||||
generalData->nPixelsX, generalData->nPixelsY, &silentMode);
|
generalData->nPixelsX, generalData->nPixelsY, silentMode);
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
file = new BinaryFile(index, maxf,
|
file = new BinaryFile(index, maxf,
|
||||||
nd, fname, fpath, findex, owenable,
|
nd, fname, fpath, findex, owenable,
|
||||||
dindex, nunits, nf, dr, portno, &silentMode);
|
dindex, nunits, nf, dr, portno, silentMode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -453,9 +453,6 @@ void DataProcessor::SetPixelDimension() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DataProcessor::SetSilentMode(bool mode) {
|
|
||||||
silentMode = mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DataProcessor::PadMissingPackets(char* buf) {
|
void DataProcessor::PadMissingPackets(char* buf) {
|
||||||
FILE_LOG(logDEBUG) << index << ": Padding Missing Packets";
|
FILE_LOG(logDEBUG) << index << ": Padding Missing Packets";
|
||||||
|
@ -16,7 +16,8 @@ using namespace std;
|
|||||||
const string DataStreamer::TypeName = "DataStreamer";
|
const string DataStreamer::TypeName = "DataStreamer";
|
||||||
|
|
||||||
|
|
||||||
DataStreamer::DataStreamer(int ind, Fifo*& f, uint32_t* dr, int* sEnable, uint64_t* fi, int* fd, char* ajh) :
|
DataStreamer::DataStreamer(int ind, Fifo*& f, uint32_t* dr, int* sEnable,
|
||||||
|
uint64_t* fi, int* fd, char* ajh, bool* sm) :
|
||||||
ThreadObject(ind),
|
ThreadObject(ind),
|
||||||
runningFlag(0),
|
runningFlag(0),
|
||||||
generalData(0),
|
generalData(0),
|
||||||
@ -25,14 +26,14 @@ DataStreamer::DataStreamer(int ind, Fifo*& f, uint32_t* dr, int* sEnable, uint64
|
|||||||
dynamicRange(dr),
|
dynamicRange(dr),
|
||||||
shortFrameEnable(sEnable),
|
shortFrameEnable(sEnable),
|
||||||
fileIndex(fi),
|
fileIndex(fi),
|
||||||
|
flippedData(fd),
|
||||||
|
additionJsonHeader(ajh),
|
||||||
|
silentMode(sm),
|
||||||
acquisitionStartedFlag(false),
|
acquisitionStartedFlag(false),
|
||||||
measurementStartedFlag(false),
|
measurementStartedFlag(false),
|
||||||
firstAcquisitionIndex(0),
|
firstAcquisitionIndex(0),
|
||||||
firstMeasurementIndex(0),
|
firstMeasurementIndex(0),
|
||||||
completeBuffer(0),
|
completeBuffer(0)
|
||||||
flippedData(fd),
|
|
||||||
additionJsonHeader(ajh),
|
|
||||||
silentMode(false)
|
|
||||||
{
|
{
|
||||||
if(ThreadObject::CreateThread() == FAIL)
|
if(ThreadObject::CreateThread() == FAIL)
|
||||||
throw std::exception();
|
throw std::exception();
|
||||||
@ -272,7 +273,3 @@ int DataStreamer::RestreamStop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DataStreamer::SetSilentMode(bool mode) {
|
|
||||||
silentMode = mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ void File::PrintMembers() {
|
|||||||
<< "UDP Port number: " << *udpPortNumber << endl
|
<< "UDP Port number: " << *udpPortNumber << endl
|
||||||
<< "Master File Name: " << masterFileName << endl
|
<< "Master File Name: " << masterFileName << endl
|
||||||
<< "Current File Name: " << currentFileName << endl
|
<< "Current File Name: " << currentFileName << endl
|
||||||
<< "Silent Mode: " << silentMode;
|
<< "Silent Mode: " << *silentMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -159,7 +159,7 @@ int HDF5File::CreateFile(uint64_t fnum) {
|
|||||||
if (dataspace == NULL)
|
if (dataspace == NULL)
|
||||||
cprintf(RED,"Got nothing!\n");
|
cprintf(RED,"Got nothing!\n");
|
||||||
|
|
||||||
if(!silentMode) {
|
if(!(*silentMode)) {
|
||||||
FILE_LOG(logINFO) << *udpPortNumber << ": HDF5 File created: " << currentFileName;
|
FILE_LOG(logINFO) << *udpPortNumber << ": HDF5 File created: " << currentFileName;
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
@ -215,7 +215,7 @@ int HDF5File::WriteToFile(char* buffer, int buffersize, uint64_t fnum, uint32_t
|
|||||||
if (fnum >= extNumImages) {
|
if (fnum >= extNumImages) {
|
||||||
if (HDF5FileStatic::ExtendDataset(index, dataspace, dataset,
|
if (HDF5FileStatic::ExtendDataset(index, dataspace, dataset,
|
||||||
dataspace_para, dataset_para, *numImages) == OK) {
|
dataspace_para, dataset_para, *numImages) == OK) {
|
||||||
if (!silentMode) {
|
if (!(*silentMode)) {
|
||||||
cprintf(BLUE,"%d Extending HDF5 dataset by %llu, Total x Dimension: %llu\n",
|
cprintf(BLUE,"%d Extending HDF5 dataset by %llu, Total x Dimension: %llu\n",
|
||||||
index, (long long unsigned int)extNumImages,
|
index, (long long unsigned int)extNumImages,
|
||||||
(long long unsigned int)(extNumImages + *numImages));
|
(long long unsigned int)(extNumImages + *numImages));
|
||||||
@ -258,7 +258,7 @@ int HDF5File::CreateMasterFile(bool en, uint32_t size,
|
|||||||
virtualfd = 0;
|
virtualfd = 0;
|
||||||
masterFileName = HDF5FileStatic::CreateMasterFileName(filePath,
|
masterFileName = HDF5FileStatic::CreateMasterFileName(filePath,
|
||||||
fileNamePrefix, *fileIndex);
|
fileNamePrefix, *fileIndex);
|
||||||
if(!silentMode) {
|
if(!(*silentMode)) {
|
||||||
FILE_LOG(logINFO) << "Master File: " << masterFileName;
|
FILE_LOG(logINFO) << "Master File: " << masterFileName;
|
||||||
}
|
}
|
||||||
pthread_mutex_lock(&Mutex);
|
pthread_mutex_lock(&Mutex);
|
||||||
@ -297,7 +297,13 @@ void HDF5File::EndofAcquisition(bool anyPacketsCaught, uint64_t numf) {
|
|||||||
// called only by the one maser receiver
|
// called only by the one maser receiver
|
||||||
int HDF5File::CreateVirtualFile(uint64_t numf) {
|
int HDF5File::CreateVirtualFile(uint64_t numf) {
|
||||||
pthread_mutex_lock(&Mutex);
|
pthread_mutex_lock(&Mutex);
|
||||||
int ret = HDF5FileStatic::CreateVirtualDataFile(
|
|
||||||
|
string vname = HDF5FileStatic::CreateVirtualFileName(filePath, fileNamePrefix, *fileIndex);
|
||||||
|
if(!(*silentMode)) {
|
||||||
|
FILE_LOG(logINFO) << "Virtual File: " << vname;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ret = HDF5FileStatic::CreateVirtualDataFile(vname,
|
||||||
virtualfd, masterFileName,
|
virtualfd, masterFileName,
|
||||||
filePath, fileNamePrefix, *fileIndex, (*numImages > 1),
|
filePath, fileNamePrefix, *fileIndex, (*numImages > 1),
|
||||||
*detIndex, *numUnitsPerDetector,
|
*detIndex, *numUnitsPerDetector,
|
||||||
|
@ -22,7 +22,7 @@ const string Listener::TypeName = "Listener";
|
|||||||
Listener::Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
|
Listener::Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
|
||||||
uint32_t* portno, char* e, uint64_t* nf, uint32_t* dr,
|
uint32_t* portno, char* e, uint64_t* nf, uint32_t* dr,
|
||||||
uint32_t* us, uint32_t* as, uint32_t* fpf,
|
uint32_t* us, uint32_t* as, uint32_t* fpf,
|
||||||
frameDiscardPolicy* fdp, bool* act, bool* depaden) :
|
frameDiscardPolicy* fdp, bool* act, bool* depaden, bool* sm) :
|
||||||
ThreadObject(ind),
|
ThreadObject(ind),
|
||||||
runningFlag(0),
|
runningFlag(0),
|
||||||
generalData(0),
|
generalData(0),
|
||||||
@ -40,6 +40,7 @@ Listener::Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
|
|||||||
frameDiscardMode(fdp),
|
frameDiscardMode(fdp),
|
||||||
activated(act),
|
activated(act),
|
||||||
deactivatedPaddingEnable(depaden),
|
deactivatedPaddingEnable(depaden),
|
||||||
|
silentMode(sm),
|
||||||
xcoord(0),
|
xcoord(0),
|
||||||
ycoord(0),
|
ycoord(0),
|
||||||
acquisitionStartedFlag(false),
|
acquisitionStartedFlag(false),
|
||||||
@ -54,8 +55,7 @@ Listener::Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s,
|
|||||||
listeningPacket(0),
|
listeningPacket(0),
|
||||||
udpSocketAlive(0),
|
udpSocketAlive(0),
|
||||||
numPacketsStatistic(0),
|
numPacketsStatistic(0),
|
||||||
numFramesStatistic(0),
|
numFramesStatistic(0)
|
||||||
silentMode(false)
|
|
||||||
{
|
{
|
||||||
if(ThreadObject::CreateThread() == FAIL)
|
if(ThreadObject::CreateThread() == FAIL)
|
||||||
throw std::exception();
|
throw std::exception();
|
||||||
@ -159,7 +159,7 @@ void Listener::RecordFirstIndices(uint64_t fnum) {
|
|||||||
firstAcquisitionIndex = fnum;
|
firstAcquisitionIndex = fnum;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!silentMode) {
|
if(!(*silentMode)) {
|
||||||
if (!index) cprintf(BLUE,"%d First Acquisition Index:%lu\n"
|
if (!index) cprintf(BLUE,"%d First Acquisition Index:%lu\n"
|
||||||
"%d First Measurement Index:%lu\n",
|
"%d First Measurement Index:%lu\n",
|
||||||
index, firstAcquisitionIndex,
|
index, firstAcquisitionIndex,
|
||||||
@ -237,11 +237,6 @@ void Listener::ShutDownUDPSocket() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Listener::SetSilentMode(bool mode) {
|
|
||||||
silentMode = mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int Listener::CreateDummySocketForUDPSocketBufferSize(uint32_t s) {
|
int Listener::CreateDummySocketForUDPSocketBufferSize(uint32_t s) {
|
||||||
FILE_LOG(logINFO) << "Testing UDP Socket Buffer size with test port " << *udpPortNumber;
|
FILE_LOG(logINFO) << "Testing UDP Socket Buffer size with test port " << *udpPortNumber;
|
||||||
|
|
||||||
@ -349,7 +344,7 @@ void Listener::ThreadExecution() {
|
|||||||
fifo->PushAddress(buffer);
|
fifo->PushAddress(buffer);
|
||||||
|
|
||||||
//Statistics
|
//Statistics
|
||||||
if(!silentMode) {
|
if(!(*silentMode)) {
|
||||||
numFramesStatistic++;
|
numFramesStatistic++;
|
||||||
if (numFramesStatistic >=
|
if (numFramesStatistic >=
|
||||||
//second condition also for infinite #number of frames
|
//second condition also for infinite #number of frames
|
||||||
|
@ -91,7 +91,7 @@ void UDPBaseImplementation::initializeMembers(){
|
|||||||
memset(additionalJsonHeader, 0, sizeof(additionalJsonHeader));
|
memset(additionalJsonHeader, 0, sizeof(additionalJsonHeader));
|
||||||
|
|
||||||
//***receiver parameters***
|
//***receiver parameters***
|
||||||
silentMode = 0;
|
silentMode = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -319,7 +319,7 @@ slsReceiverDefs::runStatus UDPBaseImplementation::getStatus() const{
|
|||||||
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
||||||
return status;}
|
return status;}
|
||||||
|
|
||||||
uint32_t UDPBaseImplementation::getSilentMode() const{
|
bool UDPBaseImplementation::getSilentMode() const{
|
||||||
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
||||||
return silentMode;}
|
return silentMode;}
|
||||||
|
|
||||||
@ -664,7 +664,7 @@ int UDPBaseImplementation::setFifoDepth(const uint32_t i){
|
|||||||
}
|
}
|
||||||
|
|
||||||
/***receiver parameters***/
|
/***receiver parameters***/
|
||||||
void UDPBaseImplementation::setSilentMode(const uint32_t i){
|
void UDPBaseImplementation::setSilentMode(const bool i){
|
||||||
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
||||||
|
|
||||||
silentMode = i;
|
silentMode = i;
|
||||||
|
@ -224,7 +224,7 @@ int UDPStandardImplementation::setDataStreamEnable(const bool enable) {
|
|||||||
for ( int i = 0; i < numThreads; ++i ) {
|
for ( int i = 0; i < numThreads; ++i ) {
|
||||||
try {
|
try {
|
||||||
DataStreamer* s = new DataStreamer(i, fifo[i], &dynamicRange,
|
DataStreamer* s = new DataStreamer(i, fifo[i], &dynamicRange,
|
||||||
&shortFrameEnable, &fileIndex, flippedData, additionalJsonHeader);
|
&shortFrameEnable, &fileIndex, flippedData, additionalJsonHeader, &silentMode);
|
||||||
dataStreamer.push_back(s);
|
dataStreamer.push_back(s);
|
||||||
dataStreamer[i]->SetGeneralData(generalData);
|
dataStreamer[i]->SetGeneralData(generalData);
|
||||||
dataStreamer[i]->CreateZmqSockets(&numThreads, streamingPort, streamingSrcIP);
|
dataStreamer[i]->CreateZmqSockets(&numThreads, streamingPort, streamingSrcIP);
|
||||||
@ -309,19 +309,6 @@ int UDPStandardImplementation::setFifoDepth(const uint32_t i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void UDPStandardImplementation::setSilentMode(const uint32_t i){
|
|
||||||
silentMode = i;
|
|
||||||
|
|
||||||
for (vector<Listener*>::const_iterator it = listener.begin(); it != listener.end(); ++it)
|
|
||||||
(*it)->SetSilentMode(i);
|
|
||||||
for (vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it)
|
|
||||||
(*it)->SetSilentMode(i);
|
|
||||||
for (vector<DataStreamer*>::const_iterator it = dataStreamer.begin(); it != dataStreamer.end(); ++it)
|
|
||||||
(*it)->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";
|
||||||
@ -375,13 +362,13 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) {
|
|||||||
Listener* l = new Listener(i, myDetectorType, fifo[i], &status,
|
Listener* l = new Listener(i, myDetectorType, fifo[i], &status,
|
||||||
&udpPortNum[i], eth, &numberOfFrames, &dynamicRange,
|
&udpPortNum[i], eth, &numberOfFrames, &dynamicRange,
|
||||||
&udpSocketBufferSize, &actualUDPSocketBufferSize, &framesPerFile,
|
&udpSocketBufferSize, &actualUDPSocketBufferSize, &framesPerFile,
|
||||||
&frameDiscardMode, &activated, &deactivatedPaddingEnable);
|
&frameDiscardMode, &activated, &deactivatedPaddingEnable, &silentMode);
|
||||||
listener.push_back(l);
|
listener.push_back(l);
|
||||||
|
|
||||||
DataProcessor* p = new DataProcessor(i, myDetectorType, fifo[i], &fileFormatType,
|
DataProcessor* p = new DataProcessor(i, myDetectorType, fifo[i], &fileFormatType,
|
||||||
fileWriteEnable, &dataStreamEnable, &gapPixelsEnable,
|
fileWriteEnable, &dataStreamEnable, &gapPixelsEnable,
|
||||||
&dynamicRange, &frameToGuiFrequency, &frameToGuiTimerinMS,
|
&dynamicRange, &frameToGuiFrequency, &frameToGuiTimerinMS,
|
||||||
&framePadding, &activated, &deactivatedPaddingEnable,
|
&framePadding, &activated, &deactivatedPaddingEnable, &silentMode,
|
||||||
rawDataReadyCallBack, rawDataModifyReadyCallBack, pRawDataReady);
|
rawDataReadyCallBack, rawDataModifyReadyCallBack, pRawDataReady);
|
||||||
dataProcessor.push_back(p);
|
dataProcessor.push_back(p);
|
||||||
}
|
}
|
||||||
|
@ -721,6 +721,11 @@ int slsReceiverTCPIPInterface::send_update() {
|
|||||||
#endif
|
#endif
|
||||||
n += mySock->SendDataOnly(&ind,sizeof(ind));
|
n += mySock->SendDataOnly(&ind,sizeof(ind));
|
||||||
|
|
||||||
|
// silent mode
|
||||||
|
#ifdef SLS_RECEIVER_UDP_FUNCTIONS
|
||||||
|
ind=(int)receiverBase->getSilentMode();
|
||||||
|
#endif
|
||||||
|
n += mySock->SendDataOnly(&ind,sizeof(ind));
|
||||||
|
|
||||||
if (!lockStatus)
|
if (!lockStatus)
|
||||||
strcpy(mySock->lastClientIP,mySock->thisClientIP);
|
strcpy(mySock->lastClientIP,mySock->thisClientIP);
|
||||||
@ -2437,7 +2442,7 @@ int slsReceiverTCPIPInterface::set_silent_mode() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//get
|
//get
|
||||||
retval = receiverBase->getSilentMode(); // no check required
|
retval = (int)receiverBase->getSilentMode(); // no check required
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef VERYVERBOSE
|
#ifdef VERYVERBOSE
|
||||||
|
Reference in New Issue
Block a user