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
cf0ac062
Commit
cf0ac062
authored
Feb 25, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
different color for every machine the the operator has to visit
parent
7a513746
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
dream/plugins/BatchesOperatorGantt.py
dream/plugins/BatchesOperatorGantt.py
+19
-0
No files found.
dream/plugins/BatchesOperatorGantt.py
View file @
cf0ac062
...
@@ -25,6 +25,24 @@ class BatchesOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
...
@@ -25,6 +25,24 @@ class BatchesOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
resultElements
=
data
[
'result'
][
'result_list'
][
-
1
][
'elementList'
]
resultElements
=
data
[
'result'
][
'result_list'
][
-
1
][
'elementList'
]
task_dict
=
{}
task_dict
=
{}
# loop in the results to find Operators
# loop in the results to find Operators
colorList
=
[
'blue'
,
'green'
,
'red'
,
'gold'
,
'black'
,
'white'
,
'DarkRed'
,
'Fuchsia'
,
'Gray'
,
'magenta'
,
'yellow'
,
'Olive'
,
'orange'
,
'purple'
,
'pink'
]
# create a dictionary so that all stations have their own color
colorDict
=
{}
nodes
=
data
[
'graph'
][
'node'
]
i
=
0
for
node_id
,
node
in
nodes
.
iteritems
():
if
node
[
'_class'
].
startswith
(
'Dream.BatchScrapMachine'
)
or
node
[
'_class'
]
==
'Dream.M3'
:
colorDict
[
node_id
]
=
colorList
[
i
]
i
+=
1
if
i
==
len
(
colorList
):
i
=
0
for
element
in
resultElements
:
for
element
in
resultElements
:
if
element
[
'_class'
]
==
"Dream.Operator"
:
if
element
[
'_class'
]
==
"Dream.Operator"
:
operatorId
=
element
[
'id'
]
operatorId
=
element
[
'id'
]
...
@@ -55,6 +73,7 @@ class BatchesOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
...
@@ -55,6 +73,7 @@ class BatchesOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
open
=
False
,
open
=
False
,
entranceTime
=
entranceTime
,
entranceTime
=
entranceTime
,
duration
=
exitTime
-
entranceTime
,
duration
=
exitTime
-
entranceTime
,
color
=
colorDict
[
record
[
'stationId'
]]
)
)
# return the result to the gadget
# return the result to the gadget
...
...
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