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

Conversion error when using a double parameter as ParameterAssignment value #221

Open
arauschert opened this issue Oct 30, 2024 · 0 comments
Labels
bug Something isn't working c++ The issue is realted to the c++ part of the project

Comments

@arauschert
Copy link
Collaborator

arauschert commented Oct 30, 2024

Describe the bug
In the OSC XML standard the class ParameterAssignment has an attribute 'value' of type 'string' so that it can hold any data type (see here).
This works, if the value is hardcoded. But when trying to set the value through a parameter of type 'double', the OSC API will return an error upon parsing:

Value '231.100000' cannot be converted to type 'string' (30,71)

Interestingly when setting the parameter value to an integer number (e.g. 231.0 but still with parameterType double) in the ParameterDeclaration, the OSC API will not return an error upon parsing.

To Reproduce
Here is the scenario and catalog I used for reproducing the error:
type_conversion.zip

Expected behavior
No error by OSC API when parsing double parameters into attributes of type string.

Further info
Probably the problem originates from here:

if (doubleValue == std::ceil(doubleValue))

The double value must be basically an integer, otherwise the "if" clause will not evaluate to true.

In v1_0 when there was still the parameter resolver instead of the expression resolver, everything could be converted to a string, while now there is a constraint:

@arauschert arauschert added bug Something isn't working c++ The issue is realted to the c++ part of the project labels Oct 30, 2024
kmfrank added a commit that referenced this issue Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c++ The issue is realted to the c++ part of the project
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant