Class IngredientPipelineService
java.lang.Object
com.tccc.kos.commons.util.ready.ReadyBean
com.tccc.kos.commons.core.service.AbstractService
com.tccc.kos.ext.dispense.pipeline.ingredient.IngredientPipelineService
- All Implemented Interfaces:
com.tccc.kos.commons.core.context.CtxEventListener
,com.tccc.kos.commons.core.service.handle.ContextHandleAware
,com.tccc.kos.commons.core.service.handle.HandleAware
,com.tccc.kos.commons.util.ready.Ready
,com.tccc.kos.commons.util.ready.ReadyListener
public final class IngredientPipelineService
extends com.tccc.kos.commons.core.service.AbstractService
Service performing ingredient pours based on pump operations and named
intents. This service handles high level functions such as pump locking,
making sure pumps don't run dry if not supported. This service leverages
user supplied implementations for some functions such as converting a
named intent to an actual sequence of pump operations.
- Since:
- 1.0
- Version:
- 2023-03-06
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDilution
(PumpOp op) Adds an op that requires dilution to be running.Pump<?>
Returns the pump used for dilution.Returns thePumpIntent
definition for the specified pump and intent type.void
com.tccc.kos.commons.util.concurrent.future.FutureWork
Returns a future that will pour the specified intent on the specified pump when run.void
removeDilution
(PumpOp op) Removes an op that requires dilution.void
setDilutionPump
(Pump<?> pump) Sets the pump to be used for dilution.com.tccc.kos.commons.util.concurrent.future.FutureWork
Returns a future that will perform the specified timed pour on the specified pump.com.tccc.kos.commons.util.concurrent.future.FutureWork
Returns a future that will perform the specified volume pour on the specified pump.Methods inherited from class com.tccc.kos.commons.core.service.AbstractService
getHandle, getHandlePrefix
Methods inherited from class com.tccc.kos.commons.util.ready.ReadyBean
getReady, onBeanReady
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.context.CtxEventListener
onCtxAutowiringCompleted, onCtxDestroyed, onCtxPhaseCompleted
Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
Methods inherited from interface com.tccc.kos.commons.util.ready.Ready
isReady, setReady
Methods inherited from interface com.tccc.kos.commons.util.ready.ReadyListener
onDependenciesGroupReady
-
Field Details
-
DILUTION_INTENT
- See Also:
-
-
Method Details
-
onDependenciesReady
public void onDependenciesReady()- Specified by:
onDependenciesReady
in interfacecom.tccc.kos.commons.util.ready.ReadyListener
- Overrides:
onDependenciesReady
in classcom.tccc.kos.commons.util.ready.ReadyBean
-
getDilutionPump
Returns the pump used for dilution. -
setDilutionPump
Sets the pump to be used for dilution. Only required if dilution will be used in pump operations. This requires that the pump have a dilution intent defined. -
getIntent
Returns thePumpIntent
definition for the specified pump and intent type.- Parameters:
pump
- the pump the intent is forintentType
- the type of intent to return
-
pour
Returns a future that will pour the specified intent on the specified pump when run.- Parameters:
pump
- the pump the intent is forintentType
- the type of intent to return
-
vpour
public com.tccc.kos.commons.util.concurrent.future.FutureWork vpour(Pump<?> pump, double volume, double rate, boolean diluted) Returns a future that will perform the specified volume pour on the specified pump. This allows a custom vpour operation to be performed without the need to define an intent. This will construct an internal intent on the fly and pour as any other intent.- Parameters:
pump
- the pump to pourvolume
- the volume to pour in mlrate
- the rate to pour in ml/secdiluted
- if true, pour with dilution
-
tpour
public com.tccc.kos.commons.util.concurrent.future.FutureWork tpour(Pump<?> pump, int duration, double rate, boolean diluted) Returns a future that will perform the specified timed pour on the specified pump. This allows a custom tpour operation to be performed without the need to define an intent. This will construct an internal intent on the fly and pour as any other intent.- Parameters:
pump
- the pump to pourduration
- duration of the pour in msrate
- the rate to pour in ml/secdiluted
- if true, pour with dilution
-
addDilution
Adds an op that requires dilution to be running. Starts dilution when the first op is added. When starting dilution this will block shortly (config value:preDilutionDelayMs
) to allow the dilution flow to start. -
removeDilution
Removes an op that requires dilution. Once the last resource is removed, dilution will stop. When stopping dilution there will be short delay before the flow actually stops in an attempt to keep dilution running across operations that require it (config value:postDilutionDelayMs
).
-