Merge "Make index encoder constructors work."

This commit is contained in:
Thomas Clark (WPI)
2015-01-21 14:03:17 -08:00
committed by Gerrit Code Review

View File

@@ -216,6 +216,7 @@ public class Encoder extends SensorBase implements CounterBase, PIDSource, LiveW
m_bSource = new DigitalInput(bChannel);
m_indexSource = new DigitalInput(indexChannel);
initEncoder(reverseDirection);
setIndexSource(indexChannel);
}
/**
@@ -328,7 +329,7 @@ public class Encoder extends SensorBase implements CounterBase, PIDSource, LiveW
}
/**
* Encoder constructor. Construct a Encoder given a and b channels as
* Encoder constructor. Construct a Encoder given a, b and index channels as
* digital inputs. This is used in the case where the digital inputs are
* shared. The Encoder class will not allocate the digital inputs and assume
* that they already are counted.
@@ -360,10 +361,11 @@ public class Encoder extends SensorBase implements CounterBase, PIDSource, LiveW
m_bSource = bSource;
m_indexSource = indexSource;
initEncoder(reverseDirection);
setIndexSource(indexSource);
}
/**
* Encoder constructor. Construct a Encoder given a and b channels as
* Encoder constructor. Construct a Encoder given a, b and index channels as
* digital inputs. This is used in the case where the digital inputs are
* shared. The Encoder class will not allocate the digital inputs and assume
* that they already are counted.