SCRIPT: wpiformat

This commit is contained in:
PJ Reiniger
2025-11-07 20:01:58 -05:00
committed by Peter Johnson
parent ae6bdc9d25
commit 2109161534
749 changed files with 5504 additions and 3936 deletions

View File

@@ -23,11 +23,11 @@ DoubleSolenoid::DoubleSolenoid(int busId, int module,
m_reverseChannel{reverseChannel} {
if (!m_module->CheckSolenoidChannel(m_forwardChannel)) {
throw WPILIB_MakeError(err::ChannelIndexOutOfRange, "Channel {}",
m_forwardChannel);
m_forwardChannel);
}
if (!m_module->CheckSolenoidChannel(m_reverseChannel)) {
throw WPILIB_MakeError(err::ChannelIndexOutOfRange, "Channel {}",
m_reverseChannel);
m_reverseChannel);
}
m_forwardMask = 1 << forwardChannel;
@@ -37,14 +37,15 @@ DoubleSolenoid::DoubleSolenoid(int busId, int module,
int allocMask = m_module->CheckAndReserveSolenoids(m_mask);
if (allocMask != 0) {
if (allocMask == m_mask) {
throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channels {} and {}",
m_forwardChannel, m_reverseChannel);
throw WPILIB_MakeError(err::ResourceAlreadyAllocated,
"Channels {} and {}", m_forwardChannel,
m_reverseChannel);
} else if (allocMask == m_forwardMask) {
throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channel {}",
m_forwardChannel);
m_forwardChannel);
} else {
throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "Channel {}",
m_reverseChannel);
m_reverseChannel);
}
}
@@ -52,8 +53,8 @@ DoubleSolenoid::DoubleSolenoid(int busId, int module,
fmt::format("Solenoid[{},{}]", m_forwardChannel, m_reverseChannel),
"DoubleSolenoid");
wpi::util::SendableRegistry::Add(this, "DoubleSolenoid",
m_module->GetModuleNumber(), m_forwardChannel);
wpi::util::SendableRegistry::Add(
this, "DoubleSolenoid", m_module->GetModuleNumber(), m_forwardChannel);
}
DoubleSolenoid::DoubleSolenoid(int busId, PneumaticsModuleType moduleType,