Commit 1fb32ee7 authored by Martin Drechsler's avatar Martin Drechsler

un poco mas prolijo el init del feedfoward

parent 3dc19186
......@@ -101,7 +101,8 @@ class GuiMainWindow(QMainWindow):
self.piezoB397 = anal_control_signal('piezoB397', 7, out_step = 0.01)
self.piezoA866 = anal_control_signal('piezoA866', 14, out_minimum=0, out_maximum=4, out_step=0.01)
self.piezoB866 = anal_control_signal('piezoB866', 6, out_step = 0.01)
self.piezoA423 = anal_control_signal('piezoA423', 1, out_step = 0.01, feedfoward_channel=0)
self.piezoA423 = anal_control_signal('piezoA423', 1, out_step = 0.01, feedfoward=True)
self.piezoA423.set_scan_feedfoward_analog_out(0)
self.trapDCA = anal_control_signal('DC A', 2)
self.trapDCB = anal_control_signal('DC B', 3)
......
......@@ -20,14 +20,15 @@ import scanFunctions
class anal_control_signal(QWidget):
_registry = []
def __init__(self, name, channel, out_minimum = -10, out_maximum = 10, out_step = 0.1, feedfoward_channel = 0):
def __init__(self, name, channel, out_minimum = -10, out_maximum = 10, out_step = 0.1, feedfoward = False):
super().__init__()
self._registry.append(self)
self.name = name
self.ch = channel
self.feedfoward_channel = feedfoward_channel
self.is_feedwoward_enabled = feedfoward
self.initial_value = 0
......@@ -40,8 +41,6 @@ class anal_control_signal(QWidget):
self.sb = pg.SpinBox(value = self.initial_value, bounds=[self.min, self.max], step = self.step, siPrefix = self.siPrefix, suffix = self.suffix)
try:
self.AO = daq_AO(self.ch)
if feedfoward_channel == 0:
self.AO_feedfoward = daq_AO(self.feedfoward_channel)
except:
show_warning('Analog output %i not found. Daq might not be connected' % self.ch)
......@@ -105,7 +104,7 @@ class anal_control_signal(QWidget):
self.scan_step = next(self.scan_array_gen)
self.AO.set_out(self.scan_step)
if self.scan_feedfoward_button.isChecked():
if self.is_feedwoward_enabled and self.scan_feedfoward_button.isChecked():
self.scan_feedfoward_step = next(self.scan_array_feedfoward_gen)
self.AO_feedfoward.set_out(self.scan_feedfoward_step)
......@@ -150,6 +149,7 @@ class anal_control_signal(QWidget):
plt.plot(self.scan_array, label = 'scan')
plt.plot(self.scan_array_feedfoward, label = 'feedfoward')
plt.legend()
plt.xlabel('u.a'), plt.ylabel('Voltaje [V]')
plt.show()
......@@ -169,8 +169,8 @@ class anal_control_signal(QWidget):
def set_scan_feedfoward_analog_out(self, analogOut):
self.scan_feedfoward_analogOut = analogOut
def set_scan_feedfoward_analog_out(self, feedfoward_channel):
self.AO_feedfoward = daq_AO(feedfoward_channel)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment