5.3.1.7.2.3.1. cli.cmd_etl.etl.can_filter.CANFilter

class cli.cmd_etl.etl.can_filter.CANFilter(ids: list[str], id_pos: int, sampling: dict[str, int] | None = None, _input: Path | None = None, output: Path | None = None)

Bases: object

Implements the CAN message filter functionalities

Parameters:
  • _ids – CAN ids which should be filtered

  • _id_pos – Position of the CAN ids in the log file

  • _sampling – Number of specific CAN messages that should be stored

static extend_ids(ids: list[str]) → list[str]

Extend the list with CAN ids with respect to the used abbreviations as 201-20F.

This function only accepts only ids in hexadecimal.

Parameters:

ids – List with CAN ids

Returns:

Extended list with CAN ids

filter_msg(msg: str) → str | None

Filter the incoming CAN message with.

Filtering is done with respect to the _ids, _id_pos and _sampling. This function handles only CAN messages with whitespace separated parts.

Parameters:

msg – One CAN messages as string

Returns:

One CAN message that fulfills the filter conditions