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
9cb118fe
Commit
9cb118fe
authored
Aug 26, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new plugin to output operator schedule in tabular format
parent
767f4ae9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
dream/plugins/JobShop/JSOperatorTabSchedule.py
dream/plugins/JobShop/JSOperatorTabSchedule.py
+63
-0
No files found.
dream/plugins/JobShop/JSOperatorTabSchedule.py
0 → 100644
View file @
9cb118fe
from
datetime
import
datetime
import
random
from
pprint
import
pformat
from
dream.plugins
import
plugin
from
dream.plugins.TimeSupport
import
TimeSupportMixin
import
datetime
from
copy
import
copy
'''outputs the Operator Schedules in tabular format'''
class
JSOperatorTabSchedule
(
plugin
.
OutputPreparationPlugin
,
TimeSupportMixin
):
def
postprocess
(
self
,
data
):
"""Post process Operator job schedules and formats to be presented in tabular format
"""
'''Time definition'''
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
)
'''reading results'''
for
result
in
data
[
'result'
][
'result_list'
]:
self
.
result
=
result
resultElements
=
result
[
'elementList'
]
# create the titles row
result
[
self
.
configuration_dict
[
'output_id'
]]
=
[[
'Operator'
,
'Job ID'
,
'Task ID'
,
'Station ID'
,
'Entrance Time'
,
'Exit Time'
,
]]
for
element
in
resultElements
:
if
element
.
get
(
"_class"
,
None
)
==
'Dream.Operator'
:
operatorId
=
element
.
get
(
'id'
,
None
)
print
operatorId
results
=
element
.
get
(
"results"
,
{})
schedule
=
results
.
get
(
"schedule"
,
[])
for
step
in
schedule
:
# entranceTime
entranceTime
=
step
.
get
(
"entranceTime"
,
None
)
exitTime
=
step
.
get
(
"exitTime"
,
None
)
entityId
=
step
.
get
(
"entityId"
,
None
)
stationId
=
step
.
get
(
"stationId"
,
None
)
task_id
=
step
.
get
(
"task_id"
,
None
)
if
stationId
!=
'off-shift'
:
result
[
self
.
configuration_dict
[
'output_id'
]].
append
([
operatorId
,
entityId
,
task_id
,
stationId
,
self
.
convertToFormattedRealWorldTime
(
entranceTime
),
self
.
convertToFormattedRealWorldTime
(
entranceTime
)
])
return
data
\ 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