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
e535e39b
Commit
e535e39b
authored
Aug 25, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin to handle wip also for stations that are not in the beginning
parent
eb1f2147
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
16 deletions
+20
-16
dream/plugins/CapacityStations/ChangeWIPSpreadsheet.py
dream/plugins/CapacityStations/ChangeWIPSpreadsheet.py
+20
-16
No files found.
dream/plugins/CapacityStations/ChangeWIPSpreadsheet.py
View file @
e535e39b
...
...
@@ -14,7 +14,6 @@ class ChangeWIPSpreadsheet(plugin.InputPreparationPlugin):
wipColumn
=
i
break
i
+=
1
from
pprint
import
pprint
if
projectData
:
alreadyConsideredProjects
=
[]
for
row
in
range
(
1
,
len
(
projectData
)):
...
...
@@ -40,34 +39,39 @@ class ChangeWIPSpreadsheet(plugin.InputPreparationPlugin):
requiredCapacity
=
float
(
projectData
[
row
+
stationRecord
][
5
])
completedCapacityDict
[
stationId
]
=
completedCapacity
requiredCapacityDict
[
stationId
]
=
requiredCapacity
# print '------------',projectId
# pprint(completedCapacityDict)
wipDict
=
self
.
calculateWIPDict
(
data
,
completedCapacityDict
,
requiredCapacityDict
)
print
'------------'
,
projectId
for
stationRecord
in
range
(
numberOfOperations
):
stationId
=
projectData
[
row
+
stationRecord
][
4
]
projectData
[
row
+
stationRecord
][
wipColumn
]
=
wipDict
[
stationId
]
pprint
(
wipDict
)
return
data
# gets the dict that shows the completed capacities and returns the one with the actual wip
def
calculateWIPDict
(
self
,
data
,
completedCapacityDict
,
requiredCapacityDict
):
wipDict
=
{}
for
stationId
,
completedCapacity
in
completedCapacityDict
.
iteritems
():
if
self
.
checkIfStationIsFirst
(
data
,
stationId
):
previous
=
self
.
getPredecessors
(
data
,
stationId
)
if
previous
:
# if the station is assembly
if
len
(
previous
)
>
1
:
if
completedCapacityDict
[
stationId
]:
wipDict
[
stationId
]
=
requiredCapacityDict
[
stationId
]
-
completedCapacityDict
[
stationId
]
else
:
readyForAssembly
=
True
for
previousId
in
previous
:
if
requiredCapacityDict
[
previousId
]
>
completedCapacityDict
[
previousId
]:
readyForAssembly
=
False
wipDict
[
stationId
]
=
0
if
readyForAssembly
:
wipDict
[
stationId
]
=
requiredCapacityDict
[
stationId
]
else
:
previousId
=
previous
[
0
]
completedFromPrevious
=
completedCapacityDict
[
previousId
]
transferRate
=
requiredCapacityDict
[
stationId
]
/
float
(
requiredCapacityDict
[
previousId
])
wipDict
[
stationId
]
=
(
transferRate
*
completedFromPrevious
)
-
completedCapacityDict
[
stationId
]
else
:
wipDict
[
stationId
]
=
requiredCapacityDict
[
stationId
]
-
completedCapacityDict
[
stationId
]
return
wipDict
# returns True if the station has no predecessors
def
checkIfStationIsFirst
(
self
,
data
,
stationId
):
previous
=
self
.
getPredecessors
(
data
,
stationId
)
if
previous
:
return
False
return
True
\ 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