java.lang.Object
com.tccc.kos.ext.dispense.Pump<T>
All Implemented Interfaces:
com.tccc.kos.commons.core.service.config.ConfigAware<CANPumpConfig>, com.tccc.kos.commons.core.service.handle.HandleAware, com.tccc.kos.commons.util.Abortable, com.tccc.kos.commons.util.Cancelable, com.tccc.kos.commons.util.Terminable, com.tccc.kos.ext.dispense.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
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.tccc.kos.ext.dispense.PourAvailability

    com.tccc.kos.ext.dispense.PourAvailability.Type
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    VPump(CANBoard<?> board, PumpInfo info, int subNodeId)
    Create a pump with the specified CANOpen subNodeId.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    bind(VPumpBinding binding)
    Bind a physical device to this virtual pump.
    double
    Return the ratio of the overall pour assigned to this pump.
    double
    Return the captured requested rate.
     
    boolean
     
    void
    setCurrentRate(double rate)
    Tell the vpump the current rate of pour.
    void
    setFixedRate(boolean fixedRate)
    Set whether this vpump reports itself as a fixed rate or variable rate pump.

    Methods inherited from class com.tccc.kos.ext.freestyle.hardware.can.subnode.pump.AbstractCANPump

    isAborted, toString, tpour, vpour

    Methods inherited from class com.tccc.kos.ext.freestyle.FreestylePump

    setFixedRatePump

    Methods inherited from class com.tccc.kos.ext.dispense.Pump

    abort, cancel, getBeverageAvailabilityLock, getBeverageLocks, getBoard, getCategory, getConfig, getEffectiveIngredientId, getHandle, getHolder, getIngredientAvailabilityLock, getIngredientId, getIngredientLocks, getIntent, getLastChangedTime, getLastStartTime, getNominalRate, getNozzle, getPour, getPrevIngredientId, getUnavailableReasons, isBeveragePour, isIngredientPour, isInserted, postStop, pour, preStart, record, recordRate, setConfig, setLastStartTime, setPour, setPrevIngredientId, setUnavailableReasons, sinceLastStarted

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.tccc.kos.commons.core.service.config.ConfigAware

    onConfigChanged, onConfigSet

    Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware

    addHandleChild, getName, getPath

    Methods inherited from interface com.tccc.kos.ext.dispense.PourAvailability

    getAvailbilityLock
  • 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

    • getType

      public String getType()
      Specified by:
      getType in class com.tccc.kos.ext.dispense.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.