nmcb / dads

Reading and counter storage
The Unlicense
0 stars 0 forks source link

Incorrect volume. #17

Closed bartbuijse closed 7 months ago

nmcb commented 3 years ago

I'll have a look tracing. can you post an indication containing just the 0532cac2-4b6e-48e2-8009-34117fdc860a measurement that triggers a wrong update? and for my clarification, what do you mean with the 'current counter'?

nmcb commented 3 years ago

i think it's because we now multiply inbound kWh measurement by 1.0E9 now that #14 was deployed. with previous counter values in the 1000s due to the bug ... subtracting an inbound converted value of scale 1.0E9 yields a large negative number. could that be it?

ref: https://github.com/nmcb/dads/blob/master/src/main/scala/dads/v1/MeasurementReceiver.scala#L69

nmcb commented 3 years ago

we'll need a good test set to assert correct functionality. can you, for a the part that are not working correctly, provide:

i can pick this up on wednesday, so let me know whether you want me to pick this issue up first, or whether you prefer me to work on (implement) the MeasurementReceiver.GetMeasureements first, you have a better view on priorities what needs to be done to get the point-to-point working on friday.

[1] https://github.com/nmcb/dads/blob/master/src/test/scala/dads/v1/test/MeasurementReceiverTest.scala#L111-L115

nmcb commented 3 years ago

But values can not be negative.

check, that one is unimplemented, good catch! can you specify?

if the current.value - measurement.reading is negative, what should be the written?

[x] fail the indication? [ ] write a default value? [ ] ignore? [ ]

nmcb commented 3 years ago

i can pick this up on wednesday, so let me know whether you want me to pick this issue up first, or whether you prefer me to work on (implement) the MeasurementReceiver.GetMeasureements first, you have a better view on priorities what needs to be done to get the point-to-point working on friday.

nmcb commented 3 years ago

I do not see any checks on the stored values in the database

see: https://github.com/nmcb/dads/blob/master/src/test/scala/dads/v1/test/CounterRepositoryTest.scala#L64-L74

for an example on how validate values (in this case properties) of persistent storage.

(edited at my own peril).

nmcb commented 3 years ago

do

you prefer me to work on (implement) the MeasurementReceiver.GetMeasureements first, you have a better view on priorities what needs to be done to get the point-to-point working on friday.

answer the question plz, thx!

nmcb commented 3 years ago

ah, point-top-point gas measurement, volume history ... sorry, im a bit slow today.

can you remember me, did you want me to persist ㎥ or ㎣ decimal values ...

(In the DaDS CounterRepositoryand the RealTimeDecimalRepository).

nmcb commented 3 years ago

that link doesn't work for me, can you quote the spec here plz?

nmcb commented 3 years ago

checked again, thanks for keeping me busy ... nope your link doesn't work for me.

ah, the "volume history" is the whole specification, not just the part specifying gas measurements, now i finally understand.

(sorry, i can be so stupid and so slow sometimes, especially on my free days).

then regarding my question, ref: https://github.com/nmcb/dads/issues/17#issuecomment-724629186

what would you suggest, shall i reread the spec on wednseday first then?