PLCControler.py
changeset 1763 bcc07ff2362c
parent 1762 fcc406143e5b
child 1766 c1e5b9f19483
equal deleted inserted replaced
1762:fcc406143e5b 1763:bcc07ff2362c
  1779                 else basetype_content_type.upper())
  1779                 else basetype_content_type.upper())
  1780         return None
  1780         return None
  1781 
  1781 
  1782     # Return Base Type of given possible derived type
  1782     # Return Base Type of given possible derived type
  1783     def GetBaseType(self, typename, debug=False):
  1783     def GetBaseType(self, typename, debug=False):
  1784         if TypeHierarchy.has_key(typename):
  1784         if typename in TypeHierarchy:
  1785             return typename
  1785             return typename
  1786 
  1786 
  1787         datatype = self.GetDataType(typename, debug)
  1787         datatype = self.GetDataType(typename, debug)
  1788         if datatype is not None:
  1788         if datatype is not None:
  1789             basetype = self.GetDataTypeBaseType(datatype)
  1789             basetype = self.GetDataTypeBaseType(datatype)
  2410                                                     exclude=exclude,
  2410                                                     exclude=exclude,
  2411                                                     debug=debug)
  2411                                                     debug=debug)
  2412                     exclude[stepname] = True
  2412                     exclude[stepname] = True
  2413                     instance.setname(stepname)
  2413                     instance.setname(stepname)
  2414                 localid = instance.getlocalId()
  2414                 localid = instance.getlocalId()
  2415                 if not used_id.has_key(localid):
  2415                 if not localid in used_id:
  2416                     new_id[localid] = True
  2416                     new_id[localid] = True
  2417 
  2417 
  2418             idx = 1
  2418             idx = 1
  2419             translate_id = {}
  2419             translate_id = {}
  2420             bbox = rect()
  2420             bbox = rect()
  2421             for instance in instances:
  2421             for instance in instances:
  2422                 localId = instance.getlocalId()
  2422                 localId = instance.getlocalId()
  2423                 bbox.union(instance.getBoundingBox())
  2423                 bbox.union(instance.getBoundingBox())
  2424                 if used_id.has_key(localId):
  2424                 if localId in used_id:
  2425                     while used_id.has_key(idx) or new_id.has_key(idx):
  2425                     while (idx in used_id) or (idx in new_id):
  2426                         idx += 1
  2426                         idx += 1
  2427                     new_id[idx] = True
  2427                     new_id[idx] = True
  2428                     instance.setlocalId(idx)
  2428                     instance.setlocalId(idx)
  2429                     translate_id[localId] = idx
  2429                     translate_id[localId] = idx
  2430 
  2430