mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[wpilib] PowerDistribution: Add module type getter (#3948)
This commit is contained in:
@@ -152,6 +152,20 @@ public class PowerDistribution implements Sendable, AutoCloseable {
|
||||
return m_module;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the module type for this power distribution object.
|
||||
*
|
||||
* @return The module type
|
||||
*/
|
||||
public ModuleType getType() {
|
||||
int type = PowerDistributionJNI.getType(m_handle);
|
||||
if (type == PowerDistributionJNI.REV_TYPE) {
|
||||
return ModuleType.kRev;
|
||||
} else {
|
||||
return ModuleType.kCTRE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether the PDH switchable channel is turned on or off. Returns false with the CTRE PDP.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user