Closed lategoodbye closed 4 years ago
@fredrik-sk are you fine with this compromise?
@fredrik-sk are you fine with this compromise?
I'm glad that something happends. And that you have found and corrected some issue.
Thanks for the review
I had one more comment. I see the change has been merged. Should we return both the raw value and the decoded?
Should we return both the raw value and the decoded?
Not sure that i understand your question. Do you mean decimal + hex?
Yes. Since in the case with negative BCD, seing a minus makes more sense then an F, and having to apply the algorithm by yourself. My first approach was calling it "raw value", and "decoded value".
I like to avoid such a structure change in the XML structure. Maybe you prefer the normalized output. Let's stay at this example (SLB_CF-Compact-Integral-MK-MaXX).
default output:
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>Temperature Difference (1e-2 deg C)</Unit>
<Value>F00018</Value>
</DataRecord>
normalized output:
<DataRecord id="6">
<Function>Instantaneous value</Function>
<StorageNumber>0</StorageNumber>
<Unit>K</Unit>
<Quantity>Temperature difference</Quantity>
<Value>-0.180000</Value>
</DataRecord>
This pull request tries to solve the issue #163
At the end the whole BCD decoding is depending on the context. So add a new function which preserve all the BCD information.