# HG changeset patch # User laurent # Date 1316034407 -7200 # Node ID 01e2c3d58a279b330ff82b99fbcdd085c028bfb5 # Parent 0f591ac019f3869ed7ea58d43d877bbb6c5b8a26 Fix bug while generating direct global array variables diff -r 0f591ac019f3 -r 01e2c3d58a27 PLCGenerator.py --- a/PLCGenerator.py Wed Sep 14 23:06:05 2011 +0200 +++ b/PLCGenerator.py Wed Sep 14 23:06:47 2011 +0200 @@ -278,7 +278,7 @@ # Array derived directly from an elementary type else: basetype_name = base_type["name"] - var_type = "ARRAY [%s] OF %s" % (",".join(map(lambda x : "%s..%s" % (dimension.getlower(), dimension.getupper()), vartype_content["value"].getdimension())), basetype_name) + var_type = "ARRAY [%s] OF %s" % (",".join(map(lambda x : "%s..%s" % (x.getlower(), x.getupper()), vartype_content["value"].getdimension())), basetype_name) # Variable type is an elementary type else: var_type = vartype_content["name"] @@ -347,7 +347,7 @@ # Array derived directly from an elementary type else: basetype_name = base_type["name"] - var_type = "ARRAY [%s] OF %s" % (",".join(map(lambda x : "%s..%s" % (dimension.getlower(), dimension.getupper()), vartype_content["value"].getdimension())), basetype_name) + var_type = "ARRAY [%s] OF %s" % (",".join(map(lambda x : "%s..%s" % (x.getlower(), x.getupper()), vartype_content["value"].getdimension())), basetype_name) # Variable type is an elementary type else: var_type = vartype_content["name"] @@ -623,7 +623,7 @@ # Array derived directly from a user defined type if base_type["name"] == "derived": basetype_name = base_type["value"].getname() - self.GenerateDataType(basetype_name) + self.ParentGenerator.GenerateDataType(basetype_name) # Array derived directly from a string type elif base_type["name"] in ["string", "wstring"]: basetype_name = base_type["name"].upper()