project8 / dripline

Slow controls for medium scale physics experiments based on AMQP centralized messaging
http://www.project8.org/dripline
1 stars 0 forks source link

need to be able to "precalibrate" return values #143

Closed laroque closed 9 years ago

laroque commented 9 years ago

Sometimes numeric sensors return a most-raw value which can't be cast to a string (something like 0.993V instead of 0.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.

laroque commented 9 years ago

This can be achieve with a custom implementation of on_get(); that's probably the best thing for now.

laroque commented 9 years ago

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.