included network tab in gui, correctedmulti to be able to clear sls detectors error mask,included coud not set up network parameter error

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@454 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d 2013-02-07 17:34:09 +00:00
parent 9fe499e20c
commit 35de710225
4 changed files with 43 additions and 10 deletions

View File

@ -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;

View File

@ -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<<id));
}
id++;
s=s.substr(p2+1);
@ -3909,3 +3911,13 @@ string multiSlsDetector::getErrorMessage(int &critical){
}
return retval;
}
int64_t multiSlsDetector::clearAllErrorMask(){
clearErrorMask();
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++)
if (detectors[idet])
detectors[idet]->clearErrorMask();
return getErrorMask();
}

View File

@ -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:

View File

@ -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;
}