mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 15:20:02 +02:00
trimbits work.
This commit is contained in:
parent
c5a4f357bf
commit
7faac70c3f
@ -507,7 +507,10 @@ int Beb_RequestNImages(unsigned int beb_number, unsigned int left_right, int ten
|
||||
int in_two_requests = (!ten_gig&&Beb_bit_mode==32);
|
||||
if(in_two_requests) npackets/=2;
|
||||
|
||||
printf("here: %d %d %d %d %d %d %d\n",beb_number,left_right,ten_gig,dst_number,nimages, header_size,test_just_send_out_packets_no_wait);
|
||||
//usleep needed after acquisition start, else you miss the single images
|
||||
usleep(0);
|
||||
|
||||
//printf("beb no:%d left_right:%d ten_gig:%d dst_number:%d #images:%d header_size:%d test_just_send_out_packets_no_wait:%d\n",beb_number,left_right,ten_gig,dst_number,nimages, header_size,test_just_send_out_packets_no_wait);
|
||||
//printf("here: "<<beb_number<<","<<left_right<<","<<ten_gig<<","<<dst_number<<","<<1<<","<<header_size<<","<<test_just_send_out_packets_no_wait\n");
|
||||
unsigned int i;
|
||||
for(i=0;i<nimages;i++){
|
||||
|
@ -838,7 +838,8 @@ int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits){
|
||||
//for (int iy=263670;iy<263680;++iy)//263681
|
||||
// printf("%d:%c\t\t",iy,trimbits[iy]);
|
||||
|
||||
|
||||
unsigned int trimbits_to_load_l[1024];
|
||||
unsigned int trimbits_to_load_r[1024];
|
||||
|
||||
unsigned int module_index=0;
|
||||
if(!Feb_Control_GetModuleIndex(module_num,&module_index)){
|
||||
@ -847,8 +848,9 @@ int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits){
|
||||
}
|
||||
|
||||
if(!Feb_Control_Reset()) printf("Warning could not reset DAQ.\n");
|
||||
int l_r;
|
||||
int l_r; //printf("222\n");
|
||||
for(l_r=0;l_r<2;l_r++){ // l_r loop
|
||||
//printf("\nl_r:%d\t\t",l_r);
|
||||
unsigned int disable_chip_mask = l_r ? DAQ_CS_BAR_LEFT : DAQ_CS_BAR_RIGHT;
|
||||
if(!(Feb_Interface_WriteRegister(0xfff,DAQ_REG_STATIC_BITS,disable_chip_mask|DAQ_STATIC_BIT_PROGRAM|DAQ_STATIC_BIT_M8,0,0)&&Feb_Control_SetCommandRegister(DAQ_SET_STATIC_BIT)&&Feb_Control_StartDAQOnlyNWaitForFinish(5000))){
|
||||
printf("Could not select chips\n");
|
||||
@ -856,6 +858,7 @@ int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits){
|
||||
}
|
||||
int row_set;
|
||||
for(row_set=0;row_set<16;row_set++){ //16 rows at a time
|
||||
//printf("row_set:%d\t\t",row_set);
|
||||
if(row_set==0){
|
||||
if(!Feb_Control_SetCommandRegister(DAQ_RESET_COMPLETELY|DAQ_SEND_A_TOKEN_IN|DAQ_LOAD_16ROWS_OF_TRIMBITS)){
|
||||
printf("Warning: Could not Feb_Control_SetCommandRegister for loading trim bits.\n");
|
||||
@ -868,14 +871,13 @@ int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits){
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned int trimbits_to_load_l[1024];
|
||||
static unsigned int trimbits_to_load_r[1024];
|
||||
int row;
|
||||
for(row=0;row<16;row++){ //row loop
|
||||
//printf("row:%d\t\t",row);
|
||||
int offset = 2*32*row;
|
||||
int sc;
|
||||
for(sc=0;sc<32;sc++){ //supercolumn loop sc
|
||||
|
||||
//printf("sc:%d\t\t",sc);
|
||||
int super_column_start_position_l = 1030*row + l_r *258 + sc*8;
|
||||
int super_column_start_position_r = 1030*row + 516 + l_r *258 + sc*8;
|
||||
|
||||
@ -886,10 +888,12 @@ int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits){
|
||||
int chip_sc = 31 - sc;
|
||||
trimbits_to_load_l[offset+chip_sc] = 0;
|
||||
trimbits_to_load_r[offset+chip_sc] = 0;
|
||||
trimbits_to_load_l[offset+chip_sc+32] = 0;
|
||||
trimbits_to_load_r[offset+chip_sc+32] = 0;
|
||||
int i;
|
||||
for(i=0;i<8;i++){ // column loop i
|
||||
|
||||
trimbits_to_load_l[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_l+i])<<((7-i)*4);//low
|
||||
//printf("i:%d\t\t",i);
|
||||
trimbits_to_load_l[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_l+i])<<((7-i)*4);//low
|
||||
trimbits_to_load_l[offset+chip_sc+32] |= ((0x38 & trimbits[row_set*16480+super_column_start_position_l+i])>>3)<<((7-i)*4);//upper
|
||||
trimbits_to_load_r[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_r+i])<<((7-i)*4);//low
|
||||
trimbits_to_load_r[offset+chip_sc+32] |= ((0x38 & trimbits[row_set*16480+super_column_start_position_r+i])>>3)<<((7-i)*4);//upper
|
||||
@ -898,26 +902,26 @@ int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits){
|
||||
trimbits_to_load_l[offset+chip_sc+32] |= ((0x38 & trimbits[263679 - (row_set*16480+super_column_start_position_l+i)])>>3)<<((7-i)*4);//upper
|
||||
trimbits_to_load_r[offset+chip_sc] |= ( 0x7 & trimbits[263679 - (row_set*16480+super_column_start_position_r+i)])<<((7-i)*4);//low
|
||||
trimbits_to_load_r[offset+chip_sc+32] |= ((0x38 & trimbits[263679 - (row_set*16480+super_column_start_position_r+i)])>>3)<<((7-i)*4);//upper
|
||||
*/
|
||||
|
||||
*/
|
||||
} // end column loop i
|
||||
} //end supercolumn loop sc
|
||||
} //end row loop
|
||||
|
||||
/*
|
||||
if(!WriteMemory(modules[0]->Module_GetTopLeftAddress(),0,0,1024,trimbits_to_load_r)||!WriteMemory(modules[0]->Module_GetTopRightAddress(),0,0,1024,trimbits_to_load_l)||!Feb_Control_StartDAQOnlyNWaitForFinish()){
|
||||
cout <<" some errror!"<< endl;
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
if(!Feb_Interface_WriteMemory(Module_GetTopLeftAddress(&modules[0]),0,0,1023,trimbits_to_load_r)||!Feb_Interface_WriteMemory(Module_GetTopRightAddress(&modules[0]),0,0,1023,trimbits_to_load_l)||!Feb_Control_StartDAQOnlyNWaitForFinish(5000)){
|
||||
|
||||
if(!Feb_Interface_WriteMemoryInLoops(Module_GetTopLeftAddress(&modules[0]),0,0,1024,trimbits_to_load_r)||
|
||||
!Feb_Interface_WriteMemoryInLoops(Module_GetTopRightAddress(&modules[0]),0,0,1024,trimbits_to_load_l)||
|
||||
//if(!Feb_Interface_WriteMemory(Module_GetTopLeftAddress(&modules[0]),0,0,1023,trimbits_to_load_r)||
|
||||
// !Feb_Interface_WriteMemory(Module_GetTopRightAddress(&modules[0]),0,0,1023,trimbits_to_load_l)||
|
||||
!Feb_Control_StartDAQOnlyNWaitForFinish(5000)){
|
||||
printf(" some errror!\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
} //end row_set loop (groups of 16 rows)
|
||||
} // end l_r loop
|
||||
|
||||
memcpy(Feb_Control_last_downloaded_trimbits,trimbits,Feb_Control_trimbit_size*sizeof(unsigned char));
|
||||
|
||||
return Feb_Control_SetStaticBits(); //send the static bits
|
||||
}
|
||||
|
||||
@ -1362,81 +1366,6 @@ int Feb_Control_StopAcquisition(){
|
||||
|
||||
|
||||
|
||||
|
||||
int Feb_Control_LoadTrimbitFile(){/*
|
||||
string filename = "/home/root/noise.snbeb040";
|
||||
ifstream input_file;
|
||||
|
||||
int Module_ndacs =16;
|
||||
int dacs[Module_ndacs];
|
||||
unsigned int chanregs[trimbit_size];
|
||||
|
||||
|
||||
input_file.open(filename.c_str() ,ifstream::binary);
|
||||
if(!input_file.is_open()){
|
||||
printf("Warning, could not open trimbit file: %s\n",filename);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
//dacs
|
||||
int i;
|
||||
for(i=0;i<Module_ndacs;++i){
|
||||
input_file.read((char*) &dacs[i],sizeof(int));
|
||||
printf(" dac %d:%s:%d\n",i,Module_dac_names[i],dacs[i]);
|
||||
Feb_Control_SetDAC(Module_dac_names[i],dacs[i]);
|
||||
|
||||
}
|
||||
|
||||
printf("Loading trimbits from file %s\n");
|
||||
|
||||
//trimbits
|
||||
input_file.read((char*) chanregs,Feb_Control_trimbit_size*sizeof(unsigned int));
|
||||
if(input_file.eof()){
|
||||
printf("\nError, could not load trimbits end of file, %s, reached.\n\n",filename);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
input_file.close();
|
||||
return Feb_Control_SetTrimbits(0,chanregs);
|
||||
*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int Feb_Control_SaveTrimbitFile(){
|
||||
/*
|
||||
string filename = "/home/root/noise.snbeb040";
|
||||
ofstream output_file;
|
||||
|
||||
int Module_ndacs =16;
|
||||
int dacs[Module_ndacs];
|
||||
|
||||
output_file.open(filename.c_str() ,ofstream::binary);
|
||||
if(!output_file.is_open()){
|
||||
printf("Warning, could not open trimbit file: %s\n",filename);
|
||||
return 0;
|
||||
}
|
||||
|
||||
printf("Writing trimbits to file %s\n",filename);
|
||||
|
||||
//dacs
|
||||
int i;
|
||||
for(i=0;i<Module_ndacs;++i){
|
||||
Feb_Control_GetDAC(Module_dac_names[i], dacs[i]);
|
||||
output_file.write((char*) &dacs[i],sizeof(int));
|
||||
printf(" dac %d:%s:%s\n",i,Module_dac_names[i],dacs[i]);
|
||||
}
|
||||
|
||||
//trimbits
|
||||
output_file.write((char*) Feb_Control_last_downloaded_trimbits,Feb_Control_trimbit_size * sizeof(unsigned int));
|
||||
|
||||
output_file.close();
|
||||
*/
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int Feb_Control_SaveAllTrimbitsTo(int value){
|
||||
unsigned int chanregs[Feb_Control_trimbit_size];
|
||||
int i;
|
||||
|
@ -140,8 +140,6 @@ int Module_GetBottomDACValue(struct Module* mod,unsigned int i);
|
||||
|
||||
|
||||
/**Added by Dhanya */
|
||||
int Feb_Control_LoadTrimbitFile();
|
||||
int Feb_Control_SaveTrimbitFile();
|
||||
int Feb_Control_SaveAllTrimbitsTo(int value);
|
||||
|
||||
|
||||
|
@ -165,6 +165,22 @@ int Feb_Interface_WriteRegisters(unsigned int sub_num, unsigned int nwrites, uns
|
||||
return 1;
|
||||
}
|
||||
|
||||
int Feb_Interface_WriteMemoryInLoops(unsigned int sub_num, unsigned int mem_num, unsigned int start_address, unsigned int nwrites, unsigned int *values){
|
||||
unsigned int max_single_packet_size = 352;
|
||||
int passed=1;
|
||||
unsigned int n_to_send = max_single_packet_size;
|
||||
unsigned int ndata_sent = 0;
|
||||
unsigned int ndata_countdown = nwrites;
|
||||
while(ndata_countdown>0){
|
||||
n_to_send = ndata_countdown<max_single_packet_size ? ndata_countdown:max_single_packet_size;
|
||||
if(!Feb_Interface_WriteMemory(sub_num,mem_num,start_address,n_to_send,&(values[ndata_sent]))){passed=0; break;}
|
||||
ndata_countdown-=n_to_send;
|
||||
ndata_sent +=n_to_send;
|
||||
start_address +=n_to_send;
|
||||
usleep(0);//500 works
|
||||
}
|
||||
return passed;
|
||||
}
|
||||
|
||||
int Feb_Interface_WriteMemory(unsigned int sub_num, unsigned int mem_num, unsigned int start_address, unsigned int nwrites, unsigned int *values){
|
||||
// -1 means write to all
|
||||
@ -174,7 +190,7 @@ int Feb_Interface_WriteMemory(unsigned int sub_num, unsigned int mem_num, unsign
|
||||
nwrites &= 0x3ff;
|
||||
if(!nwrites||nwrites>Feb_Interface_send_buffer_size-2) {printf("error herer: nwrites:%d\n",nwrites);return 0;}//*d-1026
|
||||
|
||||
Feb_Interface_send_ndata = nwrites+2;//*d-1025
|
||||
Feb_Interface_send_ndata = nwrites+2;//*d-1026
|
||||
Feb_Interface_send_data[0] = 0xc0000000 | mem_num << 24 | nwrites << 14 | start_address; //cmd -> write to memory, nwrites, mem number, start address
|
||||
Feb_Interface_send_data[nwrites+1] = 0;
|
||||
for(i=0;i<nwrites;i++) Feb_Interface_send_data[i+1] = values[i];
|
||||
|
@ -32,6 +32,9 @@
|
||||
/*int Feb_Interface_WriteRegisters(unsigned int sub_num, unsigned int nwrites, unsigned int* reg_nums, unsigned int* values, int* wait_ons=0, unsigned int* wait_on_addresses=0);*/
|
||||
int Feb_Interface_WriteRegisters(unsigned int sub_num, unsigned int nwrites, unsigned int* reg_nums, unsigned int* values, int* wait_ons, unsigned int* wait_on_addresses);
|
||||
|
||||
|
||||
int Feb_Interface_WriteMemoryInLoops(unsigned int sub_num, unsigned int mem_num, unsigned int start_address, unsigned int nwrites, unsigned int *values);
|
||||
|
||||
int Feb_Interface_WriteMemory(unsigned int sub_num, unsigned int mem_num, unsigned int start_address, unsigned int nwrites, unsigned int *values);
|
||||
|
||||
|
||||
|
@ -75,7 +75,7 @@ int Local_InitNewMemory (struct LocalLinkInterface* ll,unsigned int addr, int if
|
||||
|
||||
|
||||
int Local_Init(struct LocalLinkInterface* ll,unsigned int ll_fifo_badr){
|
||||
int fd;
|
||||
int fd;
|
||||
void *plb_ll_fifo_ptr;
|
||||
|
||||
if ((fd=open("/dev/mem", O_RDWR)) < 0){
|
||||
@ -113,9 +113,9 @@ int Local_Reset1(struct LocalLinkInterface* ll,unsigned int rst_mask){
|
||||
HWIO_xfs_out32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_CTRL,ll->ll_fifo_ctrl_reg);
|
||||
|
||||
ll->ll_fifo_ctrl_reg &= (~rst_mask);
|
||||
|
||||
|
||||
HWIO_xfs_out32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_CTRL,ll->ll_fifo_ctrl_reg);
|
||||
// printf("FIFO CTRL Address: 0x%08x\n FIFO CTRL Register: 0x%08x\n",PLB_LL_FIFO_REG_CTRL,plb_ll_fifo[PLB_LL_FIFO_REG_CTRL]);
|
||||
// printf("FIFO CTRL Address: 0x%08x\n FIFO CTRL Register: 0x%08x\n",PLB_LL_FIFO_REG_CTRL,plb_ll_fifo[PLB_LL_FIFO_REG_CTRL]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -130,17 +130,17 @@ int Local_Write(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buf
|
||||
// frame_len in byte
|
||||
int vacancy=0;
|
||||
int i;
|
||||
int words_send = 0;
|
||||
int last_word;
|
||||
int words_send = 0;
|
||||
int last_word;
|
||||
unsigned int *word_ptr;
|
||||
unsigned int fifo_ctrl;
|
||||
xfs_u32 status;
|
||||
|
||||
if (buffer_len < 1) return -1;
|
||||
|
||||
|
||||
last_word = (buffer_len-1)/4;
|
||||
word_ptr = (unsigned int *)buffer;
|
||||
|
||||
|
||||
while (words_send <= last_word)
|
||||
{
|
||||
while (!vacancy)//wait for Fifo to be empty again
|
||||
@ -176,12 +176,12 @@ int Local_Read(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buff
|
||||
// frame_len in byte
|
||||
int len;
|
||||
unsigned int *word_ptr;
|
||||
unsigned int status;
|
||||
unsigned int status;
|
||||
volatile unsigned int fifo_val;
|
||||
int sof = 0;
|
||||
|
||||
word_ptr = (unsigned int *)buffer;
|
||||
do
|
||||
|
||||
word_ptr = (unsigned int *)buffer;
|
||||
do
|
||||
{
|
||||
status = HWIO_xfs_in32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_STATUS);
|
||||
|
||||
@ -189,7 +189,7 @@ int Local_Read(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buff
|
||||
{
|
||||
if (status & PLB_LL_FIFO_STATUS_LL_SOF)
|
||||
{
|
||||
if (buffer_ptr)
|
||||
if (buffer_ptr)
|
||||
{
|
||||
buffer_ptr = 0;
|
||||
return -1; // buffer overflow
|
||||
@ -200,14 +200,14 @@ int Local_Read(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buff
|
||||
}
|
||||
|
||||
fifo_val = HWIO_xfs_in32(ll->ll_fifo_base+4*PLB_LL_FIFO_REG_FIFO); //read from fifo
|
||||
|
||||
|
||||
if ((buffer_ptr > 0) || sof)
|
||||
{
|
||||
if ( (buffer_len >> 2) > buffer_ptr)
|
||||
{
|
||||
word_ptr[buffer_ptr++] = fifo_val; //write to buffer
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
buffer_ptr = 0;
|
||||
return -2; // buffer overflow
|
||||
@ -223,9 +223,9 @@ int Local_Read(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buff
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
while(!(status & PLB_LL_FIFO_STATUS_EMPTY));
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -245,7 +245,7 @@ int Local_Test(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buff
|
||||
|
||||
int len;
|
||||
unsigned int rec_buff_len = 4096;
|
||||
unsigned int rec_buffer[4097];
|
||||
unsigned int rec_buffer[4097];
|
||||
|
||||
|
||||
Local_Write(ll,buffer_len,buffer);
|
||||
@ -258,11 +258,11 @@ int Local_Test(struct LocalLinkInterface* ll,unsigned int buffer_len, void *buff
|
||||
if (len > 0){
|
||||
rec_buffer[len]=0;
|
||||
printf((char*) rec_buffer);
|
||||
printf("\n");
|
||||
printf("\n");
|
||||
}
|
||||
} while(len > 0);
|
||||
|
||||
printf("\n\n\n\n");
|
||||
printf("\n\n\n\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -324,18 +324,18 @@ int enableTenGigabitEthernet(int val){
|
||||
send_to_ten_gig = 0;
|
||||
//configuremac called from client
|
||||
}
|
||||
//#ifdef VERBOSE
|
||||
#ifdef VERBOSE
|
||||
printf("10Gbe:%d\n",send_to_ten_gig);
|
||||
//#endif
|
||||
#endif
|
||||
return send_to_ten_gig;
|
||||
}
|
||||
|
||||
|
||||
int setModule(sls_detector_module myMod){
|
||||
int retval[2];
|
||||
#ifdef VERBOSE
|
||||
//#ifdef VERBOSE
|
||||
printf("Setting module with settings %d\n",myMod.reg);
|
||||
#endif
|
||||
//#endif
|
||||
int i;
|
||||
for(i=0;i<myMod.ndac;i++)
|
||||
setDAC((enum detDacIndex)i,myMod.dacs[i],myMod.module,0,retval);
|
||||
@ -348,7 +348,25 @@ int setModule(sls_detector_module myMod){
|
||||
copyModule(detectorModules,&myMod);
|
||||
|
||||
setSettings( (enum detectorSettings)myMod.reg,-1); // put the settings in the module register?!?!?
|
||||
Feb_Control_SetTrimbits(0,myMod.chanregs);
|
||||
|
||||
//includ gap pixels
|
||||
int offset = 0;
|
||||
unsigned int tt[263680];
|
||||
int iy,ichip,ix,ip=0,ich=0;
|
||||
for(iy=0;iy<256;iy++) {
|
||||
for (ichip=0; ichip<4; ichip++) {
|
||||
for(ix=0;ix<256;ix++) {
|
||||
tt[ip++]=myMod.chanregs[ich++];
|
||||
}
|
||||
if (ichip<3) {
|
||||
tt[ip++]=0;
|
||||
tt[ip++]=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Feb_Control_SetTrimbits(0,tt);
|
||||
|
||||
|
||||
return 0;
|
||||
@ -358,11 +376,32 @@ int setModule(sls_detector_module myMod){
|
||||
int getModule(sls_detector_module *myMod){
|
||||
int i;
|
||||
int retval[2];
|
||||
|
||||
//dacs
|
||||
for(i=0;i<NDAC;i++)
|
||||
setDAC((enum detDacIndex)i,-1,-1,0,retval);
|
||||
|
||||
myMod->chanregs = Feb_Control_GetTrimbits();
|
||||
|
||||
//trimbits
|
||||
unsigned int* tt;
|
||||
tt = Feb_Control_GetTrimbits();
|
||||
|
||||
//exclude gap pixels
|
||||
int offset = 0;
|
||||
int iy,ichip,ix,ip=0,ich=0;
|
||||
for(iy=0;iy<256;iy++) {
|
||||
for (ichip=0; ichip<4; ichip++) {
|
||||
for(ix=0;ix<256;ix++) {
|
||||
myMod->chanregs[ich++]=tt[ip++];
|
||||
}
|
||||
if (ichip<3) {
|
||||
ip++;
|
||||
ip++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//copy to local copy as well
|
||||
if (detectorModules)
|
||||
copyModule(myMod,detectorModules);
|
||||
else
|
||||
|
@ -5680,8 +5680,8 @@ int slsDetector::loadSettingsFile(string fname, int imod) {
|
||||
myMod=readSettingsFile(fn, thisDetector->myDetectorType);
|
||||
if (myMod) {
|
||||
myMod->module=im;
|
||||
//settings is saved in myMod.reg for gotthard or moench
|
||||
if((thisDetector->myDetectorType==GOTTHARD)||(thisDetector->myDetectorType==MOENCH))
|
||||
//settings is saved in myMod.reg for all except mythen
|
||||
if(thisDetector->myDetectorType!=MYTHEN)
|
||||
myMod->reg=thisDetector->currentSettings;
|
||||
setModule(*myMod);
|
||||
deleteModule(myMod);
|
||||
|
@ -433,7 +433,10 @@ int slsDetectorActions::executeScan(int level, int istep) {
|
||||
break;
|
||||
case trimbitsScan:
|
||||
trimbit=(int)currentScanVariable[level];
|
||||
setChannel((trimbit<<((int)TRIMBIT_OFF))|((int)COMPARATOR_ENABLE)); // trimbit scan
|
||||
if(getDetectorsType() == EIGER)
|
||||
setAllTrimbits(trimbit);
|
||||
else
|
||||
setChannel((trimbit<<((int)TRIMBIT_OFF))|((int)COMPARATOR_ENABLE)); // trimbit scan
|
||||
break;
|
||||
case positionScan:
|
||||
//check if channels are connected!
|
||||
|
@ -197,6 +197,13 @@ class slsDetectorActions : public virtual slsDetectorBase
|
||||
*/
|
||||
virtual dacs_t setDAC(dacs_t val, dacIndex index , int mV, int imod=-1)=0;
|
||||
|
||||
/** sets all the trimbits to a particular value
|
||||
\param val trimbit value
|
||||
\param imod module number, -1 means all modules
|
||||
\returns OK or FAIL
|
||||
*/
|
||||
virtual int setAllTrimbits(int val, int imod=-1)=0;
|
||||
|
||||
/** returns the detector type
|
||||
\param pos position in the multi detector structure (is -1 returns type of detector with id -1)
|
||||
\returns type
|
||||
|
Loading…
x
Reference in New Issue
Block a user