[wpilibj] Remove getSimObject (#2479)

This approach to getting the simulation object doesn't work in C++ and
creates coupling that doesn't need to be present.
This commit is contained in:
Peter Johnson
2020-04-12 10:37:27 -07:00
committed by GitHub
parent c82b8546bc
commit 212182d991
5 changed files with 7 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2008-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2008-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -12,7 +12,6 @@ import edu.wpi.first.hal.AnalogJNI;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.hal.SimDevice;
import edu.wpi.first.hal.sim.AnalogInSim;
import edu.wpi.first.hal.util.AllocationException;
import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
import edu.wpi.first.wpilibj.smartdashboard.SendableRegistry;
@@ -360,8 +359,4 @@ public class AnalogInput implements PIDSource, Sendable, AutoCloseable {
builder.setSmartDashboardType("Analog Input");
builder.addDoubleProperty("Value", this::getAverageVoltage, null);
}
public AnalogInSim getSimObject() {
return new AnalogInSim(m_channel);
}
}

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2014-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2014-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -10,7 +10,6 @@ package edu.wpi.first.wpilibj;
import edu.wpi.first.hal.AnalogJNI;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.hal.sim.AnalogOutSim;
import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
import edu.wpi.first.wpilibj.smartdashboard.SendableRegistry;
@@ -65,8 +64,4 @@ public class AnalogOutput implements Sendable, AutoCloseable {
builder.setSmartDashboardType("Analog Output");
builder.addDoubleProperty("Value", this::getVoltage, this::setVoltage);
}
public AnalogOutSim getSimObject() {
return new AnalogOutSim(m_channel);
}
}

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2014-2019 FIRST. All Rights Reserved. */
/* Copyright (c) 2014-2020 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -10,7 +10,6 @@ package edu.wpi.first.wpilibj;
import edu.wpi.first.hal.AccelerometerJNI;
import edu.wpi.first.hal.FRCNetComm.tResourceType;
import edu.wpi.first.hal.HAL;
import edu.wpi.first.hal.sim.AccelerometerSim;
import edu.wpi.first.wpilibj.interfaces.Accelerometer;
import edu.wpi.first.wpilibj.smartdashboard.SendableBuilder;
import edu.wpi.first.wpilibj.smartdashboard.SendableRegistry;
@@ -104,8 +103,4 @@ public class BuiltInAccelerometer implements Accelerometer, Sendable, AutoClosea
builder.addDoubleProperty("Y", this::getY, null);
builder.addDoubleProperty("Z", this::getZ, null);
}
public AccelerometerSim getSimObject() {
return new AccelerometerSim();
}
}