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

redeclaration of component from inherited model not possible? #10584

Closed
AHaumer opened this issue Apr 20, 2023 · 1 comment · Fixed by #10646
Closed

redeclaration of component from inherited model not possible? #10584

AHaumer opened this issue Apr 20, 2023 · 1 comment · Fixed by #10646
Assignees
Labels
COMP/GUI/OMEdit Issue and pull request related to OMEdit
Milestone

Comments

@AHaumer
Copy link

AHaumer commented Apr 20, 2023

Please consider the enclosed example:
Examples.Example1 is ok - I can redeclare driveData.data
Examples.Example2: extends from partial PartialExample (which is the same as Example1).
If I try to redeclare the driveData.data I get the following error message:

Unable to set the extends modifier value using command setExtendsModifierValue(Test.Examples.Example2, Test.Examples.PartialExample, driveData.data, $Code(=redeclare Test.ParameterRecords.DataB data))

  • OpenModelica Version: OpenModelica v1.20.0 (64-bit)
  • OS: Windows 10 Pro 64-bit
  • MSL 4.0

Please try to explain a work-around, I need this in my Master course at the university.
Also interested: @christiankral

Test.zip

@perost
Copy link
Member

perost commented Apr 20, 2023

Actually, this looks like an OMEdit issue. I assumed it was just the error message that showed the modifier wrong, but it seems like OMEdit might be calling the API with the wrong syntax. Fixing the syntax on the modifier and calling it in a script works:

loadFile("Test.mo");
setExtendsModifierValue(Test.Examples.Example2, Test.Examples.PartialExample,
    driveData.data, $Code((redeclare Test.ParameterRecords.DataA data)));
getErrorString();
list(Test.Examples.Example2);

However, I think driveData.data for the third argument is wrong, it should just be driveData since otherwise the redeclare of data is put on data itself (i.e. driveData.data(redeclare ... data) instead of the correct driveData(redeclare ... data)).

@perost perost added COMP/GUI/OMEdit Issue and pull request related to OMEdit and removed COMP/OMC/Interactive Environment labels Apr 20, 2023
@casella casella added this to the 1.22.0 milestone Apr 21, 2023
adeas31 added a commit to adeas31/OpenModelica that referenced this issue May 4, 2023
@adeas31 adeas31 closed this as completed in 02d3de0 May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
COMP/GUI/OMEdit Issue and pull request related to OMEdit
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants