diff --git a/Modelica/Mechanics/MultiBody/Visualizers/Advanced/Shape.mo b/Modelica/Mechanics/MultiBody/Visualizers/Advanced/Shape.mo index ef29a9a31f..0e9a54447a 100644 --- a/Modelica/Mechanics/MultiBody/Visualizers/Advanced/Shape.mo +++ b/Modelica/Mechanics/MultiBody/Visualizers/Advanced/Shape.mo @@ -3,7 +3,7 @@ model Shape "Visualizing an elementary object with variable size; all data have to be set as modifiers (see info layer)" extends ModelicaServices.Animation.Shape; - extends Modelica.Utilities.Internal.PartialModelicaServices.Animation.PartialShape; + extends ModelicaServices.AnimationInterface.PartialShape; annotation ( Icon(coordinateSystem( diff --git a/Modelica/Mechanics/MultiBody/Visualizers/Advanced/Surface.mo b/Modelica/Mechanics/MultiBody/Visualizers/Advanced/Surface.mo index 4fc065e03d..633e863937 100644 --- a/Modelica/Mechanics/MultiBody/Visualizers/Advanced/Surface.mo +++ b/Modelica/Mechanics/MultiBody/Visualizers/Advanced/Surface.mo @@ -2,7 +2,7 @@ within Modelica.Mechanics.MultiBody.Visualizers.Advanced; model Surface "Visualizing a moveable, parameterized surface; the surface characteristic is provided by a function" extends Modelica.Mechanics.MultiBody.Icons.Surface; - extends Modelica.Utilities.Internal.PartialModelicaServices.Animation.PartialSurface; + extends ModelicaServices.AnimationInterface.PartialSurface; extends ModelicaServices.Animation.Surface; annotation (Icon(graphics={Polygon( points={{-102,40},{-98,92},{28,-8},{96,146},{104,-118},{-18,-34},{-52, diff --git a/Modelica/Mechanics/MultiBody/Visualizers/Advanced/Vector.mo b/Modelica/Mechanics/MultiBody/Visualizers/Advanced/Vector.mo index fe8aee5e8b..5a693281fe 100644 --- a/Modelica/Mechanics/MultiBody/Visualizers/Advanced/Vector.mo +++ b/Modelica/Mechanics/MultiBody/Visualizers/Advanced/Vector.mo @@ -2,7 +2,7 @@ within Modelica.Mechanics.MultiBody.Visualizers.Advanced; model Vector "Visualizing a vector quantity (force, torque, etc.)" extends ModelicaServices.Animation.Vector; - extends Modelica.Utilities.Internal.PartialModelicaServices.Animation.PartialVector; + extends ModelicaServices.AnimationInterface.PartialVector; annotation ( Documentation(info=" diff --git a/Modelica/Utilities/Files.mo b/Modelica/Utilities/Files.mo index 0d9a310087..601deeca6f 100644 --- a/Modelica/Utilities/Files.mo +++ b/Modelica/Utilities/Files.mo @@ -692,8 +692,6 @@ end temporaryFileName; function loadResource "Return the absolute path name of a URI or local file name" - extends - Modelica.Utilities.Internal.PartialModelicaServices.ExternalReferences.PartialLoadResource; extends ModelicaServices.ExternalReferences.loadResource; annotation ( Documentation(info= diff --git a/Modelica/Utilities/Internal.mo b/Modelica/Utilities/Internal.mo index acfc1725ef..b87b4e6be6 100644 --- a/Modelica/Utilities/Internal.mo +++ b/Modelica/Utilities/Internal.mo @@ -3,157 +3,6 @@ package Internal "Internal components that a user should usually not directly utilize" extends Modelica.Icons.InternalPackage; import Modelica.Units.SI; -package PartialModelicaServices - "Interfaces of components requiring a tool specific implementation" - extends Modelica.Icons.InternalPackage; - package Animation "Models and functions for 3-dim. animation" - extends Modelica.Icons.Package; - partial model PartialShape "Interface for 3D animation of elementary shapes" - - import Modelica.Mechanics.MultiBody.Frames; - import Modelica.Mechanics.MultiBody.Types; - - parameter Types.ShapeType shapeType="box" - "Type of shape (box, sphere, cylinder, pipecylinder, cone, pipe, beam, gearwheel, spring, )"; - input Frames.Orientation R=Frames.nullRotation() - "Orientation object to rotate the world frame into the object frame" annotation(Dialog); - input SI.Position r[3]={0,0,0} - "Position vector from origin of world frame to origin of object frame, resolved in world frame" annotation(Dialog); - input SI.Position r_shape[3]={0,0,0} - "Position vector from origin of object frame to shape origin, resolved in object frame" annotation(Dialog); - input Real lengthDirection[3](each final unit="1")={1,0,0} - "Vector in length direction, resolved in object frame" annotation(Dialog); - input Real widthDirection[3](each final unit="1")={0,1,0} - "Vector in width direction, resolved in object frame" annotation(Dialog); - input SI.Length length=0 "Length of visual object" annotation(Dialog); - input SI.Length width=0 "Width of visual object" annotation(Dialog); - input SI.Length height=0 "Height of visual object" annotation(Dialog); - input Types.ShapeExtra extra=0.0 - "Additional size data for some of the shape types" annotation(Dialog); - input Real color[3]={255,0,0} "Color of shape" annotation(Dialog(colorSelector=true)); - input Types.SpecularCoefficient specularCoefficient = 0.7 - "Reflection of ambient light (= 0: light is completely absorbed)" annotation(Dialog); - - annotation ( - Documentation(info=" -

-This model is documented at -Modelica.Mechanics.MultiBody.Visualizers.Advanced.Shape. -

-")); - - end PartialShape; - - partial model PartialVector "Interface for 3D animation of a vector quantity (force, torque etc)" - import Modelica.Mechanics.MultiBody.Types; - import Modelica.Mechanics.MultiBody.Frames; - - input Frames.Orientation R=Frames.nullRotation() - "Orientation object to rotate the world frame into the vector frame" annotation(Dialog); - input SI.Position r[3]={0,0,0} - "Position vector from origin of world frame to origin of vector frame, resolved in world frame" annotation(Dialog); - input Real coordinates[3]={0,0,0} - "Coordinates of the vector resolved in vector frame" annotation(Dialog); - input Types.Color color=Types.Defaults.ArrowColor - "Color of vector" annotation(Dialog(colorSelector=true)); - input Types.SpecularCoefficient specularCoefficient = 0.7 - "Material property describing the reflecting of ambient light (= 0 means, that light is completely absorbed)" annotation(Dialog); - parameter Types.VectorQuantity quantity = Types.VectorQuantity.Force "Quantity of the coordinates"; - input Boolean headAtOrigin=false "= true, if the vector is pointing towards the origin of vector frame" annotation(Dialog); - input Boolean twoHeadedArrow=false "= true, if the arrow has two heads after each other (pointing in the same direction)" annotation(Dialog); - - annotation ( - Documentation(info=" -

-This model is documented at -Modelica.Mechanics.MultiBody.Visualizers.Advanced.Vector. -

-")); - end PartialVector; - - partial model PartialSurface "Interface for 3D animation of surfaces" - - import Modelica.Mechanics.MultiBody.Frames; - import Modelica.Mechanics.MultiBody.Types; - - input Frames.Orientation R=Frames.nullRotation() - "Orientation object to rotate the world frame into the surface frame" - annotation(Dialog(group="Surface frame")); - input SI.Position r_0[3]={0,0,0} - "Position vector from origin of world frame to origin of surface frame, resolved in world frame" - annotation(Dialog(group="Surface frame")); - - parameter Integer nu=2 "Number of points in u-Dimension" annotation(Dialog(group="Surface properties")); - parameter Integer nv=2 "Number of points in v-Dimension" annotation(Dialog(group="Surface properties")); - replaceable function surfaceCharacteristic = - Modelica.Mechanics.MultiBody.Interfaces.partialSurfaceCharacteristic - "Function defining the surface characteristic" - annotation(choicesAllMatching=true,Dialog(group="Surface properties")); - - parameter Boolean wireframe=false "= true: 3D model will be displayed without faces" - annotation (Dialog(group="Material properties"),choices(checkBox=true)); - parameter Boolean multiColoredSurface=false "= true: Color is defined for each surface point" - annotation(Dialog(group="Material properties"),choices(checkBox=true)); - input Real color[3]={255,0,0} "Color of surface" annotation(Dialog(colorSelector=true,group="Material properties", enable=not multiColoredSurface)); - input Types.SpecularCoefficient specularCoefficient = 0.7 - "Reflection of ambient light (= 0: light is completely absorbed)" - annotation(Dialog(group="Material properties")); - input Real transparency=0 "Transparency of shape: 0 (= opaque) ... 1 (= fully transparent)" - annotation(Dialog(group="Material properties")); - - annotation (Documentation(info=" -

-This model is documented at -Modelica.Mechanics.MultiBody.Visualizers.Advanced.Surface. -

-")); - end PartialSurface; - end Animation; - - package ExternalReferences "Functions to access external resources" - extends Modelica.Icons.InternalPackage; - partial function PartialLoadResource - "Interface for tool specific function to return the absolute path name of a URI or local file name" - extends Modelica.Icons.Function; - input String uri "URI or local file name"; - output String fileReference "Absolute path name of file"; - annotation (Documentation(info=" -

-This partial function defines the function interface of a tool-specific implementation -in package ModelicaServices. The interface is documented at -Modelica.Utilities.Internal.FileSystem.loadResource. -

- -")); - end PartialLoadResource; - end ExternalReferences; - - package System "System dependent functions" - extends Modelica.Icons.InternalPackage; - partial function exitBase "Interface for tool specific function to terminate the execution of the Modelica environment" - extends Modelica.Icons.Function; - input Integer status=0 "Result to be returned by environment (0 means success)"; - annotation (Documentation(info=" -

-This partial function defines the function interface of a tool-specific implementation -in package ModelicaServices. -

-")); - end exitBase; - end System; - annotation (Documentation(info=" - -

-This package contains interfaces of a set of functions and models used in the -Modelica Standard Library that requires a tool specific implementation. -There is an associated package called ModelicaServices. A tool vendor -should provide a proper implementation of this library for the corresponding -tool. The default implementation is \"do nothing\". -In the Modelica Standard Library, the models and functions of ModelicaServices -are used. -

-")); -end PartialModelicaServices; package FileSystem "Internal package with external functions as interface to the file system" diff --git a/ModelicaServices/AnimationInterface/Frames/Orientation.mo b/ModelicaServices/AnimationInterface/Frames/Orientation.mo new file mode 100644 index 0000000000..76592fa726 --- /dev/null +++ b/ModelicaServices/AnimationInterface/Frames/Orientation.mo @@ -0,0 +1,8 @@ +within ModelicaServices.AnimationInterface.Frames; +record Orientation + "Orientation object defining rotation from a frame 1 into a frame 2" + extends Icons.Record; + Real T[3, 3] "Transformation matrix from world frame to local frame"; + Types.AngularVelocity w[3] + "Absolute angular velocity of local frame, resolved in local frame"; +end Orientation; diff --git a/ModelicaServices/AnimationInterface/Frames/nullRotation.mo b/ModelicaServices/AnimationInterface/Frames/nullRotation.mo new file mode 100644 index 0000000000..0aafbe21e8 --- /dev/null +++ b/ModelicaServices/AnimationInterface/Frames/nullRotation.mo @@ -0,0 +1,9 @@ +within ModelicaServices.AnimationInterface.Frames; +function nullRotation + "Return orientation object that does not rotate a frame" + extends Icons.Function; + output Orientation R + "Orientation object such that frame 1 and frame 2 are identical"; +algorithm + R := Orientation(T=identity(3),w= zeros(3)); +end nullRotation; diff --git a/ModelicaServices/AnimationInterface/Frames/package.mo b/ModelicaServices/AnimationInterface/Frames/package.mo new file mode 100644 index 0000000000..e5a5573642 --- /dev/null +++ b/ModelicaServices/AnimationInterface/Frames/package.mo @@ -0,0 +1,4 @@ +within ModelicaServices.AnimationInterface; + +package Frames +end Frames; diff --git a/ModelicaServices/AnimationInterface/Interfaces/package.mo b/ModelicaServices/AnimationInterface/Interfaces/package.mo new file mode 100644 index 0000000000..ebd0729745 --- /dev/null +++ b/ModelicaServices/AnimationInterface/Interfaces/package.mo @@ -0,0 +1,3 @@ +within ModelicaServices.AnimationInterface; +package Interfaces +end Interfaces; diff --git a/ModelicaServices/AnimationInterface/Interfaces/partialSurfaceCharacteristic.mo b/ModelicaServices/AnimationInterface/Interfaces/partialSurfaceCharacteristic.mo new file mode 100644 index 0000000000..f3c680508f --- /dev/null +++ b/ModelicaServices/AnimationInterface/Interfaces/partialSurfaceCharacteristic.mo @@ -0,0 +1,18 @@ +within ModelicaServices.AnimationInterface.Interfaces; + +partial function partialSurfaceCharacteristic "Interface for a function returning surface characteristics" + extends Modelica.Icons.Function; + input Integer nu "Number of points in u-Dimension"; + input Integer nv "Number of points in v-Dimension"; + input Boolean multiColoredSurface=false + "= true: Color is defined for each surface point"; + output Types.Position X[nu,nv] + "[nu,nv] positions of points in x-Direction resolved in surface frame"; + output Types.Position Y[nu,nv] + "[nu,nv] positions of points in y-Direction resolved in surface frame"; + output Types.Position Z[nu,nv] + "[nu,nv] positions of points in z-Direction resolved in surface frame"; + output Real C[if multiColoredSurface then nu else 0, + if multiColoredSurface then nv else 0,3] + "[nu,nv,3] Color array, defining the color for each surface point"; +end partialSurfaceCharacteristic; diff --git a/ModelicaServices/AnimationInterface/Types/Color.mo b/ModelicaServices/AnimationInterface/Types/Color.mo new file mode 100644 index 0000000000..68a08d6cd3 --- /dev/null +++ b/ModelicaServices/AnimationInterface/Types/Color.mo @@ -0,0 +1,30 @@ +within ModelicaServices.AnimationInterface.Types; + +type Color = Integer[3] (each min=0, each max=255) + "RGB representation of color" + annotation ( + Dialog(colorSelector=true), + choices( + choice={0,0,0} "{0,0,0} \"black\"", + choice={155,0,0} "{155,0,0} \"dark red\"", + choice={255,0,0} "{255,0,0 } \"red\"", + choice={255,65,65} "{255,65,65} \"light red\"", + choice={0,128,0} "{0,128,0} \"dark green\"", + choice={0,180,0} "{0,180,0} \"green\"", + choice={0,230,0} "{0,230,0} \"light green\"", + choice={0,0,200} "{0,0,200} \"dark blue\"", + choice={0,0,255} "{0,0,255} \"blue\"", + choice={0,128,255} "{0,128,255} \"light blue\"", + choice={255,255,0} "{255,255,0} \"yellow\"", + choice={255,0,255} "{255,0,255} \"pink\"", + choice={100,100,100} "{100,100,100} \"dark grey\"", + choice={155,155,155} "{155,155,155} \"grey\"", + choice={255,255,255} "{255,255,255} \"white\""), + Documentation(info=" +

+Type Color is an Integer vector with 3 elements, +{r, g, b}, and specifies the color of a shape. +{r, g, b} are the \"red\", \"green\" and \"blue\" color parts. +Note, r, g and b are given in the range 0 … 255. +

+")); diff --git a/ModelicaServices/AnimationInterface/Types/ShapeExtra.mo b/ModelicaServices/AnimationInterface/Types/ShapeExtra.mo new file mode 100644 index 0000000000..418349fef3 --- /dev/null +++ b/ModelicaServices/AnimationInterface/Types/ShapeExtra.mo @@ -0,0 +1,51 @@ +within ModelicaServices.AnimationInterface.Types; +type ShapeExtra = Real + "Type of the additional data that can be defined for an elementary ShapeType" + annotation ( + Documentation(info=" +

+This type is used in shapes of visual objects to define +extra data depending on the shape type. Usually, input +variable extra is used as instance name: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
shapeTypeMeaning of parameter extra
\"cylinder\"if extra > 0, a black line is included in the + cylinder to show the rotation of it.
\"cone\"extra = diameter-left-side / diameter-right-side, i.e.,
+ extra = 1: cylinder
+ extra = 0: \"real\" cone.
\"pipe\"extra = outer-diameter / inner-diameter, i.e,
+ extra = 1: cylinder that is completely hollow
+ extra = 0: cylinder without a hole.
\"gearwheel\"extra is the number of teeth of the (external) gear. +If extra < 0, an internal gear is visualized with |extra| teeth. +The axis of the gearwheel is along \"lengthDirection\", and usually: +width = height = 2*radiusOfGearWheel.
\"spring\"extra is the number of windings of the spring. + Additionally, \"height\" is not the \"height\" but + 2*coil-width.
external shapeextra = 0: Visualization from file is not scaled.
+ extra = 1: Visualization from file is scaled with \"length\", \"width\" and \"height\" + of the shape
+")); diff --git a/ModelicaServices/AnimationInterface/Types/ShapeType.mo b/ModelicaServices/AnimationInterface/Types/ShapeType.mo new file mode 100644 index 0000000000..66c11b5132 --- /dev/null +++ b/ModelicaServices/AnimationInterface/Types/ShapeType.mo @@ -0,0 +1,63 @@ +within ModelicaServices.AnimationInterface.Types; +type ShapeType = String + "Type of shape (box, sphere, cylinder, pipecylinder, cone, pipe, beam, gearwheel, spring, )" + annotation ( choices( + choice="box" "\"box\"", + choice="sphere" "\"sphere\"", + choice="cylinder" "\"cylinder\"", + choice="pipecylinder" "\"pipecylinder\"", + choice="cone" "\"cone\"", + choice="pipe" "\"pipe\"", + choice="beam" "\"beam\"", + choice="gearwheel" "\"gearwheel\"", + choice="spring" "\"spring\"", + choice="modelica://PackageName/PathName.dxf"), + Documentation(info=" +

+Type ShapeType is used to define the shape of the +visual object as parameter String. Usually, \"shapeType\" is used +as instance name. The following +values for shapeType are possible, e.g., shapeType=\"box\": +

+ +
+\"model +
+ +

+The dark blue arrows in the figure above are directed along +variable lengthDirection. The light blue arrows are directed +along variable widthDirection. The coordinate systems +in the figure represent frame_a of the Shape component. +

+ +

+Additionally, external shapes can be specified as (not all options might be supported by all tools): +

+ + + +

+The supported file formats are tool dependent. Most tools support +at least DXF-files (a tool might support 3-dim. Face of the DXF format only), +but may support other format as well (such as stl, obj, 3ds). +Since visualization files contain color and other data, the corresponding +information in the model is usually ignored. +

+")); diff --git a/ModelicaServices/AnimationInterface/Types/SpecularCoefficient.mo b/ModelicaServices/AnimationInterface/Types/SpecularCoefficient.mo new file mode 100644 index 0000000000..7124d18b6a --- /dev/null +++ b/ModelicaServices/AnimationInterface/Types/SpecularCoefficient.mo @@ -0,0 +1,22 @@ +within ModelicaServices.AnimationInterface.Types; +type SpecularCoefficient = Real(min=0) + "Reflection of ambient light (= 0: light is completely absorbed)" + annotation (choices( + choice=0 "0.0 \"dull\"", + choice=0.7 "0.7 \"medium\"", + choice=1 "1.0 \"glossy\""), + Documentation(info=" +

+Type SpecularCoefficient defines the reflection of +ambient light on shape surfaces. If value = 0, the light +is completely absorbed. Often, 0.7 is a reasonable value. +It might be that from some viewing directions, a body is no +longer visible, if the SpecularCoefficient value is too high. +In the following image, the different values of SpecularCoefficient +are shown for a cylinder: +

+ +
+ +
+")); diff --git a/ModelicaServices/AnimationInterface/Types/VectorQuantity.mo b/ModelicaServices/AnimationInterface/Types/VectorQuantity.mo new file mode 100644 index 0000000000..bd5ed29268 --- /dev/null +++ b/ModelicaServices/AnimationInterface/Types/VectorQuantity.mo @@ -0,0 +1,36 @@ +within ModelicaServices.AnimationInterface.Types; + +type VectorQuantity = enumeration( + Force "Force quantity", + Torque "Torque quantity", + Velocity "Velocity quantity", + Acceleration "Acceleration quantity", + AngularVelocity "Angular velocity quantity", + AngularAcceleration "Angular acceleration quantity", + RelativePosition "Relative position") + "Enumeration defining the kind of physical quantity represented by the vector" + annotation (Documentation(info=" + + + + + + + + + + + + + + + + + + + + + + +
Types.VectorQuantity.Meaning
ForceVector represents a force quantity
TorqueVector represents a torque quantity
VelocityVector represents a velocity quantity
AccelerationVector represents an acceleration quantity
AngularVelocityVector represents an angular velocity quantity
AngularAccelerationVector represents an angular acceleration quantity
RelativePositionVector represents the relative position
+")); diff --git a/ModelicaServices/AnimationInterface/Types/package.mo b/ModelicaServices/AnimationInterface/Types/package.mo new file mode 100644 index 0000000000..8a423b99bb --- /dev/null +++ b/ModelicaServices/AnimationInterface/Types/package.mo @@ -0,0 +1,9 @@ +within ModelicaServices.AnimationInterface; + +package Types +type Length = Real (final quantity="Length", final unit="m"); +type Position = Length; +type AngularVelocity = Real ( + final quantity="AngularVelocity", + final unit="rad/s"); +end Types; diff --git a/ModelicaServices/AnimationInterface/package.mo b/ModelicaServices/AnimationInterface/package.mo new file mode 100644 index 0000000000..e031f92f6b --- /dev/null +++ b/ModelicaServices/AnimationInterface/package.mo @@ -0,0 +1,106 @@ +within ModelicaServices; + +package AnimationInterface + extends Icons.Package; + partial model PartialShape "Interface for 3D animation of elementary shapes" + parameter Types.ShapeType shapeType="box" + "Type of shape (box, sphere, cylinder, pipecylinder, cone, pipe, beam, gearwheel, spring, )"; + input Frames.Orientation R=Frames.nullRotation() + "Orientation object to rotate the world frame into the object frame" annotation(Dialog); + input Types.Position r[3]={0,0,0} + "Position vector from origin of world frame to origin of object frame, resolved in world frame" annotation(Dialog); + input Types.Position r_shape[3]={0,0,0} + "Position vector from origin of object frame to shape origin, resolved in object frame" annotation(Dialog); + input Real lengthDirection[3](each final unit="1")={1,0,0} + "Vector in length direction, resolved in object frame" annotation(Dialog); + input Real widthDirection[3](each final unit="1")={0,1,0} + "Vector in width direction, resolved in object frame" annotation(Dialog); + input Types.Length length=0 "Length of visual object" annotation(Dialog); + input Types.Length width=0 "Width of visual object" annotation(Dialog); + input Types.Length height=0 "Height of visual object" annotation(Dialog); + input Types.ShapeExtra extra=0.0 + "Additional size data for some of the shape types" annotation(Dialog); + input Real color[3]={255,0,0} "Color of shape" annotation(Dialog(colorSelector=true)); + input Types.SpecularCoefficient specularCoefficient = 0.7 + "Reflection of ambient light (= 0: light is completely absorbed)" annotation(Dialog); + + annotation ( + Documentation(info=" +

+This model is documented at +Modelica.Mechanics.MultiBody.Visualizers.Advanced.Shape. +

+")); + + end PartialShape; + + partial model PartialVector "Interface for 3D animation of a vector quantity (force, torque etc)" + input Frames.Orientation R=Frames.nullRotation() + "Orientation object to rotate the world frame into the vector frame" annotation(Dialog); + input Types.Position r[3]={0,0,0} + "Position vector from origin of world frame to origin of vector frame, resolved in world frame" annotation(Dialog); + input Real coordinates[3]={0,0,0} + "Coordinates of the vector resolved in vector frame" annotation(Dialog); + input Types.Color color=Types.Defaults.ArrowColor + "Color of vector" annotation(Dialog(colorSelector=true)); + input Types.SpecularCoefficient specularCoefficient = 0.7 + "Material property describing the reflecting of ambient light (= 0 means, that light is completely absorbed)" annotation(Dialog); + parameter Types.VectorQuantity quantity = Types.VectorQuantity.Force "Quantity of the coordinates"; + input Boolean headAtOrigin=false "= true, if the vector is pointing towards the origin of vector frame" annotation(Dialog); + input Boolean twoHeadedArrow=false "= true, if the arrow has two heads after each other (pointing in the same direction)" annotation(Dialog); + + annotation ( + Documentation(info=" +

+This model is documented at +Modelica.Mechanics.MultiBody.Visualizers.Advanced.Vector. +

+")); + end PartialVector; + + partial model PartialSurface "Interface for 3D animation of surfaces" + input Frames.Orientation R=Frames.nullRotation() + "Orientation object to rotate the world frame into the surface frame" + annotation(Dialog(group="Surface frame")); + input Types.Position r_0[3]={0,0,0} + "Position vector from origin of world frame to origin of surface frame, resolved in world frame" + annotation(Dialog(group="Surface frame")); + + parameter Integer nu=2 "Number of points in u-Dimension" annotation(Dialog(group="Surface properties")); + parameter Integer nv=2 "Number of points in v-Dimension" annotation(Dialog(group="Surface properties")); + replaceable function surfaceCharacteristic = + Modelica.Mechanics.MultiBody.Interfaces.partialSurfaceCharacteristic + "Function defining the surface characteristic" + annotation(choicesAllMatching=true,Dialog(group="Surface properties")); + + parameter Boolean wireframe=false "= true: 3D model will be displayed without faces" + annotation (Dialog(group="Material properties"),choices(checkBox=true)); + parameter Boolean multiColoredSurface=false "= true: Color is defined for each surface point" + annotation(Dialog(group="Material properties"),choices(checkBox=true)); + input Real color[3]={255,0,0} "Color of surface" annotation(Dialog(colorSelector=true,group="Material properties", enable=not multiColoredSurface)); + input Types.SpecularCoefficient specularCoefficient = 0.7 + "Reflection of ambient light (= 0: light is completely absorbed)" + annotation(Dialog(group="Material properties")); + input Real transparency=0 "Transparency of shape: 0 (= opaque) ... 1 (= fully transparent)" + annotation(Dialog(group="Material properties")); + + annotation (Documentation(info=" +

+This model is documented at +Modelica.Mechanics.MultiBody.Visualizers.Advanced.Surface. +

+")); + end PartialSurface; + annotation( + preferredView="info", + version="4.0.0", + Documentation(info=" +

AnimationInterface contains the interfaces of elements used to create animations in Modelica. +These interfaces are used by the Modelica Standard Library and ModelicaServices to ensure that both contain +the expected interface.

+

In ModelicaServices.Animation, the actual implementation may be extended to add communication with a Modelica tool in +order to for example visualize the model on the fly.

+

This package including any classes below it in the hierarchy are not intended to be modified by a tool vendor.

+") + ); +end AnimationInterface; diff --git a/ModelicaServices/Icons.mo b/ModelicaServices/Icons.mo new file mode 100644 index 0000000000..0f9a395f46 --- /dev/null +++ b/ModelicaServices/Icons.mo @@ -0,0 +1,791 @@ +within ModelicaServices; +package Icons "Library of icons" + partial class Information "Icon for general information packages" + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Ellipse( + lineColor={75,138,73}, + fillColor={75,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + extent={{-100.0,-100.0},{100.0,100.0}}), + Polygon(origin={-4.167,-15.0}, + fillColor={255,255,255}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833,-50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}}, + smooth=Smooth.Bezier), + Ellipse(origin={7.5,56.5}, + fillColor={255,255,255}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + extent={{-12.5,-12.5},{12.5,12.5}})}), + Documentation(info=" +

This icon indicates classes containing only documentation, intended for general description of, e.g., concepts and features of a package.

+")); + end Information; + extends Icons.Package; + + partial class Contact "Icon for contact information" + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Rectangle( + extent={{-100,70},{100,-72}}, + fillColor={235,235,235}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-100,-72},{100,-72},{0,20},{-100,-72}}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid), + Polygon( + points={{22,0},{100,70},{100,-72},{22,0}}, + fillColor={235,235,235}, + fillPattern=FillPattern.Solid), + Polygon( + points={{-100,70},{100,70},{0,-20},{-100,70}}, + fillColor={241,241,241}, + fillPattern=FillPattern.Solid)}), + Documentation(info=" +

This icon shall be used for the contact information of the library developers.

+")); + end Contact; + + partial class ReleaseNotes "Icon for release notes in documentation" + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Polygon( + points={{-80,-100},{-80,100},{0,100},{0,20},{80,20},{80,-100},{-80, + -100}}, + fillColor={245,245,245}, + fillPattern=FillPattern.Solid), + Polygon( + points={{0,100},{80,20},{0,20},{0,100}}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid), + Line(points={{2,-12},{50,-12}}), + Ellipse( + extent={{-56,2},{-28,-26}}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid), + Line(points={{2,-60},{50,-60}}), + Ellipse( + extent={{-56,-46},{-28,-74}}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid)}), Documentation(info=" +

This icon indicates release notes and the revision history of a library.

+")); + + end ReleaseNotes; + + partial class References "Icon for external references" + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Polygon( + points={{-100,-80},{-100,60},{-80,54},{-80,80},{-40,58},{-40,100},{ + -10,60},{90,60},{100,40},{100,-100},{-20,-100},{-100,-80}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={245,245,245}, + fillPattern=FillPattern.Solid), + Polygon(points={{-20,-100},{-10,-80},{90,-80},{100,-100},{-20,-100}}), + Line(points={{90,-80},{90,60},{100,40},{100,-100}}), + Line(points={{90,60},{-10,60},{-10,-80}}), + Line(points={{-10,60},{-40,100},{-40,-40},{-10,-80},{-10,60}}), + Line(points={{-20,-88},{-80,-60},{-80,80},{-40,58}}), + Line(points={{-20,-100},{-100,-80},{-100,60},{-80,54}}), + Line(points={{10,30},{72,30}}), + Line(points={{10,-10},{70,-10}}), + Line(points={{10,-50},{70,-50}})}), Documentation(info= + " +

This icon indicates a documentation class containing references to external documentation and literature.

+")); + + end References; + + partial package ExamplesPackage + "Icon for packages containing runnable examples" + extends Modelica.Icons.Package; + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Polygon( + origin={8.0,14.0}, + lineColor={78,138,73}, + fillColor={78,138,73}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-58.0,46.0},{42.0,-14.0},{-58.0,-74.0},{-58.0,46.0}})}), Documentation(info=" +

This icon indicates a package that contains executable examples.

+")); + end ExamplesPackage; + + partial model Example "Icon for runnable examples" + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Ellipse(lineColor = {75,138,73}, + fillColor={255,255,255}, + fillPattern = FillPattern.Solid, + extent = {{-100,-100},{100,100}}), + Polygon(lineColor = {0,0,255}, + fillColor = {75,138,73}, + pattern = LinePattern.None, + fillPattern = FillPattern.Solid, + points = {{-36,60},{64,0},{-36,-60},{-36,60}})}), Documentation(info=" +

This icon indicates an example. The play button suggests that the example can be executed.

+")); + end Example; + + partial package Package "Icon for standard packages" + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + lineColor={200,200,200}, + fillColor={248,248,248}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Rectangle( + lineColor={128,128,128}, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0)}), Documentation(info=" +

Standard package icon.

+")); + end Package; + + partial package BasesPackage "Icon for packages containing base classes" + extends Modelica.Icons.Package; + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Ellipse( + extent={{-30.0,-30.0},{30.0,30.0}}, + lineColor={128,128,128}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), + Documentation(info=" +

This icon shall be used for a package/library that contains base models and classes, respectively.

+")); + end BasesPackage; + + partial package VariantsPackage "Icon for package containing variants" + extends Modelica.Icons.Package; + annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100,100}}), + graphics={ + Ellipse( + extent={{-70.0,-70.0},{-10.0,-10.0}}, + lineColor={76,76,76}, + fillColor={76,76,76}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{70.0,-70.0},{10.0,-10.0}}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{70.0,70.0},{10.0,10.0}}, + lineColor={128,128,128}, + fillColor={128,128,128}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-70.0,70.0},{-10.0,10.0}}, + lineColor={128,128,128}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)}), + Documentation(info=" +

This icon shall be used for a package/library that contains several variants of one component.

+")); + end VariantsPackage; + + partial package InterfacesPackage "Icon for packages containing interfaces" + extends Modelica.Icons.Package; + annotation ( + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), + graphics={ + Polygon( + lineColor={64,64,64}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + points={{10,70},{30,70},{60,20},{100,20},{100,-20},{60,-20},{30,-70},{10,-70}}), + Polygon( + lineColor={102,102,102}, + fillColor={102,102,102}, + fillPattern=FillPattern.Solid, + points={{-100,20},{-60,20},{-30,70},{-10,70},{-10,-70},{-30,-70},{-60,-20},{-100,-20}})}), + Documentation(info=" +

This icon indicates packages containing interfaces.

+")); + end InterfacesPackage; + + partial package SourcesPackage "Icon for packages containing sources" + extends Modelica.Icons.Package; + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Polygon(origin={23.3333,0.0}, + fillColor={128,128,128}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-23.333,30.0},{46.667,0.0},{-23.333,-30.0}}), + Rectangle( + fillColor = {128,128,128}, + pattern = LinePattern.None, + fillPattern = FillPattern.Solid, + extent = {{-70,-4.5},{0,4.5}})}), + Documentation(info=" +

This icon indicates a package which contains sources.

+")); + end SourcesPackage; + + partial package SensorsPackage "Icon for packages containing sensors" + extends Modelica.Icons.Package; + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Ellipse(origin={0.0,-30.0}, + fillColor={255,255,255}, + extent={{-90.0,-90.0},{90.0,90.0}}, + startAngle=20.0, + endAngle=160.0), + Ellipse(origin={0.0,-30.0}, + fillColor={128,128,128}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + extent={{-20.0,-20.0},{20.0,20.0}}), + Line(origin={0.0,-30.0}, + points={{0.0,60.0},{0.0,90.0}}), + Ellipse(origin={-0.0,-30.0}, + fillColor={64,64,64}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + extent={{-10.0,-10.0},{10.0,10.0}}), + Polygon( + origin={-0.0,-30.0}, + rotation=-35.0, + fillColor={64,64,64}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-7.0,0.0},{-3.0,85.0},{0.0,90.0},{3.0,85.0},{7.0,0.0}})}), + Documentation(info=" +

This icon indicates a package containing sensors.

+")); + end SensorsPackage; + + partial package UtilitiesPackage "Icon for utility packages" + extends Modelica.Icons.Package; + annotation (Icon(coordinateSystem(extent={{-100.0,-100.0},{100.0,100.0}}), graphics={ + Polygon( + origin={1.3835,-4.1418}, + rotation=45.0, + fillColor={64,64,64}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-15.0,93.333},{-15.0,68.333},{0.0,58.333},{15.0,68.333},{15.0,93.333},{20.0,93.333},{25.0,83.333},{25.0,58.333},{10.0,43.333},{10.0,-41.667},{25.0,-56.667},{25.0,-76.667},{10.0,-91.667},{0.0,-91.667},{0.0,-81.667},{5.0,-81.667},{15.0,-71.667},{15.0,-61.667},{5.0,-51.667},{-5.0,-51.667},{-15.0,-61.667},{-15.0,-71.667},{-5.0,-81.667},{0.0,-81.667},{0.0,-91.667},{-10.0,-91.667},{-25.0,-76.667},{-25.0,-56.667},{-10.0,-41.667},{-10.0,43.333},{-25.0,58.333},{-25.0,83.333},{-20.0,93.333}}), + Polygon( + origin={10.1018,5.218}, + rotation=-45.0, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid, + points={{-15.0,87.273},{15.0,87.273},{20.0,82.273},{20.0,27.273},{10.0,17.273},{10.0,7.273},{20.0,2.273},{20.0,-2.727},{5.0,-2.727},{5.0,-77.727},{10.0,-87.727},{5.0,-112.727},{-5.0,-112.727},{-10.0,-87.727},{-5.0,-77.727},{-5.0,-2.727},{-20.0,-2.727},{-20.0,2.273},{-10.0,7.273},{-10.0,17.273},{-20.0,27.273},{-20.0,82.273}})}), + Documentation(info=" +

This icon indicates a package containing utility classes.

+")); + end UtilitiesPackage; + + partial package TypesPackage "Icon for packages containing type definitions" + extends Modelica.Icons.Package; + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={Polygon( + origin={-12.167,-23}, + fillColor={128,128,128}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{12.167,65},{14.167,93},{36.167,89},{24.167,20},{4.167,-30}, + {14.167,-30},{24.167,-30},{24.167,-40},{-5.833,-50},{-15.833, + -30},{4.167,20},{12.167,65}}, + smooth=Smooth.Bezier), Polygon( + origin={2.7403,1.6673}, + fillColor={128,128,128}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{49.2597,22.3327},{31.2597,24.3327},{7.2597,18.3327},{-26.7403, + 10.3327},{-46.7403,14.3327},{-48.7403,6.3327},{-32.7403,0.3327},{-6.7403, + 4.3327},{33.2597,14.3327},{49.2597,14.3327},{49.2597,22.3327}}, + smooth=Smooth.Bezier)})); + end TypesPackage; + + partial package FunctionsPackage "Icon for packages containing functions" + extends Modelica.Icons.Package; + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Text( + textColor={128,128,128}, + extent={{-90,-90},{90,90}}, + textString="f")})); + end FunctionsPackage; + + partial package IconsPackage "Icon for packages containing icons" + extends Modelica.Icons.Package; + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={Polygon( + origin={-8.167,-17}, + fillColor={128,128,128}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{ + 4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833, + -50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}}, + smooth=Smooth.Bezier), Ellipse( + origin={-0.5,56.5}, + fillColor={128,128,128}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + extent={{-12.5,-12.5},{12.5,12.5}})})); + end IconsPackage; + + partial package InternalPackage + "Icon for an internal package (indicating that the package should not be directly utilized by user)" + + annotation ( + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100, + 100}}), graphics={ + Rectangle( + lineColor={215,215,215}, + fillColor={255,255,255}, + fillPattern=FillPattern.HorizontalCylinder, + extent={{-100,-100},{100,100}}, + radius=25), + Rectangle( + lineColor={215,215,215}, + extent={{-100,-100},{100,100}}, + radius=25), + Ellipse( + extent={{-80,80},{80,-80}}, + lineColor={215,215,215}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-55,55},{55,-55}}, + lineColor={255,255,255}, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-60,14},{60,-14}}, + lineColor={215,215,215}, + fillColor={215,215,215}, + fillPattern=FillPattern.Solid, + rotation=45)}), + Documentation(info=" + +

+This icon shall be used for a package that contains internal classes not to be +directly utilized by a user. +

+")); + end InternalPackage; + + partial package MaterialPropertiesPackage + "Icon for package containing property classes" + extends Modelica.Icons.Package; + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Ellipse( + lineColor={102,102,102}, + fillColor={204,204,204}, + pattern=LinePattern.None, + fillPattern=FillPattern.Sphere, + extent={{-60.0,-60.0},{60.0,60.0}})}), + Documentation(info=" +

This icon indicates a package that contains properties

+")); + end MaterialPropertiesPackage; + + partial package RecordsPackage "Icon for package containing records" + extends Modelica.Icons.Package; + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={ + Rectangle( + origin={0,-20}, + lineColor={64,64,64}, + fillColor={255,215,136}, + fillPattern=FillPattern.Solid, + extent={{-80,-60},{80,60}}, + radius=25.0), + Line( + points={{-80,0},{80,0}}, + color={64,64,64}), + Line( + origin={0,-40}, + points={{-80,0},{80,0}}, + color={64,64,64}), + Line( + origin={0,-5}, + points={{0,45},{0,-75}}, + color={64,64,64})}), + Documentation(info=" +

This icon indicates a package that contains records

+")); + end RecordsPackage; + + partial class MaterialProperty "Icon for property classes" + + annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics={ + Ellipse(lineColor={102,102,102}, + fillColor={204,204,204}, + pattern=LinePattern.None, + fillPattern=FillPattern.Sphere, + extent={{-100.0,-100.0},{100.0,100.0}})}), + Documentation(info=" +

This icon indicates a property class.

+")); + end MaterialProperty; + + partial class RoundSensor "Icon representing a round measurement device" + + annotation ( + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Ellipse( + fillColor={245,245,245}, + fillPattern=FillPattern.Solid, + extent={{-70.0,-70.0},{70.0,70.0}}), + Line(points={{0.0,70.0},{0.0,40.0}}), + Line(points={{22.9,32.8},{40.2,57.3}}), + Line(points={{-22.9,32.8},{-40.2,57.3}}), + Line(points={{37.6,13.7},{65.8,23.9}}), + Line(points={{-37.6,13.7},{-65.8,23.9}}), + Ellipse( + lineColor={64,64,64}, + fillColor={255,255,255}, + extent={{-12.0,-12.0},{12.0,12.0}}), + Polygon( + rotation=-17.5, + fillColor={64,64,64}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-5.0,0.0},{-2.0,60.0},{0.0,65.0},{2.0,60.0},{5.0,0.0}}), + Ellipse( + fillColor={64,64,64}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + extent={{-7.0,-7.0},{7.0,7.0}})}), + Documentation(info=" +

+This icon is designed for a rotational sensor model. +

+")); + end RoundSensor; + + partial class RectangularSensor + "Icon representing a linear measurement device" + + annotation ( + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + fillColor={245,245,245}, + fillPattern=FillPattern.Solid, + extent={{-70.0,-60.0},{70.0,20.0}}), + Polygon( + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-40,-40},{-50,-16},{-30,-16},{-40,-40}}), + Line(points={{-40,0},{-40,-16}}), + Line(points={{-70,0},{-40,0}}), + Line(points={{-50.0,-40.0},{-50.0,-60.0}}), + Line(points={{-30.0,-40.0},{-30.0,-60.0}}), + Line(points={{-10.0,-40.0},{-10.0,-60.0}}), + Line(points={{10.0,-40.0},{10.0,-60.0}}), + Line(points={{30.0,-40.0},{30.0,-60.0}}), + Line(points={{50.0,-40.0},{50.0,-60.0}})}), + Documentation(info=" +

+This icon is designed for a translational sensor model. +

")); + end RectangularSensor; + + partial function Function "Icon for functions" + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Text( + textColor={0,0,255}, + extent={{-150,105},{150,145}}, + textString="%name"), + Ellipse( + lineColor = {108,88,49}, + fillColor = {255,215,136}, + fillPattern = FillPattern.Solid, + extent = {{-100,-100},{100,100}}), + Text( + textColor={108,88,49}, + extent={{-90.0,-90.0},{90.0,90.0}}, + textString="f")}), + Documentation(info=" +

This icon indicates Modelica functions.

+")); + end Function; + + partial record Record "Icon for records" + + annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics={ + Text( + textColor={0,0,255}, + extent={{-150,60},{150,100}}, + textString="%name"), + Rectangle( + origin={0.0,-25.0}, + lineColor={64,64,64}, + fillColor={255,215,136}, + fillPattern=FillPattern.Solid, + extent={{-100.0,-75.0},{100.0,75.0}}, + radius=25.0), + Line( + points={{-100.0,0.0},{100.0,0.0}}, + color={64,64,64}), + Line( + origin={0.0,-50.0}, + points={{-100.0,0.0},{100.0,0.0}}, + color={64,64,64}), + Line( + origin={0.0,-25.0}, + points={{0.0,75.0},{0.0,-75.0}}, + color={64,64,64})}), Documentation(info=" +

+This icon is indicates a record. +

+")); + end Record; + + type TypeReal "Icon for Real types" + extends Real; + annotation(Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + lineColor={160,160,164}, + fillColor={160,160,164}, + fillPattern=FillPattern.Solid, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Text( + textColor={255,255,255}, + extent={{-90.0,-50.0},{90.0,50.0}}, + textString="R")}),Documentation(info=" +

+This icon is designed for a Real type. +

+")); + end TypeReal; + + type TypeInteger "Icon for Integer types" + extends Integer; + annotation(Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + lineColor={160,160,164}, + fillColor={160,160,164}, + fillPattern=FillPattern.Solid, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Text( + textColor={255,255,255}, + extent={{-90.0,-50.0},{90.0,50.0}}, + textString="I")}),Documentation(info=" +

+This icon is designed for an Integer type. +

+")); + end TypeInteger; + + type TypeBoolean "Icon for Boolean types" + extends Boolean; + annotation(Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + lineColor={160,160,164}, + fillColor={160,160,164}, + fillPattern=FillPattern.Solid, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Text( + textColor={255,255,255}, + extent={{-90.0,-50.0},{90.0,50.0}}, + textString="B")}), + Documentation(info=" +

+This icon is designed for a Boolean type. +

")); + end TypeBoolean; + + type TypeString "Icon for String types" + extends String; + annotation(Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Rectangle( + lineColor={160,160,164}, + fillColor={160,160,164}, + fillPattern=FillPattern.Solid, + extent={{-100.0,-100.0},{100.0,100.0}}, + radius=25.0), + Text( + textColor={255,255,255}, + extent={{-90.0,-50.0},{90.0,50.0}}, + textString="S")}),Documentation(info=" +

+This icon is designed for a String type. +

+")); + end TypeString; + + expandable connector SignalBus "Icon for signal bus" + + annotation ( + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}, initialScale=0.2), graphics={ + Rectangle( + lineColor={255,204,51}, + lineThickness=0.5, + extent={{-20.0,-2.0},{20.0,2.0}}), + Polygon( + fillColor={255,215,136}, + fillPattern=FillPattern.Solid, + points={{-80.0,50.0},{80.0,50.0},{100.0,30.0},{80.0,-40.0},{60.0,-50.0},{-60.0,-50.0},{-80.0,-40.0},{-100.0,30.0}}, + smooth=Smooth.Bezier), + Ellipse( + fillPattern=FillPattern.Solid, + extent={{-65.0,15.0},{-55.0,25.0}}), + Ellipse( + fillPattern=FillPattern.Solid, + extent={{-5.0,15.0},{5.0,25.0}}), + Ellipse( + fillPattern=FillPattern.Solid, + extent={{55.0,15.0},{65.0,25.0}}), + Ellipse( + fillPattern=FillPattern.Solid, + extent={{-35.0,-25.0},{-25.0,-15.0}}), + Ellipse( + fillPattern=FillPattern.Solid, + extent={{25.0,-25.0},{35.0,-15.0}})}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}, + initialScale=0.2), graphics={ + Polygon( + points={{-40,25},{40,25},{50,15},{40,-20},{30,-25},{-30,-25},{-40,-20},{-50,15}}, + fillColor={255,204,51}, + fillPattern=FillPattern.Solid, + smooth=Smooth.Bezier), + Ellipse( + extent={{-32.5,7.5},{-27.5,12.5}}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-2.5,12.5},{2.5,7.5}}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{27.5,12.5},{32.5,7.5}}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-17.5,-7.5},{-12.5,-12.5}}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{12.5,-7.5},{17.5,-12.5}}, + fillPattern=FillPattern.Solid), + Text( + extent={{-150,70},{150,40}}, + textString="%name")}), + Documentation(info=" +This icon is designed for a signal bus connector. +")); + end SignalBus; + + expandable connector SignalSubBus "Icon for signal sub-bus" + + annotation ( + Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Line( + points={{-16.0,2.0},{16.0,2.0}}, + color={255,204,51}, + thickness=0.5), + Rectangle( + lineColor={255,204,51}, + lineThickness=0.5, + extent={{-10.0,0.0},{8.0,8.0}}), + Polygon( + fillColor={255,215,136}, + fillPattern=FillPattern.Solid, + points={{-80.0,50.0},{80.0,50.0},{100.0,30.0},{80.0,-40.0},{60.0,-50.0},{-60.0,-50.0},{-80.0,-40.0},{-100.0,30.0}}, + smooth=Smooth.Bezier), + Ellipse( + fillPattern=FillPattern.Solid, + extent={{-55.0,15.0},{-45.0,25.0}}), + Ellipse( + fillPattern=FillPattern.Solid, + extent={{45.0,15.0},{55.0,25.0}}), + Ellipse( + fillPattern=FillPattern.Solid, + extent={{-5.0,-25.0},{5.0,-15.0}}), + Rectangle( + lineColor={255,215,136}, + lineThickness=0.5, + extent={{-20.0,0.0},{20.0,4.0}})}), + Diagram(coordinateSystem( + preserveAspectRatio=false, + extent={{-100,-100},{100,100}}), graphics={ + Polygon( + points={{-40,25},{40,25},{50,15},{40,-20},{30,-25},{-30,-25},{-40,-20},{-50,15}}, + fillColor={255,204,51}, + fillPattern=FillPattern.Solid, + smooth=Smooth.Bezier), + Ellipse( + extent={{-22.5,7.5},{-17.5,12.5}}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{17.5,12.5},{22.5,7.5}}, + fillPattern=FillPattern.Solid), + Ellipse( + extent={{-2.5,-7.5},{2.5,-12.5}}, + fillPattern=FillPattern.Solid), + Text( + extent={{-150,70},{150,40}}, + textString= + "%name")}), + Documentation(info=" +

+This icon is designed for a sub-bus in a signal connector. +

+")); + + end SignalSubBus; + + partial class UnderConstruction + "Icon for classes that are still under construction" + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ + Polygon(points={{-100,-100},{0,80},{100,-100},{-100,-100}}, + lineColor={255,0,0}, + lineThickness=0.5)}), Documentation(info=" +

Library developers can use this icon to indicate that the respective model is under construction.

+")); + end UnderConstruction; + + partial class ObsoleteModel + "Icon for classes that are obsolete and will be removed in later versions" + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={Rectangle( + extent={{-102,102},{102,-102}}, + lineColor={255,0,0}, + pattern=LinePattern.Dash, + lineThickness=0.5)}), Documentation(info=" +

+This partial class is intended to provide a default icon +for an obsolete model that will be removed from the +corresponding library in a future release. +

+")); + end ObsoleteModel; + + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -100},{100,100}}), graphics={Polygon( + origin={-8.167,-17}, + fillColor={128,128,128}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + points={{-15.833,20.0},{-15.833,30.0},{14.167,40.0},{24.167,20.0},{ + 4.167,-30.0},{14.167,-30.0},{24.167,-30.0},{24.167,-40.0},{-5.833, + -50.0},{-15.833,-30.0},{4.167,20.0},{-5.833,20.0}}, + smooth=Smooth.Bezier), Ellipse( + origin={-0.5,56.5}, + fillColor={128,128,128}, + pattern=LinePattern.None, + fillPattern=FillPattern.Solid, + extent={{-12.5,-12.5},{12.5,12.5}})})); +end Icons; diff --git a/ModelicaServices/package.mo b/ModelicaServices/package.mo index d64ab069dc..f82a103e68 100644 --- a/ModelicaServices/package.mo +++ b/ModelicaServices/package.mo @@ -1,13 +1,13 @@ within ; package ModelicaServices "ModelicaServices (Default implementation) - Models and functions used in the Modelica Standard Library requiring a tool specific implementation" - extends Modelica.Icons.Package; + extends Icons.Package; constant String target="Default" "Target of this ModelicaServices implementation"; package UsersGuide "User's Guide" - extends Modelica.Icons.Information; + extends Icons.Information; class ReleaseNotes "Release notes" - extends Modelica.Icons.ReleaseNotes; + extends Icons.ReleaseNotes; annotation (Documentation(info="

Version 4.0.0, 2020-06-04

@@ -80,7 +80,7 @@ First version of the ModelicaServices library. end ReleaseNotes; class Contact "Contact" - extends Modelica.Icons.Contact; + extends Icons.Contact; annotation (Documentation(info="
Main Author
@@ -108,11 +108,11 @@ The design of the Animation.Shape component is from Hilding Elmqvist, previously end UsersGuide; package Animation "Models and functions for 3-dim. animation" - extends Modelica.Icons.Package; + extends Icons.Package; model Shape "Different visual shapes with variable size; all data have to be set as modifiers (see info layer)" extends - Modelica.Utilities.Internal.PartialModelicaServices.Animation.PartialShape; + AnimationInterface.PartialShape; annotation (Icon(coordinateSystem( preserveAspectRatio=true, @@ -130,7 +130,7 @@ The interface of this model is documented at model Surface "Animation of a moveable, parameterized surface; the surface characteristic is provided by a function" - extends Modelica.Utilities.Internal.PartialModelicaServices.Animation.PartialSurface; + extends AnimationInterface.PartialSurface; annotation (Documentation(info="

@@ -144,7 +144,7 @@ The interface of this model is defined at end Surface; model Vector "Animation of a moveable vector-quantity (the length is not fixed in meters)" - extends Modelica.Utilities.Internal.PartialModelicaServices.Animation.PartialVector; + extends AnimationInterface.PartialVector; annotation (Documentation(info="

@@ -159,11 +159,12 @@ The interface of this model is defined at end Animation; package ExternalReferences "Library of functions to access external resources" - extends Modelica.Icons.Package; + extends Icons.Package; function loadResource "Return the absolute path name of a URI or local file name (in this default implementation URIs are not supported, but only local file names)" - extends - Modelica.Utilities.Internal.PartialModelicaServices.ExternalReferences.PartialLoadResource; + extends Icons.Function; + input String uri "URI or local file name"; + output String fileReference "Absolute path name of file"; algorithm fileReference := Modelica.Utilities.Files.fullPathName(uri); @@ -177,7 +178,7 @@ The interface of this model is documented at end ExternalReferences; package Machine "Machine dependent constants" - extends Modelica.Icons.Package; + extends Icons.Package; final constant Real eps=1e-15 "Biggest number such that 1.0 + eps = 1.0"; final constant Real small=1e-60 "Smallest number such that small and -small are representable on the machine"; @@ -196,10 +197,11 @@ but indirectly via the alias definition in end Machine; package System "System dependent functions" - extends Modelica.Icons.Package; + extends Icons.Package; impure function exit "Terminate execution of Modelica environment" - extends Modelica.Utilities.Internal.PartialModelicaServices.System.exitBase; - external "C" exit(status) annotation(Include="#include ", Library="ModelicaExternalC"); + extends Icons.Function; + input Integer status=0 "Result to be returned by environment (0 means success)"; + external "C" exit(status) annotation(Include="#include "); annotation(Documentation(info="

Tool-specific implementation of Modelica.Utilities.System.exit. @@ -209,7 +211,7 @@ Tool-specific implementation of