mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-05 17:40:40 +02:00
setting number of frames had a bug in eiger server, refactored code a bit
This commit is contained in:
parent
dd8f48929c
commit
b24f374155
@ -1048,31 +1048,20 @@ int Feb_Control_WaitForFinishedFlag(int sleep_time_us){
|
||||
|
||||
int Feb_Control_AcquisitionInProgress(){
|
||||
unsigned int status_reg_r=0,status_reg_l=0;
|
||||
|
||||
/*printf("master right:%d\n",Feb_Control_GetDAQStatusRegister(Module_GetTopRightAddress(&modules[0]),&status_reg_r));
|
||||
printf("master left:%d\n",Feb_Control_GetDAQStatusRegister(Module_GetTopLeftAddress(&modules[0]),&status_reg_l));
|
||||
|
||||
|
||||
printf("top right:%d\n",Feb_Control_GetDAQStatusRegister(Module_GetTopRightAddress(&modules[1]),&status_reg_r));
|
||||
printf("top left:%d\n",Feb_Control_GetDAQStatusRegister(Module_GetTopLeftAddress(&modules[1]),&status_reg_l));
|
||||
|
||||
if(Module_BottomAddressIsValid(&modules[1])){
|
||||
printf("bot right:%d\n",Feb_Control_GetDAQStatusRegister(Module_GetBottomRightAddress(&modules[1]),&status_reg_r));
|
||||
printf("bot left:%d\n",Feb_Control_GetDAQStatusRegister(Module_GetBottomLeftAddress(&modules[1]),&status_reg_l));
|
||||
}
|
||||
*/
|
||||
if(Module_BottomAddressIsValid(&modules[1])){
|
||||
//printf("************* bottom1\n");
|
||||
|
||||
if(!(Feb_Control_GetDAQStatusRegister(Module_GetBottomRightAddress(&modules[1]),&status_reg_r)))
|
||||
{printf("**bottom address wrong\n");return 0;}
|
||||
{printf("ERROR: Trouble reading Status register. bottom right address\n");return 0;}
|
||||
if(!(Feb_Control_GetDAQStatusRegister(Module_GetBottomLeftAddress(&modules[1]),&status_reg_l)))
|
||||
{printf("ERROR: Trouble reading Status register. bottom left address\n");return 0;}
|
||||
|
||||
}else{
|
||||
//printf("************* top1\n");
|
||||
if(!(Feb_Control_GetDAQStatusRegister(Module_GetTopRightAddress(&modules[1]),&status_reg_r)))
|
||||
{printf("**top address wrong\n");return 0;}
|
||||
{printf("ERROR: Trouble reading Status register. top right address\n");return 0;}
|
||||
if(!(Feb_Control_GetDAQStatusRegister(Module_GetTopLeftAddress(&modules[1]),&status_reg_l)))
|
||||
{printf("ERROR: Trouble reading Status register. top left address\n");return 0;}
|
||||
}
|
||||
printf("runningggg 0x%x\n",status_reg_r);
|
||||
if(status_reg_r&DAQ_STATUS_DAQ_RUNNING) {printf("**runningggg\n");return 1;}
|
||||
if((status_reg_r|status_reg_l)&DAQ_STATUS_DAQ_RUNNING) {/*printf("**runningggg\n");*/return 1;}
|
||||
|
||||
/*
|
||||
if(!(GetDAQStatusRegister(modules[i]->Module_GetTopLeftAddress(),status_reg_r)&&GetDAQStatusRegister(modules[i]->Module_GetTopRightAddress(),status_reg_l))){
|
||||
@ -1083,7 +1072,8 @@ int Feb_Control_AcquisitionInProgress(){
|
||||
}
|
||||
*/
|
||||
|
||||
printf("**idle\n");return 0; //i.e. not running (status_reg_r|status_reg_l)&DAQ_STATUS_DAQ_RUNNING;
|
||||
/*printf("**idle\n");*/
|
||||
return 0; //i.e. not running (status_reg_r|status_reg_l)&DAQ_STATUS_DAQ_RUNNING;
|
||||
}
|
||||
|
||||
int Feb_Control_Reset(){
|
||||
|
@ -1,6 +1,6 @@
|
||||
CC = powerpc-4xx-softfloat-gcc
|
||||
CCX = powerpc-4xx-softfloat-g++
|
||||
CFLAGS += -Wall -DDACS_INT -DEIGERD -DSLS_DETECTOR_FUNCTION_LIST -DDACS_INT -DSTOP_SERVER #-DVERBOSE #-DVIRTUAL -DPCCOMPILE
|
||||
CFLAGS += -Wall -DDACS_INT -DEIGERD -DSLS_DETECTOR_FUNCTION_LIST -DDACS_INT #-DSTOP_SERVER #-DVERBOSE #-DVIRTUAL -DPCCOMPILE
|
||||
LDLIBS += -lm -lstdc++
|
||||
|
||||
PROGS = eigerDetectorServer
|
||||
|
Binary file not shown.
@ -464,24 +464,12 @@ int startStateMachine(){
|
||||
|
||||
|
||||
printf("requesting images\n");
|
||||
//RequestImages();
|
||||
int ret_val = 0;
|
||||
dst_requested[0] = 1;
|
||||
while(dst_requested[on_dst]){
|
||||
//waits on data
|
||||
if((ret_val = (!Beb_RequestNImages(0,1,send_to_ten_gig,on_dst,nimages_per_request,0)||
|
||||
!Beb_RequestNImages(0,2,send_to_ten_gig,0x20|on_dst,nimages_per_request,0))))
|
||||
break;
|
||||
dst_requested[on_dst++]=0;
|
||||
on_dst%=ndsts_in_use;
|
||||
}
|
||||
int ret = startReadOut();
|
||||
|
||||
if(ret_val)
|
||||
return FAIL;
|
||||
else
|
||||
return OK;
|
||||
while(getRunStatus() == IDLE);
|
||||
printf("Acquiring..\n");
|
||||
|
||||
return FAIL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@ -513,8 +501,6 @@ int startReadOut(){
|
||||
return FAIL;
|
||||
else
|
||||
return OK;
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
@ -534,6 +520,8 @@ enum runStatus getRunStatus(){
|
||||
char *readFrame(int *ret, char *mess){
|
||||
if(!Feb_Control_WaitForFinishedFlag(5000))
|
||||
printf("error in waiting for finished flag\n");
|
||||
printf("acquisition finished\n");
|
||||
|
||||
*ret = (int)FINISHED;
|
||||
return NULL;
|
||||
}
|
||||
@ -549,8 +537,8 @@ int64_t setTimer(enum timerIndex ind, int64_t val){
|
||||
switch(ind){
|
||||
case FRAME_NUMBER:
|
||||
if(val >= 0){
|
||||
printf(" Setting number of frames: %d\n",(unsigned int)val);
|
||||
if(Feb_Control_SetNExposures((unsigned int)val)*eiger_ncycles){
|
||||
printf(" Setting number of frames: %d * %d\n",(unsigned int)val,eiger_ncycles);
|
||||
if(Feb_Control_SetNExposures((unsigned int)val*eiger_ncycles)){
|
||||
eiger_nexposures = val;
|
||||
//SetDestinationParameters(EigerGetNumberOfExposures()*EigerGetNumberOfCycles());
|
||||
on_dst = 0;
|
||||
@ -587,7 +575,7 @@ int64_t setTimer(enum timerIndex ind, int64_t val){
|
||||
return EigerGetNumberOfExposures();*/
|
||||
case CYCLES_NUMBER:
|
||||
if(val >= 0){
|
||||
printf(" Setting number of triggers: %d\n",(unsigned int)val);
|
||||
printf(" Setting number of triggers: %d * %d\n",(unsigned int)val,eiger_nexposures);
|
||||
if(Feb_Control_SetNExposures((unsigned int)val*eiger_nexposures)){
|
||||
eiger_ncycles = val;
|
||||
//SetDestinationParameters(EigerGetNumberOfExposures()*EigerGetNumberOfCycles());
|
||||
|
@ -2275,9 +2275,9 @@ int get_run_status(int file_des) {
|
||||
enum runStatus s;
|
||||
sprintf(mess,"getting run status\n");
|
||||
|
||||
//#ifdef VERBOSE
|
||||
#ifdef VERBOSE
|
||||
printf("Getting status\n");
|
||||
//#endif
|
||||
#endif
|
||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||
s= getRunStatus();printf("status:%d\n");
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user