Skip to content
Snippets Groups Projects
Commit 0f5f13a3 authored by baigner's avatar baigner
Browse files

WARNING: instable version! For stable version refer to last commit.

Trying to abort KADMOS function from VISTOMS from user input. Does not work yet!

Former-commit-id: ad03c293e2e06babd05123e4338ec4169217a787
parent f7b797b6
No related branches found
No related tags found
No related merge requests found
Pipeline #193058 canceled
......@@ -204,6 +204,20 @@ def kadmosInitializeFPG():
return newVistomsData
@app.route('/kadmosRemoveUnnecessaryOutputs', methods=['POST'])
def kadmosRemoveUnnecessaryOutputs():
x = 0
y = 1
while y > x:
y += 1
print(y)
return
# TODO (aigner): "Add marking variables as ..." function
@app.route('/kadmosMarkVariable', methods=['POST'])
def kadmosMarkVariable():
......@@ -266,10 +280,12 @@ def kadmosExportChangesToFile():
fileName = 'saveFile'
# Example: Save as CMDOWS file
if isinstance(graph, FundamentalProblemGraph):
functionOrder = request.form['currentOrder'].split(',')
print(functionOrder)
graph.graph['problem_formulation'] = dict()
graph.graph['problem_formulation']['function_order'] = functionOrder
if not hasattr(graph.graph, 'problem_formulation'):
functionOrder = request.form['currentOrder'].split(',')
graph.graph['problem_formulation'] = dict()
graph.graph['problem_formulation']['function_order'] = functionOrder
graph.graph['problem_formulation']['mdao_architecture'] = "None"
graph.add_function_problem_roles()
graph.save(app.config['UPLOAD_FOLDER'] + fileName, file_type=fileType, graph_check_critical=False,mpg=mpg)
......
......@@ -19977,11 +19977,63 @@ th, td {
})
options.append("li").append("a")
.attr("id",j+1)
.text("Enrich FPG")
.text("Remove unnecessary outputs")
.on("mouseover", function(){d3.select(this).style("cursor", "pointer")})
.on("click", function()
{
bootbox.confirm("Are you sure you want to do this?", function(sure)
{
if (sure)
{
var xhr;
var dialog = bootbox.confirm({
title: 'Removing unnecessary outputs',
message: '<p><i class="fa fa-spin fa-spinner"></i>Deleting node. Please be patient...</p>',
callback: function (result) {
if (result==false)
{
//@aigner: HIER WEITER: FUNKTION ABBRECHEN!!!
xhr.abort();
}
}
});
xhr = $.ajax({
url: '/kadmosRemoveUnnecessaryOutputs',
type: 'POST',
data: {'graphID':graphID},
success: function(result)
{
if (result.includes("ERROR:"))
{
dialog.init(function(){
dialog.find('.bootbox-body').html(result);
});
}
else
{
clearView();
var theNewData = {};
theNewData = JSON.parse(result);
makeKadmosMenu(theNewData);
xdsm_script(theNewData,graphID);
dialog.init(function(){
dialog.find('.bootbox-body').html("Unnecessary output was removed!");
});
}
},
error: function(error)
{
dialog.init(function(){
dialog.find('.bootbox-body').html("ERROR: Sorry, something went wrong when calling KADMOS from VISTOMS!");
});
}
});
}
})
})
var exportChanges_ul = optionsDiv.append("ul").style("background-color","#99CC00").style("border-color","#99CC00")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment