All Implemented Interfaces:
ConfigAware<CANPumpConfig>, HandleAware, Abortable, Cancelable, Terminable, PourAvailability

public class VPump extends AbstractCANPump<CANPumpConfig>
Represents a virtual DEKA pump node. This is used as a bridge between the DEKA control algorithm and a real pump or valve.
Version:
Mar-12-18
  • Field Details

  • Constructor Details

    • VPump

      public VPump(CANBoard<?> board, PumpInfo info, int subNodeId)
      Create a pump with the specified CANOpen subNodeId.
      Parameters:
      board - the board the sub-node is associated with
      info - info about the pump
      subNodeId - the CAN bus sub-node for this pump
  • Method Details

    • pumpInfo

      public static PumpInfo pumpInfo(int pos, int maxPos)
      Return default pump info for this pump.
    • getType

      public String getType()
      Specified by:
      getType in class Pump<CANPumpConfig>
    • bind

      public void bind(VPumpBinding binding)
      Bind a physical device to this virtual pump.
      Parameters:
      binding - the binding to the physical device
    • setCurrentRate

      public void setCurrentRate(double rate) throws IOException
      Tell the vpump the current rate of pour.
      Parameters:
      rate - the rate in ml/sec
      Throws:
      IOException
    • setFixedRate

      public void setFixedRate(boolean fixedRate)
      Set whether this vpump reports itself as a fixed rate or variable rate pump. If this is a valve, this should report as fixed rate for example.
      Parameters:
      fixedRate - true if fixed rate, false if variable
    • getPourRatio

      public double getPourRatio() throws IOException
      Return the ratio of the overall pour assigned to this pump. This is returned as a value in the range of 0 to 1.0. For a recipe pour this will be the ratio defined in the recipe. For a non-recipe pour, this will always return 1.0.
      Returns:
      assigned ratio of the pour
      Throws:
      IOException
    • isFixedRatePump

      public boolean isFixedRatePump()
      Overrides:
      isFixedRatePump in class FreestylePump<CANPumpConfig>
    • getRequestedRate

      public double getRequestedRate()
      Return the captured requested rate.