Serveur OPCUA générique
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Définitions de type Macros
cta_ua_tramemanager.h
Aller à la documentation de ce fichier.
1 #ifndef __CTAUATRAMENANAGER_H__
2 #define __CTAUATRAMEMANAGER_H__
3 
4 #include "uabasenodes.h"
5 #include "servermanager.h"
6 #include "string"
7 #include <vector>
8 
9 namespace CTA_UA {
10 class NodeManagerCTA;
11 struct myStruct;
12 }
13 namespace CTA_Slc {
14 class XmlManager;
15 }
16 
17 namespace CTA_UA {
18 
19 class TrameVariable2: public IOVariableCallback {
20 
21  UA_DISABLE_COPY(TrameVariable2);
22 
23 public:
24  TrameVariable2(std::string name, std::string full, std::string id);
25  virtual ~TrameVariable2();
26 
27  void dataChange(const UaDataValue& dataValue);
28  UaDataValue getLastValue();
29 
30  // Mutex for the data and settings
31  UaMutex m_mutex;
32 
33  // Variable to trame analyser
34  UaVariable* m_pVariable;
35  // MonitoredItemId for internal monitoring
36  OpcUa_UInt32 m_monitoredItemId;
37 
38  // Flag indicating if the variable is valid
39  OpcUa_Boolean m_isValid;
40 
41  // Memory buffer for the changed values
42  std::list<UaDataValue> m_values;
43  std::string m_pname;
44  std::string m_full;
47  std::string m_id;
48  std::vector<std::string> tabName;
49  std::vector<int> tabNb;
50  std::vector<int> tabIndex;
51  std::vector<int> tabPos;
52 
53  int m_flag;
54  int m_header;
55  std::string m_headerId;
56  std::string m_data_Type;
57  int m_footer;
59  int m_idNum;
61 };
62 
63 class TrameVariable: public IOVariableCallback {
64 
65  UA_DISABLE_COPY(TrameVariable);
66 
67 public:
68  TrameVariable(std::string name, std::string full, std::string id,
69  std::string dataIdDescriptorRef);
70  virtual ~TrameVariable();
71 
72  void dataChange(const UaDataValue& dataValue);
73  UaDataValue getLastValue();
74 
75  // Mutex for the data and settings
76  UaMutex m_mutex;
77 
78  // Variable to trame analyser
79  UaVariable* m_pVariable;
80  // MonitoredItemId for internal monitoring
81  OpcUa_UInt32 m_monitoredItemId;
82 
83  // Flag indicating if the variable is valid
84  OpcUa_Boolean m_isValid;
85 
86  // Memory buffer for the changed values
87  std::list<UaDataValue> m_values;
88  std::string m_pname;
89  std::string m_full;
92  std::string m_id;
93  std::vector<std::string> tabName;
94  std::vector<int> tabNb;
95  std::vector<int> tabIndex;
96  std::vector<int> tabPos;
97 };
98 
100 // : public TrameManagerBase
101 {
102  UA_DISABLE_COPY(TrameManager);
103 
104 public:
105  TrameManager();
106  virtual ~TrameManager();
107  // Start up trame manager for internal monitoring
108  void startUp(ServerManager* pServerManager);
109  // Shut down trame manager to stop internal monitoring
110  void shutDown();
111  // Add a variable for traming- must be called before startUp
112  void addVariableToTrame(UaNode* pNode, std::string name, std::string full,
113  std::string id, std::string dataIdDescriptorRef);
114  void addVariableToSubTrame(UaNode* pNode, std::string name,
115  std::string full, std::string id);
116 private:
117  // List of variable of trame
118  std::map<UaNodeId, TrameVariable*> m_mapVariables;
119 
120  // Internal session used for monitoring
121  Session* m_pSession;
122  std::string m_dataIdDescriptorRef;
123 
124  CTA_Slc::XmlManager *m_pAnalyserManager;
125 
126  // Server manager used for internal monitoring
127  ServerManager* m_pServerManager;
128 };
129 
130 } // end namespace
131 #endif // __CTAUATRAMEMANAGER_H__