Package com.tccc.kos.ext.dispense
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckPumpOpLimits(List<String> requests) 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.intvoidsetPumpOpGrantLimit(int pumpOpGrantLimit) Methods inherited from class com.tccc.kos.core.service.hardware.Board
addLinkListener, addReadyListener, boardReady, getAssembly, getHandle, getLink, getLinkCount, isLinked, isOptional, isReady, isSticky, onBoardReady, onLink, onUnlink, removeListener, setOptional, setSticky, verifyLinkedMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.tccc.kos.core.service.assembly.AssemblyAware
getAssemblyNameMethods inherited from interface com.tccc.kos.core.service.hardware.BoardIdentifier
getInstanceId, getTypeMethods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPathMethods inherited from interface com.tccc.kos.ext.dispense.PourAvailability
getAvailbilityLock
-
Constructor Details
-
PumpBoard
-
-
Method Details
-
checkPumpOpLimits
Description copied from interface:PumpOpLimitAwareCheck 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:
checkPumpOpLimitsin interfacePumpOpLimitAware- Parameters:
requests- the grant requests to check
-
getBeverageAvailabilityLock
Description copied from interface:PourAvailabilityReturn the object add to a trouble impact list to block beverage pouring.- Specified by:
getBeverageAvailabilityLockin interfacePourAvailability
-
getIngredientAvailabilityLock
Description copied from interface:PourAvailabilityReturn the object add to a trouble impact list to block all pouring.- Specified by:
getIngredientAvailabilityLockin interfacePourAvailability
-
getPumpOpGrantLimit
public int getPumpOpGrantLimit() -
setPumpOpGrantLimit
public void setPumpOpGrantLimit(int pumpOpGrantLimit)
-