Function convertHrdSamplesToCsv

  • Converts a 2D array of HRD (High Resolution Data) samples into a CSV-formatted string.

    Returns

    A CSV string with a header row and one row per sample. Returns an empty string if no samples are provided.

    Example

    const samples = [
    [12345, 1.23, 100.5],
    [12346, 1.20, 101.2]
    ];

    const csv = convertHrdSamplesToCsv(samples);
    // "HRD Velocity (Q15),HRD Torque [‰],HRD Velocity [RPM]\n12345,1.23,100.5\n12346,1.20,101.2\n"

    Remarks

    • The CSV header is fixed as: "HRD Velocity (Q15),HRD Torque [‰],HRD Velocity [RPM]".
    • Each sample is written on a new line, with comma-separated values.

    Parameters

    • samples: number[][]

      A two-dimensional array where each inner array represents a single sample in the format [velocityQ15, torque, velocity].

    Returns string

Generated using TypeDoc