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

Commit 5e3f237

Browse files
Add UCLPP and UCLPPServer (#32)
Add implementations for the use case Limitation of Power Production (LPP) as client and server
2 parents e14b394 + 072fc37 commit 5e3f237

23 files changed

+3955
-56
lines changed

.mockery.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ packages:
1515
github.com/enbility/cemd/ucevsoc:
1616
github.com/enbility/cemd/uclpc:
1717
github.com/enbility/cemd/uclpcserver:
18+
github.com/enbility/cemd/uclpp:
19+
github.com/enbility/cemd/uclppserver:
1820
github.com/enbility/cemd/ucmgcp:
1921
github.com/enbility/cemd/ucmpc:
2022
github.com/enbility/cemd/ucopev:

cmd/democem/democem.go

+21
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"github.com/enbility/cemd/cem"
99
"github.com/enbility/cemd/ucevsecc"
1010
"github.com/enbility/cemd/uclpcserver"
11+
"github.com/enbility/cemd/uclppserver"
1112
eebusapi "github.com/enbility/eebus-go/api"
1213
"github.com/enbility/ship-go/logging"
1314
)
@@ -53,6 +54,26 @@ func (d *DemoCem) Setup() error {
5354
logging.Log().Error(err)
5455
}
5556

57+
lpps := uclppserver.NewUCLPP(d.cem.Service, d.entityEventCB)
58+
d.cem.AddUseCase(lpps)
59+
60+
if err := lpps.SetProductionLimit(api.LoadLimit{
61+
IsChangeable: true,
62+
IsActive: false,
63+
Value: 0,
64+
}); err != nil {
65+
logging.Log().Error(err)
66+
}
67+
if err := lpps.SetContractualProductionNominalMax(-7000); err != nil {
68+
logging.Log().Error(err)
69+
}
70+
if err := lpps.SetFailsafeProductionActivePowerLimit(0, true); err != nil {
71+
logging.Log().Error(err)
72+
}
73+
if err := lpps.SetFailsafeDurationMinimum(time.Hour*2, true); err != nil {
74+
logging.Log().Error(err)
75+
}
76+
5677
evsecc := ucevsecc.NewUCEVSECC(d.cem.Service, d.entityEventCB)
5778
d.cem.AddUseCase(evsecc)
5879

0 commit comments

Comments
 (0)