|
23 | 23 | import errno
|
24 | 24 | import labscript_utils.excepthook
|
25 | 25 |
|
| 26 | +try: |
| 27 | + from labscript_utils import check_version |
| 28 | +except ImportError: |
| 29 | + raise ImportError('Require labscript_utils > 2.1.0') |
| 30 | + |
| 31 | +check_version('labscript_utils', '2.10.0', '3') |
| 32 | +# Splash screen |
| 33 | +from labscript_utils.splash import Splash |
| 34 | +splash = Splash(os.path.join(os.path.dirname(__file__), 'runmanager.svg')) |
| 35 | +splash.show() |
| 36 | + |
| 37 | +splash.update_text('importing standard library modules') |
26 | 38 | import time
|
27 | 39 | import contextlib
|
28 | 40 | import subprocess
|
|
31 | 43 | import ast
|
32 | 44 | import pprint
|
33 | 45 |
|
| 46 | +splash.update_text('importing matplotlib') |
34 | 47 | # Evaluation of globals happens in a thread with the pylab module imported.
|
35 | 48 | # Although we don't care about plotting, importing pylab makes Qt calls. We
|
36 | 49 | # can't have that from a non main thread, so we'll just disable matplotlib's
|
|
42 | 55 | # Quit on ctrl-c
|
43 | 56 | signal.signal(signal.SIGINT, signal.SIG_DFL)
|
44 | 57 |
|
45 |
| -try: |
46 |
| - from labscript_utils import check_version |
47 |
| -except ImportError: |
48 |
| - raise ImportError('Require labscript_utils > 2.1.0') |
49 |
| - |
50 |
| -check_version('labscript_utils', '2', '3') |
| 58 | +splash.update_text('importing Qt') |
51 | 59 | check_version('qtutils', '2.0.0', '3.0.0')
|
| 60 | + |
| 61 | +splash.update_text('importing zprocess') |
52 | 62 | check_version('zprocess', '1.1.5', '3.0')
|
| 63 | + |
| 64 | +splash.update_text('importing pandas') |
53 | 65 | check_version('pandas', '0.13', '2')
|
54 | 66 |
|
55 | 67 | from qtutils.qt import QtCore, QtGui, QtWidgets
|
|
58 | 70 | import zprocess.locking
|
59 | 71 | from zmq import ZMQError
|
60 | 72 |
|
| 73 | +splash.update_text('importing labscript suite modules') |
61 | 74 | from labscript_utils.labconfig import LabConfig, config_prefix
|
62 | 75 | from labscript_utils.setup_logging import setup_logging
|
63 | 76 | import labscript_utils.shared_drive as shared_drive
|
@@ -1237,7 +1250,7 @@ class RunManager(object):
|
1237 | 1250 | GROUPS_DUMMY_ROW_TEXT = '<Click to add group>'
|
1238 | 1251 |
|
1239 | 1252 | def __init__(self):
|
1240 |
| - |
| 1253 | + splash.update_text('loading graphical interface') |
1241 | 1254 | loader = UiLoader()
|
1242 | 1255 | loader.registerCustomWidget(FingerTabWidget)
|
1243 | 1256 | loader.registerCustomWidget(TreeView)
|
@@ -1316,6 +1329,7 @@ def __init__(self):
|
1316 | 1329 | self.compile_queue_thread.daemon = True
|
1317 | 1330 | self.compile_queue_thread.start()
|
1318 | 1331 |
|
| 1332 | + splash.update_text('starting compiler subprocess') |
1319 | 1333 | # Start the compiler subprocess:
|
1320 | 1334 | self.to_child, self.from_child, self.child = zprocess.subprocess_with_queues(
|
1321 | 1335 | 'batch_compiler.py', self.output_box.port)
|
@@ -1353,6 +1367,7 @@ def load_the_config_file():
|
1353 | 1367 | # so that the GUI pops up faster in the meantime
|
1354 | 1368 | self.ui.firstPaint.connect(lambda: QtCore.QTimer.singleShot(50, load_the_config_file))
|
1355 | 1369 |
|
| 1370 | + splash.update_text('done') |
1356 | 1371 | self.ui.show()
|
1357 | 1372 |
|
1358 | 1373 | def setup_config(self):
|
@@ -3384,4 +3399,5 @@ def send_to_runviewer(self, run_file):
|
3384 | 3399 | qapplication = QtWidgets.QApplication(sys.argv)
|
3385 | 3400 | qapplication.setAttribute(QtCore.Qt.AA_DontShowIconsInMenus, False)
|
3386 | 3401 | app = RunManager()
|
| 3402 | + splash.hide() |
3387 | 3403 | sys.exit(qapplication.exec_())
|
0 commit comments