mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-28 09:10:01 +02:00
rest implementation, index issues
This commit is contained in:
parent
39560969f4
commit
0bacb903ea
@ -24,7 +24,6 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* Calls Base Class CreateThread(), sets ErrorMask if error and increments NumberofDataProcessors
|
* Calls Base Class CreateThread(), sets ErrorMask if error and increments NumberofDataProcessors
|
||||||
* @param ind self index
|
|
||||||
* @param f address of Fifo pointer
|
* @param f address of Fifo pointer
|
||||||
* @param ftype pointer to file format type
|
* @param ftype pointer to file format type
|
||||||
* @param fwenable pointer to file writer enable
|
* @param fwenable pointer to file writer enable
|
||||||
@ -32,7 +31,7 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
* @param dataReadycb pointer to data ready call back function
|
* @param dataReadycb pointer to data ready call back function
|
||||||
* @param pDataReadycb pointer to arguments of data ready call back function
|
* @param pDataReadycb pointer to arguments of data ready call back function
|
||||||
*/
|
*/
|
||||||
DataProcessor(int ind, Fifo*& f, fileFormat* ftype, bool* fwenable, bool* dsEnable,
|
DataProcessor(Fifo*& f, fileFormat* ftype, bool* fwenable, bool* dsEnable,
|
||||||
void (*dataReadycb)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
|
void (*dataReadycb)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
|
||||||
char*, uint32_t, void*),
|
char*, uint32_t, void*),
|
||||||
void *pDataReadycb);
|
void *pDataReadycb);
|
||||||
|
@ -20,14 +20,13 @@ class DataStreamer : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* Calls Base Class CreateThread(), sets ErrorMask if error and increments NumberofDataStreamers
|
* Calls Base Class CreateThread(), sets ErrorMask if error and increments NumberofDataStreamers
|
||||||
* @param ind self index
|
|
||||||
* @param f address of Fifo pointer
|
* @param f address of Fifo pointer
|
||||||
* @param dr pointer to dynamic range
|
* @param dr pointer to dynamic range
|
||||||
* @param freq pointer to streaming frequency
|
* @param freq pointer to streaming frequency
|
||||||
* @param timer pointer to timer if streaming frequency is random
|
* @param timer pointer to timer if streaming frequency is random
|
||||||
* @param sEnable pointer to short frame enable
|
* @param sEnable pointer to short frame enable
|
||||||
*/
|
*/
|
||||||
DataStreamer(int ind, Fifo*& f, uint32_t* dr, uint32_t* freq, uint32_t* timer, int* sEnable);
|
DataStreamer(Fifo*& f, uint32_t* dr, uint32_t* freq, uint32_t* timer, int* sEnable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
|
@ -20,12 +20,11 @@ class Fifo : private virtual slsReceiverDefs {
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* Calls CreateFifos that creates fifos and allocates memory
|
* Calls CreateFifos that creates fifos and allocates memory
|
||||||
* @param ind self index
|
|
||||||
* @param fifoItemSize size of each fifo item
|
* @param fifoItemSize size of each fifo item
|
||||||
* @param fifoDepth fifo depth
|
* @param fifoDepth fifo depth
|
||||||
* @param success true if successful, else false
|
* @param success true if successful, else false
|
||||||
*/
|
*/
|
||||||
Fifo(int ind, uint32_t fifoItemSize, uint32_t fifoDepth, bool &success);
|
Fifo(uint32_t fifoItemSize, uint32_t fifoDepth, bool &success);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
|
@ -21,7 +21,6 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* Calls Base Class CreateThread(), sets ErrorMask if error and increments NumberofListerners
|
* Calls Base Class CreateThread(), sets ErrorMask if error and increments NumberofListerners
|
||||||
* @param ind self index
|
|
||||||
* @param dtype detector type
|
* @param dtype detector type
|
||||||
* @param f address of Fifo pointer
|
* @param f address of Fifo pointer
|
||||||
* @param s pointer to receiver status
|
* @param s pointer to receiver status
|
||||||
@ -31,7 +30,7 @@ class Listener : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
* @param nf pointer to number of images to catch
|
* @param nf pointer to number of images to catch
|
||||||
* @param dr pointer to dynamic range
|
* @param dr pointer to dynamic range
|
||||||
*/
|
*/
|
||||||
Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s, uint32_t* portno, char* e, int* act, uint64_t* nf, uint32_t* dr);
|
Listener(detectorType dtype, Fifo*& f, runStatus* s, uint32_t* portno, char* e, int* act, uint64_t* nf, uint32_t* dr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
|
@ -19,8 +19,9 @@ class ThreadObject : private virtual slsReceiverDefs {
|
|||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
* @param ind self index
|
||||||
*/
|
*/
|
||||||
ThreadObject();
|
ThreadObject(int ind);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destructor
|
* Destructor
|
||||||
|
@ -27,6 +27,29 @@ class UDPInterface {
|
|||||||
*
|
*
|
||||||
* UDPInterface *udp_interface = UDPInterface::create()
|
* UDPInterface *udp_interface = UDPInterface::create()
|
||||||
*
|
*
|
||||||
|
* Sequence of Calls from client (upon setting receiver)
|
||||||
|
* -setDetectorType
|
||||||
|
* -setMultiDetectorSize
|
||||||
|
* -setDetectorPositionId
|
||||||
|
* -initialize
|
||||||
|
* -setUDPPortNumber,setUDPPortNumber2,setEthernetInterface
|
||||||
|
* -setFilePath
|
||||||
|
* -setFileName
|
||||||
|
* -setFileIndex
|
||||||
|
* -setFileFormat
|
||||||
|
* -setFileWriteEnable
|
||||||
|
* -setOverwriteEnable
|
||||||
|
* -setFrameIndexEnable
|
||||||
|
* -setAcquisitionPeriod
|
||||||
|
* -setNumberOfFrames
|
||||||
|
* -setAcquisitionTime
|
||||||
|
* -setDynamicRange
|
||||||
|
* -setFlippedData
|
||||||
|
* -setActivate
|
||||||
|
* -setTenGigaEnable
|
||||||
|
* -setStreamingPort
|
||||||
|
* -setDataStreamEnable
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* supported sequence of method-calls:
|
* supported sequence of method-calls:
|
||||||
*
|
*
|
||||||
|
@ -115,27 +115,9 @@ public:
|
|||||||
* Overridden method
|
* Overridden method
|
||||||
* Shuts down and deletes UDP Sockets
|
* Shuts down and deletes UDP Sockets
|
||||||
* TCPIPInterface can also call this in case of illegal shutdown of receiver
|
* TCPIPInterface can also call this in case of illegal shutdown of receiver
|
||||||
* @return OK or FAIL
|
|
||||||
*/
|
*/
|
||||||
int shutDownUDPSockets();
|
void shutDownUDPSockets();
|
||||||
|
|
||||||
/**
|
|
||||||
* Overridden method
|
|
||||||
* Get the buffer-current frame read by receiver
|
|
||||||
* @param c pointer to current file name
|
|
||||||
* @param raw address of pointer, pointing to current frame to send to gui
|
|
||||||
* @param startAcq start index of the acquisition
|
|
||||||
* @param startFrame start index of the scan
|
|
||||||
*/
|
|
||||||
void readFrame(char* c,char** raw, uint64_t &startAcq, uint64_t &startFrame);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Overridden method
|
|
||||||
* Closes file / all files(data compression involves multiple files)
|
|
||||||
* TCPIPInterface can also call this in case of illegal shutdown of receiver
|
|
||||||
* @param i thread index valid for datacompression using root files, -1 for all threads
|
|
||||||
*/
|
|
||||||
void closeFile(int i = -1);
|
|
||||||
|
|
||||||
uint64_t getTotalFramesCaught() const;
|
uint64_t getTotalFramesCaught() const;
|
||||||
|
|
||||||
|
@ -177,7 +177,6 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Closes file / all files(data compression involves multiple files)
|
* Closes file / all files(data compression involves multiple files)
|
||||||
* TCPIPInterface can also call this in case of illegal shutdown of receiver
|
|
||||||
*/
|
*/
|
||||||
void closeFiles();
|
void closeFiles();
|
||||||
|
|
||||||
@ -248,11 +247,6 @@ private:
|
|||||||
/** Number of Jobs */
|
/** Number of Jobs */
|
||||||
int numberofJobs;
|
int numberofJobs;
|
||||||
|
|
||||||
//*** mutex ***
|
|
||||||
/** Status mutex */
|
|
||||||
pthread_mutex_t statusMutex;
|
|
||||||
|
|
||||||
|
|
||||||
//** class objects ***
|
//** class objects ***
|
||||||
/** General Data Properties */
|
/** General Data Properties */
|
||||||
GeneralData* generalData;
|
GeneralData* generalData;
|
||||||
|
@ -31,12 +31,12 @@ uint64_t DataProcessor::RunningMask(0x0);
|
|||||||
pthread_mutex_t DataProcessor::Mutex = PTHREAD_MUTEX_INITIALIZER;
|
pthread_mutex_t DataProcessor::Mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
|
|
||||||
DataProcessor::DataProcessor(int ind, Fifo*& f, fileFormat* ftype, bool* fwenable, bool* dsEnable,
|
DataProcessor::DataProcessor(Fifo*& f, fileFormat* ftype, bool* fwenable, bool* dsEnable,
|
||||||
void (*dataReadycb)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
|
void (*dataReadycb)(uint64_t, uint32_t, uint32_t, uint64_t, uint64_t, uint16_t, uint16_t, uint16_t, uint16_t, uint32_t, uint16_t, uint8_t, uint8_t,
|
||||||
char*, uint32_t, void*),
|
char*, uint32_t, void*),
|
||||||
void *pDataReadycb) :
|
void *pDataReadycb) :
|
||||||
|
|
||||||
ThreadObject(),
|
ThreadObject(NumberofDataProcessors),
|
||||||
generalData(0),
|
generalData(0),
|
||||||
fifo(f),
|
fifo(f),
|
||||||
file(0),
|
file(0),
|
||||||
@ -53,8 +53,6 @@ DataProcessor::DataProcessor(int ind, Fifo*& f, fileFormat* ftype, bool* fwenabl
|
|||||||
rawDataReadyCallBack(dataReadycb),
|
rawDataReadyCallBack(dataReadycb),
|
||||||
pRawDataReady(pDataReadycb)
|
pRawDataReady(pDataReadycb)
|
||||||
{
|
{
|
||||||
index = ind;
|
|
||||||
|
|
||||||
if(ThreadObject::CreateThread()){
|
if(ThreadObject::CreateThread()){
|
||||||
pthread_mutex_lock(&Mutex);
|
pthread_mutex_lock(&Mutex);
|
||||||
ErrorMask ^= (1<<index);
|
ErrorMask ^= (1<<index);
|
||||||
|
@ -24,8 +24,8 @@ uint64_t DataStreamer::RunningMask(0x0);
|
|||||||
pthread_mutex_t DataStreamer::Mutex = PTHREAD_MUTEX_INITIALIZER;
|
pthread_mutex_t DataStreamer::Mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
|
|
||||||
DataStreamer::DataStreamer(int ind, Fifo*& f, uint32_t* dr, uint32_t* freq, uint32_t* timer, int* sEnable) :
|
DataStreamer::DataStreamer(Fifo*& f, uint32_t* dr, uint32_t* freq, uint32_t* timer, int* sEnable) :
|
||||||
ThreadObject(),
|
ThreadObject(NumberofDataStreamers),
|
||||||
generalData(0),
|
generalData(0),
|
||||||
fifo(f),
|
fifo(f),
|
||||||
zmqSocket(0),
|
zmqSocket(0),
|
||||||
@ -40,10 +40,6 @@ DataStreamer::DataStreamer(int ind, Fifo*& f, uint32_t* dr, uint32_t* freq, uint
|
|||||||
firstMeasurementIndex(0),
|
firstMeasurementIndex(0),
|
||||||
completeBuffer(0)
|
completeBuffer(0)
|
||||||
{
|
{
|
||||||
index = NumberofDataStreamers;
|
|
||||||
cprintf(RED, "%d: Number of DataStreamers: %d\n", index, NumberofDataStreamers);
|
|
||||||
//index = ind;
|
|
||||||
|
|
||||||
if(ThreadObject::CreateThread()){
|
if(ThreadObject::CreateThread()){
|
||||||
pthread_mutex_lock(&Mutex);
|
pthread_mutex_lock(&Mutex);
|
||||||
ErrorMask ^= (1<<index);
|
ErrorMask ^= (1<<index);
|
||||||
|
@ -14,8 +14,8 @@ using namespace std;
|
|||||||
|
|
||||||
int Fifo::NumberofFifoClassObjects(0);
|
int Fifo::NumberofFifoClassObjects(0);
|
||||||
|
|
||||||
Fifo::Fifo(int ind, uint32_t fifoItemSize, uint32_t fifoDepth, bool &success):
|
Fifo::Fifo(uint32_t fifoItemSize, uint32_t fifoDepth, bool &success):
|
||||||
index(ind),
|
index(NumberofFifoClassObjects),
|
||||||
memory(0),
|
memory(0),
|
||||||
fifoBound(0),
|
fifoBound(0),
|
||||||
fifoFree(0),
|
fifoFree(0),
|
||||||
|
@ -27,8 +27,8 @@ uint64_t Listener::RunningMask(0x0);
|
|||||||
pthread_mutex_t Listener::Mutex = PTHREAD_MUTEX_INITIALIZER;
|
pthread_mutex_t Listener::Mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
|
|
||||||
|
|
||||||
Listener::Listener(int ind, 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(),
|
ThreadObject(NumberofListeners),
|
||||||
generalData(0),
|
generalData(0),
|
||||||
fifo(f),
|
fifo(f),
|
||||||
myDetectorType(dtype),
|
myDetectorType(dtype),
|
||||||
@ -50,8 +50,6 @@ Listener::Listener(int ind, detectorType dtype, Fifo*& f, runStatus* s, uint32_t
|
|||||||
carryOverPacket(0),
|
carryOverPacket(0),
|
||||||
listeningPacket(0)
|
listeningPacket(0)
|
||||||
{
|
{
|
||||||
index = ind;
|
|
||||||
|
|
||||||
if(ThreadObject::CreateThread()){
|
if(ThreadObject::CreateThread()){
|
||||||
pthread_mutex_lock(&Mutex);
|
pthread_mutex_lock(&Mutex);
|
||||||
ErrorMask ^= (1<<index);
|
ErrorMask ^= (1<<index);
|
||||||
|
@ -12,8 +12,8 @@ using namespace std;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
ThreadObject::ThreadObject():
|
ThreadObject::ThreadObject(int ind):
|
||||||
index(0),
|
index(ind),
|
||||||
alive(false),
|
alive(false),
|
||||||
killThread(false),
|
killThread(false),
|
||||||
thread(0)
|
thread(0)
|
||||||
|
@ -90,7 +90,11 @@ void UDPRESTImplementation::initialize_REST(){
|
|||||||
string rest_state = "";
|
string rest_state = "";
|
||||||
std::string answer = "";
|
std::string answer = "";
|
||||||
|
|
||||||
// HORRIBLE FIX to get the main receiver
|
/*
|
||||||
|
* HORRIBLE FIX to get the main receiver
|
||||||
|
* TODO: use detID (from baseclass)
|
||||||
|
* it i set by the client before calling initialize()
|
||||||
|
*/
|
||||||
string filename = getFileName();
|
string filename = getFileName();
|
||||||
if (filename.substr(filename.length() - 2) == "d0"){
|
if (filename.substr(filename.length() - 2) == "d0"){
|
||||||
is_main_receiver = true;
|
is_main_receiver = true;
|
||||||
@ -236,14 +240,18 @@ void UDPRESTImplementation::stopReceiver(){
|
|||||||
if(status == RUNNING)
|
if(status == RUNNING)
|
||||||
startReadout();
|
startReadout();
|
||||||
|
|
||||||
while(status == TRANSMITTING)
|
/**
|
||||||
usleep(5000);
|
* while(status == TRANSMITTING)
|
||||||
|
* usleep(5000);
|
||||||
|
* This has been changed, you check if all the threads are done processing
|
||||||
|
* and set the final status
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//change status
|
//change status
|
||||||
status = IDLE;
|
status = IDLE;
|
||||||
|
|
||||||
FILE_LOG(logDEBUG) << __AT__ << "exited, status " << endl;
|
FILE_LOG(logDEBUG) << __AT__ << "exited, status " << endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -326,31 +334,6 @@ int UDPRESTImplementation::shutDownUDPSockets(){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* FIXME
|
|
||||||
* do you really need this, this is called if registerDataCallback() is activated
|
|
||||||
* in your gui to get data from receiver. you probably have a different way
|
|
||||||
* of reconstructing complete data set from all receivers
|
|
||||||
*/
|
|
||||||
void UDPRESTImplementation::readFrame(char* c,char** raw, uint64_t &startAcq, uint64_t &startFrame){
|
|
||||||
FILE_LOG(logDEBUG) << __AT__ << " called";
|
|
||||||
strcpy(c,"");
|
|
||||||
*raw = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* FIXME
|
|
||||||
* Its called by TCP in case of illegal shut down such as Ctrl + c.
|
|
||||||
* Upto you what you want to do with it.
|
|
||||||
*/
|
|
||||||
void UDPRESTImplementation::closeFile(int ithr){
|
|
||||||
FILE_LOG(logDEBUG) << __AT__ << "called for thread " << ithr;
|
|
||||||
FILE_LOG(logDEBUG) << __AT__ << "exited for thread " << ithr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
uint64_t UDPRESTImplementation::getTotalFramesCaught() const{
|
uint64_t UDPRESTImplementation::getTotalFramesCaught() const{
|
||||||
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
FILE_LOG(logDEBUG) << __AT__ << " starting";
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -55,9 +55,6 @@ void UDPStandardImplementation::InitializeMembers() {
|
|||||||
numThreads = 1;
|
numThreads = 1;
|
||||||
numberofJobs = 1;
|
numberofJobs = 1;
|
||||||
|
|
||||||
//*** mutex ***
|
|
||||||
pthread_mutex_init(&statusMutex,NULL);
|
|
||||||
|
|
||||||
//** class objects ***
|
//** class objects ***
|
||||||
generalData = 0;
|
generalData = 0;
|
||||||
}
|
}
|
||||||
@ -196,7 +193,7 @@ int UDPStandardImplementation::setDataStreamEnable(const bool enable) {\
|
|||||||
if (enable) {
|
if (enable) {
|
||||||
bool error = false;
|
bool error = false;
|
||||||
for ( int i = 0; i < numThreads; ++i ) {
|
for ( int i = 0; i < numThreads; ++i ) {
|
||||||
dataStreamer.push_back(new DataStreamer(i, fifo[i], &dynamicRange, &frameToGuiFrequency, &frameToGuiTimerinMS, &shortFrameEnable));
|
dataStreamer.push_back(new DataStreamer(fifo[i], &dynamicRange, &frameToGuiFrequency, &frameToGuiTimerinMS, &shortFrameEnable));
|
||||||
dataStreamer[i]->SetGeneralData(generalData);
|
dataStreamer[i]->SetGeneralData(generalData);
|
||||||
// check again
|
// check again
|
||||||
if (streamingPort == 0)
|
if (streamingPort == 0)
|
||||||
@ -375,8 +372,8 @@ int UDPStandardImplementation::setDetectorType(const detectorType d) {
|
|||||||
|
|
||||||
//create threads
|
//create threads
|
||||||
for ( int i=0; i < numThreads; ++i ) {
|
for ( int i=0; i < numThreads; ++i ) {
|
||||||
listener.push_back(new Listener(i, myDetectorType, fifo[i], &status, &udpPortNum[i], eth, &activated, &numberOfFrames, &dynamicRange));
|
listener.push_back(new Listener(myDetectorType, fifo[i], &status, &udpPortNum[i], eth, &activated, &numberOfFrames, &dynamicRange));
|
||||||
dataProcessor.push_back(new DataProcessor(i, fifo[i], &fileFormatType, &fileWriteEnable, &dataStreamEnable,
|
dataProcessor.push_back(new DataProcessor(fifo[i], &fileFormatType, &fileWriteEnable, &dataStreamEnable,
|
||||||
rawDataReadyCallBack,pRawDataReady));
|
rawDataReadyCallBack,pRawDataReady));
|
||||||
if (Listener::GetErrorMask() || DataProcessor::GetErrorMask()) {
|
if (Listener::GetErrorMask() || DataProcessor::GetErrorMask()) {
|
||||||
FILE_LOG (logERROR) << "Error: Could not creates listener/dataprocessor threads (index:" << i << ")";
|
FILE_LOG (logERROR) << "Error: Could not creates listener/dataprocessor threads (index:" << i << ")";
|
||||||
@ -467,9 +464,7 @@ int UDPStandardImplementation::startReceiver(char *c) {
|
|||||||
FILE_LOG(logINFO) << "Ready ...";
|
FILE_LOG(logINFO) << "Ready ...";
|
||||||
|
|
||||||
//status
|
//status
|
||||||
pthread_mutex_lock(&statusMutex);
|
|
||||||
status = RUNNING;
|
status = RUNNING;
|
||||||
pthread_mutex_unlock(&(statusMutex));
|
|
||||||
|
|
||||||
//Let Threads continue to be ready for acquisition
|
//Let Threads continue to be ready for acquisition
|
||||||
StartRunning();
|
StartRunning();
|
||||||
@ -509,9 +504,7 @@ void UDPStandardImplementation::stopReceiver(){
|
|||||||
usleep(5000);
|
usleep(5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
pthread_mutex_lock(&statusMutex);
|
|
||||||
status = RUN_FINISHED;
|
status = RUN_FINISHED;
|
||||||
pthread_mutex_unlock(&(statusMutex));
|
|
||||||
FILE_LOG(logINFO) << "Status: " << runStatusType(status);
|
FILE_LOG(logINFO) << "Status: " << runStatusType(status);
|
||||||
|
|
||||||
|
|
||||||
@ -541,9 +534,7 @@ void UDPStandardImplementation::stopReceiver(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//change status
|
//change status
|
||||||
pthread_mutex_lock(&statusMutex);
|
|
||||||
status = IDLE;
|
status = IDLE;
|
||||||
pthread_mutex_unlock(&(statusMutex));
|
|
||||||
|
|
||||||
FILE_LOG(logINFO) << "Receiver Stopped";
|
FILE_LOG(logINFO) << "Receiver Stopped";
|
||||||
FILE_LOG(logINFO) << "Status: " << runStatusType(status);
|
FILE_LOG(logINFO) << "Status: " << runStatusType(status);
|
||||||
@ -588,10 +579,7 @@ void UDPStandardImplementation::startReadout(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//set status
|
//set status
|
||||||
pthread_mutex_lock(&statusMutex);
|
|
||||||
status = TRANSMITTING;
|
status = TRANSMITTING;
|
||||||
pthread_mutex_unlock(&statusMutex);
|
|
||||||
|
|
||||||
FILE_LOG(logINFO) << "Status: Transmitting";
|
FILE_LOG(logINFO) << "Status: Transmitting";
|
||||||
}
|
}
|
||||||
//shut down udp sockets so as to make listeners push dummy (end) packets for processors
|
//shut down udp sockets so as to make listeners push dummy (end) packets for processors
|
||||||
@ -732,7 +720,7 @@ int UDPStandardImplementation::SetupFifoStructure() {
|
|||||||
for ( int i = 0; i < numThreads; i++ ) {
|
for ( int i = 0; i < numThreads; i++ ) {
|
||||||
//create fifo structure
|
//create fifo structure
|
||||||
bool success = true;
|
bool success = true;
|
||||||
fifo.push_back( new Fifo (i,
|
fifo.push_back( new Fifo (
|
||||||
(generalData->imageSize) * numberofJobs + (generalData->fifoBufferHeaderSize),
|
(generalData->imageSize) * numberofJobs + (generalData->fifoBufferHeaderSize),
|
||||||
fifoDepth, success));
|
fifoDepth, success));
|
||||||
if (!success) {
|
if (!success) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user