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
32e0f392
Commit
32e0f392
authored
Feb 25, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correction in plugin
parent
79fabc97
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
dream/plugins/BatchesOperatorGantt.py
dream/plugins/BatchesOperatorGantt.py
+17
-11
No files found.
dream/plugins/BatchesOperatorGantt.py
View file @
32e0f392
...
...
@@ -28,11 +28,11 @@ class BatchesOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
# loop in the results to find Operators
colorList
=
[
'blue'
,
'green'
,
'red'
,
'gold'
,
'black'
,
'
white
'
,
'gold'
,
'black'
,
'
Aqua
'
,
'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'
]
...
...
@@ -43,7 +43,9 @@ class BatchesOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
i
+=
1
if
i
==
len
(
colorList
):
i
=
0
# set off-shift color to white
colorDict
[
'off-shift'
]
=
'white'
for
element
in
resultElements
:
if
element
[
'_class'
]
==
"Dream.Operator"
:
operatorId
=
element
[
'id'
]
...
...
@@ -55,23 +57,27 @@ class BatchesOperatorGantt(plugin.OutputPreparationPlugin, TimeSupportMixin):
open
=
False
)
schedule
=
copy
(
element
[
'results'
][
'schedule'
])
schedule
=
copy
(
element
[
'results'
][
'schedule'
])
# in the cases the operator exits and the enters in the same station merge those records
k
=
0
for
record
in
schedule
:
for
nextRecord
in
schedule
[
k
+
1
:]:
if
nextRecord
[
'stationId'
]
==
record
[
'stationId'
]
and
not
record
is
schedule
[
-
1
]:
if
nextRecord
[
'stationId'
]
==
record
[
'stationId'
]
\
and
nextRecord
[
'entranceTime'
]
==
record
[
'exitTime'
]
\
and
not
record
is
schedule
[
-
1
]:
nextExitTime
=
nextRecord
.
get
(
'exitTime'
,
maxSimTime
)
record
[
'exitTime'
]
=
nextExitTime
schedule
.
remove
(
nextRecord
)
else
:
continue
k
+=
1
#
print schedule
k
+=
1
#
loop though the records
k
=
1
for
record
in
schedule
:
entranceTime
=
record
[
'entranceTime'
]
try
:
exitTime
=
schedule
[
k
][
'entranceTime'
]
except
IndexError
:
exitTime
=
maxSimTime
exitTime
=
record
.
get
(
'exitTime'
,
None
)
if
not
exitTime
:
exitTime
=
maxSimTime
k
+=
1
task_dict
[
operatorId
+
record
[
'stationId'
]
+
str
(
k
)]
=
dict
(
id
=
operatorId
+
record
[
'stationId'
]
+
str
(
k
),
...
...
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