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
9cae3eb4
Commit
9cae3eb4
authored
Jun 13, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update job schedule widget to support capacity project
parent
4239ba05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
dream/platform/static/src/dream.js
dream/platform/static/src/dream.js
+21
-9
No files found.
dream/platform/static/src/dream.js
View file @
9cae3eb4
...
...
@@ -295,10 +295,11 @@
// versa.
$
.
each
(
output_data
.
elementList
,
function
(
idx
,
obj
)
{
if
(
obj
.
_class
===
'
Dream.Job
'
)
{
if
(
obj
.
_class
===
'
Dream.Job
'
||
obj
.
_class
===
'
Dream.CapacityProject
'
)
{
var
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
(
var
node_id
in
input_data
.
nodes
)
{
var
node
=
input_data
.
nodes
[
node_id
];
if
(
node
.
wip
)
{
...
...
@@ -307,7 +308,7 @@
if
(
order
.
id
==
obj
.
id
)
{
input_job
=
input_order
=
order
;
}
if
(
input_job
===
null
)
{
if
(
input_job
===
null
&&
order
.
componentsList
)
{
for
(
var
j
=
0
;
j
<
order
.
componentsList
.
length
;
j
++
){
var
component
=
order
.
componentsList
[
j
];
if
(
component
.
id
==
obj
.
id
){
...
...
@@ -320,6 +321,7 @@
}
}
// XXX does not make sense in the case of capacity project
var
due_date
=
new
Date
(
simulation_start_date
.
getTime
()
+
input_order
.
dueDate
*
1000
*
3600
);
$
.
each
(
obj
[
'
results
'
][
'
schedule
'
],
function
(
i
,
schedule
)
{
...
...
@@ -327,19 +329,29 @@
// TODO: time unit
schedule
[
'
entranceTime
'
]
*
1000
*
3600
);
var
duration
=
0
;
// Duration 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
'
];
if
(
schedule
[
'
exitTime
'
])
{
duration
=
(
schedule
[
'
exitTime
'
]
-
schedule
[
'
entranceTime
'
]);
}
else
{
duration
=
obj
[
'
results
'
][
'
schedule
'
][
i
+
1
][
'
entranceTime
'
]
-
schedule
[
'
entranceTime
'
];
// 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
'
];
}
}
var
name
=
""
;
if
(
obj
.
_class
==
'
Dream.CapacityProject
'
)
{
name
=
input_order
.
name
+
'
-
'
+
schedule
[
'
stationId
'
];
}
else
{
name
=
input_order
.
name
+
"
-
"
+
input_job
.
name
;
}
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