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
b0e30256
Commit
b0e30256
authored
Mar 13, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JobShop post_proc gadgets now work on all different results
parent
69bab6d0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
278 additions
and
272 deletions
+278
-272
dream/plugins/JSComponentGantt.py
dream/plugins/JSComponentGantt.py
+61
-58
dream/plugins/JSComponentTabSchedule.py
dream/plugins/JSComponentTabSchedule.py
+53
-51
dream/plugins/JSOperatorGantt.py
dream/plugins/JSOperatorGantt.py
+55
-54
dream/plugins/JSOperatorUtilization.py
dream/plugins/JSOperatorUtilization.py
+49
-49
dream/plugins/JSStationUtilization.py
dream/plugins/JSStationUtilization.py
+60
-60
No files found.
dream/plugins/JSComponentGantt.py
View file @
b0e30256
...
...
@@ -27,63 +27,66 @@ class JSComponentGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
maxSimTime
=
data
[
'general'
][
'maxSimTime'
]
self
.
initializeTimeSupport
(
data
)
date_format
=
'%d-%m-%Y %H:%M'
resultElements
=
data
[
'result'
][
'result_list'
][
-
1
][
'elementList'
]
task_dict
=
{}
# loop in the results to find Operators
for
element
in
resultElements
:
if
element
[
'_class'
]
in
self
.
COMPONENT_CLASS_SET
:
componentId
=
element
[
'id'
]
# add the component in the task_dict
task_dict
[
element
[
'id'
]]
=
dict
(
id
=
componentId
,
text
=
componentId
,
type
=
'component'
,
open
=
False
)
k
=
1
schedule
=
element
[
'results'
].
get
(
'schedule'
,
[])
if
schedule
:
for
record
in
schedule
:
stationId
=
record
[
'stationId'
]
stationClass
=
data
[
"graph"
][
"node"
][
stationId
][
"_class"
]
entranceTime
=
record
[
'entranceTime'
]
taskId
=
record
.
get
(
"task_id"
,
None
)
# text to be displayed (if there is no task id display just the stationId)
if
not
taskId
:
task_to_display
=
record
[
'stationId'
]
else
:
task_to_display
=
taskId
+
"; "
+
record
[
'stationId'
]
# get the exitTime from the record
exitTime
=
record
.
get
(
"exitTime"
,
None
)
if
exitTime
==
None
:
# if there is no exitTime get it from the entranceTime of the next step
try
:
exitTime
=
schedule
[
k
][
'entranceTime'
]
# if there is no next step
except
IndexError
:
exitTime
=
maxSimTime
k
+=
1
if
stationClass
in
self
.
STATION_CLASS_SET
:
task_dict
[
componentId
+
record
[
'stationId'
]
+
str
(
k
)]
=
dict
(
id
=
componentId
+
record
[
'stationId'
]
+
str
(
k
),
parent
=
componentId
,
text
=
task_to_display
,
#record['stationId']+"; "+taskId,
start_date
=
self
.
convertToRealWorldTime
(
entranceTime
).
strftime
(
date_format
),
stop_date
=
self
.
convertToRealWorldTime
(
exitTime
).
strftime
(
date_format
),
open
=
False
,
entranceTime
=
entranceTime
,
duration
=
exitTime
-
entranceTime
,
)
# return the result to the gadget
result
=
data
[
'result'
][
'result_list'
][
-
1
]
result
[
self
.
configuration_dict
[
'output_id'
]]
=
dict
(
time_unit
=
self
.
getTimeUnitText
(),
task_list
=
sorted
(
task_dict
.
values
(),
key
=
lambda
task
:
(
task
.
get
(
'parent'
),
task
.
get
(
'type'
)
==
'project'
,
task
.
get
(
'entranceTime'
),
task
.
get
(
'id'
))))
'''read the results'''
for
result
in
data
[
'result'
][
'result_list'
]:
resultElements
=
result
[
'elementList'
]
task_dict
=
{}
# loop in the results to find Operators
for
element
in
resultElements
:
if
element
[
'_class'
]
in
self
.
COMPONENT_CLASS_SET
:
componentId
=
element
[
'id'
]
# add the component in the task_dict
task_dict
[
element
[
'id'
]]
=
dict
(
id
=
componentId
,
text
=
componentId
,
type
=
'component'
,
open
=
False
)
k
=
1
schedule
=
element
[
'results'
].
get
(
'schedule'
,
[])
if
schedule
:
for
record
in
schedule
:
stationId
=
record
[
'stationId'
]
stationClass
=
data
[
"graph"
][
"node"
][
stationId
][
"_class"
]
entranceTime
=
record
[
'entranceTime'
]
taskId
=
record
.
get
(
"task_id"
,
None
)
# text to be displayed (if there is no task id display just the stationId)
if
not
taskId
:
task_to_display
=
record
[
'stationId'
]
else
:
task_to_display
=
taskId
+
"; "
+
record
[
'stationId'
]
# get the exitTime from the record
exitTime
=
record
.
get
(
"exitTime"
,
None
)
if
exitTime
==
None
:
# if there is no exitTime get it from the entranceTime of the next step
try
:
exitTime
=
schedule
[
k
][
'entranceTime'
]
# if there is no next step
except
IndexError
:
exitTime
=
maxSimTime
k
+=
1
if
stationClass
in
self
.
STATION_CLASS_SET
:
task_dict
[
componentId
+
record
[
'stationId'
]
+
str
(
k
)]
=
dict
(
id
=
componentId
+
record
[
'stationId'
]
+
str
(
k
),
parent
=
componentId
,
text
=
task_to_display
,
#record['stationId']+"; "+taskId,
start_date
=
self
.
convertToRealWorldTime
(
entranceTime
).
strftime
(
date_format
),
stop_date
=
self
.
convertToRealWorldTime
(
exitTime
).
strftime
(
date_format
),
open
=
False
,
entranceTime
=
entranceTime
,
duration
=
exitTime
-
entranceTime
,
)
# return the result to the gadget
result
[
self
.
configuration_dict
[
'output_id'
]]
=
dict
(
time_unit
=
self
.
getTimeUnitText
(),
task_list
=
sorted
(
task_dict
.
values
(),
key
=
lambda
task
:
(
task
.
get
(
'parent'
),
task
.
get
(
'type'
)
==
'project'
,
task
.
get
(
'entranceTime'
),
task
.
get
(
'id'
))))
return
data
dream/plugins/JSComponentTabSchedule.py
View file @
b0e30256
...
...
@@ -24,7 +24,7 @@ class JSComponentTabSchedule(plugin.OutputPreparationPlugin, TimeSupportMixin):
'''returns the id of the operator that has performed a certain task'''
# XXX searching in the last solution only
# XXX synchronize with the solution that is used by postprocess method
resultElements
=
self
.
data
[
'result'
][
'result_list'
][
-
1
]
[
'elementList'
]
resultElements
=
self
.
result
[
'elementList'
]
for
element
in
resultElements
:
if
element
.
get
(
"_class"
,
None
)
in
self
.
OPERATOR_CLASS_SET
:
schedule
=
element
[
"results"
].
get
(
"schedule"
,
[])
...
...
@@ -38,7 +38,7 @@ class JSComponentTabSchedule(plugin.OutputPreparationPlugin, TimeSupportMixin):
STATION_CLASS_SET
=
set
([
"Dream.MouldAssembly"
,
"Dream.MachineJobShop"
])
def
isActiveStation
(
self
,
ID
):
'''returns True if station is an active station'''
resultElements
=
self
.
data
[
'result'
][
'result_list'
][
-
1
]
[
'elementList'
]
resultElements
=
self
.
result
[
'elementList'
]
for
element
in
resultElements
:
if
element
.
get
(
"_class"
,
None
)
in
self
.
STATION_CLASS_SET
:
if
element
.
get
(
"id"
,
None
)
==
ID
:
...
...
@@ -63,54 +63,56 @@ class JSComponentTabSchedule(plugin.OutputPreparationPlugin, TimeSupportMixin):
data
[
'general'
][
'dateFormat'
]
=
'%Y/%m/%d'
self
.
initializeTimeSupport
(
data
)
date_format
=
'%d-%m-%Y %H:%M'
'''reading results'''
resultElements
=
data
[
'result'
][
'result_list'
][
-
1
][
'elementList'
]
# create the titles row
result
=
data
[
'result'
][
'result_list'
][
-
1
]
result
[
self
.
configuration_dict
[
'output_id'
]]
=
[[
'Job ID'
,
'Order'
,
'Due Date'
,
'Task ID'
,
'Station ID'
,
'Entrance Time'
,
'Processing Time'
,
'Operator'
]]
for
element
in
resultElements
:
if
element
.
get
(
"_class"
,
None
)
in
self
.
COMPONENT_CLASS_SET
:
elementId
=
element
.
get
(
"id"
,
None
)
order
=
self
.
findParentOrderById
(
elementId
)
# due date
dueDate
=
order
.
get
(
"dueDate"
,
None
)
# order
orderName
=
order
.
get
(
"name"
,
None
)
'''schedule'''
results
=
element
.
get
(
"results"
,
{})
schedule
=
results
.
get
(
"schedule"
,
[])
if
schedule
:
for
step
in
schedule
:
# entranceTime
entranceTime
=
step
.
get
(
"entranceTime"
,
None
)
exitTime
=
step
.
get
(
"exitTime"
,
None
)
# processing time
processingTime
=
0
if
exitTime
!=
None
:
processingTime
=
round
(
exitTime
-
entranceTime
,
2
)
# stationId
stationId
=
step
.
get
(
"stationId"
,
None
)
# task_id
task_id
=
step
.
get
(
"task_id"
,
None
)
# operator
operatorId
=
""
if
self
.
isActiveStation
(
stationId
):
operatorId
=
self
.
findOperatorByTaskId
(
task_id
)
# if there is a taskId defined or the station is an assembly station (order decomposition is presented)
if
task_id
or
stationId
.
startswith
(
"ASSM"
):
result
[
self
.
configuration_dict
[
'output_id'
]].
append
([
elementId
,
orderName
,
self
.
convertToFormattedRealWorldTime
(
dueDate
),
task_id
,
stationId
,
self
.
convertToFormattedRealWorldTime
(
entranceTime
),
processingTime
,
operatorId
])
for
result
in
data
[
'result'
][
'result_list'
]:
self
.
result
=
result
resultElements
=
result
[
'elementList'
]
# create the titles row
result
[
self
.
configuration_dict
[
'output_id'
]]
=
[[
'Job ID'
,
'Order'
,
'Due Date'
,
'Task ID'
,
'Station ID'
,
'Entrance Time'
,
'Processing Time'
,
'Operator'
]]
for
element
in
resultElements
:
if
element
.
get
(
"_class"
,
None
)
in
self
.
COMPONENT_CLASS_SET
:
elementId
=
element
.
get
(
"id"
,
None
)
order
=
self
.
findParentOrderById
(
elementId
)
# due date
dueDate
=
order
.
get
(
"dueDate"
,
None
)
# order
orderName
=
order
.
get
(
"name"
,
None
)
'''schedule'''
results
=
element
.
get
(
"results"
,
{})
schedule
=
results
.
get
(
"schedule"
,
[])
if
schedule
:
for
step
in
schedule
:
# entranceTime
entranceTime
=
step
.
get
(
"entranceTime"
,
None
)
exitTime
=
step
.
get
(
"exitTime"
,
None
)
# processing time
processingTime
=
0
if
exitTime
!=
None
:
processingTime
=
round
(
exitTime
-
entranceTime
,
2
)
# stationId
stationId
=
step
.
get
(
"stationId"
,
None
)
# task_id
task_id
=
step
.
get
(
"task_id"
,
None
)
# operator
operatorId
=
""
if
self
.
isActiveStation
(
stationId
):
operatorId
=
self
.
findOperatorByTaskId
(
task_id
)
# if there is a taskId defined or the station is an assembly station (order decomposition is presented)
if
task_id
or
stationId
.
startswith
(
"ASSM"
):
result
[
self
.
configuration_dict
[
'output_id'
]].
append
([
elementId
,
orderName
,
self
.
convertToFormattedRealWorldTime
(
dueDate
),
task_id
,
stationId
,
self
.
convertToFormattedRealWorldTime
(
entranceTime
),
processingTime
,
operatorId
])
return
data
dream/plugins/JSOperatorGantt.py
View file @
b0e30256
...
...
@@ -23,62 +23,63 @@ class JSOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
maxSimTime
=
data
[
'general'
][
'maxSimTime'
]
self
.
initializeTimeSupport
(
data
)
date_format
=
'%d-%m-%Y %H:%M'
resultElements
=
data
[
'result'
][
'result_list'
][
-
1
][
'elementList'
]
task_dict
=
{}
# loop in the results to find Operators
for
element
in
resultElements
:
if
element
[
'_class'
]
in
self
.
OPERATOR_CLASS_SET
:
operatorId
=
element
[
'id'
]
k
=
1
schedule
=
element
[
'results'
].
get
(
'schedule'
,
[])
if
schedule
:
for
result
in
data
[
'result'
][
'result_list'
]:
resultElements
=
result
[
'elementList'
]
task_dict
=
{}
# loop in the results to find Operators
for
element
in
resultElements
:
if
element
[
'_class'
]
in
self
.
OPERATOR_CLASS_SET
:
operatorId
=
element
[
'id'
]
k
=
1
schedule
=
element
[
'results'
].
get
(
'schedule'
,
[])
if
schedule
:
# add the operator in the task_dict
task_dict
[
element
[
'id'
]]
=
dict
(
id
=
operatorId
,
text
=
operatorId
,
type
=
'operator'
,
open
=
False
)
# add the operator in the task_dict
task_dict
[
element
[
'id'
]]
=
dict
(
id
=
operatorId
,
text
=
operatorId
,
type
=
'operator'
,
open
=
False
)
for
record
in
schedule
:
entranceTime
=
record
[
'entranceTime'
]
exitTime
=
record
.
get
(
"exitTime"
,
None
)
if
not
exitTime
:
try
:
exitTime
=
schedule
[
k
][
'entranceTime'
]
except
IndexError
:
exitTime
=
maxSimTime
k
+=
1
task_id
=
record
.
get
(
"task_id"
,
None
)
if
not
task_id
:
task_id
=
record
[
"stationId"
]
text_to_display
=
task_id
else
:
entityId
=
record
.
get
(
"entityId"
,
None
)
if
not
entityId
:
text_to_display
=
task_id
+
" "
+
record
[
"stationId"
]
for
record
in
schedule
:
entranceTime
=
record
[
'entranceTime'
]
exitTime
=
record
.
get
(
"exitTime"
,
None
)
if
not
exitTime
:
try
:
exitTime
=
schedule
[
k
][
'entranceTime'
]
except
IndexError
:
exitTime
=
maxSimTime
k
+=
1
task_id
=
record
.
get
(
"task_id"
,
None
)
if
not
task_id
:
task_id
=
record
[
"stationId"
]
text_to_display
=
task_id
else
:
text_to_display
=
task_id
+
" "
+
record
[
"stationId"
]
+
" "
+
entityId
task_dict
[
operatorId
+
task_id
+
str
(
k
)]
=
dict
(
id
=
operatorId
+
task_id
+
str
(
k
),
parent
=
operatorId
,
text
=
text_to_display
,
start_date
=
self
.
convertToRealWorldTime
(
entranceTime
).
strftime
(
date_format
),
stop_date
=
self
.
convertToRealWorldTime
(
exitTime
).
strftime
(
date_format
),
open
=
False
,
entranceTime
=
entranceTime
,
duration
=
exitTime
-
entranceTime
,
)
# return the result to the gadget
result
=
data
[
'result'
][
'result_list'
][
-
1
]
result
[
self
.
configuration_dict
[
'output_id'
]]
=
dict
(
time_unit
=
self
.
getTimeUnitText
(),
task_list
=
sorted
(
task_dict
.
values
(),
key
=
lambda
task
:
(
task
.
get
(
'parent'
),
task
.
get
(
'type'
)
==
'project'
,
task
.
get
(
'entranceTime'
),
task
.
get
(
'id'
))))
entityId
=
record
.
get
(
"entityId"
,
None
)
if
not
entityId
:
text_to_display
=
task_id
+
" "
+
record
[
"stationId"
]
else
:
text_to_display
=
task_id
+
" "
+
record
[
"stationId"
]
+
" "
+
entityId
task_dict
[
operatorId
+
task_id
+
str
(
k
)]
=
dict
(
id
=
operatorId
+
task_id
+
str
(
k
),
parent
=
operatorId
,
text
=
text_to_display
,
start_date
=
self
.
convertToRealWorldTime
(
entranceTime
).
strftime
(
date_format
),
stop_date
=
self
.
convertToRealWorldTime
(
exitTime
).
strftime
(
date_format
),
open
=
False
,
entranceTime
=
entranceTime
,
duration
=
exitTime
-
entranceTime
,
)
# return the result to the gadget
result
[
self
.
configuration_dict
[
'output_id'
]]
=
dict
(
time_unit
=
self
.
getTimeUnitText
(),
task_list
=
sorted
(
task_dict
.
values
(),
key
=
lambda
task
:
(
task
.
get
(
'parent'
),
task
.
get
(
'type'
)
==
'project'
,
task
.
get
(
'entranceTime'
),
task
.
get
(
'id'
))))
return
data
dream/plugins/JSOperatorUtilization.py
View file @
b0e30256
...
...
@@ -7,61 +7,61 @@ class JSOperatorUtilization(plugin.OutputPreparationPlugin):
# XXX hardcoded values
JS_OPERATOR_CLASS_SET
=
set
([
"Dream.Operator"
])
def
postprocess
(
self
,
data
):
result
=
data
[
'result'
][
'result_list'
][
-
1
]
for
result
in
data
[
'result'
][
'result_list'
]:
ticks
=
[]
working_data
=
[]
waiting_data
=
[]
failure_data
=
[]
blockage_data
=
[]
off_shift_data
=
[]
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"
options
=
{
"xaxis"
:
{
"minTickSize"
:
1
,
"ticks"
:
ticks
},
"stack"
:
True
"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"
:
"off_shift"
,
"data"
:
off_shift_data
}];
series
=
[{
"label"
:
"Working"
,
"data"
:
working_data
},
{
"label"
:
"Waiting"
,
"data"
:
waiting_data
},
{
"label"
:
"off_shift"
,
"data"
:
off_shift_data
}];
out
=
result
[
self
.
configuration_dict
[
'output_id'
]]
=
{
"series"
:
series
,
"options"
:
options
}
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_OPERATOR_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
[
'off_shift_ratio'
]:
off_shift_data
.
append
((
i
,
objResults
[
'off_shift_ratio'
][
0
]))
i
=
0
for
obj
in
result
[
'elementList'
]:
if
obj
.
get
(
'_class'
)
in
self
.
JS_OPERATOR_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
[
'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
ticks
.
append
((
i
,
obj
.
get
(
'name'
,
self
.
getNameFromId
(
data
,
obj
[
'id'
]))))
i
+=
1
return
data
dream/plugins/JSStationUtilization.py
View file @
b0e30256
...
...
@@ -7,72 +7,72 @@ class JSStationUtilization(plugin.OutputPreparationPlugin):
# XXX hardcoded values
JS_STATION_CLASS_SET
=
set
([
"Dream.MouldAssembly"
,
"Dream.MachineJobShop"
])
def
postprocess
(
self
,
data
):
result
=
data
[
'result'
][
'result_list'
][
-
1
]
for
result
in
data
[
'result'
][
'result_list'
]:
ticks
=
[]
working_data
=
[]
waiting_data
=
[]
failure_data
=
[]
blockage_data
=
[]
off_shift_data
=
[]
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"
options
=
{
"xaxis"
:
{
"minTickSize"
:
1
,
"ticks"
:
ticks
},
"yaxis"
:
{
"max"
:
100
},
"stack"
:
True
"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
}];
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
}
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
]))
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
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