Class IceAgitator
java.lang.Object
com.tccc.kos.ext.freestyle.hardware.can.subnode.ice.IceAgitator
- All Implemented Interfaces:
com.tccc.kos.commons.core.service.config.ConfigAware<IceAgitatorConfig>
,com.tccc.kos.commons.core.service.handle.HandleAware
,com.tccc.kos.commons.core.service.state.StateAware<IceAgitatorState>
@ApiController(base="@path",
title="Ice agitator",
desc="Services for a particular ice agitator.")
public class IceAgitator
extends Object
implements com.tccc.kos.commons.core.service.config.ConfigAware<IceAgitatorConfig>, com.tccc.kos.commons.core.service.state.StateAware<IceAgitatorState>
Agitator for ice.
- Version:
- Aug-5-17
-
Constructor Summary
ConstructorsConstructorDescriptionIceAgitator
(String name, IceAgitatorAware board) Create a new agitator for the specified board. -
Method Summary
Modifier and TypeMethodDescriptionvoid
agitate
(int duration, boolean iceGate) Perform a custom agitation cycle.com.tccc.kos.commons.core.service.handle.Handle
Return the list of configured ice types and associated settings.getState()
void
onConfigChanged
(com.tccc.kos.commons.core.service.config.BeanChanges changes) void
pauseDispense
(Object reason) Pause ice dispense with the specified reason.com.tccc.kos.commons.util.concurrent.future.FutureWork
pourIce()
Dispense ice for the max allowable amount of time.com.tccc.kos.commons.util.concurrent.future.FutureWork
pourIce
(boolean force) Dispense ice for the max allowable amount of time.com.tccc.kos.commons.util.concurrent.future.FutureWork
pourIce
(int duration, boolean force) Dispense ice for the specified amount of time in seconds.void
resumeDispense
(Object reason) Remove the dispense pause for the specified reason.void
setConfig
(IceAgitatorConfig config) void
setIceType
(String type) Set the ice type for the specified agitator.void
stopIce()
Stop any ice dispense that is in progress.boolean
switchType
(String name) Switch settings to the named type.com.tccc.kos.commons.util.concurrent.future.FutureWork
Perform an ice agitator test.com.tccc.kos.commons.util.concurrent.future.FutureWork
Perform an ice gate test.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
-
IceAgitator
Create a new agitator for the specified board.- Parameters:
name
- name of the ice agitatorboard
- the board with ice sub nodes
-
-
Method Details
-
switchType
Switch settings to the named type. This will copy the named settings on top of the active settings.- Parameters:
name
- the name of the settings to switch to- Returns:
- true if the switch was successful
-
pauseDispense
Pause ice dispense with the specified reason.- Parameters:
reason
- the reason for the pause
-
resumeDispense
Remove the dispense pause for the specified reason.- Parameters:
reason
- the reason to remove
-
pourIce
@ApiEndpoint(POST="/pour", desc="Dispense ice from the ice chute for the configured max duration.") public com.tccc.kos.commons.util.concurrent.future.FutureWork pourIce()Dispense ice for the max allowable amount of time. -
pourIce
public com.tccc.kos.commons.util.concurrent.future.FutureWork pourIce(boolean force) Dispense ice for the max allowable amount of time.- Parameters:
force
- if true, dispense even if paused
-
pourIce
public com.tccc.kos.commons.util.concurrent.future.FutureWork pourIce(int duration, boolean force) Dispense ice for the specified amount of time in seconds.- Parameters:
duration
- the time in msforce
- if true, start ice even if paused
-
stopIce
public void stopIce()Stop any ice dispense that is in progress. -
agitate
public void agitate(int duration, boolean iceGate) Perform a custom agitation cycle.- Parameters:
duration
- duration in secondsiceGate
- true if the ice gate should be open
-
testIceGate
@ApiEndpoint(POST="/test/gate", desc="Test the ice gate by opening it for a short duration.") public com.tccc.kos.commons.util.concurrent.future.FutureWork testIceGate()Perform an ice gate test. -
testAgitation
@ApiEndpoint(POST="/test/agitation", desc="Test the ice agitator by running it for a short duration.") public com.tccc.kos.commons.util.concurrent.future.FutureWork testAgitation()Perform an ice agitator test. -
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<IceAgitatorConfig>
-
getIceTypes
@ApiEndpoint(GET="/types", desc="Returns a list of availble ice types") public Collection<String> getIceTypes()Return the list of configured ice types and associated settings. This can be used by ui code to facilitate switching between known ice settings. -
setIceType
@ApiEndpoint(POST="/type/{type}", desc="Set the ice type for this agitator. This will set the type as well as apply\nall the default settings for that type to the agitator configuration.", params=@Param(name="type",desc="Ice type for the agitator.")) public void setIceType(@PathVariable("type") String type) Set the ice type for the specified agitator. Even if the type doesn't change, the associated settings will be reset to the standard settings for the type.- Parameters:
type
- the ice type
-
getConfig
- Specified by:
getConfig
in interfacecom.tccc.kos.commons.core.service.config.ConfigAware<IceAgitatorConfig>
-
setConfig
- Specified by:
setConfig
in interfacecom.tccc.kos.commons.core.service.config.ConfigAware<IceAgitatorConfig>
-
getState
- Specified by:
getState
in interfacecom.tccc.kos.commons.core.service.state.StateAware<IceAgitatorState>
-
getHandle
public com.tccc.kos.commons.core.service.handle.Handle getHandle()- Specified by:
getHandle
in interfacecom.tccc.kos.commons.core.service.handle.HandleAware
-