Package com.tccc.kos.ext.dispense
Class DispenseAssembly
java.lang.Object
com.tccc.kos.core.service.assembly.Assembly
com.tccc.kos.ext.dispense.DispenseAssembly
- All Implemented Interfaces:
com.tccc.kos.commons.core.service.handle.HandleAware
,com.tccc.kos.commons.util.json.JsonDescriptorAware
,com.tccc.kos.core.util.Loadable
,PumpOpLimitAware
public abstract class DispenseAssembly
extends com.tccc.kos.core.service.assembly.Assembly
implements PumpOpLimitAware
Assembly
that tracks dispense related objects. This is optional to use
but offers the convenience of tracking various dispense related objects automatically.
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:
- 2023-10-16
-
Constructor Summary
ConstructorsConstructorDescriptionDispenseAssembly
(String name, com.tccc.kos.commons.util.json.JsonDescriptor descriptor) Create a new assembly with the specified name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a holder to the assembly with the specified group name.void
Add a nozzle to the assembly.boolean
checkPumpOpLimits
(List<String> requests) Check the list of requests and return true if they are all allowed to run concurrently.Return all holders.Return holders from the default group.Return the holder with the specified name.getHoldersByGroup
(String group) Return holders in the specified group.Return a nozzle by nozzle name.int
void
setPumpOpGrantLimit
(int pumpOpGrantLimit) Methods inherited from class com.tccc.kos.core.service.assembly.Assembly
addBoard, addToCtx, connect, getBeans, getBoards, getCtx, getDescriptor, getHandle, isCore, isInstalling, load, start, started, stop, unload
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
-
Constructor Details
-
DispenseAssembly
Create a new assembly with the specified name.- Parameters:
name
- name of the assembly
-
-
Method Details
-
addNozzle
Add a nozzle to the assembly. -
getNozzle
Return a nozzle by nozzle name.- Parameters:
name
- the name of the nozzle to return
-
addHolder
Add a holder to the assembly with the specified group name.- Parameters:
holder
- the holder to addgroup
- the group the holder is part of
-
getDefaultHolders
Return holders from the default group. This will include holders that were added without a group. -
getHoldersByGroup
Return holders in the specified group.- Parameters:
group
- the group to return
-
getHolder
Return the holder with the specified name.- Parameters:
name
- the name of the holder to return
-
getAllHolders
Return all holders. -
checkPumpOpLimits
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 interfacePumpOpLimitAware
- Parameters:
requests
- the grant requests to check
-
getPumpOpGrantLimit
public int getPumpOpGrantLimit() -
setPumpOpGrantLimit
public void setPumpOpGrantLimit(int pumpOpGrantLimit)
-