\r
inputs = modelParser.getInputs();\r
outputs = modelParser.getOutputs();\r
- \r
- /*for (Parameter input : inputs) {\r
- System.out.print("input " + input.type + " " + input.name);\r
- if (input.optional) System.out.print(" [optional]");\r
- if (input.description != null) System.out.print(" [Description: " + input.description + "]");\r
- System.out.println();\r
- }\r
- for (Parameter output : outputs) { \r
- System.out.print("output " + output.type + " " + output.name);\r
- if (output.description != null) System.out.print(" [Description: " + output.description + "]");\r
- System.out.println();\r
- }^*/\r
\r
} catch (ParseException e1) {\r
Token token = e1.currentToken;\r
\r
private void save() {\r
final String code = modelicaCode.getExpression();\r
+ \r
+ // Update input and output lists.\r
+ validate();\r
+ \r
SimanticsUI.getSession().asyncRequest(new WriteRequest() {\r
- \r
+ \r
+ @Override\r
+ public void perform(WriteGraph graph) throws DatabaseException {\r
+ SysdynResource sr = SysdynResource.getInstance(graph);\r
+\r
+ // Remove the existing input list\r
+ removeInputList(graph);\r
+ // Create the new input list\r
+ createInputList(graph);\r
+\r
+ // Remove the existing output list\r
+ removeOutputList(graph);\r
+ // Create the new output list\r
+ createOutputList(graph);\r
+ \r
+ // Update the function code\r
+ graph.claimLiteral(\r
+ function, \r
+ sr.SysdynModelicaFunction_modelicaFunctionCode, \r
+ code);\r
+ }\r
+ \r
private void removeInputList(WriteGraph graph) throws DatabaseException {\r
SysdynResource sr = SysdynResource.getInstance(graph);\r
\r
ListUtils.create(graph, outputResources));\r
\r
}\r
- \r
- @Override\r
- public void perform(WriteGraph graph) throws DatabaseException {\r
- SysdynResource sr = SysdynResource.getInstance(graph);\r
\r
- // Remove the existing input list\r
- removeInputList(graph);\r
- // Create the new input list\r
- createInputList(graph);\r
- \r
- // Remove the existing output list\r
- removeOutputList(graph);\r
- // Create the new output list\r
- createOutputList(graph);\r
- \r
- // Update the function code\r
- graph.claimLiteral(\r
- function, \r
- sr.SysdynModelicaFunction_modelicaFunctionCode, \r
- code);\r
- }\r
});\r
}\r
\r