OpcUaCanOpen
CANopen OPC-UA server
ControlInterface.h
Go to the documentation of this file.
1 #ifndef __CONTROLINTERFACE_H__
2 #define __CONTROLINTERFACE_H__
3 
4 #include "AbstractHardware.h"
5 #include "UserDeviceStruct.h"
6 #include "nodemanagernodesetxml.h"
7 #include <string>
8 
9 using namespace std;
10 
11 namespace AddressSpace
12 {
13  class NmBuildingAutomation;
14 
15 }
16 
17 namespace UserDevice {
31  class AbstractHardware;
32 
39  {
40  public:
41 
44 
46  virtual ~ControlInterface() {};
47 
51  virtual UaStatus CreateXmlParser(UaString &sXmlFileName)=0; // initialize interface and devices
52 
53  virtual bool isTraceVariable(UaNodeId uaTraceId)
54  {
55  OpcUa_ReferenceParameter(uaTraceId);
56  return OpcUa_False;
57  }
58 
59  virtual bool isDeviceVariable(UaNodeId) = 0;
60 
61  virtual void putTraceFunctions(OpcUa_DataValue *) = 0;
62 
63  virtual UaStatus initialize()=0; // initialize interface and devices
64  virtual void closeInterface()=0;
65 
70  virtual UaStatus CreateAddressSpace(AddressSpace::NmBuildingAutomation *nManager, NodeManagerNodeSetXml* pXmlNodeManager, NodeManagerConfig *pDefaultNodeManager)=0;
71 
72  virtual IOManager* getIOManager(UaNode* pUaNode, OpcUa_Int32 attributeId) = 0;
73 
74  virtual VariableHandle* getVariableHandler(Session* session, VariableHandle::ServiceType serviceType, OpcUa_NodeId *nodeid, OpcUa_Int32 attributeId)
75  {
76  OpcUa_ReferenceParameter(session);
77  OpcUa_ReferenceParameter(serviceType);
78  OpcUa_ReferenceParameter(nodeid);
79  OpcUa_ReferenceParameter(attributeId);
80 
81  return NULL;
82  }
83 
84  UaNodeId getTypeNodeId(OpcUa_UInt32 numericIdentifier)
85  {
86  return UaNodeId(numericIdentifier, m_pTypeNodeManager->getNameSpaceIndex());
87  }
88 
89  AddressSpace::NmBuildingAutomation *getNodeManager() const { return m_pNodeManager; }
90  NodeManagerNodeSetXml *getNodeTypeManager() const { return m_pTypeNodeManager; }
99 // virtual UserDataBase_ptr<InterfaceUserDataBase> *createInterfaceEntry(UserDataBase*parent , int code , ::xsd::cxx::tree::type* conf, UaNode* node)=0;
100  virtual pUserDeviceStruct *createInterfaceEntry(pUserDeviceStruct*parent , int code , ::xsd::cxx::tree::type* conf, UaNode* node)=0;
101 
102  protected:
103  UaString m_sXmlFileName;
104 
106  NodeManagerConfig *m_pDefaultNodeManager;
107  NodeManagerNodeSetXml* m_pTypeNodeManager;
108  private:
109 
110 
111  };
112 }
113 
114 #endif