Package edu.wpi.first.wpilibj.simulation
Class SolenoidSim
java.lang.Object
edu.wpi.first.wpilibj.simulation.SolenoidSim
public class SolenoidSim extends Object
Class to control a simulated
Solenoid
.-
Constructor Summary
Constructors Constructor Description SolenoidSim(int module, PneumaticsModuleType moduleType, int channel)
Constructs for a solenoid on a pneumatics module of the given type and ID.SolenoidSim(PneumaticsModuleType moduleType, int channel)
Constructs for a solenoid on a pneumatics module of the given type and default ID.SolenoidSim(PneumaticsBaseSim moduleSim, int channel)
Constructs for a solenoid on the given pneumatics module. -
Method Summary
Modifier and Type Method Description boolean
getOutput()
Check the solenoid output.PneumaticsBaseSim
getPCMSim()
Get the wrappedPneumaticsBaseSim
object.CallbackStore
registerOutputCallback(NotifyCallback callback, boolean initialNotify)
Register a callback to be run when the output of this solenoid has changed.void
setOutput(boolean output)
Change the solenoid output.
-
Constructor Details
-
SolenoidSim
Constructs for a solenoid on the given pneumatics module.- Parameters:
moduleSim
- the PCM the solenoid is connected to.channel
- the solenoid channel.
-
SolenoidSim
Constructs for a solenoid on a pneumatics module of the given type and ID.- Parameters:
module
- the CAN ID of the pneumatics module the solenoid is connected to.moduleType
- the module type (PH or PCM)channel
- the solenoid channel.
-
SolenoidSim
Constructs for a solenoid on a pneumatics module of the given type and default ID.- Parameters:
moduleType
- the module type (PH or PCM)channel
- the solenoid channel.
-
-
Method Details
-
getOutput
Check the solenoid output.- Returns:
- the solenoid output
-
setOutput
Change the solenoid output.- Parameters:
output
- the new solenoid output
-
registerOutputCallback
Register a callback to be run when the output of this solenoid has changed.- Parameters:
callback
- the callbackinitialNotify
- should the callback be run with the initial value- Returns:
- the
CallbackStore
object associated with this callback. Save a reference to this object so GC doesn't cancel the callback.
-
getPCMSim
Get the wrappedPneumaticsBaseSim
object.- Returns:
- the wrapped
PneumaticsBaseSim
object.
-