From ca039ca531c4aff5117f057ce4dae88b7f3f3564 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 31 May 2023 12:03:26 +0100 Subject: [PATCH 01/47] Remove the definitely not in use - or in plans- from zebra --- .../serial/setup_beamline/setup_beamline.py | 111 +----------------- 1 file changed, 1 insertion(+), 110 deletions(-) diff --git a/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py b/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py index 2bea87444..8e31c90ee 100644 --- a/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py +++ b/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py @@ -698,17 +698,7 @@ def zebra1(action, args_list=None): for arg in args_list: print(arg) - if action == "pmcgrid": - caput(pv.zebra1_soft_in_b0, "0") - caput(pv.zebra1_pc_gate_sel, "External") - caput(pv.zebra1_pc_pulse_sel, "External") - caput(pv.zebra1_and3_inp1, "61") - caput(pv.zebra1_and3_inp2, "1") - caput(pv.zebra1_out2_ttl, "34") - caput(pv.zebra1_pc_gate_inp, "61") - caput(pv.zebra1_pc_pulse_inp, "1") - - elif action == "zlayer": + if action == "zlayer": caput(pv.zebra1_soft_in_b2, "0") caput(pv.zebra1_soft_in_b3, "0") caput(pv.zebra1_pc_gate_sel, "External") @@ -721,16 +711,6 @@ def zebra1(action, args_list=None): caput(pv.zebra1_out3_ttl, "52") caput(pv.zebra1_out4_ttl, "35") - elif action == "stop-and-start": - caput(pv.zebra1_soft_in_b0, "0") - caput(pv.zebra1_pc_gate_sel, "External") - caput(pv.zebra1_pc_pulse_sel, "External") - caput(pv.zebra1_and3_inp1, "61") - caput(pv.zebra1_and3_inp2, "1") - caput(pv.zebra1_out2_ttl, "34") - caput(pv.zebra1_pc_gate_inp, "61") - caput(pv.zebra1_pc_pulse_inp, "1") - elif action == "fastchip": caput(pv.zebra1_soft_in_b0, "0") caput(pv.zebra1_pc_gate_sel, "External") @@ -751,31 +731,6 @@ def zebra1(action, args_list=None): caput(pv.zebra1_pc_gate_inp, "61") caput(pv.zebra1_pc_pulse_inp, "7") - elif action == "on-the-fly": - [x_size, step_size, start_pos_x] = args_list - caput(pv.zebra1_pc_pulse_sel, "Position") - caput(pv.zebra1_pc_enc, "Enc3") - caput(pv.zebra1_pc_dir, "Positive") - caput(pv.zebra1_pc_gate_start, start_pos_x) - caput(pv.zebra1_pc_gate_width, x_size) - caput(pv.zebra1_out3_ttl, "31") - pulse_width = step_size - 0.0001 - caput(pv.zebra1_pc_pulse_start, 0.0) - caput(pv.zebra1_pc_pulse_width, pulse_width) - caput(pv.zebra1_pc_pulse_step, step_size) - - elif action == "back-and-forth": - [gate_width] = args_list - caput(pv.zebra1_pc_disarm, 1) - caput(pv.zebra1_pc_enc, "Enc2") - caput(pv.zebra1_pc_dir, "Positive") - caput(pv.zebra1_pc_gate_width, gate_width) - - elif action == "grid-collect": - # Trig Source is 'Soft' - caput(pv.zebra1_and3_inp1, "61") - caput(pv.zebra1_pc_gate_sel, "External") - elif action == "quickshot": [gate_start, gate_width] = args_list # Trig Source is soft SOFT_IN2 @@ -789,70 +744,6 @@ def zebra1(action, args_list=None): caput(pv.zebra1_pc_gate_inp, "61") sleep(0.1) - elif action == "zebratrigger-eiger": - [ - gate_start, - gate_width, - num_gates, - gate_step, - p1_delay, - p1_width, - p2_delay, - p2_width, - ] = args_list - caput(pv.zebra1_soft_in_b0, "0") - caput(pv.zebra1_pc_gate_sel, "Time") - caput(pv.zebra1_pc_pulse_sel, "External") - caput(pv.zebra1_and3_inp1, "61") - caput(pv.zebra1_and3_inp2, "52") - caput(pv.zebra1_and4_inp1, "61") - caput(pv.zebra1_and4_inp2, "53") - caput(pv.zebra1_out1_ttl, "35") - caput(pv.zebra1_out2_ttl, "34") - caput(pv.zebra1_pc_gate_inp, "61") - caput(pv.zebra1_pc_gate_start, gate_start) - caput(pv.zebra1_pc_gate_width, gate_width) - caput(pv.zebra1_pc_gate_step, gate_step) - caput(pv.zebra1_pc_gate_ngate, num_gates) - caput(pv.zebra1_pulse1_inp, "30") - caput(pv.zebra1_pulse1_delay, p1_delay) - caput(pv.zebra1_pulse1_width, p1_width) - caput(pv.zebra1_pulse2_inp, "30") - caput(pv.zebra1_pulse2_delay, p2_delay) - caput(pv.zebra1_pulse2_width, p2_width) - - elif action == "zebratrigger-pilatus": - [ - gate_start, - gate_width, - num_gates, - gate_step, - p1_delay, - p1_width, - p2_delay, - p2_width, - ] = args_list - caput(pv.zebra1_soft_in_b0, "0") - caput(pv.zebra1_pc_gate_sel, "Time") - caput(pv.zebra1_pc_pulse_sel, "External") - caput(pv.zebra1_and3_inp1, "61") - caput(pv.zebra1_and3_inp2, "52") - caput(pv.zebra1_and4_inp1, "61") - caput(pv.zebra1_and4_inp2, "53") - caput(pv.zebra1_out1_ttl, "34") - caput(pv.zebra1_out2_ttl, "35") - caput(pv.zebra1_pc_gate_inp, "61") - caput(pv.zebra1_pc_gate_start, gate_start) - caput(pv.zebra1_pc_gate_width, gate_width) - caput(pv.zebra1_pc_gate_step, gate_step) - caput(pv.zebra1_pc_gate_ngate, num_gates) - caput(pv.zebra1_pulse1_inp, "30") - caput(pv.zebra1_pulse1_delay, p1_delay) - caput(pv.zebra1_pulse1_width, p1_width) - caput(pv.zebra1_pulse2_inp, "30") - caput(pv.zebra1_pulse2_delay, p2_delay) - caput(pv.zebra1_pulse2_width, p2_width) - elif action == "fastchip-zebratrigger-pilatus": [num_gates, n_exposures, exptime] = args_list caput(pv.zebra1_soft_in_b0, "0") From 8a72a350b7cc32acd0824b920567211c27cfa9da Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 31 May 2023 12:09:43 +0100 Subject: [PATCH 02/47] Remove the definitely not in use - or in plans- from pilatus and eiger --- .../fixed_target/i24ssx_Chip_Collect_py3v1.py | 1 - .../serial/setup_beamline/setup_beamline.py | 125 +----------------- 2 files changed, 1 insertion(+), 125 deletions(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py index 049c96983..4360f1749 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py @@ -480,7 +480,6 @@ def start_i24(): lg.info("%s Fastchip Pilatus setup: exposure time %s" % (name, exptime)) sup.pilatus("fastchip", [filepath, filename, total_numb_imgs, exptime]) - # sup.pilatus('fastchip-hatrx', [filepath, filename, total_numb_imgs, exptime]) # DCID process depends on detector PVs being set up already dcid = DCID( diff --git a/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py b/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py index 8e31c90ee..fe59ea9ea 100644 --- a/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py +++ b/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py @@ -278,27 +278,7 @@ def pilatus(action, args_list=None): caput(pv.pilat_beamy, 1307) sleep(0.1) - # fast grid scans to replace GDA - if action == "pmcgrid": - [filepath, filename, total_numb_imgs, exptime] = args_list - rampath = filepath.replace("dls/i24/data", "ramdisk") - acqtime = exptime - 0.001 - print("filepath was set as", filepath) - print("Rampath set as", rampath) - print("Filename set as", filename) - print("total_numb_imgs", total_numb_imgs) - print("Exposure time set as", exptime, "s") - print("Acquire time set as", acqtime, "s") - caput(pv.pilat_filepath, rampath + filename + "/") - caput(pv.pilat_filename, filename) - caput(pv.pilat_numimages, str(total_numb_imgs)) - caput(pv.pilat_acquiretime, str(acqtime)) - caput(pv.pilat_acquireperiod, str(exptime)) - caput(pv.pilat_imagemode, "Continuous") - caput(pv.pilat_triggermode, "Mult. Trigger") - caput(pv.pilat_delaytime, 0) - - elif action == "zlayer": + if action == "zlayer": [filepath, filename, total_numb_imgs, exptime] = args_list rampath = filepath.replace("dls/i24/data", "ramdisk") acqtime = exptime - 0.001 @@ -321,7 +301,6 @@ def pilatus(action, args_list=None): elif action == "fastchip": [filepath, filename, total_numb_imgs, exptime] = args_list rampath = filepath.replace("dls/i24/data", "ramdisk") - nexpimage = 1.0 acqtime = float(exptime) - 0.001 print("filepath was set as", filepath) print("Rampath set as", rampath) @@ -341,82 +320,6 @@ def pilatus(action, args_list=None): caput(pv.pilat_triggermode, "Mult. Trigger") caput(pv.pilat_delaytime, 0) - # Fixed Target stage (very fast start and stop w/ multi-triggering - # from function generator - - elif action == "fastchip-hatrx": - [filepath, filename, total_numb_imgs, exptime] = args_list - rampath = filepath.replace("dls/i24/data", "ramdisk") - acqtime = 0.001 - nexpimage = 4.0 - print("filepath was set as", filepath) - print("Rampath set as", rampath) - print("Filename set as", filename) - print("total_numb_imgs", total_numb_imgs) - print("Exposure time set as", exptime, "s") - print("Acquire time set as", acqtime, "s") - caput(pv.pilat_startangle, 0.0) - caput(pv.pilat_angleincr, 0.0) - caput(pv.pilat_filepath, rampath + "/") - caput(pv.pilat_filename, filename) - caput(pv.pilat_numimages, str(total_numb_imgs)) - caput(pv.pilat_acquiretime, str(acqtime)) - caput(pv.pilat_acquireperiod, str(exptime)) - caput(pv.pilat_imagemode, "Multiple") - caput(pv.pilat_triggermode, "Mult. Trigger") - caput(pv.pilat_numexpimage, nexpimage) - caput(pv.pilat_delaytime, 0) - - # Originally designed for small oscillation grids - elif action == "back-and-forth": - [filepath, filename, total_numb_imgs, exptime] = args_list - rampath = filepath.replace("dls/i24/data", "ramdisk") - acqtime = exptime - 0.01 - print("filepath was set as", filepath) - print("Rampath set as", rampath) - print("Filename set as", filename) - print("total_numb_imgs", total_numb_imgs) - print("Exposure time set as", exptime, "s") - print("Acquire time set as", acqtime, "s") - caput(pv.pilat_filepath, rampath) - caput(pv.pilat_filename, filename) - caput(pv.pilat_numimages, str(total_numb_imgs)) - caput(pv.pilat_acquiretime, str(acqtime)) - caput(pv.pilat_acquireperiod, str(exptime)) - caput(pv.pilat_imagemode, "Multiple") - caput(pv.pilat_triggermode, "Ext. Trigger") - caput(pv.pilat_delaytime, 0.000) # 0.030 - - # Collect multiple images from a non-moving target - elif action == "grid-collect": - [filepath, filename, total_numb_imgs, exptime] = args_list - rampath = filepath.replace("dls/i24/data", "ramdisk") - acqtime = exptime - 0.001 - print("filepath was set as", filepath) - print("Rampath set as", rampath) - print("Filename set as", filename) - print("total_numb_imgs", total_numb_imgs) - print("Exposure time set as", exptime, "s") - print("Acquire time set as", acqtime, "s") - caput(pv.pilat_filepath, rampath) - sleep(0.1) - print("xx") - caput(pv.pilat_filename, filename) - sleep(0.1) - print("xxx") - # caput(pv.pilat_file_num, 1) - # Delay time needs checking - caput(pv.pilat_delaytime, 0.03) - # Read timeout needs to be number of images * Acq time + ?? - caput(pv.pilat_numimages, str(total_numb_imgs)) - caput(pv.pilat_acquiretime, str(acqtime)) - caput(pv.pilat_acquireperiod, str(exptime)) - caput(pv.pilat_triggermode, "Ext. Trigger") - # Template should be %s%s%04d.cbf normally - # set to %s%s06d.cbf for collection - print("Have you set template to 06d?") - # caput(pv.pilat_filename_template, '') - # Quick set of images no coordinated motion elif action == "quickshot": print("quickshot") @@ -599,32 +502,6 @@ def eiger(action, args_list=None): # Will now wait for Manual trigger. Add the below line to your DAQ script # caput(pv.eiger_trigger, 1) - # Fixed Target stage (very fast start and stop w/ triggering from GeoBrick - elif action == "fastchip": - [filepath, filename, total_numb_imgs, exptime] = args_list - # acqtime = float(exptime) - 0.0000001 - print("Filepath set as", filepath) - # print('Rampath set as', rampath) - print("Filename set as", filename) - print("total_numb_imgs", total_numb_imgs) - print("Exposure time set as", exptime, "s") - print("Acquire time set as", acqtime, "s") - nexpimage = 1.0 # Set it here like for pilatus - # HEADER INFO HERE - caput(pv.eiger_filepath, filepath) - caput(pv.eiger_filename, filename) - caput(pv.eiger_numimages, str(total_numb_imgs)) - caput(pv.eiger_acquiretime, str(acqtime)) - caput(pv.eiger_acquireperiod, str(exptime)) - caput( - pv.eiger_numexpimage, str(nexpimage) - ) # NOT SET HERE!!! N_exposures... I guess it comes from edm? - caput(pv.eiger_imagemode, "Multiple") - caput(pv.eiger_triggermode, "External Series") - # Things GDA does for eiger grids (that aren't already above) - # eigerFan.forwardstream = True - # odin.hdf5.advanced.acquistionID=str(data_coll_ID) - # Put it all back to GDA acceptable defaults # NEEDS VERIFYING FOR EIGER elif action == "return-to-normal": From 45baab3e04fd303e07878e77fbe941a7f70c057e Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 31 May 2023 13:40:18 +0100 Subject: [PATCH 03/47] Delete old zebra actions and rename ones in use --- .../fixed_target/i24ssx_Chip_Collect_py3v1.py | 12 +--- .../serial/setup_beamline/setup_beamline.py | 62 +------------------ 2 files changed, 5 insertions(+), 69 deletions(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py index 4360f1749..566c17a5f 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py @@ -498,12 +498,9 @@ def start_i24(): ) print("Arm Pilatus. Arm Zebra.") - # ZEBRA TEST. Swap the below two lines in/out. Must also swap pc_arm line also. - # sup.zebra1('fastchip') - sup.zebra1("fastchip-zebratrigger-pilatus", [num_gates, n_exposures, exptime]) + sup.zebra1("fastchip-pilatus", [num_gates, n_exposures, exptime]) caput(pv.pilat_acquire, "1") # Arm pilatus - caput(pv.zebra1_pc_arm, "1") # Arm zebra fastchip-zebratrigger - # caput(pv.zebra1_pc_arm_out, '1') # Arm zebra fastchip + caput(pv.zebra1_pc_arm, "1") # Arm zebra fastchip-pilatus caput(pv.pilat_filename, filename) time.sleep(1.5) @@ -554,11 +551,6 @@ def start_i24(): ) print("Arm Zebra.") - # TO GET DOSE SERIES TO WORK - # Choose the correct pair of lines - # sup.zebra1("fastchip-eiger") - # caput(pv.zebra1_pc_arm_out, '1') # Arm zebra - sup.zebra1("fastchip-zebratrigger-eiger", [num_gates, n_exposures, exptime]) caput(pv.zebra1_pc_arm, "1") # Arm zebra fastchip-zebratrigger diff --git a/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py b/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py index fe59ea9ea..4bdac660c 100644 --- a/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py +++ b/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py @@ -53,7 +53,6 @@ def modechange(action): caput(pv.bs_mp_select, "Data Collection") sleep(2.3) caput(pv.bl_mp_select, "In") - # caput(pv.cstrm_p1701, 1) print("Pin Data Collection Done") # Pin Room Tempreature Data Collection @@ -70,12 +69,10 @@ def modechange(action): caput(pv.vgon_pinzs, 0) caput(pv.fluo_trans, "OUT") sleep(0.1) - # caput(pv.bs_mp_select, 'Rotatable') caput(pv.bs_roty, 0) sleep(2.6) caput(pv.bl_mp_select, "In") caput(pv.bs_mp_select, "Data Collection") - # caput(pv.cstrm_p1701, 1) print("RT Data Collection Done") # Tray Hand Mount @@ -88,7 +85,6 @@ def modechange(action): sleep(1) caput(pv.aptr1_mp_select, "Manual Mounting") caput(pv.bs_mp_select, "Tray Mount") - # caput(pv.bs_roty, 180) #Commented out by RLO 8Aug18 - NEEDS TESTING while caget(pv.ttab_x + ".RBV") > 3: sleep(1) print("Tray Hand Mount Done") @@ -194,21 +190,7 @@ def beamline(action, args_list=None): for arg in args_list: print(arg) - # Not sure when this is used - if action == "safe-mount": - caput(pv.fluo_trans, "OUT") - caput(pv.aptr1_mp_select, "Out") - - elif action == "fluorescence-collect": - caput(pv.fluo_trans, "IN") - caput(pv.aptr1_mp_select, "In") - caput(pv.bs_mp_select, "Data Collection Far") - print("Waiting for Fluorescence Detector") - while caget(pv.fluo_in_limit) != "OFF": - print(".", end=" ") - sleep(0.25) - - elif action == "collect": + if action == "collect": caput(pv.aptr1_mp_select, "In") caput(pv.bl_mp_select, "Out") sleep(3) @@ -216,10 +198,6 @@ def beamline(action, args_list=None): caput(pv.bs_roty, 0) sleep(4) - elif action == "grid-collect": - caput(pv.det_z, 500) - caput(pv.bl_mp_select, "Out") - elif action == "quickshot": det_dist = args_list[0] caput(pv.det_z, det_dist) @@ -249,12 +227,6 @@ def beamline(action, args_list=None): print(".", end=" ") sleep(0.25) - elif action == "return-to-normal": - print("Return to Normal") - print(80 * "!") - modechange("Tray_switch2pin") - print(80 * "!") - else: print("Unknown action for beamline method", action) sleep(0.1) @@ -451,8 +423,6 @@ def eiger(action, args_list=None): # If detector fails to arm first time can try twice with a sleep inbetween print("Arming Eiger") caput(pv.eiger_acquire, "1") - # sleep(1.0) - # caput(pv.eiger_acquire, '1') # Will now wait for Manual trigger. Add the below line to your DAQ script ### # caput(pv.eiger_trigger, 1) @@ -461,8 +431,6 @@ def eiger(action, args_list=None): print("Eiger triggered") [filepath, filename, num_imgs, exptime] = args_list print("Filepath set as", filepath) - # rampath = filepath.replace('dls/i24/data','ramdisk') - # print('Rampath set as', rampath) filename = filename + "_" + str(caget(pv.eiger_seqID)) caput(pv.eiger_ODfilepath, filepath) sleep(0.1) @@ -497,18 +465,14 @@ def eiger(action, args_list=None): # If detector fails to arm first time can try twice with a sleep inbetween print("Arming Eiger") caput(pv.eiger_acquire, "1") - # sleep(1.0) - # caput(pv.eiger_acquire, '1') # Will now wait for Manual trigger. Add the below line to your DAQ script # caput(pv.eiger_trigger, 1) # Put it all back to GDA acceptable defaults - # NEEDS VERIFYING FOR EIGER elif action == "return-to-normal": caput(pv.eiger_manualtrigger, "No") # caput(pv.eiger_seqID, int(caget(pv.eiger_seqID))+1) print("Not Sure what else to do in here yet") - # print(filename, caget(pv.eiger_seqID) print("***** leaving Eiger") sleep(0.1) return 0 @@ -588,26 +552,6 @@ def zebra1(action, args_list=None): caput(pv.zebra1_out3_ttl, "52") caput(pv.zebra1_out4_ttl, "35") - elif action == "fastchip": - caput(pv.zebra1_soft_in_b0, "0") - caput(pv.zebra1_pc_gate_sel, "External") - caput(pv.zebra1_pc_pulse_sel, "External") - caput(pv.zebra1_and3_inp1, "61") - caput(pv.zebra1_and3_inp2, "7") - caput(pv.zebra1_out2_ttl, "34") - caput(pv.zebra1_pc_gate_inp, "61") - caput(pv.zebra1_pc_pulse_inp, "7") - - elif action == "fastchip-eiger": - caput(pv.zebra1_soft_in_b0, "0") - caput(pv.zebra1_pc_gate_sel, "External") - caput(pv.zebra1_pc_pulse_sel, "External") - caput(pv.zebra1_and3_inp1, "61") - caput(pv.zebra1_and3_inp2, "7") # should be 7. Change to 62 for testing - caput(pv.zebra1_out1_ttl, "34") - caput(pv.zebra1_pc_gate_inp, "61") - caput(pv.zebra1_pc_pulse_inp, "7") - elif action == "quickshot": [gate_start, gate_width] = args_list # Trig Source is soft SOFT_IN2 @@ -621,7 +565,7 @@ def zebra1(action, args_list=None): caput(pv.zebra1_pc_gate_inp, "61") sleep(0.1) - elif action == "fastchip-zebratrigger-pilatus": + elif action == "fastchip-pilatus": [num_gates, n_exposures, exptime] = args_list caput(pv.zebra1_soft_in_b0, "0") caput(pv.zebra1_pc_gate_sel, "External") @@ -638,7 +582,7 @@ def zebra1(action, args_list=None): caput(pv.zebra1_pc_pulse_width, pulse_width) caput(pv.zebra1_pc_pulse_max, n_exposures) - elif action == "fastchip-zebratrigger-eiger": + elif action == "fastchip-eiger": [num_gates, n_exposures, exptime] = args_list caput(pv.zebra1_soft_in_b0, "0") caput(pv.zebra1_pc_gate_sel, "External") From 454b0c4bf35b4da2c20b38a4e997c921d1b08851 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 31 May 2023 13:44:53 +0100 Subject: [PATCH 04/47] Add a couple of tests --- .../I24/serial/setup_beamline/test_setup_beamline.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/I24/serial/setup_beamline/test_setup_beamline.py b/tests/I24/serial/setup_beamline/test_setup_beamline.py index 5d356d137..10277633a 100644 --- a/tests/I24/serial/setup_beamline/test_setup_beamline.py +++ b/tests/I24/serial/setup_beamline/test_setup_beamline.py @@ -64,3 +64,15 @@ def test_zebra1_return_to_normal(fake_caput): def test_zebra1_quickshot(fake_caput): setup_beamline.zebra1("quickshot", [0, 1]) assert fake_caput.call_count == 7 + + +@patch("mx_bluesky.I24.serial.setup_beamline.setup_beamline.caput") +def test_zebra1_fastchip_pilatus(fake_caput): + setup_beamline.zebra1("fastchip-pilatus", [1, 1, 0.1]) + assert fake_caput.call_count == 12 + + +@patch("mx_bluesky.I24.serial.setup_beamline.setup_beamline.caput") +def test_zebra1_fastchip_eiger(fake_caput): + setup_beamline.zebra1("fastchip-eiger", [1, 1, 0.1]) + assert fake_caput.call_count == 12 From 529f85663f77ce85edc43edfb0952209de24832e Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 31 May 2023 13:46:01 +0100 Subject: [PATCH 05/47] A bit more tidying up --- .../fixed_target/i24ssx_Chip_Collect_py3v1.py | 4 ++-- .../serial/setup_beamline/setup_beamline.py | 21 ------------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py index 566c17a5f..2415c6e50 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py @@ -551,8 +551,8 @@ def start_i24(): ) print("Arm Zebra.") - sup.zebra1("fastchip-zebratrigger-eiger", [num_gates, n_exposures, exptime]) - caput(pv.zebra1_pc_arm, "1") # Arm zebra fastchip-zebratrigger + sup.zebra1("fastchip-eiger", [num_gates, n_exposures, exptime]) + caput(pv.zebra1_pc_arm, "1") # Arm zebra fastchip-eiger time.sleep(1.5) diff --git a/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py b/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py index 4bdac660c..254f02900 100644 --- a/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py +++ b/src/mx_bluesky/I24/serial/setup_beamline/setup_beamline.py @@ -671,24 +671,3 @@ def geobrick(action, args_list=None): caput(pv.step10_pmac_str, "I5450 = 1") print("***** leaving geobrick") return 1 - - -def returntonormal(): - print("\n***** Entering Return To Normal") - print("returntonormal - ") - caput(pv.zebra1_disarm, 1) - caput(pv.shtr_ctrl2, "Close") - caput(pv.shtr_ctrl1, "Auto") - zebra1("return-to-normal") - beamline("Tray_switch2pin") - pilatus("return-to-normal") - xspress3("return-to-normal") - print("***** leaving returntonormal") - - -def main(): - print("Hello World!") - - -if __name__ == "__main__": - main() From f9d0cc2adca7c70c538dcecb84bef3ee41226ac0 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 31 May 2023 14:55:16 +0100 Subject: [PATCH 06/47] Add forgotten parameter file for motor direction --- .../I24/serial/parameters/motor_direction.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/mx_bluesky/I24/serial/parameters/motor_direction.txt diff --git a/src/mx_bluesky/I24/serial/parameters/motor_direction.txt b/src/mx_bluesky/I24/serial/parameters/motor_direction.txt new file mode 100644 index 000000000..ab5d6ca22 --- /dev/null +++ b/src/mx_bluesky/I24/serial/parameters/motor_direction.txt @@ -0,0 +1,10 @@ + +# This file give the relationship between stage motor counts pos/neg lab +# coordinate system + +# April 2023 @ i24 +# motor number * (dir) = positive chip direction + +mtr1_dir=1 +mtr2_dir=-1 +mtr3_dir=-1 From b30da247abc2161c2cb03e59a8ea0abf61eea44c Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Mon, 5 Jun 2023 16:04:44 +0100 Subject: [PATCH 07/47] Clean up logging --- .../extruder/i24ssx_Extruder_Collect_py3v2.py | 107 ++++---- .../fixed_target/i24ssx_Chip_Collect_py3v1.py | 219 ++++++++-------- .../fixed_target/i24ssx_Chip_Manager_py3v1.py | 240 +++++++++--------- .../fixed_target/i24ssx_Chip_Mapping_py3v1.py | 71 +++--- .../fixed_target/i24ssx_Chip_StartUp_py3v1.py | 54 ++-- src/mx_bluesky/I24/serial/log.py | 81 ++++++ 6 files changed, 426 insertions(+), 346 deletions(-) create mode 100644 src/mx_bluesky/I24/serial/log.py diff --git a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py index cbb57a342..99cc0d445 100755 --- a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +++ b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py @@ -6,23 +6,25 @@ from __future__ import annotations import inspect -import logging as lg +import logging import pathlib import sys import time from datetime import datetime from time import sleep +from mx_bluesky.I24.serial import log from mx_bluesky.I24.serial.dcid import DCID, SSXType from mx_bluesky.I24.serial.setup_beamline import caget, caput, pv from mx_bluesky.I24.serial.setup_beamline import setup_beamline as sup from mx_bluesky.I24.serial.write_nexus import call_nexgen -lg.basicConfig( - format="%(asctime)s %(levelname)s: \t%(message)s", - level=lg.DEBUG, - filename=time.strftime("logs/i24_%d%B%y.log").lower(), -) +logger = logging.getLogger("I24ssx.extruder") + + +def setup_logging(): + logfile = time.strftime("i24_%d%B%y.log").lower() + log.config(logfile) def flush_print(text): @@ -33,12 +35,12 @@ def flush_print(text): def initialise_extruderi24(): name = inspect.stack()[0][3] print("Initialise Parameters for extruder data collection") - lg.info("%s I24 extruder initialisation" % name) + logger.info("%s I24 extruder initialisation" % name) # define visit using the below line # visit = "/dls/i24/data/2022/mx31930-2/" visit = "/dls/i24/data/2023/cm33852-2/" - lg.info("%s Visit defined %s" % (name, visit)) + logger.info("%s Visit defined %s" % (name, visit)) # define detector using the below line # Oct 2021. beta. Do not change from pilatus unless your name is Robin @@ -57,17 +59,17 @@ def initialise_extruderi24(): caput(pv.ioc12_gp15, str(det_type)) caput(pv.pilat_cbftemplate, 0) print("Done Done Done") - lg.info("%s Initialsation complete" % name) + logger.info("%s Initialsation complete" % name) def moveto(place): name = inspect.stack()[0][3] - lg.info("%s Move to %s" % (name, place)) + logger.info("%s Move to %s" % (name, place)) det_type = caget(pv.ioc12_gp15) if place == "laseron": - lg.info("%s laser on%s" % (name, place)) + logger.info("%s laser on%s" % (name, place)) if det_type == "pilatus": caput(pv.zebra1_out1_ttl, 60.0) caput(pv.zebra1_soft_in_b0, 1.0) @@ -76,7 +78,7 @@ def moveto(place): caput(pv.zebra1_soft_in_b0, 1.0) if place == "laseroff": - lg.info("%s laser off%s" % (name, place)) + logger.info("%s laser off%s" % (name, place)) if det_type == "pilatus": caput(pv.zebra1_soft_in_b0, 0.0) caput(pv.zebra1_out1_ttl, 0.0) @@ -94,7 +96,7 @@ def write_parameter_file(): param_path = "/dls_sw/i24/scripts/extruder/" param_fid = "parameters.txt" - lg.info("%s Writing Parameter File \n%s" % (name, param_path + param_fid)) + logger.info("%s Writing Parameter File \n%s" % (name, param_path + param_fid)) print("\nWriting Parameter File ", param_path + param_fid) visit = caget(pv.ioc12_gp1) @@ -120,7 +122,7 @@ def write_parameter_file(): # high probability of users accidentally overwriting data. Use a dash filename = filename + "-" print("Requested filename ends in a number. Appended dash:", filename) - lg.info("%s Requested filename ends in a number. Appended dash") + logger.info("%s Requested filename ends in a number. Appended dash") f = open(param_path + param_fid, "w") f.write("visit \t\t%s\n" % visit) @@ -135,16 +137,16 @@ def write_parameter_file(): f.write("pump_delay \t%s\n" % pump_delay) f.close() - lg.info("%s visit %s" % (name, visit)) - lg.info("%s directory %s" % (name, directory)) - lg.info("%s filename %s" % (name, filename)) - lg.info("%s num_imgs %s" % (name, num_imgs)) - lg.info("%s exp_time %s" % (name, exp_time)) - lg.info("%s det_dist %s" % (name, det_dist)) - lg.info("%s det_type %s" % (name, det_type)) - lg.info("%s pump_probe %s" % (name, pump_status)) - lg.info("%s pump_exp %s" % (name, pump_exp)) - lg.info("%s pump_delay %s" % (name, pump_delay)) + logger.info("%s visit %s" % (name, visit)) + logger.info("%s directory %s" % (name, directory)) + logger.info("%s filename %s" % (name, filename)) + logger.info("%s num_imgs %s" % (name, num_imgs)) + logger.info("%s exp_time %s" % (name, exp_time)) + logger.info("%s det_dist %s" % (name, det_dist)) + logger.info("%s det_type %s" % (name, det_type)) + logger.info("%s pump_probe %s" % (name, pump_status)) + logger.info("%s pump_exp %s" % (name, pump_exp)) + logger.info("%s pump_delay %s" % (name, pump_delay)) print("\n") print("visit:", visit) @@ -202,7 +204,7 @@ def scrape_parameter_file(): def run_extruderi24(): print("Starting i24") name = inspect.stack()[0][3] - lg.info("%s" % name) + logger.info("%s" % name) start_time = datetime.now() print("Start time", start_time.ctime()) @@ -221,7 +223,7 @@ def run_extruderi24(): pump_delay, ) = scrape_parameter_file() - lg.info("%s Start Time = % s" % (name, start_time)) + logger.info("%s Start Time = % s" % (name, start_time)) # Setting up the beamline caput("BL24I-PS-SHTR-01:CON", "Reset") @@ -241,8 +243,8 @@ def run_extruderi24(): filepath = visit + directory print("Filepath", filepath) print("Filename", filename) - lg.info("%s Filepath %s" % (name, filepath)) - lg.info("%s Filename %s" % (name, filename)) + logger.info("%s Filepath %s" % (name, filepath)) + logger.info("%s Filename %s" % (name, filename)) # For zebra # The below will need to be determined emprically. A value of 0.0 may be ok (????) @@ -263,16 +265,18 @@ def run_extruderi24(): if det_type == "pilatus": print("Using pilatus mini cbf") caput(pv.pilat_cbftemplate, 0) - lg.info("%s Pilatus quickshot setup: filepath %s" % (name, filepath)) - lg.info("%s Pilatus quickshot setup: filepath %s" % (name, filename)) - lg.info("%s Pilatus quickshot setup: number of images %s" % (name, num_imgs)) - lg.info("%s Pilatus quickshot setup: exposure time %s" % (name, exp_time)) + logger.info("%s Pilatus quickshot setup: filepath %s" % (name, filepath)) + logger.info("%s Pilatus quickshot setup: filepath %s" % (name, filename)) + logger.info( + "%s Pilatus quickshot setup: number of images %s" % (name, num_imgs) + ) + logger.info("%s Pilatus quickshot setup: exposure time %s" % (name, exp_time)) if pump_status == "true": print("pump probe experiment") - lg.info("%s Pump probe extruder data collection" % name) - lg.info("%s Pump exposure time %s" % (name, pump_exp)) - lg.info("%s Pump delay time %s" % (name, pump_delay)) + logger.info("%s Pump probe extruder data collection" % name) + logger.info("%s Pump exposure time %s" % (name, pump_exp)) + logger.info("%s Pump delay time %s" % (name, pump_delay)) sup.pilatus("fastchip", [filepath, filename, num_imgs, exp_time]) sup.zebra1( "zebratrigger-pilatus", @@ -289,7 +293,7 @@ def run_extruderi24(): ) elif pump_status == "false": print("Static experiment: no photoexcitation") - lg.info("%s Static experiment: no photoexcitation" % name) + logger.info("%s Static experiment: no photoexcitation" % name) sup.pilatus("quickshot", [filepath, filename, num_imgs, exp_time]) gate_start = 1.0 gate_width = (float(exp_time) * float(num_imgs)) + float(0.5) @@ -298,16 +302,16 @@ def run_extruderi24(): elif det_type == "eiger": # Test moving seqID+1 to here caput(pv.eiger_seqID, int(caget(pv.eiger_seqID)) + 1) - lg.info("%s Eiger quickshot setup: filepath %s" % (name, filepath)) - lg.info("%s Eiger quickshot setup: filepath %s" % (name, filename)) - lg.info("%s Eiger quickshot setup: number of images %s" % (name, num_imgs)) - lg.info("%s Eiger quickshot setup: exposure time %s" % (name, exp_time)) + logger.info("%s Eiger quickshot setup: filepath %s" % (name, filepath)) + logger.info("%s Eiger quickshot setup: filepath %s" % (name, filename)) + logger.info("%s Eiger quickshot setup: number of images %s" % (name, num_imgs)) + logger.info("%s Eiger quickshot setup: exposure time %s" % (name, exp_time)) if pump_status == "true": print("pump probe experiment") - lg.info("%s Pump probe extruder data collection" % name) - lg.info("%s Pump exposure time %s" % (name, pump_exp)) - lg.info("%s Pump delay time %s" % (name, pump_delay)) + logger.info("%s Pump probe extruder data collection" % name) + logger.info("%s Pump exposure time %s" % (name, pump_exp)) + logger.info("%s Pump delay time %s" % (name, pump_delay)) sup.eiger("triggered", [filepath, filename, num_imgs, exp_time]) sup.zebra1( "zebratrigger-eiger", @@ -324,13 +328,13 @@ def run_extruderi24(): ) elif pump_status == "false": print("Static experiment: no photoexcitation") - lg.info("%s Static experiment: no photoexcitation" % name) + logger.info("%s Static experiment: no photoexcitation" % name) gate_start = 1.0 gate_width = (float(exp_time) * float(num_imgs)) + float(0.5) sup.eiger("quickshot", [filepath, filename, num_imgs, exp_time]) sup.zebra1("quickshot", [gate_start, gate_width]) else: - lg.warning("%s Unknown Detector Type, det_type = %s" % (name, det_type)) + logger.warning("%s Unknown Detector Type, det_type = %s" % (name, det_type)) print("Unknown detector type") # Do DCID creation BEFORE arming the detector @@ -346,7 +350,7 @@ def run_extruderi24(): # Collect print("\nFast Shutter Opening") - lg.info("%s Fast shutter opened" % (name)) + logger.info("%s Fast shutter opened" % (name)) caput(pv.zebra1_soft_in_b1, 1) if det_type == "pilatus": print("pilatus acquire ON") @@ -378,7 +382,7 @@ def run_extruderi24(): i += 1 if int(caget(pv.ioc12_gp8)) != 0: aborted = True - lg.warning("%s Data Collection Aborted" % (name)) + logger.warning("%s Data Collection Aborted" % (name)) print(50 * "ABORTED ") if det_type == "pilatus": caput(pv.pilat_acquire, 0) @@ -393,14 +397,16 @@ def run_extruderi24(): else: aborted = True print("Data Collection ended due to GP 8 not equalling 0") - lg.warning("%s Data Collection ended due to GP 8 not equalling 0" % (name)) + logger.warning( + "%s Data Collection ended due to GP 8 not equalling 0" % (name) + ) break break print("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") caput(pv.ioc12_gp8, 1) print("\nFast Shutter Closing") - lg.info("%s Fast shutter closed" % (name)) + logger.info("%s Fast shutter closed" % (name)) caput(pv.zebra1_soft_in_b1, 0) print("\nZebra DISARMED") caput(pv.zebra1_pc_disarm, 1) @@ -436,11 +442,12 @@ def run_extruderi24(): dcid.notify_end() print("Start time", start_time.ctime()) print("End time", end_time.ctime()) - lg.info("%s End Time = %s" % (name, end_time)) + logger.info("%s End Time = %s" % (name, end_time)) return 1 def main(args): + setup_logging() command = args[0] print(args) print("done") diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py index 2415c6e50..39d4fbd22 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py @@ -2,7 +2,7 @@ Fixed target data collection """ import inspect -import logging as lg +import logging import os import pathlib import sys @@ -12,6 +12,7 @@ import numpy as np +from mx_bluesky.I24.serial import log from mx_bluesky.I24.serial.dcid import DCID, SSXType from mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1 import moveto from mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1 import ( @@ -22,17 +23,13 @@ from mx_bluesky.I24.serial.setup_beamline import setup_beamline as sup from mx_bluesky.I24.serial.write_nexus import call_nexgen +logger = logging.getLogger("I24ssx.fixed_target") -def set_up_logging(): + +def setup_logging(): # Log should now change name daily. - fh = lg.FileHandler(filename=time.strftime("logs/i24_%Y_%m_%d.log")) - fh.setFormatter(lg.Formatter("%(asctime)s %(levelname)s: \t%(message)s")) - fh.setLevel(lg.DEBUG) - console = lg.StreamHandler(sys.stdout) - console.setFormatter(lg.Formatter("%(message)s")) - lg.basicConfig(handlers=[fh, console]) - # Old logging - # lg.basicConfig(format='%(asctime)s %(levelname)s: \t%(message)s',level=lg.DEBUG, filename='i24_march21.log') + logfile = time.strftime("i24_%Y_%m_%d.log").lower() + log.config(logfile) def flush_print(text): @@ -51,7 +48,7 @@ def get_chip_prog_values( n_exposures=1, ): name = inspect.stack()[0][3] - lg.info("%s" % name) + logger.info("%s" % name) # Hack for sacla3 to bismuth chip type for oxford inner if chip_type in ["0", "1", "5", "7", "8", "10"]: ( @@ -69,17 +66,6 @@ def get_chip_prog_values( y_block_size = ((y_num_steps - 1) * w2w) + b2b_vert """ - print 'rrrrrrrrrrrrrrrrrrrrrrrrrrrrr' - print x_num_steps - print y_num_steps - print xblocks - print yblocks - print w2w - print b2b_horz - print b2b_vert - print x_block_size - print y_block_size - print 'rrrrrrrrrrrrrrrrrrrrrrrrrrrrr' '0' = 'Toronto' = [9, 9, 12, 12, 0.125, 2.2 , 2.5 ] '1' = 'Oxford ' = [8, 8, 20, 20, 0.125, 3.175, 3.175] '2' = 'Hamburg' = [3, 3, 53, 53, 0.150, 8.58 , 8.58 ] @@ -89,18 +75,18 @@ def get_chip_prog_values( elif chip_type == "2": if caget(pv.me14e_gp2) == 2: print("Full Mapping on Hamburg -> xblocks = 6") - lg.info("%s Full Mapping on Hamburg -> xblocks = 6" % name) + logger.info("%s Full Mapping on Hamburg -> xblocks = 6" % name) xblocks = 6 else: xblocks = 3 elif chip_type == "3": - lg.debug("%s\t:Hack for SACLA3 bismuth for oxford inner" % name) + logger.debug("%s\t:Hack for SACLA3 bismuth for oxford inner" % name) chip_type = "1" elif chip_type == "4": print("This is a Bismuth Chip") - lg.info("%s This is a Bismuth Chip" % name) + logger.info("%s This is a Bismuth Chip" % name) x_num_steps = caget(pv.me14e_gp6) y_num_steps = caget(pv.me14e_gp7) x_step_size = caget(pv.me14e_gp8) @@ -112,7 +98,7 @@ def get_chip_prog_values( elif chip_type == "6": print("This is a Custom Chip") - lg.info("%s This is a Custom Chip" % name) + logger.info("%s This is a Custom Chip" % name) x_num_steps = caget(pv.me14e_gp6) y_num_steps = caget(pv.me14e_gp7) x_step_size = caget(pv.me14e_gp8) @@ -123,7 +109,7 @@ def get_chip_prog_values( y_block_size = 0 # placeholder else: print("Unknown chip_type. oh no") - lg.warning("%s Unknown chip_type, chip_type = %s" % (name, chip_type)) + logger.warning("%s Unknown chip_type, chip_type = %s" % (name, chip_type)) # this is where p variables for fast laser expts will be set if pump_repeat in ["0", "1", "2"]: @@ -140,7 +126,7 @@ def get_chip_prog_values( pump_repeat_pvar = 10 else: print("Unknown pump_repeat") - lg.warning("%s Unknown pump_repeat, pump_repeat = %s" % (name, pump_repeat)) + logger.warning("%s Unknown pump_repeat, pump_repeat = %s" % (name, pump_repeat)) if pump_repeat == "2": pump_in_probe = 1 @@ -182,7 +168,7 @@ def load_motion_program_data(motion_program_dict, map_type, pump_repeat): print("Loading prog vars for chip") print("pump_repeat", pump_repeat) name = inspect.stack()[0][3] - lg.info("%s loading program variables for chip" % name) + logger.info("%s loading program variables for chip" % name) if pump_repeat == "0": print("pump delay is 0") if map_type == "0": @@ -192,7 +178,7 @@ def load_motion_program_data(motion_program_dict, map_type, pump_repeat): elif map_type == "2": prefix = 13 else: - lg.warning("%s Unknown Map Type, map_type = %s" % (name, map_type)) + logger.warning("%s Unknown Map Type, map_type = %s" % (name, map_type)) print("Unknown map_type") elif pump_repeat in ["1", "2", "3", "4", "5", "6", "7"]: print("pump repeat is", pump_repeat) @@ -216,7 +202,7 @@ def load_motion_program_data(motion_program_dict, map_type, pump_repeat): # caput(pv.me14e_pmac_str, 'P1432=10') else: - lg.warning("%s Unknown Pump repeat, pump_repeat = %s" % (name, pump_repeat)) + logger.warning("%s Unknown Pump repeat, pump_repeat = %s" % (name, pump_repeat)) print("Unknown pump_repeat") for key in sorted(motion_program_dict.keys()): @@ -226,62 +212,66 @@ def load_motion_program_data(motion_program_dict, map_type, pump_repeat): value = str(v[1]) s = "P" + str(pvar) + "=" + str(value) print(key, "\t", s) - lg.info("%s %s \t %s" % (name, key, s)) + logger.info("%s %s \t %s" % (name, key, s)) caput(pv.me14e_pmac_str, s) sleep(0.02) sleep(0.2) print("done") - lg.info("%s done" % name) + logger.info("%s done" % name) def get_prog_num(chip_type, map_type, pump_repeat): name = inspect.stack()[0][3] - lg.info("%s Get Program Number" % name) + logger.info("%s Get Program Number" % name) # Hack for sacla3 to bismuth chip type for oxford inner if str(pump_repeat) == "0": if str(chip_type) == "3": - lg.debug("%s\t:Hack for SACLA3 bismuth for oxford inner" % name) + logger.debug("%s\t:Hack for SACLA3 bismuth for oxford inner" % name) chip_type = "1" if chip_type in ["0", "1", "2", "5", "10"]: if map_type == "0": - lg.info("%s\t:Map Type = None" % name) + logger.info("%s\t:Map Type = None" % name) print("Map Type is None") return 11 elif map_type == "1": - lg.info("%s\t:Map Type = Mapping Lite" % name) + logger.info("%s\t:Map Type = Mapping Lite" % name) print("Map Type is Mapping Lite") return 12 elif map_type == "2": - lg.info("%s\t:Map Type = FULL" % name) - lg.debug("%s\t:Mapping Type FULL is broken as of 11.09.17" % name) + logger.info("%s\t:Map Type = FULL" % name) + logger.debug("%s\t:Mapping Type FULL is broken as of 11.09.17" % name) print("Map Type is FULL") return 13 else: - lg.debug("%s\t:Unknown Mapping Type; map_type = %s" % (name, map_type)) + logger.debug( + "%s\t:Unknown Mapping Type; map_type = %s" % (name, map_type) + ) print("Unknown map_type") print(map_type) return 0 elif chip_type == "4": - lg.info("%s\t:Bismuth Chip Type 2" % name) + logger.info("%s\t:Bismuth Chip Type 2" % name) print("Bismuth Chip Type 2") return 12 elif chip_type == "6": - lg.info("%s\t:Custom Chip" % name) + logger.info("%s\t:Custom Chip" % name) print("Custom Chip Type") return 11 elif chip_type in ["7", "8"]: - lg.info("%s\t:Heidelberg Chip" % name) + logger.info("%s\t:Heidelberg Chip" % name) print("Heidelberg Chip Type") return 11 else: - lg.debug("%s\t:Unknown chip_type, chip_tpe = = %s" % (name, chip_type)) + logger.debug("%s\t:Unknown chip_type, chip_tpe = = %s" % (name, chip_type)) print("Unknown Chip Type") elif pump_repeat in ["1", "2", "3", "4", "5", "6", "7"]: - lg.info("%s\t:Map Type = Mapping Lite with Pump probe" % name) + logger.info("%s\t:Map Type = Mapping Lite with Pump probe" % name) print("Map Type is Mapping Lite with Pump Probe") return 14 else: - lg.debug("%s\t:Unknown pump_repeat, pump_repeat = = %s" % (name, pump_repeat)) + logger.debug( + "%s\t:Unknown pump_repeat, pump_repeat = = %s" % (name, pump_repeat) + ) print("Unknown Pump Delay") @@ -310,7 +300,7 @@ def datasetsizei24(): # Chip Type 6 is Custom print("Calculating total number of images") total_numb_imgs = int(int(caget(pv.me14e_gp6)) * int(caget(pv.me14e_gp7))) - lg.info( + logger.info( "%s !!!!!! Calculating total number of images %s" % (name, total_numb_imgs) ) @@ -329,12 +319,12 @@ def datasetsizei24(): f.close() print("block_count", block_count) print(chip_format) - lg.info("%s\t:block_count=%s" % (name, block_count)) - lg.info("%s\t:chip_format=%s" % (name, chip_format)) + logger.info("%s\t:block_count=%s" % (name, block_count)) + logger.info("%s\t:chip_format=%s" % (name, chip_format)) n_exposures = int(caget(pv.me14e_gp3)) print(n_exposures) - lg.info("%s\t:n_exposures=%s" % (name, n_exposures)) + logger.info("%s\t:n_exposures=%s" % (name, n_exposures)) total_numb_imgs = np.prod(chip_format) * block_count * n_exposures @@ -348,16 +338,16 @@ def datasetsizei24(): # print('Unknown pump_repeat') elif map_type == "2": - lg.warning("%s\t:Not Set Up For Full Mapping=%s" % (name)) + logger.warning("%s\t:Not Set Up For Full Mapping=%s" % (name)) print("FIX ME, Im not set up for full mapping ") else: - lg.warning("%s Unknown Map Type, map_type = %s" % (name, map_type)) + logger.warning("%s Unknown Map Type, map_type = %s" % (name, map_type)) print("Unknown map type") print("Total number of images", total_numb_imgs, "\n\n\n") caput(pv.me14e_gp10, total_numb_imgs) - lg.info("%s\t:----->Total number of images = %s" % (name, total_numb_imgs)) + logger.info("%s\t:----->Total number of images = %s" % (name, total_numb_imgs)) return total_numb_imgs @@ -370,7 +360,7 @@ def datasetsizesacla(): # Hack for sacla3 to bismuth chip type for oxford inner if str(chip_type) == "3": - lg.debug("%s\t:Hack for SACLA3 bismuth for oxford inner" % name) + logger.debug("%s\t:Hack for SACLA3 bismuth for oxford inner" % name) chip_type = "1" if map_type == "0": chip_format = get_format(chip_type)[:4] @@ -395,13 +385,13 @@ def datasetsizesacla(): block_count += 1 f.close() print("block_count", block_count) - lg.info("%s\t:block_count=%s" % (name, block_count)) + logger.info("%s\t:block_count=%s" % (name, block_count)) print(chip_format) - lg.info("%s\t:chip_format=%s" % (name, chip_format)) + logger.info("%s\t:chip_format=%s" % (name, chip_format)) # n_exposures = caget(pv.me14e_gp3) print(n_exposures) - lg.info("%s\t:n_exposures=%s" % (name, n_exposures)) + logger.info("%s\t:n_exposures=%s" % (name, n_exposures)) # total_numb_imgs = np.prod(chip_format) * block_count # * n_exposures caput(pv.me14e_gp10, total_numb_imgs) @@ -409,10 +399,10 @@ def datasetsizesacla(): print("Total number of images", total_numb_imgs) elif map_type == "2": - lg.warning("%s Not Set Up For Full Mapping" % name) + logger.warning("%s Not Set Up For Full Mapping" % name) print("FIX ME, Im not set up for full mapping ") else: - lg.warning("%s Unknown Map Type, map_type = %s" % (name, map_type)) + logger.warning("%s Unknown Map Type, map_type = %s" % (name, map_type)) print("Unknown map type") return total_numb_imgs @@ -422,7 +412,7 @@ def start_i24(): """Returns a tuple of (start_time, dcid)""" print("Starting i24") name = inspect.stack()[0][3] - lg.info("%s Starting i24" % name) + logger.info("%s Starting i24" % name) start_time = datetime.now() # run_num = caget(pv.pilat_filenumber) # print(80*'-', run_num) @@ -443,23 +433,23 @@ def start_i24(): det_type, ) = scrape_parameter_file(location="i24") - lg.info("%s Set up beamline" % (name)) + logger.info("%s Set up beamline" % (name)) sup.beamline("collect") sup.beamline("quickshot", [dcdetdist]) - lg.info("%s Set up beamline DONE" % (name)) + logger.info("%s Set up beamline DONE" % (name)) total_numb_imgs = datasetsizei24() filepath = visit + sub_dir filename = chip_name - lg.info("%s Filepath %s" % (name, filepath)) - lg.info("%s Filename %s" % (name, filename)) - lg.info("%s Total number images %s" % (name, total_numb_imgs)) - lg.info("%s Exposure time %s" % (name, exptime)) + logger.info("%s Filepath %s" % (name, filepath)) + logger.info("%s Filename %s" % (name, filename)) + logger.info("%s Total number images %s" % (name, total_numb_imgs)) + logger.info("%s Exposure time %s" % (name, exptime)) print("Acquire Region") - lg.info("%s\t:Acquire Region" % (name)) + logger.info("%s\t:Acquire Region" % (name)) # Testing for new zebra triggering print("ZEBRA TEST ZEBRA TEST ZEBRA TEST ZEBRA TEST") @@ -472,12 +462,12 @@ def start_i24(): if det_type == "pilatus": print("Detector type is Pilatus") - lg.info("%s Fastchip Pilatus setup: filepath %s" % (name, filepath)) - lg.info("%s Fastchip Pilatus setup: filepath %s" % (name, filename)) - lg.info( + logger.info("%s Fastchip Pilatus setup: filepath %s" % (name, filepath)) + logger.info("%s Fastchip Pilatus setup: filepath %s" % (name, filename)) + logger.info( "%s Fastchip Pilatus setup: number of images %s" % (name, total_numb_imgs) ) - lg.info("%s Fastchip Pilatus setup: exposure time %s" % (name, exptime)) + logger.info("%s Fastchip Pilatus setup: exposure time %s" % (name, exptime)) sup.pilatus("fastchip", [filepath, filename, total_numb_imgs, exptime]) @@ -510,7 +500,7 @@ def start_i24(): # FIXME TEMPORARY HACK TO DO SINGLE IMAGE PILATUS DATA COLL TO MKDIR # print("Single image pilatus data collection to create directory") - lg.info("%s single image pilatus data collection" % name) + logger.info("%s single image pilatus data collection" % name) num_imgs = 1 sup.pilatus("quickshot-internaltrig", [filepath, filename, num_imgs, exptime]) print("Sleep 2s for pilatus to arm") @@ -529,12 +519,12 @@ def start_i24(): print("Eiger filepath", filepath) print("Eiger filename", filename) print("Eiger total number of images", total_numb_imgs) - lg.info("%s Triggered Eiger setup: filepath %s" % (name, filepath)) - lg.info("%s Triggered Eiger setup: filename %s" % (name, filename)) - lg.info( + logger.info("%s Triggered Eiger setup: filepath %s" % (name, filepath)) + logger.info("%s Triggered Eiger setup: filename %s" % (name, filename)) + logger.info( "%s Triggered Eiger setup: number of images %s" % (name, total_numb_imgs) ) - lg.info("%s Triggered Eiger setup: exposure time %s" % (name, exptime)) + logger.info("%s Triggered Eiger setup: exposure time %s" % (name, exptime)) sup.eiger("triggered", [filepath, filename, total_numb_imgs, exptime]) @@ -557,7 +547,7 @@ def start_i24(): time.sleep(1.5) else: - lg.warning("%s Unknown Detector Type, det_type = %s" % (name, det_type)) + logger.warning("%s Unknown Detector Type, det_type = %s" % (name, det_type)) print("Unknown detector type") # Open the hutch shutter @@ -575,7 +565,7 @@ def start_i24(): def start_sacla(): print("Starting SACLA") name = inspect.stack()[0][3] - lg.info("%s Starting SACLA" % name) + logger.info("%s Starting SACLA" % name) start_time = time.ctime() total_numb_imgs = datasetsizesacla() @@ -594,7 +584,7 @@ def finish_i24(chip_prog_dict, start_time): det_type = str(caget(pv.me14e_gp101)) print("Finishing I24") - lg.info("%s Finishing I24, Detector Type %s" % (name, det_type)) + logger.info("%s Finishing I24, Detector Type %s" % (name, det_type)) ( chip_name, @@ -682,19 +672,20 @@ def finish_i24(chip_prog_dict, start_time): def finish_sacla(): print("Finishing SACLA") name = inspect.stack()[0][3] - lg.info("%s Finishing SACLA" % name) + logger.info("%s Finishing SACLA" % name) caput(pv.me14e_pmac_str, "!x0y0z0") - lg.info("%s pmac_str=!x0y0z0" % name) + logger.info("%s pmac_str=!x0y0z0" % name) end_time = time.ctime() return end_time def main(location="i24"): + setup_logging() print("Location is", location, "Starting") # ABORT BUTTON name = inspect.stack()[0][3] - lg.info("%s" % name) - lg.info("%s Location is %s \n Starting" % (name, location)) + logger.info("%s" % name) + logger.info("%s Location is %s \n Starting" % (name, location)) caput(pv.me14e_gp9, 0) if location == "i24": @@ -721,9 +712,9 @@ def main(location="i24"): print("dcdetdist", dcdetdist) print("n_exposures", n_exposures) print("det_type", det_type) - lg.info("%s exptime = %s" % (name, exptime)) - lg.info("%s visit = %s" % (name, visit)) - lg.info("%s dcdetdist = %s" % (name, dcdetdist)) + logger.info("%s exptime = %s" % (name, exptime)) + logger.info("%s visit = %s" % (name, visit)) + logger.info("%s dcdetdist = %s" % (name, dcdetdist)) else: ( chip_name, @@ -745,20 +736,20 @@ def main(location="i24"): print("prepumpexptime", prepumpexptime) print("Getting Prog Dictionary") - lg.info("%s Chip name is %s" % (name, chip_name)) - lg.info("%s sub_dir = %s" % (name, sub_dir)) - lg.info("%s n_exposures = %s" % (name, n_exposures)) - lg.info("%s chip_type = %s" % (name, chip_type)) - lg.info("%s map_type = %s" % (name, map_type)) - lg.info("%s pump_repeat = %s" % (name, pump_repeat)) - lg.info("%s pumpexptime = %s" % (name, pumpexptime)) - lg.info("%s pumpdelay = %s" % (name, pumpdelay)) - lg.info("%s prepumpexptime = %s" % (name, prepumpexptime)) - lg.info("%s Getting Program Dictionary" % (name)) + logger.info("%s Chip name is %s" % (name, chip_name)) + logger.info("%s sub_dir = %s" % (name, sub_dir)) + logger.info("%s n_exposures = %s" % (name, n_exposures)) + logger.info("%s chip_type = %s" % (name, chip_type)) + logger.info("%s map_type = %s" % (name, map_type)) + logger.info("%s pump_repeat = %s" % (name, pump_repeat)) + logger.info("%s pumpexptime = %s" % (name, pumpexptime)) + logger.info("%s pumpdelay = %s" % (name, pumpdelay)) + logger.info("%s prepumpexptime = %s" % (name, prepumpexptime)) + logger.info("%s Getting Program Dictionary" % (name)) # If alignment type is Oxford inner it is still an Oxford type chip if str(chip_type) == "3": - lg.debug("%s\tMain: Change chip type Oxford Inner to Oxford" % name) + logger.debug("%s\tMain: Change chip type Oxford Inner to Oxford" % name) chip_type = "1" if location == "i24": @@ -777,7 +768,7 @@ def main(location="i24"): chip_type, location, n_exposures=n_exposures ) print("Loading Motion Program Data") - lg.info("%s Loading Motion Program Data" % (name)) + logger.info("%s Loading Motion Program Data" % (name)) load_motion_program_data(chip_prog_dict, map_type, pump_repeat) if location == "i24": @@ -785,21 +776,21 @@ def main(location="i24"): elif location == "SACLA": start_time = start_sacla() else: - lg.warning( + logger.warning( "%s This does nothing location not I24 or SACLA \n location = %s" % (name, location) ) - lg.debug("%s Put something here... start_time = start_sacla()" % (name)) + logger.debug("%s Put something here... start_time = start_sacla()" % (name)) print("Something went wrong. Location not specified") print("Moving to Start") - lg.info("%s Moving to start" % (name)) + logger.info("%s Moving to start" % (name)) caput(pv.me14e_pmac_str, "!x0y0z0") sleep(2.0) prog_num = get_prog_num(chip_type, map_type, pump_repeat) - lg.info("%s prog_num = %s" % (name, prog_num)) - lg.info("%s Resting" % (name)) + logger.info("%s prog_num = %s" % (name, prog_num)) + logger.info("%s Resting" % (name)) # Now ready for data collection. Open fast shutter caput(pv.zebra1_soft_in_b1, "1") # Open fast shutter (zebra gate) @@ -807,8 +798,8 @@ def main(location="i24"): print("Running pmac program number", prog_num) print("pmacing") - lg.info("%s pmacing" % (name)) - lg.info("%s pmac str = &2b%sr" % (name, prog_num)) + logger.info("%s pmacing" % (name)) + logger.info("%s pmac str = &2b%sr" % (name, prog_num)) caput(pv.me14e_pmac_str, "&2b%sr" % prog_num) sleep(1.0) @@ -825,7 +816,7 @@ def main(location="i24"): ) print("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") - lg.info("%s Data Collection running" % (name)) + logger.info("%s Data Collection running" % (name)) aborted = False while True: @@ -840,7 +831,7 @@ def main(location="i24"): i += 1 if int(caget(pv.me14e_gp9)) != 0: aborted = True - lg.warning("%s Data Collection Aborted" % (name)) + logger.warning("%s Data Collection Aborted" % (name)) print(50 * "ABORTED ") caput(pv.me14e_pmac_str, "A") sleep(1.0) @@ -848,15 +839,12 @@ def main(location="i24"): break elif int(caget(pv.me14e_scanstatus)) == 0: print(caget(pv.me14e_scanstatus)) - lg.warning("%s Data Collection Finished" % (name)) + logger.warning("%s Data Collection Finished" % (name)) print("\n", 20 * "DONE ") break - # if int(caget(pv.pilat_acquire)) == 'Done': - # print '\n', 20*'DONE ' - # break else: aborted = True - lg.info("%s Data Collection ended due to GP 9 not equalling 0" % (name)) + logger.info("%s Data Collection ended due to GP 9 not equalling 0" % (name)) break break print("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") @@ -882,14 +870,13 @@ def main(location="i24"): if location == "SACLA": end_time = finish_sacla() - lg.info("%s Chip name = %s sub_dir = %s" % (name, chip_name, sub_dir)) + logger.info("%s Chip name = %s sub_dir = %s" % (name, chip_name, sub_dir)) print("Start time:", start_time) - lg.info("%s Start Time = % s" % (name, start_time)) + logger.info("%s Start Time = % s" % (name, start_time)) print("End time: ", end_time) - lg.info("%s End Time = %s" % (name, end_time)) + logger.info("%s End Time = %s" % (name, end_time)) if __name__ == "__main__": - set_up_logging() # main(location='SACLA') main(location="i24") diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index 9539b0926..7d6555705 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -4,7 +4,7 @@ """ import inspect -import logging as lg +import logging import os import sys import time @@ -12,16 +12,18 @@ import numpy as np +from mx_bluesky.I24.serial import log from mx_bluesky.I24.serial.fixed_target import i24ssx_Chip_Mapping_py3v1 as mapping from mx_bluesky.I24.serial.fixed_target import i24ssx_Chip_StartUp_py3v1 as startup from mx_bluesky.I24.serial.setup_beamline import caget, caput, pv -# Log should now change name daily. -lg.basicConfig( - format="%(asctime)s %(levelname)s: \t%(message)s", - level=lg.DEBUG, - filename=time.strftime("logs/i24_%d%B%y.log").lower(), -) +logger = logging.getLogger("I24ssx.chip_manager") + + +def setup_logging(): + # Log should now change name daily. + logfile = time.strftime("i24_%Y_%m_%d.log").lower() + log.config(logfile) def whereami(): @@ -34,26 +36,15 @@ def whereami(): IOC = "ME14E" print("location is ", location) print("ioc is", ioc) - lg.info("%s location and visit: %s" % (location, ioc)) + logger.info("%s location and visit: %s" % (location, ioc)) return location, ioc, IOC def initialise(): - # location, ioc, IOC = whereami() - # caput(getattr(pv, ioc + "_stage_x") + '.HLM', 22) - # caget(getattr(pv, ioc + "_stage_x") + '.RBV')) - # commented out filter lines 230719 as this stage not connected name = inspect.stack()[0][3] - lg.info("%s Setting VMAX VELO ACCL HHL LLM" % name) - # location = 'i24' - # if location == 'i24': - # ioc = 'me14e' - # IOC = 'ME14E' - # print('yeeeeaaaaaahh') - # print('location is', location) - # print('ioc is', ioc) + logger.info("%s Setting VMAX VELO ACCL HHL LLM" % name) caput(pv.me14e_stage_x + ".VMAX", 20) caput(pv.me14e_stage_y + ".VMAX", 20) @@ -96,7 +87,7 @@ def initialise(): sleep(0.1) print("Clearing") - lg.info("%s Clearing General Purpose PVs 1-120" % name) + logger.info("%s Clearing General Purpose PVs 1-120" % name) for i in range(4, 120): # pvar = IOC + '-MO-IOC-01:GP' + str(i) pvar = "ME14E-MO-IOC-01:GP" + str(i) @@ -108,7 +99,7 @@ def initialise(): caput(pv.me14e_gp101, str(det_type)) print("\n", "Initialisation Complete") - lg.info("%s Complete" % name) + logger.info("%s Complete" % name) def write_parameter_file(): @@ -117,7 +108,7 @@ def write_parameter_file(): param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" # param_path = '/localhome/local/Documents/sacla/parameter_files/' param_fid = "parameters.txt" - lg.info("%s Writing Parameter File \n%s" % (name, param_path + param_fid)) + logger.info("%s Writing Parameter File \n%s" % (name, param_path + param_fid)) print("Writing Parameter File\n", param_path + param_fid) ############################################ @@ -150,7 +141,7 @@ def write_parameter_file(): # high probability of users accidentally overwriting data. Use a dash filename = filename + "-" print("Requested filename ends in a number. Appended dash:", filename) - lg.info("%s Requested filename ends in a number. Appended dash") + logger.info("%s Requested filename ends in a number. Appended dash") # historical - use chip_name instead of filename chip_name = filename @@ -179,17 +170,17 @@ def write_parameter_file(): f.write("det_type \t%s\n" % det_type) f.close() - lg.info("%s visit: %s" % (name, visit)) - lg.info("%s filename: %s" % (name, chip_name)) - lg.info("%s protein_name: %s" % (name, protein_name)) - lg.info("%s n_exposures: %s" % (name, n_exposures)) - lg.info("%s chip_type: %s" % (name, chip_type)) - lg.info("%s map_type: %s" % (name, map_type)) - lg.info("%s pump_repeat: %s" % (name, pump_repeat)) - lg.info("%s pumpexptime: %s" % (name, pumpexptime)) - lg.info("%s pumpdelay: %s" % (name, pumpdelay)) - lg.info("%s prepumpexptime: %s" % (name, prepumpexptime)) - lg.info("%s detector type: %s" % (name, det_type)) + logger.info("%s visit: %s" % (name, visit)) + logger.info("%s filename: %s" % (name, chip_name)) + logger.info("%s protein_name: %s" % (name, protein_name)) + logger.info("%s n_exposures: %s" % (name, n_exposures)) + logger.info("%s chip_type: %s" % (name, chip_type)) + logger.info("%s map_type: %s" % (name, map_type)) + logger.info("%s pump_repeat: %s" % (name, pump_repeat)) + logger.info("%s pumpexptime: %s" % (name, pumpexptime)) + logger.info("%s pumpdelay: %s" % (name, pumpdelay)) + logger.info("%s prepumpexptime: %s" % (name, prepumpexptime)) + logger.info("%s detector type: %s" % (name, det_type)) print("visit:", visit) print("filename:", chip_name) @@ -242,7 +233,7 @@ def define_current_chip(chipid): """ chip_type = caget(pv.me14e_gp1) print(chip_type, chipid) - lg.info("%s chip_type:%s chipid:%s" % (name, chip_type, chipid)) + logger.info("%s chip_type:%s chipid:%s" % (name, chip_type, chipid)) if chipid == "toronto": caput(pv.me14e_gp1, 0) elif chipid == "oxford": @@ -261,13 +252,13 @@ def define_current_chip(chipid): param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" # param_path = '/localhome/local/Documents/sacla/parameter_files/' f = open(param_path + chipid + ".pvar", "r") - lg.info("%s Opening %s%s.pvar" % (name, param_path, chipid)) + logger.info("%s Opening %s%s.pvar" % (name, param_path, chipid)) for line in f.readlines(): if line.startswith("#"): continue line_from_file = line.rstrip("\n") print(line_from_file) - lg.info("%s %s" % (name, line_from_file)) + logger.info("%s %s" % (name, line_from_file)) caput(pv.me14e_pmac_str, line_from_file) print(10 * "Done ") @@ -278,27 +269,27 @@ def save_screen_map(): litemap_path = "/dls_sw/i24/scripts/fastchips/litemaps/" # litemap_path = '/localhome/local/Documents/sacla/parameter_files/' print("\n\nSaving", litemap_path + "currentchip.map") - lg.info("%s Saving %s currentchip.map" % (name, litemap_path)) + logger.info("%s Saving %s currentchip.map" % (name, litemap_path)) f = open(litemap_path + "currentchip.map", "w") print("Printing only blocks with block_val == 1") - lg.info("%s Printing only blocks with block_val == 1" % name) + logger.info("%s Printing only blocks with block_val == 1" % name) for x in range(1, 82): block_str = "ME14E-MO-IOC-01:GP%i" % (x + 10) block_val = int(caget(block_str)) if block_val == 1: print(block_str, block_val) - lg.info("%s %s %s" % (name, block_str, block_val)) + logger.info("%s %s %s" % (name, block_str, block_val)) line = "%02dstatus P3%02d1 \t%s\n" % (x, x, block_val) f.write(line) f.close() print(10 * "Done ") - lg.info("%s %s" % (name, 10 * "Done")) + logger.info("%s %s" % (name, 10 * "Done")) return 0 def upload_parameters(chipid): name = inspect.stack()[0][3] - lg.info("%s Uploading Parameters to the GeoBrick" % (name)) + logger.info("%s Uploading Parameters to the GeoBrick" % (name)) if chipid == "toronto": caput(pv.me14e_gp1, 0) width = 9 @@ -322,8 +313,8 @@ def upload_parameters(chipid): f = open(litemap_path + "currentchip.map", "r") print("chipid", chipid) print(width) - lg.info("%s chipid %s" % (name, chipid)) - lg.info("%s width %s" % (name, width)) + logger.info("%s chipid %s" % (name, chipid)) + logger.info("%s width %s" % (name, width)) x = 1 for line in f.readlines()[: width**2]: cols = line.split() @@ -345,10 +336,10 @@ def upload_parameters(chipid): sleep(0.02) print() # print 'Setting Mapping Type to Lite' - lg.warning("%s Automatic Setting Mapping Type to Lite has been disabled" % name) + logger.warning("%s Automatic Setting Mapping Type to Lite has been disabled" % name) # caput(pv.me14e_gp2, 1) print(10 * "Done ") - lg.info("%s %s" % (name, 10 * "Done")) + logger.info("%s %s" % (name, 10 * "Done")) def upload_full(): @@ -363,17 +354,17 @@ def upload_full(): pmac_list.append(f.pop(0).rstrip("\n")) writeline = " ".join(pmac_list) print(writeline) - lg.info("%s %s" % (name, writeline)) + logger.info("%s %s" % (name, writeline)) caput(pv.me14e_pmac_str, writeline) sleep(0.02) print(10 * "Done ") - lg.info("%s %s" % (name, 10 * "Done")) + logger.info("%s %s" % (name, 10 * "Done")) def load_stock_map(map_choice): name = inspect.stack()[0][3] - lg.info("%s Adjusting Lite Map EDM Screen" % name) + logger.info("%s Adjusting Lite Map EDM Screen" % name) print("Please wait, adjusting lite map") # r33 = [19, 18, 17, 26, 31, 32, 33, 24, 25] @@ -558,16 +549,16 @@ def load_stock_map(map_choice): map_dict["half2"] = half2 print("Clearing") - lg.info("%s Clearing GP 10-74" % name) + logger.info("%s Clearing GP 10-74" % name) for i in range(1, 65): pvar = "ME14E-MO-IOC-01:GP" + str(i + 10) caput(pvar, 0) sys.stdout.write(".") sys.stdout.flush() print("\nMap cleared") - lg.info("%s Cleared Map" % name) + logger.info("%s Cleared Map" % name) print("Loading map_choice", map_choice) - lg.info("%s Loading Map Choice %s" % (name, map_choice)) + logger.info("%s Loading Map Choice %s" % (name, map_choice)) for i in map_dict[map_choice]: pvar = "ME14E-MO-IOC-01:GP" + str(i + 10) caput(pvar, 1) @@ -617,11 +608,11 @@ def load_lite_map(): # fmt: on chip_type = caget(pv.me14e_gp1) if chip_type == 0: - lg.info("%s Toronto Block Order" % name) + logger.info("%s Toronto Block Order" % name) print("Toronto Block Order") block_dict = toronto_block_dict elif chip_type == 1 or chip_type == 3 or chip_type == 10: - lg.info("%s Oxford Block Order" % name) + logger.info("%s Oxford Block Order" % name) print("Oxford Block Order") # block_dict = oxford_block_dict rows = ["A", "B", "C", "D", "E", "F", "G", "H"] @@ -642,7 +633,7 @@ def load_lite_map(): elif flip is True: z = 8 - (y + 1) else: - lg.warning("%s Problem in Chip Grid Creation" % name) + logger.warning("%s Problem in Chip Grid Creation" % name) print("something is wrong with chip grid creation") break button_name = str(row) + str(column) @@ -653,11 +644,11 @@ def load_lite_map(): block_dict = btn_names elif chip_type == 2: print("Hamburg Block Order") - lg.info("%s Hamburg Block Order" % name) + logger.info("%s Hamburg Block Order" % name) block_dict = hamburg_block_dict elif chip_type == 5: print("Regina Block Order") - lg.info("%s Regina Block Order" % name) + logger.info("%s Regina Block Order" % name) block_dict = regina_block_dict # litemap_path = '/dls_sw/i24/scripts/fastchips/litemaps/' @@ -665,8 +656,8 @@ def load_lite_map(): litemap_fid = str(caget(pv.me14e_gp5)) + ".lite" print("Please wait, loading LITE map") print("Opening", litemap_path + litemap_fid) - lg.info("%s Loading Lite Map" % name) - lg.info("%s Opening %s" % (name, litemap_path + litemap_fid)) + logger.info("%s Loading Lite Map" % name) + logger.info("%s Opening %s" % (name, litemap_path + litemap_fid)) f = open(litemap_path + litemap_fid, "r") for line in f.readlines(): entry = line.split() @@ -674,7 +665,7 @@ def load_lite_map(): yesno = entry[1] block_num = block_dict[block_name] pvar = "ME14E-MO-IOC-01:GP" + str(int(block_num) + 10) - lg.info("%s %s %s %s" % (name, block_name, yesno, pvar)) + logger.info("%s %s %s %s" % (name, block_name, yesno, pvar)) print(block_name, yesno, pvar) caput(pvar, yesno) print(10 * "Done ") @@ -703,14 +694,14 @@ def load_full_map(location="SACLA"): fullmap_path = "/localhome/local/Documents/sacla/parameter_files/" fullmap_fid = fullmap_path + str(caget(pv.me14e_gp5)) + ".spec" print("opening", fullmap_fid) - lg.info("%s opening %s" % (name, fullmap_fid)) + logger.info("%s opening %s" % (name, fullmap_fid)) mapping.plot_file(fullmap_fid, chip_type) print("\n\n", 10 * "PNG ") mapping.convert_chip_to_hex(fullmap_fid, chip_type) os.system( "cp %s %s" % (fullmap_fid[:-4] + "full", fullmap_path + "currentchip.full") ) - lg.info( + logger.info( "%s cp %s %s" % (name, fullmap_fid[:-4] + "full", fullmap_path + "currentchip.full") ) @@ -719,13 +710,13 @@ def load_full_map(location="SACLA"): def moveto(place): name = inspect.stack()[0][3] - lg.info("%s Move to %s" % (name, place)) + logger.info("%s Move to %s" % (name, place)) print(5 * (place + " ")) chip_type = int(caget(pv.me14e_gp1)) print("CHIP TYPE", chip_type) if chip_type == 0: print("Toronto Move") - lg.info("%s Toronto Move" % (name)) + logger.info("%s Toronto Move" % (name)) if place == "origin": caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 0.0) @@ -738,7 +729,7 @@ def moveto(place): elif chip_type == 1: print("Oxford Move") - lg.info("%s Oxford Move" % (name)) + logger.info("%s Oxford Move" % (name)) if place == "origin": caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 0.0) @@ -751,7 +742,7 @@ def moveto(place): elif chip_type == 2: print("Hamburg Move") - lg.info("%s Hamburg Move" % (name)) + logger.info("%s Hamburg Move" % (name)) if place == "origin": caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 0.0) @@ -766,7 +757,7 @@ def moveto(place): elif chip_type == 3: print("Oxford Inner Move") - lg.info("%s Oxford Inner Move" % (name)) + logger.info("%s Oxford Inner Move" % (name)) if place == "origin": caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 0.0) @@ -779,7 +770,7 @@ def moveto(place): elif chip_type == 5: print("Regina Move") - lg.info("%s Regina Move" % (name)) + logger.info("%s Regina Move" % (name)) if place == "origin": caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 0.0) @@ -792,7 +783,7 @@ def moveto(place): elif chip_type == 6: print("Custom Move") - lg.info("%s Custom Chip Move" % (name)) + logger.info("%s Custom Chip Move" % (name)) if place == "origin": caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 0.0) @@ -805,7 +796,7 @@ def moveto(place): elif chip_type == 7: print("Heidelberg4 Move") - lg.info("%s Heidelberg4 Chip Move" % (name)) + logger.info("%s Heidelberg4 Chip Move" % (name)) if place == "origin": caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 0.0) @@ -818,7 +809,7 @@ def moveto(place): elif chip_type == 8: print("Heidelberg6 Move") - lg.info("%s Heidelberg6 Chip Move" % (name)) + logger.info("%s Heidelberg6 Chip Move" % (name)) if place == "origin": caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 0.0) @@ -831,7 +822,7 @@ def moveto(place): elif chip_type == 9: print("Minichip Move") - lg.info("%s Minichip Move" % (name)) + logger.info("%s Minichip Move" % (name)) if place == "origin": caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 0.0) @@ -844,7 +835,7 @@ def moveto(place): elif chip_type == 10: print("Oxford 6 by 6 blocks Move") - lg.info("%s Oxford 6 by 6 blocks Move" % (name)) + logger.info("%s Oxford 6 by 6 blocks Move" % (name)) if place == "origin": caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 0.0) @@ -857,22 +848,22 @@ def moveto(place): else: print("Unknown chip_type move") - lg.warning("%s Unknown chip_type move" % name) + logger.warning("%s Unknown chip_type move" % name) # Non Chip Specific Move if place == "zero": - lg.info("%s moving to %s" % (name, place)) + logger.info("%s moving to %s" % (name, place)) caput(pv.me14e_pmac_str, "!x0y0z0") elif place == "yag": - lg.info("%s moving %s" % (name, place)) + logger.info("%s moving %s" % (name, place)) caput(pv.me14e_stage_x, 1.0) caput(pv.me14e_stage_y, 1.0) caput(pv.me14e_stage_z, 1.0) elif place == "load_position": print("load position") - lg.info("%s %s" % (name, place)) + logger.info("%s %s" % (name, place)) # caput(pv.me14e_filter, 20) # caput(pv.me14e_stage_x, -15.0) # caput(pv.me14e_stage_y, 25.0) @@ -887,7 +878,7 @@ def moveto(place): elif place == "collect_position": print("collect position") - lg.info("%s %s" % (name, place)) + logger.info("%s %s" % (name, place)) caput(pv.me14e_filter, 20) caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 0.0) @@ -899,7 +890,7 @@ def moveto(place): elif place == "microdrop_position": print("microdrop align position") - lg.info("%s %s" % (name, place)) + logger.info("%s %s" % (name, place)) # caput(pv.me14e_filter, 20) caput(pv.me14e_stage_x, 6.0) caput(pv.me14e_stage_y, -7.8) @@ -911,24 +902,24 @@ def moveto(place): elif place == "lightin": print("light in") - lg.info("%s Light In" % (name)) + logger.info("%s Light In" % (name)) caput(pv.me14e_filter, 24) elif place == "lightout": print("light out") - lg.info("%s Light Out" % (name)) + logger.info("%s Light Out" % (name)) caput(pv.me14e_filter, -24) elif place == "flipperin": print("flipper in") - lg.info("%s Flipper In" % (name)) - lg.debug("%s nb need M508=100 M509 =150 somewhere" % name) + logger.info("%s Flipper In" % (name)) + logger.debug("%s nb need M508=100 M509 =150 somewhere" % name) # nb need M508=100 M509 =150 somewhere caput(pv.me14e_pmac_str, "M512=0 M511=1") elif place == "flipperout": print("flipper out") - lg.info("%s Flipper out" % (name)) + logger.info("%s Flipper out" % (name)) caput(pv.me14e_pmac_str, " M512=1 M511=1") elif place == "laser1on": @@ -954,24 +945,24 @@ def moveto(place): led_burn_time = caget(pv.me14e_gp103) print("Laser 1 on") print("Burn time is", led_burn_time, "s") - lg.info("Laser 1 on") - lg.info("burntime %s s" % (led_burn_time)) + logger.info("Laser 1 on") + logger.info("burntime %s s" % (led_burn_time)) caput(pv.me14e_pmac_str, " M712=1 M711=1") sleep(int(float(led_burn_time))) print("Laser 1 off") - lg.info("Laser 1 off") + logger.info("Laser 1 off") caput(pv.me14e_pmac_str, " M712=0 M711=1") elif place == "laser2burn": led_burn_time = caget(pv.me14e_gp109) print("Laser 2 on") print("Burn time is", led_burn_time, "s") - lg.info("Laser 2 on") - lg.info("burntime %s s" % (led_burn_time)) + logger.info("Laser 2 on") + logger.info("burntime %s s" % (led_burn_time)) caput(pv.me14e_pmac_str, " M812=1 M811=1") sleep(int(float(led_burn_time))) print("laser 2 off") - lg.info("Laser 2 off") + logger.info("Laser 2 off") caput(pv.me14e_pmac_str, " M812=0 M811=1") @@ -991,7 +982,7 @@ def scrape_mtr_directions(): else: continue f.close() - lg.info( + logger.info( "%s mt1_dir %s mtr2_dir %s mtr3_dir %s" % (name, mtr1_dir, mtr2_dir, mtr3_dir) ) return mtr1_dir, mtr2_dir, mtr3_dir @@ -1025,11 +1016,13 @@ def fiducial(point): print("MTR3\t%1.4f\t%i\t%i\t%1.4f" % (rbv_3, raw_3, mtr3_dir, f_z)) print("Writing Fiducial File", 20 * ("%s " % point)) - lg.info("%s Writing Fiducial File %sfiducial_%s.txt" % (name, param_path, point)) - lg.info("%s MTR\tRBV\tRAW\tCorr\tf_value" % (name)) - lg.info("%s MTR1\t%1.4f\t%i\t%i\t%1.4f" % (name, rbv_1, raw_1, mtr1_dir, f_x)) - lg.info("%s MTR2\t%1.4f\t%i\t%i\t%1.4f" % (name, rbv_2, raw_2, mtr2_dir, f_y)) - lg.info("%s MTR3\t%1.4f\t%i\t%i\t%1.4f" % (name, rbv_3, raw_3, mtr3_dir, f_y)) + logger.info( + "%s Writing Fiducial File %sfiducial_%s.txt" % (name, param_path, point) + ) + logger.info("%s MTR\tRBV\tRAW\tCorr\tf_value" % (name)) + logger.info("%s MTR1\t%1.4f\t%i\t%i\t%1.4f" % (name, rbv_1, raw_1, mtr1_dir, f_x)) + logger.info("%s MTR2\t%1.4f\t%i\t%i\t%1.4f" % (name, rbv_2, raw_2, mtr2_dir, f_y)) + logger.info("%s MTR3\t%1.4f\t%i\t%i\t%1.4f" % (name, rbv_3, raw_3, mtr3_dir, f_y)) f = open(param_path + "fiducial_%s.txt" % point, "w") f.write("MTR\tRBV\tRAW\tCorr\tf_value\n") @@ -1068,7 +1061,7 @@ def cs_maker(): fiducial_dict[9] = [2.375, 2.375] fiducial_dict[10] = [18.25, 18.25] print(chip_type, fiducial_dict[chip_type]) - lg.info( + logger.info( "%s chip type is %s with size %s" % (name, chip_type, fiducial_dict[chip_type]) ) @@ -1106,30 +1099,30 @@ def cs_maker(): Sz = -1 * ((Sz1 + Sz2) / 2) Cz = np.sqrt((1 - Sz**2)) print("Sz1 , %1.4f, %1.4f" % (Sz1, np.degrees(np.arcsin(Sz1)))) - lg.info("%s Sz1 , %1.4f, %1.4f" % (name, Sz1, np.degrees(np.arcsin(Sz1)))) + logger.info("%s Sz1 , %1.4f, %1.4f" % (name, Sz1, np.degrees(np.arcsin(Sz1)))) print("Sz2 , %1.4f, %1.4f" % (Sz2, np.degrees(np.arcsin(Sz2)))) - lg.info("%s Sz2 , %1.4f, %1.4f" % (name, Sz2, np.degrees(np.arcsin(Sz2)))) + logger.info("%s Sz2 , %1.4f, %1.4f" % (name, Sz2, np.degrees(np.arcsin(Sz2)))) print("Sz , %1.4f, %1.4f" % (Sz, np.degrees(np.arcsin(Sz)))) - lg.info("%s Sz , %1.4f, %1.4f" % (name, Sz, np.degrees(np.arcsin(Sz)))) + logger.info("%s Sz , %1.4f, %1.4f" % (name, Sz, np.degrees(np.arcsin(Sz)))) print("Cz , %1.4f, %1.4f\n" % (Cz, np.degrees(np.arccos(Cz)))) - lg.info("%s Cz , %1.4f, %1.4f" % (name, Cz, np.degrees(np.arcsin(Cz)))) + logger.info("%s Cz , %1.4f, %1.4f" % (name, Cz, np.degrees(np.arcsin(Cz)))) # Rotation Around Y # # Sy = f1_z / fiducial_dict[chip_type][0] Sy = 1 * f1_z / fiducial_dict[chip_type][0] Cy = np.sqrt((1 - Sy**2)) print("Sy , %1.4f, %1.4f" % (Sy, np.degrees(np.arcsin(Sy)))) - lg.info("%s Sy , %1.4f, %1.4f" % (name, Sy, np.degrees(np.arcsin(Sy)))) + logger.info("%s Sy , %1.4f, %1.4f" % (name, Sy, np.degrees(np.arcsin(Sy)))) print("Cy , %1.4f, %1.4f\n" % (Cy, np.degrees(np.arccos(Cy)))) - lg.info("%s Cy , %1.4f, %1.4f" % (name, Cy, np.degrees(np.arcsin(Cy)))) + logger.info("%s Cy , %1.4f, %1.4f" % (name, Cy, np.degrees(np.arcsin(Cy)))) # Rotation Around X # # If stages upsidedown (I24) change sign of Sx Sx = -1 * f2_z / fiducial_dict[chip_type][1] # Sx = f2_z / fiducial_dict[chip_type][1] Cx = np.sqrt((1 - Sx**2)) print("Sx , %1.4f, %1.4f" % (Sx, np.degrees(np.arcsin(Sx)))) - lg.info("%s Sx , %1.4f, %1.4f" % (name, Sx, np.degrees(np.arcsin(Sx)))) + logger.info("%s Sx , %1.4f, %1.4f" % (name, Sx, np.degrees(np.arcsin(Sx)))) print("Cx , %1.4f, %1.4f\n" % (Cx, np.degrees(np.arccos(Cx)))) - lg.info("%s Cx , %1.4f, %1.4f" % (name, Cx, np.degrees(np.arcsin(Cx)))) + logger.info("%s Cx , %1.4f, %1.4f" % (name, Cx, np.degrees(np.arcsin(Cx)))) # Crucifix 1: In normal orientation on I24 4 oct 2022 scalex, scaley, scalez = 10018.0, 9999.5, 10000.0 @@ -1184,19 +1177,21 @@ def cs_maker(): # skew = 0.02 print("Skew being used is: %1.4f" % skew) - lg.info("%s Skew being used is: %1.4f" % (name, skew)) + logger.info("%s Skew being used is: %1.4f" % (name, skew)) s1 = np.degrees(np.arcsin(Sz1)) s2 = np.degrees(np.arcsin(Sz2)) rot = np.degrees(np.arcsin((Sz1 + Sz2) / 2)) calc_skew = (s1 - rot) - (s2 - rot) print("s1:%1.4f s2:%1.4f rot:%1.4f" % (s1, s2, rot)) - lg.info("%s s1:%1.4f s2:%1.4f rot:%1.4f" % (name, s1, s2, rot)) + logger.info("%s s1:%1.4f s2:%1.4f rot:%1.4f" % (name, s1, s2, rot)) print("Calculated rotation from current fiducials is: %1.4f" % rot) - lg.info("%s Calculated rotation from current fiducials is: %1.4f" % (name, rot)) + logger.info("%s Calculated rotation from current fiducials is: %1.4f" % (name, rot)) print("Calculated skew from current fiducials is: %1.4f" % calc_skew) - lg.info("%s Calculated Skew from current fiducials is: %1.4f" % (name, calc_skew)) + logger.info( + "%s Calculated Skew from current fiducials is: %1.4f" % (name, calc_skew) + ) print("Calculated skew has been known to have the wrong sign") - lg.info("%s Calculated Skew has been known to have the wrong sign") + logger.info("%s Calculated Skew has been known to have the wrong sign") # skew = calc_skew sinD = np.sin((skew / 2) * (np.pi / 180)) @@ -1210,11 +1205,11 @@ def cs_maker(): cs2 = "#2->%+1.3fX%+1.3fY%+1.3fZ" % (new_x2factor, new_y2factor, z2factor) cs3 = "#3->%+1.3fX%+1.3fY%+1.3fZ" % (x3factor, y3factor, z3factor) print("\n".join([cs1, cs2, cs3])) - lg.info("%s %s" % (name, "\n".join([cs1, cs2, cs3]))) + logger.info("%s %s" % (name, "\n".join([cs1, cs2, cs3]))) print( "These should be 1. This is the sum of the squares of the factors divided by their scale" ) - lg.info( + logger.info( "%s These should be 1. This is the sum of the squares of the factors divided by their scale" % (name) ) @@ -1224,9 +1219,9 @@ def cs_maker(): print(sqfact1) print(sqfact2) print(sqfact3) - lg.info("%s %1.4f \n %1.4f \n %1.4f" % (name, sqfact1, sqfact2, sqfact3)) + logger.info("%s %1.4f \n %1.4f \n %1.4f" % (name, sqfact1, sqfact2, sqfact3)) print("Long wait, please be patient") - lg.info("%s Long wait, please be patient" % (name)) + logger.info("%s Long wait, please be patient" % (name)) caput(pv.me14e_pmac_str, "!x0y0z0") sleep(2.5) caput(pv.me14e_pmac_str, "&2") @@ -1238,7 +1233,7 @@ def cs_maker(): caput(pv.me14e_pmac_str, "#1hmz#2hmz#3hmz") sleep(0.1) print(5 * "chip_type", type(chip_type)) - lg.info("%s Chip_type is %s" % (name, chip_type)) + logger.info("%s Chip_type is %s" % (name, chip_type)) # NEXT THREE LINES COMMENTED OUT FOR CS TESTS 5 JUNE if str(chip_type) == "1": caput(pv.me14e_pmac_str, "!x0.4y0.4") @@ -1304,27 +1299,30 @@ def block_check(): block_start_list = scrape_pvar_file("sacla3_oxford.pvar") for entry in block_start_list: if int(caget(pv.me14e_gp9)) != 0: - lg.warning("%s Block Check Aborted" % (name)) + logger.warning("%s Block Check Aborted" % (name)) print(50 * "Aborted") sleep(1.0) break block, x, y = entry print(block, x, y) - lg.info("%s %s %s %s" % (name, block, x, y)) + logger.info("%s %s %s %s" % (name, block, x, y)) caput(pv.me14e_pmac_str, "!x%sy%s" % (x, y)) time.sleep(0.4) else: print("Block Check Aborted due to GP 9 not equalling 0") - lg.warning("%s Block Check Aborted due to GP 9 not equalling 0" % (name)) + logger.warning( + "%s Block Check Aborted due to GP 9 not equalling 0" % (name) + ) break break print(10 * "Done ") def main(args): + setup_logging() name = inspect.stack()[0][3] print(args) - lg.info("%s \n\n%s" % (name, args)) + logger.info("%s \n\n%s" % (name, args)) if args[1] == "initialise": initialise() elif args[1] == "pvar_test": @@ -1365,7 +1363,7 @@ def main(args): else: print("Unknown Command") - lg.warning("Unknown Command" % name) + logger.warning("Unknown Command" % name) if __name__ == "__main__": diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py index 0d2a7a7fb..eb29ed6c3 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py @@ -4,13 +4,14 @@ This version changed to python3 March2020 by RLO """ import inspect -import logging as lg +import logging import string import time import numpy as np from matplotlib import pyplot as plt +from mx_bluesky.I24.serial import log from mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1 import ( check_files, get_format, @@ -21,17 +22,18 @@ write_file, ) -# Log should now change name daily. -lg.basicConfig( - format="%(asctime)s %(levelname)s: \t%(message)s", - level=lg.DEBUG, - filename=time.strftime("logs/i24_%d%B%y.log").lower(), -) +logger = logging.getLogger("I24ssx.chip_mapping") + + +def setup_logging(): + # Log should now change name daily. + logfile = time.strftime("i24_%Y_%m_%d.log").lower() + log.config(logfile) def read_file_make_dict(fid, chip_type, switch=False): name = inspect.stack()[0][3] - lg.info("%s" % name) + logger.info("%s" % name) f = open(fid, "r") a_dict = {} b_dict = {} @@ -53,7 +55,7 @@ def read_file_make_dict(fid, chip_type, switch=False): def plot_file(fid, chip_type): name = inspect.stack()[0][3] - lg.info("%s" % name) + logger.info("%s" % name) chip_dict = read_file_make_dict(fid, chip_type) x_list, y_list, z_list = [], [], [] for k in sorted(chip_dict.keys()): @@ -89,7 +91,7 @@ def plot_file(fid, chip_type): def get_hamburg_order(): name = inspect.stack()[0][3] - lg.info("%s" % (name)) + logger.info("%s" % (name)) blk_num = 3 caps = [ "A", @@ -169,7 +171,7 @@ def get_hamburg_order(): switch = 0 print(len(collect_list)) - lg.info("%s length of collect_list = %s" % (name, len(collect_list))) + logger.info("%s length of collect_list = %s" % (name, len(collect_list))) g = open("collect_list.txt", "w") for x in collect_list: g.write("%s\n" % x) @@ -180,7 +182,7 @@ def get_hamburg_order(): def convert_chip_to_hex(fid, chip_type): name = inspect.stack()[0][3] - lg.info("%s" % name) + logger.info("%s" % name) chip_dict = read_file_make_dict(fid, chip_type, True) chip_format = get_format(chip_type) check_files(["%s.full" % chip_type]) @@ -188,18 +190,18 @@ def convert_chip_to_hex(fid, chip_type): # Normal if chip_type in ["0", "1", "5"]: shot_order_list = get_shot_order(chip_type) - lg.info("%s Shot Order List: \n" % (name)) - lg.info("%s" % shot_order_list[:14]) - lg.info("%s" % shot_order_list[-14:]) + logger.info("%s Shot Order List: \n" % (name)) + logger.info("%s" % shot_order_list[:14]) + logger.info("%s" % shot_order_list[-14:]) print(shot_order_list[:14]) print(shot_order_list[-14:]) for i, k in enumerate(shot_order_list): if i % 20 == 0: print() - lg.info("\n") + logger.info("\n") else: print(k, end=" ") - lg.info("%s" % k) + logger.info("%s" % k) sorted_pres_list = [] for addr in shot_order_list: sorted_pres_list.append(chip_dict[addr]) @@ -233,7 +235,7 @@ def convert_chip_to_hex(fid, chip_type): print(i, right_list, end=" ") print("".join(str(x) for x in right_list), end=" ") print(line) - lg.info( + logger.info( "%s %s \n" % ( name, @@ -243,24 +245,24 @@ def convert_chip_to_hex(fid, chip_type): + 4 * "0", ) ) - lg.info("%s %s %s \n" % (name, i, right_list)) - lg.info("%s %s\n" % (name, "".join(str(x) for x in right_list))) - lg.info("%s %s \n" % (name, line)) + logger.info("%s %s %s \n" % (name, i, right_list)) + logger.info("%s %s\n" % (name, "".join(str(x) for x in right_list))) + logger.info("%s %s \n" % (name, line)) if (i + 1) % windows_per_block == 0: print("\n", 40 * (" %i" % ((i / windows_per_block) + 2))) - lg.info("\n %s" % (40 * (" %i" % ((i / windows_per_block) + 2)))) + logger.info("\n %s" % (40 * (" %i" % ((i / windows_per_block) + 2)))) print(hex_length) - lg.info("%s hex_length: %s" % (name, hex_length)) + logger.info("%s hex_length: %s" % (name, hex_length)) # NICHT Normal else: - lg.info("%s Dealing with Hamburg \n" % (name)) + logger.info("%s Dealing with Hamburg \n" % (name)) print("Dealing with Hamburg") shot_order_list = get_hamburg_order() print(shot_order_list[:14]) print(shot_order_list[-14:]) - lg.info("%s Shot Order List: \n" % (name)) - lg.info("%s" % shot_order_list[:14]) - lg.info("%s" % shot_order_list[-14:]) + logger.info("%s Shot Order List: \n" % (name)) + logger.info("%s" % shot_order_list[:14]) + logger.info("%s" % shot_order_list[-14:]) sorted_pres_list = [] for addr in shot_order_list: sorted_pres_list.append(chip_dict[addr]) @@ -287,8 +289,8 @@ def convert_chip_to_hex(fid, chip_type): g.write(writeline + "\n") print(line, "".join(str(x) for x in bite), end=" ") print(("{0:0>7X}").format(int("".join(str(x) for x in bite), 2))) - lg.info("%s %s \n" % (line, "".join(str(x) for x in bite))) - lg.info( + logger.info("%s %s \n" % (line, "".join(str(x) for x in bite))) + logger.info( "%s \n" % (("{0:0>7X}").format(int("".join(str(x) for x in bite), 2))) ) @@ -315,8 +317,8 @@ def convert_chip_to_hex(fid, chip_type): g.write(writeline + "\n") print(line, "".join(str(x) for x in bite), end=" ") print(("{0:0>7X}").format(int("".join(str(x) for x in bite), 2))) - lg.info("%s %s \n" % (line, "".join(str(x) for x in bite))) - lg.info( + logger.info("%s %s \n" % (line, "".join(str(x) for x in bite))) + logger.info( "%s \n" % (("{0:0>7X}").format(int("".join(str(x) for x in bite), 2))) ) @@ -328,8 +330,9 @@ def convert_chip_to_hex(fid, chip_type): def main(): + setup_logging() name = inspect.stack()[0][3] - lg.info("%s" % name) + logger.info("%s" % name) ( chip_name, visit, @@ -343,10 +346,10 @@ def main(): write_file(suffix=".spec", order="shot") param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" - lg.info("%s PARAMETER PATH = %s" % (name, param_path)) + logger.info("%s PARAMETER PATH = %s" % (name, param_path)) print("param_path", param_path) fid = param_path + chip_name + ".spec" - lg.info("%s FID = %s" % (name, fid)) + logger.info("%s FID = %s" % (name, fid)) print("FID", fid) plot_file(fid, chip_type) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py index 8a05c9378..3bb8cb67c 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py @@ -6,7 +6,7 @@ from __future__ import annotations import inspect -import logging as lg +import logging import os import pathlib import string @@ -15,12 +15,15 @@ import numpy as np -# Log should now change name daily. -lg.basicConfig( - format="%(asctime)s %(levelname)s: \t%(message)s", - level=lg.DEBUG, - filename=time.strftime("logs/i24_%d%B%y.log").lower(), -) +from mx_bluesky.I24.serial import log + +logger = logging.getLogger("I24ssx.chip_startup") + + +def setup_logging(): + # Log should now change name daily. + logfile = time.strftime("i24_%Y_%m_%d.log").lower() + log.config(logfile) def scrape_parameter_file(location=None): @@ -153,7 +156,7 @@ def fiducials(chip_type): fiducial_list = [] else: - lg.warning("%s Unknown chip_type, %s, in fiducials" % (name, chip_type)) + logger.warning("%s Unknown chip_type, %s, in fiducials" % (name, chip_type)) print("Unknown chip_type in fiducials") return fiducial_list @@ -216,7 +219,7 @@ def get_format(chip_type): b2b_vert = 0.800 chip_format = [6, 6, 20, 20] else: - lg.warning("%s Unknown chip_type, %s, in fiducials" % (name, chip_type)) + logger.warning("%s Unknown chip_type, %s, in fiducials" % (name, chip_type)) print("unknown chip type") cell_format = chip_format + [w2w, b2b_horz, b2b_vert] return cell_format @@ -285,10 +288,10 @@ def pathli(l_in=[], way="typewriter", reverse=False): for rep in range(25): long_list.append(entry) else: - lg.warning("%s no known path, way = %s" % (name, way)) + logger.warning("%s no known path, way = %s" % (name, way)) print("no known path") else: - lg.warning("%s no list" % (name)) + logger.warning("%s no list" % (name)) print("no list") return long_list @@ -325,7 +328,7 @@ def get_alphanumeric(chip_type): for window in window_list: alphanumeric_list.append(block + "_" + window) print(len(alphanumeric_list)) - lg.info("%s length of alphanumeric list = %s" % (name, len(alphanumeric_list))) + logger.info("%s length of alphanumeric list = %s" % (name, len(alphanumeric_list))) return alphanumeric_list @@ -364,13 +367,13 @@ def get_shot_order(chip_type): switch = 0 print(len(collect_list)) - lg.info("%s length of collect list = %s" % (name, len(collect_list))) + logger.info("%s length of collect list = %s" % (name, len(collect_list))) return collect_list def write_file(location="i24", suffix=".addr", order="alphanumeric"): name = inspect.stack()[0][3] - lg.info("%s" % name) + logger.info("%s" % name) if location == "i24": ( chip_name, @@ -390,7 +393,7 @@ def write_file(location="i24", suffix=".addr", order="alphanumeric"): chip_name, sub_dir, n_exposures, chip_type, map_type = scrape_parameter_file() a_directory = "/localhome/local/Documents/sacla/" else: - lg.warning("%s Unknown location, %s" % (name, location)) + logger.warning("%s Unknown location, %s" % (name, location)) print("Unknown location in write_file") chip_file_path = a_directory + "chips/" + sub_dir + "/" + chip_name + suffix @@ -417,7 +420,7 @@ def write_file(location="i24", suffix=".addr", order="alphanumeric"): # list_of_lines.append(line) g.write(line) g.close() - lg.info("%s" % name) + logger.info("%s" % name) def check_files(location, suffix_list): @@ -444,7 +447,7 @@ def check_files(location, suffix_list): a_directory = "/localhome/local/Documents/sacla/" else: - lg.warning("%s Unknown location, %s" % (name, location)) + logger.warning("%s Unknown location, %s" % (name, location)) print("Unknown location in write_file") chip_file_path = a_directory + "chips/" + sub_dir + "/" + chip_name @@ -461,7 +464,7 @@ def check_files(location, suffix_list): # hack / fix # os.rename(full_fid, timestamp_fid) print("Already exists ... moving old file:", timestamp_fid) - lg.info("%s File Already Exists\n -->%s" % (name, timestamp_fid)) + logger.info("%s File Already Exists\n -->%s" % (name, timestamp_fid)) return 1 @@ -532,32 +535,33 @@ def write_headers(location, suffix_list): ) g.close() else: - lg.warning("%s Unknown location, %s" % (name, location)) + logger.warning("%s Unknown location, %s" % (name, location)) print("Unknown location in write_headers") def run(): + setup_logging() name = inspect.stack()[0][3] - lg.info("%s Run Startup" % name) + logger.info("%s Run Startup" % name) print("Run StartUp") - lg.info("%s" % name) + logger.info("%s" % name) check_files("i24", [".addr", ".shot"]) print("Checked files") - lg.info("%s Checked Files" % name) + logger.info("%s Checked Files" % name) write_headers("i24", [".addr", ".shot"]) print("Written headers") - lg.info("%s Written Headers" % name) + logger.info("%s Written Headers" % name) # write_file('SACLA', suffix='.addr', order='alphanumeric') # write_file('SACLA', suffix='.shot', order='shot') print("Written files") - lg.info("%s Writing to Files has been disabled. Headers Only" % name) + logger.info("%s Writing to Files has been disabled. Headers Only" % name) # Makes a file with random crystal positions check_files("i24", ["rando.spec"]) write_headers("i24", ["rando.spec"]) # write_file('SACLA', suffix='rando.spec', order='shot') print(10 * "Done ") - lg.info("%s Done" % name) + logger.info("%s Done" % name) if __name__ == "__main__": diff --git a/src/mx_bluesky/I24/serial/log.py b/src/mx_bluesky/I24/serial/log.py new file mode 100644 index 000000000..61e0a4adf --- /dev/null +++ b/src/mx_bluesky/I24/serial/log.py @@ -0,0 +1,81 @@ +from __future__ import annotations + +import logging +import logging.config +from os import environ +from pathlib import Path +from typing import Optional + +# Logging set up +logging.getLogger("I24ssx").addHandler(logging.NullHandler()) + +logging_config = { + "version": 1, + "disable_existing_loggers": False, + "formatters": { + "default": { + "class": "logging.Formatter", + "format": "%(message)s", + } + }, + "handlers": { + "console": { + "level": "DEBUG", + "class": "logging.StreamHandler", + "formatter": "default", + "stream": "ext://sys.stdout", + } + }, + "loggers": { + "I24ssx": { + "handlers": ["console"], + "level": "DEBUG", + "propagate": True, + } + }, +} + +logging.config.dictConfig(logging_config) + + +def _get_logging_file_path() -> Path: + """Get the path to write the artemis log files to. + If on a beamline, this will be written to the according area depending on the + BEAMLINE envrionment variable. If no envrionment variable is found it will default + it to the tmp/dev directory. + Returns: + logging_path (Path): Path to the log file for the file handler to write to. + """ + beamline: Optional[str] = environ.get("BEAMLINE") + logging_path: Path + + if beamline: + logging_path = Path("/dls_sw/" + beamline + "/logs/serial/") + else: + logging_path = Path("./tmp/logs/") + + Path(logging_path).mkdir(parents=True, exist_ok=True) + return logging_path + + +def config(logfile: str | None = None, write_mode: str = "a"): + """ + Configure the logging. + + Args: + logfile (str, optional): Filename for logfile. If passed, create a file handler \ + for the logger to write to file the log output. Defaults to None. + write_mode (str, optional): String indicating writing mode for the output \ + .log file. Defaults to "a". + """ + logger = logging.getLogger("I24ssx") + if logfile: + logs = _get_logging_file_path() / logfile + fileFormatter = logging.Formatter( + "%(asctime)s %(levelname)s: \t%(message)s", + datefmt="%d-%m-%Y %I:%M:%S", + ) + FH = logging.FileHandler(logs, mode=write_mode, encoding="utf-8") + FH.setLevel(logging.DEBUG) + FH.setFormatter(fileFormatter) + logger.addHandler(FH) From 2533e08f9c3c690d9a3c0c3a17e3e4d48b08c58d Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Mon, 5 Jun 2023 16:17:45 +0100 Subject: [PATCH 08/47] Add basic script to set visit directory --- src/mx_bluesky/I24/serial/set_visit_directory.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/mx_bluesky/I24/serial/set_visit_directory.sh diff --git a/src/mx_bluesky/I24/serial/set_visit_directory.sh b/src/mx_bluesky/I24/serial/set_visit_directory.sh new file mode 100644 index 000000000..3297a8528 --- /dev/null +++ b/src/mx_bluesky/I24/serial/set_visit_directory.sh @@ -0,0 +1,9 @@ +visit=$1 + +ex_pv=BL24I-EA-IOC-12:GP1 +ft_pv=ME14E-MO-IOC-01:GP100 + +caput $ex_pv $visit +caput $ft_pv $visit + +echo "Visit set to: $visit" \ No newline at end of file From 5f879d040ef1636370c0603f4c8cee68f53fbe04 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 7 Jun 2023 11:34:56 +0100 Subject: [PATCH 09/47] Only set PV relative to experiment for visit --- .../I24/serial/set_visit_directory.sh | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/mx_bluesky/I24/serial/set_visit_directory.sh b/src/mx_bluesky/I24/serial/set_visit_directory.sh index 3297a8528..eddfc83dc 100644 --- a/src/mx_bluesky/I24/serial/set_visit_directory.sh +++ b/src/mx_bluesky/I24/serial/set_visit_directory.sh @@ -1,9 +1,24 @@ +#!/bin/bash + +# Set visit directory for current experiment type visit=$1 +expt_type=${2:-FT} ex_pv=BL24I-EA-IOC-12:GP1 ft_pv=ME14E-MO-IOC-01:GP100 -caput $ex_pv $visit -caput $ft_pv $visit +shopt -s nocasematch -echo "Visit set to: $visit" \ No newline at end of file +if [[ $expt_type == "FT" ]] || [[ $expt_type == "fixed-target" ]] +then + echo "fixed-target" + caput $ft_pv $visit + echo "Visit set to: $visit" +elif [[ $expt_type == "EX" ]] || [[ $expt_type == "extruder" ]] +then + echo "extruder" + caput $ex_pv $visit + echo "Visit set to: $visit" +else + echo "Unknown experiment type" +fi \ No newline at end of file From efada080ac94439e05a44542a6595a31655d68f0 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 7 Jun 2023 11:45:33 +0100 Subject: [PATCH 10/47] Get visit from pv and update test - actuall add the files --- .../I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py | 5 +---- tests/I24/serial/extruder/test_extruder_collect.py | 7 +++++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py index f256d6554..0f306e8f5 100755 --- a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +++ b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py @@ -37,15 +37,12 @@ def initialise_extruderi24(): print("Initialise Parameters for extruder data collection") logger.info("%s I24 extruder initialisation" % name) - # define visit using the below line - # visit = "/dls/i24/data/2022/mx31930-2/" - visit = "/dls/i24/data/2023/cm33852-2/" + visit = caget(pv.ioc12_gp1) logger.info("%s Visit defined %s" % (name, visit)) # Define detector in use det_type = sup.get_detector_type() - caput(pv.ioc12_gp1, str(visit)) caput(pv.ioc12_gp2, "test") caput(pv.ioc12_gp3, "testrun") caput(pv.ioc12_gp4, "100") diff --git a/tests/I24/serial/extruder/test_extruder_collect.py b/tests/I24/serial/extruder/test_extruder_collect.py index bb5ec828c..08c788a2c 100644 --- a/tests/I24/serial/extruder/test_extruder_collect.py +++ b/tests/I24/serial/extruder/test_extruder_collect.py @@ -30,14 +30,17 @@ def test_scrape_parameter_file(): assert len(res) == 10 +@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") @patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") @patch( "mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sup.get_detector_type" ) -def test_initialise_extruder(fake_det, fake_caput): +def test_initialise_extruder(fake_det, fake_caput, fake_caget): + fake_caget.return_value = "/path/to/visit" fake_det.return_value = Eiger() initialise_extruderi24() - assert fake_caput.call_count == 11 + assert fake_caput.call_count == 10 + assert fake_caget.call_count == 1 @patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") From b8fc790d65d98e6821c0b7706d7a7e520c96100f Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 7 Jun 2023 12:03:32 +0100 Subject: [PATCH 11/47] Add a couple of tests --- .../serial/extruder/test_extruder_collect.py | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/I24/serial/extruder/test_extruder_collect.py b/tests/I24/serial/extruder/test_extruder_collect.py index 08c788a2c..90bc664ea 100644 --- a/tests/I24/serial/extruder/test_extruder_collect.py +++ b/tests/I24/serial/extruder/test_extruder_collect.py @@ -45,12 +45,30 @@ def test_initialise_extruder(fake_det, fake_caput, fake_caget): @patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") @patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") -def test_moveto(fake_caget, fake_caput): +def test_moveto_enterhutch(fake_caget, fake_caput): moveto("enterhutch") assert fake_caget.call_count == 1 assert fake_caput.call_count == 1 +@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") +@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") +def test_moveto_laseron_for_eiger(fake_caget, fake_caput): + fake_caget.return_value = "eiger" + moveto("laseron") + assert fake_caget.call_count == 1 + assert fake_caput.call_count == 2 + + +@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") +@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") +def test_moveto_laseroff_for_pilatus(fake_caget, fake_caput): + fake_caget.return_value = "pilatus" + moveto("laseroff") + assert fake_caget.call_count == 1 + assert fake_caput.call_count == 2 + + @patch( "mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.open", mock_open(read_data=params_file_str), From ad12eaa976b0dba582a96f3000c383fe10d5a3d2 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 7 Jun 2023 13:26:10 +0100 Subject: [PATCH 12/47] Also get visit from pv in chip --- .../I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index 2896e24b3..3919f5604 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -112,14 +112,7 @@ def write_parameter_file(): logger.info("%s Writing Parameter File \n%s" % (name, param_path + param_fid)) print("Writing Parameter File\n", param_path + param_fid) - ############################################ - # define visit here. Press set parameters to update GUI - visit = "/dls/i24/data/2023/mx31850-14/" - # visit = '/dls/i24/data/2023/cm33852-2/' - # visit = '/dls/i24/data/2023/nr27313-182/' - # visit = '/dls/i24/data/2023/mx31850-5/' - ############################################ - caput(pv.me14e_gp100, str(visit)) + visit = caget(pv.me14e_gp100) filename = caget(pv.me14e_chip_name) From 884148383abc02a628f5b5b9a2616a59bc4fc469 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 7 Jun 2023 13:43:00 +0100 Subject: [PATCH 13/47] Remove old edms --- .../FT-gui-edm/MappingLite-bismuth1v5.edl | 745 ---- .../FT-gui-edm/MappingLite-bismuth2v5.edl | 2079 ------------ .../FT-gui-edm/MappingLite-hamburgv5.edl | 752 ----- .../FT-gui-edm/MappingLite-reginav5.edl | 2073 ------------ .../FT-gui-edm/MappingLite-torontov5.edl | 3002 ----------------- .../fixed_target/i24ssx_Chip_Mapping_py3v1.py | 3 - 6 files changed, 8654 deletions(-) delete mode 100755 src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-bismuth1v5.edl delete mode 100755 src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-bismuth2v5.edl delete mode 100644 src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-hamburgv5.edl delete mode 100755 src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-reginav5.edl delete mode 100644 src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-torontov5.edl diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-bismuth1v5.edl b/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-bismuth1v5.edl deleted file mode 100755 index c6e7a5cdb..000000000 --- a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-bismuth1v5.edl +++ /dev/null @@ -1,745 +0,0 @@ -4 0 1 -beginScreenProperties -major 4 -minor 0 -release 1 -x 1243 -y 86 -w 550 -h 380 -font "arial-medium-r-18.0" -ctlFont "arial-medium-r-18.0" -btnFont "arial-medium-r-18.0" -fgColor index 14 -bgColor index 7 -textColor index 14 -ctlFgColor1 index 14 -ctlFgColor2 index 0 -ctlBgColor1 index 0 -ctlBgColor2 index 14 -topShadowColor index 9 -botShadowColor index 9 -title "Mapping Lite" -endScreenProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 2044 -y 447 -w 8 -h 23 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "I" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 2002 -y 449 -w 16 -h 23 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "H" -} -autoSize -endObjectProperties - -# (Text w. Reg. Exp.) -object activeXRegTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 1250 -y 477 -w 2 -h 0 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -autoSize -endObjectProperties - -# (Text Control) -object activeXTextDspClass -beginObjectProperties -major 4 -minor 6 -release 0 -x 143 -y 94 -w 110 -h 30 -controlPv "ME14E-MO-IOC-01:GP6" -font "helvetica-medium-r-20.0" -fontAlign "right" -fgColor index 25 -bgColor index 6 -editable -autoHeight -motifWidget -limitsFromDb -nullColor index 0 -useKp -file -useHexPrefix -newPos -inputFocusUpdates -objType "controls" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 44 -y 4 -w 210 -h 37 -font "helvetica-bold-r-28.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "Bismuth Chip" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 4 -y 98 -w 133 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "N windows in x" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 4 -y 142 -w 133 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "N windows in y" -} -autoSize -endObjectProperties - -# (Text Control) -object activeXTextDspClass -beginObjectProperties -major 4 -minor 6 -release 0 -x 144 -y 138 -w 110 -h 30 -controlPv "ME14E-MO-IOC-01:GP7" -font "helvetica-medium-r-20.0" -fontAlign "right" -fgColor index 25 -bgColor index 6 -editable -autoHeight -motifWidget -limitsFromDb -nullColor index 0 -useKp -file -useHexPrefix -newPos -inputFocusUpdates -objType "controls" -endObjectProperties - -# (Lines) -object activeLineClass -beginObjectProperties -major 4 -minor 0 -release 1 -x 380 -y 129 -w 115 -h 59 -lineColor index 17 -fillColor index 0 -lineWidth 4 -numPoints 9 -xPoints { - 0 380 - 1 494 - 2 495 - 3 380 - 4 380 - 5 495 - 6 495 - 7 495 - 8 495 -} -yPoints { - 0 130 - 1 129 - 2 159 - 3 159 - 4 188 - 5 188 - 6 188 - 7 188 - 8 188 -} -endObjectProperties - -# (Lines) -object activeLineClass -beginObjectProperties -major 4 -minor 0 -release 1 -x 486 -y 176 -w 26 -h 24 -lineColor index 17 -fill -fillColor index 17 -numPoints 3 -xPoints { - 0 486 - 1 512 - 2 486 -} -yPoints { - 0 176 - 1 186 - 2 200 -} -endObjectProperties - -# (Circle) -object activeCircleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 409 -y 119 -w 20 -h 20 -lineColor index 17 -fill -fillColor index 17 -endObjectProperties - -# (Circle) -object activeCircleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 484 -y 119 -w 20 -h 20 -lineColor index 17 -fill -fillColor index 17 -endObjectProperties - -# (Circle) -object activeCircleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 447 -y 119 -w 20 -h 20 -lineColor index 17 -fill -fillColor index 17 -endObjectProperties - -# (Circle) -object activeCircleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 371 -y 149 -w 20 -h 20 -lineColor index 17 -fill -fillColor index 17 -endObjectProperties - -# (Circle) -object activeCircleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 409 -y 148 -w 20 -h 20 -lineColor index 17 -fill -fillColor index 17 -endObjectProperties - -# (Circle) -object activeCircleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 447 -y 148 -w 20 -h 20 -lineColor index 17 -fill -fillColor index 17 -endObjectProperties - -# (Circle) -object activeCircleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 484 -y 148 -w 20 -h 20 -lineColor index 17 -fill -fillColor index 17 -endObjectProperties - -# (Circle) -object activeCircleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 445 -y 178 -w 20 -h 20 -lineColor index 17 -fill -fillColor index 17 -endObjectProperties - -# (Circle) -object activeCircleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 407 -y 178 -w 20 -h 20 -lineColor index 17 -fill -fillColor index 17 -endObjectProperties - -# (Circle) -object activeCircleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 369 -y 179 -w 20 -h 20 -lineColor index 17 -fill -fillColor index 17 -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 421 -y 87 -w 25 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "Nx" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 336 -y 145 -w 25 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "Ny" -} -autoSize -endObjectProperties - -# (Text Control) -object activeXTextDspClass -beginObjectProperties -major 4 -minor 6 -release 0 -x 145 -y 183 -w 110 -h 30 -controlPv "ME14E-MO-IOC-01:GP8" -font "helvetica-medium-r-20.0" -fontAlign "right" -fgColor index 25 -bgColor index 6 -editable -autoHeight -motifWidget -limitsFromDb -nullColor index 0 -useKp -file -useHexPrefix -newPos -inputFocusUpdates -objType "controls" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 55 -y 184 -w 77 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "Step size" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 261 -y 186 -w 34 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "mm" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 45 -y 307 -w 285 -h 69 -font "arial-medium-r-18.0" -fgColor index 35 -bgColor index 0 -useDisplayBg -value { - "Bismuth type 1: step size 0.6 mm" - "Ny must be even (for now)" - "Map type should be set to none" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 6 -y 281 -w 49 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "Notes" -} -autoSize -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 326 -y 71 -w 196 -h 144 -lineColor index 7 -fill -fillColor index 7 -visPv "ME14E-MO-IOC-01:GP1" -visMin "4" -visMax "5" -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 325 -y 71 -w 197 -h 143 -lineColor index 7 -fill -fillColor index 7 -visPv "ME14E-MO-IOC-01:GP1" -visMin "0" -visMax "3" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 333 -y 100 -w 167 -h 115 -font "helvetica-bold-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -visPv "ME14E-MO-IOC-01:GP1" -visMin "0" -visMax "3" -value { - "Chip type MUST " - "be set to " - "Bismuth " - "for gui to " - "be active" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 333 -y 100 -w 162 -h 115 -font "helvetica-bold-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -visPv "ME14E-MO-IOC-01:GP1" -visMin "4" -visMax "5" -value { - "Chip type MUST" - "be set to" - "Bismuth" - "for gui to" - "be active" -} -autoSize -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 25 -y 236 -w 277 -h 35 -fgColor index 14 -bgColor index 49 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "caput ME14E-MO-CHIP-01:PMAC_STRING \\#1hmz\\2hmz\\3hmz" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 39 -y 242 -w 238 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "Set current position as start" -} -autoSize -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 30 -y 55 -w 230 -h 32 -fgColor index 14 -bgColor index 49 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py cs_reset" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 43 -y 58 -w 206 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "Clear coordinate system" -} -autoSize -endObjectProperties - diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-bismuth2v5.edl b/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-bismuth2v5.edl deleted file mode 100755 index 0d8406221..000000000 --- a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-bismuth2v5.edl +++ /dev/null @@ -1,2079 +0,0 @@ -4 0 1 -beginScreenProperties -major 4 -minor 0 -release 1 -x 1115 -y 503 -w 680 -h 400 -font "arial-medium-r-18.0" -ctlFont "arial-medium-r-18.0" -btnFont "arial-medium-r-18.0" -fgColor index 14 -bgColor index 7 -textColor index 14 -ctlFgColor1 index 14 -ctlFgColor2 index 0 -ctlBgColor1 index 0 -ctlBgColor2 index 14 -topShadowColor index 9 -botShadowColor index 9 -title "Mapping Lite" -showGrid -snapToGrid -gridSize 5 -endScreenProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 2044 -y 447 -w 8 -h 23 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "I" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 2002 -y 449 -w 16 -h 23 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "H" -} -autoSize -endObjectProperties - -# (Text w. Reg. Exp.) -object activeXRegTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 1250 -y 477 -w 2 -h 0 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -autoSize -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 40 -y 290 -w 194 -h 40 -fgColor index 0 -bgColor index 23 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -buttonLabel "Save Screen Map" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py save_screen_map" -} -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 12 -y 337 -w 244 -h 53 -fgColor index 13 -bgColor index 49 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -buttonLabel "Upload Parameters" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py upload_parameters bismuth2" -} -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 555 -y 40 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP46" -pressValue "1" -releaseValue "0" -onLabel "36" -offLabel "36" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP46" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 510 -y 310 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP45" -pressValue "1" -releaseValue "0" -onLabel "35" -offLabel "35" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP45" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 510 -y 265 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP44" -pressValue "1" -releaseValue "0" -onLabel "34" -offLabel "34" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP44" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 555 -y 85 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP47" -pressValue "1" -releaseValue "0" -onLabel "37" -offLabel "37" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP47" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 555 -y 130 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP48" -pressValue "1" -releaseValue "0" -onLabel "38" -offLabel "38" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP48" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 555 -y 175 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP49" -pressValue "1" -releaseValue "0" -onLabel "39" -offLabel "39" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP49" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 330 -y 40 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP11" -pressValue "1" -releaseValue "0" -onLabel "01" -offLabel "01" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP11" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 330 -y 85 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP12" -pressValue "1" -releaseValue "0" -onLabel "02" -offLabel "02" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP12" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 330 -y 130 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP13" -pressValue "1" -releaseValue "0" -onLabel "03" -offLabel "03" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP13" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 420 -y 175 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP28" -pressValue "1" -releaseValue "0" -onLabel "18" -offLabel "18" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP28" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 420 -y 130 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP27" -pressValue "1" -releaseValue "0" -onLabel "17" -offLabel "17" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP27" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 420 -y 85 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP26" -pressValue "1" -releaseValue "0" -onLabel "16" -offLabel "16" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP26" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 420 -y 265 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP30" -pressValue "1" -releaseValue "0" -onLabel "20" -offLabel "20" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP30" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 420 -y 310 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP31" -pressValue "1" -releaseValue "0" -onLabel "21" -offLabel "21" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP31" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 420 -y 220 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP29" -pressValue "1" -releaseValue "0" -onLabel "19" -offLabel "19" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP29" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 510 -y 220 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP43" -pressValue "1" -releaseValue "0" -onLabel "33" -offLabel "33" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP43" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 510 -y 175 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP42" -pressValue "1" -releaseValue "0" -onLabel "32" -offLabel "32" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP42" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 510 -y 130 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP41" -pressValue "1" -releaseValue "0" -onLabel "31" -offLabel "31" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP41" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 555 -y 220 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP50" -pressValue "1" -releaseValue "0" -onLabel "40" -offLabel "40" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP50" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 555 -y 265 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP51" -pressValue "1" -releaseValue "0" -onLabel "41" -offLabel "41" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP51" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 555 -y 310 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP52" -pressValue "1" -releaseValue "0" -onLabel "42" -offLabel "42" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP52" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 600 -y 310 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP59" -pressValue "1" -releaseValue "0" -onLabel "49" -offLabel "49" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP59" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 330 -y 175 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP14" -pressValue "1" -releaseValue "0" -onLabel "04" -offLabel "04" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP14" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 330 -y 220 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP15" -pressValue "1" -releaseValue "0" -onLabel "05" -offLabel "05" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP15" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 330 -y 265 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP16" -pressValue "1" -releaseValue "0" -onLabel "06" -offLabel "06" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP16" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 420 -y 40 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP25" -pressValue "1" -releaseValue "0" -onLabel "15" -offLabel "15" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP25" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 375 -y 310 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP24" -pressValue "1" -releaseValue "0" -onLabel "14" -offLabel "14" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP24" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 375 -y 265 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP23" -pressValue "1" -releaseValue "0" -onLabel "13" -offLabel "13" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP23" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 465 -y 85 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP33" -pressValue "1" -releaseValue "0" -onLabel "23" -offLabel "23" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP33" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 465 -y 130 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP34" -pressValue "1" -releaseValue "0" -onLabel "24" -offLabel "24" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP34" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 465 -y 40 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP32" -pressValue "1" -releaseValue "0" -onLabel "22" -offLabel "22" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP32" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 510 -y 85 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP40" -pressValue "1" -releaseValue "0" -onLabel "30" -offLabel "30" -toggle -3d -font "arial-medium-r-18.0" -visMin "1" -visMax "0" -colorPv "ME14E-MO-IOC-01:GP40" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 510 -y 40 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP39" -pressValue "1" -releaseValue "0" -onLabel "29" -offLabel "29" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP39" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 465 -y 310 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP38" -pressValue "1" -releaseValue "0" -onLabel "28" -offLabel "28" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP38" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 600 -y 40 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP53" -pressValue "1" -releaseValue "0" -onLabel "43" -offLabel "43" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP53" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 600 -y 85 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP54" -pressValue "1" -releaseValue "0" -onLabel "44" -offLabel "44" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP54" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 600 -y 130 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP55" -pressValue "1" -releaseValue "0" -onLabel "45" -offLabel "45" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP55" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 600 -y 220 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP57" -pressValue "1" -releaseValue "0" -onLabel "47" -offLabel "47" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP57" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 600 -y 265 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP58" -pressValue "1" -releaseValue "0" -onLabel "48" -offLabel "48" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP58" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 330 -y 310 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP17" -pressValue "1" -releaseValue "0" -onLabel "07" -offLabel "07" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP17" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 375 -y 40 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP18" -pressValue "1" -releaseValue "0" -onLabel "08" -offLabel "08" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP18" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 375 -y 85 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP19" -pressValue "1" -releaseValue "0" -onLabel "09" -offLabel "09" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP19" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 375 -y 220 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP22" -pressValue "1" -releaseValue "0" -onLabel "12" -offLabel "12" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP22" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 375 -y 175 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP21" -pressValue "1" -releaseValue "0" -onLabel "11" -offLabel "11" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP21" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 375 -y 130 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP20" -pressValue "1" -releaseValue "0" -onLabel "10" -offLabel "10" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP20" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 465 -y 220 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP36" -pressValue "1" -releaseValue "0" -onLabel "26" -offLabel "26" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP36" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 465 -y 265 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP37" -pressValue "1" -releaseValue "0" -onLabel "27" -offLabel "27" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP37" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 465 -y 175 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP35" -pressValue "1" -releaseValue "0" -onLabel "25" -offLabel "25" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP35" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 340 -y 5 -w 18 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "A" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 385 -y 5 -w 18 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "B" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 430 -y 5 -w 18 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "C" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 475 -y 5 -w 19 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "D" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 520 -y 5 -w 18 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "E" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 565 -y 5 -w 17 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "F" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 605 -y 5 -w 19 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "G" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 310 -y 49 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "1" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 310 -y 90 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "2" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 310 -y 140 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "3" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 310 -y 180 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "4" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 310 -y 315 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "7" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 310 -y 270 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "6" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 310 -y 225 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "5" -} -autoSize -endObjectProperties - -# (Text Control) -object activeXTextDspClass -beginObjectProperties -major 4 -minor 6 -release 0 -x 137 -y 105 -w 125 -h 30 -controlPv "ME14E-MO-IOC-01:GP6" -font "helvetica-medium-r-20.0" -fontAlign "right" -fgColor index 25 -bgColor index 6 -editable -autoHeight -motifWidget -limitsFromDb -nullColor index 0 -useKp -file -useHexPrefix -newPos -inputFocusUpdates -objType "controls" -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 139 -y 242 -w 73 -h 35 -fgColor index 14 -bgColor index 3 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py load_stock_map clear" -} -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 54 -y 242 -w 74 -h 35 -fgColor index 14 -bgColor index 20 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py load_stock_map x49" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 146 -y 246 -w 59 -h 26 -font "arial-medium-r-20.0" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "All off" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 62 -y 246 -w 58 -h 26 -font "arial-medium-r-20.0" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "All on" -} -autoSize -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 600 -y 175 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP56" -pressValue "1" -releaseValue "0" -onLabel "46" -offLabel "46" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP56" -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 325 -y 40 -w 320 -h 315 -lineColor index 7 -fill -fillColor index 7 -visPv "ME14E-MO-IOC-01:GP1" -visMin "5" -visMax "6" -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 9 -y 41 -w 244 -h 53 -fgColor index 14 -bgColor index 48 -topShadowColor index 1 -botShadowColor index 9 -font "helvetica-medium-r-20.0" -buttonLabel "Define Chip In PMAC" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py define_current_chip bismuth2" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 25 -y 3 -w 227 -h 37 -font "helvetica-bold-r-28.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "Bismuth2 Chip" -} -autoSize -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 325 -y 40 -w 325 -h 320 -lineColor index 7 -fill -fillColor index 7 -visPv "ME14E-MO-IOC-01:GP1" -visMin "0" -visMax "4" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 325 -y 135 -w 336 -h 93 -font "helvetica-bold-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -visPv "ME14E-MO-IOC-01:GP1" -visMin "5" -visMax "6" -value { - "Chip type MUST be set to " - "Bismuth2" - "for gui to be active" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 325 -y 135 -w 336 -h 93 -font "helvetica-bold-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -visPv "ME14E-MO-IOC-01:GP1" -visMin "0" -visMax "4" -value { - "Chip type MUST be set to " - "Bismuth2" - "for gui to be active" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x -1 -y 108 -w 133 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "N windows in x" -} -autoSize -endObjectProperties - -# (Text Control) -object activeXTextDspClass -beginObjectProperties -major 4 -minor 6 -release 0 -x 138 -y 146 -w 125 -h 30 -controlPv "ME14E-MO-IOC-01:GP7" -font "helvetica-medium-r-20.0" -fontAlign "right" -fgColor index 25 -bgColor index 6 -editable -autoHeight -motifWidget -limitsFromDb -nullColor index 0 -useKp -file -useHexPrefix -newPos -inputFocusUpdates -objType "controls" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 0 -y 149 -w 133 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "N windows in y" -} -autoSize -endObjectProperties - -# (Text Control) -object activeXTextDspClass -beginObjectProperties -major 4 -minor 6 -release 0 -x 139 -y 187 -w 125 -h 30 -controlPv "ME14E-MO-IOC-01:GP8" -font "helvetica-medium-r-20.0" -fontAlign "right" -fgColor index 25 -bgColor index 6 -editable -autoHeight -motifWidget -limitsFromDb -nullColor index 0 -useKp -file -useHexPrefix -newPos -inputFocusUpdates -objType "controls" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 50 -y 192 -w 77 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "Step size" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 267 -y 190 -w 34 -h 23 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "mm" -} -autoSize -endObjectProperties - diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-hamburgv5.edl b/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-hamburgv5.edl deleted file mode 100644 index e526e9227..000000000 --- a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-hamburgv5.edl +++ /dev/null @@ -1,752 +0,0 @@ -4 0 1 -beginScreenProperties -major 4 -minor 0 -release 1 -x 1199 -y 603 -w 550 -h 380 -font "arial-medium-r-18.0" -ctlFont "arial-medium-r-18.0" -btnFont "arial-medium-r-18.0" -fgColor index 14 -bgColor index 7 -textColor index 14 -ctlFgColor1 index 14 -ctlFgColor2 index 0 -ctlBgColor1 index 0 -ctlBgColor2 index 14 -topShadowColor index 9 -botShadowColor index 9 -title "Mapping Lite" -endScreenProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 48 -y 135 -w 170 -h 37 -fgColor index 0 -bgColor index 23 -topShadowColor index 1 -botShadowColor index 11 -font "helvetica-medium-r-20.0" -buttonLabel "Load Map File" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py load_lite_map" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 2044 -y 447 -w 5 -h 21 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "I" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 2002 -y 449 -w 13 -h 21 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "H" -} -autoSize -endObjectProperties - -# (Text w. Reg. Exp.) -object activeXRegTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 1250 -y 477 -w 2 -h 0 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -autoSize -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 41 -y 235 -w 194 -h 55 -fgColor index 0 -bgColor index 23 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -buttonLabel "Save Screen Map" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py save_screen_map" -} -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 12 -y 306 -w 244 -h 53 -fgColor index 13 -bgColor index 49 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -buttonLabel "Upload Parameters" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py upload_parameters hamburg" -} -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 305 -y 87 -w 55 -h 55 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP11" -pressValue "1" -releaseValue "0" -onLabel "01" -offLabel "01" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP11" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 305 -y 146 -w 55 -h 55 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP12" -pressValue "1" -releaseValue "0" -onLabel "02" -offLabel "02" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP12" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 304 -y 206 -w 55 -h 55 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP13" -pressValue "1" -releaseValue "0" -onLabel "03" -offLabel "03" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP13" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 364 -y 206 -w 55 -h 55 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP14" -pressValue "1" -releaseValue "0" -onLabel "04" -offLabel "04" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP14" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 364 -y 146 -w 55 -h 55 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP15" -pressValue "1" -releaseValue "0" -onLabel "05" -offLabel "05" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP15" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 364 -y 87 -w 55 -h 55 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP16" -pressValue "1" -releaseValue "0" -onLabel "06" -offLabel "06" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP16" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 424 -y 87 -w 55 -h 55 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP17" -pressValue "1" -releaseValue "0" -onLabel "07" -offLabel "07" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP17" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 424 -y 146 -w 55 -h 55 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP18" -pressValue "1" -releaseValue "0" -onLabel "08" -offLabel "08" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP18" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 424 -y 206 -w 55 -h 55 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP19" -pressValue "1" -releaseValue "0" -onLabel "09" -offLabel "09" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP19" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 325 -y 52 -w 16 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "A" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 383 -y 52 -w 17 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "B" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 441 -y 52 -w 17 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "C" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 284 -y 93 -w 14 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "1" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 281 -y 159 -w 14 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "2" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 282 -y 217 -w 13 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "3" -} -autoSize -endObjectProperties - -# (Text Control) -object activeXTextDspClass -beginObjectProperties -major 4 -minor 6 -release 0 -x 47 -y 100 -w 170 -h 30 -controlPv "ME14E-MO-IOC-01:GP5" -font "arial-medium-r-18.0" -fontAlign "right" -fgColor index 25 -bgColor index 6 -editable -autoHeight -motifWidget -limitsFromDb -nullColor index 0 -useKp -file -useHexPrefix -newPos -inputFocusUpdates -objType "controls" -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 140 -y 179 -w 73 -h 35 -fgColor index 14 -bgColor index 5 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py load_stock_map clear" -} -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 55 -y 179 -w 74 -h 35 -fgColor index 14 -bgColor index 20 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py load_stock_map h33" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 147 -y 183 -w 50 -h 23 -font "arial-medium-r-20.0" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "All off" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 63 -y 183 -w 51 -h 23 -font "arial-medium-r-20.0" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "All on" -} -autoSize -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 302 -y 83 -w 201 -h 186 -lineColor index 7 -fill -fillColor index 7 -visPv "ME14E-MO-IOC-01:GP1" -visMin "3" -visMax "8" -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 9 -y 41 -w 244 -h 53 -fgColor index 14 -bgColor index 48 -topShadowColor index 1 -botShadowColor index 9 -font "helvetica-medium-r-18.0" -buttonLabel "Define Chip In PMAC" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py define_current_chip hamburg" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 44 -y 4 -w 119 -h 21 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "Hamburg Chip" -} -autoSize -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 301 -y 84 -w 184 -h 191 -lineColor index 7 -fill -fillColor index 7 -visPv "ME14E-MO-IOC-01:GP1" -visMin "0" -visMax "2" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 311 -y 111 -w 142 -h 105 -font "helvetica-bold-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -visPv "ME14E-MO-IOC-01:GP1" -visMin "3" -visMax "8" -value { - "Chip type MUST" - "be set to" - "Hamburg" - "for gui to" - "be active" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 311 -y 111 -w 147 -h 105 -font "helvetica-bold-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -visPv "ME14E-MO-IOC-01:GP1" -visMin "0" -visMax "2" -value { - "Chip type MUST " - "be set to " - "Hamburg " - "for gui to " - "be active" -} -autoSize -endObjectProperties - diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-reginav5.edl b/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-reginav5.edl deleted file mode 100755 index ce62e90ff..000000000 --- a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-reginav5.edl +++ /dev/null @@ -1,2073 +0,0 @@ -4 0 1 -beginScreenProperties -major 4 -minor 0 -release 1 -x 1201 -y 150 -w 650 -h 400 -font "arial-medium-r-18.0" -ctlFont "arial-medium-r-18.0" -btnFont "arial-medium-r-18.0" -fgColor index 14 -bgColor index 7 -textColor index 14 -ctlFgColor1 index 14 -ctlFgColor2 index 0 -ctlBgColor1 index 0 -ctlBgColor2 index 14 -topShadowColor index 9 -botShadowColor index 9 -title "Mapping Lite" -endScreenProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 48 -y 135 -w 170 -h 37 -fgColor index 0 -bgColor index 23 -topShadowColor index 1 -botShadowColor index 11 -font "helvetica-medium-r-20.0" -buttonLabel "Load Map File" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py load_lite_map" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 2044 -y 447 -w 8 -h 23 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "I" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 2002 -y 449 -w 16 -h 23 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "H" -} -autoSize -endObjectProperties - -# (Text w. Reg. Exp.) -object activeXRegTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 1250 -y 477 -w 2 -h 0 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -autoSize -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 40 -y 290 -w 194 -h 40 -fgColor index 0 -bgColor index 23 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -buttonLabel "Save Screen Map" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py save_screen_map" -} -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 12 -y 337 -w 244 -h 53 -fgColor index 13 -bgColor index 49 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -buttonLabel "Upload Parameters" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py upload_parameters regina" -} -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 525 -y 324 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP46" -pressValue "1" -releaseValue "0" -onLabel "36" -offLabel "36" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP46" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 480 -y 324 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP45" -pressValue "1" -releaseValue "0" -onLabel "35" -offLabel "35" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP45" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 480 -y 281 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP44" -pressValue "1" -releaseValue "0" -onLabel "34" -offLabel "34" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP44" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 525 -y 281 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP47" -pressValue "1" -releaseValue "0" -onLabel "37" -offLabel "37" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP47" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 525 -y 238 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP48" -pressValue "1" -releaseValue "0" -onLabel "38" -offLabel "38" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP48" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 525 -y 195 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP49" -pressValue "1" -releaseValue "0" -onLabel "39" -offLabel "39" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP49" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 299 -y 66 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP11" -pressValue "1" -releaseValue "0" -onLabel "01" -offLabel "01" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP11" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 299 -y 109 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP12" -pressValue "1" -releaseValue "0" -onLabel "02" -offLabel "02" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP12" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 299 -y 152 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP13" -pressValue "1" -releaseValue "0" -onLabel "03" -offLabel "03" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP13" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 389 -y 195 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP28" -pressValue "1" -releaseValue "0" -onLabel "18" -offLabel "18" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP28" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 389 -y 152 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP27" -pressValue "1" -releaseValue "0" -onLabel "17" -offLabel "17" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP27" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 389 -y 109 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP26" -pressValue "1" -releaseValue "0" -onLabel "16" -offLabel "16" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP26" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 389 -y 281 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP30" -pressValue "1" -releaseValue "0" -onLabel "20" -offLabel "20" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP30" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 389 -y 324 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP31" -pressValue "1" -releaseValue "0" -onLabel "21" -offLabel "21" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP31" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 389 -y 238 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP29" -pressValue "1" -releaseValue "0" -onLabel "19" -offLabel "19" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP29" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 480 -y 238 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP43" -pressValue "1" -releaseValue "0" -onLabel "33" -offLabel "33" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP43" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 480 -y 195 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP42" -pressValue "1" -releaseValue "0" -onLabel "32" -offLabel "32" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP42" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 480 -y 152 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP41" -pressValue "1" -releaseValue "0" -onLabel "31" -offLabel "31" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP41" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 525 -y 152 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP50" -pressValue "1" -releaseValue "0" -onLabel "40" -offLabel "40" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP50" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 525 -y 109 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP51" -pressValue "1" -releaseValue "0" -onLabel "41" -offLabel "41" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP51" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 525 -y 66 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP52" -pressValue "1" -releaseValue "0" -onLabel "42" -offLabel "42" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP52" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 571 -y 324 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP59" -pressValue "1" -releaseValue "0" -onLabel "49" -offLabel "49" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP59" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 299 -y 195 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP14" -pressValue "1" -releaseValue "0" -onLabel "04" -offLabel "04" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP14" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 299 -y 238 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP15" -pressValue "1" -releaseValue "0" -onLabel "05" -offLabel "05" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP15" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 299 -y 281 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP16" -pressValue "1" -releaseValue "0" -onLabel "06" -offLabel "06" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP16" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 389 -y 66 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP25" -pressValue "1" -releaseValue "0" -onLabel "15" -offLabel "15" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP25" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 344 -y 66 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP24" -pressValue "1" -releaseValue "0" -onLabel "14" -offLabel "14" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP24" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 344 -y 109 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP23" -pressValue "1" -releaseValue "0" -onLabel "13" -offLabel "13" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP23" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 434 -y 281 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP33" -pressValue "1" -releaseValue "0" -onLabel "23" -offLabel "23" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP33" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 434 -y 238 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP34" -pressValue "1" -releaseValue "0" -onLabel "24" -offLabel "24" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP34" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 434 -y 324 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP32" -pressValue "1" -releaseValue "0" -onLabel "22" -offLabel "22" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP32" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 480 -y 109 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP40" -pressValue "1" -releaseValue "0" -onLabel "30" -offLabel "30" -toggle -3d -font "arial-medium-r-18.0" -visMin "1" -visMax "0" -colorPv "ME14E-MO-IOC-01:GP40" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 480 -y 66 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP39" -pressValue "1" -releaseValue "0" -onLabel "29" -offLabel "29" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP39" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 434 -y 66 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP38" -pressValue "1" -releaseValue "0" -onLabel "28" -offLabel "28" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP38" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 571 -y 66 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP53" -pressValue "1" -releaseValue "0" -onLabel "43" -offLabel "43" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP53" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 571 -y 109 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP54" -pressValue "1" -releaseValue "0" -onLabel "44" -offLabel "44" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP54" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 571 -y 152 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP55" -pressValue "1" -releaseValue "0" -onLabel "45" -offLabel "45" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP55" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 571 -y 238 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP57" -pressValue "1" -releaseValue "0" -onLabel "47" -offLabel "47" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP57" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 571 -y 281 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP58" -pressValue "1" -releaseValue "0" -onLabel "48" -offLabel "48" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP58" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 299 -y 324 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP17" -pressValue "1" -releaseValue "0" -onLabel "07" -offLabel "07" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP17" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 344 -y 324 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP18" -pressValue "1" -releaseValue "0" -onLabel "08" -offLabel "08" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP18" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 344 -y 281 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP19" -pressValue "1" -releaseValue "0" -onLabel "09" -offLabel "09" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP19" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 344 -y 152 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP22" -pressValue "1" -releaseValue "0" -onLabel "12" -offLabel "12" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP22" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 344 -y 195 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP21" -pressValue "1" -releaseValue "0" -onLabel "11" -offLabel "11" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP21" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 344 -y 238 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP20" -pressValue "1" -releaseValue "0" -onLabel "10" -offLabel "10" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP20" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 434 -y 152 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP36" -pressValue "1" -releaseValue "0" -onLabel "26" -offLabel "26" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP36" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 434 -y 109 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP37" -pressValue "1" -releaseValue "0" -onLabel "27" -offLabel "27" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP37" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 434 -y 195 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP35" -pressValue "1" -releaseValue "0" -onLabel "25" -offLabel "25" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP35" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 310 -y 31 -w 18 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "A" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 352 -y 31 -w 18 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "B" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 399 -y 31 -w 18 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "C" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 441 -y 31 -w 19 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "D" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 486 -y 31 -w 18 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "E" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 528 -y 31 -w 17 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "F" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 575 -y 31 -w 19 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "G" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 278 -y 72 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "1" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 278 -y 113 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "2" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 278 -y 157 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "3" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 278 -y 198 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "4" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 278 -y 328 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "7" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 278 -y 284 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "6" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 278 -y 243 -w 14 -h 31 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "5" -} -autoSize -endObjectProperties - -# (Text Control) -object activeXTextDspClass -beginObjectProperties -major 4 -minor 6 -release 0 -x 47 -y 100 -w 170 -h 30 -controlPv "ME14E-MO-IOC-01:GP5" -font "helvetica-medium-r-20.0" -fontAlign "right" -fgColor index 25 -bgColor index 6 -editable -autoHeight -motifWidget -limitsFromDb -nullColor index 0 -useKp -file -useHexPrefix -newPos -inputFocusUpdates -objType "controls" -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 140 -y 179 -w 73 -h 35 -fgColor index 14 -bgColor index 5 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py load_stock_map clear" -} -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 55 -y 179 -w 74 -h 35 -fgColor index 14 -bgColor index 20 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py load_stock_map r77" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 147 -y 183 -w 59 -h 26 -font "arial-medium-r-20.0" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "All off" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 63 -y 183 -w 58 -h 26 -font "arial-medium-r-20.0" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "All on" -} -autoSize -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 571 -y 195 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP56" -pressValue "1" -releaseValue "0" -onLabel "46" -offLabel "46" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP56" -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 147 -y 222 -w 59 -h 59 -fgColor index 14 -bgColor index 5 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py load_stock_map r55" -} -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 154 -y 230 -w 44 -h 44 -lineColor index 20 -fill -fillColor index 20 -lineWidth 0 -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 160 -y 241 -w 33 -h 23 -font "helvetica-bold-r-18.0" -fontAlign "center" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "5x5" -} -autoSize -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 63 -y 222 -w 59 -h 59 -fgColor index 14 -bgColor index 5 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py load_stock_map r33" -} -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 75 -y 233 -w 34 -h 36 -lineColor index 20 -fill -fillColor index 20 -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 78 -y 242 -w 30 -h 21 -font "arial-bold-r-16.0" -fontAlign "center" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "3x3" -} -autoSize -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 271 -y 29 -w 360 -h 351 -lineColor index 7 -fill -fillColor index 7 -visPv "ME14E-MO-IOC-01:GP1" -visMin "6" -visMax "8" -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 9 -y 41 -w 244 -h 53 -fgColor index 14 -bgColor index 48 -topShadowColor index 1 -botShadowColor index 9 -font "helvetica-medium-r-20.0" -buttonLabel "Define Chip In PMAC" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/sacla2_Chip_Manager1_v4.py define_current_chip regina" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 44 -y 4 -w 189 -h 37 -font "helvetica-bold-r-28.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "Regina Chip" -} -autoSize -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 276 -y 25 -w 361 -h 350 -lineColor index 7 -fill -fillColor index 7 -visPv "ME14E-MO-IOC-01:GP1" -visMin "0" -visMax "5" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 298 -y 141 -w 336 -h 93 -font "helvetica-bold-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -visPv "ME14E-MO-IOC-01:GP1" -visMin "6" -visMax "8" -value { - "Chip type MUST be set to " - "Regina " - "for gui to be active" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 298 -y 141 -w 336 -h 93 -font "helvetica-bold-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -visPv "ME14E-MO-IOC-01:GP1" -visMin "0" -visMax "5" -value { - "Chip type MUST be set to " - "Regina " - "for gui to be active" -} -autoSize -endObjectProperties - diff --git a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-torontov5.edl b/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-torontov5.edl deleted file mode 100644 index 3890184e5..000000000 --- a/src/mx_bluesky/I24/serial/fixed_target/FT-gui-edm/MappingLite-torontov5.edl +++ /dev/null @@ -1,3002 +0,0 @@ -4 0 1 -beginScreenProperties -major 4 -minor 0 -release 1 -x 3849 -y 774 -w 716 -h 436 -font "arial-medium-r-18.0" -ctlFont "arial-medium-r-18.0" -btnFont "arial-medium-r-18.0" -fgColor index 9 -bgColor index 7 -textColor index 14 -ctlFgColor1 index 14 -ctlFgColor2 index 0 -ctlBgColor1 index 0 -ctlBgColor2 index 14 -topShadowColor index 9 -botShadowColor index 9 -title "Mapping Lite" -gridSize 5 -endScreenProperties - -# (Text Control) -object activeXTextDspClass -beginObjectProperties -major 4 -minor 6 -release 0 -x 65 -y 112 -w 170 -h 30 -controlPv "ME14E-MO-IOC-01:GP5" -font "arial-medium-r-18.0" -fontAlign "right" -fgColor index 25 -bgColor index 6 -editable -autoHeight -motifWidget -limitsFromDb -nullColor index 0 -useKp -file -useHexPrefix -newPos -inputFocusUpdates -objType "controls" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 2044 -y 447 -w 5 -h 21 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "I" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 2002 -y 449 -w 13 -h 21 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "H" -} -autoSize -endObjectProperties - -# (Text w. Reg. Exp.) -object activeXRegTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 1250 -y 477 -w 2 -h 0 -font "arial-medium-r-18.0" -fgColor index 14 -bgColor index 0 -useDisplayBg -autoSize -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 575 -y 39 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP65" -pressValue "1" -releaseValue "0" -onLabel "55" -offLabel "55" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP65" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 575 -y 82 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP66" -pressValue "1" -releaseValue "0" -onLabel "56" -offLabel "56" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP66" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 575 -y 125 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP67" -pressValue "1" -releaseValue "0" -onLabel "57" -offLabel "57" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP67" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 619 -y 39 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP82" -pressValue "1" -releaseValue "0" -onLabel "72" -offLabel "72" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP82" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 619 -y 82 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP81" -pressValue "1" -releaseValue "0" -onLabel "71" -offLabel "71" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP81" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 619 -y 125 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP80" -pressValue "1" -releaseValue "0" -onLabel "70" -offLabel "70" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP80" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 663 -y 82 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP84" -pressValue "1" -releaseValue "0" -onLabel "74" -offLabel "74" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP84" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 663 -y 125 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP85" -pressValue "1" -releaseValue "0" -onLabel "75" -offLabel "75" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP85" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 663 -y 39 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP83" -pressValue "1" -releaseValue "0" -onLabel "73" -offLabel "73" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP83" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 443 -y 41 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP46" -pressValue "1" -releaseValue "0" -onLabel "36" -offLabel "36" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP46" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 443 -y 84 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP45" -pressValue "1" -releaseValue "0" -onLabel "35" -offLabel "35" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP45" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 443 -y 127 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP44" -pressValue "1" -releaseValue "0" -onLabel "34" -offLabel "34" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP44" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 487 -y 40 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP47" -pressValue "1" -releaseValue "0" -onLabel "37" -offLabel "37" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP47" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 487 -y 83 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP48" -pressValue "1" -releaseValue "0" -onLabel "38" -offLabel "38" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP48" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 487 -y 126 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP49" -pressValue "1" -releaseValue "0" -onLabel "39" -offLabel "39" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP49" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 531 -y 83 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP63" -pressValue "1" -releaseValue "0" -onLabel "53" -offLabel "53" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP63" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 531 -y 126 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP62" -pressValue "1" -releaseValue "0" -onLabel "52" -offLabel "52" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP62" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 531 -y 40 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP64" -pressValue "1" -releaseValue "0" -onLabel "54" -offLabel "54" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP64" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 311 -y 40 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP11" -pressValue "1" -releaseValue "0" -onLabel "01" -offLabel "01" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP11" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 311 -y 83 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP12" -pressValue "1" -releaseValue "0" -onLabel "02" -offLabel "02" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP12" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 311 -y 126 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP13" -pressValue "1" -releaseValue "0" -onLabel "03" -offLabel "03" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP13" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 355 -y 40 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP28" -pressValue "1" -releaseValue "0" -onLabel "18" -offLabel "18" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP28" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 355 -y 83 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP27" -pressValue "1" -releaseValue "0" -onLabel "17" -offLabel "17" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP27" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 355 -y 126 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP26" -pressValue "1" -releaseValue "0" -onLabel "16" -offLabel "16" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP26" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 399 -y 83 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP30" -pressValue "1" -releaseValue "0" -onLabel "20" -offLabel "20" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP30" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 399 -y 126 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP31" -pressValue "1" -releaseValue "0" -onLabel "21" -offLabel "21" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP31" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 399 -y 40 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP29" -pressValue "1" -releaseValue "0" -onLabel "19" -offLabel "19" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP29" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 575 -y 168 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP68" -pressValue "1" -releaseValue "0" -onLabel "58" -offLabel "58" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP68" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 575 -y 211 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP69" -pressValue "1" -releaseValue "0" -onLabel "59" -offLabel "59" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP69" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 575 -y 254 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP70" -pressValue "1" -releaseValue "0" -onLabel "60" -offLabel "60" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP70" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 619 -y 168 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP79" -pressValue "1" -releaseValue "0" -onLabel "69" -offLabel "69" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP79" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 619 -y 211 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP78" -pressValue "1" -releaseValue "0" -onLabel "68" -offLabel "68" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP78" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 619 -y 254 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP77" -pressValue "1" -releaseValue "0" -onLabel "67" -offLabel "67" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP77" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 663 -y 211 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP87" -pressValue "1" -releaseValue "0" -onLabel "77" -offLabel "77" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP87" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 663 -y 254 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP88" -pressValue "1" -releaseValue "0" -onLabel "78" -offLabel "78" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP88" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 663 -y 168 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP86" -pressValue "1" -releaseValue "0" -onLabel "76" -offLabel "76" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP86" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 443 -y 170 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP43" -pressValue "1" -releaseValue "0" -onLabel "33" -offLabel "33" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP43" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 443 -y 213 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP42" -pressValue "1" -releaseValue "0" -onLabel "32" -offLabel "32" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP42" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 443 -y 256 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP41" -pressValue "1" -releaseValue "0" -onLabel "31" -offLabel "31" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP41" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 487 -y 169 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP50" -pressValue "1" -releaseValue "0" -onLabel "40" -offLabel "40" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP50" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 487 -y 212 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP51" -pressValue "1" -releaseValue "0" -onLabel "41" -offLabel "41" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP51" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 487 -y 255 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP52" -pressValue "1" -releaseValue "0" -onLabel "42" -offLabel "42" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP52" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 531 -y 212 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP60" -pressValue "1" -releaseValue "0" -onLabel "50" -offLabel "50" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP60" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 531 -y 255 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP59" -pressValue "1" -releaseValue "0" -onLabel "49" -offLabel "49" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP59" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 531 -y 169 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP61" -pressValue "1" -releaseValue "0" -onLabel "51" -offLabel "51" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP61" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 311 -y 169 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP14" -pressValue "1" -releaseValue "0" -onLabel "04" -offLabel "04" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP14" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 311 -y 212 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP15" -pressValue "1" -releaseValue "0" -onLabel "05" -offLabel "05" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP15" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 311 -y 255 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP16" -pressValue "1" -releaseValue "0" -onLabel "06" -offLabel "06" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP16" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 355 -y 169 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP25" -pressValue "1" -releaseValue "0" -onLabel "15" -offLabel "15" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP25" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 355 -y 212 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP24" -pressValue "1" -releaseValue "0" -onLabel "14" -offLabel "14" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP24" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 355 -y 255 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP23" -pressValue "1" -releaseValue "0" -onLabel "13" -offLabel "13" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP23" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 399 -y 212 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP33" -pressValue "1" -releaseValue "0" -onLabel "23" -offLabel "23" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP33" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 399 -y 255 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP34" -pressValue "1" -releaseValue "0" -onLabel "24" -offLabel "24" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP34" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 399 -y 169 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP32" -pressValue "1" -releaseValue "0" -onLabel "22" -offLabel "22" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP32" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 575 -y 298 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP71" -pressValue "1" -releaseValue "0" -onLabel "61" -offLabel "61" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP71" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 575 -y 341 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP72" -pressValue "1" -releaseValue "0" -onLabel "62" -offLabel "62" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP72" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 575 -y 384 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP73" -pressValue "1" -releaseValue "0" -onLabel "63" -offLabel "63" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP73" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 619 -y 298 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP76" -pressValue "1" -releaseValue "0" -onLabel "66" -offLabel "66" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP76" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 619 -y 341 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP75" -pressValue "1" -releaseValue "0" -onLabel "65" -offLabel "65" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP75" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 619 -y 384 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP74" -pressValue "1" -releaseValue "0" -onLabel "64" -offLabel "64" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP74" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 663 -y 341 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP90" -pressValue "1" -releaseValue "0" -onLabel "80" -offLabel "80" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP90" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 663 -y 384 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP91" -pressValue "1" -releaseValue "0" -onLabel "81" -offLabel "81" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP91" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 663 -y 298 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP89" -pressValue "1" -releaseValue "0" -onLabel "79" -offLabel "79" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP89" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 443 -y 300 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP40" -pressValue "1" -releaseValue "0" -onLabel "30" -offLabel "30" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP40" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 443 -y 343 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP39" -pressValue "1" -releaseValue "0" -onLabel "29" -offLabel "29" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP39" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 443 -y 386 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP38" -pressValue "1" -releaseValue "0" -onLabel "28" -offLabel "28" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP38" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 487 -y 299 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP53" -pressValue "1" -releaseValue "0" -onLabel "43" -offLabel "43" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP53" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 487 -y 342 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP54" -pressValue "1" -releaseValue "0" -onLabel "44" -offLabel "44" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP54" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 487 -y 385 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP55" -pressValue "1" -releaseValue "0" -onLabel "45" -offLabel "45" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP55" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 531 -y 342 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP57" -pressValue "1" -releaseValue "0" -onLabel "47" -offLabel "47" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP57" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 531 -y 385 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP56" -pressValue "1" -releaseValue "0" -onLabel "46" -offLabel "46" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP56" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 531 -y 299 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP58" -pressValue "1" -releaseValue "0" -onLabel "48" -offLabel "48" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP58" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 311 -y 299 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP17" -pressValue "1" -releaseValue "0" -onLabel "07" -offLabel "07" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP17" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 311 -y 342 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP18" -pressValue "1" -releaseValue "0" -onLabel "08" -offLabel "08" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP18" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 311 -y 385 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP19" -pressValue "1" -releaseValue "0" -onLabel "09" -offLabel "09" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP19" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 355 -y 299 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP22" -pressValue "1" -releaseValue "0" -onLabel "12" -offLabel "12" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP22" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 355 -y 342 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP21" -pressValue "1" -releaseValue "0" -onLabel "11" -offLabel "11" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP21" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 355 -y 385 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP20" -pressValue "1" -releaseValue "0" -onLabel "10" -offLabel "10" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP20" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 399 -y 342 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP36" -pressValue "1" -releaseValue "0" -onLabel "26" -offLabel "26" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP36" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 399 -y 385 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP37" -pressValue "1" -releaseValue "0" -onLabel "27" -offLabel "27" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP37" -endObjectProperties - -# (Message Button) -object activeMessageButtonClass -beginObjectProperties -major 4 -minor 1 -release 0 -x 399 -y 299 -w 40 -h 40 -fgColor index 14 -onColor index 84 -offColor index 84 -topShadowColor index 9 -botShadowColor index 9 -controlPv "ME14E-MO-IOC-01:GP35" -pressValue "1" -releaseValue "0" -onLabel "25" -offLabel "25" -toggle -3d -font "arial-medium-r-18.0" -colorPv "ME14E-MO-IOC-01:GP35" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 322 -y 5 -w 16 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "A" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 364 -y 5 -w 17 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "B" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 411 -y 5 -w 17 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "C" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 453 -y 5 -w 18 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "D" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 498 -y 5 -w 16 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "E" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 540 -y 5 -w 15 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "F" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 587 -y 5 -w 19 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "G" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 629 -y 5 -w 18 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "H" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 670 -y 5 -w 6 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "I" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 290 -y 46 -w 14 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "1" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 290 -y 388 -w 13 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "9" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 290 -y 87 -w 14 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "2" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 290 -y 131 -w 13 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "3" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 290 -y 172 -w 13 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "4" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 290 -y 343 -w 13 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "8" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 290 -y 302 -w 13 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "7" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 290 -y 258 -w 13 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "6" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 290 -y 217 -w 13 -h 27 -font "arial-medium-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "5" -} -autoSize -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 66 -y 149 -w 170 -h 37 -fgColor index 0 -bgColor index 23 -topShadowColor index 1 -botShadowColor index 9 -font "arial-medium-r-18.0" -buttonLabel "Load Map File" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/Chip_Manager_v5.py load_lite_map" -} -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 58 -y 312 -w 194 -h 40 -fgColor index 0 -bgColor index 23 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -buttonLabel "Save Screen Map" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/Chip_Manager_v5.py save_screen_map" -} -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 30 -y 363 -w 244 -h 53 -fgColor index 14 -bgColor index 49 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -buttonLabel "Upload Parameters" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/Chip_Manager_v5.py upload_parameters toronto" -} -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 158 -y 196 -w 73 -h 35 -fgColor index 14 -bgColor index 5 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/Chip_Manager_v5.py load_stock_map clear" -} -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 73 -y 196 -w 74 -h 35 -fgColor index 14 -bgColor index 20 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/Chip_Manager_v5.py load_stock_map x99" -} -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 165 -y 200 -w 50 -h 23 -font "arial-medium-r-20.0" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "All off" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 81 -y 200 -w 51 -h 23 -font "arial-medium-r-20.0" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "All on" -} -autoSize -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 215 -y 240 -w 59 -h 59 -fgColor index 14 -bgColor index 5 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/Chip_Manager_v5.py load_stock_map x77" -} -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 224 -y 248 -w 44 -h 44 -lineColor index 20 -fill -fillColor index 20 -lineWidth 0 -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 230 -y 258 -w 29 -h 21 -font "helvetica-bold-r-18.0" -fontAlign "center" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "7x7" -} -autoSize -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 30 -y 239 -w 59 -h 59 -fgColor index 14 -bgColor index 5 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/Chip_Manager_v5.py load_stock_map x33" -} -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 42 -y 250 -w 34 -h 36 -lineColor index 20 -fill -fillColor index 20 -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 46 -y 258 -w 24 -h 16 -font "arial-bold-r-14.0" -fontAlign "center" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "3x3" -} -autoSize -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 124 -y 240 -w 59 -h 59 -fgColor index 14 -bgColor index 5 -topShadowColor index 1 -botShadowColor index 11 -font "arial-medium-r-18.0" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/Chip_Manager_v5.py load_stock_map x55" -} -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 132 -y 250 -w 42 -h 41 -lineColor index 20 -fill -fillColor index 20 -lineWidth 0 -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 136 -y 258 -w 29 -h 21 -font "helvetica-bold-r-18.0" -fontAlign "center" -fgColor index 0 -bgColor index 0 -useDisplayBg -value { - "5x5" -} -autoSize -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 46 -y 7 -w 107 -h 21 -font "arial-medium-r-18.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -value { - "Toronto Chip" -} -autoSize -endObjectProperties - -# (Shell Command) -object shellCmdClass -beginObjectProperties -major 4 -minor 3 -release 0 -x 23 -y 39 -w 244 -h 53 -fgColor index 14 -bgColor index 48 -topShadowColor index 1 -botShadowColor index 9 -font "helvetica-medium-r-18.0" -buttonLabel "Define Chip In PMAC" -numCmds 1 -command { - 0 "python /dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/Chip_Manager_v5.py define_current_chip toronto" -} -endObjectProperties - -# (Rectangle) -object activeRectangleClass -beginObjectProperties -major 4 -minor 0 -release 0 -x 311 -y 36 -w 398 -h 392 -lineColor index 7 -fill -fillColor index 7 -visPv "ME14E-MO-IOC-01:GP1" -visMin "1" -visMax "5" -endObjectProperties - -# (Static Text) -object activeXTextClass -beginObjectProperties -major 4 -minor 1 -release 1 -x 338 -y 179 -w 306 -h 81 -font "helvetica-bold-r-24.0" -fontAlign "center" -fgColor index 14 -bgColor index 0 -useDisplayBg -visPv "ME14E-MO-IOC-01:GP1" -visMin "1" -visMax "5" -value { - "Chip type MUST be set to " - "Toronto " - "for gui to be active" -} -autoSize -endObjectProperties - diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py index eb29ed6c3..fa65f5f1a 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py @@ -77,10 +77,7 @@ def plot_file(fid, chip_type): left=0.03, bottom=0.03, right=0.97, top=0.97, wspace=0, hspace=0 ) ax1 = fig.add_subplot(111, aspect="equal", axisbg="0.3") - # ax1.scatter(xr, yr, c=zr, s=8, alpha=1, marker='s', linewidth=0.1, cmap='autumn') ax1.scatter(xr, yr, c=zr, s=8, alpha=1, marker="s", linewidth=0.1, cmap="winter") - # ax1.set_xticks([2.2*x for x in range(11)]) - # ax1.set_yticks([2.5*x for x in range(11)]) ax1.set_xlim(-1, 26) ax1.set_ylim(-1, 26) ax1.invert_yaxis() From 0f28ae2ac4b56d4076614d227ee802bed76ca510 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 7 Jun 2023 14:14:06 +0100 Subject: [PATCH 14/47] Simplify entry point for collect commands --- pyproject.toml | 2 + .../extruder/i24ssx_Extruder_Collect_py3v2.py | 50 +++++++++++++------ .../fixed_target/i24ssx_Chip_Collect_py3v1.py | 25 ++++++++-- 3 files changed, 59 insertions(+), 18 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3024c28af..991e2bb9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,6 +47,8 @@ dev = [ [project.scripts] mx_bluesky = "mx_bluesky.__main__:main" +extruder_collect = "mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2:main" +chip_collect = "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1:main" [project.urls] GitHub = "https://github.com/DiamondLightSource/mx_bluesky" diff --git a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py index 0f306e8f5..2d689ea9d 100755 --- a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +++ b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py @@ -5,6 +5,7 @@ """ from __future__ import annotations +import argparse import inspect import logging import pathlib @@ -441,20 +442,41 @@ def run_extruderi24(): return 1 -def main(args): +usage = "%(prog)s command [options]" +parser = argparse.ArgumentParser(usage=usage, description=__doc__) +subparsers = parser.add_subparsers( + help="Choose command.", + required=True, + dest="sub-command", +) + +parser_init = subparsers.add_parser( + "initialise", + description="Initialise extruder on beamline I24.", +) +parser_init.set_defaults(func=initialise_extruderi24) +parser_run = subparsers.add_parser( + "run", + description="Run extruder on I24.", +) +parser_run.set_defaults(func=run_extruderi24) +parser_mv = subparsers.add_parser( + "moveto", + description="Move extruder to requested setting on I24.", +) +parser_mv.add_argument( + "place", + type=str, + choices=["laseron", "laseroff", "enterhutch"], + help="Requested setting.", +) +parser_mv.set_defaults(func=moveto) + + +def main(): setup_logging() - command = args[0] - print(args) - print("done") - if command == "initialise": - initialise_extruderi24() - elif command == "run": - run_extruderi24() - elif command == "moveto": - moveto(args[1]) - else: - print("Unknown arg") + args = parser.parse_args() + args.func(args) -if __name__ == "__main__": - main(sys.argv[1:]) +main() diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py index 39d4fbd22..8d5f0f1a3 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py @@ -1,6 +1,7 @@ """ Fixed target data collection """ +import argparse import inspect import logging import os @@ -679,8 +680,11 @@ def finish_sacla(): return end_time -def main(location="i24"): +def main(): setup_logging() + args = parser.parse_args() + + location = args.loc print("Location is", location, "Starting") # ABORT BUTTON name = inspect.stack()[0][3] @@ -877,6 +881,19 @@ def main(location="i24"): logger.info("%s End Time = %s" % (name, end_time)) -if __name__ == "__main__": - # main(location='SACLA') - main(location="i24") +usage = "%(prog)s [options]" +parser = argparse.ArgumentParser(usage=usage, description=__doc__) +parser.add_argument( + "-l", + "--loc", + type=str, + choices=["i24", "SACLA"], + default="i24", + help="Location of collection.", +) + +main() + +# if __name__ == "__main__": +# main(location='SACLA') +# main(location="i24") From 15883e0659afcd56bf5a1e88ab4dcd0ceb1f6f80 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 7 Jun 2023 14:40:06 +0100 Subject: [PATCH 15/47] Remove from pyproject --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 991e2bb9a..3024c28af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,8 +47,6 @@ dev = [ [project.scripts] mx_bluesky = "mx_bluesky.__main__:main" -extruder_collect = "mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2:main" -chip_collect = "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1:main" [project.urls] GitHub = "https://github.com/DiamondLightSource/mx_bluesky" From 285ec773d52c7069318feb87d462319a3481dc10 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 7 Jun 2023 14:42:21 +0100 Subject: [PATCH 16/47] Readd forgotten bits --- .../extruder/i24ssx_Extruder_Collect_py3v2.py | 3 +- .../fixed_target/i24ssx_Chip_Collect_py3v1.py | 29 +++++++++---------- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py index 2d689ea9d..7a8e015bb 100755 --- a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +++ b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py @@ -479,4 +479,5 @@ def main(): args.func(args) -main() +if __name__ == "__main__": + main() diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py index 8d5f0f1a3..633ceb201 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py @@ -26,6 +26,17 @@ logger = logging.getLogger("I24ssx.fixed_target") +usage = "%(prog)s [options]" +parser = argparse.ArgumentParser(usage=usage, description=__doc__) +parser.add_argument( + "-l", + "--loc", + type=str, + choices=["i24", "SACLA"], + default="i24", + help="Location of collection.", +) + def setup_logging(): # Log should now change name daily. @@ -881,19 +892,5 @@ def main(): logger.info("%s End Time = %s" % (name, end_time)) -usage = "%(prog)s [options]" -parser = argparse.ArgumentParser(usage=usage, description=__doc__) -parser.add_argument( - "-l", - "--loc", - type=str, - choices=["i24", "SACLA"], - default="i24", - help="Location of collection.", -) - -main() - -# if __name__ == "__main__": -# main(location='SACLA') -# main(location="i24") +if __name__ == "__main__": + main() From 7426da2e1dc24ee0b9e4c402b9ad6fde5f35f586 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 7 Jun 2023 14:56:15 +0100 Subject: [PATCH 17/47] Clean up some file open --- .../extruder/i24ssx_Extruder_Collect_py3v2.py | 23 +- .../fixed_target/i24ssx_Chip_Collect_py3v1.py | 56 ++-- .../fixed_target/i24ssx_Chip_Manager_py3v1.py | 161 +++++----- .../fixed_target/i24ssx_Chip_Mapping_py3v1.py | 300 +++++++++--------- 4 files changed, 273 insertions(+), 267 deletions(-) diff --git a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py index 7a8e015bb..d6b88c146 100755 --- a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +++ b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py @@ -120,18 +120,17 @@ def write_parameter_file(): print("Requested filename ends in a number. Appended dash:", filename) logger.info("%s Requested filename ends in a number. Appended dash") - f = open(param_path + param_fid, "w") - f.write("visit \t\t%s\n" % visit) - f.write("directory \t%s\n" % directory) - f.write("filename \t%s\n" % filename) - f.write("num_imgs \t%s\n" % num_imgs) - f.write("exp_time \t%s\n" % exp_time) - f.write("det_dist \t%s\n" % det_dist) - f.write("det_type \t%s\n" % det_type) - f.write("pump_probe \t%s\n" % pump_status) - f.write("pump_exp \t%s\n" % pump_exp) - f.write("pump_delay \t%s\n" % pump_delay) - f.close() + with open(param_path + param_fid, "w") as f: + f.write("visit \t\t%s\n" % visit) + f.write("directory \t%s\n" % directory) + f.write("filename \t%s\n" % filename) + f.write("num_imgs \t%s\n" % num_imgs) + f.write("exp_time \t%s\n" % exp_time) + f.write("det_dist \t%s\n" % det_dist) + f.write("det_type \t%s\n" % det_type) + f.write("pump_probe \t%s\n" % pump_status) + f.write("pump_exp \t%s\n" % pump_exp) + f.write("pump_delay \t%s\n" % pump_delay) logger.info("%s visit %s" % (name, visit)) logger.info("%s directory %s" % (name, directory)) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py index 633ceb201..fbcf3af76 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py @@ -323,12 +323,12 @@ def datasetsizei24(): elif map_type == "1": chip_format = get_format(chip_type)[2:4] block_count = 0 - f = open("/dls_sw/i24/scripts/fastchips/litemaps/currentchip.map", "r") - for line in f.readlines(): - entry = line.split() - if entry[2] == "1": - block_count += 1 - f.close() + with open("/dls_sw/i24/scripts/fastchips/litemaps/currentchip.map", "r") as f: + for line in f.readlines(): + entry = line.split() + if entry[2] == "1": + block_count += 1 + print("block_count", block_count) print(chip_format) logger.info("%s\t:block_count=%s" % (name, block_count)) @@ -389,13 +389,14 @@ def datasetsizesacla(): elif map_type == "1" or map_type == "3": chip_format = get_format(chip_type)[2:4] block_count = 0 - # f = open('/localhome/local/Documents/sacla/parameter_files/currentchip.map', 'r') - f = open("/dls_sw/i24/scripts/fastchips/parameter_files/currentchip.map", "r") - for line in f.readlines(): - entry = line.split() - if entry[2] == "1": - block_count += 1 - f.close() + # or '/localhome/local/Documents/sacla/parameter_files/currentchip.map' + with open( + "/dls_sw/i24/scripts/fastchips/parameter_files/currentchip.map", "r" + ) as f: + for line in f.readlines(): + entry = line.split() + if entry[2] == "1": + block_count += 1 print("block_count", block_count) logger.info("%s\t:block_count=%s" % (name, block_count)) print(chip_format) @@ -660,21 +661,20 @@ def finish_i24(chip_prog_dict, start_time): os.makedirs(userlog_path, exist_ok=True) - f = open(userlog_path + userlog_fid, "w") - f.write("Fixed Target Data Collection Parameters\n") - f.write("Data directory \t%s\n" % filepath) - f.write("Filename \t%s\n" % filename) - f.write("Shots per pos \t%s\n" % n_exposures) - f.write("Total N images \t%s\n" % total_numb_imgs) - f.write("Exposure time \t%s\n" % exptime) - f.write("Det distance \t%s\n" % dcdetdist) - f.write("Transmission \t%s\n" % transmission) - f.write("Wavelength \t%s\n" % wavelength) - f.write("Detector type \t%s\n" % det_type) - f.write("Pump status \t%s\n" % pump_repeat) - f.write("Pump exp time \t%s\n" % pumpexptime) - f.write("Pump delay \t%s\n" % pumpdelay) - f.close() + with open(userlog_path + userlog_fid, "w") as f: + f.write("Fixed Target Data Collection Parameters\n") + f.write("Data directory \t%s\n" % filepath) + f.write("Filename \t%s\n" % filename) + f.write("Shots per pos \t%s\n" % n_exposures) + f.write("Total N images \t%s\n" % total_numb_imgs) + f.write("Exposure time \t%s\n" % exptime) + f.write("Det distance \t%s\n" % dcdetdist) + f.write("Transmission \t%s\n" % transmission) + f.write("Wavelength \t%s\n" % wavelength) + f.write("Detector type \t%s\n" % det_type) + f.write("Pump status \t%s\n" % pump_repeat) + f.write("Pump exp time \t%s\n" % pumpexptime) + f.write("Pump delay \t%s\n" % pumpdelay) sleep(0.5) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index 3919f5604..61ac0776e 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -147,22 +147,20 @@ def write_parameter_file(): # param_path + param_fid, # os.path.join([visit, "processing", protein_name, chip_name]), # ] - f = open(param_path + param_fid, "w") - - f.write("visit \t\t%s\n" % visit) - f.write("chip_name \t%s\n" % chip_name) - f.write("protein_name \t%s\n" % protein_name) - f.write("n_exposures \t%s\n" % n_exposures) - f.write("chip_type \t%s\n" % chip_type) - f.write("map_type \t%s\n" % map_type) - f.write("pump_repeat \t%s\n" % pump_repeat) - f.write("pumpexptime \t%s\n" % pumpexptime) - f.write("pumpdelay \t%s\n" % pumpdelay) - f.write("prepumpexptime \t%s\n" % prepumpexptime) - f.write("exptime \t%s\n" % exptime) - f.write("dcdetdist \t%s\n" % dcdetdist) - f.write("det_type \t%s\n" % det_type) - f.close() + with open(param_path + param_fid, "w") as f: + f.write("visit \t\t%s\n" % visit) + f.write("chip_name \t%s\n" % chip_name) + f.write("protein_name \t%s\n" % protein_name) + f.write("n_exposures \t%s\n" % n_exposures) + f.write("chip_type \t%s\n" % chip_type) + f.write("map_type \t%s\n" % map_type) + f.write("pump_repeat \t%s\n" % pump_repeat) + f.write("pumpexptime \t%s\n" % pumpexptime) + f.write("pumpdelay \t%s\n" % pumpdelay) + f.write("prepumpexptime \t%s\n" % prepumpexptime) + f.write("exptime \t%s\n" % exptime) + f.write("dcdetdist \t%s\n" % dcdetdist) + f.write("det_type \t%s\n" % det_type) logger.info("%s visit: %s" % (name, visit)) logger.info("%s filename: %s" % (name, chip_name)) @@ -193,11 +191,12 @@ def write_parameter_file(): def scrape_pvar_file(fid): block_start_list = [] - dir = ( + pvar_dir = ( "/dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/" ) - f = open(dir + fid, "r") - for line in f.readlines(): + with open(pvar_dir + fid, "r") as f: + lines = f.readlines() + for line in lines: line = line.rstrip() if line.startswith("#"): continue @@ -213,7 +212,6 @@ def scrape_pvar_file(fid): x = entry[0].split("=")[1] y = entry[1].split("=")[1] block_start_list.append([block_num, x, y]) - f.close() return block_start_list @@ -245,15 +243,15 @@ def define_current_chip(chipid): param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" # param_path = '/localhome/local/Documents/sacla/parameter_files/' - f = open(param_path + chipid + ".pvar", "r") - logger.info("%s Opening %s%s.pvar" % (name, param_path, chipid)) - for line in f.readlines(): - if line.startswith("#"): - continue - line_from_file = line.rstrip("\n") - print(line_from_file) - logger.info("%s %s" % (name, line_from_file)) - caput(pv.me14e_pmac_str, line_from_file) + with open(param_path + chipid + ".pvar", "r") as f: + logger.info("%s Opening %s%s.pvar" % (name, param_path, chipid)) + for line in f.readlines(): + if line.startswith("#"): + continue + line_from_file = line.rstrip("\n") + print(line_from_file) + logger.info("%s %s" % (name, line_from_file)) + caput(pv.me14e_pmac_str, line_from_file) print(10 * "Done ") @@ -264,18 +262,17 @@ def save_screen_map(): # litemap_path = '/localhome/local/Documents/sacla/parameter_files/' print("\n\nSaving", litemap_path + "currentchip.map") logger.info("%s Saving %s currentchip.map" % (name, litemap_path)) - f = open(litemap_path + "currentchip.map", "w") - print("Printing only blocks with block_val == 1") - logger.info("%s Printing only blocks with block_val == 1" % name) - for x in range(1, 82): - block_str = "ME14E-MO-IOC-01:GP%i" % (x + 10) - block_val = int(caget(block_str)) - if block_val == 1: - print(block_str, block_val) - logger.info("%s %s %s" % (name, block_str, block_val)) - line = "%02dstatus P3%02d1 \t%s\n" % (x, x, block_val) - f.write(line) - f.close() + with open(litemap_path + "currentchip.map", "w") as f: + print("Printing only blocks with block_val == 1") + logger.info("%s Printing only blocks with block_val == 1" % name) + for x in range(1, 82): + block_str = "ME14E-MO-IOC-01:GP%i" % (x + 10) + block_val = int(caget(block_str)) + if block_val == 1: + print(block_str, block_val) + logger.info("%s %s %s" % (name, block_str, block_val)) + line = "%02dstatus P3%02d1 \t%s\n" % (x, x, block_val) + f.write(line) print(10 * "Done ") logger.info("%s %s" % (name, 10 * "Done")) return 0 @@ -304,34 +301,32 @@ def upload_parameters(chipid): width = 7 litemap_path = "/dls_sw/i24/scripts/fastchips/litemaps/" # litemap_path = '/localhome/local/Documents/sacla/parameter_files/' - f = open(litemap_path + "currentchip.map", "r") - print("chipid", chipid) - print(width) - logger.info("%s chipid %s" % (name, chipid)) - logger.info("%s width %s" % (name, width)) - x = 1 - for line in f.readlines()[: width**2]: - cols = line.split() - pvar = cols[1] - value = cols[2] - s = pvar + "=" + value - if value != "1": - s2 = pvar + " " - sys.stdout.write(s2) - else: - sys.stdout.write(s + " ") - sys.stdout.flush() - if x == width: - print() - x = 1 - else: - x += 1 - caput(pv.me14e_pmac_str, s) - sleep(0.02) - print() - # print 'Setting Mapping Type to Lite' + with open(litemap_path + "currentchip.map", "r") as f: + print("chipid", chipid) + print(width) + logger.info("%s chipid %s" % (name, chipid)) + logger.info("%s width %s" % (name, width)) + x = 1 + for line in f.readlines()[: width**2]: + cols = line.split() + pvar = cols[1] + value = cols[2] + s = pvar + "=" + value + if value != "1": + s2 = pvar + " " + sys.stdout.write(s2) + else: + sys.stdout.write(s + " ") + sys.stdout.flush() + if x == width: + print() + x = 1 + else: + x += 1 + caput(pv.me14e_pmac_str, s) + sleep(0.02) + logger.warning("%s Automatic Setting Mapping Type to Lite has been disabled" % name) - # caput(pv.me14e_gp2, 1) print(10 * "Done ") logger.info("%s %s" % (name, 10 * "Done")) @@ -340,7 +335,8 @@ def upload_full(): name = inspect.stack()[0][3] fullmap_path = "/dls_sw/i24/scripts/fastchips/fullmaps/" # fullmap_path = '/localhome/local/Documents/sacla/parameter_files/' - f = open(fullmap_path + "currentchip.full", "r").readlines() + with open(fullmap_path + "currentchip.full", "r") as fh: + f = fh.readlines() for x in range(len(f) / 2): pmac_list = [] @@ -652,8 +648,9 @@ def load_lite_map(): print("Opening", litemap_path + litemap_fid) logger.info("%s Loading Lite Map" % name) logger.info("%s Opening %s" % (name, litemap_path + litemap_fid)) - f = open(litemap_path + litemap_fid, "r") - for line in f.readlines(): + with open(litemap_path + litemap_fid, "r") as fh: + f = fh.readlines() + for line in f: entry = line.split() block_name = entry[0] yesno = entry[1] @@ -964,9 +961,10 @@ def scrape_mtr_directions(): name = inspect.stack()[0][3] param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" # param_path = '/localhome/local/Documents/sacla/parameter_files/' - f = open(param_path + "motor_direction.txt", "r") + with open(param_path + "motor_direction.txt", "r") as f: + lines = f.readlines() mtr1_dir, mtr2_dir, mtr3_dir = 1, 1, 1 - for line in f.readlines(): + for line in lines: if line.startswith("mtr1"): mtr1_dir = float(int(line.split("=")[1])) elif line.startswith("mtr2"): @@ -975,7 +973,6 @@ def scrape_mtr_directions(): mtr3_dir = float(int(line.split("=")[1])) else: continue - f.close() logger.info( "%s mt1_dir %s mtr2_dir %s mtr3_dir %s" % (name, mtr1_dir, mtr2_dir, mtr3_dir) ) @@ -1018,24 +1015,22 @@ def fiducial(point): logger.info("%s MTR2\t%1.4f\t%i\t%i\t%1.4f" % (name, rbv_2, raw_2, mtr2_dir, f_y)) logger.info("%s MTR3\t%1.4f\t%i\t%i\t%1.4f" % (name, rbv_3, raw_3, mtr3_dir, f_y)) - f = open(param_path + "fiducial_%s.txt" % point, "w") - f.write("MTR\tRBV\tRAW\tCorr\tf_value\n") - f.write("MTR1\t%1.4f\t%i\t%i\t%1.4f\n" % (rbv_1, raw_1, mtr1_dir, f_x)) - f.write("MTR2\t%1.4f\t%i\t%i\t%1.4f\n" % (rbv_2, raw_2, mtr2_dir, f_y)) - f.write("MTR3\t%1.4f\t%i\t%i\t%1.4f" % (rbv_3, raw_3, mtr3_dir, f_z)) - f.close() + with open(param_path + "fiducial_%s.txt" % point, "w") as f: + f.write("MTR\tRBV\tRAW\tCorr\tf_value\n") + f.write("MTR1\t%1.4f\t%i\t%i\t%1.4f\n" % (rbv_1, raw_1, mtr1_dir, f_x)) + f.write("MTR2\t%1.4f\t%i\t%i\t%1.4f\n" % (rbv_2, raw_2, mtr2_dir, f_y)) + f.write("MTR3\t%1.4f\t%i\t%i\t%1.4f" % (rbv_3, raw_3, mtr3_dir, f_z)) print(10 * "Done ") def scrape_mtr_fiducials(point): param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" # param_path = '/localhome/local/Documents/sacla/parameter_files/' - f = open(param_path + "fiducial_%i.txt" % point, "r") - f_lines = f.readlines()[1:] + with open(param_path + "fiducial_%i.txt" % point, "r") as f: + f_lines = f.readlines()[1:] f_x = float(f_lines[0].rsplit()[4]) f_y = float(f_lines[1].rsplit()[4]) f_z = float(f_lines[2].rsplit()[4]) - f.close() return f_x, f_y, f_z diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py index fa65f5f1a..5f9fc3deb 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py @@ -34,19 +34,19 @@ def setup_logging(): def read_file_make_dict(fid, chip_type, switch=False): name = inspect.stack()[0][3] logger.info("%s" % name) - f = open(fid, "r") a_dict = {} b_dict = {} - for line in f.readlines(): - if line.startswith("#"): - continue - else: - entry = line.rstrip().split() - addr = entry[0][-5:] - pres = entry[4] - x, y = get_xy(addr, chip_type) - a_dict[x, y] = pres - b_dict[addr] = pres + with open(fid, "r") as f: + for line in f.readlines(): + if line.startswith("#"): + continue + else: + entry = line.rstrip().split() + addr = entry[0][-5:] + pres = entry[4] + x, y = get_xy(addr, chip_type) + a_dict[x, y] = pres + b_dict[addr] = pres if switch is True: return b_dict else: @@ -169,10 +169,9 @@ def get_hamburg_order(): print(len(collect_list)) logger.info("%s length of collect_list = %s" % (name, len(collect_list))) - g = open("collect_list.txt", "w") - for x in collect_list: - g.write("%s\n" % x) - g.close() + with open("collect_list.txt", "w") as g: + for x in collect_list: + g.write("%s\n" % x) return collect_list @@ -183,146 +182,159 @@ def convert_chip_to_hex(fid, chip_type): chip_dict = read_file_make_dict(fid, chip_type, True) chip_format = get_format(chip_type) check_files(["%s.full" % chip_type]) - g = open("%s.full" % fid[:-5], "w") - # Normal - if chip_type in ["0", "1", "5"]: - shot_order_list = get_shot_order(chip_type) - logger.info("%s Shot Order List: \n" % (name)) - logger.info("%s" % shot_order_list[:14]) - logger.info("%s" % shot_order_list[-14:]) - print(shot_order_list[:14]) - print(shot_order_list[-14:]) - for i, k in enumerate(shot_order_list): - if i % 20 == 0: - print() - logger.info("\n") - else: - print(k, end=" ") - logger.info("%s" % k) - sorted_pres_list = [] - for addr in shot_order_list: - sorted_pres_list.append(chip_dict[addr]) + with open("%s.full" % fid[:-5], "w") as g: + # Normal + if chip_type in ["0", "1", "5"]: + shot_order_list = get_shot_order(chip_type) + logger.info("%s Shot Order List: \n" % (name)) + logger.info("%s" % shot_order_list[:14]) + logger.info("%s" % shot_order_list[-14:]) + print(shot_order_list[:14]) + print(shot_order_list[-14:]) + for i, k in enumerate(shot_order_list): + if i % 20 == 0: + print() + logger.info("\n") + else: + print(k, end=" ") + logger.info("%s" % k) + sorted_pres_list = [] + for addr in shot_order_list: + sorted_pres_list.append(chip_dict[addr]) - windows_per_block = chip_format[2] - number_of_lines = len(sorted_pres_list) / windows_per_block - hex_length = windows_per_block / 4 - pad = 7 - hex_length - for i in range(number_of_lines): - sublist = sorted_pres_list[ - i * windows_per_block : (i * windows_per_block) + windows_per_block - ] - if i % 2 == 0: - right_list = sublist - else: - right_list = sublist[::-1] - hex_string = ("{0:0>%sX}" % hex_length).format( - int("".join(str(x) for x in right_list), 2) - ) - hex_string = hex_string + pad * "0" - pvar = 5001 + i - line = "P%s=$%s" % (pvar, hex_string) - g.write(line + "\n") - print( - ("{0:0>%sX}" % hex_length).format( + windows_per_block = chip_format[2] + number_of_lines = len(sorted_pres_list) / windows_per_block + hex_length = windows_per_block / 4 + pad = 7 - hex_length + for i in range(number_of_lines): + sublist = sorted_pres_list[ + i * windows_per_block : (i * windows_per_block) + windows_per_block + ] + if i % 2 == 0: + right_list = sublist + else: + right_list = sublist[::-1] + hex_string = ("{0:0>%sX}" % hex_length).format( int("".join(str(x) for x in right_list), 2) ) - + 4 * "0", - end=" ", - ) - print(i, right_list, end=" ") - print("".join(str(x) for x in right_list), end=" ") - print(line) - logger.info( - "%s %s \n" - % ( - name, + hex_string = hex_string + pad * "0" + pvar = 5001 + i + line = "P%s=$%s" % (pvar, hex_string) + g.write(line + "\n") + print( ("{0:0>%sX}" % hex_length).format( int("".join(str(x) for x in right_list), 2) ) + 4 * "0", + end=" ", ) - ) - logger.info("%s %s %s \n" % (name, i, right_list)) - logger.info("%s %s\n" % (name, "".join(str(x) for x in right_list))) - logger.info("%s %s \n" % (name, line)) - if (i + 1) % windows_per_block == 0: - print("\n", 40 * (" %i" % ((i / windows_per_block) + 2))) - logger.info("\n %s" % (40 * (" %i" % ((i / windows_per_block) + 2)))) - print(hex_length) - logger.info("%s hex_length: %s" % (name, hex_length)) - # NICHT Normal - else: - logger.info("%s Dealing with Hamburg \n" % (name)) - print("Dealing with Hamburg") - shot_order_list = get_hamburg_order() - print(shot_order_list[:14]) - print(shot_order_list[-14:]) - logger.info("%s Shot Order List: \n" % (name)) - logger.info("%s" % shot_order_list[:14]) - logger.info("%s" % shot_order_list[-14:]) - sorted_pres_list = [] - for addr in shot_order_list: - sorted_pres_list.append(chip_dict[addr]) - even_odd = 0 - i = 0 - for col in range(6): - if col % 2 == 0: - for line in range(159): - chomp = [] - for x in range(28): - chomp.append(sorted_pres_list.pop(0)) - if even_odd % 2 == 0: - bite = chomp - else: - bite = chomp[::-1] - even_odd += 1 - if even_odd == 53: - even_odd = 0 - hex_string = ("{0:0>7X}").format( - int("".join(str(x) for x in bite), 2) + print(i, right_list, end=" ") + print("".join(str(x) for x in right_list), end=" ") + print(line) + logger.info( + "%s %s \n" + % ( + name, + ("{0:0>%sX}" % hex_length).format( + int("".join(str(x) for x in right_list), 2) + ) + + 4 * "0", ) - pvar = 5001 + i - writeline = "P%s=$%s" % (pvar, hex_string) - g.write(writeline + "\n") - print(line, "".join(str(x) for x in bite), end=" ") - print(("{0:0>7X}").format(int("".join(str(x) for x in bite), 2))) - logger.info("%s %s \n" % (line, "".join(str(x) for x in bite))) - logger.info( - "%s \n" - % (("{0:0>7X}").format(int("".join(str(x) for x in bite), 2))) - ) - i += 1 - print() - else: - for line in range(159): - chomp = [] - for x in range(25): - chomp.append(sorted_pres_list.pop(0)) - if even_odd % 2 == 0: - bite = chomp - else: - bite = chomp[::-1] - bite += ["0", "0", "0"] - even_odd += 1 - if even_odd == 53: - even_odd = 0 - hex_string = ("{0:0>7X}").format( - int("".join(str(x) for x in bite), 2) - ) - pvar = 5001 + i - writeline = "P%s=$%s" % (pvar, hex_string) - g.write(writeline + "\n") - print(line, "".join(str(x) for x in bite), end=" ") - print(("{0:0>7X}").format(int("".join(str(x) for x in bite), 2))) - logger.info("%s %s \n" % (line, "".join(str(x) for x in bite))) + ) + logger.info("%s %s %s \n" % (name, i, right_list)) + logger.info("%s %s\n" % (name, "".join(str(x) for x in right_list))) + logger.info("%s %s \n" % (name, line)) + if (i + 1) % windows_per_block == 0: + print("\n", 40 * (" %i" % ((i / windows_per_block) + 2))) logger.info( - "%s \n" - % (("{0:0>7X}").format(int("".join(str(x) for x in bite), 2))) + "\n %s" % (40 * (" %i" % ((i / windows_per_block) + 2))) ) - i += 1 - print() - print("----------------------------------") - g.close() + print(hex_length) + logger.info("%s hex_length: %s" % (name, hex_length)) + # NICHT Normal + else: + logger.info("%s Dealing with Hamburg \n" % (name)) + print("Dealing with Hamburg") + shot_order_list = get_hamburg_order() + print(shot_order_list[:14]) + print(shot_order_list[-14:]) + logger.info("%s Shot Order List: \n" % (name)) + logger.info("%s" % shot_order_list[:14]) + logger.info("%s" % shot_order_list[-14:]) + sorted_pres_list = [] + for addr in shot_order_list: + sorted_pres_list.append(chip_dict[addr]) + even_odd = 0 + i = 0 + for col in range(6): + if col % 2 == 0: + for line in range(159): + chomp = [] + for x in range(28): + chomp.append(sorted_pres_list.pop(0)) + if even_odd % 2 == 0: + bite = chomp + else: + bite = chomp[::-1] + even_odd += 1 + if even_odd == 53: + even_odd = 0 + hex_string = ("{0:0>7X}").format( + int("".join(str(x) for x in bite), 2) + ) + pvar = 5001 + i + writeline = "P%s=$%s" % (pvar, hex_string) + g.write(writeline + "\n") + print(line, "".join(str(x) for x in bite), end=" ") + print( + ("{0:0>7X}").format(int("".join(str(x) for x in bite), 2)) + ) + logger.info("%s %s \n" % (line, "".join(str(x) for x in bite))) + logger.info( + "%s \n" + % ( + ("{0:0>7X}").format( + int("".join(str(x) for x in bite), 2) + ) + ) + ) + i += 1 + print() + else: + for line in range(159): + chomp = [] + for x in range(25): + chomp.append(sorted_pres_list.pop(0)) + if even_odd % 2 == 0: + bite = chomp + else: + bite = chomp[::-1] + bite += ["0", "0", "0"] + even_odd += 1 + if even_odd == 53: + even_odd = 0 + hex_string = ("{0:0>7X}").format( + int("".join(str(x) for x in bite), 2) + ) + pvar = 5001 + i + writeline = "P%s=$%s" % (pvar, hex_string) + g.write(writeline + "\n") + print(line, "".join(str(x) for x in bite), end=" ") + print( + ("{0:0>7X}").format(int("".join(str(x) for x in bite), 2)) + ) + logger.info("%s %s \n" % (line, "".join(str(x) for x in bite))) + logger.info( + "%s \n" + % ( + ("{0:0>7X}").format( + int("".join(str(x) for x in bite), 2) + ) + ) + ) + i += 1 + print() + print("----------------------------------") return 0 From 836059d838b50bbdc39f33de9d41dbdc4ecb3c25 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 7 Jun 2023 15:15:38 +0100 Subject: [PATCH 18/47] Remove unused chips --- .../fixed_target/i24ssx_Chip_Manager_py3v1.py | 126 ------------- .../fixed_target/i24ssx_Chip_Mapping_py3v1.py | 176 +----------------- 2 files changed, 1 insertion(+), 301 deletions(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index 61ac0776e..80d3d1d26 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -27,21 +27,6 @@ def setup_logging(): log.config(logfile) -def whereami(): - location = "i24" - if location == "i24": - ioc = "me14e" - IOC = "ME14E" - elif location == "i19": - ioc = "me16e" - IOC = "ME14E" - print("location is ", location) - print("ioc is", ioc) - logger.info("%s location and visit: %s" % (location, ioc)) - - return location, ioc, IOC - - def initialise(): # commented out filter lines 230719 as this stage not connected name = inspect.stack()[0][3] @@ -230,16 +215,6 @@ def define_current_chip(chipid): caput(pv.me14e_gp1, 0) elif chipid == "oxford": caput(pv.me14e_gp1, 1) - elif chipid == "hamburg": - caput(pv.me14e_gp1, 2) - elif chipid == "hamburgfull": - caput(pv.me14e_gp1, 2) - elif chipid == "bismuth1": - caput(pv.me14e_gp1, 3) - elif chipid == "bismuth2": - caput(pv.me14e_gp1, 4) - elif chipid == "regina": - caput(pv.me14e_gp1, 5) param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" # param_path = '/localhome/local/Documents/sacla/parameter_files/' @@ -287,18 +262,6 @@ def upload_parameters(chipid): elif chipid == "oxford": caput(pv.me14e_gp1, 1) width = 8 - elif chipid == "hamburg": - caput(pv.me14e_gp1, 2) - width = 3 - elif chipid == "bismuth1": - caput(pv.me14e_gp1, 3) - width = 1 - elif chipid == "bismuth2": - caput(pv.me14e_gp1, 4) - width = 7 - elif chipid == "regina": - caput(pv.me14e_gp1, 5) - width = 7 litemap_path = "/dls_sw/i24/scripts/fastchips/litemaps/" # litemap_path = '/localhome/local/Documents/sacla/parameter_files/' with open(litemap_path + "currentchip.map", "r") as f: @@ -581,20 +544,6 @@ def load_lite_map(): 'G1': '49', 'G2': '50', 'G3': '51', 'G4': '52', 'G5': '53', 'G6': '54', 'G7': '55', 'G8': '56', 'H1': '64', 'H2': '63', 'H3': '62', 'H4': '61', 'H5': '60', 'H6': '59', 'H7': '58', 'H8': '57', } - regina_block_dict = { - 'A1': '01', 'A2': '02', 'A3': '03', 'A4': '04', 'A5': '05', 'A6': '06', 'A7': '07', - 'B1': '14', 'B2': '13', 'B3': '12', 'B4': '11', 'B5': '10', 'B6': '09', 'B7': '08', - 'C1': '15', 'C2': '16', 'C3': '17', 'C4': '18', 'C5': '19', 'C6': '20', 'C7': '21', - 'D1': '28', 'D2': '27', 'D3': '26', 'D4': '25', 'D5': '24', 'D6': '23', 'D7': '22', - 'E1': '29', 'E2': '30', 'E3': '31', 'E4': '32', 'E5': '33', 'E6': '34', 'E7': '35', - 'F1': '42', 'F2': '41', 'F3': '40', 'F4': '39', 'F5': '38', 'F6': '37', 'F7': '36', - 'G1': '43', 'G2': '44', 'G3': '45', 'G4': '46', 'G5': '47', 'G6': '48', 'G7': '49', - } - hamburg_block_dict = { - 'A1': '01', 'A2': '02', 'A3': '03', - 'B1': '06', 'B2': '05', 'B3': '04', - 'C1': '07', 'C2': '08', 'C3': '09', - } # fmt: on chip_type = caget(pv.me14e_gp1) if chip_type == 0: @@ -632,14 +581,6 @@ def load_lite_map(): btn_names[button_name] = label # print button_name, btn_names[button_name] block_dict = btn_names - elif chip_type == 2: - print("Hamburg Block Order") - logger.info("%s Hamburg Block Order" % name) - block_dict = hamburg_block_dict - elif chip_type == 5: - print("Regina Block Order") - logger.info("%s Regina Block Order" % name) - block_dict = regina_block_dict # litemap_path = '/dls_sw/i24/scripts/fastchips/litemaps/' litemap_path = "/localhome/local/Documents/sacla/parameter_files/" @@ -731,21 +672,6 @@ def moveto(place): caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 25.40) - elif chip_type == 2: - print("Hamburg Move") - logger.info("%s Hamburg Move" % (name)) - if place == "origin": - caput(pv.me14e_stage_x, 0.0) - caput(pv.me14e_stage_y, 0.0) - if place == "f1": - # caput(pv.me14e_stage_x, +17.16) - caput(pv.me14e_stage_x, +24.968) - caput(pv.me14e_stage_y, 0.0) - if place == "f2": - caput(pv.me14e_stage_x, 0.0) - # caput(pv.me14e_stage_y, -26.49) - caput(pv.me14e_stage_y, +24.968) - elif chip_type == 3: print("Oxford Inner Move") logger.info("%s Oxford Inner Move" % (name)) @@ -759,19 +685,6 @@ def moveto(place): caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 24.60) - elif chip_type == 5: - print("Regina Move") - logger.info("%s Regina Move" % (name)) - if place == "origin": - caput(pv.me14e_stage_x, 0.0) - caput(pv.me14e_stage_y, 0.0) - if place == "f1": - caput(pv.me14e_stage_x, +17.175) - caput(pv.me14e_stage_y, 0.0) - if place == "f2": - caput(pv.me14e_stage_x, 0.0) - caput(pv.me14e_stage_y, +17.175) - elif chip_type == 6: print("Custom Move") logger.info("%s Custom Chip Move" % (name)) @@ -785,45 +698,6 @@ def moveto(place): caput(pv.me14e_stage_x, 0.0) caput(pv.me14e_stage_y, 25.40) - elif chip_type == 7: - print("Heidelberg4 Move") - logger.info("%s Heidelberg4 Chip Move" % (name)) - if place == "origin": - caput(pv.me14e_stage_x, 0.0) - caput(pv.me14e_stage_y, 0.0) - if place == "f1": - caput(pv.me14e_stage_x, 19.135) - caput(pv.me14e_stage_y, 0.0) - if place == "f2": - caput(pv.me14e_stage_x, 0.0) - caput(pv.me14e_stage_y, 9.635) - - elif chip_type == 8: - print("Heidelberg6 Move") - logger.info("%s Heidelberg6 Chip Move" % (name)) - if place == "origin": - caput(pv.me14e_stage_x, 0.0) - caput(pv.me14e_stage_y, 0.0) - if place == "f1": - caput(pv.me14e_stage_x, 19.525) - caput(pv.me14e_stage_y, 0.0) - if place == "f2": - caput(pv.me14e_stage_x, 0.0) - caput(pv.me14e_stage_y, 9.335) - - elif chip_type == 9: - print("Minichip Move") - logger.info("%s Minichip Move" % (name)) - if place == "origin": - caput(pv.me14e_stage_x, 0.0) - caput(pv.me14e_stage_y, 0.0) - if place == "f1": - caput(pv.me14e_stage_x, 2.375) - caput(pv.me14e_stage_y, 0.0) - if place == "f2": - caput(pv.me14e_stage_x, 0.0) - caput(pv.me14e_stage_y, 2.375) - elif chip_type == 10: print("Oxford 6 by 6 blocks Move") logger.info("%s Oxford 6 by 6 blocks Move" % (name)) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py index 5f9fc3deb..1cc6c6ad7 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py @@ -5,7 +5,6 @@ """ import inspect import logging -import string import time import numpy as np @@ -17,7 +16,6 @@ get_format, get_shot_order, get_xy, - pathli, scrape_parameter_file, write_file, ) @@ -86,96 +84,6 @@ def plot_file(fid, chip_type): return 1 -def get_hamburg_order(): - name = inspect.stack()[0][3] - logger.info("%s" % (name)) - blk_num = 3 - caps = [ - "A", - "B", - "C", - "C", - "B", - "A", - "A", - "B", - "C", - "C", - "B", - "A", - "A", - "B", - "C", - "C", - "B", - "A", - ] - nums = [ - "1", - "1", - "1", - "1", - "1", - "1", - "2", - "2", - "2", - "2", - "2", - "2", - "3", - "3", - "3", - "3", - "3", - "3", - ] - lowercase_list = list(string.ascii_lowercase + string.ascii_uppercase + "0") - - block_list = [] - for a, b in zip(caps, nums): - block_list.append(a + b) - - A_path = pathli(lowercase_list, "expand28", 0) - B_path = pathli(lowercase_list[:28], "snake53", 0) - window_dn = [] - for a, b in zip(A_path, B_path): - window_dn.append(a + b) - - A_path = pathli(lowercase_list, "expand25", 1) - B_path = pathli(lowercase_list[28:], "snake53", 0) - window_up = [] - for a, b in zip(A_path, B_path): - window_up.append(a + b) - - switch = 0 - count = 0 - collect_list = [] - for block in block_list: - if switch == 0: - for window in window_dn: - collect_list.append(block + "_" + window) - count += 1 - if count == blk_num: - count = 0 - switch = 1 - else: - for window in window_up: - collect_list.append(block + "_" + window) - count += 1 - if count == blk_num: - count = 0 - switch = 0 - - print(len(collect_list)) - logger.info("%s length of collect_list = %s" % (name, len(collect_list))) - with open("collect_list.txt", "w") as g: - for x in collect_list: - g.write("%s\n" % x) - - return collect_list - - def convert_chip_to_hex(fid, chip_type): name = inspect.stack()[0][3] logger.info("%s" % name) @@ -251,90 +159,8 @@ def convert_chip_to_hex(fid, chip_type): ) print(hex_length) logger.info("%s hex_length: %s" % (name, hex_length)) - # NICHT Normal else: - logger.info("%s Dealing with Hamburg \n" % (name)) - print("Dealing with Hamburg") - shot_order_list = get_hamburg_order() - print(shot_order_list[:14]) - print(shot_order_list[-14:]) - logger.info("%s Shot Order List: \n" % (name)) - logger.info("%s" % shot_order_list[:14]) - logger.info("%s" % shot_order_list[-14:]) - sorted_pres_list = [] - for addr in shot_order_list: - sorted_pres_list.append(chip_dict[addr]) - even_odd = 0 - i = 0 - for col in range(6): - if col % 2 == 0: - for line in range(159): - chomp = [] - for x in range(28): - chomp.append(sorted_pres_list.pop(0)) - if even_odd % 2 == 0: - bite = chomp - else: - bite = chomp[::-1] - even_odd += 1 - if even_odd == 53: - even_odd = 0 - hex_string = ("{0:0>7X}").format( - int("".join(str(x) for x in bite), 2) - ) - pvar = 5001 + i - writeline = "P%s=$%s" % (pvar, hex_string) - g.write(writeline + "\n") - print(line, "".join(str(x) for x in bite), end=" ") - print( - ("{0:0>7X}").format(int("".join(str(x) for x in bite), 2)) - ) - logger.info("%s %s \n" % (line, "".join(str(x) for x in bite))) - logger.info( - "%s \n" - % ( - ("{0:0>7X}").format( - int("".join(str(x) for x in bite), 2) - ) - ) - ) - i += 1 - print() - else: - for line in range(159): - chomp = [] - for x in range(25): - chomp.append(sorted_pres_list.pop(0)) - if even_odd % 2 == 0: - bite = chomp - else: - bite = chomp[::-1] - bite += ["0", "0", "0"] - even_odd += 1 - if even_odd == 53: - even_odd = 0 - hex_string = ("{0:0>7X}").format( - int("".join(str(x) for x in bite), 2) - ) - pvar = 5001 + i - writeline = "P%s=$%s" % (pvar, hex_string) - g.write(writeline + "\n") - print(line, "".join(str(x) for x in bite), end=" ") - print( - ("{0:0>7X}").format(int("".join(str(x) for x in bite), 2)) - ) - logger.info("%s %s \n" % (line, "".join(str(x) for x in bite))) - logger.info( - "%s \n" - % ( - ("{0:0>7X}").format( - int("".join(str(x) for x in bite), 2) - ) - ) - ) - i += 1 - print() - print("----------------------------------") + logger.warning("Chip type unknown") return 0 From e8f7820902dd6aaf69a0bdb884c31ccaa8790355 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 7 Jun 2023 15:24:10 +0100 Subject: [PATCH 19/47] Fix old py2.7 code --- .../I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py | 6 +++--- tests/I24/serial/fixed-target/test_chip_startup.py | 9 +-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py index 3bb8cb67c..7aaebb224 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py @@ -112,10 +112,10 @@ def fiducials(chip_type): name = inspect.stack()[0][3] if chip_type == "0": corners_list = [] - for R in string.letters[26:35]: + for R in string.ascii_letters[26:35]: for C in [str(num) for num in range(1, 10)]: - for r in string.letters[:12]: - for c in string.letters[:12]: + for r in string.ascii_letters[:12]: + for c in string.ascii_letters[:12]: addr = "_".join([R + C, r + c]) if r + c in ["aa", "la", "ll"]: corners_list.append(addr) diff --git a/tests/I24/serial/fixed-target/test_chip_startup.py b/tests/I24/serial/fixed-target/test_chip_startup.py index 2443036f8..68c0502f3 100644 --- a/tests/I24/serial/fixed-target/test_chip_startup.py +++ b/tests/I24/serial/fixed-target/test_chip_startup.py @@ -1,7 +1,5 @@ from unittest.mock import mock_open, patch -import pytest - from mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1 import ( fiducials, get_format, @@ -37,12 +35,7 @@ def test_scrape_parameter_file(): def test_fiducials(): assert len(fiducials("1")) == 0 assert len(fiducials("5")) == 0 - - -def test_fiducials_raises_error_for_chip_type_0(): - # mostly as a reminder this needs fixing because old python - with pytest.raises(AttributeError): - fiducials("0") + assert len(fiducials("0")) > 0 def test_get_format(): From 9a18bcc615a2d4be7d95257475f7bfff2d6192c1 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 7 Jun 2023 15:28:00 +0100 Subject: [PATCH 20/47] A coupld more context managers --- .../fixed_target/i24ssx_Chip_StartUp_py3v1.py | 96 +++++++++---------- 1 file changed, 46 insertions(+), 50 deletions(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py index 7aaebb224..a3b29d7e3 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py @@ -404,22 +404,20 @@ def write_file(location="i24", suffix=".addr", order="alphanumeric"): elif order == "shot": addr_list = get_shot_order(chip_type) - # list_of_lines = [] - g = open(chip_file_path, "a") - for addr in addr_list: - xtal_name = "_".join([chip_name, addr]) - (x, y) = get_xy(xtal_name, chip_type) - if addr in fiducial_list: - pres = "0" - else: - if "rand" in suffix: - pres = str(np.random.randint(2)) + with open(chip_file_path, "a") as g: + for addr in addr_list: + xtal_name = "_".join([chip_name, addr]) + (x, y) = get_xy(xtal_name, chip_type) + if addr in fiducial_list: + pres = "0" else: - pres = "-1" - line = "\t".join([xtal_name, str(x), str(y), "0.0", pres]) + "\n" - # list_of_lines.append(line) - g.write(line) - g.close() + if "rand" in suffix: + pres = str(np.random.randint(2)) + else: + pres = "-1" + line = "\t".join([xtal_name, str(x), str(y), "0.0", pres]) + "\n" + g.write(line) + logger.info("%s" % name) @@ -495,45 +493,43 @@ def write_headers(location, suffix_list): if location == "i24": for suffix in suffix_list: full_fid = chip_file_path + suffix - g = open(full_fid, "w") - g.write( - "#23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\n#\n" - ) - g.write("#&i24\tchip_name = %s\n" % chip_name) - g.write("#&i24\tvisit = %s\n" % visit) - g.write("#&i24\tsub_dir = %s\n" % sub_dir) - g.write("#&i24\tn_exposures = %s\n" % n_exposures) - g.write("#&i24\tchip_type = %s\n" % chip_type) - g.write("#&i24\tmap_type = %s\n" % map_type) - g.write("#&i24\tpump_repeat = %s\n" % pump_repeat) - g.write("#&i24\tpumpexptime = %s\n" % pumpexptime) - g.write("#&i24\texptime = %s\n" % exptime) - g.write("#&i24\tdcdetdist = %s\n" % dcdetdist) - g.write("#&i24\tprepumpexptime = %s\n" % prepumpexptime) - g.write("#&i24\tdet_Type = %s\n" % det_type) - g.write("#\n") - g.write( - "#XtalAddr XCoord YCoord ZCoord Present Shot Spare04 Spare03 Spare02 Spare01\n" - ) - g.close() + with open(full_fid, "w") as g: + g.write( + "#23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\n#\n" + ) + g.write("#&i24\tchip_name = %s\n" % chip_name) + g.write("#&i24\tvisit = %s\n" % visit) + g.write("#&i24\tsub_dir = %s\n" % sub_dir) + g.write("#&i24\tn_exposures = %s\n" % n_exposures) + g.write("#&i24\tchip_type = %s\n" % chip_type) + g.write("#&i24\tmap_type = %s\n" % map_type) + g.write("#&i24\tpump_repeat = %s\n" % pump_repeat) + g.write("#&i24\tpumpexptime = %s\n" % pumpexptime) + g.write("#&i24\texptime = %s\n" % exptime) + g.write("#&i24\tdcdetdist = %s\n" % dcdetdist) + g.write("#&i24\tprepumpexptime = %s\n" % prepumpexptime) + g.write("#&i24\tdet_Type = %s\n" % det_type) + g.write("#\n") + g.write( + "#XtalAddr XCoord YCoord ZCoord Present Shot Spare04 Spare03 Spare02 Spare01\n" + ) elif location == "SACLA": for suffix in suffix_list: full_fid = chip_file_path + suffix - g = open(full_fid, "w") - g.write( - "#23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\n#\n" - ) - g.write("#&SACLA\tchip_name = %s\n" % chip_name) - g.write("#&SACLA\tsub_dir = %s\n" % sub_dir) - g.write("#&SACLA\tn_exposures = %s\n" % n_exposures) - g.write("#&SACLA\tchip_type = %s\n" % chip_type) - g.write("#&SACLA\tmap_type = %s\n" % map_type) - g.write("#\n") - g.write( - "#XtalAddr XCoord YCoord ZCoord Present Shot Spare04 Spare03 Spare02 Spare01\n" - ) - g.close() + with open(full_fid, "w") as g: + g.write( + "#23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\n#\n" + ) + g.write("#&SACLA\tchip_name = %s\n" % chip_name) + g.write("#&SACLA\tsub_dir = %s\n" % sub_dir) + g.write("#&SACLA\tn_exposures = %s\n" % n_exposures) + g.write("#&SACLA\tchip_type = %s\n" % chip_type) + g.write("#&SACLA\tmap_type = %s\n" % map_type) + g.write("#\n") + g.write( + "#XtalAddr XCoord YCoord ZCoord Present Shot Spare04 Spare03 Spare02 Spare01\n" + ) else: logger.warning("%s Unknown location, %s" % (name, location)) print("Unknown location in write_headers") From 021eea4888ba758176c585b8d206683e99d591e8 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 12:00:03 +0100 Subject: [PATCH 21/47] Remove paths from extruder script --- dls_dev_setup.sh | 2 +- .../extruder/i24ssx_Extruder_Collect_py3v2.py | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/dls_dev_setup.sh b/dls_dev_setup.sh index 65f382480..b2b5c56ee 100755 --- a/dls_dev_setup.sh +++ b/dls_dev_setup.sh @@ -1,4 +1,4 @@ -module load python/3.10 +#module load python/3.10 if [ -d "./.venv" ] then diff --git a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py index d6b88c146..62860bf84 100755 --- a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +++ b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py @@ -8,14 +8,15 @@ import argparse import inspect import logging -import pathlib import sys import time from datetime import datetime +from pathlib import Path from time import sleep from mx_bluesky.I24.serial import log from mx_bluesky.I24.serial.dcid import DCID, SSXType +from mx_bluesky.I24.serial.parameters.constants import PARAM_FILE_PATH_EX from mx_bluesky.I24.serial.setup_beamline import caget, caput, pv from mx_bluesky.I24.serial.setup_beamline import setup_beamline as sup from mx_bluesky.I24.serial.write_nexus import call_nexgen @@ -86,14 +87,15 @@ def moveto(place): caput(pv.det_z, 1480) -def write_parameter_file(): +def write_parameter_file(param_path: Path | str = PARAM_FILE_PATH_EX): name = inspect.stack()[0][3] - param_path = "/dls_sw/i24/scripts/extruder/" + if not isinstance(param_path, Path): + param_path = Path(param_path) param_fid = "parameters.txt" - logger.info("%s Writing Parameter File \n%s" % (name, param_path + param_fid)) - print("\nWriting Parameter File ", param_path + param_fid) + logger.info("%s Writing Parameter File \n%s" % (name, param_path / param_fid)) + print("\nWriting Parameter File ", param_path / param_fid) visit = caget(pv.ioc12_gp1) directory = caget(pv.ioc12_gp2) @@ -120,7 +122,7 @@ def write_parameter_file(): print("Requested filename ends in a number. Appended dash:", filename) logger.info("%s Requested filename ends in a number. Appended dash") - with open(param_path + param_fid, "w") as f: + with open(param_path / param_fid, "w") as f: f.write("visit \t\t%s\n" % visit) f.write("directory \t%s\n" % directory) f.write("filename \t%s\n" % filename) @@ -156,9 +158,11 @@ def write_parameter_file(): print("pump_delay:", pump_delay) -def scrape_parameter_file(): - param_path = "/dls_sw/i24/scripts/extruder/" - with open(param_path + "parameters.txt", "r") as filein: +def scrape_parameter_file(param_path: Path | str = PARAM_FILE_PATH_EX): + if not isinstance(param_path, Path): + param_path = Path(param_path) + + with open(param_path / "parameters.txt", "r") as filein: f = filein.readlines() for line in f: entry = line.rstrip().split() @@ -336,7 +340,7 @@ def run_extruderi24(): dcid = DCID( emit_errors=False, ssx_type=SSXType.EXTRUDER, - visit=pathlib.Path(visit).name, + visit=Path(visit).name, image_dir=filepath, start_time=start_time, num_images=num_imgs, From ec596e20855d1440ff751ddb7337e33763c53883 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 12:00:54 +0100 Subject: [PATCH 22/47] Actually add the file with the patchs --- src/mx_bluesky/I24/serial/parameters/constants.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/mx_bluesky/I24/serial/parameters/constants.py diff --git a/src/mx_bluesky/I24/serial/parameters/constants.py b/src/mx_bluesky/I24/serial/parameters/constants.py new file mode 100644 index 000000000..635bf6e6c --- /dev/null +++ b/src/mx_bluesky/I24/serial/parameters/constants.py @@ -0,0 +1,8 @@ +from pathlib import Path + +PARAM_FILE_PATH_EX = Path( + "src/mx_bluesky/I24/serial/parameters/extruder" +) # /dls_sw/i24/scripts/extruder/ +PARAM_FILE_PATH_FT = Path("src/mx_bluesky/I24/serial/parameters/fixed_target") +LITEMAP_PATH = Path("src/mx_bluesky/I24/serial/parameters/fixed_target/litemaps") +FULLMAP_PATH = Path("src/mx_bluesky/I24/serial/parameters/fixed_target/litemaps") From c3362c80b6780481e4bcffaa612e5a6dbb40f991 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 13:04:53 +0100 Subject: [PATCH 23/47] Add pvar files --- .../I24/serial/parameters/constants.py | 7 +- .../parameters/pvar_files/bismuth2.pvar | 65 ++++++++++++++ .../serial/parameters/pvar_files/hamburg.pvar | 18 ++++ .../parameters/pvar_files/hamburgfull.pvar | 58 +++++++++++++ .../serial/parameters/pvar_files/oxford.pvar | 85 +++++++++++++++++++ .../parameters/pvar_files/oxford6x6.pvar | 58 +++++++++++++ .../parameters/pvar_files/oxford_short.pvar | 85 +++++++++++++++++++ .../parameters/pvar_files/oxford_verbose.pvar | 85 +++++++++++++++++++ .../serial/parameters/pvar_files/regina.pvar | 72 ++++++++++++++++ .../serial/parameters/pvar_files/toronto.pvar | 46 ++++++++++ 10 files changed, 575 insertions(+), 4 deletions(-) create mode 100755 src/mx_bluesky/I24/serial/parameters/pvar_files/bismuth2.pvar create mode 100755 src/mx_bluesky/I24/serial/parameters/pvar_files/hamburg.pvar create mode 100755 src/mx_bluesky/I24/serial/parameters/pvar_files/hamburgfull.pvar create mode 100755 src/mx_bluesky/I24/serial/parameters/pvar_files/oxford.pvar create mode 100755 src/mx_bluesky/I24/serial/parameters/pvar_files/oxford6x6.pvar create mode 100755 src/mx_bluesky/I24/serial/parameters/pvar_files/oxford_short.pvar create mode 100755 src/mx_bluesky/I24/serial/parameters/pvar_files/oxford_verbose.pvar create mode 100755 src/mx_bluesky/I24/serial/parameters/pvar_files/regina.pvar create mode 100755 src/mx_bluesky/I24/serial/parameters/pvar_files/toronto.pvar diff --git a/src/mx_bluesky/I24/serial/parameters/constants.py b/src/mx_bluesky/I24/serial/parameters/constants.py index 635bf6e6c..545540648 100644 --- a/src/mx_bluesky/I24/serial/parameters/constants.py +++ b/src/mx_bluesky/I24/serial/parameters/constants.py @@ -1,8 +1,7 @@ from pathlib import Path -PARAM_FILE_PATH_EX = Path( - "src/mx_bluesky/I24/serial/parameters/extruder" -) # /dls_sw/i24/scripts/extruder/ +PARAM_FILE_PATH_EX = Path("src/mx_bluesky/I24/serial/parameters/extruder") PARAM_FILE_PATH_FT = Path("src/mx_bluesky/I24/serial/parameters/fixed_target") LITEMAP_PATH = Path("src/mx_bluesky/I24/serial/parameters/fixed_target/litemaps") -FULLMAP_PATH = Path("src/mx_bluesky/I24/serial/parameters/fixed_target/litemaps") +FULLMAP_PATH = Path("src/mx_bluesky/I24/serial/parameters/fixed_target/fullmaps") +PVAR_FILE_PATH = Path("src/mx_bluesky/I24/serial/parameters/pvar_files") diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/bismuth2.pvar b/src/mx_bluesky/I24/serial/parameters/pvar_files/bismuth2.pvar new file mode 100755 index 000000000..d9afdf8fd --- /dev/null +++ b/src/mx_bluesky/I24/serial/parameters/pvar_files/bismuth2.pvar @@ -0,0 +1,65 @@ +# Clear +P3000..3999=0 +# Switch all blocks off +P3011,49,10=0 +# X-start +P3012,7,10=0 +P3082,7,10=4 +P3152,7,10=8 +P3222,7,10=12 +P3292,7,10=16 +P3362,7,10=20 +P3432,7,10=24 +# Y-start +P3013=0 +P3023=4 +P3033=8 +P3043=12 +P3053=16 +P3063=20 +P3073=24 +P3083=0 +P3093=4 +P3103=8 +P3113=12 +P3123=16 +P3133=20 +P3143=24 +P3153=0 +P3163=4 +P3173=8 +P3183=12 +P3193=16 +P3203=20 +P3213=24 +P3223=0 +P3233=4 +P3243=8 +P3253=12 +P3263=16 +P3273=20 +P3283=24 +P3293=0 +P3303=4 +P3313=8 +P3323=12 +P3333=16 +P3343=20 +P3353=24 +P3363=0 +P3373=4 +P3383=8 +P3393=12 +P3403=16 +P3413=20 +P3423=24 +P3433=0 +P3443=4 +P3453=8 +P3463=12 +P3473=16 +P3483=20 +P3493=24 + +# Block direction +P3014,49,10=31 diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/hamburg.pvar b/src/mx_bluesky/I24/serial/parameters/pvar_files/hamburg.pvar new file mode 100755 index 000000000..6f029d9e0 --- /dev/null +++ b/src/mx_bluesky/I24/serial/parameters/pvar_files/hamburg.pvar @@ -0,0 +1,18 @@ +# Clear +P3000..3999=0 +# Switch all blocks on +P3011,9,10=1 +# Set all the x columns +P3012,3,10=0 +P3042,3,10=8.580 +P3072,3,10=17.160 +# Y-start pvar, number of down columns, 10*2*3 +# [x*2.5 for x in range(3)] +P3013,2,60=0.0 +P3023,2,60=8.580 +P3033,2,60=17.160 +# [(52*0.150) + (x*8.580) for x in range(3)] +# Y-start +P3044=24.96 +P3054=16.38 +P3064=7.80 diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/hamburgfull.pvar b/src/mx_bluesky/I24/serial/parameters/pvar_files/hamburgfull.pvar new file mode 100755 index 000000000..a8f957830 --- /dev/null +++ b/src/mx_bluesky/I24/serial/parameters/pvar_files/hamburgfull.pvar @@ -0,0 +1,58 @@ +# Clear +P3000..3999=0 +# Switch all blocks on +P3011,18,10=1 +P3012=0 +P3013=0 +P3014=31 +P3022=0 +P3023=8.580 +P3024=31 +P3032=0 +P3033=17.160 +P3034=31 +P3042=4.20 +P3043=24.96 +P3044=32 +P3052=4.20 +P3053=16.38 +P3054=32 +P3062=4.20 +P3063=7.80 +P3064=32 +P3072=8.58 +P3073=0.00 +P3074=31 +P3082=8.58 +P3083=8.58 +P3084=31 +P3092=8.58 +P3093=17.16 +P3094=31 +P3102=12.78 +P3103=24.96 +P3104=32 +P3112=12.78 +P3113=16.38 +P3114=32 +P3122=12.78 +P3123=7.80 +P3124=32 +P3132=17.16 +P3133=0.0 +P3134=31 +P3142=17.16 +P3143=8.58 +P3144=31 +P3152=17.16 +P3153=17.16 +P3154=31 +P3162=21.36 +P3163=24.96 +P3164=32 +P3172=21.36 +P3173=16.38 +P3174=32 +P3182=21.36 +P3183=7.8 +P3184=32 diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford.pvar b/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford.pvar new file mode 100755 index 000000000..40889effd --- /dev/null +++ b/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford.pvar @@ -0,0 +1,85 @@ +# Clear +P3000..3999=0 +# Switch all blocks on +P3011,64,10=1 +# +P3012=0.000 P3013=0.000 +P3022=0.000 P3023=3.175 +P3032=0.000 P3033=6.350 +P3042=0.000 P3043=9.525 +P3052=0.000 P3053=12.700 +P3062=0.000 P3063=15.875 +P3072=0.000 P3073=19.050 +P3082=0.000 P3083=22.225 +# +P3092=3.175 P3093=24.600 +P3102=3.175 P3103=21.425 +P3112=3.175 P3113=18.250 +P3122=3.175 P3123=15.075 +P3132=3.175 P3133=11.900 +P3142=3.175 P3143=8.725 +P3152=3.175 P3153=5.550 +P3162=3.175 P3163=2.375 +# +P3172=6.350 P3173=0.000 +P3182=6.350 P3183=3.175 +P3192=6.350 P3193=6.350 +P3202=6.350 P3203=9.525 +P3212=6.350 P3213=12.700 +P3222=6.350 P3223=15.875 +P3232=6.350 P3233=19.050 +P3242=6.350 P3243=22.225 +# +P3252=9.525 P3253=24.600 +P3262=9.525 P3263=21.425 +P3272=9.525 P3273=18.250 +P3282=9.525 P3283=15.075 +P3292=9.525 P3293=11.900 +P3302=9.525 P3303=8.725 +P3312=9.525 P3313=5.550 +P3322=9.525 P3323=2.375 +# +P3332=12.700 P3333=0.000 +P3342=12.700 P3343=3.175 +P3352=12.700 P3353=6.350 +P3362=12.700 P3363=9.525 +P3372=12.700 P3373=12.700 +P3382=12.700 P3383=15.875 +P3392=12.700 P3393=19.050 +P3402=12.700 P3403=22.225 +# +P3412=15.875 P3413=24.600 +P3422=15.875 P3423=21.425 +P3432=15.875 P3433=18.250 +P3442=15.875 P3443=15.075 +P3452=15.875 P3453=11.900 +P3462=15.875 P3463=8.725 +P3472=15.875 P3473=5.550 +P3482=15.875 P3483=2.375 +# +P3492=19.050 P3493=0.000 +P3502=19.050 P3503=3.175 +P3512=19.050 P3513=6.350 +P3522=19.050 P3523=9.525 +P3532=19.050 P3533=12.700 +P3542=19.050 P3543=15.875 +P3552=19.050 P3553=19.050 +P3562=19.050 P3563=22.225 +# +P3572=22.225 P3573=24.600 +P3582=22.225 P3583=21.425 +P3592=22.225 P3593=18.250 +P3602=22.225 P3603=15.075 +P3612=22.225 P3613=11.900 +P3622=22.225 P3623=8.725 +P3632=22.225 P3633=5.550 +P3642=22.225 P3643=2.375 +# Block direction +P3014,8,10=31 +P3094,8,10=32 +P3174,8,10=31 +P3254,8,10=32 +P3334,8,10=31 +P3414,8,10=32 +P3494,8,10=31 +P3574,8,10=32 diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford6x6.pvar b/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford6x6.pvar new file mode 100755 index 000000000..9845264d7 --- /dev/null +++ b/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford6x6.pvar @@ -0,0 +1,58 @@ +# Clear +P3000..3999=0 +# Switch all blocks on +P3011,36,10=1 +# +P3012=0.000 P3013=0.000 +P3022=0.000 P3023=3.175 +P3032=0.000 P3033=6.350 +P3042=0.000 P3043=9.525 +P3052=0.000 P3053=12.700 +P3062=0.000 P3063=15.875 +# +P3072=3.175 P3073=18.25 +P3082=3.175 P3083=15.875 +P3092=3.175 P3093=12.700 +P3102=3.175 P3103=9.525 +P3112=3.175 P3113=8.725 +P3122=3.175 P3123=5.550 + +# +P3132=6.350 P3133=0.000 +P3142=6.350 P3143=3.175 +P3152=6.350 P3153=6.350 +P3162=6.350 P3163=9.525 +P3172=6.350 P3173=12.700 +P3182=6.350 P3183=15.875 + +# +P3192=9.525 P3193=18.25 +P3202=9.525 P3203=15.875 +P3212=9.525 P3213=12.700 +P3222=9.525 P3223=9.525 +P3232=9.525 P3233=8.725 +P3242=9.525 P3243=5.550 +# +P3252=12.700 P3253=0.000 +P3262=12.700 P3263=3.175 +P3272=12.700 P3273=6.350 +P3282=12.700 P3283=9.525 +P3292=12.700 P3293=12.700 +P3302=12.700 P3303=15.875 + +# +P3312=15.875 P3313=18.25 +P3322=15.875 P3323=15.875 +P3332=15.875 P3333=12.700 +P3342=15.875 P3343=9.525 +P3352=15.875 P3353=8.725 +P3362=15.875 P3363=5.550 + +# Block direction +P3014,6,10=31 +P3074,6,10=32 +P3134,6,10=31 +P3194,6,10=32 +P3254,6,10=31 +P3314,6,10=32 + diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford_short.pvar b/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford_short.pvar new file mode 100755 index 000000000..fc1dd8062 --- /dev/null +++ b/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford_short.pvar @@ -0,0 +1,85 @@ +# Clear +P3000..3999=0 +# Switch all blocks on +P3011,64,10=1 +# +P3012=0.000 P3013=0.000 +P3022=0.002 P3023=3.177 +P3032=0.005 P3033=6.353 +P3042=0.007 P3043=9.528 +P3052=0.010 P3053=12.705 +P3062=0.010 P3063=15.880 +P3072=0.013 P3073=19.057 +P3082=0.015 P3083=22.233 +# +P3092=3.195 P3093=24.612 +P3102=3.192 P3103=21.435 +P3112=3.190 P3113=18.258 +P3122=3.190 P3123=15.080 +P3132=3.187 P3133=11.905 +P3142=3.187 P3143=8.730 +P3152=3.183 P3153=5.555 +P3162=3.180 P3163=2.380 +# +P3172=6.357 P3173=0.007 +P3182=6.359 P3183=3.182 +P3192=6.362 P3193=6.357 +P3202=6.364 P3203=9.533 +P3212=6.366 P3213=12.708 +P3222=6.368 P3223=15.885 +P3232=6.370 P3233=19.062 +P3242=6.373 P3243=22.238 +# +P3252=9.552 P3253=24.617 +P3262=9.550 P3263=21.440 +P3272=9.548 P3273=18.262 +P3282=9.546 P3283=15.087 +P3292=9.545 P3293=11.911 +P3302=9.542 P3303=8.735 +P3312=9.542 P3313=5.560 +P3322=9.538 P3323=2.384 +# +P3332=12.715 P3333=0.013 +P3342=12.717 P3343=3.187 +P3352=12.720 P3353=6.363 +P3362=12.720 P3363=9.538 +P3372=12.722 P3373=12.714 +P3382=12.725 P3383=15.890 +P3392=12.725 P3393=19.065 +P3402=12.727 P3403=22.242 +# +P3412=15.908 P3413=24.620 +P3422=15.905 P3423=21.441 +P3432=15.903 P3433=18.266 +P3442=15.900 P3443=15.091 +P3452=15.901 P3453=11.915 +P3462=15.898 P3463=8.740 +P3472=15.898 P3473=5.562 +P3482=15.896 P3483=2.387 +# +P3492=19.070 P3493=0.015 +P3502=19.072 P3503=3.191 +P3512=19.075 P3513=6.366 +P3522=19.077 P3523=9.542 +P3532=19.078 P3533=12.716 +P3542=19.081 P3543=15.891 +P3552=19.082 P3553=19.070 +P3562=19.085 P3563=22.246 +# +P3572=22.262 P3573=24.624 +P3582=22.262 P3583=21.443 +P3592=22.259 P3593=18.270 +P3602=22.259 P3603=15.095 +P3612=22.257 P3613=11.917 +P3622=22.256 P3623=8.743 +P3632=22.254 P3633=5.567 +P3642=22.252 P3643=2.394 +# Block direction +P3014,8,10=31 +P3094,8,10=32 +P3174,8,10=31 +P3254,8,10=32 +P3334,8,10=31 +P3414,8,10=32 +P3494,8,10=31 +P3574,8,10=32 diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford_verbose.pvar b/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford_verbose.pvar new file mode 100755 index 000000000..40889effd --- /dev/null +++ b/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford_verbose.pvar @@ -0,0 +1,85 @@ +# Clear +P3000..3999=0 +# Switch all blocks on +P3011,64,10=1 +# +P3012=0.000 P3013=0.000 +P3022=0.000 P3023=3.175 +P3032=0.000 P3033=6.350 +P3042=0.000 P3043=9.525 +P3052=0.000 P3053=12.700 +P3062=0.000 P3063=15.875 +P3072=0.000 P3073=19.050 +P3082=0.000 P3083=22.225 +# +P3092=3.175 P3093=24.600 +P3102=3.175 P3103=21.425 +P3112=3.175 P3113=18.250 +P3122=3.175 P3123=15.075 +P3132=3.175 P3133=11.900 +P3142=3.175 P3143=8.725 +P3152=3.175 P3153=5.550 +P3162=3.175 P3163=2.375 +# +P3172=6.350 P3173=0.000 +P3182=6.350 P3183=3.175 +P3192=6.350 P3193=6.350 +P3202=6.350 P3203=9.525 +P3212=6.350 P3213=12.700 +P3222=6.350 P3223=15.875 +P3232=6.350 P3233=19.050 +P3242=6.350 P3243=22.225 +# +P3252=9.525 P3253=24.600 +P3262=9.525 P3263=21.425 +P3272=9.525 P3273=18.250 +P3282=9.525 P3283=15.075 +P3292=9.525 P3293=11.900 +P3302=9.525 P3303=8.725 +P3312=9.525 P3313=5.550 +P3322=9.525 P3323=2.375 +# +P3332=12.700 P3333=0.000 +P3342=12.700 P3343=3.175 +P3352=12.700 P3353=6.350 +P3362=12.700 P3363=9.525 +P3372=12.700 P3373=12.700 +P3382=12.700 P3383=15.875 +P3392=12.700 P3393=19.050 +P3402=12.700 P3403=22.225 +# +P3412=15.875 P3413=24.600 +P3422=15.875 P3423=21.425 +P3432=15.875 P3433=18.250 +P3442=15.875 P3443=15.075 +P3452=15.875 P3453=11.900 +P3462=15.875 P3463=8.725 +P3472=15.875 P3473=5.550 +P3482=15.875 P3483=2.375 +# +P3492=19.050 P3493=0.000 +P3502=19.050 P3503=3.175 +P3512=19.050 P3513=6.350 +P3522=19.050 P3523=9.525 +P3532=19.050 P3533=12.700 +P3542=19.050 P3543=15.875 +P3552=19.050 P3553=19.050 +P3562=19.050 P3563=22.225 +# +P3572=22.225 P3573=24.600 +P3582=22.225 P3583=21.425 +P3592=22.225 P3593=18.250 +P3602=22.225 P3603=15.075 +P3612=22.225 P3613=11.900 +P3622=22.225 P3623=8.725 +P3632=22.225 P3633=5.550 +P3642=22.225 P3643=2.375 +# Block direction +P3014,8,10=31 +P3094,8,10=32 +P3174,8,10=31 +P3254,8,10=32 +P3334,8,10=31 +P3414,8,10=32 +P3494,8,10=31 +P3574,8,10=32 diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/regina.pvar b/src/mx_bluesky/I24/serial/parameters/pvar_files/regina.pvar new file mode 100755 index 000000000..104fd8661 --- /dev/null +++ b/src/mx_bluesky/I24/serial/parameters/pvar_files/regina.pvar @@ -0,0 +1,72 @@ +# Clear +P3000..3999=0 +# Switch all blocks on +P3011,64,10=1 +# Set all the x columns +# [x*3.70 for x in range(7)] + +P3012=0 P3013=0.0 +P3022=-0.01 P3023=3.701 +P3032=-0.02 P3033=7.402 +P3042=-0.03 P3043=11.103 +P3052=-0.04 P3053=14.804 +P3062=-0.05 P3063=18.505 +P3072=-0.06 P3073=22.206 + +P3082=3.63 P3083=24.58 +P3092=3.64 P3093=20.875 +P3102=3.65 P3103=17.175 +P3112=3.66 P3113=13.475 +P3122=3.67 P3123=9.775 +P3132=3.68 P3133=6.075 +P3142=3.695 P3143=2.375 + +P3152=7.40 P3013=-0.02 +P3162=7.385 P3163=3.68 +P3172=7.375 P3173=7.38 +P3182=7.365 P3183=11.09 +P3192=7.355 P3193=14.78 +P3202=7.345 P3203=18.485 +P3212=7.335 P3213=22.19 + +P3222=11.03 P3223=24.56 +P3232=11.04 P3233=20.86 +P3242=11.06 P3243=17.16 +P3252=11.06 P3253=13.455 +P3262=11.07 P3263=9.755 +P3272=11.08 P3273=6.055 +P3282=11.095 P3283=2.355 + +P3292=14.80 P3293=-0.04 +P3302=14.79 P3303=3.66 +P3312=14.78 P3313=7.36 +P3322=14.77 P3323=11.06 +P3332=14.76 P3333=14.76 +P3342=14.75 P3343=18.47 +P3352=14.74 P3353=22.17 + +P3362=18.43 P3363=24.55 +P3372=18.44 P3373=20.84 +P3382=18.45 P3383=17.14 +P3392=18.46 P3393=13.435 +P3402=18.47 P3403=9.735 +P3412=18.48 P3413=6.035 +P3422=18.50 P3423=2.335 + +P3432=22.21 P3433=-0.05 +P3442=22.20 P3443=3.66 +P3452=22.19 P3453=7.36 +P3462=22.18 P3463=11.06 +P3472=22.17 P3473=14.76 +P3482=22.16 P3483=18.47 +P3492=22.15 P3493=22.17 + +# +# Block direction +P3014,7,10=31 +P3084,7,10=32 +P3154,7,10=31 +P3224,7,10=32 +P3294,7,10=31 +P3364,7,10=32 +P3434,7,10=31 diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/toronto.pvar b/src/mx_bluesky/I24/serial/parameters/pvar_files/toronto.pvar new file mode 100755 index 000000000..32d59f2aa --- /dev/null +++ b/src/mx_bluesky/I24/serial/parameters/pvar_files/toronto.pvar @@ -0,0 +1,46 @@ +# Clear +P3000..3999=0 +# Switch all blocks on +P3011,81,10=1 +# Set all the x columns +P3012,9,10=0 +P3102,9,10=2.2 +P3192,9,10=4.4 +P3282,9,10=6.6 +P3372,9,10=8.8 +P3462,9,10=11.0 +P3552,9,10=13.2 +P3642,9,10=15.4 +P3732,9,10=17.6 +# Y-start pvar,number of down columns, 10*2*9 +# [x*2.5 for x in range(9)] +P3013,5,180=0.0 +P3023,5,180=2.5 +P3033,5,180=5.0 +P3043,5,180=7.5 +P3053,5,180=10.0 +P3063,5,180=12.5 +P3073,5,180=15.0 +P3083,5,180=17.5 +P3093,5,180=20.0 +# Y-start pvar, number of up columns, 10*2*9 +# Y-start +P3103,4,180=21.375 +P3113,4,180=18.875 +P3123,4,180=16.375 +P3133,4,180=13.875 +P3143,4,180=11.375 +P3153,4,180=8.875 +P3163,4,180=6.375 +P3173,4,180=3.875 +P3183,4,180=1.375 +# Block direction +P3014,9,10=31 +P3104,9,10=32 +P3194,9,10=31 +P3284,9,10=32 +P3374,9,10=31 +P3464,9,10=32 +P3554,9,10=31 +P3644,9,10=32 +P3734,9,10=31 From 9cfff46d097bc30ec3f0a4b71cf965a35644c53d Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 13:29:46 +0100 Subject: [PATCH 24/47] ove some files around --- .../fixed_target/i24ssx_Chip_Manager_py3v1.py | 103 ++++++++++-------- .../I24/serial/parameters/constants.py | 1 + .../pvar_files/bismuth2.pvar | 0 .../pvar_files/hamburg.pvar | 0 .../pvar_files/hamburgfull.pvar | 0 .../{ => fixed-target}/pvar_files/oxford.pvar | 0 .../pvar_files/oxford6x6.pvar | 0 .../pvar_files/oxford_short.pvar | 0 .../pvar_files/oxford_verbose.pvar | 0 .../{ => fixed-target}/pvar_files/regina.pvar | 0 .../pvar_files/toronto.pvar | 0 11 files changed, 58 insertions(+), 46 deletions(-) rename src/mx_bluesky/I24/serial/parameters/{ => fixed-target}/pvar_files/bismuth2.pvar (100%) rename src/mx_bluesky/I24/serial/parameters/{ => fixed-target}/pvar_files/hamburg.pvar (100%) rename src/mx_bluesky/I24/serial/parameters/{ => fixed-target}/pvar_files/hamburgfull.pvar (100%) rename src/mx_bluesky/I24/serial/parameters/{ => fixed-target}/pvar_files/oxford.pvar (100%) rename src/mx_bluesky/I24/serial/parameters/{ => fixed-target}/pvar_files/oxford6x6.pvar (100%) rename src/mx_bluesky/I24/serial/parameters/{ => fixed-target}/pvar_files/oxford_short.pvar (100%) rename src/mx_bluesky/I24/serial/parameters/{ => fixed-target}/pvar_files/oxford_verbose.pvar (100%) rename src/mx_bluesky/I24/serial/parameters/{ => fixed-target}/pvar_files/regina.pvar (100%) rename src/mx_bluesky/I24/serial/parameters/{ => fixed-target}/pvar_files/toronto.pvar (100%) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index 80d3d1d26..d0026cdc8 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -8,6 +8,7 @@ import os import sys import time +from pathlib import Path from time import sleep import numpy as np @@ -15,6 +16,12 @@ from mx_bluesky.I24.serial import log from mx_bluesky.I24.serial.fixed_target import i24ssx_Chip_Mapping_py3v1 as mapping from mx_bluesky.I24.serial.fixed_target import i24ssx_Chip_StartUp_py3v1 as startup +from mx_bluesky.I24.serial.parameters.constants import ( + FULLMAP_PATH, + LITEMAP_PATH, + PARAM_FILE_PATH_FT, + PVAR_FILE_PATH, +) from mx_bluesky.I24.serial.setup_beamline import caget, caput, pv from mx_bluesky.I24.serial.setup_beamline import setup_beamline as sup @@ -88,14 +95,15 @@ def initialise(): logger.info("%s Complete" % name) -def write_parameter_file(): +def write_parameter_file(param_path: Path | str = PARAM_FILE_PATH_FT): name = inspect.stack()[0][3] - param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" - # param_path = '/localhome/local/Documents/sacla/parameter_files/' + if not isinstance(param_path, Path): + param_path = Path(param_path) + param_fid = "parameters.txt" - logger.info("%s Writing Parameter File \n%s" % (name, param_path + param_fid)) - print("Writing Parameter File\n", param_path + param_fid) + logger.info("%s Writing Parameter File \n%s" % (name, param_path / param_fid)) + print("Writing Parameter File\n", param_path / param_fid) visit = caget(pv.me14e_gp100) @@ -128,11 +136,7 @@ def write_parameter_file(): if str(chip_type) == "3": chip_type = "1" - # filenames = [ - # param_path + param_fid, - # os.path.join([visit, "processing", protein_name, chip_name]), - # ] - with open(param_path + param_fid, "w") as f: + with open(param_path / param_fid, "w") as f: f.write("visit \t\t%s\n" % visit) f.write("chip_name \t%s\n" % chip_name) f.write("protein_name \t%s\n" % protein_name) @@ -174,12 +178,12 @@ def write_parameter_file(): print("\n", "Write parameter file done", "\n") -def scrape_pvar_file(fid): +def scrape_pvar_file(fid: str, pvar_dir: Path | str = PVAR_FILE_PATH): block_start_list = [] - pvar_dir = ( - "/dls_sw/work/R3.14.12.3/ioc/ME14E/ME14E-MO-IOC-01/ME14E-MO-IOC-01App/scripts/" - ) - with open(pvar_dir + fid, "r") as f: + if not isinstance(pvar_dir, Path): + pvar_dir = Path(pvar_dir) + + with open(pvar_dir / fid, "r") as f: lines = f.readlines() for line in lines: line = line.rstrip() @@ -200,7 +204,7 @@ def scrape_pvar_file(fid): return block_start_list -def define_current_chip(chipid): +def define_current_chip(chipid: str, param_path: Path | str = PVAR_FILE_PATH): name = inspect.stack()[0][3] load_stock_map("Just The First Block") """ @@ -216,9 +220,10 @@ def define_current_chip(chipid): elif chipid == "oxford": caput(pv.me14e_gp1, 1) - param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" - # param_path = '/localhome/local/Documents/sacla/parameter_files/' - with open(param_path + chipid + ".pvar", "r") as f: + if not isinstance(param_path, Path): + param_path = Path(param_path) + + with open(param_path / f"{chipid}.pvar", "r") as f: logger.info("%s Opening %s%s.pvar" % (name, param_path, chipid)) for line in f.readlines(): if line.startswith("#"): @@ -231,13 +236,14 @@ def define_current_chip(chipid): print(10 * "Done ") -def save_screen_map(): +def save_screen_map(litemap_path: Path | str = LITEMAP_PATH): name = inspect.stack()[0][3] - litemap_path = "/dls_sw/i24/scripts/fastchips/litemaps/" - # litemap_path = '/localhome/local/Documents/sacla/parameter_files/' - print("\n\nSaving", litemap_path + "currentchip.map") + if not isinstance(litemap_path, Path): + litemap_path = Path(litemap_path) + + print("\n\nSaving", litemap_path / "currentchip.map") logger.info("%s Saving %s currentchip.map" % (name, litemap_path)) - with open(litemap_path + "currentchip.map", "w") as f: + with open(litemap_path / "currentchip.map", "w") as f: print("Printing only blocks with block_val == 1") logger.info("%s Printing only blocks with block_val == 1" % name) for x in range(1, 82): @@ -253,7 +259,7 @@ def save_screen_map(): return 0 -def upload_parameters(chipid): +def upload_parameters(chipid: str, litemap_path: Path | str = LITEMAP_PATH): name = inspect.stack()[0][3] logger.info("%s Uploading Parameters to the GeoBrick" % (name)) if chipid == "toronto": @@ -262,9 +268,10 @@ def upload_parameters(chipid): elif chipid == "oxford": caput(pv.me14e_gp1, 1) width = 8 - litemap_path = "/dls_sw/i24/scripts/fastchips/litemaps/" - # litemap_path = '/localhome/local/Documents/sacla/parameter_files/' - with open(litemap_path + "currentchip.map", "r") as f: + if not isinstance(litemap_path, Path): + litemap_path = Path(litemap_path) + + with open(litemap_path / "currentchip.map", "r") as f: print("chipid", chipid) print(width) logger.info("%s chipid %s" % (name, chipid)) @@ -294,16 +301,17 @@ def upload_parameters(chipid): logger.info("%s %s" % (name, 10 * "Done")) -def upload_full(): +def upload_full(fullmap_path: Path | str = FULLMAP_PATH): name = inspect.stack()[0][3] - fullmap_path = "/dls_sw/i24/scripts/fastchips/fullmaps/" - # fullmap_path = '/localhome/local/Documents/sacla/parameter_files/' - with open(fullmap_path + "currentchip.full", "r") as fh: + if not isinstance(fullmap_path, Path): + fullmap_path = Path(fullmap_path) + + with open(fullmap_path / "currentchip.full", "r") as fh: f = fh.readlines() - for x in range(len(f) / 2): + for _ in range(len(f) // 2): pmac_list = [] - for i in range(2): + for _ in range(2): pmac_list.append(f.pop(0).rstrip("\n")) writeline = " ".join(pmac_list) print(writeline) @@ -518,7 +526,7 @@ def load_stock_map(map_choice): print(10 * "Done ") -def load_lite_map(): +def load_lite_map(litemap_path: Path | str = LITEMAP_PATH): name = inspect.stack()[0][3] load_stock_map("clear") # fmt: off @@ -582,14 +590,15 @@ def load_lite_map(): # print button_name, btn_names[button_name] block_dict = btn_names - # litemap_path = '/dls_sw/i24/scripts/fastchips/litemaps/' - litemap_path = "/localhome/local/Documents/sacla/parameter_files/" + if not isinstance(litemap_path, Path): + litemap_path = Path(litemap_path) + litemap_fid = str(caget(pv.me14e_gp5)) + ".lite" print("Please wait, loading LITE map") - print("Opening", litemap_path + litemap_fid) + print("Opening", litemap_path / litemap_fid) logger.info("%s Loading Lite Map" % name) - logger.info("%s Opening %s" % (name, litemap_path + litemap_fid)) - with open(litemap_path + litemap_fid, "r") as fh: + logger.info("%s Opening %s" % (name, litemap_path / litemap_fid)) + with open(litemap_path / litemap_fid, "r") as fh: f = fh.readlines() for line in f: entry = line.split() @@ -603,7 +612,7 @@ def load_lite_map(): print(10 * "Done ") -def load_full_map(location="SACLA"): +def load_full_map(location: str = "SACLA", fullmap_path: Path | str = FULLMAP_PATH): name = inspect.stack()[0][3] if location == "i24": ( @@ -622,20 +631,22 @@ def load_full_map(location="SACLA"): chip_type, map_type, ) = startup.scrape_parameter_file(location) - # fullmap_path = '/dls_sw/i24/scripts/fastchips/fullmaps/' - fullmap_path = "/localhome/local/Documents/sacla/parameter_files/" - fullmap_fid = fullmap_path + str(caget(pv.me14e_gp5)) + ".spec" + if not isinstance(fullmap_path, Path): + fullmap_path = Path(fullmap_path) + + fullmap_fid = fullmap_path / f"{str(caget(pv.me14e_gp5))}.spec" print("opening", fullmap_fid) logger.info("%s opening %s" % (name, fullmap_fid)) mapping.plot_file(fullmap_fid, chip_type) print("\n\n", 10 * "PNG ") mapping.convert_chip_to_hex(fullmap_fid, chip_type) os.system( - "cp %s %s" % (fullmap_fid[:-4] + "full", fullmap_path + "currentchip.full") + "cp %s %s" + % (fullmap_fid.with_suffix(".full"), fullmap_path / "currentchip.full") ) logger.info( "%s cp %s %s" - % (name, fullmap_fid[:-4] + "full", fullmap_path + "currentchip.full") + % (name, fullmap_fid.with_suffix(".full"), fullmap_path / "currentchip.full") ) print(10 * "Done ", "\n") diff --git a/src/mx_bluesky/I24/serial/parameters/constants.py b/src/mx_bluesky/I24/serial/parameters/constants.py index 545540648..f65d9a596 100644 --- a/src/mx_bluesky/I24/serial/parameters/constants.py +++ b/src/mx_bluesky/I24/serial/parameters/constants.py @@ -1,5 +1,6 @@ from pathlib import Path +PARAM_FILE_PATH = Path("src/mx_bluesky/I24/serial/parameters") PARAM_FILE_PATH_EX = Path("src/mx_bluesky/I24/serial/parameters/extruder") PARAM_FILE_PATH_FT = Path("src/mx_bluesky/I24/serial/parameters/fixed_target") LITEMAP_PATH = Path("src/mx_bluesky/I24/serial/parameters/fixed_target/litemaps") diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/bismuth2.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/bismuth2.pvar similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/pvar_files/bismuth2.pvar rename to src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/bismuth2.pvar diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/hamburg.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/hamburg.pvar similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/pvar_files/hamburg.pvar rename to src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/hamburg.pvar diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/hamburgfull.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/hamburgfull.pvar similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/pvar_files/hamburgfull.pvar rename to src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/hamburgfull.pvar diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/oxford.pvar similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/pvar_files/oxford.pvar rename to src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/oxford.pvar diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford6x6.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/oxford6x6.pvar similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/pvar_files/oxford6x6.pvar rename to src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/oxford6x6.pvar diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford_short.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/oxford_short.pvar similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/pvar_files/oxford_short.pvar rename to src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/oxford_short.pvar diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/oxford_verbose.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/oxford_verbose.pvar similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/pvar_files/oxford_verbose.pvar rename to src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/oxford_verbose.pvar diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/regina.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/regina.pvar similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/pvar_files/regina.pvar rename to src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/regina.pvar diff --git a/src/mx_bluesky/I24/serial/parameters/pvar_files/toronto.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/toronto.pvar similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/pvar_files/toronto.pvar rename to src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/toronto.pvar From a5875f8683dceffdfd16bd4a964f9691edf52636 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 13:31:12 +0100 Subject: [PATCH 25/47] Change path --- .../I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py | 6 +++--- src/mx_bluesky/I24/serial/parameters/constants.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py index 62860bf84..b08802fe3 100755 --- a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +++ b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py @@ -16,7 +16,7 @@ from mx_bluesky.I24.serial import log from mx_bluesky.I24.serial.dcid import DCID, SSXType -from mx_bluesky.I24.serial.parameters.constants import PARAM_FILE_PATH_EX +from mx_bluesky.I24.serial.parameters.constants import PARAM_FILE_PATH from mx_bluesky.I24.serial.setup_beamline import caget, caput, pv from mx_bluesky.I24.serial.setup_beamline import setup_beamline as sup from mx_bluesky.I24.serial.write_nexus import call_nexgen @@ -87,7 +87,7 @@ def moveto(place): caput(pv.det_z, 1480) -def write_parameter_file(param_path: Path | str = PARAM_FILE_PATH_EX): +def write_parameter_file(param_path: Path | str = PARAM_FILE_PATH): name = inspect.stack()[0][3] if not isinstance(param_path, Path): @@ -158,7 +158,7 @@ def write_parameter_file(param_path: Path | str = PARAM_FILE_PATH_EX): print("pump_delay:", pump_delay) -def scrape_parameter_file(param_path: Path | str = PARAM_FILE_PATH_EX): +def scrape_parameter_file(param_path: Path | str = PARAM_FILE_PATH): if not isinstance(param_path, Path): param_path = Path(param_path) diff --git a/src/mx_bluesky/I24/serial/parameters/constants.py b/src/mx_bluesky/I24/serial/parameters/constants.py index f65d9a596..cae67e0b3 100644 --- a/src/mx_bluesky/I24/serial/parameters/constants.py +++ b/src/mx_bluesky/I24/serial/parameters/constants.py @@ -1,7 +1,6 @@ from pathlib import Path PARAM_FILE_PATH = Path("src/mx_bluesky/I24/serial/parameters") -PARAM_FILE_PATH_EX = Path("src/mx_bluesky/I24/serial/parameters/extruder") PARAM_FILE_PATH_FT = Path("src/mx_bluesky/I24/serial/parameters/fixed_target") LITEMAP_PATH = Path("src/mx_bluesky/I24/serial/parameters/fixed_target/litemaps") FULLMAP_PATH = Path("src/mx_bluesky/I24/serial/parameters/fixed_target/fullmaps") From 1a7e807f3210b5be479269aa31771a61c289a8f7 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 14:10:58 +0100 Subject: [PATCH 26/47] Finish fixing/removing paths --- .../fixed_target/i24ssx_Chip_Manager_py3v1.py | 36 ++++---- .../fixed_target/i24ssx_Chip_Mapping_py3v1.py | 8 +- .../fixed_target/i24ssx_Chip_StartUp_py3v1.py | 90 ++++++++++++------- .../{ => fixed-target}/motor_direction.txt | 0 4 files changed, 79 insertions(+), 55 deletions(-) rename src/mx_bluesky/I24/serial/parameters/{ => fixed-target}/motor_direction.txt (100%) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index d0026cdc8..f0239caf8 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -842,20 +842,21 @@ def moveto(place): caput(pv.me14e_pmac_str, " M812=0 M811=1") -def scrape_mtr_directions(): +def scrape_mtr_directions(param_path: Path | str = PARAM_FILE_PATH_FT): name = inspect.stack()[0][3] - param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" - # param_path = '/localhome/local/Documents/sacla/parameter_files/' - with open(param_path + "motor_direction.txt", "r") as f: + if not isinstance(param_path, Path): + param_path = Path(param_path) + + with open(param_path / "motor_direction.txt", "r") as f: lines = f.readlines() - mtr1_dir, mtr2_dir, mtr3_dir = 1, 1, 1 + mtr1_dir, mtr2_dir, mtr3_dir = 1.0, 1.0, 1.0 for line in lines: if line.startswith("mtr1"): - mtr1_dir = float(int(line.split("=")[1])) + mtr1_dir = float(line.split("=")[1]) elif line.startswith("mtr2"): - mtr2_dir = float(int(line.split("=")[1])) + mtr2_dir = float(line.split("=")[1]) elif line.startswith("mtr3"): - mtr3_dir = float(int(line.split("=")[1])) + mtr3_dir = float(line.split("=")[1]) else: continue logger.info( @@ -864,13 +865,13 @@ def scrape_mtr_directions(): return mtr1_dir, mtr2_dir, mtr3_dir -def fiducial(point): +def fiducial(point: int, param_path: Path | str = PARAM_FILE_PATH_FT): name = inspect.stack()[0][3] scale = 10000.0 # noqa: F841 - param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" - # param_path = '/localhome/local/Documents/sacla/parameter_files/' + if not isinstance(param_path, Path): + param_path = Path(param_path) - mtr1_dir, mtr2_dir, mtr3_dir = scrape_mtr_directions() + mtr1_dir, mtr2_dir, mtr3_dir = scrape_mtr_directions(param_path) rbv_1 = float(caget(pv.me14e_stage_x + ".RBV")) rbv_2 = float(caget(pv.me14e_stage_y + ".RBV")) @@ -900,7 +901,7 @@ def fiducial(point): logger.info("%s MTR2\t%1.4f\t%i\t%i\t%1.4f" % (name, rbv_2, raw_2, mtr2_dir, f_y)) logger.info("%s MTR3\t%1.4f\t%i\t%i\t%1.4f" % (name, rbv_3, raw_3, mtr3_dir, f_y)) - with open(param_path + "fiducial_%s.txt" % point, "w") as f: + with open(param_path / f"fiducial_{point}txt", "w") as f: f.write("MTR\tRBV\tRAW\tCorr\tf_value\n") f.write("MTR1\t%1.4f\t%i\t%i\t%1.4f\n" % (rbv_1, raw_1, mtr1_dir, f_x)) f.write("MTR2\t%1.4f\t%i\t%i\t%1.4f\n" % (rbv_2, raw_2, mtr2_dir, f_y)) @@ -908,10 +909,11 @@ def fiducial(point): print(10 * "Done ") -def scrape_mtr_fiducials(point): - param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" - # param_path = '/localhome/local/Documents/sacla/parameter_files/' - with open(param_path + "fiducial_%i.txt" % point, "r") as f: +def scrape_mtr_fiducials(point: int, param_path: Path | str = PARAM_FILE_PATH_FT): + if not isinstance(param_path, Path): + param_path = Path(param_path) + + with open(param_path / f"fiducial_{point}.txt", "r") as f: f_lines = f.readlines()[1:] f_x = float(f_lines[0].rsplit()[4]) f_y = float(f_lines[1].rsplit()[4]) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py index 1cc6c6ad7..ce87b625e 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Mapping_py3v1.py @@ -19,6 +19,7 @@ scrape_parameter_file, write_file, ) +from mx_bluesky.I24.serial.parameters.constants import PARAM_FILE_PATH_FT logger = logging.getLogger("I24ssx.chip_mapping") @@ -180,10 +181,9 @@ def main(): check_files([".spec"]) write_file(suffix=".spec", order="shot") - param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" - logger.info("%s PARAMETER PATH = %s" % (name, param_path)) - print("param_path", param_path) - fid = param_path + chip_name + ".spec" + logger.info("%s PARAMETER PATH = %s" % (name, PARAM_FILE_PATH_FT)) + print("param_path", PARAM_FILE_PATH_FT) + fid = PARAM_FILE_PATH_FT / f"{chip_name}.spec" logger.info("%s FID = %s" % (name, fid)) print("FID", fid) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py index a3b29d7e3..ad3d7466a 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py @@ -8,14 +8,15 @@ import inspect import logging import os -import pathlib import string import time -from typing import Dict +from pathlib import Path +from typing import Dict, List import numpy as np from mx_bluesky.I24.serial import log +from mx_bluesky.I24.serial.parameters.constants import PARAM_FILE_PATH_FT logger = logging.getLogger("I24ssx.chip_startup") @@ -26,10 +27,13 @@ def setup_logging(): log.config(logfile) -def scrape_parameter_file(location=None): - param_path = "/dls_sw/i24/scripts/fastchips/parameter_files/" - # param_path = '/localhome/local/Documents/sacla/parameter_files/' - with open(param_path + "parameters.txt", "r") as filein: +def scrape_parameter_file( + location: str | None = None, param_path: Path | str = PARAM_FILE_PATH_FT +): + if not isinstance(param_path, Path): + param_path = Path(param_path) + + with open(param_path / "parameters.txt", "r") as filein: f = filein.readlines() for line in f: entry = line.rstrip().split() @@ -84,7 +88,9 @@ def scrape_parameter_file(location=None): return chip_name, sub_dir, n_exposures, chip_type, map_type -def read_parameters(filename: str | None = None) -> Dict[str, str]: +def read_parameters( + param_path: Path | str = PARAM_FILE_PATH_FT, filename: str | None = None +) -> Dict[str, str]: """ Read the parameter file into a lookup dictionary. @@ -98,9 +104,12 @@ def read_parameters(filename: str | None = None) -> Dict[str, str]: Returns: A dictionary with a string entry for every key in the file. """ - data = pathlib.Path( - "/dls_sw/i24/scripts/fastchips/parameter_files/parameters.txt" - ).read_text() + if not isinstance(param_path, Path): + param_path = Path(param_path) + if filename is None: + filename = "parameters.txt" + datafile = param_path / filename + data = datafile.read_text() args = {} for line in data.splitlines(): key, value = line.split(maxsplit=1) @@ -371,9 +380,15 @@ def get_shot_order(chip_type): return collect_list -def write_file(location="i24", suffix=".addr", order="alphanumeric"): +def write_file( + location="i24", + suffix=".addr", + order="alphanumeric", + param_file_path=PARAM_FILE_PATH_FT, +): name = inspect.stack()[0][3] logger.info("%s" % name) + a_directory = PARAM_FILE_PATH_FT if location == "i24": ( chip_name, @@ -387,15 +402,15 @@ def write_file(location="i24", suffix=".addr", order="alphanumeric"): exptime, dcdetdist, prepumpexptime, - ) = scrape_parameter_file("i24") - a_directory = "/dls_sw/i24/scripts/fastchips/" + ) = scrape_parameter_file("i24", param_file_path) elif location == "SACLA": - chip_name, sub_dir, n_exposures, chip_type, map_type = scrape_parameter_file() - a_directory = "/localhome/local/Documents/sacla/" + chip_name, sub_dir, n_exposures, chip_type, map_type = scrape_parameter_file( + param_path=param_file_path + ) else: logger.warning("%s Unknown location, %s" % (name, location)) print("Unknown location in write_file") - chip_file_path = a_directory + "chips/" + sub_dir + "/" + chip_name + suffix + chip_file_path = a_directory / f"chips/{sub_dir}/{chip_name}{suffix}" fiducial_list = fiducials(chip_type) if order == "alphanumeric": @@ -421,8 +436,13 @@ def write_file(location="i24", suffix=".addr", order="alphanumeric"): logger.info("%s" % name) -def check_files(location, suffix_list): +def check_files( + location: str, + suffix_list: List[str], + param_file_path: Path | str = PARAM_FILE_PATH_FT, +): name = inspect.stack()[0][3] + a_directory = PARAM_FILE_PATH_FT if location == "i24": ( chip_name, @@ -438,36 +458,38 @@ def check_files(location, suffix_list): dcdetdist, prepumpexptime, det_type, - ) = scrape_parameter_file("i24") - a_directory = "/dls_sw/i24/scripts/fastchips/" + ) = scrape_parameter_file("i24", param_path=param_file_path) elif location == "SACLA": - chip_name, sub_dir, n_exposures, chip_type, map_type = scrape_parameter_file() - a_directory = "/localhome/local/Documents/sacla/" + chip_name, sub_dir, n_exposures, chip_type, map_type = scrape_parameter_file( + param_path=param_file_path + ) else: logger.warning("%s Unknown location, %s" % (name, location)) print("Unknown location in write_file") - chip_file_path = a_directory + "chips/" + sub_dir + "/" + chip_name + chip_file_path = a_directory / f"chips/{sub_dir}/{chip_name}" try: os.stat(chip_file_path) except Exception: os.makedirs(chip_file_path) for suffix in suffix_list: - full_fid = chip_file_path + suffix - if os.path.isfile(full_fid): + full_fid = chip_file_path.with_suffix(suffix) + if full_fid.is_file(): time_str = time.strftime("%Y%m%d_%H%M%S_") - timestamp_fid = full_fid.replace(chip_name, time_str + "_" + chip_name) + timestamp_fid = full_fid.parent / f"{time_str}_{chip_name}{full_fid.suffix}" print("FIX ME") # hack / fix - # os.rename(full_fid, timestamp_fid) print("Already exists ... moving old file:", timestamp_fid) logger.info("%s File Already Exists\n -->%s" % (name, timestamp_fid)) return 1 -def write_headers(location, suffix_list): +def write_headers( + location: str, suffix_list: List[str], param_file_path=PARAM_FILE_PATH_FT +): name = inspect.stack()[0][3] + a_directory = PARAM_FILE_PATH_FT if location == "i24": ( chip_name, @@ -483,16 +505,16 @@ def write_headers(location, suffix_list): dcdetdist, prepumpexptime, det_type, - ) = scrape_parameter_file("i24") - a_directory = "/dls_sw/i24/scripts/fastchips/" + ) = scrape_parameter_file("i24", param_path=PARAM_FILE_PATH_FT) elif location == "SACLA": - chip_name, sub_dir, n_exposures, chip_type, map_type = scrape_parameter_file() - a_directory = "/localhome/local/Documents/sacla/" - chip_file_path = a_directory + "chips/" + sub_dir + "/" + chip_name + chip_name, sub_dir, n_exposures, chip_type, map_type = scrape_parameter_file( + param_path=PARAM_FILE_PATH_FT + ) + chip_file_path = a_directory / f"chips/{sub_dir}/{chip_name}" if location == "i24": for suffix in suffix_list: - full_fid = chip_file_path + suffix + full_fid = chip_file_path.with_suffix(suffix) with open(full_fid, "w") as g: g.write( "#23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\n#\n" @@ -516,7 +538,7 @@ def write_headers(location, suffix_list): elif location == "SACLA": for suffix in suffix_list: - full_fid = chip_file_path + suffix + full_fid = chip_file_path.with_suffix(suffix) with open(full_fid, "w") as g: g.write( "#23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890\n#\n" diff --git a/src/mx_bluesky/I24/serial/parameters/motor_direction.txt b/src/mx_bluesky/I24/serial/parameters/fixed-target/motor_direction.txt similarity index 100% rename from src/mx_bluesky/I24/serial/parameters/motor_direction.txt rename to src/mx_bluesky/I24/serial/parameters/fixed-target/motor_direction.txt From 6a21b6374f71b4f9af5110309d0af724e4c87440 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 14:13:25 +0100 Subject: [PATCH 27/47] Fix import --- .../I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py | 2 ++ .../I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py | 1 + 2 files changed, 3 insertions(+) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py index fbcf3af76..2e83b2401 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py @@ -1,6 +1,8 @@ """ Fixed target data collection """ +from __future__ import annotations + import argparse import inspect import logging diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index f0239caf8..fc5042fa6 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -2,6 +2,7 @@ Chip manager for fixed target This version changed to python3 March2020 by RLO """ +from __future__ import annotations import inspect import logging From 880526474102c52c16d3c8882355e6eae132e12f Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 14:26:58 +0100 Subject: [PATCH 28/47] Add just a couple of tests --- .../serial/fixed-target/test_chip_manager.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tests/I24/serial/fixed-target/test_chip_manager.py diff --git a/tests/I24/serial/fixed-target/test_chip_manager.py b/tests/I24/serial/fixed-target/test_chip_manager.py new file mode 100644 index 000000000..c85a2ac66 --- /dev/null +++ b/tests/I24/serial/fixed-target/test_chip_manager.py @@ -0,0 +1,21 @@ +from unittest.mock import patch + +from mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1 import moveto + + +@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caput") +@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") +def test_moveto_oxford_origin(fake_caget, fake_caput): + fake_caget.return_value = 1 + moveto("origin") + assert fake_caget.call_count == 1 + assert fake_caput.call_count == 2 + + +@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caput") +@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Manager_py3v1.caget") +def test_moveto_chip_unknown(fake_caget, fake_caput): + fake_caget.return_value = 2 + moveto("yag") + assert fake_caget.call_count == 1 + assert fake_caput.call_count == 3 From 3e581952b0d9e7e0f73203c238a2b8c7e677da6a Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 14:39:39 +0100 Subject: [PATCH 29/47] Use old directories for .addr .spec files as they look like logs --- .../I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py index ad3d7466a..3123ecd0f 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_StartUp_py3v1.py @@ -388,7 +388,6 @@ def write_file( ): name = inspect.stack()[0][3] logger.info("%s" % name) - a_directory = PARAM_FILE_PATH_FT if location == "i24": ( chip_name, @@ -403,10 +402,12 @@ def write_file( dcdetdist, prepumpexptime, ) = scrape_parameter_file("i24", param_file_path) + a_directory = Path("/dls_sw/i24/scripts/fastchips/") elif location == "SACLA": chip_name, sub_dir, n_exposures, chip_type, map_type = scrape_parameter_file( param_path=param_file_path ) + a_directory = Path("/localhome/local/Documents/sacla/") else: logger.warning("%s Unknown location, %s" % (name, location)) print("Unknown location in write_file") @@ -442,7 +443,6 @@ def check_files( param_file_path: Path | str = PARAM_FILE_PATH_FT, ): name = inspect.stack()[0][3] - a_directory = PARAM_FILE_PATH_FT if location == "i24": ( chip_name, @@ -459,10 +459,12 @@ def check_files( prepumpexptime, det_type, ) = scrape_parameter_file("i24", param_path=param_file_path) + a_directory = Path("/dls_sw/i24/scripts/fastchips/") elif location == "SACLA": chip_name, sub_dir, n_exposures, chip_type, map_type = scrape_parameter_file( param_path=param_file_path ) + a_directory = Path("/localhome/local/Documents/sacla/") else: logger.warning("%s Unknown location, %s" % (name, location)) @@ -489,7 +491,6 @@ def write_headers( location: str, suffix_list: List[str], param_file_path=PARAM_FILE_PATH_FT ): name = inspect.stack()[0][3] - a_directory = PARAM_FILE_PATH_FT if location == "i24": ( chip_name, @@ -506,10 +507,12 @@ def write_headers( prepumpexptime, det_type, ) = scrape_parameter_file("i24", param_path=PARAM_FILE_PATH_FT) + a_directory = Path("/dls_sw/i24/scripts/fastchips/") elif location == "SACLA": chip_name, sub_dir, n_exposures, chip_type, map_type = scrape_parameter_file( param_path=PARAM_FILE_PATH_FT ) + a_directory = Path("/localhome/local/Documents/sacla/") chip_file_path = a_directory / f"chips/{sub_dir}/{chip_name}" if location == "i24": From d9b0a2a3536dfa5d1f9c01a2fc7bfb3aff1e4613 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 17:04:59 +0100 Subject: [PATCH 30/47] Uncomment module load --- dls_dev_setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dls_dev_setup.sh b/dls_dev_setup.sh index b2b5c56ee..65f382480 100755 --- a/dls_dev_setup.sh +++ b/dls_dev_setup.sh @@ -1,4 +1,4 @@ -#module load python/3.10 +module load python/3.10 if [ -d "./.venv" ] then From 7a490789fd636b9430a10a4cec2a40053abeecc4 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 17:07:36 +0100 Subject: [PATCH 31/47] Remove unneeded pvar files --- .../fixed-target/pvar_files/bismuth2.pvar | 65 ----------------- .../fixed-target/pvar_files/hamburg.pvar | 18 ----- .../fixed-target/pvar_files/hamburgfull.pvar | 58 --------------- .../fixed-target/pvar_files/regina.pvar | 72 ------------------- .../fixed-target/pvar_files/toronto.pvar | 46 ------------ 5 files changed, 259 deletions(-) delete mode 100755 src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/bismuth2.pvar delete mode 100755 src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/hamburg.pvar delete mode 100755 src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/hamburgfull.pvar delete mode 100755 src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/regina.pvar delete mode 100755 src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/toronto.pvar diff --git a/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/bismuth2.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/bismuth2.pvar deleted file mode 100755 index d9afdf8fd..000000000 --- a/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/bismuth2.pvar +++ /dev/null @@ -1,65 +0,0 @@ -# Clear -P3000..3999=0 -# Switch all blocks off -P3011,49,10=0 -# X-start -P3012,7,10=0 -P3082,7,10=4 -P3152,7,10=8 -P3222,7,10=12 -P3292,7,10=16 -P3362,7,10=20 -P3432,7,10=24 -# Y-start -P3013=0 -P3023=4 -P3033=8 -P3043=12 -P3053=16 -P3063=20 -P3073=24 -P3083=0 -P3093=4 -P3103=8 -P3113=12 -P3123=16 -P3133=20 -P3143=24 -P3153=0 -P3163=4 -P3173=8 -P3183=12 -P3193=16 -P3203=20 -P3213=24 -P3223=0 -P3233=4 -P3243=8 -P3253=12 -P3263=16 -P3273=20 -P3283=24 -P3293=0 -P3303=4 -P3313=8 -P3323=12 -P3333=16 -P3343=20 -P3353=24 -P3363=0 -P3373=4 -P3383=8 -P3393=12 -P3403=16 -P3413=20 -P3423=24 -P3433=0 -P3443=4 -P3453=8 -P3463=12 -P3473=16 -P3483=20 -P3493=24 - -# Block direction -P3014,49,10=31 diff --git a/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/hamburg.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/hamburg.pvar deleted file mode 100755 index 6f029d9e0..000000000 --- a/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/hamburg.pvar +++ /dev/null @@ -1,18 +0,0 @@ -# Clear -P3000..3999=0 -# Switch all blocks on -P3011,9,10=1 -# Set all the x columns -P3012,3,10=0 -P3042,3,10=8.580 -P3072,3,10=17.160 -# Y-start pvar, number of down columns, 10*2*3 -# [x*2.5 for x in range(3)] -P3013,2,60=0.0 -P3023,2,60=8.580 -P3033,2,60=17.160 -# [(52*0.150) + (x*8.580) for x in range(3)] -# Y-start -P3044=24.96 -P3054=16.38 -P3064=7.80 diff --git a/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/hamburgfull.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/hamburgfull.pvar deleted file mode 100755 index a8f957830..000000000 --- a/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/hamburgfull.pvar +++ /dev/null @@ -1,58 +0,0 @@ -# Clear -P3000..3999=0 -# Switch all blocks on -P3011,18,10=1 -P3012=0 -P3013=0 -P3014=31 -P3022=0 -P3023=8.580 -P3024=31 -P3032=0 -P3033=17.160 -P3034=31 -P3042=4.20 -P3043=24.96 -P3044=32 -P3052=4.20 -P3053=16.38 -P3054=32 -P3062=4.20 -P3063=7.80 -P3064=32 -P3072=8.58 -P3073=0.00 -P3074=31 -P3082=8.58 -P3083=8.58 -P3084=31 -P3092=8.58 -P3093=17.16 -P3094=31 -P3102=12.78 -P3103=24.96 -P3104=32 -P3112=12.78 -P3113=16.38 -P3114=32 -P3122=12.78 -P3123=7.80 -P3124=32 -P3132=17.16 -P3133=0.0 -P3134=31 -P3142=17.16 -P3143=8.58 -P3144=31 -P3152=17.16 -P3153=17.16 -P3154=31 -P3162=21.36 -P3163=24.96 -P3164=32 -P3172=21.36 -P3173=16.38 -P3174=32 -P3182=21.36 -P3183=7.8 -P3184=32 diff --git a/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/regina.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/regina.pvar deleted file mode 100755 index 104fd8661..000000000 --- a/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/regina.pvar +++ /dev/null @@ -1,72 +0,0 @@ -# Clear -P3000..3999=0 -# Switch all blocks on -P3011,64,10=1 -# Set all the x columns -# [x*3.70 for x in range(7)] - -P3012=0 P3013=0.0 -P3022=-0.01 P3023=3.701 -P3032=-0.02 P3033=7.402 -P3042=-0.03 P3043=11.103 -P3052=-0.04 P3053=14.804 -P3062=-0.05 P3063=18.505 -P3072=-0.06 P3073=22.206 - -P3082=3.63 P3083=24.58 -P3092=3.64 P3093=20.875 -P3102=3.65 P3103=17.175 -P3112=3.66 P3113=13.475 -P3122=3.67 P3123=9.775 -P3132=3.68 P3133=6.075 -P3142=3.695 P3143=2.375 - -P3152=7.40 P3013=-0.02 -P3162=7.385 P3163=3.68 -P3172=7.375 P3173=7.38 -P3182=7.365 P3183=11.09 -P3192=7.355 P3193=14.78 -P3202=7.345 P3203=18.485 -P3212=7.335 P3213=22.19 - -P3222=11.03 P3223=24.56 -P3232=11.04 P3233=20.86 -P3242=11.06 P3243=17.16 -P3252=11.06 P3253=13.455 -P3262=11.07 P3263=9.755 -P3272=11.08 P3273=6.055 -P3282=11.095 P3283=2.355 - -P3292=14.80 P3293=-0.04 -P3302=14.79 P3303=3.66 -P3312=14.78 P3313=7.36 -P3322=14.77 P3323=11.06 -P3332=14.76 P3333=14.76 -P3342=14.75 P3343=18.47 -P3352=14.74 P3353=22.17 - -P3362=18.43 P3363=24.55 -P3372=18.44 P3373=20.84 -P3382=18.45 P3383=17.14 -P3392=18.46 P3393=13.435 -P3402=18.47 P3403=9.735 -P3412=18.48 P3413=6.035 -P3422=18.50 P3423=2.335 - -P3432=22.21 P3433=-0.05 -P3442=22.20 P3443=3.66 -P3452=22.19 P3453=7.36 -P3462=22.18 P3463=11.06 -P3472=22.17 P3473=14.76 -P3482=22.16 P3483=18.47 -P3492=22.15 P3493=22.17 - -# -# Block direction -P3014,7,10=31 -P3084,7,10=32 -P3154,7,10=31 -P3224,7,10=32 -P3294,7,10=31 -P3364,7,10=32 -P3434,7,10=31 diff --git a/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/toronto.pvar b/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/toronto.pvar deleted file mode 100755 index 32d59f2aa..000000000 --- a/src/mx_bluesky/I24/serial/parameters/fixed-target/pvar_files/toronto.pvar +++ /dev/null @@ -1,46 +0,0 @@ -# Clear -P3000..3999=0 -# Switch all blocks on -P3011,81,10=1 -# Set all the x columns -P3012,9,10=0 -P3102,9,10=2.2 -P3192,9,10=4.4 -P3282,9,10=6.6 -P3372,9,10=8.8 -P3462,9,10=11.0 -P3552,9,10=13.2 -P3642,9,10=15.4 -P3732,9,10=17.6 -# Y-start pvar,number of down columns, 10*2*9 -# [x*2.5 for x in range(9)] -P3013,5,180=0.0 -P3023,5,180=2.5 -P3033,5,180=5.0 -P3043,5,180=7.5 -P3053,5,180=10.0 -P3063,5,180=12.5 -P3073,5,180=15.0 -P3083,5,180=17.5 -P3093,5,180=20.0 -# Y-start pvar, number of up columns, 10*2*9 -# Y-start -P3103,4,180=21.375 -P3113,4,180=18.875 -P3123,4,180=16.375 -P3133,4,180=13.875 -P3143,4,180=11.375 -P3153,4,180=8.875 -P3163,4,180=6.375 -P3173,4,180=3.875 -P3183,4,180=1.375 -# Block direction -P3014,9,10=31 -P3104,9,10=32 -P3194,9,10=31 -P3284,9,10=32 -P3374,9,10=31 -P3464,9,10=32 -P3554,9,10=31 -P3644,9,10=32 -P3734,9,10=31 From c79d121377ff91de1e365688aeeab7c1c1673560 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 17:39:52 +0100 Subject: [PATCH 32/47] Move parsers into __main__ --- .../extruder/i24ssx_Extruder_Collect_py3v2.py | 75 +++++++++---------- .../fixed_target/i24ssx_Chip_Collect_py3v1.py | 29 +++---- 2 files changed, 51 insertions(+), 53 deletions(-) diff --git a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py index b08802fe3..7f180a560 100755 --- a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +++ b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py @@ -21,6 +21,7 @@ from mx_bluesky.I24.serial.setup_beamline import setup_beamline as sup from mx_bluesky.I24.serial.write_nexus import call_nexgen +usage = "%(prog)s command [options]" logger = logging.getLogger("I24ssx.extruder") @@ -34,7 +35,7 @@ def flush_print(text): sys.stdout.flush() -def initialise_extruderi24(): +def initialise_extruderi24(args): name = inspect.stack()[0][3] print("Initialise Parameters for extruder data collection") logger.info("%s I24 extruder initialisation" % name) @@ -59,7 +60,8 @@ def initialise_extruderi24(): logger.info("%s Initialsation complete" % name) -def moveto(place): +def moveto(args): + place = args.place name = inspect.stack()[0][3] logger.info("%s Move to %s" % (name, place)) @@ -200,7 +202,7 @@ def scrape_parameter_file(param_path: Path | str = PARAM_FILE_PATH): ) -def run_extruderi24(): +def run_extruderi24(args): print("Starting i24") name = inspect.stack()[0][3] logger.info("%s" % name) @@ -445,42 +447,37 @@ def run_extruderi24(): return 1 -usage = "%(prog)s command [options]" -parser = argparse.ArgumentParser(usage=usage, description=__doc__) -subparsers = parser.add_subparsers( - help="Choose command.", - required=True, - dest="sub-command", -) - -parser_init = subparsers.add_parser( - "initialise", - description="Initialise extruder on beamline I24.", -) -parser_init.set_defaults(func=initialise_extruderi24) -parser_run = subparsers.add_parser( - "run", - description="Run extruder on I24.", -) -parser_run.set_defaults(func=run_extruderi24) -parser_mv = subparsers.add_parser( - "moveto", - description="Move extruder to requested setting on I24.", -) -parser_mv.add_argument( - "place", - type=str, - choices=["laseron", "laseroff", "enterhutch"], - help="Requested setting.", -) -parser_mv.set_defaults(func=moveto) - - -def main(): +if __name__ == "__main__": setup_logging() - args = parser.parse_args() - args.func(args) + parser = argparse.ArgumentParser(usage=usage, description=__doc__) + subparsers = parser.add_subparsers( + help="Choose command.", + required=True, + dest="sub-command", + ) -if __name__ == "__main__": - main() + parser_init = subparsers.add_parser( + "initialise", + description="Initialise extruder on beamline I24.", + ) + parser_init.set_defaults(func=initialise_extruderi24) + parser_run = subparsers.add_parser( + "run", + description="Run extruder on I24.", + ) + parser_run.set_defaults(func=run_extruderi24) + parser_mv = subparsers.add_parser( + "moveto", + description="Move extruder to requested setting on I24.", + ) + parser_mv.add_argument( + "place", + type=str, + choices=["laseron", "laseroff", "enterhutch"], + help="Requested setting.", + ) + parser_mv.set_defaults(func=moveto) + + args = parser.parse_args() + args.func(args) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py index 2e83b2401..3f913e680 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py @@ -29,15 +29,6 @@ logger = logging.getLogger("I24ssx.fixed_target") usage = "%(prog)s [options]" -parser = argparse.ArgumentParser(usage=usage, description=__doc__) -parser.add_argument( - "-l", - "--loc", - type=str, - choices=["i24", "SACLA"], - default="i24", - help="Location of collection.", -) def setup_logging(): @@ -693,10 +684,7 @@ def finish_sacla(): return end_time -def main(): - setup_logging() - args = parser.parse_args() - +def main(args): location = args.loc print("Location is", location, "Starting") # ABORT BUTTON @@ -895,4 +883,17 @@ def main(): if __name__ == "__main__": - main() + setup_logging() + + parser = argparse.ArgumentParser(usage=usage, description=__doc__) + parser.add_argument( + "-l", + "--loc", + type=str, + choices=["i24", "SACLA"], + default="i24", + help="Location of collection.", + ) + + args = parser.parse_args() + main(args) From e0f997cefbc889670dc438d606c8593fba64bc8d Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 17:53:38 +0100 Subject: [PATCH 33/47] Test a function that apparently does nothing --- tests/I24/serial/fixed-target/test_chip_startup.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/I24/serial/fixed-target/test_chip_startup.py b/tests/I24/serial/fixed-target/test_chip_startup.py index 68c0502f3..e3e7fb3f2 100644 --- a/tests/I24/serial/fixed-target/test_chip_startup.py +++ b/tests/I24/serial/fixed-target/test_chip_startup.py @@ -1,6 +1,7 @@ from unittest.mock import mock_open, patch from mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1 import ( + check_files, fiducials, get_format, scrape_parameter_file, @@ -42,3 +43,12 @@ def test_get_format(): # oxford chip fmt = get_format("1") assert fmt == [8, 8, 20, 20, 0.125, 0.800, 0.800] + + +@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1.os") +@patch( + "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1.open", + mock_open(read_data=params_file_str), +) +def test_check_files(mock_os): + check_files("i24", [".a", ".b"]) From 32054b5e146dbcafa15192e6dbc617ebbd7cee1d Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 18:23:50 +0100 Subject: [PATCH 34/47] Make a start on log tests --- tests/I24/serial/test_log.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/I24/serial/test_log.py diff --git a/tests/I24/serial/test_log.py b/tests/I24/serial/test_log.py new file mode 100644 index 000000000..192583e41 --- /dev/null +++ b/tests/I24/serial/test_log.py @@ -0,0 +1,26 @@ +import logging +from unittest.mock import patch + +import pytest + +from mx_bluesky.I24.serial import log + + +@pytest.fixture +def dummy_logger(): + logger = logging.getLogger("I24ssx.dummy") + yield logger + + +@patch("mx_bluesky.I24.serial.log.Path.mkdir") +def test_logging_file_path(mock_dir): + log_path = log._get_logging_file_path() + assert mock_dir.call_count == 1 + assert log_path.as_posix() == "tmp/logs" + + +@patch("mx_bluesky.I24.serial.log.Path.mkdir") +@patch("mx_bluesky.I24.serial.log.logging.FileHandler") +def test_log_config(mock_fh, mock_dir, dummy_logger): + log.config("dummy.log") + assert mock_fh.call_count == 1 From 047b1ed9b65517494bd1fd7f12954777fb5a8fc3 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Fri, 16 Jun 2023 18:44:41 +0100 Subject: [PATCH 35/47] Fix extruder parsers tests --- .../extruder/i24ssx_Extruder_Collect_py3v2.py | 4 +-- .../serial/extruder/test_extruder_collect.py | 30 +++++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py index 7f180a560..406f4fce7 100755 --- a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +++ b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py @@ -35,7 +35,7 @@ def flush_print(text): sys.stdout.flush() -def initialise_extruderi24(args): +def initialise_extruderi24(args=None): name = inspect.stack()[0][3] print("Initialise Parameters for extruder data collection") logger.info("%s I24 extruder initialisation" % name) @@ -202,7 +202,7 @@ def scrape_parameter_file(param_path: Path | str = PARAM_FILE_PATH): ) -def run_extruderi24(args): +def run_extruderi24(args=None): print("Starting i24") name = inspect.stack()[0][3] logger.info("%s" % name) diff --git a/tests/I24/serial/extruder/test_extruder_collect.py b/tests/I24/serial/extruder/test_extruder_collect.py index 90bc664ea..72e5080e2 100644 --- a/tests/I24/serial/extruder/test_extruder_collect.py +++ b/tests/I24/serial/extruder/test_extruder_collect.py @@ -1,5 +1,8 @@ +import argparse from unittest.mock import mock_open, patch +import pytest + from mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2 import ( initialise_extruderi24, moveto, @@ -20,6 +23,18 @@ pump_delay 0""" +@pytest.fixture +def dummy_parser(): + parser = argparse.ArgumentParser() + parser.add_argument( + "place", + type=str, + choices=["laseron", "laseroff", "enterhutch"], + help="Requested setting.", + ) + yield parser + + @patch( "mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.open", mock_open(read_data=params_file_str), @@ -45,26 +60,29 @@ def test_initialise_extruder(fake_det, fake_caput, fake_caget): @patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") @patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") -def test_moveto_enterhutch(fake_caget, fake_caput): - moveto("enterhutch") +def test_moveto_enterhutch(fake_caget, fake_caput, dummy_parser): + fake_args = dummy_parser.parse_args(["enterhutch"]) + moveto(fake_args) assert fake_caget.call_count == 1 assert fake_caput.call_count == 1 @patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") @patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") -def test_moveto_laseron_for_eiger(fake_caget, fake_caput): +def test_moveto_laseron_for_eiger(fake_caget, fake_caput, dummy_parser): fake_caget.return_value = "eiger" - moveto("laseron") + fake_args = dummy_parser.parse_args(["laseron"]) + moveto(fake_args) assert fake_caget.call_count == 1 assert fake_caput.call_count == 2 @patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caput") @patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.caget") -def test_moveto_laseroff_for_pilatus(fake_caget, fake_caput): +def test_moveto_laseroff_for_pilatus(fake_caget, fake_caput, dummy_parser): fake_caget.return_value = "pilatus" - moveto("laseroff") + fake_args = dummy_parser.parse_args(["laseroff"]) + moveto(fake_args) assert fake_caget.call_count == 1 assert fake_caput.call_count == 2 From ebd43cc3c737e8a52755756291bd26633eec3141 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Mon, 19 Jun 2023 15:59:54 +0100 Subject: [PATCH 36/47] Remove log test that broke everything else --- src/mx_bluesky/I24/serial/log.py | 4 ++-- .../I24/serial/extruder/test_extruder_collect.py | 3 ++- tests/I24/serial/test_log.py | 16 ---------------- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/mx_bluesky/I24/serial/log.py b/src/mx_bluesky/I24/serial/log.py index 61e0a4adf..c7f5cda14 100644 --- a/src/mx_bluesky/I24/serial/log.py +++ b/src/mx_bluesky/I24/serial/log.py @@ -58,7 +58,7 @@ def _get_logging_file_path() -> Path: return logging_path -def config(logfile: str | None = None, write_mode: str = "a"): +def config(logfile: str | None = None, write_mode: str = "a", delayed: bool = False): """ Configure the logging. @@ -75,7 +75,7 @@ def config(logfile: str | None = None, write_mode: str = "a"): "%(asctime)s %(levelname)s: \t%(message)s", datefmt="%d-%m-%Y %I:%M:%S", ) - FH = logging.FileHandler(logs, mode=write_mode, encoding="utf-8") + FH = logging.FileHandler(logs, mode=write_mode, encoding="utf-8", delay=delayed) FH.setLevel(logging.DEBUG) FH.setFormatter(fileFormatter) logger.addHandler(FH) diff --git a/tests/I24/serial/extruder/test_extruder_collect.py b/tests/I24/serial/extruder/test_extruder_collect.py index 72e5080e2..6c0c13f7e 100644 --- a/tests/I24/serial/extruder/test_extruder_collect.py +++ b/tests/I24/serial/extruder/test_extruder_collect.py @@ -50,7 +50,8 @@ def test_scrape_parameter_file(): @patch( "mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.sup.get_detector_type" ) -def test_initialise_extruder(fake_det, fake_caput, fake_caget): +@patch("mx_bluesky.I24.serial.extruder.i24ssx_Extruder_Collect_py3v2.logger") +def test_initialise_extruder(fake_log, fake_det, fake_caput, fake_caget): fake_caget.return_value = "/path/to/visit" fake_det.return_value = Eiger() initialise_extruderi24() diff --git a/tests/I24/serial/test_log.py b/tests/I24/serial/test_log.py index 192583e41..d210d203e 100644 --- a/tests/I24/serial/test_log.py +++ b/tests/I24/serial/test_log.py @@ -1,26 +1,10 @@ -import logging from unittest.mock import patch -import pytest - from mx_bluesky.I24.serial import log -@pytest.fixture -def dummy_logger(): - logger = logging.getLogger("I24ssx.dummy") - yield logger - - @patch("mx_bluesky.I24.serial.log.Path.mkdir") def test_logging_file_path(mock_dir): log_path = log._get_logging_file_path() assert mock_dir.call_count == 1 assert log_path.as_posix() == "tmp/logs" - - -@patch("mx_bluesky.I24.serial.log.Path.mkdir") -@patch("mx_bluesky.I24.serial.log.logging.FileHandler") -def test_log_config(mock_fh, mock_dir, dummy_logger): - log.config("dummy.log") - assert mock_fh.call_count == 1 From 9876d89f8d8659d98e9734c97ac5d887723db10c Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Mon, 19 Jun 2023 19:15:26 +0100 Subject: [PATCH 37/47] Add small test of basic logging config --- .vscode/settings.json | 5 ++++- tests/I24/serial/test_log.py | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 2472acfd6..29abf6478 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,10 +6,13 @@ "python.testing.pytestArgs": [], "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, - "python.formatting.provider": "black", + "python.formatting.provider": "none", "python.languageServer": "Pylance", "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.organizeImports": true + }, + "[python]": { + "editor.defaultFormatter": "ms-python.black-formatter" } } \ No newline at end of file diff --git a/tests/I24/serial/test_log.py b/tests/I24/serial/test_log.py index d210d203e..dcd5633a1 100644 --- a/tests/I24/serial/test_log.py +++ b/tests/I24/serial/test_log.py @@ -1,3 +1,4 @@ +import logging from unittest.mock import patch from mx_bluesky.I24.serial import log @@ -8,3 +9,9 @@ def test_logging_file_path(mock_dir): log_path = log._get_logging_file_path() assert mock_dir.call_count == 1 assert log_path.as_posix() == "tmp/logs" + + +def test_basic_logging_config(): + logger = logging.getLogger("I24ssx") + assert logger.hasHandlers() is True + assert len(logger.handlers) == 1 From 0ec69d4ef9110d07edcacde82cce59f14724b24f Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Mon, 19 Jun 2023 22:54:00 +0100 Subject: [PATCH 38/47] Add a test for logging --- tests/I24/serial/test_log.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/tests/I24/serial/test_log.py b/tests/I24/serial/test_log.py index dcd5633a1..180891fcc 100644 --- a/tests/I24/serial/test_log.py +++ b/tests/I24/serial/test_log.py @@ -1,9 +1,17 @@ import logging from unittest.mock import patch +import pytest + from mx_bluesky.I24.serial import log +@pytest.fixture +def dummy_logger(): + logger = logging.getLogger("I24ssx") + yield logger + + @patch("mx_bluesky.I24.serial.log.Path.mkdir") def test_logging_file_path(mock_dir): log_path = log._get_logging_file_path() @@ -11,7 +19,17 @@ def test_logging_file_path(mock_dir): assert log_path.as_posix() == "tmp/logs" -def test_basic_logging_config(): - logger = logging.getLogger("I24ssx") - assert logger.hasHandlers() is True - assert len(logger.handlers) == 1 +def test_basic_logging_config(dummy_logger): + assert dummy_logger.hasHandlers() is True + assert len(dummy_logger.handlers) == 1 + assert dummy_logger.handlers[0].level == logging.DEBUG + + +@patch("mx_bluesky.I24.serial.log.Path.mkdir") +def test_logging_config_with_filehandler(mock_dir, dummy_logger): + log.config("dummy.log", delayed=True) + assert len(dummy_logger.handlers) == 2 + assert mock_dir.call_count == 1 + assert dummy_logger.handlers[1].level == logging.DEBUG + # Clear FileHandler to avoid other tests failing if it is kept open + dummy_logger.removeHandler(dummy_logger.handlers[1]) From dd01a301ea53f5eb2710c053c46c57f8da1501a4 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Mon, 19 Jun 2023 23:25:59 +0100 Subject: [PATCH 39/47] Small directory fix and test for get_format --- .../I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py | 3 ++- tests/I24/serial/fixed-target/test_chip_startup.py | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py index 3f913e680..b034b0a1f 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Collect_py3v1.py @@ -22,6 +22,7 @@ get_format, scrape_parameter_file, ) +from mx_bluesky.I24.serial.parameters.constants import LITEMAP_PATH from mx_bluesky.I24.serial.setup_beamline import caget, cagetstring, caput, pv from mx_bluesky.I24.serial.setup_beamline import setup_beamline as sup from mx_bluesky.I24.serial.write_nexus import call_nexgen @@ -316,7 +317,7 @@ def datasetsizei24(): elif map_type == "1": chip_format = get_format(chip_type)[2:4] block_count = 0 - with open("/dls_sw/i24/scripts/fastchips/litemaps/currentchip.map", "r") as f: + with open(LITEMAP_PATH / "currentchip.map", "r") as f: for line in f.readlines(): entry = line.split() if entry[2] == "1": diff --git a/tests/I24/serial/fixed-target/test_chip_startup.py b/tests/I24/serial/fixed-target/test_chip_startup.py index e3e7fb3f2..f13f7674f 100644 --- a/tests/I24/serial/fixed-target/test_chip_startup.py +++ b/tests/I24/serial/fixed-target/test_chip_startup.py @@ -45,6 +45,11 @@ def test_get_format(): assert fmt == [8, 8, 20, 20, 0.125, 0.800, 0.800] +def test_get_format_for_custom_chip(): + fmt = get_format("6") + assert fmt == [1, 1, 20, 20, 0.1, 0, 0] + + @patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1.os") @patch( "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1.open", From 4a62346022ba9613bfaac1de592ce0cc3c2e3140 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Tue, 20 Jun 2023 10:21:39 +0100 Subject: [PATCH 40/47] Add test for tot number of images calculation in ft --- .../serial/fixed-target/test_ft_collect.py | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/tests/I24/serial/fixed-target/test_ft_collect.py b/tests/I24/serial/fixed-target/test_ft_collect.py index b89dd540c..b9bff1295 100644 --- a/tests/I24/serial/fixed-target/test_ft_collect.py +++ b/tests/I24/serial/fixed-target/test_ft_collect.py @@ -1,10 +1,61 @@ +from unittest.mock import mock_open, patch + import pytest from mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1 import ( + datasetsizei24, get_chip_prog_values, get_prog_num, ) +params = { + "chip_name": "chip", + "visit": "foo", + "sub_dir": "bar", + "n_exposures": 1, + "chip_type": "1", + "map_type": "1", + "pump_repeat": "0", + "pumpexptime": 0, + "pumpdelay": 0, + "exptime": 0.01, + "dcdetdist": 100, + "prepumpexptime": 0, + "det_type": "eiger", +} + + +chipmap_str = """01status P3011 1 +02status P3021 0 +03status P3031 0 +04status P3041 0""" + + +@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caput") +@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caget") +@patch( + "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.scrape_parameter_file" +) +def test_datasetsizei24_for_one_block_and_two_exposures( + fake_params, fake_caget, fake_caput +): + fake_params.return_value = tuple(params.values()) + fake_caget.return_value = 2 + with patch( + "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.open", + mock_open(read_data=chipmap_str), + ): + tot_num_imgs = datasetsizei24() + assert tot_num_imgs == 800 + + +@patch( + "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.scrape_parameter_file" +) +def test_start_i24(fake_params): + fake_params.return_value = tuple(params.values()) + pass + def test_get_chip_prog_values(): chip_dict = get_chip_prog_values( From 6ec523a0f4832102758850324a6e39e477367178 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Tue, 20 Jun 2023 13:27:20 +0100 Subject: [PATCH 41/47] Add test for start_i24 in ft --- .../serial/fixed-target/test_ft_collect.py | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/tests/I24/serial/fixed-target/test_ft_collect.py b/tests/I24/serial/fixed-target/test_ft_collect.py index b9bff1295..f3f13b0f5 100644 --- a/tests/I24/serial/fixed-target/test_ft_collect.py +++ b/tests/I24/serial/fixed-target/test_ft_collect.py @@ -6,6 +6,7 @@ datasetsizei24, get_chip_prog_values, get_prog_num, + start_i24, ) params = { @@ -49,14 +50,6 @@ def test_datasetsizei24_for_one_block_and_two_exposures( assert tot_num_imgs == 800 -@patch( - "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.scrape_parameter_file" -) -def test_start_i24(fake_params): - fake_params.return_value = tuple(params.values()) - pass - - def test_get_chip_prog_values(): chip_dict = get_chip_prog_values( "1", @@ -84,3 +77,24 @@ def test_get_chip_prog_values(): ) def test_get_prog_number(chip_type, map_type, pump_repeat, expected_prog): assert get_prog_num(chip_type, map_type, pump_repeat) == expected_prog + + +@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.datasetsizei24") +@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.DCID") +@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caput") +@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.caget") +@patch("mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.sup") +@patch( + "mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_Collect_py3v1.scrape_parameter_file" +) +def test_start_i24_with_eiger( + fake_params, fake_sup, fake_caget, fake_caput, fake_dcid, fake_size +): + fake_size.return_value = 800 + fake_params.return_value = tuple(params.values()) + start_i24() + assert fake_sup.beamline.call_count == 2 + assert fake_sup.eiger.call_count == 1 + # Pilatus gets called for hack to create directory + assert fake_sup.pilatus.call_count == 2 + assert fake_dcid.call_count == 1 From 7ad138e28dc9a3931b90f39c7e99d2777bdaffe3 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Tue, 20 Jun 2023 15:00:53 +0100 Subject: [PATCH 42/47] Add tests --- .../serial/fixed-target/test_chip_startup.py | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/I24/serial/fixed-target/test_chip_startup.py b/tests/I24/serial/fixed-target/test_chip_startup.py index f13f7674f..b7469720a 100644 --- a/tests/I24/serial/fixed-target/test_chip_startup.py +++ b/tests/I24/serial/fixed-target/test_chip_startup.py @@ -1,9 +1,12 @@ from unittest.mock import mock_open, patch +import pytest + from mx_bluesky.I24.serial.fixed_target.i24ssx_Chip_StartUp_py3v1 import ( check_files, fiducials, get_format, + pathli, scrape_parameter_file, ) @@ -57,3 +60,21 @@ def test_get_format_for_custom_chip(): ) def test_check_files(mock_os): check_files("i24", [".a", ".b"]) + + +@pytest.mark.parametrize( + "list_in, way, reverse, expected_res", + [ + ( + [1, 2, 3], + "typewriter", + False, + [1, 2, 3] * 3, + ), # Result should be list * len(list) + ([1, 2, 3], "typewriter", True, [3, 2, 1] * 3), # list[::-1] * len(list) + ([4, 5], "snake", False, [4, 5, 5, 4]), # Snakes the list + ([4, 5], "expand", False, [4, 4, 5, 5]), # Repeats each value + ], +) +def test_pathli(list_in, way, reverse, expected_res): + assert pathli(list_in, way, reverse) == expected_res From ac2a8520eb4534f2f116ad5285142f300bb92990 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 21 Jun 2023 15:12:59 +0100 Subject: [PATCH 43/47] Reverse accidental change to vscode settings --- .vscode/settings.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 29abf6478..2472acfd6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,13 +6,10 @@ "python.testing.pytestArgs": [], "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, - "python.formatting.provider": "none", + "python.formatting.provider": "black", "python.languageServer": "Pylance", "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.organizeImports": true - }, - "[python]": { - "editor.defaultFormatter": "ms-python.black-formatter" } } \ No newline at end of file From 58c4b402685dac6fcba0162987469812dcd460dc Mon Sep 17 00:00:00 2001 From: Noemi Frisina <54588199+noemifrisina@users.noreply.github.com> Date: Wed, 21 Jun 2023 15:14:48 +0100 Subject: [PATCH 44/47] Update src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py Co-authored-by: Tom Willemsen --- .../I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index fc5042fa6..fb9d2358f 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -902,7 +902,7 @@ def fiducial(point: int, param_path: Path | str = PARAM_FILE_PATH_FT): logger.info("%s MTR2\t%1.4f\t%i\t%i\t%1.4f" % (name, rbv_2, raw_2, mtr2_dir, f_y)) logger.info("%s MTR3\t%1.4f\t%i\t%i\t%1.4f" % (name, rbv_3, raw_3, mtr3_dir, f_y)) - with open(param_path / f"fiducial_{point}txt", "w") as f: + with open(param_path / f"fiducial_{point}.txt", "w") as f: f.write("MTR\tRBV\tRAW\tCorr\tf_value\n") f.write("MTR1\t%1.4f\t%i\t%i\t%1.4f\n" % (rbv_1, raw_1, mtr1_dir, f_x)) f.write("MTR2\t%1.4f\t%i\t%i\t%1.4f\n" % (rbv_2, raw_2, mtr2_dir, f_y)) From 2647993741c600c392959782e6ead476628ee6f8 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 21 Jun 2023 15:19:32 +0100 Subject: [PATCH 45/47] Make suggested changes in manager --- .../I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index fb9d2358f..28fbacc6b 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -310,9 +310,9 @@ def upload_full(fullmap_path: Path | str = FULLMAP_PATH): with open(fullmap_path / "currentchip.full", "r") as fh: f = fh.readlines() - for _ in range(len(f) // 2): + for i in range(len(f) // 2): pmac_list = [] - for _ in range(2): + for j in range(2): pmac_list.append(f.pop(0).rstrip("\n")) writeline = " ".join(pmac_list) print(writeline) @@ -1240,7 +1240,7 @@ def main(args): else: print("Unknown Command") - logger.warning("Unknown Command" % name) + logger.warning("%s Unknown Command" % name) if __name__ == "__main__": From d374452c1426356d888769c3c37af507d97087e7 Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 21 Jun 2023 15:30:18 +0100 Subject: [PATCH 46/47] Avoid too much isinstance repetition --- .../extruder/i24ssx_Extruder_Collect_py3v2.py | 12 ++++-- .../fixed_target/i24ssx_Chip_Manager_py3v1.py | 39 ++++++++----------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py index 406f4fce7..fb423e3f1 100755 --- a/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py +++ b/src/mx_bluesky/I24/serial/extruder/i24ssx_Extruder_Collect_py3v2.py @@ -35,6 +35,12 @@ def flush_print(text): sys.stdout.flush() +def _coerce_to_path(path: Path | str) -> Path: + if not isinstance(path, Path): + return Path(path) + return path + + def initialise_extruderi24(args=None): name = inspect.stack()[0][3] print("Initialise Parameters for extruder data collection") @@ -92,8 +98,7 @@ def moveto(args): def write_parameter_file(param_path: Path | str = PARAM_FILE_PATH): name = inspect.stack()[0][3] - if not isinstance(param_path, Path): - param_path = Path(param_path) + param_path = _coerce_to_path(param_path) param_fid = "parameters.txt" logger.info("%s Writing Parameter File \n%s" % (name, param_path / param_fid)) @@ -161,8 +166,7 @@ def write_parameter_file(param_path: Path | str = PARAM_FILE_PATH): def scrape_parameter_file(param_path: Path | str = PARAM_FILE_PATH): - if not isinstance(param_path, Path): - param_path = Path(param_path) + param_path = _coerce_to_path(param_path) with open(param_path / "parameters.txt", "r") as filein: f = filein.readlines() diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index 28fbacc6b..c800c52d7 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -29,6 +29,12 @@ logger = logging.getLogger("I24ssx.chip_manager") +def _coerce_to_path(path: Path | str) -> Path: + if not isinstance(path, Path): + return Path(path) + return path + + def setup_logging(): # Log should now change name daily. logfile = time.strftime("i24_%Y_%m_%d.log").lower() @@ -99,8 +105,7 @@ def initialise(): def write_parameter_file(param_path: Path | str = PARAM_FILE_PATH_FT): name = inspect.stack()[0][3] - if not isinstance(param_path, Path): - param_path = Path(param_path) + param_path = _coerce_to_path(param_path) param_fid = "parameters.txt" logger.info("%s Writing Parameter File \n%s" % (name, param_path / param_fid)) @@ -181,8 +186,7 @@ def write_parameter_file(param_path: Path | str = PARAM_FILE_PATH_FT): def scrape_pvar_file(fid: str, pvar_dir: Path | str = PVAR_FILE_PATH): block_start_list = [] - if not isinstance(pvar_dir, Path): - pvar_dir = Path(pvar_dir) + pvar_dir = _coerce_to_path(pvar_dir) with open(pvar_dir / fid, "r") as f: lines = f.readlines() @@ -221,8 +225,7 @@ def define_current_chip(chipid: str, param_path: Path | str = PVAR_FILE_PATH): elif chipid == "oxford": caput(pv.me14e_gp1, 1) - if not isinstance(param_path, Path): - param_path = Path(param_path) + param_path = _coerce_to_path(param_path) with open(param_path / f"{chipid}.pvar", "r") as f: logger.info("%s Opening %s%s.pvar" % (name, param_path, chipid)) @@ -239,8 +242,7 @@ def define_current_chip(chipid: str, param_path: Path | str = PVAR_FILE_PATH): def save_screen_map(litemap_path: Path | str = LITEMAP_PATH): name = inspect.stack()[0][3] - if not isinstance(litemap_path, Path): - litemap_path = Path(litemap_path) + litemap_path = _coerce_to_path(litemap_path) print("\n\nSaving", litemap_path / "currentchip.map") logger.info("%s Saving %s currentchip.map" % (name, litemap_path)) @@ -269,8 +271,7 @@ def upload_parameters(chipid: str, litemap_path: Path | str = LITEMAP_PATH): elif chipid == "oxford": caput(pv.me14e_gp1, 1) width = 8 - if not isinstance(litemap_path, Path): - litemap_path = Path(litemap_path) + litemap_path = _coerce_to_path(litemap_path) with open(litemap_path / "currentchip.map", "r") as f: print("chipid", chipid) @@ -304,8 +305,7 @@ def upload_parameters(chipid: str, litemap_path: Path | str = LITEMAP_PATH): def upload_full(fullmap_path: Path | str = FULLMAP_PATH): name = inspect.stack()[0][3] - if not isinstance(fullmap_path, Path): - fullmap_path = Path(fullmap_path) + fullmap_path = _coerce_to_path(fullmap_path) with open(fullmap_path / "currentchip.full", "r") as fh: f = fh.readlines() @@ -591,8 +591,7 @@ def load_lite_map(litemap_path: Path | str = LITEMAP_PATH): # print button_name, btn_names[button_name] block_dict = btn_names - if not isinstance(litemap_path, Path): - litemap_path = Path(litemap_path) + litemap_path = _coerce_to_path(litemap_path) litemap_fid = str(caget(pv.me14e_gp5)) + ".lite" print("Please wait, loading LITE map") @@ -632,8 +631,7 @@ def load_full_map(location: str = "SACLA", fullmap_path: Path | str = FULLMAP_PA chip_type, map_type, ) = startup.scrape_parameter_file(location) - if not isinstance(fullmap_path, Path): - fullmap_path = Path(fullmap_path) + fullmap_path = _coerce_to_path(fullmap_path) fullmap_fid = fullmap_path / f"{str(caget(pv.me14e_gp5))}.spec" print("opening", fullmap_fid) @@ -845,8 +843,7 @@ def moveto(place): def scrape_mtr_directions(param_path: Path | str = PARAM_FILE_PATH_FT): name = inspect.stack()[0][3] - if not isinstance(param_path, Path): - param_path = Path(param_path) + param_path = _coerce_to_path(param_path) with open(param_path / "motor_direction.txt", "r") as f: lines = f.readlines() @@ -869,8 +866,7 @@ def scrape_mtr_directions(param_path: Path | str = PARAM_FILE_PATH_FT): def fiducial(point: int, param_path: Path | str = PARAM_FILE_PATH_FT): name = inspect.stack()[0][3] scale = 10000.0 # noqa: F841 - if not isinstance(param_path, Path): - param_path = Path(param_path) + param_path = _coerce_to_path(param_path) mtr1_dir, mtr2_dir, mtr3_dir = scrape_mtr_directions(param_path) @@ -911,8 +907,7 @@ def fiducial(point: int, param_path: Path | str = PARAM_FILE_PATH_FT): def scrape_mtr_fiducials(point: int, param_path: Path | str = PARAM_FILE_PATH_FT): - if not isinstance(param_path, Path): - param_path = Path(param_path) + param_path = _coerce_to_path(param_path) with open(param_path / f"fiducial_{point}.txt", "r") as f: f_lines = f.readlines()[1:] From 586ed8461c4b20166c24b4c7e2741bb2dbd8c03a Mon Sep 17 00:00:00 2001 From: Noemi Frisina Date: Wed, 21 Jun 2023 15:42:42 +0100 Subject: [PATCH 47/47] Use shutil for copying file --- .../I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py index c800c52d7..18d615cf2 100755 --- a/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py +++ b/src/mx_bluesky/I24/serial/fixed_target/i24ssx_Chip_Manager_py3v1.py @@ -6,7 +6,7 @@ import inspect import logging -import os +import shutil import sys import time from pathlib import Path @@ -639,12 +639,9 @@ def load_full_map(location: str = "SACLA", fullmap_path: Path | str = FULLMAP_PA mapping.plot_file(fullmap_fid, chip_type) print("\n\n", 10 * "PNG ") mapping.convert_chip_to_hex(fullmap_fid, chip_type) - os.system( - "cp %s %s" - % (fullmap_fid.with_suffix(".full"), fullmap_path / "currentchip.full") - ) + shutil.copy2(fullmap_fid.with_suffix(".full"), fullmap_path / "currentchip.full") logger.info( - "%s cp %s %s" + "%s copying %s to %s" % (name, fullmap_fid.with_suffix(".full"), fullmap_path / "currentchip.full") ) print(10 * "Done ", "\n")