mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-24 15:20:02 +02:00
added getchanregs function to get the trimbits
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@251 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
c6d383f770
commit
3faeca0649
@ -1043,6 +1043,21 @@ slsDetectorDefs::detectorSettings multiSlsDetector::setSettings(detectorSettings
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int multiSlsDetector::getChanRegs(double* retval){
|
||||||
|
//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);
|
||||||
|
|
||||||
|
memcpy(retval + (currentNumChans * sizeof(double)), retval1 , nChansDet*sizeof(double));
|
||||||
|
currentNumChans += nChansDet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -427,7 +427,12 @@ class multiSlsDetector : public slsDetectorUtils {
|
|||||||
detectorSettings setSettings(detectorSettings isettings, int imod=-1);
|
detectorSettings setSettings(detectorSettings isettings, int imod=-1);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the trimbits from the detector's shared memmory
|
||||||
|
\param retval is the array with the trimbits
|
||||||
|
\returns the total number of channels for the detector
|
||||||
|
*/
|
||||||
|
int getChanRegs(double* retval);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -2438,7 +2438,7 @@ int slsDetector::setModule(sls_detector_module module){
|
|||||||
};
|
};
|
||||||
|
|
||||||
slsDetectorDefs::sls_detector_module *slsDetector::getModule(int imod){
|
slsDetectorDefs::sls_detector_module *slsDetector::getModule(int imod){
|
||||||
|
cout<<"getModuke:"<<imod<<endl;
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
std::cout << "slsDetector get module " << std::endl;
|
std::cout << "slsDetector get module " << std::endl;
|
||||||
#endif
|
#endif
|
||||||
@ -2813,6 +2813,19 @@ slsDetectorDefs::detectorSettings slsDetector::setSettings( detectorSettings ise
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int slsDetector::getChanRegs(double* retval){
|
||||||
|
int n=getTotalNumberOfChannels();
|
||||||
|
//else the original array has 0 initialized
|
||||||
|
if(chanregs){
|
||||||
|
for (int i=0; i<n; i++)
|
||||||
|
retval[i] = (double) chanregs[i];
|
||||||
|
}
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int slsDetector::updateDetectorNoWait() {
|
int slsDetector::updateDetectorNoWait() {
|
||||||
|
|
||||||
// int ret=OK;
|
// int ret=OK;
|
||||||
|
@ -881,6 +881,14 @@ typedef struct sharedSlsDetector {
|
|||||||
detectorSettings setSettings(detectorSettings isettings, int imod=-1);
|
detectorSettings setSettings(detectorSettings isettings, int imod=-1);
|
||||||
//virtual detectorSettings setSettings(detectorSettings isettings, int imod=-1);
|
//virtual detectorSettings setSettings(detectorSettings isettings, int imod=-1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
gets the trimbits from shared memory *chanRegs
|
||||||
|
\param retval is the array with the trimbits
|
||||||
|
\returns the total number of channels for the detector
|
||||||
|
\sa ::sls_detector_module
|
||||||
|
*/
|
||||||
|
int getChanRegs(double* retval);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
updates the shared memory receiving the data from the detector (without asking and closing the connection
|
updates the shared memory receiving the data from the detector (without asking and closing the connection
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user