Crossing

model Crossing "Crossing of two branches"
    FluxTubes.Interfaces.PositiveMagneticPort port_p1 "Positive port_p1 connected with port_p2"
        annotation (Placement(transformation(extent = {
            {-110, 90}, 
            {-90, 110}})));
    FluxTubes.Interfaces.PositiveMagneticPort port_p2 "Positive port_p2 connected with port_p1"
        annotation (Placement(transformation(extent = {
            {90, -110}, 
            {110, -90}})));
    FluxTubes.Interfaces.NegativeMagneticPort port_n1 "Negative port_n1 connected with port_n2"
        annotation (Placement(transformation(extent = {
            {-110, -110}, 
            {-90, -90}})));
    FluxTubes.Interfaces.NegativeMagneticPort port_n2 "Negative port_n2 connected with port_n1"
        annotation (Placement(transformation(extent = {
            {90, 90}, 
            {110, 110}})));
equation
    connect(port_n1,port_n2) annotation (Line(
        points = {
            {-100, -100}, 
            {-100, 0}, 
            {100, 0}, 
            {100, 100}},
        color = {255, 128, 0}));
    connect(port_p1,port_p2) annotation (Line(
        points = {
            {-100, 100}, 
            {-100, 20}, 
            {0, 20}, 
            {0, -20}, 
            {100, -20}, 
            {100, -100}},
        color = {255, 128, 0}));

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = false,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    points = {
                        {100, 100}, 
                        {40, 100}, 
                        {-40, -100}, 
                        {-100, -100}},
                    color = {255, 128, 0}), 
                Line(
                    points = {
                        {-100, 100}, 
                        {-40, 100}, 
                        {40, -100}, 
                        {100, -100}},
                    color = {255, 128, 0}), 
                Text(
                    extent = {
                        {-150, 110}, 
                        {150, 150}},
                    lineColor = {0, 0, 255},
                    textString = "%name")}),
        Documentation(
            info = "<html>\n<p>\nThis is a simple crossing of two branches. The ports <code>port_p1</code> and <code>port_p2</code> are connected, as well as <code>port_n1</code> and <code>port_n2</code>.\n</p>\n\n<h4>See also</h4>\n<p>\n<a href=\"modelica://Modelica.Magnetic.FundamentalWave.Components.Idle\">Idle</a>,\n<a href=\"modelica://Modelica.Magnetic.FundamentalWave.Components.Short\">Short</a>\n</p>\n\n</html>",
            revisions = "<html>\n<h5>Version 3.2.2, 2014-01-15 (Christian Kral)</h5>\n<ul>\n<li>Added crossing model</li>\n</ul>\n\n</html>"));
end Crossing;