mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
SCRIPT: wpiformat
This commit is contained in:
committed by
Peter Johnson
parent
ae6bdc9d25
commit
2109161534
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user