mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 18:10:40 +02:00
edited getChanregs to include argument to get trimbits from sharedmemory or detector
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@253 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
008d930594
commit
4c8bc09143
@ -1043,14 +1043,14 @@ slsDetectorDefs::detectorSettings multiSlsDetector::setSettings(detectorSettings
|
||||
|
||||
|
||||
|
||||
int multiSlsDetector::getChanRegs(double* retval){
|
||||
int multiSlsDetector::getChanRegs(double* retval,bool fromDetector){
|
||||
//nChansDet and currentNumChans is because of varying channel size per detector
|
||||
int n = thisMultiDetector->numberOfChannels,nChansDet,currentNumChans=0;
|
||||
double retval1[n];
|
||||
|
||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||
if (detectors[idet]) {
|
||||
nChansDet = detectors[idet]->getChanRegs(retval1);
|
||||
nChansDet = detectors[idet]->getChanRegs(retval1,fromDetector);
|
||||
|
||||
memcpy(retval + (currentNumChans * sizeof(double)), retval1 , nChansDet*sizeof(double));
|
||||
currentNumChans += nChansDet;
|
||||
|
@ -430,9 +430,10 @@ class multiSlsDetector : public slsDetectorUtils {
|
||||
/**
|
||||
Returns the trimbits from the detector's shared memmory
|
||||
\param retval is the array with the trimbits
|
||||
\param fromDetector is true if the trimbits shared memory have to be uploaded from detector
|
||||
\returns the total number of channels for the detector
|
||||
*/
|
||||
int getChanRegs(double* retval);
|
||||
int getChanRegs(double* retval,bool fromDetector);
|
||||
|
||||
|
||||
|
||||
|
@ -2438,7 +2438,7 @@ int slsDetector::setModule(sls_detector_module module){
|
||||
};
|
||||
|
||||
slsDetectorDefs::sls_detector_module *slsDetector::getModule(int imod){
|
||||
cout<<"getModuke:"<<imod<<endl;
|
||||
|
||||
#ifdef VERBOSE
|
||||
std::cout << "slsDetector get module " << std::endl;
|
||||
#endif
|
||||
@ -2814,9 +2814,13 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise
|
||||
|
||||
|
||||
|
||||
int slsDetector::getChanRegs(double* retval){
|
||||
int slsDetector::getChanRegs(double* retval,bool fromDetector){
|
||||
int n=getTotalNumberOfChannels();
|
||||
//else the original array has 0 initialized
|
||||
if(fromDetector){
|
||||
for(int im=0;im<setNumberOfModules();im++)
|
||||
getModule(im);
|
||||
}
|
||||
//the original array has 0 initialized
|
||||
if(chanregs){
|
||||
for (int i=0; i<n; i++)
|
||||
retval[i] = (double) chanregs[i];
|
||||
|
@ -884,10 +884,11 @@ typedef struct sharedSlsDetector {
|
||||
/**
|
||||
gets the trimbits from shared memory *chanRegs
|
||||
\param retval is the array with the trimbits
|
||||
\param fromDetector is true if the trimbits shared memory have to be uploaded from detector
|
||||
\returns the total number of channels for the detector
|
||||
\sa ::sls_detector_module
|
||||
*/
|
||||
int getChanRegs(double* retval);
|
||||
int getChanRegs(double* retval,bool fromDetector);
|
||||
|
||||
/**
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user