mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 13:27:14 +02:00
added error mask for loading/writing config file to be caught by python
This commit is contained in:
@ -24,6 +24,7 @@ using namespace std;
|
||||
// 0xFFF0000000000000ULL
|
||||
#define MULTI_DETECTORS_NOT_ADDED 0x8000000000000000ULL
|
||||
#define MULTI_HAVE_DIFFERENT_VALUES 0x4000000000000000ULL
|
||||
#define MULTI_CONFIG_FILE_ERROR 0x2000000000000000ULL
|
||||
|
||||
// sls errors
|
||||
#define CRITICAL_ERROR_MASK 0xFFFFFFF
|
||||
@ -91,6 +92,7 @@ using namespace std;
|
||||
#define RESTREAM_STOP_FROM_RECEIVER 0x0000000800000000ULL
|
||||
#define TEMPERATURE_CONTROL 0x0000001000000000ULL
|
||||
#define AUTO_COMP_DISABLE 0x0000002000000000ULL
|
||||
#define CONFIG_FILE 0x0000004000000000ULL
|
||||
// 0x000000FFFFFFFFFFULL
|
||||
|
||||
|
||||
@ -289,6 +291,8 @@ public:
|
||||
if(slsErrorMask&AUTO_COMP_DISABLE)
|
||||
retval.append("Could not set/get auto comparator disable\n");
|
||||
|
||||
if(slsErrorMask&CONFIG_FILE)
|
||||
retval.append("Could not load/write config file\n");
|
||||
|
||||
//------------------------------------------------------ length of message
|
||||
|
||||
|
@ -5149,6 +5149,7 @@ int multiSlsDetector::readConfigurationFile(string const fname){
|
||||
|
||||
} else {
|
||||
std::cout<< "Error opening configuration file " << fname << " for reading" << std::endl;
|
||||
setErrorMask(getErrorMask()|MULTI_CONFIG_FILE_ERROR);
|
||||
return FAIL;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
@ -5255,6 +5256,7 @@ int multiSlsDetector::writeConfigurationFile(string const fname){
|
||||
#endif
|
||||
} else {
|
||||
std::cout<< "Error opening configuration file " << fname << " for writing" << std::endl;
|
||||
setErrorMask(getErrorMask()|MULTI_CONFIG_FILE_ERROR);
|
||||
ret = FAIL;
|
||||
}
|
||||
|
||||
@ -6510,6 +6512,10 @@ string multiSlsDetector::getErrorMessage(int &critical){
|
||||
"Please check the console\n");
|
||||
critical = 0;
|
||||
}
|
||||
if(multiMask & MULTI_CONFIG_FILE_ERROR) {
|
||||
retval.append("Could not load Config File\n");
|
||||
critical = 0;
|
||||
}
|
||||
|
||||
for (int idet=0; idet<thisMultiDetector->numberOfDetectors; ++idet) {
|
||||
if (detectors[idet]) {
|
||||
|
@ -7265,6 +7265,7 @@ int slsDetector::readConfigurationFile(string const fname){
|
||||
infile.close();
|
||||
} else {
|
||||
std::cout<< "Error opening configuration file " << fname << " for reading" << std::endl;
|
||||
setErrorMask((getErrorMask())|(CONFIG_FILE));
|
||||
return FAIL;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
@ -7362,6 +7363,7 @@ int slsDetector::writeConfigurationFile(string const fname){
|
||||
}
|
||||
else {
|
||||
std::cout<< "Error opening configuration file " << fname << " for writing" << std::endl;
|
||||
setErrorMask((getErrorMask())|(CONFIG_FILE));
|
||||
return FAIL;
|
||||
}
|
||||
#ifdef VERBOSE
|
||||
|
Reference in New Issue
Block a user