bug fix: software trigger using control connect

This commit is contained in:
maliakal_d 2020-01-14 13:59:08 +01:00
parent 6f2aad3836
commit 06473cfcb2

View File

@ -3567,14 +3567,16 @@ int slsDetector::sendSoftwareTrigger() {
#endif #endif
thisDetector->stoppedFlag=0; thisDetector->stoppedFlag=0;
if (thisDetector->onlineFlag==ONLINE_FLAG) { if (thisDetector->onlineFlag==ONLINE_FLAG) {
if (connectControl() == OK){ if (stopSocket) {
stopSocket->SendDataOnly(&fnum,sizeof(fnum)); if (connectStop() == OK){
stopSocket->ReceiveDataOnly(&ret,sizeof(ret)); stopSocket->SendDataOnly(&fnum,sizeof(fnum));
if (ret==FAIL) { stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
stopSocket->ReceiveDataOnly(mess,sizeof(mess)); if (ret==FAIL) {
std::cout<< "Detector returned error: " << mess << std::endl; stopSocket->ReceiveDataOnly(mess,sizeof(mess));
std::cout<< "Detector returned error: " << mess << std::endl;
}
disconnectStop();
} }
disconnectControl();
} }
} }
return ret; return ret;