configuremac after starting receiver, also telling the server to send packets to receiver or cpu with receiver start and receiver stop

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@290 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2012-10-11 12:53:48 +00:00
parent e5a7d834db
commit 29a540818f
7 changed files with 174 additions and 18 deletions

View File

@ -5543,10 +5543,35 @@ int slsDetector::startReceiver(){
}
dataSocket->Disconnect();
if (ret==FORCE_UPDATE)
updateReceiver();
ret=updateReceiver();
}
}
}
//configuremac for gotthard
if(ret==OK)
if(thisDetector->myDetectorType==GOTTHARD)
ret=configureMAC();
//tell the server to send to receiver and not CPU
if(ret==OK){
if (thisDetector->onlineFlag==ONLINE_FLAG) {
if (controlSocket) {
if (controlSocket->Connect()>=0) {
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
if (ret==FAIL){
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
std::cout<< "Detector returned error: " << mess << std::endl;
}
controlSocket->Disconnect();
if (ret==FORCE_UPDATE)
ret=updateDetector();
}
}
}
}
return ret;
}
@ -5574,10 +5599,30 @@ int slsDetector::stopReceiver(){
dataSocket->Disconnect();
if (ret==FORCE_UPDATE)
updateReceiver();
ret=updateReceiver();
}
}
}
//tell the server to NOT send to receiver and instead to CPU
if(ret==OK){
if (thisDetector->onlineFlag==ONLINE_FLAG) {
if (controlSocket) {
if (controlSocket->Connect()>=0) {
controlSocket->SendDataOnly(&fnum,sizeof(fnum));
controlSocket->ReceiveDataOnly(&ret,sizeof(ret));
if (ret==FAIL){
controlSocket->ReceiveDataOnly(mess,sizeof(mess));
std::cout<< "Detector returned error: " << mess << std::endl;
}
controlSocket->Disconnect();
if (ret==FORCE_UPDATE)
ret=updateDetector();
}
}
}
}
return ret;
}