mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 13:27:14 +02:00
included execute trimming execution of pulseandmove
This commit is contained in:
@ -3819,27 +3819,51 @@ int multiSlsDetector::digitalTest(digitalTestMode mode, int imod) {
|
|||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::executeTrimming(trimMode mode, int par1, int par2, int imod) {
|
int multiSlsDetector::executeTrimming(trimMode mode, int par1, int par2, int imod) {
|
||||||
int id, im, ret;
|
int id, im, ret1=-1,ret=100;
|
||||||
|
|
||||||
|
|
||||||
if (decodeNMod(imod, id, im)>=0) {
|
if (decodeNMod(imod, id, im)>=0) {
|
||||||
if (detectors[id]) {
|
if (detectors[id]) {
|
||||||
ret = detectors[id]->executeTrimming(mode, par1, par2, im);
|
ret = detectors[id]->executeTrimming(mode, par1, par2, im);
|
||||||
if(detectors[id]->getErrorMask())
|
if(detectors[id]->getErrorMask())
|
||||||
setErrorMask(getErrorMask()|(1<<id));
|
setErrorMask(getErrorMask()|(1<<id));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
} else if (imod<0) {
|
} else if (imod<0) {
|
||||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
|
||||||
if (detectors[idet]) {
|
if(!threadpool){
|
||||||
ret=detectors[idet]->executeTrimming(mode, par1, par2, imod);
|
cout << "Error in creating threadpool. Exiting" << endl;
|
||||||
if(detectors[idet]->getErrorMask())
|
return -1;
|
||||||
setErrorMask(getErrorMask()|(1<<idet));
|
}else{
|
||||||
}
|
//return storage values
|
||||||
}
|
int* iret[thisMultiDetector->numberOfDetectors];
|
||||||
return ret;
|
for(int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++){
|
||||||
}
|
if(detectors[idet]){
|
||||||
return -1;
|
iret[idet]= new int(-1);
|
||||||
|
Task* task = new Task(new func4_t <int,slsDetector,trimMode,int,int,int,int>(&slsDetector::executeTrimming,
|
||||||
|
detectors[idet],mode,par1,par2,imod,iret[idet]));
|
||||||
|
threadpool->add_task(task);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
threadpool->wait_for_tasks_to_complete();
|
||||||
|
for(int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++){
|
||||||
|
if(detectors[idet]){
|
||||||
|
if(iret[idet] != NULL){
|
||||||
|
ret1 = *iret[idet];
|
||||||
|
delete iret[idet];
|
||||||
|
}
|
||||||
|
if(detectors[idet]->getErrorMask())
|
||||||
|
setErrorMask(getErrorMask()|(1<<idet));
|
||||||
|
if (ret==-100)
|
||||||
|
ret=ret1;
|
||||||
|
else if (ret!=ret1)
|
||||||
|
ret=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,21 +82,23 @@ private:
|
|||||||
class Task: public virtual slsDetectorDefs{
|
class Task: public virtual slsDetectorDefs{
|
||||||
public:
|
public:
|
||||||
/* Return: int, Param: int */
|
/* Return: int, Param: int */
|
||||||
Task(func1_t <int,slsDetector,int,int>* t): m1(t),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0){};
|
Task(func1_t <int,slsDetector,int,int>* t): m1(t),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0){};
|
||||||
/* Return: int, Param: string,int */
|
/* Return: int, Param: string,int */
|
||||||
Task(func2_t <int,slsDetector,string,int,int>* t): m1(0),m2(t),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0){};
|
Task(func2_t <int,slsDetector,string,int,int>* t): m1(0),m2(t),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0){};
|
||||||
/* Return: string, Param: string */
|
/* Return: string, Param: string */
|
||||||
Task(func1_t <string,slsDetector,string,string>* t): m1(0),m2(0),m3(t),m4(0),m5(0),m6(0),m7(0),m8(0){};
|
Task(func1_t <string,slsDetector,string,string>* t): m1(0),m2(0),m3(t),m4(0),m5(0),m6(0),m7(0),m8(0),m9(0){};
|
||||||
/* Return: char*, Param: char* */
|
/* Return: char*, Param: char* */
|
||||||
Task(func1_t <char*,slsDetector,char*,string>* t): m1(0),m2(0),m3(0),m4(t),m5(0),m6(0),m7(0),m8(0){};
|
Task(func1_t <char*,slsDetector,char*,string>* t): m1(0),m2(0),m3(0),m4(t),m5(0),m6(0),m7(0),m8(0),m9(0){};
|
||||||
/* Return: detectorSettings, Param: int */
|
/* Return: detectorSettings, Param: int */
|
||||||
Task(func1_t <detectorSettings,slsDetector,int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(t),m6(0),m7(0),m8(0){};
|
Task(func1_t <detectorSettings,slsDetector,int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(t),m6(0),m7(0),m8(0),m9(0){};
|
||||||
/* Return: detectorSettings, Param: detectorSettings,int */
|
/* Return: detectorSettings, Param: detectorSettings,int */
|
||||||
Task(func2_t <detectorSettings,slsDetector,detectorSettings,int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(t),m7(0),m8(0){};
|
Task(func2_t <detectorSettings,slsDetector,detectorSettings,int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(t),m7(0),m8(0),m9(0){};
|
||||||
/* Return: int, Param: int,int */
|
/* Return: int, Param: int,int */
|
||||||
Task(func2_t <int,slsDetector,int,int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(t),m8(0){};
|
Task(func2_t <int,slsDetector,int,int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(t),m8(0),m9(0){};
|
||||||
/* Return: int, Param: int,int */
|
/* Return: int, Param: int,int */
|
||||||
Task(func3_t <int,slsDetector,int,int,int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(t){};
|
Task(func3_t <int,slsDetector,int,int,int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(t),m9(0){};
|
||||||
|
/* Return: int, Param: trimMode,int,int,int */
|
||||||
|
Task(func4_t <int,slsDetector,trimMode,int,int,int,int>* t): m1(0),m2(0),m3(0),m4(0),m5(0),m6(0),m7(0),m8(0),m9(t){};
|
||||||
|
|
||||||
|
|
||||||
~Task(){}
|
~Task(){}
|
||||||
@ -109,6 +111,8 @@ public:
|
|||||||
else if(m5) (*m5)();
|
else if(m5) (*m5)();
|
||||||
else if(m6) (*m6)();
|
else if(m6) (*m6)();
|
||||||
else if(m7) (*m7)();
|
else if(m7) (*m7)();
|
||||||
|
else if(m8) (*m8)();
|
||||||
|
else if(m9) (*m9)();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -128,6 +132,8 @@ private:
|
|||||||
func2_t <int,slsDetector,int,int,int>* m7;
|
func2_t <int,slsDetector,int,int,int>* m7;
|
||||||
/* Return: int, Param: int,int */
|
/* Return: int, Param: int,int */
|
||||||
func3_t <int,slsDetector,int,int,int,int>* m8;
|
func3_t <int,slsDetector,int,int,int,int>* m8;
|
||||||
|
/* Return: int, Param: trimMode,int,int,int */
|
||||||
|
func4_t <int,slsDetector,trimMode,int,int,int,int>* m9;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user