Package edu.wpi.first.wpilibj.simulation
Class SolenoidSim
java.lang.Object
edu.wpi.first.wpilibj.simulation.SolenoidSim
Class to control a simulated
Solenoid.-
Constructor Summary
ConstructorsConstructorDescriptionSolenoidSim(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 TypeMethodDescriptionbooleanCheck the solenoid output.Get the wrappedPneumaticsBaseSimobject.registerOutputCallback(NotifyCallback callback, boolean initialNotify) Register a callback to be run when the output of this solenoid has changed.voidsetOutput(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
CallbackStoreobject associated with this callback.
-
getPCMSim
Get the wrappedPneumaticsBaseSimobject.- Returns:
- the wrapped
PneumaticsBaseSimobject.
-