mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +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:
@@ -9,27 +9,12 @@
|
||||
#include "LiveWindow/LiveWindow.h"
|
||||
#include "simulation/simTime.h"
|
||||
|
||||
/**
|
||||
* Common function to implement constructor behavior.
|
||||
*/
|
||||
void Solenoid::InitSolenoid(int slot, int channel)
|
||||
{
|
||||
char buffer[50];
|
||||
int n = sprintf(buffer, "pneumatic/%d/%d", slot, channel);
|
||||
m_impl = new SimContinuousOutput(buffer);
|
||||
|
||||
LiveWindow::GetInstance()->AddActuator("Solenoid", slot, channel, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param channel The channel on the solenoid module to control (1..8).
|
||||
*/
|
||||
Solenoid::Solenoid(uint32_t channel)
|
||||
{
|
||||
InitSolenoid(1, channel);
|
||||
}
|
||||
Solenoid::Solenoid(uint32_t channel) : Solenoid(1, channel) {}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
@@ -39,7 +24,12 @@ Solenoid::Solenoid(uint32_t channel)
|
||||
*/
|
||||
Solenoid::Solenoid(uint8_t moduleNumber, uint32_t channel)
|
||||
{
|
||||
InitSolenoid(moduleNumber, channel);
|
||||
char buffer[50];
|
||||
int n = sprintf(buffer, "pneumatic/%d/%d", moduleNumber, channel);
|
||||
m_impl = new SimContinuousOutput(buffer);
|
||||
|
||||
LiveWindow::GetInstance()->AddActuator("Solenoid", moduleNumber, channel,
|
||||
this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user