Skip to content

Comments

Issue14 icons#17

Merged
AtiyahElsheikh merged 54 commits intoOpenModelica:developfrom
AtiyahElsheikh:Issue14_Icons
Apr 6, 2021
Merged

Issue14 icons#17
AtiyahElsheikh merged 54 commits intoOpenModelica:developfrom
AtiyahElsheikh:Issue14_Icons

Conversation

@AtiyahElsheikh
Copy link
Collaborator

@AtiyahElsheikh AtiyahElsheikh commented Mar 28, 2021

Main changes

  • MSL 4.0.0 ( Canceled)
  • Missing Icons in Biochem.Icons that unintentionally not included in the last release
  • Making use of Modelica.Icons.* for cases that don't exist in Biochem.Icons

…iles. Each subpackage corresponds to a standalone example
* Issue07 separate component (#11)

* MSL version 3.2.3

* separate Interfaces/Substances/package.mo into separate components

* separate the components within the package Interfaces.Compartments

* Decompose the package BioChem.Interfaces.Nodes into separate components

* Separate all components within Biochem/Interfaces/Reactions/package.mo into separate *.mo components

* Decompose package BioChem/Interfaces/Reactions/Basics/package.mo into separate components

* Separate BioChem/Interfaces/Reactions/Modifiers/package.mo into separate components

* remove extra spaces from several modified package.mo

* keep model declaration using partial or without partial identical to the original version

* package.order files to be included in the repository

* decompose BioChem/Compartments/package.mo into separate components

* decompose BioChem/Substances/package.mo into separate components

* Separate the Icons package within BioChem/package.mo into separate directory

* Separate Biochem.Math package into a separate directory

* Separate top models within the Biochem.Examples package

* Separate all subpackages within Biochem.Examples into separate *.mo files. Each subpackage corresponds to a standalone example

* Separate Biochem.Reactions.MichaelisMenten into separate components

* separate Biochem.Reactions.MassAction.Reversible into separate components

* decompose package Reactions.MassAction.Irreversible into separate components

* Decompose Reactions.Inhibition into separate components

* decompoase Reactions.FastEquilibrium into separate components

* Decompose package Reactions into separate components

* Develop 1.0.2 (#12)

* MSL version 3.2.3

* separate Interfaces/Substances/package.mo into separate components

* separate the components within the package Interfaces.Compartments

* Decompose the package BioChem.Interfaces.Nodes into separate components

* Separate all components within Biochem/Interfaces/Reactions/package.mo into separate *.mo components

* Decompose package BioChem/Interfaces/Reactions/Basics/package.mo into separate components

* Separate BioChem/Interfaces/Reactions/Modifiers/package.mo into separate components

* remove extra spaces from several modified package.mo

* keep model declaration using partial or without partial identical to the original version

* package.order files to be included in the repository

* decompose BioChem/Compartments/package.mo into separate components

* decompose BioChem/Substances/package.mo into separate components

* Separate the Icons package within BioChem/package.mo into separate directory

* Separate Biochem.Math package into a separate directory

* Separate top models within the Biochem.Examples package

* Separate all subpackages within Biochem.Examples into separate *.mo files. Each subpackage corresponds to a standalone example

* Separate Biochem.Reactions.MichaelisMenten into separate components

* separate Biochem.Reactions.MassAction.Reversible into separate components

* decompose package Reactions.MassAction.Irreversible into separate components

* Decompose Reactions.Inhibition into separate components

* decompoase Reactions.FastEquilibrium into separate components

* Decompose package Reactions into separate components

* ignore backup files

* annotations for version 1.0.2

* Revert "ignore backup files"

This reverts commit 898a667.

* remove backup files

* announcing version 1.0.2
@AtiyahElsheikh AtiyahElsheikh requested a review from sjoelund March 28, 2021 07:48
@AtiyahElsheikh AtiyahElsheikh linked an issue Mar 28, 2021 that may be closed by this pull request
Copy link
Member

@sjoelund sjoelund left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove that change to Modelica 4.0.0 and this can be merged as a squash and merge in the Github user interface. It's a whole lot of commits, but very few actual changes right now.

</ul>
</body></html>"),
uses(Modelica(version = "3.2.3")),
uses(Modelica(version = "4.0.0")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot be changed without also running the conversion script. Running the conversion script will also move annotations around (because they are not at the end of the class in most BioChem libraries). I could apply this conversion in a few separate PRs if you want.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really sure what is meant by conversion script? What is it? and how to run it?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See Section 18.8.2 of the Modelica Specification

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my understanding now, the conversion script should convert:

annotation(uses(Modelica(version="3.2.3")));

to

annotation(uses(Modelica(version="4.0.0")));

Is this the case, or should the script convert something else?
Also I think this annotation exist only in one place, so why having a conversion script?

Say we need to apply a conversion script, should I write one, or do we have a generic conversion script somewhere?

Should Biochem.mo includes the following command:

conversion(from(version = "3.2.3", to= "4.0.0"", script = "ConvertMSL3.2.3To4.0.0.mos"))

what should ConvertMSL3.2.3To4.0.0.mos include?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conversion script makes changes to the library. For example, Modelica.SIunits changed name to Modelica.Units.SI. No conversion script is needed in most cases (if you extend from something that changed interface, a new conversion script might be needed).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, modelica://Modelica/Resources/Scripts/Conversion/ConvertModelica_from_3.2.3_to_4.0.0.mos. I can apply that in a separate pair of pull requests. The changes applied are quite extensive (~140 kB diff file). It's a lot of things like:

-  type Pressure= Modelica.SIunits.Pressure annotation(Icon(coordinateSystem(extent={{-100,100},{100,-100}}, preserveAspectRatio=true, grid={10,10})), Diagram(coordinateSystem(extent={{-100,100},{100,-100}}, preserveAspectRatio=true, grid={10,10})));
+  type Pressure= Modelica.Units.SI.Pressure annotation(Icon(coordinateSystem(extent={{-100,100},{100,-100}}, preserveAspectRatio=true, grid={10,10})), Diagram(coordinateSystem(extent={{-100,100},{100,-100}}, preserveAspectRatio=true, grid={10,10})));

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have changed to MSL 3.2.3

Copy link
Collaborator Author

@AtiyahElsheikh AtiyahElsheikh Mar 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have attempted to execute the conversion script. Not sure how to do it correctly, since the associated description file does not state how to run it.

I have tried it with OMShell. Simply copying the script to the top folder (and again where package.mo is located):

>>> runScript("ConvertModelica_from_3.2.3_to_4.0.0.mos")

It does not work.

My other attempt is to extend the annotation (in the same way as MSL) as follows:

    uses(Modelica(version = "3.2.3")),
    version = "1.0.2",
    conversion(
 from(version = "3.2.3", script="modelica://Modelica/Resources/Scripts/Conversion/ConvertModelica_from_3.2.3_to_4.0.0.mos")),
    Icon( ... 

I also played with the above values, once 4.0.0, once 1.0.2 (with additional attribute to = "1.0.3". In all cases, I get a statement in OMEdit that OpenModelica currently does not support conversion scripts

How to execute the script?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use the OpenModelica master, OMC can convert libraries in memory (but not save to file). I have some scripts locally for this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recent commits have been integrated

Usage of MSL 4.0.0 after applying the conversion script
sjoelund and others added 6 commits April 6, 2021 09:07
The Modelica grammar does not allow annotations except at the end of a class.
* Convert to MSL 4.0.0

* Update version number to 1.0.3
# Conflicts:
#	BioChem/Interfaces/Reactions/Basics/FourSubstrates.mo
#	BioChem/Units/package.mo
@AtiyahElsheikh AtiyahElsheikh merged commit 32221fe into OpenModelica:develop Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Icons

3 participants