Function convertGroupedSmmParametersToTransmitData

  • Converts a grouped map of SMM parameters/values into a flat array suitable for transmission.

    During transmission, the Safety-Limited Speed (SLS) groups must be transposed. That is, instead of sending the values grouped by SLS1, SLS2, SLS3, and SLS4 in order, the values are interleaved such that:

    Input:

    • SLS1: [a1, a2, a3, ...]
    • SLS2: [b1, b2, b3, ...]
    • SLS3: [c1, c2, c3, ...]
    • SLS4: [d1, d2, d3, ...]

    Output:

    • [a1, b1, c1, d1, a2, b2, c2, d2, a3, b3, c3, d3, ...]

    This function:

    • Accepts an object mapping group names to arrays of parameters/values (e.g., "Safety functions (SOS)", "SLS1", etc.).
    • Locates the starting index of the SLS groups by finding the first key that includes "SLS".
    • Extracts and transposes the four SLS groups into n arrays of 4 elements each.
    • Inserts the transposed data in place of the original SLS groups.
    • Preserves the order of all other groups before and after the SLS block.
    • Returns the entire structure as a flattened one-dimensional array.

    Returns

    A flat array of all parameter values, reordered for transmission.

    Type Parameters

    • T

      The type of parameter values contained in each group.

    Parameters

    • obj: {
          [key: string]: T[];
      }

      An object whose keys are group names and values are arrays of parameters/values.

      • [key: string]: T[]

    Returns T[]

Generated using TypeDoc