mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-29 17:40:01 +02:00
merged
This commit is contained in:
commit
55c35b6669
@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "Beb.h"
|
#include "Beb.h"
|
||||||
|
|
||||||
|
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
|
||||||
|
|
||||||
|
|
||||||
struct BebInfo beb_infos[10];
|
struct BebInfo beb_infos[10];
|
||||||
@ -172,6 +173,111 @@ void Beb_GetModuleCopnfiguration(int* master, int* top){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void Beb_EndofDataSend(int tengiga){
|
||||||
|
//mapping new memory
|
||||||
|
u_int32_t* csp0base=0;
|
||||||
|
int l_framepktcounter2, l_txndelaycounter, l_framedelaycounter, r_framepktcounter2, r_txndelaycounter, r_framedelaycounter;
|
||||||
|
int l_framepktcounter2_new, l_txndelaycounter_new, l_framedelaycounter_new, r_framepktcounter2_new, r_txndelaycounter_new, r_framedelaycounter_new;
|
||||||
|
int addr_l_framepktcounter2, addr_l_txndelaycounter, addr_l_framedelaycounter, addr_r_framepktcounter2, addr_r_txndelaycounter, addr_r_framedelaycounter;
|
||||||
|
|
||||||
|
switch(tengiga){
|
||||||
|
case 0:
|
||||||
|
addr_l_framepktcounter2 = ONE_GIGA_LEFT_PKT_SEND_COUNTER;
|
||||||
|
addr_l_txndelaycounter = ONE_GIGA_LEFT_TXN_DELAY_COUNTER;
|
||||||
|
addr_l_framedelaycounter = ONE_GIGA_LEFT_FRAME_DELAY_COUNTER;
|
||||||
|
addr_r_framepktcounter2 = ONE_GIGA_RIGHT_PKT_SEND_COUNTER;
|
||||||
|
addr_r_txndelaycounter = ONE_GIGA_RIGHT_TXN_DELAY_COUNTER;
|
||||||
|
addr_r_framedelaycounter = ONE_GIGA_RIGHT_FRAME_DELAY_COUNTER;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
addr_l_framepktcounter2 = TEN_GIGA_LEFT_PKT_SEND_COUNTER;
|
||||||
|
addr_l_txndelaycounter = TEN_GIGA_LEFT_TXN_DELAY_COUNTER;
|
||||||
|
addr_l_framedelaycounter = TEN_GIGA_LEFT_FRAME_DELAY_COUNTER;
|
||||||
|
addr_r_framepktcounter2 = TEN_GIGA_RIGHT_PKT_SEND_COUNTER;
|
||||||
|
addr_r_txndelaycounter = TEN_GIGA_RIGHT_TXN_DELAY_COUNTER;
|
||||||
|
addr_r_framedelaycounter = TEN_GIGA_RIGHT_FRAME_DELAY_COUNTER;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//open file pointer
|
||||||
|
int fd = Beb_open(&csp0base,XPAR_COUNTER_BASEADDR);
|
||||||
|
if(fd < 0){
|
||||||
|
cprintf(BG_RED,"Delay read counter fail\n");
|
||||||
|
return;
|
||||||
|
}else{
|
||||||
|
//read data first time
|
||||||
|
l_framepktcounter2 = Beb_Read32(csp0base, addr_l_framepktcounter2);
|
||||||
|
l_txndelaycounter = Beb_Read32(csp0base, addr_l_txndelaycounter);
|
||||||
|
l_framedelaycounter = Beb_Read32(csp0base, addr_l_framedelaycounter);
|
||||||
|
r_framepktcounter2 = Beb_Read32(csp0base, addr_r_framepktcounter2);
|
||||||
|
r_txndelaycounter = Beb_Read32(csp0base, addr_r_txndelaycounter);
|
||||||
|
r_framedelaycounter = Beb_Read32(csp0base, addr_r_framedelaycounter);
|
||||||
|
//#ifdef VERBOSE
|
||||||
|
printf("\nLeft\n"
|
||||||
|
"Framepacketcounter: %d\n"
|
||||||
|
"Txndelaycounter:%d\n"
|
||||||
|
"Framedelaycounter:%d\n"
|
||||||
|
"\nRight\n"
|
||||||
|
"Framepacketcounter: %d\n"
|
||||||
|
"Txndelaycounter:%d\n"
|
||||||
|
"Framedelaycounter:%d\n\n",
|
||||||
|
l_framepktcounter2,l_txndelaycounter,l_framedelaycounter,
|
||||||
|
r_framepktcounter2,r_txndelaycounter,r_framedelaycounter);
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
//keep comparing with previous values
|
||||||
|
int maxtimer;
|
||||||
|
while(1){
|
||||||
|
maxtimer = MAX(MAX(l_txndelaycounter,l_framedelaycounter),MAX(r_txndelaycounter,r_framedelaycounter));
|
||||||
|
maxtimer /= 100;
|
||||||
|
printf("Will wait for %d us\n",maxtimer);
|
||||||
|
usleep(maxtimer);
|
||||||
|
|
||||||
|
//read new values
|
||||||
|
l_framepktcounter2_new = Beb_Read32(csp0base, addr_l_framepktcounter2);
|
||||||
|
l_txndelaycounter_new = Beb_Read32(csp0base, addr_l_txndelaycounter);
|
||||||
|
l_framedelaycounter_new = Beb_Read32(csp0base, addr_l_framedelaycounter);
|
||||||
|
r_framepktcounter2_new = Beb_Read32(csp0base, addr_r_framepktcounter2);
|
||||||
|
r_txndelaycounter_new = Beb_Read32(csp0base, addr_r_txndelaycounter);
|
||||||
|
r_framedelaycounter_new = Beb_Read32(csp0base, addr_r_framedelaycounter);
|
||||||
|
//#ifdef VERBOSE
|
||||||
|
printf("\nLeft\n"
|
||||||
|
"Framepacketcounter: %d\n"
|
||||||
|
"Txndelaycounter:%d\n"
|
||||||
|
"Framedelaycounter:%d\n"
|
||||||
|
"\nRight\n"
|
||||||
|
"Framepacketcounter: %d\n"
|
||||||
|
"Txndelaycounter:%d\n"
|
||||||
|
"Framedelaycounter:%d\n\n",
|
||||||
|
l_framepktcounter2_new,l_txndelaycounter_new,l_framedelaycounter_new,
|
||||||
|
r_framepktcounter2_new,r_txndelaycounter_new,r_framedelaycounter_new);
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
if ((l_framepktcounter2 == l_framepktcounter2_new) && (r_framepktcounter2 == r_framepktcounter2_new))
|
||||||
|
break;
|
||||||
|
|
||||||
|
//update old values
|
||||||
|
l_framepktcounter2 = l_framepktcounter2_new;
|
||||||
|
l_txndelaycounter = l_txndelaycounter_new;
|
||||||
|
l_framedelaycounter = l_framedelaycounter_new;
|
||||||
|
r_framepktcounter2 = r_framepktcounter2_new;
|
||||||
|
r_txndelaycounter = r_txndelaycounter_new;
|
||||||
|
r_framedelaycounter = r_framedelaycounter_new;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("Detector has send all data\n");
|
||||||
|
//close file pointer
|
||||||
|
Beb_close(fd,csp0base);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* do not work at the moment */
|
/* do not work at the moment */
|
||||||
int Beb_SetMasterViaSoftware(){
|
int Beb_SetMasterViaSoftware(){
|
||||||
|
|
||||||
|
@ -46,6 +46,8 @@ struct BebInfo{
|
|||||||
|
|
||||||
|
|
||||||
void Beb_GetModuleCopnfiguration(int* master, int* top);
|
void Beb_GetModuleCopnfiguration(int* master, int* top);
|
||||||
|
void Beb_EndofDataSend(int tengiga);
|
||||||
|
|
||||||
int Beb_SetMasterViaSoftware();
|
int Beb_SetMasterViaSoftware();
|
||||||
int Beb_SetSlaveViaSoftware();
|
int Beb_SetSlaveViaSoftware();
|
||||||
int Beb_Activate(int enable);
|
int Beb_Activate(int enable);
|
||||||
|
@ -153,3 +153,46 @@
|
|||||||
//temp so far
|
//temp so far
|
||||||
#define FEB_REG_STATUS 0xa
|
#define FEB_REG_STATUS 0xa
|
||||||
|
|
||||||
|
//1g counters
|
||||||
|
#define ONE_GIGA_LEFT_FRAME_SEND_COUNTER 0x04
|
||||||
|
#define ONE_GIGA_LEFT_PKT_SEND_COUNTER 0x24
|
||||||
|
|
||||||
|
#define ONE_GIGA_LEFT_TXN_DELAY_COUNTER 0x104
|
||||||
|
#define ONE_GIGA_LEFT_FRAME_DELAY_COUNTER 0x124
|
||||||
|
|
||||||
|
#define ONE_GIGA_RIGHT_FRAME_SEND_COUNTER 0x44
|
||||||
|
#define ONE_GIGA_RIGHT_PKT_SEND_COUNTER 0x64
|
||||||
|
|
||||||
|
#define ONE_GIGA_RIGHT_TXN_DELAY_COUNTER 0x144
|
||||||
|
#define ONE_GIGA_RIGHT_FRAME_DELAY_COUNTER 0x164
|
||||||
|
|
||||||
|
//10g counters
|
||||||
|
#define TEN_GIGA_LEFT_FRAME_SEND_COUNTER 0x84
|
||||||
|
#define TEN_GIGA_LEFT_PKT_SEND_COUNTER 0xa4
|
||||||
|
|
||||||
|
#define TEN_GIGA_LEFT_TXN_DELAY_COUNTER 0x184
|
||||||
|
#define TEN_GIGA_LEFT_FRAME_DELAY_COUNTER 0x1a4
|
||||||
|
|
||||||
|
#define TEN_GIGA_RIGHT_FRAME_SEND_COUNTER 0xc4
|
||||||
|
#define TEN_GIGA_RIGHT_PKT_SEND_COUNTER 0xe4
|
||||||
|
|
||||||
|
#define TEN_GIGA_RIGHT_TXN_DELAY_COUNTER 0x1c4
|
||||||
|
#define TEN_GIGA_RIGHT_FRAME_DELAY_COUNTER 0x1e4
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BIN
slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv2.2.0.16.2
Executable file
BIN
slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv2.2.0.16.2
Executable file
Binary file not shown.
@ -871,6 +871,11 @@ void readFrame(int *ret, char *mess){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//wait for detector to send
|
||||||
|
Beb_EndofDataSend(send_to_ten_gig);
|
||||||
|
|
||||||
|
|
||||||
printf("*****Done Waiting...\n");
|
printf("*****Done Waiting...\n");
|
||||||
*ret = (int)FINISHED;
|
*ret = (int)FINISHED;
|
||||||
strcpy(mess,"acquisition successfully finished\n");
|
strcpy(mess,"acquisition successfully finished\n");
|
||||||
|
@ -45,4 +45,5 @@ enum detAdcIndex{TEMP_FPGAEXT, TEMP_10GE, TEMP_DCDC, TEMP_SODL, TEMP_SODR, TEMP_
|
|||||||
enum detNetworkParameter{TXN_LEFT, TXN_RIGHT, TXN_FRAME,FLOWCTRL_10G};
|
enum detNetworkParameter{TXN_LEFT, TXN_RIGHT, TXN_FRAME,FLOWCTRL_10G};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* SLSDETECTORSERVER_DEFS_H_ */
|
#endif /* SLSDETECTORSERVER_DEFS_H_ */
|
||||||
|
@ -61,6 +61,12 @@ XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR
|
|||||||
#define XPAR_PLB_GPIO_TEST_HIGHADDR 0xD101FFFF
|
#define XPAR_PLB_GPIO_TEST_HIGHADDR 0xD101FFFF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Definitions for packet, frame and delay down counters */
|
||||||
|
#define XPAR_COUNTER_BASEADDR 0xD1020000
|
||||||
|
#define XPAR_COUNTER_HIGHADDR 0xD102FFFF
|
||||||
|
|
||||||
|
|
||||||
/* Definitions for peripheral PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT */
|
/* Definitions for peripheral PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT */
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR 0xC4100000
|
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_BASEADDR 0xC4100000
|
||||||
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_HIGHADDR 0xC410FFFF
|
#define XPAR_PLB_LL_FIFO_AURORA_DUAL_CTRL_FEB_LEFT_HIGHADDR 0xC410FFFF
|
||||||
|
@ -268,6 +268,7 @@ multiSlsDetector::multiSlsDetector(int id) : slsDetectorUtils(), shmId(-1)
|
|||||||
|
|
||||||
getNMods();
|
getNMods();
|
||||||
getMaxMods();
|
getMaxMods();
|
||||||
|
threadStarted = false;
|
||||||
threadpool = 0;
|
threadpool = 0;
|
||||||
if(createThreadPool() == FAIL)
|
if(createThreadPool() == FAIL)
|
||||||
exit(-1);
|
exit(-1);
|
||||||
@ -4938,6 +4939,7 @@ int multiSlsDetector::getFramesCaughtByReceiver() {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (int i=0; i<thisMultiDetector->numberOfDetectors; i++)
|
for (int i=0; i<thisMultiDetector->numberOfDetectors; i++)
|
||||||
if (detectors[i]){
|
if (detectors[i]){
|
||||||
ret1+=detectors[i]->getFramesCaughtByReceiver();
|
ret1+=detectors[i]->getFramesCaughtByReceiver();
|
||||||
|
@ -4029,6 +4029,8 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
|||||||
std::cout<< "Timer " << index << " set to "<< thisDetector->timerValue[index] << "ns" << std::endl;
|
std::cout<< "Timer " << index << " set to "<< thisDetector->timerValue[index] << "ns" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
if(t!=-1){
|
||||||
if ((thisDetector->myDetectorType==MYTHEN)&&(index==PROBES_NUMBER)) {
|
if ((thisDetector->myDetectorType==MYTHEN)&&(index==PROBES_NUMBER)) {
|
||||||
setDynamicRange();
|
setDynamicRange();
|
||||||
//cout << "Changing probes: data size = " << thisDetector->dataBytes <<endl;
|
//cout << "Changing probes: data size = " << thisDetector->dataBytes <<endl;
|
||||||
@ -4051,6 +4053,7 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
|
|||||||
&& (t>=0) && getRateCorrection(r)){
|
&& (t>=0) && getRateCorrection(r)){
|
||||||
setRateCorrection(r);
|
setRateCorrection(r);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -7071,8 +7074,11 @@ string slsDetector::setFilePath(string s) {
|
|||||||
if(stat(s.c_str(),&st)){
|
if(stat(s.c_str(),&st)){
|
||||||
std::cout << "path does not exist" << endl;
|
std::cout << "path does not exist" << endl;
|
||||||
setErrorMask((getErrorMask())|(FILE_PATH_DOES_NOT_EXIST));
|
setErrorMask((getErrorMask())|(FILE_PATH_DOES_NOT_EXIST));
|
||||||
}else
|
}else{
|
||||||
|
pthread_mutex_lock(&ms);
|
||||||
fileIO::setFilePath(s);
|
fileIO::setFilePath(s);
|
||||||
|
pthread_mutex_unlock(&ms);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7084,8 +7090,11 @@ string slsDetector::setFilePath(string s) {
|
|||||||
if (connectData() == OK)
|
if (connectData() == OK)
|
||||||
ret=thisReceiver->sendString(fnum,retval,arg);
|
ret=thisReceiver->sendString(fnum,retval,arg);
|
||||||
disconnectData();
|
disconnectData();
|
||||||
if(ret!=FAIL)
|
if(ret!=FAIL){
|
||||||
|
pthread_mutex_lock(&ms);
|
||||||
fileIO::setFilePath(string(retval));
|
fileIO::setFilePath(string(retval));
|
||||||
|
pthread_mutex_unlock(&ms);
|
||||||
|
}
|
||||||
else if(!s.empty()){
|
else if(!s.empty()){
|
||||||
std::cout << "path does not exist" << endl;
|
std::cout << "path does not exist" << endl;
|
||||||
setErrorMask((getErrorMask())|(FILE_PATH_DOES_NOT_EXIST));
|
setErrorMask((getErrorMask())|(FILE_PATH_DOES_NOT_EXIST));
|
||||||
@ -7094,7 +7103,11 @@ string slsDetector::setFilePath(string s) {
|
|||||||
updateReceiver();
|
updateReceiver();
|
||||||
}
|
}
|
||||||
|
|
||||||
return fileIO::getFilePath();
|
pthread_mutex_lock(&ms);
|
||||||
|
s = fileIO::getFilePath();
|
||||||
|
pthread_mutex_unlock(&ms);
|
||||||
|
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -7139,7 +7152,11 @@ string slsDetector::setFileName(string s) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return fileIO::getFileName();
|
pthread_mutex_lock(&ms);
|
||||||
|
s = fileIO::getFileName();
|
||||||
|
pthread_mutex_unlock(&ms);
|
||||||
|
|
||||||
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -7451,16 +7468,22 @@ int slsDetector::updateReceiverNoWait() {
|
|||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Updating receiver last modified by " << lastClientIP << std::endl;
|
cout << "Updating receiver last modified by " << lastClientIP << std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
n = dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
|
n = dataSocket->ReceiveDataOnly(&ind,sizeof(ind));
|
||||||
pthread_mutex_lock(&ms);
|
pthread_mutex_lock(&ms);
|
||||||
fileIO::setFileIndex(ind);
|
fileIO::setFileIndex(ind);
|
||||||
pthread_mutex_unlock(&ms);
|
pthread_mutex_unlock(&ms);
|
||||||
|
|
||||||
n = dataSocket->ReceiveDataOnly(path,MAX_STR_LENGTH);
|
n = dataSocket->ReceiveDataOnly(path,MAX_STR_LENGTH);
|
||||||
|
pthread_mutex_lock(&ms);
|
||||||
fileIO::setFilePath(path);
|
fileIO::setFilePath(path);
|
||||||
|
pthread_mutex_unlock(&ms);
|
||||||
|
|
||||||
n = dataSocket->ReceiveDataOnly(path,MAX_STR_LENGTH);
|
n = dataSocket->ReceiveDataOnly(path,MAX_STR_LENGTH);
|
||||||
pthread_mutex_lock(&ms);
|
pthread_mutex_lock(&ms);
|
||||||
fileIO::setFileName(path);
|
fileIO::setFileName(path);
|
||||||
pthread_mutex_unlock(&ms);
|
pthread_mutex_unlock(&ms);
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -7611,7 +7634,9 @@ int slsDetector::setFrameIndex(int index){
|
|||||||
int arg = index;
|
int arg = index;
|
||||||
|
|
||||||
if(thisDetector->receiverOnlineFlag==OFFLINE_FLAG){
|
if(thisDetector->receiverOnlineFlag==OFFLINE_FLAG){
|
||||||
|
pthread_mutex_lock(&ms);
|
||||||
fileIO::setFrameIndex(index);
|
fileIO::setFrameIndex(index);
|
||||||
|
pthread_mutex_unlock(&ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if(setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG){
|
else if(setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG){
|
||||||
@ -7621,13 +7646,19 @@ int slsDetector::setFrameIndex(int index){
|
|||||||
if (connectData() == OK)
|
if (connectData() == OK)
|
||||||
ret=thisReceiver->sendInt(fnum,retval,arg);
|
ret=thisReceiver->sendInt(fnum,retval,arg);
|
||||||
disconnectData();
|
disconnectData();
|
||||||
if(ret!=FAIL)
|
if(ret!=FAIL){
|
||||||
|
pthread_mutex_lock(&ms);
|
||||||
fileIO::setFrameIndex(retval);
|
fileIO::setFrameIndex(retval);
|
||||||
|
pthread_mutex_unlock(&ms);
|
||||||
|
}
|
||||||
if(ret==FORCE_UPDATE)
|
if(ret==FORCE_UPDATE)
|
||||||
updateReceiver();
|
updateReceiver();
|
||||||
}
|
}
|
||||||
|
pthread_mutex_lock(&ms);
|
||||||
|
retval = fileIO::getFrameIndex();
|
||||||
|
pthread_mutex_unlock(&ms);
|
||||||
|
|
||||||
return fileIO::getFrameIndex();
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -146,18 +146,17 @@ int slsDetectorUtils::acquire(int delflag){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(receiver){
|
if(receiver){
|
||||||
|
pthread_mutex_lock(&mg);
|
||||||
if(getReceiverStatus()!=IDLE)
|
if(getReceiverStatus()!=IDLE)
|
||||||
stopReceiver();
|
stopReceiver();
|
||||||
if(setReceiverOnline()==OFFLINE_FLAG)
|
|
||||||
*stoppedFlag=1;
|
|
||||||
//multi detectors shouldnt have different receiver read frequencies enabled/disabled
|
//multi detectors shouldnt have different receiver read frequencies enabled/disabled
|
||||||
if(setReadReceiverFrequency(0) < 0){
|
if(setReadReceiverFrequency(0) < 0){
|
||||||
std::cout << "Error: The receiver read frequency is invalid:" << setReadReceiverFrequency(0) << std::endl;
|
std::cout << "Error: The receiver read frequency is invalid:" << setReadReceiverFrequency(0) << std::endl;
|
||||||
*stoppedFlag=1;
|
*stoppedFlag=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(setReceiverOnline()==OFFLINE_FLAG)
|
if(setReceiverOnline()==OFFLINE_FLAG)
|
||||||
*stoppedFlag=1;
|
*stoppedFlag=1;
|
||||||
|
pthread_mutex_unlock(&mg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -395,7 +395,9 @@ int postProcessing::fillBadChannelMask() {
|
|||||||
|
|
||||||
|
|
||||||
void* postProcessing::processData(int delflag) {
|
void* postProcessing::processData(int delflag) {
|
||||||
|
pthread_mutex_lock(&mg);
|
||||||
if(setReceiverOnline()==OFFLINE_FLAG){
|
if(setReceiverOnline()==OFFLINE_FLAG){
|
||||||
|
pthread_mutex_unlock(&mg);
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout<< " ??????????????????????????????????????????? processing data - threaded mode " << *threadedProcessing << endl;
|
std::cout<< " ??????????????????????????????????????????? processing data - threaded mode " << *threadedProcessing << endl;
|
||||||
@ -482,6 +484,7 @@ void* postProcessing::processData(int delflag) {
|
|||||||
}
|
}
|
||||||
//receiver
|
//receiver
|
||||||
else{
|
else{
|
||||||
|
pthread_mutex_unlock(&mg);
|
||||||
//cprintf(RED,"In post processing threads\n");
|
//cprintf(RED,"In post processing threads\n");
|
||||||
|
|
||||||
|
|
||||||
@ -493,19 +496,24 @@ void* postProcessing::processData(int delflag) {
|
|||||||
else{
|
else{
|
||||||
int caught = -1;
|
int caught = -1;
|
||||||
while(true){
|
while(true){
|
||||||
cout.flush();
|
|
||||||
cout<<flush;
|
//cout.flush();
|
||||||
usleep(20000); //20ms need this else connecting error to receiver (too fast)
|
//cout<<flush;
|
||||||
|
usleep(40000); //20ms need this else connecting error to receiver (too fast)
|
||||||
|
|
||||||
if (checkJoinThread()){
|
if (checkJoinThread()){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
//get progress
|
//get progress
|
||||||
if(setReceiverOnline() == ONLINE_FLAG){
|
|
||||||
pthread_mutex_lock(&mg);
|
pthread_mutex_lock(&mg);
|
||||||
|
if(setReceiverOnline() == ONLINE_FLAG){
|
||||||
caught = getFramesCaughtByReceiver();
|
caught = getFramesCaughtByReceiver();
|
||||||
pthread_mutex_unlock(&mg);
|
|
||||||
}
|
}
|
||||||
|
pthread_mutex_unlock(&mg);
|
||||||
|
|
||||||
|
|
||||||
//updating progress
|
//updating progress
|
||||||
if(caught!= -1){
|
if(caught!= -1){
|
||||||
setCurrentProgress(caught);
|
setCurrentProgress(caught);
|
||||||
@ -516,6 +524,9 @@ void* postProcessing::processData(int delflag) {
|
|||||||
if (checkJoinThread()){
|
if (checkJoinThread()){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user