Skip to content
This repository has been archived by the owner on Jun 29, 2024. It is now read-only.

Add UCLPP and UCLPPServer #32

Merged
merged 2 commits into from
Apr 17, 2024
Merged
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
2 changes: 2 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ packages:
github.com/enbility/cemd/ucevsoc:
github.com/enbility/cemd/uclpc:
github.com/enbility/cemd/uclpcserver:
github.com/enbility/cemd/uclpp:
github.com/enbility/cemd/uclppserver:
github.com/enbility/cemd/ucmgcp:
github.com/enbility/cemd/ucmpc:
github.com/enbility/cemd/ucopev:
Expand Down
21 changes: 21 additions & 0 deletions cmd/democem/democem.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/enbility/cemd/cem"
"github.com/enbility/cemd/ucevsecc"
"github.com/enbility/cemd/uclpcserver"
"github.com/enbility/cemd/uclppserver"
eebusapi "github.com/enbility/eebus-go/api"
"github.com/enbility/ship-go/logging"
)
Expand Down Expand Up @@ -53,6 +54,26 @@ func (d *DemoCem) Setup() error {
logging.Log().Error(err)
}

lpps := uclppserver.NewUCLPP(d.cem.Service, d.entityEventCB)
d.cem.AddUseCase(lpps)

if err := lpps.SetProductionLimit(api.LoadLimit{
IsChangeable: true,
IsActive: false,
Value: 0,
}); err != nil {
logging.Log().Error(err)
}
if err := lpps.SetContractualProductionNominalMax(-7000); err != nil {
logging.Log().Error(err)
}
if err := lpps.SetFailsafeProductionActivePowerLimit(0, true); err != nil {
logging.Log().Error(err)
}
if err := lpps.SetFailsafeDurationMinimum(time.Hour*2, true); err != nil {
logging.Log().Error(err)
}

evsecc := ucevsecc.NewUCEVSECC(d.cem.Service, d.entityEventCB)
d.cem.AddUseCase(evsecc)

Expand Down
Loading