Changeset 15307
Legend:
- Unmodified
- Added
- Removed
-
trunk/Compiler/FrontEnd/ConnectUtil.mo
r14813 r15307 2604 2604 case (Connect.SET(ty = Connect.EQU(), elements = eql), _, _, _) 2605 2605 equation 2606 // here we do some overco sntrained connection breaking2606 // here we do some overconstrained connection breaking 2607 2607 eql = ConnectionGraph.removeBrokenConnects(eql, inConnected, inBroken); 2608 2608 dae = generateEquEquations(eql); … … 2657 2657 list<DAE.Element> eq; 2658 2658 String str; 2659 Boolean order_conn; 2659 2660 2660 2661 case {} then DAEUtil.emptyDae; … … 2665 2666 (e2 as Connect.CONNECTOR_ELEMENT(name = y, source = y_src)) :: rest_el) 2666 2667 equation 2667 e1 = Util.if_(Config.orderConnections(), e1, e2); 2668 order_conn = Config.orderConnections(); 2669 e1 = Util.if_(order_conn, e1, e2); 2668 2670 DAE.DAE(eq) = generateEquEquations(e1 :: rest_el); 2671 (x, y) = Util.swap(shouldFlipEquEquation(x, x_src, order_conn), x, y); 2669 2672 src = DAEUtil.mergeSources(x_src, y_src); 2670 2673 src = DAEUtil.addElementSourceConnectOpt(src, SOME((x, y))); … … 2683 2686 end generateEquEquations; 2684 2687 2688 protected function shouldFlipEquEquation 2689 "If the flag +orderConnections=false is used, then we should keep the order of 2690 the connector elements as they occur in the connection (if possible). In that 2691 case we check if the cref of the first argument to the first connection 2692 stored in the element source is a prefix of the connector element cref. If 2693 it isn't, indicate that we should flip the generated equation." 2694 input DAE.ComponentRef inLhsCref; 2695 input DAE.ElementSource inLhsSource; 2696 input Boolean inShouldOrder; 2697 output Boolean outShouldFlip; 2698 algorithm 2699 outShouldFlip := matchcontinue(inLhsCref, inLhsSource, inShouldOrder) 2700 local 2701 DAE.ComponentRef lhs; 2702 2703 case (_, DAE.SOURCE(connectEquationOptLst = SOME((lhs, _)) :: _), false) 2704 then not ComponentReference.crefPrefixOf(lhs, inLhsCref); 2705 2706 else false; 2707 end matchcontinue; 2708 end shouldFlipEquEquation; 2709 2685 2710 protected function generateFlowEquations 2686 2711 "Generating equations from a flow connection set is a little trickier that -
trunk/testsuite/flattening/modelica/connectors/Makefile
r14813 r15307 29 29 ConnectInnerOuter2.mo \ 30 30 ConnectInnerOuter3.mo \ 31 ConnectionOrder1.mo \ 32 ConnectionOrder2.mo \ 31 33 ConnectorComponents.mo \ 32 34 ConnectorIllegal.mo \
Note: See TracChangeset
for help on using the changeset viewer.