![]() |
ChimeraTK-ControlSystemAdapter-OPCUAAdapter 04.00.05
|
This class provide the opcua server and manage the variable mapping. More...
#include <ua_adapter.h>
Inheritance diagram for ChimeraTK::ua_uaadapter:
Collaboration diagram for ChimeraTK::ua_uaadapter:Public Member Functions | |
| ua_uaadapter (const string &configPath) | |
| Constructor of the class. | |
| virtual | ~ua_uaadapter () |
| Destrructor of the class. | |
| UA_DateTime | getSourceTimeStamp () |
| Return the timestamp of the node. | |
| UA_Server * | getMappedServer () |
| Return the OPC UA Server instance. | |
| UA_NodeId | createFolderPath (UA_NodeId basenodeid, vector< string > folderPathVector) |
| Create a path of folders in the given parent node. | |
| UA_NodeId | createFolder (UA_NodeId basenodeid, const string &folderName, const string &description="") |
| Creates a folder in the given parent node. | |
| UA_NodeId | existFolderPath (UA_NodeId basenodeid, const vector< string > &folderPath) |
| Check if a folder path exist in opcua server. | |
| UA_NodeId | existFolder (UA_NodeId basenodeid, const string &folderName) |
| Check if a folder exist in opcua server. | |
| UA_NodeId | enrollFolderPathFromString (const string &path, const string &seperator) |
| Create folder structure based on the given path. | |
| void | implicitVarMapping (const std::string &varName, const boost::shared_ptr< ControlSystemPVManager > &csManager) |
| Start implicit mapping process. | |
| void | applyMapping (const boost::shared_ptr< ControlSystemPVManager > &csManager) |
| Read mapping file and apply the contained folders, additional variables and pv mappings. | |
| void | explicitVarMapping (const boost::shared_ptr< ControlSystemPVManager > &csManager) |
| Read mapping file and apply contained PV mappings. | |
| void | addAdditionalVariables () |
| Read mapping file and add contained additional variables to the server. | |
| void | buildFolderStructure (const boost::shared_ptr< ControlSystemPVManager > &csManager) |
| Read mapping file and and add contained folders to the server. | |
| 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_NodeId | getOwnNodeId () |
| Methode that returns the node id of the instanced class. | |
| vector< ua_processvariable * > | getVariables () |
| Methode that returns all <ua_processvariable> of the class. | |
| void | workerThread () |
| Create and start a thread for the opcua server instance. | |
| void | readConfig () |
| This Methode reads the config-tag form the given <variableMap.xml>. | |
| vector< string > | getAllNotMappableVariablesNames () |
| Methode to get all names from all potential VarableNodes from XML-Mappingfile which could not allocated. | |
| vector< string > | getAllMappedPvSourceNames () |
| void | fillBuildInfo (UA_ServerConfig *config) const |
| Fill server build information. | |
| ServerConfig | get_server_config () |
| get ServerConfig. | |
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. | |
| 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. | |
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 101 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 58 of file ua_adapter.cpp.
|
virtual |
Destrructor of the class.
It stop the server and delete the managed object.
Definition at line 66 of file ua_adapter.cpp.
| void ChimeraTK::ua_uaadapter::addAdditionalVariables | ( | ) |
Read mapping file and add contained additional variables to the server.
Definition at line 1328 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 660 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 798 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 1627 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 1583 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 731 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 697 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 1573 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 1562 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 1049 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 116 of file ua_adapter.cpp.
| ServerConfig ChimeraTK::ua_uaadapter::get_server_config | ( | ) |
| vector< string > ChimeraTK::ua_uaadapter::getAllMappedPvSourceNames | ( | ) |
Definition at line 1643 of file ua_adapter.cpp.
| 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 1657 of file ua_adapter.cpp.
| UA_Server * ChimeraTK::ua_uaadapter::getMappedServer | ( | ) |
Return the OPC UA Server instance.
Definition at line 1699 of file ua_adapter.cpp.
| UA_NodeId ChimeraTK::ua_uaadapter::getOwnNodeId | ( | ) |
Methode that returns the node id of the instanced class.
Definition at line 1558 of file ua_adapter.cpp.
|
virtual |
Return the timestamp of the node.
Implements ChimeraTK::ua_mapped_class.
Definition at line 1695 of file ua_adapter.cpp.
| vector< ua_processvariable * > ChimeraTK::ua_uaadapter::getVariables | ( | ) |
Methode that returns all <ua_processvariable> of the class.
Definition at line 1423 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 710 of file ua_adapter.cpp.
| void ChimeraTK::ua_uaadapter::readConfig | ( | ) |
This Methode reads the config-tag form the given <variableMap.xml>.
Definition at line 289 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 1703 of file ua_adapter.cpp.
| void ChimeraTK::ua_uaadapter::workerThread | ( | ) |
Create and start a thread for the opcua server instance.
Definition at line 669 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 1713 of file ua_adapter.cpp.
|
friend |
Definition at line 338 of file ua_adapter.h.
| vector<string> ChimeraTK::ua_uaadapter::exclude |
Definition at line 162 of file ua_adapter.h.
| vector<string> ChimeraTK::ua_uaadapter::folder_with_history |
Definition at line 163 of file ua_adapter.h.
| bool ChimeraTK::ua_uaadapter::running = false |
Definition at line 160 of file ua_adapter.h.