lpp

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// Update of the list of remote entites 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 consumption write limit

use PendingProductionLimits to get the list of currently pending requests

func (*LPP) ContractualProductionNominalMax

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

return nominal maximum active (real) power the Controllable System is allowed to produce due to the customer's contract.

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 consumption 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) SetContractualProductionNominalMax

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

set nominal maximum active (real) power the Controllable System is allowed to produce due to the customer's contract.

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

Jump to

Keyboard shortcuts

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