Class DefaultPumpInfoResolver

java.lang.Object
com.tccc.kos.ext.freestyle.pumpinfo.DefaultPumpInfoResolver
All Implemented Interfaces:
PumpInfoResolver

public class DefaultPumpInfoResolver extends Object implements PumpInfoResolver
Implementation of PumpInfoResolver which allows micros to be assigned with <prefix><pos> names, including the ability to name child pumps of a super pump automatically. This will not rename standard pumps such as water, carb, and ns. This logic of this class is pretty simple and various configuration options exist for controlling ordering and so on. Behavior of this class can be easily customized by extending it.

This implements the following conventions:

  • While positions are zero-based but will display as one-based in the name.
  • Child pumps will have a letter suffix starting with a.
Version:
2024-07-28
  • Constructor Details

    • DefaultPumpInfoResolver

      public DefaultPumpInfoResolver()
      Default constructor
    • DefaultPumpInfoResolver

      public DefaultPumpInfoResolver(String namePrefix)
      Use the specified name prefix for positional pumps.
      Parameters:
      namePrefix - the prefix to use
    • DefaultPumpInfoResolver

      public DefaultPumpInfoResolver(String namePrefix, boolean reverse)
      Use the specified name prefix for positional pumps and reverse the order of the pumps.
      Parameters:
      namePrefix - the prefix to use
      reverse - true to reverse the pumps
  • Method Details

    • resolve

      public void resolve(PumpInfo info)
      Description copied from interface: PumpInfoResolver
      Called when a pump is about to be created. The PumpInfo contains information about the pump about to be created. Any data changed by this callback will be used to create the pump.
      Specified by:
      resolve in interface PumpInfoResolver
      Parameters:
      info - information about the pump to be created
    • setNamePrefix

      public DefaultPumpInfoResolver setNamePrefix(String namePrefix)
      Set the name prefix to use for non-child pumps. This will only be applied to positional pumps. The position number will be appended to the name to generate the final pump name.
      Parameters:
      namePrefix - the name prefix to use
    • setCategory

      public DefaultPumpInfoResolver setCategory(String category)
      Set the category to apply to positional pumps, including any child pumps.
      Parameters:
      category - the category to apply
    • setReverse

      public DefaultPumpInfoResolver setReverse(boolean reverse)
      Set to true if the positional pumps are labeled in the reverse order of the natural position.
    • setReverseChild

      public DefaultPumpInfoResolver setReverseChild(boolean reverse)
      Set to true if the child pumps are labled in the reverse order of the natural position.
    • getNamePrefix

      public String getNamePrefix()
    • getCategory

      public String getCategory()
    • isReverse

      public boolean isReverse()
    • isReverseChild

      public boolean isReverseChild()