added trimval function, but sending trimbits from char to int bug

This commit is contained in:
Maliakal Dhanya
2014-07-21 16:39:36 +02:00
parent e15d6077df
commit 7e46a407c6
17 changed files with 276 additions and 84 deletions

View File

@ -5719,6 +5719,41 @@ int slsDetector::saveSettingsFile(string fname, int imod) {
int slsDetector::setAllTrimbits(int val, int imod){
int fnum=F_SET_ALL_TRIMBITS;
int retval;
char mess[100];
int ret=OK;
#ifdef VERBOSE
std::cout<< "Setting all trimbits to "<< val << std::endl;
#endif
if (thisDetector->onlineFlag==ONLINE_FLAG) {
if (connectControl() == OK){
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
controlSocket->SendDataOnly(&val,sizeof(val));
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
if (ret==FAIL) {
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
std::cout<< "Detector returned error: " << mess << std::endl;
setErrorMask((getErrorMask())|(ALLTIMBITS_NOT_SET));
} else {
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
}
controlSocket->Disconnect();
if (ret==FORCE_UPDATE)
updateDetector();
}
}
#ifdef VERBOSE
std::cout<< "All trimbits were set to "<< retval << std::endl;
#endif
return retval;
}
int slsDetector::loadCalibrationFile(string fname, int imod) {