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
9c4651a0
Commit
9c4651a0
authored
Feb 25, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show how to integrate KE in the GUI
parent
e94c4f34
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
0 deletions
+43
-0
dream/platform/__init__.py
dream/platform/__init__.py
+16
-0
dream/platform/static/index.html
dream/platform/static/index.html
+3
-0
dream/platform/static/src/dream_launcher.js
dream/platform/static/src/dream_launcher.js
+24
-0
No files found.
dream/platform/__init__.py
View file @
9c4651a0
...
...
@@ -138,6 +138,22 @@ def getGUIInstance():
def
getConfigurationDict
():
return
jsonify
(
getGUIInstance
().
getConfigurationDict
())
@
app
.
route
(
"/runKnowledgeExtraction"
,
methods
=
[
"POST"
,
"OPTIONS"
])
def
runKnowledgeExtraction
():
parameter_dict
=
request
.
json
[
'json'
]
# TODO: really run knowledge extraction and change values:
import
time
time
.
sleep
(.
2
)
parameter_dict
[
'general'
][
'trace'
]
=
"ahah"
parameter_dict
[
'nodes'
][
'M1'
][
'processingTime'
]
=
{
'distributionType'
:
'Normal'
,
'stdev'
:
1.23
,
'max'
:
123
}
return
jsonify
(
parameter_dict
)
def
main
(
*
args
):
parser
=
argparse
.
ArgumentParser
(
description
=
'Launch the DREAM simulation platform.'
)
parser
.
add_argument
(
'gui_class'
,
metavar
=
'GUI_KLASS'
,
nargs
=
"?"
,
default
=
"Default"
,
...
...
dream/platform/static/index.html
View file @
9c4651a0
...
...
@@ -37,6 +37,9 @@
<form
id=
"import_form"
style=
"display:none"
>
<input
id=
"import_file"
name=
"file"
type=
"file"
></input>
</form>
<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>
...
...
dream/platform/static/src/dream_launcher.js
View file @
9c4651a0
...
...
@@ -153,6 +153,30 @@
});
});
// Enable "Run Knowledge Extraction" button
$
(
"
#run_knowledge_extraction
"
).
button
().
click
(
function
(
e
)
{
$
(
"
#run_knowledge_extraction
"
).
button
(
'
disable
'
);
$
(
"
#ke_loading_spinner
"
).
show
();
$
.
ajax
(
'
/runKnowledgeExtraction
'
,
{
data
:
JSON
.
stringify
({
json
:
dream_instance
.
getData
()
}),
contentType
:
'
application/json
'
,
type
:
'
POST
'
,
success
:
function
(
data
,
textStatus
,
jqXHR
)
{
loadData
(
data
);
$
(
"
#ke_loading_spinner
"
).
hide
();
$
(
"
#run_knowledge_extraction
"
).
button
(
'
enable
'
);
},
error
:
function
()
{
$
(
"
#ke_loading_spinner
"
).
hide
();
$
(
"
#run_knowledge_extraction
"
).
button
(
'
enable
'
);
}
});
}
)
// Enable "Run Simulation" button
$
(
"
#run_simulation
"
).
button
().
click
(
...
...
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