Example #1
0
 def __init__(self, info: pylsl.StreamInfo, plt: pg.PlotItem):
     super().__init__(info)
     # calculate the size for our buffer, i.e. two times the displayed data
     bufsize = (2 * math.ceil(info.nominal_srate() * plot_duration), info.channel_count())
     self.buffer = np.empty(bufsize, dtype=self.dtypes[info.channel_format()])
     empty = np.array([])
     # create one curve object for each channel/line that will handle displaying the data
     self.curves = [pg.PlotCurveItem(x=empty, y=empty, autoDownsample=True) for _ in range(self.channel_count)]
     for curve in self.curves:
         plt.addItem(curve)