Class PumpBoard

java.lang.Object
com.tccc.kos.core.service.hardware.Board
com.tccc.kos.ext.dispense.PumpBoard
All Implemented Interfaces:
com.tccc.kos.commons.core.service.handle.HandleAware, com.tccc.kos.core.service.assembly.AssemblyAware, com.tccc.kos.core.service.hardware.BoardIdentifier, PumpOpLimitAware, PourAvailability

public abstract class PumpBoard extends com.tccc.kos.core.service.hardware.Board implements PourAvailability, PumpOpLimitAware
Logical representation of a circuit board that manages pumps. This support PourAvailability which means that any pumps associated with this board can be blocked by simply linking the board in a PourAvailabilityTrouble.

This implements PumpOpLimitAware which enforces a simple limit grant count algorithm which can be enabled by setting pumpOpGrantLimit to the max number of concurrent pumps that can be used. If not set, no limit is enforced. Override checkPumpOpLimits() to implement a different algorithm if needed.

Since:
1.0
Version:
2022-12-01
  • Nested Class Summary

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

    PourAvailability.Type
  • Constructor Summary

    Constructors
    Constructor
    Description
    PumpBoard(com.tccc.kos.core.service.assembly.Assembly assembly, String name)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Check the list of requests and return true if they are all allowed to run concurrently.
    Return the object add to a trouble impact list to block beverage pouring.
    Return the object add to a trouble impact list to block all pouring.
    int
     
    void
    setPumpOpGrantLimit(int pumpOpGrantLimit)
     

    Methods inherited from class com.tccc.kos.core.service.hardware.Board

    addLinkListener, addReadyListener, boardReady, getAssembly, getHandle, getLink, getLinkCount, isLinked, isReady, onBoardReady, onLink, onUnlink, removeListener, verifyLinked

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface com.tccc.kos.core.service.assembly.AssemblyAware

    getAssemblyName

    Methods inherited from interface com.tccc.kos.core.service.hardware.BoardIdentifier

    getInstanceId, getType

    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
  • Constructor Details

    • PumpBoard

      public PumpBoard(com.tccc.kos.core.service.assembly.Assembly assembly, String name)
  • Method Details

    • checkPumpOpLimits

      public boolean checkPumpOpLimits(List<String> requests)
      Description copied from interface: PumpOpLimitAware
      Check the list of requests and return true if they are all allowed to run concurrently. A request is a string which may be null or a name. By default, tpour and vpour have limit grants with no request type so they will appear as null entries in the list. This can be used for simple count logic. If there is a need to limit based on other criteria such as power or pump types, the limit grant can include that information as the grant value and those values will be the strings in the request list. This allows developers to create very complex limit policies without needing to create a new type of grant.
      Specified by:
      checkPumpOpLimits in interface PumpOpLimitAware
      Parameters:
      requests - the grant requests to check
    • getBeverageAvailabilityLock

      public AvailabilityLock getBeverageAvailabilityLock()
      Description copied from interface: PourAvailability
      Return the object add to a trouble impact list to block beverage pouring.
      Specified by:
      getBeverageAvailabilityLock in interface PourAvailability
    • getIngredientAvailabilityLock

      public AvailabilityLock getIngredientAvailabilityLock()
      Description copied from interface: PourAvailability
      Return the object add to a trouble impact list to block all pouring.
      Specified by:
      getIngredientAvailabilityLock in interface PourAvailability
    • getPumpOpGrantLimit

      public int getPumpOpGrantLimit()
    • setPumpOpGrantLimit

      public void setPumpOpGrantLimit(int pumpOpGrantLimit)