Repository navigation
Conversation
|
Reviewing code |
| * See {@link lejos.robotics.SampleProvider leJOS conventions for SampleProviders} | ||
| */ | ||
| public SampleProvider getAngleMode() { | ||
| public EV3GyroAngleMode getAngleMode() { |
There was a problem hiding this comment.
Every mode returns a SampleProvider
There was a problem hiding this comment.
EV3GyroAngleMode is a SampleProvider - by implementing SensorMode.
| switchMode(MODE_RATE_ANGLE, SWITCH_DELAY); | ||
| } | ||
|
|
||
| public static class EV3GyroAngleMode implements SensorMode { |
There was a problem hiding this comment.
That mode is not necessary. I understand that you added the method getAngle() but it breaks the contract.
It is necessary to upgrade with DataChannelRereader:
https://github.com/ev3dev-lang-java/ev3dev-lang-java/blob/master/src/main/java/ev3dev/sensors/GenericMode.java
There was a problem hiding this comment.
In what way does it break the contract?
Touching GenericMode is a much broader change. I'll put in a pull request to show that.
| public EV3GyroAngleMode getAngleMode() { | ||
| switchMode(MODE_ANGLE, SWITCH_DELAY); | ||
| return getMode(1); | ||
| return (EV3GyroAngleMode)getMode(1); |
There was a problem hiding this comment.
It is not necessary to change that line
|
Old proposal |
Prototype of using DataChannelRereader in EV3Gyro