Made SensorBase a utility class and renamed it to SensorUtil (#813)

This commit is contained in:
Tyler Veness
2018-05-23 20:22:30 -07:00
committed by Peter Johnson
parent ba93f79d8b
commit ecfe95383c
72 changed files with 210 additions and 240 deletions

View File

@@ -11,7 +11,7 @@
#include <HAL/Ports.h>
#include <HAL/Solenoid.h>
#include "SensorBase.h"
#include "SensorUtil.h"
#include "SmartDashboard/SendableBuilder.h"
#include "WPIErrors.h"
@@ -26,7 +26,7 @@ using namespace frc;
* @param reverseChannel The reverse channel number on the PCM (0..7).
*/
DoubleSolenoid::DoubleSolenoid(int forwardChannel, int reverseChannel)
: DoubleSolenoid(SensorBase::GetDefaultSolenoidModule(), forwardChannel,
: DoubleSolenoid(SensorUtil::GetDefaultSolenoidModule(), forwardChannel,
reverseChannel) {}
/**
@@ -41,18 +41,18 @@ DoubleSolenoid::DoubleSolenoid(int moduleNumber, int forwardChannel,
: SolenoidBase(moduleNumber),
m_forwardChannel(forwardChannel),
m_reverseChannel(reverseChannel) {
if (!SensorBase::CheckSolenoidModule(m_moduleNumber)) {
if (!SensorUtil::CheckSolenoidModule(m_moduleNumber)) {
wpi_setWPIErrorWithContext(ModuleIndexOutOfRange,
"Solenoid Module " + wpi::Twine(m_moduleNumber));
return;
}
if (!SensorBase::CheckSolenoidChannel(m_forwardChannel)) {
if (!SensorUtil::CheckSolenoidChannel(m_forwardChannel)) {
wpi_setWPIErrorWithContext(
ChannelIndexOutOfRange,
"Solenoid Channel " + wpi::Twine(m_forwardChannel));
return;
}
if (!SensorBase::CheckSolenoidChannel(m_reverseChannel)) {
if (!SensorUtil::CheckSolenoidChannel(m_reverseChannel)) {
wpi_setWPIErrorWithContext(
ChannelIndexOutOfRange,
"Solenoid Channel " + wpi::Twine(m_reverseChannel));