ToKelvin

model ToKelvin "Conversion block from degFahrenheit to Kelvin"
    Modelica.Blocks.Interfaces.RealInput Fahrenheit(unit = "degF") annotation (Placement(transformation(extent = {
        {-140, -20}, 
        {-100, 20}})));
    Modelica.Blocks.Interfaces.RealOutput Kelvin(unit = "K") annotation (Placement(transformation(extent = {
        {100, -10}, 
        {120, 10}})));
equation
    Kelvin = Modelica.SIunits.Conversions.from_degF(Fahrenheit);

    annotation (
        Diagram(graphics = {
            Ellipse(
                extent = {
                    {-40, 40}, 
                    {40, -40}},
                lineThickness = 0.5,
                fillColor = {255, 255, 255},
                fillPattern = FillPattern.Solid), 
            Text(
                extent = {
                    {-40, -50}, 
                    {-99, -99}},
                textString = "degF"), 
            Text(
                extent = {
                    {100, -47}, 
                    {44, -100}},
                textString = "K"), 
            Line(
                points = {
                    {-100, 0}, 
                    {-40, 0}},
                color = {0, 0, 255}), 
            Line(
                points = {
                    {41, 0}, 
                    {100, 0}},
                color = {0, 0, 255})}),
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Ellipse(
                    extent = {
                        {-40, 40}, 
                        {40, -40}},
                    lineThickness = 0.5,
                    fillColor = {255, 255, 255},
                    fillPattern = FillPattern.Solid), 
                Text(
                    extent = {
                        {130, -42}, 
                        {38, -94}},
                    textString = "K"), 
                Line(
                    points = {
                        {-41, 0}, 
                        {-100, 0}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {100, 0}, 
                        {40, 0}},
                    color = {0, 0, 255}), 
                Text(
                    extent = {
                        {-150, 90}, 
                        {150, 50}},
                    textString = "%name",
                    lineColor = {0, 0, 255}), 
                Text(
                    extent = {
                        {-42, -44}, 
                        {-153, -91}},
                    textString = "degF")}),
        Documentation(info = "<html>\n<p>\nThis component converts a input signal from degree Fahrenheit to Kelvin\nand provides is as output signal.\n</p>\n</html>"));
end ToKelvin;