qdsfit/data/data.py

21 lines
684 B
Python
Raw Normal View History

2015-01-08 12:18:45 +00:00
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):
2015-01-08 15:47:13 +00:00
super(Daten, self).__init__()
2015-01-08 12:18:45 +00:00
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)))