dynamic range also updates offsets, 4 bit mode gap pixels work in call back from gui

This commit is contained in:
Dhanya Maliakal
2017-10-31 12:50:31 +01:00
parent 6ff249c3f2
commit 82f503aa09
5 changed files with 208 additions and 52 deletions

View File

@ -2009,44 +2009,44 @@ int slsDetector::enableGapPixels(int val) {
if(thisDetector->myDetectorType!= EIGER)
return -1;
if (thisDetector->dynamicRange == 4) return val;
if (val >= 0) {
val=(val>0)?1:0;
// send to receiver
int ret=OK;
//if (thisDetector->dynamicRange != 4) {
ret = FAIL;
int retval=-1;
int fnum=F_ENABLE_GAPPIXELS_IN_RECEIVER;
int arg=val;
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG) {
if (connectData() == OK){
ret=thisReceiver->sendInt(fnum,retval,arg);
disconnectData();
}
if((arg != retval) || (ret==FAIL)){
ret = FAIL;
setErrorMask((getErrorMask())|(RECEIVER_ENABLE_GAPPIXELS_NOT_SET));
}
if(ret==FORCE_UPDATE)
updateReceiver();
int retval=-1;
int fnum=F_ENABLE_GAPPIXELS_IN_RECEIVER;
int arg=val;
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG) {
if (connectData() == OK){
ret=thisReceiver->sendInt(fnum,retval,arg);
disconnectData();
}
// }
if((arg != retval) || (ret==FAIL)){
ret = FAIL;
setErrorMask((getErrorMask())|(RECEIVER_ENABLE_GAPPIXELS_NOT_SET));
}
if(ret==FORCE_UPDATE)
updateReceiver();
}
// update client
if (ret == OK) {
thisDetector->gappixels = val;
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y) * (thisDetector->dynamicRange/8);
thisDetector->dataBytesInclGapPixels = 0;
// set data bytes for other detector ( for future use)
if(thisDetector->myDetectorType==JUNGFRAUCTB)
getTotalNumberOfChannels();
if(thisDetector->myDetectorType==MYTHEN){
if (thisDetector->dynamicRange==24 || thisDetector->timerValue[PROBES_NUMBER]>0) {
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y) * thisDetector->nChans*4;
if (thisDetector->dynamicRange != 4) {
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y) * (thisDetector->dynamicRange/8);
// set data bytes for other detector ( for future use)
if(thisDetector->myDetectorType==JUNGFRAUCTB)
getTotalNumberOfChannels();
if(thisDetector->myDetectorType==MYTHEN){
if (thisDetector->dynamicRange==24 || thisDetector->timerValue[PROBES_NUMBER]>0) {
thisDetector->dataBytesInclGapPixels = getTotalNumberOfChannelsInclGapPixels(X)*getTotalNumberOfChannelsInclGapPixels(Y) * thisDetector->nChans*4;
}
}
}
}