Commit 62970db9 authored by Sebastien Robin's avatar Sebastien Robin

allow to pass more parameters, added solveMovement


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4212 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dc019716
...@@ -104,7 +104,25 @@ class SimulationTool (BaseTool): ...@@ -104,7 +104,25 @@ class SimulationTool (BaseTool):
""" show the content in the left pane of the ZMI """ """ show the content in the left pane of the ZMI """
return self.objectValues() return self.objectValues()
def solveDelivery(self, delivery, dsolver_name, tsolver_name, additional_parameters=None,**kw): def solveDelivery(self, delivery, dsolver_name, tsolver_name,
additional_parameters=None,**kw):
"""
Solve a delivery by calling DeliverySolver and TargetSolver
"""
self.solveMovementOrDelivery(delivery, dsolver_name, tsolver_name,
delivery=1,additional_parameters=additional_parameters,**kw)
def solveMovement(self, movement, dsolver_name, tsolver_name,
additional_parameters=None,**kw):
"""
Solve a movement by calling DeliverySolver and TargetSolver
"""
self.solveMovementOrDelivery(movement, dsolver_name, tsolver_name,
movement=1,additional_parameters=additional_parameters,**kw)
def solveMovementOrDelivery(self, obj, dsolver_name, tsolver_name,
movement=0,delivery=0,
additional_parameters=None,**kw):
""" """
Solve a delivery by calling DeliverySolver and TargetSolver Solve a delivery by calling DeliverySolver and TargetSolver
""" """
...@@ -119,7 +137,10 @@ class SimulationTool (BaseTool): ...@@ -119,7 +137,10 @@ class SimulationTool (BaseTool):
solver_class = getattr(solver_file, solver_name) solver_class = getattr(solver_file, solver_name)
solver = solver_class(additional_parameters=additional_parameters,**kw) solver = solver_class(additional_parameters=additional_parameters,**kw)
solver.solveDelivery(delivery) if movement:
solver.solveMovement(obj)
if delivery:
solver.solveDelivery(obj)
####################################################### #######################################################
# Stock Management # Stock Management
......
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