Skip to content

Commit

Permalink
Fixed bug with unconnected flow variables. Fixed MC bug #572.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@2361 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Peter Aronsson committed May 11, 2006
1 parent aa933ea commit 6be39ae
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Compiler/Connect.mo
Expand Up @@ -670,6 +670,8 @@ algorithm
v2 = Env.localInsideConnectorFlowvars(env);
vars = listAppend(v1, v2);
vars2 = getOuterFlowVariables(csets);
// last array subscripts are not present in vars, therefor removed from vars2 too.
vars2 = Util.listMap(vars2,Exp.crefStripLastSubs);
unconnectedvars = removeVariables(vars, vars2);
dae_1 = generateZeroflowEquations(unconnectedvars);
then
Expand Down
31 changes: 31 additions & 0 deletions Compiler/Interactive.mo
Expand Up @@ -10564,11 +10564,40 @@ algorithm
list<Absyn.ComponentRef> res;
list<Absyn.ClassPart> parts;
list<Env.Frame> env;
Absyn.Path tp;
case (Absyn.CLASS(body = Absyn.PARTS(classParts = parts)),env)
equation
res = getBaseClassesFromParts(parts, env);
then
res;
case (Absyn.CLASS(body = Absyn.DERIVED(path=tp)),env)
local
Env.Env cenv;
Absyn.Path envpath,p1;
String tpname,str;
Absyn.ComponentRef cref;
SCode.Class c;
equation
(c,cenv) = Lookup.lookupClass(env, tp, true);
SOME(envpath) = Env.getEnvPath(cenv);
tpname = Absyn.pathLastIdent(tp);
p1 = Absyn.joinPaths(envpath, Absyn.IDENT(tpname));
cref = Absyn.pathToCref(p1);
str = Absyn.pathString(p1);
then {cref};
case (Absyn.CLASS(body = Absyn.DERIVED(path=tp)),env)
local
Env.Env cenv;
Absyn.Path envpath,p1;
String tpname,str;
Absyn.ComponentRef cref;

SCode.Class c;
equation
(c,cenv) = Lookup.lookupClass(env, tp, true);
NONE = Env.getEnvPath(cenv);
cref = Absyn.pathToCref(tp);
then {cref};
case (_,_) then {};
end matchcontinue;
end getBaseClasses;
Expand Down Expand Up @@ -10661,11 +10690,13 @@ algorithm
local
Integer res;
list<Absyn.ClassPart> parts;
Absyn.Path tp;
case (Absyn.CLASS(body = Absyn.PARTS(classParts = parts)))
equation
res = countBaseClassesFromParts(parts);
then
res;
case (Absyn.CLASS(body = Absyn.DERIVED(path=tp))) then 1;
case (_) then 0;
end matchcontinue;
end countBaseClasses;
Expand Down

0 comments on commit 6be39ae

Please sign in to comment.