mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-21 03:10:02 +02:00
eiger server: bug fix for saving trimbits to file, was copying from destination to source in server
This commit is contained in:
parent
c4b8c6385f
commit
e19a27bf62
Binary file not shown.
@ -548,22 +548,26 @@ int setModule(sls_detector_module myMod, int delay){
|
|||||||
printf("Setting module with settings %d\n",myMod.reg);
|
printf("Setting module with settings %d\n",myMod.reg);
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
//copy module locally (module number, serial number, gain offset,
|
||||||
|
//dacs (pointless), trimbit values(if needed)
|
||||||
|
if (detectorModules)
|
||||||
|
if (copyModule(detectorModules,&myMod) == FAIL)
|
||||||
|
return FAIL;
|
||||||
|
|
||||||
|
// settings
|
||||||
setSettings( (enum detectorSettings)myMod.reg,-1);
|
setSettings( (enum detectorSettings)myMod.reg,-1);
|
||||||
|
|
||||||
|
// iodelay
|
||||||
if(setIODelay(delay, -1)!= delay){
|
if(setIODelay(delay, -1)!= delay){
|
||||||
cprintf(RED,"could not set iodelay %d\n",delay);
|
cprintf(RED,"could not set iodelay %d\n",delay);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//copy module locally
|
// dacs
|
||||||
if (detectorModules)
|
|
||||||
copyModule(detectorModules,&myMod);
|
|
||||||
|
|
||||||
//set dac values
|
|
||||||
for(i=0;i<myMod.ndac;i++)
|
for(i=0;i<myMod.ndac;i++)
|
||||||
setDAC((enum DACINDEX)i,myMod.dacs[i],myMod.module,0,retval);
|
setDAC((enum DACINDEX)i,myMod.dacs[i],myMod.module,0,retval);
|
||||||
|
|
||||||
|
// trimbits
|
||||||
if(myMod.nchan==0 && myMod.nchip == 0)
|
if(myMod.nchan==0 && myMod.nchip == 0)
|
||||||
cprintf(BLUE,"Setting module without trimbits\n");
|
cprintf(BLUE,"Setting module without trimbits\n");
|
||||||
else{
|
else{
|
||||||
@ -599,8 +603,10 @@ int getModule(sls_detector_module *myMod){
|
|||||||
int retval[2];
|
int retval[2];
|
||||||
|
|
||||||
//dacs
|
//dacs
|
||||||
for(i=0;i<NDAC;i++)
|
for(i=0;i<NDAC;i++) {
|
||||||
setDAC((enum DACINDEX)i,-1,-1,0,retval);
|
setDAC((enum DACINDEX)i,-1,-1,0,retval);
|
||||||
|
//cprintf(BLUE,"dac%d:%d\n",i, *((detectorModules->dacs)+i));
|
||||||
|
}
|
||||||
|
|
||||||
//trimbits
|
//trimbits
|
||||||
unsigned int* tt;
|
unsigned int* tt;
|
||||||
@ -620,9 +626,11 @@ int getModule(sls_detector_module *myMod){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//copy to local copy as well
|
//copy local module to myMod
|
||||||
if (detectorModules)
|
if (detectorModules) {
|
||||||
copyModule(detectorModules,myMod);
|
if (copyModule(myMod, detectorModules) == FAIL)
|
||||||
|
return FAIL;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return FAIL;
|
return FAIL;
|
||||||
return OK;
|
return OK;
|
||||||
@ -1309,9 +1317,10 @@ int copyModule(sls_detector_module *destMod, sls_detector_module *srcMod){
|
|||||||
else printf("Not Copying trimbits\n");
|
else printf("Not Copying trimbits\n");
|
||||||
#endif
|
#endif
|
||||||
for (idac=0; idac<(srcMod->ndac); idac++) {
|
for (idac=0; idac<(srcMod->ndac); idac++) {
|
||||||
if (*((srcMod->dacs)+idac)>=0)
|
if (*((srcMod->dacs)+idac)>=0) {
|
||||||
*((destMod->dacs)+idac)=*((srcMod->dacs)+idac);
|
*((destMod->dacs)+idac)=*((srcMod->dacs)+idac);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
for (iadc=0; iadc<(srcMod->nadc); iadc++) {
|
for (iadc=0; iadc<(srcMod->nadc); iadc++) {
|
||||||
if (*((srcMod->adcs)+iadc)>=0)
|
if (*((srcMod->adcs)+iadc)>=0)
|
||||||
*((destMod->adcs)+iadc)=*((srcMod->adcs)+iadc);
|
*((destMod->adcs)+iadc)=*((srcMod->adcs)+iadc);
|
||||||
|
@ -3460,8 +3460,10 @@ slsDetectorDefs::sls_detector_module *slsDetector::getModule(int imod){
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dacs) {
|
if (dacs) {
|
||||||
for (int i=0; i<thisDetector->nDacs; ++i)
|
for (int i=0; i<thisDetector->nDacs; ++i) {
|
||||||
dacs[i+imod*thisDetector->nDacs]=myMod->dacs[i];
|
dacs[i+imod*thisDetector->nDacs]=myMod->dacs[i];
|
||||||
|
//cprintf(BLUE,"dac%d:%d\n",i, myMod->dacs[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
(detectorModules+imod)->gain=myMod->gain;
|
(detectorModules+imod)->gain=myMod->gain;
|
||||||
(detectorModules+imod)->offset=myMod->offset;
|
(detectorModules+imod)->offset=myMod->offset;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user