Closed laroque closed 9 years ago
This can be achieve with a custom implementation of on_get(); that's probably the best thing for now.
not only is that the best thing for now, that's what that's there for, also it would be a dragonfly problem if that weren't the case.
Sometimes numeric sensors return a most-raw value which can't be cast to a string (something like
0.993V
instead of0.993
. Because of the way the SC database is currently designed, it is important that both value_raw and value_cal be able to be converted to a number.I propose a raw_extract_string which is a regular expression with a match clause, which all SCPI spimes should support, the get method would then use this to parse the most_raw result into a "raw" result to actually return. This should be used for stripping extra characters but not for the calibration, which should continue to be done as-is.
A nicer solution would be to restructure the table such that value_raw is always a string, then for various endpoints, there could be a column for "calibrated_str" "calibrated_number" and "memo" with the desired types.