Skip to content

Commit

Permalink
[NF] Don't trust global connector flags.
Browse files Browse the repository at this point in the history
- Set the "has stream operators" flag when typing a stream connector,
  rather than trusting what SCodeUtil has set. SCodeUtil operates on
  all loaded models rather than only the used classes, and the flag
  might be overwritten by API calls before the NF is called.
- Clear the overconstrained connector flag at the start of
  instantiation, since the NF already sets it itself.
  • Loading branch information
perost committed Jul 5, 2019
1 parent 9fa7b26 commit 96cf577
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 2 additions & 0 deletions OMCompiler/Compiler/NFFrontEnd/NFInst.mo
Expand Up @@ -126,6 +126,8 @@ algorithm
end if;

System.setUsesCardinality(false);
System.setHasOverconstrainedConnectors(false);
System.setHasStreamConnectors(false);

// Create a root node from the given top-level classes.
top := makeTopNode(program);
Expand Down
12 changes: 4 additions & 8 deletions OMCompiler/Compiler/NFFrontEnd/NFTyping.mo
Expand Up @@ -395,6 +395,10 @@ algorithm
end for;

connectorTy := ComplexType.CONNECTOR(pots, flows, streams);

if not listEmpty(streams) then
System.setHasStreamConnectors(true);
end if;
end if;
end makeConnectorType;

Expand Down Expand Up @@ -2159,14 +2163,6 @@ algorithm
typeComponentSections(InstNode.resolveOuter(c), origin);
end for;

// we need to update the ClassTree and add the expandable virtual components from the connects
if System.getHasExpandableConnectors() then
// collect the expandable virtual components from the connect equations

// create the components inside the existing expandable connectors
end if;


InstNode.updateClass(typed_cls, classNode);
then
();
Expand Down

0 comments on commit 96cf577

Please sign in to comment.