mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-29 09:30:02 +02:00
added loadimage function
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@147 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
2076fb75f5
commit
af864279a5
@ -236,7 +236,6 @@ multiSlsDetector::multiSlsDetector(int id) : slsDetectorUtils(), shmId(-1)
|
|||||||
// #ifdef VERBOSE
|
// #ifdef VERBOSE
|
||||||
// cout << "done" << endl;
|
// cout << "done" << endl;
|
||||||
// #endif
|
// #endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
multiSlsDetector::~multiSlsDetector() {
|
multiSlsDetector::~multiSlsDetector() {
|
||||||
@ -1022,6 +1021,7 @@ int* multiSlsDetector::getDataFromDetector() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int* multiSlsDetector::readFrame(){
|
int* multiSlsDetector::readFrame(){
|
||||||
int nel=thisMultiDetector->dataBytes/sizeof(int);
|
int nel=thisMultiDetector->dataBytes/sizeof(int);
|
||||||
int n;
|
int n;
|
||||||
@ -2500,6 +2500,44 @@ int multiSlsDetector::configureMAC() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int multiSlsDetector::loadImageToDetector(imageType index,string const fname){
|
||||||
|
|
||||||
|
int ret=-100, ret1;
|
||||||
|
short int arg[thisMultiDetector->numberOfChannels];
|
||||||
|
|
||||||
|
ifstream infile;
|
||||||
|
infile.open(fname.c_str(), ios_base::in);
|
||||||
|
if (infile.is_open()) {
|
||||||
|
#ifdef VERBOSE
|
||||||
|
std::cout<< std::endl<< "Loading ";
|
||||||
|
if(!index)
|
||||||
|
std::cout<<"Dark";
|
||||||
|
else
|
||||||
|
std::cout<<"Gain";
|
||||||
|
std::cout<<" image from file " << fname << std::endl;
|
||||||
|
#endif
|
||||||
|
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++) {
|
||||||
|
if (detectors[idet]) {
|
||||||
|
if(detectors[idet]->readDataFile(infile,arg)>=0){
|
||||||
|
ret1=detectors[idet]->sendImageToDetector(index,arg);
|
||||||
|
if (ret==-100)
|
||||||
|
ret=ret1;
|
||||||
|
else if (ret!=ret1)
|
||||||
|
ret=-1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
infile.close();
|
||||||
|
} else {
|
||||||
|
std::cout<< "Could not open file "<< fname << std::endl;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::setDynamicRange(int p) {
|
int multiSlsDetector::setDynamicRange(int p) {
|
||||||
|
|
||||||
int ret=-100, ret1;
|
int ret=-100, ret1;
|
||||||
@ -3180,10 +3218,8 @@ int multiSlsDetector::retrieveDetectorSetup(string const fname1, int level){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int multiSlsDetector::loadImageToDetector(imageType t, string s) {
|
|
||||||
return OK;
|
return OK;
|
||||||
|
|
||||||
}
|
|
||||||
int multiSlsDetector::testFunction(int times) {
|
int multiSlsDetector::testFunction(int times) {
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
@ -853,9 +853,6 @@ class multiSlsDetector : public slsDetectorUtils {
|
|||||||
|
|
||||||
int configureMAC();
|
int configureMAC();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int setNumberOfModules(int i=-1, dimension d=X);
|
int setNumberOfModules(int i=-1, dimension d=X);
|
||||||
int getMaxNumberOfModules(dimension d=X);
|
int getMaxNumberOfModules(dimension d=X);
|
||||||
int setDynamicRange(int i=-1);
|
int setDynamicRange(int i=-1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user