11package api
22
33import (
4- "github.com/enbility/eebus-go/api"
5- "github.com/enbility/spine-go/model"
64 "time"
5+
6+ "github.com/enbility/spine-go/model"
77)
88
99// Actor: Monitoring Unit
@@ -91,29 +91,29 @@ type MuMPCInterface interface {
9191 // possible errors:
9292 // - ErrMissingData if the id is not available
9393 // - and others
94- Update (data ... UpdateData ) error
94+ Update (data ... UpdateMeasurementData ) error
9595
9696 // Scenario 1
9797
9898 // use UpdateDataPowerTotal in Update to set the momentary active power consumption or production
9999 // The timestamp is optional and can be nil
100100 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
101- UpdateDataPowerTotal (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
101+ UpdateDataPowerTotal (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
102102
103103 // use UpdateDataPowerPhaseA in Update to set the momentary active power consumption or production per phase
104104 // The timestamp is optional and can be nil
105105 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
106- UpdateDataPowerPhaseA (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
106+ UpdateDataPowerPhaseA (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
107107
108108 // use UpdateDataPowerPhaseB in Update to set the momentary active power consumption or production per phase
109109 // The timestamp is optional and can be nil
110110 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
111- UpdateDataPowerPhaseB (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
111+ UpdateDataPowerPhaseB (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
112112
113113 // use UpdateDataPowerPhaseC in Update to set the momentary active power consumption or production per phase
114114 // The timestamp is optional and can be nil
115115 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
116- UpdateDataPowerPhaseC (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
116+ UpdateDataPowerPhaseC (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
117117
118118 // Scenario 2
119119
@@ -127,7 +127,7 @@ type MuMPCInterface interface {
127127 valueState * model.MeasurementValueStateType ,
128128 evaluationStart * time.Time ,
129129 evaluationEnd * time.Time ,
130- ) UpdateData
130+ ) UpdateMeasurementData
131131
132132 // use UpdateDataEnergyProduced in Update to set the total feed in energy
133133 // The timestamp is optional and can be nil
@@ -139,67 +139,61 @@ type MuMPCInterface interface {
139139 valueState * model.MeasurementValueStateType ,
140140 evaluationStart * time.Time ,
141141 evaluationEnd * time.Time ,
142- ) UpdateData
142+ ) UpdateMeasurementData
143143
144144 // Scenario 3
145145
146146 // use UpdateDataCurrentPhaseA in Update to set the momentary phase specific current consumption or production
147147 // The timestamp is optional and can be nil
148148 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
149- UpdateDataCurrentPhaseA (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
149+ UpdateDataCurrentPhaseA (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
150150
151151 // use UpdateDataCurrentPhaseB in Update to set the momentary phase specific current consumption or production
152152 // The timestamp is optional and can be nil
153153 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
154- UpdateDataCurrentPhaseB (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
154+ UpdateDataCurrentPhaseB (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
155155
156156 // use UpdateDataCurrentPhaseC in Update to set the momentary phase specific current consumption or production
157157 // The timestamp is optional and can be nil
158158 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
159- UpdateDataCurrentPhaseC (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
159+ UpdateDataCurrentPhaseC (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
160160
161161 // Scenario 4
162162
163163 // use UpdateDataVoltagePhaseA in Update to set the phase specific voltage details
164164 // The timestamp is optional and can be nil
165165 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
166- UpdateDataVoltagePhaseA (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
166+ UpdateDataVoltagePhaseA (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
167167
168168 // use UpdateDataVoltagePhaseB in Update to set the phase specific voltage details
169169 // The timestamp is optional and can be nil
170170 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
171- UpdateDataVoltagePhaseB (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
171+ UpdateDataVoltagePhaseB (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
172172
173173 // use UpdateDataVoltagePhaseC in Update to set the phase specific voltage details
174174 // The timestamp is optional and can be nil
175175 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
176- UpdateDataVoltagePhaseC (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
176+ UpdateDataVoltagePhaseC (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
177177
178178 // use UpdateDataVoltagePhaseAToB in Update to set the phase specific voltage details
179179 // The timestamp is optional and can be nil
180180 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
181- UpdateDataVoltagePhaseAToB (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
181+ UpdateDataVoltagePhaseAToB (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
182182
183183 // use UpdateDataVoltagePhaseBToC in Update to set the phase specific voltage details
184184 // The timestamp is optional and can be nil
185185 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
186- UpdateDataVoltagePhaseBToC (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
186+ UpdateDataVoltagePhaseBToC (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
187187
188188 // use UpdateDataVoltagePhaseCToA in Update to set the phase specific voltage details
189189 // The timestamp is optional and can be nil
190190 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
191- UpdateDataVoltagePhaseCToA (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
191+ UpdateDataVoltagePhaseCToA (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
192192
193193 // Scenario 5
194194
195195 // use AcFrequency in Update to set the frequency
196196 // The timestamp is optional and can be nil
197197 // The valueState shall be set if it differs from the normal valueState otherwise it can be nil
198- UpdateDataFrequency (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateData
199- }
200-
201- type UpdateData interface {
202- Supported () bool
203- NotSupportedError () error
204- MeasurementData () api.MeasurementDataForID
198+ UpdateDataFrequency (value float64 , timestamp * time.Time , valueState * model.MeasurementValueStateType ) UpdateMeasurementData
205199}
0 commit comments