Commit c88def57 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

fixes in Order

parent 8ca07e6f
...@@ -60,15 +60,14 @@ class Order(Job): ...@@ -60,15 +60,14 @@ class Order(Job):
self.secondaryComponentsList = [] # list that holds the Secondary Components of the order self.secondaryComponentsList = [] # list that holds the Secondary Components of the order
self.auxiliaryComponentsList = [] # list of the auxiliary components of the order self.auxiliaryComponentsList = [] # list of the auxiliary components of the order
self.basicsEnded=basicsEnded # flag that informs that the basic components of the order are finished self.basicsEnded=basicsEnded # flag that informs that the basic components of the order are finished
#=======================================================================
self.manager=manager # the manager responsible to handle the order self.manager=manager # the manager responsible to handle the order
#=======================================================================
# flag that informs weather the components needed for the assembly are present in the Assembly Buffer # flag that informs weather the components needed for the assembly are present in the Assembly Buffer
self.componentsReadyForAssembly = componentsReadyForAssembly self.componentsReadyForAssembly = componentsReadyForAssembly
self.decomposed=False # self.decomposed=False
# used by printRoute # used by printRoute
self.alias='O'+str(len(G.OrderList)) self.alias='O'+str(len(G.OrderList))
def createRoute(self, route): def createRoute(self, route):
return route return route
...@@ -78,13 +77,13 @@ class Order(Job): ...@@ -78,13 +77,13 @@ class Order(Job):
# returns only the components that are present in the system # returns only the components that are present in the system
#=========================================================================== #===========================================================================
def findComponents(self): def findComponents(self):
from Globals import findObjectById
for componentDict in self.componentsList: for componentDict in self.componentsList:
from Globals import findObjectById, G
componentId=componentDict.get('id',0) componentId=componentDict.get('id',0)
componentClass=componentDict.get('_class','not found') componentClass=componentDict.get('_class','not found')
# if there is mould defined in the componentsList and the mould is not yet created, then assembly is requested # if there is mould defined in the componentsList and the mould is not yet created, then assembly is requested
if componentClass=='Dream.Mould': if componentClass=='Dream.Mould':
if not componentId in G.EntityList: if not componentId in [x.id for x in G.EntityList]:
self.assemblyRequested=True self.assemblyRequested=True
# XXX if the component is not yet created then there is no entity to find. # XXX if the component is not yet created then there is no entity to find.
component=findObjectById(componentId) component=findObjectById(componentId)
...@@ -98,7 +97,6 @@ class Order(Job): ...@@ -98,7 +97,6 @@ class Order(Job):
def getComponents(self): def getComponents(self):
if not self.components: if not self.components:
self.findComponents() self.findComponents()
assert len(self.components)>=len(self.componentsList),'the created child components of an order cannot be less than the length of the componentsList'
return self.components return self.components
#=========================================================================== #===========================================================================
...@@ -106,7 +104,7 @@ class Order(Job): ...@@ -106,7 +104,7 @@ class Order(Job):
#=========================================================================== #===========================================================================
def findAssemblyComponents(self): def findAssemblyComponents(self):
for child in self.getComponents(): for child in self.getComponents():
if child.componentType in assemblyValidTypes: if child.componentType in self.assemblyValidTypes:
if not child in self.assemblyComponents: if not child in self.assemblyComponents:
self.assemblyComponents.append(child) self.assemblyComponents.append(child)
......
...@@ -291,12 +291,14 @@ class OrderDecomposition(CoreObject): ...@@ -291,12 +291,14 @@ class OrderDecomposition(CoreObject):
isCritical=self.orderToBeDecomposed.isCritical) isCritical=self.orderToBeDecomposed.isCritical)
# check the componentType of the component and accordingly add to the corresponding list of the parent order # check the componentType of the component and accordingly add to the corresponding list of the parent order
#===============================================================================
if OC.componentType == 'Basic': if OC.componentType == 'Basic':
self.orderToBeDecomposed.basicComponentsList.append(OC) self.orderToBeDecomposed.basicComponentsList.append(OC)
elif OC.componentType == 'Secondary': elif OC.componentType == 'Secondary':
self.orderToBeDecomposed.secondaryComponentsList.append(OC) self.orderToBeDecomposed.secondaryComponentsList.append(OC)
else: # else:
self.orderToBeDecomposed.auxiliaryComponentsList.append(OC) # self.orderToBeDecomposed.auxiliaryComponentsList.append(OC)
#===============================================================================
G.OrderComponentList.append(OC) G.OrderComponentList.append(OC)
G.JobList.append(OC) G.JobList.append(OC)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment