diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..051b7284 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Gui/siteSettings.py +Gui/siteConfig.py diff --git a/Configuration/DAQ.py b/Configuration/DAQ.py deleted file mode 100644 index 06e29083..00000000 --- a/Configuration/DAQ.py +++ /dev/null @@ -1,9 +0,0 @@ -class DAQ(): - def __init__(self,name): - self.name = name - def load(self, path): - self.path = path - #def Step(self): - - - diff --git a/FWCore/DAQ.py b/FWCore/DAQ.py deleted file mode 100644 index c29f29a7..00000000 --- a/FWCore/DAQ.py +++ /dev/null @@ -1,51 +0,0 @@ -import importlib -import sys -import subprocess -from Configuration.XMLUtil import * - -class DAQ(): - Procedure = [] - def __init__(self,name): - self.name = name - def ShowProcedure(self): - for step in self.Procedure: - print step.type - print step.kargs - def Run(self): - for step in self.Procedure: - if "ResetFlag" in step.kargs and step.kargs["ResetFlag"] == True: - command = "CMSITminiDAQ -r" - process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) - process.wait() - if "HWDescription" in step.kargs: - HWDescription = step.kargs["HWDescription"] - else: - HWDescription = "CMSIT.xml" - command = "CMSITminiDAQ -f %s -c %s" %(HWDescription, test) - process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) - process.wait() - - -class Step(): - def __init__(self,type_,*arg,**kargs): - self.type = type_ - self.arg = arg - self.kargs = kargs - -def Process(*arg,**kargs): - procedure = [] - for step in arg: - procedure.append(step) - return procedure - - -def SetConfiguration(name,path): - config = importlib.import_module(path) - description = eval("config.%s"%(name)) - return description - -def ConfigureBoard(BoardDescription, outputFile): - GenerateHWDescriptionXML(BoardDescription,outputFile) - return outputFile - - diff --git a/FWCore/__init__.py b/FWCore/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/FWCore/test.py b/FWCore/test.py deleted file mode 100644 index 5b9154b0..00000000 --- a/FWCore/test.py +++ /dev/null @@ -1,32 +0,0 @@ -import FWCore.DAQ as DAQ -#from Configuration.Config.SingleSCC import * - -myDAQ = DAQ.DAQ("myDAQ") - -myDAQ.config = DAQ.SetConfiguration("HWDescription","Configuration.Config.SingleSCC") -myDAQ.configFile = DAQ.ConfigureBoard(myDAQ.config, "XMLforPixelAlive.xml") - -myDAQ.step1 = DAQ.Step("PixelAlive", - HWDescription = "XMLforTest.xml" -) - -myDAQ.config2 = DAQ.SetConfiguration("HWDescription","Configuration.Config.SingleSCC") -myDAQ.configFile2 = DAQ.ConfigureBoard(myDAQ.config, "XMLforTest2.xml") - - -myDAQ.step2 = DAQ.Step("Test2", - HWDescription = "XMLforTest2.xml" -) - -myDAQ.config3 = DAQ.SetConfiguration("HWDescription","Configuration.Config.SingleSCC") -myDAQ.configFile3 = DAQ.ConfigureBoard(myDAQ.config, "XMLforTest3.xml") - -myDAQ.step3 = DAQ.Step("Test3", - HWDescription = "XMLforTest3.xml" -) - -myDAQ.Procedure = DAQ.Process(myDAQ.step1,myDAQ.step2,myDAQ.step3) - -myDAQ.ShowProcedure() - - diff --git a/Gui/CMSminiDAQ_wrap.py b/Gui/CMSminiDAQ_wrap.py deleted file mode 100644 index 7a7c7969..00000000 --- a/Gui/CMSminiDAQ_wrap.py +++ /dev/null @@ -1,11 +0,0 @@ -import os - -pixelDir = '/home/bmanley/Ph2_ACF/' - -os.system('rm -r {0}newTest'.format(pixelDir)) -os.system('mkdir {0}newTest'.format(pixelDir)) -os.system('cp {0}settings/RD53Files/CMSIT_RD53.txt {0}newTest/'.format(pixelDir)) -os.system('cp {0}settings/CMSIT.xml {0}newTest/'.format(pixelDir)) - -os.chdir('{}newTest'.format(pixelDir)) -os.system('source {0}setup.sh && cd {0}newTest && CMSITminiDAQ'.format(pixelDir)) \ No newline at end of file diff --git a/Gui/GUIutils/settings.py b/Gui/GUIutils/settings.py index 76bd7269..df65bee0 100644 --- a/Gui/GUIutils/settings.py +++ b/Gui/GUIutils/settings.py @@ -127,18 +127,15 @@ def __init__(self,DBhostname,DBIP,DBName): "v4-13":"QUAD_ELE_CROC_v4-6.bit", "v4-14":"QUAD_ELE_CROC_v4-6.bit", }, -# "RD53B" : {"v4.0.6":"IT_L12K4SCC_ELE_CROC.bit"} } ModuleLaneMap = { "TFPX Quad": {"0":"4","1":"2","2":"7","3":"5"}, - #"TFPX Quad": {"0":"4","2":"7","3":"5"}, "TEPX Quad": {"0":"0","1":"1","2":"2","3":"3"}, "TBPX Quad": {"0":"4","1":"5","2":"6","3":"7"}, "SingleSCC": {"0":"0"}, "Yellow Module (Purdue)" : {"0":"6","1":"5","3":"7"}, "CROC SCC": {"0":"15"}, - #"CROC 1x2" : {"2":"13"}, "CROC 1x2" : {"0":"12","2":"13"}, "TFPX CROC Quad" : {"0":"12","1":"13","2":"14"}, } @@ -146,13 +143,11 @@ def __init__(self,DBhostname,DBIP,DBName): BoxSize = { "SingleSCC" : 1, "TFPX Quad" : 4, - #"TFPX Quad" : 3, "TEPX Quad" : 4, "TBPX Quad" : 4, "Yellow Module (Purdue)": 3, "CROC SCC" : 1, "CROC 1x2" : 2, - #"CROC 1x2" : 1, "TFPX CROC Quad" : 3, } @@ -175,33 +170,6 @@ def __init__(self,DBhostname,DBIP,DBName): } -ModuleCurrentMap = { - "SingleSCC" : 0.6, - "TFPX Quad" : 6.5, - "TEPX Quad" : 6, - "TBPX Quad" : 6.5, - "Yellow Module (Purdue)": 6.5, - "CROC 1x2" : 4.8, - "TFPX CROC Quad" : 6.5, - "CROC SCC" : 0.6, -} - -ModuleVoltageMapSLDO = { - "SingleSCC" : 1.8, - "TFPX Quad" : 2.98, - "TEPX Quad" : 2.0, - "TBPX Quad" : 2.98, - "Yellow Module (Purdue)": 2.8, - "CROC 1x2" : 2.5, - "TFPX CROC Quad" : 2.98, - "CROC SCC" : 1.8, -} - -ModuleVoltageMap = { - "SingleSCC" : 1.3, - "CROC SCC" : 1.3, -} - ConfigFiles = { 'Latency' : '/Configuration/Defaults/CMSIT.xml', diff --git a/Gui/acfGui.py b/Gui/acfGui.py deleted file mode 100644 index 767695e9..00000000 --- a/Gui/acfGui.py +++ /dev/null @@ -1,47 +0,0 @@ -''' - acfGui.py - brief Interface for pixel grading gui - author Brandon Manley - version 0.1 - date 06/08/20 - Support: email to manley.329@osu.edu -''' - -import tkinter as tk -#import GUIutils.guiUtils as gui -import Gui.GUIutils.LoginFrame as login -import config -import database -from PIL import ImageTk, Image -from tkinter import ttk - -config.root.title('Ph2_ACF Grading System') -config.root.geometry('{}x{}'.format(600, 300)) -config.root.rowconfigure(0, weight=1, minsize=50) -config.root.rowconfigure(1, weight=1, minsize=250) -config.root.columnconfigure(0, weight=1, minsize=300) -config.root.columnconfigure(1, weight=1, minsize=300) - -title_label = tk.Label(master = config.root, text = "Phase 2 Pixel Grading System", relief=tk.GROOVE, font=('Helvetica', 25, 'bold')) -title_label.grid(row=0, column=0, columnspan=2, sticky="new") - -login.LoginFrame() -config.root.mainloop() - -#class Application(tk.Tk): -# def __init__(self): -# self.root = tk.Tk() -# self.root.title('Ph2_ACF Grading System') -# self.root.geometry('{}x{}'.format(600, 300)) -# self.root.rowconfigure(0, weight=1, minsize=50) -# self.root.rowconfigure(1, weight=1, minsize=250) -# self.root.columnconfigure(0, weight=1, minsize=300) -# self.root.columnconfigure(1, weight=1, minsize=300) - -# self.title_label = tk.Label(master = config.root, text = "Phase 2 Pixel Grading System", relief=tk.GROOVE, font=('Helvetica', 25, 'bold')) -# self.title_label.grid(row=0, column=0, columnspan=2, sticky="new") -# gui.LoginFrame() -# self.root.mainloop() - -#if __name__ == '__main__': -# Application() \ No newline at end of file diff --git a/Gui/durp.py b/Gui/durp.py deleted file mode 100644 index 70d85092..00000000 --- a/Gui/durp.py +++ /dev/null @@ -1,13 +0,0 @@ -from modulefinder import ModuleFinder - -finder = ModuleFinder() -finder.run_script('QtApplication.py') - -print('Loaded modules:') -for name, mod in finder.modules.items(): - print('%s: ' % name, end='') - print(','.join(list(mod.globalnames.keys())[:3])) - -print('-' * 50) -print('Modules not imported:') -print('\n'.join(finder.badmodules.keys())) diff --git a/Gui/siteConfig.py b/Gui/siteConfig.py new file mode 100644 index 00000000..b7ed0eed --- /dev/null +++ b/Gui/siteConfig.py @@ -0,0 +1,93 @@ +###################################################################### +# To be edited by expert as default setting for Hardware configuration +###################################################################### + +# Set gpib debug mode to True if you want to see SCPI commands sent to HV and LV devices: +GPIB_DebugMode = False + + +## The following block sets defaults that are to be used in the simplified (non-expert) mode. ## +## This mode is currently under development, so these values don't currently do anything ## + +# default FC7 boardName +defaultFC7 = "fc7.board.1" +# default IP address of IP address +defaultFC7IP = '192.168.1.80' +# default FMC board number +defaultFMC = '0' +# default mode for LV powering (Direct,SLDO,etc) +defaultPowerMode = "SLDO" +#default DBServerIP +defaultDBServerIP = '127.0.0.1' +#default DBName +defaultDBName = 'SampleDB' +################################## + + +## The following block assigns ports to devices when the "connect all devices" button is clicked ## + +# default USB port for HV power supply +defaultUSBPortHV = ["ASRL/dev/ttyUSBHV::INSTR"] +# default model for HV power supply +defaultHVModel = ["Keithley 2410 (RS232)"] +# default USB port for LV power supply +defaultUSBPortLV = ["ASRL/dev/ttyUSBLV::INSTR"] +# default model for LV power supply +defaultLVModel = ["KeySight E3633 (RS232)"] +#default BaudRate for Arduino sensor +defaultSensorBaudRate = 9600 +################################# + + +#setting default HV current compliance in mA +defaultHVCurrentCompliance = 0.00001 + +#setting HV bias voltage in V +defaultHVsetting = -60 + +## Configuring the current settings for each module type. These values are in Amps. +ModuleCurrentMap = { + "SingleSCC" : 0.6, + "TFPX Quad" : 6.5, + "TEPX Quad" : 6, + "TBPX Quad" : 6.5, + "Yellow Module (Purdue)": 6.5, + "CROC 1x2" : 4.0, + "TFPX CROC Quad" : 6.5, + "CROC SCC" : 2.0, +} + +## Configuring the voltage limit for each module type when operating in SLDO mode. These values are in Volts. +ModuleVoltageMapSLDO = { + "SingleSCC" : 1.8, + "TFPX Quad" : 2.98, + "TEPX Quad" : 2.0, + "TBPX Quad" : 2.98, + "Yellow Module (Purdue)": 2.8, + "CROC 1x2" : 2.0, + "TFPX CROC Quad" : 2.98, + "CROC SCC" : 1.8, +} + +## Configuring the voltage settings for each module type. These values are in Volts. +ModuleVoltageMap = { + "SingleSCC" : 1.3, + "CROC SCC" : 1.6, +} + +#setting the sequence of threshold tuning targets: +defaultTargetThr = ['2000','1500','1200','1000','800'] + +##### The following settings are for SLDO scans developed for Purdue.##### +##### Do not modify these settings unless you know what you are doing.#### +#default settings for SLDO scan. +defaultSLDOscanVoltage = 0.0 +defaultSLDOscanMaxCurrent = 0.0 + + +### Setting for Peltier Controller +usePeltier = True +defaultPeltierPort = '/dev/ttyUSBPeltier' +defaultPeltierBaud = 9600 +defaultPeltierSetTemp = 20 +defaultPeltierWarningTemp = 40 diff --git a/README.md b/README.md index 81ff6e7e..1cf2840c 100644 --- a/README.md +++ b/README.md @@ -15,15 +15,15 @@ git pull --recurse-submodules 2. Get the latest docker image: ``` -docker pull majoyce2/ph2_acf_gui:version4.13 +docker pull majoyce2/ph2_acf_gui:latest ``` 3. Specify device ports: -In run_Docker.sh you need to update the devices in the "docker run" line of the script. Change any "--device=tty*" to reflect the ports you will be using. +In run_Docker.sh you need to update the devices in the "mydevicelist" to reflect the ports you will be using. 4. Start the docker container: ``` -source run_Docker.sh +bash run_Docker.sh ``` 5. That's it! At this point the GUI should be open and ready to use. diff --git a/run_Docker.sh b/run_Docker.sh index d3070641..672dea76 100644 --- a/run_Docker.sh +++ b/run_Docker.sh @@ -1,23 +1,11 @@ #!/bin/bash SOCK=/tmp/.X11-unix; XAUTH=/tmp/.docker.xauth; xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -; chmod 777 $XAUTH; -#### This block is in development ########## -output=$(python3 -m serial.tools.list_ports -q) -IFS=$'\n' ports=($output) -devices="" -for port in "${ports[@]}"; do - if [ ! -z "$port" ]; then - devices+="--device=$port " - fi - -done -devices=$(echo $devices | xargs) -############################################# -## More stuff in development ############# +## Change the ports in 'mydevicelist' to those which you wish to use with the GUI############# mydevices="" -#mydevicelist=("/dev/ttyUSBLV" "/dev/ttyUSBHV" "/dev/ttyUSBPeltier" "/dev/ttyACM0") -mydevicelist=("/dev/ttyACM0" "/dev/ttyUSBHV") +mydevicelist=("/dev/ttyUSBLV" "/dev/ttyUSBHV" "/dev/ttyUSBPeltier" "/dev/ttyACM0") + for mydevice in "${mydevicelist[@]}"; do mydevices+="--device=$mydevice " mydevices+=" " @@ -25,9 +13,9 @@ for mydevice in "${mydevicelist[@]}"; do done mydevices=$(echo $mydevices | xargs) echo $mydevices | xargs -############################################ +################################################################################################ #docker run --rm -ti -v $PWD:$PWD -v ${PWD}/Ph2_ACF/test:/home/cmsTkUser/Ph2_ACF_GUI/Ph2_ACF/test -v ${PWD}/data:/home/cmsTkUser/Ph2_ACF_GUI/data $devices -w $PWD -e DISPLAY=$DISPLAY -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH --net host local/testimage #docker run --rm -ti -v $PWD:$PWD -v ${PWD}/Ph2_ACF/test:/home/cmsTkUser/Ph2_ACF_GUI/Ph2_ACF/test -v ${PWD}/data:/home/cmsTkUser/Ph2_ACF_GUI/data --device=/dev/ttyUSBHV --device=/dev/ttyUSBLV --device=/dev/ttyUSBPeltier --device=/dev/ttyACM0 -w $PWD -e DISPLAY=$DISPLAY -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH --net host local/testimage -docker run --rm -ti -v $PWD:$PWD -v ${PWD}/Ph2_ACF/test:/home/cmsTkUser/Ph2_ACF_GUI/Ph2_ACF/test -v ${PWD}/data:/home/cmsTkUser/Ph2_ACF_GUI/data --device=/dev/ttyUSBHV --device=/dev/ttyUSBLV --device=/dev/ttyUSBPeltier --device=/dev/ttyACM0 -w $PWD -e DISPLAY=$DISPLAY -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH --net host majoyce2/ph2_acf_gui:version4.13 -#docker run --rm -ti -v $PWD:$PWD -v ${PWD}/Ph2_ACF/test:/home/cmsTkUser/Ph2_ACF_GUI/Ph2_ACF/test -v ${PWD}/data:/home/cmsTkUser/Ph2_ACF_GUI/data $mydevices -w $PWD -e DISPLAY=$DISPLAY -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH --net host majoyce2/ph2_acf_gui:version4.13 \ No newline at end of file +docker run --rm -ti $mydevices -v $PWD:$PWD -v ${PWD}/Ph2_ACF/test:/home/cmsTkUser/Ph2_ACF_GUI/Ph2_ACF/test -v ${PWD}/Gui/siteConfig.py:/home/cmsTkUser/Ph2_ACF_GUI/Gui/siteSettings.py:ro -v ${PWD}/data:/home/cmsTkUser/Ph2_ACF_GUI/data -w $PWD -e DISPLAY=$DISPLAY -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH --net host majoyce2/ph2_acf_gui:latest +#docker run --rm -ti $mydevices -v $PWD:$PWD -v ${PWD}/Ph2_ACF/test:/home/cmsTkUser/Ph2_ACF_GUI/Ph2_ACF/test -v ${PWD}/Gui/siteConfig.py:/home/cmsTkUser/Ph2_ACF_GUI/Gui/siteSettings.py:ro -v ${PWD}/data:/home/cmsTkUser/Ph2_ACF_GUI/data -w $PWD -e DISPLAY=$DISPLAY -v $XSOCK:$XSOCK -v $XAUTH:$XAUTH -e XAUTHORITY=$XAUTH --net host local/testimage