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

WIP - Snapshot based redo undo functionality for OMSimulator models #911

Merged
merged 1 commit into from Jun 12, 2020

Conversation

adeas31
Copy link
Member

@adeas31 adeas31 commented May 29, 2020

  • Fixes ticket:5789 delete ssp components
    Fixes ticket:5984
    • Disable the text view if its not allowed to edit.
    • Clicking in the libraries browser should accept text changes.
    • Tabs should be preserved when accepting text changes.
    • The open nodes of the tree view in the libraries browser should be preserved when accepting text changes.
  • Create new OMSimulator models by right clicking in the Libraries Browser
  • Improved the addsubmodel dialog. Let user first select the file and then propose name from filename.

@adeas31 adeas31 requested a review from lochel May 29, 2020 13:05
@lochel
Copy link
Member

lochel commented May 29, 2020

Component names cannot contain dots. Please replace them with underscores or something else.

@adeas31
Copy link
Member Author

adeas31 commented May 29, 2020

Component names cannot contain dots. Please replace them with underscores or something else.

Instead of auto replacing them, I added a check for dots.
BTW I expect oms_addSubModel to fail if name is illegal. Are there more such restrictions with name?

@lochel
Copy link
Member

lochel commented May 30, 2020

Everything works rather well I think. Just some minor comments:

  • The API is catching the error and showing a error message in OMEdit.
  • The pre-selected name is rather bad right now. Just replacing the dots with an underscore would be much better. Just consider a typical case as this one with the FMUs DualMassOscillator.System1.fmu and DualMassOscillator.System2.fmu.
  • Please open directly the file browser when adding a submodel.

Copy link
Member

@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.

See my comments above

@adeas31
Copy link
Member Author

adeas31 commented Jun 1, 2020

Everything works rather well I think. Just some minor comments:

  • The API is catching the error and showing a error message in OMEdit.

I see but the error message is not very helpful. It says [addSubModel] System "Test.Root.SC" does not contain system "DualMassOscillator" when the submodel name is DualMassOscillator.System2.

  • The pre-selected name is rather bad right now. Just replacing the dots with an underscore would be much better. Just consider a typical case as this one with the FMUs DualMassOscillator.System1.fmu and DualMassOscillator.System2.fmu.

Done.

  • Please open directly the file browser when adding a submodel.

Done.

@lochel
Copy link
Member

lochel commented Jun 2, 2020

Do you want me to test it again?

@adeas31
Copy link
Member Author

adeas31 commented Jun 2, 2020

Do you want me to test it again?

I will let you know when its ready for testing again.

@casella
Copy link
Contributor

casella commented Jun 7, 2020

@lochel, @adeas31, can we merge this before feature freeze?

@adeas31
Copy link
Member Author

adeas31 commented Jun 8, 2020

Not yet. I need some more time to finish this.

@casella
Copy link
Contributor

casella commented Jun 8, 2020

OK, no problem 😃

@adeas31
Copy link
Member Author

adeas31 commented Jun 11, 2020

@lochel this is up for testing again.

@lochel
Copy link
Member

lochel commented Jun 12, 2020

@adeas31 I have again the problem that not all changes end up in the build of OMEdit. Even though you did change the Makefile to fix this problem as far as I remember.

@adeas31
Copy link
Member Author

adeas31 commented Jun 12, 2020

Strange. Maybe you still have the old makefile and qmake skips the generation of the new one.

@lochel
Copy link
Member

lochel commented Jun 12, 2020

How should I force to build OMEdit then?

@adeas31
Copy link
Member Author

adeas31 commented Jun 12, 2020

touch main.cpp

Create new OMSimulator models by right clicking in the Libraries Browser
Improved the addsubmodel dialog. Let user first select the file and then propose name from filename.
Fixes ticket:5789
Fixes ticket:5984
Disable the text view if its not allowed to edit.
Tabs should be preserved when accepting text changes.
The open nodes of the tree view in the libraries browser should be preserved when accepting text changes.

Handle deletion of multiple components.
Convert dots to underscores in submodel name.
Set background-color to show the read-only ssp editor as disbaled.
Renamed OMSimulator menu item to SSP.
Use the same GUI buttons for simulation.
Separated instantiation from simulation setup.
Disable the changes once the model is in instantiated state.
Get rid of OMSSimulationOptions.h InstantiateDialog.h/.cpp
Accept text changes when user clicks in the libraries browser.
Open directly the file browser when adding a submodel.
Use just one setting for working directory.
@adeas31 adeas31 merged commit 1a78531 into OpenModelica:master Jun 12, 2020
@adeas31 adeas31 deleted the oms-redo-undo branch June 12, 2020 13:57
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

3 participants