32 "W" : ["INT", "UINT", "WORD", "WSTRING"], |
32 "W" : ["INT", "UINT", "WORD", "WSTRING"], |
33 "D" : ["DINT", "UDINT", "REAL", "DWORD"], |
33 "D" : ["DINT", "UDINT", "REAL", "DWORD"], |
34 "L" : ["LINT", "ULINT", "LREAL", "LWORD"]} |
34 "L" : ["LINT", "ULINT", "LREAL", "LWORD"]} |
35 |
35 |
36 # Helper for emulate join on element list |
36 # Helper for emulate join on element list |
37 def JoinList(separator, list): |
37 def JoinList(separator, mylist): |
38 return reduce(lambda x, y: x + separator + y, list) |
38 if len(mylist) > 0 : |
|
39 return reduce(lambda x, y: x + separator + y, mylist) |
|
40 else : |
|
41 return mylist |
39 |
42 |
40 def generate_block(generator, block, body, link, order=False): |
43 def generate_block(generator, block, body, link, order=False): |
41 body_type = body.getcontent()["name"] |
44 body_type = body.getcontent()["name"] |
42 name = block.getinstanceName() |
45 name = block.getinstanceName() |
43 type = block.gettypeName() |
46 type = block.gettypeName() |