mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[sim] Add WPILib-class-taking constructors (#2538)
When not direct mapped, make index constructors private and add factory functions for channel and index. Co-authored-by: GabrielDeml <gabrielddeml@gmail.com>
This commit is contained in:
@@ -25,7 +25,7 @@ PowerDistributionPanel::PowerDistributionPanel() : PowerDistributionPanel(0) {}
|
||||
/**
|
||||
* Initialize the PDP.
|
||||
*/
|
||||
PowerDistributionPanel::PowerDistributionPanel(int module) {
|
||||
PowerDistributionPanel::PowerDistributionPanel(int module) : m_module(module) {
|
||||
int32_t status = 0;
|
||||
m_handle = HAL_InitializePDP(module, &status);
|
||||
if (status != 0) {
|
||||
@@ -136,6 +136,8 @@ void PowerDistributionPanel::ClearStickyFaults() {
|
||||
}
|
||||
}
|
||||
|
||||
int PowerDistributionPanel::GetModule() const { return m_module; }
|
||||
|
||||
void PowerDistributionPanel::InitSendable(SendableBuilder& builder) {
|
||||
builder.SetSmartDashboardType("PowerDistributionPanel");
|
||||
for (int i = 0; i < SensorUtil::kPDPChannels; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user