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
727ab731
Commit
727ab731
authored
Jul 04, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update job schedule widget to support capacity project
reapply
9cae3eb4
parent
d3751537
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
3 deletions
+28
-3
dream/platform/src2/dream/Output_viewJobScheduleSpreadsheet.js
.../platform/src2/dream/Output_viewJobScheduleSpreadsheet.js
+28
-3
No files found.
dream/platform/src2/dream/Output_viewJobScheduleSpreadsheet.js
View file @
727ab731
...
...
@@ -5,6 +5,7 @@
function
job_schedule_spreadsheet_widget
(
all_data
)
{
var
now
=
new
Date
(),
name
,
input_data
=
all_data
.
input
,
output_data
=
all_data
.
result
,
spreadsheet_data
=
[],
...
...
@@ -49,11 +50,13 @@
for
(
i
=
0
;
i
<
output_data
.
elementList
.
length
;
i
+=
1
)
{
obj
=
output_data
.
elementList
[
i
];
if
(
obj
.
_class
===
'
Dream.Job
'
)
{
if
(
obj
.
_class
===
'
Dream.Job
'
||
obj
.
_class
===
'
Dream.CapacityProject
'
)
{
input_job
=
null
;
input_order
=
null
;
// find the input order and order component for this job
// XXX this has no real meaning with capacity project
for
(
node_id
in
input_data
.
nodes
)
{
if
(
input_data
.
nodes
.
hasOwnProperty
(
node_id
))
{
node
=
input_data
.
nodes
[
node_id
];
...
...
@@ -63,7 +66,7 @@
if
(
order
.
id
===
obj
.
id
)
{
input_job
=
input_order
=
order
;
}
if
(
input_job
===
null
)
{
if
(
input_job
===
null
&&
order
.
componentsList
)
{
for
(
k
=
0
;
k
<
order
.
componentsList
.
length
;
k
+=
1
)
{
component
=
order
.
componentsList
[
k
];
if
(
component
.
id
===
obj
.
id
)
{
...
...
@@ -77,6 +80,7 @@
}
}
// XXX does not make sense in the case of capacity project
due_date
=
new
Date
(
simulation_start_date
.
getTime
()
+
input_order
.
dueDate
*
1000
*
3600
);
for
(
j
=
0
;
j
<
obj
.
results
.
schedule
.
length
;
j
+=
1
)
{
...
...
@@ -85,6 +89,27 @@
// XXX: time unit
schedule
.
entranceTime
*
1000
*
3600
);
duration
=
0
;
if
(
schedule
.
exitTime
)
{
duration
=
(
schedule
.
exitTime
-
schedule
.
entranceTime
);
}
else
{
// When duration is not returned by ManPy, it is calculated by
// difference of entranceTime of this step and entranceTime of the
// next step, or completionTime when this is the last step
if
(
i
+
1
===
obj
.
results
.
schedule
.
length
)
{
duration
=
obj
.
results
.
completionTime
-
schedule
.
entranceTime
;
}
else
{
duration
=
obj
.
results
.
schedule
[
i
+
1
]
.
entranceTime
-
schedule
.
entranceTime
;
}
}
name
=
""
;
if
(
obj
.
_class
===
'
Dream.CapacityProject
'
)
{
name
=
input_order
.
name
+
'
-
'
+
schedule
.
stationId
;
}
else
{
name
=
input_order
.
name
+
"
-
"
+
input_job
.
name
;
}
// Duration is calculated by difference of entranceTime of this
// step and entranceTime of the next step, or completionTime when
// this is the last step
...
...
@@ -98,7 +123,7 @@
spreadsheet_data
.
push
([
// XXX this label is incorrect for design step, during design
// phase we still have an order and not an order component.
input_order
.
name
+
"
-
"
+
input_job
.
name
,
name
,
obj
.
id
,
input_order
.
manager
,
moment
(
due_date
).
format
(
"
YYYY/MM/DD
"
),
...
...
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