Commit cb4fcddb authored by Martin Drechsler's avatar Martin Drechsler

small changes. Now it loads every time it starts

parent 149c417c
...@@ -129,6 +129,7 @@ class GuiMainWindow(QMainWindow): ...@@ -129,6 +129,7 @@ class GuiMainWindow(QMainWindow):
#############Toolbar and initial loading of config ############################ #############Toolbar and initial loading of config ############################
toolbar = myToolbarMenu(self.win, anal_control_signal._registry ) toolbar = myToolbarMenu(self.win, anal_control_signal._registry )
toolbar.load(anal_control_signal._registry)
print('Defined analog outputs: \n', toolbar.aosDicc.keys()) print('Defined analog outputs: \n', toolbar.aosDicc.keys())
############################################################################### ###############################################################################
#here I connect the spinboxes to the daq analog outputs: #here I connect the spinboxes to the daq analog outputs:
......
...@@ -145,14 +145,14 @@ class anal_control_signal(QWidget): ...@@ -145,14 +145,14 @@ class anal_control_signal(QWidget):
normalized=True, normalization_constant = float(self.scan_feedfoward_sb.val) ) normalized=True, normalization_constant = float(self.scan_feedfoward_sb.val) )
self.scan_array_feedfoward_gen = scanFunctions.yield_scan_array(self.scan_array_feedfoward) self.scan_array_feedfoward_gen = scanFunctions.yield_scan_array(self.scan_array_feedfoward)
import pylab as plt # import pylab as plt
plt.figure() # plt.figure()
plt.plot(self.scan_array, label = 'scan') # plt.plot(self.scan_array, label = 'scan')
plt.plot(self.scan_array_feedfoward, label = 'feedfoward') # plt.plot(self.scan_array_feedfoward, label = 'feedfoward')
plt.legend() # plt.legend()
plt.xlabel('u.a'), plt.ylabel('Voltaje [V]') # plt.xlabel('u.a'), plt.ylabel('Voltaje [V]')
plt.show() # plt.show()
#
if first_value > float(self.scan_sb_stop.val) or first_value < float(self.scan_sb_start.val): if first_value > float(self.scan_sb_stop.val) or first_value < float(self.scan_sb_start.val):
details = 'Remember remember the fifth of November.' + '\n' + 'Also remember that scan starts from the value of the corresponding spin box' details = 'Remember remember the fifth of November.' + '\n' + 'Also remember that scan starts from the value of the corresponding spin box'
...@@ -273,7 +273,11 @@ class coherentWM(QWidget): ...@@ -273,7 +273,11 @@ class coherentWM(QWidget):
try: try:
wavCoh= serial.Serial('COM11', timeout=1, rtscts=True) wavCoh= serial.Serial('COM11', timeout=1, rtscts=True)
wavCoh.close() wavCoh.close()
wav_coherent.read_measurement(wavCoh)
wavemeter_ok = True wavemeter_ok = True
print('coherent wavemeter connected')
except: except:
show_warning('Coherent wavemeter not connected') show_warning('Coherent wavemeter not connected')
...@@ -284,7 +288,7 @@ class coherentWM(QWidget): ...@@ -284,7 +288,7 @@ class coherentWM(QWidget):
lcd = QLCDNumber() lcd = QLCDNumber()
lcd.setDigitCount(10) lcd.setDigitCount(11)
lcd.display("00000000 0") lcd.display("00000000 0")
wav_coherent.set_unit(wavCoh, b'F') wav_coherent.set_unit(wavCoh, b'F')
......
...@@ -18,8 +18,10 @@ def read_measurement(wm): ...@@ -18,8 +18,10 @@ def read_measurement(wm):
w.write(b'VAL?\n') w.write(b'VAL?\n')
#time.sleep(0.2) #time.sleep(0.2)
a = w.readline().decode("utf-8") a = w.readline().decode("utf-8")
a = a.split(',')[1]
a = a.split('\r')[0]
return a[12:20] return a
def set_unit(wm, unit): def set_unit(wm, unit):
...@@ -53,7 +55,7 @@ if __name__ == '__main__': ...@@ -53,7 +55,7 @@ if __name__ == '__main__':
wavCoh=serial.Serial('COM11', timeout=1, rtscts=True) wavCoh=serial.Serial('COM11', timeout=1, rtscts=True)
wavCoh.close() wavCoh.close()
set_unit(wavCoh, b'V') set_unit(wavCoh, b'F')
print(read_measurement(wavCoh)) print(read_measurement(wavCoh))
......
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