added trimbit mask

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@254 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d 2012-09-13 08:58:45 +00:00
parent 4c8bc09143
commit 3f5bda1674
3 changed files with 5 additions and 3 deletions

View File

@ -349,6 +349,8 @@ enum channelRegisterBit {
ANALOG_SIGNAL_ENABLE=0x200, /**< mask of the analogue output enable bit */
CALIBRATION_ENABLE=0x300, /**< mask of the calibration input enable bit */
};
#define TRIMBITMASK 0x3f
/**
meaning of the chip register bits
\see ::sls_detector_chip

View File

@ -2823,7 +2823,7 @@ int slsDetector::getChanRegs(double* retval,bool fromDetector){
//the original array has 0 initialized
if(chanregs){
for (int i=0; i<n; i++)
retval[i] = (double) chanregs[i];
retval[i] = (double) (chanregs[i] & TRIMBITMASK);
}
return n;
}

View File

@ -153,7 +153,7 @@ slsDetectorDefs::sls_detector_module* energyConversion::readSettingsFile(string
#ifdef VERBOSE
// std::cout<< "trimbits " << ival ;
#endif
myMod->chanregs[ichip*nch+ichan]|=ival&0x3f;
myMod->chanregs[ichip*nch+ichan]|=ival&TRIMBITMASK;
break;
case 1:
#ifdef VERBOSE
@ -297,7 +297,7 @@ int energyConversion::writeSettingsFile(string fname, detectorType myDetectorTyp
outfile << names[idac] << " " << iv1 << std::endl;
for (ichan=0; ichan<nch; ichan++) {
iv=mod.chanregs[ichip*nch+ichan];
iv1= (iv&0x3f);
iv1= (iv&TRIMBITMASK);
outfile <<iv1 << " ";
nb=9;
iv1=((iv&(1<<nb))>>nb);