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
adaeef0d
Commit
adaeef0d
authored
Jun 11, 2014
by
Romain Courteaud
🐙
Committed by
Jérome Perrin
Aug 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display simulation parameters.
parent
90bf2510
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
39 deletions
+80
-39
dream/platform/src/index.html
dream/platform/src/index.html
+0
-14
dream/platform/src/src/dream.js
dream/platform/src/src/dream.js
+1
-21
dream/platform/src2/dream/run_simulation.html
dream/platform/src2/dream/run_simulation.html
+9
-0
dream/platform/src2/dream/run_simulation.js
dream/platform/src2/dream/run_simulation.js
+70
-4
No files found.
dream/platform/src/index.html
View file @
adaeef0d
...
...
@@ -32,9 +32,6 @@
<a
id=
"run_knowledge_extraction"
>
<i
class=
"fa fa-spinner fa-spin"
id=
"ke_loading_spinner"
style=
"display:none"
></i>
Run Knowledge Extraction
</a>
<a
id=
"run_simulation"
>
<i
class=
"fa fa-spinner fa-spin"
id=
"loading_spinner"
style=
"display:none"
></i>
Run Simulation
</a>
</div>
</div>
...
...
@@ -45,17 +42,6 @@
</div>
<div
class=
"container"
>
<div
class=
"four columns"
>
<div
id=
"simulation_controls"
>
<h4>
Simulation Parameters
</h4>
<div
title=
"Configure"
>
<form>
<fieldset
id=
"general-fieldset"
>
</fieldset>
</form>
</div>
</div>
</div>
<div
class=
"twelve columns"
>
<div
id=
"wip_part_spreadsheet"
style=
"display: none; overflow: scroll;"
></div>
<div
id=
"shift_spreadsheet"
style=
"display: none; overflow: scroll"
></div>
...
...
dream/platform/src/src/dream.js
View file @
adaeef0d
...
...
@@ -121,27 +121,6 @@
});
};
that
.
prepareDialogForGeneralProperties
=
function
()
{
var
fieldset
=
$
(
"
#general-fieldset
"
),
previous_data
=
that
.
getData
()[
'
general
'
],
previous_value
=
""
,
prefix
=
"
General-
"
;
fieldset
.
children
().
remove
();
$
.
each
(
configuration
[
'
Dream-Configuration
'
][
'
property_list
'
],
function
(
idx
,
property
)
{
if
(
property
.
_class
===
"
Dream.Property
"
)
{
previous_value
=
previous_data
[
property
.
id
]
||
""
;
if
(
previous_value
.
length
>
0
||
typeof
previous_value
==
"
number
"
)
{
previous_value
=
'
value="
'
+
previous_value
+
'
"
'
;
}
fieldset
.
append
(
"
<label>
"
+
(
property
.
name
||
property
.
id
)
+
"
</label>
"
+
'
<input title="
'
+
(
property
.
description
||
''
)
+
'
" type="text" name="
'
+
prefix
+
property
.
id
+
'
"
'
+
previous_value
+
'
id="
'
+
prefix
+
property
.
id
+
'
"
'
+
'
class="text ui-widget-content ui-corner-all"/>
'
);
}
});
};
priv
.
prepareDialogForElement
=
function
(
title
,
element_id
)
{
// code to allow changing values on connections. For now we assume
// that it is throughput. But we will need more generic code
...
...
@@ -317,6 +296,7 @@
priv
.
super_start
=
that
.
start
;
that
.
start
=
function
()
{
// XXX Migrate this part now!
priv
.
super_start
();
priv
.
displayTool
();
priv
.
initDialog
();
...
...
dream/platform/src2/dream/run_simulation.html
View file @
adaeef0d
...
...
@@ -6,13 +6,22 @@
<title>
Run Simulation
</title>
<script
src=
"../<%= copy.rsvp.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= copy.renderjs.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= copy.handlebars.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= curl.jquery.relative_dest %>"
type=
"text/javascript"
></script>
<script
src=
"../<%= curl.jquerymobilejs.relative_dest %>"
type=
"text/javascript"
></script>
<script
id=
"label-template"
type=
"text/x-handlebars-template"
>
<
label
>
{{
label
}}
<
/label
>
</script>
<script
src=
"document_page_mixin.js"
type=
"text/javascript"
></script>
<script
src=
"run_simulation.js"
type=
"text/javascript"
></script>
</head>
<body>
<form>
<fieldset
class=
"simulation_parameters"
>
</fieldset>
</form>
<form
class=
"run_form"
>
<button
type=
"submit"
class=
"ui-btn ui-btn-b ui-btn-inline
ui-icon-refresh ui-btn-icon-right"
>
Run Simulation
</button>
...
...
dream/platform/src2/dream/run_simulation.js
View file @
adaeef0d
/*global console, rJS, RSVP, initDocumentPageMixin, jQuery */
(
function
(
window
,
rJS
,
RSVP
,
initDocumentPageMixin
,
$
)
{
/*global rJS, RSVP, initDocumentPageMixin, jQuery, Handlebars */
/*jslint nomen: true, maxlen: 200 */
(
function
(
window
,
rJS
,
RSVP
,
initDocumentPageMixin
,
$
,
Handlebars
)
{
"
use strict
"
;
function
promiseEventListener
(
target
,
type
,
useCapture
)
{
...
...
@@ -27,7 +28,16 @@
return
new
RSVP
.
Promise
(
resolver
,
canceller
);
}
var
gadget_klass
=
rJS
(
window
);
/////////////////////////////////////////////////////////////////
// Handlebars
/////////////////////////////////////////////////////////////////
// Precompile the templates while loading the first gadget instance
var
gadget_klass
=
rJS
(
window
),
source
=
gadget_klass
.
__template_element
.
getElementById
(
"
label-template
"
)
.
innerHTML
,
label_template
=
Handlebars
.
compile
(
source
);
initDocumentPageMixin
(
gadget_klass
);
gadget_klass
/////////////////////////////////////////////////////////////////
...
...
@@ -60,7 +70,63 @@
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
i
,
gadget
=
this
,
property
,
parent_element
=
gadget
.
props
.
element
.
querySelector
(
"
.simulation_parameters
"
),
value
,
queue
,
data
,
property_list
=
options
.
configuration_dict
[
'
Dream-Configuration
'
].
property_list
;
this
.
props
.
jio_key
=
options
.
id
;
queue
=
gadget
.
aq_getAttachment
({
"
_id
"
:
gadget
.
props
.
jio_key
,
"
_attachment
"
:
"
body.json
"
})
.
push
(
function
(
json
)
{
data
=
JSON
.
parse
(
json
).
general
;
});
function
addField
(
property
,
value
)
{
var
sub_gadget
;
queue
.
push
(
function
()
{
parent_element
.
insertAdjacentHTML
(
'
beforeend
'
,
label_template
({
label
:
(
property
.
name
||
property
.
id
)})
);
return
gadget
.
declareGadget
(
"
../string_field/index.html
"
);
})
.
push
(
function
(
gg
)
{
sub_gadget
=
gg
;
value
=
data
[
property
.
id
]
||
value
;
return
sub_gadget
.
render
({
field_json
:
{
title
:
(
property
.
description
||
''
),
key
:
property
.
id
,
value
:
value
}});
})
.
push
(
function
()
{
return
sub_gadget
.
getElement
();
})
.
push
(
function
(
sub_element
)
{
parent_element
.
appendChild
(
sub_element
);
});
}
for
(
i
=
0
;
i
<
property_list
.
length
;
i
+=
1
)
{
property
=
property_list
[
i
];
if
(
property
.
_class
===
"
Dream.Property
"
)
{
value
=
property
.
_default
||
""
;
addField
(
property
,
value
);
}
}
return
queue
;
})
.
declareMethod
(
"
startService
"
,
function
()
{
...
...
@@ -123,4 +189,4 @@
return
gadget
.
pleaseRedirectMyHash
(
url
);
});
});
}(
window
,
rJS
,
RSVP
,
initDocumentPageMixin
,
jQuery
));
}(
window
,
rJS
,
RSVP
,
initDocumentPageMixin
,
jQuery
,
Handlebars
));
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