25 #include <open62541/config.h>
26 #include <open62541/plugin/accesscontrol.h>
27 #include <open62541/plugin/accesscontrol_default.h>
28 #include <open62541/plugin/historydata/history_data_gathering.h>
29 #include <open62541/server_config_default.h>
39 UA_Boolean UsernamePasswordLogin = UA_FALSE;
42 string applicationName =
"OPCUA-Adapter";
43 uint16_t opcuaPort = 16664;
44 bool enableSecurity =
false;
45 bool unsecure =
false;
46 UA_LogLevel logLevel = UA_LOGLEVEL_INFO;
52 vector<AdapterHistorySetup> history{};
53 vector<AdapterFolderHistorySetup> historyfolders{};
54 vector<AdapterPVHistorySetup> historyvariables{};
71 UA_NodeId folderNodeId = UA_NODEID_NULL;
73 UA_NodeId nextFolderNodeId = UA_NODEID_NULL;
75 UA_NodeId prevFolderNodeId = UA_NODEID_NULL;
102 UA_ServerConfig* server_config{
nullptr};
104 UA_NodeId variablesListId;
105 UA_NodeId constantsListId;
106 std::shared_ptr<UA_DataTypeArray> customDataTypes;
108 vector<FolderInfo> folderVector;
110 UA_NodeId configNodeId;
112 UA_Boolean mappingExceptions;
117 vector<ua_processvariable*> variables;
118 vector<ua_additionalvariable*> additionalVariables;
119 vector<ua_processvariable*> mappedVariables;
121 std::shared_ptr<xml_file_handler> fileHandler;
125 void constructServer();
131 UA_StatusCode mapSelfToNamespace();
141 UA_NodeId createUAFolder(UA_NodeId basenodeId,
const string& folderName,
const string& description =
"");
155 void raiseError(std::string errorMesssage, std::string consequenceMessage,
const int&
line = -1);
158 bool running =
false;
184 UA_DateTime getSourceTimeStamp();
190 UA_Server* getMappedServer();
197 UA_NodeId createFolderPath(UA_NodeId basenodeid, vector<string> folderPathVector);
205 UA_NodeId createFolder(UA_NodeId basenodeid,
const string& folderName,
const string& description =
"");
212 UA_NodeId existFolderPath(UA_NodeId basenodeid,
const vector<string>& folderPath);
219 UA_NodeId existFolder(UA_NodeId basenodeid,
const string& folderName);
228 UA_NodeId enrollFolderPathFromString(
const string& path,
const string& seperator);
235 void implicitVarMapping(
const std::string& varName,
const boost::shared_ptr<ControlSystemPVManager>&
csManager);
243 void applyMapping(
const boost::shared_ptr<ControlSystemPVManager>&
csManager);
250 void explicitVarMapping(
const boost::shared_ptr<ControlSystemPVManager>&
csManager);
255 void addAdditionalVariables();
262 void buildFolderStructure(
const boost::shared_ptr<ControlSystemPVManager>&
csManager);
271 void deepCopyHierarchicalLayer(
272 const boost::shared_ptr<ControlSystemPVManager>&
csManager, UA_NodeId layer, UA_NodeId target);
278 UA_NodeId getOwnNodeId();
284 vector<ua_processvariable*> getVariables();
302 vector<string> getAllNotMappableVariablesNames();
305 vector<string> getAllMappedPvSourceNames();
311 void fillBuildInfo(UA_ServerConfig* config)
const;
324 static UA_StatusCode readLogLevel(UA_Server* server,
const UA_NodeId* sessionId,
void* sessionContext,
325 const UA_NodeId* nodeId,
void* nodeContext, UA_Boolean sourceTimeStamp,
const UA_NumericRange* range,
326 UA_DataValue* dataValue);
333 static UA_StatusCode writeLogLevel(UA_Server* server,
const UA_NodeId* sessionId,
void* sessionContext,
334 const UA_NodeId* nodeId,
void* nodeContext,
const UA_NumericRange* range,
const UA_DataValue* data);