Skip to content

Commit

Permalink
Merge pull request #316 from OSU-CMS/addcommtest
Browse files Browse the repository at this point in the history
Adding CommunicationTest, updating test sequences for QC, fix manual …
  • Loading branch information
mlj5j authored Oct 24, 2024
2 parents 1e9fe7c + b14e5e6 commit f872ed7
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 30 deletions.
12 changes: 7 additions & 5 deletions Gui/QtGUIutils/QtRunWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import threading
import time
import logging
import Gui.siteSettings as site_settings

from Gui.GUIutils.DBConnection import checkDBConnection
from Gui.GUIutils.guiUtils import isActive, isCompositeTest
Expand Down Expand Up @@ -66,12 +67,13 @@ def __init__(self, master, info, firmware):

# Add TestProcedureHandler
self.testHandler = TestHandler(self, master, info, firmware)
assert self.master.instruments is not None, logger.error("Unable to setup instruments")
self.testHandler.powerSignal.connect(
lambda: self.master.instruments.off(
hv_delay=0.3, hv_step_size=10, measure=False
if not site_settings.manual_powersupply_control:
assert self.master.instruments is not None, logger.error("Unable to setup instruments")
self.testHandler.powerSignal.connect(
lambda: self.master.instruments.off(
hv_delay=0.3, hv_step_size=10, measure=False
)
)
)

self.GroupBoxSeg = [1, 10, 1]
self.HorizontalSeg = [3, 5]
Expand Down
18 changes: 9 additions & 9 deletions Gui/python/SimplifiedMainWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,11 @@ def setupUI(self):
self.StartLayout = QHBoxLayout()
self.TestGroup = QGroupBox()
self.TestGroupLayout = QVBoxLayout()
self.ProductionButton = QRadioButton("&Full Test")
self.QuickButton = QRadioButton("&Quick Test")
self.QuickButton.setChecked(True)
self.TestGroupLayout.addWidget(self.QuickButton)
self.TestGroupLayout.addWidget(self.ProductionButton)
self.FunctionTestButton = QRadioButton("&Functional Test")
self.AssemblyTestButton = QRadioButton("&Assembly QC Test")
self.AssemblyTestButton.setChecked(True)
self.TestGroupLayout.addWidget(self.AssemblyTestButton)
self.TestGroupLayout.addWidget(self.FunctionTestButton)

self.TestGroup.setLayout(self.TestGroupLayout)
logger.debug("Added Boxes/Layouts to Simplified GUI")
Expand Down Expand Up @@ -352,10 +352,10 @@ def runNewTest(self):
)
return

if self.ProductionButton.isChecked():
self.info = "ROCTune"
else:
self.info = "QuickTest"
if self.FunctionTestButton.isChecked():
self.info = "TFPX_Functional_Test"
elif self.AssemblyTestButton.isChecked():
self.info = "TFPX_Assembly_QC"
self.runFlag = True
self.RunTest = QtRunWindow(self.master, self.info, self.firmwareDescription)
self.RunButton.setDisabled(True)
Expand Down
48 changes: 35 additions & 13 deletions Gui/python/TestHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,22 @@ def runSingleTest(self, testName):
self.info_process.setWorkingDirectory(
os.environ.get("PH2ACF_BASE_DIR") + "/test/"
)
self.info_process.start(
"echo",
[
"Running COMMAND: CMSITminiDAQ -f CMSIT.xml -c {}".format(
Test_to_Ph2ACF_Map[self.currentTest]
)
],
)
if self.currentTest == "CommunicationTest":
self.info_process.start(
"echo",
[
"Running COMMAND: CMSITminiDAQ -f CMSIT.xml -p"
],
)
else:
self.info_process.start(
"echo",
[
"Running COMMAND: CMSITminiDAQ -f CMSIT.xml -c {}".format(
Test_to_Ph2ACF_Map[self.currentTest]
)
],
)
self.info_process.waitForFinished()

self.run_process.setProcessChannelMode(QtCore.QProcess.MergedChannels)
Expand Down Expand Up @@ -527,10 +535,21 @@ def runSingleTest(self, testName):
"{0}/test/CMSIT.xml".format(os.environ.get("PH2ACF_BASE_DIR")), "DoNSteps"
)

self.run_process.start(
"CMSITminiDAQ",
["-f", "CMSIT.xml", "-c", "{}".format(Test_to_Ph2ACF_Map[self.currentTest])],
)
if self.currentTest == "CommunicationTest":
self.run_process.start(
"CMSITminiDAQ",
["-f", "CMSIT.xml", "-p"],
)
else:
self.run_process.start(
"CMSITminiDAQ",
["-f", "CMSIT.xml", "-c", "{}".format(Test_to_Ph2ACF_Map[self.currentTest])],
)

#self.run_process.start(
# "CMSITminiDAQ",
# ["-f", "CMSIT.xml", "-c", "{}".format(Test_to_Ph2ACF_Map[self.currentTest])],
#)
if Test_to_Ph2ACF_Map[self.currentTest] == "threqu":
self.isTDACtuned = True

Expand Down Expand Up @@ -717,7 +736,8 @@ def on_readyReadStandardOutput(self):

except Exception as err:
logger.info("Error occures while parsing running time, {0}".format(err))

if '@@@ End of CMSIT miniDAQ @@@' in textStr:
self.ProgressingMode = "Summary"
if self.ProgressingMode == "Perform":
if "Progress:" in textStr:
try:
Expand Down Expand Up @@ -854,6 +874,8 @@ def check_for_end_of_test(self, textStr):
return True
elif "New injection delay" in textStr:
return True
elif "CommunicationTest" == self.currentTest:
return True
return False

# Reads data that is normally printed to the terminal and saves it to the output file
Expand Down
4 changes: 2 additions & 2 deletions Gui/python/TestValidator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def ResultGrader(felis, outputDir, testName, testIndexInSequence, runNumber, mod
module_name = module_data['module'].getModuleName()
module_type = module_data['module'].getModuleType()
module_version = module_data['module'].getModuleVersion()
if 'IVCurve' in testName or 'SLDOScan' in testName:
explanation = 'No grading currently available for IVCurve or SLDOScan.'
if 'IVCurve' in testName or 'SLDOScan' in testName or 'CommunicationTest' in testName:
explanation = 'No grading currently available for IVCurve, SLDOScan, or CommunicationTest.'
return {module_name:(True, explanation)}

root_file_name = testName.split('_')[0]
Expand Down
2 changes: 1 addition & 1 deletion InnerTrackerTests
Submodule InnerTrackerTests updated from 647212 to 1df224

0 comments on commit f872ed7

Please sign in to comment.