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
b4c7398c
Commit
b4c7398c
authored
Aug 27, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin to output the KE tool report in DREAM WIP spreadsheet format
parent
770fa32d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
dream/plugins/Batches/OutputKEWIP.py
dream/plugins/Batches/OutputKEWIP.py
+46
-0
No files found.
dream/plugins/Batches/OutputKEWIP.py
0 → 100644
View file @
b4c7398c
from
dream.plugins
import
plugin
class
OutputKEWIP
(
plugin
.
OutputPreparationPlugin
):
""" Output the station utilization metrics in a format compatible with
"""
def
postprocess
(
self
,
data
):
if
data
[
'general'
].
get
(
'wipSource'
,
None
)
==
'Manually'
:
data
[
'result'
][
'result_list'
][
0
][
self
.
configuration_dict
[
'output_id'
]]
=
[[
'WIP Was defined Manually. No KE tool Input!'
]]
return
data
outPutSpreadsheet
=
[[
'Station'
,
'# units awaiting processing'
,
'# units complete but not passed on'
]]
nodes
=
data
[
'graph'
][
'node'
]
for
node_id
,
node
in
nodes
.
iteritems
():
if
'Machine'
in
node
[
'_class'
]
or
'M3'
in
node
[
'_class'
]:
outPutSpreadsheet
.
append
([
node_id
,
0
])
for
node_id
,
node
in
nodes
.
iteritems
():
if
'Queue'
in
node
[
'_class'
]
or
'Clearance'
in
node
[
'_class'
]:
wip
=
node
.
get
(
'wip'
,[])
stationId
=
self
.
getNextStation
(
data
,
node_id
)
print
node_id
,
stationId
totalUnits
=
0
for
element
in
wip
:
numberOfUnits
=
element
.
get
(
'numberOfUnits'
,
0
)
totalUnits
+=
numberOfUnits
for
record
in
outPutSpreadsheet
:
print
record
if
record
[
0
]
==
stationId
:
print
'appending'
,
totalUnits
record
[
1
]
=
(
totalUnits
)
data
[
'result'
][
'result_list'
][
0
][
self
.
configuration_dict
[
'output_id'
]]
=
outPutSpreadsheet
return
data
# returns the next station that is a machine
def
getNextStation
(
self
,
data
,
bufferId
):
nodes
=
data
[
'graph'
][
'node'
]
current
=
bufferId
# find all the successors that may share batches
while
1
:
next
=
self
.
getSuccessors
(
data
,
current
)[
0
]
if
'Machine'
in
nodes
[
next
][
'_class'
]
or
'M3'
in
nodes
[
next
][
'_class'
]:
return
next
current
=
next
\ 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