Logger

DataLogger

class Logger.DataLogger.DataLogger[source]
Description

This class takes care of data logging in specific format.

Currently is logging only raw data.

To save some storage only differences are saved.

For specific ID new data will be saved only if there is difference in at least one bit.

Note

Currently only txt format is supported, in future *.csv format will be available as well.

static get_timestamp()[source]
Description

Generate timestamp in format YY/MM/DD HH:MM:SS:uS.

is_can_data_modified(can_id, can_data)[source]
Description

Check if incoming data are different then last record for given can id.

Parameters
  • can_id (str) – Id of can msg.

  • can_data (str) – Can data in binary format

Returns

True if data on specific id do not mach saved data

Return type

bool

push_raw_can(can_id, can_data)[source]
Description

Push incoming data to the storage if there is difference:

Every 1000 entry save to the file.

Parameters
  • can_id (str) – ID of incoming CAN data

  • can_data (str) – Actual CAN data

save_raw_can()[source]
Description

Save collected data to automatic path or user defined path in *.txt format.

set_save_path()[source]
Description

Open a file browser and let the user choose a save path.

Logger

Logger.Logger.setup_logger()[source]
Description

Setup logger based on JSON from LoggerConfig.json.