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
f8009276
Commit
f8009276
authored
Mar 03, 2015
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new Plugin that prepares schedule of each component to be presented in tabular format
parent
720c4dc7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
0 deletions
+73
-0
dream/plugins/JSComponentTabSchedule.py
dream/plugins/JSComponentTabSchedule.py
+73
-0
No files found.
dream/plugins/JSComponentTabSchedule.py
0 → 100644
View file @
f8009276
from
datetime
import
datetime
import
random
from
pprint
import
pformat
from
dream.plugins
import
plugin
from
dream.plugins.TimeSupport
import
TimeSupportMixin
import
datetime
class
JSComponentTabSchedule
(
plugin
.
OutputPreparationPlugin
,
TimeSupportMixin
):
'''outputs the Job Schedules in tabular format'''
# XXX hard-coded; class of the order components
COMPONENT_CLASS_SET
=
set
([
"Dream.Mould"
,
"Dream.OrderComponent"
,
"Dream.OrderDesign"
])
def
postprocess
(
self
,
data
):
"""Post process the job schedules and formats to be presented in tabular format
"""
numberOfReplications
=
int
(
data
[
'general'
][
'numberOfReplications'
])
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
)
date_format
=
'%d-%m-%Y %H:%M'
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'
,
'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
)
# due date ????
# order ????
'''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
if
exitTime
!=
None
:
processingTime
=
exitTime
-
entranceTime
# stationId
stationId
=
step
.
get
(
"stationId"
,
None
)
# operator ????
# task_id
task_id
=
step
.
get
(
"task_id"
,
None
)
if
task_id
:
print
"task_id"
,
task_id
result
[
self
.
configuration_dict
[
'output_id'
]].
append
([
elementId
,
""
,
task_id
,
stationId
,
self
.
convertToFormattedRealWorldTime
(
entranceTime
),
processingTime
,
""
])
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