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
e48e1586
Commit
e48e1586
authored
Jun 24, 2013
by
Sebastien Robin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gui prototype: correctly define repairmans in data structure
parent
d2859e60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
25 deletions
+30
-25
DREAM/dream/dream/platform/static/src/dream_launcher.js
DREAM/dream/dream/platform/static/src/dream_launcher.js
+9
-2
DREAM/dream/dream/platform/static/src/jsonPlumb.js
DREAM/dream/dream/platform/static/src/jsonPlumb.js
+21
-23
No files found.
DREAM/dream/dream/platform/static/src/dream_launcher.js
View file @
e48e1586
...
...
@@ -2,7 +2,7 @@
"
use strict
"
;
jsPlumb
.
bind
(
"
ready
"
,
function
()
{
var
graph_data
=
{},
dream_instance
,
available_people
=
{},
people_list
,
i
,
i_length
,
updateWorkerCount
;
i
,
i_length
,
updateWorkerCount
,
json_plumb_configuration
=
{}
;
graph_data
.
throughput
=
0
;
graph_data
.
box_list
=
[
{
id
:
'
window1
'
,
title
:
'
attach1
'
,
throughput
:
30
,
target_list
:
[
'
window2
'
],
coordinate
:
{
top
:
5
,
left
:
5
}},
...
...
@@ -17,7 +17,14 @@
{
id
:
'
window10
'
,
title
:
'
tests
'
,
throughput
:
28
,
target_list
:
[
'
window11
'
],
coordinate
:
{
top
:
20
,
left
:
45
}},
{
id
:
'
window11
'
,
title
:
'
packaging
'
,
throughput
:
27
,
coordinate
:
{
top
:
20
,
left
:
55
}},
];
/*json_plumb_configuration["Dream.Queue"] = {
"id": "DummyQ",
"name": "DummyQ",
"isDummy": "1",
"capacity": "1",
"predecessorList": ["S1"],
"successorList": ["M1"]
};*/
//dream_instance = DREAM.newDream(graph_data);
//dream_instance.start();
var
main_div_offset
=
$
(
"
#main
"
).
offset
();
...
...
DREAM/dream/dream/platform/static/src/jsonPlumb.js
View file @
e48e1586
...
...
@@ -64,13 +64,15 @@
var
updateConnectionData
=
function
(
connection
,
remove
)
{
console
.
log
(
"
updateConnectionData is being called
"
);
var
i
,
core_length
=
priv
.
graph_data
.
coreObject
.
length
,
element
;
for
(
i
=
0
;
i
<
core_length
;
i
++
)
{
element
=
priv
.
graph_data
.
coreObject
[
i
];
if
(
element
.
id
===
connection
.
sourceId
)
{
element
.
successorList
=
element
.
successorList
||
[];
element
.
successorList
.
push
(
connection
.
targetId
);
};
source_element
,
destination_element
;
source_element
=
priv
.
element_container
[
connection
.
sourceId
];
destination_element
=
priv
.
element_container
[
connection
.
targetId
];
console
.
log
(
'
destination_element._class
'
,
destination_element
.
_class
);
if
(
destination_element
.
_class
===
"
Dream.Repairman
"
)
{
source_element
.
repairman
=
destination_element
.
id
;
}
else
{
source_element
.
successorList
=
source_element
.
successorList
||
[];
source_element
.
successorList
.
push
(
connection
.
targetId
);
}
priv
.
updateJsonOutput
();
};
...
...
@@ -95,6 +97,7 @@
name
:
element
.
id
,
capacity
:
"
1
"
,
};
priv
.
element_container
[
element
.
id
]
=
element_data
;
priv
.
graph_data
.
modelResource
.
push
(
element_data
);
priv
.
updateJsonOutput
();
};
...
...
@@ -104,20 +107,9 @@
var
element_data
=
{
_class
:
element
.
class
,
id
:
element
.
id
,
name
:
element
.
id
};
priv
.
element_container
[
element
.
id
]
=
element_data
;
priv
.
graph_data
.
coreObject
.
push
(
element_data
);
priv
.
updateJsonOutput
();
/*{"_class": "Dream.Source",
"id": "S1",
"name": "Raw Material",
"interarrivalTime":
{
"distributionType": "Fixed",
"mean": "0.5"
},
"entity": "Part",
"successorList": ["DummyQ"]
}, */
};
Object
.
defineProperty
(
that
,
"
start
"
,
{
...
...
@@ -125,10 +117,17 @@
enumerable
:
false
,
writable
:
false
,
value
:
function
()
{
//priv.setModel();
priv
.
element_list
=
[];
priv
.
element_container
=
{};
priv
.
graph_data
=
{
coreObject
:
[],
modelResource
:
[],
_class
:
"
Dream.Simulation
"
,
general
:
{
"
_class
"
:
"
Dream.Configuration
"
,
"
numberOfReplications
"
:
"
1
"
,
"
maxSimTime
"
:
"
1440
"
,
"
trace
"
:
"
Yes
"
,
"
confidenceLevel
"
:
"
0.95
"
},
};
priv
.
initJsPlumb
();
//priv.initDialog();
...
...
@@ -155,7 +154,6 @@
render_element
.
append
(
'
<div class="window" id="
'
+
element
.
id
+
'
"
'
+
style_string
+
'
">
'
+
element
.
id
+
'
</div>
'
);
priv
.
element_list
.
push
(
element
);
// Initial DEMO code : make all the window divs draggable
jsPlumb
.
draggable
(
jsPlumb
.
getSelector
(
"
.window
"
),
{
grid
:
[
20
,
20
]
});
...
...
@@ -237,4 +235,4 @@
value
:
JsonPlumbNamespace
});
}(
window
,
jQuery
,
jsPlumb
,
console
,
_
));
}(
window
,
jQuery
,
jsPlumb
,
console
,
_
));
\ No newline at end of file
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