-
Notifications
You must be signed in to change notification settings - Fork 0
/
csvplotter.py
31 lines (25 loc) · 867 Bytes
/
csvplotter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import cProfile
import select
import matplotlib.pyplot as plt
from logplotters import JittPlotter, LatencyPlotter, FreqEstimatorPlotter
if __name__ == '__main__':
fig = plt.figure()
ax1 = fig.add_subplot(311)
ax2 = fig.add_subplot(312)
ax3 = fig.add_subplot(313)
# files = [FreqEstimatorPlotter(ax3)]
files = [FreqEstimatorPlotter(ax3), LatencyPlotter(ax2), JittPlotter(ax1)]
# files = {} # fd -> file_name
# for file_name, processor in file_names:
# fd = os.open(file_name, os.O_RDONLY | os.O_NONBLOCK)
# os.lseek(fd, 0, os.SEEK_END)
# residual = b''
# files[fd] = (file_name, residual, processor)
while True:
to_read = select.select(files, [], [])[0]
for fd in to_read:
fd()
plt.pause(0.1)
plt.show()
for fd in files.keys():
os.close(fd)