@@ -90,6 +90,7 @@ protected import UnitAbsyn;
9090protected import UnitParserExt ;
9191protected import UnitAbsynBuilder ;
9292protected import Inline ;
93+ protected import SimulationResults ;
9394
9495public function cevalInteractiveFunctions
9596"function cevalInteractiveFunctions
@@ -710,7 +711,7 @@ algorithm
710711 pwd = System . pwd();
711712 pd = System . pathDelimiter();
712713 filename_1 = Util . stringAppendList({pwd,pd,filename});
713- value = System . readPtolemyplotDataset(filename_1, vars_1, size);
714+ value = SimulationResults . readPtolemyplotDataset(filename_1, vars_1, size);
714715 then
715716 (cache,value,st);
716717
@@ -739,7 +740,7 @@ algorithm
739740 pwd = System . pwd();
740741 pd = System . pathDelimiter();
741742 filename_1 = Util . stringAppendList({pwd,pd,filename});
742- value = System . readPtolemyplotDatasetSize(filename_1);
743+ value = SimulationResults . readPtolemyplotDatasetSize(filename_1);
743744 then
744745 (cache,value,st);
745746
@@ -776,7 +777,7 @@ algorithm
776777
777778 (cache,Values . RECORD (orderd= {Values . STRING (filename)}),_) = Ceval . ceval(cache,env,
778779 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,Exp . OTHER (),{}),Exp . OTHER ()), true , SOME (st), NONE , msg);
779- value = System . readPtolemyplotDataset(filename, vars_2, 0 );
780+ value = SimulationResults . readPtolemyplotDataset(filename, vars_2, 0 );
780781 pwd = System . pwd();
781782 cit = winCitation();
782783
@@ -808,7 +809,7 @@ algorithm
808809 vars_2 = Util . listUnionElt("time" , vars_1);
809810 (cache,Values . RECORD (orderd= {Values . STRING (filename)}),_) = Ceval . ceval(cache,env,
810811 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,Exp . OTHER (),{}),Exp . OTHER ()), true , SOME (st), NONE , msg);
811- failure(_ = System . readPtolemyplotDataset(filename, vars_2, 0 ));
812+ failure(_ = SimulationResults . readPtolemyplotDataset(filename, vars_2, 0 ));
812813 then
813814 (cache,Values . STRING ("Error reading the simulation result." ),st);
814815
@@ -875,10 +876,10 @@ algorithm
875876// vars_2 =
876877
877878
878- // value = System .readPtolemyplotDataset(filename2, vars_2, 0);
879+ // value = SimulationResults .readPtolemyplotDataset(filename2, vars_2, 0);
879880
880881
881- // failure(_ = System .readPtolemyplotDataset(filename2, vars_2, 0));
882+ // failure(_ = SimulationResults .readPtolemyplotDataset(filename2, vars_2, 0));
882883
883884 then
884885 (cache,Values . STRING ("Error reading the simulation result." ),st);
@@ -920,7 +921,7 @@ algorithm
920921// vars_2 =
921922
922923
923- value = System . readPtolemyplotDataset(filename2, vars_2, 0 );
924+ value = SimulationResults . readPtolemyplotDataset(filename2, vars_2, 0 );
924925
925926 res = Values . sendPtolemyplotDataset(value, vars_2, "Plot by OpenModelica" , interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points, Exp . printExpStr(xRange), Exp . printExpStr(yRange));
926927
@@ -953,7 +954,7 @@ algorithm
953954 failure(_ = System . getVariableNames(filename));
954955// vars_2 = Util.stringSplitAtChar(str, " ");
955956
956- // failure(_ = System .readPtolemyplotDataset(filename, vars_2, 0));
957+ // failure(_ = SimulationResults .readPtolemyplotDataset(filename, vars_2, 0));
957958
958959 then
959960 (cache,Values . STRING ("Error reading the simulation result." ),st);
@@ -982,7 +983,7 @@ algorithm
982983 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,Exp . OTHER (),{}),Exp . OTHER ()), true , SOME (st), NONE , msg);
983984 str = System . getVariableNames(filename);
984985 vars_2 = Util . stringSplitAtChar(str, " " );
985- value = System . readPtolemyplotDataset(filename, vars_2, 0 );
986+ value = SimulationResults . readPtolemyplotDataset(filename, vars_2, 0 );
986987
987988 res = Values . sendPtolemyplotDataset(value, vars_2, "Plot by OpenModelica" , interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points, Exp . printExpStr(xRange), Exp . printExpStr(yRange));
988989
@@ -1018,7 +1019,7 @@ algorithm
10181019 filename = Absyn . pathString(className);
10191020 filename = Util . stringAppendList({filename, "_res.plt" });
10201021
1021- value = System . readPtolemyplotDataset(filename, vars_2, 0 );
1022+ value = SimulationResults . readPtolemyplotDataset(filename, vars_2, 0 );
10221023
10231024 res = Values . sendPtolemyplotDataset(value, vars_2, "Plot by OpenModelica" , interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points, Exp . printExpStr(xRange), Exp . printExpStr(yRange));
10241025
@@ -1052,7 +1053,7 @@ algorithm
10521053 filename = Absyn . pathString(className);
10531054 filename = Util . stringAppendList({filename, "_res.plt" });
10541055
1055- failure(_ = System . readPtolemyplotDataset(filename, vars_2, 0 ));
1056+ failure(_ = SimulationResults . readPtolemyplotDataset(filename, vars_2, 0 ));
10561057
10571058 then
10581059 (cache,Values . STRING ("Error reading the simulation result." ),st);
@@ -1080,7 +1081,7 @@ algorithm
10801081 vars_2 = Util . listUnionElt("time" , vars_1);
10811082 (cache,Values . RECORD (orderd= {Values . STRING (filename)}),_) = Ceval . ceval(cache,env,
10821083 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,Exp . OTHER (),{}),Exp . OTHER ()), true , SOME (st), NONE , msg);
1083- value = System . readPtolemyplotDataset(filename, vars_2, 0 );
1084+ value = SimulationResults . readPtolemyplotDataset(filename, vars_2, 0 );
10841085 res = Values . sendPtolemyplotDataset(value, vars_2, "Plot by OpenModelica" , interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points, Exp . printExpStr(xRange), Exp . printExpStr(yRange));
10851086
10861087 then
@@ -1110,7 +1111,7 @@ algorithm
11101111 vars_2 = Util . listUnionElt("time" , vars_1);
11111112 (cache,Values . RECORD (orderd= {Values . STRING (filename)}),_) = Ceval . ceval(cache,env,
11121113 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,Exp . OTHER (),{}),Exp . OTHER ()), true , SOME (st), NONE , msg);
1113- failure(_ = System . readPtolemyplotDataset(filename, vars_2, 0 ));
1114+ failure(_ = SimulationResults . readPtolemyplotDataset(filename, vars_2, 0 ));
11141115 then
11151116 (cache,Values . STRING ("Error reading the simulation result." ),st);
11161117
@@ -1197,11 +1198,11 @@ algorithm
11971198 filename = Util . stringAppendList({filename, "_res.plt" });
11981199 // print("filename: ");
11991200 // print(filename);
1200- vars = System . readPtolemyplotVariables(filename, visvar_str);
1201+ vars = SimulationResults . readPtolemyplotVariables(filename, visvar_str);
12011202 vars_2 = Util . listUnionElt("time" , vars);
12021203 // print(Util.stringAppendList(vars_2));
12031204 // print(Util.stringDelimitList(vars_2, ", "));
1204- value = System . readPtolemyplotDataset(filename, vars_2, 0 );
1205+ value = SimulationResults . readPtolemyplotDataset(filename, vars_2, 0 );
12051206 res = Values . sendPtolemyplotDataset2(value, vars_2, visvar_str, "Plot by OpenModelica" );
12061207
12071208 then
@@ -1230,9 +1231,9 @@ algorithm
12301231 //vars_2 = Util.listUnionElt("time", vars_1);
12311232 filename = Absyn.pathString(className);
12321233 filename = Util.stringAppendList({filename, "_res.plt"});
1233- vars = System .readPtolemyplotVariables(filename);
1234+ vars = SimulationResults .readPtolemyplotVariables(filename);
12341235
1235- failure(_ = System .readPtolemyplotDataset(filename, vars, 0));
1236+ failure(_ = SimulationResults .readPtolemyplotDataset(filename, vars, 0));
12361237
12371238 then
12381239 (cache,Values.STRING("Error reading the simulation result."),st);*/
@@ -1263,7 +1264,7 @@ algorithm
12631264 (cache,Values . RECORD (orderd= {Values . STRING (filename)}),_) = Ceval . ceval(cache,env,
12641265 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,Exp . OTHER (),{}),Exp . OTHER ()), true , SOME (st), NONE , msg);
12651266 print("tjo \n " );
1266- value = System . readPtolemyplotDataset(filename, vars_2, 0 );
1267+ value = SimulationResults . readPtolemyplotDataset(filename, vars_2, 0 );
12671268 print("value = " +& Values . valString(value));
12681269 res = Values . sendPtolemyplotDataset(value, vars_2, "Plot by OpenModelica" , interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points, title, title);
12691270
@@ -1293,7 +1294,7 @@ algorithm
12931294 vars_2 = Util . listUnionElt("time" , vars_1);
12941295 (cache,Values . RECORD (orderd= {Values . STRING (filename)}),_) = Ceval . ceval(cache,env,
12951296 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,Exp . OTHER (),{}),Exp . OTHER ()), true , SOME (st), NONE , msg);
1296- failure(_ = System . readPtolemyplotDataset(filename, vars_2, 0 ));
1297+ failure(_ = SimulationResults . readPtolemyplotDataset(filename, vars_2, 0 ));
12971298 then
12981299 (cache,Values . STRING ("Error reading the simulation result." ),st);
12991300
@@ -1371,8 +1372,8 @@ algorithm
13711372 (cache,Values.RECORD(orderd={Values.STRING(filename)}),_) = Ceval.ceval(cache,env,
13721373 Exp.CREF(Exp.CREF_IDENT("currentSimulationResult",Exp.OTHER(),{}),Exp.OTHER()), true, SOME(st), NONE, msg);
13731374
1374- Values.ARRAY({Values.ARRAY(varValues)}) = System .readPtolemyplotDataset(filename, vars_1, 0);
1375- Values.ARRAY({Values.ARRAY(timeValues)}) = System .readPtolemyplotDataset(filename, {"time"}, 0);
1375+ Values.ARRAY({Values.ARRAY(varValues)}) = SimulationResults .readPtolemyplotDataset(filename, vars_1, 0);
1376+ Values.ARRAY({Values.ARRAY(timeValues)}) = SimulationResults .readPtolemyplotDataset(filename, {"time"}, 0);
13761377
13771378
13781379 tV = Values.valueReals(timeValues);
@@ -1408,8 +1409,8 @@ algorithm
14081409 (cache,Values.RECORD(orderd={Values.STRING(filename)}),_) = Ceval.ceval(cache,env,
14091410 Exp.CREF(Exp.CREF_IDENT("currentSimulationResult",Exp.OTHER(),{}),Exp.OTHER()), true, SOME(st), NONE, msg);
14101411
1411- Values.ARRAY({Values.ARRAY(varValues)}) = System .readPtolemyplotDataset(filename, vars_1, 0);
1412- Values.ARRAY({Values.ARRAY(timeValues)}) = System .readPtolemyplotDataset(filename, {"time"}, 0);
1412+ Values.ARRAY({Values.ARRAY(varValues)}) = SimulationResults .readPtolemyplotDataset(filename, vars_1, 0);
1413+ Values.ARRAY({Values.ARRAY(timeValues)}) = SimulationResults .readPtolemyplotDataset(filename, {"time"}, 0);
14131414
14141415
14151416 tV = Values.valueReals(timeValues);
@@ -1522,7 +1523,7 @@ algorithm
15221523 (length > 1 ) = true ;
15231524 (cache,Values . RECORD (orderd= {Values . STRING (filename)}),_) = Ceval . ceval(cache,env,
15241525 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,Exp . OTHER (),{}),Exp . OTHER ()), true , SOME (st), NONE , msg);
1525- value = System . readPtolemyplotDataset(filename, vars_1, 0 );
1526+ value = SimulationResults . readPtolemyplotDataset(filename, vars_1, 0 );
15261527 pwd = System . pwd();
15271528 cit = winCitation();
15281529 omhome = Settings . getInstallationDirectoryPath();
@@ -1565,7 +1566,7 @@ algorithm
15651566 vars_1 = Util . listMap(vars, Exp . printExpStr) "Catch error reading simulation file." ;
15661567 (cache,Values . RECORD (orderd= {Values . STRING (filename)}),_) = Ceval . ceval(cache,env,
15671568 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,Exp . OTHER (),{}),Exp . OTHER ()), true , SOME (st), NONE , msg) "Util.list_union_elt( \" time \" ,vars \' ) => vars \'\' &" ;
1568- failure(_ = System . readPtolemyplotDataset(filename, vars_1, 0 ));
1569+ failure(_ = SimulationResults . readPtolemyplotDataset(filename, vars_1, 0 ));
15691570 then
15701571 (cache,Values . STRING ("Error reading the simulation result." ),st);
15711572
@@ -1621,7 +1622,7 @@ algorithm
16211622 filename = Absyn . pathString(className);
16221623 filename = Util . stringAppendList({filename, "_res.plt" });
16231624
1624- value = System . readPtolemyplotDataset(filename, vars_1, 0 );
1625+ value = SimulationResults . readPtolemyplotDataset(filename, vars_1, 0 );
16251626 pwd = System . pwd();
16261627 cit = winCitation();
16271628 omhome = Settings . getInstallationDirectoryPath();
@@ -1659,7 +1660,7 @@ algorithm
16591660 (length > 1 ) = true ;
16601661 (cache,Values . RECORD (orderd= {Values . STRING (filename)}),_) = Ceval . ceval(cache,env,
16611662 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,Exp . OTHER (),{}),Exp . OTHER ()), true , SOME (st), NONE , msg);
1662- value = System . readPtolemyplotDataset(filename, vars_1, 0 );
1663+ value = SimulationResults . readPtolemyplotDataset(filename, vars_1, 0 );
16631664 res = Values . sendPtolemyplotDataset(value, vars_1, "Plot by OpenModelica" , interpolation, title, legend, grid, logX, logY, xLabel, yLabel, points, Exp . printExpStr(xRange), Exp . printExpStr(yRange));
16641665
16651666 then
@@ -1709,7 +1710,7 @@ algorithm
17091710 vars_1 = Util . listMap(vars, Exp . printExpStr) "Catch error reading simulation file." ;
17101711 (cache,Values . RECORD (orderd= {Values . STRING (filename)}),_) = Ceval . ceval(cache,env,
17111712 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,Exp . OTHER (),{}),Exp . OTHER ()), true , SOME (st), NONE , msg) "Util.list_union_elt( \" time \" ,vars \' ) => vars \'\' &" ;
1712- failure(_ = System . readPtolemyplotDataset(filename, vars_1, 0 ));
1713+ failure(_ = SimulationResults . readPtolemyplotDataset(filename, vars_1, 0 ));
17131714 then
17141715 (cache,Values . STRING ("Error reading the simulation result." ),st);
17151716
@@ -2194,8 +2195,8 @@ algorithm
21942195 (cache,Values . RECORD (orderd= {Values . STRING (filename)}),_) = Ceval . ceval(cache,env,
21952196 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,Exp . OTHER (),{}),Exp . OTHER ()), true , SOME (st), NONE , Ceval . NO_MSG ());
21962197
2197- Values . ARRAY ({Values . ARRAY (varValues)}) = System . readPtolemyplotDataset(filename, {varName}, 0 );
2198- Values . ARRAY ({Values . ARRAY (timeValues)}) = System . readPtolemyplotDataset(filename, {"time" }, 0 );
2198+ Values . ARRAY ({Values . ARRAY (varValues)}) = SimulationResults . readPtolemyplotDataset(filename, {varName}, 0 );
2199+ Values . ARRAY ({Values . ARRAY (timeValues)}) = SimulationResults . readPtolemyplotDataset(filename, {"time" }, 0 );
21992200
22002201 tV = Values . valueReals(timeValues);
22012202 vV = Values . valueReals(varValues);
0 commit comments