mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-09 03:20:42 +02:00
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:
parent
9fe499e20c
commit
35de710225
@ -28,8 +28,9 @@ using namespace std;
|
|||||||
#define COULDNOT_SET_DATA_PORT 0x0800000000000000ULL
|
#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 */
|
/** @short class returning all error messages for error mask */
|
||||||
@ -65,10 +66,12 @@ public:
|
|||||||
retval.append("Could not set receiver port\n");
|
retval.append("Could not set receiver port\n");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(slsErrorMask&COULD_NOT_CONFIGURE_MAC)
|
if(slsErrorMask&COULD_NOT_CONFIGURE_MAC)
|
||||||
retval.append("Could not configure mac\n");
|
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;
|
return retval;
|
||||||
|
|
||||||
|
@ -2542,7 +2542,9 @@ char* multiSlsDetector::setNetworkParameter(networkParameter p, string s){
|
|||||||
while (p2!=string::npos) {
|
while (p2!=string::npos) {
|
||||||
|
|
||||||
if (detectors[id]) {
|
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++;
|
id++;
|
||||||
s=s.substr(p2+1);
|
s=s.substr(p2+1);
|
||||||
@ -3909,3 +3911,13 @@ string multiSlsDetector::getErrorMessage(int &critical){
|
|||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int64_t multiSlsDetector::clearAllErrorMask(){
|
||||||
|
clearErrorMask();
|
||||||
|
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; idet++)
|
||||||
|
if (detectors[idet])
|
||||||
|
detectors[idet]->clearErrorMask();
|
||||||
|
|
||||||
|
return getErrorMask();
|
||||||
|
}
|
||||||
|
@ -1141,6 +1141,10 @@ class multiSlsDetector : public slsDetectorUtils {
|
|||||||
*/
|
*/
|
||||||
string getErrorMessage(int &critical);
|
string getErrorMessage(int &critical);
|
||||||
|
|
||||||
|
/** Clears error mask of both multi and sls
|
||||||
|
/returns error mask
|
||||||
|
*/
|
||||||
|
int64_t clearAllErrorMask();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
@ -465,6 +465,8 @@ int slsDetector::initializeDetectorSize(detectorType type) {
|
|||||||
strcpy(thisDetector->receiver_hostname,"none");
|
strcpy(thisDetector->receiver_hostname,"none");
|
||||||
/** set receiver udp ip address */
|
/** set receiver udp ip address */
|
||||||
strcpy(thisDetector->receiverUDPIP,"none");
|
strcpy(thisDetector->receiverUDPIP,"none");
|
||||||
|
/** set receiver udp mac address */
|
||||||
|
strcpy(thisDetector->receiverUDPMAC,"none");
|
||||||
/** set detector mac address */
|
/** set detector mac address */
|
||||||
strcpy(thisDetector->detectorMAC,DEFAULT_DET_MAC);
|
strcpy(thisDetector->detectorMAC,DEFAULT_DET_MAC);
|
||||||
/** set detector ip address */
|
/** set detector ip address */
|
||||||
@ -4560,11 +4562,15 @@ char* slsDetector::setDetectorMAC(string detectorMAC){
|
|||||||
if((detectorMAC[2]==':')&&(detectorMAC[5]==':')&&(detectorMAC[8]==':')&&
|
if((detectorMAC[2]==':')&&(detectorMAC[5]==':')&&(detectorMAC[8]==':')&&
|
||||||
(detectorMAC[11]==':')&&(detectorMAC[14]==':'))
|
(detectorMAC[11]==':')&&(detectorMAC[14]==':'))
|
||||||
strcpy(thisDetector->detectorMAC,detectorMAC.c_str());
|
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");
|
return("server MAC Address should be in xx:xx:xx:xx:xx:xx format");
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
else{
|
||||||
|
setErrorMask((getErrorMask())|(COULDNOT_SET_NETWORK_PARAMETER));
|
||||||
return("server MAC Address should be in xx:xx:xx:xx:xx:xx format");
|
return("server MAC Address should be in xx:xx:xx:xx:xx:xx format");
|
||||||
|
}
|
||||||
|
|
||||||
return thisDetector->detectorMAC;
|
return thisDetector->detectorMAC;
|
||||||
};
|
};
|
||||||
@ -4579,10 +4585,12 @@ char* slsDetector::setDetectorIP(string detectorIP){
|
|||||||
int result = inet_pton(AF_INET, detectorIP.c_str(), &(sa.sin_addr));
|
int result = inet_pton(AF_INET, detectorIP.c_str(), &(sa.sin_addr));
|
||||||
if(result!=0)
|
if(result!=0)
|
||||||
strcpy(thisDetector->detectorIP,detectorIP.c_str());
|
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 ("Detector IP Address should be VALID and in xxx.xxx.xxx.xxx format");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return thisDetector->detectorIP;
|
return thisDetector->detectorIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4621,10 +4629,12 @@ char* slsDetector::setReceiverUDPIP(string udpip){
|
|||||||
int result = inet_pton(AF_INET, udpip.c_str(), &(sa.sin_addr));
|
int result = inet_pton(AF_INET, udpip.c_str(), &(sa.sin_addr));
|
||||||
if(result!=0)
|
if(result!=0)
|
||||||
strcpy(thisDetector->receiverUDPIP,udpip.c_str());
|
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 ("Receiver UDP IP Address should be VALID and in xxx.xxx.xxx.xxx format");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return thisDetector->receiverUDPIP;
|
return thisDetector->receiverUDPIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4636,11 +4646,15 @@ char* slsDetector::setReceiverUDPMAC(string udpmac){
|
|||||||
if((udpmac[2]==':')&&(udpmac[5]==':')&&(udpmac[8]==':')&&
|
if((udpmac[2]==':')&&(udpmac[5]==':')&&(udpmac[8]==':')&&
|
||||||
(udpmac[11]==':')&&(udpmac[14]==':'))
|
(udpmac[11]==':')&&(udpmac[14]==':'))
|
||||||
strcpy(thisDetector->receiverUDPMAC,udpmac.c_str());
|
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");
|
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("receiver udp mac address should be in xx:xx:xx:xx:xx:xx format");
|
||||||
|
}
|
||||||
|
|
||||||
return thisDetector->receiverUDPMAC;
|
return thisDetector->receiverUDPMAC;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user