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

TypeDefinitions support? #100

Closed
Shannon-John opened this issue Oct 17, 2020 · 2 comments
Closed

TypeDefinitions support? #100

Shannon-John opened this issue Oct 17, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@Shannon-John
Copy link

Shannon-John commented Oct 17, 2020

Dear author:
I'm using FMI4Cpp as backend for a UI. I want to show Enumeration definition info, but I can not find the FMU parser processing it. Can this feature be added in the future? Follows are the parser code I found in FUM4Cpp:

for (const ptree::value_type& v : root) {
    if (v.first == "CoSimulation") {
        coSimulation = parse_cs_attributes(v.second);
    } else if (v.first == "ModelExchange") {
        modelExchange = parse_me_attributes(v.second);
    } else if (v.first == "DefaultExperiment") {
        base.default_experiment = parse_default_experiment(v.second);
    } else if (v.first == "ModelVariables") {
        base.model_variables = std::move(parse_model_variables(v.second));
    } else if (v.first == "ModelStructure") {
        base.model_structure = std::move(parse_model_structure(v.second));
    }
}

For ModelVariable, if it has an enumeration type attribute, the attribute's item description string is defined in
TypeDefinitions part of the ModelDescription.

Thanks!

@markaren markaren added the enhancement New feature or request label Oct 17, 2020
@markaren
Copy link
Member

Hi, thanks for using the library.

I never bothered parsing the TypeDefinitions as I've never had any use for them and I'm not sure of much they are used in practice? However, just parsing them and make the information accessible should be quite straightforward. So this is something we can add, but right now I'm quite swamped with other work. So I'm not seeing this as something I'll do the coming months. If you're willing to put up a PR, however, I could take a look quicker.

@Shannon-John
Copy link
Author

OK!
Thanks for replying so quickly.
I'll do it myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants