diff --git a/Gui/GUIutils/guiUtils.py b/Gui/GUIutils/guiUtils.py index 01073410..5562efc2 100644 --- a/Gui/GUIutils/guiUtils.py +++ b/Gui/GUIutils/guiUtils.py @@ -79,6 +79,8 @@ def iter_except(function, exception): def ConfigureTest(Test, Module_ID, Output_Dir, Input_Dir): if not Output_Dir: + if 'xtalk' in Test: + Test = 'OpenBumpTest' test_dir = os.environ.get("DATA_dir") + "/Test_" + str(Test) if not os.path.isdir(test_dir): try: diff --git a/Gui/python/TestHandler.py b/Gui/python/TestHandler.py index e815d2ad..69f830f1 100644 --- a/Gui/python/TestHandler.py +++ b/Gui/python/TestHandler.py @@ -64,7 +64,7 @@ import Gui.siteSettings as site_settings from Gui.python.logging_config import get_logger from Gui.python.CustomizedWidget import chip_iref_db -from InnerTrackerTests.TestSequences import CompositeTests_Modules, Test_to_Ph2ACF_Map +from InnerTrackerTests.TestSequences import CompositeTests_Modules, Test_to_Ph2ACF_Map, OpenBumpTest from Gui.siteSettings import icicle_instrument_setup @@ -313,6 +313,9 @@ def __init__(self, runwindow, master, info, firmware, txt_files={}): self.powergroup = None for group_key, group in self.instruments.powering_groups.items(): self.powergroup = group + + self._openBumpTest_running = False + self._openBumpTest_subtest_index = 0 def finished_run_process(self, _, exitStatus, i): logger.info("Inside finsihed_run_process") @@ -530,12 +533,14 @@ def runCompositeTest(self, testName): if self.halt: return runTestList = self.test_list - + + logger.debug("Past the Openbump test conditional block") if self.testIndexTracker == len(self.test_list): logger.debug("Reset testIndexTracker") # self.testIndexTracker = 0 # self.testsAttempted = 0 return + testName = runTestList[self.testIndexTracker] if self.testIndexTracker + 1 < len( runTestList @@ -543,6 +548,11 @@ def runCompositeTest(self, testName): nextTest = runTestList[self.testIndexTracker + 1] else: nextTest = None + logger.info("The testName is: %s", testName) + if testName == "OpenBumpTest": + logger.debug("Running OpenBumpTest") + self.runOpenBumpTest() + return self.runSingleTest(testName, nextTest) def ramp_progress_bar(self, max): @@ -556,6 +566,13 @@ def ramp_progress_bar(self, max): value = 100 * np.abs(voltages[i] / max[i]) if max[i] != 0 else 0 self.updateProgressBar.emit(bar, value, text) + def runOpenBumpTest(self): + self._openBumpTest_running = True + self._openBumpTest_subtest_index = 0 + subtest = OpenBumpTest[self._openBumpTest_subtest_index] + logger.info(f"Running OpenBumpTest subtest: {subtest}") + self.currentTest = subtest + self.runSingleTest(subtest) def runADC(self): if "adc_board" in self.instruments._instrument_dict.keys(): @@ -1938,6 +1955,8 @@ def on_finish(self, processIndex: int): logger.warning("Process would not terminate, so killing it now...") self.run_processes[processIndex].kill() + + if "IVCurve" in self.currentTest: self.saveTest(processIndex, self.run_processes[processIndex]) return @@ -1949,6 +1968,22 @@ def on_finish(self, processIndex: int): self.saveConfigs(process_index=processIndex) # Don't continue on sequence until all processes have finished the current test + if self._openBumpTest_running: + self._openBumpTest_subtest_index += 1 + if self._openBumpTest_subtest_index < len(OpenBumpTest): + subtest = OpenBumpTest[self._openBumpTest_subtest_index] + logger.info(f"Running next OpenBumpTest subtest: {subtest}") + self.currentTest = subtest + self.input_dir = self.output_dir # Chain the output of the last test as input for the next + #self.output_dir = "" # Reset output directory to force creation of a new one + self.runSingleTest(subtest) + return # Skip normal finish routine + else: + # Finished all subtests + self.currentTest = "OpenBumpTest" + logger.info("All OpenBumpTest subtests finished. Validating...") + print(f"Current openbumptest subtest index = {self._openBumpTest_subtest_index}") + self._openBumpTest_running = False # Ensure that all processes have finished before continuing self.finished_processes += 1 diff --git a/Gui/python/TestValidator.py b/Gui/python/TestValidator.py index 18a9cc15..5f474bef 100644 --- a/Gui/python/TestValidator.py +++ b/Gui/python/TestValidator.py @@ -160,14 +160,6 @@ def ResultGrader( ) else: - if testName in ( - "PixelAlive_highcharge_xtalk", - "PixelAlive_coupled_xtalk", - "PixelAlive_uncoupled_xtalk", - ): - BBanalysis_root_files.extend( - outputDir + "/" + os.fsdecode(file) for file in os.listdir(outputDir) if file.endswith(".root") - ) # Note: This may be useful # chip_canvas_path_template = "Detector/Board_{boardID}/OpticalGroup_{ogID}/Hybrid_{hybridID}/Chip_{chipID:02d}" @@ -181,12 +173,13 @@ def ResultGrader( #relevant_files = [ # outputDir + "/" + os.fsdecode(file) for file in os.listdir(outputDir) #] + relevant_files = [ outputDir + "/" + os.fsdecode(file) for file in os.listdir(outputDir) if module_name in file or file.endswith(".xml") ] dqmpattern = re.compile(rf"_Hybrid_{module_hybridID}\.root$") relevant_files.extend([outputDir + "/" + os.fsdecode(file) for file in os.listdir(outputDir) if dqmpattern.search(file)]) - + #relevant_files.extend([outputDir + "/" + os.fsdecode(file) for file in os.listdir(outputDir) if file.endswith(".root")]) logger.debug(f"{relevant_files=}") _1, _2 = felis.set_module( module_name,