Commit af8e2b0c authored by Martin Drechsler's avatar Martin Drechsler

scan parameters freeze during scan, othertwise the scan bar doesnt do the job properly

parent 12410442
...@@ -116,26 +116,30 @@ class anal_control_signal(QWidget): ...@@ -116,26 +116,30 @@ class anal_control_signal(QWidget):
self.scan_button.setText('Start scan') self.scan_button.setText('Start scan')
self.scan_button.setStyleSheet('background-color: None') self.scan_button.setStyleSheet('background-color: None')
self.PbarTimer.stop() self.PbarTimer.stop()
self.sb.setValue(self.scan_step)
self.sb.setEnabled(True) self.sb.setEnabled(True)
self.scan_sb_start.setEnabled(True)
self.scan_sb_stop.setEnabled(True)
else: else:
dt = 5.0e-3 dt = 5.0e-3
first_value = float(self.scan_step) first_value = float(self.sb.val)
self.scan_array = scanFunctions.create_scan_array(self.scan_sb_start.val, self.scan_sb_stop.val, self.scan_sb_period.val, first_value,dt) self.scan_array = scanFunctions.create_scan_array(self.scan_sb_start.val, self.scan_sb_stop.val, self.scan_sb_period.val, first_value,dt)
self.scan_array_gen = scanFunctions.yield_scan_array(self.scan_array) self.scan_array_gen = scanFunctions.yield_scan_array(self.scan_array)
if self.scan_step > float(self.scan_sb_stop.val) or self.scan_step < 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'
show_warning('Scan can not start outside scan range and scan start should be lower than scan stop', details_text= details) show_warning('Scan can not start outside scan range and scan start should be lower than scan stop', details_text= details)
elif len(self.scan_array) < 5: elif len(self.scan_array) < 5:
show_warning('%i steps are too few, you need at least 5 steps' % (len(self.scan_array)) ) show_warning('%i steps are too few, you need at least 5 steps' % (len(self.scan_array)) )
else: else:
self.sb.setEnabled(False) self.sb.setEnabled(False)
self.scan_sb_start.setEnabled(False)
self.scan_sb_stop.setEnabled(False)
self.scan_button.setStyleSheet("background-color: green") self.scan_button.setStyleSheet("background-color: green")
self.PbarTimer.start(dt*1e3) self.PbarTimer.start(dt*1e3)
self.ScanTimer.start(dt*1e3) self.ScanTimer.start(dt*1e3)
...@@ -199,10 +203,8 @@ class burleighWM(QWidget): ...@@ -199,10 +203,8 @@ class burleighWM(QWidget):
wavemeter_ok = False wavemeter_ok = False
try: try:
tn = telnetlib.Telnet(host = "wannanosaurus", port = 1234, timeout = 1) tn = telnetlib.Telnet(host = "wannanosaurus", port = 1234, timeout = 1)
if tn.sock_avail():
wavemeter_ok = True wavemeter_ok = True
else:
show_warning('Wannanosaurus seems connected but WM might be off.')
except: except:
show_warning('Wannanosaurus not connected') show_warning('Wannanosaurus not connected')
......
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