Skip to content

Commit

Permalink
Merge branch 'DEV' into Simplified-Mode-Result-Tree-Arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
mlj5j authored Oct 30, 2024
2 parents 1dec421 + dc9cd29 commit f7a643c
Show file tree
Hide file tree
Showing 22 changed files with 422 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[submodule "icicle"]
path = icicle
url = https://gitlab.cern.ch/icicle/icicle.git
branch = new_adc_board_v2
branch = 1.3.0-RC
[submodule "InnerTrackerTests"]
path = InnerTrackerTests
url = https://gitlab.cern.ch/cms_tk_ph2/inner-tracker-tests.git
Expand Down
5 changes: 3 additions & 2 deletions Configuration/XMLUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ class FE():
def __init__(self):
self.Id="0"
self.Enabled = "0"
self.Lane="0"
self.Lane="0"
self.EfuseID = "0"
self.configfile="CMSIT_RD53.txt"
self.settingList = {}
self.laneConfigList = {}
Expand Down Expand Up @@ -314,7 +315,7 @@ def GenerateHWDescriptionXML(HWDescription,outputFile = "CMSIT_gen.xml", boardty
BeBoard.boardType = boardtype
print("This is the board type: ", BeBoard.boardType)
Node_FE = ET.SubElement(Node_HyBrid, BeBoard.boardType)
Node_FE = SetNodeAttribute(Node_FE,{'Id':FE.Id, 'enable':FE.Enabled,'Lane':FE.Lane,'configFile':FE.configfile,'RxGroups':FE.RxGroups,'RxPolarity':FE.RxPolarities,'TxGroup':FE.TxGroups,'TxChannel':FE.TxChannels,'TxPolarity':FE.TxPolarities,'Comment':boardtype})
Node_FE = SetNodeAttribute(Node_FE,{'Id':FE.Id, 'enable':FE.Enabled,'Lane':FE.Lane, 'eFuseCode':FE.EfuseID,'configFile':FE.configfile,'RxGroups':FE.RxGroups,'RxPolarity':FE.RxPolarities,'TxGroup':FE.TxGroups,'TxChannel':FE.TxChannels,'TxPolarity':FE.TxPolarities,'Comment':boardtype})
if 'RD53B' in boardtype:
Node_FELaneConfig = ET.SubElement(Node_FE,"LaneConfig")
Node_FELaneConfig = SetNodeAttribute(Node_FELaneConfig,FE.laneConfigList)
Expand Down
2 changes: 1 addition & 1 deletion Gui/CMSIT_RD53B.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<RD53_Files path="${PWD}/" />

<!-- Available Comment fields are: 50x50, 25x100origR0C0, 25x100origR1C0, unknown, combined with RD53A, RD53B, dual, quad -->
<RD53Bv1 Id="15" enable="1" Lane="0" configFile="CMSIT_RD53Bv1.txt" RxGroups="0006" RxPolarity="0" TxGroup="3" TxChannel="0" TxPolarity="0" Comment="RD53B 50x50">
<RD53Bv1 Id="15" enable="1" Lane="0" eFuseCode = "0" configFile="CMSIT_RD53Bv1.txt" RxGroups="0006" RxPolarity="0" TxGroup="3" TxChannel="0" TxPolarity="0" Comment="RD53B 50x50">
<LaneConfig isPrimary="1" masterLane="0" outputLanes="0001" singleChannelInputs="0000" dualChannelInput="0000" />
<!-- Overwrite .txt configuration file settings -->
<Settings
Expand Down
1 change: 1 addition & 0 deletions Gui/GUIutils/guiUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ def GenerateXMLConfig(firmwareList, testName, outputDir, **arg):
FEChip.ConfigureLaneConfig(FELaneConfig_Dict[testName][int(chip.getLane())])
FEChip.VDDAtrim = chip.getVDDA()
FEChip.VDDDtrim = chip.getVDDD()
FEChip.EfuseID = chip.getEfuseID()
HyBridModule0.AddFE(FEChip)
HyBridModule0.ConfigureGlobal(globalSettings_Dict[testName])
OpticalGroupModule0.AddHyBrid(HyBridModule0)
Expand Down
91 changes: 91 additions & 0 deletions Gui/QtGUIutils/LaudaApp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QWidget
import Gui.siteSettings as site_settings
from icicle.icicle.lauda import Lauda
import os


class LaudaWidget(QWidget):

def __init__(self, dimension):

self.myLauda = Lauda(resource=site_settings.lauda_resource)

super(LaudaWidget, self).__init__()
self.Ph2ACFDirectory = os.getenv("GUI_dir")
self.setupUi()
self.show()

def setupUi(self):
kMinimumWidth = 150
kMaximumWidth = 150
kMinimumHeight = 30
kMaximumHeight = 100

self.StartChillerButton = QtWidgets.QPushButton("Start")
self.StartChillerButton.setMinimumWidth(kMinimumWidth)
self.StartChillerButton.setMaximumWidth(kMaximumWidth)
self.StartChillerButton.setMinimumHeight(kMinimumHeight)
self.StartChillerButton.setMaximumHeight(kMaximumHeight)
self.StartChillerButton.clicked.connect(self.startChiller)
self.StartChillerButton.setCheckable(True)

self.StopChillerButton = QtWidgets.QPushButton("Stop")
self.StopChillerButton.setMinimumWidth(kMinimumWidth)
self.StopChillerButton.setMaximumWidth(kMaximumWidth)
self.StopChillerButton.setMinimumHeight(kMinimumHeight)
self.StopChillerButton.setMaximumHeight(kMaximumHeight)
self.StopChillerButton.clicked.connect(self.stopChiller)
self.StopChillerButton.setCheckable(True)

self.SetTempButton = QtWidgets.QPushButton("Set Temperature")
self.SetTempButton.setMinimumWidth(kMinimumWidth)
self.SetTempButton.setMaximumWidth(kMaximumWidth)
self.SetTempButton.setMinimumHeight(kMinimumHeight)
self.SetTempButton.setMaximumHeight(kMaximumHeight)
self.SetTempButton.clicked.connect(self.setTemperature)
self.SetTempButton.setCheckable(True)

self.SetTempEdit = QtWidgets.QLineEdit("")
self.SetTempEdit.setMinimumWidth(140)
self.SetTempEdit.setEchoMode(QtWidgets.QLineEdit.Normal)
self.SetTempEdit.setPlaceholderText("Set Temperature")
self.SetTempEdit.textChanged.connect(lambda : self.SetTempButton.setChecked(False))

self.ChillerLayout = QtWidgets.QGridLayout(self)
self.ChillerLayout.addWidget(self.StartChillerButton, 0, 0, 1, 1)
self.ChillerLayout.addWidget(self.StopChillerButton,1,0,1,1)
self.ChillerLayout.addWidget(self.SetTempButton,2,0,1,1)
self.ChillerLayout.addWidget(self.SetTempEdit,2,1,1,2)

self.setLayout(self.ChillerLayout)

def resourceExists(self):
return False if self.lauda_resource == None else True

def startChiller(self):
self.StartChillerButton.setChecked(True)
self.StopChillerButton.setChecked(False)

self.myLauda.set("START","START")

def stopChiller(self):
self.StartChillerButton.setChecked(False)
self.StopChillerButton.setChecked(True)

self.myLauda.set("STOP", "STOP")

def setTemperature(self):
self.SetTempButton.setChecked(True)

try:
self.myLauda.set("TEMPERATURE_TARGET",float(self.setTempEdit.text()))
except ValueError:
print("Temperature target must be a float.")

if __name__ == "__main__":
import sys

app = QtWidgets.QApplication(sys.argv)
ui = LaudaWidget(500)
sys.exit(app.exec_())
133 changes: 121 additions & 12 deletions Gui/QtGUIutils/QtApplication.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from PyQt5.QtWidgets import (
QApplication,
QCheckBox,
QSpinBox,
QComboBox,
QDialog,
QGridLayout,
Expand Down Expand Up @@ -32,6 +33,7 @@
import Gui.siteSettings as site_settings
from Gui.GUIutils.FirmwareUtil import fwStatusParser, FwStatusCheck
from Gui.GUIutils.guiUtils import isActive
from Gui.QtGUIutils.LaudaApp import LaudaWidget
from Gui.QtGUIutils.PeltierCoolingApp import Peltier
from Gui.QtGUIutils.QtFwCheckWindow import QtFwCheckWindow
from Gui.QtGUIutils.QtFwStatusWindow import QtFwStatusWindow
Expand All @@ -46,7 +48,9 @@
from Gui.python.ArduinoWidget import ArduinoWidget
from Gui.python.SimplifiedMainWidget import SimplifiedMainWidget
# from icicle.icicle.instrument_cluster import BadStatusForOperationError, InstrumentCluster
from icicle.icicle.multiment_cluster import InstrumentCluster
from icicle.icicle.instrument_cluster import InstrumentCluster
from icicle.icicle.f4t_temperature_chamber import F4TTempChamber




Expand Down Expand Up @@ -705,7 +709,7 @@ def createMain(self):
kMaximumWidth = 150
kMinimumHeight = 30
kMaximumHeight = 100

self.SummaryButton = QPushButton("&Status summary")
if not self.expertMode:
self.SummaryButton.setDisabled(True)
Expand Down Expand Up @@ -760,6 +764,38 @@ def createMain(self):
self.ReviewModuleEdit.setEchoMode(QLineEdit.Normal)
self.ReviewModuleEdit.setPlaceholderText("Enter Module ID")

self.ThermalTestButton = QPushButton("&Thermal Test")
self.ThermalTestButton.setEnabled(True)
self.AbortThermalTestButton = QPushButton("&Abort thermal test")
self.AbortThermalTestButton.setEnabled(True)

# To avoid people trying to push the button without a configured
# chamber, check if the resource is defined in siteConfig first.
# Maybe catching an error isn't the prettiest way to do this
# If it is not, disable the button
try:
site_settings.temp_chamber_resource
except AttributeError:
self.ThermalTestButton.setEnabled(False)
self.AbortThermalTestButton.setEnabled(False)


self.AbortThermalTestButton.setMinimumWidth(kMinimumWidth)
self.AbortThermalTestButton.setMaximumWidth(kMaximumWidth)
self.AbortThermalTestButton.setMinimumHeight(kMinimumHeight)
self.AbortThermalTestButton.setMaximumHeight(kMaximumHeight)
self.AbortThermalTestButton.clicked.connect(self.abortThermalTest)

self.ThermalTestButton.setMinimumWidth(kMinimumWidth)
self.ThermalTestButton.setMaximumWidth(kMaximumWidth)
self.ThermalTestButton.setMinimumHeight(kMinimumHeight)
self.ThermalTestButton.setMaximumHeight(kMaximumHeight)
self.ThermalTestButton.clicked.connect(self.runThermalTest)

self.ThermalProfileEdit = QLineEdit("")
self.ThermalProfileEdit.setEchoMode(QLineEdit.Normal)
self.ThermalProfileEdit.setPlaceholderText("Enter Profile Number")

self.PeltierCooling = Peltier(100)
self.PeltierBox = QGroupBox("Peltier Controller", self)
self.PeltierLayout = QGridLayout()
Expand All @@ -778,6 +814,15 @@ def createMain(self):
layout.addWidget(self.ReviewModuleButton, 3, 0, 1, 1)
layout.addWidget(self.ReviewModuleEdit, 3, 1, 1, 2)


self.ChillerOption = QGroupBox("Chiller", self)
self.ChillerLayout = QGridLayout()
self.ChillerOption.setLayout(self.ChillerLayout)

layout.addWidget(self.ThermalTestButton, 4, 0, 1, 1)
layout.addWidget(self.ThermalProfileEdit, 4, 1, 1, 1)
layout.addWidget(self.AbortThermalTestButton, 5, 0, 1, 1)

####################################################
# Functions for expert mode
####################################################
Expand All @@ -798,7 +843,7 @@ def createMain(self):
####################################################
# Functions for expert mode (END)
####################################################

self.MainOption.setLayout(layout)

self.AppOption = QGroupBox()
Expand Down Expand Up @@ -851,17 +896,28 @@ def createMain(self):
#self.mainLayout.addWidget(self.HVPowerRemoteControl, 2, 0, 1, 1)
self.mainLayout.addWidget(self.HVPowerGroup, 2, 0, 1, 1)
#self.mainLayout.addWidget(self.LVPowerRemoteControl, 2, 1, 1, 1)
self.mainLayout.addWidget(self.LVPowerGroup, 2, 1, 1, 1)
self.mainLayout.addWidget(self.LVPowerGroup, 2, 1, 1, 3)
#self.mainLayout.addWidget(self.relay_remote_control, 4, 0, 1, 1)
self.mainLayout.addWidget(self.relay_group, 3, 0, 1, 1)
#self.mainLayout.addWidget(self.multimeter_remote_control, 4, 1, 1, 1)
self.mainLayout.addWidget(self.multimeter_group, 3, 1, 1, 1)
self.mainLayout.addWidget(self.ArduinoGroup, 5, 1, 1, 1)
self.mainLayout.addWidget(self.ArduinoControl, 4, 1, 1, 1)
self.mainLayout.addWidget(self.MainOption, 0, 1, 2, 1)
self.mainLayout.addWidget(self.PeltierBox, 4, 0, 4, 1)
self.mainLayout.addWidget(self.AppOption, 6, 1, 1, 1)
self.mainLayout.addWidget(self.LogoGroupBox, 7, 1, 1, 1)
self.mainLayout.addWidget(self.multimeter_group, 3, 1, 1, 3)
self.mainLayout.addWidget(self.MainOption, 0, 1, 2, 3)
self.mainLayout.addWidget(self.PeltierBox, 4, 0, 3, 1)
self.mainLayout.addWidget(self.LogoGroupBox, 7, 0, 1, 4)

# Placing in try/except to avoid needing to change siteConfig
try:
self.MyLauda = LaudaWidget(100)
self.ChillerLayout.addWidget(self.MyLauda)

self.mainLayout.addWidget(self.ChillerOption, 4, 1, 3, 2)
self.mainLayout.addWidget(self.ArduinoControl, 4, 3, 1, 1)
self.mainLayout.addWidget(self.ArduinoGroup, 5, 3, 1, 2)
self.mainLayout.addWidget(self.AppOption, 6, 3, 1, 1)
except AttributeError:
self.mainLayout.addWidget(self.ArduinoControl, 4, 1, 1, 3)
self.mainLayout.addWidget(self.ArduinoGroup, 5, 1, 1, 3)
self.mainLayout.addWidget(self.AppOption, 6, 1, 1, 3)

self.setDefault()

Expand Down Expand Up @@ -1001,6 +1057,7 @@ def destroyMain(self):
self.ArduinoControl.deleteLater()
self.PeltierBox.deleteLater()
self.MainOption.deleteLater()
self.ChillerOption.deleteLater()
self.AppOption.deleteLater()
self.LogoGroupBox.deleteLater()
self.mainLayout.removeWidget(self.FirmwareStatus)
Expand All @@ -1017,10 +1074,62 @@ def destroyMain(self):
self.mainLayout.removeWidget(self.ArduinoControl)
self.mainLayout.removeWidget(self.PeltierBox)
self.mainLayout.removeWidget(self.MainOption)
self.mainLayout.removeWidget(self.ChillerOption)
self.mainLayout.removeWidget(self.AppOption)
self.mainLayout.removeWidget(self.LogoGroupBox)
QApplication.closeAllWindows()

def abortThermalTest(self):
"""Stop the current profile running on thermal chamber"""
temp_chamber = F4TTempChamber(resource = site_settings.temp_chamber_resource)
with temp_chamber:
temp_chamber.set('CONTROL_PROFILE', 'STOP')
message_box = QMessageBox()
message_box.setText("Profile Aborted")
message_box.setStandardButtons(QMessageBox.Ok)
message_box.exec()

def runThermalTest(self):
# Verify input of input data:
profile_number = self.ThermalProfileEdit.text()

# Check if this value is an int
try:
profile_number = int(profile_number)
except ValueError:
QMessageBox.information(
None, "Error", "Please enter a valid profile number"
". It must be an integer", QMessageBox.Ok
)
return
# Import icicle module for temperature chamber
print(site_settings.temp_chamber_resource)
temp_chamber = F4TTempChamber(resource = site_settings.temp_chamber_resource)

#
with temp_chamber:
temp_chamber.set('SELECT_PROFILE', profile_number)
profile_name = temp_chamber.query('SELECT_PROFILE')

message_box = QMessageBox()
message_box.setText("Temperature chamber"
f"profile \"{profile_name}\" has been chosen")
message_box.setInformativeText("Is this the correct profile?")
message_box.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
message_box.setDefaultButton(QMessageBox.Yes)
response = message_box.exec()

if response == QMessageBox.Yes:
with temp_chamber:
temp_chamber.set('CONTROL_PROFILE', 'START')

if response == QMessageBox.No:
return





def openNewProductionTest(self):
self.ProdTestPage = QtProductionTestWindow(
self, instrumentCluster=self.instruments
Expand Down Expand Up @@ -1202,7 +1311,7 @@ def goExpert(self):
self.destroyMain()
self.createMain()
self.checkFirmware()

###############################################################
## Global stop signal
###############################################################
Expand Down
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
2 changes: 1 addition & 1 deletion Gui/jsonFiles/instruments_osu_relayboxsldo.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"relay_board": {
"class": "RelayBoard",
"resource": "ASRL/dev/ttyUSB0::INSTR",
"resource": "ASRL/dev/ttyUSB3::INSTR",
"sim": false,
"default_voltage": 0,
"default_current": 0
Expand Down
Loading

0 comments on commit f7a643c

Please sign in to comment.