This commit is contained in:
raab 2019-09-10 16:22:56 +02:00
parent c0cfe8f193
commit 209b7ed8b1

View File

@ -277,7 +277,7 @@ def main():
disp_eth_power = True disp_eth_power = True
fig, ax = plt.subplots(n_rows, n_cols, figsize=(20/2.54, 12/2.54), facecolor='white') fig, ax = plt.subplots(n_rows, n_cols, figsize=(20/2.54, 12/2.54), facecolor='white',sharex=True, sharey=True)
ax = np.hstack(ax) ax = np.hstack(ax)
channel_handle = [] channel_handle = []
init_fig = True init_fig = True
@ -318,19 +318,24 @@ def main():
index = transfer_status.current_index index = transfer_status.current_index
if (last_idx > index) and (index != -1): if (last_idx > index) and (index != -1):
channel_array = np.arange(len(channels)) channel_array = np.arange(channels)
channel_data = list(map(lambda x : data[x::channels][:250], channel_array)) channel_data = list(map(lambda x : data[x::channels][:250], channel_array))
max = np.max(np.hstack(channel_data))
min = np.min(np.hstack(channel_data))
if init_fig == True: if init_fig == True:
print('init')
for ch in channel_array: for ch in channel_array:
h, = ax[ch].plot(np.arange(250)[:len(channel_data[ch])] / rate, channel_data[ch], color='k') h, = ax[ch].plot(np.arange(250)[:len(channel_data[ch])] / rate, channel_data[ch], color='k')
ax[ch].set_ylim(min, max)
channel_handle.append(h) channel_handle.append(h)
plt.show(block=False) plt.show(block=False)
init_fig = False init_fig = False
else: else:
print('update')
for ch in channel_array: for ch in channel_array:
channel_handle[ch].set_data(np.arange(250)[len(channel_data[ch])] / rate, channel_data[ch]) channel_handle[ch].set_data(np.arange(250)[:len(channel_data[ch])] / rate, channel_data[ch])
plt.draw() fig.canvas.draw()
# np.array(data[last_idx:], dtype=np.float32).tofile(f) # np.array(data[last_idx:], dtype=np.float32).tofile(f)
# np.array(data[:index], dtype=np.float32).tofile(f) # np.array(data[:index], dtype=np.float32).tofile(f)