Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
fdbde03c
Commit
fdbde03c
authored
Sep 28, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LineGeneration update to read current sequence from wip while BOM productionOrders are provided
parent
c3c88534
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
16 deletions
+37
-16
dream/simulation/Job.py
dream/simulation/Job.py
+3
-3
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+34
-13
No files found.
dream/simulation/Job.py
View file @
fdbde03c
...
@@ -54,7 +54,7 @@ class Job(Entity): # inherits from the Entity c
...
@@ -54,7 +54,7 @@ class Job(Entity): # inherits from the Entity c
# used by printRoute
# used by printRoute
self
.
alias
=
'J'
+
str
(
len
(
G
.
JobList
))
self
.
alias
=
'J'
+
str
(
len
(
G
.
JobList
))
# added for testing - flag that shows if the order and component routes are defined in the BOM
# added for testing - flag that shows if the order and component routes are defined in the BOM
self
.
order
InBOM
=
False
self
.
route
InBOM
=
False
# =======================================================================
# =======================================================================
# outputs results to JSON File
# outputs results to JSON File
...
@@ -108,8 +108,8 @@ class Job(Entity): # inherits from the Entity c
...
@@ -108,8 +108,8 @@ class Job(Entity): # inherits from the Entity c
# =======================================================================
# =======================================================================
def
initialize
(
self
):
def
initialize
(
self
):
currentStationWellDefined
=
False
currentStationWellDefined
=
False
# XXX change WIP definition when BOM is provided (current sequence number should be provided)
if
self
.
currentStation
and
self
.
order
InBOM
:
if
self
.
currentStation
and
self
.
route
InBOM
:
for
step
in
self
.
route
:
for
step
in
self
.
route
:
stepObjectIds
=
step
.
get
(
'stationIdsList'
,[])
stepObjectIds
=
step
.
get
(
'stationIdsList'
,[])
if
self
.
currentStation
.
id
in
stepObjectIds
:
if
self
.
currentStation
.
id
in
stepObjectIds
:
...
...
dream/simulation/LineGenerationJSON.py
View file @
fdbde03c
...
@@ -384,18 +384,39 @@ def createWIP():
...
@@ -384,18 +384,39 @@ def createWIP():
from
dream.simulation.OrderDesign
import
OrderDesign
from
dream.simulation.OrderDesign
import
OrderDesign
for
entity
in
wip
:
for
entity
in
wip
:
entityOrder
=
None
# variable to hold the parent order of the WIP
entityOrder
=
None
# variable to hold the parent order of the WIP
# if the dictionary contains no objects but ids (the orders are provided in BOM echelon)
# if there is BOM defined
if
not
type
(
entity
)
is
dict
:
if
bom
:
# try to find the parent order and the dict corresponding to the ID provided in the WIP
# and production orders in it
if
bom
.
get
(
'productionOrders'
,[]):
# find which order has the entity in its componentsList
for
order
in
G
.
OrderList
:
for
order
in
G
.
OrderList
:
if
order
.
componentsList
:
if
order
.
componentsList
:
for
componentDict
in
order
.
componentsList
:
for
componentDict
in
order
.
componentsList
:
tempID
=
componentDict
.
get
(
'id'
,
'not found'
)
# if the entity has no parent order the following control will not be performed
if
entity
==
tempID
:
if
entity
[
'id'
]
==
componentDict
[
'id'
]:
entity
=
componentDict
entityOrder
=
order
# the parent order of the entity
entityOrder
=
order
entityCurrentSeq
=
int
(
entity
[
'sequence'
])
# the current seq number of the entity's route
if
type
(
entity
)
is
dict
:
ind
=
0
# holder of the route index corresponding to the entityCurrentSeq
solution
=
False
# flag to signal that the route step is found
# find the step that corresponds to the entityCurrentSeq
for
i
,
step
in
enumerate
(
componentDict
.
get
(
'route'
,[])):
stepSeq
=
step
[
'sequence'
]
# the sequence of step i
if
stepSeq
==
''
:
stepSeq
=
0
# if the seq is ''>OrderDecomposition then 0
# if the entityCurrentSeq is found and the id of the holding Station is in the steps stationIdsList
if
int
(
stepSeq
)
==
int
(
entityCurrentSeq
)
and
element
[
'id'
]
in
step
[
'stationIdsList'
]:
ind
=
i
# hold the index
solution
=
True
# the solution isfound
break
# assert that there is solution
assert
solution
,
'something is wrong with the initial step of '
+
entity
[
'id'
]
# the remaining route of the entity assuming that the given route doesn't start from the entityCurrentSeq
entityRoute
=
componentDict
.
get
(
'route'
,[])[
ind
:]
entity
=
dict
(
componentDict
)
# copy the entity dict
entity
.
pop
(
'route'
)
# remove the old route
entity
[
'route'
]
=
entityRoute
# and hold the new one without the previous steps
break
break
entityClass
=
entity
.
get
(
'_class'
,
None
)
entityClass
=
entity
.
get
(
'_class'
,
None
)
entityType
=
Globals
.
getClassFromName
(
entityClass
)
entityType
=
Globals
.
getClassFromName
(
entityClass
)
inputDict
=
dict
(
entity
)
inputDict
=
dict
(
entity
)
...
@@ -405,7 +426,7 @@ def createWIP():
...
@@ -405,7 +426,7 @@ def createWIP():
# if orders are provided separately (BOM) provide the parent order as argument
# if orders are provided separately (BOM) provide the parent order as argument
if
entityOrder
:
if
entityOrder
:
entity
=
entityType
(
order
=
order
,
**
inputDict
)
entity
=
entityType
(
order
=
order
,
**
inputDict
)
entity
.
order
InBOM
=
True
entity
.
route
InBOM
=
True
else
:
else
:
entity
=
entityType
(
**
inputDict
)
entity
=
entityType
(
**
inputDict
)
G
.
EntityList
.
append
(
entity
)
G
.
EntityList
.
append
(
entity
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment