ChimeraTK-ControlSystemAdapter-OPCUAAdapter
04.00.01
|
This class provide the opcua server and manage the variable mapping. More...
#include <ua_adapter.h>
Public Member Functions | |
ua_uaadapter (const string &configPath) | |
Constructor of the class. More... | |
virtual | ~ua_uaadapter () |
Destrructor of the class. More... | |
UA_DateTime | getSourceTimeStamp () |
Return the timestamp of the node. More... | |
UA_Server * | getMappedServer () |
Return the OPC UA Server instance. More... | |
UA_NodeId | createFolderPath (UA_NodeId basenodeid, vector< string > folderPathVector) |
Create a path of folders in the given parent node. More... | |
UA_NodeId | createFolder (UA_NodeId basenodeid, const string &folderName, const string &description="") |
Creates a folder in the given parent node. More... | |
UA_NodeId | existFolderPath (UA_NodeId basenodeid, const vector< string > &folderPath) |
Check if a folder path exist in opcua server. More... | |
UA_NodeId | existFolder (UA_NodeId basenodeid, const string &folderName) |
Check if a folder exist in opcua server. More... | |
UA_NodeId | enrollFolderPathFromString (const string &path, const string &seperator) |
Create folder structure based on the given path. More... | |
void | implicitVarMapping (const std::string &varName, const boost::shared_ptr< ControlSystemPVManager > &csManager) |
Start implicit mapping process. More... | |
void | applyMapping (const boost::shared_ptr< ControlSystemPVManager > &csManager) |
Read mapping file and apply the contained folders, additional variables and pv mappings. More... | |
void | explicitVarMapping (const boost::shared_ptr< ControlSystemPVManager > &csManager) |
Read mapping file and apply contained PV mappings. More... | |
void | addAdditionalVariables () |
Read mapping file and add contained additional variables to the server. More... | |
void | buildFolderStructure (const boost::shared_ptr< ControlSystemPVManager > &csManager) |
Read mapping file and and add contained folders to the server. More... | |
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. More... | |
UA_NodeId | getOwnNodeId () |
Methode that returns the node id of the instanced class. More... | |
vector< ua_processvariable * > | getVariables () |
Methode that returns all <ua_processvariable> of the class. More... | |
void | workerThread () |
Create and start a thread for the opcua server instance. More... | |
void | readConfig () |
This Methode reads the config-tag form the given <variableMap.xml>. More... | |
vector< string > | getAllNotMappableVariablesNames () |
Methode to get all names from all potential VarableNodes from XML-Mappingfile which could not allocated. More... | |
vector< string > | getAllMappedPvSourceNames () |
void | fillBuildInfo (UA_ServerConfig *config) const |
Fill server build information. More... | |
ServerConfig | get_server_config () |
get ServerConfig. More... | |
Static Public Member Functions | |
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. More... | |
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. More... | |
Public Attributes | |
bool | running = false |
vector< string > | exclude |
vector< string > | folder_with_history |
Friends | |
class | csa_opcua_adapter |
This class provide the opcua server and manage the variable mapping.
This Class create and start the opcua server also it contain all variables of the server. Especially it reads the config-file and add all Variables from a pv-manager and additional variables. For config purpose. The config-file parameter will parsed and set to the right variable.
Definition at line 100 of file ua_adapter.h.
ChimeraTK::ua_uaadapter::ua_uaadapter | ( | const string & | configPath | ) |
Constructor of the class.
During the construction of the class it instanciate a xml_file_handler and read the config, after that the server will be sonstructed and the namespace ist added to them. Concluding all additional nodes which are defined in the configFile are mapped into the server.
configFile | This file provide the configuration and the mapping of the server |
Definition at line 57 of file ua_adapter.cpp.
|
virtual |
Destrructor of the class.
It stop the server and delete the managed object.
Definition at line 65 of file ua_adapter.cpp.
void ChimeraTK::ua_uaadapter::addAdditionalVariables | ( | ) |
Read mapping file and add contained additional variables to the server.
Definition at line 1331 of file ua_adapter.cpp.
void ChimeraTK::ua_uaadapter::applyMapping | ( | const boost::shared_ptr< ControlSystemPVManager > & | csManager | ) |
Read mapping file and apply the contained folders, additional variables and pv mappings.
Order -> Folder (without source) -> Folder (with source) -> additional variables -> PV mappings
csManager | control system manager |
Definition at line 662 of file ua_adapter.cpp.
void ChimeraTK::ua_uaadapter::buildFolderStructure | ( | const boost::shared_ptr< ControlSystemPVManager > & | csManager | ) |
Read mapping file and and add contained folders to the server.
csManager | control system manager |
Definition at line 801 of file ua_adapter.cpp.
UA_NodeId ChimeraTK::ua_uaadapter::createFolder | ( | UA_NodeId | basenodeid, |
const string & | folderName, | ||
const string & | description = "" |
||
) |
Creates a folder in the given parent node.
basenodeId | Node id of the parent node |
folderName | Name of the new folder |
description | A short description of the folder |
Definition at line 1630 of file ua_adapter.cpp.
UA_NodeId ChimeraTK::ua_uaadapter::createFolderPath | ( | UA_NodeId | basenodeid, |
std::vector< string > | folderPath | ||
) |
Create a path of folders in the given parent node.
basenodeid | Node id of the parent node |
folderPathVector | Every single string is a folder name, the path ist createt in the given order |
Definition at line 1586 of file ua_adapter.cpp.
void ChimeraTK::ua_uaadapter::deepCopyHierarchicalLayer | ( | const boost::shared_ptr< ControlSystemPVManager > & | csManager, |
UA_NodeId | layer, | ||
UA_NodeId | target | ||
) |
Copy (recursively) the content of a folder to a new location.
csManager | control system manager |
layer | source folder |
target | destination folder |
Definition at line 734 of file ua_adapter.cpp.
UA_NodeId ChimeraTK::ua_uaadapter::enrollFolderPathFromString | ( | const string & | path, |
const string & | seperator | ||
) |
Create folder structure based on the given path.
path | The complete path |
seperator | Delimiters with are used to split the path |
Definition at line 700 of file ua_adapter.cpp.
UA_NodeId ChimeraTK::ua_uaadapter::existFolder | ( | UA_NodeId | basenodeid, |
const string & | folderName | ||
) |
Check if a folder exist in opcua server.
basenodeId | Node id of the parent node |
folderName | The name of folder, that be checked |
Definition at line 1576 of file ua_adapter.cpp.
UA_NodeId ChimeraTK::ua_uaadapter::existFolderPath | ( | UA_NodeId | basenodeid, |
const vector< string > & | folderPath | ||
) |
Check if a folder path exist in opcua server.
basenodeId | Node id of the parent node |
folderPathVector | Every single string is a folder name, the path ist checked in the given order |
Definition at line 1565 of file ua_adapter.cpp.
void ChimeraTK::ua_uaadapter::explicitVarMapping | ( | const boost::shared_ptr< ControlSystemPVManager > & | csManager | ) |
Read mapping file and apply contained PV mappings.
csManager | control system manager |
Definition at line 1052 of file ua_adapter.cpp.
void ChimeraTK::ua_uaadapter::fillBuildInfo | ( | UA_ServerConfig * | config | ) | const |
Fill server build information.
config | The server configuration to be modified. |
Definition at line 115 of file ua_adapter.cpp.
ServerConfig ChimeraTK::ua_uaadapter::get_server_config | ( | ) |
vector< string > ChimeraTK::ua_uaadapter::getAllMappedPvSourceNames | ( | ) |
vector< string > ChimeraTK::ua_uaadapter::getAllNotMappableVariablesNames | ( | ) |
Methode to get all names from all potential VarableNodes from XML-Mappingfile which could not allocated.
Definition at line 1660 of file ua_adapter.cpp.
UA_Server * ChimeraTK::ua_uaadapter::getMappedServer | ( | ) |
Return the OPC UA Server instance.
Definition at line 1690 of file ua_adapter.cpp.
UA_NodeId ChimeraTK::ua_uaadapter::getOwnNodeId | ( | ) |
Methode that returns the node id of the instanced class.
Definition at line 1561 of file ua_adapter.cpp.
|
virtual |
Return the timestamp of the node.
Implements ChimeraTK::ua_mapped_class.
Definition at line 1686 of file ua_adapter.cpp.
vector< ua_processvariable * > ChimeraTK::ua_uaadapter::getVariables | ( | ) |
Methode that returns all <ua_processvariable> of the class.
Definition at line 1426 of file ua_adapter.cpp.
void ChimeraTK::ua_uaadapter::implicitVarMapping | ( | const std::string & | varName, |
const boost::shared_ptr< ControlSystemPVManager > & | csManager | ||
) |
Start implicit mapping process.
basenodeId | Node id of the parent node |
folderPathVector | Every single string is a folder name, the path ist checked in the given order |
Definition at line 713 of file ua_adapter.cpp.
void ChimeraTK::ua_uaadapter::readConfig | ( | ) |
This Methode reads the config-tag form the given <variableMap.xml>.
Definition at line 291 of file ua_adapter.cpp.
|
static |
callback function used to read the servers logging level.
Read the current logging level stored in adapter->serverConfig.logLevel.
Definition at line 1694 of file ua_adapter.cpp.
void ChimeraTK::ua_uaadapter::workerThread | ( | ) |
Create and start a thread for the opcua server instance.
Definition at line 671 of file ua_adapter.cpp.
|
static |
callback function used to change the servers logging level.
Set the new logging level entered by the user. Replace the servers logger by a new one.
Definition at line 1704 of file ua_adapter.cpp.
|
friend |
Definition at line 336 of file ua_adapter.h.
vector<string> ChimeraTK::ua_uaadapter::exclude |
Definition at line 160 of file ua_adapter.h.
vector<string> ChimeraTK::ua_uaadapter::folder_with_history |
Definition at line 161 of file ua_adapter.h.
bool ChimeraTK::ua_uaadapter::running = false |
Definition at line 158 of file ua_adapter.h.