221 @return: [(C_file_name, CFLAGS),...] , LDFLAGS_TO_APPEND |
221 @return: [(C_file_name, CFLAGS),...] , LDFLAGS_TO_APPEND |
222 """ |
222 """ |
223 current_location = self.GetCurrentLocation() |
223 current_location = self.GetCurrentLocation() |
224 # define a unique name for the generated C file |
224 # define a unique name for the generated C file |
225 prefix = "_".join(map(str, current_location)) |
225 prefix = "_".join(map(str, current_location)) |
226 Gen_OD_path = os.path.join(buildpath, "OD_%s.c" % prefix ) |
226 Gen_OD_path = os.path.join(buildpath, "OD_%s.c" % prefix) |
227 # Create a new copy of the model |
227 # Create a new copy of the model |
228 slave = self.GetCurrentNodeCopy() |
228 slave = self.GetCurrentNodeCopy() |
229 slave.SetNodeName("OD_%s" % prefix) |
229 slave.SetNodeName("OD_%s" % prefix) |
230 # allow access to local OD from Slave PLC |
230 # allow access to local OD from Slave PLC |
231 pointers = config_utils.LocalODPointers(locations, current_location, slave) |
231 pointers = config_utils.LocalODPointers(locations, current_location, slave) |
440 """ |
440 """ |
441 self._CloseView(self._GeneratedMasterView) |
441 self._CloseView(self._GeneratedMasterView) |
442 current_location = self.GetCurrentLocation() |
442 current_location = self.GetCurrentLocation() |
443 # define a unique name for the generated C file |
443 # define a unique name for the generated C file |
444 prefix = "_".join(map(str, current_location)) |
444 prefix = "_".join(map(str, current_location)) |
445 Gen_OD_path = os.path.join(buildpath, "OD_%s.c" % prefix ) |
445 Gen_OD_path = os.path.join(buildpath, "OD_%s.c" % prefix) |
446 # Create a new copy of the model with DCF loaded with PDO mappings for desired location |
446 # Create a new copy of the model with DCF loaded with PDO mappings for desired location |
447 try: |
447 try: |
448 master, pointers = config_utils.GenerateConciseDCF(locations, current_location, self, self.CanFestivalNode.getSync_TPDOs(), "OD_%s" % prefix) |
448 master, pointers = config_utils.GenerateConciseDCF(locations, current_location, self, self.CanFestivalNode.getSync_TPDOs(), "OD_%s" % prefix) |
449 except config_utils.PDOmappingException, e: |
449 except config_utils.PDOmappingException, e: |
450 raise Exception, e.message |
450 raise Exception, e.message |
479 </xsd:element> |
479 </xsd:element> |
480 </xsd:schema> |
480 </xsd:schema> |
481 """ |
481 """ |
482 |
482 |
483 CTNChildrenTypes = [("CanOpenNode", _NodeListCTN, "CanOpen Master"), |
483 CTNChildrenTypes = [("CanOpenNode", _NodeListCTN, "CanOpen Master"), |
484 ("CanOpenSlave", _SlaveCTN, "CanOpen Slave" )] |
484 ("CanOpenSlave", _SlaveCTN, "CanOpen Slave")] |
485 def GetParamsAttributes(self, path=None): |
485 def GetParamsAttributes(self, path=None): |
486 infos = ConfigTreeNode.GetParamsAttributes(self, path=path) |
486 infos = ConfigTreeNode.GetParamsAttributes(self, path=path) |
487 for element in infos: |
487 for element in infos: |
488 if element["name"] == "CanFestivalInstance": |
488 if element["name"] == "CanFestivalInstance": |
489 for child in element["children"]: |
489 for child in element["children"]: |