Circuit: fix validateCurrent and validatePower (#20183)
This commit is contained in:
parent
167124bfa3
commit
455bc3348c
5 changed files with 39 additions and 28 deletions
|
|
@ -239,8 +239,8 @@ type Circuit interface {
|
|||
SetMaxPower(float64)
|
||||
SetMaxCurrent(float64)
|
||||
Update([]CircuitLoad) error
|
||||
ValidateCurrent(old, new float64) float64
|
||||
ValidatePower(old, new float64) float64
|
||||
ValidateCurrent(old, new float64, charging bool) float64
|
||||
ValidatePower(old, new float64, charging bool) float64
|
||||
}
|
||||
|
||||
// Redactor is an interface to redact sensitive data
|
||||
|
|
|
|||
16
api/mock.go
16
api/mock.go
|
|
@ -953,31 +953,31 @@ func (mr *MockCircuitMockRecorder) Update(arg0 any) *gomock.Call {
|
|||
}
|
||||
|
||||
// ValidateCurrent mocks base method.
|
||||
func (m *MockCircuit) ValidateCurrent(old, new float64) float64 {
|
||||
func (m *MockCircuit) ValidateCurrent(old, new float64, charging bool) float64 {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ValidateCurrent", old, new)
|
||||
ret := m.ctrl.Call(m, "ValidateCurrent", old, new, charging)
|
||||
ret0, _ := ret[0].(float64)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// ValidateCurrent indicates an expected call of ValidateCurrent.
|
||||
func (mr *MockCircuitMockRecorder) ValidateCurrent(old, new any) *gomock.Call {
|
||||
func (mr *MockCircuitMockRecorder) ValidateCurrent(old, new, charging any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateCurrent", reflect.TypeOf((*MockCircuit)(nil).ValidateCurrent), old, new)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidateCurrent", reflect.TypeOf((*MockCircuit)(nil).ValidateCurrent), old, new, charging)
|
||||
}
|
||||
|
||||
// ValidatePower mocks base method.
|
||||
func (m *MockCircuit) ValidatePower(old, new float64) float64 {
|
||||
func (m *MockCircuit) ValidatePower(old, new float64, charging bool) float64 {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "ValidatePower", old, new)
|
||||
ret := m.ctrl.Call(m, "ValidatePower", old, new, charging)
|
||||
ret0, _ := ret[0].(float64)
|
||||
return ret0
|
||||
}
|
||||
|
||||
// ValidatePower indicates an expected call of ValidatePower.
|
||||
func (mr *MockCircuitMockRecorder) ValidatePower(old, new any) *gomock.Call {
|
||||
func (mr *MockCircuitMockRecorder) ValidatePower(old, new, charging any) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatePower", reflect.TypeOf((*MockCircuit)(nil).ValidatePower), old, new)
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatePower", reflect.TypeOf((*MockCircuit)(nil).ValidatePower), old, new, charging)
|
||||
}
|
||||
|
||||
// Wrap mocks base method.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue