Skip to content

Commit

Permalink
Add support for HideResult annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel committed Dec 19, 2015
1 parent bcd44ef commit 0872025
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
Expand Up @@ -92,7 +92,7 @@ readFile("testParameters_init.tmp.xml");
// causality = \"internal\" isValueChangeable = \"true\"
// alias = \"noAlias\"
// classIndex = \"0\" classType = \"rSta\"
// isProtected = \"false\"
// isProtected = \"false\" hideResult = \"false\"
// fileName = \"<interactive>\" startLine = \"8\" startColumn = \"3\" endLine = \"8\" endColumn = \"9\" fileWritable = \"true\">
// <Real useStart=\"false\" fixed=\"false\" useNominal=\"false\" />
// </ScalarVariable>
Expand All @@ -103,7 +103,7 @@ readFile("testParameters_init.tmp.xml");
// causality = \"internal\" isValueChangeable = \"false\"
// alias = \"noAlias\"
// classIndex = \"0\" classType = \"rDer\"
// isProtected = \"false\"
// isProtected = \"false\" hideResult = \"false\"
// fileName = \"&lt;interactive&gt;\" startLine = \"8\" startColumn = \"3\" endLine = \"8\" endColumn = \"9\" fileWritable = \"true\">
// <Real useStart=\"false\" fixed=\"false\" useNominal=\"false\" />
// </ScalarVariable>
Expand All @@ -114,7 +114,7 @@ readFile("testParameters_init.tmp.xml");
// causality = \"internal\" isValueChangeable = \"true\"
// alias = \"noAlias\"
// classIndex = \"0\" classType = \"rPar\"
// isProtected = \"false\"
// isProtected = \"false\" hideResult = \"false\"
// fileName = \"&lt;interactive&gt;\" startLine = \"4\" startColumn = \"3\" endLine = \"4\" endColumn = \"31\" fileWritable = \"true\">
// <Real useStart=\"true\" start=\"0.9356160015533859\" fixed=\"true\" useNominal=\"false\" />
// </ScalarVariable>
Expand All @@ -125,7 +125,7 @@ readFile("testParameters_init.tmp.xml");
// causality = \"internal\" isValueChangeable = \"true\"
// alias = \"noAlias\"
// classIndex = \"1\" classType = \"rPar\"
// isProtected = \"false\"
// isProtected = \"false\" hideResult = \"false\"
// fileName = \"&lt;interactive&gt;\" startLine = \"3\" startColumn = \"3\" endLine = \"3\" endColumn = \"20\" fileWritable = \"true\">
// <Real useStart=\"false\" fixed=\"true\" useNominal=\"false\" />
// </ScalarVariable>
Expand All @@ -136,7 +136,7 @@ readFile("testParameters_init.tmp.xml");
// causality = \"internal\" isValueChangeable = \"false\"
// alias = \"noAlias\"
// classIndex = \"2\" classType = \"rPar\"
// isProtected = \"false\"
// isProtected = \"false\" hideResult = \"false\"
// fileName = \"&lt;interactive&gt;\" startLine = \"5\" startColumn = \"3\" endLine = \"5\" endColumn = \"30\" fileWritable = \"true\">
// <Real useStart=\"false\" fixed=\"true\" useNominal=\"false\" />
// </ScalarVariable>
Expand All @@ -147,7 +147,7 @@ readFile("testParameters_init.tmp.xml");
// causality = \"internal\" isValueChangeable = \"false\"
// alias = \"noAlias\"
// classIndex = \"3\" classType = \"rPar\"
// isProtected = \"false\"
// isProtected = \"false\" hideResult = \"false\"
// fileName = \"&lt;interactive&gt;\" startLine = \"6\" startColumn = \"3\" endLine = \"6\" endColumn = \"29\" fileWritable = \"true\">
// <Real useStart=\"true\" start=\"3.0\" fixed=\"true\" useNominal=\"false\" />
// </ScalarVariable>
Expand All @@ -158,7 +158,7 @@ readFile("testParameters_init.tmp.xml");
// causality = \"internal\" isValueChangeable = \"false\"
// alias = \"noAlias\"
// classIndex = \"4\" classType = \"rPar\"
// isProtected = \"false\"
// isProtected = \"false\" hideResult = \"false\"
// fileName = \"&lt;interactive&gt;\" startLine = \"7\" startColumn = \"3\" endLine = \"7\" endColumn = \"32\" fileWritable = \"true\">
// <Real useStart=\"false\" fixed=\"false\" useNominal=\"false\" />
// </ScalarVariable>
Expand Down
28 changes: 28 additions & 0 deletions simulation/modelica/others/Bug2536.mos
@@ -0,0 +1,28 @@
// name: Bug2536.mos
// status: correct

loadString("
model Bug2536
Real a=time annotation(HideResult=true);
Real b=time annotation(HideResult=false);
Real c=time;
end Bug2536;
"); getErrorString();

res := simulate(Bug2536); getErrorString();
resultFile := res.resultFile;
OpenModelica.Scripting.readSimulationResultVars(resultFile); getErrorString();

// Result:
// true
// ""
// record SimulationResult
// resultFile = "Bug2536_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'Bug2536', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// ""
// "Bug2536_res.mat"
// {"b","c","time"}
// ""
// endResult
1 change: 1 addition & 0 deletions simulation/modelica/others/Makefile
Expand Up @@ -7,6 +7,7 @@ Bug1687.mos \
Bug1728.mos \
Bug1987.mos \
Bug2432.mos \
Bug2536.mos \
Bug2633.mos \
Bug2704.mos \
Bug2788.mos \
Expand Down

0 comments on commit 0872025

Please sign in to comment.