diff --git a/mission/utility/GlobalConfigHandler.cpp b/mission/utility/GlobalConfigHandler.cpp index 36d1bafa..fc92714e 100644 --- a/mission/utility/GlobalConfigHandler.cpp +++ b/mission/utility/GlobalConfigHandler.cpp @@ -24,7 +24,7 @@ GlobalConfigHandler::GlobalConfigHandler(object_id_t objectId, std::string confi } ReturnValue_t GlobalConfigHandler::initialize() { ReturnValue_t result = SystemObject::initialize(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::initialize: SystemObject::initialize() failed with " << result << std::endl; @@ -33,13 +33,13 @@ ReturnValue_t GlobalConfigHandler::initialize() { } result = ReadConfigFile(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::initialize: Creating JSON file at " << getFullName() << std::endl; #endif result = ResetConfigFile(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { return result; } } @@ -52,29 +52,29 @@ ReturnValue_t GlobalConfigHandler::initialize() { GlobalConfigHandler::~GlobalConfigHandler() {} ReturnValue_t GlobalConfigHandler::performOperation(uint8_t operationCode) { - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; sif::debug << "GlobalConfigHandler::performOperation" << std::endl; return result; } ReturnValue_t GlobalConfigHandler::lockConfigFile() { - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; result = configLock->lockMutex(MutexIF::TimeoutType::WAITING, 10); return result; } ReturnValue_t GlobalConfigHandler::unlockConfigFile() { - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; result = configLock->unlockMutex(); return result; } template ReturnValue_t GlobalConfigHandler::setConfigFileValue(ParamIds paramID, T data) { - ReturnValue_t result = RETURN_OK; - ReturnValue_t resultSet = RETURN_OK; + ReturnValue_t result = returnvalue::OK; + ReturnValue_t resultSet = returnvalue::OK; result = lockConfigFile(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::setConfigFileValue lock mutex failed with " << result << std::endl; @@ -93,11 +93,11 @@ ReturnValue_t GlobalConfigHandler::setConfigFileValue(ParamIds paramID, T data) << " not found!" << std::endl; #endif triggerEvent(SET_CONFIGFILEVALUE_FAILED, 1, 0); - return RETURN_FAILED; + return returnvalue::FAILED; } resultSet = setValue(PARAM_KEY_MAP[paramID], data); - if (resultSet != RETURN_OK) { + if (resultSet != returnvalue::OK) { triggerEvent(SET_CONFIGFILEVALUE_FAILED, 0, 0); #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::setConfigFileValue set json failed with " << resultSet @@ -106,7 +106,7 @@ ReturnValue_t GlobalConfigHandler::setConfigFileValue(ParamIds paramID, T data) } result = unlockConfigFile(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::setConfigFileValue unlock mutex failed with " << result << std::endl; @@ -118,11 +118,11 @@ ReturnValue_t GlobalConfigHandler::setConfigFileValue(ParamIds paramID, T data) } template ReturnValue_t GlobalConfigHandler::getConfigFileValue(ParamIds paramID, T& data) { - ReturnValue_t result = RETURN_OK; - ReturnValue_t resultGet = RETURN_OK; + ReturnValue_t result = returnvalue::OK; + ReturnValue_t resultGet = returnvalue::OK; result = lockConfigFile(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::getConfigFileValue lock mutex failed with " << result << std::endl; @@ -131,7 +131,7 @@ ReturnValue_t GlobalConfigHandler::getConfigFileValue(ParamIds paramID, T& data) } resultGet = getValue(PARAM_KEY_MAP[paramID], data); - if (resultGet != RETURN_OK) { + if (resultGet != returnvalue::OK) { triggerEvent(GET_CONFIGFILEVALUE_FAILED, 0, 0); #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::getConfigFileValue getValue failed with " << resultGet @@ -139,7 +139,7 @@ ReturnValue_t GlobalConfigHandler::getConfigFileValue(ParamIds paramID, T& data) #endif } result = unlockConfigFile(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::getConfigFileValue unlock mutex failed with " << result << std::endl; @@ -151,9 +151,9 @@ ReturnValue_t GlobalConfigHandler::getConfigFileValue(ParamIds paramID, T& data) } ReturnValue_t GlobalConfigHandler::resetConfigFileValues() { - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; result = lockConfigFile(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::resetConfigFileValues lock mutex failed with " << result << std::endl; @@ -164,7 +164,7 @@ ReturnValue_t GlobalConfigHandler::resetConfigFileValues() { insertValue(PARAM_KEY_MAP[PARAM1], PARAM1_DEFAULT); result = unlockConfigFile(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::resetConfigFileValues unlock mutex failed with " << result << std::endl; @@ -174,10 +174,10 @@ ReturnValue_t GlobalConfigHandler::resetConfigFileValues() { return result; } ReturnValue_t GlobalConfigHandler::WriteConfigFile() { - ReturnValue_t result = RETURN_OK; - ReturnValue_t resultWrite = RETURN_OK; + ReturnValue_t result = returnvalue::OK; + ReturnValue_t resultWrite = returnvalue::OK; result = lockConfigFile(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::WriteConfigFile lock mutex failed with " << result << std::endl; @@ -186,7 +186,7 @@ ReturnValue_t GlobalConfigHandler::WriteConfigFile() { } resultWrite = writeJsonFile(); - if (resultWrite != RETURN_OK) { + if (resultWrite != returnvalue::OK) { triggerEvent(WRITE_CONFIGFILE_FAILED, 0, 0); #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::WriteConfigFile write json failed with " << resultWrite @@ -195,7 +195,7 @@ ReturnValue_t GlobalConfigHandler::WriteConfigFile() { } result = unlockConfigFile(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::WriteConfigFile unlock mutex failed with " << result << std::endl; @@ -205,10 +205,10 @@ ReturnValue_t GlobalConfigHandler::WriteConfigFile() { return resultWrite; } ReturnValue_t GlobalConfigHandler::ReadConfigFile() { - ReturnValue_t result = RETURN_OK; - ReturnValue_t resultRead = RETURN_OK; + ReturnValue_t result = returnvalue::OK; + ReturnValue_t resultRead = returnvalue::OK; result = lockConfigFile(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::ReadConfigFile lock mutex failed with " << result << std::endl; @@ -217,7 +217,7 @@ ReturnValue_t GlobalConfigHandler::ReadConfigFile() { } resultRead = readJsonFile(); - if (resultRead != RETURN_OK) { + if (resultRead != returnvalue::OK) { triggerEvent(READ_CONFIGFILE_FAILED, 0, 0); #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::ReadConfigFile read json failed with " << resultRead @@ -226,7 +226,7 @@ ReturnValue_t GlobalConfigHandler::ReadConfigFile() { } result = unlockConfigFile(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::ReadConfigFile unlock mutex failed with " << result << std::endl; @@ -237,9 +237,9 @@ ReturnValue_t GlobalConfigHandler::ReadConfigFile() { return resultRead; } ReturnValue_t GlobalConfigHandler::ResetConfigFile() { - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; result = resetConfigFileValues(); - if (result != RETURN_OK) { + if (result != returnvalue::OK) { #if OBSW_VERBOSE_LEVEL >= 1 sif::info << "GlobalConfigHandler::ResetConfigFile failed with " << result << std::endl; #endif @@ -250,7 +250,7 @@ ReturnValue_t GlobalConfigHandler::ResetConfigFile() { } ReturnValue_t GlobalConfigHandler::setConfigFileName(std::string configFileName) { - ReturnValue_t result = RETURN_OK; + ReturnValue_t result = returnvalue::OK; setFullName(configFileName); result = ResetConfigFile(); return result;