From 9d0b9c6071fc67633b2e1fd8058d12ee6d78f3e5 Mon Sep 17 00:00:00 2001 From: baigner <benedikt.aigner@rwth-aachen.de> Date: Tue, 17 Apr 2018 09:55:14 +0200 Subject: [PATCH] Vistoms update/bugfix: 1.) Some style changes. 2.) Update of function problem roles after changing function order only if function roles were already assigned. Former-commit-id: 0ca259e628f19ce0de9c09aef19ded919b59e1ca --- kadmos/vistoms/templates/VISTOMS.html | 12 ++++++++---- kadmos/vistoms/vistoms.py | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/kadmos/vistoms/templates/VISTOMS.html b/kadmos/vistoms/templates/VISTOMS.html index d755b97ae..5ae834b14 100644 --- a/kadmos/vistoms/templates/VISTOMS.html +++ b/kadmos/vistoms/templates/VISTOMS.html @@ -459,10 +459,12 @@ .style("min-width","200px") .style("margin-left","10px") addButtonPanel.append("div").attr("class","panel-heading text-center align-top") + .style("background-color","#555555") .append("h3") .attr("class","panel-title") .style("font-family","Arial") .style("font-size","14pt") + .style("color","white") .style("display","inline-block") .text("Add graph") var panelBody = addButtonPanel.append("div").attr("class","panel-body") @@ -613,10 +615,12 @@ .style("min-width","200px") .style("margin-left","10px") saveButtonPanel.append("div").attr("class","panel-heading text-center align-top") + .style("background-color","#555555") .append("h3") .attr("class","panel-title") .style("font-family","Arial") .style("font-size","14pt") + .style("color","white") .style("display","inline-block") .text("Save all graphs") var savepanelBody = saveButtonPanel.append("div").attr("class","panel-body") @@ -18765,7 +18769,7 @@ var saveButton = revertDiv.append("button") - .attr("class","btn btn-primary button") + .attr("class","btn btn-primary") .attr("data-toggle","tooltip") .attr("data-placement","top") .attr("title","Save graph") @@ -18874,7 +18878,7 @@ var deleteButton = revertDiv.append("button") - .attr("class","btn btn-danger button") + .attr("class","btn btn-danger") .attr("data-toggle","tooltip") .attr("data-placement","top") .attr("title","Delete graph") @@ -18940,7 +18944,7 @@ var backButton = revertDiv.append("button") - .attr("class","btn btn-warning button") + .attr("class","btn btn-warning") .attr("data-toggle","tooltip") .attr("data-placement","top") .attr("title","Revert graph manipulation step") @@ -19004,7 +19008,7 @@ }) var fwdButton = revertDiv.append("button") - .attr("class","btn btn-warning button") + .attr("class","btn btn-warning") .attr("data-toggle","tooltip") .attr("data-placement","top") .attr("title","Restore graph manipulation step") diff --git a/kadmos/vistoms/vistoms.py b/kadmos/vistoms/vistoms.py index fd51ad13c..5a285c049 100644 --- a/kadmos/vistoms/vistoms.py +++ b/kadmos/vistoms/vistoms.py @@ -707,7 +707,8 @@ def kadmosChangeNodePos(): function_order.insert(newPos, nodeName) if isinstance(graph, FundamentalProblemGraph): graph.graph['problem_formulation']['function_order'] = function_order - graph.add_function_problem_roles() + if 'problem_role' in graph.nodes[function_order[0]]: + graph.add_function_problem_roles() # Add the graph with the updated function order to VISTOMS newVistomsData = graph.vistoms_add_json(function_order=function_order, graph_id=graphID, mpg=mpg) @@ -1091,7 +1092,8 @@ def kadmosGetPossibleFunctionOrder(): function_order = fpg.get_possible_function_order(method) fpg.assert_or_add_nested_attribute(['problem_formulation', 'mdao_architecture'], 'undefined') fpg.graph['problem_formulation']['function_order'] = function_order - fpg.add_function_problem_roles() + if 'problem_role' in fpg.nodes[function_order[0]]: + fpg.add_function_problem_roles() # Save the graph in temp/tmp.kdms fpg.save(os.path.join(UPLOAD_FOLDER, TEMP_FILE + '_' + graphID + '.kdms'), -- GitLab