Skip to content

Commit

Permalink
fix flickering in GUI in case of mat export
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed May 12, 2019
1 parent bd6155f commit f5f7b38
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions asammdf/mdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,7 @@ def export(self, fmt, filename=None, **kargs):
groups_nr = len(self.groups)

for i, grp in enumerate(self.groups):
print(i, len(self.groups))
if self._terminate:
return

Expand Down Expand Up @@ -1469,7 +1470,7 @@ def export(self, fmt, filename=None, **kargs):
mdict[channel_name] = sig.samples

if self._callback:
self._callback(i + 1, groups_nr)
self._callback(i + 1, groups_nr + 1)

else:
used_names = UniqueDB()
Expand All @@ -1488,6 +1489,8 @@ def export(self, fmt, filename=None, **kargs):

mdict['time'] = df.index.values

if self._callback:
self._callback(80, 100)
if format == "7.3":

savemat(
Expand All @@ -1506,6 +1509,8 @@ def export(self, fmt, filename=None, **kargs):
oned_as=oned_as,
do_compression=bool(compression),
)
if self._callback:
self._callback(100, 100)

elif fmt == "parquet":
filename = filename.with_suffix(".parquet")
Expand Down Expand Up @@ -3473,8 +3478,16 @@ def to_dataframe(
self.get_master(i, copy_master=False)
for i, _ in enumerate(self.groups)
]
masters = [
master
for master in masters
if len(master)
]
self._master_channel_cache.clear()
master = reduce(np.union1d, masters)
if masters:
master = reduce(np.union1d, masters)
else:
master = np.array([], dtype='<f4')

df["time"] = pd.Series(master, index=np.arange(len(master)))

Expand Down

0 comments on commit f5f7b38

Please sign in to comment.