From d99aaf5b0df2020c2a95eee6c51a001788705252 Mon Sep 17 00:00:00 2001 From: Leon Hiemstra <hiemstra@astron.nl> Date: Wed, 3 Mar 2021 10:12:53 +0100 Subject: [PATCH] fix for tr_reload_W command --- src/opcua/ua_server.cpp | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/opcua/ua_server.cpp b/src/opcua/ua_server.cpp index 99ec9dd3..f473dfec 100644 --- a/src/opcua/ua_server.cpp +++ b/src/opcua/ua_server.cpp @@ -535,32 +535,31 @@ int ua_server_init(bool warm_start) if(!warm_start) { mUaServer = UA_Server_new(); UA_ServerConfig_setDefault(UA_Server_getConfig(mUaServer)); - } - TermOutput termout; - std::vector<int> nodes = SD.unb->get_nodes(); // all nodes + TermOutput termout; + std::vector<int> nodes = SD.unb->get_nodes(); // all nodes - UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "UA Server add nodes"); + UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "UA Server add nodes"); - RegisterMap *pointmap = SD.unb->get_pointMap(); - std::vector<std::string> regnames = pointmap->getRegnames(""); - for(auto m : regnames) { - int format = pointmap->getFormat(m); - unsigned int size = pointmap->getSpan(m); - std::string perm = pointmap->getPerm(m); - ua_add_Variable(mUaServer, m, format, size, perm); - } + RegisterMap *pointmap = SD.unb->get_pointMap(); + std::vector<std::string> regnames = pointmap->getRegnames(""); + for(auto m : regnames) { + int format = pointmap->getFormat(m); + unsigned int size = pointmap->getSpan(m); + std::string perm = pointmap->getPerm(m); + ua_add_Variable(mUaServer, m, format, size, perm); + } - RegisterMap *trmap = SD.tr->getTranslatorMap(); - std::vector<std::string> trregnames = trmap->getRegnames(""); - for(auto m : trregnames) { - int format = trmap->getFormat(m); - unsigned int size = trmap->getSpan(m); - std::string perm = trmap->getPerm(m); - ua_add_Variable(mUaServer, m, format, size, perm); + RegisterMap *trmap = SD.tr->getTranslatorMap(); + std::vector<std::string> trregnames = trmap->getRegnames(""); + for(auto m : trregnames) { + int format = trmap->getFormat(m); + unsigned int size = trmap->getSpan(m); + std::string perm = trmap->getPerm(m); + ua_add_Variable(mUaServer, m, format, size, perm); + } } - return 0; } -- GitLab