Help - Search - Members - Calendar
Full Version: Help adding libraries to MathModelica Lite v1.0.1
Modelica Forum > Modelica > MathModelica / OpenModelica
matt.cook
How do I add extra libraries?

Here is how I have been attempting to do it ...
  1. I have been adding them to the folder OpenModelica install ..... for example ..... C:\OpenModelica1.4.3\ModelicaLibrary\HyLibLight 2.3
  2. I then open the 'package.mo' file
  3. I then see a 'box' for this in the library browser but it does not have a blue outline or say 'Library' (like the base Modelica library does).
  4. If I then, say, choose to 'Open All' .... for each component I get the following error message in a dialog window ... "Modelica Kernel Error: A function call to the modelica kernel failed."
  5. All the components appear in the library browser but none of them have any icons.
  6. I can 'edit' them and see the modelica code but obviously I can not use them on a drawing.
  7. Maybe I have just installed the library in the wrong place?

I can not find anything in the MathModelica documentation which gives me the answers.

The libraries don't make any mention of how to install them ...... I know this may be tool specific but a quick howto guide on OpenModelica website (or maybe here) would be very useful, I'd be willing to contribute if required.

Any help you can provide will be most gratefully received.
matt.cook
Further information:

I have checked the 'Show packages as icons' option in ...

Tools > Options... > Library Browser > Visability
matt.cook
Further information:

I've gone back to OpenModelica v1.4.1 (uninstalled and re-installed everything).

Now I get hardly any kernel errors when I load packages. When I add an icon to the diagram I now see parameters in the Paramerter Window.

... but there are still NO icons.

Here is example code in the 'Text View' mode (if it helps).

CODE
model dddd
  annotation(Icon(coordinateSystem(extent={{-100,-100},{100,100}}),graphics={Text(visible=true, fillPattern=FillPattern.Solid, extent={{-100,-150},{100,-110}}, textString="%name")}),Diagram(coordinateSystem(extent={{-148.5,-105},{148.5,105}})));
  HyLibLight.Components.CheckValve checkValve1 annotation(Placement(visible=true,transformation(x=-71.5676,y=55.5191,scale=0.75)));
  HyLibLight.Components.CheckValve checkValve1 annotation(Placement(visible=true,transformation(x=-71.5676,y=55.5191,scale=0.75)));
end dddd;
matt.cook
Further information:

Maybe the icons (annotation?) do not render in MathModelica ??

One thing I have noticed is that the icon annotation that does render uses curly braces ...

{{a,b},{c,d}}

... and the ones that do not are using square braces ...

[a,b;c,d]

... or am I just talking rubbish.
matt.cook
Further information:

I've noticed that the drawing tools (line, rectangle, etc.) which are part of the MathModelica Lite standard toolbar are always disabled. Maybe the Lite version intentially does not allow the icons to be rendered? Does it make an exception for the standard Modelica library?

However, if I create my own block from scratch, I can enter annotations when in the 'Text view' mode and they do appear to render when I change to Icon/Display modes (although I've any done a very quick test for this).

Does anyone know which annotation the Library Browser uses to display icons? I ask this because some blocks appear to have graphic annotation in the Icon layer but not in the Display layer.
brugard
As the icons are drawn in Dymola the use Dymola graphics and not Modelica graphics, therefore graphics do not work in MathModelica. However there is a beta translator available. By typing

translateGraphics(libraryname)

the libraries graphics will get translated. Note, that it is a beta version so there will probably be parts that are not fully translated. Hope this will help you.

As you noticed the drawing toolbar is never active in MathModelica Lite as this is one of the features that is only availble in MathModleica System Deisgner and MathModleica System Deisgner Professional.



This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.