mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +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);
|
||||
//#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);
|
||||
|
||||
// iodelay
|
||||
if(setIODelay(delay, -1)!= delay){
|
||||
cprintf(RED,"could not set iodelay %d\n",delay);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
//copy module locally
|
||||
if (detectorModules)
|
||||
copyModule(detectorModules,&myMod);
|
||||
|
||||
//set dac values
|
||||
// dacs
|
||||
for(i=0;i<myMod.ndac;i++)
|
||||
setDAC((enum DACINDEX)i,myMod.dacs[i],myMod.module,0,retval);
|
||||
|
||||
|
||||
// trimbits
|
||||
if(myMod.nchan==0 && myMod.nchip == 0)
|
||||
cprintf(BLUE,"Setting module without trimbits\n");
|
||||
else{
|
||||
@ -599,8 +603,10 @@ int getModule(sls_detector_module *myMod){
|
||||
int retval[2];
|
||||
|
||||
//dacs
|
||||
for(i=0;i<NDAC;i++)
|
||||
for(i=0;i<NDAC;i++) {
|
||||
setDAC((enum DACINDEX)i,-1,-1,0,retval);
|
||||
//cprintf(BLUE,"dac%d:%d\n",i, *((detectorModules->dacs)+i));
|
||||
}
|
||||
|
||||
//trimbits
|
||||
unsigned int* tt;
|
||||
@ -620,9 +626,11 @@ int getModule(sls_detector_module *myMod){
|
||||
}
|
||||
}
|
||||
|
||||
//copy to local copy as well
|
||||
if (detectorModules)
|
||||
copyModule(detectorModules,myMod);
|
||||
//copy local module to myMod
|
||||
if (detectorModules) {
|
||||
if (copyModule(myMod, detectorModules) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
else
|
||||
return FAIL;
|
||||
return OK;
|
||||
@ -1309,9 +1317,10 @@ int copyModule(sls_detector_module *destMod, sls_detector_module *srcMod){
|
||||
else printf("Not Copying trimbits\n");
|
||||
#endif
|
||||
for (idac=0; idac<(srcMod->ndac); idac++) {
|
||||
if (*((srcMod->dacs)+idac)>=0)
|
||||
if (*((srcMod->dacs)+idac)>=0) {
|
||||
*((destMod->dacs)+idac)=*((srcMod->dacs)+idac);
|
||||
}
|
||||
}
|
||||
for (iadc=0; iadc<(srcMod->nadc); iadc++) {
|
||||
if (*((srcMod->adcs)+iadc)>=0)
|
||||
*((destMod->adcs)+iadc)=*((srcMod->adcs)+iadc);
|
||||
|
@ -3460,8 +3460,10 @@ slsDetectorDefs::sls_detector_module *slsDetector::getModule(int imod){
|
||||
}
|
||||
|
||||
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];
|
||||
//cprintf(BLUE,"dac%d:%d\n",i, myMod->dacs[i]);
|
||||
}
|
||||
}
|
||||
(detectorModules+imod)->gain=myMod->gain;
|
||||
(detectorModules+imod)->offset=myMod->offset;
|
||||
|
Loading…
x
Reference in New Issue
Block a user