ChimeraTK-ControlSystemAdapter-OPCUAAdapter  04.00.01
csa_opcua_adapter.h
Go to the documentation of this file.
1 /*
2  * This file is part of ChimeraTKs ControlSystem-OPC-UA-Adapter.
3  *
4  * ChimeraTKs ControlSystem-OPC-UA-Adapter is free software: you can
5  * redistribute it and/or modify it under the terms of the Lesser GNU
6  * General Public License as published by the Free Software Foundation,
7  * either version 3 of the License, or (at your option) any later version.
8  *
9  * ChimeraTKs ControlSystem-OPC-UA-Adapter is distributed in the hope
10  * that it will be useful, but WITHOUT ANY WARRANTY; without even the
11  * implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12  * See the Lesser GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Foobar. If not, see https://www.gnu.org/licenses/lgpl.html
16  *
17  * Copyright (c) 2016 Chris Iatrou <Chris_Paul.Iatrou@tu-dresden.de>
18  * Copyright (c) 2016 Julian Rahm <Julian.Rahm@tu-dresden.de>
19  */
20 
21 #pragma once
22 
23 #include "ChimeraTK/ControlSystemAdapter/ApplicationBase.h"
24 #include "ChimeraTK/ControlSystemAdapter/ControlSystemPVManager.h"
25 #include "csa_processvariable.h"
26 #include "ua_adapter.h"
27 
28 #include <thread>
29 #include <vector>
30 
31 namespace ChimeraTK {
45  private:
46  std::thread adapter_thread;
47  std::thread observer_thread;
48  std::shared_ptr<ua_uaadapter> adapter;
49  boost::shared_ptr<ControlSystemPVManager> csManager;
50  set<string> unusedVariables;
51 
52  public:
59  csa_opcua_adapter(boost::shared_ptr<ControlSystemPVManager> csManager, string configFile);
60 
65 
71  boost::shared_ptr<ControlSystemPVManager> const& getControlSystemManager() const;
72 
78  std::shared_ptr<ua_uaadapter> getUAAdapter();
79 
80  const set<string>& getUnusedVariables() const;
81 
85  void start();
86 
90  void stop();
91 
97  bool isRunning();
98 
104  const UA_Logger* getLogger();
105  };
106 } // namespace ChimeraTK
ChimeraTK::csa_opcua_adapter
This class provide the two parts of the OPCUA Adapter. First of all the OPCUA server starts with a po...
Definition: csa_opcua_adapter.h:44
ChimeraTK::csa_opcua_adapter::stop
void stop()
Stop all objects in single threads for this case only the opc ua server.
Definition: csa_opcua_adapter.cpp:216
ChimeraTK::csa_opcua_adapter::getUnusedVariables
const set< string > & getUnusedVariables() const
Definition: csa_opcua_adapter.cpp:229
ChimeraTK::csa_opcua_adapter::getLogger
const UA_Logger * getLogger()
Get the adapter logger.
Definition: csa_opcua_adapter.cpp:233
ChimeraTK::csa_opcua_adapter::isRunning
bool isRunning()
Checks if the opcua server is still running and return the suitable bool value.
Definition: csa_opcua_adapter.cpp:226
ua_adapter.h
csa_processvariable.h
ChimeraTK::csa_opcua_adapter::csa_opcua_adapter
csa_opcua_adapter(boost::shared_ptr< ControlSystemPVManager > csManager, string configFile)
Constructor for ControlSystemAdapter-OPC-UA-Adapter.
Definition: csa_opcua_adapter.cpp:35
ChimeraTK::csa_opcua_adapter::~csa_opcua_adapter
~csa_opcua_adapter()
Destructor to stop the running thread, hence it stops the OPC UA server.
Definition: csa_opcua_adapter.cpp:168
csManager
boost::shared_ptr< ChimeraTK::ControlSystemPVManager > csManager
Definition: csa_opcua_application.cpp:59
ChimeraTK::csa_opcua_adapter::getUAAdapter
std::shared_ptr< ua_uaadapter > getUAAdapter()
Return the uaadapter, hence the OPC UA server.
Definition: csa_opcua_adapter.cpp:176
ChimeraTK::csa_opcua_adapter::start
void start()
Start all objects in single threads for this case only the opc ua server.
Definition: csa_opcua_adapter.cpp:180
ChimeraTK
Definition: csa_additionalvariable.h:28
ChimeraTK::csa_opcua_adapter::getControlSystemManager
boost::shared_ptr< ControlSystemPVManager > const & getControlSystemManager() const
Return the ControlsystemPVManager of the class.
Definition: csa_opcua_adapter.cpp:172