setting receiver to none properly, ten giga set in shared memoery properly if no receiver involved

This commit is contained in:
Dhanya Maliakal 2017-10-03 14:17:48 +02:00
parent 0a446c425b
commit 96caf728c8

View File

@ -6027,6 +6027,14 @@ string slsDetector::setDetectorIP(string detectorIP){
string slsDetector::setReceiver(string receiverIP){ string slsDetector::setReceiver(string receiverIP){
if(receiverIP == "none") {
memset(thisDetector->receiver_hostname, 0, MAX_STR_LENGTH);
strcpy(thisDetector->receiver_hostname,"none");
thisDetector->receiverOnlineFlag = OFFLINE_FLAG;
return string(thisDetector->receiver_hostname);
}
if(getRunStatus()==RUNNING){ if(getRunStatus()==RUNNING){
cprintf(RED,"Acquisition already running, Stopping it.\n"); cprintf(RED,"Acquisition already running, Stopping it.\n");
stopAcquisition(); stopAcquisition();
@ -7589,13 +7597,12 @@ slsDetectorDefs::synchronizationMode slsDetector::setSynchronization(synchroniza
/*receiver*/ /*receiver*/
int slsDetector::setReceiverOnline(int off) { int slsDetector::setReceiverOnline(int off) {
if (off!=GET_ONLINE_FLAG) { if (off!=GET_ONLINE_FLAG) {
// setting flag to offline // no receiver
if (off == OFFLINE_FLAG) if(!strcmp(thisDetector->receiver_hostname,"none"))
thisDetector->receiverOnlineFlag = OFFLINE_FLAG;
else
thisDetector->receiverOnlineFlag = off; thisDetector->receiverOnlineFlag = off;
// set flag to online only if hostname not none // check receiver online
else if(strcmp(thisDetector->receiver_hostname,"none")){
thisDetector->receiverOnlineFlag=off;
}
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG){ if (thisDetector->receiverOnlineFlag==ONLINE_FLAG){
setReceiverTCPSocket(); setReceiverTCPSocket();
// error in connecting // error in connecting
@ -7604,6 +7611,7 @@ int slsDetector::setReceiverOnline(int off) {
setErrorMask((getErrorMask())|(CANNOT_CONNECT_TO_RECEIVER)); setErrorMask((getErrorMask())|(CANNOT_CONNECT_TO_RECEIVER));
} }
} }
} }
return thisDetector->receiverOnlineFlag; return thisDetector->receiverOnlineFlag;
} }
@ -8681,9 +8689,9 @@ int slsDetector::enableTenGigabitEthernet(int i){
//must also configuremac //must also configuremac
if((i != -1)&&(retval == i)) if((i != -1)&&(retval == i))
if(configureMAC() != FAIL){ if(configureMAC() != FAIL){
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
ret = FAIL; ret = FAIL;
retval=-1; retval=-1;
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
#ifdef VERBOSE #ifdef VERBOSE
std::cout << "Enabling / Disabling 10Gbe in receiver: " << i << std::endl; std::cout << "Enabling / Disabling 10Gbe in receiver: " << i << std::endl;
#endif #endif