mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[sim] Add WPILib-class-taking constructors (#2538)
When not direct mapped, make index constructors private and add factory functions for channel and index. Co-authored-by: GabrielDeml <gabrielddeml@gmail.com>
This commit is contained in:
@@ -24,7 +24,7 @@ class AccelerometerSimTest {
|
||||
@Test
|
||||
void testCallbacks() {
|
||||
HAL.initialize(500, 0);
|
||||
AccelerometerSim sim = new AccelerometerSim();
|
||||
BuiltInAccelerometerSim sim = new BuiltInAccelerometerSim();
|
||||
sim.resetData();
|
||||
|
||||
TriggeredStore store = new TriggeredStore();
|
||||
|
||||
@@ -26,7 +26,7 @@ class AnalogInputSimTest {
|
||||
HAL.initialize(500, 0);
|
||||
|
||||
AnalogInput input = new AnalogInput(5);
|
||||
AnalogInSim inputSim = new AnalogInSim(5);
|
||||
AnalogInputSim inputSim = new AnalogInputSim(input);
|
||||
|
||||
for (double i = 0; i < 5.0; i += 0.1) {
|
||||
inputSim.setVoltage(0);
|
||||
|
||||
@@ -37,7 +37,7 @@ class AnalogOutputSimTest {
|
||||
AnalogOutput output = new AnalogOutput(0);
|
||||
output.setVoltage(0.5);
|
||||
|
||||
AnalogOutSim outputSim = new AnalogOutSim(0);
|
||||
AnalogOutputSim outputSim = new AnalogOutputSim(output);
|
||||
|
||||
DoubleStore store = new DoubleStore();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user