mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-23 23:10:02 +02:00
setting receiver to none properly, ten giga set in shared memoery properly if no receiver involved
This commit is contained in:
parent
0a446c425b
commit
96caf728c8
@ -6027,6 +6027,14 @@ string slsDetector::setDetectorIP(string detectorIP){
|
||||
|
||||
|
||||
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){
|
||||
cprintf(RED,"Acquisition already running, Stopping it.\n");
|
||||
stopAcquisition();
|
||||
@ -7588,23 +7596,23 @@ slsDetectorDefs::synchronizationMode slsDetector::setSynchronization(synchroniza
|
||||
|
||||
/*receiver*/
|
||||
int slsDetector::setReceiverOnline(int off) {
|
||||
if (off!=GET_ONLINE_FLAG) {
|
||||
// setting flag to offline
|
||||
if (off == OFFLINE_FLAG)
|
||||
thisDetector->receiverOnlineFlag = off;
|
||||
// set flag to online only if hostname not none
|
||||
else if(strcmp(thisDetector->receiver_hostname,"none")){
|
||||
thisDetector->receiverOnlineFlag=off;
|
||||
}
|
||||
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG){
|
||||
setReceiverTCPSocket();
|
||||
// error in connecting
|
||||
if(thisDetector->receiverOnlineFlag==OFFLINE_FLAG){
|
||||
std::cout << "cannot connect to receiver" << endl;
|
||||
setErrorMask((getErrorMask())|(CANNOT_CONNECT_TO_RECEIVER));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (off!=GET_ONLINE_FLAG) {
|
||||
// no receiver
|
||||
if(!strcmp(thisDetector->receiver_hostname,"none"))
|
||||
thisDetector->receiverOnlineFlag = OFFLINE_FLAG;
|
||||
else
|
||||
thisDetector->receiverOnlineFlag = off;
|
||||
// check receiver online
|
||||
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG){
|
||||
setReceiverTCPSocket();
|
||||
// error in connecting
|
||||
if(thisDetector->receiverOnlineFlag==OFFLINE_FLAG){
|
||||
std::cout << "cannot connect to receiver" << endl;
|
||||
setErrorMask((getErrorMask())|(CANNOT_CONNECT_TO_RECEIVER));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return thisDetector->receiverOnlineFlag;
|
||||
}
|
||||
|
||||
@ -8681,9 +8689,9 @@ int slsDetector::enableTenGigabitEthernet(int i){
|
||||
//must also configuremac
|
||||
if((i != -1)&&(retval == i))
|
||||
if(configureMAC() != FAIL){
|
||||
ret = FAIL;
|
||||
retval=-1;
|
||||
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
|
||||
ret = FAIL;
|
||||
retval=-1;
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Enabling / Disabling 10Gbe in receiver: " << i << std::endl;
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user