Commit c5d39b95 authored by Martin Drechsler's avatar Martin Drechsler

small changes in the printing of analog outputs pinouts

parent a3e8a24a
...@@ -132,7 +132,7 @@ class GuiMainWindow(QMainWindow): ...@@ -132,7 +132,7 @@ class GuiMainWindow(QMainWindow):
self.toolbar = myToolbarMenu(self.win, anal_control_signal._registry ) self.toolbar = myToolbarMenu(self.win, anal_control_signal._registry )
self.toolbar.load(anal_control_signal._registry) self.toolbar.load(anal_control_signal._registry)
print('Defined analog outputs: \n', self.toolbar.aosDicc.keys()) #print('Defined analog outputs: \n', self.toolbar.aosDicc.keys())
self.autosave_timer = QTimer() self.autosave_timer = QTimer()
self.autosave_timer.timeout.connect(lambda: self.toolbar.save(anal_control_signal._registry)) self.autosave_timer.timeout.connect(lambda: self.toolbar.save(anal_control_signal._registry))
...@@ -142,6 +142,11 @@ class GuiMainWindow(QMainWindow): ...@@ -142,6 +142,11 @@ class GuiMainWindow(QMainWindow):
#here I connect the spinboxes to the daq analog outputs: #here I connect the spinboxes to the daq analog outputs:
for ao in anal_control_signal._registry: for ao in anal_control_signal._registry:
ao.connectSpinBoxesToDaq() ao.connectSpinBoxesToDaq()
print('Analog control pinout:')
for ao in anal_control_signal._registry:
print(ao.name + ' -> ' + 'ao' + str(ao.ch))
############################################################################### ###############################################################################
......
...@@ -6,7 +6,7 @@ Created on Wed Feb 6 13:07:39 2019 ...@@ -6,7 +6,7 @@ Created on Wed Feb 6 13:07:39 2019
""" """
#import serial #import serial
#import time import time
# #
#wavCoh=serial.Serial('COM10', timeout=1, rtscts=True) #wavCoh=serial.Serial('COM10', timeout=1, rtscts=True)
#wavCoh.close() #wavCoh.close()
...@@ -23,6 +23,21 @@ def read_measurement(wm): ...@@ -23,6 +23,21 @@ def read_measurement(wm):
return a return a
def read_measurement_forever(wm):
with wm as w:
while(True):
w.write(b'VAL?\n')
#time.sleep(0.2)
a = w.readline().decode("utf-8")
try:
a = a.split(',')[1]
a = a.split('\r')[0]
print(a)
except:
print("wrong value read")
time.sleep(1)
def set_unit(wm, unit): def set_unit(wm, unit):
""" """
...@@ -65,6 +80,9 @@ if __name__ == '__main__': ...@@ -65,6 +80,9 @@ if __name__ == '__main__':
while(1): while(1):
print(read_measurement(wavCoh)) print(read_measurement(wavCoh))
time.sleep(0.5) time.sleep(0.5)
read_measurement_forever(wavCoh)
# print(a[12:20]) # print(a[12:20])
# check_unit(wavCoh) # check_unit(wavCoh)
# import os # import os
......
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