Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 31 additions & 34 deletions Gui/GUIutils/guiUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,18 @@ def isActive(dbconnection):

def SetupXMLConfig(Input_Dir, Output_Dir, BeBoardName=""):
try:
os.system(
"cp {0}/CMSIT_{2}.xml {1}/CMSIT_2.xml".format(
Input_Dir, Output_Dir, BeBoardName
)
)
shutil.copyfile("{0}/CMSIT_{1}.xml".formgitat(Input_Dir, BeBoardName),
"{1}/CMSIT_2.xml".format(Output_Dir))


except OSError as e:
logger.error(f"Failed to copy XML file: {e}")
logger.error(traceback.format_exc())
try:
os.system(
"cp {0}/CMSIT_{2}.xml {1}/test/CMSIT_{2}.xml".format(
Output_Dir, os.environ.get("PH2ACF_BASE_DIR"), BeBoardName
)
)
shutil.copyfile( "{0}/CMSIT_{1}.xml".format(Output_Dir, BeBoardName),
"{0}/test/CMSIT_{1}.xml".format(os.environ.get("PH2ACF_BASE_DIR"), BeBoardName)
)

logger.info("Copied XML file to test directory")
except OSError as e:
logger.error(f"Failed to copy XML file to test directory: {e}")
Expand Down Expand Up @@ -274,18 +272,19 @@ def SetupXMLConfigfromFile(InputFile, Output_Dir, BeBoardName=""):
logger.error(traceback.format_exc())

try:
os.system("cp {0} {1}/CMSIT_{2}.xml".format(InputFile, Output_Dir, BeBoardName)) # FIXME
shutil.copyfile(InputFile,
os.path.join(Output_Dir, f"CMSIT_{BeBoardName}.xml"))

except OSError:
print("Can not copy the XML files {0} to {1}".format(InputFile, Output_Dir))
print(traceback.format_exc())
try:
os.system(
"cp {0}/CMSIT_{1}.xml {2}/test/CMSIT_{1}.xml".format(
Output_Dir, BeBoardName, os.environ.get("PH2ACF_BASE_DIR")
shutil.copyfile("{0}/CMSIT_{1}.xml".format(Output_Dir, BeBoardName),
"{0}/test/CMSIT_{1}.xml".format(os.environ.get("PH2ACF_BASE_DIR"), BeBoardName)
)
)
except OSError:
print(
logger.error(
"Can not copy {0}/CMSIT_{1}.xml to {2}/test/CMSIT_{1}.xml".format(
Output_Dir, BeBoardName, os.environ.get("PH2ACF_BASE_DIR")
)
Expand All @@ -302,24 +301,24 @@ def SetupRD53Config(Input_Dir, Output_Dir, RD53Dict):
try:
print("Doing the copy thing in guiUtils")
shutil.copyfile(
"{0}/CMSIT_RD53_{1}_OUT.txt".format(Input_Dir, key),
"{0}/CMSIT_RD53_{1}_IN.txt".format(Output_Dir, key),
"{0}/CMSIT_RD53_{1}_OUT.txt".format(Input_Dir, key),
"{0}/CMSIT_RD53_{1}_IN.txt".format(Output_Dir, key)
)
except OSError:
print(
logger.error(
"Can not copy the RD53 configuration files to {0} for RD53 ID: {1}".format(
Output_Dir, key
)
)
print(traceback.format_exc())
try:
os.system(
"cp {0}/CMSIT_RD53_{1}_IN.txt {2}/test/CMSIT_RD53_{1}.txt".format(
Output_Dir, key, os.environ.get("PH2ACF_BASE_DIR")
shutil.copyfile(
"{0}/CMSIT_RD53_{1}_IN.txt".format(Output_Dir, key),
"{1}/test/CMSIT_RD53_{0}.txt".format(key, os.environ.get("PH2ACF_BASE_DIR")
)
)
except OSError:
print(
logger.error(
"Can not copy {0}/CMSIT_RD53_{1}_IN.txt to {2}/test/CMSIT_RD53_{1}.txt".format(
Output_Dir, key, os.environ.get("PH2ACF_BASE_DIR")
)
Expand All @@ -334,26 +333,24 @@ def SetupRD53Config(Input_Dir, Output_Dir, RD53Dict):
def SetupRD53ConfigfromFile(InputFileDict, Output_Dir):
for key in InputFileDict.keys():
try:
os.system(
"cp {0} {1}/CMSIT_RD53_{2}_IN.txt".format(
InputFileDict[key], Output_Dir, key
)
shutil.copyfile(
InputFileDict[key],
"{0}/CMSIT_RD53_{1}_IN.txt".format(Output_Dir, key)
)
except OSError:
print(
logger.error(
"Can not copy the XML files {0} to {1}".format(
InputFileDict[key], Output_Dir
)
)
print(traceback.format_exc())
try:
os.system(
"cp {0}/CMSIT_RD53_{1}_IN.txt {2}/test/CMSIT_RD53_{1}.txt".format(
Output_Dir, key, os.environ.get("PH2ACF_BASE_DIR")
)
)
shutil.copyfile(
os.path.join(Output_Dir, f"CMSIT_RD53_{key}_IN.txt"),
os.path.join(os.environ.get("PH2ACF_BASE_DIR"), "test", f"CMSIT_RD53_{key}.txt")
)
except OSError:
print(
logger.error(
"Can not copy {0}/CMSIT_RD53_{1}_IN.txt to {2}/test/CMSIT_RD53.txt".format(
Output_Dir, key, os.environ.get("PH2ACF_BASE_DIR")
)
Expand Down
7 changes: 4 additions & 3 deletions Gui/QtGUIutils/QtApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
from Gui.python.logging_config import get_logger
logger = get_logger(__name__)


class QtApplication(QWidget):
globalStop = pyqtSignal()
errorMessageBoxSignal = pyqtSignal(str)
Expand Down Expand Up @@ -589,7 +588,7 @@ def createMain(self):
if not site_settings.manual_powersupply_control:
HVDevices = []
for device_name, device in site_settings.icicle_instrument_setup[
"instrument_dict"
'instrument_dict'
].items():
if "hv" in device_name:
HVDevices.append(device)
Expand Down Expand Up @@ -976,7 +975,8 @@ def connect_devices(self):
if self.expertMode:
if not self.default_checkbox.isChecked():
for key, value in self.connected_device_information.items():
self.device_settings[key] = value
self.device_settings[key] = value

try:
try:
self.instruments = InstrumentCluster(**self.device_settings)
Expand Down Expand Up @@ -1023,6 +1023,7 @@ def connect_devices(self):
self.ArduinoGroup.setBaudRate(site_settings.defaultSensorBaudRate)
self.ArduinoGroup.setArduinoPanel()


def disable_instrument_widgets(self):
"""
Use to disable the groupbox of LV, HV, relay board, and multimeter
Expand Down
2 changes: 1 addition & 1 deletion Gui/QtGUIutils/QtStartWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
from Gui.GUIutils.settings import firmware_image, ModuleLaneMap
from Gui.siteSettings import (
FC7List,
json_setup,
ModuleCurrentMap,
icicle_instrument_setup,
WorkingChannels,
json_setup,
cooler
)
from icicle.icicle.instrument_cluster import DummyInstrument
Expand Down
6 changes: 6 additions & 0 deletions Gui/jsonFiles/instruments_osu_adcboardsldo.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,11 @@
"lv": {"instrument":"lv_1", "channel":1},
"hv": {"instrument":"hv", "channel":1}
}
},

"fc7_address_dict":{
"fc7.board.1" : "192.168.1.80",
"fc7.board.2" : "192.168.1.81",
"fc7.board.3" : "192.168.1.82"
}
}
8 changes: 7 additions & 1 deletion Gui/jsonFiles/instruments_osu_auto.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,11 @@
"hb": {"instrument":"hb", "channel":8},
"hv": {"instrument":"hv", "channel":1}
}
},

"fc7_address_dict":{
"fc7.board.1" : "192.168.1.80",
"fc7.board.2" : "192.168.1.81",
"fc7.board.3" : "192.168.1.82"
}
}
}
63 changes: 41 additions & 22 deletions Gui/python/TestHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1323,12 +1323,13 @@
# When using multiple FC7s root files will get overwritten so need to attach
# what fc7 the test was run on to file name
fc7_in_use: str = base_dir.split("/")[-1].replace(".", "_")

for file in matching_files:
file_name: str = file.split("/")[-1]
logger.debug(
f"Copying {file} to {output_dir}/{fc7_in_use}_{file_name}"
)
os.system(f"cp {file} {output_dir}/{fc7_in_use}_{file_name}")
shutil.copyfile(file, f"{output_dir}/{fc7_in_use}_{file_name}")

def saveTest(self, processIndex: int, process: QProcess):
logger.debug("Inside saveTest")
Expand All @@ -1350,39 +1351,57 @@
)
)

if self.RunNumber == "-1":
os.system(
"cp {0}/test/Results/Run000000*.root {1}/".format(
if self.RunNumber == "-1":
dest_dir = os.path.join(self.output_dir,
self.firmware[processIndex].getBoardname()
)

for file_path in glob.glob(
os.path.join(
os.environ.get("PH2ACF_BASE_DIR"),
os.path.join(
self.output_dir, self.firmware[processIndex].getBoardName()
),
"test",
"Results",
"Run000000*.root"
)
)
):
try:
shutil.copy(file_path, dest_dir)
except (shutil.Error, IOError) as e:
logger.error(f"Error copying {file_path}: {e}")


elif "IVCurve" in self.currentTest:
print("copying MonitorDQM.root file to output directory")

current_fc7: str = self.firmware[processIndex].getBoardName()
os.system(
"cp {0}/test/Results/Run{1}_MonitorDQM_Board_{2}*.root {3}/".format(
os.environ.get("PH2ACF_BASE_DIR"),
self.RunNumber,
self.firmware[processIndex].getBoardID(),
os.path.join(
self.output_dir, current_fc7
),
)
)
os.system(
"cp {0}/test/Results/Run{1}_CMSIT_{2}.xml {3}/".format(

for file_path in glob.glob(
os.path.join(
os.environ.get("PH2ACF_BASE_DIR"),
"test",
"Results",
"Run{0}_MonitorDQM_Board_{1}*.root".format(
self.RunNumber, self.firmware[processIndex].getBoardID()))
):
shutil.copyfile(
file_path,
os.path.join(
self.output_dir,
current_fc7,
os.path.basename(file_path)
)
)

shutil.copyfile(
"{0}/test/Results/Run{1}_CMSIT_{2}.xml".format(os.environ.get("PH2ACF_BASE_DIR"),
self.RunNumber,
current_fc7,
current_fc7),
os.path.join(
self.output_dir, current_fc7
),
)
)

)

Check failure on line 1404 in Gui/python/TestHandler.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

Gui/python/TestHandler.py:1404:17: invalid-syntax: Expected a statement

Check failure on line 1404 in Gui/python/TestHandler.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

Gui/python/TestHandler.py:1404:17: invalid-syntax: Expected a statement
elif "IREF_GADC" in self.currentTest:

Check failure on line 1405 in Gui/python/TestHandler.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

Gui/python/TestHandler.py:1404:18: invalid-syntax: Expected a statement

Check failure on line 1405 in Gui/python/TestHandler.py

View workflow job for this annotation

GitHub Actions / ruff

Ruff (invalid-syntax)

Gui/python/TestHandler.py:1404:18: invalid-syntax: Expected a statement
print("copying MonitorDQM.root file to output directory")
current_fc7: str = self.firmware[processIndex].getBoardName()
Expand Down
3 changes: 2 additions & 1 deletion Gui/python/TestValidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def ResultGrader(
f"{testIndexInSequence:02d}_{testName}",
"sldo",
)

elif "Trimbit" in testName:
relevant_files = [
outputDir + "/" + os.fsdecode(file) for file in os.listdir(outputDir)
Expand All @@ -113,6 +114,7 @@ def ResultGrader(
"trimbitscan",
)


elif "IREF" in testName:
relevant_files = [
outputDir + "/" + os.fsdecode(file) for file in os.listdir(outputDir) if module_name in file or file.endswith(".xml")
Expand All @@ -135,7 +137,6 @@ def ResultGrader(
"irefgadc",
)


elif "CommunicationTest" in testName:
module_name = module_data["module"].getModuleName()
comm_result = communicationTestResults.get(module_name)
Expand Down
18 changes: 13 additions & 5 deletions Gui/siteConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@

# Load instrument setup from json file
# If the json filename contains 'auto', channels will be automatically assigned as listed in Working Channels

json_setup = 'jsonFiles/instruments_osu_adcboardsldo.json'
with open(json_setup, 'r') as file:
icicle_instrument_setup = json.load(file)
Expand Down Expand Up @@ -119,12 +120,19 @@

forward_bias_voltage = 0.5 #positive voltage used to run a forward-reverse bias bump bond test


## Update this dictionary for the IP addreses of your FC7 devices ##
FC7List = {
'fc7.board.1' : '192.168.1.80',
'fc7.board.2' : '192.168.1.81',
'fc7.board.3' : '192.168.1.82',
}

try:
json_setup = 'jsonFiles/instruments_osu_adcboardsldo.json'
with open(json_setup, 'r') as file:
icicle_instrument_setup = json.load(file)
except FileNotFoundError:
print("Error: 'data.json' not found.")
exit()

FC7List = icicle_instrument_setup['fc7_address_dict']
icicle_instrument_setup.pop('fc7_address_dict')

## Update this list with all working TEC channels in your coldbox
## Channel assignments will follow this list sequentially per number of modules entered in the GUI
Expand Down
Loading