Skip to content

Convert types and indices in special sensor specification to lists #169

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

Merged
merged 1 commit into from
Oct 4, 2016

Conversation

ddemidov
Copy link
Member

@ddemidov ddemidov commented Sep 27, 2016

This allows to correctly work with modes that have several values.
The immediate example is GYRO-G&A mode that is added to gyroSensor with this PR.

❗ Requires rewriting templates for special sensor types.

See ddemidov/ev3dev-lang-cpp#10

This allows to correctly work with modes that have several values.

See ddemidov/ev3dev-lang-cpp/issues#10
ddemidov added a commit to ddemidov/ev3dev-lang-cpp that referenced this pull request Sep 27, 2016
Change template for special sensor types to account for the fact that
types and value indices are now lists in the specification.

Refs #10, depends on ev3dev/ev3dev-lang#169
ddemidov added a commit to ddemidov/ev3dev-lang-cpp that referenced this pull request Sep 27, 2016
Change template for special sensor types to account for the fact that
types and value indices are now lists in the specification.

Refs #10, depends on ev3dev/ev3dev-lang#169
@WasabiFan
Copy link
Member

Sorry I haven't been involved in that thread so far.

Although this looks good code-wise, I am wondering why we need it. Is there an advantage to doing this over just always using the G&A mode for that sensor? I haven't gotten the chance to do a speed comparison.

@ddemidov
Copy link
Member Author

@WasabiFan
Copy link
Member

Give me some time to look through this more closely (I want to understand the C++ template you have); right now I don't think I properly understand the use case.

@ddemidov
Copy link
Member Author

Sure. Compare the result of the template here: https://github.com/ddemidov/ev3dev-lang-cpp/blob/858c0cb77b43f4e265fc571783986f5da51db556/ev3dev.h#L481-L491

The first method is generated from a type/indices list with single entry, and the second is generated from two entries. The template just checks if the type list has single entry and does different things depending on that.

@WasabiFan WasabiFan self-assigned this Sep 28, 2016
@WasabiFan
Copy link
Member

By the way, I haven't forgotten about this; I just haven't had a time to read through and understand the changes and their implications. If you want to merge this before I can take a look, go ahead; I trust your judgment.

ddemidov added a commit to ddemidov/ev3dev-lang-cpp that referenced this pull request Oct 3, 2016
Change template for special sensor types to account for the fact that
types and value indices are now lists in the specification.

Refs #10, depends on ev3dev/ev3dev-lang#169
@WasabiFan
Copy link
Member

OK, I understand this now. LGTM.

@ddemidov ddemidov merged commit 436957c into develop Oct 4, 2016
@ddemidov ddemidov deleted the tuple_values branch October 4, 2016 03:52
ddemidov added a commit to ddemidov/ev3dev-lang-cpp that referenced this pull request Oct 4, 2016
Change template for special sensor types to account for the fact that
types and value indices are now lists in the specification.

Refs #10, depends on ev3dev/ev3dev-lang#169
ddemidov added a commit to ddemidov/ev3dev-lang-cpp that referenced this pull request Oct 4, 2016
Change template for special sensor types to account for the fact that
types and value indices are now lists in the specification.

Refs #10, depends on ev3dev/ev3dev-lang#169
ddemidov added a commit to ev3dev/ev3dev-lang-python that referenced this pull request Oct 4, 2016
ddemidov added a commit that referenced this pull request Oct 4, 2016
WasabiFan pushed a commit that referenced this pull request Oct 4, 2016
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