예제 #1
0
    def findStartingBlocks(self, dnaRacingPadGroup, distRacePad):
        startingBlocks = []
        for i in range(dnaRacingPadGroup.getNumChildren()):
            dnaGroup = dnaRacingPadGroup.at(i)
            if string.find(dnaGroup.getName(), 'starting_block') >= 0:
                padLocation = dnaGroup.getName().split('_')[2]
                pos = dnaGroup.getPos()
                hpr = dnaGroup.getHpr()
                if isinstance(distRacePad, DistributedRacePadAI):
                    sb = DistributedStartingBlockAI(self, distRacePad, pos[0],
                                                    pos[1], pos[2], hpr[0],
                                                    hpr[1], hpr[2],
                                                    int(padLocation))
                else:
                    sb = DistributedViewingBlockAI(self, distRacePad, pos[0],
                                                   pos[1], pos[2], hpr[0],
                                                   hpr[1], hpr[2],
                                                   int(padLocation))
                sb.generateWithRequired(distRacePad.zoneId)
                startingBlocks.append(sb)
            else:
                self.notify.debug(
                    'Found dnaGroup that is not a starting_block under a race pad group'
                )

        return startingBlocks
    def findStartingBlocks(self, dnaRacingPadGroup, distRacePad):
        """
        Comment goes here...
        """
        startingBlocks = []
        # Search the children of the racing pad
        for i in range(dnaRacingPadGroup.getNumChildren()):
            dnaGroup = dnaRacingPadGroup.at(i)

            # TODO - check if DNAProp instance
            if ((dnaGroup.getName().find('starting_block') >= 0)):
                padLocation = dnaGroup.getName().split('_')[2]
                pos = dnaGroup.getPos()
                hpr = dnaGroup.getHpr()

                if (isinstance(distRacePad, DistributedRacePadAI)):
                    sb = DistributedStartingBlockAI(self, distRacePad, pos[0],
                                                    pos[1], pos[2], hpr[0],
                                                    hpr[1], hpr[2],
                                                    int(padLocation))
                else:
                    sb = DistributedViewingBlockAI(self, distRacePad, pos[0],
                                                   pos[1], pos[2], hpr[0],
                                                   hpr[1], hpr[2],
                                                   int(padLocation))
                sb.generateWithRequired(distRacePad.zoneId)
                startingBlocks.append(sb)
            else:
                self.notify.debug(
                    "Found dnaGroup that is not a starting_block under a race pad group"
                )
        return startingBlocks
예제 #3
0
 def findStartingBlocks(self, dnaRacingPadGroup, distRacePad):
     startingBlocks = []
     for i in range(dnaRacingPadGroup.getNumChildren()):
         dnaGroup = dnaRacingPadGroup.at(i)
         if string.find(dnaGroup.getName(), 'starting_block') >= 0:
             padLocation = dnaGroup.getName().split('_')[2]
             pos = dnaGroup.getPos()
             hpr = dnaGroup.getHpr()
             if isinstance(distRacePad, DistributedRacePadAI):
                 sb = DistributedStartingBlockAI(self, distRacePad, pos[0], pos[1], pos[2], hpr[0], hpr[1], hpr[2], int(padLocation))
             else:
                 sb = DistributedViewingBlockAI(self, distRacePad, pos[0], pos[1], pos[2], hpr[0], hpr[1], hpr[2], int(padLocation))
             sb.generateWithRequired(distRacePad.zoneId)
             startingBlocks.append(sb)
             continue
         self.notify.debug('Found dnaGroup that is not a starting_block under a race pad group')
     
     return startingBlocks