Commit 4f13ba14 authored by Ioannis Papagiannopoulos's avatar Ioannis Papagiannopoulos Committed by Georgios Dagkakis

fixes in Order

parent 7fe3cee6
......@@ -60,15 +60,14 @@ class Order(Job):
self.secondaryComponentsList = [] # list that holds the Secondary 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.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
self.componentsReadyForAssembly = componentsReadyForAssembly
self.decomposed=False
# self.decomposed=False
# used by printRoute
self.alias='O'+str(len(G.OrderList))
def createRoute(self, route):
return route
......@@ -78,13 +77,13 @@ class Order(Job):
# returns only the components that are present in the system
#===========================================================================
def findComponents(self):
from Globals import findObjectById
for componentDict in self.componentsList:
from Globals import findObjectById, G
componentId=componentDict.get('id',0)
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 componentClass=='Dream.Mould':
if not componentId in G.EntityList:
if not componentId in [x.id for x in G.EntityList]:
self.assemblyRequested=True
# XXX if the component is not yet created then there is no entity to find.
component=findObjectById(componentId)
......@@ -98,7 +97,6 @@ class Order(Job):
def getComponents(self):
if not self.components:
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
#===========================================================================
......@@ -106,7 +104,7 @@ class Order(Job):
#===========================================================================
def findAssemblyComponents(self):
for child in self.getComponents():
if child.componentType in assemblyValidTypes:
if child.componentType in self.assemblyValidTypes:
if not child in self.assemblyComponents:
self.assemblyComponents.append(child)
......
......@@ -234,7 +234,7 @@ class OrderDecomposition(CoreObject):
# variable that holds the componentType which can be Basic/Secondary/Auxiliary
componentType=component.get('componentType', 'Basic')
# the component that needs the auxiliary (if the componentType is "Auxiliary") during its processing
requestingComponent = component.get('requestingComponent', 'not found')
requestingComponent = component.get('requestingComponent', 'not found')
# dummy variable that holds the routes of the jobs the route from the JSON file is a sequence of dictionaries
JSONRoute=component.get('route', [])
# variable that holds the argument used in the Job initiation hold None for each entry in the 'route' list
......@@ -291,12 +291,14 @@ class OrderDecomposition(CoreObject):
isCritical=self.orderToBeDecomposed.isCritical)
# check the componentType of the component and accordingly add to the corresponding list of the parent order
#===============================================================================
if OC.componentType == 'Basic':
self.orderToBeDecomposed.basicComponentsList.append(OC)
elif OC.componentType == 'Secondary':
self.orderToBeDecomposed.secondaryComponentsList.append(OC)
else:
self.orderToBeDecomposed.auxiliaryComponentsList.append(OC)
# else:
# self.orderToBeDecomposed.auxiliaryComponentsList.append(OC)
#===============================================================================
G.OrderComponentList.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