public interface StartStoppable extends OpenemsComponent
A device or service inside OpenEMS that implements this OpenEMS Nature can be started or stopped.
Implementing this Nature also requires the Component to have a configuration
property "startStop" of type StartStopConfig
that overrides the logic
of the setStartStop(StartStop)
method:
@AttributeDefinition(name = "Start/stop behaviour?", description = "Should this Component be forced to start or stop?") StartStopConfig startStop() default StartStopConfig.AUTO;
StartStopConfig.START
-> always start
StartStopConfig.STOP
-> always stop
StartStopConfig.AUTO
-> start
StartStop.UNDEFINED
and wait for a call to
setStartStop(StartStop)
Modifier and Type | Interface and Description |
---|---|
static class |
StartStoppable.ChannelId |
Modifier and Type | Method and Description |
---|---|
default void |
_setStartStop(StartStop value)
Internal method to set the 'nextValue' on
StartStoppable.ChannelId.START_STOP
Channel. |
static ModbusSlaveNatureTable |
getModbusSlaveNatureTable(AccessMode accessMode)
Gets the
ModbusSlaveNatureTable for StartStoppable used by
the Modbus/TCP Slave API. |
default StartStop |
getStartStop()
Gets the current
StartStop state of the StartStoppable
Component. |
default Channel<StartStop> |
getStartStopChannel()
Gets the Channel for
StartStoppable.ChannelId.START_STOP . |
default boolean |
isStarted()
Is this device or service started?.
|
default boolean |
isStopped()
Is this device or service stopped?.
|
void |
setStartStop(StartStop value)
Starts or stops the device or service represented by this OpenEMS Component.
|
default void |
start()
Starts the device or service represented by this OpenEMS Component.
|
default void |
stop()
Stops the device or service represented by this OpenEMS Component.
|
_channel, _getChannelAs, alias, channel, channel, channels, debugLog, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid, updateConfigurationProperty, updateReferenceFilter
static ModbusSlaveNatureTable getModbusSlaveNatureTable(AccessMode accessMode)
ModbusSlaveNatureTable
for StartStoppable
used by
the Modbus/TCP Slave API.getModbusSlaveNatureTable
in interface OpenemsComponent
accessMode
- the AccessMode
ModbusSlaveNatureTable
default Channel<StartStop> getStartStopChannel()
StartStoppable.ChannelId.START_STOP
.default StartStop getStartStop()
StartStop
state of the StartStoppable
Component. See StartStoppable.ChannelId.START_STOP
.Value
default boolean isStarted()
StartStoppable.ChannelId.START_STOP
is
StartStop.START
StartStoppable.ChannelId.START_STOP
is StartStop.STOP
or
StartStop.UNDEFINED
default boolean isStopped()
StartStoppable.ChannelId.START_STOP
is
StartStop.STOP
StartStoppable.ChannelId.START_STOP
is StartStop.START
or
StartStop.UNDEFINED
default void _setStartStop(StartStop value)
StartStoppable.ChannelId.START_STOP
Channel.value
- the next valuevoid setStartStop(StartStop value) throws OpenemsError.OpenemsNamedException
value
- target StartStop
stateOpenemsError.OpenemsNamedException
- on errordefault void start() throws OpenemsError.OpenemsNamedException
This calls setStartStop(StartStop)
with StartStop.START
.
OpenemsError.OpenemsNamedException
- on errordefault void stop() throws OpenemsError.OpenemsNamedException
This calls setStartStop(StartStop)
with StartStop.STOP
.
OpenemsError.OpenemsNamedException
- on error