From ca0958dc5be56e6aebb9d4ccedc51a61a477ea1f Mon Sep 17 00:00:00 2001 From: MiniLab Date: Tue, 31 May 2022 08:43:12 -0400 Subject: [PATCH 1/3] Update runviewer layout for new Lyse Fields --- runmanager/main.ui | 519 +++++++++++++++++++++++++++++---------------- 1 file changed, 331 insertions(+), 188 deletions(-) diff --git a/runmanager/main.ui b/runmanager/main.ui index 3f6f374..efd2c50 100644 --- a/runmanager/main.ui +++ b/runmanager/main.ui @@ -94,7 +94,16 @@ QToolButton:hover:checked { 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -307,17 +316,90 @@ subprocess 6 - - - - <html><head/><body><p>The host computer running BLACS.</p></body></html> + + + + false - - localhost + + QToolButton{ + background: rgb(224,224,224); + padding: 3px; +} - - true + + QFrame::StyledPanel + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + <html><head/><body><p>The folder in which newly compiled shot files will be placed.</p><p>If the folder does not exist, it will be created at compile time.</p></body></html> + + + + + + false + + + true + + + + + + + Select a file ... + + + QToolButton{ + border: none; + background: white; + padding: 2px; +} + +QToolButton:hover { + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #f6f7fa, stop: 1 #dadbde); + } + + QToolButton:pressed { + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #dadbde, stop: 1 #f6f7fa); + } + + + ... + + + + :/qtutils/fugue/folder-open-document-text.png:/qtutils/fugue/folder-open-document-text.png + + + + @@ -327,7 +409,7 @@ subprocess - + false @@ -358,7 +440,7 @@ subprocess - + false @@ -375,82 +457,40 @@ subprocess - - - - - 0 - 0 - - - - - 0 - 0 - - - - QFrame::StyledPanel - - - - 0 - - - 0 - - - - - - 0 - 0 - - - - <html><head/><body><p>The folder in which newly compiled shot files will be placed.</p><p>If the folder does not exist, it will be created at compile time.</p></body></html> - - - - - - false - - - true - - - - - - - <html><head/><body><p>Non-default output folder chosen: all shots will be produced in this folder.</p><p>New folders will not automatically be created for new sequences/dates/etc.</p><p>To reset to the default output folder, click the 'reset to default output folder' button.</p></body></html> - - - - - - :/qtutils/fugue/exclamation-white.png - - - - - - - Qt::Vertical - - - - - - - false - - - Select folder ... - - - QToolButton{ + + + + + + + 0 + 0 + + + + <html><head/><body><p>The folder in which newly compiled shot files will be placed.</p><p>If the folder does not exist, it will be created at compile time.</p></body></html> + + + + + + false + + + true + + + + + + + false + + + Select folder ... + + + QToolButton{ border: none; background: white; padding: 2px; @@ -465,76 +505,52 @@ QToolButton:hover { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #dadbde, stop: 1 #f6f7fa); } - - - ... - - - - :/qtutils/fugue/folder-horizontal-open.png:/qtutils/fugue/folder-horizontal-open.png - - - - - + + + ... + + + + :/qtutils/fugue/folder-horizontal-open.png:/qtutils/fugue/folder-horizontal-open.png + + + + - - - - false - - - QToolButton{ - background: rgb(224,224,224); - padding: 3px; -} - - - QFrame::StyledPanel - - - - 0 - - - 0 - - - - - - 0 - 0 - - - - The labscript file to compile. - - - - - - false - - - true - - - - - - - Qt::Vertical - - - - - - - Select a file ... - - - QToolButton{ + + + + + + + 0 + 0 + + + + <html><head/><body><p>The folder in which newly compiled shot files will be placed.</p><p>If the folder does not exist, it will be created at compile time.</p></body></html> + + + + + + false + + + true + + + + + + + false + + + Select folder ... + + + QToolButton{ border: none; background: white; padding: 2px; @@ -549,19 +565,98 @@ QToolButton:hover { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #dadbde, stop: 1 #f6f7fa); } - - - ... - - - - :/qtutils/fugue/folder-open-document-text.png:/qtutils/fugue/folder-open-document-text.png - - - - + + + ... + + + + :/qtutils/fugue/folder-horizontal-open.png:/qtutils/fugue/folder-horizontal-open.png + + + + + + + + + Lyse hostname + + + + + + + + 0 + 0 + + + + <html><head/><body><p>The folder in which newly compiled shot files will be placed.</p><p>If the folder does not exist, it will be created at compile time.</p></body></html> + + + + + + false + + + true + + + + + + + <html><head/><body><p>Non-default output folder chosen: all shots will be produced in this folder.</p><p>New folders will not automatically be created for new sequences/dates/etc.</p><p>To reset to the default output folder, click the 'reset to default output folder' button.</p></body></html> + + + + + + :/qtutils/fugue/exclamation-white.png + + + + + + + false + + + Select folder ... + + + QToolButton{ + border: none; + background: white; + padding: 2px; +} + +QToolButton:hover { + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #f6f7fa, stop: 1 #dadbde); + } + + QToolButton:pressed { + background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, + stop: 0 #dadbde, stop: 1 #f6f7fa); + } + + + ... + + + + :/qtutils/fugue/folder-horizontal-open.png:/qtutils/fugue/folder-horizontal-open.png + + + + + @@ -620,7 +715,16 @@ QToolButton:hover { 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -643,7 +747,16 @@ QToolButton:hover { 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -754,15 +867,24 @@ QToolButton:hover { 0 0 - 926 - 486 + 942 + 489 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -770,15 +892,15 @@ QToolButton:hover { QAbstractItemView::NoEditTriggers + + true + QAbstractItemView::ExtendedSelection QAbstractItemView::SelectRows - - true - @@ -802,7 +924,16 @@ QToolButton:hover { 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -810,7 +941,16 @@ QToolButton:hover { 9 - + + 3 + + + 3 + + + 3 + + 3 @@ -892,15 +1032,24 @@ QToolButton:hover { 0 0 - 963 - 448 + 971 + 459 0 - + + 0 + + + 0 + + + 0 + + 0 @@ -926,7 +1075,7 @@ QToolButton:hover { 0 0 1000 - 31 + 21 @@ -1023,13 +1172,9 @@ QToolButton:hover { pushButton_abort pushButton_restart_subprocess pushButton_shuffle - lineEdit_labscript_file toolButton_select_labscript_file toolButton_edit_labscript_file - lineEdit_shot_output_folder - toolButton_select_shot_output_folder toolButton_reset_shot_output_folder - lineEdit_BLACS_hostname tabWidget scrollArea toolButton_axis_to_top @@ -1043,8 +1188,6 @@ QToolButton:hover { treeView_groups scrollArea_2 - - - + From 873309a5c6fa4e3c10b853b49aced208b6f7ff4a Mon Sep 17 00:00:00 2001 From: Ian Spielman Date: Tue, 31 May 2022 09:54:22 -0400 Subject: [PATCH 2/3] Revert "Update runviewer layout for new Lyse Fields" This reverts commit ca0958dc5be56e6aebb9d4ccedc51a61a477ea1f. Also adds all changes to store lyse_host into the h5 file. --- runmanager/__main__.py | 20 ++- runmanager/batch_compiler.py | 6 +- runmanager/main.ui | 334 +++++++++++++++-------------------- 3 files changed, 165 insertions(+), 195 deletions(-) diff --git a/runmanager/__main__.py b/runmanager/__main__.py index 0c38710..d0fda88 100644 --- a/runmanager/__main__.py +++ b/runmanager/__main__.py @@ -1793,6 +1793,8 @@ def on_engage_clicked(self): send_to_BLACS = self.ui.checkBox_run_shots.isChecked() send_to_runviewer = self.ui.checkBox_view_shots.isChecked() labscript_file = self.ui.lineEdit_labscript_file.text() + lyse_host = self.ui.lineEdit_Lyse_hostname.text() + # even though we shuffle on a per global basis, if ALL of the globals are set to shuffle, then we may as well shuffle again. This helps shuffle shots more randomly than just shuffling within each level (because without this, you would still do all shots with the outer most variable the same, etc) shuffle = self.ui.pushButton_shuffle.checkState() == QtCore.Qt.Checked if not labscript_file: @@ -1819,7 +1821,7 @@ def on_engage_clicked(self): labscript_file, run_files = self.make_h5_files( labscript_file, output_folder, sequenceglobals, shots, shuffle) self.ui.pushButton_abort.setEnabled(True) - self.compile_queue.put([labscript_file, run_files, send_to_BLACS, BLACS_host, send_to_runviewer]) + self.compile_queue.put([labscript_file, run_files, send_to_BLACS, BLACS_host, send_to_runviewer, lyse_host]) except Exception as e: self.output_box.output('%s\n\n' % str(e), red=True) logger.info('end engage') @@ -3044,9 +3046,12 @@ def get_save_data(self): if is_using_default_shot_output_folder: shot_output_folder = '' - # Get the server hostnames: + # Get the BLACS server hostnames: blacs_host = self.ui.lineEdit_BLACS_hostname.text() + # Get the lyse server hostnames: + lyse_host = self.ui.lineEdit_Lyse_hostname.text() + send_to_runviewer = self.ui.checkBox_view_shots.isChecked() send_to_blacs = self.ui.checkBox_run_shots.isChecked() shuffle = self.ui.pushButton_shuffle.isChecked() @@ -3070,7 +3075,8 @@ def get_save_data(self): 'send_to_blacs': send_to_blacs, 'shuffle': shuffle, 'axes': axes, - 'blacs_host': blacs_host} + 'blacs_host': blacs_host, + 'lyse_host': lyse_host} return save_data def save_configuration(self, save_file): @@ -3205,6 +3211,10 @@ def warning(message): if blacs_host is not None: self.ui.lineEdit_BLACS_hostname.setText(blacs_host) + lyse_host = runmanager_config.get('lyse_host') + if blacs_host is not None: + self.ui.lineEdit_Lyse_hostname.setText(lyse_host) + # Set as self.last_save_data: save_data = self.get_save_data() self.last_save_data = save_data @@ -3214,7 +3224,7 @@ def warning(message): def compile_loop(self): while True: try: - labscript_file, run_files, send_to_BLACS, BLACS_host, send_to_runviewer = self.compile_queue.get() + labscript_file, run_files, send_to_BLACS, BLACS_host, send_to_runviewer, lyse_host = self.compile_queue.get() run_files = iter(run_files) # Should already be in iterator but just in case while True: if self.compilation_aborted.is_set(): @@ -3230,7 +3240,7 @@ def compile_loop(self): self.output_box.output('Ready.\n\n') break else: - self.to_child.put(['compile', [labscript_file, run_file]]) + self.to_child.put(['compile', [labscript_file, run_file, lyse_host]]) signal, success = self.from_child.get() assert signal == 'done' if not success: diff --git a/runmanager/batch_compiler.py b/runmanager/batch_compiler.py index 6c6f438..61b934a 100644 --- a/runmanager/batch_compiler.py +++ b/runmanager/batch_compiler.py @@ -53,7 +53,7 @@ def mainloop(self): else: raise ValueError(signal) - def compile(self, labscript_file, run_file): + def compile(self, labscript_file, run_file, lyse_host): self.script_module.__file__ = labscript_file # Save the current working directory before changing it to the location of the @@ -64,7 +64,9 @@ def compile(self, labscript_file, run_file): try: # Do not let the modulewatcher unload any modules whilst we're working: with kill_lock, module_watcher.lock: - labscript.labscript_init(run_file, labscript_file=labscript_file) + labscript.labscript_init(run_file, + labscript_file=labscript_file, + lyse_host=lyse_host) with open(labscript_file) as f: code = compile( f.read(), self.script_module.__file__, 'exec', dont_inherit=True diff --git a/runmanager/main.ui b/runmanager/main.ui index efd2c50..36ab18d 100644 --- a/runmanager/main.ui +++ b/runmanager/main.ui @@ -316,7 +316,7 @@ subprocess 6 - + false @@ -355,7 +355,7 @@ subprocess - <html><head/><body><p>The folder in which newly compiled shot files will be placed.</p><p>If the folder does not exist, it will be created at compile time.</p></body></html> + The labscript file to compile. @@ -368,6 +368,13 @@ subprocess + + + + Qt::Vertical + + + @@ -402,6 +409,19 @@ QToolButton:hover { + + + + <html><head/><body><p>The host computer running BLACS.</p></body></html> + + + localhost + + + true + + + @@ -409,7 +429,7 @@ QToolButton:hover { - + false @@ -440,7 +460,7 @@ QToolButton:hover { - + false @@ -457,180 +477,98 @@ QToolButton:hover { - - - - - - - 0 - 0 - - - - <html><head/><body><p>The folder in which newly compiled shot files will be placed.</p><p>If the folder does not exist, it will be created at compile time.</p></body></html> - - - - - - false - - - true - - - - - - - false - - - Select folder ... - - - QToolButton{ - border: none; - background: white; - padding: 2px; -} - -QToolButton:hover { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #f6f7fa, stop: 1 #dadbde); - } - - QToolButton:pressed { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #dadbde, stop: 1 #f6f7fa); - } - - - ... - - - - :/qtutils/fugue/folder-horizontal-open.png:/qtutils/fugue/folder-horizontal-open.png - - - - - - - - - - - - 0 - 0 - - - - <html><head/><body><p>The folder in which newly compiled shot files will be placed.</p><p>If the folder does not exist, it will be created at compile time.</p></body></html> - - - - - - false - - - true - - - - - - - false - - - Select folder ... - - - QToolButton{ - border: none; - background: white; - padding: 2px; -} - -QToolButton:hover { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #f6f7fa, stop: 1 #dadbde); - } - - QToolButton:pressed { - background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, - stop: 0 #dadbde, stop: 1 #f6f7fa); - } - - - ... - - - - :/qtutils/fugue/folder-horizontal-open.png:/qtutils/fugue/folder-horizontal-open.png - - - - - - + Lyse hostname - - - - - - - 0 - 0 - - - - <html><head/><body><p>The folder in which newly compiled shot files will be placed.</p><p>If the folder does not exist, it will be created at compile time.</p></body></html> - - - - - - false - - - true - - - - - - - <html><head/><body><p>Non-default output folder chosen: all shots will be produced in this folder.</p><p>New folders will not automatically be created for new sequences/dates/etc.</p><p>To reset to the default output folder, click the 'reset to default output folder' button.</p></body></html> - - - - - - :/qtutils/fugue/exclamation-white.png - - - - - - - false - - - Select folder ... - - - QToolButton{ + + + + + 0 + 0 + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + <html><head/><body><p>The folder in which newly compiled shot files will be placed.</p><p>If the folder does not exist, it will be created at compile time.</p></body></html> + + + + + + false + + + true + + + + + + + <html><head/><body><p>Non-default output folder chosen: all shots will be produced in this folder.</p><p>New folders will not automatically be created for new sequences/dates/etc.</p><p>To reset to the default output folder, click the 'reset to default output folder' button.</p></body></html> + + + + + + :/qtutils/fugue/exclamation-white.png + + + + + + + Qt::Vertical + + + + + + + false + + + Select folder ... + + + QToolButton{ border: none; background: white; padding: 2px; @@ -645,17 +583,31 @@ QToolButton:hover { background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #dadbde, stop: 1 #f6f7fa); } - - - ... - - - - :/qtutils/fugue/folder-horizontal-open.png:/qtutils/fugue/folder-horizontal-open.png - - - - + + + ... + + + + :/qtutils/fugue/folder-horizontal-open.png:/qtutils/fugue/folder-horizontal-open.png + + + + + + + + + + <html><head/><body><p>The host computer running BLACS.</p></body></html> + + + localhost + + + true + + @@ -867,8 +819,8 @@ QToolButton:hover { 0 0 - 942 - 489 + 71 + 71 @@ -1032,8 +984,8 @@ QToolButton:hover { 0 0 - 971 - 459 + 83 + 71 @@ -1172,9 +1124,13 @@ QToolButton:hover { pushButton_abort pushButton_restart_subprocess pushButton_shuffle + lineEdit_labscript_file toolButton_select_labscript_file toolButton_edit_labscript_file + lineEdit_shot_output_folder + toolButton_select_shot_output_folder toolButton_reset_shot_output_folder + lineEdit_BLACS_hostname tabWidget scrollArea toolButton_axis_to_top @@ -1188,6 +1144,8 @@ QToolButton:hover { treeView_groups scrollArea_2 - + + + From 3806125b3733f7d3c0ad502d577a9b64337ca2f8 Mon Sep 17 00:00:00 2001 From: spielman Date: Mon, 14 Jul 2025 11:00:11 -0400 Subject: [PATCH 3/3] Modified so that lyse path is sent as part of the message to Blacs rather than in the h5 file. --- runmanager/__main__.py | 8 +++++--- runmanager/batch_compiler.py | 3 +-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/runmanager/__main__.py b/runmanager/__main__.py index d0fda88..78158f4 100644 --- a/runmanager/__main__.py +++ b/runmanager/__main__.py @@ -3247,7 +3247,7 @@ def compile_loop(self): self.compilation_aborted.set() continue if send_to_BLACS: - self.send_to_BLACS(run_file, BLACS_host) + self.send_to_BLACS(run_file, BLACS_host, lyse_host) if send_to_runviewer: self.send_to_runviewer(run_file) except Exception as e: @@ -3472,12 +3472,14 @@ def make_h5_files(self, labscript_file, output_folder, sequence_globals, shots, logger.debug(run_files) return labscript_file, run_files - def send_to_BLACS(self, run_file, BLACS_hostname): + def send_to_BLACS(self, run_file, BLACS_hostname, lyse_host): port = int(self.exp_config.get('ports', 'BLACS')) agnostic_path = shared_drive.path_to_agnostic(run_file) self.output_box.output('Submitting run file %s.\n' % os.path.basename(run_file)) try: - response = zmq_get(port, BLACS_hostname, data=agnostic_path) + message = {"agnostic_path": agnostic_path, + "lyse_host": lyse_host} + response = zmq_get(port, BLACS_hostname, data=message) if 'added successfully' in response: self.output_box.output(response) else: diff --git a/runmanager/batch_compiler.py b/runmanager/batch_compiler.py index 61b934a..d7fb2f7 100644 --- a/runmanager/batch_compiler.py +++ b/runmanager/batch_compiler.py @@ -65,8 +65,7 @@ def compile(self, labscript_file, run_file, lyse_host): # Do not let the modulewatcher unload any modules whilst we're working: with kill_lock, module_watcher.lock: labscript.labscript_init(run_file, - labscript_file=labscript_file, - lyse_host=lyse_host) + labscript_file=labscript_file) with open(labscript_file) as f: code = compile( f.read(), self.script_module.__file__, 'exec', dont_inherit=True