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

@@ -10,9 +10,26 @@
#include "LiveWindow/LiveWindow.h"
/**
* Common function to implement constructor behaviour.
* Constructor.
* Uses the default PCM ID of 0
* @param forwardChannel The forward channel number on the PCM (0..7).
* @param reverseChannel The reverse channel number on the PCM (0..7).
*/
void DoubleSolenoid::InitSolenoid() {
DoubleSolenoid::DoubleSolenoid(uint32_t forwardChannel, uint32_t reverseChannel)
: DoubleSolenoid(GetDefaultSolenoidModule(), forwardChannel, reverseChannel) {}
/**
* Constructor.
*
* @param moduleNumber The CAN ID of the PCM.
* @param forwardChannel The forward channel on the PCM to control (0..7).
* @param reverseChannel The reverse channel on the PCM to control (0..7).
*/
DoubleSolenoid::DoubleSolenoid(uint8_t moduleNumber, uint32_t forwardChannel,
uint32_t reverseChannel)
: SolenoidBase(moduleNumber),
m_forwardChannel(forwardChannel),
m_reverseChannel(reverseChannel) {
char buf[64];
if (!CheckSolenoidModule(m_moduleNumber)) {
snprintf(buf, 64, "Solenoid Module %d", m_moduleNumber);
@@ -58,34 +75,6 @@ void DoubleSolenoid::InitSolenoid() {
m_forwardChannel, this);
}
/**
* Constructor.
* Uses the default PCM ID of 0
* @param forwardChannel The forward channel number on the PCM (0..7).
* @param reverseChannel The reverse channel number on the PCM (0..7).
*/
DoubleSolenoid::DoubleSolenoid(uint32_t forwardChannel, uint32_t reverseChannel)
: SolenoidBase(GetDefaultSolenoidModule()),
m_forwardChannel(forwardChannel),
m_reverseChannel(reverseChannel) {
InitSolenoid();
}
/**
* Constructor.
*
* @param moduleNumber The CAN ID of the PCM.
* @param forwardChannel The forward channel on the PCM to control (0..7).
* @param reverseChannel The reverse channel on the PCM to control (0..7).
*/
DoubleSolenoid::DoubleSolenoid(uint8_t moduleNumber, uint32_t forwardChannel,
uint32_t reverseChannel)
: SolenoidBase(moduleNumber),
m_forwardChannel(forwardChannel),
m_reverseChannel(reverseChannel) {
InitSolenoid();
}
/**
* Destructor.
*/