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

#1554 rename module #1573

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

benjaperez1983
Copy link
Contributor

Fixes #1554

Description

When importing a simulation from pkml, whose name already exists in the project: MoBi asks to rename the simulation and suggests N as the new default name:
However, if I enter another name for the simulation: the module of the imported simulation still has the default name

Type of change

Please mark relevant options with an x in the brackets.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires documentation changes (link at least one user or developer documentation issue):
  • Algorithm update - updates algorithm documentation/questions/answers etc.
  • Other (please describe):

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Integration tests
  • Unit tests
  • Manual tests
  • No tests required

Reviewer checklist

Mark everything that needs to be checked before merging the PR.

  • Check if the code is well documented
  • Check if the behavior is what is expected
  • Check if the code is well tested
  • Check if the code is readable and well formatted
  • Additional checks (document below if any)
  • Check if documentation update issue(s) are created if the option This change requires a documentation update above is selected

Screenshots (if appropriate):

Questions (if appropriate):

src/MoBi.Core/Services/SimulationLoader.cs Outdated Show resolved Hide resolved
src/MoBi.Core/Services/SimulationLoader.cs Outdated Show resolved Hide resolved
src/MoBi.Core/Services/SimulationLoader.cs Outdated Show resolved Hide resolved
src/MoBi.Core/Services/SimulationLoader.cs Outdated Show resolved Hide resolved
src/MoBi.Core/Services/SimulationLoader.cs Outdated Show resolved Hide resolved
src/MoBi.Core/Services/SimulationLoader.cs Outdated Show resolved Hide resolved

private void renameModulesAfterSimulation(Module module, string simulationName, string originalSimulationName)
{
if (module.Name.StartsWith(originalSimulationName))
Copy link
Member

Choose a reason for hiding this comment

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

why StartsWith and not Equals ?

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.

Rename module when renaming imported simulation
3 participants