From 07644f03486e4812ac85839b5eaba9f8bbbf890a Mon Sep 17 00:00:00 2001 From: tassaron Date: Mon, 22 May 2017 19:42:32 -0400 Subject: text and visualization colour can be changed using commandline --- preview_thread.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'preview_thread.py') diff --git a/preview_thread.py b/preview_thread.py index 5bad653..041d39e 100644 --- a/preview_thread.py +++ b/preview_thread.py @@ -19,8 +19,9 @@ class Worker(QtCore.QObject): self.queue = queue - @pyqtSlot(str, str, QtGui.QFont, int, int, int, int) - def createPreviewImage(self, backgroundImage, titleText, titleFont, fontSize, alignment, xOffset, yOffset): + @pyqtSlot(str, str, QtGui.QFont, int, int, int, int, tuple, tuple) + def createPreviewImage(self, backgroundImage, titleText, titleFont, fontSize,\ + alignment, xOffset, yOffset, textColor, visColor): # print('worker thread id: {}'.format(QtCore.QThread.currentThreadId())) dic = { "backgroundImage": backgroundImage, @@ -29,7 +30,9 @@ class Worker(QtCore.QObject): "fontSize": fontSize, "alignment": alignment, "xoffset": xOffset, - "yoffset": yOffset + "yoffset": yOffset, + "textColor" : textColor, + "visColor" : visColor } self.queue.put(dic) @@ -59,11 +62,12 @@ class Worker(QtCore.QObject): nextPreviewInformation["fontSize"], nextPreviewInformation["alignment"], nextPreviewInformation["xoffset"], - nextPreviewInformation["yoffset"]) - + nextPreviewInformation["yoffset"], + nextPreviewInformation["textColor"], + nextPreviewInformation["visColor"]) spectrum = numpy.fromfunction(lambda x: 0.008*(x-128)**2, (255,), dtype="int16") - im = self.core.drawBars(spectrum, im) + im = self.core.drawBars(spectrum, im, nextPreviewInformation["visColor"]) self._image = ImageQt(im) self._previewImage = QtGui.QImage(self._image) -- cgit v1.2.3