diff --git a/slsDetectorSoftware/commonFiles/error_defs.h b/slsDetectorSoftware/commonFiles/error_defs.h index b6be32d6c..af5a550d8 100644 --- a/slsDetectorSoftware/commonFiles/error_defs.h +++ b/slsDetectorSoftware/commonFiles/error_defs.h @@ -28,8 +28,9 @@ using namespace std; #define COULDNOT_SET_DATA_PORT 0x0800000000000000ULL -#define COULD_NOT_CONFIGURE_MAC 0x0000000000000001ULL +#define COULD_NOT_CONFIGURE_MAC 0x0000000000000001ULL +#define COULDNOT_SET_NETWORK_PARAMETER 0x0000000000000002ULL /** @short class returning all error messages for error mask */ @@ -65,10 +66,12 @@ public: retval.append("Could not set receiver port\n"); + if(slsErrorMask&COULD_NOT_CONFIGURE_MAC) retval.append("Could not configure mac\n"); - + if(slsErrorMask&COULDNOT_SET_NETWORK_PARAMETER) + retval.append("Could not set network parameter. Should be valid and in proper format.\n"); return retval; diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp index f58214990..d2c6d5b5b 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.cpp @@ -2542,7 +2542,9 @@ char* multiSlsDetector::setNetworkParameter(networkParameter p, string s){ while (p2!=string::npos) { if (detectors[id]) { - detectors[id]->setCalDir(s.substr(p1,p2-p1)); + detectors[id]->setNetworkParameter(p,s.substr(p1,p2-p1)); + if(detectors[id]->getErrorMask()) + setErrorMask(getErrorMask()|(1<numberOfDetectors; idet++) + if (detectors[idet]) + detectors[idet]->clearErrorMask(); + + return getErrorMask(); +} diff --git a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h index 90486d17c..21b64f1d8 100644 --- a/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h +++ b/slsDetectorSoftware/multiSlsDetector/multiSlsDetector.h @@ -1141,6 +1141,10 @@ class multiSlsDetector : public slsDetectorUtils { */ string getErrorMessage(int &critical); + /** Clears error mask of both multi and sls + /returns error mask + */ + int64_t clearAllErrorMask(); protected: diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index 0677bf510..4457c187e 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -465,6 +465,8 @@ int slsDetector::initializeDetectorSize(detectorType type) { strcpy(thisDetector->receiver_hostname,"none"); /** set receiver udp ip address */ strcpy(thisDetector->receiverUDPIP,"none"); + /** set receiver udp mac address */ + strcpy(thisDetector->receiverUDPMAC,"none"); /** set detector mac address */ strcpy(thisDetector->detectorMAC,DEFAULT_DET_MAC); /** set detector ip address */ @@ -4560,11 +4562,15 @@ char* slsDetector::setDetectorMAC(string detectorMAC){ if((detectorMAC[2]==':')&&(detectorMAC[5]==':')&&(detectorMAC[8]==':')&& (detectorMAC[11]==':')&&(detectorMAC[14]==':')) strcpy(thisDetector->detectorMAC,detectorMAC.c_str()); - else + else{ + setErrorMask((getErrorMask())|(COULDNOT_SET_NETWORK_PARAMETER)); return("server MAC Address should be in xx:xx:xx:xx:xx:xx format"); + } + } + else{ + setErrorMask((getErrorMask())|(COULDNOT_SET_NETWORK_PARAMETER)); + return("server MAC Address should be in xx:xx:xx:xx:xx:xx format"); } - else - return("server MAC Address should be in xx:xx:xx:xx:xx:xx format"); return thisDetector->detectorMAC; }; @@ -4579,8 +4585,10 @@ char* slsDetector::setDetectorIP(string detectorIP){ int result = inet_pton(AF_INET, detectorIP.c_str(), &(sa.sin_addr)); if(result!=0) strcpy(thisDetector->detectorIP,detectorIP.c_str()); - else + else{ + setErrorMask((getErrorMask())|(COULDNOT_SET_NETWORK_PARAMETER)); return ("Detector IP Address should be VALID and in xxx.xxx.xxx.xxx format"); + } } } return thisDetector->detectorIP; @@ -4621,8 +4629,10 @@ char* slsDetector::setReceiverUDPIP(string udpip){ int result = inet_pton(AF_INET, udpip.c_str(), &(sa.sin_addr)); if(result!=0) strcpy(thisDetector->receiverUDPIP,udpip.c_str()); - else + else{ + setErrorMask((getErrorMask())|(COULDNOT_SET_NETWORK_PARAMETER)); return ("Receiver UDP IP Address should be VALID and in xxx.xxx.xxx.xxx format"); + } } } return thisDetector->receiverUDPIP; @@ -4636,11 +4646,15 @@ char* slsDetector::setReceiverUDPMAC(string udpmac){ if((udpmac[2]==':')&&(udpmac[5]==':')&&(udpmac[8]==':')&& (udpmac[11]==':')&&(udpmac[14]==':')) strcpy(thisDetector->receiverUDPMAC,udpmac.c_str()); - else + else{ + setErrorMask((getErrorMask())|(COULDNOT_SET_NETWORK_PARAMETER)); return("receiver udp mac address should be in xx:xx:xx:xx:xx:xx format"); + } } - else + else{ + setErrorMask((getErrorMask())|(COULDNOT_SET_NETWORK_PARAMETER)); return("receiver udp mac address should be in xx:xx:xx:xx:xx:xx format"); + } return thisDetector->receiverUDPMAC; }