Function formatOffsetDetectionStepValue

  • Formats the value associated with a specific offset detection step.

    Depending on the provided stepId, this function will convert the raw value into a human-readable string or return the value as-is. The formatting is tailored to the type of step:

    • For 'openPhaseDetection', returns 'Yes' or 'No' based on the truthiness of value.
    • For 'phaseResistanceMeasurement', appends 'mΩ' to the value if defined.
    • For 'phaseInductanceMeasurement', appends 'μH' to the value if defined.
    • For 'polePairDetection', returns the value directly.
    • For 'motorPhaseOrderDetection', returns 'Normal' or 'Inverted' based on the value.
    • For 'commutationOffsetMeasurement', returns the value if defined.
    • For any other step, returns the value as-is.

    Returns

    The formatted value as a string or the original value, depending on the step.

    Parameters

    • stepId: "openPhaseDetection" | "phaseResistanceMeasurement" | "phaseInductanceMeasurement" | "polePairDetection" | "motorPhaseOrderDetection" | "commutationOffsetMeasurement"

      The identifier of the offset detection step.

    • value: number

      The value to be parsed and formatted.

    Returns string | number

Generated using TypeDoc