public abstract class AbstractSunSpecMeter extends AbstractOpenemsSunSpecComponent implements AsymmetricMeter, SymmetricMeter, OpenemsComponent
AbstractOpenemsModbusComponent.BitConverter, AbstractOpenemsModbusComponent.ChannelMapper<T extends AbstractModbusElement<?>>
AsymmetricMeter.ChannelId
POWER_DOC_TEXT
Constructor and Description |
---|
AbstractSunSpecMeter(java.util.Map<SunSpecModel,Priority> activeModels,
ChannelId[] firstInitialChannelIds,
ChannelId[]... furtherInitialChannelIds) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
activate(org.osgi.service.component.ComponentContext context,
java.lang.String id,
java.lang.String alias,
boolean enabled,
int unitId,
org.osgi.service.cm.ConfigurationAdmin cm,
java.lang.String modbusReference,
java.lang.String modbusId,
int readFromCommonBlockNo)
Make sure to call this method from the inheriting OSGi Component.
|
protected void |
deactivate()
Make sure to call this method from the inheriting OSGi Component.
|
java.lang.String |
debugLog()
Gets some output that is suitable for a continuous Debug log.
|
protected <T extends Channel<?>> |
getSunSpecChannel(SunSpecPoint point)
Get the Channel for the given Point.
|
protected <T extends Channel<?>> |
getSunSpecChannelOrError(SunSpecPoint point)
Get the Channel for the given Point or throw an error if it is not available.
|
protected void |
onSunSpecInitializationCompleted()
This method is called after the SunSpec initialization was completed.
|
activate, addBlock, defineModbusProtocol, getSunSpecModel, isSunSpecInitializationCompleted, mapFirstPointToChannel
activate, activate, getBridgeModbus, getModbusProtocol, getUnitId, m, m, m, m, setModbus, unsetModbus
_channel, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logDebug, logError, logInfo, logWarn, modified, removeChannel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
_setActivePowerL1, _setActivePowerL1, _setActivePowerL2, _setActivePowerL2, _setActivePowerL3, _setActivePowerL3, _setCurrentL1, _setCurrentL1, _setCurrentL2, _setCurrentL2, _setCurrentL3, _setCurrentL3, _setReactivePowerL1, _setReactivePowerL1, _setReactivePowerL2, _setReactivePowerL2, _setReactivePowerL3, _setReactivePowerL3, _setVoltageL1, _setVoltageL1, _setVoltageL2, _setVoltageL2, _setVoltageL3, _setVoltageL3, getActivePowerL1, getActivePowerL1Channel, getActivePowerL2, getActivePowerL2Channel, getActivePowerL3, getActivePowerL3Channel, getCurrentL1, getCurrentL1Channel, getCurrentL2, getCurrentL2Channel, getCurrentL3, getCurrentL3Channel, getModbusSlaveNatureTable, getReactivePowerL1, getReactivePowerL1Channel, getReactivePowerL2, getReactivePowerL2Channel, getReactivePowerL3, getReactivePowerL3Channel, getVoltageL1, getVoltageL1Channel, getVoltageL2, getVoltageL2Channel, getVoltageL3, getVoltageL3Channel, initializePowerSumChannels
_setActiveConsumptionEnergy, _setActiveConsumptionEnergy, _setActivePower, _setActivePower, _setActiveProductionEnergy, _setActiveProductionEnergy, _setCurrent, _setCurrent, _setFrequency, _setFrequency, _setMaxActivePower, _setMaxActivePower, _setMinActivePower, _setMinActivePower, _setReactivePower, _setReactivePower, _setVoltage, _setVoltage, getActiveConsumptionEnergy, getActiveConsumptionEnergyChannel, getActivePower, getActivePowerChannel, getActiveProductionEnergy, getActiveProductionEnergyChannel, getCurrent, getCurrentChannel, getFrequency, getFrequencyChannel, getMaxActivePower, getMaxActivePowerChannel, getMeterType, getMinActivePower, getMinActivePowerChannel, getReactivePower, getReactivePowerChannel, getVoltage, getVoltageChannel
_channel, _getChannelAs, alias, channel, channel, channels, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, logDebug, logError, logInfo, logWarn, serviceFactoryPid, servicePid, updateConfigurationProperty, updateReferenceFilter
public AbstractSunSpecMeter(java.util.Map<SunSpecModel,Priority> activeModels, ChannelId[] firstInitialChannelIds, ChannelId[]... furtherInitialChannelIds) throws OpenemsException
OpenemsException
protected boolean activate(org.osgi.service.component.ComponentContext context, java.lang.String id, java.lang.String alias, boolean enabled, int unitId, org.osgi.service.cm.ConfigurationAdmin cm, java.lang.String modbusReference, java.lang.String modbusId, int readFromCommonBlockNo) throws OpenemsException
activate
in class AbstractOpenemsSunSpecComponent
OpenemsException
- on errorprotected void deactivate()
deactivate
in class AbstractOpenemsModbusComponent
public java.lang.String debugLog()
OpenemsComponent
debugLog
in interface OpenemsComponent
protected void onSunSpecInitializationCompleted()
AbstractOpenemsSunSpecComponent
The purpose of this method is to add mappings between SunSpec Channel-Points to OpenEMS Nature Channels.
onSunSpecInitializationCompleted
in class AbstractOpenemsSunSpecComponent
protected <T extends Channel<?>> java.util.Optional<T> getSunSpecChannel(SunSpecPoint point)
AbstractOpenemsSunSpecComponent
getSunSpecChannel
in class AbstractOpenemsSunSpecComponent
T
- the Channel typepoint
- the SunSpec Pointprotected <T extends Channel<?>> T getSunSpecChannelOrError(SunSpecPoint point) throws OpenemsException
AbstractOpenemsSunSpecComponent
getSunSpecChannelOrError
in class AbstractOpenemsSunSpecComponent
T
- the Channel typepoint
- the SunSpec PointOpenemsException
- if Channel is not available