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

#276 Now using name only to identify signals #277

Merged
merged 8 commits into from
Jul 1, 2019

Conversation

restenb
Copy link
Member

@restenb restenb commented Jun 19, 2019

Solves #276

@restenb restenb added the enhancement New feature or request label Jun 19, 2019
@restenb restenb self-assigned this Jun 19, 2019
Copy link
Contributor

@markaren markaren left a comment

Choose a reason for hiding this comment

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

In scenario_parser.cpp you should remove find_variable_type and find_causality functions.
In defaults struct and parse_defaults you should remove causality and type
parse_scenario needs to be updated to get the required info from the variable_description

@restenb
Copy link
Member Author

restenb commented Jun 19, 2019

In scenario_parser.cpp you should remove find_variable_type and find_causality functions.

Don't think so, they are still in use for creating a scenario::variable_action.

@markaren
Copy link
Contributor

markaren commented Jun 19, 2019

In scenario_parser.cpp you should remove find_variable_type and find_causality functions.

Don't think so, they are still in use for creating a scenario::variable_action.

That is why you should update parse_scenario to get the required info from the variable_description. I did the same change in #275, but you can be more effective. I loop through the variable list three times. Once is enough.

Edit: And you can remove type and causality form the scenario files.

@restenb
Copy link
Member Author

restenb commented Jun 19, 2019

Okay, now I see. I wasn't familiar with the implementation of scenarios, but on closer inspection this sounds reasonable - type and causality should indeed no longer be needed in the scenario data.

Edit: I'll wait for @eidekrist to comment as he's the original author of this code. Feel free to implement your suggested change on this PR instead.

@markaren markaren self-requested a review June 19, 2019 12:59
@markaren markaren self-requested a review June 19, 2019 13:01
@markaren
Copy link
Contributor

markaren commented Jun 23, 2019

A compile error was just fixed, but file_observer.cpp and stuff related to it LogConfig (?) still needs to be updated for this PR to be ok.

@markaren
Copy link
Contributor

Any hope of getting this PR moving? I think @eidekrist needs to verify and finish what remains.

@eidekrist
Copy link
Member

I'll try to get on this as soon as I can. Looks like we'll need a companion PR for cse-client as well.

@markaren
Copy link
Contributor

Finalizing the java wrapper and noticed that the C interface also needs to be updated. It should not be necessary to pass the variable_type when using the time_series_observer

@markaren
Copy link
Contributor

markaren commented Jul 1, 2019

Finalizing the java wrapper and noticed that the C interface also needs to be updated. It should not be necessary to pass the variable_type when using the time_series_observer

I looked a little bit into this, and I reckon it has to be "fixed" in a separate PR. I still think it is uneccessary for clients of the library to pass this information when the library can find it on his own. But the changes required for making it requires some substantial refactoring.

@eidekrist
Copy link
Member

Finalizing the java wrapper and noticed that the C interface also needs to be updated. It should not be necessary to pass the variable_type when using the time_series_observer

I looked a little bit into this, and I reckon it has to be "fixed" in a separate PR. I still think it is uneccessary for clients of the library to pass this information when the library can find it on his own. But the changes required for making it requires some substantial refactoring.

I reckon you're talking about the cse_observer_start_observing() method? In that case, passing the variable_type is necessary, since the value reference is only unique for a given type. See src/test/data/fmi1/identity.fmu, where there are variables for four types, all with the value reference = 0.

@markaren
Copy link
Contributor

markaren commented Jul 1, 2019

Finalizing the java wrapper and noticed that the C interface also needs to be updated. It should not be necessary to pass the variable_type when using the time_series_observer

I looked a little bit into this, and I reckon it has to be "fixed" in a separate PR. I still think it is uneccessary for clients of the library to pass this information when the library can find it on his own. But the changes required for making it requires some substantial refactoring.

I reckon you're talking about the cse_observer_start_observing() method? In that case, passing the variable_type is necessary, since the value reference is only unique for a given type. See src/test/data/fmi1/identity.fmu, where there are variables for four types, all with the value reference = 0.

I had to double-check the spec to see if this was true. It apparently is for both 1.0 and 2.0. Why would they do something like that? Well, well.

@eidekrist
Copy link
Member

eidekrist commented Jul 1, 2019

I am now a happy man, and believe this is good to go. Companion PR for cse-client here. While looking at file_observer.cpp I couldn't help but do some changes here and there, resulting in an improvement (IMO) in the log file output.

@eidekrist eidekrist merged commit 27775c1 into master Jul 1, 2019
@eidekrist eidekrist deleted the feature/276-use-signal-name-to-identify-signals branch July 1, 2019 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants