pub struct CompuMethod {
pub name: String,
pub conversion_type: ConversionType,
pub coeffs: Coeffs,
pub tab_ref: Option<String>,
pub unit: String,
}Expand description
A COMPU_METHOD: the raw ↔ physical conversion for one quantity.
Fields§
§name: StringCOMPU_METHOD name.
conversion_type: ConversionTypeConversion type (LINEAR, RAT_FUNC, TABLE, IDENTITY).
coeffs: CoeffsCoefficients carried by the method (COEFFS/COEFFS_LINEAR);
Coeffs::None for TABLE/IDENTITY and for methods that reference
a table via COMPU_TAB_REF instead.
tab_ref: Option<String>The COMPU_TAB_REF table name when the conversion is tabular.
unit: StringPhysical unit string (may be empty).
Implementations§
Source§impl CompuMethod
impl CompuMethod
Sourcepub fn to_linear(&self) -> Option<LinearFn>
pub fn to_linear(&self) -> Option<LinearFn>
Reduce the method to a linear raw → physical function when the conversion is linear-or-reducibly-rational:
LINEAR(COEFFS_LINEAR a b):f(x) = a·x + bdirectly.RAT_FUNCwithd = e = 0andf ≠ 0:(a·x² + b·x + c) / freduces to linear with slopea / f, interceptc / f— the form nearly every real ECU uses.IDENTITY:f(x) = x.TABLE(and non-linearRAT_FUNC): not reducible →None.
Trait Implementations§
Source§impl Clone for CompuMethod
impl Clone for CompuMethod
Source§impl Debug for CompuMethod
impl Debug for CompuMethod
Source§impl PartialEq for CompuMethod
impl PartialEq for CompuMethod
impl StructuralPartialEq for CompuMethod
Auto Trait Implementations§
impl Freeze for CompuMethod
impl RefUnwindSafe for CompuMethod
impl Send for CompuMethod
impl Sync for CompuMethod
impl Unpin for CompuMethod
impl UnsafeUnpin for CompuMethod
impl UnwindSafe for CompuMethod
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more