put trimval should work also for MYTHEN

This commit is contained in:
2017-11-21 12:09:52 +01:00
parent 7c9958db04
commit 45e0cf71eb
5 changed files with 72 additions and 66 deletions

View File

@ -1,11 +1,11 @@
//#define SVNPATH ""
#define SVNURLLIB "git@git.psi.ch:sls_detectors_software/sls_detector_software.git"
//#define SVNREPPATH ""
#define SVNREPUUIDLIB "1fd03e9cdd01efd75e3ab8641be71d61b2e1aa10"
//#define SVNREV 0x1571
#define SVNREPUUIDLIB "73bad32c4ab2c8cfb2687547f7da6f932b358c1a"
//#define SVNREV 0x1609
//#define SVNKIND ""
//#define SVNSCHED ""
#define SVNAUTHLIB "Dhanya_Maliakal"
#define SVNREVLIB 0x1571
#define SVNDATELIB 0x20171003
#define SVNAUTHLIB "Dhanya_Thattil"
#define SVNREVLIB 0x1609
#define SVNDATELIB 0x20171107
//

View File

@ -7526,24 +7526,30 @@ int slsDetector::setAllTrimbits(int val, int imod){
#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));
}
disconnectControl();
if (ret==FORCE_UPDATE)
updateDetector();
}
}
if (getDetectorsType() == MYTHEN) {
if (val>=0) {
setChannel((val<<((int)TRIMBIT_OFF))|((int)COMPARATOR_ENABLE)); // trimbit scan
}
return val;
} else {
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));
}
disconnectControl();
if (ret==FORCE_UPDATE)
updateDetector();
}
}
}
#ifdef VERBOSE
std::cout<< "All trimbits were set to "<< retval << std::endl;

View File

@ -4532,14 +4532,14 @@ string slsDetectorCommand::cmdSettings(int narg, char *args[], int action) {
return string("done");
} else if (cmd=="trimval") {
if (action==PUT_ACTION){
if (sscanf(args[1],"%d",&val))
myDet->setAllTrimbits(val);
else
return string("invalid trimbit value ")+cmd;
}
sprintf(ans,"%d",myDet->setAllTrimbits(-1));
return ans;
if (action==PUT_ACTION){
if (sscanf(args[1],"%d",&val))
myDet->setAllTrimbits(val);
else
return string("invalid trimbit value ")+cmd;
}
sprintf(ans,"%d",myDet->setAllTrimbits(-1));
return ans;
} else if (cmd=="pedestal") {
if (action==GET_ACTION)
return string("cannot get");