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
5246bfae
Commit
5246bfae
authored
Feb 10, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrections in plugins
parent
054e5c95
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
39 deletions
+42
-39
dream/plugins/AvailableCapacitySpreadsheet.py
dream/plugins/AvailableCapacitySpreadsheet.py
+5
-3
dream/plugins/CapacityStationWIPSpreadsheet.py
dream/plugins/CapacityStationWIPSpreadsheet.py
+37
-36
No files found.
dream/plugins/AvailableCapacitySpreadsheet.py
View file @
5246bfae
...
...
@@ -18,12 +18,13 @@ class AvailableCapacitySpreadsheet(plugin.InputPreparationPlugin):
node
=
data
[
'graph'
][
'node'
]
now
=
strptime
(
data
[
'general'
][
'currentDate'
],
'%Y/%m/%d'
)
if
capacityData
:
numberOfStations
=
len
(
capacityData
[
0
])
-
1
numberOf
Exceptions
=
len
(
capacityData
)
# get the number of stations
numberOf
Stations
=
len
([
st
for
st
in
capacityData
[
0
]
if
(
st
and
not
st
==
'DAY'
)]
)
# loop through stations
for
col
in
range
(
numberOfStations
):
stationId
=
capacityData
[
0
][
col
+
1
]
assert
stationId
in
data
[
'graph'
][
'node'
].
keys
(),
'available capacity spreadsheet has station id that does not exist in production line'
assert
stationId
in
data
[
'graph'
][
'node'
].
keys
(),
(
'available capacity spreadsheet has station id:'
,
stationId
,
'that does not exist in production line'
)
# for every station read the interval capacity (Monday to Sunday)
intervalCapacity
=
[]
for
row
in
range
(
7
):
...
...
@@ -31,6 +32,7 @@ class AvailableCapacitySpreadsheet(plugin.InputPreparationPlugin):
node
[
stationId
][
'intervalCapacity'
]
=
intervalCapacity
# for every station read the interval capacity exceptions
for
row
in
range
(
8
,
len
(
capacityData
)):
# at the first empty line break
if
not
capacityData
[
row
][
0
]:
break
exeptionDate
=
strptime
(
capacityData
[
row
][
0
],
'%Y/%m/%d'
)
...
...
dream/plugins/CapacityStationWIPSpreadsheet.py
View file @
5246bfae
...
...
@@ -16,42 +16,43 @@ class CapacityStationWIPSpreadsheet(plugin.InputPreparationPlugin):
""" Set the WIP in queue from spreadsheet data.
"""
wipData
=
data
[
'input'
].
get
(
'wip_spreadsheet'
,
None
)
node
=
data
[
'graph'
][
'node'
]
# create an empty wip list in all CapacityStationBuffers
for
(
node_id
,
node_data
)
in
node
.
iteritems
():
if
node_data
[
'_class'
]
==
'dream.simulation.applications.CapacityStations.CapacityStationBuffer.CapacityStationBuffer'
:
node_data
[
'wip'
]
=
[]
# get the number of projects
numberOfProjects
=
0
for
col
in
range
(
1
,
len
(
wipData
[
0
])):
if
wipData
[
0
][
col
]:
numberOfProjects
+=
1
else
:
break
# get the number of operations
numberOfOperations
=
0
for
row
in
range
(
1
,
len
(
wipData
)):
if
wipData
[
row
][
0
]:
numberOfOperations
+=
1
else
:
break
# loop through all the columns>0
for
col
in
range
(
1
,
numberOfProjects
+
1
):
projectId
=
wipData
[
0
][
col
]
# loop through all the rows>0
for
row
in
range
(
1
,
numberOfProjects
+
1
):
stationId
=
wipData
[
row
][
0
]
assert
stationId
in
node
.
keys
(),
'wip spreadsheet has station id that does not exist in production line'
requiredCapacity
=
wipData
[
row
][
col
]
# if the cell has a requiredCapacity>0 create the entity
if
requiredCapacity
:
buffer
=
self
.
getBuffer
(
data
,
stationId
)
data
[
'graph'
][
'node'
][
buffer
][
'wip'
].
append
({
"_class"
:
"dream.simulation.applications.CapacityStations.CapacityEntity.CapacityEntity"
,
"requiredCapacity"
:
float
(
requiredCapacity
),
"capacityProjectId"
:
projectId
,
"name"
:
projectId
+
'_'
+
stationId
+
'_'
+
str
(
requiredCapacity
)
})
if
wipData
:
node
=
data
[
'graph'
][
'node'
]
# create an empty wip list in all CapacityStationBuffers
for
(
node_id
,
node_data
)
in
node
.
iteritems
():
if
node_data
[
'_class'
]
==
'dream.simulation.applications.CapacityStations.CapacityStationBuffer.CapacityStationBuffer'
:
node_data
[
'wip'
]
=
[]
# get the number of projects
numberOfProjects
=
0
for
col
in
range
(
1
,
len
(
wipData
[
0
])):
if
wipData
[
0
][
col
]:
numberOfProjects
+=
1
else
:
break
# get the number of operations
numberOfOperations
=
0
for
row
in
range
(
1
,
len
(
wipData
)):
if
wipData
[
row
][
0
]:
numberOfOperations
+=
1
else
:
break
# loop through all the columns>0
for
col
in
range
(
1
,
numberOfProjects
+
1
):
projectId
=
wipData
[
0
][
col
]
# loop through all the rows>0
for
row
in
range
(
1
,
numberOfProjects
+
1
):
stationId
=
wipData
[
row
][
0
]
assert
stationId
in
node
.
keys
(),
'wip spreadsheet has station id that does not exist in production line'
requiredCapacity
=
wipData
[
row
][
col
]
# if the cell has a requiredCapacity>0 create the entity
if
requiredCapacity
:
buffer
=
self
.
getBuffer
(
data
,
stationId
)
data
[
'graph'
][
'node'
][
buffer
][
'wip'
].
append
({
"_class"
:
"dream.simulation.applications.CapacityStations.CapacityEntity.CapacityEntity"
,
"requiredCapacity"
:
float
(
requiredCapacity
),
"capacityProjectId"
:
projectId
,
"name"
:
projectId
+
'_'
+
stationId
+
'_'
+
str
(
requiredCapacity
)
})
return
data
# gets the data and the station id and returns the buffer id of this station
...
...
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