Skip to content

Commit 0d61284

Browse files
committed
Minor updates
1 parent 3ab9613 commit 0d61284

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

examples/data-processing/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def filter_signals(self, df_phys):
211211

212212
return df_phys
213213

214-
def get_raw_data(self, log_file, lin=False, passwords={}):
214+
def get_raw_data(self, log_file, passwords={}, lin=False):
215215
"""Extract a df of raw data and device ID from log file.
216216
Optionally include LIN bus data by setting lin=True
217217
"""

examples/other/misc/create_log_files.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
# this script can be used to generate log files for the CANedge e.g. for testing WiFi transfer
2-
31
import os
42
import hashlib
53

6-
# specify details of log files (device ID should match your test device)
7-
device_id = "534F281B"
8-
file_type = "MF4"
9-
sessions = 120
10-
splits = 50
11-
size_bytes = 2 * 1024 * 1024
124

13-
# function for creating files
145
def sha256_file(path):
156
digest = hashlib.sha256()
167
with open(path, "rb") as f:
@@ -21,10 +12,17 @@ def sha256_file(path):
2112
digest.update(buf)
2213
return digest.hexdigest().upper()
2314

24-
# run loop to create log files in folders
15+
16+
device_id = "3851A144" #"1973B1D6"
17+
file_type = "MF4"
18+
sessions = 30
19+
splits = 50
20+
session_offset = 20000
21+
size_bytes = 2 * 1024 * 1024
22+
2523
dir_path = os.path.dirname(os.path.abspath(__file__))
2624

27-
for session_no in range(1, sessions + 1):
25+
for session_no in range(session_offset, sessions + session_offset):
2826
for split_no in range(1, splits + 1):
2927
tmp_file_name = "{}.mf4".format(split_no)
3028
tmp_file_path = os.path.join(dir_path, tmp_file_name)
@@ -36,9 +34,7 @@ def sha256_file(path):
3634
# Calculate digest of file
3735
digest = sha256_file(tmp_file_path)
3836

39-
# create folder name
4037
folder = f'{session_no}'.zfill(8)
41-
4238
# Check whether the specified path exists or not
4339
isExist = os.path.exists(folder)
4440

0 commit comments

Comments
 (0)