#[non_exhaustive]#[repr(u8)]pub enum ConversionType {
Show 17 variants
NoConversion = 0,
Linear = 1,
Rational = 2,
Algebraic = 3,
ValueToValueInterpolation = 4,
ValueToValue = 5,
ValueRangeToValue = 6,
ValueToText = 7,
ValueRangeToText = 8,
TextToValue = 9,
TextToTranslation = 10,
BitfieldToText = 11,
Polynomial = 30,
Exponential = 31,
Logarithmic = 32,
DateConversion = 33,
TimeConversion = 34,
}Expand description
\brief Type of conversion formula
The type together with the Parameter() function defines the conversion between channel and engineering value.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoConversion = 0
\brief 1:1 conversion. No parameters needed.
Linear = 1
\brief Linear conversion. 2 parameters. Eng = Ch * Par(1) + Par(0).
Rational = 2
\brief Rational function conversion. 6 parameters. Eng = (Par(0)*Ch^2 + Par(1)*Ch + Par(2)) / (Par(3)*Ch^2 + Par(4)*Ch + Par(5))
Algebraic = 3
< Text formula.
ValueToValueInterpolation = 4
\brief Value to value conversion with interpolation. Defined by a list of Key value pairs. Par(n) = key and Par(n+1) value.
ValueToValue = 5
\brief Value to value conversion without interpolation. Defined by a list of Key value pairs. Par(n) = key and Par(n+1) value.
ValueRangeToValue = 6
\brief Value range to value conversion without interpolation. Defined by a list of Key min/max value triplets. Par(3n) = key min, Par(3(n+1)) = key max and Par(3*(n+2)) value. Add a default value last, after all the triplets.
ValueToText = 7
\brief Value to text conversion. Defined by a list of key values to text string conversions. This is normally used for enumerated channels. Par(n) value to Ref(n) text. Add a default referenced text last.
ValueRangeToText = 8
\brief Value range to text conversion. Defined by a list of key min/max values to text string conversions. This is normally used for enumerated channels. Par(2*n) min key, Par(2(n+1)) max key to Ref(n) value. Add a default referenced text last.
TextToValue = 9
\brief Text to value conversion. Defines a list of text string to value conversion. Ref(n) key to Par(n) value. Add a default value last to the parameter list.
TextToTranslation = 10
\brief Text to text conversion. Defines a list of text string to text conversion. Ref(2n) key to Ref(2(n+1)) value. Add a text value last to the parameter list.
BitfieldToText = 11
\brief Bitfield to text conversion Currently unsupported conversion.
Polynomial = 30
< MDF 3 polynomial conversion.
Exponential = 31
< MDF 3 exponential conversion.
Logarithmic = 32
< MDF 3 logarithmic conversion.
DateConversion = 33
< MDF 3 Date conversion
TimeConversion = 34
< MDF 3 Time conversion
Trait Implementations§
Source§impl Clone for ConversionType
impl Clone for ConversionType
Source§fn clone(&self) -> ConversionType
fn clone(&self) -> ConversionType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more