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

Implement oms_rename for sub-models #928

Merged
merged 10 commits into from
Feb 9, 2021
Merged

Conversation

lochel
Copy link
Member

@lochel lochel commented Feb 1, 2021

Related Issues

Purpose

The oms_rename function does only work for model identifiers, but not for systems and components.

Expected Behavior

oms_rename("modelA", "modelB")     // renaming a model from modelA to modelB
oms_rename("modelA.Root", "root")  // renaming system Root to root in modelA
oms_rename("modelA.Root.foo", "some_name")    // renaming an FMU in the Root system from foo to some_name 

@lochel
Copy link
Member Author

lochel commented Feb 2, 2021

@adeas31 this will cause OMEdit (with OpenModelica/OpenModelica#7118) to crash. Can you have a quick look?

@lochel lochel marked this pull request as ready for review February 2, 2021 17:48
src/OMSimulatorLib/Model.cpp Outdated Show resolved Hide resolved
Copy link
Member Author

@lochel lochel left a comment

Choose a reason for hiding this comment

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

(OMSimulator v2.1.1.post6-g620bad6-linux)
@arun3688 Renaming model A to B should fail if there exists already a model B.

@lochel lochel merged commit b4463d5 into OpenModelica:master Feb 9, 2021
@lochel lochel deleted the rename branch February 9, 2021 17:30
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.

API for renaming only implemented for model identifiers
2 participants