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
e520ec13
Commit
e520ec13
authored
Feb 27, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new post-process plugin for JobShop station-utilization graph
parent
4bcddfe4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
0 deletions
+78
-0
dream/plugins/JSStationUtilization.py
dream/plugins/JSStationUtilization.py
+78
-0
No files found.
dream/plugins/JSStationUtilization.py
0 → 100644
View file @
e520ec13
from
dream.plugins
import
plugin
from
copy
import
copy
class
JSStationUtilization
(
plugin
.
OutputPreparationPlugin
):
""" Output the station utilization metrics in a format compatible with
"""
# XXX hardcoded values
JS_STATION_CLASS_SET
=
set
([
"Dream.MouldAssembly"
,
"Dream.MachineJobShop"
])
def
postprocess
(
self
,
data
):
result
=
data
[
'result'
][
'result_list'
][
-
1
]
ticks
=
[]
working_data
=
[]
waiting_data
=
[]
failure_data
=
[]
blockage_data
=
[]
off_shift_data
=
[]
options
=
{
"xaxis"
:
{
"minTickSize"
:
1
,
"ticks"
:
ticks
},
"yaxis"
:
{
"max"
:
100
},
"series"
:
{
"bars"
:
{
"show"
:
True
,
"barWidth"
:
0.8
,
"align"
:
"center"
},
"stack"
:
True
}
}
series
=
[{
"label"
:
"Working"
,
"data"
:
working_data
},
{
"label"
:
"Waiting"
,
"data"
:
waiting_data
},
{
"label"
:
"Failures"
,
"data"
:
failure_data
},
{
"label"
:
"Blockage"
,
"data"
:
blockage_data
},
{
"label"
:
"off_shift"
,
"data"
:
off_shift_data
}];
out
=
result
[
self
.
configuration_dict
[
'output_id'
]]
=
{
"series"
:
series
,
"options"
:
options
}
i
=
0
for
obj
in
result
[
'elementList'
]:
if
obj
.
get
(
'_class'
)
in
self
.
JS_STATION_CLASS_SET
:
objResults
=
copy
(
obj
[
'results'
])
if
objResults
[
'working_ratio'
]:
working_data
.
append
((
i
,
objResults
[
'working_ratio'
][
0
]))
if
objResults
[
'waiting_ratio'
]:
waiting_data
.
append
((
i
,
objResults
[
'waiting_ratio'
][
0
]))
if
objResults
[
'failure_ratio'
]:
failure_data
.
append
((
i
,
objResults
[
'failure_ratio'
][
0
]))
if
objResults
[
'blockage_ratio'
]:
blockage_data
.
append
((
i
,
objResults
[
'blockage_ratio'
][
0
]))
if
objResults
[
'off_shift_ratio'
]:
off_shift_data
.
append
((
i
,
objResults
[
'off_shift_ratio'
][
0
]))
ticks
.
append
((
i
,
obj
.
get
(
'name'
,
self
.
getNameFromId
(
data
,
obj
[
'id'
]))))
i
+=
1
return
data
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