equal
deleted
inserted
replaced
179 "IN": "_P_ENUM", |
179 "IN": "_P_ENUM", |
180 "MEM": "_O_ENUM", |
180 "MEM": "_O_ENUM", |
181 "OUT": "_O_ENUM", |
181 "OUT": "_O_ENUM", |
182 "VAR": "_ENUM" |
182 "VAR": "_ENUM" |
183 }[node.vartype] + ", " + |
183 }[node.vartype] + ", " + |
184 str(buf_index) + ", 0}"] |
184 str(buf_index) + ", 0, }"] |
185 buf_index += sz |
185 buf_index += sz |
186 if len(node.path) == 1: |
186 if len(node.path) == 1: |
187 extern_variables_declarations += [ |
187 extern_variables_declarations += [ |
188 "extern __IEC_" + node.iectype + "_" + |
188 "extern __IEC_" + node.iectype + "_" + |
189 "t" if node.vartype is "VAR" else "p" |
189 "t" if node.vartype is "VAR" else "p" |
206 svghmi_c_file.close() |
206 svghmi_c_file.close() |
207 svghmi_c_code = svghmi_c_code % { |
207 svghmi_c_code = svghmi_c_code % { |
208 "variable_decl_array": ",\n".join(variable_decl_array), |
208 "variable_decl_array": ",\n".join(variable_decl_array), |
209 "extern_variables_declarations": "\n".join(extern_variables_declarations), |
209 "extern_variables_declarations": "\n".join(extern_variables_declarations), |
210 "buffer_size": buf_index, |
210 "buffer_size": buf_index, |
211 "var_access_code": targets.GetCode("var_access.c") |
211 "var_access_code": targets.GetCode("var_access.c"), |
|
212 "PLC_ticktime": self.GetCTRoot().GetTicktime() |
212 } |
213 } |
213 |
214 |
214 gen_svghmi_c_path = os.path.join(buildpath, "svghmi.c") |
215 gen_svghmi_c_path = os.path.join(buildpath, "svghmi.c") |
215 gen_svghmi_c = open(gen_svghmi_c_path, 'w') |
216 gen_svghmi_c = open(gen_svghmi_c_path, 'w') |
216 gen_svghmi_c.write(svghmi_c_code) |
217 gen_svghmi_c.write(svghmi_c_code) |