Esempio n. 1
0
 def getEntity(self):
     activeObject = self.getActiveObject()
     activeObjectQueue = activeObject.getActiveObjectQueue()
     activeEntity = QueueManagedJob.getEntity(
         self)  #execute default behaviour
     # if the activeEntity is of type orderComponent
     try:
         if activeEntity.componentType == 'Basic' or 'Secondary':
             activeEntity.readyForAssembly = 1
         # check if all the basics have finished being processed in the previous machines
         # if the componentType of the activeEntity just received is 'Basic',
         # go through the components of its parent order
         # and check if they are present in the activeObjectQueue
         if activeEntity.componentType == 'Basic':
             # local variable to notify when all the basics are received
             allBasicsPresent = True
             # run through all the basicComponentsList
             for entity in activeEntity.order.basicComponentsList:
                 # if a basic is not present then set the local variable False and break
                 if not (entity in activeObjectQueue):
                     allBasicsPresent = False
                     break
             # if all are present then basicsEnded
             if allBasicsPresent:
                 activeEntity.order.basicsEnded = 1
             # TODO: has to signal ConditionalBuffer to start sending entities again
             for secondary in [
                     x for x in activeEntity.order.secondaryComponentsList
                     if activeEntity.order.basicsEnded
             ]:
                 if secondary.currentStation.__class__.__name__ == 'ConditionalBufferManaged':
                     #                         print now(), self.id, '                                                    signalling conditional buffer'
                     if secondary.currentStation.expectedSignals[
                             'canDispose']:
                         self.sendSignal(
                             receiver=secondary.currentStation,
                             signal=secondary.currentStation.canDispose)
                     break
         # for all the components that have the same parent Order as the activeEntity
         activeEntity.order.componentsReadyForAssembly = 1
         for entity in activeEntity.order.basicComponentsList+\
                         activeEntity.order.secondaryComponentsList:
             # if one of them has not reach the Buffer yet,
             if not entity.readyForAssembly:
                 # the mould is not ready for assembly
                 activeEntity.order.componentsReadyForAssembly = 0
                 break
     # if the activeEntity is of type Mould
     except:
         pass
     return activeEntity
Esempio n. 2
0
    def getEntity(self):
        activeObject = self.getActiveObject()
        activeObjectQueue = activeObject.getActiveObjectQueue()
        activeEntity=QueueManagedJob.getEntity(self)   #execute default behaviour
        # if the activeEntity is of type orderComponent
        try:
            if activeEntity.componentType=='Basic' or 'Secondary':
                activeEntity.readyForAssembly=1
            # check if all the basics have finished being processed in the previous machines
            # if the componentType of the activeEntity just received is 'Basic', 
            # go through the components of its parent order
            # and check if they are present in the activeObjectQueue
            if activeEntity.componentType=='Basic':
                # local variable to notify when all the basics are received
                allBasicsPresent = True
                # run through all the basicComponentsList
                for entity in activeEntity.order.basicComponentsList:
                    # if a basic is not present then set the local variable False and break
                    if not (entity in activeObjectQueue):
                        allBasicsPresent = False
                        break
                # if all are present then basicsEnded
                if allBasicsPresent:
                    activeEntity.order.basicsEnded = 1
                # TODO: has to signal ConditionalBuffer to start sending entities again
                for secondary in [x for x in activeEntity.order.secondaryComponentsList if activeEntity.order.basicsEnded]:
                    if secondary.currentStation.__class__.__name__=='ConditionalBuffer':
#                         print now(), self.id, '                                                    signalling conditional buffer'
                        if secondary.currentStation.expectedSignals['canDispose']:
                            self.sendSignal(receiver=secondary.currentStation,signal=secondary.currentStation.canDispose)
                        break
            # for all the components that have the same parent Order as the activeEntity
            activeEntity.order.componentsReadyForAssembly = 1
            for entity in activeEntity.order.basicComponentsList+\
                            activeEntity.order.secondaryComponentsList:
            # if one of them has not reach the Buffer yet,
                if not entity.readyForAssembly:
            # the mould is not ready for assembly
                    activeEntity.order.componentsReadyForAssembly = 0
                    break
        # if the activeEntity is of type Mould
        except:
            pass
        return activeEntity
Esempio n. 3
0
 def getEntity(self):
     activeObject = self.getActiveObject()
     activeObjectQueue = activeObject.getActiveObjectQueue()
     activeEntity=QueueManagedJob.getEntity(self)   #execute default behaviour
     # if the activeEntity is of type orderComponent
     try:
         if activeEntity.componentType=='Basic' or 'Secondary':
             activeEntity.readyForAssembly=1
         # check if all the basics have finished being processed in the previous machines
         # if the componentType of the activeEntity just received is 'Basic', 
         # go through the components of its parent order
         # and check if they are present in the activeObjectQueue
         if activeEntity.componentType=='Basic':
             # local variable to notify when all the basics are received
             allBasicsPresent = True
             # run through all the basicComponentsList
             for entity in activeEntity.order.basicComponentsList:
                 # if a basic is not present then set the local variable False and break
                 if not (entity in activeObjectQueue):
                     allBasicsPresent = False
                     break
             # if all are present then basicsEnded
             if allBasicsPresent:
                 activeEntity.order.basicsEnded = 1
         # for all the components that have the same parent Order as the activeEntity
         activeEntity.order.componentsReadyForAssembly = 1
         for entity in activeEntity.order.basicComponentsList+\
                         activeEntity.order.secondaryComponentsList:
         # if one of them has not reach the Buffer yet,
             if not entity.readyForAssembly:
         # the mould is not ready for assembly
                 activeEntity.order.componentsReadyForAssembly = 0
                 break
     # if the activeEntity is of type Mould
     except:
         pass
     return activeEntity