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
831cad78
Commit
831cad78
authored
Mar 12, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a component is not injected as wip to an assembly buffer if the mould is already created
parent
63a8aa57
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
dream/plugins/InsertWIP.py
dream/plugins/InsertWIP.py
+21
-3
No files found.
dream/plugins/InsertWIP.py
View file @
831cad78
...
...
@@ -11,8 +11,8 @@ class InsertWIP(plugin.InputPreparationPlugin):
def
preprocess
(
self
,
data
):
""" updates the Work in Process of each station according to the BOM
"""
wip
=
data
[
"input"
][
"BOM"
].
get
(
"WIP"
,
{})
for
partID
,
work
in
wip
.
iteritems
():
WIP
=
data
[
"input"
][
"BOM"
].
get
(
"WIP"
,
{})
for
partID
,
work
in
WIP
.
iteritems
():
stationID
=
work
.
get
(
"station"
,
None
)
if
not
stationID
:
break
...
...
@@ -20,6 +20,24 @@ class InsertWIP(plugin.InputPreparationPlugin):
if
not
node
:
break
wip
=
node
.
get
(
"wip"
,
[])
endOfRoute
=
False
# flag to signal that the part should not be injected as WIP
mouldCreated
=
False
# flag to signal that the mould of the same order is created
# if the part lies in an assembly buffer
if
data
[
'graph'
][
'node'
][
stationID
][
'_class'
]
==
'Dream.MouldAssemblyBuffer'
:
# find the order it belongs to
for
order
in
data
[
'input'
][
'BOM'
][
'productionOrders'
]:
for
component
in
order
.
get
(
'componentsList'
,
[]):
if
component
.
get
(
'id'
,
None
)
==
partID
:
# if the part is of class OrderComponent (and NOT Mould)
if
component
.
get
(
'_class'
,
None
)
==
'Dream.OrderComponent'
:
endOfRoute
=
True
# find the Mould component of the order and see it is already in the WIP
if
component
.
get
(
'_class'
,
None
)
==
'Dream.Mould'
:
if
component
.
get
(
'id'
,
None
)
in
WIP
.
keys
():
mouldCreated
=
True
# if the part reached the end of its route (an assembly buffer) and the mould is already created
if
endOfRoute
and
mouldCreated
:
continue
wip
.
append
({
"id"
:
partID
,
"sequence"
:
work
.
get
(
"sequence"
,
None
),
...
...
@@ -42,4 +60,4 @@ class InsertWIP(plugin.InputPreparationPlugin):
return
data
if
__name__
==
'__main__'
:
pass
\ No newline at end of file
pass
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