Multiplex4

block Multiplex4 "Multiplexer block for four input connectors"
    extends Modelica.Blocks.Icons.Block;

    parameter Integer n1 = 1 "Dimension of input signal connector 1";
    parameter Integer n2 = 1 "Dimension of input signal connector 2";
    parameter Integer n3 = 1 "Dimension of input signal connector 3";
    parameter Integer n4 = 1 "Dimension of input signal connector 4";
    Modelica.Blocks.Interfaces.RealInput u1[n1] "Connector of Real input signals 1"
        annotation (Placement(transformation(extent = {
            {-140, 70}, 
            {-100, 110}})));
    Modelica.Blocks.Interfaces.RealInput u2[n2] "Connector of Real input signals 2"
        annotation (Placement(transformation(extent = {
            {-140, 10}, 
            {-100, 50}})));
    Modelica.Blocks.Interfaces.RealInput u3[n3] "Connector of Real input signals 3"
        annotation (Placement(transformation(extent = {
            {-140, -50}, 
            {-100, -10}})));
    Modelica.Blocks.Interfaces.RealInput u4[n4] "Connector of Real input signals 4"
        annotation (Placement(transformation(extent = {
            {-140, -110}, 
            {-100, -70}})));
    Modelica.Blocks.Interfaces.RealOutput y[n1 + n2 + n3 + n4] "Connector of Real output signals"
        annotation (Placement(transformation(extent = {
            {100, -10}, 
            {120, 10}})));
equation
    [y] = [u1; u2; u3; u4];

    annotation (
        Documentation(info = "<html>\n<p>\nThe output connector is the <strong>concatenation</strong> of the four input connectors.\nNote, that the dimensions of the input connector signals have to be\nexplicitly defined via parameters n1, n2, n3 and n4.\n</p>\n</html>"),
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    points = {
                        {8, 0}, 
                        {102, 0}},
                    color = {0, 0, 127}), 
                Line(
                    points = {
                        {-100, 90}, 
                        {-60, 90}, 
                        {-3, 4}},
                    color = {0, 0, 127}), 
                Line(
                    points = {
                        {-100, 30}, 
                        {-60, 30}, 
                        {0, 0}},
                    color = {0, 0, 127}), 
                Line(
                    points = {
                        {-100, -30}, 
                        {-60, -30}, 
                        {0, 0}},
                    color = {0, 0, 127}), 
                Line(
                    points = {
                        {-100, -90}, 
                        {-60, -90}, 
                        {-5, -6}},
                    color = {0, 0, 127}), 
                Ellipse(
                    extent = {
                        {-15, 15}, 
                        {15, -15}},
                    fillColor = {0, 0, 127},
                    fillPattern = FillPattern.Solid,
                    lineColor = {0, 0, 127})}),
        Diagram(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    points = {
                        {-100, 90}, 
                        {-60, 90}, 
                        {0, 0}},
                    color = {0, 0, 127}), 
                Line(
                    points = {
                        {-100, -90}, 
                        {-60, -90}, 
                        {0, 0}},
                    color = {0, 0, 127}), 
                Line(
                    points = {
                        {8, 0}, 
                        {102, 0}},
                    color = {0, 0, 127}), 
                Ellipse(
                    extent = {
                        {-15, 15}, 
                        {15, -15}},
                    fillColor = {0, 0, 127},
                    fillPattern = FillPattern.Solid,
                    lineColor = {0, 0, 127}), 
                Line(
                    points = {
                        {-100, 30}, 
                        {-60, 30}, 
                        {0, 0}},
                    color = {0, 0, 127}), 
                Line(
                    points = {
                        {-100, -30}, 
                        {-59, -30}, 
                        {0, 0}},
                    color = {0, 0, 127})}));
end Multiplex4;