Skip to content

Commit

Permalink
Plotting is now done in a thread
Browse files Browse the repository at this point in the history
  • Loading branch information
02bwilson committed Aug 4, 2023
1 parent b6721ae commit f638faa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Widgets/AbstractPlot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import threading

import pyqtgraph as pg
from PyQt6.QtWidgets import QGridLayout, QWidget

Expand All @@ -18,5 +20,10 @@ def __init__(self):

self.setLayout(self.mainGridLayout)

def requestPlot(self, xData, yData):
plotThrd = threading.Thread(target=self.plot, args=(xData, yData))
plotThrd.start()

def plot(self, xData, yData):
self.plotLine.setData(yData, xData)

0 comments on commit f638faa

Please sign in to comment.