ensuring acquire, p receiver start and the gui enables and disables data streaming accordingly. those with api will have to know what they want before acquiring

This commit is contained in:
Dhanya Maliakal
2017-06-22 16:44:29 +02:00
parent cd86c708dc
commit bbbd4731d7
3 changed files with 28 additions and 26 deletions

View File

@ -1319,7 +1319,15 @@ string slsDetectorCommand::cmdAcquire(int narg, char *args[], int action) {
myDet->setOnline(ONLINE_FLAG);
myDet->setReceiverOnline(ONLINE_FLAG);
if (myDet->setReceiverOnline(ONLINE_FLAG) == ONLINE_FLAG) {
//if it was not off
if (myDet->enableDataStreamingFromReceiver(-1) != 0){
//switch it off, if error
if (myDet->enableDataStreamingFromReceiver(0) != 0) {
return string("could not disable data streaming in receiver\n");
}
}
}
if(myDet->acquire() == FAIL)
return string("acquire unsuccessful");
@ -4830,12 +4838,23 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) {
myDet->setOnline(ONLINE_FLAG);
myDet->setReceiverOnline(ONLINE_FLAG);
int receivers = myDet->setReceiverOnline(ONLINE_FLAG);
if(cmd=="receiver"){
if (action==PUT_ACTION) {
if(!strcasecmp(args[1],"start"))
if(!strcasecmp(args[1],"start")) {
//to ensure data streaming enable is the same across client and receiver
if (receivers == ONLINE_FLAG) {
//if it was not off
if (myDet->enableDataStreamingFromReceiver(-1) != 0){
//switch it off, if error
if (myDet->enableDataStreamingFromReceiver(0) != 0) {
return string("could not disable data streaming in receiver\n");
}
}
}
myDet->startReceiver();
}
else if(!strcasecmp(args[1],"stop")){
//myDet->stopReceiver();
// myDet->startReceiverReadout();