Class BeveragePourSequence

java.lang.Object
com.tccc.kos.ext.dispense.pipeline.beverage.BeveragePourSequence
All Implemented Interfaces:
com.tccc.kos.commons.util.UserDataAware

public class BeveragePourSequence extends Object implements com.tccc.kos.commons.util.UserDataAware
A list of Pourable objects that will be poured in order as an atomic operation. Each Pourable will be passed to the pour engine to convert the Pourable to a FutureWork that will execute the pourable. It is possible to define new Pourable classes that perform non-pouring processes that should be part of the overall pour process, such as pausing or dispensing ice.

A PourSequence also support pour limits. A limit will pour the expected volume for each pourable in the sequence until the volume limit is hit, effectively ending the pour early. This differs from changing the overall volume of the sequence where the volumes per pourable will be reduced to run the entire sequence. These options are particularly useful in controlled pour applications.

As a sequence spans multiple pourables, the sequence can represent the overall pour transaction. To facilitate the ability to store data across pours in a sequence, BeveragePourSequence supports user data. This is a map that allows users to attach additional data to the sequence using a string key.

Since:
1.0
Version:
2023-08-10
  • Constructor Details

    • BeveragePourSequence

      public BeveragePourSequence()
  • Method Details

    • getDuration

      public int getDuration()
      Return the duration of the sequence in milliseconds. If called before the sequence ends, this will return the duration so far.
    • getFuture

      public com.tccc.kos.commons.util.concurrent.future.FutureWork getFuture()
      Return the future for the overall sequence.
    • getTotalVolume

      public double getTotalVolume()
      Return the total volume of the pour. This may not be the amount poured if there is a limit volume.
    • getLimitVolume

      public double getLimitVolume()
      Return the volume limit of the pour. If >= zero, this is how much of the total volume will actually be poured. A negative value represents no limit applied.
    • setLimitVolume

      public void setLimitVolume(double limitVolume)
      Set the limit volume of the pour in milliliters. If this is greater than or equal to zero, only this portion of the pour will be poured (negative values will be clipped to zero). All pourables will still pour the expected volume based on the total volume, but total output will be limited to the limit volume. If limit volume is less than total volume, the pour will end early and some pourables may not be poured as a result.

      If the limit it set higher than the total volume, it will be adjusted to match the total volume.

      Use disableLimitVolume() to disable any previously applied limit.

      Parameters:
      limitVolume - pour limit, negative is zero volume
    • disableLimitVolume

      public void disableLimitVolume()
      Disable the volume limit if set.
    • getEffectiveVolume

      public double getEffectiveVolume()
      Return the total volume of the pour. This is the sum of all the pourable volumes constrained by any applied limit.
    • setUserData

      public void setUserData(String key, Object data)
      Specified by:
      setUserData in interface com.tccc.kos.commons.util.UserDataAware
    • getUserData

      public Object getUserData(String key)
      Specified by:
      getUserData in interface com.tccc.kos.commons.util.UserDataAware
    • removeUserData

      public Object removeUserData(String key)
      Specified by:
      removeUserData in interface com.tccc.kos.commons.util.UserDataAware
    • getId

      public String getId()
    • getStartTime

      public long getStartTime()
    • getEndTime

      public long getEndTime()