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
9198cee5
Commit
9198cee5
authored
Feb 25, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new plugin that reads the WIP from the BOM and injects to the corresponding stations
parent
474ab65d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
dream/plugins/InsertWIP.py
dream/plugins/InsertWIP.py
+35
-0
No files found.
dream/plugins/InsertWIP.py
0 → 100644
View file @
9198cee5
from
copy
import
copy
from
dream.plugins
import
plugin
import
datetime
class
InsertWIP
(
plugin
.
InputPreparationPlugin
):
""" Input preparation
reads the BOM - wip and inserts the work in progress to the corresponding stations
"""
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
():
stationID
=
work
.
get
(
"station"
,
None
)
if
not
stationID
:
break
node
=
data
[
"graph"
][
"node"
].
get
(
stationID
,
{})
if
not
node
:
break
wip
=
node
.
get
(
"wip"
,
[])
wip
.
append
({
"id"
:
partID
,
"sequence"
:
work
.
get
(
"sequence"
,
None
),
"task_id"
:
work
.
get
(
"task_id"
,
None
)
})
operator
=
work
.
get
(
"operator"
,
None
)
if
operator
:
wip
[
-
1
][
"operator"
]
=
operator
node
[
"wip"
]
=
wip
return
data
if
__name__
==
'__main__'
:
pass
\ No newline at end of file
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