Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding MSL 4.0.0 to libraries-for-testing #7161

Merged
merged 3 commits into from
Feb 17, 2021

Conversation

AnHeuermann
Copy link
Member

Adding test cases for Modelica.Clocked.Examples.CascadeControlledDrive.AbsoluteClocks from MSL 4.

@AnHeuermann AnHeuermann self-assigned this Feb 15, 2021
@sjoelund
Copy link
Member

I'm only speculating, but there might be some older tests that will fail. Change those to load 3.2.3 explicitly or update them :)

@AnHeuermann
Copy link
Member Author

AnHeuermann commented Feb 15, 2021

Oh yes, a lot of them broke. I'll just set them up to load MSL 3.2.3 for now. But in the long run we should update them to work with MSL 4.

AnHeuermann added 2 commits February 15, 2021 17:53
  - Using MSL 3.2.3 if it no version was specified
@AnHeuermann
Copy link
Member Author

@adeas31 Can you take a look into the test-clang-icon-generator test?

The script OMCompiler/Examples/generate_icons.py is not working for me with MSL 4.0.0 and I'm not sure how to fix it.

$ omc GenerateMSLIcons.mos
true
""
true
{1,1,0,1,1,1}
""
2021-02-15 18:37:21,589 - generate_icons.py - CRITICAL - Failed to generate icons for Complex after 0.1 seconds: can only concatenate str (not "int") to str
2021-02-15 18:37:21.517211 Generating SVGs for package(s) ['Complex']
Traceback (most recent call last):
  File "/home/andreas/workspace/OpenModelica/build/bin/../share/doc/omc/testmodels/generate_icons.py", line 1502, in <module>
    sys.exit(main())
  File "/home/andreas/workspace/OpenModelica/build/bin/../share/doc/omc/testmodels/generate_icons.py", line 1466, in main
    getBaseClasses(modelica_class, base_classes)
  File "/home/andreas/workspace/OpenModelica/build/bin/../share/doc/omc/testmodels/generate_icons.py", line 1354, in getBaseClasses
    for i in range(1, inheritance_cnt + 1):
TypeError: can only concatenate str (not "int") to str


2021-02-15 18:37:23,405 - generate_icons.py - CRITICAL - Failed to generate icons for Modelica.Blocks.Continuous.CriticalDamping after 1.9 seconds: can only concatenate str (not "int") to str
2021-02-15 18:37:21.540766 Generating SVGs for package(s) ['Modelica.Blocks.Continuous.CriticalDamping']
Traceback (most recent call last):
  File "/home/andreas/workspace/OpenModelica/build/bin/../share/doc/omc/testmodels/generate_icons.py", line 1502, in <module>
    sys.exit(main())
  File "/home/andreas/workspace/OpenModelica/build/bin/../share/doc/omc/testmodels/generate_icons.py", line 1466, in main
    getBaseClasses(modelica_class, base_classes)
  File "/home/andreas/workspace/OpenModelica/build/bin/../share/doc/omc/testmodels/generate_icons.py", line 1354, in getBaseClasses
    for i in range(1, inheritance_cnt + 1):
TypeError: can only concatenate str (not "int") to str


2021-02-15 18:37:21.507872 Generating SVGs for package(s) ['Modelica.Electrical.Analog.Basic.EMF']
2021-02-15 18:37:23.391754 Generated SVGs for 0 models in package(s) ['Modelica.Electrical.Analog.Basic.EMF'] in 1.9 seconds


2021-02-15 18:37:23,397 - generate_icons.py - CRITICAL - Failed to generate icons for Modelica.Mechanics.Rotational.Examples.Utilities.Spring after 1.9 seconds: can only concatenate str (not "int") to str
2021-02-15 18:37:21.517831 Generating SVGs for package(s) ['Modelica.Mechanics.Rotational.Examples.Utilities.Spring']
Traceback (most recent call last):
  File "/home/andreas/workspace/OpenModelica/build/bin/../share/doc/omc/testmodels/generate_icons.py", line 1502, in <module>
    sys.exit(main())
  File "/home/andreas/workspace/OpenModelica/build/bin/../share/doc/omc/testmodels/generate_icons.py", line 1466, in main
    getBaseClasses(modelica_class, base_classes)
  File "/home/andreas/workspace/OpenModelica/build/bin/../share/doc/omc/testmodels/generate_icons.py", line 1354, in getBaseClasses
    for i in range(1, inheritance_cnt + 1):
TypeError: can only concatenate str (not "int") to str


<?xml version="1.0" encoding="utf-8" ?>
<svg baseProfile="full" height="210.0" version="1.1" viewBox="0 0 310.0 210.0" width="310.0" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><rect fill="rgb(245,245,245)" fill-opacity="1" height="80.0" rx="0.0" ry="0.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" width="140.0" x="85.0" y="85.0" /><defs /><polygon fill="rgb(0,0,0)" fill-opacity="1" points="115.0,145.0 105.0,121.0 125.0,121.0 115.0,145.0" /><defs /><polyline fill="none" fill-opacity="0" points="115.0,105.0 115.0,121.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="85.0,105.0 115.0,105.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="105.0,145.0 105.0,165.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="125.0,145.0 125.0,165.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="145.0,145.0 145.0,165.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="165.0,145.0 165.0,165.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="185.0,145.0 185.0,165.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="205.0,145.0 205.0,165.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="55.0,105.0 85.0,105.0" stroke="rgb(0,127,255)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="225.0,105.0 255.0,105.0" stroke="rgb(0,127,255)" stroke-width="0.25mm" /><defs /><text dominant-baseline="middle" fill="rgb(0,0,0)" fill-opacity="1" font-family="Verdana" font-size="40.0" text-anchor="middle" x="155.0" y="45.0">name</text><defs /><polyline fill="none" fill-opacity="0" points="187.0,102.0 97.0,102.0" stroke="rgb(0,128,255)" stroke-width="0.25mm" /><defs /><polygon fill="rgb(0,128,255)" fill-opacity="1" points="177.0,87.0 217.0,102.0 177.0,117.0 177.0,87.0" stroke="rgb(0,128,255)" stroke-width="0.25mm" /><defs /><g id="port_a"><ellipse cx="55.0" cy="105.0" fill="rgb(0,127,255)" fill-opacity="1" rx="10.0" ry="10.0" stroke="rgb(0,127,255)" stroke-width="0.25mm" /><defs /><ellipse cx="55.0" cy="105.0" fill="rgb(0,127,255)" fill-opacity="1" rx="10.0" ry="10.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><g display="none" id="info"><text id="name">port_a</text><text id="type">Modelica.Fluid.Interfaces.FluidPort_a</text><text id="classDesc">Generic fluid connector at design inlet</text><text id="desc" /></g></g><g id="port_b"><ellipse cx="255.0" cy="105.0" fill="rgb(0,127,255)" fill-opacity="1" rx="10.0" ry="10.0" stroke="rgb(0,127,255)" stroke-width="0.25mm" /><defs /><ellipse cx="255.0" cy="105.0" fill="rgb(0,127,255)" fill-opacity="1" rx="10.0" ry="10.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><ellipse cx="255.0" cy="105.0" fill="rgb(255,255,255)" fill-opacity="1" rx="8.0" ry="8.0" stroke="rgb(0,127,255)" stroke-width="0.25mm" /><defs /><g display="none" id="info"><text id="name">port_b</text><text id="type">Modelica.Fluid.Interfaces.FluidPort_b</text><text id="classDesc">Generic fluid connector at design outlet</text><text id="desc" /></g></g></svg>

<?xml version="1.0" encoding="utf-8" ?>
<svg baseProfile="full" height="240.0" version="1.1" viewBox="0 0 311.0 240.0" width="311.0" xmlns="http://www.w3.org/2000/svg" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xlink="http://www.w3.org/1999/xlink"><defs /><ellipse cx="155.0" cy="125.0" fill="rgb(245,245,245)" fill-opacity="1" rx="70.0" ry="70.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="155.0,55.0 155.0,85.0" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="177.9,92.2 195.2,67.7" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="132.1,92.2 114.8,67.7" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="192.6,111.3 220.8,101.1" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="117.4,111.3 89.2,101.1" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><ellipse cx="155.0" cy="125.0" fill="none" fill-opacity="0" rx="12.0" ry="12.0" stroke="rgb(64,64,64)" stroke-width="0.25mm" /><defs /><polygon fill="rgb(64,64,64)" fill-opacity="1" points="150.23140170268132,123.49651395789338 171.13439318635196,67.17542601533324 174.54531854738605,63.00822213485722 174.9492718242069,68.37821484901855 159.76859829731868,126.50348604210662" /><defs /><ellipse cx="155.0" cy="125.0" fill="rgb(64,64,64)" fill-opacity="1" rx="7.0" ry="7.0" /><defs /><polyline fill="none" fill-opacity="0" points="225.0,125.0 255.0,125.0" stroke="rgb(0,0,127)" stroke-width="0.25mm" /><defs /><polyline fill="none" fill-opacity="0" points="155.0,195.0 155.0,225.0" stroke="rgb(0,127,255)" stroke-width="0.25mm" /><defs /><text dominant-baseline="middle" fill="rgb(0,0,0)" fill-opacity="1" font-family="Verdana" font-size="40.0" text-anchor="middle" x="155.0" y="25.0">name</text><defs /><text dominant-baseline="middle" fill="rgb(0,0,0)" fill-opacity="1" font-family="Verdana" font-size="30.0" text-anchor="middle" x="259.0" y="160.0">p</text><defs /><g id="port"><ellipse cx="155.0" cy="225.0" fill="rgb(0,127,255)" fill-opacity="1" rx="10.000463257217945" ry="9.99953672132034" stroke="rgb(0,127,255)" stroke-width="0.25mm" /><defs /><ellipse cx="155.0" cy="225.0" fill="rgb(0,127,255)" fill-opacity="1" rx="10.000463257217945" ry="9.99953672132034" stroke="rgb(0,0,0)" stroke-width="0.25mm" /><defs /><g display="none" id="info"><text id="name">port</text><text id="type">Modelica.Fluid.Interfaces.FluidPort_a</text><text id="classDesc">Generic fluid connector at design inlet</text><text id="desc" /></g></g><g id="p"><polygon fill="rgb(255,255,255)" fill-opacity="1" points="255.0,115.0 275.0,125.0 255.0,135.0" stroke="rgb(0,0,127)" stroke-width="0.25mm" /><defs /><g display="none" id="info"><text id="name">p</text><text id="type">Modelica.Blocks.Interfaces.RealOutput</text><text id="classDesc">'output Real' as connector</text><text id="desc">Pressure at port</text></g></g></svg>

There is some problem with componentAnnotationsList containing None (https://github.com/OpenModelica/OpenModelica/blob/master/OMCompiler/Examples/generate_icons.py#L491-L597) and inheritance_cnt being a string (ahttps://github.com/OpenModelica/OpenModelica/blob/master/OMCompiler/Examples/generate_icons.py#L1354).

I have added my "fixes" in f7fb7b3.

  - Using MSL 4.0.0 modles to generate icons
  - SVGs updated, but they are looking wrong
  - Disabled test for now
@AnHeuermann
Copy link
Member Author

I disabled the test GenerateMSLIcons.mos. It needs to be fixed in a sperate PR, see #7173.

@AnHeuermann AnHeuermann merged commit ea1a004 into OpenModelica:master Feb 17, 2021
@AnHeuermann AnHeuermann deleted the addMSL4.0.0Testsuite branch February 17, 2021 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants