added load image, changed key find, changed get temp to getADC

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@123 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2012-02-20 10:05:57 +00:00
parent 44eea027f3
commit c6f61d3663
5 changed files with 378 additions and 151 deletions

View File

@ -1764,7 +1764,6 @@ int slsDetector::readRegister(int addr){
PREAMP,
TEMPERATURE,
HUMIDITY,
DETECTOR_BIAS
}{};
*/
@ -4544,7 +4543,52 @@ int slsDetector:: writeAngularConversion(ofstream &ofs) {
}
int slsDetector::loadImageToDetector(int index,string const fname){
int retval;
int fnum=F_LOAD_IMAGE;
int ret=FAIL;
char mess[100];
short int arg[1280];
#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
if(readDataFile(fname,arg)){
std::cout<< "Could not open file "<< fname << std::endl;
return -1;
}
if (thisDetector->onlineFlag==ONLINE_FLAG) {
if (controlSocket) {
if (controlSocket->Connect()>=0) {
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
controlSocket->SendDataOnly(&index,sizeof(index));
controlSocket->SendDataOnly(arg,sizeof(arg));
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
if (ret!=FAIL)
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
else {
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
std::cout<< "Detector returned error: " << mess << std::endl;
}
controlSocket->Disconnect();
if (ret==FORCE_UPDATE)
updateDetector();
}
}
}
if (ret==FAIL) {
std::cout<< "failed " << std::endl;
return -1;
}
return 0;
}