Documentation
¶
Index ¶
- Constants
- type LPC
- func (e *LPC) AddFeatures()
- func (e *LPC) ApproveOrDenyConsumptionLimit(msgCounter model.MsgCounterType, approve bool, reason string)
- func (e *LPC) ConsumptionLimit() (limit ucapi.LoadLimit, resultErr error)
- func (e *LPC) ConsumptionNominalMax() (value float64, resultErr error)
- func (e *LPC) FailsafeConsumptionActivePowerLimit() (limit float64, isChangeable bool, resultErr error)
- func (e *LPC) FailsafeDurationMinimum() (duration time.Duration, isChangeable bool, resultErr error)
- func (e *LPC) HandleEvent(payload spineapi.EventPayload)
- func (e *LPC) IsHeartbeatWithinDuration() bool
- func (e *LPC) PendingConsumptionLimits() map[model.MsgCounterType]ucapi.LoadLimit
- func (e *LPC) SetConsumptionLimit(limit ucapi.LoadLimit) (resultErr error)
- func (e *LPC) SetConsumptionNominalMax(value float64) error
- func (e *LPC) SetFailsafeConsumptionActivePowerLimit(value float64, changeable bool) error
- func (e *LPC) SetFailsafeDurationMinimum(duration time.Duration, changeable bool) error
Constants ¶
const ( // Update of the list of remote entities supporting the Use Case // // Use `RemoteEntities` to get the current data UseCaseSupportUpdate api.EventType = "cs-lpc-UseCaseSupportUpdate" // Load control obligation limit data update received // // Use `ConsumptionLimit` to get the current data // // Use Case LPC, Scenario 1 DataUpdateLimit api.EventType = "cs-lpc-DataUpdateLimit" // An incoming load control obligation limit needs to be approved or denied // // Use `PendingConsumptionLimits` to get the currently pending write approval requests // and invoke `ApproveOrDenyConsumptionLimit` for each // // Use Case LPC, Scenario 1 WriteApprovalRequired api.EventType = "cs-lpc-WriteApprovalRequired" // Failsafe limit for the consumed active (real) power of the // Controllable System data update received // // Use `FailsafeConsumptionActivePowerLimit` to get the current data // // Use Case LPC, Scenario 2 DataUpdateFailsafeConsumptionActivePowerLimit api.EventType = "cs-lpc-DataUpdateFailsafeConsumptionActivePowerLimit" // Minimum time the Controllable System remains in "failsafe state" unless conditions // specified in this Use Case permit leaving the "failsafe state" data update received // // Use `FailsafeDurationMinimum` to get the current data // // Use Case LPC, Scenario 2 DataUpdateFailsafeDurationMinimum api.EventType = "cs-lpc-DataUpdateFailsafeDurationMinimum" // Indicates a notify heartbeat event the application should care of. // E.g. going into or out of the Failsafe state // // Use Case LPC, Scenario 3 DataUpdateHeartbeat api.EventType = "cs-lpc-DataUpdateHeartbeat" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LPC ¶
type LPC struct { *usecase.UseCaseBase // contains filtered or unexported fields }
func NewLPC ¶
func NewLPC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *LPC
func (*LPC) AddFeatures ¶
func (e *LPC) AddFeatures()
func (*LPC) ApproveOrDenyConsumptionLimit ¶
func (e *LPC) ApproveOrDenyConsumptionLimit(msgCounter model.MsgCounterType, approve bool, reason string)
accept or deny an incoming consumption write limit
use PendingConsumptionLimits to get the list of currently pending requests
func (*LPC) ConsumptionLimit ¶
return the current loadcontrol limit data
return values:
- limit: load limit data
possible errors:
- ErrDataNotAvailable if no such limit is (yet) available
- and others
func (*LPC) ConsumptionNominalMax ¶ added in v0.6.2
return nominal maximum active (real) power the Controllable System is allowed to consume.
If the local device type is an EnergyManagementSystem, the contractual consumption nominal max is returned, otherwise the power consumption nominal max is returned.
func (*LPC) FailsafeConsumptionActivePowerLimit ¶
func (e *LPC) FailsafeConsumptionActivePowerLimit() (limit float64, isChangeable bool, resultErr error)
return Failsafe limit for the consumed active (real) power of the Controllable System. This limit becomes activated in "init" state or "failsafe state".
func (*LPC) FailsafeDurationMinimum ¶
func (e *LPC) FailsafeDurationMinimum() (duration time.Duration, isChangeable bool, resultErr error)
return minimum time the Controllable System remains in "failsafe state" unless conditions specified in this Use Case permit leaving the "failsafe state"
func (*LPC) HandleEvent ¶
func (e *LPC) HandleEvent(payload spineapi.EventPayload)
handle SPINE events
func (*LPC) IsHeartbeatWithinDuration ¶
func (*LPC) PendingConsumptionLimits ¶
func (e *LPC) PendingConsumptionLimits() map[model.MsgCounterType]ucapi.LoadLimit
return the currently pending incoming consumption write limits
func (*LPC) SetConsumptionLimit ¶
set the current loadcontrol limit data
func (*LPC) SetConsumptionNominalMax ¶ added in v0.6.2
set nominal maximum active (real) power the Controllable System is allowed to consume.
If the local device type is an EnergyManagementSystem, the contractual consumption nominal max is set, otherwise the power consumption nominal max is set.
parameters:
- value: nominal max power consumption in W
func (*LPC) SetFailsafeConsumptionActivePowerLimit ¶
set Failsafe limit for the consumed active (real) power of the Controllable System. This limit becomes activated in "init" state or "failsafe state".
func (*LPC) SetFailsafeDurationMinimum ¶
set minimum time the Controllable System remains in "failsafe state" unless conditions specified in this Use Case permit leaving the "failsafe state"
parameters:
- duration: has to be >= 2h and <= 24h
- changeable: boolean if the client service can change this value