mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
artf4107: Removed most "Init" functions from classes
They were either replaced with delegating constructors or merged into the only constructor in the class. Change-Id: I3d35139f6ab23c719433a9f76942b02a3b07ddac
This commit is contained in:
@@ -11,9 +11,21 @@
|
||||
#include "LiveWindow/LiveWindow.h"
|
||||
|
||||
/**
|
||||
* Common function to implement constructor behavior.
|
||||
* Constructor using the default PCM ID (0).
|
||||
*
|
||||
* @param channel The channel on the PCM to control (0..7).
|
||||
*/
|
||||
void Solenoid::InitSolenoid() {
|
||||
Solenoid::Solenoid(uint32_t channel)
|
||||
: Solenoid(GetDefaultSolenoidModule(), channel) {}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param moduleNumber The CAN ID of the PCM the solenoid is attached to
|
||||
* @param channel The channel on the PCM to control (0..7).
|
||||
*/
|
||||
Solenoid::Solenoid(uint8_t moduleNumber, uint32_t channel)
|
||||
: SolenoidBase(moduleNumber), m_channel(channel) {
|
||||
char buf[64];
|
||||
if (!CheckSolenoidModule(m_moduleNumber)) {
|
||||
snprintf(buf, 64, "Solenoid Module %d", m_moduleNumber);
|
||||
@@ -40,27 +52,6 @@ void Solenoid::InitSolenoid() {
|
||||
m_moduleNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor using the default PCM ID (0).
|
||||
*
|
||||
* @param channel The channel on the PCM to control (0..7).
|
||||
*/
|
||||
Solenoid::Solenoid(uint32_t channel)
|
||||
: SolenoidBase(GetDefaultSolenoidModule()), m_channel(channel) {
|
||||
InitSolenoid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param moduleNumber The CAN ID of the PCM the solenoid is attached to
|
||||
* @param channel The channel on the PCM to control (0..7).
|
||||
*/
|
||||
Solenoid::Solenoid(uint8_t moduleNumber, uint32_t channel)
|
||||
: SolenoidBase(moduleNumber), m_channel(channel) {
|
||||
InitSolenoid();
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user