Class REVPHSim


public class REVPHSim extends PneumaticsBaseSim
Class to control a simulated PneumaticHub (PH).
  • Constructor Details

    • REVPHSim

      public REVPHSim()
      Constructs for the default PH.
    • REVPHSim

      public REVPHSim(int module)
      Constructs from a PH module number (CAN ID).
      Parameters:
      module - module number
    • REVPHSim

      public REVPHSim(PneumaticHub module)
      Constructs from a PneumaticHum object.
      Parameters:
      module - PCM module to simulate
  • Method Details

    • getCompressorConfigType

      public int getCompressorConfigType()
      Check whether the closed loop compressor control is active.
      Returns:
      config type
    • setCompressorConfigType

      public void setCompressorConfigType(int compressorConfigType)
      Turn on/off the closed loop control of the compressor.
      Parameters:
      compressorConfigType - compressor config type
    • registerCompressorConfigTypeCallback

      public CallbackStore registerCompressorConfigTypeCallback(NotifyCallback callback, boolean initialNotify)
      Register a callback to be run whenever the closed loop state changes.
      Parameters:
      callback - the callback
      initialNotify - whether the callback should be called with the initial value
      Returns:
      the CallbackStore object associated with this callback.
    • getInitialized

      public boolean getInitialized()
      Description copied from class: PneumaticsBaseSim
      Check whether the PCM/PH has been initialized.
      Specified by:
      getInitialized in class PneumaticsBaseSim
      Returns:
      true if initialized
    • setInitialized

      public void setInitialized(boolean initialized)
      Description copied from class: PneumaticsBaseSim
      Define whether the PCM/PH has been initialized.
      Specified by:
      setInitialized in class PneumaticsBaseSim
      Parameters:
      initialized - true for initialized
    • registerInitializedCallback

      public CallbackStore registerInitializedCallback(NotifyCallback callback, boolean initialNotify)
      Description copied from class: PneumaticsBaseSim
      Register a callback to be run when the PCM/PH is initialized.
      Specified by:
      registerInitializedCallback in class PneumaticsBaseSim
      Parameters:
      callback - the callback
      initialNotify - whether to run the callback with the initial state
      Returns:
      the CallbackStore object associated with this callback.
    • getCompressorOn

      public boolean getCompressorOn()
      Description copied from class: PneumaticsBaseSim
      Check if the compressor is on.
      Specified by:
      getCompressorOn in class PneumaticsBaseSim
      Returns:
      true if the compressor is active
    • setCompressorOn

      public void setCompressorOn(boolean compressorOn)
      Description copied from class: PneumaticsBaseSim
      Set whether the compressor is active.
      Specified by:
      setCompressorOn in class PneumaticsBaseSim
      Parameters:
      compressorOn - the new value
    • registerCompressorOnCallback

      public CallbackStore registerCompressorOnCallback(NotifyCallback callback, boolean initialNotify)
      Description copied from class: PneumaticsBaseSim
      Register a callback to be run when the compressor activates.
      Specified by:
      registerCompressorOnCallback in class PneumaticsBaseSim
      Parameters:
      callback - the callback
      initialNotify - whether to run the callback with the initial state
      Returns:
      the CallbackStore object associated with this callback.
    • getSolenoidOutput

      public boolean getSolenoidOutput(int channel)
      Description copied from class: PneumaticsBaseSim
      Check the solenoid output on a specific channel.
      Specified by:
      getSolenoidOutput in class PneumaticsBaseSim
      Parameters:
      channel - the channel to check
      Returns:
      the solenoid output
    • setSolenoidOutput

      public void setSolenoidOutput(int channel, boolean solenoidOutput)
      Description copied from class: PneumaticsBaseSim
      Change the solenoid output on a specific channel.
      Specified by:
      setSolenoidOutput in class PneumaticsBaseSim
      Parameters:
      channel - the channel to check
      solenoidOutput - the new solenoid output
    • registerSolenoidOutputCallback

      public CallbackStore registerSolenoidOutputCallback(int channel, NotifyCallback callback, boolean initialNotify)
      Description copied from class: PneumaticsBaseSim
      Register a callback to be run when the solenoid output on a channel changes.
      Specified by:
      registerSolenoidOutputCallback in class PneumaticsBaseSim
      Parameters:
      channel - the channel to monitor
      callback - the callback
      initialNotify - should the callback be run with the initial value
      Returns:
      the CallbackStore object associated with this callback.
    • getPressureSwitch

      public boolean getPressureSwitch()
      Description copied from class: PneumaticsBaseSim
      Check the value of the pressure switch.
      Specified by:
      getPressureSwitch in class PneumaticsBaseSim
      Returns:
      the pressure switch value
    • setPressureSwitch

      public void setPressureSwitch(boolean pressureSwitch)
      Description copied from class: PneumaticsBaseSim
      Set the value of the pressure switch.
      Specified by:
      setPressureSwitch in class PneumaticsBaseSim
      Parameters:
      pressureSwitch - the new value
    • registerPressureSwitchCallback

      public CallbackStore registerPressureSwitchCallback(NotifyCallback callback, boolean initialNotify)
      Description copied from class: PneumaticsBaseSim
      Register a callback to be run whenever the pressure switch value changes.
      Specified by:
      registerPressureSwitchCallback in class PneumaticsBaseSim
      Parameters:
      callback - the callback
      initialNotify - whether the callback should be called with the initial value
      Returns:
      the CallbackStore object associated with this callback.
    • getCompressorCurrent

      public double getCompressorCurrent()
      Description copied from class: PneumaticsBaseSim
      Read the compressor current.
      Specified by:
      getCompressorCurrent in class PneumaticsBaseSim
      Returns:
      the current of the compressor connected to this module
    • setCompressorCurrent

      public void setCompressorCurrent(double compressorCurrent)
      Description copied from class: PneumaticsBaseSim
      Set the compressor current.
      Specified by:
      setCompressorCurrent in class PneumaticsBaseSim
      Parameters:
      compressorCurrent - the new compressor current
    • registerCompressorCurrentCallback

      public CallbackStore registerCompressorCurrentCallback(NotifyCallback callback, boolean initialNotify)
      Description copied from class: PneumaticsBaseSim
      Register a callback to be run whenever the compressor current changes.
      Specified by:
      registerCompressorCurrentCallback in class PneumaticsBaseSim
      Parameters:
      callback - the callback
      initialNotify - whether to call the callback with the initial state
      Returns:
      the CallbackStore object associated with this callback.
    • resetData

      public void resetData()
      Description copied from class: PneumaticsBaseSim
      Reset all simulation data for this object.
      Specified by:
      resetData in class PneumaticsBaseSim