61 connections = variable.connectionPointIn.getconnections() |
61 connections = variable.connectionPointIn.getconnections() |
62 if connections and len(connections) == 1: |
62 if connections and len(connections) == 1: |
63 if body_type == "FBD" or body_type == "SFC": |
63 if body_type == "FBD" or body_type == "SFC": |
64 value = generator.ComputeFBDExpression(body, connections[0], executionOrderId > 0) |
64 value = generator.ComputeFBDExpression(body, connections[0], executionOrderId > 0) |
65 elif body_type == "LD": |
65 elif body_type == "LD": |
66 paths = generator.GenerateLDPaths(variable.connectionPointIn.getConnections(), body) |
66 value = generator.ComputeLDExpression(body, variable.connectionPointIn.getConnections()) |
67 if len(paths) > 0: |
|
68 paths = tuple(paths) |
|
69 else: |
|
70 paths = paths[0] |
|
71 value = generator.ComputeLDExpression(paths, True) |
|
72 vars.append(generator.ExtractModifier(variable, value, input_info)) |
67 vars.append(generator.ExtractModifier(variable, value, input_info)) |
73 generator.Program += [(generator.CurrentIndent, ()), |
68 generator.Program += [(generator.CurrentIndent, ()), |
74 (output_name, output_info), |
69 (output_name, output_info), |
75 (" := ", ()), |
70 (" := ", ()), |
76 (type, (generator.TagName, "block", block.getlocalId(), "type")), |
71 (type, (generator.TagName, "block", block.getlocalId(), "type")), |
88 if connections and len(connections) == 1: |
83 if connections and len(connections) == 1: |
89 parameter = variable.getformalParameter() |
84 parameter = variable.getformalParameter() |
90 if body_type == "FBD" or body_type == "SFC": |
85 if body_type == "FBD" or body_type == "SFC": |
91 value = generator.ComputeFBDExpression(body, connections[0], executionOrderId > 0) |
86 value = generator.ComputeFBDExpression(body, connections[0], executionOrderId > 0) |
92 elif body_type == "LD": |
87 elif body_type == "LD": |
93 paths = generator.GenerateLDPaths(variable.connectionPointIn.getconnections(), body) |
88 value = generator.ComputeLDExpression(body, variable.connectionPointIn.getconnections()) |
94 if len(paths) > 0: |
|
95 paths = tuple(paths) |
|
96 else: |
|
97 paths = paths[0] |
|
98 value = generator.ComputeLDExpression(paths, True) |
|
99 vars.append([(parameter, input_info), |
89 vars.append([(parameter, input_info), |
100 (" := ", ())] + generator.ExtractModifier(variable, value, input_info)) |
90 (" := ", ())] + generator.ExtractModifier(variable, value, input_info)) |
101 generator.Program += [(generator.CurrentIndent, ()), |
91 generator.Program += [(generator.CurrentIndent, ()), |
102 (name, (generator.TagName, "block", block.getlocalId(), "name")), |
92 (name, (generator.TagName, "block", block.getlocalId(), "name")), |
103 ("(", ())] |
93 ("(", ())] |