Class IngredientPipelineService
java.lang.Object
com.kosdev.kos.ext.dispense.pipeline.ingredient.IngredientPipelineService
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
- Version:
- 1
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDilution(PumpOp op) Adds an op that requires dilution to be running.getAvailablePumpsByIngredient(String ingredientId) Return the list of pumps able to pour the specified ingredient.Pump<?>Returns the pump used for dilution.Returns thePumpIntentdefinition for the specified pump and intent type.com.kosdev.kos.commons.util.concurrent.future.FutureWorkReturns a future that will pour the specified intent on the specified pump when run.voidremoveDilution(PumpOp op) Removes an op that requires dilution.voidsetDilutionPump(Pump<?> pump) Sets the pump to be used for dilution.com.kosdev.kos.commons.util.concurrent.future.FutureWorkReturns a future that will perform the specified timed pour on the specified pump.com.kosdev.kos.commons.util.concurrent.future.FutureWorkReturns a future that will perform the specified volume pour on the specified pump.
-
Field Details
-
DILUTION_INTENT
- See Also:
-
-
Method Details
-
getDilutionPump
Returns the pump used for dilution.- Since:
- 1
-
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.- Since:
- 1
-
getIntent
Returns thePumpIntentdefinition for the specified pump and intent type.- Parameters:
pump- the pump the intent is forintentType- the type of intent to return- Since:
- 1
-
pour
public com.kosdev.kos.commons.util.concurrent.future.FutureWork pour(Pump<?> pump, String intentType) 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- Since:
- 1
-
vpour
public com.kosdev.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- Since:
- 1
-
tpour
public com.kosdev.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- Since:
- 1
-
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.- Since:
- 1
-
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).- Since:
- 1
-
getAvailablePumpsByIngredient
Return the list of pumps able to pour the specified ingredient.- Parameters:
ingredientId- the ingredient to search for- Since:
- 1
-