opc_ua/client.py
branchpython3
changeset 3750 f62625418bff
parent 3718 7841b651d601
child 3820 46f3ca3f0157
equal deleted inserted replaced
3749:fda6c1a37662 3750:f62625418bff
     1 # opcua/client.py
     1 # opcua/client.py
     2 
     2 
     3 from __future__ import absolute_import
     3 
     4 
     4 
     5 import os
     5 import os
     6 
     6 
     7 from editors.ConfTreeNodeEditor import ConfTreeNodeEditor
     7 from editors.ConfTreeNodeEditor import ConfTreeNodeEditor
     8 from PLCControler import LOCATION_CONFNODE, LOCATION_VAR_INPUT, LOCATION_VAR_OUTPUT
     8 from PLCControler import LOCATION_CONFNODE, LOCATION_VAR_INPUT, LOCATION_VAR_OUTPUT
   156     def GetVariableLocationTree(self):
   156     def GetVariableLocationTree(self):
   157         current_location = self.GetCurrentLocation()
   157         current_location = self.GetCurrentLocation()
   158         locstr = "_".join(map(str, current_location))
   158         locstr = "_".join(map(str, current_location))
   159         name = self.BaseParams.getName()
   159         name = self.BaseParams.getName()
   160         entries = []
   160         entries = []
   161         for direction, data in self.modeldata.iteritems():
   161         for direction, data in self.modeldata.items():
   162             iec_direction_prefix = {"input": "__I", "output": "__Q"}[direction]
   162             iec_direction_prefix = {"input": "__I", "output": "__Q"}[direction]
   163             for row in data:
   163             for row in data:
   164                 dname, ua_nsidx, ua_nodeid_type, _ua_node_id, ua_type, iec_number = row
   164                 dname, ua_nsidx, ua_nodeid_type, _ua_node_id, ua_type, iec_number = row
   165                 iec_type, C_type, iec_size_prefix, ua_type_enum, ua_type = UA_IEC_types[ua_type]
   165                 iec_type, C_type, iec_size_prefix, ua_type_enum, ua_type = UA_IEC_types[ua_type]
   166                 c_loc_name = iec_direction_prefix + iec_size_prefix + locstr + "_" + str(iec_number)
   166                 c_loc_name = iec_direction_prefix + iec_size_prefix + locstr + "_" + str(iec_number)