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:
Tyler Veness
2015-06-29 02:43:44 -07:00
parent e4a8aacc51
commit 1ab3ea670d
62 changed files with 258 additions and 525 deletions

View File

@@ -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.
*/