Skip to content

Commit

Permalink
fixes #1127 : add process_bus_logging to stack and concatenate
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed Jan 14, 2025
1 parent 9103225 commit b8873d2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/asammdf/gui/widgets/channel_group_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ def _display(self, position):
record_count = record_end - record_offset

data = b"".join(
e[0] for e in self.mdf._load_data(self.group, record_offset=record_offset, record_count=record_count)
fragment.data
for fragment in self.mdf._load_data(self.group, record_offset=record_offset, record_count=record_count)
)

data = pd.Series(list(np.frombuffer(data, dtype=f"({self.record_size},)u1")))
Expand Down
2 changes: 1 addition & 1 deletion src/asammdf/gui/widgets/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ def load_channel_list(self, event=None, file_name=None, manually=False, show_pro

self.functions.update(info.get("functions", {}))
self.global_variables = f'{self.global_variables}\n{info.get("global_variables", "")}'
self.global_variables = '\n'.join([line for line in self.global_variables.splitlines() if line])
self.global_variables = "\n".join([line for line in self.global_variables.splitlines() if line])

if channels:
iterator = QtWidgets.QTreeWidgetItemIterator(self.channels_tree)
Expand Down
21 changes: 19 additions & 2 deletions src/asammdf/mdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ class MDF:
.. versionadded:: 7.0.0
process_bus_logging (\*\*kwargs) : bool
controls if the bus processing of MDF v4 files is done when the file is loaded. Default True
.. versionadded:: 8.0.0
Examples
--------
>>> mdf = MDF(version='3.30') # new MDF object with version 3.30
Expand Down Expand Up @@ -2245,6 +2250,11 @@ def concatenate(
use_display_names (False) : bool
process_bus_logging (True) : bool
controls if the bus processing of MDF v4 files is done when the file is loaded. Default True
.. versionadded:: 8.1.0
Examples
--------
>>> conc = MDF.concatenate(
Expand Down Expand Up @@ -2646,7 +2656,8 @@ def concatenate(
first_mdf.close()

try:
merged._process_bus_logging()
if kwargs.get("process_bus_logging", True):
merged._process_bus_logging()
except:
pass

Expand Down Expand Up @@ -2680,6 +2691,11 @@ def stack(
use_display_names (False) : bool
process_bus_logging (True) : bool
controls if the bus processing of MDF v4 files is done when the file is loaded. Default True
.. versionadded:: 8.1.0
Examples
--------
>>> stacked = MDF.stack(
Expand Down Expand Up @@ -2834,7 +2850,8 @@ def stack(
return TERMINATED

try:
stacked._process_bus_logging()
if kwargs.get("process_bus_logging", True):
stacked._process_bus_logging()
except:
pass

Expand Down

0 comments on commit b8873d2

Please sign in to comment.