72 "type": LOCATION_VAR_MEMORY, |
72 "type": LOCATION_VAR_MEMORY, |
73 "size": size, |
73 "size": size, |
74 "IEC_type": IECTypeConversion.get(typeinfos["name"]), |
74 "IEC_type": IECTypeConversion.get(typeinfos["name"]), |
75 "var_name": "%s_%4.4x_%2.2x" % ("_".join(name.split()), index, subindex), |
75 "var_name": "%s_%4.4x_%2.2x" % ("_".join(name.split()), index, subindex), |
76 "location": "%s%s" % (SizeConversion[size], ".".join(map(str, current_location + |
76 "location": "%s%s" % (SizeConversion[size], ".".join(map(str, current_location + |
77 (index, subindex)))), |
77 (index, subindex)))), |
78 "description": "", |
78 "description": "", |
79 "children": []}) |
79 "children": []}) |
80 return {"name": name, |
80 return {"name": name, |
81 "type": LOCATION_CONFNODE, |
81 "type": LOCATION_CONFNODE, |
82 "location": ".".join([str(i) for i in current_location]) + ".x", |
82 "location": ".".join([str(i) for i in current_location]) + ".x", |
350 |
350 |
351 def GetVariableLocationTree(self): |
351 def GetVariableLocationTree(self): |
352 current_location = self.GetCurrentLocation() |
352 current_location = self.GetCurrentLocation() |
353 nodeindexes = self.SlaveNodes.keys() |
353 nodeindexes = self.SlaveNodes.keys() |
354 nodeindexes.sort() |
354 nodeindexes.sort() |
355 return {"name": self.BaseParams.getName(), |
355 children = [] |
356 "type": LOCATION_CONFNODE, |
356 children += [GetSlaveLocationTree(self.Manager.GetCurrentNodeCopy(), |
357 "location": self.GetFullIEC_Channel(), |
357 current_location, |
358 "children": [GetSlaveLocationTree(self.Manager.GetCurrentNodeCopy(), |
358 _("Local entries"))] |
359 current_location, |
359 children += [GetSlaveLocationTree(self.SlaveNodes[nodeid]["Node"], |
360 _("Local entries"))] + |
360 current_location + (nodeid,), |
361 [GetSlaveLocationTree(self.SlaveNodes[nodeid]["Node"], |
361 self.SlaveNodes[nodeid]["Name"]) for nodeid in nodeindexes] |
362 current_location + (nodeid,), |
362 |
363 self.SlaveNodes[nodeid]["Name"]) |
363 return { |
364 for nodeid in nodeindexes] |
364 "name": self.BaseParams.getName(), |
|
365 "type": LOCATION_CONFNODE, |
|
366 "location": self.GetFullIEC_Channel(), |
|
367 "children": children |
365 } |
368 } |
366 |
369 |
367 _GeneratedMasterView = None |
370 _GeneratedMasterView = None |
368 |
371 |
369 def _ShowGeneratedMaster(self): |
372 def _ShowGeneratedMaster(self): |