qdsfit/data/data.py

21 lines
684 B
Python

from PyQt4.QtCore import QObject, pyqtSignal
__author__ = 'markusro'
class Daten(QObject):
data_changed_signal = pyqtSignal(list, list, list)
def __init__(self, x=None, y_real=None, y_imag=None):
super(Daten, self).__init__()
self._data = (x, y_real, y_imag)
def get_data(self):
return self._data
def set_data(self, x, y_real, y_imag):
if len(x) == len(y_real) == len(y_imag):
self._data = (x, y_real, y_imag)
self.data_changed_signal.emit(list(x), list(y_real), list(y_imag))
else:
raise AttributeError("Inhomogeneous data size x,real,imag: %i,%i,%i"(len(x), len(y_real), len(y_imag)))