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
6f210ee3
Commit
6f210ee3
authored
Feb 23, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remainingProcessingTime used instead of entry and exit
parent
3fb70d2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
36 deletions
+21
-36
dream/plugins/ReadJSWIP.py
dream/plugins/ReadJSWIP.py
+18
-28
dream/plugins/UpdateWIP.py
dream/plugins/UpdateWIP.py
+3
-8
No files found.
dream/plugins/ReadJSWIP.py
View file @
6f210ee3
...
...
@@ -3,12 +3,13 @@ import json
import
time
import
random
import
operator
from
datetime
import
datetime
import
datetime
import
copy
from
dream.plugins
import
plugin
from
dream.plugins.TimeSupport
import
TimeSupportMixin
class
ReadJSWIP
(
plugin
.
InputPreparationPlugin
):
class
ReadJSWIP
(
plugin
.
InputPreparationPlugin
,
TimeSupportMixin
):
""" Input preparation
reads the wip from the spreadsheet and inserts it to the BOM
"""
...
...
@@ -16,6 +17,16 @@ class ReadJSWIP(plugin.InputPreparationPlugin):
def
preprocess
(
self
,
data
):
""" inserts the wip as introduced in the GUI to the BOM
"""
strptime
=
datetime
.
datetime
.
strptime
# read the current date and define dateFormat from it
try
:
now
=
strptime
(
data
[
'general'
][
'currentDate'
],
'%Y/%m/%d %H:%M'
)
data
[
'general'
][
'dateFormat'
]
=
'%Y/%m/%d %H:%M'
except
ValueError
:
now
=
strptime
(
data
[
'general'
][
'currentDate'
],
'%Y/%m/%d'
)
data
[
'general'
][
'dateFormat'
]
=
'%Y/%m/%d'
self
.
initializeTimeSupport
(
data
)
WIPdata
=
data
[
"input"
].
get
(
"wip_spreadsheet"
,[])
workPlanData
=
data
[
"input"
].
get
(
"workplan_spreadsheet"
,[])
try
:
...
...
@@ -36,37 +47,16 @@ class ReadJSWIP(plugin.InputPreparationPlugin):
operatorID
=
WIPitem
[
4
]
sequence
=
WIPitem
[
1
]
WP_id
=
WIPitem
[
2
]
start
=
WIPitem
[
5
]
# end = WIPitem[6]
# start = WIPitem[5]
start
=
self
.
convertToSimulationTime
(
strptime
(
"%s %s"
%
(
data
[
'general'
][
'currentDate'
],
WIPitem
[
5
]),
'%Y/%m/%d %H:%M'
))
remainingProcessinTime
=
start
-
now
wip
[
partID
]
=
{
"task_id"
:
WP_id
,
"operator"
:
operatorID
,
"station"
:
stationID
,
"entry"
:
start
,
"exit"
:
end
,
"remainingProcessinTime"
:
remainingProcessing
,
"sequence"
:
sequence
}
return
data
'''
{
"name": "Part ID",
"type": "string"
}, {
"name": "Sequence",
"type": "string"
}, {
"name": "task ID",
"type": "string"
}, {
"name": "Station ID",
"type": "string"
}, {
"name": "Personnel ID",
"type": "string"
}, {
"name": "Start time",
"type": "string",
"format": "date-time"
}
'''
\ No newline at end of file
\ No newline at end of file
dream/plugins/UpdateWIP.py
View file @
6f210ee3
...
...
@@ -19,7 +19,6 @@ class UpdateWIP(plugin.InputPreparationPlugin):
def
preprocess
(
self
,
data
):
""" updates the Work in Process according to what is provided by the BOM, i.e. if a design just exited the last step of it's sequence
"""
currentTime
=
datetime
.
datetime
.
now
().
time
()
self
.
data
=
copy
(
data
)
orders
=
self
.
data
[
"input"
][
"BOM"
][
"orders"
]
nodes
=
self
.
data
[
"graph"
][
"node"
]
...
...
@@ -43,8 +42,7 @@ class UpdateWIP(plugin.InputPreparationPlugin):
work
=
wip
[
componentID
]
# # extract WIP information
workStation
=
work
[
"station"
]
entryTime
=
float
(
work
.
pop
(
"entry"
),
0
)
exitTime
=
float
(
work
.
pop
(
"exit"
,
0
))
remainingProcessingTime
=
float
(
work
.
get
(
"remainingProcessingTime"
,
0
))
task_id
=
work
[
"task_id"
]
assert
len
(
route
)
>
0
,
"the OrderComponent must have a route defined with length more than 0"
assert
task_id
,
"there must be a task_id defined for the OrderComponent in the WIP"
...
...
@@ -54,10 +52,7 @@ class UpdateWIP(plugin.InputPreparationPlugin):
last_step
=
step
break
# # check if the entity has left the station
# the entity is a machine if there is no exitTime
if
not
exitTime
:
# # calculate remaining processing time
remainingProcessingTime
=
currentTime
-
entryTime
if
remainingProcessingTime
:
currentStation
=
workStation
current_step
=
last_step
# the entity is in a buffer if the step_index is no larger than the length of the route
...
...
@@ -79,7 +74,7 @@ class UpdateWIP(plugin.InputPreparationPlugin):
wip
[
componentID
][
"station"
]
=
currentStation
wip
[
componentID
][
"sequence"
]
=
current_step
[
"sequence"
]
wip
[
componentID
][
"task_id"
]
=
current_step
[
"task_id"
]
if
not
exit
Time
:
if
remainingProcessing
Time
:
wip
[
componentID
][
"remainingProcessingTime"
]
=
{
"Fixed"
:
{
"mean"
:
remainingProcessingTime
}}
# if the entity is not recognized within the current WIP then check if it should be created
# first the flag designComplete and the completedComponents list must be updated
...
...
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