Class DefaultPumpInfoResolver
java.lang.Object
com.tccc.kos.ext.freestyle.pumpinfo.DefaultPumpInfoResolver
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionDefault constructorDefaultPumpInfoResolver
(String namePrefix) Use the specified name prefix for positional pumps.DefaultPumpInfoResolver
(String namePrefix, boolean reverse) Use the specified name prefix for positional pumps and reverse the order of the pumps. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
void
Called when a pump is about to be created.setCategory
(String category) Set the category to apply to positional pumps, including any child pumps.setNamePrefix
(String namePrefix) Set the name prefix to use for non-child pumps.setReverse
(boolean reverse) Set to true if the positional pumps are labeled in the reverse order of the natural position.setReverseChild
(boolean reverse) Set to true if the child pumps are labled in the reverse order of the natural position.
-
Constructor Details
-
DefaultPumpInfoResolver
public DefaultPumpInfoResolver()Default constructor -
DefaultPumpInfoResolver
Use the specified name prefix for positional pumps.- Parameters:
namePrefix
- the prefix to use
-
DefaultPumpInfoResolver
Use the specified name prefix for positional pumps and reverse the order of the pumps.- Parameters:
namePrefix
- the prefix to usereverse
- true to reverse the pumps
-
-
Method Details
-
resolve
Description copied from interface:PumpInfoResolver
Called when a pump is about to be created. ThePumpInfo
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 interfacePumpInfoResolver
- Parameters:
info
- information about the pump to be created
-
setNamePrefix
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
Set the category to apply to positional pumps, including any child pumps.- Parameters:
category
- the category to apply
-
setReverse
Set to true if the positional pumps are labeled in the reverse order of the natural position. -
setReverseChild
Set to true if the child pumps are labled in the reverse order of the natural position. -
getNamePrefix
-
getCategory
-
isReverse
public boolean isReverse() -
isReverseChild
public boolean isReverseChild()
-