mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 08:10:02 +02:00
continuous and storeinram variable
This commit is contained in:
parent
a8fc34c92b
commit
0d83346943
@ -420,9 +420,9 @@ enum readOutFlags {
|
|||||||
BACKGROUND_CORRECTIONS=0x1000, /**<background corrections */
|
BACKGROUND_CORRECTIONS=0x1000, /**<background corrections */
|
||||||
TOT_MODE=0x2000,/**<pump-probe mode */
|
TOT_MODE=0x2000,/**<pump-probe mode */
|
||||||
CONTINOUS_RO=0x4000,/**<pump-probe mode */
|
CONTINOUS_RO=0x4000,/**<pump-probe mode */
|
||||||
PARALLEL=0x10,/** <eiger parallel mode */
|
PARALLEL=0x10000,/** <eiger parallel mode */
|
||||||
NONPARALLEL=0x20,/** <eiger serial mode */
|
NONPARALLEL=0x20000,/** <eiger serial mode */
|
||||||
SAFE=0x40/** <eiger safe mode */
|
SAFE=0x40000/** <eiger safe mode */
|
||||||
};
|
};
|
||||||
/**
|
/**
|
||||||
trimming modes
|
trimming modes
|
||||||
|
Binary file not shown.
@ -17,6 +17,8 @@
|
|||||||
enum detectorSettings thisSettings;
|
enum detectorSettings thisSettings;
|
||||||
const char* dac_names[16] = {"SvP","Vtr","Vrf","Vrs","SvN","Vtgstv","Vcmp_ll","Vcmp_lr","cal","Vcmp_rl","rxb_rb","rxb_lb","Vcmp_rr","Vcp","Vcn","Vis"};
|
const char* dac_names[16] = {"SvP","Vtr","Vrf","Vrs","SvN","Vtgstv","Vcmp_ll","Vcmp_lr","cal","Vcmp_rl","rxb_rb","rxb_lb","Vcmp_rr","Vcp","Vcn","Vis"};
|
||||||
|
|
||||||
|
enum{E_PARALLEL, E_NON_PARALLEL, E_SAFE};
|
||||||
|
|
||||||
//static const string dacNames[16] = {"Svp","Svn","Vtr","Vrf","Vrs","Vtgstv","Vcmp_ll","Vcmp_lr","Cal","Vcmp_rl","Vcmp_rr","Rxb_rb","Rxb_lb","Vcp","Vcn","Vis"};
|
//static const string dacNames[16] = {"Svp","Svn","Vtr","Vrf","Vrs","Vtgstv","Vcmp_ll","Vcmp_lr","Cal","Vcmp_rl","Vcmp_rr","Rxb_rb","Rxb_lb","Vcp","Vcn","Vis"};
|
||||||
|
|
||||||
sls_detector_module *detectorModules=NULL;
|
sls_detector_module *detectorModules=NULL;
|
||||||
@ -31,6 +33,7 @@ int eiger_iodelay = 0;
|
|||||||
int eiger_photonenergy = 0;
|
int eiger_photonenergy = 0;
|
||||||
int eiger_dynamicrange = 0;
|
int eiger_dynamicrange = 0;
|
||||||
int eiger_readoutmode = 0;
|
int eiger_readoutmode = 0;
|
||||||
|
int eiger_storeinmem = 0;
|
||||||
int eiger_readoutspeed = 0;
|
int eiger_readoutspeed = 0;
|
||||||
int eiger_triggermode = 0;
|
int eiger_triggermode = 0;
|
||||||
int eiger_extgating = 0;
|
int eiger_extgating = 0;
|
||||||
@ -131,9 +134,9 @@ int initDetector(){
|
|||||||
setTimer(FRAME_PERIOD,1E9);
|
setTimer(FRAME_PERIOD,1E9);
|
||||||
setDynamicRange(16);
|
setDynamicRange(16);
|
||||||
setThresholdEnergy(8000,0);
|
setThresholdEnergy(8000,0);
|
||||||
setReadOutFlags(PARALLEL);
|
setReadOutFlags(NONPARALLEL);
|
||||||
setSpeed(0,1);//clk_devider,half speed
|
setSpeed(0,1);//clk_devider,half speed
|
||||||
setHighVolage(150,0);
|
setHighVolage(0,0);
|
||||||
setIODelay(675,0);
|
setIODelay(675,0);
|
||||||
setTiming(AUTO_TIMING);
|
setTiming(AUTO_TIMING);
|
||||||
//SetPhotonEnergyCalibrationParameters(-5.8381e-5,1.838515,5.09948e-7,-4.32390e-11,1.32527e-15);
|
//SetPhotonEnergyCalibrationParameters(-5.8381e-5,1.838515,5.09948e-7,-4.32390e-11,1.32527e-15);
|
||||||
@ -486,15 +489,17 @@ int startReceiver(int d){
|
|||||||
|
|
||||||
|
|
||||||
int startStateMachine(){
|
int startStateMachine(){
|
||||||
int ret,prev_flag;
|
int ret = OK,prev_flag;
|
||||||
//get the DAQ toggle bit
|
//get the DAQ toggle bit
|
||||||
prev_flag = Feb_Control_AcquisitionStartedBit();
|
prev_flag = Feb_Control_AcquisitionStartedBit();
|
||||||
|
|
||||||
printf("Going to start acquisition\n");
|
printf("Going to start acquisition\n");
|
||||||
Feb_Control_StartAcquisition();
|
Feb_Control_StartAcquisition();
|
||||||
|
|
||||||
printf("requesting images\n");
|
if(!eiger_storeinmem){
|
||||||
|
printf("requesting images right after start\n");
|
||||||
ret = startReadOut();
|
ret = startReadOut();
|
||||||
|
}
|
||||||
|
|
||||||
//wait for acquisition start
|
//wait for acquisition start
|
||||||
if(ret == OK){
|
if(ret == OK){
|
||||||
@ -504,6 +509,7 @@ int startStateMachine(){
|
|||||||
}
|
}
|
||||||
cprintf(GREEN,"***Acquisition started\n");
|
cprintf(GREEN,"***Acquisition started\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*while(getRunStatus() == IDLE){printf("waiting for being not idle anymore\n");}*/
|
/*while(getRunStatus() == IDLE){printf("waiting for being not idle anymore\n");}*/
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
@ -569,6 +575,15 @@ char *readFrame(int *ret, char *mess){
|
|||||||
if(!Feb_Control_WaitForFinishedFlag(5000))
|
if(!Feb_Control_WaitForFinishedFlag(5000))
|
||||||
cprintf(RED,"Error: Waiting for finished flag\n");
|
cprintf(RED,"Error: Waiting for finished flag\n");
|
||||||
cprintf(GREEN,"Acquisition finished***\n");
|
cprintf(GREEN,"Acquisition finished***\n");
|
||||||
|
|
||||||
|
if(eiger_storeinmem){
|
||||||
|
printf("requesting images after storing in memory\n");
|
||||||
|
if(startReadOut() == FAIL){
|
||||||
|
cprintf(RED, "Could not read out images\n");
|
||||||
|
*ret = (int)FAIL;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
//usleep(0);
|
//usleep(0);
|
||||||
usleep(1000000);
|
usleep(1000000);
|
||||||
printf("*****Done Waiting...\n");
|
printf("*****Done Waiting...\n");
|
||||||
@ -677,26 +692,53 @@ int setDynamicRange(int dr){
|
|||||||
|
|
||||||
|
|
||||||
enum readOutFlags setReadOutFlags(enum readOutFlags val){
|
enum readOutFlags setReadOutFlags(enum readOutFlags val){
|
||||||
int ret;
|
|
||||||
|
enum readOutFlags retval;
|
||||||
if(val!=GET_READOUT_FLAGS){
|
if(val!=GET_READOUT_FLAGS){
|
||||||
|
|
||||||
|
|
||||||
|
if(val&0xF0000){
|
||||||
switch(val){
|
switch(val){
|
||||||
case PARALLEL: val=0; break;
|
case PARALLEL: val=E_PARALLEL; printf(" Setting Read out Flag: Parallel\n"); break;
|
||||||
case NONPARALLEL: val=1; break;
|
case NONPARALLEL: val=E_NON_PARALLEL; printf(" Setting Read out Flag: Non Parallel\n"); break;
|
||||||
case SAFE: val=2; break;
|
case SAFE: val=E_SAFE; printf(" Setting Read out Flag: Safe\n"); break;
|
||||||
default: val=0; break;
|
|
||||||
|
default:
|
||||||
|
cprintf(RED,"Cannot set unknown readout flag. 0x%x\n", val);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
printf(" Setting Read out Flag: %d\n",val);
|
printf(" Setting Read out Flag: %d\n",val);
|
||||||
if(Feb_Control_SetReadoutMode(val))
|
if(Feb_Control_SetReadoutMode(val))
|
||||||
eiger_readoutmode = val;
|
eiger_readoutmode = val;
|
||||||
|
else return -1;
|
||||||
|
|
||||||
|
}else{
|
||||||
|
switch(val){
|
||||||
|
case STORE_IN_RAM: val=1; printf(" Setting Read out Flag: Store in Ram\n"); break;
|
||||||
|
case CONTINOUS_RO: val=0; printf(" Setting Read out Flag: Continuous Readout\n"); break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
cprintf(RED,"Cannot set unknown readout flag. 0x%x\n", val);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
printf(" Setting store in ram variable: %d\n",val);
|
||||||
|
eiger_storeinmem = val;
|
||||||
|
|
||||||
}
|
}
|
||||||
switch(eiger_readoutmode){
|
|
||||||
case 0: ret=PARALLEL; break;
|
|
||||||
case 1: ret=NONPARALLEL; break;
|
|
||||||
case 2: ret=SAFE; break;
|
|
||||||
default:ret=-1; break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
switch(eiger_readoutmode){
|
||||||
|
case E_PARALLEL: retval=PARALLEL; break;
|
||||||
|
case E_NON_PARALLEL: retval=NONPARALLEL; break;
|
||||||
|
case E_SAFE: retval=SAFE; break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(eiger_storeinmem){
|
||||||
|
case 0: retval|=CONTINOUS_RO; break;
|
||||||
|
case 1: retval|=STORE_IN_RAM; break;
|
||||||
|
}
|
||||||
|
printf("Read out Flag: 0x%x\n",retval);
|
||||||
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -4046,7 +4046,8 @@ string slsDetectorCommand::helpSpeed(int narg, char *args[], int action) {
|
|||||||
|
|
||||||
string slsDetectorCommand::cmdAdvanced(int narg, char *args[], int action) {
|
string slsDetectorCommand::cmdAdvanced(int narg, char *args[], int action) {
|
||||||
|
|
||||||
|
int retval;
|
||||||
|
char answer[1000]="";
|
||||||
|
|
||||||
if (action==HELP_ACTION)
|
if (action==HELP_ACTION)
|
||||||
return helpAdvanced(narg, args, action);
|
return helpAdvanced(narg, args, action);
|
||||||
@ -4078,24 +4079,27 @@ string slsDetectorCommand::cmdAdvanced(int narg, char *args[], int action) {
|
|||||||
|
|
||||||
myDet->setOnline(ONLINE_FLAG);
|
myDet->setOnline(ONLINE_FLAG);
|
||||||
|
|
||||||
switch (myDet->setReadOutFlags(flag)) {
|
retval = myDet->setReadOutFlags(flag);
|
||||||
case NORMAL_READOUT:
|
|
||||||
|
if(retval == NORMAL_READOUT)
|
||||||
return string("none");
|
return string("none");
|
||||||
case STORE_IN_RAM:
|
|
||||||
return string("storeinram");
|
if(retval & STORE_IN_RAM)
|
||||||
case TOT_MODE:
|
strcat(answer,"storeinram ");
|
||||||
return string("tot");
|
if(retval & TOT_MODE)
|
||||||
case CONTINOUS_RO:
|
strcat(answer,"tot ");
|
||||||
return string("continous");
|
if(retval & CONTINOUS_RO)
|
||||||
case PARALLEL:
|
strcat(answer,"continous ");
|
||||||
return string("parallel");
|
if(retval & PARALLEL)
|
||||||
case NONPARALLEL:
|
strcat(answer,"parallel ");
|
||||||
return string("nonparallel");
|
if(retval & NONPARALLEL)
|
||||||
case SAFE:
|
strcat(answer,"nonparallel ");
|
||||||
return string("safe");
|
if(retval & SAFE)
|
||||||
default:
|
strcat(answer,"safe ");
|
||||||
|
if(strlen(answer))
|
||||||
|
return string(answer);
|
||||||
|
|
||||||
return string("unknown");
|
return string("unknown");
|
||||||
}
|
|
||||||
|
|
||||||
} else if (cmd=="extsig") {
|
} else if (cmd=="extsig") {
|
||||||
externalSignalFlag flag=GET_EXTERNAL_SIGNAL_FLAG;
|
externalSignalFlag flag=GET_EXTERNAL_SIGNAL_FLAG;
|
||||||
|
@ -2637,9 +2637,19 @@ int set_readout_flags(int file_des) {
|
|||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(MYTHEND) && !defined(EIGERD)
|
||||||
|
sprintf(mess,"Read out flags not implemented for this detector\n");
|
||||||
|
cprintf(RED, "%s",mess);
|
||||||
|
ret=FAIL;
|
||||||
|
#else
|
||||||
|
|
||||||
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
printf("setting readout flags to %d\n",arg);
|
printf("setting readout flags to %d\n",arg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
if (differentClients==1 && lockStatus==1 && arg!=GET_READOUT_FLAGS) {
|
if (differentClients==1 && lockStatus==1 && arg!=GET_READOUT_FLAGS) {
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
@ -2648,30 +2658,37 @@ int set_readout_flags(int file_des) {
|
|||||||
switch(arg) {
|
switch(arg) {
|
||||||
case GET_READOUT_FLAGS:
|
case GET_READOUT_FLAGS:
|
||||||
#ifdef MYTHEND
|
#ifdef MYTHEND
|
||||||
case STORE_IN_RAM:
|
|
||||||
case TOT_MODE:
|
case TOT_MODE:
|
||||||
case CONTINOUS_RO:
|
|
||||||
case NORMAL_READOUT:
|
case NORMAL_READOUT:
|
||||||
retval=setReadOutFlags(arg);
|
#endif
|
||||||
break;
|
#if defined(MYTHEND) || defined(EIGERD)
|
||||||
#elif EIGERD
|
case STORE_IN_RAM:
|
||||||
|
case CONTINOUS_RO:
|
||||||
|
#endif
|
||||||
|
#ifdef EIGERD
|
||||||
case PARALLEL:
|
case PARALLEL:
|
||||||
case NONPARALLEL:
|
case NONPARALLEL:
|
||||||
case SAFE:
|
case SAFE:
|
||||||
|
#endif
|
||||||
retval=setReadOutFlags(arg);
|
retval=setReadOutFlags(arg);
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
default:
|
default:
|
||||||
sprintf(mess,"Unknown readout flag %d for this detector\n", arg);
|
sprintf(mess,"Unknown readout flag %d for this detector\n", arg);
|
||||||
|
cprintf(RED, "%s",mess);
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
if (ret==OK) {
|
if (ret==OK) {
|
||||||
if (arg!=GET_READOUT_FLAGS && arg!=retval) {
|
if (retval == -1) {
|
||||||
ret=FAIL;
|
ret=FAIL;
|
||||||
sprintf(mess,"Could not change readout flag: should be %d but is %d\n", arg, retval);
|
sprintf(mess,"Could not change readout flag: should be %d but is %d\n", arg, retval);
|
||||||
|
cprintf(RED, "%s",mess);
|
||||||
}else if (differentClients)
|
}else if (differentClients)
|
||||||
ret=FORCE_UPDATE;
|
ret=FORCE_UPDATE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user