198 "location", "AXIS_REF", self.CTNName(), "")) |
198 "location", "AXIS_REF", self.CTNName(), "")) |
199 |
199 |
200 def CTNGenerate_C(self, buildpath, locations): |
200 def CTNGenerate_C(self, buildpath, locations): |
201 current_location = self.GetCurrentLocation() |
201 current_location = self.GetCurrentLocation() |
202 |
202 |
203 location_str = "_".join(map(lambda x: str(x), current_location)) |
203 location_str = "_".join(map(str, current_location)) |
204 slave_pos = self.GetSlavePos() |
204 slave_pos = self.GetSlavePos() |
205 MCL_headers = Headers |
205 MCL_headers = Headers |
206 |
206 |
207 # Open CIA402 node code template file |
207 # Open CIA402 node code template file |
208 plc_cia402node_filepath = os.path.join(os.path.split(__file__)[0], |
208 plc_cia402node_filepath = os.path.join(os.path.split(__file__)[0], |
324 |
324 |
325 # Add newline between string in list of generated strings for sections |
325 # Add newline between string in list of generated strings for sections |
326 [fieldbus_interface_declaration, fieldbus_interface_definition, |
326 [fieldbus_interface_declaration, fieldbus_interface_definition, |
327 init_axis_params, extra_variables_retrieve, extra_variables_publish, |
327 init_axis_params, extra_variables_retrieve, extra_variables_publish, |
328 extern_located_variables_declaration, entry_variables, |
328 extern_located_variables_declaration, entry_variables, |
329 init_entry_variables] = map(lambda l: "\n".join(l), [ |
329 init_entry_variables] = map("\n".join, [ |
330 fieldbus_interface_declaration, fieldbus_interface_definition, |
330 fieldbus_interface_declaration, fieldbus_interface_definition, |
331 init_axis_params, extra_variables_retrieve, extra_variables_publish, |
331 init_axis_params, extra_variables_retrieve, extra_variables_publish, |
332 extern_located_variables_declaration, entry_variables, |
332 extern_located_variables_declaration, entry_variables, |
333 init_entry_variables]) |
333 init_entry_variables]) |
334 |
334 |