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

Simplify ssv related code in class Model #948

Merged
merged 4 commits into from
Feb 15, 2021
Merged

Conversation

lochel
Copy link
Member

@lochel lochel commented Feb 15, 2021

This is just simplifying some of the existing code.

@lochel lochel requested a review from arun3688 February 15, 2021 16:30
@lochel lochel enabled auto-merge (squash) February 15, 2021 16:32
@@ -1689,6 +1692,9 @@ bool oms::System::copyResources()

void oms::System::getAllResources(std::vector<std::string>& resources) const
{
if (!values.empty() && !Flags::ExportParametersInline())
Copy link
Contributor

Choose a reason for hiding this comment

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

this will not work, and values.empty() will always be false and the ssv files will not be pushed to resources

Copy link
Member Author

Choose a reason for hiding this comment

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

Why will values.empty() always be false?

@@ -1689,6 +1692,9 @@ bool oms::System::copyResources()

void oms::System::getAllResources(std::vector<std::string>& resources) const
{
if (!values.empty() && !Flags::ExportParametersInline())
resources.push_back("resources/" + std::string(this->getFullCref()) + ".ssv");
Copy link
Contributor

Choose a reason for hiding this comment

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

the ssv file can be pushed directly in exportoFile() in Model.cpp which is easily understandable i guess

Copy link
Member Author

Choose a reason for hiding this comment

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

values contain all the values that will be exported to the ssv file, right? Therefore, it would make sense to move everything ssv related to that class. I am not quite sure why it didn't work, but I would still like to move those things there.

@lochel lochel merged commit 7057a23 into OpenModelica:master Feb 15, 2021
@lochel lochel deleted the ssv branch February 15, 2021 21:12
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.

2 participants