# HG changeset patch # User laurent # Date 1309253308 -7200 # Node ID 2faf0964feb23048857c2c626d63119b6ba5f0aa # Parent f28df922efbe75c7255c8fe35f12b497b6c03b4a Fix bug in using STRING and WSTRING in user defined types diff -r f28df922efbe -r 2faf0964feb2 PLCControler.py --- a/PLCControler.py Tue Jun 14 17:40:02 2011 +0200 +++ b/PLCControler.py Tue Jun 28 11:28:28 2011 +0200 @@ -1406,9 +1406,9 @@ infos = {} datatype = project.getdataType(words[1]) basetype_content = datatype.baseType.getcontent() - if basetype_content["value"] is None: + if basetype_content["value"] is None or basetype_content["name"] in ["string", "wstring"]: infos["type"] = "Directly" - infos["base_type"] = basetype_content["name"] + infos["base_type"] = basetype_content["name"].upper() elif basetype_content["name"] == "derived": infos["type"] = "Directly" infos["base_type"] = basetype_content["value"].getname() @@ -1432,8 +1432,8 @@ for dimension in basetype_content["value"].getdimension(): infos["dimensions"].append((dimension.getlower(), dimension.getupper())) base_type = basetype_content["value"].baseType.getcontent() - if base_type["value"] is None: - infos["base_type"] = base_type["name"] + if base_type["value"] is None or element_type["name"] in ["string", "wstring"]: + infos["base_type"] = base_type["name"].upper() else: infos["base_type"] = base_type["value"].getname() elif basetype_content["name"] == "struct": @@ -1443,8 +1443,8 @@ element_infos = {} element_infos["Name"] = element.getname() element_type = element.type.getcontent() - if element_type["value"] is None: - element_infos["Type"] = element_type["name"] + if element_type["value"] is None or element_type["name"] in ["string", "wstring"]: + element_infos["Type"] = element_type["name"].upper() else: element_infos["Type"] = element_type["value"].getname() if element.initialValue is not None: