Skip to content

Commit

Permalink
- Added new package ConnectionSets to handle connection sets.
Browse files Browse the repository at this point in the history
- Lots of connection handling improvements.
- Some updates of the omc translations.
- Added case for SCodeInst to CevalScript.runFrontEndWork which mimics the old
  instantiation, to make it easier to compare the new and old instantiation.
- Probably lots of other things too...


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@12754 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
perost committed Aug 31, 2012
1 parent 4536cb4 commit 1b7051d
Show file tree
Hide file tree
Showing 25 changed files with 3,225 additions and 1,236 deletions.
29 changes: 13 additions & 16 deletions Compiler/FrontEnd/ComponentReference.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1357,30 +1357,27 @@ algorithm
end match;
end crefLastCref;

public function crefType "function: crefType
Function for extracting the type out of the first cref of a componentReference. "
input DAE.ComponentRef inRef;
output DAE.Type res;
public function crefType
"Function for extracting the type of the first identifier of a cref."
input DAE.ComponentRef inCref;
output DAE.Type outType;
algorithm
res := matchcontinue (inRef)
outType := match(inCref)
local
DAE.Type t2;
String s;

case(inRef as DAE.CREF_IDENT(_,t2,_)) then t2;
DAE.Type ty;

case(inRef as DAE.CREF_QUAL(_,t2,_,_)) then t2;
case DAE.CREF_IDENT(identType = ty) then ty;
case DAE.CREF_QUAL(identType = ty) then ty;

case(inRef)
else
equation
true = Flags.isSet(Flags.FAILTRACE);
Debug.fprint(Flags.FAILTRACE, "ComponentReference.crefType failed on Cref:");
s = printComponentRefStr(inRef);
Debug.fprint(Flags.FAILTRACE, s);
Debug.fprint(Flags.FAILTRACE, "\n");
Debug.trace("ComponentReference.crefType failed on cref: ");
Debug.traceln(printComponentRefStr(inCref));
then
fail();
end matchcontinue;

end match;
end crefType;

public function crefLastType "returns the 'last' type of a cref.
Expand Down
11 changes: 11 additions & 0 deletions Compiler/FrontEnd/Connect2.mo
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,21 @@ public uniontype ExpandableConnector
end EXPANDABLE_CONNECTOR;
end ExpandableConnector;

public uniontype ConnectorType
"The type of a connector element."
record POTENTIAL end POTENTIAL;
record FLOW end FLOW;
record STREAM
Option<DAE.ComponentRef> associatedFlow;
end STREAM;
record NO_TYPE end NO_TYPE;
end ConnectorType;

public uniontype Connector
record CONNECTOR
DAE.ComponentRef name;
Face face;
ConnectorType ty;
end CONNECTOR;
end Connector;

Expand Down
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/ConnectUtil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2312,7 +2312,7 @@ algorithm

// Both outside:
// cr1 = inStream(cr2);
// cr2 = inStream(cr2);
// cr2 = inStream(cr1);
case ({Connect.CONNECTOR_ELEMENT(name = cr1, face = Connect.OUTSIDE(), source = src1),
Connect.CONNECTOR_ELEMENT(name = cr2, face = Connect.OUTSIDE(), source = src2)})
equation
Expand Down

0 comments on commit 1b7051d

Please sign in to comment.