@@ -2204,6 +2204,8 @@ algorithm
22042204 vars = Util . listMap(vars,Exp . CodeVarToCref );
22052205 vars_1 = Util . listMap(vars, Exp . printExpStr) "plot" ;
22062206 vars_2 = Util . listUnionElt("time" , vars_1);
2207+
2208+
22072209 (cache,Values . RECORD (_,{Values . STRING (filename)},_),_) = ceval(cache,env,
22082210 Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,{}),Exp . OTHER ()), true , SOME (st), NONE , msg);
22092211 value = System . readPtolemyplotDataset(filename, vars_2, 0 );
@@ -2268,7 +2270,7 @@ algorithm
22682270 local list< Exp . Exp > vars;
22692271 then
22702272 (cache,Values . STRING ("Unknown error while plotting" ),st);
2271-
2273+
22722274 case (cache,env,
22732275 Exp . CALL (
22742276 path = Absyn . IDENT (name = "val" ),
@@ -2284,18 +2286,26 @@ algorithm
22842286 Real timeStamp;
22852287 list< Values . Value > varValues, timeValues;
22862288 list< Real > tV, vV;
2287- Real val;
2288-
2289+ Real val;
22892290 equation
2290- var = Exp . printExpStr(Exp . CodeVarToCref (varName));
2291- (cache,Values . REAL (timeStamp),SOME (st)) = ceval(cache,env, varTimeStamp, true , SOME (st), NONE , msg);
2291+
2292+ {varName} = Util . listMap({varName},Exp . CodeVarToCref );
2293+ vars_1 = Util . listMap({varName}, Exp . printExpStr);
2294+ // Util.listMap0(vars_1,print);
2295+
2296+ (cache,Values . REAL (timeStamp),SOME (st)) = ceval(cache,env, varTimeStamp, true , SOME (st), NONE , msg);
2297+
22922298 (cache,Values . RECORD (_,{Values . STRING (filename)},_),_) = ceval(cache,env,
2293- Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,{}),Exp . OTHER ()), true , SOME (st), NONE , msg);
2294- Values . ARRAY ({Values . ARRAY (varValues)}) = System . readPtolemyplotDataset(filename, {var }, 0 );
2295- Values . ARRAY ({Values . ARRAY (timeValues)}) = System . readPtolemyplotDataset(filename, {"time" }, 0 );
2299+ Exp . CREF (Exp . CREF_IDENT ("currentSimulationResult" ,{}),Exp . OTHER ()), true , SOME (st), NONE , msg);
2300+
2301+ Values . ARRAY ({Values . ARRAY (varValues)}) = System . readPtolemyplotDataset(filename, vars_1, 0 );
2302+ Values . ARRAY ({Values . ARRAY (timeValues)}) = System . readPtolemyplotDataset(filename, {"time" }, 0 );
2303+
2304+
22962305 tV = Values . valueReals(timeValues);
2297- vV = Values . valueReals(varValues);
2306+ vV = Values . valueReals(varValues);
22982307 val = System . getVariableValue(timeStamp, tV, vV);
2308+
22992309 then
23002310 (cache,Values . REAL (val),st);
23012311
0 commit comments