Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various maintenance updates #136

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion usecases/cem/cevc/public_scen2.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ func (e *CEVC) WritePowerLimits(entity spineapi.EntityRemoteInterface, data []uc
for index, slot := range data {
relativeStart := totalDuration

slotid := uint(index) //nolint:gosec // disable G115
timeSeriesSlot := model.TimeSeriesSlotType{
TimeSeriesSlotId: util.Ptr(model.TimeSeriesSlotIdType(index)),
TimeSeriesSlotId: util.Ptr(model.TimeSeriesSlotIdType(slotid)),
TimePeriod: &model.TimePeriodType{
StartTime: model.NewAbsoluteOrRelativeTimeTypeFromDuration(relativeStart),
},
Expand Down
6 changes: 6 additions & 0 deletions usecases/cem/cevc/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ type CEVC struct {

var _ ucapi.CemCEVCInterface = (*CEVC)(nil)

// Add support for the Coordinated EV Charging (CEVC) use case
// as a CEM actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewCEVC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *CEVC {
validActorTypes := []model.UseCaseActorType{
model.UseCaseActorTypeEV,
Expand Down
7 changes: 7 additions & 0 deletions usecases/cem/evcc/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ type EVCC struct {

var _ ucapi.CemEVCCInterface = (*EVCC)(nil)

// Add support for the EV Commissioning and Configuration (EVCEM) use case
// as a CEM actor
//
// Parameters:
// - service: The service implementation
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewEVCC(
service api.ServiceInterface,
localEntity spineapi.EntityLocalInterface,
Expand Down
13 changes: 12 additions & 1 deletion usecases/cem/evcem/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ type EVCEM struct {

var _ ucapi.CemEVCEMInterface = (*EVCEM)(nil)

func NewEVCEM(service api.ServiceInterface, localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *EVCEM {
// Add support for the Measurement of Electricity during EV Charging (EVCEM) use case
// as a CEM actor
//
// Parameters:
// - service: The service implementation
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewEVCEM(
service api.ServiceInterface,
localEntity spineapi.EntityLocalInterface,
eventCB api.EntityEventCallback,
) *EVCEM {
validActorTypes := []model.UseCaseActorType{
model.UseCaseActorTypeEV,
}
Expand Down
6 changes: 6 additions & 0 deletions usecases/cem/evsecc/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ type EVSECC struct {

var _ ucapi.CemEVSECCInterface = (*EVSECC)(nil)

// Add support for the EVSE Commmissioning and Configuration (EVSECC) use case
// as a CEM actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewEVSECC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *EVSECC {
validActorTypes := []model.UseCaseActorType{
model.UseCaseActorTypeEVSE,
Expand Down
6 changes: 6 additions & 0 deletions usecases/cem/evsoc/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ type EVSOC struct {

var _ ucapi.CemEVSOCInterface = (*EVSOC)(nil)

// Add support for the EV State of Charge (EVSOC) use case
// as a CEM actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewEVSOC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *EVSOC {
validActorTypes := []model.UseCaseActorType{
model.UseCaseActorTypeEV,
Expand Down
6 changes: 6 additions & 0 deletions usecases/cem/opev/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ type OPEV struct {

var _ ucapi.CemOPEVInterface = (*OPEV)(nil)

// Add support for the Overload Protection by EV Charging Current Curtailment (OPEV) use case
// as a CEM actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewOPEV(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *OPEV {
validActorTypes := []model.UseCaseActorType{
model.UseCaseActorTypeEV,
Expand Down
6 changes: 6 additions & 0 deletions usecases/cem/oscev/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ type OSCEV struct {

var _ ucapi.CemOSCEVInterface = (*OSCEV)(nil)

// Add support for the Optimization of Self-Consumption during EV Charging (OSCEV) use case
// as a CEM actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewOSCEV(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *OSCEV {
validActorTypes := []model.UseCaseActorType{
model.UseCaseActorTypeEV,
Expand Down
6 changes: 6 additions & 0 deletions usecases/cem/vabd/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ type VABD struct {

var _ ucapi.CemVABDInterface = (*VABD)(nil)

// Add support for the Visualization of Aggregated Battery Data (VABD) use case
// as a CEM actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewVABD(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *VABD {
validActorTypes := []model.UseCaseActorType{
model.UseCaseActorTypeBatterySystem,
Expand Down
6 changes: 6 additions & 0 deletions usecases/cem/vapd/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ type VAPD struct {

var _ ucapi.CemVAPDInterface = (*VAPD)(nil)

// Add support for the Visualization of Aggregated Photovoltaic Data (VAPD) use case
// as a CEM actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewVAPD(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *VAPD {
validActorTypes := []model.UseCaseActorType{
model.UseCaseActorTypePVSystem,
Expand Down
6 changes: 6 additions & 0 deletions usecases/cs/lpc/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ type LPC struct {

var _ ucapi.CsLPCInterface = (*LPC)(nil)

// Add support for the Limitation of Power Consumption (LPC) use case
// as a Controllable System actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewLPC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *LPC {
validActorTypes := []model.UseCaseActorType{model.UseCaseActorTypeEnergyGuard}
validEntityTypes := []model.EntityTypeType{
Expand Down
6 changes: 6 additions & 0 deletions usecases/cs/lpp/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ type LPP struct {

var _ ucapi.CsLPPInterface = (*LPP)(nil)

// Add support for the Limitation of Power Production (LPC) use case
// as a Controllable System actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewLPP(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *LPP {
validActorTypes := []model.UseCaseActorType{model.UseCaseActorTypeEnergyGuard}
validEntityTypes := []model.EntityTypeType{
Expand Down
6 changes: 6 additions & 0 deletions usecases/eg/lpc/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ type LPC struct {

var _ ucapi.EgLPCInterface = (*LPC)(nil)

// Add support for the Limitation of Power Consumption (LPC) use case
// as a Energy Guard actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewLPC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *LPC {
validActorTypes := []model.UseCaseActorType{model.UseCaseActorTypeControllableSystem}
validEntityTypes := []model.EntityTypeType{
Expand Down
6 changes: 6 additions & 0 deletions usecases/eg/lpp/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ type LPP struct {

var _ ucapi.EgLPPInterface = (*LPP)(nil)

// Add support for the Limitation of Power Production (LPC) use case
// as a Energy Guard actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewLPP(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *LPP {
validActorTypes := []model.UseCaseActorType{model.UseCaseActorTypeControllableSystem}
validEntityTypes := []model.EntityTypeType{
Expand Down
6 changes: 6 additions & 0 deletions usecases/ma/mgcp/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ type MGCP struct {

var _ ucapi.MaMGCPInterface = (*MGCP)(nil)

// Add support for the Monitoring of Grid Connection Point (MGCP) use case
// as a Monitoring Appliance actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewMGCP(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *MGCP {
validActorTypes := []model.UseCaseActorType{model.UseCaseActorTypeGridConnectionPoint}
validEntityTypes := []model.EntityTypeType{
Expand Down
6 changes: 6 additions & 0 deletions usecases/ma/mpc/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ type MPC struct {

var _ ucapi.MaMPCInterface = (*MPC)(nil)

// Add support for the Monitoring of Monitoring Power Consumption (MPC) use case
// as a Monitoring Appliance actor
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - eventCB: The callback to be called when an event is triggered (optional, can be nil)
func NewMPC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *MPC {
validActorTypes := []model.UseCaseActorType{model.UseCaseActorTypeMonitoredUnit}
validEntityTypes := []model.EntityTypeType{
Expand Down
13 changes: 13 additions & 0 deletions usecases/usecase/usecase.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ type UseCaseBase struct {

var _ api.UseCaseBaseInterface = (*UseCaseBase)(nil)

// Adds a new use case to an entity
//
// Parameters:
// - localEntity: The local entity which should support the use case
// - usecaseActor: The actor type of the use case
// - usecaseName: The name of the use case
// - useCaseVersion: The version of the use case
// - useCaseDocumentSubVersion: The sub version of the use case document
// - useCaseScenarios: The supported scenarios of the use case
// - eventCB: The callback to be called when an usecase update event of a remote entity is triggered (optional, can be nil)
// - useCaseUpdateEvent: The event type of the use case update event for the eventCB
// - validActorTypes: The valid actor types for the use case in a remote entity
// - validEntityTypes: The valid entity types for the use case in a remote entity
func NewUseCaseBase(
localEntity spineapi.EntityLocalInterface,
usecaseActor model.UseCaseActorType,
Expand Down