lpc

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2024 License: MIT Imports: 14 Imported by: 2

Documentation

Index

Constants

View Source
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

func (e *LPC) ConsumptionLimit() (limit ucapi.LoadLimit, resultErr error)

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

func (e *LPC) ConsumptionNominalMax() (value float64, resultErr error)

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 (e *LPC) IsHeartbeatWithinDuration() bool

func (*LPC) PendingConsumptionLimits

func (e *LPC) PendingConsumptionLimits() map[model.MsgCounterType]ucapi.LoadLimit

return the currently pending incoming consumption write limits

func (*LPC) SetConsumptionLimit

func (e *LPC) SetConsumptionLimit(limit ucapi.LoadLimit) (resultErr error)

set the current loadcontrol limit data

func (*LPC) SetConsumptionNominalMax added in v0.6.2

func (e *LPC) SetConsumptionNominalMax(value float64) error

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

func (e *LPC) SetFailsafeConsumptionActivePowerLimit(value float64, changeable bool) error

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

func (e *LPC) SetFailsafeDurationMinimum(duration time.Duration, changeable bool) error

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL