|
@@ -19,7 +19,6 @@ import storage
|
|
|
import config
|
|
|
import kcgwidget as kcgw
|
|
|
# import widgets.timingWidget as tw
|
|
|
-import widgets.acquiresettings as acqs
|
|
|
|
|
|
class DummyStorage():
|
|
|
def __init__(self):
|
|
@@ -214,13 +213,16 @@ class _bif_ProgressBar(QtGui.QProgressBar):
|
|
|
kcgw.statusbar.insertWidget(1, self)
|
|
|
self.setValue(0)
|
|
|
QtGui.qApp.processEvents()
|
|
|
- def remove(self, timeout):
|
|
|
+ def remove(self, timeout=None):
|
|
|
def remove_progressbar():
|
|
|
kcgw.statusbar.removeWidget(self)
|
|
|
kcgw.statusbar.removeWidget(self.label)
|
|
|
kcgw.statusbar.showMessage(board.status.status_text)
|
|
|
self.destroy()
|
|
|
- QtCore.QTimer.singleShot(timeout, remove_progressbar)
|
|
|
+ if timeout:
|
|
|
+ QtCore.QTimer.singleShot(timeout, remove_progressbar)
|
|
|
+ else:
|
|
|
+ remove_progressbar()
|
|
|
|
|
|
|
|
|
def bk_calibrate(self): # TODO: Wie zeitkritisch ist dies, setValue braucht sicher etwas zeit
|
|
@@ -304,7 +306,7 @@ def bk_calibrate(self): # TODO: Wie zeitkritisch ist dies, setValue braucht sich
|
|
|
time.sleep(0.5)
|
|
|
progressbar.setValue(15)
|
|
|
|
|
|
- progressbar.remove(1000)
|
|
|
+ progressbar.remove(100)
|
|
|
board.status.calibrated = True
|
|
|
|
|
|
except board.BoardError as e:
|
|
@@ -335,7 +337,7 @@ def bk_sync_board():
|
|
|
progressbar.setValue(i)
|
|
|
logging.info("Done!")
|
|
|
board.write_pci('0x0003f0', '0x9040')
|
|
|
- progressbar.remove(1000)
|
|
|
+ progressbar.remove(100)
|
|
|
except board.BoardError as e:
|
|
|
logging.error("Synchronization failed: {}".format(str(e)))
|
|
|
_bif_disable_wait_cursor()
|
|
@@ -408,7 +410,7 @@ def bk_set_defaults(self):
|
|
|
board.write_pci('{0:08x}'.format(board.config.get('orbits_skip')), '0x9028')
|
|
|
# acqs.setValueSilent('orbits_skip', board.config.get('orbits_skip'))
|
|
|
board.status.defaults_set = True
|
|
|
- progressbar.remove(1000)
|
|
|
+ progressbar.remove(100)
|
|
|
|
|
|
except board.BoardError as e:
|
|
|
logging.error("Setting defaults failed: {}".format(str(e)))
|
|
@@ -626,7 +628,7 @@ def bk_acquire():
|
|
|
|
|
|
def _bif_stop_acquisition():
|
|
|
board.status.acquisition = False
|
|
|
- board.acquisition_progressbar.remove(1000)
|
|
|
+ board.acquisition_progressbar.remove(100)
|
|
|
board.acquisition_timer.stop()
|
|
|
for elem in Elements.getElements("acquireTrigger"):
|
|
|
elem.setIcon(QtGui.QIcon(config.startIcon))
|
|
@@ -668,7 +670,7 @@ def _bif_start_acquisition():
|
|
|
_bif_iterate_spectrograms(spectrogram_dir) # TODO: not here ?
|
|
|
else:
|
|
|
_bif_stop_acquisition() # TODO: stop_acquisition
|
|
|
- acquisition_progressbar.remove(5000)
|
|
|
+ acquisition_progressbar.remove(100)
|
|
|
|
|
|
board.acquisition_timer.timeout.connect(on_timeout)
|
|
|
board.acquisition_timer.start(board.config.get('orbits_wait_time') * 1000)
|