26#include <open62541/config.h>
27#include <open62541/plugin/accesscontrol.h>
28#include <open62541/plugin/accesscontrol_default.h>
29#include <open62541/plugin/historydata/history_data_gathering.h>
30#include <open62541/server_config_default.h>
103 UA_ServerConfig* server_config{
nullptr};
105 UA_NodeId variablesListId;
106 UA_NodeId constantsListId;
107 std::shared_ptr<UA_DataTypeArray> customDataTypes;
108 UA_DataType customType[1];
110 vector<FolderInfo> folderVector;
112 UA_NodeId configNodeId;
114 UA_Boolean mappingExceptions;
119 vector<ua_processvariable*> variables;
120 vector<ua_additionalvariable*> additionalVariables;
121 vector<ua_processvariable*> mappedVariables;
123 std::shared_ptr<xml_file_handler> fileHandler;
127 void constructServer();
133 UA_StatusCode mapSelfToNamespace();
143 UA_NodeId createUAFolder(UA_NodeId basenodeId,
const string& folderName,
const string& description =
"");
157 void raiseError(std::string errorMesssage, std::string consequenceMessage,
const int& line = -1);
199 UA_NodeId
createFolderPath(UA_NodeId basenodeid, vector<string> folderPathVector);
207 UA_NodeId
createFolder(UA_NodeId basenodeid,
const string& folderName,
const string& description =
"");
214 UA_NodeId
existFolderPath(UA_NodeId basenodeid,
const vector<string>& folderPath);
221 UA_NodeId
existFolder(UA_NodeId basenodeid,
const string& folderName);
274 const boost::shared_ptr<ControlSystemPVManager>&
csManager, UA_NodeId layer, UA_NodeId target);
326 static UA_StatusCode
readLogLevel(UA_Server* server,
const UA_NodeId* sessionId,
void* sessionContext,
327 const UA_NodeId* nodeId,
void* nodeContext, UA_Boolean sourceTimeStamp,
const UA_NumericRange* range,
328 UA_DataValue* dataValue);
335 static UA_StatusCode
writeLogLevel(UA_Server* server,
const UA_NodeId* sessionId,
void* sessionContext,
336 const UA_NodeId* nodeId,
void* nodeContext,
const UA_NumericRange* range,
const UA_DataValue* data);
This class provide the two parts of the OPCUA Adapter.
This class mapped all inforamtion into the opca server.
This class provide the opcua server and manage the variable mapping.
void fillBuildInfo(UA_ServerConfig *config) const
Fill server build information.
void workerThread()
Create and start a thread for the opcua server instance.
void implicitVarMapping(const std::string &varName, const boost::shared_ptr< ControlSystemPVManager > &csManager)
Start implicit mapping process.
UA_NodeId createFolder(UA_NodeId basenodeid, const string &folderName, const string &description="")
Creates a folder in the given parent node.
static UA_StatusCode writeLogLevel(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, const UA_NodeId *nodeId, void *nodeContext, const UA_NumericRange *range, const UA_DataValue *data)
callback function used to change the servers logging level.
vector< ua_processvariable * > getVariables()
Methode that returns all <ua_processvariable> of the class.
UA_NodeId existFolder(UA_NodeId basenodeid, const string &folderName)
Check if a folder exist in opcua server.
void buildFolderStructure(const boost::shared_ptr< ControlSystemPVManager > &csManager)
Read mapping file and and add contained folders to the server.
void addAdditionalVariables()
Read mapping file and add contained additional variables to the server.
UA_NodeId getOwnNodeId()
Methode that returns the node id of the instanced class.
UA_DateTime getSourceTimeStamp()
Return the timestamp of the node.
void deepCopyHierarchicalLayer(const boost::shared_ptr< ControlSystemPVManager > &csManager, UA_NodeId layer, UA_NodeId target)
Copy (recursively) the content of a folder to a new location.
UA_Server * getMappedServer()
Return the OPC UA Server instance.
void explicitVarMapping(const boost::shared_ptr< ControlSystemPVManager > &csManager)
Read mapping file and apply contained PV mappings.
UA_NodeId existFolderPath(UA_NodeId basenodeid, const vector< string > &folderPath)
Check if a folder path exist in opcua server.
void readConfig()
This Methode reads the config-tag form the given <variableMap.xml>.
UA_NodeId createFolderPath(UA_NodeId basenodeid, vector< string > folderPathVector)
Create a path of folders in the given parent node.
vector< string > getAllMappedPvSourceNames()
UA_NodeId enrollFolderPathFromString(const string &path, const string &seperator)
Create folder structure based on the given path.
void applyMapping(const boost::shared_ptr< ControlSystemPVManager > &csManager)
Read mapping file and apply the contained folders, additional variables and pv mappings.
vector< string > folder_with_history
virtual ~ua_uaadapter()
Destrructor of the class.
vector< string > getAllNotMappableVariablesNames()
Methode to get all names from all potential VarableNodes from XML-Mappingfile which could not allocat...
static UA_StatusCode readLogLevel(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, const UA_NodeId *nodeId, void *nodeContext, UA_Boolean sourceTimeStamp, const UA_NumericRange *range, UA_DataValue *dataValue)
callback function used to read the servers logging level.
ServerConfig get_server_config()
get ServerConfig.
boost::shared_ptr< ChimeraTK::ControlSystemPVManager > csManager
This struct represents a folder in OPCUA with its own node id and with his parent and child node id.
string folderName
Name of the folder.
UA_NodeId nextFolderNodeId
NodeId from the child folder.
UA_NodeId folderNodeId
NodeId from the folder from opcua server.
UA_NodeId prevFolderNodeId
NodeId from the parent folder.
This struct represents a server config.
UA_Boolean UsernamePasswordLogin
vector< AdapterPVHistorySetup > historyvariables
vector< AdapterHistorySetup > history
vector< AdapterFolderHistorySetup > historyfolders