Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

cannot import libraries

cannot import libraries

> I’m newbie in Modelica.
>
> I need to do a study with heatpumps and I saw the Openmodelica software.
>
> I gonna need same components that I think that exists in the
> thermocycle librarie.   ( http://www.thermocycle.net/)

The problem is when I try to load the thermocycle librarie with OMEdit
appears the following message:



> [C:/OpenModelica1.9.1/lib/omlibrary/ThermoCycle/Examples/TestComponent
> s/package.mo:2:1-18:19]
> Error: Test_Cell1D_2 was referenced in the package.order file, but was
> not found in package.mo, Test_Cell1D_2/package.mo or Test_Cell1D_2.mo.
>
> [C:/OpenModelica1.9.1/lib/omlibrary/ThermoCycle/Examples/TestComponent
> s/package.mo:6:32-6:104]
> Warning: The file was not encoded in UTF-8:
>
>    "<HTML> <p><big><dl><dt><b>Main Authors:</b> <br/></dt> <dd>Sylvain
> Quoil...".
>
>    Defaulting to 7-bit ASCII with unknown characters replaced by '?'.
>
>    To change encoding when loading a file: loadFile(encoding="ISO-XXXX-YY").
>
>    To change it in a package: add a file package.encoding at the top-level.
>
>    Note: The Modelica Language Specification only allows files encoded
> in UTF-8.


Can you help me?

Best

Joaquim

Re: cannot import libraries

Are the error messages not useful?

> [C:/OpenModelica1.9.1/lib/omlibrary/ThermoCycle/Examples/TestComponent
> s/package.mo:2:1-18:19]
> Error: Test_Cell1D_2 was referenced in the package.order file, but was
> not found in package.mo, Test_Cell1D_2/package.mo or Test_Cell1D_2.mo.

Open your package.order file and remove Test_Cell1D_2 since it is not defined in the package.

> [C:/OpenModelica1.9.1/lib/omlibrary/ThermoCycle/Examples/TestComponent
> s/package.mo:6:32-6:104]
> Warning: The file was not encoded in UTF-8:
>
>    "<HTML> <p><big><dl><dt><b>Main Authors:</b> <br/></dt> <dd>Sylvain
> Quoil...".
>
>    Defaulting to 7-bit ASCII with unknown characters replaced by '?'.
>
>    To change encoding when loading a file: loadFile(encoding="ISO-XXXX-YY").
>
>    To change it in a package: add a file package.encoding at the top-level.
>
>    Note: The Modelica Language Specification only allows files encoded
> in UTF-8.

Create a file package.encoding and write your library encoding format in it and put the file at top-level where your package.mo is located.

If you don't know your library encoding format then,
- Use OMEdit menu File->Open/Convert Modelica File(s) With Encoding.
- Select the root package.mo file.
- Check Convert all files within the selected directory and sub-directories.
- Click Open and convert to UTF-8.
This is will convert your whole library to UTF-8 encoding.

Adeel.

Re: cannot import libraries

Hi,

Thanks for your help Adeel.

I follow your instructions and  I try to load the thermocycle librarie with OMEdit appears the following message:

[C:/OpenModelica1.9.1/lib/omlibrary/ThermoCycle/Examples/TestComponents/package.mo:2:1-18:19] Error: Test_Cell1D_2 was referenced in the package.order file, but was not found in package.mo, Test_Cell1D_2/package.mo or Test_Cell1D_2.mo.
[:0:0-0:0] Error: Failed to load package ThermoCycle () using MODELICAPATH C:\OpenModelica1.9.1\lib\omlibrary\;C:/OpenModelica1.9.1/lib/omlibrary.

What I did wrong?

Joaquim

Re: cannot import libraries

As I said in my previous post "Open your package.order file and remove Test_Cell1D_2 since it is not defined in the package. "
Did you remove Test_Cell1D_2 from C:/OpenModelica1.9.1/lib/omlibrary/ThermoCycle/Examples/TestComponents/package.order?

Btw I noticed that this bug is only present in ThermoCycle Library v1.0. Why don't you use ThermoCycle Library v2.0? OR more better use the version from github (https://github.com/thermocycle/Thermocycle-library)

Adeel.

There are 0 guests and 0 other users also viewing this topic