Class CartridgeAgitator
java.lang.Object
com.tccc.kos.ext.freestyle.service.cartridgeagitation.CartridgeAgitator
- All Implemented Interfaces:
com.tccc.kos.commons.core.service.config.ConfigAware<CartridgeAgitatorConfig>
,com.tccc.kos.commons.core.service.handle.HandleAware
,com.tccc.kos.commons.core.service.state.StateAware<CartridgeAgitatorSubNode.CartridgeAgitatorState>
,com.tccc.kos.ext.dispense.service.insertion.InsertionHolderListener
,com.tccc.kos.ext.dispense.service.insertion.InsertionListener
,com.tccc.kos.ext.dispense.service.pumpevent.PumpListener
,com.tccc.kos.ext.dispense.service.pumpevent.PumpLockListener
@ApiController(base="@path",
title="Cartridge agitator",
desc="Services for a particular cartridge agitator.")
public class CartridgeAgitator
extends Object
implements com.tccc.kos.commons.core.service.config.ConfigAware<CartridgeAgitatorConfig>, com.tccc.kos.commons.core.service.state.StateAware<CartridgeAgitatorSubNode.CartridgeAgitatorState>, com.tccc.kos.ext.dispense.service.pumpevent.PumpLockListener, com.tccc.kos.ext.dispense.service.insertion.InsertionHolderListener
Agitator for a cartridge shelf or tower.
- Version:
- 2024-09-30
-
Constructor Summary
ConstructorsConstructorDescriptionCartridgeAgitator
(String name, CartridgeAgitatorSubNode subNode, boolean homeSensor) -
Method Summary
Modifier and TypeMethodDescriptioncom.tccc.kos.commons.core.service.handle.Handle
com.tccc.kos.commons.util.ListenerList<CartridgeAgitatorListener>
getState()
boolean
isHomed()
Return true if the agitator is properly homed.boolean
com.tccc.kos.commons.util.concurrent.future.FutureWork
Perform any pending agitation immediately, ignoring door state or block state.void
onConfigChanged
(com.tccc.kos.commons.core.service.config.BeanChanges changes) void
onContainerInsertStart
(com.tccc.kos.ext.dispense.Container container, com.tccc.kos.ext.dispense.Holder[] holders) void
onContainerRemove
(com.tccc.kos.ext.dispense.Container container, com.tccc.kos.ext.dispense.Holder[] holders) void
onPumpLock
(com.tccc.kos.ext.dispense.service.nozzle.NozzlePipeline pipeline, com.tccc.kos.ext.dispense.Pump<?> pump) void
onPumpUnlock
(com.tccc.kos.ext.dispense.service.nozzle.NozzlePipeline pipeline, com.tccc.kos.ext.dispense.Pump<?> pump) void
Pause the agitator for the specified reason.void
Resume the agitator by removing the pause reason.void
setConfig
(CartridgeAgitatorConfig config) com.tccc.kos.commons.util.concurrent.future.FutureWork
startAgitation
(int rpm, int duration) Run agitation for the specified for the specified duration.void
stopAgitation
(boolean home) Stop any running agitation without waiting for it to stop.void
stopAgitation
(boolean home, boolean wait) Stop any running agitation.com.tccc.kos.commons.util.concurrent.future.FutureWork
Perform a test agitation.void
Wait until the agitator is stopped using internal timeout to make sure this doesn't block indefinitely.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.service.config.ConfigAware
onConfigSet
Methods inherited from interface com.tccc.kos.commons.core.service.handle.HandleAware
addHandleChild, getName, getPath
-
Constructor Details
-
CartridgeAgitator
-
-
Method Details
-
pause
Pause the agitator for the specified reason.- Parameters:
reason
- the pause reasonhome
- if true, home when pausing
-
resume
Resume the agitator by removing the pause reason. The callback will be used to actually trigger the start. -
manualStartPendingAgitation
public com.tccc.kos.commons.util.concurrent.future.FutureWork manualStartPendingAgitation()Perform any pending agitation immediately, ignoring door state or block state. -
startAgitation
public com.tccc.kos.commons.util.concurrent.future.FutureWork startAgitation(int rpm, int duration) Run agitation for the specified for the specified duration.- Parameters:
rpm
- the rpm settingduration
- the duration in seconds
-
stopAgitation
public void stopAgitation(boolean home) Stop any running agitation without waiting for it to stop.- Parameters:
home
- if true, home the agitator
-
stopAgitation
public void stopAgitation(boolean home, boolean wait) Stop any running agitation.- Parameters:
home
- if true, home the agitatorwait
- if true, wait for agitation to actually stop
-
isHomed
public boolean isHomed()Return true if the agitator is properly homed.- Returns:
- true if properly homed
-
waitForStop
public void waitForStop()Wait until the agitator is stopped using internal timeout to make sure this doesn't block indefinitely. -
testAgitation
@ApiEndpoint(POST="/test", desc="Run an agitation test.") public com.tccc.kos.commons.util.concurrent.future.FutureWork testAgitation()Perform a test agitation. -
onConfigChanged
public void onConfigChanged(com.tccc.kos.commons.core.service.config.BeanChanges changes) - Specified by:
onConfigChanged
in interfacecom.tccc.kos.commons.core.service.config.ConfigAware<CartridgeAgitatorConfig>
-
getState
- Specified by:
getState
in interfacecom.tccc.kos.commons.core.service.state.StateAware<CartridgeAgitatorSubNode.CartridgeAgitatorState>
-
onPumpLock
public void onPumpLock(com.tccc.kos.ext.dispense.service.nozzle.NozzlePipeline pipeline, com.tccc.kos.ext.dispense.Pump<?> pump) - Specified by:
onPumpLock
in interfacecom.tccc.kos.ext.dispense.service.pumpevent.PumpLockListener
-
onPumpUnlock
public void onPumpUnlock(com.tccc.kos.ext.dispense.service.nozzle.NozzlePipeline pipeline, com.tccc.kos.ext.dispense.Pump<?> pump) - Specified by:
onPumpUnlock
in interfacecom.tccc.kos.ext.dispense.service.pumpevent.PumpLockListener
-
onContainerInsertStart
public void onContainerInsertStart(com.tccc.kos.ext.dispense.Container container, com.tccc.kos.ext.dispense.Holder[] holders) - Specified by:
onContainerInsertStart
in interfacecom.tccc.kos.ext.dispense.service.insertion.InsertionHolderListener
-
onContainerRemove
public void onContainerRemove(com.tccc.kos.ext.dispense.Container container, com.tccc.kos.ext.dispense.Holder[] holders) - Specified by:
onContainerRemove
in interfacecom.tccc.kos.ext.dispense.service.insertion.InsertionHolderListener
-
getConfig
- Specified by:
getConfig
in interfacecom.tccc.kos.commons.core.service.config.ConfigAware<CartridgeAgitatorConfig>
-
setConfig
- Specified by:
setConfig
in interfacecom.tccc.kos.commons.core.service.config.ConfigAware<CartridgeAgitatorConfig>
-
getHandle
public com.tccc.kos.commons.core.service.handle.Handle getHandle()- Specified by:
getHandle
in interfacecom.tccc.kos.commons.core.service.handle.HandleAware
-
getListeners
-
isHomeSensor
public boolean isHomeSensor()
-