From 0a1c9a4d3cc6b6f814fe36019b501fb1c816e57f Mon Sep 17 00:00:00 2001 From: "Eugeniy E. Mikhailov" Date: Mon, 14 Jun 2021 22:06:50 -0400 Subject: added image export --- eitControl.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'eitControl.py') diff --git a/eitControl.py b/eitControl.py index 0ea26a7..84864ae 100644 --- a/eitControl.py +++ b/eitControl.py @@ -1,6 +1,7 @@ from pyqtgraph.Qt import QtGui, QtCore import pyqtgraph as pg from pyqtgraph.dockarea import * +from pyqtgraph.exporters import ImageExporter import platform import argparse @@ -121,6 +122,14 @@ class Experiment: except IOError: print('I/O error') + try: + ex = ImageExporter(self.channelGraph['adc0']) + ex.parameters()['width'] = 800 + ex.parameters()['height'] = 600 + ex.export("snapshot.png") + except ZeroDivisionError: + print("Early version (0.10.0) of PyQtGraph has bug in exporter. The image file is not generated.") + def onTic(self,swp=None): start = datetime.now() if swp is None: -- cgit v1.2.3