lpp

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: 1

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-lpp-UseCaseSupportUpdate"

	// Load control obligation limit data update received
	//
	// Use `ProductionLimit` to get the current data
	//
	// Use Case LPC, Scenario 1
	DataUpdateLimit api.EventType = "cs-lpp-DataUpdateLimit"

	// An incoming load control obligation limit needs to be approved or denied
	//
	// Use `PendingProductionLimits` to get the currently pending write approval requests
	// and invoke `ApproveOrDenyProductionLimit` for each
	//
	// Use Case LPC, Scenario 1
	WriteApprovalRequired api.EventType = "cs-lpp-WriteApprovalRequired"

	// Failsafe limit for the produced active (real) power of the
	// Controllable System data update received
	//
	// Use `FailsafeProductionActivePowerLimit` to get the current data
	//
	// Use Case LPC, Scenario 2
	DataUpdateFailsafeProductionActivePowerLimit api.EventType = "cs-lpp-DataUpdateFailsafeProductionActivePowerLimit"

	// 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-lpp-DataUpdateFailsafeDurationMinimum"

	// Indicates a notify heartbeat event the application should care of.
	// E.g. going into or out of the Failsafe state
	//
	// Use Case LPP, Scenario 3
	DataUpdateHeartbeat api.EventType = "uclpcserver-DataUpdateHeartbeat"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type LPP

type LPP struct {
	*usecase.UseCaseBase
	// contains filtered or unexported fields
}

func NewLPP

func NewLPP(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *LPP

func (*LPP) AddFeatures

func (e *LPP) AddFeatures()

func (*LPP) ApproveOrDenyProductionLimit

func (e *LPP) ApproveOrDenyProductionLimit(msgCounter model.MsgCounterType, approve bool, reason string)

accept or deny an incoming production write limit

use PendingProductionLimits to get the list of currently pending requests

func (*LPP) FailsafeDurationMinimum

func (e *LPP) 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 (*LPP) FailsafeProductionActivePowerLimit

func (e *LPP) FailsafeProductionActivePowerLimit() (limit float64, isChangeable bool, resultErr error)

return Failsafe limit for the produced active (real) power of the Controllable System. This limit becomes activated in "init" state or "failsafe state".

func (*LPP) HandleEvent

func (e *LPP) HandleEvent(payload spineapi.EventPayload)

handle SPINE events

func (*LPP) IsHeartbeatWithinDuration

func (e *LPP) IsHeartbeatWithinDuration() bool

func (*LPP) PendingProductionLimits

func (e *LPP) PendingProductionLimits() map[model.MsgCounterType]ucapi.LoadLimit

return the currently pending incoming production write limits

func (*LPP) ProductionLimit

func (e *LPP) ProductionLimit() (limit ucapi.LoadLimit, resultErr error)

return the current production limit data

return values:

  • limit: load limit data

possible errors:

  • ErrDataNotAvailable if no such limit is (yet) available
  • and others

func (*LPP) ProductionNominalMax added in v0.6.2

func (e *LPP) ProductionNominalMax() (value float64, resultErr error)

return nominal maximum active (real) power the Controllable System is allowed to produce.

If the local device type is an EnergyManagementSystem, the contractual production nominal max is returned, otherwise the power production nominal max is returned.

func (*LPP) SetFailsafeDurationMinimum

func (e *LPP) 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

func (*LPP) SetFailsafeProductionActivePowerLimit

func (e *LPP) SetFailsafeProductionActivePowerLimit(value float64, changeable bool) error

set Failsafe limit for the produced active (real) power of the Controllable System. This limit becomes activated in "init" state or "failsafe state".

func (*LPP) SetProductionLimit

func (e *LPP) SetProductionLimit(limit ucapi.LoadLimit) (resultErr error)

set the current production limit data

func (*LPP) SetProductionNominalMax added in v0.6.2

func (e *LPP) SetProductionNominalMax(value float64) error

set nominal maximum active (real) power the Controllable System is allowed to produce.

If the local device type is an EnergyManagementSystem, the contractual production nominal max is set, otherwise the power production nominal max is set.

parameters:

  • value: nominal max power production in W

Jump to

Keyboard shortcuts

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