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
    Modifier and Type
    Field
    Description
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Adds an op that requires dilution to be running.
    Pump<?>
    Returns the pump used for dilution.
    getIntent(Pump<?> pump, String intentType)
    Returns the PumpIntent definition for the specified pump and intent type.
    void
     
    com.tccc.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.
    void
    Removes an op that requires dilution.
    void
    Sets the pump to be used for dilution.
    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.
    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.

    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

  • Method Details

    • onDependenciesReady

      public void onDependenciesReady()
      Specified by:
      onDependenciesReady in interface com.tccc.kos.commons.util.ready.ReadyListener
      Overrides:
      onDependenciesReady in class com.tccc.kos.commons.util.ready.ReadyBean
    • getDilutionPump

      public Pump<?> getDilutionPump()
      Returns the pump used for dilution.
    • setDilutionPump

      public void setDilutionPump(Pump<?> pump)
      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

      public PumpIntent getIntent(Pump<?> pump, String intentType)
      Returns the PumpIntent definition for the specified pump and intent type.
      Parameters:
      pump - the pump the intent is for
      intentType - the type of intent to return
    • pour

      public com.tccc.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 for
      intentType - 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 pour
      volume - the volume to pour in ml
      rate - the rate to pour in ml/sec
      diluted - 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 pour
      duration - duration of the pour in ms
      rate - the rate to pour in ml/sec
      diluted - if true, pour with dilution
    • addDilution

      public void addDilution(PumpOp op)
      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

      public void removeDilution(PumpOp op)
      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 ).