Package io.openems.edge.simulator.modbus
Class ModbusSimulator
- java.lang.Object
-
- io.openems.edge.common.component.AbstractOpenemsComponent
-
- io.openems.edge.simulator.modbus.ModbusSimulator
-
- All Implemented Interfaces:
BridgeModbus
,BridgeModbusTcp
,OpenemsComponent
public class ModbusSimulator extends AbstractOpenemsComponent implements BridgeModbus, BridgeModbusTcp, OpenemsComponent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ModbusSimulator.ChannelId
-
Constructor Summary
Constructors Constructor Description ModbusSimulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProtocol(java.lang.String sourceId, ModbusProtocol protocol)
Adds a Protocol with a source identifier to this Modbus Bridge.protected void
deactivate()
Handles @Deactivate of implementations.java.net.InetAddress
getIpAddress()
Gets the IP address.void
removeProtocol(java.lang.String sourceId)
Removes a Protocol from this Modbus Bridge.-
Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, activate, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logDebug, logError, logInfo, logWarn, modified, removeChannel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.openems.edge.bridge.modbus.api.BridgeModbus
_setCycleTimeIsTooShort, _setExecutionDuration, getCycleTimeIsTooShort, getCycleTimeIsTooShortChannel, getExecutionDuration, getExecutionDurationChannel
-
Methods inherited from interface io.openems.edge.common.component.OpenemsComponent
_channel, _getChannelAs, alias, channel, channel, channels, debugLog, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid
-
-
-
-
Method Detail
-
deactivate
protected void deactivate()
Description copied from class:AbstractOpenemsComponent
Handles @Deactivate of implementations. Prints log output.- Overrides:
deactivate
in classAbstractOpenemsComponent
-
getIpAddress
public java.net.InetAddress getIpAddress()
Description copied from interface:BridgeModbusTcp
Gets the IP address.- Specified by:
getIpAddress
in interfaceBridgeModbusTcp
- Returns:
- the IP address
-
addProtocol
public void addProtocol(java.lang.String sourceId, ModbusProtocol protocol)
Description copied from interface:BridgeModbus
Adds a Protocol with a source identifier to this Modbus Bridge.- Specified by:
addProtocol
in interfaceBridgeModbus
- Parameters:
sourceId
- the unique source identifierprotocol
- the Modbus Protocol
-
removeProtocol
public void removeProtocol(java.lang.String sourceId)
Description copied from interface:BridgeModbus
Removes a Protocol from this Modbus Bridge.- Specified by:
removeProtocol
in interfaceBridgeModbus
- Parameters:
sourceId
- the unique source identifier
-
-