Serveur OPCUA générique
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Définitions de type Macros
cta_ua_nodemanager.h
Aller à la documentation de ce fichier.
1 /******************************************************************************
2  ** nodemanagercta.h
3  **
4  ** Copyright (C) 2008-2011 Unified Automation GmbH. All Rights Reserved.
5  ** Web: http://www.unified-automation.com
6  ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
7  ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
8  **
9  ** Project: C++ OPC Server SDK information model for namespace http://yourorganisation.org/testXML/
10  **
11  ** Description: File generated by UaModeler
12  ** Template C++ OPC UA SDK 1.3.1
13  **
14  ******************************************************************************/
15 
16 #ifndef __NODEMANAGERCTA_H__
17 #define __NODEMANAGERCTA_H__
18 
19 #include "uamutex.h"
20 #include "uabasenodes.h"
21 #include "nodemanagerbase.h"
22 #include "uaobjecttypes.h"
23 #include <string>
25 #include "udp/hardware_udp.h"
26 #include "tcp/hardware_tcp.h"
27 #include "usb/hardware_usb.h"
28 #include "serial/hardware_serial.h"
29 #include "datacollector.h"
30 #include "pci/hardware_pci.h"
31 #include "opcua_statetype.h"
32 #include "opcua_dataitemtype.h"
33 #include "opcua_analogitemtype.h"
34 #include "methodmanager.h"
35 #include "nodemanagerbase.h"
36 
37 #include "cta_ua_historymanager.h"
38 #include "cta_ua_alarmmanager.h"
39 #include "opcua_historicaldataconfigurationtype.h"
40 
41 class UaMethodGeneric;
42 
43 namespace CTA_Slc_Dict {
44 struct AlarmStruct;
45 }
46 
47 namespace CTA_Slc {
48 class NodeManagerSlc;
49 }
50 
51 namespace CTA_UA {
52 class HistoryManager;
53 class AlarmManager;
54 class TrameManager;
55 class PushManager;
56 class ClientManager;
57 class ControllerObject;
58 }
59 
60 namespace CTA_UA {
61 
62 class NodeManagerCTA: public NodeManagerBase {
63  UA_DISABLE_COPY(NodeManagerCTA);
64 
65  static NodeManagerCTA *singleton;
66  /* construction / destruction */
67  NodeManagerCTA(OpcUa_Boolean firesEvents, std::string,
68  CTA_Slc::NodeManagerSlc *nodeManagerSlc);
69  virtual ~NodeManagerCTA();
70 
71 public:
72  struct Tab {
73  int taille;
74  std::string* element;
75  };
76 
77  //- Interface NodeManagerUaNode -------------------------------------------------------
78  UaStatus afterStartUp();
79  UaStatus beforeShutDown();
80  static NodeManagerCTA *getInstance(OpcUa_Boolean firesEvents, std::string,
81  CTA_Slc::NodeManagerSlc *nodeManagerSlc);
82  static NodeManagerCTA *getInstance();
83  static void kill();
84  int find(std::string ip, std::string *val_ip, std::string id,
85  std::string *val_id);
86  //- Interface NodeManagerUaNode -------------------------------------------------------
87 
88  static OpcUa_Int16 getTypeNamespace();
89  OpcUa_Int16 getTypeNamespace2();
90 
91  UaVariable* getInstanceDeclarationVariable(UaNodeId numericIdentifier);
92  UaObject* getInstanceDeclarationObject(UaNodeId numericIdentifier);
93  void lanceClient();
94  void lanceTrameAnalyse(std::string url);
95 
96  UaStatus addHistory(ControllerObject *pControler, std::string var);
97  UaStatus addAlarm(ControllerObject *pControler,
98  CTA_Slc_Dict::AlarmStruct *alarmStruct);
99  UaStatus addTrame(ControllerObject *pControler, std::string var,
100  std::string id, std::string dataIdDescriptorRef);
101  UaStatus addSubTrame(ControllerObject *pControler, std::string var,
102  std::string id);
103  UaStatus addPush(std::string name, ControllerObject *pControler);
104  int addClient(std::string name);
105  void addEvent(ControllerObject *pControler);
106  void lanceHistory();
107 
108  std::map<std::string, Tab> mymap;
109  std::map<std::string, std::string> elementmap;
110 private:
111  OpcUa::GenericObjectType* pObjectType;
112  static OpcUa::StateType* s_pState;
113  OpcUa::StateType* m_pState;
114  std::list<OpcUa::StateType*> l_pState;
115  static OpcUa::DataItemType* s_pBaseDataVariable;
116  OpcUa::DataItemType* m_pBaseDataVariable;
117  std::list<OpcUa::DataItemType*> l_pBaseDataVariable;
118  UaMutex m_mutex;
119  static OpcUa_Int16 s_namespaceIndex;
120  UaString m_fichierMain;
121  ControllerObject *pControler;
122  UaMethodGeneric* m_pMethodStart;
123  HistoryManager* m_pHistoryManager;
124  AlarmManager* m_pAlarmManager;
125  TrameManager* m_pTrameManager;
126  PushManager* m_pPushManager;
127  ClientManager* m_pClientManager;
128  UaAreaFolder *pAreaAirConditionerJL;
129  CTA_Slc::NodeManagerSlc *m_nodeManagerSlc;
130 };
131 
132 } // end namespace
133 #endif
134