Closed ddavidebor closed 6 years ago
This should be implemented directly in the current set widget. The math is very simple and works the following way:
Assuming you have a value you want to assign, for example 0.05 A (amperes) --> 0.05 for simplicity
We use a simple adjustment algorithm to compensate for hardware issues, it works the following way:
output = a + inputvalue * b
where a
is near 0, and b
is near 1
two better names for a and b are:
Currently, in develop those two values are specified here:
But that is only specific for a instrument model, while calibration values are specific for every single instrument.
The best solution would be to put the values and the formula in the mathsheet
adj_current_generator_offset = 0.0
adj_current_generator_slope = 1.0
output_current = adj_current_generator_offset + user_output_current_value * adj_current_generator_slope
This way the current input value passes through the formula, that could be changed with a better model in the future.
problem is, not all the mathsheet is valid if the measures have no value. So we need to invent some way to separate the current output part. Maybe a specific comment ? or maybe use some "grep-like" instruction to extract the lines we need.
Please @wtubog ignore the code regarding a and b in usb.js
temporary solution making a and b editable, we will find a better handling solution when working on a more efficient config file.
Move A and B variables to mathsheet, also rename them with something more explicit