diff --git a/.gitignore b/.gitignore index 5bf8e751..7f150733 100644 --- a/.gitignore +++ b/.gitignore @@ -118,7 +118,8 @@ cls/data_io/suitcase_nxstxm_TODEL/ cls/scan_engine/bluesky/tests/tst_output/ -version.json +**/version.json + /sphinx/_build/ /sphinx/_build/ diff --git a/bcm/backend.py b/bcm/backend.py index e8b68927..77955da5 100644 --- a/bcm/backend.py +++ b/bcm/backend.py @@ -5,4 +5,4 @@ # set the backend that should be used -BACKEND='zmq' \ No newline at end of file +BACKEND='epics' \ No newline at end of file diff --git a/bcm/devices/__init__.py b/bcm/devices/__init__.py index 2dc3c168..5d560d0a 100644 --- a/bcm/devices/__init__.py +++ b/bcm/devices/__init__.py @@ -70,6 +70,13 @@ def print_flds(slf, _attrs, _attr_lst=None): f.close() +# make sure sim devices are available +from bcm.devices.sim.sim_base_device import BaseSimDevice +from bcm.devices.sim.sim_base_object import BaseSimObject +from bcm.devices.sim.sim_binary_out import SimBo +from bcm.devices.sim.sim_multi_bit_binary_out import SimMbbo +from bcm.devices.sim.energy_dev import EnergyDevice + if USE_EPICS: from .epics.base import BaseDevice from .epics.aio import basedevice as basedevice diff --git a/bcm/devices/ophyd/e712_wavegen/e712.ini b/bcm/devices/ophyd/e712_wavegen/e712.ini index e6051707..71a4ad65 100644 --- a/bcm/devices/ophyd/e712_wavegen/e712.ini +++ b/bcm/devices/ophyd/e712_wavegen/e712.ini @@ -1,22 +1,22 @@ { - "dwell": 10.0, - "fpath": "e712.ini", + "dwell": 1.0000000474974513, + "fpath": "/mnt/srv-unix-home/sm-user/git_sandbox/branches/40/pyStxm/bcm/devices/ophyd/e712_wavegen/e712.ini", "line_accrange": 1.5, - "line_return_time": 0.2, + "line_return_time": 0.5, "line_start_delay": 0.03, "line_step_time": 0.005, "line_trig_time": 0.03, "line_updown_time": 0.005, "max_rcv_bytes": 16384.0, "max_sock_timeout": 1.0, - "mode": 1, - "numX": 25, - "numY": 25, + "mode": 0, + "numX": 100, + "numY": 100, "pnt_start_delay": 0.0, "pnt_step_time": 0.001, "pnt_updown_time": 0.001, - "startX": -5.0, - "startY": -5.0, - "stopX": 5.0, - "stopY": 5.0 + "startX": 1507.2386474609375, + "startY": -1274.4219970703125, + "stopX": 1517.2386474609375, + "stopY": -1264.4219970703125 } \ No newline at end of file diff --git a/bcm/devices/ophyd/motor.py b/bcm/devices/ophyd/motor.py index 65a025b9..14e50212 100644 --- a/bcm/devices/ophyd/motor.py +++ b/bcm/devices/ophyd/motor.py @@ -113,6 +113,8 @@ class MotorQt(EpicsMotor, QObject): raw_val = Cpt(EpicsSignal, ".RVAL", kind="omitted") foff = Cpt(EpicsSignal, ".FOFF", kind="omitted") + _emit_move = pyqtSignal(float, bool) # a signal to call move from a sig handler in a thread safe way + # the following is here for compatability with e712_sample_motor def __init__(self, *args, **kwargs): @@ -209,6 +211,18 @@ def __init__(self, *args, **kwargs): self.add_callback('user_readback', self._on_pv_changed) + self._emit_move.connect(self.move) + + def call_emit_move(self, position, wait=True, kwargs={}): + """ + a thread safe way to call move from a signal handler + :param position: + :param wait: + :param kwargs: + :return: + """ + self._emit_move.emit(position, wait) + def is_connected(self): """ @@ -556,141 +570,6 @@ def within_limits(self, val): return (val <= self.get(hl_name) and val >= self.get(ll_name)) # def move(self, position=None, relative=False, wait=False, timeout=300.0, - # dial=False, step=False, raw=False, - # ignore_limits=False, confirm_move=False): - # """ - # arguments: - # ========== - # val value to move to (float) [Must be provided] - # relative move relative to current position (T/F) [F] - # wait whether to wait for move to complete (T/F) [F] - # dial use dial coordinates (T/F) [F] - # raw use raw coordinates (T/F) [F] - # step use raw coordinates (backward compat)(T/F) [F] - # ignore_limits try move without regard to limits (T/F) [F] - # confirm_move try to confirm that move has begun (T/F) [F] - # timeout max time for move to complete (in seconds) [300] - # - # return values: - # -13 : invalid value (cannot convert to float). Move not attempted. - # -12 : target value outside soft limits. Move not attempted. - # -11 : drive PV is not connected: Move not attempted. - # -8 : move started, but timed-out. - # -7 : move started, timed-out, but appears done. - # -5 : move started, unexpected return value from PV.put() - # -4 : move-with-wait finished, soft limit violation seen - # -3 : move-with-wait finished, hard limit violation seen - # 0 : move-with-wait finish OK. - # 0 : move-without-wait executed, not cpmfirmed - # 1 : move-without-wait executed, move confirmed - # 3 : move-without-wait finished, hard limit violation seen - # 4 : move-without-wait finished, soft limit violation seen - # """ - # if self.within_limits(position): - # super().move(position, wait=wait)#, wait=wait, timeout=timeout, - # # dial=dial, step=step, raw=raw, - # # ignore_limits=ignore_limits, confirm_move=confirm_move) - # return 0 - # else: - # _logger.error(f"{self.name}: Move to [{position}] would violate the limits") - # return -12 - - - # - # def move(self, val=None, relative=False, wait=False, timeout=300.0, - # dial=False, step=False, raw=False, - # ignore_limits=False, confirm_move=False): - # """ moves motor drive to position - # - # arguments: - # ========== - # val value to move to (float) [Must be provided] - # relative move relative to current position (T/F) [F] - # wait whether to wait for move to complete (T/F) [F] - # dial use dial coordinates (T/F) [F] - # raw use raw coordinates (T/F) [F] - # step use raw coordinates (backward compat)(T/F) [F] - # ignore_limits try move without regard to limits (T/F) [F] - # confirm_move try to confirm that move has begun (T/F) [F] - # timeout max time for move to complete (in seconds) [300] - # - # return values: - # -13 : invalid value (cannot convert to float). Move not attempted. - # -12 : target value outside soft limits. Move not attempted. - # -11 : drive PV is not connected: Move not attempted. - # -8 : move started, but timed-out. - # -7 : move started, timed-out, but appears done. - # -5 : move started, unexpected return value from PV.put() - # -4 : move-with-wait finished, soft limit violation seen - # -3 : move-with-wait finished, hard limit violation seen - # 0 : move-with-wait finish OK. - # 0 : move-without-wait executed, not cpmfirmed - # 1 : move-without-wait executed, move confirmed - # 3 : move-without-wait finished, hard limit violation seen - # 4 : move-without-wait finished, soft limit violation seen - # - # """ - # step = step or raw - # - # NONFLOAT, OUTSIDE_LIMITS, UNCONNECTED = -13, -12, -11 - # TIMEOUT, TIMEOUT_BUTDONE = -8, -7 - # UNKNOWN_ERROR = -5 - # DONEW_SOFTLIM, DONEW_HARDLIM = -4, -3 - # DONE_OK = 0 - # MOVE_BEGUN, MOVE_BEGUN_CONFIRMED = 0, 1 - # NOWAIT_SOFTLIM, NOWAIT_HARDLIM = 4, 3 - # try: - # val = float(val) - # except TypeError: - # return NONFLOAT - # - # drv, rbv = ('setpoint', 'readback') - # - # if relative: - # val += self.get(drv) - # - # # Check for limit violations - # if not ignore_limits and not step: - # if not self.within_limits(val): - # return OUTSIDE_LIMITS - # - # if (self._collision_support): - # stat = self.put('check_tr.A', val, wait=wait, timeout=timeout) - # else: - # stat = self.put(drv, val, wait=wait, timeout=timeout) - # - # if stat is None: - # return UNCONNECTED - # - # if wait and stat == -1: # move started, exceeded timeout - # if self.get('DMOV') == 0: - # return TIMEOUT - # return TIMEOUT_BUTDONE - # if 1 == stat: - # if wait: # ... and finished OK - # if 1 == self.get('soft_limit'): - # return DONEW_SOFTLIM - # elif 1 == self.get('high_limit_set') or 1 == self.get('low_limit_set'): - # return DONEW_HARDLIM - # return DONE_OK - # else: - # if 1 == self.get('soft_limit') or confirm_move: - # ca.poll(evt=1.e-2) - # moving = False - # if confirm_move: - # t0 = time.time() - # while self.get('MOVN') == 0: - # ca.poll(evt=1.e-3) - # if time.time() - t0 > 0.25: break - # if 1 == self.get('MOVN'): - # return MOVE_BEGUN_CONFIRMED - # elif 1 == self.get('soft_limit'): - # return NOWAIT_SOFTLIM - # elif 1 == self.get('high_limit_set') or 1 == self.get('low_limit_set'): - # return NOWAIT_HARDLIM - # else: - # return MOVE_BEGUN - # return UNKNOWN_ERROR # def confirm_stopped(self): t = 0 @@ -730,14 +609,7 @@ def wait_for_stopped_and_zero(self): self.set_position(0.0) # print '%s setting zero' % self.signal_name - # def move_and_set_position(self, pos, setpos): - # self.move(pos) - # # print 'waiting for %s to stop' % self.signal_name - # self.confirm_stopped() - # # print '%s has now stopped' % self.signal_name - # self.set_position(setpos) - # # print '%s setting zero' % self.signal_name - # + class MotorLimitException(Exception): @@ -762,7 +634,8 @@ def __str__(self): return str(self.msg) -class EnergyMotor(EpicsMotor): +# class EnergyMotor(EpicsMotor): +class EnergyMotor(MotorQt): """just a convienience class so that PVs can be configured in the beamline configuration file and used as if they were other devices, making the rest of the code cleaner """ @@ -849,8 +722,8 @@ def __init__(self, *args, **kwargs): # app = QtWidgets.QApplication(sys.argv) # m = Motor_Qt('SIM_IOC:m704', name='m704', pos_set=1, collision_support=False, report_fields= True ) - zpz = MotorQt("SIM_IOC:m704", name="zpz_mtr") - zp1 = Zoneplate("MYZONER", "zp1", zpz, -4.839514, 100, 45, 60) + #zpz = MotorQt("SIM_IOC:m704", name="zpz_mtr") + zp1 = Zoneplate("MYZONER", "zp1", "a1", -4.839514, 100, 45, 60) zp2 = Zoneplate("MYZONER", "zp2", zpz, -6.791682, 240, 90, 35) zp3 = Zoneplate("MYZONER", "zp3", zpz, -7.76662, 240, 90, 40) zp4 = Zoneplate("MYZONER", "zp4", zpz, -4.524239, 140, 60, 40) diff --git a/bcm/devices/ophyd/stxm_sample_mtr.py b/bcm/devices/ophyd/stxm_sample_mtr.py index 1beefb04..49ddbc11 100644 --- a/bcm/devices/ophyd/stxm_sample_mtr.py +++ b/bcm/devices/ophyd/stxm_sample_mtr.py @@ -315,7 +315,7 @@ def do_interferometer_check(self): d_rng = math.fabs(cfbk - ffbk) if d_rng > self.min_interfer_reset_range: - print(f"do_interferometer_check: (delta range) {d_rng} > {self.min_interfer_reset_range}(MIN_INTERFER_RESET_RANGE_UM) range too large Resetting interferometer") + print(f"do_interferometer_check: (delta range coarse to fine fbk) {d_rng} > {self.min_interfer_reset_range}(MIN_INTERFER_RESET_RANGE_UM) range too large Resetting interferometer") self.reset_interferometers() #if we did a reset, loop here until the feedbacks match diff --git a/bcm/devices/ophyd/zoneplate.py b/bcm/devices/ophyd/zoneplate.py index 2039265c..35fbd192 100644 --- a/bcm/devices/ophyd/zoneplate.py +++ b/bcm/devices/ophyd/zoneplate.py @@ -98,45 +98,10 @@ def unstage(self): st.set_finished() return st - # def calc_new_zpz_pos(self): - # A = self.energy.get() - # # "Delta zpz frm focus" - # B = 0 #self.delta_zpz_from_focus.get() - # #"scantype flag" - # C = 1 #self.scantype_flag.get() - # # "A1" - # D = self.a1.get() - # #"Defocus (um)" - # E = 0 #self.defocus.get() - # # "A0 setpoint" - # F = 1000 #self.ao_setpoint.get() - # # "delta A0" - # G = 0 #self.delta_a0.get() - # # "theo FL" - # H = 0 #self.theoretical_fl.get() - # # "adjust zpz" - # I = 0 #self.adjust_zpz.get() - # - # # "new osaz" - # K = new_osa_z = ((-1.0*F)-E)+G - # # "FL mode0" - # L = FL_mode_0 = ((A*D)-abs(F))+G-I - # # "FL mode1" - # M = FL_mode_1 = ((A*D)-E)+G-I - # - # # "Zpz MTR OUT" - # if C == 0: - # N = new_zpz = L - # else: - # N = new_zpz = M - # # "set clcd FL" - # O = new_fl = A*D - # - # self.zpz_posner.put('user_setpoint', new_zpz) def calc_new_zpz_pos(self): A = self.energy.get() - print("A energy = %.2f" % A) + print("A energy = %.2f:" % A) # "Delta zpz frm focus" B = 0 # self.delta_zpz_from_focus.get() # "scantype flag" @@ -156,24 +121,24 @@ def calc_new_zpz_pos(self): # "new osaz" K = new_osa_z = ((-1.0 * F) - E) + G - print("K new osa Z: %.2f" % K) + print("\tK new osa Z: %.2f" % K) # "FL mode0" L = FL_mode_0 = ((A * D) - abs(F)) + G - I - print("L new FL mode0: %.2f" % L) + print("\tL new FL mode0 (OSA Focused): %.2f" % L) # "FL mode1" M = FL_mode_1 = ((A * D) - E) + G - I - print("M new FL mode1: %.2f" % M) + print("\tM new FL mode1 (Sample Focussed): %.2f" % M) # "set clcd FL" O = new_fl = A * D - print("N new FL: %.2f" % O) + print("\tN new FL: %.2f" % O) # "Zpz MTR OUT" if C == 0: N = new_zpz = L else: N = new_zpz = M - print("N new ZPZ pos: %.2f" % N) + print("\tN new ZPZ pos: %.2f\n\n" % N) self.zpz_posner.put("user_setpoint", new_zpz) def put(self, val): @@ -212,7 +177,7 @@ def stop(self, *, success): bec = BestEffortCallback() # Send all metadata/data captured to the BestEffortCallback. - RE.subscribe(bec) + # RE.subscribe(bec) from databroker import Broker db = Broker.named("pystxm_amb_bl10ID1") @@ -222,19 +187,30 @@ def stop(self, *, success): # install_kicker() - zpz = MotorQt("SIM_IOC:m704", name="SIM_IOC:m704") - energy = MotorQt("SIM_VBL1610-I10:AMB:ENERGY", name="SIM_VBL1610-I10:AMB:ENERGY") - - zp1 = Zoneplate("MYZONER", "zp1", zpz, -4.839514, 100, 45, 60) - zp2 = Zoneplate("MYZONER", "zp2", zpz, -6.791682, 240, 90, 35) - zp3 = Zoneplate("MYZONER", "zp3", zpz, -7.76662, 240, 90, 40) - zp4 = Zoneplate("MYZONER", "zp4", zpz, -4.524239, 140, 60, 40) - zp5 = Zoneplate("MYZONER", "zp5", zpz, -4.85874, 240, 95, 25) - zp6 = Zoneplate("MYZONER", "zp6", zpz, -4.85874, 240, 95, 25) - zp7 = Zoneplate("MYZONER", "zp7", zpz, -5.0665680, 250, 100, 25) - zp8 = Zoneplate("MYZONER", "zp8", zpz, 0, 240, 100, 63.79) + #cz = MotorQt("SMTR1610-3-I12:47", name="DNM_COARSE_Z") + # zpz = MotorQt("SMTR1610-3-I12:51", name="DNM_ZONEPLATE_Z") + zpz = MotorQt("SIM_VBL1610-I12:slitX", name="DNM_ZONEPLATE_Z") + energy = MotorQt("SIM_VBL1610-I12:ENERGY", name="SIM_VBL1610-I12:ENERGY") + + zoneplate_lst = [ + {'name': 'ZonePlate 0', 'zp_id': 0, 'a1': -4.840, 'D': 100.0, 'CsD': 45.0, 'OZone': 60.0}, + {'name': 'ZonePlate 1', 'zp_id': 1, 'a1': -6.792, 'D': 240.0, 'CsD': 90.0, 'OZone': 35.0}, + {'name': 'ZonePlate 2', 'zp_id': 2, 'a1': -7.767, 'D': 240.0, 'CsD': 90.0, 'OZone': 40.0}, + {'name': 'ZonePlate 3', 'zp_id': 3, 'a1': -4.524, 'D': 140.0, 'CsD': 60.0, 'OZone': 40.0}, + {'name': 'ZonePlate 4', 'zp_id': 4, 'a1': -4.859, 'D': 240.0, 'CsD': 95.0, 'OZone': 25.0}, + {'name': 'ZonePlate 5', 'zp_id': 5, 'a1': -4.857, 'D': 240.0, 'CsD': 95.0, 'OZone': 25.0}, + {'name': 'ZonePlate 6', 'zp_id': 6, 'a1': -5.067, 'D': 250.0, 'CsD': 100.0, 'OZone': 25.0}, + {'name': 'ZonePlate 7', 'zp_id': 7, 'a1': -6.789, 'D': 159.0, 'CsD': 111.0, 'OZone': 35.0}, + {'name': 'ZonePlate 8', 'zp_id': 8, 'a1': -35.835, 'D': 5000.0, 'CsD': 111.0, 'OZone': 35.0}, + {'name': 'ZonePlate 9', 'zp_id': 9, 'a1': -11.358981, 'D': 280.0, 'CsD': 100.0, 'OZone': 50.0}, + ] + + zp_objs = [] + for i, zp_def in enumerate(zoneplate_lst): + zp_objs.append(Zoneplate("MYZONER", f"zp{zp_def['zp_id']}", zpz, zp_def['a1'], zp_def['D'], zp_def['CsD'], zp_def['OZone'])) # zp1.set_energy(465) dets = [det1, det2, zpz] # just one in this case, but it could be more than one - RE(count(dets)) - RE(scan(dets, zp2, 260, 360, 10)) + # RE(count(dets)) + #RE(scan(dets, zp_objs[9], 395, 450, 3)) + RE(scan(dets, energy, 395, 450, 3)) diff --git a/bcm/devices/sim/__init__.py b/bcm/devices/sim/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/bcm/devices/sim/caproto_devs/__init__.py b/bcm/devices/sim/caproto_devs/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/bcm/sim/caproto/all_cosmic.py b/bcm/devices/sim/caproto_devs/all_cosmic.py similarity index 100% rename from bcm/sim/caproto/all_cosmic.py rename to bcm/devices/sim/caproto_devs/all_cosmic.py diff --git a/bcm/sim/caproto/all_in_one.py b/bcm/devices/sim/caproto_devs/all_in_one.py similarity index 100% rename from bcm/sim/caproto/all_in_one.py rename to bcm/devices/sim/caproto_devs/all_in_one.py diff --git a/bcm/sim/caproto/bl_server.py b/bcm/devices/sim/caproto_devs/bl_server.py similarity index 100% rename from bcm/sim/caproto/bl_server.py rename to bcm/devices/sim/caproto_devs/bl_server.py diff --git a/bcm/sim/caproto/bucket_extras.py b/bcm/devices/sim/caproto_devs/bucket_extras.py similarity index 100% rename from bcm/sim/caproto/bucket_extras.py rename to bcm/devices/sim/caproto_devs/bucket_extras.py diff --git a/bcm/sim/caproto/bucket_of_pvs.py b/bcm/devices/sim/caproto_devs/bucket_of_pvs.py similarity index 100% rename from bcm/sim/caproto/bucket_of_pvs.py rename to bcm/devices/sim/caproto_devs/bucket_of_pvs.py diff --git a/bcm/sim/caproto/fake_apd.py b/bcm/devices/sim/caproto_devs/fake_apd.py similarity index 100% rename from bcm/sim/caproto/fake_apd.py rename to bcm/devices/sim/caproto_devs/fake_apd.py diff --git a/bcm/sim/caproto/fake_apd_cosmic.py b/bcm/devices/sim/caproto_devs/fake_apd_cosmic.py similarity index 100% rename from bcm/sim/caproto/fake_apd_cosmic.py rename to bcm/devices/sim/caproto_devs/fake_apd_cosmic.py diff --git a/bcm/sim/caproto/gen_templates.py b/bcm/devices/sim/caproto_devs/gen_templates.py similarity index 100% rename from bcm/sim/caproto/gen_templates.py rename to bcm/devices/sim/caproto_devs/gen_templates.py diff --git a/bcm/sim/caproto/inline.py b/bcm/devices/sim/caproto_devs/inline.py similarity index 100% rename from bcm/sim/caproto/inline.py rename to bcm/devices/sim/caproto_devs/inline.py diff --git a/bcm/sim/caproto/macros.py b/bcm/devices/sim/caproto_devs/macros.py similarity index 100% rename from bcm/sim/caproto/macros.py rename to bcm/devices/sim/caproto_devs/macros.py diff --git a/bcm/sim/caproto/macros_mine.py b/bcm/devices/sim/caproto_devs/macros_mine.py similarity index 100% rename from bcm/sim/caproto/macros_mine.py rename to bcm/devices/sim/caproto_devs/macros_mine.py diff --git a/bcm/sim/caproto/mock_records.py b/bcm/devices/sim/caproto_devs/mock_records.py similarity index 100% rename from bcm/sim/caproto/mock_records.py rename to bcm/devices/sim/caproto_devs/mock_records.py diff --git a/bcm/sim/caproto/mockrec_subclass.py b/bcm/devices/sim/caproto_devs/mockrec_subclass.py similarity index 97% rename from bcm/sim/caproto/mockrec_subclass.py rename to bcm/devices/sim/caproto_devs/mockrec_subclass.py index a06c947f..e10a7584 100644 --- a/bcm/sim/caproto/mockrec_subclass.py +++ b/bcm/devices/sim/caproto_devs/mockrec_subclass.py @@ -8,7 +8,7 @@ # Subclass the motor fields here. It's important to use this 'register_record' -# decorator to tell caproto where to find this record: +# decorator to tell caproto_devs where to find this record: @register_record class CustomMotorFields(MotorFields): # The custom fields are identified by this string, which is overridden from diff --git a/bcm/sim/caproto/my_bucket_of_pvs.py b/bcm/devices/sim/caproto_devs/my_bucket_of_pvs.py similarity index 98% rename from bcm/sim/caproto/my_bucket_of_pvs.py rename to bcm/devices/sim/caproto_devs/my_bucket_of_pvs.py index 4a9acb5c..579506a8 100644 --- a/bcm/sim/caproto/my_bucket_of_pvs.py +++ b/bcm/devices/sim/caproto_devs/my_bucket_of_pvs.py @@ -2,10 +2,8 @@ import os from caproto.server import pvproperty, PVGroup, template_arg_parser, run from cls.utils.dirlist import dirlist -from cls.utils.json_utils import json_to_dict, file_to_json, dict_to_json, json_to_file +from cls.utils.json_utils import json_to_dict, file_to_json import json -from epics import PV, dbr -import time def get_populated_motor_dict(field_path=None): @@ -302,8 +300,6 @@ def load_json_files(): if __name__ == "__main__": - from bcm.sim.caproto.txt_to_json import rd_txt_gen_json_files - # rd_txt_gen_json_files() parser, split_args = template_arg_parser( diff --git a/bcm/sim/caproto/mybucket2.py b/bcm/devices/sim/caproto_devs/mybucket2.py similarity index 100% rename from bcm/sim/caproto/mybucket2.py rename to bcm/devices/sim/caproto_devs/mybucket2.py diff --git a/bcm/sim/caproto/pv_server.py b/bcm/devices/sim/caproto_devs/pv_server.py similarity index 100% rename from bcm/sim/caproto/pv_server.py rename to bcm/devices/sim/caproto_devs/pv_server.py diff --git a/bcm/sim/caproto/test.py b/bcm/devices/sim/caproto_devs/test.py similarity index 100% rename from bcm/sim/caproto/test.py rename to bcm/devices/sim/caproto_devs/test.py diff --git a/bcm/sim/caproto/txt_to_json.py b/bcm/devices/sim/caproto_devs/txt_to_json.py similarity index 100% rename from bcm/sim/caproto/txt_to_json.py rename to bcm/devices/sim/caproto_devs/txt_to_json.py diff --git a/bcm/devices/sim/energy_dev.py b/bcm/devices/sim/energy_dev.py new file mode 100644 index 00000000..58ad3bbf --- /dev/null +++ b/bcm/devices/sim/energy_dev.py @@ -0,0 +1,672 @@ + +import time + +import math +from PyQt5 import QtCore, QtGui, QtWidgets + +from ophyd import Component as Cpt, Device +from ophyd.signal import Signal +from ophyd.status import DeviceStatus + + +ABS_MIN_A0 = 100.0 # Minimum allowable A0 +ABS_MAX_A0 = 5000.0 # Maximum allowable A0 + + +class Sigs(QtCore.QObject): + focus_params_changed = QtCore.pyqtSignal(dict) + + +class FocusCalculations(object): + """ + Class to handle focus calculations for zoneplates. + """ + def __init__(self, prefix, name='', parent=None): + super().__init__(parent, name=name) + self._sigs = Sigs() + self.focus_params_changed = self._sigs.focus_params_changed + self.zoneplate_def = {} + self.osa_def = {} + self.A0 = ABS_MAX_A0 + self.delta_A0 = 0.0 + self.zpz_adjust = 0.0 + self.min_A0 = ABS_MIN_A0 # Minimum allowable A0 + self.max_A0 = ABS_MAX_A0 + self._FL = 0.0 + self.zpz_for_osa_focussed = 0.0 + self.zpz_for_sample_focussed = 0.0 + self._defocus_beam_setpoint_um = 0.0 # desired defocus beam in micrometers + self._defocus_um = 0.0 # actual defocus calc result in micrometers + + def emit_focus_params_changed(self): + params = { + 'zoneplate_def': self.zoneplate_def, + 'osa_def': self.osa_def, + 'FL': self._FL, + 'min_A0': self.min_A0, + 'A0': self.A0, + 'max_A0': self.max_A0, + 'delta_A0': self.delta_A0, + 'zpz_adjust': self.zpz_adjust, + "defocus_beam_setpoint_um": self._defocus_beam_setpoint_um, + "defocus_beam_um": self._defocus_um, + "zpz_for_osa_focussed": self.zpz_for_osa_focussed, + "zpz_for_sample_focussed": self.zpz_for_sample_focussed, + } + self.focus_params_changed.emit(params) + + def update_min_a0(self, val: float): + """ + Update the min_A0 value + :param val: New ,min_A0 value + """ + if val < ABS_MIN_A0: + _logger.warn(f"Attempted to set min_A0 to {val}, which is below absolute minimum of {ABS_MIN_A0}. Setting to {ABS_MIN_A0}.") + else: + self.min_A0 = val + # self.emit_focus_params_changed() + + def calc_focal_length(self, energy): + """ + f = A1 * E + """ + + if energy and self.zoneplate_def: + if 'zpA1' in self.zoneplate_def: + # ignore the sign of A1 + f = math.fabs(self.zoneplate_def["zpA1"]) * energy + self._FL = f + # self.emit_focus_params_changed() + return f + else: + raise ValueError( + "Zoneplate definition does not contain 'zpA1' key and as such may not have been initialized yet with a zoneplate definition.") + + def get_focal_length_as_zpz_position(self) -> float: + """ + Get the current focal length (FL) + :return: Current focal length (FL) + """ + self._FL_as_zpz_pos = 0.0 - self._FL + if not self._FL_as_zpz_pos == 0.0: + self.emit_focus_params_changed() + return self._FL_as_zpz_pos + + def calc_delta_focus_position(self, energy: float, desired_focus_position: float) -> float: + """ + Calculate the change in focal length (delta_a0) required to achieve the desired focal length for a given energy. + :param desired_focal_length: Desired focal length + :param energy: Energy in eV + :return: Change in focal length (delta_a0) + """ + current_focal_length = 0.0 - (math.fabs(self.calc_focal_length(energy)) - (self.A0 + self.delta_A0)) + delta_focus_pos = desired_focus_position - current_focal_length + # self.update_a0_for_focus(delta_focus_pos) + return delta_focus_pos + + def calc_new_coarse_z_pos_for_focus(self, energy: float, cur_cz_pos: float, desired_focus_position: float) -> float: + """ + Calculate the new coarse z position needed to achieve focus at the desired focal length for a given energy. + :param cur_cz_pos: Current coarse z position + :param delta_a0: Change in focal length required to achieve focus + :return: New coarse z position + """ + delta_focus_pos = self.calc_delta_focus_position(energy, desired_focus_position) + new_cz_pos = cur_cz_pos - delta_focus_pos + return new_cz_pos + + def calc_new_zoneplate_z_pos_for_focus(self, energy: float) -> float: + """ + NOTE: Focal length is equal to OSA in focus, calc new zpz position for current energy, Ao and delta_A0 + + Calculate the new zoneplate z position needed to achieve focus at the desired focal length for a given energy. + :param focal_length: Desired focal length + :param a0: Current focal length + :param delta_a0: Change in focal length required to achieve focus + :return: New zoneplate z position + """ + focal_length = self.calc_focal_length(energy) + if focal_length: + new_zp_z_pos = 0.0 - math.fabs((focal_length + self._defocus_um) + self.zpz_adjust) + (self.A0 + self.delta_A0) + self.zpz_for_sample_focussed = new_zp_z_pos + self.emit_focus_params_changed() + return new_zp_z_pos + else: + return None + + def calc_new_zpz_for_osa_focussed(self, energy: float) -> float: + """ + Calculate the new zoneplate z position needed to achieve focus at the desired focal length for a given energy when OSA is focused. + :param energy: Energy in eV + :return: New zoneplate z position + """ + focal_length = self.calc_focal_length(energy) + if focal_length: + #new_zp_z_pos = 0.0 - (math.fabs(focal_length) - (self.zpz_adjust + self.delta_A0)) + new_zp_z_pos = 0.0 - math.fabs(focal_length + self._defocus_um) + self.zpz_for_osa_focussed = new_zp_z_pos + self.emit_focus_params_changed() + return new_zp_z_pos + else: + return None + + + +class EnergyDevice(FocusCalculations, Device): + """" + energy_dev_dict = { + "a0_dev": a0_dev, + "delta_a0_dev": delta_a0_dev, + "zpz_adjust_dev": zpz_adjust_dev, + "defocus_beam_dev": defocus_beam_dev, + "energy_posner": energy_posner, + "zpz_posner": zpz_posner, + "cz_posner": cz_posner + } + """ + + def __init__(self, prefix, name, energy_dev_dict=None): + super(EnergyDevice, self).__init__(prefix, name=name) + self.dcs_name = prefix + "_EnergyDevice" + + self.energy_posner = energy_dev_dict['energy_posner'] + self.zpz_posner = energy_dev_dict['zpz_posner'] + self.cz_posner = energy_dev_dict['cz_posner'] + + self.a0_dev = energy_dev_dict['a0_dev'] + self.delta_a0_dev = energy_dev_dict['delta_a0_dev'] + self.zpz_adjust_dev = energy_dev_dict['zpz_adjust_dev'] + self.defocus_beam_dev = energy_dev_dict['defocus_beam_dev'] + self.focal_len_dev = energy_dev_dict['focal_len_dev'] + self.zp_a1_dev = energy_dev_dict['zp_a1_dev'] + self.a0_max_dev = energy_dev_dict['a0_max_dev'] + self.calcd_zpz_dev = energy_dev_dict['calcd_zpz_dev'] + self.zp_focus_mode_dev = energy_dev_dict["zp_focus_mode_dev"] + + self._enable_fl_change_on_energy_change = True + self.focus_mode = 'OSA' # or 'SAMPLE' + self.FLMode_0 = 0.0 + self.FLMode_1 = 0.0 + + skip_lst = ['OphydAttrList', 'move', 'put', 'set', 'stop'] + for attr in dir(self.energy_posner): + if attr.startswith('_') or (attr in skip_lst): + continue + val = getattr(self.energy_posner, attr) + if attr.find("parent") > -1: + continue + if callable(val): + setattr(self, attr, val) + + + def get_name(self): + return self.name + + def update_focus_calcs(self): + """ + a function that can be called to make sure all relevant focus calcs are executed when a param changes + """ + energy = self.energy_posner.get_position() + self.calculate_focal_length(energy) + self.calc_new_zoneplate_z_pos_for_focus(energy) + self.update_cacld_zpz_pos() + self.calc_new_zpz_for_osa_focussed(energy) + + + def update_zp_def(self, zp_def: dict): + """ + Update the zoneplate definition + :param zp_def: New zoneplate definition + """ + self.zoneplate_def = zp_def + self.emit_focus_params_changed() + + def update_osa_def(self, osa_def: dict): + """ + Update the OSA definition + :param osa_def: New OSA definition + """ + self.osa_def = osa_def + self.emit_focus_params_changed() + + def get_a0(self) -> float: + """ + Get the current focal length (A0) + :return: Current focal length (A0) + """ + self.update_a0(self.a0_dev.get()) + return self.A0 + + def get_delta_a0(self) -> float: + """ + Get the current change in focal length (delta_a0) + :return: Current change in focal length (delta_a0) + """ + delta_a0 = self.delta_a0_dev.get() + self.update_delta_a0(delta_a0) + return delta_a0 + + def get_focal_length(self) -> float: + """ + Get the current focal length (FL) + :return: Current focal length (FL) + """ + return math.fabs(self._FL) + + def update_a0(self, a0: float): + """ + Update the a0 value + :param a0: New a0 value + """ + self.A0 = a0 + self.a0_dev.put(a0) + self.update_delta_a0(0.0) + self.update_focus_calcs() + + def update_delta_a0(self, delta_a0: float): + """ + Update the delta_a0 value + :param delta_a0: New delta_a0 value + """ + self.delta_A0 = delta_a0 + self.delta_a0_dev.put(delta_a0) + self.update_focus_calcs() + + def update_a0_for_focus(self, new_a0: float): + """ + Update the focal length (A0) to a new value, ensuring it is within allowable limits. + :param new_a0: New focal length (A0) + """ + + new_a0 = self.A0 + new_a0 + self.update_a0(new_a0) + self.update_focus_calcs() + + def update_cacld_zpz_pos(self): + """ + Update the calculated zpz position + :param val: New calculated zpz position + """ + new_zpz_pos = self.calc_new_zpz_pos("SAMPLE") + self.calcd_zpz_dev.put(new_zpz_pos) + + + def adjust_zpz(self, adjust: float): + """ + Adjust the zpz position offset + :param adjust: Adjustment value + """ + self.zpz_adjust = adjust + self.zpz_adjust_dev.put(adjust) + self.update_focus_calcs() + + def enable_fl_change_with_energy_change(self, enable: bool): + """ + Enable or disable automatic focal length change when energy changes. + :param enable: True to enable, False to disable + """ + self._enable_fl_change_on_energy_change = enable + + + def defocus_beam(self, defocus_um: float): + """ + Defocus the beam by a specified amount in micrometers. + :param defocus_um: Amount to defocus the beam in micrometers. + """ + self._defocus_beam_setpoint_um = defocus_um + zp_res = self.zoneplate_def['zpOZone'] + energy_val = self.energy_posner.get_position() + + # calc the actual defocus in um from the desired setpoint + self._defocus_um = (defocus_um * zp_res * energy_val) / 1239.8 + self.defocus_beam_dev.put(self._defocus_um) + # self.emit_focus_params_changed() + #self.calc_new_zpz_pos() + if self.focus_mode == 'OSA': + self.move_to_osa_focussed() + else: + self.move_to_sample_focussed() + self.update_focus_calcs() + + def calculate_focal_length(self, energy: float=None) -> float: + """ + Calculate and return the focal length for the given energy. + If no energy is provided, use the current energy from the energy positioner. + :param energy: Energy in eV + :return: Calculated focal length + """ + if energy is None: + energy = self.energy_posner.get() + + fl = self.calc_focal_length(energy) + self.focal_len_dev.put(fl) + return fl + + def set_focus_mode(self, mode: str): + """ + set focus mode to either 'OSA' or 'SAMPLE' + """ + if mode in ['OSA', 'SAMPLE']: + self.focus_mode = mode + + if mode == 'OSA': + self.zp_focus_mode_dev.put(0) + self.move_to_osa_focussed() + else: + self.zp_focus_mode_dev.put(1) + self.move_to_sample_focussed() + + self.update_focus_calcs() + else: + raise ValueError("Focus mode must be either 'OSA' or 'SAMPLE'") + + + def set_zp_def(self, zp_def: dict): + """ + set zoneplate definition from dict + """ + self.update_zp_def(zp_def) + zp_a1 = zp_def['zpA1'] + self.zp_a1_dev.put(zp_a1) + # update max_a0 + max_a0 = self.calc_max_a0() + self.a0_max_dev.put(max_a0) + + #update calcd zpz pos + self.update_cacld_zpz_pos() + + def set_osa_def(self, osa_def: dict): + """ + set osa definition from dict + """ + self.update_osa_def(osa_def) + max_a0 = self.calc_max_a0() + self.a0_max_dev.put(max_a0) + # update calcd zpz pos + self.update_cacld_zpz_pos() + + def get_new_zpz_for_osa_focussed(self, energy: float=None) -> float: + if energy is None: + energy = self.energy_posner.get() + + return self.calc_new_zpz_for_osa_focussed(energy) + + def report(self): + print("name = %s, type = %s" % (str(self.__class__), self.name)) + + def trigger(self): + st = super().trigger() + # #this put doesnt return until it is complete (the waveform generator is done) + # self.run.put(1, callback=st._finished) + return st + + def unstage(self): + st = super().unstage() + # self.run.put(0) + st = DeviceStatus(self) + st.set_finished() + return st + + def calc_max_a0(self) -> float: + """ + Defocus the beam by a specified amount in micrometers. + :param defocus_um: Amount to defocus the beam in micrometers. + """ + if isinstance(self.osa_def, dict) and isinstance(self.zoneplate_def, dict): + if 'D' in self.osa_def: + osa_D = self.osa_def['D'] + zp_diam = self.zoneplate_def['zpD'] + fl = self.calc_focal_length(self.energy_posner.get()) + self.max_A0 = float((osa_D * fl) / zp_diam) + return self.max_A0 + return None + + def calc_new_zpz_pos(self, focus_mode=None): + # self.report_params() + if focus_mode is None: + focus_mode = self.focus_mode + + energy_val = self.energy_posner.get() + FL = self.calc_focal_length(energy_val) + B = 0 # self.delta_zpz_from_focus.get() + C = 0 # self.scantype_flag.get() + defocus_um = self._defocus_um + A0 = self.A0 + delta_A0 = self.delta_A0 + new_zpz_for_osa_focussed = self.calc_new_zpz_for_osa_focussed(energy_val) + new_zpz_for_sample_focussed = self.calc_new_zoneplate_z_pos_for_focus(energy_val) + self.FLMode_1 = new_zpz_for_sample_focussed + + if focus_mode == 'OSA': + new_zpz = new_zpz_for_osa_focussed + else: + new_zpz = new_zpz_for_sample_focussed + + # print(f"Calculated new ZPZ position: {new_zpz:.2f} based on focus mode: {self.focus_mode}\n") + return new_zpz + + + def move_to_osa_focussed(self, energy_sp=None): + """ + Move the zpz positioner to the calculated position for OSA focused mode. + """ + if energy_sp is not None: + energy_val = energy_sp + else: + energy_val = self.energy_posner.get() + + new_zpz = self.calc_new_zpz_for_osa_focussed(energy_val) + # print(f"Moving ZPZ to OSA focused position: {new_zpz:.2f}\n") + #self.zpz_posner.put("user_setpoint", new_zpz) + self.zpz_posner.call_emit_move(new_zpz, wait=False) + + def move_to_sample_focussed(self, energy_sp=None): + """ + Move the zpz positioner to the calculated position for Sample focused mode. + """ + if energy_sp is not None: + energy_val = energy_sp + else: + energy_val = self.energy_posner.get() + new_zpz = self.calc_new_zoneplate_z_pos_for_focus(energy_val) + # print(f"Moving ZPZ to Sample focused position: {new_zpz:.2f}\n") + # self.zpz_posner.put("user_setpoint", new_zpz) + self.zpz_posner.call_emit_move(new_zpz, wait=False) + + def move(self, val: float, wait=True): + # print("EnergyDevice [move] called with val: ", val) + self.energy_posner.move(val, wait=wait) + if self._enable_fl_change_on_energy_change: + if self.focus_mode == 'OSA': + self.move_to_osa_focussed(energy_sp=val) + else: + self.move_to_sample_focussed(energy_sp=val) + + def put(self, energy_sp): + # print("EnergyDevice [put] called with val: ", val) + # move the zoneplate z positioner to the correct position based on focus mode + if self._enable_fl_change_on_energy_change: + if self.focus_mode == 'OSA': + self.move_to_osa_focussed(energy_sp) + else: + self.move_to_sample_focussed(energy_sp) + # now move energy + self.energy_posner.move(energy_sp) + + + def set(self, val): + """ + part of the API required to execute from a scan plan + :param val: + :return: + """ + # print("EnergyDevice [set] called with val: ", val) + self.put(val) + st = DeviceStatus(self, timeout=5.0) + st.set_finished() + return st + + def stop(self, *, success): + # self.close() + # self.is_open = False + pass + + + + + +if __name__ == "__main__": + from bcm.devices import MotorQt + from bluesky import RunEngine + from bluesky.plans import scan, count + from ophyd.sim import det1, det2 + from epics import PV + from cls.applications.pyStxm.bl_configs.utils import make_basedevice, make_base_simdevice + + # Make plots update live while scans run. + from bluesky.utils import install_kicker + + def on_focus_parms_changed(params): + # print("Focus parameters changed:") + # for key, value in params.items(): + # print(f"\t{key}: {value}") + # print("") + pass + + def mdev(dcs_name, name): + d = make_base_simdevice( + cat="PVS", + sig_nm=dcs_name, + name=name, + desc="", + units="", + rd_only=False, + backend="epics", + devcfg=None, + ) + return d + + RE = RunEngine({}) + from bluesky.callbacks.best_effort import BestEffortCallback + + bec = BestEffortCallback() + + # Send all metadata/data captured to the BestEffortCallback. + # RE.subscribe(bec) + from databroker import Broker + + db = Broker.named("pystxm_amb_bl10ID1") + + # Insert all metadata/data captured into db. + RE.subscribe(db.insert) + + # install_kicker() + + cz_mtr = MotorQt("SMTR1610-3-I12-47", name="DNM_COARSE_Z") + zpz_mtr = MotorQt("SMTR1610-3-I12-51", name="DNM_ZONEPLATE_Z") + energy_mtr = MotorQt("SIM_VBL1610-I12:ENERGY", name="SIM_VBL1610-I12:ENERGY") + + time.sleep(1.0) # give motors time to connect + + edct = {} + edct["energy_posner"] = energy_mtr + edct["zpz_posner"] = zpz_mtr + edct["cz_posner"] = cz_mtr + + edct["a0_dev"] = mdev("DNM_A0", "DNM_A0") + edct["delta_a0_dev"] = mdev("DNM_DELTA_A0", "DNM_DELTA_A0") + edct["zpz_adjust_dev"] = mdev("DNM_ZPZ_ADJUST", "DNM_ZPZ_ADJUST") + edct["defocus_beam_dev"] = mdev("DNM_BEAM_DEFOCUS", "DNM_BEAM_DEFOCUS") + edct["focal_len_dev"] = mdev("DNM_FOCAL_LENGTH", "DNM_FOCAL_LENGTH") + edct["zp_a1_dev"] = mdev("DNM_ZP_A1", "DNM_ZP_A1") + edct["a0_max_dev"] = mdev("DNM_A0MAX", "DNM_A0MAX") + edct["calcd_zpz_dev"] = mdev("DNM_CALCD_ZPZ", "DNM_CALCD_ZPZ") + edct["zp_focus_mode_dev"] = mdev("DNM_ZONEPLATE_FOCUS_MODE", "DNM_ZONEPLATE_FOCUS_MODE") + + edct["a0_dev"].put(1000.0) + edct["delta_a0_dev"].put(0.0) + edct["zpz_adjust_dev"].put(0.0) + edct["defocus_beam_dev"].put(0.0) + edct["zp_a1_dev"].put(11.358981) + edct["a0_max_dev"].put(500) + #edct["calcd_zpz_dev"].put(0.0) + edct["zp_focus_mode_dev"].put(1) + + energy_device = EnergyDevice("SIM_VBL1610-I12:ENERGY", name="ENERGY_DEVICE", energy_dev_dict=edct) + energy_device.focus_params_changed.connect(on_focus_parms_changed) + + zp0 = {'name': 'ZonePlate 0', 'zp_id': 0, 'zpA1': 4.840, 'zpD': 100.0, 'CsD': 45.0, 'zpOZone': 60.0} + zp1 = {'name': 'ZonePlate 1', 'zp_id': 1, 'zpA1': 6.792, 'zpD': 240.0, 'CsD': 90.0, 'zpOZone': 35.0} + zp2 = {'name': 'ZonePlate 2', 'zp_id': 2, 'zpA1': 7.767, 'zpD': 240.0, 'CsD': 90.0, 'zpOZone': 40.0} + zp3 = {'name': 'ZonePlate 3', 'zp_id': 3, 'zpA1': 4.524, 'zpD': 140.0, 'CsD': 60.0, 'zpOZone': 40.0} + zp4 = {'name': 'ZonePlate 4', 'zp_id': 4, 'zpA1': 4.859, 'zpD': 240.0, 'CsD': 95.0, 'zpOZone': 25.0} + zp5 = {'name': 'ZonePlate 5', 'zp_id': 5, 'zpA1': 4.857, 'zpD': 240.0, 'CsD': 95.0, 'zpOZone': 25.0} + zp6 = {'name': 'ZonePlate 6', 'zp_id': 6, 'zpA1': 5.067, 'zpD': 250.0, 'CsD': 100.0, 'zpOZone': 25.0} + zp7 = {'name': 'ZonePlate 7', 'zp_id': 7, 'zpA1': 6.789, 'zpD': 159.0, 'CsD': 111.0, 'zpOZone': 35.0} + zp8 = {'name': 'ZonePlate 8', 'zp_id': 8, 'zpA1': 35.835, 'zpD': 5000.0, 'CsD': 111.0, 'zpOZone': 35.0} + zp9 = {'name': 'ZonePlate 9', 'zp_id': 9, 'zpA1': 11.358981, 'zpD': 280.0, 'CsD': 100.0, 'zpOZone': 50.0} + + osa0 = {'name': 'OSA 0', 'osa_id': 0, 'D': 30.0} + osa1 = {'name': 'OSA 1', 'osa_id': 1, 'D': 50.0} + osa2 = {'name': 'OSA 2', 'osa_id': 2, 'D': 40.0} + osa3 = {'name': 'OSA 3', 'osa_id': 3, 'D': 60.0} + osa4 = {'name': 'OSA 4', 'osa_id': 4, 'D': 70.0} + osa5 = {'name': 'OSA 5', 'osa_id': 5, 'D': 51.0} + osa6 = {'name': 'OSA 6', 'osa_id': 6, 'D': 42.0} + osa7 = {'name': 'OSA 7', 'osa_id': 7, 'D': 63.0} + osa8 = {'name': 'OSA 8', 'osa_id': 8, 'D': 74.0} + + dets = [det1] # just one in this case, but it could be more than one + # RE(count(dets)) + + energy_val = energy_mtr.get_position() + # delta_a0_val = PV("ASTXM1610:bl_api:delta_A0").get() + # a0_val = PV("ASTXM1610:bl_api:A0").get() + # defocus_val = PV("ASTXM1610:bl_api:zp:defocus").get() + # adjust_val = PV("ASTXM1610:bl_api:zp:adjust_zpz").get() + # + # FLMode0_val = PV("ASTXM1610:bl_api:zp:mode:setter.L").get() + # FLMode1_val = PV("ASTXM1610:bl_api:zp:mode:setter.M").get() + + + + # run calcs based in current pv values + energy_device.set_zp_def(zp9) + energy_device.calc_focal_length(energy_val) + energy_device.set_osa_def(osa1) + energy_device.update_a0(1000) + energy_device.update_delta_a0(0) + energy_device.adjust_zpz(0) + energy_device.defocus_beam(0) + energy_device.set_focus_mode("SAMPLE") + + # if energy_device.FLMode_0 != FLMode0_val: + # print(f"!!!!!!!!!!!!!!!!!!!!!!!!!!!!FLMode_0 mismatch: calc={energy_device.FLMode_0:.2f}, pv={FLMode0_val:.2f}") + # else: + # print(f"BOOM! FLMode_0 match: calc={energy_device.FLMode_0:.2f}, pv={FLMode0_val:.2f}") + # + # if energy_device.FLMode_1 != FLMode1_val: + # print(f"!!!!!!!!!!!!!!!!!!!!!!!!!!!!FLMode_1 mismatch: calc={energy_device.FLMode_1:.2f}, pv={FLMode1_val:.2f}") + # else: + # print(f"BOOM! FLMode_1 match: calc={energy_device.FLMode_1:.2f}, pv={FLMode1_val:.2f}") + + # print(f"-----Starting scan with energy device... using zoneplate zp9 and osa1----OSA FOCUSSED") + # RE(scan(dets, energy_device, 395, 425, 3)) + + # energy_device.set_zp_def(zp2) + # energy_device.set_osa_def(osa1) + energy_device.set_focus_mode("SAMPLE") + print(f"-----Starting scan with energy device... using zoneplate zp2 and osa1---- SAMPLE FOCUSSED") + RE(scan(dets, energy_device, 395.0, 450.0, 10)) + + energy_device.move_to_osa_focussed() + energy_device.move_to_sample_focussed() + energy_device.move_to_osa_focussed() + + # At the end of your script, before exiting + RE.stop() # Stop the RunEngine if running + + # If using ophyd devices, unstage them + energy_device.unstage() + + diff --git a/bcm/devices/sim/sim_base_device.py b/bcm/devices/sim/sim_base_device.py new file mode 100644 index 00000000..86fe0b8c --- /dev/null +++ b/bcm/devices/sim/sim_base_device.py @@ -0,0 +1,338 @@ +import sys +import time as ttime + +from PyQt5 import QtWidgets, QtCore + +from ophyd.device import ( + Component, + Device, +) + +from ophyd.utils.epics_pvs import data_shape, data_type +from ophyd.ophydobj import Kind +from ophyd.signal import Signal +from bcm.devices.dev_categories import dev_categories +from bcm.devices import report_fields, BACKEND +from bcm.devices.ophyd.ophyd_qt_dev import OphydQt_AIDevice, OphydQt_NodeDevice + +from cls.utils.log import get_module_logger + +_logger = get_module_logger(__name__) + +PREC = 3 +SIMULATE = False + + +class SimSignal(Signal): + def __init__( + self, + *, + name, + value=0.0, + timestamp=None, + parent=None, + labels=None, + kind=Kind.omitted, + tolerance=0.001, + rtolerance=None, + metadata=None, + cl=None, + attr_name="", + ): + super().__init__( + name=name, + value=value, + timestamp=timestamp, + parent=parent, + kind=kind, + labels=labels, + tolerance=tolerance, + rtolerance=rtolerance, + metadata=metadata, + cl=cl, + attr_name=attr_name, + ) + + def set_enable(self, en): + """Use this attribute to allow the read() top ignore this Signal if the user has bnot asked to use this ROI.""" + if en: + self.kind = Kind.normal + else: + self.kind = Kind.omitted + + def read(self) -> dict: + """Put the status of the signal into a simple dictionary format for data acquisition.""" + value = self.get() + self._readback = value + return {self.name: {"value": value, "timestamp": ttime.time()}} + + def describe(self): + """ + Provide schema and meta-data for :meth:`~BlueskyInterface.read`. + + This keys in the `OrderedDict` this method returns must match the + keys in the `OrderedDict` return by :meth:`~BlueskyInterface.read`. + + This provides schema related information, (ex shape, dtype), the + source (ex PV name), and if available, units, limits, precision etc. + + Returns + ------- + data_keys : OrderedDict + The keys must be strings and the values must be dict-like + with the ``event_model.event_descriptor.data_key`` schema. + + """ + value = self.get() + return { + self.name: { + "source": f"{self.attr_name}", + "dtype": data_type(value), + "shape": data_shape(value), + "precision": PREC, + }, + } + + + +class BaseSimDevice(Device, QtCore.QObject): + changed = QtCore.pyqtSignal(object) + on_connect = QtCore.pyqtSignal(object) + + def __init__( + self, + sig_name, + name=None, + write_pv=None, + rd_only=False, + val_only=False, + val_kw="value", + backend=BACKEND, + wait_for_conn_timeout=0, + **kwargs + ): + super(BaseSimDevice, self).__init__(name=name, prefix=sig_name) + # name here for compatability + self.dcs_name = sig_name + self.name = name + # name here for compatability + self.prefix = sig_name + + self.sig_name = sig_name + self.rd_only = rd_only + self.can_write = True + self._ophyd_dev = None + self._prev_val = None + self._num_since_update = 0 + self.write_pv = None + + if "units" in kwargs.keys(): + self._units = kwargs["units"] + else: + self._units = "counts" + + if "desc" in kwargs.keys(): + self._desc = kwargs["desc"] + else: + self._desc = self.name + + if rd_only: + self.can_write = False + + self._ophyd_dev = None + + if (write_pv is None) and self.can_write: + self.write_pv = sig_name + else: + self.write_pv = write_pv + + + self._attrs = {} + for kw in kwargs: + self._attrs[kw] = kwargs[kw] + + self.backend = backend + self.val_only = val_only + self.val_kw = val_kw + self.val_kw_exists = True + self.info = dict(called=False) + + self.signal = SimSignal(name=sig_name) + + if wait_for_conn_timeout > 0: + self.signal.wait_for_connection(timeout=wait_for_conn_timeout) + + self.signal.subscribe( + self._sub_fired, run=False, event_type=self.signal.SUB_VALUE + ) + + report_fields(self) + + def connected(self): + return True + + def get_ophyd_device(self): + return self._ophyd_dev + + def add_callback(self, func, **kwargs): + self.signal.subscribe(func, run=False, event_type=self.signal.SUB_VALUE) + + def on_connection(self, pvname, conn, pv): + if conn: + # print('BaseDevice: [%s] is connected' % pvname) + self.on_connect.emit(self) + else: + # print('BaseDevice: [%s] is not connected' % pvname) + pass + + def is_connected(self): + return self.connected() + + def set_can_write(self, val): + """ + + :param val: + :return: + """ + self.can_write = val + + def set_return_val_only(self, val): + """ + + :param val: + :return: + """ + self.val_only = val + + def get_name(self): + return self.sig_name + + def get_position(self): + return self.get() + + def report(self): + """return a dict that reresents all of the settings for this device""" + print("name = %s, type = %s" % (str(self.__class__), self.name)) + + def get_report(self): + """return a dict that reresents all + of the settings for this device + + To be implemented by the inheriting class + """ + dct = {} + return dct + + def get_desc(self): + if hasattr(self, "_desc"): + return self._desc + else: + return self.get_name() + + def get_egu(self): + return self.egu + + def get_low_limit(self): + """ + can be overridded by inheriting class + :return: + """ + return None + + def get_high_limit(self): + """ + can be overridded by inheriting class + :return: + """ + return None + + def get_enum_str(self): + """ + can be overridded by inheriting class + :return: + """ + print("get_enum_str: NEED TO IMPLEMENT THIS") + return [] + + def get_enum_str_as_int(self): + """ + + :return: + """ + # val = self.pv.get() + # if (type(val) is int): + # final = val + # else: + # final = int(self.pv.enum_strs[val]) + # return (final) + print("get_enum_str_as_int: NEED TO IMPLEMENT THIS") + return [] + + def put(self, val, wait=False): + if self.can_write: + if SIMULATE: + print("simulating a put of: ", self.get_name(), val) + else: + if self.signal.connected: + self.signal.put(val) + + def get(self, fld="VAL"): + # _logger.debug('GET: [%s]' % self.get_name()) + return self.signal.get() + + def get_array(self): + return self.signal.get(as_numpy=True) + + def _sub_fired(self, **kwargs): + """ + kwargs={'old_value': 5529854, + 'value': 5529855, + 'timestamp': 1547055932.448674, + 'sub_type': 'value', + 'obj': EpicsSignal(read_pv='TRG2400:cycles', name='TRG2400:cycles', value=5529855, timestamp=1547055932.448674, + pv_kw={}, auto_monitor=False, string=False, write_pv='TRG2400:cycles', limits=False, put_complete=False)} + :param kwargs: + :return: + """ + self.info["called"] = True + self.info["kw"] = kwargs + if self.val_only: + if self.val_kw_exists: + if self.val_kw in kwargs.keys(): + # print(kwargs) + # self._num_since_update = 0 + val = kwargs[self.val_kw] + if val != self._prev_val: + self.changed.emit(kwargs[self.val_kw]) + else: + print("Skipping changed sig [%d]" % self._num_since_update) + self._num_since_update += 1 + self._prev_val = kwargs[self.val_kw] + else: + self.val_kw_exists = False + + else: + # entire dict + self.changed.emit(kwargs) + + def read(self): + """ + provide the o + """ + + +if __name__ == "__main__": + # from .base_object import BaseObject + + def mycallback(kwargs): + print(f"mycallback: received: {kwargs}") + + app = QtWidgets.QApplication(sys.argv) + sv = BaseSimDevice("uhvCI:counter:Waveform_RBV", name="counter0") + sv.changed.connect(mycallback) + print(sv.info) + print(sv.get()) + sv.put(1234.567) + print(sv.get()) + + sys.exit(app.exec_()) diff --git a/bcm/devices/sim/sim_base_object.py b/bcm/devices/sim/sim_base_object.py new file mode 100644 index 00000000..6616b903 --- /dev/null +++ b/bcm/devices/sim/sim_base_object.py @@ -0,0 +1,144 @@ +import sys +from PyQt5 import QtWidgets, QtCore + +from bcm.devices.sim.sim_base_device import BaseSimDevice + + +class BaseSimObject(QtCore.QObject): + + def __init__( + self, name, write_pv=None, val_only=False, val_kw="value", backend="epics" + ): + super(BaseSimObject, self).__init__() + self.name = self.prefix = name + self.backend = backend + self.devs = {} + + def report(self): + print("\tname = %s, type = %s" % (str(self.__class__), self.name)) + + def get_name(self): + """ + + :return: + """ + return self.name + + # def on_change(self, val): + # self.changed.emit(val) + + def add_device( + self, + sig_name, + write_pv=None, + val_only=False, + val_kw="value", + is_dev_attr=False, + _delim=".", + ): + """ + :param sig_name: + :param write_pv: + :param val_only: + :param val_kw: + :param backend: + :param is_dev_attr: basically all this means is that if the device is an attr to the main object then use the + name + sig_name, otherwise just use sig_name, makes it cleaner when adding addrs such as for an + Mbbi object definition, then the attrs are stored in the self.devs by attr not the fully qualified name, so gets + and puts become self.dev.put('VAL') as opposed to self.dev.put('BL1610-I10:ScanSelflag.A') + :return: + """ + if is_dev_attr: + # construct the full name and store using just the attr name + complete_sig_name = self.name + _delim + sig_name + self.devs[sig_name] = BaseSimDevice( + complete_sig_name, + write_pv=complete_sig_name, + val_only=val_only, + val_kw=val_kw, + backend=self.backend, + ) + else: + self.devs[sig_name] = BaseSimDevice( + sig_name, + write_pv=write_pv, + val_only=val_only, + val_kw=val_kw, + backend=self.backend, + ) + return self.devs[sig_name] + + def add_callback(self, sig_name, cb): + """ + :param sig_name: + :param cb: + :return: + """ + self.devs[sig_name].changed.connect(cb) + + def remove_callback(self, sig_name): + """ + + :param sig_name: + :return: + """ + self.devs[sig_name].disconnect() + + def get(self, sig_name=None): + """ + + :param sig_name: + :return: + """ + if sig_name: + val = self.devs[sig_name].get() + else: + print("get: Error: sig_name [%s] does not exist" % sig_name) + val = None + return val + + def put(self, sig_name=None, val=None): + """ + here I set both args to None in the hopes that if a user + :param sig_name: + :param val: + :return: + """ + if sig_name is not None: + if val is not None: + # use the passed in sig_name + self.devs[sig_name].put(val) + else: + print("Error: put requires at least 2 arguments, 1 specified") + return + else: + print("Error: put requires at least 2 arguments, 0 specified") + return + + +if __name__ == "__main__": + + def mycallback(kwargs): + print(f"mycallback: received: {kwargs}") + + app = QtWidgets.QApplication(sys.argv) + obj = BaseSimObject( + "Fake1PV.RBV", write_pv="Fake1PV.VAL", val_only=False, val_kw="value" + ) + e = obj.add_device( + "Fake2PV.RBV", write_pv="Fake2PV.VAL", val_only=False, val_kw="value" + ) + d = obj.add_device( + "Fake3PV.RBV", write_pv="Fake3PV.VAL", val_only=False, val_kw="timestamp" + ) + s = obj.add_device("FAKESYSTEM:mode:fbk", val_only=False, val_kw="value") + t = obj.add_device("FAKEBL1610-I10:ENERGY:uhv:enabled", val_only=False, val_kw="value") + d.changed.connect(mycallback) + e.changed.connect(mycallback) + s.changed.connect(mycallback) + t.changed.connect(mycallback) + d.put(-6749.321) + e.put(-1749.321) + print('MODE fbk is: ', s.get()) + + sys.exit(app.exec_()) diff --git a/bcm/devices/sim/sim_binary_out.py b/bcm/devices/sim/sim_binary_out.py new file mode 100644 index 00000000..90a2916c --- /dev/null +++ b/bcm/devices/sim/sim_binary_out.py @@ -0,0 +1,69 @@ + +from bcm.devices import report_fields +from bcm.devices.sim.sim_base_object import BaseSimObject + + +class SimBo(BaseSimObject): + """ + Simple SIM bo device based on EPICS BO record + Binary output + 0 - Off + 1 - On + 2 string values + """ + + def __init__( + self, + base_signal_name=None, + write_pv=None, + desc=None, + egu="", + cb=None, + ret_kwarg="value", + **cb_kwargs + ): + + super(SimBo, self).__init__( + base_signal_name, write_pv=base_signal_name + ".VAL", **cb_kwargs + ) + self.dcs_name = base_signal_name + self.attrs = ("VAL", "OUT", "NAME", "DESC", "ZNAM", "ONAM") + self.main_dev = self.add_device(base_signal_name) + self.changed = self.main_dev.changed + self.on_connect = self.main_dev.on_connect + self.is_connected = self.main_dev.is_connected + self.desc = desc + + for _attr in self.attrs: + # sig_name = self.base_signal_name + self._delim + '%s' % _attr + # self.add_device(sig_name, write_pv=sig_name) + self.add_device(_attr, is_dev_attr=True) + + report_fields(self) + + def get_position(self): + return self.get("VAL") + + def get(self, _attr): + if _attr in self.devs.keys(): + return self.devs[_attr].get() + + def put(self, val=None): + return self.devs["VAL"].put(val) + + + +if __name__ == "__main__": + import sys + from PyQt5 import QtWidgets + + + def mycallback(kwargs): + print(kwargs) + + app = QtWidgets.QApplication(sys.argv) + t = Bo("BL1610-I10:ENERGY:uhv:enabled", val_only=False, val_kw="value") + t.get("VAL") + t.changed.connect(mycallback) + + sys.exit(app.exec_()) diff --git a/bcm/devices/sim/sim_multi_bit_binary_out.py b/bcm/devices/sim/sim_multi_bit_binary_out.py new file mode 100644 index 00000000..79c4015e --- /dev/null +++ b/bcm/devices/sim/sim_multi_bit_binary_out.py @@ -0,0 +1,148 @@ + +from bcm.devices import report_fields +from bcm.devices.sim.sim_base_object import BaseSimObject + +DO_SIM = False + +class SimMbbo(BaseSimObject): + """ + Simple mbbo input device, based on EPICS MBBO record + 16 bit multi bit binary output + 0-15 values + 16 string values + 16 output values + """ + + def __init__( + self, + base_signal_name=None, + write_pv=None, + desc=None, + egu="", + cb=None, + ret_kwarg="value", + **cb_kwargs + ): + + # super(Mbbo, self).__init__(base_signal_name, write_pv=base_signal_name + '.VAL', **cb_kwargs) + super(SimMbbo, self).__init__( + base_signal_name, write_pv=base_signal_name, **cb_kwargs + ) + self.dcs_name = base_signal_name + + if DO_SIM: + self.attrs = ("VAL", "OUT", "NAME", "DESC") + else: + self.attrs = ( + "VAL", + "OUT", + "NAME", + "DESC", + "ZRVL", + "ONVL", + "TWVL", + "THVL", + "FRVL", + "FVVL", + "SXVL", + "SVVL", + "EIVL", + "NIVL", + "TEVL", + "ELVL", + "TVVL", + "TTVL", + "FTVL", + "FFVL", + "ZRST", + "ONST", + "TWST", + "THST", + "FRST", + "FVST", + "SXST", + "SVST", + "EIST", + "NIST", + "TEST", + "ELST", + "TVST", + "TTST", + "FTST", + "FFST", + ) + + self.val_flds = [ + "ZRVL", + "ONVL", + "TWVL", + "THVL", + "FRVL", + "FVVL", + "SXVL", + "SVVL", + "EIVL", + "NIVL", + "TEVL", + "ELVL", + "TVVL", + "TTVL", + "FTVL", + "FFVL", + ] + self.str_flds = [ + "ZRST", + "ONST", + "TWST", + "THST", + "FRST", + "FVST", + "SXST", + "SVST", + "EIST", + "NIST", + "TEST", + "ELST", + "TVST", + "TTST", + "FTST", + "FFST", + ] + self.main_dev = self.add_device(base_signal_name) + self.changed = self.main_dev.changed + self.on_connect = self.main_dev.on_connect + self.is_connected = self.main_dev.is_connected + + for _attr in self.attrs: + # sig_name = self.base_signal_name + self._delim + '%s' % _attr + # self.add_device(sig_name, write_pv=sig_name) + self.add_device(_attr, is_dev_attr=True) + + report_fields(self) + + def get_position(self): + return self.get() + + def get(self, _attr=None): + if _attr in self.devs.keys(): + return self.devs[_attr].get() + else: + return self.devs["VAL"].get() + + def put(self, _attr=None, val=None): + if _attr in self.devs.keys(): + return self.devs[_attr].put(val) + elif val is None: + # then this is just a put without the _attr set such as 'put(val)' so treat it as such + val = _attr + _attr = "VAL" + self.devs[_attr].put(val) + elif _attr is None: + # then they specified val= but no attr so assume VAL + _attr = "VAL" + self.devs[_attr].put(val) + elif _attr not in self.attrs: + _attr = "VAL" + self.devs[_attr].put(val) + else: + print("Mbbo: put: something is not right here, cannot PUT") \ No newline at end of file diff --git a/bcm/devices/sim/sim_transform.py b/bcm/devices/sim/sim_transform.py new file mode 100644 index 00000000..6ae1e3e2 --- /dev/null +++ b/bcm/devices/sim/sim_transform.py @@ -0,0 +1,208 @@ +#!/usr/bin/env python +"""Epics transform record""" + +import os +from bcm.devices import report_fields +from bcm.devices.sim.sim_base_object import BaseSimObject + + +class SimTransform(BaseSimObject): + + def __init__(self, base_signal_name, **kwargs): + self.attr_fmts = {"CLC%s": "CLC%s"} + self.attrs = ["COPT", "PREC", "PINI", "DESC", "PROC"] + self.rows = "ABCDEFGHIJKLMNOP" + self.all_rows = [ + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + ] + self._delim = "." + + if base_signal_name.endswith("."): + base_signal_name = base_signal_name[:-1] + + super(SimTransform, self).__init__(base_signal_name) + self.dcs_name = base_signal_name + self.main_dev = self.add_device(base_signal_name) + self.changed = self.main_dev.changed + self.on_connect = self.main_dev.on_connect + self.is_connected = self.main_dev.is_connected + + # self.attrs = ['COPT', 'PREC', 'PINI'] + for fmt in list(self.attr_fmts.values()): + for let in self.rows: + self.attrs.append(fmt % let) + + for _attr in self.attrs: + # sig_name = self.base_signal_name + self._delim + '%s' % _attr + # self.add_device(sig_name, write_pv=sig_name) + self.add_device(_attr, is_dev_attr=True) + report_fields(self) + + def __validrow(self, row): + return isinstance(row, str) and len(row) == 1 and row in self.rows + + # def get_name(self): + # # return (self.get('NAME')) + # return (self.base_signal_name.replace(self._delim, '')) + + def get_position(self): + """this is an API function for all devices/pvs/detectors""" + return self.get_all() + + def get(self, _attr): + if _attr in self.devs.keys(): + return self.devs[_attr].get() + + def put(self, _attr, val): + if _attr in self.devs.keys(): + return self.devs[_attr].put(val) + + def get_all(self): + all = {} + all["PINI"] = self.get("PINI") + all["PREC"] = self.get("PREC") + + for r in self.all_rows: + all[r] = self.get_row(r) + + return all + + def get_row(self, row="A"): + """get full data for a calculation 'row' (or letter): + + returns dictionary with keywords (and PV suffix for row='B'): + + 'Value': B + 'Input': INPB + 'Input_Valid': IBV + 'Expression': CLCB + 'Output': OUTB + 'Output_Valid': OBV + 'Comment': CMTB + 'Expression_Valid': CBV + 'Previous_Value': LB + + """ + if not self.__validrow(row): + return None + dat = {} + for label, fmt in list(self.attr_fmts.items()): + # self.base_signal_name + self._delim + '%s' % _attr + dat[label % row] = self.devs[fmt % row].get() + return dat + + def set_row(self, row="A", data=None): + """set full data for a calculation 'row' (or letter): + + data should be a dictionary as returned from get_row() + """ + if not self.__validrow(row): + return None + for key, value in list(data.items()): + if key in self.attr_fmts: + attr = self.attr_fmts[key] % row + if self.devs[attr].write_access: + self.devs[attr].put(value) + + def set_calc(self, row="A", calc=""): + """set calc for a 'row' (or letter): + calc should be a string""" + if not self.__validrow(row): + return None + self.devs[self.attr_fmts["Expression"] % row].put(calc) + + def set_comment(self, row="A", comment=""): + """set comment for a 'row' (or letter): + comment should be a string""" + if not self.__validrow(row): + return None + self.devs[self.attr_fmts["Comment"] % row].put(calc) + + def set_input(self, row="A", input=""): + """set input PV for a 'row' (or letter): + input should be a string""" + if not self.__validrow(row): + return None + self.devs[self.attr_fmts["Input"] % row].put(calc) + + def gen_record_row(self, r, dct): + r_dct = dct[r] + s = ( + '\tfield(CMT%s, "%s") field(INP%s, "%s") field(CLC%s, "%s") field(%s, "%s") field(OUT%s, "%s")\n' + % ( + r, + r_dct["CMT%s" % r], + r, + r_dct["INP%s" % r], + r, + r_dct["CLC%s" % r], + r, + r_dct["%s" % r], + r, + r_dct["OUT%s" % r], + ) + ) + return s + + def gen_record(self): + dct = self.get_all() + s = 'record(transform, "%s")\n' % self.name + s += "{\n" + s += '\tfield(PINI, "%s")\n' % dct["PINI"] + s += '\tfield(PREC, "%s")\n' % dct["PREC"] + s += "\n" + + for row in self.all_rows: + s += self.gen_record_row(row, dct) + s += "}\n\n" + return s + + +if __name__ == "__main__": + import os + import sys + from PyQt5 import QtWidgets + + # #for i in range(1,50): + # # t = Transform('BL08ID1:trans_%d:tr' % i) + # # print t.gen_record() + # print('starting') + # z = Transform('BL1610-I10:ENERGY:amb:zp:def') + # #o = Transform('BL1610-I10:ENERGY:amb:osa:def') + # print('done') + # #print t.get_all() + # #print t.gen_record() + + def mycallback(kwargs): + print(kwargs) + + app = QtWidgets.QApplication(sys.argv) + z = Transform("BL1610-I10:ENERGY:uhv:zp:def") + print(z.get("A")) + print(z.get("B")) + print(z.get("C")) + print(z.get("D")) + print(z.get("E")) + print(z.get("F")) + print(z.get("G")) + + z.put("F", 777.123) + z.put("CMTF", "How you doin?") + print(z.get("F")) + + sys.exit(app.exec_()) diff --git a/bcm/devices/zmq/motor.py b/bcm/devices/zmq/motor.py index 92649655..6290ca9a 100644 --- a/bcm/devices/zmq/motor.py +++ b/bcm/devices/zmq/motor.py @@ -1,4 +1,4 @@ -from PyQt5.QtCore import Qt +from PyQt5.QtCore import Qt, pyqtSignal from bcm.devices.zmq.zmq_device import ZMQBaseDevice, ZMQSignal from bcm.devices.zmq.pixelator.positioner_defines import MAX_DELTA_FINE_RANGE_UM @@ -72,7 +72,7 @@ class ZMQMotor(ZMQBaseDevice): """ A basic device that offers a positioner interface """ - + _emit_move = pyqtSignal(float, bool) # a signal to call move from a sig handler in a thread safe way def __init__(self, dcs_name, name, **kwargs): super().__init__(dcs_name, name, **kwargs) self._low_limit = -10000 @@ -119,6 +119,17 @@ def __init__(self, dcs_name, name, **kwargs): # are set by the coarse motors for an e712 motor because it needs to be able to use setpoint values that are # in the range of the coarse motor, scanable range is the actual physical range of the piezo stage and will # come from the max_fine_x and max_fine_y declarations in the bealmline config file + self._emit_move.connect(self.move) + + def call_emit_move(self, position, wait=True, kwargs={}): + """ + a thread safe way to call move from a signal handler + :param position: + :param wait: + :param kwargs: + :return: + """ + self._emit_move.emit(position, wait) def set_max_scanable_range(self, rng: float) -> None: self.scanable_range = rng diff --git a/bcm/devices/zmq/pixelator/pixelator_dcs_server_api.py b/bcm/devices/zmq/pixelator/pixelator_dcs_server_api.py index e26b86e4..0d2cc3c0 100644 --- a/bcm/devices/zmq/pixelator/pixelator_dcs_server_api.py +++ b/bcm/devices/zmq/pixelator/pixelator_dcs_server_api.py @@ -1025,6 +1025,12 @@ def connect_to_dcs_server(self, devices_dct: dict) -> bool: positioner_dct['lowerSoftLimit'] = -7000 positioner_dct['upperSoftLimit'] = 7000 + if app_devname in ["DNM_ENERGY"]: + # set the value to something reasonable if it is currently 0.0 (noHardware) + if dev.get_position() == 0.0: + dev.move(700.0) + + dev.set_positioner_dct(positioner_dct) if hasattr(dev, 'set_low_limit'): @@ -1087,9 +1093,9 @@ def connect_to_dcs_server(self, devices_dct: dict) -> bool: # DNM_FOCAL_LENGTH = Energy * A1 # DNM_ZP_DEF_A = A1 appdevs = {'DNM_ENERGY': 650, - 'DNM_ZP_DEF_A': -11.359, + 'DNM_ZP_A1': 11.359, 'DNM_A0MAX': 1300, - 'DNM_FOCAL_LENGTH': 650 * -11.359} + 'DNM_FOCAL_LENGTH': 650 * 11.359} for app_devname, val in appdevs.items(): if app_devname in list(self.parent.devs.keys()): dev = self.parent.devs[app_devname]['dev'] diff --git a/bcm/devices/zmq/pixelator/talk_to_pix.py b/bcm/devices/zmq/pixelator/talk_to_pix.py index c6594277..b3e157db 100644 --- a/bcm/devices/zmq/pixelator/talk_to_pix.py +++ b/bcm/devices/zmq/pixelator/talk_to_pix.py @@ -54,9 +54,9 @@ 'Sample OUT': None, 'topupMode': None, 'beamShutterMode': None, - 'loadFile directory': '{"directory":"/home/bergr/srv-unix-home/Data/2025-08-08","showHidden":1, "fileExtension":".hdf5"}', - 'listDirectory': '{"directory":"/home/bergr/srv-unix-home/Data"}', - 'loadFile file': '{ "directory": "/home/bergr/srv-unix-home/Data/0502", "file": "/home/bergr/srv-unix-home/Data/0502/A240502001.hdf5", "showHidden": 0, "fileExtension": ".hdf5", "directories": ["..", "discard"], "files": ["A240502001.hdf5"], "pluginNumber": 0 }', + 'loadFile directory': '{"directory":"/beamlinedata/SM/operations/STXM-data/ASTXM_upgrade_tmp/2025/pix_data/2025-12-04","showHidden":1, "fileExtension":".hdf5"}', + 'listDirectory': '{"directory":"/beamlinedata/SM/operations/STXM-data/ASTXM_upgrade_tmp/2025/pix_data"}', + 'loadFile file': '{ "directory": "/beamlinedata/SM/operations/STXM-data/ASTXM_upgrade_tmp/2025/pix_data/2025-12-04", "file": "/beamlinedata/SM/operations/STXM-data/ASTXM_upgrade_tmp/2025/pix_data/2025-12-04/Detector_2025-12-04_001.hdf5", "showHidden": 0, "fileExtension": ".hdf5", "directories": ["..", "discard"], "files": ["Detector_2025-12-04_001.hdf5"], "pluginNumber": 0 }', 'loadFile files': '{"cmd_args":{"files":[]}}', 'loadDefinition': None, 'change user': None, @@ -186,8 +186,8 @@ def __init__(self, host, sub_port, req_port, scan_content_sub_port=56566): self.main_widget = QWidget(self) self.layout = QVBoxLayout(self.main_widget) - self.contact_sheet = ContactSheet() - self.contact_sheet.setMinimumSize(600, 400) + # self.contact_sheet = ContactSheet() + # self.contact_sheet.setMinimumSize(600, 400) # Label for command part self.cmd_label = QLabel("Select command (First Part of Multipart):", self) @@ -218,7 +218,7 @@ def __init__(self, host, sub_port, req_port, scan_content_sub_port=56566): self.received_message_txtedit = QtWidgets.QTextEdit() self.layout.addWidget(self.received_message_txtedit) - self.layout.addWidget(self.contact_sheet) + # self.layout.addWidget(self.contact_sheet) self.setCentralWidget(self.main_widget) @@ -264,7 +264,7 @@ def on_sub_message_received(self, msg_lst): # print(f"on_sub_message_received: {msg_lst}") # Print only the first 100 characters for brevity msg_dct = json.loads(msg_lst[1]) h5_file_dct = json.loads(msg_dct['pystxm_load']) - self.contact_sheet.create_thumbnail_from_h5_file_dct(h5_file_dct) + # self.contact_sheet.create_thumbnail_from_h5_file_dct(h5_file_dct) def on_loadfile_directory_msg(self, msg_dct: dict) -> None: diff --git a/bcm/devices/zmq/zmq_dev_manager.py b/bcm/devices/zmq/zmq_dev_manager.py index b741764a..d1b065b6 100644 --- a/bcm/devices/zmq/zmq_dev_manager.py +++ b/bcm/devices/zmq/zmq_dev_manager.py @@ -142,15 +142,20 @@ def __init__(self, devices_dct, parent=None): #connect device signals if hasattr(dev, 'attrs'): for _attr in dev.attrs: - a = getattr(dev, _attr) - # print(f"zmqDevMgr: connecting signal do_put for attribute {a.name}") - a.do_put.connect(self.on_dev_put) - a.do_get.connect(self.on_dev_get) - - # print(f"zmqDevMgr: connecting signal do_put for device {dev.name}") - dev.do_put.connect(self.on_dev_put) - dev.do_get.connect(self.on_dev_get) - dev.on_connect.connect(self.on_dev_connect) + attr_exists = False + if hasattr(dev, _attr): + attr_exists = True + a = getattr(dev, _attr) + # print(f"zmqDevMgr: connecting signal do_put for attribute {a.name}") + a.do_put.connect(self.on_dev_put) + a.do_get.connect(self.on_dev_get) + if not attr_exists: + continue + if hasattr(dev, 'do_put'): + # print(f"zmqDevMgr: connecting signal do_put for device {dev.name}") + dev.do_put.connect(self.on_dev_put) + dev.do_get.connect(self.on_dev_get) + dev.on_connect.connect(self.on_dev_connect) # must set the device name maps after all devices have been added self.dcs_server_api.set_device_name_maps(self.app_to_dcsname_map, self.dcs_to_appname_map) diff --git a/cls/appWidgets/dialogs.py b/cls/appWidgets/dialogs.py index 160eceab..44b3f112 100644 --- a/cls/appWidgets/dialogs.py +++ b/cls/appWidgets/dialogs.py @@ -411,6 +411,12 @@ def notify(title, msg, accept_str, ss=None, posn=None): dialog.setGeometry( QtCore.QRect(posn[0], posn[1], dialog.width(), dialog.height()) ) + else: + screen = QtWidgets.QApplication.primaryScreen() + screen_geometry = screen.availableGeometry() + x = (screen_geometry.width() - dialog.width()) // 2 + y = (screen_geometry.height() - dialog.height()) // 2 + dialog.move(x, y) if ss: dialog.setStyleSheet(ss) @@ -418,7 +424,6 @@ def notify(title, msg, accept_str, ss=None, posn=None): ret = dialog.notifyMessage(title, msg, accept_str) return ret - def warn(title, msg, accept_str, reject_str, ss=None, posn=None): dialog = Dialog() # from PyQt5 import QtGui, QtCore, QtWidgets diff --git a/cls/appWidgets/enum.py b/cls/appWidgets/enum_class.py similarity index 100% rename from cls/appWidgets/enum.py rename to cls/appWidgets/enum_class.py diff --git a/cls/appWidgets/focus_class.py b/cls/appWidgets/focus_class.py new file mode 100644 index 00000000..2e22e161 --- /dev/null +++ b/cls/appWidgets/focus_class.py @@ -0,0 +1,152 @@ + +import math +from PyQt5 import QtCore, QtGui, QtWidgets + +from cls.utils.log import get_module_logger + +_logger = get_module_logger(__name__) + +ABS_MIN_A0 = 100.0 # Minimum allowable A0 +ABS_MAX_A0 = 5000.0 # Maximum allowable A0 + + +class FocusCalculations(QtCore.QObject): + """ + Class to handle focus calculations for zoneplates. + """ + def __init__(self, zoneplate_def: dict, A0: float, delta_A0: float=0.0, parent=None): + super().__init__(parent) + self.parent = parent + self.zoneplate_def = zoneplate_def + self.A0 = A0 + self.delta_A0 = delta_A0 + self.min_A0 = ABS_MIN_A0 # Minimum allowable A0 + + def update_min_a0(self, val: float): + """ + Update the min_A0 value + :param val: New ,min_A0 value + """ + if val < ABS_MIN_A0: + _logger.warn(f"Attempted to set min_A0 to {val}, which is below absolute minimum of {ABS_MIN_A0}. Setting to {ABS_MIN_A0}.") + else: + self.min_A0 = val + + def update_a0(self, a0: float): + """ + Update the a0 value + :param a0: New a0 value + """ + self.A0 = a0 + self.update_delta_a0(0.0) + + def update_delta_a0(self, delta_a0: float): + """ + Update the delta_a0 value + :param delta_a0: New delta_a0 value + """ + self.delta_A0 = delta_a0 + + + def focal_length(self, energy): + """ + f = A1 * E + """ + f = self.zoneplate_def["zpA1"] * energy + + return f + + def get_a0(self) -> float: + """ + Get the current focal length (A0) + :return: Current focal length (A0) + """ + return self.A0 + + def get_delta_a0(self) -> float: + """ + Get the current change in focal length (delta_a0) + :return: Current change in focal length (delta_a0) + """ + return self.delta_A0 + + def calc_delta_focus_position(self, energy: float, desired_focus_position: float) -> float: + """ + Calculate the change in focal length (delta_a0) required to achieve the desired focal length for a given energy. + :param desired_focal_length: Desired focal length + :param energy: Energy in eV + :return: Change in focal length (delta_a0) + """ + current_focal_length = 0.0 - (math.fabs(self.focal_length(energy)) - (self.A0 + self.delta_A0)) + delta_focus_pos = desired_focus_position - current_focal_length + self.update_a0_for_focus(delta_focus_pos) + return delta_focus_pos + + def update_a0_for_focus(self, new_a0: float): + """ + Update the focal length (A0) to a new value, ensuring it is within allowable limits. + :param new_a0: New focal length (A0) + """ + self.A0 += new_a0 + + def calc_new_coarse_z_pos_for_focus(self, energy: float, cur_cz_pos: float, desired_focus_position: float) -> float: + """ + Calculate the new coarse z position needed to achieve focus at the desired focal length for a given energy. + :param cur_cz_pos: Current coarse z position + :param delta_a0: Change in focal length required to achieve focus + :return: New coarse z position + """ + delta_focus_pos = self.calc_delta_focus_position(energy, desired_focus_position) + new_cz_pos = cur_cz_pos - delta_focus_pos + return new_cz_pos + + def calc_new_zoneplate_z_pos_for_focus(self, energy: float) -> float: + """ + NOTE: Focal length is equal to OSA in focus, calc new zpz position for current energy, Ao and delta_A0 + + Calculate the new zoneplate z position needed to achieve focus at the desired focal length for a given energy. + :param focal_length: Desired focal length + :param a0: Current focal length + :param delta_a0: Change in focal length required to achieve focus + :return: New zoneplate z position + """ + focal_length = self.focal_length(energy) + new_zp_z_pos = 0.0 - (math.fabs(focal_length) - (self.A0 + self.delta_A0)) + # new_zp_z_pos = 0.0 - ((math.fabs(focal_length) - self.A0) - (delta_focus_pos) + self.delta_A0) + return new_zp_z_pos + + + +if __name__ == '__main__': + import sys + + energy = 395.0 # eV + a1 = -11.0 + a0 = 1000 + desired_focus_position = [-3386, -3286, -3486, -3586, -3586, -3686, -3786, -3886, -3986] + cz = 3000 + zpz = -3486 + + zp_def = {"D": 280.0, "CsD": 100, "OZone": 50, "zpA1": -11.359} + + fclass = FocusCalculations(zp_def, a0) + + fl = fclass.focal_length(energy) + print(f"[a0={a0:.2f}] Focal length at {energy} eV: {fl} um") + print("-----------------------------------------------") + + # for des_focus_pos in desired_focus_position: + # print(f"[des_focus_pos: {des_focus_pos}] Cz = {fclass.calc_new_coarse_z_pos_for_focus(energy, cz, des_focus_pos):.2f} um") + # print() + # for des_focus_pos in desired_focus_position: + # print(f"[des_focus_pos: {des_focus_pos}] ZPz = {fclass.calc_new_zoneplate_z_pos_for_focus(energy, a0, des_focus_pos):.2f} um") + + new_a0_offset = fclass.calc_delta_focus_position(395, -3476.8) + fclass.update_a0_for_focus(new_a0_offset) + fclass.calc_new_zoneplate_z_pos_for_focus(energy) + + + + + + diff --git a/cls/appWidgets/main_object.py b/cls/appWidgets/main_object.py index 7a3a08dc..28eca02b 100644 --- a/cls/appWidgets/main_object.py +++ b/cls/appWidgets/main_object.py @@ -25,8 +25,10 @@ from cls.types.stxmTypes import ( sample_fine_positioning_modes, sample_positioning_modes, + SAMPLE_FOCUS_MODE, + OSA_FOCUS_MODE ) - +from cls.appWidgets.focus_class import FocusCalculations from cls.scan_engine.bluesky.qt_run_engine import EngineWidget, ZMQEngineWidget from bcm.devices import BACKEND @@ -135,6 +137,7 @@ def __init__(self, name, endstation, beamline_cfg_dct=None, splash=None, main_cf self.data_dir = beamline_cfg_dct["BL_CFG_MAIN"]['data_dir'] self.default_detector = beamline_cfg_dct["BL_CFG_MAIN"].get('default_detector', None) self.data_sub_context = zmq.Context() + self.nx_server_master_seq_dct = None if DATA_SERVER_HOST is None: _logger.error("DATA_SERVER_HOST environment variable is not set, cannot continue") @@ -429,7 +432,7 @@ def get_master_file_seq_names(self, data_dir: str=None, new_stack_dir=new_stack_dir, prefix_char=prefix_char, dev_backend=dev_backend) - + self.nx_server_master_seq_dct = master_seq_dct return master_seq_dct def nx_server_load_data_directory(self, data_dir: str=None, *, extension: str='.hdf5') -> None: @@ -437,6 +440,18 @@ def nx_server_load_data_directory(self, data_dir: str=None, *, extension: str='. This function loads the data directory from the DCS server and updates the remote file system info. It is used to load the data directory from the DCS server. """ + + def get_sorted_hdf5_files(dct): + """ + Combine 'files' and directory-based hdf5 files, return sorted list. + """ + files = dct['directories']['files'] + dirs = dct['directories']['directories'] + # Each directory contains a file named .hdf5 + dir_files = [f"{dirname}/{dirname}.hdf5" for dirname in dirs] + all_files = files + dir_files + return sorted(all_files, reverse=True) + if data_dir is None: data_dir = self.data_dir #file_lst = self.dcs_server_api.load_directory(data_dir, extension=extension) @@ -446,18 +461,13 @@ def nx_server_load_data_directory(self, data_dir: str=None, *, extension: str='. res_dct = self.send_to_nx_server(NX_SERVER_CMNDS.LOADFILE_DIRECTORY, [], '', data_dir, nx_app_def='nxstxm', host=self.nx_server_host, port=self.nx_server_port, verbose=False, cmd_args=cmd_args) - if 'directories' in res_dct.keys(): - file_lst = res_dct['directories']['files'] + + file_lst = get_sorted_hdf5_files(res_dct) + + if len(file_lst) > 0: if isinstance(file_lst, list): self.nx_server_load_files(data_dir, file_lst=file_lst) - subdir_lst = res_dct['directories']['directories'] - if isinstance(subdir_lst, list): - for subdir in subdir_lst: - #self.nx_server_load_file(data_dir, fname) - # cause a directory data thumbnail to be created - fname = subdir + extension - self.nx_server_load_file(os.path.join(data_dir, subdir), fname, extension=extension) def nx_server_load_file(self, data_dir: str=None, fname: str=None, extension: str='.hdf5') -> None: """ @@ -1083,7 +1093,7 @@ def device(self, name, do_warn=True): dev = self.main_obj["DEVICES"].devices[cat][name] if dev is None: if do_warn: - _logger.warn("Warning: dev [%s] does not exist in master object" % name) + _logger.warn(f"device [{name}] does not exist in master device dictionary or device name database") return dev def get_device_obj(self): diff --git a/cls/appWidgets/ui/message.ui b/cls/appWidgets/ui/message.ui deleted file mode 100644 index 0eb75606..00000000 --- a/cls/appWidgets/ui/message.ui +++ /dev/null @@ -1,90 +0,0 @@ - - - Form - - - - 0 - 0 - 510 - 197 - - - - Form - - - - - - Qt::Vertical - - - - 20 - 70 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 75 - true - - - - msgLbl - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 69 - - - - - - - - - diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_0_c.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_0_c.bmp deleted file mode 100644 index 39f0eeaa..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_0_c.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_100_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_100_a.bmp deleted file mode 100644 index 73cfd2e9..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_100_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_100_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_100_b.bmp deleted file mode 100644 index f4fb0b8a..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_100_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_101_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_101_a.bmp deleted file mode 100644 index 18e92e3b..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_101_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_101_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_101_b.bmp deleted file mode 100644 index 97171e78..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_101_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_102_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_102_a.bmp deleted file mode 100644 index 12c8bd7e..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_102_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_102_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_102_b.bmp deleted file mode 100644 index 148263f3..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_102_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_103_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_103_a.bmp deleted file mode 100644 index 092d0022..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_103_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_103_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_103_b.bmp deleted file mode 100644 index 1f1f92b5..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_103_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_104_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_104_a.bmp deleted file mode 100644 index a5c554e4..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_104_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_104_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_104_b.bmp deleted file mode 100644 index 22cabffc..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_104_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_105_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_105_a.bmp deleted file mode 100644 index 7a1683df..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_105_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_105_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_105_b.bmp deleted file mode 100644 index 04b4960f..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_105_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_106_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_106_a.bmp deleted file mode 100644 index 5ceb89da..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_106_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_106_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_106_b.bmp deleted file mode 100644 index 5c3ae22b..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_106_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_107_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_107_a.bmp deleted file mode 100644 index dd2d61f8..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_107_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_107_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_107_b.bmp deleted file mode 100644 index 99887f9c..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_107_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_108_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_108_a.bmp deleted file mode 100644 index 662d03ed..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_108_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_108_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_108_b.bmp deleted file mode 100644 index 2baab000..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_108_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_109_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_109_a.bmp deleted file mode 100644 index ca6c66d7..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_109_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_109_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_109_b.bmp deleted file mode 100644 index dddca720..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_109_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_10_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_10_a.bmp deleted file mode 100644 index e5a0e816..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_10_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_10_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_10_b.bmp deleted file mode 100644 index 361f0d81..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_10_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_110_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_110_a.bmp deleted file mode 100644 index 78820108..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_110_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_110_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_110_b.bmp deleted file mode 100644 index 942b4e1f..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_110_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_11_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_11_a.bmp deleted file mode 100644 index ccddadfd..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_11_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_11_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_11_b.bmp deleted file mode 100644 index 30475d79..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_11_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_12_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_12_a.bmp deleted file mode 100644 index fdf1ef7a..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_12_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_12_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_12_b.bmp deleted file mode 100644 index ee2a7546..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_12_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_13_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_13_a.bmp deleted file mode 100644 index 8ee3b3a8..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_13_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_13_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_13_b.bmp deleted file mode 100644 index 47f5b299..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_13_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_14_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_14_a.bmp deleted file mode 100644 index 0494ca12..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_14_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_14_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_14_b.bmp deleted file mode 100644 index 8992e370..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_14_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_15_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_15_a.bmp deleted file mode 100644 index bc449f12..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_15_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_15_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_15_b.bmp deleted file mode 100644 index c80cb003..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_15_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_16_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_16_a.bmp deleted file mode 100644 index 852c4b88..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_16_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_16_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_16_b.bmp deleted file mode 100644 index d8a2e3db..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_16_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_17_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_17_a.bmp deleted file mode 100644 index 47e32139..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_17_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_17_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_17_b.bmp deleted file mode 100644 index 9669aac6..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_17_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_18_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_18_a.bmp deleted file mode 100644 index 41fecd32..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_18_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_18_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_18_b.bmp deleted file mode 100644 index e20015e1..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_18_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_19_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_19_a.bmp deleted file mode 100644 index 4d0c6fa5..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_19_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_19_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_19_b.bmp deleted file mode 100644 index 8cae9ab6..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_19_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_1_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_1_a.bmp deleted file mode 100644 index 66164ea8..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_1_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_1_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_1_b.bmp deleted file mode 100644 index 09e7cd9f..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_1_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_20_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_20_a.bmp deleted file mode 100644 index 7b1ee3e8..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_20_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_20_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_20_b.bmp deleted file mode 100644 index d5044f69..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_20_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_21_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_21_a.bmp deleted file mode 100644 index 081cbbff..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_21_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_21_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_21_b.bmp deleted file mode 100644 index 7dfde6ab..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_21_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_22_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_22_a.bmp deleted file mode 100644 index 5c2e89a1..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_22_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_22_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_22_b.bmp deleted file mode 100644 index 29350177..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_22_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_23_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_23_a.bmp deleted file mode 100644 index 11077eb1..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_23_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_23_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_23_b.bmp deleted file mode 100644 index 601b6ad2..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_23_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_24_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_24_a.bmp deleted file mode 100644 index 0b709799..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_24_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_24_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_24_b.bmp deleted file mode 100644 index 11b2e967..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_24_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_25_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_25_a.bmp deleted file mode 100644 index fce2bc11..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_25_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_25_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_25_b.bmp deleted file mode 100644 index 44863915..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_25_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_26_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_26_a.bmp deleted file mode 100644 index 1e14d636..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_26_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_26_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_26_b.bmp deleted file mode 100644 index bec75824..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_26_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_27_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_27_a.bmp deleted file mode 100644 index 9848241c..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_27_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_27_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_27_b.bmp deleted file mode 100644 index e109bc3a..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_27_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_28_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_28_a.bmp deleted file mode 100644 index 8299c0d2..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_28_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_28_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_28_b.bmp deleted file mode 100644 index d966f8a1..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_28_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_29_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_29_a.bmp deleted file mode 100644 index a97fdcba..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_29_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_29_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_29_b.bmp deleted file mode 100644 index 1717e8cc..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_29_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_2_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_2_a.bmp deleted file mode 100644 index a2459562..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_2_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_2_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_2_b.bmp deleted file mode 100644 index bcd77d57..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_2_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_30_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_30_a.bmp deleted file mode 100644 index 16e21721..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_30_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_30_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_30_b.bmp deleted file mode 100644 index 7026a203..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_30_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_31_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_31_a.bmp deleted file mode 100644 index fda6646e..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_31_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_31_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_31_b.bmp deleted file mode 100644 index 482700ca..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_31_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_32_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_32_a.bmp deleted file mode 100644 index 7dfd4cbc..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_32_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_32_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_32_b.bmp deleted file mode 100644 index 8f1b3966..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_32_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_33_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_33_a.bmp deleted file mode 100644 index c4caa5e5..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_33_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_33_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_33_b.bmp deleted file mode 100644 index 595fdf39..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_33_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_34_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_34_a.bmp deleted file mode 100644 index 19e37aa7..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_34_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_34_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_34_b.bmp deleted file mode 100644 index c5b00635..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_34_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_35_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_35_a.bmp deleted file mode 100644 index 8e9429c4..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_35_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_35_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_35_b.bmp deleted file mode 100644 index ca6dd762..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_35_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_36_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_36_a.bmp deleted file mode 100644 index 5be451df..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_36_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_36_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_36_b.bmp deleted file mode 100644 index 539c420b..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_36_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_37_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_37_a.bmp deleted file mode 100644 index 2c344b16..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_37_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_37_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_37_b.bmp deleted file mode 100644 index 6838baa5..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_37_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_38_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_38_a.bmp deleted file mode 100644 index 676a411b..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_38_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_38_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_38_b.bmp deleted file mode 100644 index d91aa3e5..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_38_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_39_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_39_a.bmp deleted file mode 100644 index de2d2e1f..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_39_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_39_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_39_b.bmp deleted file mode 100644 index 1f3501c8..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_39_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_3_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_3_a.bmp deleted file mode 100644 index 4021357b..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_3_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_3_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_3_b.bmp deleted file mode 100644 index 5301c2b0..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_3_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_40_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_40_a.bmp deleted file mode 100644 index ba2c5f1a..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_40_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_40_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_40_b.bmp deleted file mode 100644 index bcc76bbc..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_40_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_41_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_41_a.bmp deleted file mode 100644 index 17897ebd..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_41_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_41_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_41_b.bmp deleted file mode 100644 index db7ff6f6..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_41_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_42_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_42_a.bmp deleted file mode 100644 index bd004d85..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_42_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_42_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_42_b.bmp deleted file mode 100644 index 23161696..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_42_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_43_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_43_a.bmp deleted file mode 100644 index 1d26bc6f..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_43_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_43_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_43_b.bmp deleted file mode 100644 index bf8edef3..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_43_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_44_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_44_a.bmp deleted file mode 100644 index e96f97c5..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_44_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_44_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_44_b.bmp deleted file mode 100644 index b09817ce..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_44_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_45_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_45_a.bmp deleted file mode 100644 index 770cf9cd..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_45_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_45_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_45_b.bmp deleted file mode 100644 index 6746b24c..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_45_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_46_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_46_a.bmp deleted file mode 100644 index f96e7001..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_46_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_46_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_46_b.bmp deleted file mode 100644 index 122dc9ae..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_46_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_47_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_47_a.bmp deleted file mode 100644 index fe57e59a..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_47_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_47_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_47_b.bmp deleted file mode 100644 index 358485e5..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_47_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_48_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_48_a.bmp deleted file mode 100644 index 8aa61b54..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_48_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_48_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_48_b.bmp deleted file mode 100644 index 4f62fe77..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_48_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_49_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_49_a.bmp deleted file mode 100644 index e10bc446..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_49_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_49_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_49_b.bmp deleted file mode 100644 index 3722d325..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_49_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_4_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_4_a.bmp deleted file mode 100644 index a2c379f6..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_4_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_4_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_4_b.bmp deleted file mode 100644 index 0954ddc4..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_4_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_50_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_50_a.bmp deleted file mode 100644 index c6f550ea..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_50_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_50_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_50_b.bmp deleted file mode 100644 index dc30439d..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_50_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_51_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_51_a.bmp deleted file mode 100644 index 57e58dcc..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_51_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_51_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_51_b.bmp deleted file mode 100644 index 89093066..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_51_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_52_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_52_a.bmp deleted file mode 100644 index b34f6129..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_52_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_52_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_52_b.bmp deleted file mode 100644 index 7159dcce..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_52_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_53_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_53_a.bmp deleted file mode 100644 index a4e6c37d..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_53_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_53_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_53_b.bmp deleted file mode 100644 index 369efd39..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_53_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_54_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_54_a.bmp deleted file mode 100644 index 978de0be..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_54_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_54_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_54_b.bmp deleted file mode 100644 index 63d31ad6..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_54_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_55_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_55_a.bmp deleted file mode 100644 index afdb8f4e..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_55_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_55_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_55_b.bmp deleted file mode 100644 index 1ca43358..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_55_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_56_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_56_a.bmp deleted file mode 100644 index 165ebe67..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_56_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_56_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_56_b.bmp deleted file mode 100644 index 4aca483f..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_56_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_57_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_57_a.bmp deleted file mode 100644 index 4adfbe2a..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_57_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_57_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_57_b.bmp deleted file mode 100644 index 6791b57d..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_57_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_58_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_58_a.bmp deleted file mode 100644 index b4ac74cb..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_58_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_58_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_58_b.bmp deleted file mode 100644 index c36d7c44..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_58_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_59_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_59_a.bmp deleted file mode 100644 index 6f246b9d..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_59_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_59_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_59_b.bmp deleted file mode 100644 index 31bc62bb..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_59_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_5_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_5_a.bmp deleted file mode 100644 index c532541e..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_5_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_5_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_5_b.bmp deleted file mode 100644 index 83aef12a..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_5_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_60_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_60_a.bmp deleted file mode 100644 index 8bd89182..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_60_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_60_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_60_b.bmp deleted file mode 100644 index f7d8fd39..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_60_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_61_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_61_a.bmp deleted file mode 100644 index d6fc0afc..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_61_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_61_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_61_b.bmp deleted file mode 100644 index 19276756..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_61_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_62_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_62_a.bmp deleted file mode 100644 index 2ad04a59..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_62_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_62_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_62_b.bmp deleted file mode 100644 index 0fe6f233..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_62_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_63_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_63_a.bmp deleted file mode 100644 index a428246b..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_63_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_63_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_63_b.bmp deleted file mode 100644 index 54492514..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_63_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_64_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_64_a.bmp deleted file mode 100644 index bed2fe89..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_64_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_64_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_64_b.bmp deleted file mode 100644 index f944d322..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_64_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_65_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_65_a.bmp deleted file mode 100644 index 4fede335..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_65_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_65_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_65_b.bmp deleted file mode 100644 index 6fac5d58..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_65_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_66_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_66_a.bmp deleted file mode 100644 index c85891de..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_66_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_66_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_66_b.bmp deleted file mode 100644 index 814d8cc5..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_66_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_67_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_67_a.bmp deleted file mode 100644 index 574f12a8..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_67_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_67_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_67_b.bmp deleted file mode 100644 index 0cee93ef..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_67_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_68_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_68_a.bmp deleted file mode 100644 index 443dd49a..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_68_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_68_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_68_b.bmp deleted file mode 100644 index 90feff98..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_68_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_69_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_69_a.bmp deleted file mode 100644 index 8a80e628..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_69_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_69_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_69_b.bmp deleted file mode 100644 index bf49301b..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_69_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_6_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_6_a.bmp deleted file mode 100644 index 68e38c7f..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_6_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_6_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_6_b.bmp deleted file mode 100644 index 46c2fe96..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_6_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_70_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_70_a.bmp deleted file mode 100644 index 62836c33..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_70_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_70_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_70_b.bmp deleted file mode 100644 index 9315395b..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_70_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_71_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_71_a.bmp deleted file mode 100644 index 1e6238dd..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_71_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_71_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_71_b.bmp deleted file mode 100644 index 060fa364..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_71_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_72_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_72_a.bmp deleted file mode 100644 index 9a1fd9cb..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_72_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_72_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_72_b.bmp deleted file mode 100644 index 668a0fd7..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_72_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_73_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_73_a.bmp deleted file mode 100644 index cd991217..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_73_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_73_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_73_b.bmp deleted file mode 100644 index b054038f..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_73_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_74_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_74_a.bmp deleted file mode 100644 index 64fd4b21..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_74_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_74_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_74_b.bmp deleted file mode 100644 index 73ff8338..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_74_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_75_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_75_a.bmp deleted file mode 100644 index 8e444649..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_75_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_75_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_75_b.bmp deleted file mode 100644 index 44a06017..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_75_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_76_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_76_a.bmp deleted file mode 100644 index cd8cf993..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_76_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_76_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_76_b.bmp deleted file mode 100644 index ea19d412..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_76_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_77_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_77_a.bmp deleted file mode 100644 index 450a6446..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_77_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_77_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_77_b.bmp deleted file mode 100644 index ad1a2b97..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_77_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_78_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_78_a.bmp deleted file mode 100644 index 2917fc88..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_78_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_78_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_78_b.bmp deleted file mode 100644 index eb80ac2d..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_78_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_79_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_79_a.bmp deleted file mode 100644 index 097ec351..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_79_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_79_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_79_b.bmp deleted file mode 100644 index 85b86456..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_79_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_7_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_7_a.bmp deleted file mode 100644 index a9f2e27f..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_7_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_7_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_7_b.bmp deleted file mode 100644 index 0747e2cc..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_7_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_80_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_80_a.bmp deleted file mode 100644 index 15e7ee02..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_80_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_80_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_80_b.bmp deleted file mode 100644 index 08ea7f63..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_80_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_81_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_81_a.bmp deleted file mode 100644 index 7ef7ecf0..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_81_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_81_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_81_b.bmp deleted file mode 100644 index f03a4706..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_81_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_82_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_82_a.bmp deleted file mode 100644 index 222a739a..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_82_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_82_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_82_b.bmp deleted file mode 100644 index 0b1cd300..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_82_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_83_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_83_a.bmp deleted file mode 100644 index 3c68904f..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_83_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_83_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_83_b.bmp deleted file mode 100644 index aaa4e84e..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_83_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_84_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_84_a.bmp deleted file mode 100644 index 43495d58..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_84_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_84_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_84_b.bmp deleted file mode 100644 index cd578404..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_84_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_85_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_85_a.bmp deleted file mode 100644 index f4ca7d51..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_85_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_85_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_85_b.bmp deleted file mode 100644 index 26e1e0d7..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_85_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_86_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_86_a.bmp deleted file mode 100644 index 56f63cef..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_86_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_86_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_86_b.bmp deleted file mode 100644 index f4d54471..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_86_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_87_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_87_a.bmp deleted file mode 100644 index da6a23a3..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_87_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_87_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_87_b.bmp deleted file mode 100644 index df3ad720..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_87_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_88_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_88_a.bmp deleted file mode 100644 index f219e51d..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_88_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_88_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_88_b.bmp deleted file mode 100644 index ca15eb10..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_88_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_89_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_89_a.bmp deleted file mode 100644 index c6bef6e3..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_89_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_89_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_89_b.bmp deleted file mode 100644 index 7d663400..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_89_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_8_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_8_a.bmp deleted file mode 100644 index 0377eded..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_8_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_8_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_8_b.bmp deleted file mode 100644 index 058ba1c8..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_8_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_90_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_90_a.bmp deleted file mode 100644 index d1e0859d..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_90_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_90_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_90_b.bmp deleted file mode 100644 index 346b9dcd..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_90_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_91_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_91_a.bmp deleted file mode 100644 index b77354cf..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_91_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_91_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_91_b.bmp deleted file mode 100644 index 1c8373a8..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_91_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_92_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_92_a.bmp deleted file mode 100644 index 36e27d3b..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_92_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_92_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_92_b.bmp deleted file mode 100644 index b819eb79..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_92_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_93_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_93_a.bmp deleted file mode 100644 index 6cb8cf6e..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_93_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_93_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_93_b.bmp deleted file mode 100644 index ab2b4cb5..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_93_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_94_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_94_a.bmp deleted file mode 100644 index b44b0bae..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_94_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_94_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_94_b.bmp deleted file mode 100644 index 158090b7..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_94_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_95_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_95_a.bmp deleted file mode 100644 index bf507e7f..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_95_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_95_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_95_b.bmp deleted file mode 100644 index 60cdc275..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_95_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_96_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_96_a.bmp deleted file mode 100644 index 5f392173..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_96_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_96_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_96_b.bmp deleted file mode 100644 index 5a37e16c..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_96_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_97_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_97_a.bmp deleted file mode 100644 index d3bf7ee7..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_97_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_97_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_97_b.bmp deleted file mode 100644 index 6776d827..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_97_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_98_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_98_a.bmp deleted file mode 100644 index 887b8b5d..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_98_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_98_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_98_b.bmp deleted file mode 100644 index e9606121..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_98_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_99_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_99_a.bmp deleted file mode 100644 index c0bd187c..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_99_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_99_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_99_b.bmp deleted file mode 100644 index adc7e054..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_99_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_9_a.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_9_a.bmp deleted file mode 100644 index e378d4bc..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_9_a.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/elem_9_b.bmp b/cls/appWidgets/ui/periodicTblebmps/elem_9_b.bmp deleted file mode 100644 index dd03e32a..00000000 Binary files a/cls/appWidgets/ui/periodicTblebmps/elem_9_b.bmp and /dev/null differ diff --git a/cls/appWidgets/ui/periodicTblebmps/lowcase b/cls/appWidgets/ui/periodicTblebmps/lowcase deleted file mode 100644 index 5f17ca2a..00000000 --- a/cls/appWidgets/ui/periodicTblebmps/lowcase +++ /dev/null @@ -1,109 +0,0 @@ -mv elem_1_a.BMP elem_1_a.bmp -mv elem_2_a.BMP elem_2_a.bmp -mv elem_3_a.BMP elem_3_a.bmp -mv elem_4_a.BMP elem_4_a.bmp -mv elem_5_a.BMP elem_5_a.bmp -mv elem_6_a.BMP elem_6_a.bmp -mv elem_7_a.BMP elem_7_a.bmp -mv elem_8_a.BMP elem_8_a.bmp -mv elem_9_a.BMP elem_9_a.bmp -mv elem_10_a.BMP elem_10_a.bmp -mv elem_11_a.BMP elem_11_a.bmp -mv elem_12_a.BMP elem_12_a.bmp -mv elem_13_a.BMP elem_13_a.bmp -mv elem_14_a.BMP elem_14_a.bmp -mv elem_15_a.BMP elem_15_a.bmp -mv elem_16_a.BMP elem_16_a.bmp -mv elem_17_a.BMP elem_17_a.bmp -mv elem_18_a.BMP elem_18_a.bmp -mv elem_19_a.BMP elem_19_a.bmp -mv elem_20_a.BMP elem_20_a.bmp -mv elem_21_a.BMP elem_21_a.bmp -mv elem_22_a.BMP elem_22_a.bmp -mv elem_23_a.BMP elem_23_a.bmp -mv elem_24_a.BMP elem_24_a.bmp -mv elem_25_a.BMP elem_25_a.bmp -mv elem_26_a.BMP elem_26_a.bmp -mv elem_27_a.BMP elem_27_a.bmp -mv elem_28_a.BMP elem_28_a.bmp -mv elem_29_a.BMP elem_29_a.bmp -mv elem_30_a.BMP elem_30_a.bmp -mv elem_31_a.BMP elem_31_a.bmp -mv elem_32_a.BMP elem_32_a.bmp -mv elem_33_a.BMP elem_33_a.bmp -mv elem_34_a.BMP elem_34_a.bmp -mv elem_35_a.BMP elem_35_a.bmp -mv elem_36_a.BMP elem_36_a.bmp -mv elem_37_a.BMP elem_37_a.bmp -mv elem_38_a.BMP elem_38_a.bmp -mv elem_39_a.BMP elem_39_a.bmp -mv elem_40_a.BMP elem_40_a.bmp -mv elem_41_a.BMP elem_41_a.bmp -mv elem_42_a.BMP elem_42_a.bmp -mv elem_43_a.BMP elem_43_a.bmp -mv elem_44_a.BMP elem_44_a.bmp -mv elem_45_a.BMP elem_45_a.bmp -mv elem_46_a.BMP elem_46_a.bmp -mv elem_47_a.BMP elem_47_a.bmp -mv elem_48_a.BMP elem_48_a.bmp -mv elem_49_a.BMP elem_49_a.bmp -mv elem_50_a.BMP elem_50_a.bmp -mv elem_51_a.BMP elem_51_a.bmp -mv elem_52_a.BMP elem_52_a.bmp -mv elem_53_a.BMP elem_53_a.bmp -mv elem_54_a.BMP elem_54_a.bmp -mv elem_55_a.BMP elem_55_a.bmp -mv elem_56_a.BMP elem_56_a.bmp -mv elem_57_a.BMP elem_57_a.bmp -mv elem_58_a.BMP elem_58_a.bmp -mv elem_59_a.BMP elem_59_a.bmp -mv elem_60_a.BMP elem_60_a.bmp -mv elem_61_a.BMP elem_61_a.bmp -mv elem_62_a.BMP elem_62_a.bmp -mv elem_63_a.BMP elem_63_a.bmp -mv elem_64_a.BMP elem_64_a.bmp -mv elem_65_a.BMP elem_65_a.bmp -mv elem_66_a.BMP elem_66_a.bmp -mv elem_67_a.BMP elem_67_a.bmp -mv elem_68_a.BMP elem_68_a.bmp -mv elem_69_a.BMP elem_69_a.bmp -mv elem_71_a.BMP elem_71_a.bmp -mv elem_72_a.BMP elem_72_a.bmp -mv elem_73_a.BMP elem_73_a.bmp -mv elem_74_a.BMP elem_74_a.bmp -mv elem_75_a.BMP elem_75_a.bmp -mv elem_76_a.BMP elem_76_a.bmp -mv elem_77_a.BMP elem_77_a.bmp -mv elem_78_a.BMP elem_78_a.bmp -mv elem_79_a.BMP elem_79_a.bmp -mv elem_80_a.BMP elem_80_a.bmp -mv elem_81_a.BMP elem_81_a.bmp -mv elem_82_a.BMP elem_82_a.bmp -mv elem_83_a.BMP elem_83_a.bmp -mv elem_84_a.BMP elem_84_a.bmp -mv elem_85_a.BMP elem_85_a.bmp -mv elem_86_a.BMP elem_86_a.bmp -mv elem_87_a.BMP elem_87_a.bmp -mv elem_88_a.BMP elem_88_a.bmp -mv elem_89_a.BMP elem_89_a.bmp -mv elem_90_a.BMP elem_90_a.bmp -mv elem_91_a.BMP elem_91_a.bmp -mv elem_92_a.BMP elem_92_a.bmp -mv elem_93_a.BMP elem_93_a.bmp -mv elem_94_a.BMP elem_94_a.bmp -mv elem_95_a.BMP elem_95_a.bmp -mv elem_96_a.BMP elem_96_a.bmp -mv elem_97_a.BMP elem_97_a.bmp -mv elem_98_a.BMP elem_98_a.bmp -mv elem_99_a.BMP elem_99_a.bmp -mv elem_100_a.BMP elem_100_a.bmp -mv elem_101_a.BMP elem_101_a.bmp -mv elem_102_a.BMP elem_102_a.bmp -mv elem_103_a.BMP elem_103_a.bmp -mv elem_104_a.BMP elem_104_a.bmp -mv elem_105_a.BMP elem_105_a.bmp -mv elem_106_a.BMP elem_106_a.bmp -mv elem_107_a.BMP elem_107_a.bmp -mv elem_108_a.BMP elem_108_a.bmp -mv elem_109_a.BMP elem_109_a.bmp -mv elem_110_a.BMP elem_110_a.bmp diff --git a/cls/appWidgets/ui/progress.ui b/cls/appWidgets/ui/progress.ui deleted file mode 100644 index e436b20e..00000000 --- a/cls/appWidgets/ui/progress.ui +++ /dev/null @@ -1,62 +0,0 @@ - - - Form - - - - 0 - 0 - 421 - 77 - - - - Form - - - - - - - - - - - 75 - true - - - - TextLabel - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - 0 - - - - - - - - - - diff --git a/cls/appWidgets/user_account/login.py b/cls/appWidgets/user_account/login.py index dca39dfb..5f9ef908 100644 --- a/cls/appWidgets/user_account/login.py +++ b/cls/appWidgets/user_account/login.py @@ -58,7 +58,7 @@ from cls.utils.log import get_module_logger, log_to_console, log_to_qt from cls.appWidgets.dialogs import questionMessage, info -from cls.appWidgets.enum import Enum +from cls.appWidgets.enum_class import Enum from cls.utils.cfgparser import ConfigClass diff --git a/cls/appWidgets/user_account/user_object.py b/cls/appWidgets/user_account/user_object.py index a5ea9f64..84ea9d41 100644 --- a/cls/appWidgets/user_account/user_object.py +++ b/cls/appWidgets/user_account/user_object.py @@ -8,7 +8,7 @@ from cls.utils.cfgparser import ConfigClass from cls.appWidgets.user_account.sample_holder_object import sample_holder_obj -from cls.appWidgets.enum import Enum +from cls.appWidgets.enum_class import Enum from cls.appWidgets.bl_config_loader import load_beamline_preset ACCESS_LVLS = Enum(["GUEST", "USER", "STAFF", "ADMIN"]) diff --git a/cls/appWidgets/user_account/usrAcctMgr.py b/cls/appWidgets/user_account/usrAcctMgr.py index e142de6d..30da6d89 100644 --- a/cls/appWidgets/user_account/usrAcctMgr.py +++ b/cls/appWidgets/user_account/usrAcctMgr.py @@ -58,7 +58,7 @@ from cls.utils.log import get_module_logger, log_to_console, log_to_qt from cls.appWidgets.dialogs import questionMessage, info -from cls.appWidgets.enum import Enum +from cls.appWidgets.enum_class import Enum from cls.utils.cfgparser import ConfigClass from cls.appWidgets.user_account.user_acct_utils import user_accnt_mgr diff --git a/cls/app_data/amb_bl10ID1_dflts.json b/cls/app_data/amb_bl10ID1_dflts.json deleted file mode 100644 index 4c3a8b43..00000000 --- a/cls/app_data/amb_bl10ID1_dflts.json +++ /dev/null @@ -1,638 +0,0 @@ -{ - "APP": { - "UI": { - "COLORS": { - "app_blue": "rgb(114, 148, 240);", - "app_drkblue": "rgb(0, 85, 255);", - "app_drkgray": "rgb(66, 69, 66);", - "app_green": "rgb(99, 142, 82);", - "app_ltblue": "rgb(115, 150, 247);", - "app_ltgray": "rgb(165, 165, 165);", - "app_ltgreen": "rgb(85,255,127);", - "app_medblue": "rgb(94,123, 209);", - "app_meddrkgray": "rgb(100, 100, 100);", - "app_medgray": "rgb(115, 113, 115);", - "app_red": "rgb(142,50,50);", - "app_superltgray": "rgb(205, 205, 205);", - "app_yellow": "rgb(236,236,0);", - "black": "rgb(0,0,0);", - "btn_pressed": "qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(94, 128, 220), stop:1 rgb(72, 99, 174));", - "fbk_moving_ylw": "rgb(254, 233, 0);", - "master_background_color": "rgb(115,113,115);", - "msg_color": "rgb(0, 0, 254);", - "plot_bckgrnd": "rgb(0,0,0);", - "plot_forgrnd": "rgb(2,116,255);", - "plot_gridmaj": "rgb(63,63,63);", - "plot_gridmin": "rgb(40,40,40);", - "scan_sts_blue": "rgb(60, 115, 235);", - "white": "rgb(255,255,255);" - } - } - }, - "PREFS": { - "DETECTORSPANEL": { - "COUNTER_APD": { - "COUNTER": "ctr1", - "DEVICE": "Dev3", - "ENABLED": false, - "SRC_CLK": "PFI2", - "SRC_TERM": "PFI1" - }, - "DNM_COUNTER_APD": { - "COUNTER": "ctr1", - "DEVICE": "Dev3", - "ENABLED": false, - "SRC_CLK": "PFI2", - "SRC_TERM": "PFI1" - }, - "DNM_PMT": { - "COUNTER": "ctr2", - "DEVICE": "Dev4", - "ENABLED": false, - "SRC_CLK": "PFI12", - "SRC_TERM": "PFI0" - }, - "PMT": { - "COUNTER": "ctr2", - "DEVICE": "Dev4", - "ENABLED": false, - "SRC_CLK": "PFI12", - "SRC_TERM": "PFI0" - } - }, - "FOCUSPARAMS": { - "OSA_PARAMS": [ - { - "D": 30.0, - "osa_id": 0 - }, - { - "D": 50.0, - "osa_id": 1 - }, - { - "D": 40.0, - "osa_id": 2 - } - ], - "ZP_FOCUS_PARAMS": { - "OSA_A0": 1010.0, - "OSA_A0MAX": 550.6572, - "OSA_D": 50.0, - "OSA_IDEAL_A0": 1000, - "OSA_IDX": 1, - "ZP_A1": -4.859, - "ZP_D": 240.0, - "ZP_IDX": 9 - } - }, - "PREFERENCESPARAMS": { - "AUTO_SAVE_FILE": true, - "MAX_POINTS": 101, - "MAX_VOLTS": 9.456, - "PREF_1": 0, - "PREF_2": true - } - }, - "PRESETS": { - "DETECTOR": { - "ABS_CENTER": [ - 586, - 259 - ], - "CALIBPOSN": [ - 183.02, - -165.42 - ], - "CENTER": [ - 0.0, - 0.0 - ] - }, - "OSA": { - "ABS_CENTER": [ - -2416, - 882.96 - ], - "ABS_OUT": [ - -4000, - null - ], - "CENTER": [ - 0, - 0, - 0.0, - 0.0 - ], - "OUT": [ - -4000, - null - ] - }, - "OSA_PARAMS": [ - { - "D": 30.0, - "osa_id": 1 - }, - { - "D": 50.0, - "osa_id": 2 - }, - { - "D": 40.0, - "osa_id": 3 - } - ], - "ZP_FOCUS_PARAMS": { - "OSA_A0": 534, - "OSA_A0MAX": 554, - "OSA_D": 50.0, - "OSA_IDEAL_A0": 534, - "OSA_IDX": 1, - "ZP_A1": -6.792, - "ZP_D": 240.0, - "ZP_IDX": 0 - } - }, - "SCAN": { - "COARSE_IMAGE": { - "CENTER": [ - 0.0, - 0.0, - 0, - 0 - ], - "DWELL": 10.0, - "NPOINTS": [ - 50, - 50, - 0, - 0 - ], - "RANGE": [ - 250.0, - 250.0, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 5.1020408163265305, - 5.1020408163265305, - 0, - 0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - }, - "DETECTOR": { - "CENTER": [ - 20.0, - 10.0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 5, - 5, - 0, - 0 - ], - "RANGE": [ - 400.0, - 400.0, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 100.0, - 100.0, - 0, - 0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "FOCUS": { - "CENTER": [ - 4087.02, - -33.95, - -2182.0, - 0 - ], - "DWELL": 10.0, - "NPOINTS": [ - 150, - 150, - 20, - 0 - ], - "RANGE": [ - 4406.67, - -33.95, - 50.0, - 0 - ], - "START": [ - 4087.02, - -33.95, - -7203.47, - 0 - ], - "STEP": [ - 2.1453020134228193, - 0.0, - 2.6315789473684212, - 0 - ], - "STOP": [ - 4406.67, - -33.95, - -7153.47, - 0 - ] - }, - "LINE": { - "CENTER": [ - 257.136, - 185.286, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 0, - 0 - ], - "RANGE": [ - 325.0, - 249.0, - 0, - 0 - ], - "START": [ - -25.0, - -50.0, - 0, - 0 - ], - "STEP": [ - 17.105263157894736, - 13.105263157894736, - 0, - 0 - ], - "STOP": [ - 300.0, - 199.0, - 0, - 0 - ] - }, - "OSA": { - "CENTER": [ - 0.0, - 0.0, - 0, - 0 - ], - "DWELL": 10.0, - "NPOINTS": [ - 3, - 3, - 0, - 0 - ], - "RANGE": [ - 10.0, - 10.0, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 5.0, - 5.0, - 0, - 0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "OSA_FOCUS": { - "CENTER": [ - -20.0, - 0.0, - -6963.4, - 0 - ], - "DWELL": 10.0, - "NPOINTS": [ - 10, - 10, - 10, - 0 - ], - "RANGE": [ - 20.0, - 0.0, - 200.0, - 0 - ], - "START": [ - -20.0, - 0.0, - -7275.9, - 0 - ], - "STEP": [ - 4.444444444444445, - 0.0, - 22.22222222222222, - 0 - ], - "STOP": [ - 20.0, - 0.0, - -7075.9, - 0 - ] - }, - "PATTERN_GEN": { - "CENTER": [ - 0.0, - 0.0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 0, - 0 - ], - "PAD1": "0", - "PAD2": "0", - "PAD3": "0", - "PAD4": "0", - "PAD5": "0", - "PAD6": "0", - "PAD7": "0", - "PAD8": "0", - "PAD9": "0", - "PAD_SIZE": "0", - "RANGE": [ - 5.0, - 5.0, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 0.2631578947368421, - 0.2631578947368421, - 0, - 0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - }, - "POINT": { - "CENTER": [ - 580, - 250, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 20, - 20 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.0, - 1.0, - 1.0, - 1.0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "POSITIONER": { - "CENTER": [ - -50.0, - 0, - 0, - 0 - ], - "DWELL": 100.0, - "NPOINTS": [ - 25, - 0, - 0, - 0 - ], - "RANGE": [ - 50.0, - 0, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 4.166666666666667, - 0, - 0, - 0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - }, - "PTYCHOGRAPHY": { - "CENTER": [ - -1.903, - 0.619, - 0, - 0 - ], - "DWELL": 300.0, - "IMG_FILE_FORMAT": "TIFF", - "NPOINTS": [ - 10, - 10, - 0, - 0 - ], - "RANGE": [ - 10, - 10, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.1111111111111112, - 1.1111111111111112, - 0, - 0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - }, - "SAMPLE_LXL": { - "CENTER": [ - 580, - 250, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 20, - 20 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.0, - 1.0, - 1.0, - 1.0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "SAMPLE_PXP": { - "CENTER": [ - 580, - 250, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 20, - 20 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.0, - 1.0, - 1.0, - 1.0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - } - } -} \ No newline at end of file diff --git a/cls/app_data/maxiv_pixelator_dflts.json b/cls/app_data/app_dflts.json similarity index 84% rename from cls/app_data/maxiv_pixelator_dflts.json rename to cls/app_data/app_dflts.json index e19dd539..070d02d5 100644 --- a/cls/app_data/maxiv_pixelator_dflts.json +++ b/cls/app_data/app_dflts.json @@ -48,7 +48,7 @@ "DNM_PMT": { "COUNTER": "ctr2", "DEVICE": "Dev4", - "ENABLED": true, + "ENABLED": false, "SRC_CLK": "PFI12", "SRC_TERM": "PFI0" }, @@ -76,14 +76,14 @@ } ], "ZP_FOCUS_PARAMS": { - "OSA_A0": 1010.0, + "OSA_A0": 320.0, "OSA_A0MAX": 550.6572, "OSA_D": 50.0, "OSA_IDEAL_A0": 1000, - "OSA_IDX": 0, + "OSA_IDX": 1, "ZP_A1": -4.859, "ZP_D": 240.0, - "ZP_IDX": 1 + "ZP_IDX": 5 } }, "PREFERENCESPARAMS": { @@ -101,8 +101,8 @@ 259 ], "CALIBPOSN": [ - 183.02, - -165.42 + 23.5, + 183.94 ], "CENTER": [ 0.0, @@ -128,50 +128,26 @@ -4000, null ] - }, - "OSA_PARAMS": [ - { - "D": 30.0, - "osa_id": 1 - }, - { - "D": 50.0, - "osa_id": 2 - }, - { - "D": 40.0, - "osa_id": 3 - } - ], - "ZP_FOCUS_PARAMS": { - "OSA_A0": 534, - "OSA_A0MAX": 554, - "OSA_D": 50.0, - "OSA_IDEAL_A0": 534, - "OSA_IDX": 1, - "ZP_A1": -6.792, - "ZP_D": 240.0, - "ZP_IDX": 0 } }, "SCAN": { "COARSE_IMAGE": { "CENTER": [ - 0.0, - 5500.0, + 5537.96, + 5389.79, 0, 0 ], - "DWELL": 50.0, + "DWELL": 3.0, "NPOINTS": [ - 125, - 125, + 25, + 25, 0, 0 ], "RANGE": [ - 250.0, - 250.0, + 200.0, + 200.0, 0, 0 ], @@ -182,8 +158,8 @@ -10.0 ], "STEP": [ - 2.0161290322580645, - 2.0161290322580645, + 8.333333333333334, + 8.333333333333334, 0, 0 ], @@ -203,14 +179,14 @@ ], "DWELL": 1.0, "NPOINTS": [ - 20, - 20, + 25, + 25, 0, 0 ], "RANGE": [ - 1000.0, - 1000.0, + 50.0, + 50.0, 0, 0 ], @@ -221,8 +197,8 @@ -10.0 ], "STEP": [ - 52.63157894736842, - 52.63157894736842, + 2.0833333333333335, + 2.0833333333333335, 0, 0 ], @@ -235,47 +211,47 @@ }, "FOCUS": { "CENTER": [ - -17.59, - 7.68, + 5487.04, + -305.1, -2182.0, 0 ], - "DWELL": 10.0, + "DWELL": 8.0, "NPOINTS": [ - 37, - 37, - 37, + 30, + 30, + 30, 0 ], "RANGE": [ - 18.51, - 7.68, - 20.0, + 5511.35, + -305.1, + 300.0, 0 ], "START": [ - -17.59, - 7.68, - -6988.99, + 5487.04, + -305.1, + -3276.04, 0 ], "STEP": [ - 1.0027777777777778, + 0.8382758620689793, 0.0, - 0.5555555555555556, + 10.344827586206897, 0 ], "STOP": [ - 18.51, - 7.68, - -6968.99, + 5511.35, + -305.1, + -2976.04, 0 ] }, "LINE": { "CENTER": [ - 0, - 0, + -614.669, + -245.68200000000002, 0, 0 ], @@ -287,26 +263,26 @@ 0 ], "RANGE": [ - 550.0, - 50.0, + 6.7139186339663866, + 3.345611300650944, 0, 0 ], "START": [ - -300.0, - -200.0, + 527.8820364627085, + -1407.5040150210343, 0, 0 ], "STEP": [ - 28.94736842105263, - 2.6315789473684212, + 0.3533641386298098, + 0.1760848052974181, 0, 0 ], "STOP": [ - 250.0, - -150.0, + 534.5959550966749, + -1404.1584037203834, 0, 0 ] @@ -326,8 +302,8 @@ 0 ], "RANGE": [ - 300.0, - 300.0, + 50.0, + 50.0, 0, 0 ], @@ -338,8 +314,8 @@ -10.0 ], "STEP": [ - 21.428571428571427, - 21.428571428571427, + 3.5714285714285716, + 3.5714285714285716, 0, 0 ], @@ -352,40 +328,40 @@ }, "OSA_FOCUS": { "CENTER": [ - -18.4, - -4.51, - 0.0, + -43.16, + 2.01, + -2000.0, 0 ], "DWELL": 10.0, "NPOINTS": [ + 15, + 15, 25, - 25, - 30, 0 ], "RANGE": [ - 14.98, - -4.51, - 200.0, + 10.68, + 2.01, + 500.0, 0 ], "START": [ - -18.4, - -4.51, - -3406.66, + -43.16, + 2.01, + -2483.3, 0 ], "STEP": [ - 1.3908333333333331, + 3.8457142857142856, 0.0, - 6.896551724137931, + 20.833333333333332, 0 ], "STOP": [ - 14.98, - -4.51, - -3206.66, + 10.68, + 2.01, + -1983.3000000000002, 0 ] }, @@ -479,20 +455,20 @@ }, "POSITIONER": { "CENTER": [ - -10000.0, + -50.0, 0, 0, 0 ], "DWELL": 1.0, "NPOINTS": [ - 250, + 50, 0, 0, 0 ], "RANGE": [ - 10000.0, + 50.0, 0, 0, 0 @@ -504,7 +480,7 @@ -10.0 ], "STEP": [ - 80.32128514056225, + 2.0408163265306123, 0, 0, 0 @@ -637,26 +613,26 @@ "TWO_VARIABLE": { "CENTER": [ 0.0, - 0.0, + 480.0, 0, 0 ], "DWELL": 1.0, "NPOINTS": [ 20, - 20, + 30, 0, 0 ], "RANGE": [ 20.0, - 100.0, + 580.0, 0, 0 ], "STEP": [ - 1.0, - 1.0, + 1.0526315789473684, + 3.4482758620689653, 0, 0 ] diff --git a/cls/app_data/basic_dflts.json b/cls/app_data/basic_dflts.json deleted file mode 100644 index 4719a723..00000000 --- a/cls/app_data/basic_dflts.json +++ /dev/null @@ -1,574 +0,0 @@ -{ - "APP": { - "UI": { - "COLORS": { - "app_blue": "rgb(114, 148, 240);", - "app_drkgray": "rgb(66, 69, 66);", - "app_green": "rgb(99, 142, 82);", - "app_ltgray": "rgb(165, 165, 165);", - "app_meddrkgray": "rgb(100, 100, 100);", - "app_medgray": "rgb(115, 113, 115);", - "app_yellow": "rgb(236,236,0);", - "master_background_color": "rgb(115,113,115);", - "msg_color": "rgb(0, 0, 254);", - "plot_bckgrnd": "rgb(0,0,0);", - "plot_forgrnd": "rgb(2,116,255);", - "plot_gridmaj": "rgb(63,63,63);", - "plot_gridmin": "rgb(40,40,40);" - } - } - }, - "PREFS": { - "DETECTORSPANEL": { - "COUNTER_APD": { - "COUNTER": "ctr1", - "DEVICE": "Dev3", - "ENABLED": false, - "SRC_CLK": "PFI2", - "SRC_TERM": "PFI1" - }, - "DNM_COUNTER_APD": { - "COUNTER": "ctr1", - "DEVICE": "Dev3", - "ENABLED": false, - "SRC_CLK": "PFI2", - "SRC_TERM": "PFI1" - }, - "DNM_PMT": { - "COUNTER": "ctr2", - "DEVICE": "Dev4", - "ENABLED": false, - "SRC_CLK": "PFI12", - "SRC_TERM": "PFI0" - }, - "PMT": { - "COUNTER": "ctr2", - "DEVICE": "Dev4", - "ENABLED": false, - "SRC_CLK": "PFI12", - "SRC_TERM": "PFI0" - }, - "STORAGERINGCURRENT": { - "ENABLED": false, - "HOST_ARCH": "win32-x86_debug", - "VER": "R3.14.12.4" - } - }, - "FOCUSPARAMS": { - "ZP_FOCUS_PARAMS": { - "OSA_A0": 1010.0, - "OSA_A0MAX": 1103.5072583333333, - "OSA_D": 40.0, - "OSA_IDEAL_A0": 1000, - "OSA_IDX": 1, - "ZP_A1": -7.77, - "ZP_D": 240.0, - "ZP_IDX": 8 - } - }, - "PREFERENCESPARAMS": { - "AUTO_SAVE_FILE": true, - "MAX_POINTS": 101, - "MAX_VOLTS": 9.456, - "PREF_1": 0, - "PREF_2": true - } - }, - "PRESETS": { - "DETECTOR": { - "ABS_CENTER": [ - 586, - 259 - ], - "CALIBPOSN": [ - -83.25, - -57.79 - ], - "CENTER": [ - 0.0, - 0.0 - ] - }, - "OSA": { - "ABS_CENTER": [ - -2416, - 882.96 - ], - "ABS_OUT": [ - 3000, - null - ], - "CENTER": [ - 0, - 0, - 0.0, - 0.0 - ], - "OUT": [ - 3000, - null - ] - } - }, - "SCAN": { - "COARSE_GONI": { - "CENTER": [ - -220.0, - -330.0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 5, - 6, - 0, - 0 - ], - "RANGE": [ - 200.0, - 200.0, - 0, - 0 - ], - "STEP": [ - 50.0, - 40.0, - 0, - 0 - ] - }, - "COARSE_IMAGE": { - "CENTER": [ - -191.36, - -75.49, - 0, - 0 - ], - "DWELL": 10.0, - "NPOINTS": [ - 150, - 150, - 0, - 0 - ], - "RANGE": [ - 1500.0, - 1500.0, - 0, - 0 - ], - "STEP": [ - 10.06711409395973, - 10.06711409395973, - 0, - 0 - ] - }, - "DETECTOR": { - "CENTER": [ - 0.0, - -2000.0, - 0, - 0 - ], - "DWELL": 5.0, - "NPOINTS": [ - 10, - 10, - 0, - 0 - ], - "RANGE": [ - 1500.0, - 1500.0, - 0, - 0 - ], - "STEP": [ - 166.66666666666666, - 166.66666666666666, - 0, - 0 - ] - }, - "FOCUS": { - "CENTER": [ - -726.82, - -328.92, - -2182.0, - 0 - ], - "DWELL": 10.0, - "NPOINTS": [ - 60, - 60, - 50, - 0 - ], - "RANGE": [ - 274.5, - -328.92, - 2500.0, - 0 - ], - "START": [ - -726.82, - -328.92, - -40206.03, - 0 - ], - "STEP": [ - 16.971525423728814, - 0.0, - 51.02040816326531, - 0 - ], - "STOP": [ - 274.5, - -328.92, - -37706.03, - 0 - ] - }, - "LINE": { - "CENTER": [ - -2.704, - 11.109, - 0, - 0 - ], - "DWELL": 2.0, - "NPOINTS": [ - 150, - 150, - 0, - 0 - ], - "RANGE": [ - 456.2987197724042, - 0.0, - 0, - 0 - ], - "START": [ - -1195.770106685633, - 444.0844523470839, - 0, - 0 - ], - "STEP": [ - 3.0624075152510346, - 0.0, - 0, - 0 - ], - "STOP": [ - -739.4713869132288, - 444.0844523470839, - 0, - 0 - ] - }, - "OSA": { - "CENTER": [ - 0.0, - 0.0, - 0, - 0 - ], - "DWELL": 5.0, - "NPOINTS": [ - 15, - 15, - 0, - 0 - ], - "RANGE": [ - 150.0, - 150.0, - 0, - 0 - ], - "STEP": [ - 10.714285714285714, - 10.714285714285714, - 0, - 0 - ] - }, - "OSA_FOCUS": { - "CENTER": [ - -77.0, - 0.0, - -204.85, - 0 - ], - "DWELL": 5.0, - "NPOINTS": [ - 20, - 20, - 20, - 0 - ], - "RANGE": [ - 77.0, - 0.0, - 3000.0, - 0 - ], - "START": [ - -77.0, - 0.0, - -40918.5, - 0 - ], - "STEP": [ - 8.105263157894736, - 0.0, - 157.89473684210526, - 0 - ], - "STOP": [ - 77.0, - 0.0, - -37918.5, - 0 - ] - }, - "PATTERN_GEN": { - "CENTER": [ - -5915.052007433538, - 492.6661186792368, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 60, - 120, - 0, - 0 - ], - "PAD1": "0", - "PAD2": "0", - "PAD3": "0", - "PAD4": "0", - "PAD5": "0", - "PAD6": "0", - "PAD7": "0", - "PAD8": "0", - "PAD9": "0", - "PAD_SIZE": "0", - "RANGE": [ - 52.97095448741402, - 105.94190897482753, - 0, - 0 - ], - "STEP": [ - 0.897812787922256, - 0.8902681426456099, - 0, - 0 - ] - }, - "POINT": { - "CENTER": [ - 586, - 259, - 0, - 0 - ], - "DWELL": 2.0, - "NPOINTS": [ - 20, - 20, - 0, - 0 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "STEP": [ - 1, - 1, - 0, - 0 - ] - }, - "POSITIONER": { - "CENTER": [ - -3000.0, - 0, - 0, - 0 - ], - "DWELL": 10.0, - "NPOINTS": [ - 100, - 0, - 0, - 0 - ], - "RANGE": [ - 3000.0, - 0, - 0, - 0 - ], - "STEP": [ - 60.60606060606061, - 0, - 0, - 0 - ] - }, - "PTYCHOGRAPHY": { - "CENTER": [ - 0.001, - 0.001, - 0, - 0 - ], - "DWELL": 1.0, - "IMG_FILE_FORMAT": "HDF5", - "NPOINTS": [ - 10, - 10, - 0, - 0 - ], - "RANGE": [ - 10, - 10, - 0, - 0 - ], - "STEP": [ - 1.1111111111111112, - 1.1111111111111112, - 0, - 0 - ] - }, - "PatternGen": { - "CENTER": [ - 0, - 0, - 0, - 0 - ], - "DWELL": 2.0, - "NPOINTS": [ - 20, - 20, - 0, - 0 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "STEP": [ - 1, - 1, - 0, - 0 - ] - }, - "SAMPLE_LXL": { - "CENTER": [ - 586, - 259, - 0, - 0 - ], - "DWELL": 2.0, - "NPOINTS": [ - 20, - 20, - 0, - 0 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "STEP": [ - 1, - 1, - 0, - 0 - ] - }, - "SAMPLE_PXP": { - "CENTER": [ - 586, - 259, - 0, - 0 - ], - "DWELL": 2.0, - "NPOINTS": [ - 20, - 20, - 0, - 0 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "STEP": [ - 1, - 1, - 0, - 0 - ] - }, - "TOMO": { - "CENTER": [ - 0, - 0, - 0, - 0.0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 0, - 0, - 0, - 3 - ], - "RANGE": [ - 0, - 0, - 0, - 10.0 - ], - "STEP": [ - 0, - 0, - 0, - 5.0 - ], - "ZPZ_ADJUST": [ - "0", - "0", - "0", - 0 - ] - } - }, - "fpath": "C:\\controls\\sandbox\\branches\\166\\pyStxm3\\cls\\app_data\\basic_dflts.json" -} \ No newline at end of file diff --git a/cls/app_data/cryo_bl10ID1_dflts.json b/cls/app_data/cryo_bl10ID1_dflts.json deleted file mode 100644 index b825ab64..00000000 --- a/cls/app_data/cryo_bl10ID1_dflts.json +++ /dev/null @@ -1,705 +0,0 @@ -{ - "APP": { - "UI": { - "COLORS": { - "app_blue": "rgb(114, 148, 240);", - "app_drkblue": "rgb(0, 85, 255);", - "app_drkgray": "rgb(66, 69, 66);", - "app_green": "rgb(99, 142, 82);", - "app_ltblue": "rgb(115, 150, 247);", - "app_ltgray": "rgb(165, 165, 165);", - "app_ltgreen": "rgb(85,255,127);", - "app_medblue": "rgb(94,123, 209);", - "app_meddrkgray": "rgb(100, 100, 100);", - "app_medgray": "rgb(115, 113, 115);", - "app_red": "rgb(142,50,50);", - "app_superltgray": "rgb(205, 205, 205);", - "app_yellow": "rgb(236,236,0);", - "black": "rgb(0,0,0);", - "btn_pressed": "qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(94, 128, 220), stop:1 rgb(72, 99, 174));", - "fbk_moving_ylw": "rgb(254, 233, 0);", - "master_background_color": "rgb(115,113,115);", - "msg_color": "rgb(0, 0, 254);", - "plot_bckgrnd": "rgb(0,0,0);", - "plot_forgrnd": "rgb(2,116,255);", - "plot_gridmaj": "rgb(63,63,63);", - "plot_gridmin": "rgb(40,40,40);", - "scan_sts_blue": "rgb(60, 115, 235);", - "white": "rgb(255,255,255);" - } - } - }, - "PREFS": { - "DETECTORSPANEL": { - "COUNTER_APD": { - "COUNTER": "ctr1", - "DEVICE": "Dev3", - "ENABLED": false, - "SRC_CLK": "PFI2", - "SRC_TERM": "PFI1" - }, - "DNM_COUNTER_APD": { - "COUNTER": "ctr1", - "DEVICE": "Dev3", - "ENABLED": false, - "SRC_CLK": "PFI2", - "SRC_TERM": "PFI1" - }, - "DNM_PMT": { - "COUNTER": "ctr2", - "DEVICE": "Dev4", - "ENABLED": true, - "SRC_CLK": "PFI12", - "SRC_TERM": "PFI0" - }, - "PMT": { - "COUNTER": "ctr2", - "DEVICE": "Dev4", - "ENABLED": false, - "SRC_CLK": "PFI12", - "SRC_TERM": "PFI0" - } - }, - "FOCUSPARAMS": { - "OSA_PARAMS": [ - { - "D": 30.0, - "osa_id": 0 - }, - { - "D": 50.0, - "osa_id": 1 - }, - { - "D": 40.0, - "osa_id": 2 - } - ], - "ZP_FOCUS_PARAMS": { - "OSA_A0": 1010.0, - "OSA_A0MAX": 550.6572, - "OSA_D": 50.0, - "OSA_IDEAL_A0": 1000, - "OSA_IDX": 0, - "ZP_A1": -4.859, - "ZP_D": 240.0, - "ZP_IDX": 1 - } - }, - "PREFERENCESPARAMS": { - "AUTO_SAVE_FILE": true, - "MAX_POINTS": 101, - "MAX_VOLTS": 9.456, - "PREF_1": 0, - "PREF_2": true - } - }, - "PRESETS": { - "DETECTOR": { - "ABS_CENTER": [ - 586, - 259 - ], - "CALIBPOSN": [ - 183.02, - -165.42 - ], - "CENTER": [ - 0.0, - 0.0 - ] - }, - "OSA": { - "ABS_CENTER": [ - -2416, - 882.96 - ], - "ABS_OUT": [ - -4000, - null - ], - "CENTER": [ - 0, - 0, - 0.0, - 0.0 - ], - "OUT": [ - -4000, - null - ] - }, - "OSA_PARAMS": [ - { - "D": 30.0, - "osa_id": 1 - }, - { - "D": 50.0, - "osa_id": 2 - }, - { - "D": 40.0, - "osa_id": 3 - } - ], - "ZP_FOCUS_PARAMS": { - "OSA_A0": 534, - "OSA_A0MAX": 554, - "OSA_D": 50.0, - "OSA_IDEAL_A0": 534, - "OSA_IDX": 1, - "ZP_A1": -6.792, - "ZP_D": 240.0, - "ZP_IDX": 0 - } - }, - "SCAN": { - "COARSE_IMAGE": { - "CENTER": [ - 0.0, - 5500.0, - 0, - 0 - ], - "DWELL": 50.0, - "NPOINTS": [ - 125, - 125, - 0, - 0 - ], - "RANGE": [ - 250.0, - 250.0, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 2.0161290322580645, - 2.0161290322580645, - 0, - 0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - }, - "DETECTOR": { - "CENTER": [ - 0.0, - 0.0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 0, - 0 - ], - "RANGE": [ - 1000.0, - 1000.0, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 52.63157894736842, - 52.63157894736842, - 0, - 0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "FOCUS": { - "CENTER": [ - -60.0, - -20.0, - -3890.24, - 0 - ], - "DWELL": 10.0, - "NPOINTS": [ - 77, - 77, - 37, - 0 - ], - "RANGE": [ - 60.0, - -20.0, - 500.0, - 0 - ], - "START": [ - -60.0, - -20.0, - -7243.98, - 0 - ], - "STEP": [ - 1.5789473684210527, - 0.0, - 13.88888888888889, - 0 - ], - "STOP": [ - 60.0, - -20.0, - -6743.98, - 0 - ] - }, - "LINE": { - "CENTER": [ - 0, - 0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 50, - 50, - 0, - 0 - ], - "RANGE": [ - 10.135429184549228, - 3.09891891891888, - 0, - 0 - ], - "START": [ - 2.0677789699570566, - 6.654729729729647, - 0, - 0 - ], - "STEP": [ - 0.20684549356222914, - 0.06324324324324244, - 0, - 0 - ], - "STOP": [ - 12.203208154506285, - 9.753648648648527, - 0, - 0 - ] - }, - "OSA": { - "CENTER": [ - 0.0, - 0.0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 15, - 15, - 0, - 0 - ], - "RANGE": [ - 300.0, - 300.0, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 21.428571428571427, - 21.428571428571427, - 0, - 0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "OSA_FOCUS": { - "CENTER": [ - -38.59, - -16.28, - -24002.0, - 0 - ], - "DWELL": 10.0, - "NPOINTS": [ - 50, - 50, - 30, - 0 - ], - "RANGE": [ - -3.48, - 1.13, - 200.0, - 0 - ], - "START": [ - -38.59, - -16.28, - -6850.74, - 0 - ], - "STEP": [ - 0.7165306122448981, - 0.3553061224489796, - 6.896551724137931, - 0 - ], - "STOP": [ - -3.48, - 1.13, - -6650.74, - 0 - ] - }, - "PATTERN_GEN": { - "CENTER": [ - 0.0, - 0.0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 0, - 0 - ], - "PAD1": "0", - "PAD2": "0", - "PAD3": "0", - "PAD4": "0", - "PAD5": "0", - "PAD6": "0", - "PAD7": "0", - "PAD8": "0", - "PAD9": "0", - "PAD_SIZE": "0", - "RANGE": [ - 5.0, - 5.0, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 0.2631578947368421, - 0.2631578947368421, - 0, - 0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - }, - "POINT": { - "CENTER": [ - 580, - 250, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 20, - 20 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.0, - 1.0, - 1.0, - 1.0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "POSITIONER": { - "CENTER": [ - -4.0, - 0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 1000, - 0, - 0, - 0 - ], - "RANGE": [ - 2.0, - 0, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 0.006006006006006006, - 0, - 0, - 0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - }, - "PTYCHOGRAPHY": { - "CENTER": [ - -1.903, - 0.619, - 0, - 0 - ], - "DWELL": 300.0, - "IMG_FILE_FORMAT": "TIFF", - "NPOINTS": [ - 10, - 10, - 0, - 0 - ], - "RANGE": [ - 10, - 10, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.1111111111111112, - 1.1111111111111112, - 0, - 0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - }, - "SAMPLE_LXL": { - "CENTER": [ - 580, - 250, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 20, - 20 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.0, - 1.0, - 1.0, - 1.0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "SAMPLE_PXP": { - "CENTER": [ - 580, - 250, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 20, - 20 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.0, - 1.0, - 1.0, - 1.0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "TWO_VARIABLE": { - "CENTER": [ - 0.0, - 0.0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 0, - 0 - ], - "RANGE": [ - 20.0, - 100.0, - 0, - 0 - ], - "STEP": [ - 1.0, - 1.0, - 0, - 0 - ] - }, - "TWO_VARIABLE_SCAN": { - "CENTER": [ - 0, - 0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 20, - 20 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.0, - 1.0, - 1.0, - 1.0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - } - }, - "fpath": "C:\\controls\\sandbox\\branches\\193\\pyStxm3\\cls\\app_data\\cryo_bl10ID1_dflts.json" -} \ No newline at end of file diff --git a/cls/app_data/defaults.py b/cls/app_data/defaults.py index 7c449186..e563f203 100644 --- a/cls/app_data/defaults.py +++ b/cls/app_data/defaults.py @@ -38,7 +38,7 @@ class Defaults(QtCore.QObject): changed = QtCore.pyqtSignal() - def __init__(self, fname, new=False): + def __init__(self, fname="app_dflts.json", new=False): super(Defaults, self).__init__() self.defdct = {} self.fpath = os.path.join(defaultsDir, fname) diff --git a/cls/app_data/sls_pixelator_dflts.json b/cls/app_data/sls_pixelator_dflts.json deleted file mode 100644 index aab2c333..00000000 --- a/cls/app_data/sls_pixelator_dflts.json +++ /dev/null @@ -1,704 +0,0 @@ -{ - "APP": { - "UI": { - "COLORS": { - "app_blue": "rgb(114, 148, 240);", - "app_drkblue": "rgb(0, 85, 255);", - "app_drkgray": "rgb(66, 69, 66);", - "app_green": "rgb(99, 142, 82);", - "app_ltblue": "rgb(115, 150, 247);", - "app_ltgray": "rgb(165, 165, 165);", - "app_ltgreen": "rgb(85,255,127);", - "app_medblue": "rgb(94,123, 209);", - "app_meddrkgray": "rgb(100, 100, 100);", - "app_medgray": "rgb(115, 113, 115);", - "app_red": "rgb(142,50,50);", - "app_superltgray": "rgb(205, 205, 205);", - "app_yellow": "rgb(236,236,0);", - "black": "rgb(0,0,0);", - "btn_pressed": "qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb(94, 128, 220), stop:1 rgb(72, 99, 174));", - "fbk_moving_ylw": "rgb(254, 233, 0);", - "master_background_color": "rgb(115,113,115);", - "msg_color": "rgb(0, 0, 254);", - "plot_bckgrnd": "rgb(0,0,0);", - "plot_forgrnd": "rgb(2,116,255);", - "plot_gridmaj": "rgb(63,63,63);", - "plot_gridmin": "rgb(40,40,40);", - "scan_sts_blue": "rgb(60, 115, 235);", - "white": "rgb(255,255,255);" - } - } - }, - "PREFS": { - "DETECTORSPANEL": { - "COUNTER_APD": { - "COUNTER": "ctr1", - "DEVICE": "Dev3", - "ENABLED": false, - "SRC_CLK": "PFI2", - "SRC_TERM": "PFI1" - }, - "DNM_COUNTER_APD": { - "COUNTER": "ctr1", - "DEVICE": "Dev3", - "ENABLED": false, - "SRC_CLK": "PFI2", - "SRC_TERM": "PFI1" - }, - "DNM_PMT": { - "COUNTER": "ctr2", - "DEVICE": "Dev4", - "ENABLED": true, - "SRC_CLK": "PFI12", - "SRC_TERM": "PFI0" - }, - "PMT": { - "COUNTER": "ctr2", - "DEVICE": "Dev4", - "ENABLED": false, - "SRC_CLK": "PFI12", - "SRC_TERM": "PFI0" - } - }, - "FOCUSPARAMS": { - "OSA_PARAMS": [ - { - "D": 30.0, - "osa_id": 0 - }, - { - "D": 50.0, - "osa_id": 1 - }, - { - "D": 40.0, - "osa_id": 2 - } - ], - "ZP_FOCUS_PARAMS": { - "OSA_A0": 1010.0, - "OSA_A0MAX": 550.6572, - "OSA_D": 50.0, - "OSA_IDEAL_A0": 1000, - "OSA_IDX": 0, - "ZP_A1": -4.859, - "ZP_D": 240.0, - "ZP_IDX": 1 - } - }, - "PREFERENCESPARAMS": { - "AUTO_SAVE_FILE": true, - "MAX_POINTS": 101, - "MAX_VOLTS": 9.456, - "PREF_1": 0, - "PREF_2": true - } - }, - "PRESETS": { - "DETECTOR": { - "ABS_CENTER": [ - 586, - 259 - ], - "CALIBPOSN": [ - 183.02, - -165.42 - ], - "CENTER": [ - 0.0, - 0.0 - ] - }, - "OSA": { - "ABS_CENTER": [ - -2416, - 882.96 - ], - "ABS_OUT": [ - -4000, - null - ], - "CENTER": [ - 0, - 0, - 0.0, - 0.0 - ], - "OUT": [ - -4000, - null - ] - }, - "OSA_PARAMS": [ - { - "D": 30.0, - "osa_id": 1 - }, - { - "D": 50.0, - "osa_id": 2 - }, - { - "D": 40.0, - "osa_id": 3 - } - ], - "ZP_FOCUS_PARAMS": { - "OSA_A0": 534, - "OSA_A0MAX": 554, - "OSA_D": 50.0, - "OSA_IDEAL_A0": 534, - "OSA_IDX": 1, - "ZP_A1": -6.792, - "ZP_D": 240.0, - "ZP_IDX": 0 - } - }, - "SCAN": { - "COARSE_IMAGE": { - "CENTER": [ - 0.0, - 5500.0, - 0, - 0 - ], - "DWELL": 50.0, - "NPOINTS": [ - 125, - 125, - 0, - 0 - ], - "RANGE": [ - 250.0, - 250.0, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 2.0161290322580645, - 2.0161290322580645, - 0, - 0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - }, - "DETECTOR": { - "CENTER": [ - 0.0, - 0.0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 0, - 0 - ], - "RANGE": [ - 1000.0, - 1000.0, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 52.63157894736842, - 52.63157894736842, - 0, - 0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "FOCUS": { - "CENTER": [ - -17.59, - 7.68, - -2182.0, - 0 - ], - "DWELL": 10.0, - "NPOINTS": [ - 37, - 37, - 37, - 0 - ], - "RANGE": [ - 18.51, - 7.68, - 20.0, - 0 - ], - "START": [ - -17.59, - 7.68, - -7003.98, - 0 - ], - "STEP": [ - 1.0027777777777778, - 0.0, - 0.5555555555555556, - 0 - ], - "STOP": [ - 18.51, - 7.68, - -6983.98, - 0 - ] - }, - "LINE": { - "CENTER": [ - 0.0, - 5000.0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 50, - 50, - 0, - 0 - ], - "RANGE": [ - 600.0, - 8000.0, - 0, - 0 - ], - "START": [ - -300.0, - 1000.0, - 0, - 0 - ], - "STEP": [ - 12.244897959183673, - 163.26530612244898, - 0, - 0 - ], - "STOP": [ - 300.0, - 9000.0, - 0, - 0 - ] - }, - "OSA": { - "CENTER": [ - 0.0, - 0.0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 15, - 15, - 0, - 0 - ], - "RANGE": [ - 300.0, - 300.0, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 21.428571428571427, - 21.428571428571427, - 0, - 0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "OSA_FOCUS": { - "CENTER": [ - -18.4, - -4.51, - 0.0, - 0 - ], - "DWELL": 10.0, - "NPOINTS": [ - 25, - 25, - 30, - 0 - ], - "RANGE": [ - 14.98, - -4.51, - 200.0, - 0 - ], - "START": [ - -18.4, - -4.51, - -6410.89, - 0 - ], - "STEP": [ - 1.3908333333333331, - 0.0, - 6.896551724137931, - 0 - ], - "STOP": [ - 14.98, - -4.51, - -6210.89, - 0 - ] - }, - "PATTERN_GEN": { - "CENTER": [ - 0.0, - 0.0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 0, - 0 - ], - "PAD1": "0", - "PAD2": "0", - "PAD3": "0", - "PAD4": "0", - "PAD5": "0", - "PAD6": "0", - "PAD7": "0", - "PAD8": "0", - "PAD9": "0", - "PAD_SIZE": "0", - "RANGE": [ - 5.0, - 5.0, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 0.2631578947368421, - 0.2631578947368421, - 0, - 0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - }, - "POINT": { - "CENTER": [ - 580, - 250, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 20, - 20 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.0, - 1.0, - 1.0, - 1.0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "POSITIONER": { - "CENTER": [ - -500.0, - 0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 250, - 0, - 0, - 0 - ], - "RANGE": [ - 1500.0, - 0, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 8.032128514056225, - 0, - 0, - 0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - }, - "PTYCHOGRAPHY": { - "CENTER": [ - -1.903, - 0.619, - 0, - 0 - ], - "DWELL": 300.0, - "IMG_FILE_FORMAT": "TIFF", - "NPOINTS": [ - 10, - 10, - 0, - 0 - ], - "RANGE": [ - 10, - 10, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.1111111111111112, - 1.1111111111111112, - 0, - 0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - }, - "SAMPLE_LXL": { - "CENTER": [ - 580, - 250, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 20, - 20 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.0, - 1.0, - 1.0, - 1.0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "SAMPLE_PXP": { - "CENTER": [ - 580, - 250, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 20, - 20 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "START": [ - 570.0, - 240.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.0, - 1.0, - 1.0, - 1.0 - ], - "STOP": [ - 590.0, - 260.0, - 10.0, - 10.0 - ] - }, - "TWO_VARIABLE": { - "CENTER": [ - 0.0, - 0.0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 0, - 0 - ], - "RANGE": [ - 20.0, - 100.0, - 0, - 0 - ], - "STEP": [ - 1.0, - 1.0, - 0, - 0 - ] - }, - "TWO_VARIABLE_SCAN": { - "CENTER": [ - 0, - 0, - 0, - 0 - ], - "DWELL": 1.0, - "NPOINTS": [ - 20, - 20, - 20, - 20 - ], - "RANGE": [ - 20, - 20, - 0, - 0 - ], - "START": [ - -10.0, - -10.0, - -10.0, - -10.0 - ], - "STEP": [ - 1.0, - 1.0, - 1.0, - 1.0 - ], - "STOP": [ - 10.0, - 10.0, - 10.0, - 10.0 - ] - } - } -} \ No newline at end of file diff --git a/cls/applications/pyStxm/app.ini b/cls/applications/pyStxm/app.ini index 663b0076..347206d2 100644 --- a/cls/applications/pyStxm/app.ini +++ b/cls/applications/pyStxm/app.ini @@ -4,8 +4,8 @@ autoSaveData = true # which beamline configuration to use for the devices, this is the name of the .ini file in the bl_configs directory # of the same name __.ini -bl_config = sls_x07da_polLux -# bl_config = amb_bl10ID1 +# bl_config = sls_x07da_polLux +bl_config = amb_bl10ID1 # bl_config = uhv_bl10ID1 mongo_db_nm = pystxm_amb_bl10ID1 nx_server_port = 5555 diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/amb_bl10ID1.ini b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/amb_bl10ID1.ini index 04600829..f4c3c728 100644 --- a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/amb_bl10ID1.ini +++ b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/amb_bl10ID1.ini @@ -1,6 +1,6 @@ [BL_CFG_MAIN] -beamline_desc=CLS SM 10ID2 +beamline_desc=CLS SM 10ID-1 endstation_name=Ambient STXM endstation_prefix=amb_bl10ID1 dcs_backend=epics @@ -25,10 +25,18 @@ default_detector=DNM_PMT #support for Pixelator required override the plugin dir so that it will use the common pixelator scan plugins plugin_dir=amb_bl10ID1 +# from teh cls/plot_widgets/shapes/sample_holders directory +sample_holder_shape_class=Standard6HoleHolderShape +# sample_holder_shape_class=CryoGoniometerHolderShape + +# osa_holder_shape_class=OSAHorizontalRowHolderShape +osa_holder_shape_class=OSALaddPtychoHolderShape [POSITIONER_PANEL_EXCLUDE_LIST] # COARSE_SAMPLEFINE exclude_list = [ + "DNM_COARSE_X", + "DNM_COARSE_Y", "DNM_GONI_X", "DNM_GONI_Y", "DNM_GONI_Z", @@ -61,14 +69,13 @@ sig_src_term_pfi = 8 #PFI for pmt signal input det_scan = 0 osa_scan = 1 osa_focus_scan = 2 -coarse_image_scan = 3 -fine_image_scans = 4 -focus_scan = 5 -fine_point_scan = 6 -line_scan = 7 -positioner_scan = 8 -pattern_gen_scan = 9 -ptychography_scan = 10 +sample_image_scans = 3 +focus_scan = 4 +fine_point_scan = 5 +line_scan = 6 +positioner_scan = 7 +pattern_gen_scan = 8 +ptychography_scan = 9 [SCAN_PANEL_STXM_SCAN_TYPES] # this maps scan module names to defined stxm scan types in nxstxm nexus application definition @@ -78,8 +85,7 @@ ptychography_scan = 10 det_scan = detector image osa_scan = osa image osa_focus_scan = osa focus -coarse_image_scan = sample image, sample image stack -fine_image_scans = sample image, sample image stack +sample_image_scans = sample image, sample image stack focus_scan = sample focus fine_point_scan = sample point spectrum line_scan = sample line spectrum @@ -127,7 +133,8 @@ xpos_6=5000 ypos_6=0 xi0pos=-46.7 yi0pos=-8000 -sample_circle_diam=1000 +sample_circle_diam=2500 +osa_out_position=5000 [SAMPLE_IMAGE_LXL] #um @@ -144,6 +151,7 @@ max_coarse_y=7000 max_fine_x=200 max_fine_y=200 + #[GONI_ZONEPLATE] ##these need to be setup depending on sample scanning or zoneplate scanning #max_coarse_x=70 @@ -160,16 +168,16 @@ max_fine_y=200 [ZP_DEFS] -zp0 = {'name': 'ZonePlate 0', 'zp_id':0, 'a1':-4.840,'D':100.0, 'CsD':45.0, 'OZone': 60.0} -zp1 = {'name': 'ZonePlate 1', 'zp_id':1, 'a1':-6.792,'D':240.0, 'CsD':90.0, 'OZone': 35.0} -zp2 = {'name': 'ZonePlate 2', 'zp_id':2, 'a1':-7.767,'D':240.0, 'CsD':90.0, 'OZone': 40.0} -zp3 = {'name': 'ZonePlate 3', 'zp_id':3, 'a1':-4.524,'D':140.0, 'CsD':60.0, 'OZone': 40.0} -zp4 = {'name': 'ZonePlate 4', 'zp_id':4, 'a1':-4.859,'D':240.0, 'CsD':95.0, 'OZone': 25.0} -zp5 = {'name': 'ZonePlate 5', 'zp_id':5, 'a1': -4.857, 'D': 240.0, 'CsD': 95.0, 'OZone': 25.0} -zp6 = {'name': 'ZonePlate 6', 'zp_id':6, 'a1': -5.067, 'D': 250.0, 'CsD': 100.0, 'OZone': 25.0} -zp7 = {'name': 'ZonePlate 7', 'zp_id':7, 'a1': -6.789, 'D': 159.0, 'CsD': 111.0, 'OZone': 35.0} -zp8 = {'name': 'ZonePlate 8', 'zp_id':8, 'a1': -35.835, 'D': 5000.0, 'CsD': 111.0, 'OZone': 35.0} -zp9 = {'name': 'ZonePlate 9', 'zp_id':9, 'a1': -11.358981, 'D': 280.0, 'CsD': 100.0, 'OZone': 50.0} +zp0 = {'name': 'ZonePlate 0', 'zp_id':0, 'a1':4.840,'D':100.0, 'CsD':45.0, 'OZone': 60.0} +zp1 = {'name': 'ZonePlate 1', 'zp_id':1, 'a1':6.792,'D':240.0, 'CsD':90.0, 'OZone': 35.0} +zp2 = {'name': 'ZonePlate 2', 'zp_id':2, 'a1':7.767,'D':240.0, 'CsD':90.0, 'OZone': 40.0} +zp3 = {'name': 'ZonePlate 3', 'zp_id':3, 'a1':4.524,'D':140.0, 'CsD':60.0, 'OZone': 40.0} +zp4 = {'name': 'ZonePlate 4', 'zp_id':4, 'a1':4.859,'D':240.0, 'CsD':95.0, 'OZone': 25.0} +zp5 = {'name': 'ZonePlate 5', 'zp_id':5, 'a1':4.85471, 'D': 240.0, 'CsD': 95.0, 'OZone': 25.0} +zp6 = {'name': 'ZonePlate 6', 'zp_id':6, 'a1':5.067, 'D': 250.0, 'CsD': 100.0, 'OZone': 25.0} +zp7 = {'name': 'ZonePlate 7', 'zp_id':7, 'a1':6.789, 'D': 159.0, 'CsD': 111.0, 'OZone': 35.0} +zp8 = {'name': 'ZonePlate 8', 'zp_id':8, 'a1':35.835, 'D': 5000.0, 'CsD': 111.0, 'OZone': 35.0} +zp9 = {'name': 'ZonePlate 9', 'zp_id':9, 'a1':11.358981, 'D': 280.0, 'CsD': 100.0, 'OZone': 50.0} [OSA_DEFS] diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/device_db.json b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/device_db.json index 2d437cfc..40a3ee55 100644 --- a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/device_db.json +++ b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/device_db.json @@ -1 +1 @@ -{"_default": {"1": {"category": "DETECTORS", "devtype": "SIS3820ScalarDevice", "name": "DNM_SIS3820", "dcs_nm": "MCS1610-310-01:", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "con_chk_nm": "mcs:startScan", "pos_type": ""}, "2": {"category": "DETECTORS", "devtype": "make_basedevice", "name": "DNM_PMT", "dcs_nm": "ASTXM1610:Ci-D1C2:cntr:SingleValue_RBV", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "3": {"category": "DETECTORS", "devtype": "TucsenDetector", "name": "DNM_TUCSEN_AD", "dcs_nm": "SCMOS1610-310:", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "4": {"category": "DIO", "devtype": "PvShutter", "name": "DNM_SHUTTER", "dcs_nm": "uhvDIO:shutter:ctl", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "5": {"category": "DIO", "devtype": "make_basedevice", "name": "DNM_SHUTTERTASKRUN", "dcs_nm": "uhvDIO:shutter:Run", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "6": {"category": "E712", "devtype": "E712ControlWidget", "name": "DNM_E712_WIDGET", "dcs_nm": "ASTXM1610:E712:", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "con_chk_nm": "CommStatus_RBV", "pos_type": ""}, "7": {"category": "E712", "devtype": "E712WGDevice", "name": "DNM_E712_OPHYD_DEV", "dcs_nm": "ASTXM1610:E712:", "connected": true, "sim": false, "enable": true, "units": "", "desc": "E712 wavgenerator flyer device", "rd_only": false, "con_chk_nm": "CommStatus_RBV", "pos_type": ""}, "8": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DWELLS", "dcs_nm": "ASTXM1610:E712:dwells", "connected": true, "sim": false, "enable": true, "units": "mA", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "9": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_XRESETPOSNS", "dcs_nm": "ASTXM1610:E712:xreset:posns", "connected": true, "sim": false, "enable": true, "units": "um", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "10": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_YRESETPOSNS", "dcs_nm": "ASTXM1610:E712:yreset:posns", "connected": true, "sim": false, "enable": true, "units": "um", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "11": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_SP_IDS", "dcs_nm": "ASTXM1610:E712:sp_roi:ids", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "12": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_CURRENT_SP_ID", "dcs_nm": "ASTXM1610:E712:sp_roi:current", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "13": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_START_POS", "dcs_nm": "ASTXM1610:E712:XStartPos", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "14": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_START_POS", "dcs_nm": "ASTXM1610:E712:YStartPos", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "15": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_0", "dcs_nm": "ASTXM1610:E712:ddl:0", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "16": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_1", "dcs_nm": "ASTXM1610:E712:ddl:1", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "17": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_2", "dcs_nm": "ASTXM1610:E712:ddl:2", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "18": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_3", "dcs_nm": "ASTXM1610:E712:ddl:3", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "19": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_4", "dcs_nm": "ASTXM1610:E712:ddl:4", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "20": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_5", "dcs_nm": "ASTXM1610:E712:ddl:5", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "21": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_6", "dcs_nm": "ASTXM1610:E712:ddl:6", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "22": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_7", "dcs_nm": "ASTXM1610:E712:ddl:7", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "23": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_8", "dcs_nm": "ASTXM1610:E712:ddl:8", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "24": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_9", "dcs_nm": "ASTXM1610:E712:ddl:9", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "25": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_IMAGE_IDX", "dcs_nm": "ASTXM1610:E712:image_idx", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "26": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_SCAN_MODE", "dcs_nm": "ASTXM1610:E712:ScanMode", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "27": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_START_MODE", "dcs_nm": "ASTXM1610:E712:WavTbl1StartMode", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "28": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_START_MODE", "dcs_nm": "ASTXM1610:E712:WavTbl2StartMode", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "29": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_WAVTBL_IDS", "dcs_nm": "ASTXM1610:E712:wg1_tbl:ids", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "30": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_WAVTBL_IDS", "dcs_nm": "ASTXM1610:E712:wg2_tbl:ids", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "31": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_NPTS", "dcs_nm": "ASTXM1610:E712:wg1:npts", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "32": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_NPTS", "dcs_nm": "ASTXM1610:E712:wg2:npts", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "33": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_USEDDL", "dcs_nm": "ASTXM1610:E712:WavTbl1UseDDL", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "34": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_USEDDL", "dcs_nm": "ASTXM1610:E712:WavTbl2UseDDL", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "35": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_USEREINIT", "dcs_nm": "ASTXM1610:E712:WavTbl1UseReinitDDL", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "36": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_USEREINIT", "dcs_nm": "ASTXM1610:E712:WavTbl2UseReinitDDL", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "37": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_STRT_AT_END", "dcs_nm": "ASTXM1610:E712:WavTbl1StartAtEndPos", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "38": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_STRT_AT_END", "dcs_nm": "ASTXM1610:E712:WavTbl2StartAtEndPos", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "39": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_USE_TBL_NUM", "dcs_nm": "ASTXM1610:E712:WavGen1UseTblNum", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "40": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_USE_TBL_NUM", "dcs_nm": "ASTXM1610:E712:WavGen2UseTblNum", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "41": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_SSPND_CTRLR_FBK", "dcs_nm": "ASTXM1610:E712:SuspendCtrlrFbk", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "42": {"category": "POSITIONERS", "devtype": "e712_sample_motor", "name": "DNM_SAMPLE_FINE_X", "dcs_nm": "PZAC1610-3-I12-40", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Fine_X", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "43": {"category": "POSITIONERS", "devtype": "e712_sample_motor", "name": "DNM_SAMPLE_FINE_Y", "dcs_nm": "PZAC1610-3-I12-41", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Fine_Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "44": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_OSA_X", "dcs_nm": "PZAC1610-3-I12-43", "connected": true, "sim": false, "enable": true, "units": "", "desc": "OSA_X", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "45": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_OSA_Y", "dcs_nm": "PZAC1610-3-I12-44", "connected": true, "sim": false, "enable": true, "units": "", "desc": "OSA_Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "46": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_ZONEPLATE_Z", "dcs_nm": "SMTR1610-3-I12-51", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "47": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_COARSE_X", "dcs_nm": "SMTR1610-3-I12-45", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Coarse_X", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "48": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_COARSE_Y", "dcs_nm": "SMTR1610-3-I12-46", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Coarse_Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "49": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_COARSE_Z", "dcs_nm": "SMTR1610-3-I12-47", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Coarse_Z", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "50": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_DETECTOR_X", "dcs_nm": "SMTR1610-3-I12-48", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Detector_X", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "51": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_DETECTOR_Y", "dcs_nm": "SMTR1610-3-I12-49", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Detector_Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "52": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_DETECTOR_Z", "dcs_nm": "SMTR1610-3-I12-50", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Detector_Z", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "53": {"category": "POSITIONERS", "devtype": "sample_abstract_motor", "name": "DNM_SAMPLE_X", "dcs_nm": "PSMTR1610-3-I12-00", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Sample_X", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "54": {"category": "POSITIONERS", "devtype": "sample_abstract_motor", "name": "DNM_SAMPLE_Y", "dcs_nm": "PSMTR1610-3-I12-01", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Sample_Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "55": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_ENERGY", "dcs_nm": "BL1610-I10:ENERGY", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Energy", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "56": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_SLIT_X", "dcs_nm": "BL1610-I10:slitX", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Slit_X", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "57": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_SLIT_Y", "dcs_nm": "BL1610-I10:slitY", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Slit_Y", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "58": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_M3_PITCH", "dcs_nm": "BL1610-I10:m3STXMPitch", "connected": true, "sim": false, "enable": true, "units": "", "desc": "M3_Pitch", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "59": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_EPU_GAP", "dcs_nm": "BL1610-I10:epuGap", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Epu_Gap", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "60": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_EPU_OFFSET", "dcs_nm": "BL1610-I10:epuOffset", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Epu_Offset", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "61": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_EPU_HARMONIC", "dcs_nm": "BL1610-I10:epuHarmonic", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Epu_Harmonic", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "62": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_EPU_POLARIZATION", "dcs_nm": "BL1610-I10:epuPolarization", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Polarization", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "63": {"category": "POSITIONERS", "devtype": "Motor_Qt", "name": "DNM_EPU_ANGLE", "dcs_nm": "BL1610-I10:epuAngle", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Epu_Angle", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "64": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1410-01:vac:p", "dcs_nm": "CCG1410-01:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.1", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "65": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1410-I00-01:vac:p", "dcs_nm": "CCG1410-I00-01:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.2", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "66": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1410-I00-02:vac:p", "dcs_nm": "CCG1410-I00-02:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.4", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "67": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-1-I00-02:vac:p", "dcs_nm": "CCG1610-1-I00-02:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.6", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "68": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "HCG1610-1-I00-01:vac:p", "dcs_nm": "HCG1610-1-I00-01:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.7", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "69": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-1-I00-03:vac:p", "dcs_nm": "CCG1610-1-I00-03:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.8", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "70": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-I10-01:vac:p", "dcs_nm": "CCG1610-I10-01:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.10", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "71": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-I10-03:vac:p", "dcs_nm": "CCG1610-I10-03:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.12", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "72": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-I10-04:vac:p", "dcs_nm": "CCG1610-I10-04:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.13", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "73": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-I12-01:vac:p", "dcs_nm": "CCG1610-I12-01:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.14", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "74": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-I12-02:vac:p", "dcs_nm": "CCG1610-I12-02:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.15", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "75": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-3-I12-01:vac:p", "dcs_nm": "CCG1610-3-I12-01:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.16", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "76": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_FINE_ACCEL_DIST_PRCNT", "dcs_nm": "SIM_FINEIMAGE:ACCEL_DIST_PRCNT", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "77": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_FINE_DECCEL_DIST_PRCNT", "dcs_nm": "SIM_FINEIMAGE:DECCEL_DIST_PRCNT", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "78": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_CRS_ACCEL_DIST_PRCNT", "dcs_nm": "SIM_COARSEIMAGE:ACCEL_DIST_PRCNT", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "79": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_CRS_DECCEL_DIST_PRCNT", "dcs_nm": "SIM_COARSEIMAGE:DECCEL_DIST_PRCNT", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "80": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_CALCD_ZPZ", "dcs_nm": "ASTXM1610:bl_api:zp:fbk:tr.I", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "81": {"category": "PVS", "devtype": "Bo", "name": "DNM_RESET_INTERFERS", "dcs_nm": "PSMTR1610-3-I12-00:reset_interfers", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "82": {"category": "PVS", "devtype": "Bo", "name": "DNM_SFX_AUTOZERO", "dcs_nm": "PZAC1610-3-I12-40:AutoZero", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "83": {"category": "PVS", "devtype": "Bo", "name": "DNM_SFY_AUTOZERO", "dcs_nm": "PZAC1610-3-I12-41:AutoZero", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "84": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_ZPZ_ADJUST", "dcs_nm": "ASTXM1610:bl_api:zp:adjust_zpz", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "85": {"category": "PVS", "devtype": "Mbbo", "name": "DNM_ZONEPLATE_SCAN_MODE", "dcs_nm": "ASTXM1610:bl_api:zp:scanselflag", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "86": {"category": "PVS", "devtype": "Mbbo", "name": "DNM_ZONEPLATE_SCAN_MODE_RBV", "dcs_nm": "ASTXM1610:bl_api:zp:scanselflag", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "87": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_DELTA_A0", "dcs_nm": "ASTXM1610:bl_api:delta_A0", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "88": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_IDEAL_A0", "dcs_nm": "ASTXM1610:bl_api:zp:fbk:tr.K", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "89": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_CALCD_ZPZ", "dcs_nm": "ASTXM1610:bl_api:zp:fbk:tr.I", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "90": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_ZPZ_ADJUST", "dcs_nm": "ASTXM1610:bl_api:zp:adjust_zpz", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "91": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_FOCAL_LENGTH", "dcs_nm": "ASTXM1610:bl_api:zp:FL", "connected": true, "sim": false, "enable": true, "units": "um", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "92": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_A0", "dcs_nm": "ASTXM1610:bl_api:A0", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "93": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_A0MAX", "dcs_nm": "ASTXM1610:bl_api:A0Max", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "94": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_ZPZ_POS", "dcs_nm": "ASTXM1610:bl_api:zp:zpz_pos", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "95": {"category": "PVS", "devtype": "Bo", "name": "DNM_ENERGY_ENABLE", "dcs_nm": "ASTXM1610:bl_api:enabled", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "96": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_ENERGY_RBV", "dcs_nm": "BL1610-I10:ENERGY.RBV", "connected": true, "sim": false, "enable": true, "units": "um", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "97": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_ZPZ_RBV", "dcs_nm": "SMTR1610-3-I12-51.RBV", "connected": true, "sim": false, "enable": true, "units": "um", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "98": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_ZP_DEF_A", "dcs_nm": "ASTXM1610:bl_api:zp:def.A", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "99": {"category": "PVS", "devtype": "Transform", "name": "DNM_ZP_DEF", "dcs_nm": "ASTXM1610:bl_api:zp:def", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "100": {"category": "PVS", "devtype": "Transform", "name": "DNM_OSA_DEF", "dcs_nm": "ASTXM1610:bl_api:osa:def", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "101": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_SYSTEM_MODE_FBK", "dcs_nm": "SYSTEM:mode:fbk", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "102": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_SRSTATUS_SHUTTERS", "dcs_nm": "SRStatus:shutters", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "103": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_MONO_EV_FBK", "dcs_nm": "SM01PGM01:ENERGY_MON", "connected": true, "sim": false, "enable": true, "units": "eV", "desc": "No description in config", "rd_only": true, "pos_type": ""}, "104": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_BEAM_DEFOCUS", "dcs_nm": "ASTXM1610:bl_api:zp:defocus", "connected": true, "sim": false, "enable": true, "units": "um", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "105": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_AX1_INTERFER_VOLTS", "dcs_nm": "ASTXM1610:Ai:ai0_RBV", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": true, "pos_type": ""}, "106": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_SFX_PIEZO_VOLTS", "dcs_nm": "PZAC1610-3-I12-40:OutputVolt_RBV", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": true, "pos_type": ""}, "107": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_SFY_PIEZO_VOLTS", "dcs_nm": "PZAC1610-3-I12-41:OutputVolt_RBV", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": true, "pos_type": ""}, "108": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_AX2_INTERFER_VOLTS", "dcs_nm": "ASTXM1610:Ai:ai1_RBV", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": true, "pos_type": ""}, "109": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_RING_CURRENT", "dcs_nm": "PCT1402-01:mA:fbk", "connected": true, "sim": false, "enable": true, "units": "mA", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "110": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_BASELINE_RING_CURRENT", "dcs_nm": "PCT1402-01:mA:fbk", "connected": true, "sim": false, "enable": true, "units": "mA", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "111": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_DFLT_PMT_DWELL", "dcs_nm": "MCS1610-310-01:mcs:delay", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "112": {"category": "PVS_DONT_RECORD", "devtype": "make_basedevice", "name": "DNM_TICKER", "dcs_nm": "TRG2400:cycles", "connected": true, "sim": false, "enable": true, "units": "counts", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "113": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-01", "dcs_nm": "TM1610-3-I12-01", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Turbo cooling water", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "114": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-30", "dcs_nm": "TM1610-3-I12-30", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Sample Coarse Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "115": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-32", "dcs_nm": "TM1610-3-I12-32", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Detector Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "116": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-21", "dcs_nm": "TM1610-3-I12-21", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Chamber temp #1", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "117": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-22", "dcs_nm": "TM1610-3-I12-22", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Chamber temp #2", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "118": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-23", "dcs_nm": "TM1610-3-I12-23", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Chamber temp #3", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "119": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-24", "dcs_nm": "TM1610-3-I12-24", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Chamber temp #4", "rd_only": false, "pos_type": "POS_TYPE_ES"}}} \ No newline at end of file +{"_default": {"1": {"category": "DETECTORS", "devtype": "SIS3820ScalarDevice", "name": "DNM_SIS3820", "dcs_nm": "MCS1610-310-01:", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "con_chk_nm": "mcs:startScan", "pos_type": ""}, "2": {"category": "DETECTORS", "devtype": "make_basedevice", "name": "DNM_PMT", "dcs_nm": "ASTXM1610:Ci-D1C2:cntr:SingleValue_RBV", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "3": {"category": "DETECTORS", "devtype": "TucsenDetector", "name": "DNM_TUCSEN_AD", "dcs_nm": "SCMOS1610-310:", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "4": {"category": "DIO", "devtype": "DCSShutter", "name": "DNM_SHUTTER", "dcs_nm": "uhvDIO:shutter:ctl", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "5": {"category": "DIO", "devtype": "make_basedevice", "name": "DNM_SHUTTERTASKRUN", "dcs_nm": "uhvDIO:shutter:Run", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "6": {"category": "E712", "devtype": "E712ControlWidget", "name": "DNM_E712_WIDGET", "dcs_nm": "ASTXM1610:E712:", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "con_chk_nm": "CommStatus_RBV", "pos_type": ""}, "7": {"category": "E712", "devtype": "E712WGDevice", "name": "DNM_E712_OPHYD_DEV", "dcs_nm": "ASTXM1610:E712:", "connected": true, "sim": false, "enable": true, "units": "", "desc": "E712 wavgenerator flyer device", "rd_only": false, "con_chk_nm": "CommStatus_RBV", "pos_type": ""}, "8": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DWELLS", "dcs_nm": "ASTXM1610:E712:dwells", "connected": true, "sim": false, "enable": true, "units": "mA", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "9": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_XRESETPOSNS", "dcs_nm": "ASTXM1610:E712:xreset:posns", "connected": true, "sim": false, "enable": true, "units": "um", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "10": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_YRESETPOSNS", "dcs_nm": "ASTXM1610:E712:yreset:posns", "connected": true, "sim": false, "enable": true, "units": "um", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "11": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_SP_IDS", "dcs_nm": "ASTXM1610:E712:sp_roi:ids", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "12": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_CURRENT_SP_ID", "dcs_nm": "ASTXM1610:E712:sp_roi:current", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "13": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_START_POS", "dcs_nm": "ASTXM1610:E712:XStartPos", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "14": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_START_POS", "dcs_nm": "ASTXM1610:E712:YStartPos", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "15": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_0", "dcs_nm": "ASTXM1610:E712:ddl:0", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "16": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_1", "dcs_nm": "ASTXM1610:E712:ddl:1", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "17": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_2", "dcs_nm": "ASTXM1610:E712:ddl:2", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "18": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_3", "dcs_nm": "ASTXM1610:E712:ddl:3", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "19": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_4", "dcs_nm": "ASTXM1610:E712:ddl:4", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "20": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_5", "dcs_nm": "ASTXM1610:E712:ddl:5", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "21": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_6", "dcs_nm": "ASTXM1610:E712:ddl:6", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "22": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_7", "dcs_nm": "ASTXM1610:E712:ddl:7", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "23": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_8", "dcs_nm": "ASTXM1610:E712:ddl:8", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "24": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_DDL_TBL_9", "dcs_nm": "ASTXM1610:E712:ddl:9", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "25": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_IMAGE_IDX", "dcs_nm": "ASTXM1610:E712:image_idx", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "26": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_SCAN_MODE", "dcs_nm": "ASTXM1610:E712:ScanMode", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "27": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_START_MODE", "dcs_nm": "ASTXM1610:E712:WavTbl1StartMode", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "28": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_START_MODE", "dcs_nm": "ASTXM1610:E712:WavTbl2StartMode", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "29": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_WAVTBL_IDS", "dcs_nm": "ASTXM1610:E712:wg1_tbl:ids", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "30": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_WAVTBL_IDS", "dcs_nm": "ASTXM1610:E712:wg2_tbl:ids", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "31": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_NPTS", "dcs_nm": "ASTXM1610:E712:wg1:npts", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "32": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_NPTS", "dcs_nm": "ASTXM1610:E712:wg2:npts", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "33": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_USEDDL", "dcs_nm": "ASTXM1610:E712:WavTbl1UseDDL", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "34": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_USEDDL", "dcs_nm": "ASTXM1610:E712:WavTbl2UseDDL", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "35": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_USEREINIT", "dcs_nm": "ASTXM1610:E712:WavTbl1UseReinitDDL", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "36": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_USEREINIT", "dcs_nm": "ASTXM1610:E712:WavTbl2UseReinitDDL", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "37": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_STRT_AT_END", "dcs_nm": "ASTXM1610:E712:WavTbl1StartAtEndPos", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "38": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_STRT_AT_END", "dcs_nm": "ASTXM1610:E712:WavTbl2StartAtEndPos", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "39": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_X_USE_TBL_NUM", "dcs_nm": "ASTXM1610:E712:WavGen1UseTblNum", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "40": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_Y_USE_TBL_NUM", "dcs_nm": "ASTXM1610:E712:WavGen2UseTblNum", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "41": {"category": "E712", "devtype": "make_basedevice", "name": "DNM_E712_SSPND_CTRLR_FBK", "dcs_nm": "ASTXM1610:E712:SuspendCtrlrFbk", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "42": {"category": "ENERGY_DEV", "devtype": "EnergyDevice", "name": "DNM_ENERGY_DEVICE", "dcs_nm": "BL1610-I10:ENERGY", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Energy device that includes focussing", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "43": {"category": "POSITIONERS", "devtype": "e712_sample_motor", "name": "DNM_SAMPLE_FINE_X", "dcs_nm": "PZAC1610-3-I12-40", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Fine_X", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "44": {"category": "POSITIONERS", "devtype": "e712_sample_motor", "name": "DNM_SAMPLE_FINE_Y", "dcs_nm": "PZAC1610-3-I12-41", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Fine_Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "45": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_OSA_X", "dcs_nm": "PZAC1610-3-I12-43", "connected": true, "sim": false, "enable": true, "units": "", "desc": "OSA_X", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "46": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_OSA_Y", "dcs_nm": "PZAC1610-3-I12-44", "connected": true, "sim": false, "enable": true, "units": "", "desc": "OSA_Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "47": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_ZONEPLATE_Z", "dcs_nm": "SMTR1610-3-I12-51", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "48": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_COARSE_X", "dcs_nm": "SMTR1610-3-I12-45", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Coarse_X", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "49": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_COARSE_Y", "dcs_nm": "SMTR1610-3-I12-46", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Coarse_Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "50": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_COARSE_Z", "dcs_nm": "SMTR1610-3-I12-47", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Coarse_Z", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "51": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_DETECTOR_X", "dcs_nm": "SMTR1610-3-I12-48", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Detector_X", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "52": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_DETECTOR_Y", "dcs_nm": "SMTR1610-3-I12-49", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Detector_Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "53": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_DETECTOR_Z", "dcs_nm": "SMTR1610-3-I12-50", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Detector_Z", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "54": {"category": "POSITIONERS", "devtype": "sample_abstract_motor", "name": "DNM_SAMPLE_X", "dcs_nm": "PSMTR1610-3-I12-00", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Sample_X", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "55": {"category": "POSITIONERS", "devtype": "sample_abstract_motor", "name": "DNM_SAMPLE_Y", "dcs_nm": "PSMTR1610-3-I12-01", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Sample_Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "56": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_ENERGY", "dcs_nm": "BL1610-I10:ENERGY", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Energy", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "57": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_SLIT_X", "dcs_nm": "BL1610-I10:slitX", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Slit_X", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "58": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_SLIT_Y", "dcs_nm": "BL1610-I10:slitY", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Slit_Y", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "59": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_M3_PITCH", "dcs_nm": "BL1610-I10:m3STXMPitch", "connected": true, "sim": false, "enable": true, "units": "", "desc": "M3_Pitch", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "60": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_EPU_GAP", "dcs_nm": "BL1610-I10:epuGap", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Epu_Gap", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "61": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_EPU_OFFSET", "dcs_nm": "BL1610-I10:epuOffset", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Epu_Offset", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "62": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_EPU_HARMONIC", "dcs_nm": "BL1610-I10:epuHarmonic", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Epu_Harmonic", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "63": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_EPU_POLARIZATION", "dcs_nm": "BL1610-I10:epuPolarization", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Polarization", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "64": {"category": "POSITIONERS", "devtype": "MotorQt", "name": "DNM_EPU_ANGLE", "dcs_nm": "BL1610-I10:epuAngle", "connected": true, "sim": false, "enable": true, "units": "", "desc": "Epu_Angle", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "65": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1410-01:vac:p", "dcs_nm": "CCG1410-01:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.1", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "66": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1410-I00-01:vac:p", "dcs_nm": "CCG1410-I00-01:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.2", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "67": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1410-I00-02:vac:p", "dcs_nm": "CCG1410-I00-02:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.4", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "68": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-1-I00-02:vac:p", "dcs_nm": "CCG1610-1-I00-02:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.6", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "69": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "HCG1610-1-I00-01:vac:p", "dcs_nm": "HCG1610-1-I00-01:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.7", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "70": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-1-I00-03:vac:p", "dcs_nm": "CCG1610-1-I00-03:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.8", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "71": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-I10-01:vac:p", "dcs_nm": "CCG1610-I10-01:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.10", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "72": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-I10-03:vac:p", "dcs_nm": "CCG1610-I10-03:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.12", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "73": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-I10-04:vac:p", "dcs_nm": "CCG1610-I10-04:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.13", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "74": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-I12-01:vac:p", "dcs_nm": "CCG1610-I12-01:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.14", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "75": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-I12-02:vac:p", "dcs_nm": "CCG1610-I12-02:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.15", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "76": {"category": "PRESSURES", "devtype": "make_basedevice", "name": "CCG1610-3-I12-01:vac:p", "dcs_nm": "CCG1610-3-I12-01:vac:p", "connected": true, "sim": false, "enable": true, "units": "torr", "desc": "Sec.16", "rd_only": false, "pos_type": "POS_TYPE_BL"}, "77": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_RETURN_VELO", "dcs_nm": "SIM_SCAN:return_velo", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "78": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_FINE_ACCEL_DIST_PRCNT", "dcs_nm": "SIM_FINEIMAGE:ACCEL_DIST_PRCNT", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "79": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_FINE_DECCEL_DIST_PRCNT", "dcs_nm": "SIM_FINEIMAGE:DECCEL_DIST_PRCNT", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "80": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_CRS_ACCEL_DIST_PRCNT", "dcs_nm": "SIM_COARSEIMAGE:ACCEL_DIST_PRCNT", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "81": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_CRS_DECCEL_DIST_PRCNT", "dcs_nm": "SIM_COARSEIMAGE:DECCEL_DIST_PRCNT", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "82": {"category": "PVS", "devtype": "Bo", "name": "DNM_RESET_INTERFERS", "dcs_nm": "PSMTR1610-3-I12-00:reset_interfers", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "83": {"category": "PVS", "devtype": "Bo", "name": "DNM_SFX_AUTOZERO", "dcs_nm": "PZAC1610-3-I12-40:AutoZero", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "84": {"category": "PVS", "devtype": "Bo", "name": "DNM_SFY_AUTOZERO", "dcs_nm": "PZAC1610-3-I12-41:AutoZero", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "85": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_CALCD_ZPZ", "dcs_nm": "ASTXM1610:bl_api:zp:fbk:tr.I", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "86": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_ZPZ_ADJUST", "dcs_nm": "ASTXM1610:bl_api:zp:adjust_zpz", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "87": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_ZONEPLATE_FOCUS_MODE", "dcs_nm": "ASTXM1610:bl_api:zp:scanselflag", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "88": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_DELTA_A0", "dcs_nm": "ASTXM1610:bl_api:delta_A0", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "89": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_IDEAL_A0", "dcs_nm": "ASTXM1610:bl_api:zp:fbk:tr.K", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "90": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_CALCD_ZPZ", "dcs_nm": "ASTXM1610:bl_api:zp:fbk:tr.I", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "91": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_ZPZ_ADJUST", "dcs_nm": "ASTXM1610:bl_api:zp:adjust_zpz", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "92": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_FOCAL_LENGTH", "dcs_nm": "ASTXM1610:bl_api:zp:FL", "connected": false, "sim": false, "enable": true, "units": "um", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "93": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_A0", "dcs_nm": "ASTXM1610:bl_api:A0", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "94": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_A0MAX", "dcs_nm": "ASTXM1610:bl_api:A0Max", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "95": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_ZPZ_POS", "dcs_nm": "ASTXM1610:bl_api:zp:zpz_pos", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "96": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_BEAM_DEFOCUS", "dcs_nm": "ASTXM1610:bl_api:zp:defocus", "connected": false, "sim": false, "enable": true, "units": "um", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "97": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_ZP_A1", "dcs_nm": "ASTXM1610:bl_api:zp:def.A", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "98": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_ZP_DEF", "dcs_nm": "ASTXM1610:bl_api:zp:def", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "99": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_OSA_DEF", "dcs_nm": "ASTXM1610:bl_api:osa:def", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "100": {"category": "PVS", "devtype": "make_base_simdevice", "name": "DNM_ENERGY_ENABLE", "dcs_nm": "ASTXM1610:bl_api:enabled", "connected": false, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "101": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_ENERGY_RBV", "dcs_nm": "BL1610-I10:ENERGY.RBV", "connected": true, "sim": false, "enable": true, "units": "um", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "102": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_ZPZ_RBV", "dcs_nm": "SMTR1610-3-I12-51.RBV", "connected": true, "sim": false, "enable": true, "units": "um", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "103": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_SYSTEM_MODE_FBK", "dcs_nm": "SYSTEM:mode:fbk", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "104": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_SRSTATUS_SHUTTERS", "dcs_nm": "SRStatus:shutters", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "105": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_MONO_EV_FBK", "dcs_nm": "SM01PGM01:ENERGY_MON", "connected": true, "sim": false, "enable": true, "units": "eV", "desc": "No description in config", "rd_only": true, "pos_type": ""}, "106": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_AX1_INTERFER_VOLTS", "dcs_nm": "ASTXM1610:Ai:ai0_RBV", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": true, "pos_type": ""}, "107": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_SFX_PIEZO_VOLTS", "dcs_nm": "PZAC1610-3-I12-40:OutputVolt_RBV", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": true, "pos_type": ""}, "108": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_SFY_PIEZO_VOLTS", "dcs_nm": "PZAC1610-3-I12-41:OutputVolt_RBV", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": true, "pos_type": ""}, "109": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_AX2_INTERFER_VOLTS", "dcs_nm": "ASTXM1610:Ai:ai1_RBV", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": true, "pos_type": ""}, "110": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_RING_CURRENT", "dcs_nm": "PCT1402-01:mA:fbk", "connected": true, "sim": false, "enable": true, "units": "mA", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "111": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_BASELINE_RING_CURRENT", "dcs_nm": "PCT1402-01:mA:fbk", "connected": true, "sim": false, "enable": true, "units": "mA", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "112": {"category": "PVS", "devtype": "make_basedevice", "name": "DNM_DFLT_PMT_DWELL", "dcs_nm": "MCS1610-310-01:mcs:delay", "connected": true, "sim": false, "enable": true, "units": "", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "113": {"category": "PVS_DONT_RECORD", "devtype": "make_basedevice", "name": "DNM_TICKER", "dcs_nm": "TRG2400:cycles", "connected": true, "sim": false, "enable": true, "units": "counts", "desc": "No description in config", "rd_only": false, "pos_type": ""}, "114": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-01", "dcs_nm": "TM1610-3-I12-01", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Turbo cooling water", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "115": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-30", "dcs_nm": "TM1610-3-I12-30", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Sample Coarse Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "116": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-32", "dcs_nm": "TM1610-3-I12-32", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Detector Y", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "117": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-21", "dcs_nm": "TM1610-3-I12-21", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Chamber temp #1", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "118": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-22", "dcs_nm": "TM1610-3-I12-22", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Chamber temp #2", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "119": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-23", "dcs_nm": "TM1610-3-I12-23", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Chamber temp #3", "rd_only": false, "pos_type": "POS_TYPE_ES"}, "120": {"category": "TEMPERATURES", "devtype": "make_basedevice", "name": "TM1610-3-I12-24", "dcs_nm": "TM1610-3-I12-24", "connected": true, "sim": false, "enable": true, "units": "deg C", "desc": "UVH Chamber temp #4", "rd_only": false, "pos_type": "POS_TYPE_ES"}}} \ No newline at end of file diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/devs.py b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/devs.py index 6426c478..aa38deeb 100644 --- a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/devs.py +++ b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/devs.py @@ -1,5 +1,5 @@ -SIM = True +SIM = False dev_dct = {} dev_dct["POSITIONERS"] = [ { @@ -129,6 +129,8 @@ "abstract_mtr": True, "pos_type": "POS_TYPE_BL", }, + + { "name": "DNM_SLIT_X", "desc": "Slit_X", @@ -195,6 +197,7 @@ "abstract_mtr": True, "pos_type": "POS_TYPE_BL", }, + ] # if the sig_name is not itself a PV but is only a prefix, profide the con_chk_nm field dev_dct["DIO"] = [ @@ -255,6 +258,12 @@ ] dev_dct["PVS"] = [ + { + "name": "DNM_RETURN_VELO", + "class": "make_basedevice", + "cat": "PVS", + "dcs_nm": "SIM_SCAN:return_velo", + }, { "name": "DNM_FINE_ACCEL_DIST_PRCNT", "class": "make_basedevice", @@ -279,12 +288,6 @@ "cat": "PVS", "dcs_nm": "SIM_COARSEIMAGE:DECCEL_DIST_PRCNT", }, - { - "name": "DNM_CALCD_ZPZ", - "class": "make_basedevice", - "cat": "PVS", - "dcs_nm": "ASTXM1610:bl_api:zp:fbk:tr.I", - }, { "name": "DNM_RESET_INTERFERS", "class": "Bo", @@ -303,109 +306,133 @@ "cat": "PVS", "dcs_nm": "PZAC1610-3-I12-41:AutoZero", }, +# used to control which value gets sent to Zpz, fl or fl - A0 + # {'name': 'DNM_ZONEPLATE_INOUT', 'class': 'Bo', 'dcs_nm': 'BL1610-I12:zp_inout'}, + # {'name': 'DNM_ZONEPLATE_INOUT_FBK', 'class': 'Mbbi', 'dcs_nm': 'ASTXM1610:bl_api:zp_inout:fbk'}, + # used to convieniently move zp z in and out + { - "name": "DNM_ZPZ_ADJUST", - "class": "make_basedevice", + "name": "DNM_CALCD_ZPZ", + "class": "make_base_simdevice", "cat": "PVS", - "dcs_nm": "ASTXM1610:bl_api:zp:adjust_zpz", + "dcs_nm": "ASTXM1610:bl_api:zp:fbk:tr.I", }, { - "name": "DNM_ZONEPLATE_SCAN_MODE", - "class": "Mbbo", - "dcs_nm": "ASTXM1610:bl_api:zp:scanselflag", + "name": "DNM_ZPZ_ADJUST", + "class": "make_base_simdevice", + "cat": "PVS", + "dcs_nm": "ASTXM1610:bl_api:zp:adjust_zpz", }, { - "name": "DNM_ZONEPLATE_SCAN_MODE_RBV", - "class": "Mbbo", + "name": "DNM_ZONEPLATE_FOCUS_MODE", + "class": "make_base_simdevice", "dcs_nm": "ASTXM1610:bl_api:zp:scanselflag", }, - # used to control which value gets sent to Zpz, fl or fl - A0 - # {'name': 'DNM_ZONEPLATE_INOUT', 'class': 'Bo', 'dcs_nm': 'BL1610-I12:zp_inout'}, - # {'name': 'DNM_ZONEPLATE_INOUT_FBK', 'class': 'Mbbi', 'dcs_nm': 'ASTXM1610:bl_api:zp_inout:fbk'}, - # used to convieniently move zp z in and out + # { + # "name": "DNM_ZONEPLATE_SCAN_MODE_RBV", + # "class": "make_base_simdevice", + # "dcs_nm": "ASTXM1610:bl_api:zp:scanselflag", + # }, + { "name": "DNM_DELTA_A0", - "class": "make_basedevice", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "ASTXM1610:bl_api:delta_A0", }, { "name": "DNM_IDEAL_A0", - "class": "make_basedevice", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "ASTXM1610:bl_api:zp:fbk:tr.K", }, { "name": "DNM_CALCD_ZPZ", - "class": "make_basedevice", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "ASTXM1610:bl_api:zp:fbk:tr.I", }, { "name": "DNM_ZPZ_ADJUST", - "class": "make_basedevice", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "ASTXM1610:bl_api:zp:adjust_zpz", }, { "name": "DNM_FOCAL_LENGTH", - "class": "make_basedevice", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "ASTXM1610:bl_api:zp:FL", "units": "um", }, { "name": "DNM_A0", - "class": "make_basedevice", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "ASTXM1610:bl_api:A0", }, { "name": "DNM_A0MAX", - "class": "make_basedevice", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "ASTXM1610:bl_api:A0Max", }, - # {'name': 'DNM_A0_FOR_CALC', 'class': 'make_basedevice', 'cat': 'PVS', 'dcs_nm': 'ASTXM1610:bl_api:A0:for_calc'}, { "name": "DNM_ZPZ_POS", - "class": "make_basedevice", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "ASTXM1610:bl_api:zp:zpz_pos", }, - {"name": "DNM_ENERGY_ENABLE", "class": "Bo", "dcs_nm": "ASTXM1610:bl_api:enabled"}, - { - "name": "DNM_ENERGY_RBV", - "class": "make_basedevice", - "cat": "PVS", - "dcs_nm": "SIM_VBL1610-I12:ENERGY.RBV" if SIM else "BL1610-I10:ENERGY.RBV", - "units": "um", - }, { - "name": "DNM_ZPZ_RBV", - "class": "make_basedevice", + "name": "DNM_BEAM_DEFOCUS", + "class": "make_base_simdevice", "cat": "PVS", - "dcs_nm": "SMTR1610-3-I12-51.RBV", + "dcs_nm": "ASTXM1610:bl_api:zp:defocus", "units": "um", }, { - "name": "DNM_ZP_DEF_A", - "class": "make_basedevice", + "name": "DNM_ZP_A1", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "ASTXM1610:bl_api:zp:def.A", }, { "name": "DNM_ZP_DEF", - "class": "Transform", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "ASTXM1610:bl_api:zp:def", }, { "name": "DNM_OSA_DEF", - "class": "Transform", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "ASTXM1610:bl_api:osa:def", }, + { + "name": "DNM_ENERGY_ENABLE", + "class": "make_base_simdevice", + "dcs_nm": "ASTXM1610:bl_api:enabled" + }, + # { + # "name": "DNM_FOCUS_MODE", + # "class": "make_base_simdevice", + # "dcs_nm": "ASTXM1610:bl_api:enabled" + # }, + { + "name": "DNM_ENERGY_RBV", + "class": "make_basedevice", + "cat": "PVS", + "dcs_nm": "SIM_VBL1610-I12:ENERGY.RBV" if SIM else "BL1610-I10:ENERGY.RBV", + "units": "um", + }, + { + "name": "DNM_ZPZ_RBV", + "class": "make_basedevice", + "cat": "PVS", + "dcs_nm": "SMTR1610-3-I12-51.RBV", + "units": "um", + }, + { "name": "DNM_SYSTEM_MODE_FBK", "class": "make_basedevice", @@ -418,18 +445,6 @@ "cat": "PVS", "dcs_nm": "SRStatus:shutters", }, - # {'name': 'DNM_EPU_POL_FBK', 'class': 'Mbbo', 'dcs_nm': 'BL1610-I12UND1410-01:polarization'}, - # {'name': 'DNM_EPU_POL_ANGLE', 'class': 'make_basedevice', 'cat': 'PVS', 'dcs_nm': 'BL1610-I12:UND1410-01:polarAngle', 'units': 'udeg'}, - # {'name': 'DNM_EPU_GAP_FBK', 'class': 'make_basedevice', 'cat': 'PVS', 'dcs_nm': 'BL1610-I12:UND1410-01:gap:mm:fbk', 'units': 'mm'}, - # {'name': 'DNM_EPU_GAP_OFFSET', 'class': 'make_basedevice', 'cat': 'PVS', 'dcs_nm': 'BL1610-I12:UND1410-01:gap:offset', 'units': 'mm'}, - # {'name': 'DNM_EPU_HARMONIC_PV', 'class': 'make_basedevice', 'cat': 'PVS', 'dcs_nm': 'BL1610-I12:UND1410-01:harmonic'}, - # {'name': 'DNM_SYSTEM_MODE_FBK', 'class': 'Mbbi', 'dcs_nm': 'BL1610-I12SYSTEM:mode:fbk'}, - # {'name': 'DNM_EPU_POL_FBK', 'class': 'make_basedevice', 'dcs_nm': 'SIM_VBL1610-I12:epuPolarization.RBV', 'rd_only': True}, - # {'name': 'DNM_EPU_POL_ANGLE', 'class': 'make_basedevice', 'cat': 'PVS', 'dcs_nm': 'BLUND1410-01:polarAngle', 'units': 'udeg'}, - # {'name': 'DNM_EPU_GAP_FBK', 'class': 'make_basedevice', 'cat': 'PVS', 'dcs_nm': 'SIM_VBL1610-I12:epuGap', 'units': 'mm', 'rd_only': True}, - # {'name': 'DNM_EPU_GAP_OFFSET', 'class': 'make_basedevice', 'cat': 'PVS', 'dcs_nm': 'SIM_VBL1610-I12:epuOffset', 'units': 'mm'}, - # {'name': 'DNM_EPU_HARMONIC_PV', 'class': 'make_basedevice', 'cat': 'PVS', 'dcs_nm': 'SIM_VBL1610-I12:epuHarmonic'}, - # {'name': 'DNM_SYSTEM_MODE_FBK', 'class': 'Mbbi', 'dcs_nm': 'BL1610-I12SYSTEM:mode:fbk'}, { "name": "DNM_MONO_EV_FBK", "class": "make_basedevice", @@ -439,13 +454,7 @@ "units": "eV", "rd_only": True, }, - { - "name": "DNM_BEAM_DEFOCUS", - "class": "make_basedevice", - "cat": "PVS", - "dcs_nm": "ASTXM1610:bl_api:zp:defocus", - "units": "um", - }, + { "name": "DNM_AX1_INTERFER_VOLTS", "class": "make_basedevice", @@ -495,6 +504,19 @@ "dcs_nm": "MCS1610-310-01:mcs:delay", }, # _pv: BaseDevice('BL1610-I12:MONO1610-I10-01:grating:select:fbk'}, _pv.get_position: _pv.get_enum_str_as_int[{'name': 'Mono_grating_fbk', 'class': _pv + +] +dev_dct["ENERGY_DEV"] = [ + { + "name": "DNM_ENERGY_DEVICE", + "desc": "Energy device that includes focussing", + "class": "EnergyDevice", + "dcs_nm": "SIM_VBL1610-I12:ENERGY" if SIM else "BL1610-I10:ENERGY", + "energy_nm": "DNM_ENERGY", + "zz_nm": "DNM_ZONEPLATE_Z", + "cz_nm": "DNM_COARSE_Z", + "pos_type": "POS_TYPE_BL", + }, ] dev_dct["PVS_DONT_RECORD"] = [ diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/coarse_image_scan/coarse_image_scan.py b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/coarse_image_scan/coarse_image_scan.py deleted file mode 100644 index 4239176c..00000000 --- a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/coarse_image_scan/coarse_image_scan.py +++ /dev/null @@ -1,29 +0,0 @@ -""" -Created on 04/11/2022 - -@author: bergr -""" - -from cls.applications.pyStxm.main_obj_init import MAIN_OBJ, DEFAULTS -from cls.data_io.stxm_data_io import STXMDataIo -from cls.utils.log import get_module_logger - -from cls.applications.pyStxm.bl_configs.base_scan_plugins.coarse_image_scan.coarse_image_scan import ( - BaseCoarseImageScanParam, -) - -_logger = get_module_logger(__name__) - - -class CoarseImageScanParam(BaseCoarseImageScanParam): - - data = {} - - def __init__(self, parent=None): - super().__init__(main_obj=MAIN_OBJ, data_io=STXMDataIo, dflts=DEFAULTS) - self.scan_class = self.instanciate_scan_class( - __file__, "CoarseImageScan", "CoarseImageScanClass" - ) - - - diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/fine_image_scans/fine_image_scans.py b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/fine_image_scans/fine_image_scans.py deleted file mode 100644 index bc812a8b..00000000 --- a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/fine_image_scans/fine_image_scans.py +++ /dev/null @@ -1,34 +0,0 @@ -""" -Created on 04/11/2022 - -@author: bergr -""" - -from cls.applications.pyStxm.main_obj_init import MAIN_OBJ, DEFAULTS -from cls.data_io.stxm_data_io import STXMDataIo -from cls.utils.log import get_module_logger - -from cls.applications.pyStxm.bl_configs.base_scan_plugins.fine_image_scans.fine_image_scans import ( - BaseFineImageScansParam, - USE_E712_HDW_ACCEL, -) - -_logger = get_module_logger(__name__) - - -class SampleFineImageScanParam(BaseFineImageScansParam): - - data = {} - - def __init__(self, parent=None): - super().__init__(main_obj=MAIN_OBJ, data_io=STXMDataIo, dflts=DEFAULTS) - if USE_E712_HDW_ACCEL: - self.scan_class = self.instanciate_scan_class( - __file__, - "SampleFineImageWithE712WavegenScan", - "SampleFineImageWithE712WavegenScanClass", - ) - else: - self.scan_class = self.instanciate_scan_class( - __file__, "SampleFineImageScan", "FineSampleImageScanClass" - ) diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/coarse_image_scan/CoarseImageScan.py b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/CoarseImageScan.py similarity index 100% rename from cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/coarse_image_scan/CoarseImageScan.py rename to cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/CoarseImageScan.py diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/fine_image_scans/SampleFineImageScan.py b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/SampleFineImageScan.py similarity index 68% rename from cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/fine_image_scans/SampleFineImageScan.py rename to cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/SampleFineImageScan.py index 6799112b..f0fab20f 100644 --- a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/fine_image_scans/SampleFineImageScan.py +++ b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/SampleFineImageScan.py @@ -1,5 +1,5 @@ """ -Created on 04/11/2022 +Created on 08/12/2025 @author: bergr """ @@ -12,9 +12,9 @@ class SampleFineImageScanClass(BaseSampleFineImageScanClass): - """a scan for executing a SampleFineImage scan + """a scan for executing a Sample Fine Scan scan - This class is stubbed in here in case you would like to orverride the base implementation, if you want to use + This class is stubbed in here in case you would like to override the base implementation, if you want to use as is there is no need to do anything else just leave as is """ @@ -25,4 +25,4 @@ def __init__(self, main_obj=None): :returns: None """ - super().__init__(main_obj=main_obj) + super().__init__(main_obj=main_obj) \ No newline at end of file diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/fine_image_scans/SampleFineImageWithE712WavegenScan.py b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/SampleFineImageWithE712WavegenScan.py similarity index 62% rename from cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/fine_image_scans/SampleFineImageWithE712WavegenScan.py rename to cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/SampleFineImageWithE712WavegenScan.py index e53ab4d6..233fbb9e 100644 --- a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/fine_image_scans/SampleFineImageWithE712WavegenScan.py +++ b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/SampleFineImageWithE712WavegenScan.py @@ -1,5 +1,5 @@ """ -Created on 04/11/2022 +Created on 08/12/2025 @author: bergr """ @@ -8,15 +8,14 @@ BaseSampleFineImageWithE712WavegenScanClass, ) + _logger = get_module_logger(__name__) -class SampleFineImageWithE712WavegenScanClass( - BaseSampleFineImageWithE712WavegenScanClass -): - """a scan for executing a SampleFineImageWithE712Wavegen scan +class SampleFineImageWithE712WavegenScanClass(BaseSampleFineImageWithE712WavegenScanClass): + """a scan for executing a Sample Fine scan with Hardware acceleration - This class is stubbed in here in case you would like to orverride the base implementation, if you want to use + This class is stubbed in here in case you would like to override the base implementation, if you want to use as is there is no need to do anything else just leave as is """ @@ -28,3 +27,4 @@ def __init__(self, main_obj=None): :returns: None """ super().__init__(main_obj=main_obj) + diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/__init__.py b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/coarse_image_scan/loader.py b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/loader.py similarity index 83% rename from cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/coarse_image_scan/loader.py rename to cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/loader.py index e98d645b..82c140dd 100644 --- a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/coarse_image_scan/loader.py +++ b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/loader.py @@ -5,5 +5,5 @@ mod_classname = 'CoarseImageScanParam' the class in the mod_file that has all the UI stuff """ -mod_file = "coarse_image_scan.py" -mod_classname = "CoarseImageScanParam" +mod_file = "sample_image_scans.py" +mod_classname = "SampleImageScanParam" diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/sample_image_scans.py b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/sample_image_scans.py new file mode 100644 index 00000000..a6b12324 --- /dev/null +++ b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/sample_image_scans/sample_image_scans.py @@ -0,0 +1,126 @@ +""" +Created on 04/11/2022 + +@author: bergr +""" +import os + +from cls.applications.pyStxm import abs_path_to_ini_file +from cls.applications.pyStxm.main_obj_init import MAIN_OBJ, DEFAULTS +from cls.data_io.stxm_data_io import STXMDataIo +from cls.utils.log import get_module_logger +from cls.utils.dict_utils import dct_get +from cls.utils.roi_dict_defs import (WDGCOM_SPATIAL_ROIS, SPDB_XSETPOINTS, SPDB_YSETPOINTS, + SPDB_XRANGE, SPDB_YRANGE) +from cls.utils.cfgparser import ConfigClass + +from cls.applications.pyStxm.bl_configs.base_scan_plugins.sample_image_scans.sample_image_scans import ( + BaseSampleImageScansParam, + USE_E712_HDW_ACCEL, +) + +appConfig = ConfigClass(abs_path_to_ini_file) + +MAX_FINE_RANGE_X = MAIN_OBJ.get_preset_as_float("max_fine_x") +MAX_FINE_RANGE_Y = MAIN_OBJ.get_preset_as_float("max_fine_y") + +_logger = get_module_logger(__name__) + + +class SampleImageScanParam(BaseSampleImageScansParam): + + data = {} + + def __init__(self, parent=None): + + if USE_E712_HDW_ACCEL: + super().__init__(main_obj=MAIN_OBJ, data_io=STXMDataIo, dflts=DEFAULTS, + ui_path="sample_image_scans-soft-and-hdw-accel.ui") + + self.scan_class_coarse = self.instanciate_scan_class( + __file__, + "CoarseImageScan", + "CoarseImageScanClass", + ) + + + self.scan_class_hdw = self.instanciate_scan_class( + __file__, + "SampleFineImageWithE712WavegenScan", + "SampleFineImageWithE712WavegenScanClass", + ) + + self.scan_class_soft = self.instanciate_scan_class( + __file__, "SampleFineImageScan", "SampleFineImageScanClass" + ) + self.scan_class = self.scan_class_soft + else: + super().__init__(main_obj=MAIN_OBJ, data_io=STXMDataIo, dflts=DEFAULTS, + ui_path="sample_image_scans-soft-and-hdw-accel.ui") + self.scan_class_hdw = None + self.scan_class_soft = self.instanciate_scan_class( + __file__, "SampleFineImageScan", "SampleFineImageScanClass" + ) + self.scan_class = self.scan_class_soft + + def get_scan_class(self): + """ + override the base class method to return the appropriate scan class based on whether + hardware acceleration is enabled or not + :return: + """ + wdg_com = self.update_data() + sp_rois = wdg_com[WDGCOM_SPATIAL_ROIS] + sp_ids = list(sp_rois.keys()) + sp_id = sp_ids[0] + sp_db = sp_rois[sp_id] + rngX = dct_get(sp_db, SPDB_XRANGE) + rngY = dct_get(sp_db, SPDB_YRANGE) + + is_coarse_scan = False + if rngX >= MAX_FINE_RANGE_X: + is_coarse_scan = True + if rngY >= MAX_FINE_RANGE_Y: + is_coarse_scan = True + + if is_coarse_scan: + return self.scan_class_coarse + + elif self.hdwAccelGrpBox.isChecked(): + return self.scan_class_hdw + else: + return self.scan_class_soft + + + def check_scan_limits(self): + """a function to be implemented by the scan pluggin that + checks the scan parameters against the soft limits of the + positioners, if all is well return true else false + + This function should provide an explicit error log msg to aide the user + """ + wdg_com = self.update_data() + sp_rois = wdg_com[WDGCOM_SPATIAL_ROIS] + sp_ids = list(sp_rois.keys()) + sp_id = sp_ids[0] + sp_db = sp_rois[sp_id] + x_spts = dct_get(sp_db, SPDB_XSETPOINTS) + y_spts = dct_get(sp_db, SPDB_YSETPOINTS) + + # check the range against the coarse stages only + mtrx = self.main_obj.device("DNM_COARSE_X") + mtry = self.main_obj.device("DNM_COARSE_Y") + + if ( + x_spts[0] < mtrx.get_low_limit() + or x_spts[-1] > mtrx.get_high_limit() + or y_spts[0] < mtry.get_low_limit() + or y_spts[-1] > mtry.get_high_limit() + ): + _logger.error( + "Requested scan range is outside the limits of the coarse stage(s). " + "Please adjust the scan range." + ) + return False + + return True diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_time_data/osa_focus_data.js b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_time_data/osa_focus_data.js index 827e6b4d..64f2292c 100644 --- a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_time_data/osa_focus_data.js +++ b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_time_data/osa_focus_data.js @@ -1 +1 @@ -[[33.98915886878967, 10, 10, 5.0], [302.39755392074585, 50, 20, 5.0], [152.39949131011963, 50, 10, 5.0], [74.31555151939392, 50, 5, 5.0], [135.0112748146057, 20, 15, 100.0], [210.76262640953064, 20, 30, 10.0], [318.96619939804077, 30, 30, 10.0], [313.4308531284332, 30, 30, 10.0], [14.067206144332886, 10, 10, 10.0], [36.17898941040039, 10, 10, 10.0], [34.23037838935852, 10, 10, 10.0]] \ No newline at end of file +[[33.98915886878967, 10, 10, 5.0], [302.39755392074585, 50, 20, 5.0], [152.39949131011963, 50, 10, 5.0], [74.31555151939392, 50, 5, 5.0], [135.0112748146057, 20, 15, 100.0], [210.76262640953064, 20, 30, 10.0], [318.96619939804077, 30, 30, 10.0], [313.4308531284332, 30, 30, 10.0], [14.067206144332886, 10, 10, 10.0], [36.17898941040039, 10, 10, 10.0], [34.23037838935852, 10, 10, 10.0], [142.8138108253479, 20, 20, 10.0], [142.10690069198608, 20, 20, 10.0], [141.86025285720825, 20, 20, 10.0], [412.97433066368103, 19, 60, 10.0], [171.83211159706116, 19, 25, 10.0], [169.99562048912048, 19, 25, 10.0], [170.1689417362213, 19, 25, 10.0]] \ No newline at end of file diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_time_data/osa_image_data.js b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_time_data/osa_image_data.js index cfcfd175..89790de1 100644 --- a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_time_data/osa_image_data.js +++ b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_time_data/osa_image_data.js @@ -1 +1 @@ -[[95.0, 15, 15, 1.0], [99.0, 15, 15, 1.0], [87.0, 15, 15, 1.0], [90.0, 15, 15, 1.0], [85.0, 15, 15, 1.0], [86.0, 15, 15, 1.0], [95.0, 15, 15, 1.0], [99.0, 15, 15, 1.0], [87.0, 15, 15, 1.0], [90.0, 15, 15, 1.0], [85.0, 15, 15, 1.0], [86.0, 15, 15, 1.0], [47.020424604415894, 10, 10, 100.0], [47.044618368148804, 10, 10, 100.0], [38.06581926345825, 10, 10, 1.0], [109.2405469417572, 20, 20, 1.0], [107.22432208061218, 20, 20, 10.0], [68.11338400840759, 13, 15, 10.0], [3.9937920570373535, 3, 3, 10.0], [2.9934401512145996, 3, 3, 10.0], [4.05676007270813, 3, 3, 10.0], [3.0017757415771484, 3, 3, 10.0], [4.004361152648926, 3, 3, 10.0], [3.009395122528076, 3, 3, 10.0], [1.9995620250701904, 3, 3, 10.0], [8.083166360855103, 3, 3, 10.0], [7.093394994735718, 3, 3, 10.0], [2.00238299369812, 3, 3, 10.0], [2.9990475177764893, 3, 3, 10.0], [3.0067787170410156, 3, 3, 10.0], [3.110016345977783, 3, 3, 10.0], [36.202935218811035, 10, 10, 10.0]] \ No newline at end of file +[[95.0, 15, 15, 1.0], [99.0, 15, 15, 1.0], [87.0, 15, 15, 1.0], [90.0, 15, 15, 1.0], [85.0, 15, 15, 1.0], [86.0, 15, 15, 1.0], [95.0, 15, 15, 1.0], [99.0, 15, 15, 1.0], [87.0, 15, 15, 1.0], [90.0, 15, 15, 1.0], [85.0, 15, 15, 1.0], [86.0, 15, 15, 1.0], [47.020424604415894, 10, 10, 100.0], [47.044618368148804, 10, 10, 100.0], [38.06581926345825, 10, 10, 1.0], [109.2405469417572, 20, 20, 1.0], [107.22432208061218, 20, 20, 10.0], [68.11338400840759, 13, 15, 10.0], [3.9937920570373535, 3, 3, 10.0], [2.9934401512145996, 3, 3, 10.0], [4.05676007270813, 3, 3, 10.0], [3.0017757415771484, 3, 3, 10.0], [4.004361152648926, 3, 3, 10.0], [3.009395122528076, 3, 3, 10.0], [1.9995620250701904, 3, 3, 10.0], [8.083166360855103, 3, 3, 10.0], [7.093394994735718, 3, 3, 10.0], [2.00238299369812, 3, 3, 10.0], [2.9990475177764893, 3, 3, 10.0], [3.0067787170410156, 3, 3, 10.0], [3.110016345977783, 3, 3, 10.0], [36.202935218811035, 10, 10, 10.0], [149.87287831306458, 20, 20, 10.0], [150.12262225151062, 20, 20, 10.0], [150.1346619129181, 20, 20, 10.0], [151.21765899658203, 20, 20, 10.0], [150.17821669578552, 20, 20, 10.0], [151.95510482788086, 20, 20, 10.0], [151.09182381629944, 20, 20, 10.0], [94.04748249053955, 20, 20, 10.0], [18.915010452270508, 5, 5, 10.0]] \ No newline at end of file diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_time_data/scan_names.js b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_time_data/scan_names.js index 89ee2367..9304a060 100644 --- a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_time_data/scan_names.js +++ b/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_time_data/scan_names.js @@ -1 +1,2 @@ -["sample_image", "coarse_image", "detector_image", "osa_image", "sample_focus", "generic_scan", "osa_focus", "sample_image_stack", "sample_point_spectrum", "pattern_gen"] \ No newline at end of file +["sample_image", "detector_image", "osa_image", "sample_focus", "generic_scan", "osa_focus", "sample_image_stack", "sample_point_spectrum", "pattern_gen", "sample_line_spectrum"] + diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/coarse_image_scan/CoarseImageScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/coarse_image_scan/CoarseImageScan.py index 75b53897..bfbc9f78 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/coarse_image_scan/CoarseImageScan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/coarse_image_scan/CoarseImageScan.py @@ -127,10 +127,10 @@ def go_to_scan_start(self): # check if beyond soft limits # if the soft limits would be violated then return False else continue and return True - if not mtr_x.check_scan_limits(xstart, xstop): + if not mtr_x.check_scan_limits(xstart, xstop, coarse_only=True): _logger.error("Scan would violate soft limits of X motor") return (False) - if not mtr_y.check_scan_limits(ystart, ystop): + if not mtr_y.check_scan_limits(ystart, ystop, coarse_only=True): _logger.error("Scan would violate soft limits of Y motor") return (False) @@ -173,48 +173,42 @@ def get_num_progress_events(self): return self.x_roi[NPOINTS] * self.y_roi[NPOINTS] def make_pxp_scan_plan(self, dets, bi_dir=False, md={}): - dev_list = self.main_obj.main_obj[DEVICES].devs_as_list() + dev_list = self.main_obj.main_obj[DEVICES].devs_as_list() # skip_lst) + self._bi_dir = bi_dir - # zp_def = self.get_zoneplate_info_dct() - mtr_dct = self.determine_samplexy_posner_pvs() - md = copy.deepcopy( - self.make_standard_metadata( - entry_num=0, scan_type=self.scan_type, dets=dets - ) - ) + if md is None: + md = { + "metadata": dict_to_json( + self.make_standard_metadata( + entry_name="entry0", scan_type=self.scan_type, dets=dets + ) + ) + } @bpp.baseline_decorator(dev_list) + @bpp.run_decorator(md=md) def do_scan(): - # Declare the end of the run. - # make sure that the positions of the piezos are correct to start psmtr_x = self.main_obj.device("DNM_SAMPLE_X") psmtr_y = self.main_obj.device("DNM_SAMPLE_Y") psmtr_x.set_piezo_power_off() psmtr_y.set_piezo_power_off() - x_roi = self.sp_db["X"] - y_roi = self.sp_db["Y"] - mtr_x = self.main_obj.device(mtr_dct["cx_name"]) - mtr_y = self.main_obj.device(mtr_dct["cy_name"]) + mtr_x = self.main_obj.device("DNM_COARSE_X") + mtr_y = self.main_obj.device("DNM_COARSE_Y") shutter = self.main_obj.device("DNM_SHUTTER") - # the detector will be staged automatically by the grid_scan plan + shutter.open() - yield from grid_scan( - dets, - mtr_y, - y_roi[START], - y_roi[STOP], - y_roi[NPOINTS], - mtr_x, - x_roi[START], - x_roi[STOP], - x_roi[NPOINTS], - self._bi_dir, - md=md, - ) + yield from bps.mv(mtr_x, self.x_roi['START'], group='B') + yield from bps.mv(mtr_y, self.y_roi['START'], group='B') + yield from bps.wait('B') + # a scan with N events + for y_sp in self.y_roi['SETPOINTS']: + yield from bps.mv(mtr_y, y_sp) + for x_sp in self.x_roi['SETPOINTS']: + yield from bps.mv(mtr_x, x_sp, group='BB') + # yield from bps.wait('BB') + yield from bps.trigger_and_read(dets) shutter.close() - #yield from bps.unstage(gate) - # print("CoarseSampleImageScanClass: make_pxp_scan_plan Leaving") return (yield from do_scan()) @@ -264,7 +258,6 @@ def do_scan(): DECCEL_DISTANCE = self.x_roi["RANGE"] * deccel_dist_prcnt_pv.get() #scan_velo = self.x_roi["RANGE"] / ((self.x_roi["NPOINTS"] * self.dwell) * 0.001) - sisdev = dets[0] piezo_mtr.scan_start.put(self.x_roi['START'] - ACCEL_DISTANCE) #piezo_mtr.scan_stop.put(self.x_roi['STOP'] + ACCEL_DISTANCE) piezo_mtr.scan_stop.put(self.x_roi['STOP'] + DECCEL_DISTANCE) @@ -273,11 +266,6 @@ def do_scan(): piezo_mtr.marker_stop.put(self.x_roi['STOP']) piezo_mtr.set_marker.put(self.x_roi['START']) piezo_mtr.set_marker_position(self.x_roi['START']) - #hack to soret out why trigs need to be opposite sign for positions - # piezo_mtr.marker_start.put(self.x_roi['START'] * -1.0) - # piezo_mtr.marker_stop.put(self.x_roi['STOP'] * -1.0) - # piezo_mtr.set_marker.put(self.x_roi['START'] * -1.0) - # piezo_mtr.set_marker_position(self.x_roi['START'] * -1.0) # move to scan start yield from bps.mv(crs_x, self.x_roi['START'] - ACCEL_DISTANCE, group='BB') @@ -287,10 +275,12 @@ def do_scan(): for y_sp in self.y_roi['SETPOINTS']: ACCEL_DISTANCE = self.x_roi["RANGE"] * accel_dist_prcnt_pv.get() DECCEL_DISTANCE = self.x_roi["RANGE"] * deccel_dist_prcnt_pv.get() - #print(f"CoarseImageScan: ACCEL_DISTANCE = {ACCEL_DISTANCE}, DECCEL_DISTANCE={DECCEL_DISTANCE}") + # print(f"CoarseImageScan: ACCEL_DISTANCE = {ACCEL_DISTANCE}, DECCEL_DISTANCE={DECCEL_DISTANCE}") crs_x.velocity.put(self.scan_velo) piezo_mtr.enable_marker_position(True) - yield from bps.mv(sisdev.run, 1, group='SIS3820') + for d in dets: + if hasattr(d, 'run'): + yield from bps.mv(d.run, 1, group='SIS3820') # yield from bps.mv(crs_y, y_sp) yield from bps.mv(crs_x, self.x_roi['STOP'] + DECCEL_DISTANCE, group='BB') yield from bps.wait('BB') @@ -301,10 +291,7 @@ def do_scan(): yield from bps.wait('CC') shutter.close() - # print("CoarseSampleImageScanClass LxL: make_scan_plan Leaving") - # except NameError as ne: - # # Code to handle NameError - # print(ne) + except LimitError as le: _logger.error(f"There was a problem involving a motor setpoint being larger than valid range: [{le}]") diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/coarse_image_scan/coarse_image_scan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/coarse_image_scan/coarse_image_scan.py index 3b350455..ba7970d0 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/coarse_image_scan/coarse_image_scan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/coarse_image_scan/coarse_image_scan.py @@ -78,6 +78,7 @@ def __init__( # does this exist?????self.scanTypeSelComboBox.currentIndexChanged.connect(self.scan_type_changed) + self.energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") self.data = {} self.sp_db = None self.load_from_defaults() @@ -125,6 +126,7 @@ def on_plugin_focus(self): :return: """ if self.isEnabled(): + self.energy_dev.set_focus_mode("SAMPLE") self.update_est_time() def on_plugin_defocus(self): @@ -399,15 +401,17 @@ def mod_roi(self, sp_db, do_recalc=True, sp_only=True): if sp_db[SPDB_X][RANGE] != 0: # only modify if larger than fine scans - if sp_db[SPDB_X][RANGE] > MAX_SCAN_RANGE_FINEX: - self.sp_db[SPDB_X][RANGE] = sp_db[SPDB_X][RANGE] + # if sp_db[SPDB_X][RANGE] > MAX_SCAN_RANGE_FINEX: + # self.sp_db[SPDB_X][RANGE] = sp_db[SPDB_X][RANGE] + self.sp_db[SPDB_X][RANGE] = sp_db[SPDB_X][RANGE] self.sp_db[SPDB_Y][CENTER] = sp_db[SPDB_Y][CENTER] if sp_db[SPDB_Y][RANGE] != 0: # only modify if larger than fine scans - if sp_db[SPDB_Y][RANGE] > MAX_SCAN_RANGE_FINEY: - self.sp_db[SPDB_Y][RANGE] = sp_db[SPDB_Y][RANGE] + # if sp_db[SPDB_Y][RANGE] > MAX_SCAN_RANGE_FINEY: + # self.sp_db[SPDB_Y][RANGE] = sp_db[SPDB_Y][RANGE] + self.sp_db[SPDB_Y][RANGE] = sp_db[SPDB_Y][RANGE] x_roi = self.sp_db[SPDB_X] y_roi = self.sp_db[SPDB_Y] diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/det_scan/det_scan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/det_scan/det_scan.py index 593a3181..4b7739a7 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/det_scan/det_scan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/det_scan/det_scan.py @@ -14,8 +14,6 @@ from cls.applications.pyStxm.main_obj_init import MAIN_OBJ, DEFAULTS -# from cls.applications.pyStxm.bl_configs.amb_bl10ID1.device_names import * - from cls.data_io.stxm_data_io import STXMDataIo from cls.data_io.utils import ( test_eq, @@ -54,6 +52,8 @@ # from cls.applications.pyStxm.scan_plugins.det_scan_tester import test_sp_db +OSA_OUT_POSITION = MAIN_OBJ.get_preset_as_float("osa_out_position") + _logger = get_module_logger(__name__) @@ -390,20 +390,15 @@ def on_set_center(self): def on_osa_out(self, chkd): """ - to that limit + move it to the out position specified in the bl config .ini file """ osa_mtr = self.main_obj.device("DNM_OSA_X") # use as the out position: current max High level Lim - 10um if chkd: - self.osaOutBtn.setText("Move OSA In") - if self.osa_out_limit == "low": - lm = osa_mtr.get_low_limit() + 10.0 - else: - lm = osa_mtr.get_high_limit() - 10.0 - - osa_mtr.move(lm, wait=False) + self.osaOutBtn.setText(" Move OSA In ") + osa_mtr.move(OSA_OUT_POSITION, wait=False) else: - self.osaOutBtn.setText("Move OSA Out") + self.osaOutBtn.setText(" Move OSA Out ") osa_mtr.move(0.0, wait=False) def on_do_scribbler(self, checked): diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/det_scan/det_scan.ui b/cls/applications/pyStxm/bl_configs/base_scan_plugins/det_scan/det_scan.ui index 5f65528c..a73a697d 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/det_scan/det_scan.ui +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/det_scan/det_scan.ui @@ -186,7 +186,7 @@ Move OSA in or out of the way - Move OSA Out + Move OSA Out true @@ -229,20 +229,6 @@ - - - - adjust number of points to use this dwell value - - - ... - - - - ../../../../../../../icons/wand.ico../../../../../../../icons/wand.ico - - - diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/device_loader.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/device_loader.py index d66ea972..b878e195 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/device_loader.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/device_loader.py @@ -4,7 +4,6 @@ @author: bergr """ -import os import pathlib from ophyd.epics_motor import EpicsMotor @@ -20,6 +19,8 @@ from bcm.devices import Counter from bcm.devices import sample_abstract_motor +from bcm.devices.sim.energy_dev import EnergyDevice + if BACKEND == 'epics': from bcm.devices.ophyd.stxm_sample_mtr import e712_sample_motor from bcm.devices.ophyd.pi_e712 import E712WGDevice @@ -37,25 +38,24 @@ from bcm.devices.ophyd.qt.daqmx_counter_output import GateDevice from bcm.devices.ophyd.camera import camera + else: from bcm.devices import MultiSelectable from bcm.devices import Command #from bcm.devices import BaseOphydGate -from bcm.devices import DCSShutter, init_pv_report_file +from bcm.devices import DCSShutter -from cls.appWidgets.main_object import dev_config_base, POS_TYPE_BL, POS_TYPE_ES +from cls.appWidgets.main_object import dev_config_base from cls.appWidgets.splashScreen import get_splash -from cls.applications.pyStxm import abs_path_to_ini_file from cls.types.stxmTypes import ( sample_positioning_modes, sample_fine_positioning_modes, endstation_id_types, ) -from cls.utils.cfgparser import ConfigClass from cls.utils.log import get_module_logger -from cls.applications.pyStxm.bl_configs.utils import make_basedevice +from cls.applications.pyStxm.bl_configs.utils import make_basedevice, make_base_simdevice _logger = get_module_logger(__name__) @@ -219,6 +219,38 @@ def create_instance(self, category, dct): d = noisy_det d.name = dct["name"] + elif dct['class'] == 'EnergyDevice': + # get all of the positioners needed for this device + a0_dev = self.devices["PVS"]["DNM_A0"] + delta_a0_dev = self.devices["PVS"]["DNM_DELTA_A0"] + zpz_adjust_dev = self.devices["PVS"]["DNM_ZPZ_ADJUST"] + defocus_beam_dev = self.devices["PVS"]["DNM_BEAM_DEFOCUS"] + focal_len_dev = self.devices["PVS"]["DNM_FOCAL_LENGTH"] + zp_a1_dev = self.devices["PVS"]["DNM_ZP_A1"] + a0_max_dev = self.devices["PVS"]["DNM_A0MAX"] + calcd_zpz_dev = self.devices["PVS"]["DNM_CALCD_ZPZ"] + zp_focus_mode_dev = self.devices["PVS"]["DNM_ZONEPLATE_FOCUS_MODE"] + + energy_posner = self.devices["POSITIONERS"][dct["energy_nm"]] + zpz_posner = self.devices["POSITIONERS"][dct["zz_nm"]] + cz_posner = self.devices["POSITIONERS"][dct["cz_nm"]] + + energy_dev_dict = { + "a0_dev": a0_dev, + "delta_a0_dev": delta_a0_dev, + "zpz_adjust_dev": zpz_adjust_dev, + "defocus_beam_dev": defocus_beam_dev, + "energy_posner": energy_posner, + "zpz_posner": zpz_posner, + "cz_posner": cz_posner, + "focal_len_dev": focal_len_dev, + "zp_a1_dev": zp_a1_dev, + "a0_max_dev": a0_max_dev, + "calcd_zpz_dev": calcd_zpz_dev, + "zp_focus_mode_dev": zp_focus_mode_dev, + } + d = EnergyDevice(dct['dcs_nm'], name=dct['name'], energy_dev_dict=energy_dev_dict) + elif dct["class"] == "e712_sample_motor": d = e712_sample_motor( dct["dcs_nm"], name=dct["dcs_nm"] @@ -302,6 +334,7 @@ def create_instance(self, category, dct): d = Mbbi(dct["dcs_nm"]) elif dct["class"] == "Transform": d = Transform(dct["dcs_nm"], name=dct["name"]) + elif dct["class"] == "E712WGDevice": d = E712WGDevice(dct["dcs_nm"], name=dct["name"]) elif dct["class"] == "E712ControlWidget": @@ -350,14 +383,37 @@ def create_instance(self, category, dct): backend=BACKEND, devcfg=self, ) - if dct['name'].find("DNM_RING_CURRENT") > -1: - # hack, need ring current to appear to be a detector but not in DETECTORS category because - # the read() will be looking for an attribute called det.id - category = "DETECTORS" + + + elif dct["class"] == "make_base_simdevice": + if "units" not in dct.keys(): + dct["units"] = "" + if "desc" not in dct.keys(): + dct["desc"] = "No description in config" + if "rd_only" not in dct.keys(): + dct["rd_only"] = False + # if "backend" not in dct.keys(): + # dct["backend"] = "epics" + d = make_base_simdevice( + cat=category, + sig_nm=dct["dcs_nm"], + name=dct["name"], + desc=dct["desc"], + units=dct["units"], + rd_only=dct["rd_only"], + backend=BACKEND, + devcfg=self, + ) else: print("Unknown category [%s]" % dct["class"]) d = None + + if dct['name'].find("DNM_RING_CURRENT") > -1: + # hack, need ring current to appear to be a detector but not in DETECTORS category because + # the read() will be looking for an attribute called det.id + category = "DETECTORS" + if category.find("DETECTORS") > -1: # assign a unique id to each detector that will be used later in the code to reference its data d.det_id = self.det_id_counter diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/SampleFineImageScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/SampleFineImageScan.py index e8b88031..b7e7ee94 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/SampleFineImageScan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/SampleFineImageScan.py @@ -3,20 +3,41 @@ @author: bergr """ +import bluesky.plan_stubs as bps +import bluesky.preprocessors as bpp +from bluesky.utils import FailedStatus + +from ophyd.utils import (ReadOnlyError, LimitError, DestroyedError) +from cls.applications.pyStxm import abs_path_to_ini_file from cls.applications.pyStxm.main_obj_init import MAIN_OBJ from cls.scanning.BaseScan import BaseScan, SIM_SPEC_DATA, SIMULATE_SPEC_DATA +from cls.types.stxmTypes import ( + scan_types, + scan_sub_types, + energy_scan_order_types, + sample_positioning_modes, + sample_fine_positioning_modes, +) +from cls.scanning.scan_cfg_utils import ensure_valid_values, calc_accRange +from cls.scan_engine.decorators import conditional_decorator from cls.utils.roi_dict_defs import * from cls.utils.log import get_module_logger +from cls.utils.cfgparser import ConfigClass from cls.utils.dict_utils import dct_put, dct_get +from cls.utils.json_utils import dict_to_json + +from cls.plotWidgets.utils import * _logger = get_module_logger(__name__) +appConfig = ConfigClass(abs_path_to_ini_file) + # get the accel distance for now from the app configuration -ACCEL_DISTANCE = MAIN_OBJ.get_preset_as_float("fine_accel_distance") +ACCEL_DISTANCE_PERCENT_OF_RANGE = MAIN_OBJ.get_preset_as_float("coarse_accel_dist_percent_of_range") -class BaseFineSampleImageScanClass(BaseScan): +class BaseSampleFineImageScanClass(BaseScan): """ This class is used to implement Coarse scans for conventional mode scanning """ @@ -28,178 +49,446 @@ def __init__(self, main_obj=None): :returns: None """ super().__init__(main_obj=main_obj) - self.x_use_reinit_ddl = False - self.x_auto_ddl = True + # self.x_use_reinit_ddl = False + # self.x_auto_ddl = True # self.spid_data = None self.img_idx_map = {} self.spid_data = {} + # set a default detctor name if the user has not selected any detector from the detector selection window + # self.default_detector_nm = "C" + + def config_devs_for_line(self, dets): + ''' + config devs for line scan + ''' + for d in dets: + if hasattr(d, "set_dwell"): + d.set_dwell(self.dwell) + if hasattr(d, "set_config"): + d.set_config(self.y_roi["NPOINTS"], self.x_roi["NPOINTS"], is_pxp_scan=self.is_pxp) + if hasattr(d, "setup_for_hdw_triggered"): + d.setup_for_hdw_triggered() + if hasattr(d, "set_row_change_index_points"): + d.set_row_change_index_points(remove_first_point=True) + if hasattr(d, "set_sequence_map"): + d.set_sequence_map(self.seq_map_dct) + + def config_devs_for_point(self, dets): + ''' + config devs for point scan + ''' + for d in dets: + if hasattr(d, "set_dwell"): + d.set_dwell(self.dwell) + if hasattr(d, "set_config"): + d.set_config(self.y_roi["NPOINTS"], self.x_roi["NPOINTS"], is_pxp_scan=True) + if hasattr(d, "setup_for_software_triggered"): + d.setup_for_software_triggered() + if hasattr(d, "set_row_change_index_points"): + # use defaults of all args = False + d.set_row_change_index_points() + if hasattr(d, "set_sequence_map"): + d.set_sequence_map(self.seq_map_dct) + + def configure_devs(self, dets): + """ + + """ + super().configure_devs(dets) + + if self.is_lxl: + self.config_devs_for_line(dets) + else: + self.config_devs_for_point(dets) - def make_pxp_scan_plan(self, dets, md=None, bi_dir=False): - # dev_list = self.main_obj.main_obj[DEVICES].devs_as_list() - # self._bi_dir = bi_dir - # # zp_def = self.get_zoneplate_info_dct() + def go_to_scan_start(self): + """ + an API function that will be called if it exists for all scans + move the coarse X and Y motors to the start of the scan and make sure the + piezo motors are off + mtr_dct = + {'xstart': -3000.0, + 'ystart': -3238.07, + 'xpv': 'PSMTR1610-3-I12-00', + 'ypv': 'PSMTR1610-3-I12-01', + 'sx_name': 'DNM_SAMPLE_X', + 'sy_name': 'DNM_SAMPLE_Y', + 'cx_name': 'DNM_SAMPLE_X', + 'cy_name': 'DNM_SAMPLE_Y', + 'fx_name': 'DNM_SAMPLE_FINE_X', + 'fy_name': 'DNM_SAMPLE_FINE_Y', + 'fine_pv_nm': {'X': 'PZAC1610-3-I12-40', 'Y': 'PZAC1610-3-I12-41'}, + 'coarse_pv_nm': {'X': 'PSMTR1610-3-I12-00', 'Y': 'PSMTR1610-3-I12-01'}, + 'sample_pv_nm': {'X': 'PSMTR1610-3-I12-00', 'Y': 'PSMTR1610-3-I12-01'}} + """ + super().fine_scan_go_to_scan_start() # mtr_dct = self.determine_samplexy_posner_pvs() - # md = copy.deepcopy( - # self.make_standard_metadata( - # entry_num=0, scan_type=self.scan_type, dets=dets - # ) - # ) - - # @bpp.baseline_decorator(dev_list) - # @bpp.stage_decorator(dets) - # @bpp.run_decorator(md={'entry_name': 'entry0', 'scan_type': scan_types.DETECTOR_IMAGE}) + # mtr_x = self.main_obj.device(mtr_dct["sx_name"]) + # mtr_y = self.main_obj.device(mtr_dct["sy_name"]) + # + # accel_dist_prcnt_pv, deccel_dist_prcnt_pv = self.get_accel_deccel_pvs() + # + # ACCEL_DISTANCE = self.x_roi[RANGE] * accel_dist_prcnt_pv.get() + # DECCEL_DISTANCE = self.x_roi[RANGE] * deccel_dist_prcnt_pv.get() + # xstart = self.x_roi[START] - ACCEL_DISTANCE + # xstop = self.x_roi[STOP] + DECCEL_DISTANCE + # ystart, ystop = self.y_roi[START], self.y_roi[STOP] + # + # # check if beyond soft limits + # # if the soft limits would be violated then return False else continue and return True + # if not mtr_x.check_scan_limits(xstart, xstop, coarse_only=True): + # _logger.error("Scan would violate soft limits of X motor") + # return (False) + # if not mtr_y.check_scan_limits(ystart, ystop, coarse_only=True): + # _logger.error("Scan would violate soft limits of Y motor") + # return (False) + # + # #before starting scan check the interferometers, note BOTH piezo's must be off first + # mtr_x.set_piezo_power_off() + # mtr_y.set_piezo_power_off() + # + # mtr_x.do_interferometer_check() + # mtr_y.do_interferometer_check() + # + # mtr_x.move_coarse_to_scan_start(start=xstart, stop= self.x_roi[STOP], npts=self.x_roi[NPOINTS], dwell=self.dwell) + # mtr_y.move_coarse_to_position(ystart, False) + + return(True) + + def verify_scan_velocity(self): + """ + This is meant to take a motor and check that the scan velocity is not greater than the max velocity of the motor + To be implemented by the inheriting class + + calc_scan_velo(self, mtr, rng, npoints, dwell) + return True for scan velo checks out and False for it is invalid + """ + mtr_x = self.main_obj.device("DNM_SAMPLE_FINE_X") + + self.scan_velo = self.calc_scan_velo(mtr_x, self.x_roi[RANGE], self.x_roi[NPOINTS], self.dwell) + if self.scan_velo > 0: + return(True) + else: + return(False) + + def get_num_progress_events(self): + """ + over ride base class def + """ + # if self.is_lxl: + # return self.y_roi[NPOINTS] + # else: + # #point scan + # return self.x_roi[NPOINTS] * self.y_roi[NPOINTS] + if self.is_lxl: + return self.y_roi[NPOINTS] * self.numE * self.numEPU * self.numSPIDS + else: + # point scan + return self.x_roi[NPOINTS] * self.y_roi[NPOINTS] * self.numE * self.numEPU * self.numSPIDS + + def make_scan_plan(self, dets, md=None, bi_dir=False): + """ + override the default make_scan_plan to set the scan_type + :param dets: + :param gate: + :param md: + :param bi_dir: + :return: + """ + self.configure_devs(dets) + self.dev_list = self.main_obj.main_obj[DEVICES].devs_as_list() + if self.numImages == 1: + self.scan_type = scan_types.SAMPLE_IMAGE + return self.make_soft_stack_image_plan(dets, md=md, bi_dir=bi_dir) + else: + self.scan_type = scan_types.SAMPLE_IMAGE_STACK + return self.make_soft_stack_image_plan(dets, md=md, bi_dir=bi_dir) + + + def make_soft_stack_image_plan(self, dets, md=None, bi_dir=False): + #print("entering: make_stack_image_plan") + self._saved_one = False + stagers = [] + for d in dets: + stagers.append(d) + def do_scan(): - pass - # # Declare the end of the run. - # - # x_roi = self.sp_db["X"] - # y_roi = self.sp_db["Y"] - # mtr_x = self.main_obj.device(mtr_dct["fx_name"]) - # mtr_y = self.main_obj.device(mtr_dct["fy_name"]) - # shutter = self.main_obj.device("DNM_SHUTTER") - # - # yield from bps.stage(gate) - # # the detector will be staged automatically by the grid_scan plan - # shutter.open() - # yield from grid_scan( - # dets, - # mtr_y, - # y_roi[START], - # y_roi[STOP], - # y_roi[NPOINTS], - # mtr_x, - # x_roi[START], - # x_roi[STOP], - # x_roi[NPOINTS], - # self._bi_dir, - # md=md, - # ) - # - # shutter.close() - # yield from bps.unstage(gate) - # - # print("CoarseSampleImageScanClass: make_pxp_scan_plan Leaving") + energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") + pol_mtr = self.main_obj.device("DNM_EPU_POLARIZATION") + off_mtr = self.main_obj.device("DNM_EPU_OFFSET") + ang_mtr = self.main_obj.device("DNM_EPU_ANGLE") + + # print('starting: make_stack_image_plan: do_scan()') + entrys_lst = [] + entry_num = 0 + # idx = 0 + self._current_img_idx = 0 + point_spec_devs_configd = False + prev_entry_nm = "" + # , starts=starts, stops=stops, npts=npts, group='e712_wavgen', wait=True) + # this starts the wavgen and waits for it to finish without blocking the Qt event loop + epu_sps = zip(self.setpointsPol, self.setpointsOff,self.setpointsAngle) + + for pol, off, ang in epu_sps: + # switch to new polarization, offset and angle + if pol_mtr.get_position() != pol: + yield from bps.mv(pol_mtr, pol) + if off_mtr.get_position() != off: + yield from bps.mv(off_mtr, off) + if ang_mtr.get_position() != ang: + yield from bps.mv(ang_mtr, ang) + # switch to new energy + for ev_sp in self.ev_setpoints: + yield from bps.mv(energy_dev, ev_sp) + # self.dwell = ev_roi[DWELL] + self.dwell = self.setpointsDwell + + # now load and execute each spatial region + for sp_id in self.sp_ids: + self.sp_id = sp_id + # this updates member vars x_roi, y_roi, etc... with current spatial id specifics + self.update_roi_member_vars(self.sp_rois[self.sp_id]) + if self.is_point_spec and (not point_spec_devs_configd): + # config the det and gate + for d in dets: + if hasattr(d, "set_mode"): + d.set_mode(bs_dev_modes.NORMAL_PXP) + if hasattr(d, "configure"): + d.configure() + + point_spec_devs_configd = True + + samplemtrx = self.main_obj.get_sample_positioner("X") + samplemtry = self.main_obj.get_sample_positioner("Y") + finemtrx = self.main_obj.get_sample_fine_positioner("X") + finemtry = self.main_obj.get_sample_fine_positioner("Y") + # make sure servo power is on + finemtrx.servo_power.put(1) + finemtry.servo_power.put(1) + + if self.is_zp_scan: + # moving them to the start gets rid of a goofy first line of the scan + yield from bps.mv(finemtrx, self.zx_roi[START]) + yield from bps.mv(finemtry, self.zy_roi[START]) + yield from bps.mv( + samplemtrx, + self.gx_roi[CENTER], + samplemtry, + self.gy_roi[CENTER], + ) + # samplemtrx.move(self.gx_roi[CENTER], wait=True) + # samplemtry.move(self.gy_roi[CENTER], wait=True) + + else: + # !!! THIS NEEDS TESTING + # moving them to the start gets rid of a goofy first line of the scan + yield from bps.mv(finemtrx, self.x_roi[START]) + yield from bps.mv(finemtry, self.y_roi[START]) + ############################ + # take a single image that will be saved with its own run scan id + # img_dct = self.img_idx_map['%d' % idx] + img_dct = self.img_idx_map["%d" % self._current_img_idx] + + md = { + "metadata": dict_to_json( + self.make_standard_metadata( + entry_name=img_dct["entry"], + dets=dets, + scan_type=self.scan_type, + ) + ) + } + # if(entry_num is 0): + # if(img_dct['entry'] is not prev_entry_nm): + if img_dct["entry"] not in entrys_lst: + # only create the entry once + if self.is_point_spec: + yield from self.make_soft_single_point_spec_plan( + dets, md=md, do_baseline=True + ) + else: + if self.is_lxl: + yield from self.make_lxl_scan_plan( + dets, md=md, do_baseline=True + ) + else: + yield from self.make_pxp_scan_plan( + dets, md=md, do_baseline=True + ) + + else: + # this data will be used to add to previously created entries + if self.is_point_spec: + yield from self.make_soft_single_point_spec_plan( + dets, md=md, do_baseline=False + ) + else: + if self.is_lxl: + yield from self.make_lxl_scan_plan( + dets, md=md, do_baseline=False + ) + else: + yield from self.make_pxp_scan_plan( + dets, md=md, do_baseline=False + ) + + # entry_num += 1 + # idx += 1 + self._current_img_idx += 1 + # prev_entry_nm = img_dct['entry'] + entrys_lst.append(img_dct["entry"]) + + self._saved_one = True + + #print("make_stack_image_plan Leaving") return (yield from do_scan()) - #def make_lxl_scan_plan(self, dets, gate, md={}, bi_dir=False): - def make_lxl_scan_plan(self, dets, md=None, bi_dir=False): + + def make_lxl_scan_plan(self, dets, md=None, bi_dir=False, do_baseline=True): """ + This produces a line by line scan that uses base level plans to do the scan + due to the sis3820 requiring it to be running before the X motor moves across the scan line - this needs to be adapted to be a fly scan, setup SampleX to trigger at correct location, set scan velo and acc range - and then call scan, gate an d counter need to be staged for lxl :param dets: :param gate: :param bi_dir: + :param do_baseline: should a baseline reading be taken, stack scan controlled :return: """ - # dev_list = self.main_obj.main_obj[DEVICES].devs_as_list() - # self._bi_dir = bi_dir - # mtr_dct = self.determine_samplexy_posner_pvs() + self._bi_dir = bi_dir + if md is None: + md = { + "metadata": dict_to_json( + self.make_standard_metadata( + entry_name="entry0", scan_type=self.scan_type, dets=dets + ) + ) + } + print(f"RUSS:make_lxl_scan_plan: self.scan_type={self.scan_type}") + @conditional_decorator(bpp.baseline_decorator(self.dev_list), do_baseline) + @bpp.stage_decorator(dets) + @bpp.run_decorator(md=md) + def do_scan(): + try: + print('entering BaseSampleFineImageScanClass: make_lxl_scan_plan') + print(f"RUSS:make_lxl_scan_plan:do_scan: self.scan_type={self.scan_type}") + + psmtr_x = self.main_obj.device("DNM_SAMPLE_X") + psmtr_y = self.main_obj.device("DNM_SAMPLE_Y") + crs_x = self.main_obj.device("DNM_COARSE_X") + crs_y = self.main_obj.device("DNM_COARSE_Y") + shutter = self.main_obj.device("DNM_SHUTTER") + piezo_mtr_x = self.main_obj.get_sample_fine_positioner("X") + piezo_mtr_y = self.main_obj.get_sample_fine_positioner("Y") + self.is_fine_scan = False + accel_dist_prcnt_pv, deccel_dist_prcnt_pv = self.get_accel_deccel_pvs() + + psmtr_x.set_piezo_power_on() + psmtr_y.set_piezo_power_on() + + shutter.open() + ACCEL_DISTANCE = self.x_roi["RANGE"] * accel_dist_prcnt_pv.get() + DECCEL_DISTANCE = self.x_roi["RANGE"] * deccel_dist_prcnt_pv.get() + + #scan_velo = self.x_roi["RANGE"] / ((self.x_roi["NPOINTS"] * self.dwell) * 0.001) + piezo_mtr_x.scan_start.put(self.x_roi['START'] - ACCEL_DISTANCE) + piezo_mtr_x.scan_stop.put(self.x_roi['STOP'] + DECCEL_DISTANCE) + + piezo_mtr_x.marker_start.put(self.x_roi['START']) + piezo_mtr_x.marker_stop.put(self.x_roi['STOP']) + piezo_mtr_x.set_marker.put(self.x_roi['START']) + piezo_mtr_x.set_marker_position(self.x_roi['START']) + + # move to scan start + yield from bps.mv(piezo_mtr_x, self.x_roi['START'] - ACCEL_DISTANCE, group='BB') + yield from bps.mv(piezo_mtr_y, self.y_roi['START'], group='BB') + yield from bps.wait('BB') + + for y_sp in self.y_roi['SETPOINTS']: + ACCEL_DISTANCE = self.x_roi["RANGE"] * accel_dist_prcnt_pv.get() + DECCEL_DISTANCE = self.x_roi["RANGE"] * deccel_dist_prcnt_pv.get() + #print(f"CoarseImageScan: ACCEL_DISTANCE = {ACCEL_DISTANCE}, DECCEL_DISTANCE={DECCEL_DISTANCE}") + piezo_mtr_x.velocity.put(self.scan_velo) + piezo_mtr_x.enable_marker_position(True) + for d in dets: + if hasattr(d, 'run'): + yield from bps.mv(d.run, 1, group='SIS3820') + + # yield from bps.mv(crs_y, y_sp) + yield from bps.mv(piezo_mtr_x, self.x_roi['STOP'] + DECCEL_DISTANCE, group='BB') + yield from bps.wait('BB') + yield from bps.trigger_and_read(dets) + piezo_mtr_x.enable_marker_position(False) + yield from bps.mv(piezo_mtr_x, self.x_roi['START'] - ACCEL_DISTANCE, piezo_mtr_y, y_sp, group='CC') + yield from bps.wait('CC') + + shutter.close() + except LimitError as le: + _logger.error(f"There was a problem involving a motor setpoint being larger than valid range: [{le}]") + + except FailedStatus as fe: + _logger.error(f"Most likely a motor is sitting on a limit: [{fe}]") + + return (yield from do_scan()) + + def make_pxp_scan_plan(self, dets, bi_dir=False, md={}, do_baseline=True): + """ + This produces a point by point scan that uses base level plans to do the scan + due to the sis3820 requiring it to be running before the X motor moves across the scan line + + :param dets: + :param gate: + :param bi_dir: + :param do_baseline: should a baseline reading be taken, stack scan controlled + :return: + """ + self._bi_dir = bi_dir # zp_def = self.get_zoneplate_info_dct() - # md = { - # "entry_name": "entry0", - # "scan_type": self.scan_type, - # "rois": {SPDB_X: self.x_roi, SPDB_Y: self.y_roi}, - # "dwell": self.dwell, - # "primary_det": "DNM_DEFAULT_COUNTER", - # "zp_def": zp_def, - # "wdg_com": dict_to_json(self.wdg_com), - # } - - # @bpp.baseline_decorator(dev_list) - # @bpp.stage_decorator(dets) + mtr_dct = self.determine_samplexy_posner_pvs() + if md is None: + md = { + "metadata": dict_to_json( + self.make_standard_metadata( + entry_name="entry0", scan_type=self.scan_type, dets=dets + ) + ) + } + + @conditional_decorator(bpp.baseline_decorator(self.dev_list), do_baseline) + @bpp.run_decorator(md=md) def do_scan(): - pass - # mtr_x = self.main_obj.device("DNM_SAMPLE_X") - # mtr_y = self.main_obj.device("DNM_SAMPLE_Y") - # shutter = self.main_obj.device("DNM_SHUTTER") - # - # yield from bps.stage(gate) - # # the detector will be staged automatically by the grid_scan plan - # shutter.open() - # bps.open_run(md=md) - # - # # go to start of line - # yield from bps.mv( - # mtr_x, self.x_roi[START] - ACCEL_DISTANCE, mtr_y, self.y_roi[START] - # ) - # - # # now do a horizontal line for every new zoneplate Z setpoint - # for y_sp in self.y_roi[SETPOINTS]: - # yield from bps.mv( - # mtr_y, y_sp, mtr_x, self.x_roi[START] - ACCEL_DISTANCE - # ) - # yield from bps.mv(mtr_x, self.x_roi[STOP] + ACCEL_DISTANCE) - # - # shutter.close() - # - # yield from bps.unstage(gate) - # bps.close_run() - # print("CoarseSampleImageScanClass LxL: make_scan_plan Leaving") + print('entering BaseSampleFineImageScanClass: make_pxp_scan_plan') + # Declare the end of the run. + # make sure that the positions of the piezos are correct to start + psmtr_x = self.main_obj.device("DNM_SAMPLE_X") + psmtr_y = self.main_obj.device("DNM_SAMPLE_Y") + psmtr_x.set_piezo_power_on() + psmtr_y.set_piezo_power_on() + piezo_mtr_x = self.main_obj.device(mtr_dct["fx_name"]) + piezo_mtr_y = self.main_obj.device(mtr_dct["fy_name"]) + + shutter = self.main_obj.device("DNM_SHUTTER") + # the detector will be staged automatically by the grid_scan plan + shutter.open() + + for y_sp in self.y_roi['SETPOINTS']: + yield from bps.mv(piezo_mtr_y, y_sp) + + for x_sp in self.x_roi['SETPOINTS']: + yield from bps.mv(piezo_mtr_x, x_sp, group='AA') + yield from bps.wait('AA') + # yield from bps.sleep(0.002) # small delay to allow detectors to settle + yield from bps.trigger_and_read(dets) + + yield from bps.mv(piezo_mtr_x, self.x_roi["SETPOINTS"][0], group='AA') + yield from bps.sleep(0.8) + + shutter.close() return (yield from do_scan()) - # def on_this_scan_done(self): - # # self.shutter.close() - # # self.gate.stop() - # # self.counter.stop() - # # #Jan 9 2018 - # # self.ensure_data() - # # - # # self.save_hdr() - # # #self.on_save_sample_image() - # # self.on_scan_done_discon_sigs() - # pass - - # - # def optimize_sample_line_scan(self): - # ''' - # To be implemented by the inheriting class - # This function is meant to retrieve from the ini file the section for its scan and set any PDLY's - # and any other settings required to optimize the scan for speed. - # Typically this is used by the scans that move the fine piezo stages as their status response can greatly - # mprove the performance if it is optimized. - # - # appConfig.get_value('SAMPLE_IMAGE', 'whatever') - # c_scan1_pdly=0.0 - # c_scan2_pdly=0.0 - # f_scan2_pdly=0.0 - # f_scan1_pdly=0.15 - # # force done values are: 0=NORMAL, 1=FORCED, 2=INTERNAL_TIMED - # f_fx_force_done=2 - # f_fy_force_done=1 - # ''' - # appConfig.update() - # c_scan1_pdly = float(appConfig.get_value('SAMPLE_IMAGE_LXL', 'c_scan1_pdly')) - # c_scan2_pdly = float(appConfig.get_value('SAMPLE_IMAGE_LXL', 'c_scan2_pdly')) - # f_scan1_pdly = float(appConfig.get_value('SAMPLE_IMAGE_LXL', 'f_scan1_pdly')) - # f_scan2_pdly = float(appConfig.get_value('SAMPLE_IMAGE_LXL', 'f_scan2_pdly')) - # c_fx_force_done = float(appConfig.get_value('SAMPLE_IMAGE_LXL', 'c_fx_force_done')) - # c_fy_force_done = float(appConfig.get_value('SAMPLE_IMAGE_LXL', 'c_fy_force_done')) - # f_fx_force_done = float(appConfig.get_value('SAMPLE_IMAGE_LXL', 'f_fx_force_done')) - # f_fy_force_done = float(appConfig.get_value('SAMPLE_IMAGE_LXL', 'f_fy_force_done')) - # fx_done = MAIN_OBJ.device('FX_force_done') - # fy_done = MAIN_OBJ.device('FY_force_done') - # - # if (self.x_roi[SCAN_RES] == 'COARSE'): - # self.xScan.put('PDLY', c_scan1_pdly) - # fx_done.put(c_fx_force_done) - # else: - # self.xScan.put('PDLY', f_scan1_pdly) - # fx_done.put(f_fx_force_done) - # - # if (self.y_roi[SCAN_RES] == 'COARSE'): - # self.yScan.put('PDLY', c_scan2_pdly) - # fy_done.put(c_fy_force_done) - # else: - # self.yScan.put('PDLY', f_scan2_pdly) - # fy_done.put(f_fy_force_done) - # - - def configure( - self, wdg_com, sp_id=0, ev_idx=0, line=True, block_disconnect_emit=False - ): + def configure(self, wdg_com, sp_id=0, ev_idx=0, line=True, block_disconnect_emit=False): """ configure(): This is the configure routine that is required to be defined by every scan plugin. the main goal of the configure function is to - extract into member variables the scan param data from the wdg_com (widget communication) dict @@ -238,28 +527,18 @@ def configure( :returns: None """ - super().configure(wdg_com, sp_id=sp_id, line=line, z_enabled=False) - _logger.info("\n\nFineSampleImageScanClass: configuring sp_id [%d]" % sp_id) + ret = super().configure(wdg_com, sp_id=sp_id, line=line, z_enabled=False) + if not ret: + return(ret) + _logger.info("\n\SampleFineImageScanClass: configuring sp_id [%d]" % sp_id) self.new_spatial_start_sent = False # initial setup and retrieval of common scan information - # self.set_spatial_id(sp_id) - # self.wdg_com = wdg_com - # self.sp_rois = wdg_com[WDGCOM_SPATIAL_ROIS] - # self.sp_ids = list(self.sp_rois.keys()) - # self.sp_db = self.sp_rois[sp_id] - # self.scan_type = dct_get(self.sp_db, SPDB_SCAN_PLUGIN_TYPE) - # self.scan_sub_type = dct_get(self.sp_db, SPDB_SCAN_PLUGIN_SUBTYPE) - # self.sample_positioning_mode = MAIN_OBJ.get_sample_positioning_mode() - # - # self.update_roi_member_vars(self.sp_db) - # - # #the wavegenerator does both axis in one sscan record by calling the wavegenerator to execute, - # # this is done in sscan2 - # self.xScan = self._scan1 - # self.yScan = self._scan2 - # self.xyScan = None - # - # self.determine_scan_res() + self.set_spatial_id(sp_id) + self.determine_scan_res() + # if self.is_fine_scan: + # _logger.error("Scan is a fine scan, use Image Scan for this") + # return None + # dct_put(self.sp_db, SPDB_RECT, (self.x_roi[START], self.y_roi[START], self.x_roi[STOP], self.y_roi[STOP])) # the sample motors have different modes, make a call to handle that they are setup correctly for this scan self.configure_sample_motors_for_scan() @@ -292,17 +571,17 @@ def configure( self.x_auto_ddl = False self.x_use_reinit_ddl = False - # # setup some convienience member variables - # self.dwell = e_roi[DWELL] - # self.numX = int(self.x_roi[NPOINTS]) - # self.numY = int(self.y_roi[NPOINTS]) - # self.numZX = int(self.zx_roi[NPOINTS]) - # self.numZY = int(self.zy_roi[NPOINTS]) - # self.numEPU = len(self.setpointsPol) - # # self.numE = self.sp_db[SPDB_EV_NPOINTS] * len(self.setpointsPol) - # self.numE = int(self.sp_db[SPDB_EV_NPOINTS]) - # self.numSPIDS = len(self.sp_rois) - # self.numImages = 1 + # setup some convienience member variables + self.dwell = e_roi[DWELL] + self.numX = int(self.x_roi[NPOINTS]) + self.numY = int(self.y_roi[NPOINTS]) + self.numZX = int(self.zx_roi[NPOINTS]) + self.numZY = int(self.zy_roi[NPOINTS]) + self.numEPU = len(self.setpointsPol) + # self.numE = self.sp_db[SPDB_EV_NPOINTS] * len(self.setpointsPol) + self.numE = int(self.sp_db[SPDB_EV_NPOINTS]) + self.numSPIDS = len(self.sp_rois) + self.numImages = 1 # set some flags that are used elsewhere self.stack = False @@ -312,7 +591,31 @@ def configure( self.file_saved = False self.sim_point = 0 - # self.config_for_sample_holder_scan(dct) + # users can request that the the ev and polarity portions of the scan can be executed in different orders + # based on the order that requires a certain what for the sscan clases to be assigned in terms of their "level" so handle that in + # another function + # self.set_ev_pol_order(self.ev_pol_order) + if self.scan_sub_type == scan_sub_types.LINE_UNIDIR: + # LINE_UNIDIR + self.is_lxl = True + + else: + # POINT_BY_POINT + self.is_pxp = True + + # # depending on the scan size the positioners used in the scan will be different, use a singe + # # function to find out which we are to use and return those names in a dct + dct = self.determine_samplexy_posner_pvs() + + self.numImages = int( + self.sp_db[SPDB_EV_NPOINTS] * self.numEPU * self.numSPIDS + ) + + # set some flags that are used elsewhere + if self.numImages > 1: + self.stack = True + else: + self.stack = False self.final_data_dir = self.config_hdr_datarecorder( self.stack, self.final_data_dir @@ -320,16 +623,251 @@ def configure( # self.stack_scan = stack # make sure OSA XY is in its center - # self.move_osaxy_to_its_center() + self.move_osaxy_to_its_center() - # self.seq_map_dct = self.generate_2d_seq_image_map( - # self.numE, self.y_roi[NPOINTS], self.x_roi[NPOINTS], lxl=self.is_lxl - # ) self.seq_map_dct = self.generate_2d_seq_image_map( - self.numE, self.numEPU, self.y_roi[NPOINTS], self.x_roi[NPOINTS], lxl=self.is_lxl, + num_evs=self.numE, num_pols=self.numEPU, nypnts=self.y_roi[NPOINTS], nxpnts=self.x_roi[NPOINTS], lxl=self.is_lxl ) - + # THIS must be the last call self.finish_setup() # self.new_spatial_start.emit(sp_id) - return True + return ret + + def config_for_sample_holder_scan(self, dct): + """ + this function accomplishes the following: + - set the positoners for X and Y + - set the sample X and Y positioners to self.sample_mtrx etc + - determine and set the fine positioners to sample_finex etc + - move the sample_mtrx/y to start by setting scan Mode too ScanStart then moving and waiting until stopped + - determine if coarse or fine scan and PxP or LxL and: + - get max velo of the x positioner + - Determine if scan is Line Spectra + - if LineSpectra the number of points is Y not X + - calc ScanVelo, Npts and Dwell, adjusting Npts to match velo and dwell + - Depending on coarse or fine scans calc accel/deccel range or get straight from blConfig + - Set the MarkerStart,ScanStart/Stop etc by calling config_samplex_start_stop + - set the X positioner velocity to the scan velo + - set the driver Mode to LINE_UNIDIR or COARSE or whatever it needs + - if Fine scan make sure the servo power is on + """ + self.sample_mtrx = self.main_obj.get_sample_positioner("X") + self.sample_mtry = self.main_obj.get_sample_positioner("Y") + self.sample_finex = self.main_obj.get_sample_fine_positioner("X") + self.sample_finey = self.main_obj.get_sample_fine_positioner("Y") + self.coarse_x = self.main_obj.device("DNM_COARSE_X") + self.coarse_y = self.main_obj.device("DNM_COARSE_Y") + + # setup X positioner + self.sample_mtrx.set_mode(self.sample_mtrx.MODE_SCAN_START) + self.sample_mtrx.move(dct["xstart"]) + _logger.info("Waiting for SampleX to move to start") + self.confirm_stopped([self.sample_mtrx]) + # self.sample_finex.set_power(0) + # self.coarse_x.move(dct["xstart"]) + # _logger.info("Waiting for SampleX to move to start") + # self.confirm_stopped([self.coarse_x]) + + # setup Y positioner + self.sample_mtry.set_mode(self.sample_mtrx.MODE_SCAN_START) + self.sample_mtry.move(dct["ystart"]) + _logger.info("Waiting for SampleY to move to start") + self.confirm_stopped([self.sample_mtry]) + # self.sample_finex.set_power(0) + # self.coarse_y.move(dct["ystart"]) + # _logger.info("Waiting for SampleY to move to start") + # self.confirm_stopped([self.coarse_y]) + + # setup X + if self.is_pxp or self.is_point_spec: + if self.x_roi[SCAN_RES] == COARSE: + # scan_velo = self.get_mtr_max_velo(self.xScan.P1) + scan_velo = self.sample_mtrx.get_max_velo() + else: + # scan_velo = self.get_mtr_max_velo(self.main_obj.device('DNM_SAMPLE_FINE_X)) + scan_velo = self.sample_finex.get_max_velo() + + # x needs one extra to switch the row + npts = self.numX + dwell = self.dwell + accRange = 0 + deccRange = 0 + line = False + else: + _ev_idx = self.get_evidx() + e_roi = self.e_rois[_ev_idx] + vmax = self.sample_mtrx.get_max_velo() + # its not a point scan so determine the scan velo and accRange + if self.scan_type == scan_types.SAMPLE_LINE_SPECTRUM: + # for line spec scans the number of points is saved in self.numY + (scan_velo, npts, dwell) = ensure_valid_values( + self.x_roi[START], + self.x_roi[STOP], + self.dwell, + self.numY, + vmax, + do_points=True, + ) + else: + (scan_velo, npts, dwell) = ensure_valid_values( + self.x_roi[START], + self.x_roi[STOP], + self.dwell, + self.numX, + vmax, + do_points=True, + ) + + if self.x_roi[SCAN_RES] == COARSE: + accRange = calc_accRange( + dct["sx_name"], + self.x_roi[SCAN_RES], + self.x_roi[RANGE], + scan_velo, + dwell, + accTime=0.04, + ) + deccRange = accRange + else: + # pick up any changes from disk from the app config file + # appConfig.update() + section = "SAMPLE_IMAGE_PXP" + if self.is_lxl: + section = "SAMPLE_IMAGE_LXL" + + # accRange = float(appConfig.get_value(section, 'f_acc_rng')) + # deccRange = float(appConfig.get_value(section, 'f_decc_rng')) + accRange = self.main_obj.get_preset(section, "f_acc_rng") + deccRange = self.main_obj.get_preset(section, "f_decc_rng") + + # the number of points may have changed in order to satisfy the dwell the user wants + # so update the number of X points and dwell + # self.numX = npts + # self.x_roi[NPOINTS] = npts + + line = True + e_roi[DWELL] = dwell + self.dwell = dwell + + print("accRange=%.2f um" % (accRange)) + print("deccRange=%.2f um" % (deccRange)) + + # move X to start + # self.sample_mtrx.put('Mode', MODE_SCAN_START) + # self.sample_mtrx.put('Mode', MODE_NORMAL) + if self.is_lxl: + # self.config_samplex_start_stop(dct['xpv'], self.x_roi[START], self.x_roi[STOP], self.numX, accRange=accRange, line=line) + if self.x_roi[SCAN_RES] == COARSE: + self.sample_mtrx.config_start_stop( + self.x_roi[START], + self.x_roi[STOP], + self.numX, + accRange=accRange, + deccRange=deccRange, + line=line, + ) + self.sample_mtrx.set_velo(scan_velo) + # self.config_samplex_start_stop(dct['sample_pv_nm']['X'], self.x_roi[START], self.x_roi[STOP], self.numX, + # accRange=accRange, deccRange=deccRange, line=line) + else: + # if it is a fine scan then dont use the abstract motor for the actual scanning + # because the status fbk timing is currently not stable + self.sample_finex.config_start_stop( + self.x_roi[START], + self.x_roi[STOP], + self.numX, + accRange=accRange, + deccRange=deccRange, + line=line, + ) + self.sample_finex.set_velo(scan_velo) + # self.config_samplex_start_stop(dct['fine_pv_nm']['X'], self.x_roi[START], self.x_roi[STOP], + # self.numX, accRange=accRange, deccRange=deccRange, line=line) + + # self.set_x_scan_velo(scan_velo) + # self.confirm_stopped([self.sample_mtrx, self.sample_mtry]) + + self.num_points = self.numY + + # self.confirm_stopped(self.mtr_list) + # set teh velocity in teh sscan rec for X + if self.is_pxp or self.is_point_spec: + # force it to toggle, not sure why this doesnt just work + if self.x_roi[SCAN_RES] == COARSE: + # self.sample_mtrx.put('Mode', MODE_COARSE) + self.sample_mtrx.set_mode(self.sample_mtrx.MODE_COARSE) + + else: + # self.sample_mtrx.put('Mode', MODE_POINT) + # self.sample_finex.set_power( 1) + self.sample_mtrx.set_mode(self.sample_mtrx.MODE_POINT) + self.sample_finex.set_power(self.sample_mtrx.POWER_ON) + + if self.y_roi[SCAN_RES] == COARSE: + # self.sample_mtry.put('Mode', MODE_COARSE) + self.sample_mtry.set_mode(self.sample_mtry.MODE_COARSE) + else: + # self.sample_mtry.put('Mode', MODE_LINE_UNIDIR) + # self.sample_finey.set_power( 1) + self.sample_mtry.set_mode(self.sample_mtry.MODE_LINE_UNIDIR) + self.sample_finey.set_power(self.sample_mtry.POWER_ON) + + else: + # force it to toggle, not sure why this doesnt just work + if self.x_roi[SCAN_RES] == COARSE: + # self.sample_mtrx.put('Mode', MODE_COARSE) + self.sample_mtrx.set_mode(self.sample_mtrx.MODE_COARSE) + # self.xScan.put('P1PV', dct['coarse_pv_nm']['X'] + '.VAL') + # self.xScan.put('R1PV', dct['coarse_pv_nm']['X'] + '.RBV') + # self.xScan.put('BSPV', dct['sample_pv_nm']['X'] + '.VELO') + # self.main_obj.device( DNM_CX_AUTO_DISABLE_POWER ).put(0) #disabled + # self.set_sample_posner_mode(self.sample_mtrx, self.sample_finex, MODE_COARSE) + else: + # self.sample_mtrx.put('Mode', MODE_LINE_UNIDIR) + self.sample_mtrx.set_mode(self.sample_mtrx.MODE_LINE_UNIDIR) + + # self.xScan.put('P1PV', dct['fine_pv_nm']['X'] + '.VAL') + # self.xScan.put('R1PV', dct['fine_pv_nm']['X'] + '.RBV') + # self.sample_finex.set_power( 1) + self.sample_finex.set_power(self.sample_mtrx.POWER_ON) + + # self.main_obj.device( DNM_CX_AUTO_DISABLE_POWER ).put(1) #enabled + # self.set_sample_posner_mode(self.sample_mtrx, self.sample_finex, MODE_LINE_UNIDIR) + + # set Y's scan mode + if self.y_roi[SCAN_RES] == COARSE: + # self.set_sample_posner_mode(self.sample_mtrx, self.sample_finex, MODE_COARSE) + # self.sample_mtry.put('Mode', MODE_COARSE) + self.sample_mtry.set_mode(self.sample_mtrx.MODE_COARSE) + + # self.yScan.put('P1PV', dct['coarse_pv_nm']['Y'] + '.VAL') + # self.yScan.put('R1PV', dct['coarse_pv_nm']['Y'] + '.RBV') + + else: + + # self.set_sample_posner_mode(self.sample_mtrx, self.sample_finex, MODE_LINE_UNIDIR) + # self.sample_mtry.put('Mode', MODE_NORMAL) + # self.sample_mtry.put('Mode', MODE_LINE_UNIDIR) + self.sample_mtry.set_mode(self.sample_mtrx.MODE_LINE_UNIDIR) + # self.yScan.put('P1PV', dct['fine_pv_nm']['Y'] + '.VAL') + # self.yScan.put('R1PV', dct['fine_pv_nm']['Y'] + '.RBV') + # self.sample_finey.set_power( 1) + self.sample_finey.set_power(self.sample_mtry.POWER_ON) + + # self.main_obj.device( DNM_CY_AUTO_DISABLE_POWER ).put(1) #enabled + + def on_scan_done(self): + """ + called when scan is done + turn the fine motor power back on so that it is ready for next scan type + """ + # call base class method first + super().on_scan_done() + + mtr_dct = self.determine_samplexy_posner_pvs() + mtr_x = self.main_obj.device(mtr_dct["sx_name"]) + mtr_y = self.main_obj.device(mtr_dct["sy_name"]) + #mtr_x.set_piezo_power_on() + #mtr_y.set_piezo_power_on() + diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/SampleFineImageWithE712WavegenScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/SampleFineImageWithE712WavegenScan.py index 77a16c91..1ea265a2 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/SampleFineImageWithE712WavegenScan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/SampleFineImageWithE712WavegenScan.py @@ -432,7 +432,8 @@ def make_stack_image_plan(self, dets, md=None, bi_dir=False): stagers.append(d) def do_scan(): - ev_mtr = self.main_obj.device("DNM_ENERGY") + # ev_mtr = self.main_obj.device("DNM_ENERGY") + energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") pol_mtr = self.main_obj.device("DNM_EPU_POLARIZATION") off_mtr = self.main_obj.device("DNM_EPU_OFFSET") ang_mtr = self.main_obj.device("DNM_EPU_ANGLE") @@ -458,7 +459,8 @@ def do_scan(): yield from bps.mv(ang_mtr, ang) # switch to new energy for ev_sp in self.ev_setpoints: - yield from bps.mv(ev_mtr, ev_sp) + #yield from bps.mv(ev_mtr, ev_sp) + yield from bps.mv(energy_dev, ev_sp) # self.dwell = ev_roi[DWELL] self.dwell = self.setpointsDwell diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/fine_image_scans-no-hdw-accel.ui b/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/fine_image_scans-no-hdw-accel.ui new file mode 100644 index 00000000..d73991fc --- /dev/null +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/fine_image_scans-no-hdw-accel.ui @@ -0,0 +1,328 @@ + + + Form + + + + 0 + 0 + 630 + 460 + + + + + 0 + 150 + + + + Qt::StrongFocus + + + Form + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + 650 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 62 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + 75 + true + + + + Load Scan + + + + + + + + 25 + 25 + + + + + 25 + 25 + + + + + + + + :/scan_plugins/helplite.png:/scan_plugins/helplite.png + + + + 50 + 50 + + + + + + + + + 25 + 25 + + + + true + + + QFrame::StyledPanel + + + + + + :/scan_plugins/icons8-mouse-right-click-50.png + + + true + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + true + + + + 75 + true + + + + Qt::LeftToRight + + + 1 + + + 2 + + + + Point by Point + + + + + Line by Line + + + + + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + 0 + 50 + + + + Hardware Acceleration + + + true + + + false + + + + + + + 75 + true + + + + DDL Mode + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + Auto + + + true + + + + + + + true + + + Reinitialize + + + false + + + + + + + true + + + + + + + ../../../icons/1318611600_23.ico../../../icons/1318611600_23.ico + + + + + + + + + + + + + + + + 16777215 + 16777215 + + + + + 75 + true + + + + Spatial/Energy/Polarizations + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/fine_image_scans-soft-and-hdw-accel.ui b/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/fine_image_scans-soft-and-hdw-accel.ui new file mode 100644 index 00000000..99f88523 --- /dev/null +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/fine_image_scans-soft-and-hdw-accel.ui @@ -0,0 +1,328 @@ + + + Form + + + + 0 + 0 + 630 + 460 + + + + + 0 + 150 + + + + Qt::StrongFocus + + + Form + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + 650 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 62 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + 75 + true + + + + Load Scan + + + + + + + + 25 + 25 + + + + + 25 + 25 + + + + + + + + :/scan_plugins/helplite.png:/scan_plugins/helplite.png + + + + 50 + 50 + + + + + + + + + 25 + 25 + + + + true + + + QFrame::StyledPanel + + + + + + :/scan_plugins/icons8-mouse-right-click-50.png + + + true + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + true + + + + 75 + true + + + + Qt::LeftToRight + + + 1 + + + 2 + + + + Point by Point + + + + + Line by Line + + + + + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + 0 + 76 + + + + Hardware Acceleration + + + true + + + false + + + + + + + 75 + true + + + + DDL Mode + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + Auto + + + true + + + + + + + true + + + Reinitialize + + + false + + + + + + + true + + + + + + + ../../../icons/1318611600_23.ico../../../icons/1318611600_23.ico + + + + + + + + + + + + + + + + 16777215 + 16777215 + + + + + 75 + true + + + + Spatial/Energy/Polarizations + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/fine_image_scans.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/fine_image_scans.py index d7c32565..8e4c41af 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/fine_image_scans.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_image_scans/fine_image_scans.py @@ -10,12 +10,11 @@ from cls.applications.pyStxm.main_obj_init import MAIN_OBJ, DEFAULTS from cls.scanning.base import ScanParamWidget, MultiRegionScanParamBase, zp_focus_modes - from cls.applications.pyStxm.widgets.scan_table_view.multiRegionWidget import ( MultiRegionWidget, ) -# from cls.applications.pyStxm.bl_configs.amb_bl10ID1.device_names import * +# from cls.applications.pyStxm.bl_configs.amb_bl10ID1.device_names import from cls.data_io.stxm_data_io import STXMDataIo @@ -75,7 +74,11 @@ def __init__( ): super().__init__(main_obj=main_obj, data_io=data_io, dflts=dflts) self._parent = parent - uic.loadUi(os.path.join(ui_path, "fine_image_scans.ui"), self) + if ui_path[-3:] == ".ui": + # parent class passed entire file path with non default name + uic.loadUi(os.path.join(os.path.dirname(__file__), ui_path), self) + else: + uic.loadUi(os.path.join(ui_path, "sample_image_scans.ui"), self) self.epu_supported = False self.goni_supported = False @@ -83,6 +86,8 @@ def __init__( if self.main_obj.is_device_supported("DNM_GONI_X"): self.goni_supported = True + self.energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") + if self.sample_positioning_mode == sample_positioning_modes.GONIOMETER: x_cntr = self.main_obj.device("DNM_GONI_X").get_position() y_cntr = self.main_obj.device("DNM_GONI_Y").get_position() @@ -155,7 +160,7 @@ def init_plugin(self): set the plugin specific details to common attributes :return: """ - self.name = "Fine Image Scan" + self.name = "Sample Image Scan" self.idx = self.main_obj.get_scan_panel_order(__file__) self.type = scan_types.SAMPLE_IMAGE # This is now set in constructor to support inheriting plugins that do not support LxL @@ -197,6 +202,7 @@ def on_plugin_focus(self): :return: """ if self.isEnabled(): + self.energy_dev.set_focus_mode("SAMPLE") self.update_est_time() # call the standard init_base_values function for scan param widgets that contain a multiRegionWidget self.on_multiregion_widget_focus_init_base_values() @@ -204,10 +210,11 @@ def on_plugin_focus(self): def show_hdw_accel_details(self): # if hasattr(self, 'e712_wg'): - if USE_E712_HDW_ACCEL: + if self.hdwAccelGrpBox.isChecked(): dark = get_style() - self.scan_class.e712_wg.setStyleSheet(dark) - self.scan_class.e712_wg.show() + scan_class = self.get_scan_class() + scan_class.e712_wg.setStyleSheet(dark) + scan_class.e712_wg.show() def on_E712WavegenBtn(self, chkd): if chkd: @@ -592,8 +599,8 @@ def update_data(self, force_pxp=False): self.sub_type = scan_sub_types.POINT_BY_POINT dct_put(self.wdg_com, SPDB_SCAN_PLUGIN_SUBTYPE, self.sub_type) - - + dct_put(self.wdg_com, SPDB_SCAN_PLUGIN_TYPE, self.get_scan_type()) + self.roi_changed.emit(self.wdg_com) self.update_est_time() return self.wdg_com diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_point_scan/PointSpecScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_point_scan/PointSpecScan.py index 7b0947f9..2e63d736 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_point_scan/PointSpecScan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/fine_point_scan/PointSpecScan.py @@ -71,18 +71,6 @@ def go_to_scan_start(self): super().fine_scan_go_to_scan_start() return(True) - def add_spids_xy_setpoints(self, md={}): - md["sp_id_setpoints"] = {} - dct = {} - for sp_id in self._master_sp_id_list: - # get x and y setpoints - x_sp = self.sp_rois[sp_id]["X"]["CENTER"] - y_sp = self.sp_rois[sp_id]["Y"]["CENTER"] - # these are used by the nxstxm suitcase to record the correct SAMPLE_X and SAMPLE_Y positions for the spectra - dct[sp_id] = {"x_sp": x_sp, "y_sp": y_sp} - md["sp_id_setpoints"] = dict_to_json(dct) - return md - def init_subscriptions(self, ew, func, det_lst): """ Base init_subscriptions is used by most scans @@ -153,7 +141,7 @@ def do_scan(): # need to make sure that all spatial points are within range of the piezo's before executing this #assume all points a reachable - mtr_ev = self.main_obj.device("DNM_ENERGY") + energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") mtr_x = self.main_obj.get_sample_fine_positioner("X") mtr_y = self.main_obj.get_sample_fine_positioner("Y") pol_mtr = self.main_obj.device("DNM_EPU_POLARIZATION") @@ -174,7 +162,7 @@ def do_scan(): yield from bps.mv(ang_mtr, ang) # switch to new energy for ev_sp in self.ev_setpoints: - yield from bps.mv(mtr_ev, ev_sp) + yield from bps.mv(energy_dev, ev_sp) self.dwell = self.setpointsDwell for sp_id, sp_db in self.sp_rois.items(): diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/focus_scan/FocusScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/focus_scan/FocusScan.py index afead104..8c526950 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/focus_scan/FocusScan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/focus_scan/FocusScan.py @@ -150,12 +150,17 @@ def go_to_scan_start(self): #check if beyond soft limits # if the soft limits would be violated then return False else continue and return True - if not mtr_x.check_scan_limits(xstart, xstop): - _logger.error("Scan would violate soft limits of X motor") - return(False) - if not mtr_y.check_scan_limits(ystart, ystop): - _logger.error("Scan would violate soft limits of Y motor") - return(False) + if not self.is_fine_scan: + coarse_only = True + else: + coarse_only = False + + # if not mtr_x.check_scan_limits(xstart, xstop, coarse_only=coarse_only): + # _logger.error("Scan would violate soft limits of X motor") + # return(False) + # if not mtr_y.check_scan_limits(ystart, ystop, coarse_only=coarse_only): + # _logger.error("Scan would violate soft limits of Y motor") + # return(False) if not mtr_z.check_scan_limits(zzstart, zzstop): _logger.error("Scan would violate soft limits of ZZ motor") return(False) @@ -194,38 +199,91 @@ def go_to_scan_start(self): return(True) - def configure_devs(self, dets): + # def configure_devs(self, dets): + # """ + # configure_devs(): description + # + # :param dets: dets description + # :type dets: dets type + # + # :returns: None + # """ + # super().configure_devs(dets) + # + # for d in dets: + # if hasattr(d, "set_dwell"): + # d.set_dwell(self.dwell) + # if hasattr(d, "set_config"): + # if self.is_horiz_line: + # is_pxp_scan = False + # else: + # is_pxp_scan = True + # d.set_config(self.y_roi["NPOINTS"], self.x_roi["NPOINTS"], is_pxp_scan=is_pxp_scan) + # if self.is_pxp: + # if hasattr(d, "setup_for_software_triggered"): + # d.setup_for_software_triggered() + # if hasattr(d, "set_row_change_index_points"): + # # use defaults of all args = False + # d.set_row_change_index_points() + # + # else: + # if hasattr(d, "setup_for_hdw_triggered"): + # d.setup_for_hdw_triggered() + # if hasattr(d, "set_row_change_index_points"): + # d.set_row_change_index_points(remove_first_point=True) + + def config_devs_for_line(self, dets): + ''' + config devs for line scan + ''' + for d in dets: + if hasattr(d, "set_dwell"): + d.set_dwell(self.dwell) + if hasattr(d, "set_config"): + d.set_config(self.y_roi["NPOINTS"], self.x_roi["NPOINTS"], is_pxp_scan=self.is_pxp) + if hasattr(d, "setup_for_hdw_triggered"): + d.setup_for_hdw_triggered() + if hasattr(d, "set_row_change_index_points"): + d.set_row_change_index_points(remove_first_point=True) + + def config_devs_for_point(self, dets): + ''' + config devs for point scan + ''' + for d in dets: + if hasattr(d, "set_dwell"): + d.set_dwell(self.dwell) + if hasattr(d, "set_config"): + d.set_config(self.y_roi["NPOINTS"], self.x_roi["NPOINTS"], is_pxp_scan=True) + if hasattr(d, "setup_for_software_triggered"): + d.setup_for_software_triggered() + if hasattr(d, "set_row_change_index_points"): + # use defaults of all args = False + d.set_row_change_index_points() + + def get_num_points_in_scan(self): """ - configure_devs(): description + overriddden by inheriting class + """ + # self.numX = dct_get(self.sp_db, SPDB_XNPOINTS) + # self.numY = dct_get(self.sp_db, SPDB_YNPOINTS) + # self.numZ = dct_get(self.sp_db, SPDB_ZNPOINTS) + # self.numZZ = dct_get(self.sp_db, SPDB_ZZNPOINTS) + # self.numZX = dct_get(self.sp_db, SPDB_ZXNPOINTS) + # self.numZY = dct_get(self.sp_db, SPDB_ZYNPOINTS) + # self.numE = dct_get(self.sp_db, SPDB_EV_NPOINTS) + return self.numX * self.numZZ - :param dets: dets description - :type dets: dets type + def configure_devs(self, dets): + """ - :returns: None """ super().configure_devs(dets) - for d in dets: - if hasattr(d, "set_dwell"): - d.set_dwell(self.dwell) - if hasattr(d, "set_config"): - if self.is_horiz_line: - is_pxp_scan = False - else: - is_pxp_scan = True - d.set_config(self.y_roi["NPOINTS"], self.x_roi["NPOINTS"], is_pxp_scan=is_pxp_scan) - if self.is_pxp: - if hasattr(d, "setup_for_software_triggered"): - d.setup_for_software_triggered() - if hasattr(d, "set_row_change_index_points"): - # use defaults of all args = False - d.set_row_change_index_points() - - else: - if hasattr(d, "setup_for_hdw_triggered"): - d.setup_for_hdw_triggered() - if hasattr(d, "set_row_change_index_points"): - d.set_row_change_index_points(remove_first_point=True) + if self.is_lxl: + self.config_devs_for_line(dets) + else: + self.config_devs_for_point(dets) def make_pxp_scan_plan(self, dets, md=None, bi_dir=False): """ diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/focus_scan/focus_scan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/focus_scan/focus_scan.py index 5514cca8..cd146fde 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/focus_scan/focus_scan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/focus_scan/focus_scan.py @@ -37,7 +37,7 @@ from cls.types.stxmTypes import ( scan_types, spatial_type_prefix, - sample_positioning_modes, + sample_positioning_modes, scan_sub_types, ) from cls.appWidgets.dialogs import notify @@ -93,27 +93,26 @@ def __init__( title_color="white", var_clr="black", ) - self._new_zpz_pos = None + self._desired_zpz_focus_pos = None self.selFocusBtn.clicked.connect(self.on_sel_focus_pos_btn) - self.setZPtoFocusBtn.clicked.connect(self.on_focus_zpz) - self.setA0toFocusBtn.clicked.connect(self.on_focus_a0) + self.setZPtoFocusBtn.clicked.connect(self.adjust_coarse_z_to_focus) + self.setA0toFocusBtn.clicked.connect(self.on_set_a0_to_cursor) + self.setDeltaA0Btn.clicked.connect(self.on_set_delta_a0_to_cursor) self.horizSelBtn.clicked.connect(self.on_horiz_line_sel_btn) self.arbSelBtn.clicked.connect(self.on_arbitrary_line_sel_btn) + self.scanTypeSelComboBox.currentIndexChanged.connect(self.on_subtype_changed) + #self.loadScanBtn.clicked.connect(self.load_scan) - self.testBtn.clicked.connect(self.do_test) + #self.testBtn.clicked.connect(self.do_test) self.resetDeltaA0Btn.clicked.connect(self.on_reset_delta_a0) + self.energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") + self.energy_dev.focus_params_changed.connect(self.on_update_focus_params) self.mtr_zpz = self.main_obj.device("DNM_ZONEPLATE_Z") - self.fl = self.main_obj.device("DNM_FOCAL_LENGTH") - self.A0 = self.main_obj.device("DNM_A0") - if self.fl is not None or self.A0 is not None: - self._zpz_fbk_timer = QtCore.QTimer() - self._zpz_fbk_timer.timeout.connect(self.on_update_zpz_fbk) # instanciate both because the non-E712 version is used for coarse scans - # #self.scan_class_coarse = FocusScanClass(main_obj=self.main_obj) # self.scan_class_coarse = self.instanciate_scan_class(__file__, 'FocusScan', 'FocusScanClass') # #set the e712 class to the coarse scan class in case there is no e712 support @@ -130,10 +129,27 @@ def __init__( self.connect_paramfield_signals() self.on_single_spatial_npoints_changed() self.init_loadscan_menu() - if self.fl is not None or self.A0 is not None: - self.fbk_enabled = True - self._zpz_fbk_timer.start(250) - # self.init_test_module() + + def on_subtype_changed(self, idx): + """ + handle when the scan subtype is changed + :param idx: + :return: + """ + if idx == 0: + self.sub_type = scan_sub_types.POINT_BY_POINT + else: + self.sub_type = scan_sub_types.LINE_UNIDIR + + def on_update_focus_params(self, focus_dct: dict): + """ + Update the ZP center label + """ + + # update the ZP center + # print(focus_dct) + zpz_pos = focus_dct["zpz_for_sample_focussed"] + self.set_parm(self.centerZPFld, zpz_pos) def on_plugin_focus(self): """ @@ -147,7 +163,12 @@ def on_plugin_focus(self): else: self.enable_line_select_btns(False) self.update_est_time() - self._new_zpz_pos = None + self._desired_zpz_focus_pos = None + + self.energy_dev.set_focus_mode("SAMPLE") + zpz_focus_pos = self.energy_dev.calc_new_zpz_pos() + self.set_parm(self.centerZPFld, zpz_focus_pos) + def on_plugin_defocus(self): """ @@ -226,13 +247,13 @@ def on_update_zpz_fbk(self): """ if self.fbk_enabled: - fl_val = math.fabs(self.fl.get_position()) - a0_val = self.A0.get_position() - self.set_parm(self.centerZPFld, a0_val - fl_val) + fl_val = self.energy_dev.get_focal_length() + a0_val = self.energy_dev.get_a0() + delta_a0_val = self.energy_dev.get_delta_a0() + self.set_parm(self.centerZPFld, self.energy_dev.calc_new_zpz_pos("SAMPLE")) def on_reset_delta_a0(self): - a0 = self.main_obj.device("DNM_DELTA_A0") - a0.put(0.0) + self.energy_dev.update_delta_a0(0.0) def get_max_fine_scan_range(self): """to be implemented by inheriting class""" @@ -455,14 +476,6 @@ def check_scan_limits(self): else: return self.check_samplexy_scan_limits() - # retxy = self.check_start_stop_xy_scan_limits('SampleX', 'SampleY') - # retz = self.check_center_range_z_scan_limits('ZonePlateZ.Z') - # - # if(retxy and retz): - # return(True) - # else: - # return(False) - def check_samplexy_scan_limits(self): """a function to be implemented by the scan pluggin that checks the scan parameters against the soft limits of the @@ -535,8 +548,10 @@ def disable_focus_btns(self): """ self.setZPtoFocusBtn.setText(f"Set Focus to Cursor") self.setA0toFocusBtn.setText(f"Set A0 to Cursor") + self.setDeltaA0Btn.setText(f"Set Delta A0 to Cursor") self.setZPtoFocusBtn.setEnabled(False) self.setA0toFocusBtn.setEnabled(False) + self.setDeltaA0Btn.setEnabled(False) def enable_focus_btns(self): """ @@ -544,6 +559,7 @@ def enable_focus_btns(self): """ self.setZPtoFocusBtn.setEnabled(True) self.setA0toFocusBtn.setEnabled(True) + self.setDeltaA0Btn.setEnabled(True) def reset_focus_btns(self, deactivate_tool=True): """ @@ -559,88 +575,96 @@ def on_new_pos_selected(self, x, y): a handler for the plotters 'new_selected_position' signal that updates our new focus position to use for setting focus """ - self._new_zpz_pos = y + + self._desired_zpz_focus_pos = y self.setZPtoFocusBtn.setText(f"Set Focus to Cursor ({y:.2f} um)") self.setA0toFocusBtn.setText(f"Set A0 to Cursor ({y:.2f} um)") + self.setDeltaA0Btn.setText(f"Set Delta A0 to Cursor ({y:.2f} um)") - def on_focus_zpz(self): + def adjust_coarse_z_to_focus(self): """ - COARSE_SAMPLEFINE, GONI_ZONEPLATE, COARSE_ZONEPLATE + adjust Coarse Z to keep sample in focus + :return: """ - if self._new_zpz_pos == None: - _logger.info("You must first select a position before you can set focus") - notify( - "Unable to set focus", - "You must first select a position before you can set focus", - accept_str="OK", - ) - return - self.reset_focus_btns() - mtr_z = self.main_obj.device("DNM_ZONEPLATE_Z") + mtr_zz = self.main_obj.device("DNM_ZONEPLATE_Z") mtr_cz = self.main_obj.device("DNM_COARSE_Z") - if mtr_cz is None: - _logger.error("Unable to find Coarse Z motor in device database, cannot set focus") - # have the plotter delete the focus image - self._parent.reset_image_plot(shape_only=True) - return - - fl = math.fabs(self.main_obj.device("DNM_FOCAL_LENGTH").get_position()) + cur_cz_pos = mtr_cz.get_position() + energy = self.main_obj.device("DNM_ENERGY").get_position() + # fl = self.energy_dev.get_focal_length() + # a0_val = self.energy_dev.get_a0() if re.search(scanning_mode, 'COARSE_SAMPLEFINE', re.IGNORECASE): - # sflag = self.main_obj.device('Zpz_scanModeFlag') - # 1 for OSA focus scan 0 for anything else - # sflag.put('user_setpoint', 0) - - a0_val = self.A0.get_position() - #calc delta zpz pos from old focus to new focus point - #zp_cent = float(str(self.centerZPFld.text())) - zp_cent = math.fabs(float(self._new_zpz_pos)) - #we use fl because it would have been set in the OSA focus scan - delta_zpz = math.fabs(zp_cent) - math.fabs((math.fabs(a0_val) - math.fabs(fl))) - #move zpz to previous zpz pos via call to self.get_prev_zpz_pos() - zpz_in_focus_at_cur_ev = a0_val - fl - - if mtr_z.within_limits(zpz_in_focus_at_cur_ev): - mtr_z.move(zpz_in_focus_at_cur_ev) - mtr_z.confirm_stopped() + new_cz_pos = self.energy_dev.calc_new_coarse_z_pos_for_focus(energy, cur_cz_pos, self._desired_zpz_focus_pos) + zpz_in_focus_at_cur_ev = self.energy_dev.calc_new_zoneplate_z_pos_for_focus(energy) + #move zpz back to theoretical focus position at current energy accounting for a0 + if mtr_zz.within_limits(zpz_in_focus_at_cur_ev): + mtr_zz.call_emit_move(zpz_in_focus_at_cur_ev, wait=False) else: _logger.error(f"new Zp Z position [{zpz_in_focus_at_cur_ev:.2f} um] is outside the soft limits of Zp Z, skipping") return - # apply that delta to Coarse Z - cz_cur_pos = mtr_cz.get_position() - new_cz_pos = cz_cur_pos + delta_zpz - if mtr_cz.within_limits(new_cz_pos): mtr_cz.move(new_cz_pos) mtr_cz.confirm_stopped() - # added Jan 18 2018, if this btn is pressed need to reset delta to 0 - self.main_obj.device("DNM_DELTA_A0").put(0.0) + # reset delta a0 + # self.main_obj.update_delta_a0(0.0) else: _logger.error(f"new Coarse Z position [{cz_cur_pos + delta_zpz:.2f} um] is outside the soft limits of Coarse Z, skipping") elif re.search(scanning_mode, 'GONI_ZONEPLATE', re.IGNORECASE): - #a0 = self.main_obj.device("DNM_A0") - #zp_cent = float(str(self.centerZPFld.text())) - zp_cent = float(self._new_zpz_pos) + # #a0 = self.main_obj.device("DNM_A0") + # #zp_cent = float(str(self.centerZPFld.text())) + # zp_cent = float(self._desired_zpz_focus_pos) + # + # mtr_z.move(zp_cent) + # mtr_z.confirm_stopped() + # + # fl = self.main_obj.device("DNM_FOCAL_LENGTH").get_position() + # mtr_z.set_position(fl) + # + # # added Jan 18 2018, if this btn is pressed need to reset delta to 0 + # self.main_obj.device("DNM_DELTA_A0").put(0.0) + + #this needs testing on cryoSTXM + pass + + elif re.search(scanning_mode, 'COARSE_ZONEPLATE', re.IGNORECASE): + _logger.info("Setting focus for COARSE_ZONEPLATE currently not supported") - mtr_z.move(zp_cent) - mtr_z.confirm_stopped() + # have the plotter delete the focus image + self._parent.reset_image_plot(shape_only=True) + self.reset_focus_btns() - fl = self.main_obj.device("DNM_FOCAL_LENGTH").get_position() - mtr_z.set_position(fl) + def on_set_a0_to_cursor(self): + """ + From document: Focusing procedures for CLS SM CryoStxm + Auth: Adam Leontowich et al + Date: Jan , 2016 - # added Jan 18 2018, if this btn is pressed need to reset delta to 0 - self.main_obj.device("DNM_DELTA_A0").put(0.0) + ...ZPz is moved to the value defined by the last cursor click + then A0 is updated, OSAz will not move and remain to be 0 - elif re.search(scanning_mode, 'COARSE_ZONEPLATE', re.IGNORECASE): - _logger.info("Setting focus for COARSE_ZONEPLATE currently not supported") + """ + mtr_zz = self.main_obj.device("DNM_ZONEPLATE_Z") + energy = self.main_obj.device("DNM_ENERGY").get_position() + + delta_focus_pos = self.energy_dev.calc_delta_focus_position(energy, self._desired_zpz_focus_pos) + self.energy_dev.update_a0_for_focus(delta_focus_pos) + zpz_in_focus = self.energy_dev.calc_new_zoneplate_z_pos_for_focus(energy) - #have the plotter delete the focus image - self._parent.reset_image_plot() + # now move ZpZ to the focus pos given A0 and delta A0 + if mtr_zz.within_limits(zpz_in_focus): + mtr_zz.call_emit_move(zpz_in_focus, wait=False) + else: + _logger.error( + f"new Zp Z position [{zpz_in_focus:.2f} um] is outside the soft limits of Zp Z, skipping") + return + + self._parent.reset_image_plot(shape_only=True) + self.reset_focus_btns() - def on_focus_a0(self): + def on_set_delta_a0_to_cursor(self): """ From document: Focusing procedures for CLS SM CryoStxm Auth: Adam Leontowich et al @@ -650,17 +674,24 @@ def on_focus_a0(self): then A0 is updated, OSAz will not move and remain to be 0 """ + mtr_zz = self.main_obj.device("DNM_ZONEPLATE_Z") + energy = self.main_obj.device("DNM_ENERGY").get_position() + + # this call updates A0 in focusclass + delta_focus_pos = self.energy_dev.calc_delta_focus_position(energy, self._desired_zpz_focus_pos) + self.energy_dev.update_delta_a0(delta_focus_pos) + zpz_in_focus = self.energy_dev.calc_new_zoneplate_z_pos_for_focus(energy) + + # now move ZpZ to the focus pos given A0 and delta A0 + if mtr_zz.within_limits(zpz_in_focus): + mtr_zz.call_emit_move(zpz_in_focus, wait=False) + else: + _logger.error( + f"new Zp Z position [{zpz_in_focus:.2f} um] is outside the soft limits of Zp Z, skipping") + return + + self._parent.reset_image_plot(shape_only=True) self.reset_focus_btns() - fl = math.fabs(self.main_obj.device("DNM_FOCAL_LENGTH").get_position()) - a0_val = self.A0.get_position() - zp_cent = float(self._new_zpz_pos) - delta_zpz = (a0_val - math.fabs(fl)) - zp_cent - #self.main_obj.device("DNM_DELTA_A0").put(delta_zpz) - self.A0.put(a0_val - delta_zpz) - #have the plotter delete the focus image - self._parent.reset_image_plot() - # sflag = self.main_obj.device('Zpz_scanModeFlag') - # sflag.put('user_setpoint', zp_focus_modes.A0MOD) def set_roi(self, roi): """ @@ -803,6 +834,14 @@ def update_data(self): else: wdg_com = self.focus_scan_update_data() + if self.scanTypeSelComboBox.currentIndex() == 0: + self.sub_type = scan_sub_types.POINT_BY_POINT + else: + self.sub_type = scan_sub_types.LINE_UNIDIR + + self.sp_db = get_first_sp_db_from_wdg_com(wdg_com) + dct_put(self.sp_db, SPDB_SCAN_PLUGIN_SUBTYPE, self.sub_type) + self.update_est_time() self.roi_changed.emit(wdg_com) return wdg_com diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/focus_scan/focus_scan.ui b/cls/applications/pyStxm/bl_configs/base_scan_plugins/focus_scan/focus_scan.ui index e1c189c3..e218ddce 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/focus_scan/focus_scan.ui +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/focus_scan/focus_scan.ui @@ -7,7 +7,7 @@ 0 0 445 - 644 + 650 @@ -130,7 +130,39 @@ - + + + + + true + + + + 75 + true + + + + Qt::LeftToRight + + + 1 + + + 2 + + + + Point by Point + + + + + Line by Line + + + + @@ -183,19 +215,6 @@ - - - - false - - - Test - - - - - - @@ -849,6 +868,16 @@ + + + + false + + + Set Delta A0 to Cursor + + + @@ -867,6 +896,8 @@ - + + + diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/line_scan/LineSpecScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/line_scan/LineSpecScan.py index f300a693..c43fde52 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/line_scan/LineSpecScan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/line_scan/LineSpecScan.py @@ -340,7 +340,7 @@ def do_scan(): mtr_x = self.main_obj.device(mtr_dct["cx_name"]) mtr_y = self.main_obj.device(mtr_dct["cy_name"]) - ev_mtr = self.main_obj.device("DNM_ENERGY") + energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") pol_mtr = self.main_obj.device("DNM_EPU_POLARIZATION") shutter = self.main_obj.device("DNM_SHUTTER") @@ -367,7 +367,7 @@ def do_scan(): for ev_roi in self.e_rois: # switch to new energy for ev_sp in ev_roi[SETPOINTS]: - yield from bps.mv(ev_mtr, ev_sp) + yield from bps.mv(energy_dev, ev_sp) self.dwell = ev_roi[DWELL] # go to start of line @@ -420,7 +420,7 @@ def do_scan(): print('entering BaseLineSpecScanClass: do_scan') psmtr_x = self.main_obj.device("DNM_SAMPLE_X") psmtr_y = self.main_obj.device("DNM_SAMPLE_Y") - mtr_ev = self.main_obj.device("DNM_ENERGY") + energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") crs_x = self.main_obj.device("DNM_COARSE_X") crs_y = self.main_obj.device("DNM_COARSE_Y") shutter = self.main_obj.device("DNM_SHUTTER") @@ -465,7 +465,7 @@ def do_scan(): for ev_sp in ev_setpoints: - yield from bps.mv(mtr_ev, ev_sp, group='EV') + yield from bps.mv(energy_dev, ev_sp, group='EV') yield from bps.wait('EV') ACCEL_DISTANCE = self.x_roi[RANGE] * accel_dist_prcnt_pv.get() diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/line_scan/LineSpecWithE712WavegenScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/line_scan/LineSpecWithE712WavegenScan.py index be86afd0..4e693d65 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/line_scan/LineSpecWithE712WavegenScan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/line_scan/LineSpecWithE712WavegenScan.py @@ -193,7 +193,7 @@ def do_scan(): mtr_x = self.main_obj.device(mtr_dct["cx_name"]) mtr_y = self.main_obj.device(mtr_dct["cy_name"]) - mtr_ev = self.main_obj.device("DNM_ENERGY") + energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") shutter = self.main_obj.device("DNM_SHUTTER") ev_setpoints = [] @@ -204,7 +204,7 @@ def do_scan(): x_traj = cycler(mtr_x, self.x_roi[SETPOINTS]) y_traj = cycler(mtr_y, self.y_roi[SETPOINTS]) - energy_traj = cycler(mtr_ev, ev_setpoints) + energy_traj = cycler(energy_dev, ev_setpoints) yield from bps.stage(gate) # this starts the wavgen and waits for it to finish without blocking the Qt event loop diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/osa_focus_scan/OsaFocusScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/osa_focus_scan/OsaFocusScan.py index 05874617..cf4e3e3c 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/osa_focus_scan/OsaFocusScan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/osa_focus_scan/OsaFocusScan.py @@ -18,6 +18,7 @@ from cls.types.stxmTypes import scan_sub_types from cls.utils.log import get_module_logger from cls.utils.json_utils import dict_to_json +from cls.utils.dict_utils import dct_get from bcm.devices.ophyd.qt.data_emitters import ImageDataEmitter, SIS3820ImageDataEmitter from cls.scan_engine.bluesky.bluesky_defs import bs_dev_modes from bcm.devices.ophyd.qt.daqmx_counter_output import trig_src_types @@ -68,6 +69,29 @@ def configure_devs(self, dets): # use defaults of all args = False d.set_row_change_index_points() + def get_num_progress_events(self): + """ + over ride base class def + """ + if self.is_lxl: + return self.zz_roi[NPOINTS] + else: + #point scan + return self.x_roi[NPOINTS] * self.zz_roi[NPOINTS] + + def get_num_points_in_scan(self): + """ + overriddden by inheriting class + """ + # self.numX = dct_get(self.sp_db, SPDB_XNPOINTS) + # self.numY = dct_get(self.sp_db, SPDB_YNPOINTS) + # self.numZ = dct_get(self.sp_db, SPDB_ZNPOINTS) + # self.numZZ = dct_get(self.sp_db, SPDB_ZZNPOINTS) + # self.numZX = dct_get(self.sp_db, SPDB_ZXNPOINTS) + # self.numZY = dct_get(self.sp_db, SPDB_ZYNPOINTS) + # self.numE = dct_get(self.sp_db, SPDB_EV_NPOINTS) + return self.numX * self.numZZ + def go_to_scan_start(self): """ an API function that will be called if it exists for all scans @@ -176,6 +200,7 @@ def make_pxp_scan_plan(self, dets, md=None, bi_dir=False): } @bpp.baseline_decorator(dev_list) + @bpp.run_decorator(md=md) def do_scan(): """ do_scan(): description @@ -190,17 +215,25 @@ def do_scan(): mtr_z = self.main_obj.device("DNM_ZONEPLATE_Z") shutter = self.main_obj.device("DNM_SHUTTER") - x_traj = cycler(mtr_x, self.x_roi[SETPOINTS]) - y_traj = cycler(mtr_y, self.y_roi[SETPOINTS]) - zz_traj = cycler(mtr_z, self.zz_roi[SETPOINTS]) - - shutter.open() - # the detector will be staged automatically by the grid_scan plan - yield from scan_nd(dets, zz_traj * (y_traj + x_traj), md=md) + # x_traj = cycler(mtr_x, self.x_roi[SETPOINTS]) + # y_traj = cycler(mtr_y, self.y_roi[SETPOINTS]) + # zz_traj = cycler(mtr_z, self.zz_roi[SETPOINTS]) + # + # shutter.open() + # # the detector will be staged automatically by the grid_scan plan + # yield from scan_nd(dets, zz_traj * (y_traj + x_traj), md=md) + + setpoints = list(zip(self.x_roi['SETPOINTS'], self.y_roi['SETPOINTS'])) + for z_sp in self.zz_roi['SETPOINTS']: + yield from bps.mv(mtr_z, z_sp, group='ZZ') + yield from bps.wait('ZZ') + for spts in setpoints: + x_sp, y_sp = spts + yield from bps.mv(mtr_x, x_sp, mtr_y, y_sp, group='BB') + yield from bps.wait('BB') + yield from bps.trigger_and_read(dets) shutter.close() - # yield from bps.wait(group='e712_wavgen') - # print("OsaFocusScanClass: make_scan_plan Leaving") return (yield from do_scan()) diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/osa_focus_scan/osa_focus_scan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/osa_focus_scan/osa_focus_scan.py index 1bc48210..798f1719 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/osa_focus_scan/osa_focus_scan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/osa_focus_scan/osa_focus_scan.py @@ -22,7 +22,7 @@ get_base_energy_roi, make_spatial_db_dict, ) -from cls.utils.calculations import focal_length +from cls.utils.focus_calculations import focal_length from cls.types.stxmTypes import scan_types, spatial_type_prefix, OSA_FOCUS_MODE, SAMPLE_FOCUS_MODE, image_types from cls.plotWidgets.shape_restrictions import ROILimitObj, ROILimitDef from cls.plotWidgets.color_def import ( @@ -63,17 +63,20 @@ def __init__( ) #self.fl = self.main_obj.device("DNM_FOCAL_LENGTH") - self.a1 = self.main_obj.device("DNM_ZP_DEF_A") + self.energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") + self.energy_dev.focus_params_changed.connect(self.on_update_focus_params) + self.a1 = self.main_obj.device("DNM_ZP_A1") self.energy_mtr = self.main_obj.device("DNM_ENERGY") - self._zpz_fbk_timer = QtCore.QTimer() - # RUSS SEPT 10 2024 self._zpz_fbk_timer.timeout.connect(self.on_update_zpz_fbk) self.sp_db = None self.load_from_defaults() self.init_sp_db() self.connect_paramfield_signals() self.on_focus_scan_single_spatial_npoints_changed() self.init_loadscan_menu() - self._zpz_fbk_timer.start(250) + + + zpz_pos = self.energy_dev.get_new_zpz_for_osa_focussed() + self.set_parm(self.centerZPFld, zpz_pos) def init_plugin(self): """ @@ -111,6 +114,16 @@ def init_plugin(self): # self._help_html_fpath = os.path.join('interface', 'window_system', 'scan_plugins', 'detector.html') self._help_ttip = "OSA Focus scan documentation and instructions" + def on_update_focus_params(self, focus_dct: dict): + """ + Update the ZP center label + """ + + # update the ZP center + # print(focus_dct) + zpz_pos = focus_dct["zpz_for_osa_focussed"] + self.set_parm(self.centerZPFld, zpz_pos) + def on_plugin_focus(self): """ This is a function that is called when the plugin first receives focus from the main GUI @@ -123,6 +136,8 @@ def on_plugin_focus(self): self.enable_line_select_btns(False) self.update_est_time() + self.energy_dev.set_focus_mode("OSA") + self._new_zpz_pos = None if self.main_obj.device("DNM_OSAY_TRACKING", do_warn=False): # make sure that the OSA vertical tracking is off if it is on @@ -168,28 +183,6 @@ def connect_paramfield_signals(self): self.connect_param_flds_to_validator(lim_dct) - def on_update_zpz_fbk(self): - """ - FL on - - """ - if re.search(scanning_mode, 'COARSE_SAMPLEFINE', re.IGNORECASE): - A0 = 0.0 - fl_val = A0 - math.fabs(focal_length(self.energy_mtr.get_position(), self.a1.get_position())) - #fl_val = A0 - math.fabs(self.fl.get_position()) - self.set_parm(self.centerZPFld, fl_val) - - elif re.search(scanning_mode, 'GONI_ZONEPLATE', re.IGNORECASE): - #needs testing - A0 = 0.0 - #fl_val = A0 - math.fabs(self.fl.get_position()) - fl_val = A0 - math.fabs(focal_length(self.energy_mtr.get_position(), self.a1.get_position())) - self.set_parm(self.centerZPFld, fl_val) - - elif re.search(scanning_mode, 'COARSE_ZONEPLATE', re.IGNORECASE): - pass - #_logger.info("Setting focus for COARSE_ZONEPLATE currently not supported") - def enable_line_select_btns(self, en): """ enable or disable the line selection buttons, if the image is currently an OSA focus then disable the buttons @@ -383,44 +376,47 @@ def on_set_focus_btn(self): accept_str="OK", ) return - self.reset_focus_btns() - mtrz = self.main_obj.device("DNM_ZONEPLATE_Z") + sflag = self.main_obj.device("DNM_ZONEPLATE_SCAN_MODE") + mtr_zz = self.main_obj.device("DNM_ZONEPLATE_Z") mtrx = self.main_obj.device("DNM_OSA_X") mtry = self.main_obj.device("DNM_OSA_Y") - # sflag 0 == Sample Focus, 1 == OSA focus - sflag = self.main_obj.device("DNM_ZONEPLATE_SCAN_MODE") - # mult by -1.0 so that it is always negative as zpz pos needs - fl = -1.0 * math.fabs(self.main_obj.device("DNM_FOCAL_LENGTH").get_position()) - a0 = self.main_obj.device("DNM_A0").get_position() + # mtr_cz = self.main_obj.device("DNM_COARSE_Z") + # cur_cz_pos = mtr_cz.get_position() + # energy = self.main_obj.device("DNM_ENERGY").get_position() + # fl = self.main_obj.get_focal_length(energy) + fl_as_zpz_pos = self.energy_dev.get_focal_length_as_zpz_position() + # zpz_in_focus = self.energy_dev.calc_new_zoneplate_z_pos_for_focus(energy) + # a0_val = self.main_obj.get_a0() if re.search(scanning_mode, 'COARSE_SAMPLEFINE', re.IGNORECASE): # 0 for OSA focus scan 1 for Sample Focus - if sflag: - sflag.put(SAMPLE_FOCUS_MODE) + # if sflag: + # sflag.put(SAMPLE_FOCUS_MODE) zp_cent = float(self._new_zpz_pos) - #zp_cent = float(str(self.centerZPFld.text())) - # support for DCS server motors that use offsets - if hasattr(mtrz, 'apply_delta_to_offset'): + if hasattr(mtr_zz, 'apply_delta_to_offset'): delta = float(str(self.centerZPFld.text())) - zp_cent - mtrz.apply_delta_to_offset(delta) + mtr_zz.apply_delta_to_offset(delta) else: - mtrz.move(zp_cent) + mtr_zz.call_emit_move(zp_cent, wait=True) - if hasattr(mtrz, 'confirm_stopped'): - mtrz.confirm_stopped() - if hasattr(mtrz, 'set_position'): - mtrz.set_position(fl) + if hasattr(mtr_zz, 'confirm_stopped'): + mtr_zz.confirm_stopped() + if hasattr(mtr_zz, 'set_position'): + mtr_zz.set_position(fl_as_zpz_pos) - mtrx.move(0.0) - mtry.move(0.0) + mtrx.call_emit_move(0.0, wait=False) + mtry.call_emit_move(0.0, wait=False) #now move to Sample Focus position which is == FL - A0 - zpz_final_pos = -1.0 * (math.fabs(fl) - math.fabs(a0)) - mtrz.move(zpz_final_pos) + # zpz_in_focus = -1.0 * (math.fabs(fl) - math.fabs(a0_val)) + #zpz_in_focus = self.main_obj.calc_new_zoneplate_z_pos_for_focus(energy) + + #mtr_zz.call_emit_move(fl_as_zpz_pos, wait=False) + self.energy_dev.move_to_osa_focussed() elif re.search(scanning_mode, 'GONI_ZONEPLATE', re.IGNORECASE): @@ -433,29 +429,31 @@ def on_set_focus_btn(self): #zp_cent = float(str(self.centerZPFld.text())) zp_cent = float(self._new_zpz_pos) - # mtrz = self.main_obj.device('DNM_ZONEPLATE_Z') + # mtr_zz = self.main_obj.device('DNM_ZONEPLATE_Z') # support for DCS server motors that use offsets - if hasattr(mtrz, 'apply_delta_to_offset'): + if hasattr(mtr_zz, 'apply_delta_to_offset'): delta = float(str(self.centerZPFld.text())) - zp_cent - mtrz.apply_delta_to_offset(delta) + mtr_zz.apply_delta_to_offset(delta) else: - mtrz.move(zp_cent) - mtrz.confirm_stopped() + mtr_zz.call_emit_move(zp_cent, wait=True) + mtr_zz.confirm_stopped() - mtrz.set_position(fl) + mtr_zz.set_position(fl_as_zpz_pos) - mtrx.move(0.0) - mtry.move(0.0) + mtrx.call_emit_move(0.0, wait=False) + mtry.call_emit_move(0.0, wait=False) # now move to Sample Focus position which is == FL - A0 - zpz_final_pos = -1.0 * (math.fabs(fl) - math.fabs(a0)) - mtrz.move(zpz_final_pos) + # zpz_final_pos = -1.0 * (math.fabs(fl) - math.fabs(a0_val)) + # mtr_zz.call_emit_move(zpz_final_pos, wait=False) + self.energy_dev.move_to_sample_focussed() elif re.search(scanning_mode, 'COARSE_ZONEPLATE', re.IGNORECASE): _logger.info("Setting focus for COARSE_ZONEPLATE currently not supported") - #have the plotter delete the focus image - self._parent.reset_image_plot() + # have the plotter delete the focus image + self._parent.reset_image_plot(shape_only=True) + self.reset_focus_btns() def set_roi(self, roi): """ @@ -484,8 +482,8 @@ def set_roi(self, roi): self.set_parm(self.startYFld, sy) # we want the ZP center to always be the current Zpz pozition - zpz_pos = self.main_obj.device("DNM_ZONEPLATE_Z").get_position() - self.set_parm(self.centerZPFld, zpz_pos) + # zpz_pos = self.main_obj.device("DNM_ZONEPLATE_Z").get_position() + # self.set_parm(self.centerZPFld, zpz_pos) if ex != None: self.set_parm(self.endXFld, ex) diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/osa_scan/osa_scan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/osa_scan/osa_scan.py index 5c1eda29..4437b50f 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/osa_scan/osa_scan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/osa_scan/osa_scan.py @@ -81,6 +81,7 @@ def __init__( self.osay_trcking_was = None self.osa_tracking_enabled = False + self.energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") self.sp_db = None self.load_from_defaults() self.init_sp_db() @@ -126,6 +127,7 @@ def on_plugin_focus(self): :return: """ if self.isEnabled(): + self.energy_dev.set_focus_mode("OSA") # make sure that the OSA vertical tracking is off if it is on self.update_est_time() if self.osa_tracking_enabled: diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/positioner_scan/PositionerScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/positioner_scan/PositionerScan.py index 881dd539..0f826c54 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/positioner_scan/PositionerScan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/positioner_scan/PositionerScan.py @@ -141,6 +141,7 @@ def make_pxp_scan_plan(self, dets, md=None, bi_dir=False): @bpp.baseline_decorator(dev_list) + @bpp.run_decorator(md=md) def do_scan(): mtr_x = self.main_obj.device(self.x_roi[POSITIONER]) @@ -151,14 +152,21 @@ def do_scan(): if hasattr(d, "set_spid"): d.set_spid(self._master_sp_id_list[0]) - yield from scan( - dets, - mtr_x, - self.x_roi[START], - self.x_roi[STOP], - self.x_roi[NPOINTS], - md=md, - ) + # yield from scan( + # dets, + # mtr_x, + # self.x_roi[START], + # self.x_roi[STOP], + # self.x_roi[NPOINTS], + # md=md, + # ) + # a scan with N events + for x_sp in self.x_roi['SETPOINTS']: + yield from bps.mv(mtr_x, x_sp, group='BB') + # yield from bps.wait('BB') + #yield from bps.trigger_and_read(dets) + yield from bps.trigger_and_read(dets + [mtr_x]) + shutter.close() for d in dets: diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/ptychography_scan/PtychographyScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/ptychography_scan/PtychographyScan.py index 66ab4a6c..97ac676c 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/ptychography_scan/PtychographyScan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/ptychography_scan/PtychographyScan.py @@ -624,7 +624,7 @@ def configure(self, wdg_com, sp_id=0, line=False, restore=True, z_enabled=False) self.outer_pnts = [] self.dwell_setpoints_ms = [] - energy_dev = self.main_obj.device("DNM_ENERGY") + energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") epu_pol_dev = self.main_obj.device("DNM_EPU_POLARIZATION") epu_offset_dev = self.main_obj.device("DNM_EPU_OFFSET") epu_angle_dev = self.main_obj.device("DNM_EPU_ANGLE") diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/SampleFineImageScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/SampleFineImageScan.py new file mode 100644 index 00000000..b7e7ee94 --- /dev/null +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/SampleFineImageScan.py @@ -0,0 +1,873 @@ +""" +Created on Apr 26, 2017 + +@author: bergr +""" +import bluesky.plan_stubs as bps +import bluesky.preprocessors as bpp +from bluesky.utils import FailedStatus + +from ophyd.utils import (ReadOnlyError, LimitError, DestroyedError) +from cls.applications.pyStxm import abs_path_to_ini_file +from cls.applications.pyStxm.main_obj_init import MAIN_OBJ + +from cls.scanning.BaseScan import BaseScan, SIM_SPEC_DATA, SIMULATE_SPEC_DATA +from cls.types.stxmTypes import ( + scan_types, + scan_sub_types, + energy_scan_order_types, + sample_positioning_modes, + sample_fine_positioning_modes, +) +from cls.scanning.scan_cfg_utils import ensure_valid_values, calc_accRange +from cls.scan_engine.decorators import conditional_decorator +from cls.utils.roi_dict_defs import * +from cls.utils.log import get_module_logger +from cls.utils.cfgparser import ConfigClass +from cls.utils.dict_utils import dct_put, dct_get +from cls.utils.json_utils import dict_to_json + +from cls.plotWidgets.utils import * + +_logger = get_module_logger(__name__) + +appConfig = ConfigClass(abs_path_to_ini_file) + +# get the accel distance for now from the app configuration +ACCEL_DISTANCE_PERCENT_OF_RANGE = MAIN_OBJ.get_preset_as_float("coarse_accel_dist_percent_of_range") + + +class BaseSampleFineImageScanClass(BaseScan): + """ + This class is used to implement Coarse scans for conventional mode scanning + """ + + def __init__(self, main_obj=None): + """ + __init__(): description + + :returns: None + """ + super().__init__(main_obj=main_obj) + # self.x_use_reinit_ddl = False + # self.x_auto_ddl = True + # self.spid_data = None + self.img_idx_map = {} + self.spid_data = {} + # set a default detctor name if the user has not selected any detector from the detector selection window + # self.default_detector_nm = "C" + + def config_devs_for_line(self, dets): + ''' + config devs for line scan + ''' + for d in dets: + if hasattr(d, "set_dwell"): + d.set_dwell(self.dwell) + if hasattr(d, "set_config"): + d.set_config(self.y_roi["NPOINTS"], self.x_roi["NPOINTS"], is_pxp_scan=self.is_pxp) + if hasattr(d, "setup_for_hdw_triggered"): + d.setup_for_hdw_triggered() + if hasattr(d, "set_row_change_index_points"): + d.set_row_change_index_points(remove_first_point=True) + if hasattr(d, "set_sequence_map"): + d.set_sequence_map(self.seq_map_dct) + + def config_devs_for_point(self, dets): + ''' + config devs for point scan + ''' + for d in dets: + if hasattr(d, "set_dwell"): + d.set_dwell(self.dwell) + if hasattr(d, "set_config"): + d.set_config(self.y_roi["NPOINTS"], self.x_roi["NPOINTS"], is_pxp_scan=True) + if hasattr(d, "setup_for_software_triggered"): + d.setup_for_software_triggered() + if hasattr(d, "set_row_change_index_points"): + # use defaults of all args = False + d.set_row_change_index_points() + if hasattr(d, "set_sequence_map"): + d.set_sequence_map(self.seq_map_dct) + + def configure_devs(self, dets): + """ + + """ + super().configure_devs(dets) + + if self.is_lxl: + self.config_devs_for_line(dets) + else: + self.config_devs_for_point(dets) + + def go_to_scan_start(self): + """ + an API function that will be called if it exists for all scans + move the coarse X and Y motors to the start of the scan and make sure the + piezo motors are off + mtr_dct = + {'xstart': -3000.0, + 'ystart': -3238.07, + 'xpv': 'PSMTR1610-3-I12-00', + 'ypv': 'PSMTR1610-3-I12-01', + 'sx_name': 'DNM_SAMPLE_X', + 'sy_name': 'DNM_SAMPLE_Y', + 'cx_name': 'DNM_SAMPLE_X', + 'cy_name': 'DNM_SAMPLE_Y', + 'fx_name': 'DNM_SAMPLE_FINE_X', + 'fy_name': 'DNM_SAMPLE_FINE_Y', + 'fine_pv_nm': {'X': 'PZAC1610-3-I12-40', 'Y': 'PZAC1610-3-I12-41'}, + 'coarse_pv_nm': {'X': 'PSMTR1610-3-I12-00', 'Y': 'PSMTR1610-3-I12-01'}, + 'sample_pv_nm': {'X': 'PSMTR1610-3-I12-00', 'Y': 'PSMTR1610-3-I12-01'}} + """ + super().fine_scan_go_to_scan_start() + # mtr_dct = self.determine_samplexy_posner_pvs() + # mtr_x = self.main_obj.device(mtr_dct["sx_name"]) + # mtr_y = self.main_obj.device(mtr_dct["sy_name"]) + # + # accel_dist_prcnt_pv, deccel_dist_prcnt_pv = self.get_accel_deccel_pvs() + # + # ACCEL_DISTANCE = self.x_roi[RANGE] * accel_dist_prcnt_pv.get() + # DECCEL_DISTANCE = self.x_roi[RANGE] * deccel_dist_prcnt_pv.get() + # xstart = self.x_roi[START] - ACCEL_DISTANCE + # xstop = self.x_roi[STOP] + DECCEL_DISTANCE + # ystart, ystop = self.y_roi[START], self.y_roi[STOP] + # + # # check if beyond soft limits + # # if the soft limits would be violated then return False else continue and return True + # if not mtr_x.check_scan_limits(xstart, xstop, coarse_only=True): + # _logger.error("Scan would violate soft limits of X motor") + # return (False) + # if not mtr_y.check_scan_limits(ystart, ystop, coarse_only=True): + # _logger.error("Scan would violate soft limits of Y motor") + # return (False) + # + # #before starting scan check the interferometers, note BOTH piezo's must be off first + # mtr_x.set_piezo_power_off() + # mtr_y.set_piezo_power_off() + # + # mtr_x.do_interferometer_check() + # mtr_y.do_interferometer_check() + # + # mtr_x.move_coarse_to_scan_start(start=xstart, stop= self.x_roi[STOP], npts=self.x_roi[NPOINTS], dwell=self.dwell) + # mtr_y.move_coarse_to_position(ystart, False) + + return(True) + + def verify_scan_velocity(self): + """ + This is meant to take a motor and check that the scan velocity is not greater than the max velocity of the motor + To be implemented by the inheriting class + + calc_scan_velo(self, mtr, rng, npoints, dwell) + return True for scan velo checks out and False for it is invalid + """ + mtr_x = self.main_obj.device("DNM_SAMPLE_FINE_X") + + self.scan_velo = self.calc_scan_velo(mtr_x, self.x_roi[RANGE], self.x_roi[NPOINTS], self.dwell) + if self.scan_velo > 0: + return(True) + else: + return(False) + + def get_num_progress_events(self): + """ + over ride base class def + """ + # if self.is_lxl: + # return self.y_roi[NPOINTS] + # else: + # #point scan + # return self.x_roi[NPOINTS] * self.y_roi[NPOINTS] + if self.is_lxl: + return self.y_roi[NPOINTS] * self.numE * self.numEPU * self.numSPIDS + else: + # point scan + return self.x_roi[NPOINTS] * self.y_roi[NPOINTS] * self.numE * self.numEPU * self.numSPIDS + + def make_scan_plan(self, dets, md=None, bi_dir=False): + """ + override the default make_scan_plan to set the scan_type + :param dets: + :param gate: + :param md: + :param bi_dir: + :return: + """ + self.configure_devs(dets) + self.dev_list = self.main_obj.main_obj[DEVICES].devs_as_list() + if self.numImages == 1: + self.scan_type = scan_types.SAMPLE_IMAGE + return self.make_soft_stack_image_plan(dets, md=md, bi_dir=bi_dir) + else: + self.scan_type = scan_types.SAMPLE_IMAGE_STACK + return self.make_soft_stack_image_plan(dets, md=md, bi_dir=bi_dir) + + + def make_soft_stack_image_plan(self, dets, md=None, bi_dir=False): + #print("entering: make_stack_image_plan") + self._saved_one = False + stagers = [] + for d in dets: + stagers.append(d) + + def do_scan(): + energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") + pol_mtr = self.main_obj.device("DNM_EPU_POLARIZATION") + off_mtr = self.main_obj.device("DNM_EPU_OFFSET") + ang_mtr = self.main_obj.device("DNM_EPU_ANGLE") + + # print('starting: make_stack_image_plan: do_scan()') + entrys_lst = [] + entry_num = 0 + # idx = 0 + self._current_img_idx = 0 + point_spec_devs_configd = False + prev_entry_nm = "" + # , starts=starts, stops=stops, npts=npts, group='e712_wavgen', wait=True) + # this starts the wavgen and waits for it to finish without blocking the Qt event loop + epu_sps = zip(self.setpointsPol, self.setpointsOff,self.setpointsAngle) + + for pol, off, ang in epu_sps: + # switch to new polarization, offset and angle + if pol_mtr.get_position() != pol: + yield from bps.mv(pol_mtr, pol) + if off_mtr.get_position() != off: + yield from bps.mv(off_mtr, off) + if ang_mtr.get_position() != ang: + yield from bps.mv(ang_mtr, ang) + # switch to new energy + for ev_sp in self.ev_setpoints: + yield from bps.mv(energy_dev, ev_sp) + # self.dwell = ev_roi[DWELL] + self.dwell = self.setpointsDwell + + # now load and execute each spatial region + for sp_id in self.sp_ids: + self.sp_id = sp_id + # this updates member vars x_roi, y_roi, etc... with current spatial id specifics + self.update_roi_member_vars(self.sp_rois[self.sp_id]) + if self.is_point_spec and (not point_spec_devs_configd): + # config the det and gate + for d in dets: + if hasattr(d, "set_mode"): + d.set_mode(bs_dev_modes.NORMAL_PXP) + if hasattr(d, "configure"): + d.configure() + + point_spec_devs_configd = True + + samplemtrx = self.main_obj.get_sample_positioner("X") + samplemtry = self.main_obj.get_sample_positioner("Y") + finemtrx = self.main_obj.get_sample_fine_positioner("X") + finemtry = self.main_obj.get_sample_fine_positioner("Y") + # make sure servo power is on + finemtrx.servo_power.put(1) + finemtry.servo_power.put(1) + + if self.is_zp_scan: + # moving them to the start gets rid of a goofy first line of the scan + yield from bps.mv(finemtrx, self.zx_roi[START]) + yield from bps.mv(finemtry, self.zy_roi[START]) + yield from bps.mv( + samplemtrx, + self.gx_roi[CENTER], + samplemtry, + self.gy_roi[CENTER], + ) + # samplemtrx.move(self.gx_roi[CENTER], wait=True) + # samplemtry.move(self.gy_roi[CENTER], wait=True) + + else: + # !!! THIS NEEDS TESTING + # moving them to the start gets rid of a goofy first line of the scan + yield from bps.mv(finemtrx, self.x_roi[START]) + yield from bps.mv(finemtry, self.y_roi[START]) + ############################ + # take a single image that will be saved with its own run scan id + # img_dct = self.img_idx_map['%d' % idx] + img_dct = self.img_idx_map["%d" % self._current_img_idx] + + md = { + "metadata": dict_to_json( + self.make_standard_metadata( + entry_name=img_dct["entry"], + dets=dets, + scan_type=self.scan_type, + ) + ) + } + # if(entry_num is 0): + # if(img_dct['entry'] is not prev_entry_nm): + if img_dct["entry"] not in entrys_lst: + # only create the entry once + if self.is_point_spec: + yield from self.make_soft_single_point_spec_plan( + dets, md=md, do_baseline=True + ) + else: + if self.is_lxl: + yield from self.make_lxl_scan_plan( + dets, md=md, do_baseline=True + ) + else: + yield from self.make_pxp_scan_plan( + dets, md=md, do_baseline=True + ) + + else: + # this data will be used to add to previously created entries + if self.is_point_spec: + yield from self.make_soft_single_point_spec_plan( + dets, md=md, do_baseline=False + ) + else: + if self.is_lxl: + yield from self.make_lxl_scan_plan( + dets, md=md, do_baseline=False + ) + else: + yield from self.make_pxp_scan_plan( + dets, md=md, do_baseline=False + ) + + # entry_num += 1 + # idx += 1 + self._current_img_idx += 1 + # prev_entry_nm = img_dct['entry'] + entrys_lst.append(img_dct["entry"]) + + self._saved_one = True + + #print("make_stack_image_plan Leaving") + + return (yield from do_scan()) + + + def make_lxl_scan_plan(self, dets, md=None, bi_dir=False, do_baseline=True): + """ + This produces a line by line scan that uses base level plans to do the scan + due to the sis3820 requiring it to be running before the X motor moves across the scan line + + :param dets: + :param gate: + :param bi_dir: + :param do_baseline: should a baseline reading be taken, stack scan controlled + :return: + """ + self._bi_dir = bi_dir + if md is None: + md = { + "metadata": dict_to_json( + self.make_standard_metadata( + entry_name="entry0", scan_type=self.scan_type, dets=dets + ) + ) + } + print(f"RUSS:make_lxl_scan_plan: self.scan_type={self.scan_type}") + @conditional_decorator(bpp.baseline_decorator(self.dev_list), do_baseline) + @bpp.stage_decorator(dets) + @bpp.run_decorator(md=md) + def do_scan(): + try: + print('entering BaseSampleFineImageScanClass: make_lxl_scan_plan') + print(f"RUSS:make_lxl_scan_plan:do_scan: self.scan_type={self.scan_type}") + + psmtr_x = self.main_obj.device("DNM_SAMPLE_X") + psmtr_y = self.main_obj.device("DNM_SAMPLE_Y") + crs_x = self.main_obj.device("DNM_COARSE_X") + crs_y = self.main_obj.device("DNM_COARSE_Y") + shutter = self.main_obj.device("DNM_SHUTTER") + piezo_mtr_x = self.main_obj.get_sample_fine_positioner("X") + piezo_mtr_y = self.main_obj.get_sample_fine_positioner("Y") + self.is_fine_scan = False + accel_dist_prcnt_pv, deccel_dist_prcnt_pv = self.get_accel_deccel_pvs() + + psmtr_x.set_piezo_power_on() + psmtr_y.set_piezo_power_on() + + shutter.open() + ACCEL_DISTANCE = self.x_roi["RANGE"] * accel_dist_prcnt_pv.get() + DECCEL_DISTANCE = self.x_roi["RANGE"] * deccel_dist_prcnt_pv.get() + + #scan_velo = self.x_roi["RANGE"] / ((self.x_roi["NPOINTS"] * self.dwell) * 0.001) + piezo_mtr_x.scan_start.put(self.x_roi['START'] - ACCEL_DISTANCE) + piezo_mtr_x.scan_stop.put(self.x_roi['STOP'] + DECCEL_DISTANCE) + + piezo_mtr_x.marker_start.put(self.x_roi['START']) + piezo_mtr_x.marker_stop.put(self.x_roi['STOP']) + piezo_mtr_x.set_marker.put(self.x_roi['START']) + piezo_mtr_x.set_marker_position(self.x_roi['START']) + + # move to scan start + yield from bps.mv(piezo_mtr_x, self.x_roi['START'] - ACCEL_DISTANCE, group='BB') + yield from bps.mv(piezo_mtr_y, self.y_roi['START'], group='BB') + yield from bps.wait('BB') + + for y_sp in self.y_roi['SETPOINTS']: + ACCEL_DISTANCE = self.x_roi["RANGE"] * accel_dist_prcnt_pv.get() + DECCEL_DISTANCE = self.x_roi["RANGE"] * deccel_dist_prcnt_pv.get() + #print(f"CoarseImageScan: ACCEL_DISTANCE = {ACCEL_DISTANCE}, DECCEL_DISTANCE={DECCEL_DISTANCE}") + piezo_mtr_x.velocity.put(self.scan_velo) + piezo_mtr_x.enable_marker_position(True) + for d in dets: + if hasattr(d, 'run'): + yield from bps.mv(d.run, 1, group='SIS3820') + + # yield from bps.mv(crs_y, y_sp) + yield from bps.mv(piezo_mtr_x, self.x_roi['STOP'] + DECCEL_DISTANCE, group='BB') + yield from bps.wait('BB') + yield from bps.trigger_and_read(dets) + piezo_mtr_x.enable_marker_position(False) + yield from bps.mv(piezo_mtr_x, self.x_roi['START'] - ACCEL_DISTANCE, piezo_mtr_y, y_sp, group='CC') + yield from bps.wait('CC') + + shutter.close() + except LimitError as le: + _logger.error(f"There was a problem involving a motor setpoint being larger than valid range: [{le}]") + + except FailedStatus as fe: + _logger.error(f"Most likely a motor is sitting on a limit: [{fe}]") + + return (yield from do_scan()) + + def make_pxp_scan_plan(self, dets, bi_dir=False, md={}, do_baseline=True): + """ + This produces a point by point scan that uses base level plans to do the scan + due to the sis3820 requiring it to be running before the X motor moves across the scan line + + :param dets: + :param gate: + :param bi_dir: + :param do_baseline: should a baseline reading be taken, stack scan controlled + :return: + """ + self._bi_dir = bi_dir + # zp_def = self.get_zoneplate_info_dct() + mtr_dct = self.determine_samplexy_posner_pvs() + if md is None: + md = { + "metadata": dict_to_json( + self.make_standard_metadata( + entry_name="entry0", scan_type=self.scan_type, dets=dets + ) + ) + } + + @conditional_decorator(bpp.baseline_decorator(self.dev_list), do_baseline) + @bpp.run_decorator(md=md) + def do_scan(): + print('entering BaseSampleFineImageScanClass: make_pxp_scan_plan') + # Declare the end of the run. + # make sure that the positions of the piezos are correct to start + psmtr_x = self.main_obj.device("DNM_SAMPLE_X") + psmtr_y = self.main_obj.device("DNM_SAMPLE_Y") + psmtr_x.set_piezo_power_on() + psmtr_y.set_piezo_power_on() + piezo_mtr_x = self.main_obj.device(mtr_dct["fx_name"]) + piezo_mtr_y = self.main_obj.device(mtr_dct["fy_name"]) + + shutter = self.main_obj.device("DNM_SHUTTER") + # the detector will be staged automatically by the grid_scan plan + shutter.open() + + for y_sp in self.y_roi['SETPOINTS']: + yield from bps.mv(piezo_mtr_y, y_sp) + + for x_sp in self.x_roi['SETPOINTS']: + yield from bps.mv(piezo_mtr_x, x_sp, group='AA') + yield from bps.wait('AA') + # yield from bps.sleep(0.002) # small delay to allow detectors to settle + yield from bps.trigger_and_read(dets) + + yield from bps.mv(piezo_mtr_x, self.x_roi["SETPOINTS"][0], group='AA') + yield from bps.sleep(0.8) + + shutter.close() + + return (yield from do_scan()) + + def configure(self, wdg_com, sp_id=0, ev_idx=0, line=True, block_disconnect_emit=False): + """ + configure(): This is the configure routine that is required to be defined by every scan plugin. the main goal of the configure function is to + - extract into member variables the scan param data from the wdg_com (widget communication) dict + - configure the sample motors for the correct Mode for the upcoming scan + - reset any relevant member variable counters + - decide if it is a line by line, point by point or point spectrum scan + - set the optimization function for this scan (which is used later to fine tune some key params of the sscan record before scan) + - decide if this is a goniometer scan and set a flag accordingly + - set the start/stop/npts etc fields of the relevant sscan records for a line or point scan by calling either: + set_ImageLineScan_line_sscan_rec() or set_ImageLineScan_point_sscan_rec() + - determine the positioners that will be used in this scan (they depend on the size of the scan range, coarse or fine etc) + - call either config_for_goniometer_scan() or config_for_sample_holder_scan() depending on if a goniometer scan or not + - create the numpy array in self.data by calling config_hdr_datarecorder() + - then call final_setup() which must be called at the end of every configure() function + + :param wdg_com: wdg_com is a "widget Communication dictionary" and it is used to relay information to/from widgets regarding current regions of interest + :type wdg_com: wdg_com is a dictionary comprised of 2 keys: WDGCOM_CMND and SPDB_SPATIAL_ROIS, both of which are strings defined in roi_dict_defs.py + WDGCOM_CMND : is a command that identifys what should be done with the rois listed in the next field + SPDB_SPATIAL_ROIS : is a list of spatial roi's or spatial databases (sp_db) + + :param sp_id: sp_id is the "spatial ID" of the sp_db + :type sp_id: integer + + :param ev_idx: ev_idx is the index into the e_rois[] list of energy regions of interest, this configure() function could be called again repeatedly if there are more than one + energy regions of interest, this index is the index into that list, when the scan is first configured/called the index is always the first == 0 + :type ev_idx: integer + + :param line: line is a boolean flag indicating if the scan to be configured is a line by line scan or not + :type line: bool + + :param block_disconnect_emit: because configure() can be called repeatedly by check_more_spatial_regions() I need to be able to control + how the main GUI will react to a new scan being executed in succession, this flag if False will not blocking the emission of the 'disconnect' signals signal + and if True it will block teh emission of the 'disconnect' that the main GUI is listening to + :type block_disconnect_emit: bool + + :returns: None + + """ + ret = super().configure(wdg_com, sp_id=sp_id, line=line, z_enabled=False) + if not ret: + return(ret) + _logger.info("\n\SampleFineImageScanClass: configuring sp_id [%d]" % sp_id) + self.new_spatial_start_sent = False + # initial setup and retrieval of common scan information + self.set_spatial_id(sp_id) + self.determine_scan_res() + # if self.is_fine_scan: + # _logger.error("Scan is a fine scan, use Image Scan for this") + # return None + + # dct_put(self.sp_db, SPDB_RECT, (self.x_roi[START], self.y_roi[START], self.x_roi[STOP], self.y_roi[STOP])) + # the sample motors have different modes, make a call to handle that they are setup correctly for this scan + self.configure_sample_motors_for_scan() + + if ev_idx == 0: + self.reset_evidx() + self.reset_imgidx() + # self.reset_pnt_spec_spid_idx() + self.final_data_dir = None + self.update_dev_data = [] + + self.is_multi_spatial = False + self.set_save_all_data(False) + + # get the energy and EOU related setpoints + e_roi = self.e_rois[ev_idx] + self.setpointsDwell = dct_get(e_roi, DWELL) + # self.setpointsPol = self.convert_polarity_points(dct_get(e_roi, 'EPU_POL_PNTS')) + self.setpointsPol = dct_get(e_roi, EPU_POL_PNTS) + self.setpointsOff = dct_get(e_roi, EPU_OFF_PNTS) + self.setpointsAngle = dct_get(e_roi, EPU_ANG_PNTS) + self.ev_pol_order = dct_get(e_roi, EV_POL_ORDER) + + sps = dct_get(self.wdg_com, SPDB_SINGLE_LST_SP_ROIS) + evs = dct_get(self.wdg_com, SPDB_SINGLE_LST_EV_ROIS) + pols = dct_get(self.wdg_com, SPDB_SINGLE_LST_POL_ROIS) + dwells = dct_get(self.wdg_com, SPDB_SINGLE_LST_DWELLS) + + self.use_hdw_accel = False + self.x_auto_ddl = False + self.x_use_reinit_ddl = False + + # setup some convienience member variables + self.dwell = e_roi[DWELL] + self.numX = int(self.x_roi[NPOINTS]) + self.numY = int(self.y_roi[NPOINTS]) + self.numZX = int(self.zx_roi[NPOINTS]) + self.numZY = int(self.zy_roi[NPOINTS]) + self.numEPU = len(self.setpointsPol) + # self.numE = self.sp_db[SPDB_EV_NPOINTS] * len(self.setpointsPol) + self.numE = int(self.sp_db[SPDB_EV_NPOINTS]) + self.numSPIDS = len(self.sp_rois) + self.numImages = 1 + + # set some flags that are used elsewhere + self.stack = False + self.is_lxl = False + self.is_pxp = False + self.is_point_spec = False + self.file_saved = False + self.sim_point = 0 + + # users can request that the the ev and polarity portions of the scan can be executed in different orders + # based on the order that requires a certain what for the sscan clases to be assigned in terms of their "level" so handle that in + # another function + # self.set_ev_pol_order(self.ev_pol_order) + if self.scan_sub_type == scan_sub_types.LINE_UNIDIR: + # LINE_UNIDIR + self.is_lxl = True + + else: + # POINT_BY_POINT + self.is_pxp = True + + # # depending on the scan size the positioners used in the scan will be different, use a singe + # # function to find out which we are to use and return those names in a dct + dct = self.determine_samplexy_posner_pvs() + + self.numImages = int( + self.sp_db[SPDB_EV_NPOINTS] * self.numEPU * self.numSPIDS + ) + + # set some flags that are used elsewhere + if self.numImages > 1: + self.stack = True + else: + self.stack = False + + self.final_data_dir = self.config_hdr_datarecorder( + self.stack, self.final_data_dir + ) + # self.stack_scan = stack + + # make sure OSA XY is in its center + self.move_osaxy_to_its_center() + + self.seq_map_dct = self.generate_2d_seq_image_map( + num_evs=self.numE, num_pols=self.numEPU, nypnts=self.y_roi[NPOINTS], nxpnts=self.x_roi[NPOINTS], lxl=self.is_lxl + ) + + # THIS must be the last call + self.finish_setup() + # self.new_spatial_start.emit(sp_id) + return ret + + def config_for_sample_holder_scan(self, dct): + """ + this function accomplishes the following: + - set the positoners for X and Y + - set the sample X and Y positioners to self.sample_mtrx etc + - determine and set the fine positioners to sample_finex etc + - move the sample_mtrx/y to start by setting scan Mode too ScanStart then moving and waiting until stopped + - determine if coarse or fine scan and PxP or LxL and: + - get max velo of the x positioner + - Determine if scan is Line Spectra + - if LineSpectra the number of points is Y not X + - calc ScanVelo, Npts and Dwell, adjusting Npts to match velo and dwell + - Depending on coarse or fine scans calc accel/deccel range or get straight from blConfig + - Set the MarkerStart,ScanStart/Stop etc by calling config_samplex_start_stop + - set the X positioner velocity to the scan velo + - set the driver Mode to LINE_UNIDIR or COARSE or whatever it needs + - if Fine scan make sure the servo power is on + """ + self.sample_mtrx = self.main_obj.get_sample_positioner("X") + self.sample_mtry = self.main_obj.get_sample_positioner("Y") + self.sample_finex = self.main_obj.get_sample_fine_positioner("X") + self.sample_finey = self.main_obj.get_sample_fine_positioner("Y") + self.coarse_x = self.main_obj.device("DNM_COARSE_X") + self.coarse_y = self.main_obj.device("DNM_COARSE_Y") + + # setup X positioner + self.sample_mtrx.set_mode(self.sample_mtrx.MODE_SCAN_START) + self.sample_mtrx.move(dct["xstart"]) + _logger.info("Waiting for SampleX to move to start") + self.confirm_stopped([self.sample_mtrx]) + # self.sample_finex.set_power(0) + # self.coarse_x.move(dct["xstart"]) + # _logger.info("Waiting for SampleX to move to start") + # self.confirm_stopped([self.coarse_x]) + + # setup Y positioner + self.sample_mtry.set_mode(self.sample_mtrx.MODE_SCAN_START) + self.sample_mtry.move(dct["ystart"]) + _logger.info("Waiting for SampleY to move to start") + self.confirm_stopped([self.sample_mtry]) + # self.sample_finex.set_power(0) + # self.coarse_y.move(dct["ystart"]) + # _logger.info("Waiting for SampleY to move to start") + # self.confirm_stopped([self.coarse_y]) + + # setup X + if self.is_pxp or self.is_point_spec: + if self.x_roi[SCAN_RES] == COARSE: + # scan_velo = self.get_mtr_max_velo(self.xScan.P1) + scan_velo = self.sample_mtrx.get_max_velo() + else: + # scan_velo = self.get_mtr_max_velo(self.main_obj.device('DNM_SAMPLE_FINE_X)) + scan_velo = self.sample_finex.get_max_velo() + + # x needs one extra to switch the row + npts = self.numX + dwell = self.dwell + accRange = 0 + deccRange = 0 + line = False + else: + _ev_idx = self.get_evidx() + e_roi = self.e_rois[_ev_idx] + vmax = self.sample_mtrx.get_max_velo() + # its not a point scan so determine the scan velo and accRange + if self.scan_type == scan_types.SAMPLE_LINE_SPECTRUM: + # for line spec scans the number of points is saved in self.numY + (scan_velo, npts, dwell) = ensure_valid_values( + self.x_roi[START], + self.x_roi[STOP], + self.dwell, + self.numY, + vmax, + do_points=True, + ) + else: + (scan_velo, npts, dwell) = ensure_valid_values( + self.x_roi[START], + self.x_roi[STOP], + self.dwell, + self.numX, + vmax, + do_points=True, + ) + + if self.x_roi[SCAN_RES] == COARSE: + accRange = calc_accRange( + dct["sx_name"], + self.x_roi[SCAN_RES], + self.x_roi[RANGE], + scan_velo, + dwell, + accTime=0.04, + ) + deccRange = accRange + else: + # pick up any changes from disk from the app config file + # appConfig.update() + section = "SAMPLE_IMAGE_PXP" + if self.is_lxl: + section = "SAMPLE_IMAGE_LXL" + + # accRange = float(appConfig.get_value(section, 'f_acc_rng')) + # deccRange = float(appConfig.get_value(section, 'f_decc_rng')) + accRange = self.main_obj.get_preset(section, "f_acc_rng") + deccRange = self.main_obj.get_preset(section, "f_decc_rng") + + # the number of points may have changed in order to satisfy the dwell the user wants + # so update the number of X points and dwell + # self.numX = npts + # self.x_roi[NPOINTS] = npts + + line = True + e_roi[DWELL] = dwell + self.dwell = dwell + + print("accRange=%.2f um" % (accRange)) + print("deccRange=%.2f um" % (deccRange)) + + # move X to start + # self.sample_mtrx.put('Mode', MODE_SCAN_START) + # self.sample_mtrx.put('Mode', MODE_NORMAL) + if self.is_lxl: + # self.config_samplex_start_stop(dct['xpv'], self.x_roi[START], self.x_roi[STOP], self.numX, accRange=accRange, line=line) + if self.x_roi[SCAN_RES] == COARSE: + self.sample_mtrx.config_start_stop( + self.x_roi[START], + self.x_roi[STOP], + self.numX, + accRange=accRange, + deccRange=deccRange, + line=line, + ) + self.sample_mtrx.set_velo(scan_velo) + # self.config_samplex_start_stop(dct['sample_pv_nm']['X'], self.x_roi[START], self.x_roi[STOP], self.numX, + # accRange=accRange, deccRange=deccRange, line=line) + else: + # if it is a fine scan then dont use the abstract motor for the actual scanning + # because the status fbk timing is currently not stable + self.sample_finex.config_start_stop( + self.x_roi[START], + self.x_roi[STOP], + self.numX, + accRange=accRange, + deccRange=deccRange, + line=line, + ) + self.sample_finex.set_velo(scan_velo) + # self.config_samplex_start_stop(dct['fine_pv_nm']['X'], self.x_roi[START], self.x_roi[STOP], + # self.numX, accRange=accRange, deccRange=deccRange, line=line) + + # self.set_x_scan_velo(scan_velo) + # self.confirm_stopped([self.sample_mtrx, self.sample_mtry]) + + self.num_points = self.numY + + # self.confirm_stopped(self.mtr_list) + # set teh velocity in teh sscan rec for X + if self.is_pxp or self.is_point_spec: + # force it to toggle, not sure why this doesnt just work + if self.x_roi[SCAN_RES] == COARSE: + # self.sample_mtrx.put('Mode', MODE_COARSE) + self.sample_mtrx.set_mode(self.sample_mtrx.MODE_COARSE) + + else: + # self.sample_mtrx.put('Mode', MODE_POINT) + # self.sample_finex.set_power( 1) + self.sample_mtrx.set_mode(self.sample_mtrx.MODE_POINT) + self.sample_finex.set_power(self.sample_mtrx.POWER_ON) + + if self.y_roi[SCAN_RES] == COARSE: + # self.sample_mtry.put('Mode', MODE_COARSE) + self.sample_mtry.set_mode(self.sample_mtry.MODE_COARSE) + else: + # self.sample_mtry.put('Mode', MODE_LINE_UNIDIR) + # self.sample_finey.set_power( 1) + self.sample_mtry.set_mode(self.sample_mtry.MODE_LINE_UNIDIR) + self.sample_finey.set_power(self.sample_mtry.POWER_ON) + + else: + # force it to toggle, not sure why this doesnt just work + if self.x_roi[SCAN_RES] == COARSE: + # self.sample_mtrx.put('Mode', MODE_COARSE) + self.sample_mtrx.set_mode(self.sample_mtrx.MODE_COARSE) + # self.xScan.put('P1PV', dct['coarse_pv_nm']['X'] + '.VAL') + # self.xScan.put('R1PV', dct['coarse_pv_nm']['X'] + '.RBV') + # self.xScan.put('BSPV', dct['sample_pv_nm']['X'] + '.VELO') + # self.main_obj.device( DNM_CX_AUTO_DISABLE_POWER ).put(0) #disabled + # self.set_sample_posner_mode(self.sample_mtrx, self.sample_finex, MODE_COARSE) + else: + # self.sample_mtrx.put('Mode', MODE_LINE_UNIDIR) + self.sample_mtrx.set_mode(self.sample_mtrx.MODE_LINE_UNIDIR) + + # self.xScan.put('P1PV', dct['fine_pv_nm']['X'] + '.VAL') + # self.xScan.put('R1PV', dct['fine_pv_nm']['X'] + '.RBV') + # self.sample_finex.set_power( 1) + self.sample_finex.set_power(self.sample_mtrx.POWER_ON) + + # self.main_obj.device( DNM_CX_AUTO_DISABLE_POWER ).put(1) #enabled + # self.set_sample_posner_mode(self.sample_mtrx, self.sample_finex, MODE_LINE_UNIDIR) + + # set Y's scan mode + if self.y_roi[SCAN_RES] == COARSE: + # self.set_sample_posner_mode(self.sample_mtrx, self.sample_finex, MODE_COARSE) + # self.sample_mtry.put('Mode', MODE_COARSE) + self.sample_mtry.set_mode(self.sample_mtrx.MODE_COARSE) + + # self.yScan.put('P1PV', dct['coarse_pv_nm']['Y'] + '.VAL') + # self.yScan.put('R1PV', dct['coarse_pv_nm']['Y'] + '.RBV') + + else: + + # self.set_sample_posner_mode(self.sample_mtrx, self.sample_finex, MODE_LINE_UNIDIR) + # self.sample_mtry.put('Mode', MODE_NORMAL) + # self.sample_mtry.put('Mode', MODE_LINE_UNIDIR) + self.sample_mtry.set_mode(self.sample_mtrx.MODE_LINE_UNIDIR) + # self.yScan.put('P1PV', dct['fine_pv_nm']['Y'] + '.VAL') + # self.yScan.put('R1PV', dct['fine_pv_nm']['Y'] + '.RBV') + # self.sample_finey.set_power( 1) + self.sample_finey.set_power(self.sample_mtry.POWER_ON) + + # self.main_obj.device( DNM_CY_AUTO_DISABLE_POWER ).put(1) #enabled + + def on_scan_done(self): + """ + called when scan is done + turn the fine motor power back on so that it is ready for next scan type + """ + # call base class method first + super().on_scan_done() + + mtr_dct = self.determine_samplexy_posner_pvs() + mtr_x = self.main_obj.device(mtr_dct["sx_name"]) + mtr_y = self.main_obj.device(mtr_dct["sy_name"]) + #mtr_x.set_piezo_power_on() + #mtr_y.set_piezo_power_on() + diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/SampleFineImageWithE712WavegenScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/SampleFineImageWithE712WavegenScan.py new file mode 100644 index 00000000..1ea265a2 --- /dev/null +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/SampleFineImageWithE712WavegenScan.py @@ -0,0 +1,939 @@ +# coding=utf-8 +""" +Created on Dec 8, 2017 + +@author: bergr +""" +import warnings +#this will be removed in the future when an upgrade to the latest BlueSky/ophyd +warnings.filterwarnings("ignore", message="The document type 'bulk_events' has been deprecated") + + +import bluesky.plan_stubs as bps +import bluesky.preprocessors as bpp + +from bcm.devices.ophyd.e712_wavegen.e712_defines import * + +# from cls.applications.pyStxm.bl_configs.amb_bl10ID1.device_names import * +from cls.scan_engine.bluesky.bluesky_defs import bs_dev_modes +from bcm.devices.ophyd.qt.daqmx_counter_output import trig_src_types +from bcm.devices.ophyd.qt.data_emitters import ImageDataEmitter +from cls.applications.pyStxm import abs_path_to_ini_file +from cls.applications.pyStxm.main_obj_init import MAIN_OBJ +from cls.scanning.BaseScan import BaseScan +from cls.types.stxmTypes import ( + scan_types, + scan_sub_types, + sample_positioning_modes, + sample_fine_positioning_modes, + detector_types +) +from cls.utils.roi_dict_defs import * +from cls.utils.log import get_module_logger +from cls.utils.cfgparser import ConfigClass +from cls.utils.dict_utils import dct_get +from cls.utils.json_utils import dict_to_json +from cls.scan_engine.decorators import conditional_decorator + +_logger = get_module_logger(__name__) + +appConfig = ConfigClass(abs_path_to_ini_file) + +MAX_PIEZO_VELO = 2.0e21 + +class BaseSampleFineImageWithE712WavegenScanClass(BaseScan): + """ + This class is based on SampleImageWithEnergySSCAN and modified to support the E712 waveform generator + for executing the low level scan and triggering, the main scan is still controlled by SSCAN records but instead of using sscan records and motor + positioners to move the motors it uses the E712 waveform generator which must be configured first here. + + The standard BaseScan api will be followed and hte E712 wave generator will only be used if it is : + - a fine scan + - the E712 is available + if the scan is a coarse scan it will not be used, this should work for both zoneplate and standard sample fine scans. + + Note: the configuration is the only thing that changes in order to execute pxp or lxl scans, the data from a pxp scans when using the + waveform generator are received as a complete line just like lxl scans + """ + + def __init__(self, main_obj=None): + """ + __init__(): description + + :returns: None + """ + super().__init__(main_obj=main_obj) + self.x_use_reinit_ddl = False + self.x_auto_ddl = True + self.img_idx_map = {} + self.spid_data = {} + self.e712_enabled = True + self.e712_wg = MAIN_OBJ.device("DNM_E712_WIDGET") + self.e712_wg.set_main_obj(MAIN_OBJ) + self._det_subscription = None + self._det_prog_subscription = None + self._saved_one = False + self.is_fine_scan = True + + def filter_detector_list(self, dets, det_type=detector_types.POINT): + """ + a base level function that will remove selected detectors that do not + support a particular interface like a flyer interface for scans that are executed + by the E712 wave generator, that scan is a flyer because the 2D raster scan is performed + on the E712 wavegenerators that means that the scan plan does not loop each line calling + trigger_and_read() the detectors, therefore only detectors that support the flyer interface + will be allowed, this function allows each scan class to tailor its detectors used in the scan. + + To be implimented by inheriting class + dets: is a list of ophyd detector objects + returns a list of detector ophyd objects + """ + _dets = [] + for d in dets: + if det_type == detector_types.LINE_FLYER: + #check if the flyer interface is supported + if hasattr(d, "kickoff"): + _dets.append(d) + # if det_type == detector_types.LINE: + # #check if the flyer interface is supported + # if hasattr(d, "kickoff"): + # _dets.append(d) + # else: + # # Point + # #if hasattr(d, "kickoff"): + # _dets.append(d) + + + return(_dets) + + + def init_subscriptions(self, ew, func, det_lst): + """ + over ride the base init_subscriptions because we need to use the number of rows from the self.zz_roi instead of + self.y_roi + :param ew: + :param func: + :param det_lst is a list of detector ophyd objects + :return: + """ + #!!!!!!!!!!!!!!!!!!!!!!!!!!!!! for now connect only the first detector, in the future though this needs to setup an emitter for each selected detector + #so that the detectors data can be stored and plottable items can be created and built as the scan progresses + if len(det_lst) > 0 and hasattr(det_lst[0], 'name'): + d = det_lst[0] + d.new_plot_data.connect(func) + self._det_subscription = d + + + # def init_progress_subscription(self, ew, func, det_lst): + # """ + # connect the SIS3820 and ask it to send us progress dictionarys + # """ + # if len(det_lst) > 0 and hasattr(det_lst[0], 'name'): + # d = det_lst[0] + # if hasattr(d, "set_sequence_map"): + # d.set_sequence_map(self.seq_map_dct) + # d.new_progress_data.connect(func) + # self._det_prog_subscription = d + + def configure_devs(self, dets): + """ + + """ + super().configure_devs(dets) + + if self.is_lxl: + self.config_devs_for_line(dets) + else: + self.config_devs_for_point(dets) + + def config_devs_for_line(self, dets): + ''' + config devs for line scan + ''' + for d in dets: + if hasattr(d, "set_dwell"): + d.set_dwell(self.dwell) + if hasattr(d, "set_config"): + d.set_config(self.y_roi["NPOINTS"], self.x_roi["NPOINTS"], is_pxp_scan=self.is_pxp, is_e712_wg_scan=True) + if hasattr(d, "setup_for_ntrigs_per_line"): + d.setup_for_ntrigs_per_line() + if hasattr(d, "set_row_change_index_points"): + d.set_row_change_index_points(remove_last_point=True) + if hasattr(d, "set_sequence_map"): + d.set_sequence_map(self.seq_map_dct) + + # set it so that the plotter updates every 3rd row + self.set_plot_update_divisor(3) + + + def config_devs_for_point(self, dets): + ''' + config devs for point scan + ''' + for d in dets: + if hasattr(d, "set_dwell"): + d.set_dwell(self.dwell) + if hasattr(d, "set_config"): + d.set_config(self.y_roi["NPOINTS"], self.x_roi["NPOINTS"], is_pxp_scan=self.is_pxp, is_e712_wg_scan=True) + if hasattr(d, "set_sequence_map"): + d.set_sequence_map(self.seq_map_dct) + if hasattr(d, "setup_for_ntrigs_per_line"): + d.setup_for_ntrigs_per_line() + if hasattr(d, "set_row_change_index_points"): + if self.dwell < PXP_SHORT_DWELL_REQ_MULT_TRIGS_MS: + d.set_row_change_index_points(ignore_even_data_points=True) + else: + d.set_row_change_index_points(remove_last_point=True) + + # set it so that the plotter updates every row + self.set_plot_update_divisor(1) + + def stop(self): + e712_wdg = self.main_obj.device("DNM_E712_WIDGET") + e712_wdg.stop_wave_generator() + + # call the parents stop + super().stop() + + def on_scan_done(self): + """ + calls base class on_scan_done() then does some specific stuff + call a specific on_scan_done for fine scans + """ + super().on_scan_done() + super().fine_scan_on_scan_done() + + def go_to_scan_start(self): + """ + an API function that will be called if it exists for all scans + call a specific scan start for fine scans + """ + super().fine_scan_go_to_scan_start() + return(True) + + + def make_scan_plan(self, dets, md=None, bi_dir=False): + """ + override the default make_scan_plan to set the scan_type + :param dets: + :param gate: + :param md: + :param bi_dir: + :return: + """ + self.configure_devs(dets) + self.dev_list = self.main_obj.main_obj[DEVICES].devs_as_list() + if self.is_point_spec: + self.scan_type = scan_types.SAMPLE_POINT_SPECTRUM + return self.make_stack_image_plan(dets, md=md, bi_dir=bi_dir) + elif self.numImages == 1: + self.scan_type = scan_types.SAMPLE_IMAGE + # return (self.make_single_image_e712_plan(dets, gate, md=md, bi_dir=bi_dir)) + return self.make_stack_image_plan(dets, md=md, bi_dir=bi_dir) + else: + self.scan_type = scan_types.SAMPLE_IMAGE_STACK + return self.make_stack_image_plan(dets, md=md, bi_dir=bi_dir) + + def make_single_point_spec_plan( + self, dets, md=None, bi_dir=False, do_baseline=True + ): + + print("entering: make_single_point_spec_plan") + # zp_def = self.get_zoneplate_info_dct() + #dev_list = self.main_obj.main_obj[DEVICES].devs_as_list() + e712_dev = self.main_obj.device("DNM_E712_OPHYD_DEV") + e712_wdg = self.main_obj.device("DNM_E712_WIDGET") + shutter = self.main_obj.device("DNM_SHUTTER") + ev_mtr = self.main_obj.device("DNM_ENERGY") + pol_mtr = self.main_obj.device("DNM_EPU_POLARIZATION") + dnm_e712_x_use_tbl_num = self.main_obj.device("DNM_E712_X_USE_TBL_NUM") + dnm_e712_y_use_tbl_num = self.main_obj.device("DNM_E712_Y_USE_TBL_NUM") + dnm_e712_x_start_pos = self.main_obj.device("DNM_E712_X_START_POS") + dnm_e712_y_start_pos = self.main_obj.device("DNM_E712_Y_START_POS") + stagers = [] + + det = dets[0] + + if md is None: + md = { + "metadata": dict_to_json( + self.make_standard_metadata( + entry_name="entry0", scan_type=self.scan_type, dets=dets + ) + ) + } + # if(not skip_baseline): + # @bpp.baseline_decorator(dev_list) + + @conditional_decorator(bpp.baseline_decorator(self.dev_list), do_baseline) + @bpp.stage_decorator(stagers) + @bpp.run_decorator(md=md) + def do_scan(): + + print("starting: make_single_point_spec_plan: do_scan()") + # load the sp_id for wavegen + x_tbl_id, y_tbl_id = e712_wdg.get_wg_table_ids(self.sp_id) + print( + "make_single_point_spec_plan: putting x_tbl_id=%d, y_tbl_id=%d" + % (x_tbl_id, y_tbl_id) + ) + dnm_e712_x_use_tbl_num.put(x_tbl_id) + dnm_e712_y_use_tbl_num.put(y_tbl_id) + # get the X motor reset position * / + if self.is_zp_scan: + dnm_e712_x_start_pos.put(self.zx_roi[START]) + dnm_e712_y_start_pos.put(self.zy_roi[START]) + else: + dnm_e712_x_start_pos.put(self.x_roi[START]) + dnm_e712_y_start_pos.put(self.y_roi[START]) + + e712_wdg.set_num_cycles(self.y_roi[NPOINTS]) + + + yield from bps.stage(dets) + # , starts=starts, stops=stops, npts=npts, group='e712_wavgen', wait=True) + # this starts the wavgen and waits for it to finish without blocking the Qt event loop + shutter.open() + yield from bps.mv(e712_dev.run, 1) + yield from bps.read(dets) + shutter.close() + # yield from bps.wait(group='e712_wavgen') + + yield from bps.unstage(dets) # stop minting events everytime the line_det publishes new data! + # yield from bps.unmonitor(det) + # the collect method on e712_flyer may just return as empty list as a formality, but future proofing! + # yield from bps.collect(det) + #print("make_single_point_spec_plan Leaving") + + return (yield from do_scan()) + + + + def make_single_image_e712_plan(self, dets, md=None, bi_dir=False, do_baseline=True): + #print("entering: make_single_image_e712_plan") + + # zp_def = self.get_zoneplate_info_dct() + # dev_list = self.main_obj.main_obj[DEVICES].devs_as_list() + e712_dev = self.main_obj.device("DNM_E712_OPHYD_DEV") + e712_wdg = self.main_obj.device("DNM_E712_WIDGET") + shutter = self.main_obj.device("DNM_SHUTTER") + ev_mtr = self.main_obj.device("DNM_ENERGY") + pol_mtr = self.main_obj.device("DNM_EPU_POLARIZATION") + DNM_E712_X_USE_TBL_NUM = self.main_obj.device("DNM_E712_X_USE_TBL_NUM") + DNM_E712_Y_USE_TBL_NUM = self.main_obj.device("DNM_E712_Y_USE_TBL_NUM") + DNM_E712_X_START_POS = self.main_obj.device("DNM_E712_X_START_POS") + DNM_E712_Y_START_POS = self.main_obj.device("DNM_E712_Y_START_POS") + #line_counter = self.main_obj.device("DNM_LINE_DET_FLYER") + # md = self.make_standard_metadata(entry_name="entry0", scan_type=self.scan_type, dets=dets) + if md is None: + md = { + "metadata": dict_to_json( + self.make_standard_metadata( + entry_name="entry0", scan_type=self.scan_type, dets=dets + ) + ) + } + + # NOTE: baseline_decorator() MUST come before run_decorator() + @conditional_decorator(bpp.baseline_decorator(self.dev_list), do_baseline) + @bpp.run_decorator(md=md) + def do_scan(): + + #print("starting: make_single_image_e712_plan: do_scan()") + # load the sp_id for wavegen + x_tbl_id, y_tbl_id = e712_wdg.get_wg_table_ids(self.sp_id) + # print( + # "make_single_image_e712_plan: putting x_tbl_id=%d, y_tbl_id=%d" + # % (x_tbl_id, y_tbl_id) + # ) + #_do_scan_started = True + DNM_E712_X_USE_TBL_NUM.put(x_tbl_id) + DNM_E712_Y_USE_TBL_NUM.put(y_tbl_id) + # get the X motor reset position * / + if self.is_zp_scan: + DNM_E712_X_START_POS.put(self.zx_roi[START]) + DNM_E712_Y_START_POS.put(self.zy_roi[START]) + else: + DNM_E712_X_START_POS.put(self.x_roi[START]) + DNM_E712_Y_START_POS.put(self.y_roi[START]) + + e712_wdg.set_num_cycles(self.y_roi[NPOINTS]) + + for d in dets: + if hasattr(d, "configure_for_scan"): + d.configure_for_scan( self.x_roi[NPOINTS], scan_types.SAMPLE_IMAGE) + + for d in dets: + #print(f"detector [{d.name}]") + yield from bps.stage(d) + if hasattr(d, "kickoff"): + _logger.debug(f"Calling KICKOFF for device [{d.name}]") + yield from bps.kickoff(d, group="KICKED_DETECTORS") + _logger.debug(f"DONE Calling KICKOFF for device [{d.name}]") + if hasattr(d, "init_indexs"): + # new image so reset row/col indexes for data it emits to plotter + d.init_indexs() + + yield from bps.wait("KICKED_DETECTORS") + + # this starts the wavgen and waits for it to finish without blocking the Qt event loop + shutter.open() + _logger.debug(f"Calling bps.trigger(e712_dev)") + yield from bps.trigger(e712_dev) + _logger.debug(f"DONE Calling trigger(e712_dev)") + + shutter.close() + + # create an event_page doc in the primary data stream + if self.get_is_scan_aborted() and not self._saved_one: + # aborted before first image was saved (cannot save partials) + pass + else: + # aborted or not and its already saved one + yield from bps.create("primary") + + for d in dets: + #yield from bps.read(d) + yield from bps.unstage(d) + if hasattr(d, "complete"): + _logger.debug(f"Calling COMPLETE for device [{d.name}]") + yield from bps.complete(d, group="COMPLETED_DETECTORS") # stop minting events everytime the line_det publishes new data! + _logger.debug(f"DONE Calling COMPLETE for device [{d.name}]") + + bps.wait("COMPLETED_DETECTORS") + + for d in dets: + # the collect method on e712_flyer may just return as empty list as a formality, but future proofing! + if hasattr(d, "collect"): + _logger.debug(f"Calling COLLECT for device [{d.name}]") + + # for collect: + # stream: boolean, optional + # If False (default), emit Event documents in one bulk dump. If True, emit events one at time. + # + # return_payload: boolean, optional + # If True (default), return the collected Events. If False, return None. Using stream=True + # and return_payload=False together avoids accumulating the documents in memory: they are + # emmitted as they are collected, and they are not accumulated. + yield from bps.collect(d, stream=True, return_payload=False) + + _logger.debug(f"DONE Calling COLLECT for device [{d.name}]") + + # bundle and emit doc + yield from bps.save() + + return (yield from do_scan()) + + def make_stack_image_plan(self, dets, md=None, bi_dir=False): + #print("entering: make_stack_image_plan") + self._saved_one = False + stagers = [] + for d in dets: + stagers.append(d) + + def do_scan(): + # ev_mtr = self.main_obj.device("DNM_ENERGY") + energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") + pol_mtr = self.main_obj.device("DNM_EPU_POLARIZATION") + off_mtr = self.main_obj.device("DNM_EPU_OFFSET") + ang_mtr = self.main_obj.device("DNM_EPU_ANGLE") + + # print('starting: make_stack_image_plan: do_scan()') + entrys_lst = [] + entry_num = 0 + # idx = 0 + self._current_img_idx = 0 + point_spec_devs_configd = False + prev_entry_nm = "" + # , starts=starts, stops=stops, npts=npts, group='e712_wavgen', wait=True) + # this starts the wavgen and waits for it to finish without blocking the Qt event loop + epu_sps = zip(self.setpointsPol, self.setpointsOff,self.setpointsAngle) + + for pol, off, ang in epu_sps: + # switch to new polarization, offset and angle + if pol_mtr.get_position() != pol: + yield from bps.mv(pol_mtr, pol) + if off_mtr.get_position() != off: + yield from bps.mv(off_mtr, off) + if ang_mtr.get_position() != ang: + yield from bps.mv(ang_mtr, ang) + # switch to new energy + for ev_sp in self.ev_setpoints: + #yield from bps.mv(ev_mtr, ev_sp) + yield from bps.mv(energy_dev, ev_sp) + # self.dwell = ev_roi[DWELL] + self.dwell = self.setpointsDwell + + # now load and execute each spatial region + for sp_id in self.sp_ids: + self.sp_id = sp_id + # this updates member vars x_roi, y_roi, etc... with current spatial id specifics + self.update_roi_member_vars(self.sp_rois[self.sp_id]) + if self.is_point_spec and (not point_spec_devs_configd): + # config the det and gate + for d in dets: + if hasattr(d, "set_mode"): + d.set_mode(bs_dev_modes.NORMAL_PXP) + if hasattr(d, "configure"): + d.configure() + + point_spec_devs_configd = True + + samplemtrx = self.main_obj.get_sample_positioner("X") + samplemtry = self.main_obj.get_sample_positioner("Y") + finemtrx = self.main_obj.get_sample_fine_positioner("X") + finemtry = self.main_obj.get_sample_fine_positioner("Y") + # make sure servo power is on + finemtrx.servo_power.put(1) + finemtry.servo_power.put(1) + + if self.is_zp_scan: + # moving them to the start gets rid of a goofy first line of the scan + yield from bps.mv(finemtrx, self.zx_roi[START]) + yield from bps.mv(finemtry, self.zy_roi[START]) + yield from bps.mv( + samplemtrx, + self.gx_roi[CENTER], + samplemtry, + self.gy_roi[CENTER], + ) + # samplemtrx.move(self.gx_roi[CENTER], wait=True) + # samplemtry.move(self.gy_roi[CENTER], wait=True) + + else: + # !!! THIS NEEDS TESTING + # moving them to the start gets rid of a goofy first line of the scan + yield from bps.mv(finemtrx, self.x_roi[START]) + yield from bps.mv(finemtry, self.y_roi[START]) + ############################ + # take a single image that will be saved with its own run scan id + # img_dct = self.img_idx_map['%d' % idx] + img_dct = self.img_idx_map["%d" % self._current_img_idx] + + md = { + "metadata": dict_to_json( + self.make_standard_metadata( + entry_name=img_dct["entry"], + dets=dets, + scan_type=self.scan_type, + ) + ) + } + # if(entry_num is 0): + # if(img_dct['entry'] is not prev_entry_nm): + if img_dct["entry"] not in entrys_lst: + # only create the entry once + if self.is_point_spec: + yield from self.make_single_point_spec_plan( + dets, md=md, do_baseline=True + ) + else: + yield from self.make_single_image_e712_plan( + dets, md=md, do_baseline=True + ) + + else: + # this data will be used to add to previously created entries + if self.is_point_spec: + yield from self.make_single_point_spec_plan( + dets, md=md, do_baseline=False + ) + else: + yield from self.make_single_image_e712_plan( + dets, md=md, do_baseline=False + ) + + # entry_num += 1 + # idx += 1 + self._current_img_idx += 1 + # prev_entry_nm = img_dct['entry'] + entrys_lst.append(img_dct["entry"]) + + self._saved_one = True + + #print("make_stack_image_plan Leaving") + + return (yield from do_scan()) + + def on_scan_done_discon_sigs(self): + """ + on_scan_done(): fires when the top level scan is done, calls on_child_scan_done() if one has been + configured by parent scan plugin + + :returns: None + """ + + + if self.signals_connected: + # _logger.debug('BaseScan: on_scan_done_discon_sigs: emitted all_done sig') + self.all_done.emit() + else: + _logger.debug( + "BaseScan: on_scan_done_discon_sigs: ELSE: sigs were not connected" + ) + # if(done): + self.disconnect_signals() + + def configure(self, wdg_com, sp_id=0, ev_idx=0, line=True, block_disconnect_emit=False): + """ + configure(): This is the configure routine that is required to be defined by every scan plugin. the main goal of the configure function is to + - extract into member variables the scan param data from the wdg_com (widget communication) dict + - configure the sample motors for the correct Mode for the upcoming scan + - reset any relevant member variable counters + - decide if it is a line by line, point by point or point spectrum scan + - set the optimization function for this scan (which is used later to fine tune some key params of the sscan record before scan) + - decide if this is a goniometer scan and set a flag accordingly + - set the start/stop/npts etc fields of the relevant sscan records for a line or point scan by calling either: + set_ImageLineScan_line_sscan_rec() or set_ImageLineScan_point_sscan_rec() + - determine the positioners that will be used in this scan (they depend on the size of the scan range, coarse or fine etc) + - call either config_for_goniometer_scan() or config_for_sample_holder_scan() depending on if a goniometer scan or not + - create the numpy array in self.data by calling config_hdr_datarecorder() + - then call final_setup() which must be called at the end of every configure() function + + :param wdg_com: wdg_com is a "widget Communication dictionary" and it is used to relay information to/from widgets regarding current regions of interest + :type wdg_com: wdg_com is a dictionary comprised of 2 keys: WDGCOM_CMND and SPDB_SPATIAL_ROIS, both of which are strings defined in roi_dict_defs.py + WDGCOM_CMND : is a command that identifys what should be done with the rois listed in the next field + SPDB_SPATIAL_ROIS : is a list of spatial roi's or spatial databases (sp_db) + + :param sp_id: sp_id is the "spatial ID" of the sp_db + :type sp_id: integer + + :param ev_idx: ev_idx is the index into the e_rois[] list of energy regions of interest, this configure() function could be called again repeatedly if there are more than one + energy regions of interest, this index is the index into that list, when the scan is first configured/called the index is always the first == 0 + :type ev_idx: integer + + :param line: line is a boolean flag indicating if the scan to be configured is a line by line scan or not + :type line: bool + + :param block_disconnect_emit: because configure() can be called repeatedly by check_more_spatial_regions() I need to be able to control + how the main GUI will react to a new scan being executed in succession, this flag if False will not blocking the emission of the 'disconnect' signals signal + and if True it will block teh emission of the 'disconnect' that the main GUI is listening to + :type block_disconnect_emit: bool + + :returns: None + + """ + ret = super().configure(wdg_com, sp_id=sp_id, line=line, z_enabled=False) + if not ret: + return(ret) + _logger.info( + "\n\nSampleFineImageWithE712WavegenScanClass: configuring sp_id [%d]" + % sp_id + ) + self.new_spatial_start_sent = False + + if ev_idx == 0: + self.reset_evidx() + self.reset_imgidx() + # self.reset_pnt_spec_spid_idx() + self.final_data_dir = None + self.update_dev_data = [] + + if len(self.sp_ids) > 1: + self.is_multi_spatial = True + # if multi spatial then just save everything without prompting + self.set_save_all_data(True) + else: + self.is_multi_spatial = False + self.set_save_all_data(False) + + # get the energy and EOU related setpoints + e_roi = self.e_rois[ev_idx] + + self.setpointsDwell = dct_get(e_roi, DWELL) + self.setpointsPol = dct_get(e_roi, EPU_POL_PNTS) + self.setpointsOff = dct_get(e_roi, EPU_OFF_PNTS) + self.setpointsAngle = dct_get(e_roi, EPU_ANG_PNTS) + self.ev_pol_order = dct_get(e_roi, EV_POL_ORDER) + + # sps = dct_get(self.wdg_com, SPDB_SINGLE_LST_SP_ROIS) + # evs = dct_get(self.wdg_com, SPDB_SINGLE_LST_EV_ROIS) + # self.setpointsPol = dct_get(self.wdg_com, SPDB_SINGLE_LST_POL_ROIS) + # self.setpointsDwell = dct_get(self.wdg_com, SPDB_SINGLE_LST_DWELLS) + + # sub_type = dct_get(self.wdg_com, SPDB_SCAN_PLUGIN_SUBTYPE) + + # if sub_type is scan_sub_types.POINT_BY_POINT: + # self.is_pxp = True + # self.is_lxl = False + # #self.default_detector_nm = self._default_detector_nm_pxp + # else: + # self.is_pxp = False + # self.is_lxl = True + # #self.default_detector_nm = self._default_detector_nm_lxl + + self.use_hdw_accel = dct_get(self.sp_db, SPDB_HDW_ACCEL_USE) + if self.use_hdw_accel is None: + self.use_hdw_accel = True + + self.is_fine_scan = True + # override + if not self.is_fine_scan: + # coarse scan so turn hdw accel flag off + self.use_hdw_accel = False + + if self.use_hdw_accel: + # self.save_hdr = self.hdw_accel_save_hdr + + # set the DDL flags + if dct_get(self.sp_db, SPDB_HDW_ACCEL_AUTO_DDL): + self.x_auto_ddl = True + self.x_use_reinit_ddl = False + else: + # Reinit DDL for the current scan + self.x_auto_ddl = False + self.x_use_reinit_ddl = True + + if self.scan_type != scan_types.SAMPLE_POINT_SPECTRUM: + self.numImages = int( + self.sp_db[SPDB_EV_NPOINTS] * self.numEPU * self.numSPIDS + ) + else: + # is a sample point spectrum + self.numImages = 1 + + # set some flags that are used elsewhere + if self.numImages > 1: + self.stack = True + self.save_all_data = True + else: + self.stack = False + + self.ttl_pnts = 0 + + # depending on the scan size the positioners used in the scan will be different, use a singe + # function to find out which we are to use and return those names in a dct + dct = self.determine_samplexy_posner_pvs(force_fine_scan=True) + + # depending on the current samplpositioning_mode perform a different configuration + if self.sample_positioning_mode == sample_positioning_modes.GONIOMETER: + self.seq_map_dct = self.generate_2d_seq_image_map( + self.numE , self.numEPU, self.zy_roi[NPOINTS], self.zx_roi[NPOINTS], lxl=self.is_lxl, + ) + if self.use_hdw_accel: + self.config_for_goniometer_scan_hdw_accel(dct) + else: + self.config_for_goniometer_scan(dct) + + else: + if self.sample_positioning_mode == sample_positioning_modes.GONIOMETER: + self.seq_map_dct = self.generate_2d_seq_image_map( + self.numE , self.numEPU, + self.zy_roi[NPOINTS], + self.zx_roi[NPOINTS], + lxl=self.is_lxl, + ) + # goniometer_zoneplate mode + self.configure_for_zxzy_fine_scan_hdw_accel(dct) + elif (self.sample_positioning_mode == sample_positioning_modes.COARSE) and ( + self.fine_sample_positioning_mode + == sample_fine_positioning_modes.ZONEPLATE + ): + self.seq_map_dct = self.generate_2d_seq_image_map( + self.numE , self.numEPU, + self.zy_roi[NPOINTS], + self.zx_roi[NPOINTS], + lxl=self.is_lxl, + + ) + self.configure_for_coarse_zoneplate_fine_scan_hdw_accel(dct) + else: + # coarse_samplefine mode + self.seq_map_dct = self.generate_2d_seq_image_map( + self.numE, self.numEPU, self.y_roi[NPOINTS], self.x_roi[NPOINTS], lxl=self.is_lxl, + ) + self.configure_for_samplefxfy_fine_scan_hdw_accel(dct) + + self.final_data_dir = self.config_hdr_datarecorder( + self.stack, self.final_data_dir + ) + # self.stack_scan = stack + + # make sure OSA XY is in its center + self.move_osaxy_to_its_center() + + # THIS must be the last call + self.finish_setup() + + self.new_spatial_start.emit(sp_id) + return(ret) + + + def configure_for_zxzy_fine_scan_hdw_accel(self, dct, is_focus=False): + """ + For a goniometer scan this will always be a fine scan of max range 100x100um (actually less) + and the sequence to configure a scan is to position the goniometer at teh center of the scan everytime + and set the +/- scan range to be about Zoneplate XY center (0,0) + + Need to take into account that this could be a LxL scan (uses xScan, yScan, zScan) or a PxP (uses xyScan, zScan) + + Because this scan uses the waveform generator on the E712 there are no positioners set for X and Y scan only the + triggering of the waveform generator, will still need to do something so that save_hdr has something to get data + from, not sure how to handle this yet. + + """ + ### VERY IMPORTANT the current PID tune for ZX is based on a velo (SLew Rate) of 1,000,000 + # self.main_obj.device("DNM_ZONEPLATE_X").set_velo(1000000.0) + # self.main_obj.device("DNM_ZONEPLATE_Y").set_velo(1000000.0) + self.main_obj.device("DNM_ZONEPLATE_X").set_velo(MAX_PIEZO_VELO) + self.main_obj.device("DNM_ZONEPLATE_Y").set_velo(MAX_PIEZO_VELO) + + self.set_config_devices_func(self.on_this_dev_cfg) + + self.sample_mtrx = self.sample_finex = self.main_obj.device("DNM_ZONEPLATE_X") + self.sample_mtry = self.sample_finey = self.main_obj.device("DNM_ZONEPLATE_Y") + + # move Gx and Gy to center of scan, is it within a um? + if self.zx_roi[CENTER] != 0.0: + # zx is moving to scan center + pass + else: + # Gx is moving to scan center nd zx is centered around 0, so move Gx to scan center + self.main_obj.device(dct["cx_name"]).put( + "user_setpoint", self.gx_roi[CENTER] + ) + + # if(self.is_within_dband( gy_mtr.get_position(), self.gy_roi[CENTER], 15.0)): + if self.zy_roi[CENTER] != 0.0: + # zy is moving to scan center + pass + else: + # Gy is moving to scan center nd zy is centered around 0, so move Gy to scan center + self.main_obj.device(dct["cy_name"]).put( + "user_setpoint", self.gy_roi[CENTER] + ) + + # config the sscan that makes sure to move goni xy and osa xy to the correct position for scan + # the setupScan will be executed as the top level but not monitored + self.num_points = self.numY + + self.sample_mtrx.put("Mode", 0) + + # setup the E712 wavtable's and other relevant params + self.modify_config_for_hdw_accel() + + def configure_for_samplefxfy_fine_scan_hdw_accel(self, dct): + """ + if this is executed the assumption is that the the scan will be a sampleFx Fy fine scan, it should make sure the + SampleX and SampleY stages are in their start positions the wavegen tables and set the starting offset (which + will be the big difference) + :return: + """ + """ + For a fine scan this will always be a scan of max range 100x100um (actually less) + and the sequence to configure a scan is to position the goniometer at teh center of the scan everytime + and set the +/- scan range to be about Fine XY center (0,0) + + Need to take into account that this could be a LxL scan (uses xScan, yScan, zScan) or a PxP (uses xyScan, zScan) + + Because this scan uses the waveform generator on the E712 there are no positioners set for X and Y scan only the + triggering of the waveform generator. + + """ + # ### VERY IMPORTANT the current PID tune for ZX is based on a velo (SLew Rate) of 1,000,000 + # # must be FxFy + # self.main_obj.get_sample_fine_positioner("X").set_power(1) + # self.main_obj.get_sample_fine_positioner("Y").set_power(1) + # + self.main_obj.get_sample_fine_positioner("X").set_velo(MAX_PIEZO_VELO) + self.main_obj.get_sample_fine_positioner("Y").set_velo(MAX_PIEZO_VELO) + # + # # this scan is used with and without the goniometer so setupScan maybe None + # # if(self.setupScan): + # # self.setupScan.set_positioner(1, self.main_obj.device('DNM_SAMPLE_X)) + # # self.setupScan.set_positioner(2, self.main_obj.device('DNM_SAMPLE_Y)) + # + # # these are the SampleX SampleY motors + # cx_mtr = self.main_obj.device(dct["cx_name"]) + # cy_mtr = self.main_obj.device(dct["cy_name"]) + # + # cx_mtr.put("mode", 0) # MODE_NORMAL + # cy_mtr.put("mode", 0) # MODE_NORMAL + # + # # RUSS APR 21 2022 I think this can be skipped because the devices are setup earlier self.set_config_devices_func(self.on_this_dev_cfg) + # self.sample_mtrx = self.sample_finex = self.main_obj.get_sample_fine_positioner("X") + # self.sample_mtry = self.sample_finey = self.main_obj.get_sample_fine_positioner("Y") + # + # # move Cx and Cy to center of scan, is it within a um? + # # Sx is moving to scan center nd fx is centered around 0, so move Sx to scan center + # cx_mtr.move(self.x_roi[CENTER]) + # self.sample_finex.put("user_setpoint", self.x_roi[CENTER]) + # # self.main_obj.device(dct['cx_name']).put('user_setpoint', self.x_roi[CENTER]) + # + # # if(self.is_within_dband( gy_mtr.get_position(), self.gy_roi[CENTER], 15.0)): + # # Sy is moving to scan center nd fy is centered around 0, so move Sy to scan center + # # self.main_obj.device(dct['cy_name']).put('user_setpoint', self.gy_roi[CENTER]) + # cy_mtr.move(self.y_roi[CENTER]) + + # config the sscan that makes sure to move goni xy and osa xy to the correct position for scan + # the setupScan will be executed as the top level but not monitored + self.num_points = self.numY + + # setup the E712 wavtable's and other relevant params + self.modify_config_for_hdw_accel() + + def configure_for_coarse_zoneplate_fine_scan_hdw_accel(self, dct): + """ + if this is executed the assumption is that the the scan will be a sampleFx Fy fine scan, it should make sure the + SampleX and SampleY stages are in their start positions the wavegen tables and set the starting offset (which + will be the big difference) + :return: + """ + """ + For a fine scan this will always be a scan of max range 100x100um (actually less) + and the sequence to configure a scan is to position the goniometer at teh center of the scan everytime + and set the +/- scan range to be about Fine XY center (0,0) + + Need to take into account that this could be a LxL scan (uses xScan, yScan, zScan) or a PxP (uses xyScan, zScan) + + Because this scan uses the waveform generator on the E712 there are no positioners set for X and Y scan only the + triggering of the waveform generator. + + """ + ### VERY IMPORTANT the current PID tune for ZX is based on a velo (SLew Rate) of 1,000,000 + # must be FxFy + self.main_obj.device("DNM_ZONEPLATE_X").set_power(1) + self.main_obj.device("DNM_ZONEPLATE_Y").set_power(1) + + # self.main_obj.device("DNM_ZONEPLATE_X").set_velo(1000000.0) + # self.main_obj.device("DNM_ZONEPLATE_Y").set_velo(1000000.0) + self.main_obj.device("DNM_ZONEPLATE_X").set_velo(MAX_PIEZO_VELO) + self.main_obj.device("DNM_ZONEPLATE_Y").set_velo(MAX_PIEZO_VELO) + + # this scan is used with and without the goniometer so setupScan maybe None + # if(self.setupScan): + # self.setupScan.set_positioner(1, self.main_obj.device('DNM_SAMPLE_X)) + # self.setupScan.set_positioner(2, self.main_obj.device('DNM_SAMPLE_Y)) + + # these are the SampleX SampleY motors + # cx_mtr = self.main_obj.device(dct['cx_name']) + # cy_mtr = self.main_obj.device(dct['cy_name']) + + # cx_mtr.put('Mode', 0) # MODE_NORMAL + # cy_mtr.put('Mode', 0) # MODE_NORMAL + + self.set_config_devices_func(self.on_this_dev_cfg) + self.sample_mtrx = self.sample_finex = self.main_obj.device("DNM_SAMPLE_X") + self.sample_mtry = self.sample_finey = self.main_obj.device("DNM_SAMPLE_Y") + + self.sample_mtrx.put("Mode", 0) # MODE_NORMAL + self.sample_mtry.put("Mode", 0) # MODE_NORMAL + + # Sx is moving to scan center nd fx is centered around 0, so move Sx to scan center + # cx_mtr.move(self.x_roi[CENTER]) + # self.sample_finex.put('user_setpoint', self.x_roi[CENTER]) + # self.sample_mtrx.put('user_setpoint', self.x_roi[CENTER]) + self.sample_mtrx.put("user_setpoint", self.x_roi[START]) + + # cy_mtr.move(self.y_roi[CENTER]) + # self.sample_mtry.put('user_setpoint', self.y_roi[CENTER]) + self.sample_mtry.put("user_setpoint", self.y_roi[START]) + + # config the sscan that makes sure to move goni xy and osa xy to the correct position for scan + # the setupScan will be executed as the top level but not monitored + self.num_points = self.numY + + # setup the E712 wavtable's and other relevant params + self.modify_config_for_hdw_accel() + + diff --git a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/fine_image_scans/loader.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/loader.py similarity index 82% rename from cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/fine_image_scans/loader.py rename to cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/loader.py index 036bb4e3..dbed2ce6 100644 --- a/cls/applications/pyStxm/bl_configs/amb_bl10ID1/scan_plugins/fine_image_scans/loader.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/loader.py @@ -5,5 +5,5 @@ mod_classname = 'CoarseImageScanParam' the class in the mod_file that has all the UI stuff """ -mod_file = "fine_image_scans.py" -mod_classname = "SampleFineImageScanParam" +mod_file = "sample_image_scans.py" +mod_classname = "BaseSampleImageScansParam" diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans-no-hdw-accel.ui b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans-no-hdw-accel.ui new file mode 100644 index 00000000..d73991fc --- /dev/null +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans-no-hdw-accel.ui @@ -0,0 +1,328 @@ + + + Form + + + + 0 + 0 + 630 + 460 + + + + + 0 + 150 + + + + Qt::StrongFocus + + + Form + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + 650 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 62 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + 75 + true + + + + Load Scan + + + + + + + + 25 + 25 + + + + + 25 + 25 + + + + + + + + :/scan_plugins/helplite.png:/scan_plugins/helplite.png + + + + 50 + 50 + + + + + + + + + 25 + 25 + + + + true + + + QFrame::StyledPanel + + + + + + :/scan_plugins/icons8-mouse-right-click-50.png + + + true + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + true + + + + 75 + true + + + + Qt::LeftToRight + + + 1 + + + 2 + + + + Point by Point + + + + + Line by Line + + + + + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + 0 + 50 + + + + Hardware Acceleration + + + true + + + false + + + + + + + 75 + true + + + + DDL Mode + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + Auto + + + true + + + + + + + true + + + Reinitialize + + + false + + + + + + + true + + + + + + + ../../../icons/1318611600_23.ico../../../icons/1318611600_23.ico + + + + + + + + + + + + + + + + 16777215 + 16777215 + + + + + 75 + true + + + + Spatial/Energy/Polarizations + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans-soft-and-hdw-accel.ui b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans-soft-and-hdw-accel.ui new file mode 100644 index 00000000..99f88523 --- /dev/null +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans-soft-and-hdw-accel.ui @@ -0,0 +1,328 @@ + + + Form + + + + 0 + 0 + 630 + 460 + + + + + 0 + 150 + + + + Qt::StrongFocus + + + Form + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + 650 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 62 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + 75 + true + + + + Load Scan + + + + + + + + 25 + 25 + + + + + 25 + 25 + + + + + + + + :/scan_plugins/helplite.png:/scan_plugins/helplite.png + + + + 50 + 50 + + + + + + + + + 25 + 25 + + + + true + + + QFrame::StyledPanel + + + + + + :/scan_plugins/icons8-mouse-right-click-50.png + + + true + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + true + + + + 75 + true + + + + Qt::LeftToRight + + + 1 + + + 2 + + + + Point by Point + + + + + Line by Line + + + + + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + 0 + 76 + + + + Hardware Acceleration + + + true + + + false + + + + + + + 75 + true + + + + DDL Mode + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + Auto + + + true + + + + + + + true + + + Reinitialize + + + false + + + + + + + true + + + + + + + ../../../icons/1318611600_23.ico../../../icons/1318611600_23.ico + + + + + + + + + + + + + + + + 16777215 + 16777215 + + + + + 75 + true + + + + Spatial/Energy/Polarizations + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans.py new file mode 100644 index 00000000..5f4ea25d --- /dev/null +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans.py @@ -0,0 +1,758 @@ +""" +Created on Aug 25, 2014 + +@author: bergr +""" +from PyQt5 import QtCore, QtWidgets +from PyQt5 import uic +import os +from cls.stylesheets import get_style + +from cls.applications.pyStxm.main_obj_init import MAIN_OBJ, DEFAULTS +from cls.scanning.base import ScanParamWidget, MultiRegionScanParamBase, zp_focus_modes +from cls.applications.pyStxm.widgets.scan_table_view.multiRegionWidget import ( + MultiRegionWidget, +) + +# from cls.applications.pyStxm.bl_configs.amb_bl10ID1.device_names import + +from cls.data_io.stxm_data_io import STXMDataIo + +from cls.utils.roi_utils import ( + make_spatial_db_dict, + widget_com_cmnd_types, + get_unique_roi_id, + on_range_changed, + on_npoints_changed, + on_step_size_changed, + on_start_changed, + on_stop_changed, + on_center_changed, + recalc_setpoints, + get_base_start_stop_roi, + get_base_roi, + get_first_sp_db_from_wdg_com, + get_base_energy_roi +) +from cls.types.stxmTypes import ( + scan_types, + scan_sub_types, + image_scan_secids, + spatial_type_prefix, + sample_positioning_modes, + sample_fine_positioning_modes, + scan_image_types, +) + +from cls.plotWidgets.shape_restrictions import ROILimitObj, ROILimitDef +from cls.plotWidgets.color_def import ( + get_normal_clr, + get_warn_clr, + get_alarm_clr, + get_normal_fill_pattern, + get_warn_fill_pattern, + get_alarm_fill_pattern, +) + +from cls.utils.time_utils import secondsToStr +from cls.utils.dict_utils import dct_get, dct_put +from cls.utils.roi_dict_defs import * +from cls.utils.log import get_module_logger + +_logger = get_module_logger(__name__) + +MAX_SCAN_RANGE_FINEX = MAIN_OBJ.get_preset_as_float("max_fine_x") +MAX_SCAN_RANGE_FINEY = MAIN_OBJ.get_preset_as_float("max_fine_y") +MAX_SCAN_RANGE_X = MAIN_OBJ.get_preset_as_float("max_coarse_x") +MAX_SCAN_RANGE_Y = MAIN_OBJ.get_preset_as_float("max_coarse_y") +USE_E712_HDW_ACCEL = MAIN_OBJ.get_preset_as_bool("USE_E712_HDW_ACCEL", "BL_CFG_MAIN") + + +class BaseSampleImageScansParam(MultiRegionScanParamBase): + def __init__( + self, parent=None, main_obj=MAIN_OBJ, data_io=STXMDataIo, dflts=DEFAULTS, ui_path=os.path.dirname(__file__) + ): + super().__init__(main_obj=main_obj, data_io=data_io, dflts=dflts) + self._parent = parent + if ui_path[-3:] == ".ui": + # parent class passed entire file path with non default name + uic.loadUi(os.path.join(os.path.dirname(__file__), ui_path), self) + else: + uic.loadUi(os.path.join(ui_path, "sample_image_scans.ui"), self) + + self.epu_supported = False + self.goni_supported = False + + if self.main_obj.is_device_supported("DNM_GONI_X"): + self.goni_supported = True + + self.energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") + + if self.sample_positioning_mode == sample_positioning_modes.GONIOMETER: + x_cntr = self.main_obj.device("DNM_GONI_X").get_position() + y_cntr = self.main_obj.device("DNM_GONI_Y").get_position() + else: + # x_cntr = self.main_obj.device("DNM_SAMPLE_X").get_position() + # y_cntr = self.main_obj.device("DNM_SAMPLE_Y").get_position() + x_cntr = self.main_obj.device("DNM_COARSE_X").get_position() + y_cntr = self.main_obj.device("DNM_COARSE_Y").get_position() + + self._multi_region_widget = MultiRegionWidget( + enable_multi_spatial=self.enable_multi_region, + single_ev_model=True, + single_pol_model=True, + max_range=MAX_SCAN_RANGE_X, + min_sp_rois=1, + x_cntr=x_cntr, + y_cntr=y_cntr, + main_obj=self.main_obj, + single_dwell=True, + ) + + if not self.main_obj.is_device_supported("DNM_EPU_POLARIZATION"): + self.multi_region_widget.deslect_all_polarizations() + self.multi_region_widget.disable_polarization_table(True) + self.multi_region_widget.set_polarization_table_visible(False) + else: + # more + self.epu_supported = True + self.multi_region_widget.deslect_all_polarizations() + self.multi_region_widget.disable_polarization_table(False) + self.multi_region_widget.set_polarization_table_visible(True) + + self.multi_region_widget.spatial_row_selected.connect( + self.on_spatial_row_selected + ) + self.multi_region_widget.spatial_row_changed.connect( + self.on_spatial_row_changed + ) + self.multi_region_widget.spatial_row_deleted.connect( + self.on_spatial_row_deleted + ) + self.multi_region_widget.spatial_row_added.connect(self.on_spatial_row_changed) + + self.multi_region_widget.ev_total_changed.connect(self.update_est_time) + + self.center_plot_on_focus = True + + self.evGrpBox.layout().addWidget(self.multi_region_widget) + self.evGrpBox.layout().update() + + if hasattr(self, 'scanTypeSelComboBox'): + self.scanTypeSelComboBox.currentIndexChanged.connect(self.scan_type_changed) + self.sub_type = scan_sub_types.LINE_UNIDIR + else: + self.sub_type = scan_sub_types.POINT_BY_POINT + + self.loadScanBtn.clicked.connect(self.load_scan) + + if hasattr(self, 'hdwAccelDetailsBtn'): + self.hdwAccelDetailsBtn.setToolTip("E712 Wavgen details") + self.hdwAccelDetailsBtn.clicked.connect(self.show_hdw_accel_details) + + self.wdg_com = None + self.load_from_defaults() + self.on_plugin_focus() + self.init_loadscan_menu() + + def init_plugin(self): + """ + set the plugin specific details to common attributes + :return: + """ + self.name = "Sample Image Scan" + self.idx = self.main_obj.get_scan_panel_order(__file__) + self.type = scan_types.SAMPLE_IMAGE + # This is now set in constructor to support inheriting plugins that do not support LxL + # self.sub_type = scan_sub_types.LINE_UNIDIR + self.data = {} + self.section_id = image_scan_secids[image_scan_secids.SAMPLE_LXL] # by default + self.axis_strings = ["Sample Y microns", "Sample X microns", "", ""] + self.zp_focus_mode = zp_focus_modes.A0MOD + # data_file_pfx = 'i' + self.data_file_pfx = self.main_obj.get_datafile_prefix() + self.plot_item_type = spatial_type_prefix.ROI + self.enable_multi_region = self.main_obj.get_is_multi_region_enabled() + self.multi_ev = True + + self._type_interactive_plot = True # [scan_panel_order.POSITIONER_SCAN] + self._type_skip_scan_q_table_plots = ( + False # [scan_panel_order.OSA_FOCUS_SCAN, scan_panel_order.FOCUS_SCAN] + ) + self._type_spectra_plot_type = ( + False # [scan_panel_order.POINT_SCAN, scan_panel_order.POSITIONER_SCAN] + ) + self._type_skip_centering_scans = ( + True # [scan_panel_order.FOCUS_SCAN, scan_panel_order.TOMOGRAPHY, + ) + # scan_panel_order.LINE_SCAN, scan_panel_order.POINT_SCAN, scan_panel_order.IMAGE_SCAN] + self._type_do_recenter = True # [scan_panel_order.IMAGE_SCAN, scan_panel_order.TOMOGRAPHY, scan_panel_order.LINE_SCAN] + + # self._help_html_fpath = os.path.join('interface', 'window_system', 'scan_plugins', 'detector.html') + self._help_ttip = "Sample Fine scan documentation and instructions" + + @property + def multi_region_widget(self) -> MultiRegionWidget: + return self._multi_region_widget + + def on_plugin_focus(self): + """ + this is called when this scan param receives focus on the GUI + - basically get the current EPU values and assign them to the multiregion widget + :return: + """ + if self.isEnabled(): + self.energy_dev.set_focus_mode("SAMPLE") + self.update_est_time() + # call the standard init_base_values function for scan param widgets that contain a multiRegionWidget + self.on_multiregion_widget_focus_init_base_values() + self.multi_region_widget.resize_tableviews() + + def show_hdw_accel_details(self): + # if hasattr(self, 'e712_wg'): + if self.hdwAccelGrpBox.isChecked(): + dark = get_style() + scan_class = self.get_scan_class() + scan_class.e712_wg.setStyleSheet(dark) + scan_class.e712_wg.show() + + def on_E712WavegenBtn(self, chkd): + if chkd: + # set the wave generator radio box's to enabled + self.autoDDLRadBtn.setEnabled(True) + self.reinitDDLRadBtn.setEnabled(True) + else: + # set the wave generator radio box's to disabled + self.autoDDLRadBtn.setEnabled(False) + self.reinitDDLRadBtn.setEnabled(False) + + def clear_params(self): + """meant to clear all params from table""" + self.multi_region_widget.clear_spatial_table() + + def gen_max_scan_range_limit_def(self): + """this function only currently centers around 0,0, this is a problem because in order + to indicate when the range of the scan is larger than the fine ranges it must be valid around + whereever o,o is on the fine physical stage is, as this is nly generated and sent to teh plot + widget at startup it doesnt work properly when the scan is not around 0,0. + leaving this for future + """ + + if self.sample_positioning_mode == sample_positioning_modes.GONIOMETER: + self.gen_GONI_SCAN_max_scan_range_limit_def() + else: + # mtr_sx = self.main_obj.device("DNM_SAMPLE_X") + # mtr_sy = self.main_obj.device("DNM_SAMPLE_Y") + mtr_sx = self.main_obj.device("DNM_COARSE_X") + mtr_sy = self.main_obj.device("DNM_COARSE_Y") + mtr_sfx = self.main_obj.get_sample_fine_positioner("X") + mtr_sfy = self.main_obj.get_sample_fine_positioner("Y") + center_x = mtr_sx.get_position() + center_y = mtr_sy.get_position() + + xllm = mtr_sx.get_low_limit() + xhlm = mtr_sx.get_high_limit() + yllm = mtr_sy.get_low_limit() + yhlm = mtr_sy.get_high_limit() + + fxllm = center_x - (MAX_SCAN_RANGE_X * 0.5) + fxhlm = center_x + (MAX_SCAN_RANGE_X * 0.5) + fyllm = center_y - (MAX_SCAN_RANGE_Y * 0.5) + fyhlm = center_y + (MAX_SCAN_RANGE_Y * 0.5) + + bounding_qrect = QtCore.QRectF( + QtCore.QPointF(xllm, yhlm), QtCore.QPointF(xhlm, yllm) + ) + + # adjust the warn qrect by 0.1 in all directions so that a scan range of the exact size of the limit is still allowed + warn_qrect = QtCore.QRectF( + QtCore.QPointF(fxllm - 0.1, fyhlm + 0.1), + QtCore.QPointF(fxhlm + 0.1, fyllm - 0.1), + ) + alarm_qrect = self.get_percentage_of_qrect( + warn_qrect, 0.99999 + ) # %99 of max + + bounding = ROILimitObj( + bounding_qrect, + get_alarm_clr(255), + "Range is beyond CoarseXY Capabilities", + get_warn_fill_pattern(), + ) + normal = ROILimitObj( + bounding_qrect, + get_normal_clr(45), + "Sample Image Fine Scan", + get_normal_fill_pattern(), + ) + warn = ROILimitObj( + warn_qrect, + get_warn_clr(150), + "Coarse X/Y will have to be moved in order to perform scan", + get_warn_fill_pattern(), + ) + alarm = ROILimitObj( + alarm_qrect, + get_alarm_clr(255), + "Beyond range of Sample Fine X/Y", + get_alarm_fill_pattern(), + ) + + self.roi_limit_def = ROILimitDef(bounding, normal, warn, alarm) + + def update_sub_type(self): + if hasattr(self, 'scanTypeSelComboBox'): + idx = self.scanTypeSelComboBox.currentIndex() + if idx == scan_sub_types.POINT_BY_POINT: + # point by point + self.sub_type = scan_sub_types.POINT_BY_POINT + else: + # line by line + self.sub_type = scan_sub_types.LINE_UNIDIR + + def scan_type_changed(self, idx): + if idx == 0: + # line by line + self.sub_type = scan_sub_types.LINE_UNIDIR + else: + # point by point + self.sub_type = scan_sub_types.POINT_BY_POINT + + sp_db = get_first_sp_db_from_wdg_com(self.wdg_com) + x_roi = sp_db[SPDB_X] + y_roi = sp_db[SPDB_Y] + dwell = sp_db[SPDB_EV_ROIS][0][DWELL] + # Moved to update_data() but currently commented + # if (self.sub_type == scan_sub_types.POINT_BY_POINT): + # self.calc_new_scan_time_estemate(True, x_roi, y_roi, dwell) + # else: + # self.calc_new_scan_time_estemate(False, x_roi, y_roi, dwell) + + def set_roi(self, roi): + """ + This standard function is typically used to set QtLineEdit fields but because this plugin uses the multispatialwidget + there are no fields so it is basically unused + :param roi: + :return: + """ + # (cx, cy, cz, c0) = roi[CENTER] + # (rx, ry, rz, s0) = roi[RANGE] + # (nx, ny, nz, n0) = roi[NPOINTS] + # (sx, sy, sz, s0) = roi[STEP] + # + # dwell = roi[DWELL] + pass + + def mod_roi(self, wdg_com, do_recalc=True, ev_only=False, sp_only=False): + """ + wdg_com is a widget_com dict + The purpose of the mod_roi() function is to update the fields in the GUI with the correct values + it can be called by either a signal from one of the edit fields (ex: self.centerXFld) or + by a signal from a plotter (via the main gui that is connected to the plotter) so that as a user + grabs a region of interest marker in the plot and either moves or resizes it, those new center and size + values will be delivered here and, if required, the stepsizes will be recalculated + + + :param wdg_com: is a standard dict returned from the call to sm.stxm_control.stxm_utils.roi_utils.make_spatial_db_dict() + :type wdg_com: dict. + + :param do_recalc: selectively the STEP of the ROI's for X and Y can be recalculated if the number of points or range have changed + :type do_recalc: flag. + + :returns: None + + """ + + item_id = dct_get(wdg_com, SPDB_ID_VAL) + dct_put(wdg_com, SPDB_PLOT_SHAPE_TYPE, self.plot_item_type) + + if wdg_com[CMND] == widget_com_cmnd_types.LOAD_SCAN: + self.load_roi(wdg_com) + return + + # if((wdg_com[CMND] == widget_com_cmnd_types.SELECT_ROI) or (wdg_com[CMND] == widget_com_cmnd_types.LOAD_SCAN)): + if wdg_com[CMND] == widget_com_cmnd_types.SELECT_ROI: + cur_scan = self.multi_region_widget.sp_widg.get_row_data_by_item_id(item_id) + if cur_scan != None: + # change the command to add this ROI + self.multi_region_widget.sp_widg.select_row(item_id=item_id) + return + # wdg_com[CMND] = widget_com_cmnd_types.ROI_CHANGED + else: + x_roi = wdg_com[SPDB_X] + y_roi = wdg_com[SPDB_Y] + # x_roi[NPOINTS] = 20 + # y_roi[NPOINTS] = 20 + scan = make_spatial_db_dict(x_roi=x_roi, y_roi=y_roi) + on_npoints_changed(scan[SPDB_X]) + on_npoints_changed(scan[SPDB_Y]) + scan[SPDB_ID_VAL] = item_id + self.multi_region_widget.sp_widg.on_new_region(scan) + self.multi_region_widget.sp_widg.select_row(item_id=item_id) + return + + if wdg_com[CMND] == widget_com_cmnd_types.ROI_CHANGED: + # print 'image_scans.mod_roi: item_id = %d' % item_id + # we are being modified by the plotter + x_roi = wdg_com[SPDB_X] + y_roi = wdg_com[SPDB_Y] + scan = make_spatial_db_dict(x_roi=x_roi, y_roi=y_roi) + cur_scan = self.multi_region_widget.sp_widg.get_row_data_by_item_id(item_id) + + if cur_scan is None: + scan[SPDB_ID_VAL] = item_id + on_npoints_changed(scan[SPDB_X]) + on_npoints_changed(scan[SPDB_Y]) + + _dwell = scan[SPDB_EV_ROIS][0][DWELL] + _x = scan[SPDB_X] + _y = scan[SPDB_Y] + + # self.multi_region_widget.sp_widg.table_view.add_scan(scan, wdg_com['CURRENT']['PLOT']['ITEM']['ID']) + self.multi_region_widget.sp_widg.on_new_region(scan, ev_only=ev_only) + self.multi_region_widget.sp_widg.select_row(item_id=item_id) + # return + else: + # cur_scan = self.multi_region_widget.sp_widg.table_view.get_scan(item_id) + # update the center and range fields that have come from the plotter + # first call center recalc, then range + cur_scan[SPDB_X][CENTER] = scan[SPDB_X][CENTER] + on_center_changed(cur_scan[SPDB_X]) + + cur_scan[SPDB_X][RANGE] = scan[SPDB_X][RANGE] + on_range_changed(cur_scan[SPDB_X]) + + cur_scan[SPDB_Y][CENTER] = scan[SPDB_Y][CENTER] + on_center_changed(cur_scan[SPDB_Y]) + + cur_scan[SPDB_Y][RANGE] = scan[SPDB_Y][RANGE] + on_range_changed(cur_scan[SPDB_Y]) + + _dwell = cur_scan[SPDB_EV_ROIS][0][DWELL] + _x = cur_scan[SPDB_X] + _y = cur_scan[SPDB_Y] + + self.multi_region_widget.sp_widg.select_row(item_id=item_id) + self.multi_region_widget.sp_widg.modify_row_data(item_id, cur_scan) + + # return + # the following takes waaay to long to execute which ruins the responsiveness of the UI + # if (self.sub_type == scan_sub_types.POINT_BY_POINT): + # self.calc_new_scan_time_estemate(True, _x, _y, _dwell) + # else: + # self.calc_new_scan_time_estemate(False, _x, _y, _dwell) + # return + + elif wdg_com[CMND] == widget_com_cmnd_types.DEL_ROI: + # remove this roi from the multi region spatial table + self.multi_region_widget.sp_widg.delete_row(item_id) + + return + + # elif(wdg_com[CMND] == widget_com_cmnd_types.SELECT_ROI): + # self.multi_region_widget.select_spatial_row(item_id) + # return + elif wdg_com[CMND] == widget_com_cmnd_types.DESELECT_ROI: + # _logger.debug('mod_roi: calling deselect_all() ') + self.multi_region_widget.sp_widg.deselect_all() + + else: + # we are + print( + "image_scan: mod_roi: unsupported widget_com CMND [%d]" % wdg_com[CMND] + ) + return + + def clear_params(self): + # this should cascade through and delete all tables + self.multi_region_widget.clear_spatial_table() + + def load_roi(self, wdg_com, append=False, ev_only=False, sp_only=False): + """ + take a widget communications dict and load the plugin GUI with the spatial region, also + set the scan subtype selection pulldown for point by point or line + """ + # self.wdg_com = dct_get(ado_obj, ADO_CFG_WDG_COM) + + has_scan_subtype_selector = False + if hasattr(self,'scanTypeSelComboBox'): + has_scan_subtype_selector = True + + self.wdg_com = wdg_com + if self.wdg_com[CMND] == widget_com_cmnd_types.LOAD_SCAN: + sp_db_dct = dct_get(self.wdg_com, WDGCOM_SPATIAL_ROIS) + sp_ids = list(sp_db_dct.keys()) + sp_id = sp_ids[0] + sp_db = sp_db_dct[sp_id] + + image_scans = [scan_types.SAMPLE_IMAGE, scan_types.SAMPLE_IMAGE_STACK] + if (not ev_only) and ( + dct_get(sp_db, SPDB_SCAN_PLUGIN_TYPE) not in image_scans + ): + return + + if not ev_only: + if has_scan_subtype_selector: + if ( + dct_get(sp_db, SPDB_SCAN_PLUGIN_SUBTYPE) + == scan_sub_types.LINE_UNIDIR + ): + # image Line by Line + self.scanTypeSelComboBox.setCurrentIndex(1) + else: + # image Point by Point + self.scanTypeSelComboBox.setCurrentIndex(0) + + if dct_get(sp_db, SPDB_HDW_ACCEL_AUTO_DDL): + self.autoDDLRadBtn.setChecked(True) + else: + self.autoDDLRadBtn.setChecked(False) + + if dct_get(sp_db, SPDB_HDW_ACCEL_REINIT_DDL): + self.reinitDDLRadBtn.setChecked(True) + else: + self.reinitDDLRadBtn.setChecked(False) + + self.multi_region_widget.load_scan( + self.wdg_com, ev_only=ev_only, sp_only=sp_only + ) + self.enable_multi_region = ( + self.multi_region_widget.is_multi_region_enabled() + ) + # emit roi_changed so that the plotter can be signalled to create the ROI shap items + if not self.multi_region_widget.is_spatial_list_empty(): + wdg_com[WDGCOM_CMND] = widget_com_cmnd_types.ROI_CHANGED + self.roi_changed.emit(self.wdg_com) + + def on_single_energy(self, val): + self.single_energy = val + + def update_type(self): + + self.update_sub_type() + if self.wdg_com is not None: + sp_rois = dct_get(self.wdg_com, WDGCOM_SPATIAL_ROIS) + sp_ids = list(sp_rois.keys()) + for sp_id in sp_ids: + sp_db = sp_rois[sp_id] + + if USE_E712_HDW_ACCEL: + # added E712 waveform generator support + dct_put(sp_db, SPDB_HDW_ACCEL_USE, True) + dct_put( + sp_db, SPDB_HDW_ACCEL_AUTO_DDL, self.autoDDLRadBtn.isChecked() + ) + dct_put( + sp_db, + SPDB_HDW_ACCEL_REINIT_DDL, + self.reinitDDLRadBtn.isChecked(), + ) + + dct_put(sp_db, SPDB_SCAN_PLUGIN_SUBTYPE, self.sub_type) + x_roi = dct_get(sp_db, SPDB_X) + if dct_get(sp_db, SPDB_XRANGE) > MAX_SCAN_RANGE_FINEX: + x_roi[SCAN_RES] = COARSE + else: + x_roi[SCAN_RES] = FINE + + e_setpoints =self.multi_region_widget.get_just_ev_setpoints() + if (len(sp_ids) > 1) or (not self.multi_region_widget.is_set_for_single_ev() and len(e_setpoints) > 1): + self.type = scan_types.SAMPLE_IMAGE_STACK + dct_put( + sp_db, SPDB_SCAN_PLUGIN_TYPE, scan_types.SAMPLE_IMAGE_STACK + ) # the scan type: scan_types-> Enum('Detector_Image','OSA_Image','OSA_Focus','Sample_Focus','Sample_Point_Spectrum', 'Sample_Line_Spectrum', 'Sample_Image', 'Sample_Image_Stack', 'Generic_Scan') + # dct_put(sp_db, SPDB_SCAN_PLUGIN_SUBTYPE, None) + else: + self.type = scan_types.SAMPLE_IMAGE + dct_put(sp_db, SPDB_SCAN_PLUGIN_TYPE, scan_types.SAMPLE_IMAGE) + + def update_data(self, force_pxp=False): + """ + This is a standard function that all scan pluggins have that is called to + get the data from the pluggins UI widgets and write them into a dict returned by + get_base_scanparam_roi(), this dict is emitted by all scan pluggins to be used by + the scan classes configure() functions + + :returns: None + + """ + # the following calc of time estemates is slow because it has to querey the E712 + # if (self.sub_type == scan_sub_types.POINT_BY_POINT): + # self.calc_new_scan_time_estemate(True, x_roi, y_roi, dwell) + # else: + # self.calc_new_scan_time_estemate(False, x_roi, y_roi, dwell) + self.update_type() + if self.sample_positioning_mode == sample_positioning_modes.GONIOMETER: + # goniometer_zoneplate mode + self.wdg_com = self.GONI_SCAN_update_data() + # elif(self.sample_positioning_mode == sample_positioning_modes.COARSE): + # if (self.main_obj.get_fine_sample_positioning_mode() == sample_fine_positioning_modes.ZONEPLATE): + # #coarse_zoneplate mode + # self.wdg_com = self.ZONEPLATE_SCAN_update_data() + # else: + # #coarse_samplefine mode + # self.wdg_com = self.update_multi_spatial_wdg_com() + else: + self.wdg_com = self.update_multi_spatial_wdg_com() + + if force_pxp: + self.sub_type = scan_sub_types.POINT_BY_POINT + + dct_put(self.wdg_com, SPDB_SCAN_PLUGIN_SUBTYPE, self.sub_type) + dct_put(self.wdg_com, SPDB_SCAN_PLUGIN_TYPE, self.get_scan_type()) + + self.roi_changed.emit(self.wdg_com) + self.update_est_time() + return self.wdg_com + + ######################################################################### + # Goniometer specific routines + ######################################################################### + + def gen_GONI_SCAN_max_scan_range_limit_def(self): + """to be overridden by inheriting class""" + # mtr_zpx = self.main_obj.device('DNM_ZONEPLATE_X) + # mtr_zpy = self.main_obj.device('DNM_ZONEPLATE_Y) + # mtr_osax = self.main_obj.device('OSAX.X') + # mtr_osay = self.main_obj.device('OSAY.Y') + mtr_gx = self.main_obj.device("DNM_GONI_X") + mtr_gy = self.main_obj.device("DNM_GONI_Y") + + gx_pos = mtr_gx.get_position() + gy_pos = mtr_gy.get_position() + + # these are all added because the sign is in the LLIM + xllm = gx_pos - (MAX_SCAN_RANGE_FINEX * 0.5) + xhlm = gx_pos + (MAX_SCAN_RANGE_FINEX * 0.5) + yllm = gy_pos - (MAX_SCAN_RANGE_FINEY * 0.5) + yhlm = gy_pos + (MAX_SCAN_RANGE_FINEY * 0.5) + + gxllm = mtr_gx.get_low_limit() + gxhlm = mtr_gx.get_high_limit() + gyllm = mtr_gy.get_low_limit() + gyhlm = mtr_gy.get_high_limit() + + bounding_qrect = QtCore.QRectF( + QtCore.QPointF(gxllm, gyhlm), QtCore.QPointF(gxhlm, gyllm) + ) + # warn_qrect = self.get_percentage_of_qrect(bounding, 0.90) #%80 of max + # alarm_qrect = self.get_percentage_of_qrect(bounding, 0.95) #%95 of max + normal_qrect = QtCore.QRectF( + QtCore.QPointF(xllm, yhlm), QtCore.QPointF(xhlm, yllm) + ) + warn_qrect = self.get_percentage_of_qrect(normal_qrect, 1.01) #%95 of max + alarm_qrect = self.get_percentage_of_qrect(normal_qrect, 1.0) #%95 of max + + bounding = ROILimitObj( + bounding_qrect, + get_alarm_clr(255), + "Range is beyond Goniometer Capabilities", + get_alarm_fill_pattern(), + ) + normal = ROILimitObj( + normal_qrect, get_normal_clr(45), "Fine ZP Scan", get_normal_fill_pattern() + ) + warn = ROILimitObj( + warn_qrect, + get_warn_clr(150), + "Goniometer will be required to move", + get_warn_fill_pattern(), + ) + alarm = ROILimitObj( + alarm_qrect, + get_alarm_clr(255), + "Range is beyond ZP Capabilities", + get_alarm_fill_pattern(), + ) + + self.roi_limit_def = ROILimitDef(bounding, normal, warn, alarm) + + self.multi_region_widget.set_roi_limits(self.roi_limit_def) + + def get_saved_center(self): + """ + override the get_saved_center() in base and return the current Gx Gy values as "THE CENTER" + this call is typical used by the main gui when the user selects the zp image scan so that the plot can + display coordinates around the current goni center + """ + if self.sample_positioning_mode == sample_positioning_modes.GONIOMETER: + mtr_x = self.main_obj.device("DNM_GONI_X") + mtr_y = self.main_obj.device("DNM_GONI_Y") + else: + # mtr_x = self.main_obj.device("DNM_SAMPLE_X") + # mtr_y = self.main_obj.device("DNM_SAMPLE_Y") + mtr_x = self.main_obj.device("DNM_COARSE_X") + mtr_y = self.main_obj.device("DNM_COARSE_Y") + + return (mtr_x.get_position(), mtr_y.get_position()) + + def get_theta_fld_vals(self): + roi = {} + self.assign_flds(roi, "Theta") + return roi + + def calc_correction(self, x, y, z, t): + """ + here it is hoped that the mathematical model will go to calculate the corrections required to reposition the sample correctly + based on a new theta value + for now the model is only to offset the value by %10 of theta + """ + # new_x = x + (0.1 * t) + # new_y = y + (0.1 * t) + # new_z = z + (0.1 * t) + # return(new_x, new_y, new_z) + # + new_x = x + new_y = y + new_z = z + return (new_x, new_y, new_z) + + def apply_correction_model(self, gx_roi, gy_roi, gz_roi, gt_roi): + x = gx_roi[SETPOINTS][0] + y = gy_roi[SETPOINTS][0] + z = gz_roi[SETPOINTS][0] + idx = 0 + for t in gt_roi[SETPOINTS]: + gx_roi[idx], gy_roi[idx], gz_roi[idx] = self.calc_correction(x, y, z, t) + idx += 1 + + def create_sub_spatial_dbs(self, wdg_com): + """ + Given a set of spatial region dbs, subdivide them into spatial regions that are within the scan range of the + Zoneplate X and Y, each sub spatial region represents the area that can be scanned when the OSA XY is positioned at the regions center. + If the desired scan area is smaller than the max subscan range then just return the original spatial region + + This function creates a dict of sub spatial regions as well, the OSA XY position for each sub spatial region can be + taken from (x_roi[CENTER], y_roi[CENTER]) + + :returns: None + + """ + sub_spatials = {} + sp_dbs = dct_get(wdg_com, WDGCOM_SPATIAL_ROIS) + + for sp_id in sp_dbs: + sp_db = sp_dbs[sp_id] + sp_db = self.modify_sp_db_for_goni(sp_db) + + return None + + def GONI_SCAN_update_data(self): + """ + This is a standard function that all scan pluggins have that is called to + get the data from the pluggins UI widgets and write them into a dict returned by + get_base_scanparam_roi(), this dict is emitted by all scan pluggins to be used by + the scan classes configure() functions + + :returns: None + + """ + wdg_com = self.update_multi_spatial_wdg_com() + sub_spatials = self.create_sub_spatial_dbs(wdg_com) + if sub_spatials: + # for now only support single spatial with multi sub spatial + sp_id = list(sub_spatials.keys())[0] + sp_db = dct_get(wdg_com, SPDB_SPATIAL_ROIS)[sp_id] + dct_put(sp_db, SPDB_SUB_SPATIAL_ROIS, sub_spatials[sp_id]) + self.update_est_time() + return wdg_com diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans.ui b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans.ui new file mode 100644 index 00000000..1c43630d --- /dev/null +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans.ui @@ -0,0 +1,304 @@ + + + Form + + + + 0 + 0 + 630 + 460 + + + + + 0 + 150 + + + + Qt::StrongFocus + + + Form + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + 650 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 62 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + 75 + true + + + + Load Scan + + + + + + + + 25 + 25 + + + + + 25 + 25 + + + + + + + + :/scan_plugins/helplite.png:/scan_plugins/helplite.png + + + + 50 + 50 + + + + + + + + + 25 + 25 + + + + true + + + QFrame::StyledPanel + + + + + + :/scan_plugins/icons8-mouse-right-click-50.png + + + true + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + + + true + + + + 75 + true + + + + Qt::LeftToRight + + + 1 + + + 2 + + + + Point by Point + + + + + Line by Line + + + + + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + 75 + true + + + + DDL Mode + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + Auto + + + true + + + + + + + true + + + Reinitialize + + + false + + + + + + + + + + + ../../../icons/1318611600_23.ico../../../icons/1318611600_23.ico + + + + + + + + + + + + + 16777215 + 16777215 + + + + + 75 + true + + + + Spatial/Energy/Polarizations + + + + 5 + + + 5 + + + 5 + + + 5 + + + 5 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans_with_gt.ui b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans_with_gt.ui new file mode 100644 index 00000000..9e93b6e0 --- /dev/null +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/sample_image_scans/sample_image_scans_with_gt.ui @@ -0,0 +1,313 @@ + + + Frame + + + + 0 + 0 + 640 + 558 + + + + Qt::StrongFocus + + + Frame + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 650 + 16777215 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 75 + true + + + + Load Scan + + + + + + + + + true + + + + 75 + true + + + + Qt::LeftToRight + + + 1 + + + 2 + + + + Point by Point + + + + + Line by Line + + + + + + + + + + true + + + Auto + + + true + + + + + + + true + + + Reinitialize + + + false + + + + + + + + + + + ../../../icons/1318611600_23.ico../../../icons/1318611600_23.ico + + + + + + + + + + + + 75 + true + + + + Goni Theta + + + + + + + + + 75 + true + + + + Start (deg) + + + Qt::AlignCenter + + + + + + + -1000 + + + + + + + + + + + + 75 + true + + + + End (deg) + + + Qt::AlignCenter + + + + + + + 1000 + + + + + + + + + + + + 75 + true + + + + # Points + + + Qt::AlignCenter + + + + + + + 3 + + + + + + + + + + + + 75 + true + + + + Step (deg) + + + Qt::AlignCenter + + + + + + + 1000 + + + + + + + + + + + + + 16777215 + 16777215 + + + + + 75 + true + + + + Spatial + + + + 5 + + + 5 + + + 5 + + + 2 + + + 5 + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 341 + + + + + + + + + diff --git a/cls/applications/pyStxm/bl_configs/base_scan_plugins/tomography_scan/TomographyWithE712WavegenScan.py b/cls/applications/pyStxm/bl_configs/base_scan_plugins/tomography_scan/TomographyWithE712WavegenScan.py index 48f2dbed..96410704 100644 --- a/cls/applications/pyStxm/bl_configs/base_scan_plugins/tomography_scan/TomographyWithE712WavegenScan.py +++ b/cls/applications/pyStxm/bl_configs/base_scan_plugins/tomography_scan/TomographyWithE712WavegenScan.py @@ -123,7 +123,7 @@ def make_tomo_plan(self, dets, gate, md=None, bi_dir=False): def do_scan(): # yield from bps.open_run(md) - ev_mtr = self.main_obj.device("DNM_ENERGY") + energy_dev = self.main_obj.device("DNM_ENERGY_DEVICE") pol_mtr = self.main_obj.device("DNM_EPU_POLARIZATION") off_mtr = self.main_obj.device("DNM_EPU_OFFSET") ang_mtr = self.main_obj.device("DNM_EPU_ANGLE") @@ -178,7 +178,7 @@ def do_scan(): # switch to new energy for ev_sp in self.ev_setpoints: - yield from bps.mv(ev_mtr, ev_sp) + yield from bps.mv(energy_dev, ev_sp) # self.dwell = ev_roi[DWELL] self.dwell = self.setpointsDwell # take a single image that will be saved with its own run scan id diff --git a/cls/applications/pyStxm/bl_configs/device_configurator/version.json b/cls/applications/pyStxm/bl_configs/device_configurator/version.json deleted file mode 100644 index 702c5d02..00000000 --- a/cls/applications/pyStxm/bl_configs/device_configurator/version.json +++ /dev/null @@ -1 +0,0 @@ -"{\n \"auth\": \"Russ Berg\",\n \"commit\": \"44a3299ef0ccb38e965b56ab5702e9b3f4d3ab90\",\n \"commited_by\": \"bergr \",\n \"date\": \" Thu Jul 3 11:59:05 2025 -0600\",\n \"major_ver\": \"3\",\n \"minor_ver\": \"0\",\n \"ver\": \"3.0\",\n \"ver_str\": \"Version 3.0\"\n}" \ No newline at end of file diff --git a/cls/applications/pyStxm/bl_configs/device_names.py b/cls/applications/pyStxm/bl_configs/device_names.py index 446a8ba6..aa280711 100644 --- a/cls/applications/pyStxm/bl_configs/device_names.py +++ b/cls/applications/pyStxm/bl_configs/device_names.py @@ -1,14 +1,3 @@ -DNM_CSX = 'DNM_CSX' -DNM_CSY = 'DNM_CSY' -DNM_MIRROR1_RY = 'DNM_MIRROR1_RY' -DNM_MIRROR1_RX = 'DNM_MIRROR1_RX' -DNM_HW_COARSE_Y = 'DNM_HW_COARSE_Y' -DNM_HW_COARSE_X = 'DNM_HW_COARSE_X' -DNM_GIRDER_Y = 'DNM_GIRDER_Y' -DNM_SAMPLE_FINE_Z = 'DNM_SAMPLE_FINE_Z' -DNM_EXIT_SLIT_V = 'DNM_EXIT_SLIT_V' -DNM_EXIT_SLIT_H = 'DNM_EXIT_SLIT_H' -DNM_ENTRANCE_SLIT = 'DNM_ENTRANCE_SLIT' DNM_SAMPLE_FINE_X = 'DNM_SAMPLE_FINE_X' DNM_SAMPLE_FINE_Y = 'DNM_SAMPLE_FINE_Y' DNM_OSA_X = 'DNM_OSA_X' @@ -23,29 +12,31 @@ DNM_SAMPLE_X = 'DNM_SAMPLE_X' DNM_SAMPLE_Y = 'DNM_SAMPLE_Y' DNM_ENERGY = 'DNM_ENERGY' +DNM_SLIT_X = 'DNM_SLIT_X' +DNM_SLIT_Y = 'DNM_SLIT_Y' +DNM_M3_PITCH = 'DNM_M3_PITCH' +DNM_EPU_GAP = 'DNM_EPU_GAP' DNM_EPU_OFFSET = 'DNM_EPU_OFFSET' -DNM_ID2_OFFSET = 'DNM_ID2_OFFSET' +DNM_EPU_HARMONIC = 'DNM_EPU_HARMONIC' DNM_EPU_POLARIZATION = 'DNM_EPU_POLARIZATION' DNM_EPU_ANGLE = 'DNM_EPU_ANGLE' DNM_SHUTTER = 'DNM_SHUTTER' DNM_SHUTTERTASKRUN = 'DNM_SHUTTERTASKRUN' -DNM_COUNTER1 = 'DNM_COUNTER1' -DNM_COUNTER2 = 'DNM_COUNTER2' -DNM_ANALOG0 = 'DNM_ANALOG0' -DNM_APD_VOLTAGE = 'DNM_APD_VOLTAGE' -DNM_MAGNETIC_FIELD = 'DNM_MAGNETIC_FIELD' -DNM_ZMQ = 'DNM_ZMQ' -DNM_MOENCH_NUM_FRAMES = 'DNM_MOENCH_NUM_FRAMES' +DNM_SIS3820 = 'DNM_SIS3820' +DNM_PMT = 'DNM_PMT' +DNM_TUCSEN_AD = 'DNM_TUCSEN_AD' +DNM_RETURN_VELO = 'DNM_RETURN_VELO' DNM_FINE_ACCEL_DIST_PRCNT = 'DNM_FINE_ACCEL_DIST_PRCNT' DNM_FINE_DECCEL_DIST_PRCNT = 'DNM_FINE_DECCEL_DIST_PRCNT' DNM_CRS_ACCEL_DIST_PRCNT = 'DNM_CRS_ACCEL_DIST_PRCNT' DNM_CRS_DECCEL_DIST_PRCNT = 'DNM_CRS_DECCEL_DIST_PRCNT' DNM_CALCD_ZPZ = 'DNM_CALCD_ZPZ' DNM_RESET_INTERFERS = 'DNM_RESET_INTERFERS' +DNM_SFX_AUTOZERO = 'DNM_SFX_AUTOZERO' +DNM_SFY_AUTOZERO = 'DNM_SFY_AUTOZERO' DNM_ZPZ_ADJUST = 'DNM_ZPZ_ADJUST' -DNM_ZONEPLATE_INOUT = 'DNM_ZONEPLATE_INOUT' -DNM_OSA_INOUT = 'DNM_OSA_INOUT' -DNM_SAMPLE_OUT = 'DNM_SAMPLE_OUT' +DNM_ZONEPLATE_SCAN_MODE = 'DNM_ZONEPLATE_SCAN_MODE' +DNM_ZONEPLATE_SCAN_MODE_RBV = 'DNM_ZONEPLATE_SCAN_MODE_RBV' DNM_DELTA_A0 = 'DNM_DELTA_A0' DNM_IDEAL_A0 = 'DNM_IDEAL_A0' DNM_CALCD_ZPZ = 'DNM_CALCD_ZPZ' @@ -54,13 +45,57 @@ DNM_A0 = 'DNM_A0' DNM_A0MAX = 'DNM_A0MAX' DNM_ZPZ_POS = 'DNM_ZPZ_POS' +DNM_ENERGY_ENABLE = 'DNM_ENERGY_ENABLE' +DNM_ENERGY_RBV = 'DNM_ENERGY_RBV' +DNM_ZPZ_RBV = 'DNM_ZPZ_RBV' DNM_ZP_DEF_A = 'DNM_ZP_DEF_A' DNM_ZP_DEF = 'DNM_ZP_DEF' DNM_OSA_DEF = 'DNM_OSA_DEF' +DNM_SYSTEM_MODE_FBK = 'DNM_SYSTEM_MODE_FBK' DNM_SRSTATUS_SHUTTERS = 'DNM_SRSTATUS_SHUTTERS' +DNM_MONO_EV_FBK = 'DNM_MONO_EV_FBK' +DNM_BEAM_DEFOCUS = 'DNM_BEAM_DEFOCUS' +DNM_AX1_INTERFER_VOLTS = 'DNM_AX1_INTERFER_VOLTS' +DNM_SFX_PIEZO_VOLTS = 'DNM_SFX_PIEZO_VOLTS' +DNM_SFY_PIEZO_VOLTS = 'DNM_SFY_PIEZO_VOLTS' +DNM_AX2_INTERFER_VOLTS = 'DNM_AX2_INTERFER_VOLTS' +DNM_RING_CURRENT = 'DNM_RING_CURRENT' +DNM_BASELINE_RING_CURRENT = 'DNM_BASELINE_RING_CURRENT' DNM_DFLT_PMT_DWELL = 'DNM_DFLT_PMT_DWELL' -DNM_ALL_MOTORS_OFF = 'DNM_ALL_MOTORS_OFF' -DNM_GATING = 'DNM_GATING' -DNM_FOCUS_MODE = 'DNM_FOCUS_MODE' -DNM_SHUTTER_MODE = 'DNM_SHUTTER_MODE' DNM_TICKER = 'DNM_TICKER' +DNM_E712_WIDGET = 'DNM_E712_WIDGET' +DNM_E712_OPHYD_DEV = 'DNM_E712_OPHYD_DEV' +DNM_E712_DWELLS = 'DNM_E712_DWELLS' +DNM_E712_XRESETPOSNS = 'DNM_E712_XRESETPOSNS' +DNM_E712_YRESETPOSNS = 'DNM_E712_YRESETPOSNS' +DNM_E712_SP_IDS = 'DNM_E712_SP_IDS' +DNM_E712_CURRENT_SP_ID = 'DNM_E712_CURRENT_SP_ID' +DNM_E712_X_START_POS = 'DNM_E712_X_START_POS' +DNM_E712_Y_START_POS = 'DNM_E712_Y_START_POS' +DNM_E712_DDL_TBL_0 = 'DNM_E712_DDL_TBL_0' +DNM_E712_DDL_TBL_1 = 'DNM_E712_DDL_TBL_1' +DNM_E712_DDL_TBL_2 = 'DNM_E712_DDL_TBL_2' +DNM_E712_DDL_TBL_3 = 'DNM_E712_DDL_TBL_3' +DNM_E712_DDL_TBL_4 = 'DNM_E712_DDL_TBL_4' +DNM_E712_DDL_TBL_5 = 'DNM_E712_DDL_TBL_5' +DNM_E712_DDL_TBL_6 = 'DNM_E712_DDL_TBL_6' +DNM_E712_DDL_TBL_7 = 'DNM_E712_DDL_TBL_7' +DNM_E712_DDL_TBL_8 = 'DNM_E712_DDL_TBL_8' +DNM_E712_DDL_TBL_9 = 'DNM_E712_DDL_TBL_9' +DNM_E712_IMAGE_IDX = 'DNM_E712_IMAGE_IDX' +DNM_E712_SCAN_MODE = 'DNM_E712_SCAN_MODE' +DNM_E712_X_START_MODE = 'DNM_E712_X_START_MODE' +DNM_E712_Y_START_MODE = 'DNM_E712_Y_START_MODE' +DNM_E712_X_WAVTBL_IDS = 'DNM_E712_X_WAVTBL_IDS' +DNM_E712_Y_WAVTBL_IDS = 'DNM_E712_Y_WAVTBL_IDS' +DNM_E712_X_NPTS = 'DNM_E712_X_NPTS' +DNM_E712_Y_NPTS = 'DNM_E712_Y_NPTS' +DNM_E712_X_USEDDL = 'DNM_E712_X_USEDDL' +DNM_E712_Y_USEDDL = 'DNM_E712_Y_USEDDL' +DNM_E712_X_USEREINIT = 'DNM_E712_X_USEREINIT' +DNM_E712_Y_USEREINIT = 'DNM_E712_Y_USEREINIT' +DNM_E712_X_STRT_AT_END = 'DNM_E712_X_STRT_AT_END' +DNM_E712_Y_STRT_AT_END = 'DNM_E712_Y_STRT_AT_END' +DNM_E712_X_USE_TBL_NUM = 'DNM_E712_X_USE_TBL_NUM' +DNM_E712_Y_USE_TBL_NUM = 'DNM_E712_Y_USE_TBL_NUM' +DNM_E712_SSPND_CTRLR_FBK = 'DNM_E712_SSPND_CTRLR_FBK' diff --git a/cls/applications/pyStxm/bl_configs/pixelator_common/scan_plugins/fine_image_scans/SampleFineImageScan.py b/cls/applications/pyStxm/bl_configs/pixelator_common/scan_plugins/fine_image_scans/SampleFineImageScan.py index b3eba0b6..4aebdc47 100644 --- a/cls/applications/pyStxm/bl_configs/pixelator_common/scan_plugins/fine_image_scans/SampleFineImageScan.py +++ b/cls/applications/pyStxm/bl_configs/pixelator_common/scan_plugins/fine_image_scans/SampleFineImageScan.py @@ -9,7 +9,7 @@ from cls.applications.pyStxm.main_obj_init import MAIN_OBJ from cls.applications.pyStxm.bl_configs.base_scan_plugins.fine_image_scans.SampleFineImageScan import ( - BaseFineSampleImageScanClass, + BaseSampleFineImageScanClass, ) from cls.utils.roi_dict_defs import * from cls.utils.log import get_module_logger @@ -22,7 +22,7 @@ ACCEL_DISTANCE = MAIN_OBJ.get_preset_as_float("fine_accel_distance") -class FineSampleImageScanClass(BaseFineSampleImageScanClass): +class FineSampleImageScanClass(BaseSampleFineImageScanClass): """ This class is used to implement Coarse scans for conventional mode scanning """ diff --git a/cls/applications/pyStxm/bl_configs/pixelator_common/scan_plugins/osa_focus_scan/osa_focus_scan.py b/cls/applications/pyStxm/bl_configs/pixelator_common/scan_plugins/osa_focus_scan/osa_focus_scan.py index bfbf2b36..25c764df 100644 --- a/cls/applications/pyStxm/bl_configs/pixelator_common/scan_plugins/osa_focus_scan/osa_focus_scan.py +++ b/cls/applications/pyStxm/bl_configs/pixelator_common/scan_plugins/osa_focus_scan/osa_focus_scan.py @@ -29,40 +29,41 @@ def __init__(self, parent=None): init_scan_req_member_vars(self) - def on_set_focus_btn(self): - """ - set focus - """ - if self._new_zpz_pos == None: - _logger.info("You must first select a position before you can set focus") - notify( - "Unable to set focus", - "You must first select a position before you can set focus", - accept_str="OK", - ) - return - self.reset_focus_btns() - mtrz = self.main_obj.device("DNM_ZONEPLATE_Z") - mtrx = self.main_obj.device("DNM_OSA_X") - mtry = self.main_obj.device("DNM_OSA_Y") - # mult by -1.0 so that it is always negative as zpz pos needs - fl = -1.0 * math.fabs(self.main_obj.device("DNM_FOCAL_LENGTH").get_position()) - a0 = self.main_obj.device("DNM_A0").get_position() - zp_cent = float(self._new_zpz_pos) - - # support for DCS server motors that use offsets - if hasattr(mtrz, 'apply_delta_to_offset'): - delta = zp_cent - float(str(self.centerZPFld.text())) - mtrz.apply_delta_to_offset(delta) - - mtrx.move(0.0) - mtry.move(0.0) - - #now move to Sample Focus position which is == FL - A0 - #zpz_final_pos = -1.0 * (math.fabs(fl) - math.fabs(a0)) - # for now just move to the focal length position - zpz_final_pos = -1.0 * (math.fabs(fl)) - mtrz.move(zpz_final_pos) - - #have the plotter delete the focus image - self._parent.reset_image_plot() \ No newline at end of file + # def on_set_focus_btn(self): + # """ + # set focus + # """ + # if self._new_zpz_pos == None: + # _logger.info("You must first select a position before you can set focus") + # notify( + # "Unable to set focus", + # "You must first select a position before you can set focus", + # accept_str="OK", + # ) + # return + # self.reset_focus_btns() + # mtrz = self.main_obj.device("DNM_ZONEPLATE_Z") + # mtrx = self.main_obj.device("DNM_OSA_X") + # mtry = self.main_obj.device("DNM_OSA_Y") + # # mult by -1.0 so that it is always negative as zpz pos needs + # # fl = -1.0 * math.fabs(self.main_obj.device("DNM_FOCAL_LENGTH").get_position()) + # fl_as_zpz_pos = self.energy_dev.get_focal_length_as_zpz_position() + # zp_cent = float(self._new_zpz_pos) + # + # # support for DCS server motors that use offsets + # if hasattr(mtrz, 'apply_delta_to_offset'): + # delta = zp_cent - float(str(self.centerZPFld.text())) + # mtrz.apply_delta_to_offset(delta) + # + # # recenter OSA + # mtrx.move(0.0) + # mtry.move(0.0) + # + # #now move to Sample Focus position which is == FL - A0 + # #zpz_final_pos = -1.0 * (math.fabs(fl) - math.fabs(a0)) + # # for now just move to the focal length position + # # zpz_final_pos = -1.0 * (math.fabs(fl)) + # mtrz.move(fl_as_zpz_pos) + # + # #have the plotter delete the focus image + # self._parent.reset_image_plot() \ No newline at end of file diff --git a/cls/applications/pyStxm/bl_configs/sls_x07da_polLux/devs.py b/cls/applications/pyStxm/bl_configs/sls_x07da_polLux/devs.py index d7cbf2b8..d2de61ca 100644 --- a/cls/applications/pyStxm/bl_configs/sls_x07da_polLux/devs.py +++ b/cls/applications/pyStxm/bl_configs/sls_x07da_polLux/devs.py @@ -1,3 +1,797 @@ +# SIM = True +# dev_dct = {} +# dev_dct["POSITIONERS"] = [ +# { +# "name": "DNM_CSX", +# "desc": "CSX", +# "class": "MotorQt", +# "dcs_nm": "CSX", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_CSY", +# "desc": "CSY", +# "class": "MotorQt", +# "dcs_nm": "CSY", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_MIRROR1_RY", +# "desc": "Mirror1_Ry", +# "class": "MotorQt", +# "dcs_nm": "Mirror1_Ry", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_MIRROR1_RX", +# "desc": "Mirror1_Rx", +# "class": "MotorQt", +# "dcs_nm": "Mirror1_Rx", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_HW_COARSE_Y", +# "desc": "HwCoarseY", +# "class": "MotorQt", +# "dcs_nm": "HwCoarseY", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_HW_COARSE_X", +# "desc": "HwCoarseX", +# "class": "MotorQt", +# "dcs_nm": "HwCoarseX", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_GIRDER_Y", +# "desc": "Girder_y", +# "class": "MotorQt", +# "dcs_nm": "Girder_y", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_SAMPLE_FINE_Z", +# "desc": "Fine_Z", +# "class": "MotorQt", +# "dcs_nm": "FineZ", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_EXIT_SLIT_V", +# "desc": "ExitSlit_V", +# "class": "MotorQt", +# "dcs_nm": "ExitSlit_V", +# "pos_type": "POS_TYPE_BL", +# }, +# { +# "name": "DNM_EXIT_SLIT_H", +# "desc": "ExitSlit_H", +# "class": "MotorQt", +# "dcs_nm": "ExitSlit_H", +# "pos_type": "POS_TYPE_BL", +# }, +# { +# "name": "DNM_ENTRANCE_SLIT", +# "desc": "EntranceSlit", +# "class": "MotorQt", +# "dcs_nm": "EntranceSlit", +# "pos_type": "POS_TYPE_BL", +# }, +# { +# "name": "DNM_SAMPLE_FINE_X", +# "desc": "Fine_X", +# "class": "MotorQt", +# "dcs_nm": "FineX", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_SAMPLE_FINE_Y", +# "desc": "Fine_Y", +# "class": "MotorQt", +# "dcs_nm": "FineY", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_OSA_X", +# "desc": "OSA_X", +# "class": "MotorQt", +# "dcs_nm": "OSAX", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_OSA_Y", +# "desc": "OSA_Y", +# "class": "MotorQt", +# "dcs_nm": "OSAY", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_ZONEPLATE_Z", +# "desc": "Zoneplate", +# "class": "MotorQt", +# "dcs_nm": "Zoneplate", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_COARSE_X", +# "desc": "Coarse_X", +# "class": "MotorQt", +# "dcs_nm": "CoarseX", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_COARSE_Y", +# "desc": "Coarse_Y", +# "class": "MotorQt", +# "dcs_nm": "CoarseY", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_COARSE_Z", +# "desc": "Coarse_Z", +# "class": "MotorQt", +# "dcs_nm": "CoarseZ", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_DETECTOR_X", +# "desc": "Detector_X", +# "class": "MotorQt", +# "dcs_nm": "DetectorX", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_DETECTOR_Y", +# "desc": "Detector_Y", +# "class": "MotorQt", +# "dcs_nm": "DetectorY", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_DETECTOR_Z", +# "desc": "Detector_Z", +# "class": "MotorQt", +# "dcs_nm": "DetectorZ", +# "pos_type": "POS_TYPE_ES", +# }, +# { +# "name": "DNM_SAMPLE_X", +# "desc": "Sample_X", +# "class": "sample_abstract_motor", +# "dcs_nm": "SampleX", +# "pos_type": "POS_TYPE_ES", +# "fine_mtr_name": "DNM_SAMPLE_FINE_X", +# "coarse_mtr_name": "DNM_COARSE_X" +# }, +# { +# "name": "DNM_SAMPLE_Y", +# "desc": "Sample_Y", +# "class": "sample_abstract_motor", +# "dcs_nm": "SampleY", +# "pos_type": "POS_TYPE_ES", +# "fine_mtr_name": "DNM_SAMPLE_FINE_Y", +# "coarse_mtr_name": "DNM_COARSE_Y" +# +# }, +# { +# "name": "DNM_ENERGY", +# "desc": "Energy", +# "class": "MotorQt", +# "dcs_nm": "Energy" if SIM else "Energy", +# "abstract_mtr": True, +# "pos_type": "POS_TYPE_BL", +# "units": "eV", +# }, +# { +# "name": "DNM_EPU_OFFSET", +# "desc": "ID1_Offset", +# "class": "MotorQt", +# "dcs_nm": "ID1Off" if SIM else "ID1Off", +# "abstract_mtr": True, +# "pos_type": "POS_TYPE_BL", +# }, +# { +# "name": "DNM_ID2_OFFSET", +# "desc": "ID2_Offset", +# "class": "MotorQt", +# "dcs_nm": "ID2Off" if SIM else "ID2Off", +# "abstract_mtr": True, +# "pos_type": "POS_TYPE_BL", +# }, +# { +# "name": "DNM_EPU_POLARIZATION", +# "desc": "Polarization", +# "class": "MotorQt", +# "dcs_nm": "Polarization" if SIM else "Polarization", +# "abstract_mtr": True, +# "pos_type": "POS_TYPE_BL", +# "enums": ["Off", "Pos", "Neg"], +# "enum_values": [0, -0.2, 0.2] +# }, +# { +# "name": "DNM_EPU_ANGLE", +# "desc": "Epu_Angle", +# "class": "MotorQt", +# "dcs_nm": "PIXELATOR_DNM_EPU_ANGLE", +# "abstract_mtr": True, +# "pos_type": "POS_TYPE_BL", +# }, +# ] +# # if the sig_name is not itself a PV but is only a prefix, profide the con_chk_nm field +# dev_dct["DIO"] = [ +# { +# "name": "DNM_SHUTTER", +# "class": "DCSShutter", +# "dcs_nm": "BeamShutter", +# "ctrl_enum_strs": ["Auto", "Open", "Closed", "Auto Line"], +# "fbk_enum_strs": ["CLOSED", "OPEN"], +# +# }, +# { +# "name": "DNM_SHUTTERTASKRUN", +# "class": "make_basedevice", +# # "dcs_nm": "ASTXM1610:Dio:shutter:Run", +# "dcs_nm": "PIXELATOR_SHUTTERTASKRUN", +# }, +# ] +# +# dev_dct["DETECTORS"] = [ +# { +# "name": "DNM_COUNTER1", +# "class": "Counter", +# "dcs_nm": "Counter1", +# }, +# { +# "name": "DNM_COUNTER2", +# "class": "Counter", +# "dcs_nm": "Counter2", +# }, +# { +# "name": "DNM_ANALOG0", +# "class": "Counter", +# "dcs_nm": "Bl AI 0", +# }, +# +# ] +# dev_dct["PVS"] = [ +# { +# "name": "DNM_APD_VOLTAGE", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "APD Voltage", +# }, +# { +# "name": "DNM_MAGNETIC_FIELD", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "Magnetic Field", +# }, +# { +# "name": "DNM_ZMQ", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "ZMQ", +# }, +# { +# "name": "DNM_MOENCH_NUM_FRAMES", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "MoenchNumFrames", +# }, +# { +# "name": "DNM_FINE_ACCEL_DIST_PRCNT", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_FINE_ACCEL_DIST_PRCNT", +# }, +# { +# "name": "DNM_FINE_DECCEL_DIST_PRCNT", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_FINE_DECCEL_DIST_PRCNT", +# }, +# { +# "name": "DNM_CRS_ACCEL_DIST_PRCNT", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_CRS_ACCEL_DIST_PRCNT", +# }, +# { +# "name": "DNM_CRS_DECCEL_DIST_PRCNT", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_CRS_DECCEL_DIST_PRCNT", +# }, +# { +# "name": "DNM_CALCD_ZPZ", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_CALCD_ZPZ", +# }, +# { +# "name": "DNM_ZPZ_ADJUST", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_ZPZ_ADJUST", +# }, +# { +# "name": "DNM_DELTA_A0", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_DELTA_A0", +# }, +# { +# "name": "DNM_IDEAL_A0", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_IDEAL_A0", +# }, +# { +# "name": "DNM_CALCD_ZPZ", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_CALCD_ZPZ", +# }, +# { +# "name": "DNM_ZPZ_ADJUST", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_ZPZ_ADJUST", +# }, +# { +# "name": "DNM_FOCAL_LENGTH", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_FOCAL_LENGTH", +# "units": "um", +# }, +# { +# "name": "DNM_A0", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_A0", +# }, +# { +# "name": "DNM_A0MAX", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_A0MAX", +# }, +# # {'name': 'DNM_A0_FOR_CALC', 'class': 'make_basedevice', 'cat': 'PVS', 'dcs_nm': 'ASTXM1610:bl_api:A0:for_calc'}, +# { +# "name": "DNM_ZPZ_POS", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_ZPZ_POS", +# }, +# { +# "name": "DNM_ZP_DEF_A", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_ZP_DEF_A", +# }, +# { +# "name": "DNM_ZP_DEF", +# "class": "Transform", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_ZP_DEF", +# }, +# { +# "name": "DNM_OSA_DEF", +# "class": "Transform", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_OSA_DEF", +# }, +# { +# "name": "DNM_SRSTATUS_SHUTTERS", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_SRSTATUS_SHUTTERS", +# }, +# +# # { +# # "name": "DNM_RING_CURRENT", +# # "class": "make_basedevice", +# # "cat": "PVS", +# # "dcs_nm": "PIXELATOR_RING_CURRENT" if SIM else "PIXELATOR_RING_CURRENT", +# # "units": "mA", +# # }, +# # { +# # "name": "DNM_BASELINE_RING_CURRENT", +# # "class": "make_basedevice", +# # "cat": "PVS", +# # "dcs_nm": "PIXELATOR_BASELINE_RING_CURRENT" if SIM else "PIXELATOR_BASELINE_RING_CURRENT", +# # "units": "mA", +# # }, +# { +# "name": "DNM_DFLT_PMT_DWELL", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_DFLT_PMT_DWELL", +# }, +# { +# "name": "DNM_ALL_MOTORS_OFF", +# "class": "make_basedevice", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_ALL_MOTORS_OFF", +# }, +# { +# "name": "DNM_GATING", +# "class": "MultiSelectable", +# "dcs_nm": "PIXELATOR_GATING", +# "desc": "Pixelator Gating, connected to the rings top up mode", +# # the ctrl_enum_strs appear in teh pulldown for the combobox +# "ctrl_enum_strs": ["On", "Off", "No Repeat"], +# "fbk_enum_strs": ["On", "Off", "No Repeat"], +# #"fbk_enum_values": [0, 1, 2] +# }, +# { +# "name": "DNM_FOCUS_MODE", +# "class": "MultiSelectable", +# "dcs_nm": "PIXELATOR_FOCUS_MODE", +# "desc": "Focus mode", +# # the ctrl_enum_strs appear in the pulldown for the combobox +# "ctrl_enum_strs": ["Static", "Auto"], +# "fbk_enum_strs": ["Static", "Auto"], +# #"fbk_enum_values": [0, 1] +# }, +# { +# "name": "DNM_SHUTTER_MODE", +# "class": "MultiSelectable", +# "dcs_nm": "PIXELATOR_FOCUS_MODE", +# "desc": "Focus mode", +# # the ctrl_enum_strs appear in the pulldown for the combobox +# "ctrl_enum_strs": ["Static", "Auto"], +# "fbk_enum_strs": ["Static", "Auto"], +# #"fbk_enum_values": [0, 1] +# }, +# +# +# +# # _pv: BaseDevice('BL1610-I12:MONO1610-I10-01:grating:select:fbk'}, _pv.get_position: _pv.get_enum_str_as_int[{'name': 'Mono_grating_fbk', 'class': _pv +# ] +# +# dev_dct['COMMANDS'] = [ +# { +# "name": "DNM_RESET_INTERFERS", +# "class": "Bo", +# "cat": "PVS", +# "dcs_nm": "PIXELATOR_RESET_INTERFERS", +# }, +# # used to convieniently move zp z in and out +# { +# "name": "DNM_ZONEPLATE_INOUT", +# "class": "Command", +# "dcs_nm": "PIXELATOR_ZONEPLATE_INOUT", +# }, +# { +# "name": "DNM_OSA_INOUT", +# "class": "Command", +# "dcs_nm": "PIXELATOR_OSA_INOUT", +# }, +# { +# "name": "DNM_SAMPLE_OUT", +# "class": "Command", +# "dcs_nm": "PIXELATOR_SAMPLE_OUT", +# }, +# { +# "name": "DNM_LOAD_DIRECTORY", +# "class": "Command", +# "dcs_nm": "loadFile directory", +# "arg_keywords": ["directory","showHidden","fileExtension"] +# }, +# { +# "name": "DNM_LOAD_FILE", +# "class": "Command", +# "dcs_nm": "loadFile file", +# "arg_keywords": ["filePath","readMode"] +# }, +# ] +# +# dev_dct["PVS_DONT_RECORD"] = [ +# { +# "name": "DNM_TICKER", +# "class": "make_basedevice", +# "cat": "PVS_DONT_RECORD", +# "dcs_nm": "PIXELATOR_TICKER", +# "units": "counts", +# } +# ] +# +# dev_dct["HEARTBEATS"] = [ +# # { +# # "name": "DNM_BLAPI_HRTBT", +# # "class": "Bo", +# # "dcs_nm": "ASTXM1610:BlApi:hrtbt:alive", +# # "desc": "BlApiApp", +# # }, +# # { +# # "name": "DNM_AI_HRTBT", +# # "class": "Bo", +# # "dcs_nm": "ASTXM1610:Ai:hrtbt:alive", +# # "desc": "AnalogInputApp", +# # }, +# # { +# # "name": "DNM_CI_HRTBT", +# # "class": "Bo", +# # "dcs_nm": "ASTXM1610:Ci:hrtbt:alive", +# # "desc": "CounterInputApp", +# # }, +# # { +# # "name": "DNM_CO_HRTBT", +# # "class": "Bo", +# # "dcs_nm": "ASTXM1610:Co:hrtbt:alive", +# # "desc": "CounterOutputApp", +# # }, +# # { +# # "name": "DNM_DIO_HRTBT", +# # "class": "Bo", +# # "dcs_nm": "ASTXM1610:Dio:hrtbt:alive", +# # "desc": "DigitalIOApp", +# # }, +# # { +# # "name": "DNM_MTRS_HRTBT", +# # "class": "Bo", +# # "dcs_nm": "ASTXM1610:AmbAbsMtrs:hrtbt:alive", +# # "desc": "MainMotorsApp", +# # }, +# # { +# # "name": "DNM_MTR_CALIB_HRTBT", +# # "class": "Bo", +# # "dcs_nm": "ASTXM1610:MtrCal:hrtbt:alive", +# # "desc": "MotorCalibrations", +# # }, +# # { +# # "name": "DNM_MTRS_OSA_HRTBT", +# # "class": "Bo", +# # "dcs_nm": "ASTXM1610:PiE873:hrtbt:alive", +# # "desc": "OSAMotorsApp", +# # }, +# # {'name': 'DNM_MTRS_ZP_HRTBT', 'class': 'Bo', 'dcs_nm':'ASTXM1610:MtrZp:hrtbt:alive', 'desc': 'ZPzMotorsApp'}, +# # {'name': 'DNM_GATE_SCAN_CFG_HRTBT', 'class': 'Bo', 'dcs_nm':'ASTXM1610:hrtbt:alive', 'desc': 'Gate / CounterscancfgApp'} +# ] +# +# dev_dct["PRESSURES"] = [ +# # { +# # "name": "CCG1410-01:vac:p", +# # "class": "make_basedevice", +# # "cat": "PRESSURES", +# # "dcs_nm": "CCG1410-01:vac:p", +# # "desc": "Sec.1", +# # "units": "torr", +# # "pos_type": "POS_TYPE_BL", +# # }, +# # { +# # "name": "CCG1410-I00-01:vac:p", +# # "class": "make_basedevice", +# # "cat": "PRESSURES", +# # "dcs_nm": "CCG1410-I00-01:vac:p", +# # "desc": "Sec.2", +# # "units": "torr", +# # "pos_type": "POS_TYPE_BL", +# # }, +# # { +# # "name": "CCG1410-I00-02:vac:p", +# # "class": "make_basedevice", +# # "cat": "PRESSURES", +# # "dcs_nm": "CCG1410-I00-02:vac:p", +# # "desc": "Sec.4", +# # "units": "torr", +# # "pos_type": "POS_TYPE_BL", +# # }, +# # { +# # "name": "CCG1610-1-I00-02:vac:p", +# # "class": "make_basedevice", +# # "cat": "PRESSURES", +# # "dcs_nm": "CCG1610-1-I00-02:vac:p", +# # "desc": "Sec.6", +# # "units": "torr", +# # "pos_type": "POS_TYPE_BL", +# # }, +# # { +# # "name": "HCG1610-1-I00-01:vac:p", +# # "class": "make_basedevice", +# # "cat": "PRESSURES", +# # "dcs_nm": "HCG1610-1-I00-01:vac:p", +# # "desc": "Sec.7", +# # "units": "torr", +# # "pos_type": "POS_TYPE_BL", +# # }, +# # { +# # "name": "CCG1610-1-I00-03:vac:p", +# # "class": "make_basedevice", +# # "cat": "PRESSURES", +# # "dcs_nm": "CCG1610-1-I00-03:vac:p", +# # "desc": "Sec.8", +# # "units": "torr", +# # "pos_type": "POS_TYPE_BL", +# # }, +# # { +# # "name": "CCG1610-I10-01:vac:p", +# # "class": "make_basedevice", +# # "cat": "PRESSURES", +# # "dcs_nm": "CCG1610-I10-01:vac:p", +# # "desc": "Sec.10", +# # "units": "torr", +# # "pos_type": "POS_TYPE_BL", +# # }, +# # { +# # "name": "CCG1610-I10-03:vac:p", +# # "class": "make_basedevice", +# # "cat": "PRESSURES", +# # "dcs_nm": "CCG1610-I10-03:vac:p", +# # "desc": "Sec.12", +# # "units": "torr", +# # "pos_type": "POS_TYPE_BL", +# # }, +# # { +# # "name": "CCG1610-I10-04:vac:p", +# # "class": "make_basedevice", +# # "cat": "PRESSURES", +# # "dcs_nm": "CCG1610-I10-04:vac:p", +# # "desc": "Sec.13", +# # "units": "torr", +# # "pos_type": "POS_TYPE_BL", +# # }, +# # { +# # "name": "CCG1610-I12-01:vac:p", +# # "class": "make_basedevice", +# # "cat": "PRESSURES", +# # "dcs_nm": "CCG1610-I12-01:vac:p", +# # "desc": "Sec.14", +# # "units": "torr", +# # "pos_type": "POS_TYPE_BL", +# # }, +# # { +# # "name": "CCG1610-I12-02:vac:p", +# # "class": "make_basedevice", +# # "cat": "PRESSURES", +# # "dcs_nm": "CCG1610-I12-02:vac:p", +# # "desc": "Sec.15", +# # "units": "torr", +# # "pos_type": "POS_TYPE_BL", +# # }, +# # { +# # "name": "CCG1610-3-I12-01:vac:p", +# # "class": "make_basedevice", +# # "cat": "PRESSURES", +# # "dcs_nm": "CCG1610-3-I12-01:vac:p", +# # "desc": "Sec.16", +# # "units": "torr", +# # "pos_type": "POS_TYPE_BL", +# #}, +# ] +# +# dev_dct["TEMPERATURES"] = [ +# # { +# # "name": "TM1610-3-I12-01", +# # "class": "make_basedevice", +# # "cat": "TEMPERATURES", +# # "dcs_nm": "TM1610-3-I12-01", +# # "desc": "UVH Turbo cooling water", +# # "units": "deg C", +# # "pos_type": "POS_TYPE_ES", +# # }, +# # { +# # "name": "TM1610-3-I12-30", +# # "class": "make_basedevice", +# # "cat": "TEMPERATURES", +# # "dcs_nm": "TM1610-3-I12-30", +# # "desc": "UVH Sample Coarse Y", +# # "units": "deg C", +# # "pos_type": "POS_TYPE_ES", +# # }, +# # { +# # "name": "TM1610-3-I12-32", +# # "class": "make_basedevice", +# # "cat": "TEMPERATURES", +# # "dcs_nm": "TM1610-3-I12-32", +# # "desc": "UVH Detector Y", +# # "units": "deg C", +# # "pos_type": "POS_TYPE_ES", +# # }, +# # { +# # "name": "TM1610-3-I12-21", +# # "class": "make_basedevice", +# # "cat": "TEMPERATURES", +# # "dcs_nm": "TM1610-3-I12-21", +# # "desc": "UVH Chamber temp #1", +# # "units": "deg C", +# # "pos_type": "POS_TYPE_ES", +# # }, +# # { +# # "name": "TM1610-3-I12-22", +# # "class": "make_basedevice", +# # "cat": "TEMPERATURES", +# # "dcs_nm": "TM1610-3-I12-22", +# # "desc": "UVH Chamber temp #2", +# # "units": "deg C", +# # "pos_type": "POS_TYPE_ES", +# # }, +# # { +# # "name": "TM1610-3-I12-23", +# # "class": "make_basedevice", +# # "cat": "TEMPERATURES", +# # "dcs_nm": "TM1610-3-I12-23", +# # "desc": "UVH Chamber temp #3", +# # "units": "deg C", +# # "pos_type": "POS_TYPE_ES", +# # }, +# # { +# # "name": "TM1610-3-I12-24", +# # "class": "make_basedevice", +# # "cat": "TEMPERATURES", +# # "dcs_nm": "TM1610-3-I12-24", +# # "desc": "UVH Chamber temp #4", +# # "units": "deg C", +# # "pos_type": "POS_TYPE_ES", +# # }, +# ] +# +# +# +# def get_dev_names(): +# dev_nms = [] +# for k in list(dev_dct.keys()): +# # get all the device names +# dlist = dev_dct[k] +# for sig_dct in dlist: +# if isinstance(sig_dct, dict): +# if "name" in sig_dct.keys(): +# dev_nms.append(sig_dct["name"]) +# else: +# if sig_dct.find("POS_TYPE") > -1: +# dlist = dev_dct[k][sig_dct] +# for _dct in dlist: +# if "name" in _dct.keys(): +# dev_nms.append(_dct["name"]) +# return dev_nms +# +# +# def get_connections_status(_dct=None): +# from cls.applications.pyStxm.bl_configs.device_configurator.con_checker import con_check_many +# +# dev_pvlist = [] +# con_lst = [] +# if _dct is None: +# keys = list(dev_dct.keys()) +# else: +# keys = list(_dct.keys()) +# +# for k in keys: +# # get all the signal names +# dlist = dev_dct[k] +# for sig_dct in dlist: +# if isinstance(sig_dct, dict): +# if "dcs_nm" in sig_dct.keys(): +# if "con_chk_nm" in sig_dct.keys(): +# con_lst.append(sig_dct["dcs_nm"] + sig_dct["con_chk_nm"]) +# else: +# con_lst.append(sig_dct["dcs_nm"]) +# dev_pvlist.append(sig_dct["dcs_nm"]) +# else: +# if sig_dct.find("POS_TYPE") > -1: +# dlist = dev_dct[k][sig_dct] +# for _dct in dlist: +# if "dcs_nm" in _dct.keys(): +# if "con_chk_nm" in _dct.keys(): +# con_lst.append(_dct["dcs_nm"] + _dct["con_chk_nm"]) +# else: +# con_lst.append(_dct["dcs_nm"]) +# dev_pvlist.append(_dct["dcs_nm"]) +# # the list for connections might not be same as the sig_name required to create an instance of the device +# # so for purposes of finding out IS THERE A CONNECTION just make sure to specify an actual PV not just a prefix +# cons = con_check_many(con_lst) +# both = dict(zip(dev_pvlist, cons)) +# return both +# +# +# if __name__ == "__main__": +# cons = get_connections_status() +# for conn in list(cons): +# print(conn) + SIM = True dev_dct = {} dev_dct["POSITIONERS"] = [ @@ -20,14 +814,14 @@ "desc": "Mirror1_Ry", "class": "MotorQt", "dcs_nm": "Mirror1_Ry", - "pos_type": "POS_TYPE_ES", + "pos_type": "POS_TYPE_BL", }, { "name": "DNM_MIRROR1_RX", "desc": "Mirror1_Rx", "class": "MotorQt", "dcs_nm": "Mirror1_Rx", - "pos_type": "POS_TYPE_ES", + "pos_type": "POS_TYPE_BL", }, { "name": "DNM_HW_COARSE_Y", @@ -48,7 +842,7 @@ "desc": "Girder_y", "class": "MotorQt", "dcs_nm": "Girder_y", - "pos_type": "POS_TYPE_ES", + "pos_type": "POS_TYPE_BL", }, { "name": "DNM_SAMPLE_FINE_Z", @@ -255,6 +1049,11 @@ ] dev_dct["PVS"] = [ + { + "name": "DNM_ZONEPLATE_FOCUS_MODE", + "class": "make_base_simdevice", + "dcs_nm": "PIXELATOR_ZONEPLATE_FOCUS_MODE", + }, { "name": "DNM_APD_VOLTAGE", "class": "make_basedevice", @@ -333,6 +1132,13 @@ "cat": "PVS", "dcs_nm": "PIXELATOR_CALCD_ZPZ", }, + { + "name": "DNM_BEAM_DEFOCUS", + "class": "make_basedevice", + "cat": "PVS", + "dcs_nm": "PIXELATOR_BEAM_DEFOCUS", + "units": "um", + }, { "name": "DNM_ZPZ_ADJUST", "class": "make_basedevice", @@ -358,7 +1164,11 @@ "cat": "PVS", "dcs_nm": "PIXELATOR_A0MAX", }, - # {'name': 'DNM_A0_FOR_CALC', 'class': 'make_basedevice', 'cat': 'PVS', 'dcs_nm': 'ASTXM1610:bl_api:A0:for_calc'}, + { + 'name': 'DNM_A0_FOR_CALC', + 'class': 'make_basedevice', + 'cat': 'PVS', + 'dcs_nm': 'ASTXM1610:bl_api:A0:for_calc'}, { "name": "DNM_ZPZ_POS", "class": "make_basedevice", @@ -366,20 +1176,20 @@ "dcs_nm": "PIXELATOR_ZPZ_POS", }, { - "name": "DNM_ZP_DEF_A", + "name": "DNM_ZP_A1", "class": "make_basedevice", "cat": "PVS", - "dcs_nm": "PIXELATOR_ZP_DEF_A", + "dcs_nm": "PIXELATOR_ZP_A1", }, { "name": "DNM_ZP_DEF", - "class": "Transform", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "PIXELATOR_ZP_DEF", }, { "name": "DNM_OSA_DEF", - "class": "Transform", + "class": "make_base_simdevice", "cat": "PVS", "dcs_nm": "PIXELATOR_OSA_DEF", }, @@ -489,6 +1299,20 @@ }, ] +dev_dct["ENERGY_DEV"] = [ + { + "name": "DNM_ENERGY_DEVICE", + "desc": "Energy device that includes focussing", + "class": "EnergyDevice", + #"dcs_nm": "SIM_VBL1610-I12:ENERGY" if SIM else "BL1610-I10:ENERGY", + "dcs_nm": "SIM_VBLFAKE:ENERGY" if SIM else "BLFAKE:ENERGY", + "energy_nm": "DNM_ENERGY", + "zz_nm": "DNM_ZONEPLATE_Z", + "cz_nm": "DNM_COARSE_Z", + "pos_type": "POS_TYPE_BL", + }, +] + dev_dct["PVS_DONT_RECORD"] = [ { "name": "DNM_TICKER", @@ -500,234 +1324,15 @@ ] dev_dct["HEARTBEATS"] = [ - # { - # "name": "DNM_BLAPI_HRTBT", - # "class": "Bo", - # "dcs_nm": "ASTXM1610:BlApi:hrtbt:alive", - # "desc": "BlApiApp", - # }, - # { - # "name": "DNM_AI_HRTBT", - # "class": "Bo", - # "dcs_nm": "ASTXM1610:Ai:hrtbt:alive", - # "desc": "AnalogInputApp", - # }, - # { - # "name": "DNM_CI_HRTBT", - # "class": "Bo", - # "dcs_nm": "ASTXM1610:Ci:hrtbt:alive", - # "desc": "CounterInputApp", - # }, - # { - # "name": "DNM_CO_HRTBT", - # "class": "Bo", - # "dcs_nm": "ASTXM1610:Co:hrtbt:alive", - # "desc": "CounterOutputApp", - # }, - # { - # "name": "DNM_DIO_HRTBT", - # "class": "Bo", - # "dcs_nm": "ASTXM1610:Dio:hrtbt:alive", - # "desc": "DigitalIOApp", - # }, - # { - # "name": "DNM_MTRS_HRTBT", - # "class": "Bo", - # "dcs_nm": "ASTXM1610:AmbAbsMtrs:hrtbt:alive", - # "desc": "MainMotorsApp", - # }, - # { - # "name": "DNM_MTR_CALIB_HRTBT", - # "class": "Bo", - # "dcs_nm": "ASTXM1610:MtrCal:hrtbt:alive", - # "desc": "MotorCalibrations", - # }, - # { - # "name": "DNM_MTRS_OSA_HRTBT", - # "class": "Bo", - # "dcs_nm": "ASTXM1610:PiE873:hrtbt:alive", - # "desc": "OSAMotorsApp", - # }, - # {'name': 'DNM_MTRS_ZP_HRTBT', 'class': 'Bo', 'dcs_nm':'ASTXM1610:MtrZp:hrtbt:alive', 'desc': 'ZPzMotorsApp'}, - # {'name': 'DNM_GATE_SCAN_CFG_HRTBT', 'class': 'Bo', 'dcs_nm':'ASTXM1610:hrtbt:alive', 'desc': 'Gate / CounterscancfgApp'} + ] dev_dct["PRESSURES"] = [ - # { - # "name": "CCG1410-01:vac:p", - # "class": "make_basedevice", - # "cat": "PRESSURES", - # "dcs_nm": "CCG1410-01:vac:p", - # "desc": "Sec.1", - # "units": "torr", - # "pos_type": "POS_TYPE_BL", - # }, - # { - # "name": "CCG1410-I00-01:vac:p", - # "class": "make_basedevice", - # "cat": "PRESSURES", - # "dcs_nm": "CCG1410-I00-01:vac:p", - # "desc": "Sec.2", - # "units": "torr", - # "pos_type": "POS_TYPE_BL", - # }, - # { - # "name": "CCG1410-I00-02:vac:p", - # "class": "make_basedevice", - # "cat": "PRESSURES", - # "dcs_nm": "CCG1410-I00-02:vac:p", - # "desc": "Sec.4", - # "units": "torr", - # "pos_type": "POS_TYPE_BL", - # }, - # { - # "name": "CCG1610-1-I00-02:vac:p", - # "class": "make_basedevice", - # "cat": "PRESSURES", - # "dcs_nm": "CCG1610-1-I00-02:vac:p", - # "desc": "Sec.6", - # "units": "torr", - # "pos_type": "POS_TYPE_BL", - # }, - # { - # "name": "HCG1610-1-I00-01:vac:p", - # "class": "make_basedevice", - # "cat": "PRESSURES", - # "dcs_nm": "HCG1610-1-I00-01:vac:p", - # "desc": "Sec.7", - # "units": "torr", - # "pos_type": "POS_TYPE_BL", - # }, - # { - # "name": "CCG1610-1-I00-03:vac:p", - # "class": "make_basedevice", - # "cat": "PRESSURES", - # "dcs_nm": "CCG1610-1-I00-03:vac:p", - # "desc": "Sec.8", - # "units": "torr", - # "pos_type": "POS_TYPE_BL", - # }, - # { - # "name": "CCG1610-I10-01:vac:p", - # "class": "make_basedevice", - # "cat": "PRESSURES", - # "dcs_nm": "CCG1610-I10-01:vac:p", - # "desc": "Sec.10", - # "units": "torr", - # "pos_type": "POS_TYPE_BL", - # }, - # { - # "name": "CCG1610-I10-03:vac:p", - # "class": "make_basedevice", - # "cat": "PRESSURES", - # "dcs_nm": "CCG1610-I10-03:vac:p", - # "desc": "Sec.12", - # "units": "torr", - # "pos_type": "POS_TYPE_BL", - # }, - # { - # "name": "CCG1610-I10-04:vac:p", - # "class": "make_basedevice", - # "cat": "PRESSURES", - # "dcs_nm": "CCG1610-I10-04:vac:p", - # "desc": "Sec.13", - # "units": "torr", - # "pos_type": "POS_TYPE_BL", - # }, - # { - # "name": "CCG1610-I12-01:vac:p", - # "class": "make_basedevice", - # "cat": "PRESSURES", - # "dcs_nm": "CCG1610-I12-01:vac:p", - # "desc": "Sec.14", - # "units": "torr", - # "pos_type": "POS_TYPE_BL", - # }, - # { - # "name": "CCG1610-I12-02:vac:p", - # "class": "make_basedevice", - # "cat": "PRESSURES", - # "dcs_nm": "CCG1610-I12-02:vac:p", - # "desc": "Sec.15", - # "units": "torr", - # "pos_type": "POS_TYPE_BL", - # }, - # { - # "name": "CCG1610-3-I12-01:vac:p", - # "class": "make_basedevice", - # "cat": "PRESSURES", - # "dcs_nm": "CCG1610-3-I12-01:vac:p", - # "desc": "Sec.16", - # "units": "torr", - # "pos_type": "POS_TYPE_BL", - #}, + ] dev_dct["TEMPERATURES"] = [ - # { - # "name": "TM1610-3-I12-01", - # "class": "make_basedevice", - # "cat": "TEMPERATURES", - # "dcs_nm": "TM1610-3-I12-01", - # "desc": "UVH Turbo cooling water", - # "units": "deg C", - # "pos_type": "POS_TYPE_ES", - # }, - # { - # "name": "TM1610-3-I12-30", - # "class": "make_basedevice", - # "cat": "TEMPERATURES", - # "dcs_nm": "TM1610-3-I12-30", - # "desc": "UVH Sample Coarse Y", - # "units": "deg C", - # "pos_type": "POS_TYPE_ES", - # }, - # { - # "name": "TM1610-3-I12-32", - # "class": "make_basedevice", - # "cat": "TEMPERATURES", - # "dcs_nm": "TM1610-3-I12-32", - # "desc": "UVH Detector Y", - # "units": "deg C", - # "pos_type": "POS_TYPE_ES", - # }, - # { - # "name": "TM1610-3-I12-21", - # "class": "make_basedevice", - # "cat": "TEMPERATURES", - # "dcs_nm": "TM1610-3-I12-21", - # "desc": "UVH Chamber temp #1", - # "units": "deg C", - # "pos_type": "POS_TYPE_ES", - # }, - # { - # "name": "TM1610-3-I12-22", - # "class": "make_basedevice", - # "cat": "TEMPERATURES", - # "dcs_nm": "TM1610-3-I12-22", - # "desc": "UVH Chamber temp #2", - # "units": "deg C", - # "pos_type": "POS_TYPE_ES", - # }, - # { - # "name": "TM1610-3-I12-23", - # "class": "make_basedevice", - # "cat": "TEMPERATURES", - # "dcs_nm": "TM1610-3-I12-23", - # "desc": "UVH Chamber temp #3", - # "units": "deg C", - # "pos_type": "POS_TYPE_ES", - # }, - # { - # "name": "TM1610-3-I12-24", - # "class": "make_basedevice", - # "cat": "TEMPERATURES", - # "dcs_nm": "TM1610-3-I12-24", - # "desc": "UVH Chamber temp #4", - # "units": "deg C", - # "pos_type": "POS_TYPE_ES", - # }, -] + ] diff --git a/cls/applications/pyStxm/bl_configs/utils.py b/cls/applications/pyStxm/bl_configs/utils.py index b979874f..5309b4d2 100644 --- a/cls/applications/pyStxm/bl_configs/utils.py +++ b/cls/applications/pyStxm/bl_configs/utils.py @@ -1,13 +1,19 @@ import os from bcm.devices import BaseDevice +from bcm.devices.sim.sim_base_device import BaseSimDevice -def make_basedevice(cat, sig_nm, name="YOUNEEDTOPROVIDEANAME", desc="", units="", rd_only=False, devcfg=None, backend="epics"): - # RUSS FEB25 devcfg.msg_splash("connecting to %s: [%s]" % (cat, nm)) +def make_basedevice(cat, sig_nm, name="YOUNEEDTOPROVIDEANAME", desc="", units="", rd_only=False, devcfg=None, + backend="epics"): dev = BaseDevice(sig_nm, name=name, desc=desc, units=units, rd_only=rd_only, backend=backend) return dev +def make_base_simdevice(cat, sig_nm, name="YOUNEEDTOPROVIDEANAME", desc="", units="", rd_only=False, devcfg=None, + backend="epics"): + dev = BaseSimDevice(sig_nm, name=name, desc=desc, units=units, rd_only=rd_only, backend=backend) + return dev + def get_config_name(fname): nm = fname.split(os.path.sep)[-1].replace(".py", "") return nm diff --git a/cls/applications/pyStxm/main_obj_init.py b/cls/applications/pyStxm/main_obj_init.py index 966f67b1..a7974f77 100644 --- a/cls/applications/pyStxm/main_obj_init.py +++ b/cls/applications/pyStxm/main_obj_init.py @@ -133,8 +133,7 @@ mainConfig.update(bl_config_dct) MAIN_OBJ.set_presets(mainConfig) - # DEFAULTS = Defaults('uhvstxm_dflts.json', new=False) - DEFAULTS = Defaults("%s_dflts.json" % bl_config_nm) + DEFAULTS = Defaults() else: print("NO SAMPLE POSITIONING MODE SELECTED") exit() diff --git a/cls/applications/pyStxm/preferences/focusAndZoneplateParms/focusAndZoneplateParms.py b/cls/applications/pyStxm/preferences/focusAndZoneplateParms/focusAndZoneplateParms.py index 45c78f04..35b79f3a 100644 --- a/cls/applications/pyStxm/preferences/focusAndZoneplateParms/focusAndZoneplateParms.py +++ b/cls/applications/pyStxm/preferences/focusAndZoneplateParms/focusAndZoneplateParms.py @@ -12,6 +12,8 @@ from cls.applications.pyStxm.main_obj_init import MAIN_OBJ from cls.devWidgets.ophydLabelWidget import assign_aiLabelWidget from cls.appWidgets.basePreference import BasePreference +from cls.scanning.paramLineEdit import dblLineEditParamObj +from cls.appWidgets.focus_class import ABS_MIN_A0, ABS_MAX_A0 from cls.utils.log import get_module_logger widgetsUiDir = os.path.join(os.path.dirname(os.path.abspath(__file__))) @@ -32,6 +34,10 @@ def __init__(self, name="FocusParams", parent=None): self._parent = parent uic.loadUi(os.path.join(widgetsUiDir, "focusAndZoneplateParms.ui"), self) + # subscribe to focus changes + self.energy_dev = MAIN_OBJ.device("DNM_ENERGY_DEVICE") + self.energy_dev.focus_params_changed.connect(self.on_update_focus_params) + # reassign the QLabels to be attached to pvs to update when their values change #if MAIN_OBJ.device("DNM_ENERGY_RBV"): if MAIN_OBJ.device("DNM_ENERGY"): @@ -46,10 +52,10 @@ def __init__(self, name="FocusParams", parent=None): else: self.evFbkLbl.setText("No Energy Feedback Device in database") - if MAIN_OBJ.device("DNM_ZP_DEF_A"): + if MAIN_OBJ.device("DNM_ZP_A1"): self.a1FbkLbl = assign_aiLabelWidget( self.a1FbkLbl, - MAIN_OBJ.device("DNM_ZP_DEF_A"), + MAIN_OBJ.device("DNM_ZP_A1"), hdrText="A1", egu="", title_color="white", @@ -57,7 +63,7 @@ def __init__(self, name="FocusParams", parent=None): format="%5.4f", ) else: - self.a1FbkLbl.setText("No DNM_ZP_DEF_A Device in database") + self.a1FbkLbl.setText("No DNM_ZP_A1 Device in database") if MAIN_OBJ.device("DNM_A0MAX"): self.a0MaxFbkLbl = assign_aiLabelWidget( @@ -97,10 +103,10 @@ def __init__(self, name="FocusParams", parent=None): self.sampleZFbkLbl.setText("No DNM_IDEAL_A0 Device in database") #if MAIN_OBJ.device("DNM_ZPZ_RBV"): - if MAIN_OBJ.device("DNM_ZONEPLATE_Z"): + if MAIN_OBJ.device("DNM_CALCD_ZPZ"): self.zpzFbkLbl = assign_aiLabelWidget( self.zpzFbkLbl, - MAIN_OBJ.device("DNM_ZONEPLATE_Z"), + MAIN_OBJ.device("DNM_CALCD_ZPZ"), hdrText="Zpz", egu="um", title_color="white", @@ -108,7 +114,7 @@ def __init__(self, name="FocusParams", parent=None): format="%5.2f", ) else: - self.zpzFbkLbl.setText("No DNM_ZPZ_RBV Device in database") + self.zpzFbkLbl.setText("No DNM_CALCD_ZPZ Device in database") self.a0Fld.returnPressed.connect(self.on_a0_changed) @@ -143,10 +149,10 @@ def __init__(self, name="FocusParams", parent=None): zpParms_ui = uic.loadUi(os.path.join(widgetsUiDir, "zpFlds.ui")) # populate fields - zpParms_ui.zpDFld.setText("%.2f" % zp_def["D"]) - zpParms_ui.zpCStopFld.setText("%.2f" % zp_def["CsD"]) - zpParms_ui.zpOZoneFld.setText("%.2f" % zp_def["OZone"]) - zpParms_ui.zpA1Fld.setText("%.3f" % zp_def["a1"]) + zpParms_ui.zpDFld.setText(f"{zp_def['D']:.2f}") + zpParms_ui.zpCStopFld.setText(f"{zp_def['CsD']:.2f}" ) + zpParms_ui.zpOZoneFld.setText(f"{zp_def['OZone']:.2f}") + zpParms_ui.zpA1Fld.setText(f"{zp_def['a1']:.3f}") #self.zpToolBox.insertItem(pages, zpParms_ui, "ZP %d" % (pages)) self.zpToolBox.insertItem(pages, zpParms_ui, f"{zp_def['name']}") @@ -191,17 +197,23 @@ def __init__(self, name="FocusParams", parent=None): osa_idx = 0 self.osaToolBox.setCurrentIndex(osa_idx) + A0 = self.get_section("ZP_FOCUS_PARAMS.OSA_A0") + self.a0Fld.setText("%.2f" % A0) + self.on_a0_changed() + self.update_zp_selection(zp_idx=zp_idx) self.update_osa_selection(osa_idx=osa_idx) - # A0 = self.get_section("ZP_FOCUS_PARAMS.OSA_A0") - # self.a0Fld.setText("%.2f" % A0) - # self.on_a0_changed() - self.zpToolBox.currentChanged.connect(self.update_zp_selection) self.osaToolBox.currentChanged.connect(self.update_osa_selection) - scan_mode_dev = MAIN_OBJ.device("DNM_ZONEPLATE_SCAN_MODE") + self.minA0Fld.dpo = dblLineEditParamObj("minA0Fld", ABS_MIN_A0, ABS_MAX_A0, 2, parent=self.minA0Fld) + # fld.dpo.valid_returnPressed.connect(self.update_data) + self.minA0Fld.dpo.valid_returnPressed.connect( + self.on_min_a0_changed + ) + + scan_mode_dev = MAIN_OBJ.device("DNM_ZONEPLATE_SCAN_MODE", do_warn=False) if scan_mode_dev: scan_mode_dev.put(1) @@ -213,6 +225,45 @@ def __init__(self, name="FocusParams", parent=None): # init from saved self.reload() + self.update_fl_label() + + def on_update_focus_params(self, focus_parms_dct: dict): + """ + slot to handle when the focus parameters have been updated in the energy device + :param focus_parms_dct: + example: + {'zoneplate_def': self.zoneplate_def, + 'osa_def': self.osa_def, + 'FL': self._FL, + 'min_A0': self.min_A0, + 'A0': self.A0, + 'max_A0': self.max_A0, + 'delta_A0': self.delta_A0, + 'zpz_adjust': self.zpz_adjust, + "defocus_beam_setpoint_um": self._defocus_beam_setpoint_um, + "defocus_beam_um": self._defocus_um, + } + :return: + """ + # print(f"on_update_focus_params: focus_parms_dct={focus_parms_dct}") + if 'A0' in focus_parms_dct.keys(): + self.a0Fld.setText(f"{focus_parms_dct['A0']:.2f}") + if 'FL' in focus_parms_dct.keys(): + self.flFbkLbl.on_val_change(focus_parms_dct['FL']) + # if 'Zpz_pos' in focus_parms_dct.keys(): + # self.zpzFbkLbl.on_val_change(focus_parms_dct['Zpz_pos']) + # if 'Cz_pos' in focus_parms_dct.keys(): + # self.sampleZFbkLbl.on_val_change(focus_parms_dct['Cz_pos']) + + def on_min_a0_changed(self): + """ + handle when the min A0 field is changed + :return: + """ + val = float(self.minA0Fld.text()) + #MAIN_OBJ.update_min_a0(val) + self.energy_dev.update_min_a0(val) + def convert_section_to_dict(self, section_defs_dct): dct = {} for nm, _dct in section_defs_dct.items(): @@ -317,21 +368,15 @@ def reload(self): self.zpToolBox.setCurrentIndex(zp_idx) self.osaToolBox.setCurrentIndex(osa_idx) - def update_fl_label(self, val_dct): + def update_fl_label(self, val_dct=None): # print(f"update_fl_label: val_dct={val_dct}") - if isinstance(val_dct, dict): - if 'zpA1' in self._cur_sel_zp_def.keys(): - new_fl = focal_length(val_dct["value"], self._cur_sel_zp_def["zpA1"]) - else: - #assume its a scalar - if 'zpA1' in self._cur_sel_zp_def.keys(): - new_fl = focal_length(val_dct, self._cur_sel_zp_def["zpA1"]) - if 'zpA1' in self._cur_sel_zp_def.keys(): - self.flFbkLbl.on_val_change(new_fl) + new_fl = self.energy_dev.calculate_focal_length() + self.flFbkLbl.on_val_change(new_fl) - if MAIN_OBJ.get_device_backend() == 'zmq': - # for zmq backend we need to set the focal length on the device - MAIN_OBJ.device("DNM_FOCAL_LENGTH").set_readback(new_fl) + #ToDO: THIS MAY NOT BE NEEDED ANYMORE SINCE THE ENERGY DEVICE HANDLES IT + if MAIN_OBJ.get_device_backend() == 'zmq': + # for zmq backend we need to set the focal length on the device + MAIN_OBJ.device("DNM_FOCAL_LENGTH").set_readback(new_fl) def on_energy_fbk_changed(self, val): @@ -339,7 +384,7 @@ def on_energy_fbk_changed(self, val): def on_a0_changed(self): A0 = float(str(self.a0Fld.text())) - MAIN_OBJ.device("DNM_A0").put(A0) + self.energy_dev.update_a0(A0) self.update_zp_data() def update_zp_selection(self, zp_idx=None): @@ -353,15 +398,17 @@ def update_zp_selection(self, zp_idx=None): self.set_definition_active_by_id("ZP_DEFS", zp_idx) zp_name, zp_dct = self.get_def_by_id_num("ZP_DEFS", zp_idx) if MAIN_OBJ.get_device_backend() == 'epics' and len(zp_dct) > 0: - zp_def_pv = MAIN_OBJ.device("DNM_ZP_DEF") - # because this is a Calc field I need to put values as strings - zp_def_pv.put("CLCA", str(zp_dct["a1"])) - zp_def_pv.put("CLCB", str(zp_dct["D"])) - zp_def_pv.put("CLCC", str(zp_dct["CsD"])) - zp_def_pv.put("CLCD", str(zp_dct["OZone"])) - zp_def_pv.put("PROC", 1) + # zp_def_pv = MAIN_OBJ.device("DNM_ZP_DEF") + # # because this is a Calc field I need to put values as strings + # zp_def_pv.put("CLCA", str(zp_dct["a1"])) + # zp_def_pv.put("CLCB", str(zp_dct["D"])) + # zp_def_pv.put("CLCC", str(zp_dct["CsD"])) + # zp_def_pv.put("CLCD", str(zp_dct["OZone"])) + # zp_def_pv.put("PROC", 1) + pass self.update_zp_data() + self.update_fl_label() def update_osa_selection(self, osa_idx=None): """ @@ -373,9 +420,10 @@ def update_osa_selection(self, osa_idx=None): self.set_definition_active_by_id("OSA_DEFS", osa_idx) osa_nm, osa_dct = self.get_def_by_id_num("OSA_DEFS", osa_idx) if MAIN_OBJ.get_device_backend() == 'epics' and len(osa_dct) > 0: - osa_def_pv = MAIN_OBJ.device("DNM_OSA_DEF") - osa_def_pv.put("CLCA", str(osa_dct["D"])) - osa_def_pv.put("PROC", 1) + # osa_def_pv = MAIN_OBJ.device("DNM_OSA_DEF") + # osa_def_pv.put("CLCA", str(osa_dct["D"])) + # osa_def_pv.put("PROC", 1) + pass self.update_osa_data() def update_osa_data(self): @@ -383,8 +431,16 @@ def update_osa_data(self): self.set_section("ZP_FOCUS_PARAMS.OSA_IDX", osa_idx) osa_defs = MAIN_OBJ.get_preset_section("OSA_DEFS") + osa_keys = list(osa_defs.keys()) MAIN_OBJ.set_dcs_osa_definitions(osa_defs) + key = osa_keys[osa_idx] + if isinstance(osa_defs[key], str): + osa_dct = json.loads(osa_defs[key].replace("'", '"')) + else: + osa_dct = osa_defs[key] + self.energy_dev.set_osa_def(osa_dct) + def update_zp_data(self, update_defaults=True): """ Write ZP select @@ -405,9 +461,9 @@ def update_zp_data(self, update_defaults=True): self._cur_sel_zp_def["Zpz_pos"] = Zpz_pos = float( str(self.zpzFbkLbl.get_text()) ) - self._cur_sel_zp_def["Cz_pos"] = Cz_pos = float( - str(self.sampleZFbkLbl.get_text()) - ) + # self._cur_sel_zp_def["Cz_pos"] = Cz_pos = float( + # str(self.sampleZFbkLbl.text()) + # ) self._cur_sel_zp_def["zpD"] = zpD = float(str(zpParms_ui.zpDFld.text())) self._cur_sel_zp_def["zpCStop"] = zpCStop = float( str(zpParms_ui.zpCStopFld.text()) @@ -424,9 +480,12 @@ def update_zp_data(self, update_defaults=True): self.set_section("ZP_FOCUS_PARAMS.OSA_A0", A0) zp_defs = MAIN_OBJ.get_preset_section("ZP_DEFS") + self.energy_dev.set_zp_def(self._cur_sel_zp_def) + MAIN_OBJ.set_dcs_zoneplate_definitions(zp_defs) + def get_cur_zp_def(self): self.update_zp_data() return self._cur_sel_zp_def diff --git a/cls/applications/pyStxm/preferences/focusAndZoneplateParms/focusAndZoneplateParms.ui b/cls/applications/pyStxm/preferences/focusAndZoneplateParms/focusAndZoneplateParms.ui index af30a05c..c4468176 100755 --- a/cls/applications/pyStxm/preferences/focusAndZoneplateParms/focusAndZoneplateParms.ui +++ b/cls/applications/pyStxm/preferences/focusAndZoneplateParms/focusAndZoneplateParms.ui @@ -7,7 +7,7 @@ 0 0 615 - 387 + 464 @@ -40,7 +40,7 @@ 0 0 609 - 57 + 68 @@ -164,22 +164,25 @@ - - + + - 70 - 0 + 100 + 25 - - - 50 - false - + + + 100 + 18 + + + + QFrame::StyledPanel - A0 + 0.0 Qt::AlignCenter @@ -205,61 +208,46 @@ - - + + - 100 - 25 - - - - - 100 - 18 + 70 + 0 - - QFrame::StyledPanel + + + 50 + false + - 0.0 + A1 Qt::AlignCenter - - + + 0 25 - - - 16777215 - 18 - - - - - 75 - true - - - - QFrame::StyledPanel - - 0.0 + A0< + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - + + 70 @@ -273,29 +261,64 @@ - A1 + A0 Qt::AlignCenter - - + + 0 25 + + + 16777215 + 18 + + + + + 75 + true + + + + QFrame::StyledPanel + - A0< + 0.0 + + + + + + + Min A0 (um) Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + 0 + 0 + + + + 100.0 + + + @@ -380,7 +403,7 @@ 0 - 30 + 0 @@ -390,7 +413,7 @@ - Expected Positions for current energy + Expected Positions for SAMPLE_FOCUS at current energy Qt::AlignCenter diff --git a/cls/applications/pyStxm/stxmMain.py b/cls/applications/pyStxm/stxmMain.py index 3f049295..694a1935 100644 --- a/cls/applications/pyStxm/stxmMain.py +++ b/cls/applications/pyStxm/stxmMain.py @@ -5,6 +5,7 @@ """ import atexit +import math import os import queue import sys @@ -21,6 +22,7 @@ from plotpy.items import PolygonShape from cls.applications.pyStxm import abs_path_to_ini_file +# from cls.applications.pyStxm.bl_configs.base_scan_plugins.osa_scan.osa_scan_tester import energy_pos from cls.applications.pyStxm.main_obj_init import MAIN_OBJ from cls.applications.pyStxm.sm_user import usr_acct_manager @@ -31,6 +33,7 @@ get_module_logger, log_to_qt_and_to_file, ) + from cls.utils.environment import get_environ_var from cls.utils.json_utils import dict_to_json from cls.utils.fileUtils import get_file_path_as_parts @@ -74,7 +77,9 @@ spatial_type_prefix, sample_positioning_modes, scan_status_types, - SPEC_ROI_PREFIX + SPEC_ROI_PREFIX, + OSA_FOCUS_MODE, + SAMPLE_FOCUS_MODE ) @@ -93,17 +98,18 @@ # from cls.appWidgets.spyder_console import ShellWidget#, ShellDock from cls.appWidgets.thread_worker import Worker -# from cls.applications.pyStxm.widgets.sampleSelector import SampleSelectorWidget from cls.applications.pyStxm.widgets.motorPanel import PositionersPanel from cls.applications.pyStxm.widgets.devDisplayPanel import DevsPanel from cls.applications.pyStxm.widgets.scan_queue_table import ScanQueueTableWidget from cls.applications.pyStxm.widgets.ptycho_viewer import PtychoDataViewerPanel + +from cls.utils.focus_calculations import focal_length + from cls.types.beamline import BEAMLINE_IDS from cls.data_io.nxstxm import Serializer - # read the ini file and load the default directories appConfig = ConfigClass(abs_path_to_ini_file) scanPluginDir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "scan_plugins") @@ -599,8 +605,9 @@ def set_zp_focus_mode(self, mode=None): this function is called when the user switches to a new scan in the scans toolbox """ if MAIN_OBJ.get_beamline_id() is BEAMLINE_IDS.STXM: - zpz_scanflag = MAIN_OBJ.device("DNM_ZONEPLATE_SCAN_MODE") + zpz_scanflag = MAIN_OBJ.device("DNM_ZONEPLATE_FOCUS_MODE") zpz_scanflag.put("user_setpoint", mode) + MAIN_OBJ.set_zp_focus_mode(mode) def allow_feedback(self): if hasattr(self, "esPosPanel"): @@ -718,12 +725,11 @@ def add_to_dcs_server_window(self, clr, msg): self.dcsServerWindow.setTextColor(clr) self.dcsServerWindow.append(str(msg)) - def add_exporter_msg_to_log(self, msg_dct): + def add_exporter_msg_to_log(self, msg_str): """ from the nx_server process """ - # msg = str(msg_dct['status']) - msg = str(msg_dct) + msg = str(msg_str) clr = QtGui.QColor('#000000') if len(msg) < 50: self.add_to_log(clr, msg) @@ -842,34 +848,24 @@ def enable_energy_change(self, en): # devices = MAIN_OBJ.get_devices() # ev_en = devices['PVS'][DNM_ENERGY_ENABLE] ev_en = MAIN_OBJ.device("DNM_ENERGY_ENABLE") - zpz = MAIN_OBJ.device("DNM_ZONEPLATE_Z") - - if ev_en: - if en: - ev_en.put(1) - # enable Zoneplate Z servo - if zpz: - zpz.put("use_torque", 1) - zpz.put("disabled", 0) # GO - else: - # park energy change enabled - ev_en.put(0) - # disable Zoneplate Z servo - if zpz: - zpz.put("use_torque", 0) - zpz.put("disabled", 1) # STOP - - # def on_edit_zp_params(self): - # """ - # on_edit_zp_params(): description - # - # :returns: None - # """ - # - # #self.fpForm.show() - # self.fpForm = FocusParams(self) - # self.apply_stylesheet(self.fpForm, self.qssheet) - # self.fpForm.show() + # todo: this is a hassle during commissioning, uncomment when done commissioning + # zpz = MAIN_OBJ.device("DNM_ZONEPLATE_Z") + # + # if ev_en: + # if en: + # ev_en.put(1) + # # enable Zoneplate Z servo + # if zpz: + # zpz.put("use_torque", 1) + # zpz.put("disabled", 0) # GO + # else: + # # park energy change enabled + # ev_en.put(0) + # # disable Zoneplate Z servo + # if zpz: + # zpz.put("use_torque", 0) + # zpz.put("disabled", 1) # STOP + def on_about_pystxm(self): self.aboutForm = uic.loadUi(os.path.join(uiDir, "pyStxm_about.ui")) @@ -1067,9 +1063,107 @@ def setup_main_gui(self): # endstation positioners panel dev_obj = MAIN_OBJ.get_device_obj() exclude_list = dev_obj.get_exclude_positioners_list() + + # #beamline positioners panel + bl_posners = MAIN_OBJ.get_devices_in_category( + "POSITIONERS", pos_type="POS_TYPE_BL" + ) + energy_dev = dev_obj.device("DNM_ENERGY_DEVICE") + # overwrite the base energy motor with the actual energy device so that if the setpoint changes focus can change + bl_posners['DNM_ENERGY'] = energy_dev + + self.blPosPanel = PositionersPanel(bl_posners, exclude_list, parent=self, main_obj=MAIN_OBJ) + + # prevent Energy from being displayed int the Endstation positioners panel below + exclude_list.append('DNM_ENERGY') + + self.blPosPanel.setObjectName("blPosPanel") + # spacer = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacer = QtWidgets.QSpacerItem( + 1, 1, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding + ) + vbox4 = QtWidgets.QVBoxLayout() + vbox4.addWidget(self.blPosPanel) + vbox4.addItem(spacer) + self.beamlinePositionersFrame.setLayout(vbox4) + + # temperatures panel + temps = MAIN_OBJ.get_devices_in_category( + "TEMPERATURES", pos_type="POS_TYPE_ES" + ) + if temps: + self.esTempPanel = DevsPanel(temps, egu="deg C", parent=None) + self.esTempPanel.setObjectName("esTempPanel") + # self.esTempPanel = TemperaturesPanel(POS_TYPE_ES) + # spacer = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacer = QtWidgets.QSpacerItem( + 1, 1, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding + ) + vbox5 = QtWidgets.QVBoxLayout() + vbox5.addWidget(self.esTempPanel) + vbox5.addItem(spacer) + self.esTempsFrame.setLayout(vbox5) + # + # ES pressures panel + presrs = MAIN_OBJ.get_devices_in_category( + "PRESSURES", pos_type="POS_TYPE_ES" + ) + if presrs: + self.esPressPanel = DevsPanel( + presrs, egu="Torr", engineering_notation=True, parent=None + ) + self.esPressPanel.setObjectName("esPressPanel") + # self.esTempPanel = TemperaturesPanel(POS_TYPE_ES) + # spacer = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + spacer = QtWidgets.QSpacerItem( + 1, 1, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding + ) + vbox6 = QtWidgets.QVBoxLayout() + vbox6.addWidget(self.esPressPanel) + vbox6.addItem(spacer) + self.esPressuresFrame.setLayout(vbox6) + + # BL pressures panel + bl_presrs = MAIN_OBJ.get_devices_in_category( + "PRESSURES", pos_type="POS_TYPE_BL" + ) + #only show if there are pressure devices + if bl_presrs: + bl_presrs = self.sort_by_desc(bl_presrs) + + self.blPressPanel = DevsPanel( + bl_presrs, egu="Torr", engineering_notation=True, parent=None + ) + self.blPressPanel.setObjectName("blPressPanel") + spacer = QtWidgets.QSpacerItem( + 1, 1, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding + ) + vbox7 = QtWidgets.QVBoxLayout() + vbox7.addWidget(self.blPressPanel) + vbox7.addItem(spacer) + self.blPressuresFrame.setLayout(vbox7) + + # tools panel + # self.toolsPanel = ToolsPanel() + # spacer = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + # vbox4 = QtWidgets.QVBoxLayout() + # vbox4.addWidget(self.toolsPanel) + # vbox4.addItem(spacer) + # self.toolsPositionersFrame.setLayout(vbox4) + + # self.detectorsPanel = DetectorsPanel(self) + # spacer = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) + # vbox5 = QtWidgets.QVBoxLayout() + # vbox5.addWidget(self.detectorsPanel) + # vbox5.addItem(spacer) + # self.detectorsFrame.setLayout(vbox5) + + #### setup Endstation Panel es_posners = MAIN_OBJ.get_devices_in_category( "POSITIONERS", pos_type="POS_TYPE_ES" ) + + self.esPosPanel = PositionersPanel(es_posners, exclude_list, parent=self, main_obj=MAIN_OBJ) self.esPosPanel.setObjectName("esPosPanel") # spacer = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) @@ -1089,21 +1183,54 @@ def setup_main_gui(self): self.esPosPanel.append_widget_to_positioner_layout(hline) # add Zpz change on energy button - ev_en_dev = dev_obj.device("DNM_ENERGY_ENABLE") - if ev_en_dev: - self.esPosPanel.append_toggle_btn_device( + self.ev_en_dev = dev_obj.device("DNM_ENERGY_ENABLE", do_warn=False) + if self.ev_en_dev: + btn = self.esPosPanel.append_toggle_btn_device( " FL change with Energy ", "Enable the Focal Length (FL==Zpz stage) to move to new focal length based on Energy", - ev_en_dev, + self.ev_en_dev, off_val=0, on_val=1, - fbk_dev=ev_en_dev, + fbk_dev=self.ev_en_dev, off_str="Disabled", on_str="Enabled", + cb=self.on_enable_fl_change_with_energy ) + # set checked and text to True values + btn.make_checked(True) + + fcs_mode_dev = MAIN_OBJ.device('DNM_FOCUS_MODE', do_warn=False) + if fcs_mode_dev: + self.esPosPanel.append_combobox_device( + " Focus ", + fcs_mode_dev.desc, + fcs_mode_dev, + fcs_mode_dev.fbk_enum_strs, + fcs_mode_dev.fbk_enum_values, + cb=None + ) + + # add the Focusing Mode + self.foc_mode_dev = dev_obj.device("DNM_ZONEPLATE_FOCUS_MODE", do_warn=False) + + if self.foc_mode_dev: + btn = self.esPosPanel.append_toggle_btn_device( + " Focal length mode ", + "Toggle the focal length mode from Sample to OSA focused", + self.foc_mode_dev, + fbk_dev=self.foc_mode_dev, + off_val=0, + on_val=1, + off_str="OSA Focused", + on_str="Sample Focused", + toggle=True, + cb=self.on_change_focus_mode + ) + # set checked and text to False values fr OSA Focussed + btn.make_checked(False) # add the beam defocus device - defoc_dev = dev_obj.device("DNM_BEAM_DEFOCUS") + defoc_dev = dev_obj.device("DNM_BEAM_DEFOCUS", do_warn=False) if defoc_dev: _min = 0.0 _max = 5000 @@ -1114,11 +1241,12 @@ def setup_main_gui(self): defoc_dev, _min, _max, - prec=2 + prec=2, + cb=self.on_defocus_beam ) # add the OSA vertical tracking device - osay_track_dev = dev_obj.device("DNM_OSAY_TRACKING") + osay_track_dev = dev_obj.device("DNM_OSAY_TRACKING", do_warn=False) if osay_track_dev: self.esPosPanel.append_toggle_btn_device( " OSA vertical tracking ", @@ -1131,24 +1259,9 @@ def setup_main_gui(self): on_str="On", ) - # add the Focusing Mode - foc_mode_dev = dev_obj.device("DNM_ZONEPLATE_SCAN_MODE") - - if foc_mode_dev: - self.esPosPanel.append_toggle_btn_device( - " Focal length mode ", - "Toggle the focal length mode from Sample to OSA focused", - foc_mode_dev, - fbk_dev=foc_mode_dev, - off_val=0, - on_val=1, - off_str="OSA Focused", - on_str="Sample Focused", - toggle=True, - ) # add zonplate in/out - zp_inout_dev = dev_obj.device("DNM_ZONEPLATE_INOUT") + zp_inout_dev = dev_obj.device("DNM_ZONEPLATE_INOUT", do_warn=False) if zp_inout_dev: zp_inout_dev_fbk = dev_obj.device("DNM_ZONEPLATE_INOUT_FBK") self.esPosPanel.append_toggle_btn_device( @@ -1163,7 +1276,7 @@ def setup_main_gui(self): toggle=True, ) - osa_inout_dev = dev_obj.device("DNM_OSA_INOUT") + osa_inout_dev = dev_obj.device("DNM_OSA_INOUT", do_warn=False) if osa_inout_dev: osa_inout_dev_fbk = dev_obj.device("DNM_OSA_INOUT_FBK") self.esPosPanel.append_toggle_btn_device( @@ -1178,7 +1291,7 @@ def setup_main_gui(self): toggle=True, ) - sample_out_dev = dev_obj.device("DNM_SAMPLE_OUT") + sample_out_dev = dev_obj.device("DNM_SAMPLE_OUT", do_warn=False) if sample_out_dev: sample_out_dev_fbk = dev_obj.device("DNM_SAMPLE_OUT") self.esPosPanel.append_toggle_btn_device( @@ -1192,46 +1305,7 @@ def setup_main_gui(self): toggle=False, ) - - rset_intfer_dev = dev_obj.device("DNM_RESET_INTERFERS") - if rset_intfer_dev: - self.esPosPanel.append_toggle_btn_device( - " Reset Interferometers ", - "Reset Interferometer positions to coarse positions", - rset_intfer_dev, - off_val=0, - on_val=1, - off_str="Start", - on_str="Start", - toggle=False, - ) - - atz_sfx_dev = dev_obj.device("DNM_SFX_AUTOZERO") - if atz_sfx_dev: - self.esPosPanel.append_toggle_btn_device( - " ATZ fx ", - "AutoZero Sample Fine X", - atz_sfx_dev, - off_val=0, - on_val=1, - off_str="Start", - on_str="Stop", - toggle=False, - ) - atz_sfy_dev = dev_obj.device("DNM_SFY_AUTOZERO") - if atz_sfy_dev: - self.esPosPanel.append_toggle_btn_device( - " ATZ fy ", - "AutoZero Sample Fine Y", - atz_sfy_dev, - off_val=0, - on_val=1, - off_str="Start", - on_str="Stop", - toggle=False, - ) - - gating_dev = MAIN_OBJ.device('DNM_GATING') + gating_dev = MAIN_OBJ.device('DNM_GATING', do_warn=False) if gating_dev: self.esPosPanel.append_combobox_device( " Gating ", @@ -1242,103 +1316,26 @@ def setup_main_gui(self): cb=None ) - fcs_mode_dev = MAIN_OBJ.device('DNM_FOCUS_MODE') - if fcs_mode_dev: - self.esPosPanel.append_combobox_device( - " Focus ", - fcs_mode_dev.desc, - fcs_mode_dev, - fcs_mode_dev.fbk_enum_strs, - fcs_mode_dev.fbk_enum_values, - cb=None - ) - self.endstationPositionersFrame.setLayout(vbox3) + cb = None + if MAIN_OBJ.get_device_backend() == "epics": + cb = self.on_autozero_piezos_set_coarse_position - # #beamline positioners panel - bl_posners = MAIN_OBJ.get_devices_in_category( - "POSITIONERS", pos_type="POS_TYPE_BL" - ) - self.blPosPanel = PositionersPanel(bl_posners, parent=self, main_obj=MAIN_OBJ) - self.blPosPanel.setObjectName("blPosPanel") - # spacer = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - spacer = QtWidgets.QSpacerItem( - 1, 1, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding - ) - vbox4 = QtWidgets.QVBoxLayout() - vbox4.addWidget(self.blPosPanel) - vbox4.addItem(spacer) - self.beamlinePositionersFrame.setLayout(vbox4) - - # temperatures panel - temps = MAIN_OBJ.get_devices_in_category( - "TEMPERATURES", pos_type="POS_TYPE_ES" - ) - if temps: - self.esTempPanel = DevsPanel(temps, egu="deg C", parent=None) - self.esTempPanel.setObjectName("esTempPanel") - # self.esTempPanel = TemperaturesPanel(POS_TYPE_ES) - # spacer = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - spacer = QtWidgets.QSpacerItem( - 1, 1, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding - ) - vbox5 = QtWidgets.QVBoxLayout() - vbox5.addWidget(self.esTempPanel) - vbox5.addItem(spacer) - self.esTempsFrame.setLayout(vbox5) - # - # ES pressures panel - presrs = MAIN_OBJ.get_devices_in_category( - "PRESSURES", pos_type="POS_TYPE_ES" - ) - if presrs: - self.esPressPanel = DevsPanel( - presrs, egu="Torr", engineering_notation=True, parent=None - ) - self.esPressPanel.setObjectName("esPressPanel") - # self.esTempPanel = TemperaturesPanel(POS_TYPE_ES) - # spacer = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - spacer = QtWidgets.QSpacerItem( - 1, 1, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding - ) - vbox6 = QtWidgets.QVBoxLayout() - vbox6.addWidget(self.esPressPanel) - vbox6.addItem(spacer) - self.esPressuresFrame.setLayout(vbox6) - - # BL pressures panel - bl_presrs = MAIN_OBJ.get_devices_in_category( - "PRESSURES", pos_type="POS_TYPE_BL" - ) - #only show if there are pressure devices - if bl_presrs: - bl_presrs = self.sort_by_desc(bl_presrs) - - self.blPressPanel = DevsPanel( - bl_presrs, egu="Torr", engineering_notation=True, parent=None - ) - self.blPressPanel.setObjectName("blPressPanel") - spacer = QtWidgets.QSpacerItem( - 1, 1, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding + rset_intfer_dev = dev_obj.device("DNM_RESET_INTERFERS", do_warn=False) + if rset_intfer_dev: + self.esPosPanel.append_toggle_btn_device( + " AutoZero and Reset Interferometers ", + "Reset Interferometer positions to coarse positions", + rset_intfer_dev, + off_val=0, + on_val=1, + off_str="Start", + on_str="Start", + toggle=False, + cb=cb ) - vbox7 = QtWidgets.QVBoxLayout() - vbox7.addWidget(self.blPressPanel) - vbox7.addItem(spacer) - self.blPressuresFrame.setLayout(vbox7) - # tools panel - # self.toolsPanel = ToolsPanel() - # spacer = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - # vbox4 = QtWidgets.QVBoxLayout() - # vbox4.addWidget(self.toolsPanel) - # vbox4.addItem(spacer) - # self.toolsPositionersFrame.setLayout(vbox4) - # self.detectorsPanel = DetectorsPanel(self) - # spacer = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) - # vbox5 = QtWidgets.QVBoxLayout() - # vbox5.addWidget(self.detectorsPanel) - # vbox5.addItem(spacer) - # self.detectorsFrame.setLayout(vbox5) + self.endstationPositionersFrame.setLayout(vbox3) # self.load_dir_view() self.pythonshell = None @@ -1368,6 +1365,60 @@ def setup_main_gui(self): # self.check_if_pv_exists() + def on_autozero_piezos_set_coarse_position(self): + """ + a very specific got_to_start function for scans that involve the fine motor in the scan + """ + if MAIN_OBJ.get_device_backend() == "epics": + mtr_x = MAIN_OBJ.device("DNM_SAMPLE_X") + mtr_y = MAIN_OBJ.device("DNM_SAMPLE_Y") + + mtr_x.do_autozero() + mtr_y.do_autozero() + + mtr_x.reset_interferometers() + mtr_y.reset_interferometers() + + mtr_x.set_piezo_power_on() + mtr_y.set_piezo_power_on() + + def on_enable_fl_change_with_energy(self, chkd: bool=False): + """ + callback when the user toggles the FL change with energy button + """ + cmbo_btn = self.sender() + ev_dev = MAIN_OBJ.device('DNM_ENERGY_DEVICE') + if ev_dev: + ev_dev.enable_fl_change_with_energy_change(chkd) + if chkd: + cmbo_btn.setText(cmbo_btn.on_str) + else: + cmbo_btn.setText(cmbo_btn.off_str) + + def on_change_focus_mode(self, chkd: bool = False): + """ + change the zoneplate Z position based on the focus mode + """ + cmbo_btn = self.sender() + ev_dev = MAIN_OBJ.device('DNM_ENERGY_DEVICE') + if ev_dev: + if chkd: + ev_dev.set_focus_mode("SAMPLE") + cmbo_btn.setText(cmbo_btn.on_str) + else: + ev_dev.set_focus_mode("OSA") + cmbo_btn.setText(cmbo_btn.off_str) + + def on_defocus_beam(self): + """ + callback when the user changes the beam defocus value + """ + fld = self.sender() + val = fld.cur_val + dev = MAIN_OBJ.device('DNM_ENERGY_DEVICE') + if dev: + dev.defocus_beam(val) + def check_if_pv_exists(self): dev_obj = MAIN_OBJ.get_device_obj() psner_dct = dev_obj.devices["POSITIONERS"] @@ -1856,7 +1907,7 @@ def on_scan_loaded(self, wdg_com): scan_name = dct_get(sp_db, SPDB_SCAN_PLUGIN_SECTION_ID) self.scan_panel_idx = MAIN_OBJ.get_scan_panel_id_from_scan_name(scan_name) - # if(self.scan_panel_idx > 100):{"file": "/tmp/2025-07-22/discard/Detector_2025-07-22_001.hdf5", "scan_type_num": 0, "scan_type": "detector_image Point_by_Point", "stxm_scan_type": "detector image", "energy": [700.0], "estart": 700.0, "estop": 700.0, "e_npnts": 1, "polarization": "CircLeft", "offset": 0.0, "angle": 0.0, "dwell": 1000.0, "npoints": [75, 30], "date": "2025-07-22", "start_time": "10:22:06-06:00", "end_time": "10:22:18-06:00", "center": [0.0, 0.0], "range": [19.733333333333334, 19.333333333333332], "step": [0.2666666666666675, 0.6666666666666661], "start": [-9.866666666666667, -9.666666666666666], "stop": [9.866666666666667, 9.666666666666666], "xpositioner": "DNM_DETECTOR_X", "ypositioner": "DNM_DETECTOR_Y"} + # if(self.scan_panel_idx > 100): # self.scan_panel_idx = scan_panel_order.IMAGE_SCAN self.scanTypeStackedWidget.setCurrentIndex(self.scan_panel_idx) @@ -2126,36 +2177,21 @@ def setup_image_plot(self): min_clr = master_colors["plot_gridmaj"]["rgb_hex"] maj_clr = master_colors["plot_gridmin"]["rgb_hex"] - # gridparam = {'fg_clr':fg_clr, 'bg_clr':bg_clr, 'min_clr':min_clr, 'maj_clr':maj_clr} - - # self.lineByLineImageDataWidget = ImageWidgetPlot(parent=None, filtStr="*.hdf5", type=None, - # options = dict(lock_aspect_ratio=True, show_contrast=True, show_xsection=True, show_ysection=True, - # xlabel=("microns", ""), ylabel=("microns", ""), colormap="gist_gray")) - self.lineByLineImageDataWidget = ImageWidgetPlot( parent=None, type="analyze", - settings_fname="%s_settings.json" % MAIN_OBJ.get_endstation_prefix(), ) if hasattr(self, "lineByLineImageDataWidget"): # self.lineByLineImageDataWidget.plot.setTitle('lineByLineImageDataWidget') self.lineByLineImageDataWidget.set_lock_aspect_ratio(True) - # self.bsImagePlotWidget = ImgPlotWindow() - # vb = QtWidgets.QVBoxLayout() - # vb.addWidget(self.bsImagePlotWidget) - # self.bsImagePlotFrame.setLayout(vb) self.lineByLineImageDataWidget.setObjectName("lineByLineImageDataWidget") self.lineByLineImageDataWidget.register_osa_and_samplehldr_tool( sample_pos_mode ) - # self.lineByLineImageDataWidget.register_osa_and_samplehldr_tool(sample_pos_mode) - # self.lineByLineImageDataWidget.set_transform_factors(0.333, 0.333, 0.333, 'um') - # self.lineByLineImageDataWidget.setMinimumSize(600, 600) self.lineByLineImageDataWidget.enable_tool_by_name( "tools.clsOpenFileTool", False ) - # self.lineByLineImageDataWidget.set_sample_positioning_mode(sample_pos_mode) self.lineByLineImageDataWidget.set_dataIO(STXMDataIo) self.lineByLineImageDataWidget.addTool("DummySeparatorTool") @@ -2190,8 +2226,6 @@ def setup_image_plot(self): self.on_new_directed_beam_pos ) - # self.lineByLineImageDataWidget.create_sample_holder() - vbox = QtWidgets.QVBoxLayout() # ################ TESTING # integrate_btn = QtWidgets.QPushButton("Integrate Points") @@ -2684,6 +2718,19 @@ def init_statusbar(self): ) ) + if MAIN_OBJ.device("DNM_DELTA_A0"): + self.status_list.append( + ophyd_aiRangeLabelWidget( + MAIN_OBJ.device("DNM_DELTA_A0"), + hdrText="Delta A0", + egu="um", + title_color=status_title_color, + var_clr=status_fbk_color, + alarm=(-10000, 10000), + warn=(-9999, 9999), + ) + ) + if MAIN_OBJ.device("DNM_SFX_PIEZO_VOLTS"): self.status_list.append( ophyd_aiRangeLabelWidget( @@ -2919,7 +2966,7 @@ def add_line_to_plot(self, counter_to_plotter_com_dct): :returns: None """ - # print(f'add_line_to_plot: {counter_to_plotter_com_dct}') + # print(f'add_line_to_plot: plot_dct={counter_to_plotter_com_dct}') # return # det_id = counter_to_plotter_com_dct[CNTR2PLOT_DETID] row = int(counter_to_plotter_com_dct[CNTR2PLOT_ROW]) @@ -2957,6 +3004,7 @@ def add_line_to_plot(self, counter_to_plotter_com_dct): # added to support SLS Pixelator data = val[det_name] if (col == 0) and (row == 0): + # print(f"reset_item_data 1:[{det_name}] col == {col} & row == {row}") self.do_roi_update(det_name, prog_dct) self.lineByLineImageDataWidget.reset_item_data(det_name) self.lineByLineImageDataWidget.add_vertical_line(det_name, col, data, True) @@ -2964,7 +3012,7 @@ def add_line_to_plot(self, counter_to_plotter_com_dct): elif det_name is not None: # added to support SLS Pixelator if (col == 0) and (row == 0): - # print(f"reset_item_data: col == {col} & row == {row}") + # print(f"reset_item_data 2:[{det_name}] col == {col} & row == {row}") self.do_roi_update(det_name, prog_dct) self.lineByLineImageDataWidget.reset_item_data(det_name) data = val[det_name] @@ -2984,30 +3032,12 @@ def add_line_to_plot(self, counter_to_plotter_com_dct): update_plot = True keys = list(val.keys()) - # cur_ev = MAIN_OBJ.device("DNM_ENERGY_RBV").get_position() for det_name in keys: data = val[det_name] if row == 0: # # new image starting, have plotter emit a signal with image and rois - # plot_data = self.lineByLineImageDataWidget.get_data(det_name) - # if not np.isnan(plot_data).any(): - # dct = {} - # dct['img_idx'] = prog_dct['PROG']['CUR_IMG_IDX'] - # dct['det_name'] = det_name - # dct['plot_data'] = plot_data - # img_idx = dct['img_idx'] - 1 - # if img_idx < 0: - # img_idx = 0 - # img_idx_key = str(img_idx) - # img_dct = self.executingScan.img_idx_map[img_idx_key] - # e_idx = img_dct['e_idx'] - # cur_ev = self.executingScan.ev_setpoints[e_idx] - # #print(self.executingScan.img_idx_map) - # dct['cur_ev'] = cur_ev - # self.update_rois.emit(dct) - # emit_do_integrations = True - # # print(f"add_line_to_plot: [{img_idx}] {det_name} {plot_data.sum()} {cur_ev}") self.do_roi_update(det_name, prog_dct) + # print(f"reset_item_data 3:[{det_name}] col == {col} & row == {row}") self.lineByLineImageDataWidget.reset_item_data(det_name) self.lineByLineImageDataWidget.addLine(det_name, row, data, update_plot) @@ -3022,27 +3052,46 @@ def add_line_to_plot(self, counter_to_plotter_com_dct): def do_roi_update(self, det_name, prog_dct): """ - new image starting, have plotter emit a signal with image and rois - """ - plot_data = self.lineByLineImageDataWidget.get_data(det_name) - if not np.isnan(plot_data).any(): - dct = {} - dct['img_idx'] = prog_dct['PROG']['CUR_IMG_IDX'] - dct['det_name'] = det_name - dct['plot_data'] = plot_data - img_idx = dct['img_idx'] - 1 - if img_idx < 0: - img_idx = 0 - img_idx_key = str(img_idx) - img_dct = self.executingScan.img_idx_map[img_idx_key] - e_idx = img_dct['e_idx'] - cur_ev = self.executingScan.ev_setpoints[e_idx] - # print(self.executingScan.img_idx_map) - dct['cur_ev'] = cur_ev - self.update_rois.emit(dct) - # emit_do_integrations = True - # print(f"add_line_to_plot: [{img_idx}] {det_name} {plot_data.sum()} {cur_ev}") - self.integrate.emit() + Update the ROI data for a given detector. + + This method retrieves the current plot data for the specified detector, + checks for valid (non-NaN) data, and prepares a dictionary containing + the image index, detector name, plot data, and current energy value. + It then emits the `update_rois` signal with this dictionary and triggers + integration by emitting the `integrate` signal. + + Parameters + ---------- + det_name : str + The name of the detector for which ROI data is being updated. + prog_dct : dict + A dictionary containing scan progress information, including the current image index. + + Returns + ------- + None + """ + print(f"do_roi_update: det_name=[{det_name}] prog_dict={prog_dct}") + + # plot_data = self.lineByLineImageDataWidget.get_data(det_name) + # if not np.isnan(plot_data).any(): + # dct = {} + # dct['img_idx'] = prog_dct['PROG']['CUR_IMG_IDX'] + # dct['det_name'] = det_name + # dct['plot_data'] = plot_data + # img_idx = dct['img_idx'] - 1 + # if img_idx < 0: + # img_idx = 0 + # img_idx_key = str(img_idx) + # img_dct = self.executingScan.img_idx_map[img_idx_key] + # e_idx = img_dct['e_idx'] + # cur_ev = self.executingScan.ev_setpoints[e_idx] + # # print(self.executingScan.img_idx_map) + # dct['cur_ev'] = cur_ev + # self.update_rois.emit(dct) + # # emit_do_integrations = True + # # print(f"add_line_to_plot: [{img_idx}] {det_name} {plot_data.sum()} {cur_ev}") + # self.integrate.emit() def add_point_to_plot(self, counter_to_plotter_com_dct): @@ -3391,8 +3440,8 @@ def get_user_selected_counters(self, det_types=[detector_types.POINT], scan_clas # if its a point scan make sure to include the DNM_RING_CURRENT # only add Ring current if device exists - if MAIN_OBJ.device("DNM_RING_CURRENT"): - dets.append(MAIN_OBJ.device("DNM_RING_CURRENT").get_ophyd_device()) + # if MAIN_OBJ.device("DNM_RING_CURRENT"): + # dets.append(MAIN_OBJ.device("DNM_RING_CURRENT").get_ophyd_device()) if len(sel_dets_lst) == 0: _logger.error('No detector selected') @@ -3874,8 +3923,8 @@ def on_start_scan(self, testing=False): #scan_class.init_subscriptions(MAIN_OBJ.engine_widget, self.add_point_to_plot, dets) plotting_func = self.add_point_to_plot else: - scan_class.init_subscriptions(MAIN_OBJ.engine_widget, self.add_line_to_plot, dets) - plotting_func = self.add_point_to_plot + #scan_class.init_subscriptions(MAIN_OBJ.engine_widget, self.add_line_to_plot, dets) + plotting_func = self.add_line_to_plot if plotting_func: scan_class.init_subscriptions(MAIN_OBJ.engine_widget, plotting_func, dets) @@ -3917,7 +3966,7 @@ def on_start_scan(self, testing=False): dat_ext="hdf5", stack_dir=False, num_desired_datafiles=1, - prefix_char=main_obj.get_datafile_prefix(), + prefix_char=MAIN_OBJ.get_datafile_prefix(), dev_backend=MAIN_OBJ.get_device_backend(), ) self.assign_datafile_names_to_sp_db(sp_db, master_seq_dct[0]) @@ -4238,6 +4287,10 @@ def do_data_export(self, run_uids, datadir, is_stack_dir=False, progress_callbac data_dir = self.active_user.get_data_dir() fprefix = str(MAIN_OBJ.get_datafile_prefix()) + str( get_next_file_num_in_seq(data_dir, extension="hdf5")) + print("fprefix={fprefix}") + + if 0 in MAIN_OBJ.nx_server_master_seq_dct.keys(): + data_dir = MAIN_OBJ.nx_server_master_seq_dct[0]['data_dir'] scan_type = self.get_cur_scan_type() first_uid = run_uids[0] @@ -4248,32 +4301,41 @@ def do_data_export(self, run_uids, datadir, is_stack_dir=False, progress_callbac # we only want the information in the main # first_uid = run_uids[4] # run_uids = [first_uid] - pass + + # pass + return if scan_type in [scan_types.SAMPLE_IMAGE_STACK, scan_types.TOMOGRAPHY]: + print(f"do_data_export: scan_type = {scan_type} is in [scan_types.SAMPLE_IMAGE_STACK, scan_types.TOMOGRAPHY]") # could also just be multiple rois on a single energy + print(f"do_data_export: data_dir={data_dir} fprefix={fprefix}") data_dir = os.path.join(data_dir, fprefix) + print(f"do_data_export: final data_dir={data_dir} ") + is_stack = True if not os.path.exists(data_dir): os.makedirs(data_dir) - MAIN_OBJ.save_nx_files(run_uids, fprefix, data_dir, nx_app_def=nx_app_def, host='localhost', port='5555', + ret_msg = MAIN_OBJ.save_nx_files(run_uids, fprefix, data_dir, nx_app_def=nx_app_def, host='localhost', port='5555', verbose=False) elif scan_type in [scan_types.PTYCHOGRAPHY]: + print(f"do_data_export: scan_type = {scan_type} is in [scan_types.PTYCHOGRAPHY]") nx_app_def = "nxptycho" data_dir = self.executingScan.get_current_scan_data_dir() fprefix = data_dir.split("\\")[-1] - MAIN_OBJ.save_nx_files(run_uids, fprefix, data_dir, nx_app_def=nx_app_def, host='localhost', + ret_msg = MAIN_OBJ.save_nx_files(run_uids, fprefix, data_dir, nx_app_def=nx_app_def, host='localhost', port='5555', verbose=False) return # elif(scan_type is scan_types.SAMPLE_POINT_SPECTRUM): elif scan_type in spectra_type_scans: - MAIN_OBJ.save_nx_files(run_uids, fprefix, data_dir, nx_app_def=nx_app_def, host='localhost', port='5555', + print(f"do_data_export: scan_type = {scan_type} is in spectra_type_scans") + ret_msg = MAIN_OBJ.save_nx_files(run_uids, fprefix, data_dir, nx_app_def=nx_app_def, host='localhost', port='5555', verbose=False) else: - MAIN_OBJ.save_nx_files(run_uids, fprefix, data_dir, nx_app_def=nx_app_def, host='localhost', port='5555', + print(f"do_data_export: scan_type = {scan_type} in CATCH ALL else block") + ret_msg = MAIN_OBJ.save_nx_files(run_uids, fprefix, data_dir, nx_app_def=nx_app_def, host='localhost', port='5555', verbose=False) if self.validate_saved_files["doit"]: @@ -4286,6 +4348,13 @@ def do_data_export(self, run_uids, datadir, is_stack_dir=False, progress_callbac # # Execute self._threadpool.start(worker) + if isinstance(ret_msg, str): + if ret_msg.find('nxstxm:') > -1: + lines = ret_msg.split("nxstxm:") + _logger.info(lines[-1]) + else: + _logger.info(ret_msg) + def get_counter_from_table(self, tbl, prime_cntr): for k in list(tbl.keys()): if k.find(prime_cntr) > -1: @@ -4584,10 +4653,7 @@ def on_image_start(self, wdg_com=None, sp_id=None, det_id=0): scan_type = dct_get(sp_db, SPDB_SCAN_PLUGIN_TYPE) if self.executingScan.image_started == False: - if scan_type == scan_types.SAMPLE_FOCUS: - self.lineByLineImageDataWidget.set_autoscale(fill_plot_window=True) - - elif scan_type == scan_types.OSA_FOCUS: + if scan_type in [scan_types.SAMPLE_FOCUS, scan_types.OSA_FOCUS]: self.lineByLineImageDataWidget.set_autoscale(fill_plot_window=True) elif scan_type == scan_types.SAMPLE_LINE_SPECTRUM: diff --git a/cls/applications/pyStxm/version.json b/cls/applications/pyStxm/version.json deleted file mode 100644 index 6c6e199e..00000000 --- a/cls/applications/pyStxm/version.json +++ /dev/null @@ -1 +0,0 @@ -"{\n \"auth\": \"Russ Berg\",\n \"commit\": \"b4dd585e844e2e35faa4fb084de380c9c4022f34\",\n \"commited_by\": \"bergr \",\n \"date\": \" Fri Jul 4 12:01:20 2025 -0600\",\n \"major_ver\": \"3\",\n \"minor_ver\": \"0\",\n \"ver\": \"3.0\",\n \"ver_str\": \"Version 3.0\"\n}" \ No newline at end of file diff --git a/cls/applications/pyStxm/widgets/dict_based_contact_sheet/contact_sheet.py b/cls/applications/pyStxm/widgets/dict_based_contact_sheet/contact_sheet.py index b88418d5..c7ba7939 100644 --- a/cls/applications/pyStxm/widgets/dict_based_contact_sheet/contact_sheet.py +++ b/cls/applications/pyStxm/widgets/dict_based_contact_sheet/contact_sheet.py @@ -33,7 +33,11 @@ _logger = get_module_logger(__name__) -class ThumbnailSceneManager: +MAX_DIRNAME_LENGTH = 70 + + +class ThumbnailSceneManager(QtCore.QObject): + def __init__(self, image_graphics_view, spec_graphics_view): self.image_graphics_view = image_graphics_view self.spec_graphics_view = spec_graphics_view @@ -41,6 +45,10 @@ def __init__(self, image_graphics_view, spec_graphics_view): self.history = [] # Browser-like history of directories self.current_index = -1 + def scene_exists(self, directory): + """Check if a scene for the given directory exists.""" + return directory in self.scenes.keys() + def get_current_scene_directory(self): """Return the current scene's directory or None if no scenes exist.""" if self.current_index >= 0 and self.current_index < len(self.history): @@ -119,12 +127,14 @@ class ContactSheet(QtWidgets.QWidget): def __init__(self, main_obj=None, data_dir=None, data_io=None, base_data_dir='/tmp', parent=None): super(ContactSheet, self).__init__(parent) - - self.dir_sel_wdg = RemoteDirectorySelectorWidget(main_obj, base_data_dir, data_dir) + self.data_dir = data_dir + self.base_data_dir = base_data_dir + data_dir_display_name = self.get_directory_display_name(self.data_dir) + self.dir_sel_wdg = RemoteDirectorySelectorWidget(main_obj, base_data_dir, self.data_dir) self.dir_sel_wdg.create_scenes.connect(self.create_new_scenes) self.dir_sel_wdg.loading_data.connect(self.on_loading_data) + self.dir_sel_wdg.new_data_dir.connect(self.on_new_data_dir) - self.data_dir = data_dir self.image_win = self.create_image_viewer() self.spec_win = self.create_spectra_viewer() self.ptnw = PrintSTXMThumbnailWidget() @@ -134,11 +144,15 @@ def __init__(self, main_obj=None, data_dir=None, data_io=None, base_data_dir='/t # Directory label self.dir_label = QtWidgets.QLabel(self.data_dir) - self.dir_label.setAlignment(QtCore.Qt.AlignRight) - self.dir_label.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Preferred) - self.dir_label.setFixedWidth(680) # Set to desired width - self.dir_label.setStyleSheet("background-color: #555555; color: #FFFFFF;") - main_layout.addWidget(self.dir_label) + + self.dir_combo_box = QtWidgets.QComboBox() + self.dir_combo_box.setEditable(False) + self.dir_combo_box.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred) + # self.dir_combo_box.setStyleSheet("background-color: #555555; color: #FFFFFF;") + self.dir_combo_box.addItem(data_dir_display_name) + self.dir_combo_box.setCurrentIndex(0) + self.dir_combo_box.currentIndexChanged.connect(self.on_combo_sel_changed) + main_layout.addWidget(self.dir_combo_box) # Toolbar layout with buttons toolbar_layout = QtWidgets.QHBoxLayout() @@ -157,12 +171,12 @@ def __init__(self, main_obj=None, data_dir=None, data_io=None, base_data_dir='/t QtWidgets.QSizePolicy.Minimum)) # Change directory button - self.changeDirBtn = QtWidgets.QToolButton() - self.changeDirBtn.setToolTip("Change Directory") - self.changeDirBtn.setIcon(self.style().standardIcon(QtWidgets.QStyle.SP_DirIcon)) - self.changeDirBtn.setIconSize(QtCore.QSize(ICONSIZE, ICONSIZE)) - self.changeDirBtn.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly) - toolbar_layout.addWidget(self.changeDirBtn) + self.loadDirBtn = QtWidgets.QToolButton() + self.loadDirBtn.setToolTip("Load a Directory") + self.loadDirBtn.setIcon(self.style().standardIcon(QtWidgets.QStyle.SP_DirIcon)) + self.loadDirBtn.setIconSize(QtCore.QSize(ICONSIZE, ICONSIZE)) + self.loadDirBtn.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly) + toolbar_layout.addWidget(self.loadDirBtn) main_layout.addLayout(toolbar_layout) @@ -188,7 +202,8 @@ def __init__(self, main_obj=None, data_dir=None, data_io=None, base_data_dir='/t self.tab_widget.addTab(spectra_tab, "Spectra") self._scene_mgr = ThumbnailSceneManager(self.images_view, self.spectra_view) - self.images_scene, self.spectra_scene = self._scene_mgr.create_scenes(self.data_dir) + # the scenes are kept in a dict using the shortened directory name as the key + self.images_scene, self.spectra_scene = self._scene_mgr.create_scenes(data_dir_display_name) nav_layout = QtWidgets.QHBoxLayout() @@ -198,7 +213,7 @@ def __init__(self, main_obj=None, data_dir=None, data_io=None, base_data_dir='/t self.backBtn.setIcon(self.style().standardIcon(QtWidgets.QStyle.SP_ArrowBack)) self.backBtn.setIconSize(QtCore.QSize(ICONSIZE, ICONSIZE)) self.backBtn.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly) - nav_layout.addWidget(self.backBtn) + # nav_layout.addWidget(self.backBtn) nav_layout.addWidget(self.tab_widget) @@ -208,24 +223,48 @@ def __init__(self, main_obj=None, data_dir=None, data_io=None, base_data_dir='/t self.forwardBtn.setIcon(self.style().standardIcon(QtWidgets.QStyle.SP_ArrowForward)) self.forwardBtn.setIconSize(QtCore.QSize(ICONSIZE, ICONSIZE)) self.forwardBtn.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly) - nav_layout.addWidget(self.forwardBtn) + # nav_layout.addWidget(self.forwardBtn) main_layout.addLayout(nav_layout) # Connect signals - # self.backBtn.clicked.connect(lambda: self.navigate_scene(-1)) - # self.forwardBtn.clicked.connect(lambda: self.navigate_scene(1)) + self.backBtn.clicked.connect(lambda: self.navigate_scene(-1)) + self.forwardBtn.clicked.connect(lambda: self.navigate_scene(1)) self.backBtn.clicked.connect(self.navigate_scene) self.forwardBtn.clicked.connect(self.navigate_scene) # Connect signals self.reloadBtn.clicked.connect(self.on_reload_clicked) - self.changeDirBtn.clicked.connect(self.on_change_dir_clicked) + self.loadDirBtn.clicked.connect(self.on_change_dir_clicked) # Set window properties self.setWindowTitle("Contact Sheet Viewer") self.resize(800, 600) + def on_new_data_dir(self, directory: str): + """ + when a new data directory is selected in the directory selector widget + """ + if directory != self.base_data_dir: + # skip the base data directory + self.add_directory_to_combo(directory) + + + def on_combo_sel_changed(self, idx: int): + """ + when a user selects a different directory from the combo box load that scene + """ + dir_name = self.dir_combo_box.itemText(idx) + if self._scene_mgr.scene_exists(dir_name): + result = self._scene_mgr.switch_to_scene(dir_name) + if result: + self.set_directory_label(dir_name) + # Update navigation buttons + self.backBtn.setEnabled(self._scene_mgr.current_index > 0) + last_dir = self._scene_mgr.get_last_scene_directory() + self.forwardBtn.setEnabled(dir_name != self._scene_mgr.scenes[last_dir]) + + def navigate_scene(self): """ a slot to navigate between scenes @@ -290,9 +329,15 @@ def create_spectra_viewer(self): return spectra_win def set_drag_enabled(self, val): + """ + set whether drag is enabled + """ self.drag_enabled = val def get_drag_enabled(self): + """ + return whether drag is enabled + """ return self.drag_enabled def create_folder_thumbnail(self): @@ -314,7 +359,7 @@ def create_new_scenes(self, directory, force_new=True): if directory is None or directory == "": _logger.warning("on_create_new_scenes: directory cannot be None or empty") return - + directory = self.get_directory_display_name(directory) self.images_scene, self.spectra_scene = self._scene_mgr.create_scenes(directory, force_new=force_new) self.set_directory_label(directory) @@ -323,6 +368,10 @@ def on_reload_clicked(self): signal handler for when the refresh button is clicked. """ self.dir_sel_wdg.data_dir = self._scene_mgr.get_current_scene_directory() + if self.dir_sel_wdg.data_dir.find(".hdf5") > -1: + # skip reloading stacks as it requires the original thumbnail widget, maybe be implmented later + return + self.create_new_scenes(self.dir_sel_wdg.data_dir, force_new=True) # Reload the directory and change the mouse cursor while reloading @@ -338,11 +387,13 @@ def create_thumbnail_from_h5_file_dct(self, h5_file_dct: dict) -> None: _scan_type = h5_file_dct[h5_file_dct['default']]['sp_db_dct']['pystxm_enum_scan_type'] is_folder = False + is_stack = False if _scan_type == scan_types.SAMPLE_IMAGE_STACK: # so that it can be identified as a stack is_folder = True + is_stack = True # h5_file_dct['entry1']['sp_db_dct']['file_path'] - thumbnail = create_thumbnail(h5_file_dct, is_folder=is_folder) + thumbnail = create_thumbnail(h5_file_dct, is_folder=is_folder, is_stack=is_stack) if thumbnail is None: return @@ -355,7 +406,6 @@ def create_thumbnail_from_h5_file_dct(self, h5_file_dct: dict) -> None: if thumbnail.draggable: thumbnail.drag.connect(self.on_drag) - if _scan_type in spectra_type_scans: scene = self.spectra_scene self.spectra_thumbs.append(thumbnail) @@ -375,57 +425,64 @@ def create_thumbnail_from_h5_file_dct(self, h5_file_dct: dict) -> None: scene.addItem(thumbnail) self.update_scene_layout() - def create_stack_thumbnails_from_thumbwidget(self, thumb: ThumbnailWidget) -> None: + def create_stack_thumbnails_from_thumbwidget(self, thumb: ThumbnailWidget) -> None: """ - Take a data_dct and create a thumbnail widget from it, adding it to the bottom of the scene. + Create and add thumbnails to the scene in the order of energy values. """ + import timeit + if thumb is None: _logger.warning("create_stack_thumbnails_from_thumbwidget: thumb cannot be None") return - self.image_thumbs = [] energies = thumb.h5_file_dct[thumb.h5_file_dct['default']]['sp_db_dct']['energy'] entry_key = thumb.h5_file_dct['default'] entry_dct = thumb.h5_file_dct[entry_key] sp_db_dct = entry_dct['sp_db_dct'] sp_key = list(entry_dct['WDG_COM']['SPATIAL_ROIS'].keys())[0] sp_db = entry_dct['WDG_COM']['SPATIAL_ROIS'][sp_key] - num_ev_rois = len(sp_db[EV_ROIS]) - data_idx = 0 - for ev_idx in range(num_ev_rois): - for ev_pnt in range(len(sp_db[EV_ROIS][ev_idx][SETPOINTS])): + total_points = sum(len(sp_db[EV_ROIS][ev_idx][SETPOINTS]) for ev_idx in range(num_ev_rois)) + data_index = total_points -1 + # load the stack in reverse so that it is displayed in ascending order of energy from top to bottom + for ev_idx in reversed(range(num_ev_rois)): + num_setpoints = len(sp_db[EV_ROIS][ev_idx][SETPOINTS]) + for ev_pnt in reversed(range(num_setpoints)): e_pnt = sp_db[EV_ROIS][ev_idx][SETPOINTS][ev_pnt] - data = thumb.data[data_idx] - thumbnail = create_thumbnail(thumb.h5_file_dct, data=data, energy=e_pnt, ev_idx=ev_idx, ev_pnt=ev_pnt, - pol_idx=0, stack_idx=0) + if data_index > -1: + data = thumb.data[data_index] + else: + _logger.error("create_stack_thumbnails_from_thumbwidget: data_index out of range: < -1") + return + thumbnail = create_thumbnail( + thumb.h5_file_dct, data=data, energy=e_pnt, ev_idx=ev_idx, ev_pnt=ev_pnt, + pol_idx=0, stack_idx=0 + ) + if thumbnail is None: _logger.warning("create_stack_thumbnails_from_thumbwidget: thumbnail creation failed") continue if thumbnail.is_valid(): thumbnail.select.connect(self.do_select) thumbnail.launch_viewer.connect(self.launch_viewer) - #thumbnail.print_thumb.connect(self.print_thumbnail) - #thumbnail.preview_thumb.connect(self.preview_thumbnail) - #thumbnail.dbl_clicked.connect(self.on_thumbnail_dblclicked) - #if thumbnail.draggable: - # thumbnail.drag.connect(self.on_drag) - - self.image_thumbs.insert(0, thumbnail) - data_idx += 1 - - for item in self.image_thumbs: - # Find the bottom-most y position - items = [item for item in self.images_scene.items() if isinstance(item, QtWidgets.QGraphicsWidget)] - items = sorted(items, key=lambda item: item.pos().y()) - if items: - max_y = max(item.pos().y() + item.boundingRect().height() for item in items) - else: - max_y = 0 - item.setPos(0, max_y + 10) # 10 px margin - self.images_scene.addItem(item) - self.update_scene_layout() + # Find the bottom-most y position for each new thumbnail + items = [item for item in self.images_scene.items() if isinstance(item, QtWidgets.QGraphicsWidget)] + items = sorted(items, key=lambda item: item.pos().y()) + if items: + max_y = max(item.pos().y() + item.boundingRect().height() for item in items) + else: + max_y = 0 + thumbnail.setPos(0, max_y + 10) # 10 px margin + self.images_scene.addItem(thumbnail) + + data_index -= 1 + self.update_scene_layout() + + # call this every 5 thumbnails to keep the UI responsive + if ev_pnt % 5 == 0: + QtWidgets.QApplication.processEvents() + self.on_loading_data(True) def on_thumbnail_dblclicked(self, thumb: ThumbnailWidget) -> None: @@ -434,13 +491,37 @@ def on_thumbnail_dblclicked(self, thumb: ThumbnailWidget) -> None: """ if thumb.scan_type == scan_types.SAMPLE_IMAGE_STACK: # grab current scene - filename = os.path.join(thumb.directory, thumb.filename) - result = self._scene_mgr.switch_to_scene(filename) + path_name = os.path.join(thumb.directory, thumb.filename) + display_name = self.get_directory_display_name(path_name) + result = self._scene_mgr.switch_to_scene(display_name) if not result: - self.images_scene, self.spectra_scene = self._scene_mgr.create_scenes(filename) - self.set_directory_label(filename) + self.images_scene, self.spectra_scene = self._scene_mgr.create_scenes(display_name) + self.set_directory_label(display_name) self.on_loading_data(False) self.create_stack_thumbnails_from_thumbwidget(thumb) + self.add_directory_to_combo(path_name) + self.dir_combo_box.setCurrentText(display_name) + self.dir_combo_box.setToolTip(f"Full path:\n {str(path_name)}") + + def get_directory_display_name(self, path_name: str) -> str: + """ + get_directory_display_name(): the display name only has so many characters, this function standardizes the + path names that will be displayed in the directory combo box + """ + #return path_name[-MAX_DIRNAME_LENGTH:] if len(path_name) > MAX_DIRNAME_LENGTH else path_name + return path_name + + def add_directory_to_combo(self, path_name: str) -> None: + """ + add_directory_to_combo(): adds a new directory name to the combo box if its not already present + """ + display_name = self.get_directory_display_name(path_name) + items = [self.dir_combo_box.itemText(i) for i in range(self.dir_combo_box.count())] + if display_name not in items: + # self.dir_combo_box.addItem(str(filename)) + self.dir_combo_box.addItem(str(display_name)) + self.dir_combo_box.setCurrentText(display_name) + self.dir_combo_box.setToolTip(path_name) def update_scene_layout(self): """ @@ -489,6 +570,10 @@ def on_drag(self, obj: ThumbnailWidget, event: QtWidgets.QGraphicsSceneDragDropE :returns: None """ + import orjson + import timeit + + print("on_drag: Entered.") event.accept() if self.get_drag_enabled(): @@ -501,25 +586,59 @@ def on_drag(self, obj: ThumbnailWidget, event: QtWidgets.QGraphicsSceneDragDropE else: format = "application/dict-based-imageplot-stxmscan" dct = obj.get_standard_image_launch_viewer_dct() - - jstr = json.dumps(convert_numpy_to_python(dct), cls=NumpyAwareJSONEncoder) + print("\n") + start = timeit.default_timer() + #jstr = json.dumps(convert_numpy_to_python(dct), cls=NumpyAwareJSONEncoder) + py_dict = convert_numpy_to_python(dct) + end = timeit.default_timer() + print(f"\tconvert_numpy_to_python: Elapsed: {end - start} seconds") + + start = timeit.default_timer() + jstr_bytes = orjson.dumps(py_dict) + end = timeit.default_timer() + print(f"\torjson.dumps: Elapsed: {end - start} seconds") itemData = QtCore.QByteArray() dataStream = QtCore.QDataStream(itemData, QtCore.QIODevice.WriteOnly) + + start = timeit.default_timer() + if obj.is_stack: + # if its a stack we only need 1 images worth of data + print("\ton_drag: Stack detected, using first image data only.") + #data_bytes = obj.data[0].tobytes() + data_bytes = b'' + else: + print("\ton_drag: Single image detected, using full data.") + data_bytes = obj.data.tobytes() + end = timeit.default_timer() + print(f"\ttobytes(): Elapsed: {end - start} seconds") + + start = timeit.default_timer() ( - dataStream - << QtCore.QByteArray(bytearray(jstr.encode())) - << QtCore.QByteArray(obj.data.tobytes()) - << (event.pos() - obj.rect().topLeft()) + dataStream + << QtCore.QByteArray(bytearray(jstr_bytes)) + << QtCore.QByteArray(data_bytes) + << (event.pos() - obj.rect().topLeft()) ) + end = timeit.default_timer() + print(f"\tdataStream << << << : Elapsed: {end - start} seconds") + + start = timeit.default_timer() mimeData = QtCore.QMimeData() mimeData.setData(format, itemData) mimeData.setText(obj.info_jstr) + end = timeit.default_timer() + print(f"\tmimeData : Elapsed: {end - start} seconds") + start = timeit.default_timer() drag = QtGui.QDrag(self) drag.setMimeData(mimeData) pos = event.pos() - obj.rect().topLeft() drag.setHotSpot(QtCore.QPoint(int(pos.x()), int(pos.y()))) + + end = timeit.default_timer() + print(f"\tdrag.setHotSpot : Elapsed: {end - start} seconds") + if obj.pixmap is not None: drag.setPixmap(obj.pixmap) @@ -532,6 +651,7 @@ def on_drag(self, obj: ThumbnailWidget, event: QtWidgets.QGraphicsSceneDragDropE pass else: pass + print("on_drag: Leaving.") def resizeEvent(self, event): super().resizeEvent(event) diff --git a/cls/applications/pyStxm/widgets/dict_based_contact_sheet/remote_directory_selector_mgr.py b/cls/applications/pyStxm/widgets/dict_based_contact_sheet/remote_directory_selector_mgr.py index 40904b7d..a67c11d3 100644 --- a/cls/applications/pyStxm/widgets/dict_based_contact_sheet/remote_directory_selector_mgr.py +++ b/cls/applications/pyStxm/widgets/dict_based_contact_sheet/remote_directory_selector_mgr.py @@ -34,9 +34,9 @@ def __init__(self, main_obj, base_data_dir, data_dir): self.dir_label = QtWidgets.QLabel(data_dir) self.layout.addWidget(self.dir_label) - self.subdir_list = QtWidgets.QListWidget() - self.subdir_list.itemClicked.connect(self.on_subdir_selected) - self.layout.addWidget(self.subdir_list) + self.subdir_list_wdg = QtWidgets.QListWidget() + self.subdir_list_wdg.itemClicked.connect(self.on_subdir_selected) + self.layout.addWidget(self.subdir_list_wdg) if self.main_obj: sub_dirs = self.main_obj.request_data_dir_list(base_dir=self.data_dir) @@ -86,11 +86,12 @@ def list_subdirectories(self, sub_dirs=None): Args: sub_dirs: List of subdirectory names to display. """ - self.subdir_list.clear() + self.subdir_list_wdg.clear() items = ['..'] if sub_dirs: items += [f"{d['sub_dir']} \t({d['num_h5_files']} h5 files)" for d in sub_dirs] - self.subdir_list.addItems(items) + items.sort() + self.subdir_list_wdg.addItems(items) def on_subdir_selected(self, selected): """ @@ -101,29 +102,38 @@ def on_subdir_selected(self, selected): """ do_hide = True if selected: + sel_txt = selected.text() subdir_name = selected.text().split('\t')[0].strip() - if subdir_name == '..': - # if self.data_dir == self.base_data_dir: - # # if we are at the base directory, request the subdirs from the main_obj - # # this is to avoid an infinite loop of going up to the base dir - # return + if subdir_name == '..' or sel_txt.find("(0 h5 files)") > -1: - new_data_dir = os.path.dirname(self.data_dir) + #_new_data_dir = os.path.dirname(self.data_dir) + if subdir_name == '..': + _new_data_dir = os.path.dirname(self.data_dir) + else: + _new_data_dir = os.path.join(self.data_dir, subdir_name) do_hide = False - self.subdir_list.clear() - sub_dirs = self.main_obj.request_data_dir_list(base_dir=new_data_dir) + self.subdir_list_wdg.clear() + sub_dirs = self.main_obj.request_data_dir_list(base_dir=_new_data_dir) self.list_subdirectories(sub_dirs) - self.update_data_dir(new_data_dir) + self.update_data_dir(_new_data_dir) + elif sel_txt.find("h5 files") > -1: + #_new_data_dir = os.path.dirname(self.data_dir) + _new_data_dir = os.path.join(self.data_dir, subdir_name) + do_hide = True + self.subdir_list_wdg.clear() + sub_dirs = self.main_obj.request_data_dir_list(base_dir=_new_data_dir) + self.list_subdirectories(sub_dirs) + self.update_data_dir(_new_data_dir) else: - new_data_dir = os.path.join(self.data_dir, subdir_name) + _new_data_dir = os.path.join(self.data_dir, subdir_name) if do_hide: # request that the image and spec graphic scenes be cleared - self.create_scenes.emit(new_data_dir) + self.create_scenes.emit(_new_data_dir) - self.reload_directory(new_data_dir) - self.update_data_dir(new_data_dir) + self.reload_directory(_new_data_dir) + self.update_data_dir(_new_data_dir) # update the current list of sub dirs sub_dirs = self.main_obj.request_data_dir_list(base_dir=self.data_dir) diff --git a/cls/applications/pyStxm/widgets/dict_based_contact_sheet/thumbnail_create.py b/cls/applications/pyStxm/widgets/dict_based_contact_sheet/thumbnail_create.py index 571ab4c5..c4d17845 100644 --- a/cls/applications/pyStxm/widgets/dict_based_contact_sheet/thumbnail_create.py +++ b/cls/applications/pyStxm/widgets/dict_based_contact_sheet/thumbnail_create.py @@ -5,7 +5,8 @@ from cls.applications.pyStxm.widgets.dict_based_contact_sheet.thumbnail_widget import ThumbnailWidget from cls.utils.fileUtils import get_file_path_as_parts -def create_thumbnail(h5_file_dct, is_folder=False, data=None, energy=None, ev_idx=0, ev_pnt=0, pol_idx=0, stack_idx=None): +def create_thumbnail(h5_file_dct, is_folder=False, data=None, energy=None, ev_idx=0, ev_pnt=0, pol_idx=0, stack_idx=None, + is_stack=False): """ Create a thumbnail QGraphicsWidget from sp_db_dict data @@ -19,10 +20,12 @@ def create_thumbnail(h5_file_dct, is_folder=False, data=None, energy=None, ev_id data_dir, fprefix, fsuffix = get_file_path_as_parts(file_path) if stack_idx is None: - th_wdg = ThumbnailWidget(h5_file_dct, fprefix + fsuffix, is_folder=is_folder, data=data, energy=energy) + th_wdg = ThumbnailWidget(h5_file_dct, fprefix + fsuffix, is_folder=is_folder, data=data, energy=energy, + is_stack=is_stack) else: # change the filename sp that in the location of the filename the energy value of this stack widget is shown - th_wdg = ThumbnailWidget(h5_file_dct, f'{energy:.2f} eV', is_folder=is_folder, data=data, energy=energy) + th_wdg = ThumbnailWidget(h5_file_dct, f'{energy:.2f} eV', is_folder=is_folder, data=data, energy=energy, + is_stack=is_stack) if th_wdg.valid_file: s, jstr = dict_based_build_image_params(h5_file_dct, energy=energy, ev_idx=ev_idx, ev_pnt=ev_pnt, pol_idx=pol_idx, diff --git a/cls/applications/pyStxm/widgets/dict_based_contact_sheet/thumbnail_widget.py b/cls/applications/pyStxm/widgets/dict_based_contact_sheet/thumbnail_widget.py index 769a3873..1a1baab0 100644 --- a/cls/applications/pyStxm/widgets/dict_based_contact_sheet/thumbnail_widget.py +++ b/cls/applications/pyStxm/widgets/dict_based_contact_sheet/thumbnail_widget.py @@ -23,6 +23,7 @@ from cls.utils.log import get_module_logger import cls.applications.pyStxm.widgets.dict_based_contact_sheet.utils as utils +FILENAME_FONT_SIZE = 9 _logger = get_module_logger(__name__) @@ -36,9 +37,11 @@ class ThumbnailWidget(QtWidgets.QGraphicsWidget): update_view = QtCore.pyqtSignal() select = QtCore.pyqtSignal(object) - def __init__(self, h5_file_dct, filename, is_folder=False, data=None, energy=None, parent=None): + def __init__(self, h5_file_dct, filename, is_folder=False, data=None, energy=None, is_stack=False, parent=None): super().__init__(parent) + self.is_stack = is_stack self.h5_file_dct = h5_file_dct + self.filename = filename self.sp_db_dct = utils.get_sp_db_dct_from_h5_file_dct(h5_file_dct) if self.sp_db_dct is None: @@ -87,6 +90,23 @@ def __init__(self, h5_file_dct, filename, is_folder=False, data=None, energy=Non self.sp_db_dct = self.entry_dct.get('sp_db_dct', {}) self.scan_type = self.sp_db_dct.get('pystxm_enum_scan_type', 'Unknown') + if is_stack: + # create a draggable h5_file_dct for stacks + self.drag_h5_file_dct = {} + ekey = utils.get_first_entry_key(h5_file_dct) + self.drag_h5_file_dct['default'] = ekey + self.drag_h5_file_dct[ekey] = {} + self.drag_h5_file_dct[ekey]['WDG_COM'] = h5_file_dct[ekey]['WDG_COM'] + self.drag_h5_file_dct[ekey]['sp_db_dct'] = {} + skip_lst = ['nxdata'] + for k in h5_file_dct[ekey]['sp_db_dct'].keys(): + if k in skip_lst: + continue + self.drag_h5_file_dct[ekey]['sp_db_dct'][k] = h5_file_dct[ekey]['sp_db_dct'][k] + + self.drag_h5_file_dct[ekey]['sp_db_dct']['nxdata'] = {} + #self.drag_h5_file_dct[ekey]['sp_db_dct']['nxdata'][self.default_counter] = self.counter_data[0] + self.drag_h5_file_dct[ekey]['sp_db_dct']['nxdata'][self.default_counter] = None if self.scan_type in focus_scans: self.draggable = False @@ -293,7 +313,11 @@ def get_standard_image_launch_viewer_dct(self): dct["stack_index"] = stack_index dct["path"] = self.filepath dct["sp_db"] = sp_db - dct["h5_file_dct"] = self.h5_file_dct + if self.is_stack: + dct["h5_file_dct"] = self.drag_h5_file_dct + else: + dct["h5_file_dct"] = self.h5_file_dct + dct['scan_type_str'] = dct_get(sp_db, roi_defs.SPDB_SCAN_PLUGIN_SECTION_ID) dct["scan_type"] = self.scan_type dct["xlabel"] = dct_get(sp_db, roi_defs.SPDB_XPOSITIONER) @@ -620,6 +644,13 @@ def boundingRect(self): return QtCore.QRectF(0, 0, utils.THUMB_WIDTH, utils.THUMB_HEIGHT) def paint(self, painter, option, widget): + # Draw data image with minimal margins + if self.pixmap is None: + e_str = "self.pixmap is None in paint()" + print(e_str) + _logger.error(e_str) + return + # Draw border if self.is_selected: #print(f"ThumbnailWidget: {self.filename} is selected") @@ -640,19 +671,13 @@ def paint(self, painter, option, widget): # Set font for text painter.setPen(QtCore.Qt.black) font = painter.font() - font.setPointSize(6) + font.setPointSize(FILENAME_FONT_SIZE) painter.setFont(font) # Reserve minimal space for text text_height = 16 # Height for text line spacing = 2 # Small spacing between elements - # Draw data image with minimal margins - if self.pixmap is None: - e_str = "self.pixmap is None in paint()" - print(e_str) - _logger.error(e_str) - return img_x = int((utils.THUMB_WIDTH - self.pixmap.width()) / 2) img_y = spacing # Very small top margin painter.drawPixmap(img_x, img_y, self.pixmap) diff --git a/cls/applications/pyStxm/widgets/motorPanel.py b/cls/applications/pyStxm/widgets/motorPanel.py index b4e6e17b..6941b350 100644 --- a/cls/applications/pyStxm/widgets/motorPanel.py +++ b/cls/applications/pyStxm/widgets/motorPanel.py @@ -346,7 +346,7 @@ def update_combobox_selection(self, mtr): def append_widget_to_positioner_layout(self, widg): self.vbox.addWidget(widg) - def append_setpoint_device(self, name, desc, units, dev, _min, _max, prec=0, min_mtrfld_nm_width=MIN_MTR_FLD_NM_WIDTH): + def append_setpoint_device(self, name, desc, units, dev, _min, _max, prec=0, cb=None, min_mtrfld_nm_width=MIN_MTR_FLD_NM_WIDTH): widg = QtWidgets.QWidget() dev_ui = sp_small() dev_ui.setupUi(widg) @@ -368,7 +368,11 @@ def append_setpoint_device(self, name, desc, units, dev, _min, _max, prec=0, min dev.get_name(), _min, _max, prec, parent=dev_ui.setPosFld ) # dev_ui.setPosFld.dpo.valid_returnPressed.connect(on_changed_cb) - dev_ui.setPosFld.dpo.valid_returnPressed.connect(self.on_setpoint_dev_changed) + # if the user passed a callback call it when return is pressed instead of the default handler + if cb: + dev_ui.setPosFld.dpo.valid_returnPressed.connect(cb) + else: + dev_ui.setPosFld.dpo.valid_returnPressed.connect(self.on_setpoint_dev_changed) self.mtr_dict[dev.get_name()] = {"dev": dev, "dev_ui": dev_ui} @@ -435,6 +439,8 @@ def append_toggle_btn_device( toggle=True, min_mtrfld_nm_width=MIN_MTR_FLD_NM_WIDTH ): + # assign callback if provided + self.cb = cb widg = QtWidgets.QWidget() dev_ui = btn_small_pass_a_btn() if fbk_dev: @@ -447,6 +453,7 @@ def append_toggle_btn_device( on_str=on_str, fbk_dev=fbk_dev, toggle=toggle, + cb=self.cb ) else: pBtn = ophydPushBtn( @@ -456,6 +463,7 @@ def append_toggle_btn_device( off_str=off_str, on_str=on_str, toggle=toggle, + cb=self.cb ) dev_ui.setupUi(widg, pBtn) @@ -480,6 +488,8 @@ def append_toggle_btn_device( self.append_widget_to_positioner_layout(widg) + return pBtn + def append_combobox_device(self, name, desc, @@ -490,6 +500,7 @@ def append_combobox_device(self, min_mtrfld_nm_width=MIN_MTR_FLD_NM_WIDTH ): ss = get_style() + self.cb = cb widg = QtWidgets.QWidget() dev_ui = combo_small_ui() dev_ui.setupUi(widg) @@ -525,8 +536,12 @@ def on_non_mtr_combo_selection_changed(self, pos): the handler for when a new selection is made from a combobox, ex: Polarization """ cmbo = self.sender() - dev = cmbo._device - sts = dev.set(pos) + # if there is a callback provided call it, else set the device value + if hasattr(cmbo, 'cb') and cmbo.cb: + cmbo.cb(pos) + else: + dev = cmbo._device + sts = dev.set(pos) def format_tooltip_text( self, diff --git a/cls/applications/pyStxm/widgets/scan_queue_table.py b/cls/applications/pyStxm/widgets/scan_queue_table.py index 2e0e01da..807abca3 100644 --- a/cls/applications/pyStxm/widgets/scan_queue_table.py +++ b/cls/applications/pyStxm/widgets/scan_queue_table.py @@ -28,20 +28,19 @@ # setup module logger with a default do-nothing handler _logger = get_module_logger(__name__) -HDR_FONT_SIZE = 8 -TABLE_FONT_SIZE = 8 - +HDR_FONT_SIZE = 11 +TABLE_FONT_SIZE = 11 DEFAULT_PIXMAP_COLUMN = 5 DEFAULT_PROGESS_BAR_COLUMN = 6 # table column width definitions -FILENAME_WIDTH = dpi_scaled(120) -STACK_FILENAME_WIDTH = dpi_scaled(170) -EV_WIDTH = dpi_scaled(60) -START_WIDTH = dpi_scaled(100) -POLARITY_WIDTH = dpi_scaled(80) -CENTER_WIDTH = dpi_scaled(150) +FILENAME_WIDTH = dpi_scaled(170) +STACK_FILENAME_WIDTH = dpi_scaled(210) +EV_WIDTH = dpi_scaled(80) +START_WIDTH = dpi_scaled(120) +POLARITY_WIDTH = dpi_scaled(100) +CENTER_WIDTH = dpi_scaled(170) NPOINTS_WIDTH = dpi_scaled(80) PMAP_WIDTH = dpi_scaled(8) PROGRESS_WIDTH = dpi_scaled(150) diff --git a/cls/applications/pyStxm/widgets/scan_table_view/baseScanTable.py b/cls/applications/pyStxm/widgets/scan_table_view/baseScanTable.py index 7fb9de4b..120fa2d2 100644 --- a/cls/applications/pyStxm/widgets/scan_table_view/baseScanTable.py +++ b/cls/applications/pyStxm/widgets/scan_table_view/baseScanTable.py @@ -27,8 +27,8 @@ # this is the value that will be added to the start and end of each extra EV # region -TABLE_FONT_SIZE = 8 -TABLE_HEADER_FONT_SIZE = 8 +TABLE_FONT_SIZE = 11 +TABLE_HEADER_FONT_SIZE = 11 SPATIAL_CNTR = 1000 EV_CNTR = 500 diff --git a/cls/applications/pyStxm/widgets/scan_table_view/polarizationTableView.py b/cls/applications/pyStxm/widgets/scan_table_view/polarizationTableView.py index 85cdb989..1bc13913 100644 --- a/cls/applications/pyStxm/widgets/scan_table_view/polarizationTableView.py +++ b/cls/applications/pyStxm/widgets/scan_table_view/polarizationTableView.py @@ -50,13 +50,6 @@ def __init__(self, scanList=[], parent=None): # self.set_model_id_start_val(POL_CNTR) self.setItemDelegateForColumn(POLARIZATION_COLUMN, PolComboBoxDelegate(self)) - # turn bold off - font = self.horizontalHeader().font() - font.setBold(False) - font.setPointSize(8) - self.horizontalHeader().setFont(font) - # self.init_model() - # self.table_view.horizontalHeader().setSectionResizeMode(QtGui.QHeaderView.ResizeToContents) self.setMaximumHeight(100) # Set the resize policy size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed) diff --git a/cls/applications/pyStxm/widgets/ui/combofbk_small.ui b/cls/applications/pyStxm/widgets/ui/combofbk_small.ui index 9f66fb48..fcafd5c6 100644 --- a/cls/applications/pyStxm/widgets/ui/combofbk_small.ui +++ b/cls/applications/pyStxm/widgets/ui/combofbk_small.ui @@ -317,6 +317,15 @@ + + + + 0 + 0 + 0 + + + @@ -454,6 +463,15 @@ + + + + 0 + 0 + 0 + + + @@ -591,6 +609,15 @@ + + + + 0 + 0 + 0 + + + @@ -671,6 +698,9 @@ + + false + 20 diff --git a/cls/applications/pyStxm/widgets/ui/spfbk_small.ui b/cls/applications/pyStxm/widgets/ui/spfbk_small.ui index 8ac48af8..ee136031 100755 --- a/cls/applications/pyStxm/widgets/ui/spfbk_small.ui +++ b/cls/applications/pyStxm/widgets/ui/spfbk_small.ui @@ -715,6 +715,9 @@ + + false + 20 diff --git a/cls/data_io/nxstxm/__init__.py b/cls/data_io/nxstxm/__init__.py index 8db933ed..3609f1a4 100644 --- a/cls/data_io/nxstxm/__init__.py +++ b/cls/data_io/nxstxm/__init__.py @@ -24,32 +24,7 @@ import suitcase.utils -# from cls.data_io.nxstxm.utils import * -# from cls.data_io.nxstxm.device_names import * -# from cls.data_io.nxstxm.stxm_types import scan_types, single_entry_scans, single_2d_scans, single_image_scans, \ -# stack_type_scans, spectra_type_scans, line_spec_scans, focus_scans, sample_image_filetypes -# -# from cls.data_io.nxstxm.nxstxm_utils import (_dataset, _string_attr, _group, make_1d_array, \ -# get_nx_standard_epu_mode, get_nx_standard_epu_harmonic_new, translate_pol_id_to_stokes_vector, \ -# readin_base_classes, make_NXclass, remove_unused_NXsensor_fields) -# -# from cls.data_io.nxstxm.generic_scan_utils import modify_generic_scan_nxdata_group, modify_generic_scan_ctrl_data_grps, \ -# modify_generic_scan_instrument_group -# from cls.data_io.nxstxm.single_2d_image_utils import modify_base_2d_nxdata_group, modify_2posner_ctrl_data_grps, \ -# modify_base_2d_instrument_group -# from cls.data_io.nxstxm.focus_image_utils import modify_focus_nxdata_group, modify_focus_ctrl_data_grps, \ -# modify_focus_instrument_group -# from cls.data_io.nxstxm.single_image_utils import modify_single_image_nxdata_group, modify_single_image_ctrl_data_grps, \ -# modify_single_image_instrument_group -# -# from cls.data_io.nxstxm.stack_image_utils import modify_stack_nxdata_group, modify_stack_ctrl_data_grps -# from cls.data_io.nxstxm.spectra_utils import modify_spectra_nxdata_group, modify_spectra_ctrl_data_grps, \ -# modify_spectra_instrument_group -# -# from cls.data_io.nxstxm.linespec_utils import modify_line_spectra_nxdata_group, modify_line_spectra_ctrl_data_grps, \ -# modify_line_spectra_instrument_group -# -# import cls.data_io.nxstxm.nx_key_defs as nxkd + from cls.data_io.nxstxm.utils import * from cls.data_io.nxstxm.device_names import * from cls.data_io.nxstxm.stxm_types import ( @@ -338,15 +313,17 @@ def __init__(self, directory, file_prefix="{}-", **kwargs): @property def artifacts(self): - # The 'artifacts' are the manager's way to exposing to the user a - # way to get at the resources that were created. For - # `MultiFileManager`, the artifacts are filenames. For - # `MemoryBuffersManager`, the artifacts are the buffer objects - # themselves. The Serializer, in turn, exposes that to the user here. - # - # This must be a property, not a plain attribute, because the - # manager's `artifacts` attribute is also a property, and we must - # access it anew each time to be sure to get the latest contents. + """ + The 'artifacts' are the manager's way to exposing to the user a + way to get at the resources that were created. For + `MultiFileManager`, the artifacts are filenames. For + `MemoryBuffersManager`, the artifacts are the buffer objects + themselves. The Serializer, in turn, exposes that to the user here. + + This must be a property, not a plain attribute, because the + manager's `artifacts` attribute is also a property, and we must + access it anew each time to be sure to get the latest contents. + """ return self._manager.artifacts def close(self): @@ -355,13 +332,6 @@ def close(self): """ self._manager.close() - # These methods enable the Serializer to be used as a context manager: - # - # with Serializer(...) as serializer: - # ... - # - # which always calls close() on exit from the with block. - def __enter__(self): return self @@ -438,10 +408,6 @@ def start(self, doc): self._sample_rotation_angle = self._cur_scan_md[doc["uid"]]["rotation_angle"] js_str = self._cur_scan_md[doc["uid"]]["wdg_com"] - #self._wdg_com = json.loads(js_str) - - # self._data_shape = self.get_data_shape() - if self._start_found: raise RuntimeError( @@ -459,25 +425,6 @@ def get_scan_subtype(self): subtype = self._wdg_com['SPATIAL_ROIS'][sp_ids[0]]['SCAN_PLUGIN']['SCAN_SUBTYPE'] return subtype - # def get_data_shape(self): - # """ - # based on the scan parameters and scan type return the shape of the data, - # this should really be done at scan config time and passed in with the metadata - # """ - # # get teh scan params based on scan type - # sp_roi = self._wdg_com['SINGLE_LST']['SP_ROIS'][0] - # #self._scan_type - # # single_2d_scans - # # focus_scans - # # multi_entry_scans - # shp = [] - # if self._scan_type in (single_2d_scans or focus_scans or multi_entry_scans): - # shp = self.get_2D_image_data_shape(sp_roi) - # - # #other scans here - # - # return shp - def get_2D_image_data_shape(self, sp_roi): """ @@ -488,38 +435,28 @@ def get_2D_image_data_shape(self, sp_roi): npts_ev = sp_roi['EV_NPOINTS'] return (npts_ev, npts_x, npts_y) - - - - - #determine the shape of the data - - #return it as a list - def return_initialized_data(self, shp): """ + determine the shape of the data, return it as a list take the desired shape of final data and create an array of nan's and return that array as a single dimensional list IS_PXP scan data will be 1D arrays, if LXL they will be multi D arrays """ if len(shp) == 1: - init_dat = np.empty((shp[0])) + init_dat = np.full((shp[0]), np.nan) elif len(shp) == 2: if self._scan_subtype == IS_PXP: - init_dat = np.empty((shp[0] * shp[1])) + init_dat = np.full((shp[0] * shp[1]), np.nan) else: - init_dat = np.empty((shp[0] , shp[1])) + init_dat = np.full((shp[0] , shp[1]), np.nan) elif len(shp) == 3: if self._scan_subtype == IS_PXP: - init_dat = np.empty((shp[0] * shp[1] * shp[2])) + init_dat = np.full((shp[0] * shp[1] * shp[2]), np.nan) else: - init_dat = np.empty((shp[0], shp[1], shp[2])) + init_dat = np.full((shp[0], shp[1], shp[2]), np.nan) else: #most likely this is a baseline stream detector so give it 2 values for start and stop values - init_dat = np.empty((2)) - - #init_dat[:] = np.nan - init_dat[:] = -1 + init_dat = np.full((2), np.nan) return list(init_dat) @@ -554,33 +491,12 @@ def add_arrays(self, A_nans, B_nums): returns A padded with nan's if the complete data was not available """ - # Example arrays - #A_nans = np.full(15, np.nan) # array of 15 NaNs - #B_nums = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) # array of 11 integers num_B, = np.array(B_nums).shape A_nans = np.array(A_nans) - # # Create a mask to identify NaN values in A - # mask_15 = np.isnan(A_nans) - - # Overwrite NaN values in A with corresponding elements from B - # A[mask_15] = B_nums[:mask_15.sum()] A_nans[:num_B] = B_nums[:num_B] - #A_nans = np.reshape(A_nans, np.array(B_nums).shape) return A_nans - def get_full_data_shape(self): - """ - based on the scan type find out what the complete data shape is and return it as a list of values - This way a complete data array can be initialized with nans then filled in with actual data, and if the data - is incomplete the data will fill in the nan data array - """ - sin_lst = self._wdg_com['SINGLE_LST'] - - - - - def descriptor(self, doc): """Use `descriptor` doc to map stream_names to descriptor uid's. @@ -604,11 +520,7 @@ def descriptor(self, doc): self._data[strm_name][ch_dct['chan_nm']][self._cur_uid] = {} self._data[strm_name][ch_dct['chan_nm']][self._cur_uid]["data"] = [] self._data[strm_name][ch_dct['chan_nm']][self._cur_uid]["info"] = v - # if strm_name.find('primary') > -1: - # self._data[strm_name][ch_dct['chan_nm']][self._cur_uid][ - # "data_full_shape"] = self.return_initialized_data(v['shape']) - # else: - self._data[strm_name][ch_dct['chan_nm']][self._cur_uid]["data_full_shape"] = self.return_initialized_data(v['shape']) + self._data[strm_name][ch_dct['chan_nm']][self._cur_uid]["data_full_shape"] = self.return_initialized_data(num_pnts_shape) else: self._data[strm_name][k] = {} @@ -654,6 +566,9 @@ def is_multi_dimensional(self, lst): return False + def is_list_of_lists(self, dat): + return isinstance(dat, list) and all(isinstance(item, list) for item in dat) + def event_page(self, doc): """Add event page document information to a ".csv" file. @@ -684,7 +599,6 @@ def event_page(self, doc): seq_num = doc['seq_num'][0] - 1 strm_name = self._streamnames[doc["descriptor"]] - strm_name = self._streamnames[doc["descriptor"]] for k in doc["data"].keys(): if k in self._data[strm_name].keys() or k.find('SIS3820') > -1: if k.find('SIS3820') > -1: @@ -699,9 +613,11 @@ def event_page(self, doc): if len(dat) == 1: #dereference this single value instead of appending a list of a single value dat = dat[0] - self._data[strm_name][k][self._cur_uid]["data"].append(dat) - # init_val = self._data[strm_name][k][self._cur_uid]["data_full_shape"][seq_num] - # self._data[strm_name][k][self._cur_uid]["data_full_shape"][seq_num] = self.add_with_nan_handling(init_val, dat[0]) + if self.is_list_of_lists(dat): + for sublist in dat: + self._data[strm_name][k][self._cur_uid]["data"].extend(sublist) + else: + self._data[strm_name][k][self._cur_uid]["data"].append(dat) if strm_name.find("primary") > -1: if k not in self._detector_names: @@ -711,17 +627,12 @@ def event_page(self, doc): else: dat = doc["data"][k][0] self._data[strm_name][k][self._cur_uid]["data"].append(dat) - # init_val = self._data[strm_name][k][self._cur_uid]["data_full_shape"][seq_num] - # self._data[strm_name][k][self._cur_uid]["data_full_shape"][seq_num] = self.add_with_nan_handling( - # init_val, dat) if strm_name.find("primary") > -1: if k not in self._detector_names: self._detector_names.append(k) self._det_strm_map[k] = strm_name - #result = list(map(add_with_nan_handling, list1, list2)) - event_model.verify_filled(doc) @@ -747,12 +658,15 @@ def create_entry_structure(self, doc, scan_type): _logger.info("creating [%s]" % self._entry_nm) if scan_types(scan_type) in single_entry_scans: + print("nxstxm: saving single entry scan") self.save_single_entry_scan(doc, scan_type) # elif scan_types(scan_type) in spectra_type_scans: # self.save_point_spec_entry_scan(doc, scan_type) elif scan_types(scan_type) is scan_types.SAMPLE_POINT_SPECTRUM: + print("nxstxm: saving sample point spectrum scan") self.save_point_spec_entry_scan(doc, scan_type) else: + print("nxstxm: saving multi entry scan") self.save_multi_entry_scan(doc, scan_type) def create_file_attrs(self): @@ -803,9 +717,6 @@ def save_single_entry_scan(self, doc, scan_type): ctrl_nxgrp = self.create_base_control_group(entry_nxgrp, doc, scan_type) self.specific_scan_funcs["mod_nxctrl"](self, ctrl_nxgrp, doc, scan_type) - # data_nxgrp = self.create_base_nxdata_group(entry_nxgrp, self._detector_names, doc, scan_type) - # self.specific_scan_funcs['mod_nxdata'](self, data_nxgrp, doc, scan_type) - # self._detector_names = list(self._data["primary"].keys()) data_nxgrps = self.create_base_nxdata_group( entry_nxgrp, self._detector_names, doc, scan_type ) @@ -815,17 +726,12 @@ def save_single_entry_scan(self, doc, scan_type): inst_nxgrp = self.create_base_instrument_group(entry_nxgrp, doc, scan_type) self.specific_scan_funcs["mod_nxinst"](self, inst_nxgrp, doc, scan_type) for det_nm in self._detector_names: - self.create_base_instrument_detector(inst_nxgrp, det_nm, doc) + if det_nm not in inst_nxgrp.keys(): + self.create_base_instrument_detector(inst_nxgrp, det_nm, doc) self.create_base_sample_group(entry_nxgrp, doc, scan_type) nf.close() - # except: - # print("save_single_entry_scan: Unexpected error:", sys.exc_info()[0]) - # _logger.info("Problem saving file[%s]" % self._tmp_fname) - # if nf is not None: - # nf.close() - # os.rename(self._tmp_fname, self._tmp_fname + ".err") except Exception as e: print("save_single_entry_scan: Unexpected error:", sys.exc_info()[0]) @@ -873,12 +779,6 @@ def save_multi_entry_scan(self, doc, scan_type): ctrl_nxgrp = self.create_stack_control_group(entry_nxgrp, doc, scan_type) self.specific_scan_funcs["mod_nxctrl"](self, ctrl_nxgrp, doc, scan_type) - # data_nxgrp = self.create_stack_nxdata_group(entry_nxgrp, self._detector_names, doc, scan_type) - # self.specific_scan_funcs['mod_nxdata'](self, data_nxgrp, doc, scan_type) - # - # inst_nxgrp = self.create_base_instrument_group(entry_nxgrp, doc, scan_type) - # self.specific_scan_funcs['mod_nxinst'](self, inst_nxgrp, doc, scan_type) - data_nxgrps = self.create_stack_nxdata_group( entry_nxgrp, self._detector_names, doc, self._scan_type ) @@ -890,81 +790,13 @@ def save_multi_entry_scan(self, doc, scan_type): for det_nm in self._detector_names: self.create_base_instrument_detector(inst_nxgrp, det_nm, doc) - # self.create_base_sample_group(entry_nxgrp, doc, scan_type) nf.close() except: print("save_multi_entry_scan: Unexpected error:", sys.exc_info()[0]) raise - print("Problem saving file[%s]" % self._tmp_fname) - _logger.error("Problem saving file[%s]" % self._tmp_fname) - if nf is not None: - nf.close() - os.rename(self._tmp_fname, self._tmp_fname + ".err") - # def save_point_spec_entry_scan(self, doc, scan_type): - # ''' - # the main function to create the point spectra type NXstxm file - # :param doc: - # :param scan_type: - # :return: - # ''' - # nf = None - # try: - # self.specific_scan_funcs = self.get_scan_specific_funcs(self._scan_type) - # uid = self.get_current_uid() - # primary_det_nm = self.get_primary_det_nm(uid) - # prim_data_arr = np.array(self._data['primary'][primary_det_nm][uid]['data']) - # num_spids = len(self._sp_id_lst) - # coll_nxgrp = None - # nf = self._nf = h5py.File(self._tmp_fname, 'a') - # - # i = 0 - # for sp_id in self._sp_id_lst: - # self._cur_sp_id = sp_id - # - # #all spid data is in one long array, get this sp_ids data by slicing every nth value - # data = prim_data_arr[i::num_spids] - # - # entry_nxgrp = _group(nf, 'entry%s' % sp_id, 'NXentry') - # - # # set attrs for the file - # _dataset(entry_nxgrp, 'title', 'NeXus sample', 'NX_CHAR') - # _dataset(entry_nxgrp, 'start_time', self._start_time_str, 'NX_DATE_TIME') - # _dataset(entry_nxgrp, 'end_time', self._stop_time_str, 'NX_DATE_TIME') - # _dataset(entry_nxgrp, 'definition', 'NXstxm', 'NX_CHAR') - # _dataset(entry_nxgrp, 'version', '1.0', 'NX_CHAR') - # - # #create entry groups - # if (coll_nxgrp is None): - # coll_nxgrp = self.create_collection_group(entry_nxgrp, doc, self._scan_type) - # else: - # # just make a copy to recreate it - # nf.copy(coll_nxgrp, entry_nxgrp) - # - # ctrl_nxgrp = self.create_stack_control_group(entry_nxgrp, doc, self._scan_type) - # self.specific_scan_funcs['mod_nxctrl'](self, ctrl_nxgrp, doc, self._scan_type) - # - # data_nxgrp = self.create_stack_nxdata_group(entry_nxgrp, self._detector_names, doc, self._scan_type) - # self.specific_scan_funcs['mod_nxdata'](self, data_nxgrp, doc, data, self._scan_type) - # #modify_spectra_nxdata_group(self, data_nxgrp, doc, data, self._scan_type) - # - # inst_nxgrp = self.create_base_instrument_group(entry_nxgrp, doc, self._scan_type) - # self.specific_scan_funcs['mod_nxinst'](self, inst_nxgrp, doc, data, self._scan_type) - # # - # self.create_base_sample_group(entry_nxgrp, doc, self._scan_type) - # i += 1 - # - # nf.close() - # except: - # print("save_point_spec_entry_scan: Unexpected error:", sys.exc_info()[0]) - # raise - # print('Problem saving file[%s]' % self._tmp_fname) - # _logger.error('Problem saving file[%s]' % self._tmp_fname) - # if(nf is not None): - # nf.close() - # os.rename(self._tmp_fname, self._tmp_fname + '.err') def get_spec_detnames_for_spatial_id(self, sp_id): """ @@ -988,9 +820,6 @@ def save_point_spec_entry_scan(self, doc, scan_type): """ nf = None try: - - - self.specific_scan_funcs = self.get_scan_specific_funcs(self._scan_type) uid = self.get_current_uid() @@ -1019,7 +848,6 @@ def save_point_spec_entry_scan(self, doc, scan_type): ) _dataset(entry_nxgrp, "definition", "NXstxm", "NX_CHAR") _dataset(entry_nxgrp, "version", "1.0", "NX_CHAR") - #_string_attr(entry_nxgrp, "default", self._default_det) self._default_det = self._cur_scan_md[self._cur_uid]["default_entry_detectors"][str(sp_id)] _string_attr(entry_nxgrp, "default", self._default_det) @@ -1035,7 +863,6 @@ def save_point_spec_entry_scan(self, doc, scan_type): #create a data group for each detector spid_detnames = self.get_spec_detnames_for_spatial_id(sp_id) - #data_nxgrps = self.create_stack_nxdata_group( entry_nxgrp, self._detector_names, doc, self._scan_type ) data_nxgrps = self.create_stack_nxdata_group(entry_nxgrp, spid_detnames, doc, self._scan_type) for dgrp in data_nxgrps: self.specific_scan_funcs["mod_nxdata"](self, dgrp, doc, scan_type) @@ -1047,7 +874,6 @@ def save_point_spec_entry_scan(self, doc, scan_type): for det_nm in spid_detnames: self.create_base_instrument_detector(inst_nxgrp, det_nm, doc) - # self.create_base_sample_group(entry_nxgrp, doc, self._scan_type) i += 1 @@ -1195,7 +1021,6 @@ def create_base_instrument_group(self, nxgrp, doc, scan_type): self.make_monochromator(inst_nxgrp, doc, scan_type=scan_type) self.make_zoneplate(inst_nxgrp, doc) - #epu_pol_src = self.get_devname("DNM_EPU_POLARIZATION", do_warn=False) epu_pol_src = "DNM_EPU_POLARIZATION" if epu_pol_src: # then EPU is supported @@ -1393,27 +1218,6 @@ def make_source(self, nxgrp, doc, modify=False): if not modify: _sr_data = self.get_baseline_all_data("DNM_BASELINE_RING_CURRENT") rois = self.get_rois_from_current_md(doc["run_start"]) - # ring_cur_signame = self._cur_scan_md[self._cur_uid]['ring_current_nm'] - # if ring_cur_signame in self._data["baseline"].keys(): - # rois = self.get_rois_from_current_md(doc["run_start"]) - # # use the baseline start/stop values and create a sequence from start to stop - # # strt, stp = self._data['baseline'][ring_cur_signame][uid]['data'] - # ring_data = self.get_baseline_all_data(ring_cur_signame) - # if type(ring_data) == list: - # strt = ring_data[0] - # stp = ring_data[-1] - # elif type(ring_data) == tuple: - # strt = ring_data[0] - # stp = ring_data[-1] - # else: - # print("make_source: ring data is not list or tuple") - # return - # #strt, stp = self.get_baseline_all_data(ring_cur_signame) - # sr_data = np.linspace(strt, stp, int(rois["X"][NPOINTS]), dtype=np.float32) - # else: - # sr_data = np.array( - # self._data["primary"][ring_cur_signame]["data"], dtype=np.float32 - # ) sr_data = np.linspace(_sr_data[0], _sr_data[-1], int(rois["X"][NPOINTS]), dtype=np.float32) src_grp = _group(nxgrp, "source", "NXsource") @@ -1428,7 +1232,7 @@ def make_source(self, nxgrp, doc, modify=False): def get_devname(self, lu_nm, do_warn=False): """ - get the device name using the reverse lookup dict + get the device name using the reverse lookup dict only if it exists :param lu_nm: :return: """ @@ -1437,10 +1241,10 @@ def get_devname(self, lu_nm, do_warn=False): return md["rev_lu_dct"][lu_nm] else: if do_warn: - _logger.warn( - "nxstxm_primary: get_devname: cannot find [%s] in current scan metadata" - % lu_nm - ) + _logger.info( + f"nxstxm_primary: get_devname: cannot find [{lu_nm}] in current scan metadata" + ) + print(f"Info: nxstxm_primary: get_devname: cannot find lookup name [{lu_nm}] in current scan metadata") return lu_nm def get_baseline_start_data(self, src_nm): @@ -1700,13 +1504,10 @@ def create_base_nxdata_group(self, entry_nxgrp, cntr_nm_lst, doc, scan_type): ydata = np.array(dct_get(rois, SPDB_YSETPOINTS), dtype=np.float32) # make sure dwell is in seconds dwell = np.float32(self._cur_scan_md[doc["run_start"]]["dwell"]) * 0.001 - if "SINGLE_LST" not in self._wdg_com.keys(): - spid = list(self._wdg_com["SPATIAL_ROIS"].keys())[0] - ev_setpoints = [] - for ev_roi in self._wdg_com["SPATIAL_ROIS"][spid]["EV_ROIS"]: - ev_setpoints += ev_roi[SETPOINTS] - else: - ev_setpoints = self._wdg_com["SINGLE_LST"]["EV_ROIS"] + spid = list(self._wdg_com["SPATIAL_ROIS"].keys())[0] + ev_setpoints = [] + for ev_roi in self._wdg_com["SPATIAL_ROIS"][spid]["EV_ROIS"]: + ev_setpoints += ev_roi[SETPOINTS] num_ev_points = len(ev_setpoints) if num_ev_points < 1: @@ -1726,10 +1527,6 @@ def create_base_nxdata_group(self, entry_nxgrp, cntr_nm_lst, doc, scan_type): _dataset(data_nxgrp, nxkd.SAMPLE_X, xdata, "NX_FLOAT") _dataset(data_nxgrp, nxkd.SAMPLE_Y, ydata, "NX_FLOAT") - # pol_src = self.get_devname(DNM_EPU_POLARIZATION, do_warn=False) - # if (pol_src): - # _dataset(data_nxgrp, 'epu_polarization', self.get_baseline_start_data(pol_src), 'NX_FLOAT') - #epu_pol_src = self.get_devname("DNM_EPU_POLARIZATION", do_warn=False) epu_pol_src = "DNM_EPU_POLARIZATION" if epu_pol_src: # then EPU is supported @@ -1785,10 +1582,6 @@ def create_stack_nxdata_group(self, entry_nxgrp, cntr_nm_lst, doc, scan_type): data_nxgrp, nxkd.SAMPLE_Y, self.get_sample_y_data("start"), "NX_FLOAT" ) - # pol_src = self.get_devname(DNM_EPU_POLARIZATION, do_warn=False) - # if (pol_src): - # _dataset(data_nxgrp, 'epu_polarization', self.get_baseline_start_data(pol_src), 'NX_FLOAT') - #epu_pol_src = self.get_devname("DNM_EPU_POLARIZATION", do_warn=False) epu_pol_src = "DNM_EPU_POLARIZATION" if epu_pol_src: # then EPU is supported @@ -1993,13 +1786,12 @@ def stop(self, doc): if len(shp) == 0: #shp = [self._cur_scan_md[self._cur_uid]['num_points']] do_reshape = False - A_nans = self._data[strm_name][k][self._cur_uid]["data_full_shape"] B_nums = self._data[strm_name][k][self._cur_uid]["data"] - # data = self.add_arrays(A_nans, B_nums) - # if do_reshape: - # data = np.reshape(data, shp) - # self._data[strm_name][k][self._cur_uid]["data_full_shape"] = data - self._data[strm_name][k][self._cur_uid]["data_full_shape"] = B_nums + # If B_nums is a list of lists, flatten it + if isinstance(B_nums, list) and any(isinstance(i, list) for i in B_nums): + B_nums = [item for sublist in B_nums for item in sublist] + # move the data that we have into the array of total expected size + self._data[strm_name][k][self._cur_uid]["data_full_shape"][:len(B_nums)] = B_nums if has_baseline: self.create_entry_structure(doc, scan_type=scan_type) @@ -2011,6 +1803,18 @@ def stop(self, doc): if len(self._detector_names) > 0: for det_nm in self._detector_names: dat_arr = np.array(self._data["primary"][det_nm][uid]["data"]) + + if dat_arr.ndim == 1: + # reshape to 2D if needed + rois = self.get_rois_from_current_md(doc["run_start"]) + xnpoints = int(dct_get(rois, SPDB_XNPOINTS)) + ynpoints = int(dct_get(rois, SPDB_YNPOINTS)) + expected_size = xnpoints * ynpoints + if dat_arr.size < expected_size: + # scan was aborted so fix the data array + dat_arr = self.fix_aborted_data(dat_arr, expected_size) + dat_arr = dat_arr.reshape((ynpoints, xnpoints)) + # now place it in correct entry/counter/data self.modify_entry_data(self._entry_nm, det_nm, dat_arr) @@ -2063,7 +1867,8 @@ def modify_entry_data(self, entry_nm, det_prfx, data): nf.close() except: - _logger.error("Problem modifying data in [%s]" % self._tmp_fname) + _logger.error(f"Problem modifying data in [{self._tmp_fname}], creating an error file") + print(f"Problem modifying data in [{self._tmp_fname}], creating an error file") if nf is not None: nf.close() os.rename(self._tmp_fname, self._tmp_fname + ".err") diff --git a/cls/data_io/nxstxm/focus_image_utils.py b/cls/data_io/nxstxm/focus_image_utils.py index a8caf740..9f1bcf75 100644 --- a/cls/data_io/nxstxm/focus_image_utils.py +++ b/cls/data_io/nxstxm/focus_image_utils.py @@ -183,7 +183,7 @@ def modify_focus_nxdata_group(parent, data_nxgrp, doc, scan_type): #prim_arr = np.array(prim_data_arr) if prim_arr.ndim == 1: resize_data = True - prim_arr = parent.interpolate_data_from_endpoints(prim_arr, ttlpnts) + elif prim_arr.ndim == 2: rows, cols = prim_arr.shape if cols < xnpoints: diff --git a/cls/data_io/nxstxm/generic_scan_utils.py b/cls/data_io/nxstxm/generic_scan_utils.py index d86b903f..f508b9dd 100644 --- a/cls/data_io/nxstxm/generic_scan_utils.py +++ b/cls/data_io/nxstxm/generic_scan_utils.py @@ -25,12 +25,12 @@ def modify_generic_scan_ctrl_data_grps(parent, nxgrp, doc, scan_type): resize_data = False rois = parent.get_rois_from_current_md(doc["run_start"]) x_src = parent.get_devname(rois[SPDB_X][POSITIONER]) - x_posnr_nm = parent.fix_posner_nm(rois[SPDB_X][POSITIONER]) + x_posnr_nm = parent.fix_posner_nm(rois[SPDB_X][POSITIONER]).upper() xnpoints = int(rois[SPDB_X][NPOINTS]) ttlpnts = xnpoints uid = parent.get_current_uid() - prim_data_lst = parent.get_primary_all_data(x_src) + prim_data_lst = parent.get_primary_all_data(x_posnr_nm) if len(prim_data_lst) < ttlpnts: resize_data = True # scan was aborted so use setpoint data here @@ -39,23 +39,11 @@ def modify_generic_scan_ctrl_data_grps(parent, nxgrp, doc, scan_type): # use actual data # xdata is teh first xnpoints xdata = np.array( - parent.get_primary_all_data(x_src)[0:xnpoints], dtype=np.float32 + parent.get_primary_all_data(x_posnr_nm)[0:xnpoints], dtype=np.float32 ) _dataset(nxgrp, x_posnr_nm, xdata, "NX_FLOAT") - # this should be an array the same shape as the 'data' group in NXdata filled with the storagering current - # sr_data = np.array( - # parent._data["primary"][parent.get_devname("DNM_RING_CURRENT")][uid]["data"], - # dtype=np.float32, - # ) - sr_data = parent.get_primary_all_data("DNM_RING_CURRENT") - - if resize_data: - sr_data = np.resize(sr_data, (ttlpnts,)) - - _dataset(nxgrp, "data", sr_data, "NX_NUMBER") - modify_generic_scan_ctrl_str_attrs(parent, nxgrp, doc) @@ -85,12 +73,12 @@ def modify_generic_scan_nxdata_group(parent, data_nxgrp, doc, scan_type): rois = parent.get_rois_from_current_md(doc["run_start"]) x_src = parent.get_devname(rois[SPDB_X][POSITIONER]) - x_posnr_nm = parent.fix_posner_nm(rois[SPDB_X][POSITIONER]) + x_posnr_nm = parent.fix_posner_nm(rois[SPDB_X][POSITIONER]).upper() xnpoints = int(rois[SPDB_X][NPOINTS]) ttlpnts = xnpoints det_nm = parent.get_nxgrp_det_name(data_nxgrp) - prim_data_lst = parent.get_primary_all_data(x_src) + prim_data_lst = parent.get_primary_all_data(x_posnr_nm) if len(prim_data_lst) < ttlpnts: resize_data = True # scan was aborted so use setpoint data here @@ -100,7 +88,7 @@ def modify_generic_scan_nxdata_group(parent, data_nxgrp, doc, scan_type): # use actual data # xdata is teh first xnpoints xdata = np.array( - parent.get_primary_all_data(x_src)[0:xnpoints], dtype=np.float32 + parent.get_primary_all_data(x_posnr_nm)[0:xnpoints], dtype=np.float32 ) _dataset(data_nxgrp, x_posnr_nm, xdata, "NX_FLOAT") @@ -146,9 +134,9 @@ def modify_generic_scan_instrument_group(parent, inst_nxgrp, doc, scan_type): xnpoints = int(rois[SPDB_X][NPOINTS]) x_src = parent.get_devname(rois[SPDB_X][POSITIONER]) - x_posnr_nm = parent.fix_posner_nm(rois[SPDB_X][POSITIONER]) + x_posnr_nm = parent.fix_posner_nm(rois[SPDB_X][POSITIONER]).upper() # xdata is teh first xnpoints - xdata = parent.get_primary_all_data(x_src)[0:xnpoints] + xdata = parent.get_primary_all_data(x_posnr_nm)[0:xnpoints] # parent.make_detector(inst_nxgrp, x_posnr_nm, np.tile(xdata, xnpoints), dwell, ttlpnts, units='um') parent.make_detector(inst_nxgrp, x_posnr_nm, xdata, dwell, ttlpnts, units="um") diff --git a/cls/data_io/nxstxm/single_2d_image_utils.py b/cls/data_io/nxstxm/single_2d_image_utils.py index cd863acc..ea071145 100644 --- a/cls/data_io/nxstxm/single_2d_image_utils.py +++ b/cls/data_io/nxstxm/single_2d_image_utils.py @@ -7,25 +7,12 @@ from cls.data_io.nxstxm.stxm_types import scan_types, two_posner_scans from cls.data_io.nxstxm.device_names import * - -# from cls.data_io.nxstxm.utils import dct_get, dct_put from cls.data_io.nxstxm.roi_dict_defs import * - -# from cls.data_io.nxstxm.nxstxm_utils import (make_signal, _dataset, _string_attr, _group, make_1d_array, \ -# get_nx_standard_epu_mode, get_nx_standard_epu_harmonic_new, translate_pol_id_to_stokes_vector, \ -# readin_base_classes, make_NXclass, remove_unused_NXsensor_fields) from cls.data_io.nxstxm.nxstxm_utils import _dataset, _string_attr, make_1d_array - import cls.data_io.nxstxm.nx_key_defs as nxkd - MARK_DATA = False - -# parent.modify_2posner_ctrl_str_attrs(cntrl_nxgrp, doc) -# parent.modify_2posner_ctrl_data_grps(cntrl_nxgrp, doc) - - def modify_2posner_ctrl_data_grps(parent, nxgrp, doc, scan_type): """ @@ -46,8 +33,6 @@ def modify_2posner_ctrl_data_grps(parent, nxgrp, doc, scan_type): xnpoints = int(rois[SPDB_X][NPOINTS]) ynpoints = int(rois[SPDB_Y][NPOINTS]) ttlpnts = xnpoints * ynpoints - #prim_data_lst = parent.get_primary_all_data(x_src) - #if len(prim_data_lst) < ttlpnts: if x_src not in parent._data["primary"].keys(): #resize_data = True # scan was aborted so use setpoint data here @@ -156,24 +141,13 @@ def modify_base_2d_nxdata_group(parent, data_nxgrp, doc, scan_type): scan_types.OSA_IMAGE, scan_types.OSA_FOCUS, scan_types.SAMPLE_FOCUS, + scan_types.SAMPLE_IMAGE, scan_types.SAMPLE_IMAGE_STACK, scan_types.COARSE_IMAGE, scan_types.COARSE_GONI, scan_types.TOMOGRAPHY, ] if scan_types(scan_type) in three_d_scans: - # det_data = np.array(parent._data['primary'][det_nm]['data'], dtype=np.float32).reshape((1, ynpoints, xnpoints)) - # if det_nm not in parent._data["primary"].keys(): - # # must be a flyer scan, only one detector in primary stream - # det_data = np.array( - # parent._data["baseline"][det_nm][uid]["data"][0], dtype=np.float32 - # ) - # else: - # # det name is in primary data stream - # resize_data = False - # det_data = np.array( - # parent.get_primary_all_data(det_nm), dtype=np.float32 - # ) resize_data = False det_data = np.array(parent.get_primary_all_data(det_nm), dtype=np.float32) @@ -181,7 +155,8 @@ def modify_base_2d_nxdata_group(parent, data_nxgrp, doc, scan_type): # det_data = parent.fix_aborted_data(det_data, ttlpnts) det_data = parent.fix_aborted_data(det_data, ttlpnts) - #for a line by line scan the data here (if say RING_CURRENT) we will only have 1 value per row, so we need to duplicate the single value for the entire row + # for a line by line scan the data here (if say RING_CURRENT) we will only have 1 value per row, so we need to + # duplicate the single value for the entire row cols = 0 if det_data.ndim == 1: rws, = det_data.shape diff --git a/cls/data_io/nxstxm/spectra_utils.py b/cls/data_io/nxstxm/spectra_utils.py index 1650e583..0ea8c8ee 100644 --- a/cls/data_io/nxstxm/spectra_utils.py +++ b/cls/data_io/nxstxm/spectra_utils.py @@ -115,25 +115,26 @@ def modify_spectra_nxdata_group(parent, data_nxgrp, doc, scan_type): rows = 1 (cols,) = det_data.shape - if (rows * cols) < ttlpnts: - # scn had been aborted - resize_data = True - # scan was aborted so use setpoint data here - xdata = np.array(xnpoints, dtype=np.float32) - ydata = np.array(rois[SPDB_Y][SETPOINTS], dtype=np.float32) - else: - if x_src not in parent._data["primary"].keys(): - xdata = make_1d_array(ttlpnts, rois[SPDB_X][SETPOINTS]) - ydata = make_1d_array(ttlpnts, rois[SPDB_Y][SETPOINTS]) - else: - # use actual data - # xdata is teh first xnpoints - # xdata = np.array(parent._data['primary'][x_src][uid]['data'][0:xnpoints], dtype=np.float32) - xdata = make_1d_array(ttlpnts, parent.get_sample_x_data("start")) - # ydata is every ynpoint - # ydata = np.array(parent._data['primary'][y_src][uid]['data'][0::ynpoints], dtype=np.float32) - ydata = make_1d_array(ttlpnts, parent.get_sample_y_data("start")) - + # if (rows * cols) < ttlpnts: + # # scn had been aborted + # resize_data = True + # # scan was aborted so use setpoint data here + # xdata = np.array(xnpoints, dtype=np.float32) + # ydata = np.array(rois[SPDB_Y][SETPOINTS], dtype=np.float32) + # else: + # if x_src not in parent._data["primary"].keys(): + # xdata = make_1d_array(ttlpnts, rois[SPDB_X][SETPOINTS]) + # ydata = make_1d_array(ttlpnts, rois[SPDB_Y][SETPOINTS]) + # else: + # # use actual data + # # xdata is teh first xnpoints + # # xdata = np.array(parent._data['primary'][x_src][uid]['data'][0:xnpoints], dtype=np.float32) + # xdata = make_1d_array(ttlpnts, parent.get_sample_x_data("start")) + # # ydata is every ynpoint + # # ydata = np.array(parent._data['primary'][y_src][uid]['data'][0::ynpoints], dtype=np.float32) + # ydata = make_1d_array(ttlpnts, parent.get_sample_y_data("start")) + xdata = make_1d_array(ttlpnts, parent.get_sample_x_data("start")) + ydata = make_1d_array(ttlpnts, parent.get_sample_y_data("start")) # regardless of the positioner, these names (sample_x, sample_y) are hardcoded into the nxstxm definition # if there were already sample_x and y created by the default constructors then delete them and recreate with the right data if nxkd.SAMPLE_Y in data_nxgrp.keys(): diff --git a/cls/data_io/nxstxm/stack_image_utils.py b/cls/data_io/nxstxm/stack_image_utils.py index 217f45ce..f417c7e9 100644 --- a/cls/data_io/nxstxm/stack_image_utils.py +++ b/cls/data_io/nxstxm/stack_image_utils.py @@ -125,7 +125,14 @@ def modify_stack_nxdata_group(parent, data_nxgrp, doc, scan_type): rows = 1 (cols,) = prim_data_arr.shape else: - if prim_data_arr.ndim == 2: + if prim_data_arr.ndim == 1: + if len(prim_data_arr) == ttlpnts: + rows = ynpoints + cols = xnpoints + # make it a 2D array + prim_data_arr = np.reshape(prim_data_arr, (rows,cols)) + + elif prim_data_arr.ndim == 2: rows, cols = prim_data_arr.shape else: dud_evidx, rows, cols = prim_data_arr.shape diff --git a/cls/data_io/nxstxm/stxm_types.py b/cls/data_io/nxstxm/stxm_types.py index e243d383..eae3c991 100644 --- a/cls/data_io/nxstxm/stxm_types.py +++ b/cls/data_io/nxstxm/stxm_types.py @@ -51,6 +51,7 @@ class scan_types(Enum): single_2d_scans = [ scan_types.DETECTOR_IMAGE, scan_types.OSA_IMAGE, + scan_types.SAMPLE_IMAGE, scan_types.COARSE_IMAGE, scan_types.COARSE_GONI, ] diff --git a/cls/data_io/nxstxm_h5_to_dict.py b/cls/data_io/nxstxm_h5_to_dict.py index de372a81..017e7b0e 100644 --- a/cls/data_io/nxstxm_h5_to_dict.py +++ b/cls/data_io/nxstxm_h5_to_dict.py @@ -1,7 +1,7 @@ import sys import os -import simplejson as json +import orjson import numpy as np #make sure that the applications modules can be found, used to depend on PYTHONPATH environ var @@ -39,12 +39,12 @@ def load_nxstxm_file_to_h5_file_dct(filename, *, ret_as_dict=False, ret_as_jstr= # Convert numpy arrays to Python lists before JSON serialization python_dict = convert_numpy_to_python(h5_file_dct) python_dict = clean_nans(python_dict) - jstr = json.dumps(python_dict, indent=4) + jstr = orjson.dumps(python_dict).decode() return jstr else: python_dict = convert_numpy_to_python(h5_file_dct) python_dict = clean_nans(python_dict) - jstr = json.dumps(python_dict, indent=4) + jstr = orjson.dumps(python_dict).decode() # by printing it it becomes the output of the function when called from PixelatorController # print(jstr) sys.stdout.write(jstr) diff --git a/cls/devWidgets/ophydLabelWidget.py b/cls/devWidgets/ophydLabelWidget.py index e2a6dd87..6e3636c5 100644 --- a/cls/devWidgets/ophydLabelWidget.py +++ b/cls/devWidgets/ophydLabelWidget.py @@ -43,11 +43,17 @@ def __init__( title_color="black", var_clr="blue", sig_change_kw="value", + font=None, ): super(BaseLabel, self).__init__() if signal is None: _logger.error("Error: BaseLabel was passed device object set to [None]") return + + if font is not None: + # f = QtGui.QFont( "Arial", 18, QtGui.QFont.Bold) + self.setFont(font) + self.enum_strs = [] self.setAutoFillBackground(True) self.fbk_enabled = False @@ -232,10 +238,8 @@ def __init__( var_clr=var_clr, warn=warn, alarm=alarm, + font=font ) - if font is not None: - # f = QtGui.QFont( "Arial", 18, QtGui.QFont.Bold) - self.setFont(font) self.setContentsMargins(0, 0, 0, 0) self.signal = signal @@ -330,10 +334,8 @@ def __init__( var_clr=var_clr, warn=warn, # is a tuple alarm=alarm, # is a tuple + font=font, ) - if font is not None: - # f = QtGui.QFont( "Arial", 18, QtGui.QFont.Bold) - self.setFont(font) self.setContentsMargins(0, 0, 0, 0) self.signal = signal diff --git a/cls/devWidgets/ophydPushBtn.py b/cls/devWidgets/ophydPushBtn.py index 39ae3ad8..fbb9629c 100644 --- a/cls/devWidgets/ophydPushBtn.py +++ b/cls/devWidgets/ophydPushBtn.py @@ -30,11 +30,6 @@ # Moving color two_color = "rgb(79, 255, 144);" - -# def mycallback(kwargs): -# print(kwargs) - - def format_btn(title_color="black", bgcolor="transparent"): s = "QPushButton{ color: %s; background-color: %s;}" % (title_color, bgcolor) @@ -64,11 +59,6 @@ def __init__( toggle=False, ): super(ophydPushBtn, self).__init__(off_str) - if (not isinstance(device, Bo)) and (not isinstance(device, Mbbo)): - _logger.error( - "ophydPushBtn: Invalid device type: requires device to be of type Bo or Mbbo" - ) - return if btn is not None: # the user has passed in a different button for us to use so clone it @@ -240,11 +230,6 @@ def __init__( toggle=True, ): super(ophydPushBtnWithFbk, self).__init__(off_str) - if (not isinstance(device, Bo)) and (not isinstance(device, Mbbo)): - _logger.error( - "ophydPushBtnWithFbk: Invalid device type: requires device to be of type Bo" - ) - return if btn is not None: # the user has passed in a different button for us to use so clone it # skiplist = ['staticMetaObject', '__weakref__', 'parent', 'parentWidget'] @@ -315,13 +300,6 @@ def __init__( self.changed.connect(self.on_val_change) self.disconnected.connect(self.discon_fbk) self.connected.connect(self.init_fbk) - # dct = {self.sig_change_kw: pv.get()} - # print 'emiting changed[%d]' % init_val - # self.changed.emit(dct) - # self.discon_fbk() - - # if(self.pv.pv.connected): - # self.init_fbk() def get_fbk_valstr(self, val): """ @@ -340,23 +318,25 @@ def get_fbk_valstr(self, val): elif val == 1: val_str = str(self.fbk_dev.get("ONST")) else: - wrn_msg = f"Feedback device is of an unsupported type, setting to OFF_STR" if val == self.on_val: val_str = self.on_str - wrn_msg = f"Feedback device is of an unsupported type, setting to ON_STR" else: val_str = self.off_str - _logger.warn(wrn_msg) return val_str def make_checked(self, chkd): - # if self.toggle: - # # skip it - # return - self.btn.setChecked(chkd) + if chkd: + s = self.on_str + val = self.on_val + else: + s = self.off_str + val = self.off_val + self.btn.setText(s) + self.btn.device.put(val) + def on_connect(self, pvname=None, conn=None, pv=None): # print 'ca_aiLabelWidget: on_connect has been called' if conn: diff --git a/cls/plotWidgets/amb_bl10ID1_settings.json b/cls/plotWidgets/amb_bl10ID1_settings.json deleted file mode 100644 index 6ca627d6..00000000 --- a/cls/plotWidgets/amb_bl10ID1_settings.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "OSA": { - "CENTER": [ - 0, - 0 - ], - "RECT": [ - -1250, - 500, - 1250, - -5500 - ] - }, - "OSA_AMBIENT": { - "CENTER": [ - -751.771980942837, - -2501.8349350484177 - ], - "RECT": [ - -2001.7719809428395, - 498.16506495157427, - 498.2280190571655, - -5501.8349350484095 - ] - }, - "OSA_CRYO": { - "CENTER": [ - -1187.5421670895232, - -1000.5925262721269 - ], - "RECT": [ - -4187.5421670895175, - 249.5951432086572, - 1812.457832910471, - -2250.780195752911 - ] - }, - "SAMPLE_GONI": { - "CENTER": [ - 320.4466858789624, - -651.6853932584269 - ], - "RADIUS": 1000, - "RECT": [ - -494.5533141210376, - -511.68539325842687, - 1135.4466858789624, - -791.6853932584269 - ] - }, - "SAMPLE_STANDARD": { - "CENTER": [ - -2550.3974645796065, - 2707.6956184038504 - ], - "RADIUS": 1000, - "RECT": [ - -3365.3974645796065, - 2847.6956184038504, - -1735.3974645796065, - 2567.6956184038504 - ] - }, - "SMPL_HLDR": { - "CENTER": [ - 0, - 2500.0 - ], - "RADIUS": 1000, - "RECT": [ - -7000, - 7000, - 7000, - -2000 - ] - }, - "fpath": "C:\\controls\\git_sandbox\\branches\\pystxm\\zeromq_testing\\pyStxm3\\cls\\plotWidgets\\amb_bl10ID1_settings.json" -} \ No newline at end of file diff --git a/cls/plotWidgets/cryo_bl10ID1_settings.json b/cls/plotWidgets/cryo_bl10ID1_settings.json deleted file mode 100644 index d69ad307..00000000 --- a/cls/plotWidgets/cryo_bl10ID1_settings.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "OSA": { - "CENTER": [ - 0, - 0 - ], - "RECT": [ - -1250, - 500, - 1250, - -5500 - ] - }, - "OSA_AMBIENT": { - "CENTER": [ - -1247.7022682879685, - -1595.9402372900463 - ], - "RECT": [ - -2497.7022682879715, - 1404.0597627099448, - 2.2977317120344196, - -4595.940237290038 - ] - }, - "OSA_CRYO": { - "CENTER": [ - -1187.5421670895232, - -1000.5925262721269 - ], - "RECT": [ - -4187.5421670895175, - 249.5951432086572, - 1812.457832910471, - -2250.780195752911 - ] - }, - "SAMPLE_GONI": { - "CENTER": [ - 320.4466858789624, - -651.6853932584269 - ], - "RADIUS": 1000, - "RECT": [ - -494.5533141210376, - -511.68539325842687, - 1135.4466858789624, - -791.6853932584269 - ] - }, - "SAMPLE_STANDARD": { - "CENTER": [ - -2550.3974645796065, - 2707.6956184038504 - ], - "RADIUS": 1000, - "RECT": [ - -3365.3974645796065, - 2847.6956184038504, - -1735.3974645796065, - 2567.6956184038504 - ] - }, - "SMPL_HLDR": { - "CENTER": [ - 0, - 2500.0 - ], - "RADIUS": 1000, - "RECT": [ - -7000, - 7000, - 7000, - -2000 - ] - }, - "fpath": "C:\\controls\\sandbox\\branches\\193\\pyStxm3\\cls\\plotWidgets\\cryo_bl10ID1_settings.json" -} \ No newline at end of file diff --git a/cls/plotWidgets/imageWidget.py b/cls/plotWidgets/imageWidget.py index 6a932963..65a98af8 100644 --- a/cls/plotWidgets/imageWidget.py +++ b/cls/plotWidgets/imageWidget.py @@ -8,18 +8,18 @@ import sys import os import timeit -from typing import Dict, Optional, Tuple, Union -from PyQt5 import QtGui, QtWidgets +from typing import Dict, Optional +from PyQt5 import QtGui from PyQt5 import QtCore from PyQt5.QtCore import pyqtSignal, QObject, QTimer, QPointF, QRectF, Qt from PyQt5 import uic -import copy import qwt as Qwt import simplejson as json import numpy as np -from cls.utils.roi_utils import make_base_wdg_com, widget_com_cmnd_types +from cls.utils.bl_config_reader import BeamlineConfigReader +from cls.utils.roi_utils import make_base_wdg_com from cls.types.stxmTypes import SPEC_ROI_PREFIX, scan_types from plotpy.plot import PlotOptions from plotpy.mathutils.colormap import get_cmap, register_extra_colormap @@ -30,17 +30,14 @@ ImageParam, ImageAxesParam, GridParam, - CurveParam, ) -from cls.plotWidgets.config import _, DEFAULTS - +from cls.plotWidgets.config import _ from plotpy.items import shape from plotpy.items import ImageItem, TrImageItem, LabelItem, HistogramItem from guidata.qthelpers import add_actions from guidata.configtools import get_icon -from guidata.config import CONF def _nanmin(data): @@ -63,9 +60,7 @@ def _nanmax(data): from plotpy.interfaces import ( ICSImageItemType, - IPanel, IBasePlotItem, - ICurveItemType, IShapeItemType, IDecoratorItemType, ) @@ -95,9 +90,6 @@ def _nanmax(data): from cls.plotWidgets.tools.annotatedHorizontalSegment import AnnotatedHorizontalSegment -from cls.plotWidgets.stxm_osa_dflt_settings import ( - make_dflt_stxm_osa_smplholder_settings_dct, -) from cls.plotWidgets.tools import ROITool, clsSquareAspectRatioTool from cls.utils.excepthook import exception from cls.utils.nextFactor import nextFactor @@ -105,12 +97,10 @@ def _nanmax(data): from cls.utils.fileUtils import get_file_path_as_parts from cls.utils.log import get_module_logger from cls.utils.dict_utils import dct_get, dct_put -from cls.utils.json_utils import file_to_json -from cls.utils.cfgparser import ConfigClass from cls.utils.time_utils import datetime_string_to_seconds from cls.stylesheets import master_colors -from cls.appWidgets.dialogs import excepthook, errorMessage +from cls.appWidgets.dialogs import excepthook from cls.plotWidgets import tools from cls.plotWidgets.shape_restrictions import ROILimitObj, ROILimitDef, ROI_STATE_ALARM from cls.utils.roi_utils import ( @@ -121,7 +111,6 @@ def _nanmax(data): is_unique_roi_id_in_list, get_current_unique_id, set_current_unique_id, - delete_unique_id, ) from cls.utils.roi_dict_defs import * from cls.plotWidgets.color_def import ( @@ -136,9 +125,6 @@ def _nanmax(data): import cls.types.stxmTypes as types -from cls.utils.save_settings import SaveSettings -from cls.utils.json_threadsave import mime_to_dct - from cls.data_io.stxm_data_io import STXMDataIo from cls.scanning.dataRecorder import DataIo #from cls.plotWidgets.CLSPlotItemBuilder import clsPlotItemBuilder @@ -146,9 +132,7 @@ def _nanmax(data): from cls.utils.threaded_image_loader import ThreadpoolImageLoader from cls.plotWidgets.shapes.utils import ( - create_rect_centerd_at, create_rectangle, - create_simple_circle, ) @@ -206,6 +190,8 @@ def _nanmax(data): FILTER_STRING = "*.hdf5;*.png;*.jpg" MAX_IMAGE_Z = 1000 +sample_holder_counter = 0 +osa_holder_counter = 0 # setup module logger with a default do-nothing handler _logger = get_module_logger(__name__) @@ -356,7 +342,7 @@ def __init__( type="basic", sample_pos_mode=None, options=None, - settings_fname="settings.json", + #settings_fname="shape_settings.json", ): """ __init__(): description @@ -474,16 +460,16 @@ def __init__( title="", toolbar=True, edit=False, options=options ) self.setObjectName("ImageWidgetPlot") - self.settings_fname = os.path.join(plotDir, settings_fname) - if not os.path.exists(self.settings_fname): - osa_smplhldr_dct = make_dflt_stxm_osa_smplholder_settings_dct( - self.settings_fname - ) - - else: - osa_smplhldr_dct = file_to_json(self.settings_fname) - - self.ss = SaveSettings(self.settings_fname, dct_template=osa_smplhldr_dct) + # self.settings_fname = os.path.join(plotDir, settings_fname) + # if not os.path.exists(self.settings_fname): + # osa_smplhldr_dct = make_dflt_stxm_osa_smplholder_settings_dct( + # self.settings_fname + # ) + # + # else: + # osa_smplhldr_dct = file_to_json(self.settings_fname) + # + # self.ss = SaveSettings(self.settings_fname, dct_template=osa_smplhldr_dct) contrast_pnl = self.get_contrast_panel() gpplot = contrast_pnl.get_plot() @@ -612,6 +598,14 @@ def __init__( _cpnl.histogram.range.shapeparam.fill = "yellow" _cpnl.histogram.range.shapeparam.shade = 0.15 + self.standard_sample_holder = None + self.osa_holder = None + + # will pull the current beamline configuration specified in app.ini + bl_cfg = BeamlineConfigReader() + self.sample_holder_class_name = bl_cfg.get_setting("BL_CFG_MAIN", "sample_holder_shape_class") + self.osa_holder_shape_class_name = bl_cfg.get_setting("BL_CFG_MAIN", "osa_holder_shape_class") + def get_xcs_panel(self): ''' @@ -1362,6 +1356,35 @@ def activate_tool(self, toolstr): tool.activate() + # def register_osa_and_samplehldr_tool( + # self, sample_pos_mode=types.sample_positioning_modes.COARSE + # ): + # """ + # register_osa_and_samplehldr_tool(): register the osa and sample holder tools + # + # :returns: None + # """ + # global sample_holder_counter + # self.standard_sample_holder = Standard6HoleHolderShape(self, shp_id=sample_holder_counter) + # sht = self.add_tool(tools.StxmShowSampleHolderTool) + # sample_holder_counter += 1 + # + # osat = self.add_tool(tools.StxmShowOSATool) + # + # if sample_pos_mode == types.sample_positioning_modes.GONIOMETER: + # self.osa_holder = OSALaddPtychoHolderShape(self) + # osat.changed.connect(self.create_uhv_osa) + # self.osa_type = OSA_CRYO + # sht.changed.connect(self.create_goni_sample_holder) + # self.sample_hldr_type = SAMPLE_GONI + # + # else: + # self.osa_type = OSA_AMBIENT + # self.osa_holder = OSAHorizontalRowHolderShape(self) + # osat.changed.connect(self.create_osa) + # sht.changed.connect(self.create_stdrd_sample_holder) + # self.sample_hldr_type = SAMPLE_STANDARD + def register_osa_and_samplehldr_tool( self, sample_pos_mode=types.sample_positioning_modes.COARSE ): @@ -1370,21 +1393,34 @@ def register_osa_and_samplehldr_tool( :returns: None """ + global sample_holder_counter, osa_holder_counter + + #self.standard_sample_holder = Standard6HoleHolderShape(self, shp_id=sample_holder_counter) + self.sample_holder = globals()[self.sample_holder_class_name](self, shp_id=sample_holder_counter) sht = self.add_tool(tools.StxmShowSampleHolderTool) + sht.changed.connect(self.create_sample_holder) + sample_holder_counter += 1 + osat = self.add_tool(tools.StxmShowOSATool) + self.osa_holder = globals()[self.osa_holder_shape_class_name](self, shp_id=osa_holder_counter) + osat.changed.connect(self.create_osa) + osa_holder_counter += 1 if sample_pos_mode == types.sample_positioning_modes.GONIOMETER: - osat.changed.connect(self.create_uhv_osa) + #self.osa_holder = OSALaddPtychoHolderShape(self) + #osat.changed.connect(self.create_uhv_osa) self.osa_type = OSA_CRYO - sht.changed.connect(self.create_goni_sample_holder) + #sht.changed.connect(self.create_goni_sample_holder) self.sample_hldr_type = SAMPLE_GONI else: self.osa_type = OSA_AMBIENT + # self.osa_holder = OSAHorizontalRowHolderShape(self) osat.changed.connect(self.create_osa) sht.changed.connect(self.create_stdrd_sample_holder) self.sample_hldr_type = SAMPLE_STANDARD + def register_samplehldr_tool( self, sample_pos_mode=types.sample_positioning_modes.COARSE ): @@ -1393,14 +1429,21 @@ def register_samplehldr_tool( :returns: None """ + global sample_holder_counter + # self.standard_sample_holder = Standard6HoleHolderShape(self, shp_id=sample_holder_counter) + # sht = self.add_tool(tools.StxmShowSampleHolderTool) + # sample_holder_counter += 1 + self.sample_holder = globals()[self.sample_holder_class_name](self, shp_id=sample_holder_counter) sht = self.add_tool(tools.StxmShowSampleHolderTool) + sht.changed.connect(self.create_sample_holder) + sample_holder_counter += 1 if sample_pos_mode == types.sample_positioning_modes.GONIOMETER: - sht.changed.connect(self.create_goni_sample_holder) + #sht.changed.connect(self.create_goni_sample_holder) self.sample_hldr_type = SAMPLE_GONI else: - sht.changed.connect(self.create_stdrd_sample_holder) + #sht.changed.connect(self.create_stdrd_sample_holder) self.sample_hldr_type = SAMPLE_STANDARD def register_osa_tool(self, sample_pos_mode=types.sample_positioning_modes.COARSE): @@ -1409,10 +1452,18 @@ def register_osa_tool(self, sample_pos_mode=types.sample_positioning_modes.COARS :returns: None """ + global osa_holder_counter + # self.osa_holder = OSAHorizontalRowHolderShape(self, shp_id=osa_holder_counter) + # osat = self.add_tool(tools.StxmShowOSATool) + # osa_holder_counter += 1 osat = self.add_tool(tools.StxmShowOSATool) + self.osa_holder = globals()[self.osa_holder_shape_class_name](self, shp_id=osa_holder_counter) + osat.changed.connect(self.create_osa) + osa_holder_counter += 1 if sample_pos_mode == types.sample_positioning_modes.GONIOMETER: - osat.changed.connect(self.create_uhv_osa) + #self.osa_holder = OSALaddPtychoHolderShape(self) + #osat.changed.connect(self.create_uhv_osa) self.osa_type = OSA_CRYO else: @@ -1702,7 +1753,7 @@ def addTool(self, toolstr, is_visible=True, units="um"): elif toolstr == "tools.StxmShowSampleHolderTool": tool = self.add_tool(tools.StxmShowSampleHolderTool) - if sample_pos_mode == types.sample_positioning_modes.GONIOMETER: + if self.sample_pos_mode == types.sample_positioning_modes.GONIOMETER: tool.changed.connect(self.create_goni_sample_holder) self.sample_hldr_type = SAMPLE_GONI else: @@ -1711,7 +1762,7 @@ def addTool(self, toolstr, is_visible=True, units="um"): elif toolstr == "tools.StxmShowOSATool": tool = self.add_tool(tools.StxmShowOSATool) - if sample_pos_mode == types.sample_positioning_modes.GONIOMETER: + if self.sample_pos_mode == types.sample_positioning_modes.GONIOMETER: tool.changed.connect(self.create_uhv_osa) self.osa_type = OSA_CRYO @@ -2364,7 +2415,6 @@ def create_target_circle(self, xc, yc, val): :returns: None """ - from plotpy.styles import ShapeParam # circ = make.annotated_circle(x0, y0, x1, y1, ratio, title, subtitle) rad = val / 2.0 @@ -2383,50 +2433,6 @@ def create_target_circle(self, xc, yc, val): circ.shape.set_item_parameters({"ShapeParam": circ.shape.shapeparam}) self.plot.add_item(circ, z=999999999) - def create_osa(self, do_it=True): - """ - create_osa(): description - - :returns: None - """ - if do_it: - # rad = 1000 - # xc = -1230 - # xc = 0.0 - # yc = 0.0 - # rect = (-1250, 500, 1250, -5500) - - xc, yc = self.ss.get("OSA_AMBIENT.CENTER") - rect = self.ss.get("OSA_AMBIENT.RECT") - - create_rectangle(rect, title="osa_rect", plot=self.plot) - - create_simple_circle( - rect[0] + 500, rect[1] - 500, 20, title="osa_1", plot=self.plot - ) - create_simple_circle( - rect[0] + 1000, rect[1] - 500, 25, title="osa_2", plot=self.plot - ) - create_simple_circle( - rect[0] + 1500, rect[1] - 500, 30, title="osa_3", plot=self.plot - ) - create_simple_circle( - rect[0] + 2000, rect[1] - 500, 35, title="osa_4", plot=self.plot - ) - - else: - # remove the sample_holder - self.blockSignals(True) - shapes = self.plot.get_items(item_type=IShapeItemType) - for shape in shapes: - if hasattr(shape, "shapeparam"): - s = shape.shapeparam - title = s._title - if title.find("osa_") > -1: - self.delPlotItem(shape) - self.blockSignals(False) - self.plot.replot() - def create_beam_spot(self, xc, yc, size=0.5): """ a function to create a beam spot shape that will show the current position of the beam on the plot @@ -2452,82 +2458,42 @@ def move_beam_spot(self, xc, yc): self.plot.replot() - def create_uhv_osa(self, do_it=True): + def create_osa(self, do_it=True): """ create_osa(): description :returns: None """ - if do_it: - xc, yc = self.ss.get("OSA_CRYO.CENTER") - rect = self.ss.get("OSA_CRYO.RECT") - x2 = rect[2] - y1 = rect[1] - create_rectangle(rect, title="osa_rect", plot=self.plot) - # from outboard to inboard - create_simple_circle(x2 - 250, y1 - 250, 35, title="osa_1", plot=self.plot) - create_simple_circle(x2 - 250, y1 - 2250, 35, title="osa_2", plot=self.plot) + self.osa_holder.create_shape(do_it) + self.plot.replot() - else: - # remove the sample_holder + def create_uhv_osa(self, do_it=True): + """ + create_osa(): description - self.blockSignals(True) - shapes = self.plot.get_items(item_type=IShapeItemType) + :returns: None + """ + self.osa_holder.create_shape(do_it) + self.plot.replot() - for shape in shapes: - title = "" - if hasattr(shape, "annotationparam"): - title = shape.annotationparam._title - elif hasattr(shape, "shapeparam"): - title = shape.shapeparam._title - if title.find("osa_") > -1: - self.delPlotItem(shape) + def create_sample_holder(self, do_it=True): + """ + create_sample_holder(): description - self.blockSignals(False) + :returns: None + """ + self.sample_holder.create_shape(do_it) self.plot.replot() + def create_stdrd_sample_holder(self, do_it=True): """ create_sample_holder(): description :returns: None """ - HOLE_DIAMETER = 2500 - if do_it: - rad = self.ss.get("%s.RADIUS" % SAMPLE_STANDARD) - rect = self.ss.get("%s.RECT" % SAMPLE_STANDARD) - xc = (rect[0] + rect[2]) * 0.5 - yc = (rect[1] + rect[3] - 5000) * 0.5 - - create_rectangle(rect, title="sh_rect") - - create_simple_circle(xc - 5000, yc, rad, title="sh_1", plot=self.plot) - create_simple_circle(xc, yc, rad, title="sh_2", plot=self.plot) - create_simple_circle(xc + 5000, yc, rad, title="sh_3", plot=self.plot) - - create_simple_circle( - xc - 5000, yc + 5000, rad, title="sh_4", plot=self.plot - ) - create_simple_circle(xc, yc + 5000, rad, title="sh_5", plot=self.plot) - create_simple_circle( - xc + 5000, yc + 5000, rad, title="sh_6", plot=self.plot - ) - else: - # remove the sample_holder - self.blockSignals(True) - shapes = self.plot.get_items(item_type=IShapeItemType) - for shape in shapes: - title = "" - if hasattr(shape, "annotationparam"): - title = shape.annotationparam._title - elif hasattr(shape, "shapeparam"): - title = shape.shapeparam._title - # s = shape.shapeparam - # title = s._title - if title.find("sh_") > -1: - self.delPlotItem(shape) - self.blockSignals(False) + self.sample_holder.create_shape(do_it) self.plot.replot() def create_goni_sample_holder(self, do_it=True): @@ -2536,59 +2502,62 @@ def create_goni_sample_holder(self, do_it=True): :returns: None """ - if do_it: - rad = self.ss.get("%s.RADIUS" % SAMPLE_GONI) - rect = self.ss.get("%s.RECT" % SAMPLE_GONI) - xc, yc = self.ss.get("%s.CENTER" % SAMPLE_GONI) - # xc = (rect[0] + rect[2]) * 0.5 - # yc = (rect[1] + rect[3] - 5000) * 0.5 - frame = (0.0, 600.0, 3000.0, -600.0) - frame_outbrd_edge = xc - ((frame[0] + frame[2]) / 2.0) - - hole = (-100, 400, 100, -400) - - # self.create_rectangle(new_rect, title='sh_rect') - create_rect_centerd_at(frame, xc, yc, title="sh_rect", plot=self.plot) - create_rect_centerd_at( - hole, frame_outbrd_edge + 385.0, yc, title="sh_1", plot=self.plot - ) - create_rect_centerd_at( - hole, frame_outbrd_edge + 660.0, yc, title="sh_1", plot=self.plot - ) - create_rect_centerd_at( - hole, frame_outbrd_edge + 935.0, yc, title="sh_2", plot=self.plot - ) - create_rect_centerd_at( - hole, frame_outbrd_edge + 1210.0, yc, title="sh_3", plot=self.plot - ) - create_rect_centerd_at( - hole, frame_outbrd_edge + 1485.0, yc, title="sh_4", plot=self.plot - ) - create_rect_centerd_at( - hole, frame_outbrd_edge + 1760.0, yc, title="sh_5", plot=self.plot - ) - create_rect_centerd_at( - hole, frame_outbrd_edge + 2035.0, yc, title="sh_6", plot=self.plot - ) - # self.create_rect_centerd_at(hole, frame_outbrd_edge + 1945.0, yc , title='sh_7') - # self.create_rect_centerd_at(hole, frame_outbrd_edge + 100.0, yc , title='sh_8') - - else: - # else: - # remove the sample_holder - self.blockSignals(True) - shapes = self.plot.get_items(item_type=IShapeItemType) - for shape in shapes: - title = "" - if hasattr(shape, "annotationparam"): - title = shape.annotationparam._title - elif hasattr(shape, "shapeparam"): - title = shape.shapeparam._title - if title.find("sh_") > -1: - self.delPlotItem(shape) - self.blockSignals(False) + self.sample_holder.create_shape(do_it) self.plot.replot() + # if do_it: + # rad = self.ss.get("%s.RADIUS" % SAMPLE_GONI) + # rect = self.ss.get("%s.RECT" % SAMPLE_GONI) + # xc, yc = self.ss.get("%s.CENTER" % SAMPLE_GONI) + # # xc = (rect[0] + rect[2]) * 0.5 + # # yc = (rect[1] + rect[3] - 5000) * 0.5 + # frame = (0.0, 600.0, 3000.0, -600.0) + # frame_outbrd_edge = xc - ((frame[0] + frame[2]) / 2.0) + # + # hole = (-100, 400, 100, -400) + # + # # self.create_rectangle(new_rect, title='sh_rect') + # create_rect_centerd_at(frame, xc, yc, title="sh_rect", plot=self.plot) + # create_rect_centerd_at( + # hole, frame_outbrd_edge + 385.0, yc, title="sh_1", plot=self.plot + # ) + # create_rect_centerd_at( + # hole, frame_outbrd_edge + 660.0, yc, title="sh_1", plot=self.plot + # ) + # create_rect_centerd_at( + # hole, frame_outbrd_edge + 935.0, yc, title="sh_2", plot=self.plot + # ) + # create_rect_centerd_at( + # hole, frame_outbrd_edge + 1210.0, yc, title="sh_3", plot=self.plot + # ) + # create_rect_centerd_at( + # hole, frame_outbrd_edge + 1485.0, yc, title="sh_4", plot=self.plot + # ) + # create_rect_centerd_at( + # hole, frame_outbrd_edge + 1760.0, yc, title="sh_5", plot=self.plot + # ) + # create_rect_centerd_at( + # hole, frame_outbrd_edge + 2035.0, yc, title="sh_6", plot=self.plot + # ) + # # self.create_rect_centerd_at(hole, frame_outbrd_edge + 1945.0, yc , title='sh_7') + # # self.create_rect_centerd_at(hole, frame_outbrd_edge + 100.0, yc , title='sh_8') + # + # else: + # # else: + # # remove the sample_holder + # self.blockSignals(True) + # shapes = self.plot.get_items(item_type=IShapeItemType) + # for shape in shapes: + # title = "" + # if hasattr(shape, "annotationparam"): + # title = shape.annotationparam._title + # elif hasattr(shape, "shapeparam"): + # title = shape.shapeparam._title + # if title.find("sh_") > -1: + # self.delPlotItem(shape) + # self.blockSignals(False) + # self.plot.replot() + def show_pattern(self, xc=None, yc=None, pad_size=1.0, do_show=True): # passing self will allow the pattern to be added to the plotter if do_show: @@ -2853,10 +2822,11 @@ def select_main_rect_of_shape(self, _title="sh_"): # else: # main_rect = main_rect.united(qrect) else: - print( - "select_main_rect_of_shape: the shape title [%s] didnt match [%s]" - % (title, _title) - ) + # print( + # "select_main_rect_of_shape: the shape title [%s] didnt match [%s]" + # % (title, _title) + # ) + pass if len(selected_shapes) > 0: selected_shapes.reverse() for sh in selected_shapes: @@ -3088,6 +3058,7 @@ def active_item_moved(self, item): :returns: None """ + title = "" if type(item) == TrImageItem: #user moved an image they loaded so emit new center self.inputState.keyisPressed[Qt.Key_Alt] = True @@ -3113,6 +3084,9 @@ def active_item_moved(self, item): else: if self.inputState.keyisPressed[Qt.Key_Alt]: self._emit_new_roi(self.image_type) + elif hasattr(item, "_shape_object"): + # update the shape objects coordinates + item._shape_object.set_center_position(item.get_center()) elif hasattr(item, "shapeparam"): shape = item.shapeparam @@ -3130,25 +3104,24 @@ def active_item_moved(self, item): if title.find("osa_") > -1: shape = self.get_shape_with_this_title("osa_rect") if shape: - self.ss.set("%s.CENTER" % self.osa_type, shape.get_center()) - self.ss.set("%s.RECT" % self.osa_type, shape.get_rect()) - self.ss.update() + #self.ss.set("%s.RECT" % self.osa_type, shape.get_rect()) + #self.ss.update() + shape._shape_object.set_center_position(shape.get_center()) + shape._shape_object.set_rect(shape.get_rect()) if title.find("sh_") > -1: shape = self.get_shape_with_this_title("sh_rect") if shape: - self.ss.set("%s.CENTER" % self.sample_hldr_type, shape.get_center()) - self.ss.set("%s.RECT" % self.sample_hldr_type, shape.get_rect()) - self.ss.update() + shape._shape_object.set_center_position(shape.get_center()) + shape._shape_object.set_rect(shape.get_rect()) regd_shape = self.get_shape_from_registry(title) if regd_shape: # only look at first 5 chars if title.find(regd_shape["shape_title"][0:5]) > -1: cntr = item.get_center() - self.ss.set("%s.CENTER" % regd_shape["shape_title"].upper(), cntr) - # self.ss.set('%s.RECT' % regd_shape['shape_title'].upper(), shape.get_rect()) - self.ss.update() + # self.ss.set("%s.CENTER" % regd_shape["shape_title"].upper(), cntr) + # self.ss.update() self._emit_new_roi(self.image_type) else: @@ -5704,7 +5677,6 @@ def getShapeItemsByShapeInstance(self, shape_inst=None): def get_shape_item_types(self, item): if isinstance(item, AnnotatedRectangle): return { - "shape_type": AnnotatedRectangle, "spatial_type": types.spatial_type_prefix.ROI, } @@ -5738,20 +5710,15 @@ def delPlotItem(self, item, replot=True): :returns: None """ - # Don't delete the base image - # if(item.title().text() != 'Image #1'): if not isinstance(item, ICSImageItemType): title = str(item.title().text()) # print 'deleting %s' % title self.region_deleted.emit(title) self.plot.del_item(item) - # print 'deleteing [%s] with unique_id [%d]' % (str(item.title().text()), item.unique_id) - # print 'id(item)=%d, unique=%d' % (id(item), item.unique_id) if hasattr(item, "_parent_tool"): item._parent_tool.re_init_unique_id() del item # signal to anyone listening that we are deleting this item - # print 'delPlotItem: emitting_new_roi with cmnd=DEL_ROI' self._emit_new_roi(None, cmnd=widget_com_cmnd_types.DEL_ROI) if replot: @@ -5790,11 +5757,16 @@ def delShapePlotItems(self, exclude_rois=False): """ items = self.plot.get_items(item_type=IShapeItemType) for item in items: + if hasattr(item, "shape_item"): + # delete the shape object fo rsample or osa holder + item.shape_item = None if not exclude_rois: if hasattr(item, "title"): if item.title().text().find(SPEC_ROI_PREFIX) == -1: + print(f"deleting shape item 1: {item.title().text()} or type {type(item)}") self.delShapePlotItem(item, replot=False) else: + print(f"deleting shape item 2: {item.title().text()} or type {type(item)}") self.delShapePlotItem(item, replot=False) self.plot.replot() @@ -6528,8 +6500,6 @@ def load_image_data( # can update the scan param widgets. self.blockSignals(False) - self.scan_loaded.emit(wdg_com) - if self.show_image_params: self.display_image_params(fprefix, sp_db) else: @@ -7096,8 +7066,6 @@ def make_default_stand_alone_stxm_imagewidget( # global win # print 'on_new_beamspot_fbk: (%.2f, %.2f)' % (cx, cy) # win.move_beam_spot(cx, cy) - from cls.utils.cfgparser import ConfigClass - from cls.applications.pyStxm import abs_path_to_ini_file # appConfig = ConfigClass(abs_path_to_ini_file) # scan_mode = MAIN_OBJ.get_sample_scanning_mode_string() @@ -7581,8 +7549,6 @@ def on_new_roi(object): app.exec_() def astxm_lineplot_test(): - from cls.utils.roi_utils import on_centerxy_changed - ss = get_style() app = guidata.qapplication() sys.excepthook = excepthook @@ -7798,7 +7764,6 @@ def set_cs_grid_parameters(self, forgrnd_color, bkgrnd_color, min_color, maj_col from cls.stylesheets import get_style from bcm.devices import MotorQt as apsMotor from PyQt5.QtCore import pyqtSignal, QObject - from cls.utils.profiling import determine_profile_bias_val, profile_it # profile_it('go', bias_val=7.40181638985e-07) # go() diff --git a/cls/plotWidgets/maxiv_pixelator_settings.json b/cls/plotWidgets/maxiv_pixelator_settings.json deleted file mode 100644 index 942ff930..00000000 --- a/cls/plotWidgets/maxiv_pixelator_settings.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "OSA": { - "CENTER": [ - 0, - 0 - ], - "RECT": [ - -1250, - 500, - 1250, - -5500 - ] - }, - "OSA_AMBIENT": { - "CENTER": [ - -1247.7022682879685, - -1595.9402372900463 - ], - "RECT": [ - -2497.7022682879715, - 1404.0597627099448, - 2.2977317120344196, - -4595.940237290038 - ] - }, - "OSA_CRYO": { - "CENTER": [ - -1187.5421670895232, - -1000.5925262721269 - ], - "RECT": [ - -4187.5421670895175, - 249.5951432086572, - 1812.457832910471, - -2250.780195752911 - ] - }, - "SAMPLE_GONI": { - "CENTER": [ - 320.4466858789624, - -651.6853932584269 - ], - "RADIUS": 1000, - "RECT": [ - -494.5533141210376, - -511.68539325842687, - 1135.4466858789624, - -791.6853932584269 - ] - }, - "SAMPLE_STANDARD": { - "CENTER": [ - -2550.3974645796065, - 2707.6956184038504 - ], - "RADIUS": 1000, - "RECT": [ - -3365.3974645796065, - 2847.6956184038504, - -1735.3974645796065, - 2567.6956184038504 - ] - }, - "SMPL_HLDR": { - "CENTER": [ - 0, - 2500.0 - ], - "RADIUS": 1000, - "RECT": [ - -7000, - 7000, - 7000, - -2000 - ] - }, - "fpath": "/home/bergr/srv-unix-home/github/pyStxm/branches/23/pyStxm/cls/plotWidgets/maxiv_pixelator_settings.json" -} \ No newline at end of file diff --git a/cls/plotWidgets/settings.json b/cls/plotWidgets/settings.json deleted file mode 100644 index 6853e506..00000000 --- a/cls/plotWidgets/settings.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "OSA": { - "CENTER": [ - 0, - 0 - ], - "RECT": [ - -1250, - 500, - 1250, - -5500 - ] - }, - "OSA_AMBIENT": { - "CENTER": [ - -1247.7022682879685, - -1595.9402372900463 - ], - "RECT": [ - -2497.7022682879715, - 1404.0597627099448, - 2.2977317120344196, - -4595.940237290038 - ] - }, - "OSA_CRYO": { - "CENTER": [ - -1176.2002924264427, - -1000.5925262721269 - ], - "RECT": [ - -4176.200292426437, - 249.5951432086572, - 1823.7997075735516, - -2250.780195752911 - ] - }, - "PATTERN": { - "CENTER": [ - 0.3809155968510787, - 1.1847353470144704 - ] - }, - "SAMPLE_GONI": { - "CENTER": [ - 153.8807954117574, - 234.62851931936183 - ], - "RADIUS": 1000, - "RECT": [ - -1346.1192045882426, - 834.6285193193618, - 1653.8807954117574, - -365.3714806806381 - ] - }, - "SAMPLE_STANDARD": { - "CENTER": [ - -2550.3974645796065, - 2707.6956184038504 - ], - "RADIUS": 1000, - "RECT": [ - -3365.3974645796065, - 2847.6956184038504, - -1735.3974645796065, - 2567.6956184038504 - ] - }, - "SMPL_HLDR": { - "CENTER": [ - 0, - 2500.0 - ], - "RADIUS": 1000, - "RECT": [ - -7000, - 7000, - 7000, - -2000 - ] - }, - "fpath": "C:\\controls\\sandbox\\branches\\xx\\pyStxm3\\cls\\plotWidgets\\settings.json" -} \ No newline at end of file diff --git a/cls/plotWidgets/shapes/__init__.py b/cls/plotWidgets/shapes/__init__.py index ec51c5a2..a4e94e10 100644 --- a/cls/plotWidgets/shapes/__init__.py +++ b/cls/plotWidgets/shapes/__init__.py @@ -1,2 +1,10 @@ # -*- coding: utf-8 -*- # +from cls.plotWidgets.shapes.sample_holders.standard_6_hole_holder import Standard6HoleHolderShape +from cls.plotWidgets.shapes.sample_holders.cryo_goniometer_holder import CryoGoniometerHolderShape + +from cls.plotWidgets.shapes.osa_holders.osa_horizontal_row import OSAHorizontalRowHolderShape +from cls.plotWidgets.shapes.osa_holders.osa_ladd_ptycho import OSALaddPtychoHolderShape + + + diff --git a/cls/plotWidgets/shapes/base_shape.py b/cls/plotWidgets/shapes/base_shape.py new file mode 100644 index 00000000..be1ff232 --- /dev/null +++ b/cls/plotWidgets/shapes/base_shape.py @@ -0,0 +1,169 @@ +import os + +from plotpy.interfaces import IShapeItemType +from cls.utils.json_utils import dict_to_json, json_to_dict, json_to_file, file_to_json + +shapes_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "settings")) + +class BaseShape(object): + def __init__(self, category=None, name=None, prefix='', parent=None): + if name is None: + raise ValueError("name must be provided") + self.category = category + self.name = name + self.shape_prefix = prefix + #self.settings_fname = os.path.join(shapes_dir, f"{self.name}_settings.json") + self.settings_fname = os.path.join(shapes_dir, "settings.json") + self.shape_item = None + self.center = (0, 0) + self.size = (1, 1) + self.rect = [0,0,0,0 ] + self.color = (50, 50, 50) # Blue color for the holder + self.rotation = 0 + self.parent = parent + self.init_settings() + + def init_settings(self): + """ + initialize the shape parameters + :return: None + """ + try: + self.load_settings() + except Exception as e: + # print(f"Could not load shape settings from {self.settings_fname}, using defaults. Error: {e}") + self.save_settings() + + def save_settings(self): + """ + Update the shape parameters in the settings file under self.category and self.name. + :return: json string + """ + # print(f"Saving settings for category [{self.category}] name [{self.name}] to {self.settings_fname}") + if os.path.exists(self.settings_fname): + js = file_to_json(self.settings_fname) + settings = json_to_dict(js) + else: + # print(f"Settings file {self.settings_fname} does not exist. Creating a new one for " + # f"category=[{self.category}] name [{self.name}].") + settings = {} + + # Ensure the category exists + if self.category not in settings: + print(f"Category [{self.category}] not found in settings. Creating new category.") + settings[self.category] = {} + + + # Update or add the shape under the category + settings[self.category][self.name] = { + "center": self.center, + "rotation": self.rotation, + "rect": self.rect, + "name": self.name + } + + js = dict_to_json(settings) + json_to_file(self.settings_fname, js) + # print(f"Settings saved successfully for category [{self.category}] name [{self.name}].") + return js + + def load_settings(self): + """ + Load the shape parameters from the settings file using self.category and self.name. + """ + if not os.path.exists(self.settings_fname): + return + js = file_to_json(self.settings_fname) + settings = json_to_dict(js) + if self.category in settings and self.name in settings[self.category]: + shape_dict = settings[self.category][self.name] + self.center = tuple(shape_dict.get("center", self.center)) + self.rotation = shape_dict.get("rotation", self.rotation) + self.rect = list(shape_dict.get("rect", self.rect)) + self.name = shape_dict.get("name", self.name) + else: + raise ValueError(f"Shape settings for category '{self.category}' and name '{self.name}' not found.") + + + def create_shape(self, do_it=True): + """ + create the shape(): description + the main function _create_shape() to be implemented by inheriting class + """ + if do_it: + self._create_shape() + else: + + # remove the shapes with shape_prefix + self.parent.blockSignals(True) + shapes = self.parent.plot.get_items(item_type=IShapeItemType) + for shape in shapes: + title = "" + if hasattr(shape, "annotationparam"): + title = shape.annotationparam._title + elif hasattr(shape, "shapeparam"): + title = shape.shapeparam._title + if title.find(self.shape_prefix) > -1: + self.parent.delPlotItem(shape) + self.parent.blockSignals(False) + + def set_color(self, color): + """ + set the color of the shape + :param color: tuple of (r,g,b) + :return: None + """ + self.color = color + self.save_settings() + + def set_center_position(self, position): + """ + set the position of the shape + :param position: tuple of (x,y) + """ + self.center = position + self.save_settings() + + def set_rect(self, rect): + """ + set the rect of the shape + :param rect: list of [x0, y0, x1, y1] + """ + self.rect = rect + #self.save_settings() + + def set_rotation(self, rotation): + """ + set the rotation of the shape + :param rotation: rotation in degrees + """ + self.rotation = rotation + self.save_settings() + + def set_size(self, size): + """ + set the size of the shape + :param size: tuple of (width, height) + """ + self.size = size + #self.save_settings() + + def set_shapes_visible(self, prefix='', visible=True): + shapes = self.parent.plot.get_items(item_type=IShapeItemType) + for shape in shapes: + title = "" + if hasattr(shape, "annotationparam"): + title = shape.annotationparam._title + elif hasattr(shape, "shapeparam"): + title = shape.shapeparam._title + if title.find(prefix) > -1: + # self.parent.delPlotItem(shape) + shape.setVisible(visible) + + + + + + + + diff --git a/cls/plotWidgets/shapes/osa_holders/__init__.py b/cls/plotWidgets/shapes/osa_holders/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/cls/plotWidgets/shapes/osa_holders/osa_horizontal_row.py b/cls/plotWidgets/shapes/osa_holders/osa_horizontal_row.py new file mode 100644 index 00000000..d3001ded --- /dev/null +++ b/cls/plotWidgets/shapes/osa_holders/osa_horizontal_row.py @@ -0,0 +1,92 @@ +import os + +from cls.plotWidgets.shapes.base_shape import BaseShape +from cls.plotWidgets.shapes.utils import create_simple_circle, create_rectangle, create_polygon +from plotpy.interfaces import IShapeItemType + +class OSAHorizontalRowHolderShape(BaseShape): + def __init__(self,parent=None, shp_id=None): + name = "OSAHorizontalRowHolderShape" + if shp_id is not None: + name = f"OSAHorizontalRowHolderShape_{shp_id}" + + super().__init__(os.path.basename(os.path.dirname(__file__)), name, prefix='osa_', parent=parent) + if parent is None: + raise ValueError("parent must be provided") + self.parent = parent + + # Define the base rectangle for the holder + self.left = 0 + self.top = 0 + self.width = 2500 + self.height = 10000 * -1.0 + self.half_width = self.width/2.0 + self.half_height = self.height/2.0 + self.center = (self.half_width, self.half_height) + self.base_rect = [0, 0, self.width, self.height] + self.set_rect(self.base_rect) + + self.color = (0, 0, 255) # Blue color for the holder + self.rotation = 0 + + + def get_rect(self): + """ + Return a rectangle with the same size as `base_rect`, but centered at the current center. + + Uses the current center (from `get_center()`) and the width/height from `base_rect` + to compute the new rectangle coordinates. + + :return: List of rectangle coordinates [x0, y0, x1, y1] + """ + cx, cy = self.get_center() + x0, y0, x1, y1 = self.base_rect + width = abs(x1 - x0) + height = abs(y1 - y0) + rect = [ + cx - width / 2, + cy - height / 2, + cx + width / 2, + cy + height / 2 + ] + return rect + + def get_center(self): + if self.shape_item: + point = self.shape_item.boundingRect().center() + # print(f"osa: get_center: {(point.x(), point.y())}") + return (point.x(), point.y()) + else: + # print("osa: get_center: self.shape_item is None") + return self.center + + def _create_shape(self, do_it=True): + """ + create_osa(): description + + :returns: None + """ + xc, yc = self.center + print(f"osa: center is {self.center}") + # Use self.base_rect for width and height + + x0 = xc - self.half_width + y0 = yc - self.half_height + x1 = xc + self.half_width + y1 = yc + self.half_height + rect = (x0, y0, x1, y1) + #print(f"osa: _create_shape: rect is {rect}") + # x0, y0, x1, y1 = rect = self.base_rect + + (main_shape, shp_id) = create_rectangle(rect, title=f"{self.shape_prefix}rect", plot=self.parent.plot) + # the following assignemnts are required for a shape otherwise the positions will not be tracked + main_shape._shape_object = self + main_shape.get_rect = self.get_rect + main_shape.get_center = self.get_center + self.shape_item = main_shape + + create_simple_circle(x0 + 500, y0 - 500, 20, title=f"{self.shape_prefix}1", plot=self.parent.plot ) + create_simple_circle(x0 + 1000, y0 - 500, 25, title=f"{self.shape_prefix}2", plot=self.parent.plot ) + create_simple_circle(x0 + 1500, y0 - 500, 30, title=f"{self.shape_prefix}3", plot=self.parent.plot ) + create_simple_circle(x0 + 2000, y0 - 500, 35, title=f"{self.shape_prefix}4", plot=self.parent.plot ) + diff --git a/cls/plotWidgets/shapes/osa_holders/osa_ladd_ptycho.py b/cls/plotWidgets/shapes/osa_holders/osa_ladd_ptycho.py new file mode 100644 index 00000000..74a3aa43 --- /dev/null +++ b/cls/plotWidgets/shapes/osa_holders/osa_ladd_ptycho.py @@ -0,0 +1,163 @@ +import os + +from cls.plotWidgets.shapes.base_shape import BaseShape +from cls.plotWidgets.shapes.utils import create_simple_circle, create_rectangle, create_polygon + + +class OSALaddPtychoHolderShape(BaseShape): + """ + Ladd-OSA-order-ptychography.ppt + """ + def __init__(self,parent=None, shp_id=None): + name = "OSALaddPtychoHolderShape" + if shp_id is not None: + name = f"OSALaddPtychoHolderShape_{shp_id}" + + super().__init__(os.path.basename(os.path.dirname(__file__)), name, prefix='osa_', parent=parent) + if parent is None: + raise ValueError("parent must be provided") + self.parent = parent + + # Define the base rectangle for the holder + self.left = 0 + self.top = 0 + self.width = 3000 + self.height = 6000 * -1.0 + self.half_width = self.width / 2.0 + self.half_height = self.height / 2.0 + self.center = (self.half_width, self.half_height) + self.base_rect = [0, 0, self.width, self.height] + self.set_rect(self.base_rect) + + self.color = (0, 0, 255) # Blue color for the holder + self.rotation = 0 + + def get_rect(self): + """ + Return a rectangle with the same size as `base_rect`, but centered at the current center. + + Uses the current center (from `get_center()`) and the width/height from `base_rect` + to compute the new rectangle coordinates. + + :return: List of rectangle coordinates [x0, y0, x1, y1] + """ + cx, cy = self.get_center() + x0, y0, x1, y1 = self.base_rect + width = abs(x1 - x0) + height = abs(y1 - y0) + rect = [ + cx - width / 2, + cy - height / 2, + cx + width / 2, + cy + height / 2 + ] + return rect + + def get_center(self): + if self.shape_item: + point = self.shape_item.boundingRect().center() + # print(f"osa: get_center: {(point.x(), point.y())}") + return (point.x(), point.y()) + else: + # print("osa: get_center: self.shape_item is None") + return self.center + + def _create_shape(self, do_it=True): + """ + create_osa(): description + + :returns: None + """ + xc, yc = self.center + print(f"osa: center is {self.center}") + # Use self.base_rect for width and height + + x0 = xc - self.half_width + y0 = yc - self.half_height + x1 = xc + self.half_width + y1 = yc + self.half_height + rect = (x0, y0, x1, y1) + # print(f"osa: _create_shape: rect is {rect}") + # x0, y0, x1, y1 = rect = self.base_rect + + (main_shape, shp_id) = create_rectangle(rect, title=f"{self.shape_prefix}rect", plot=self.parent.plot) + # the following assignemnts are required for a shape otherwise the positions will not be tracked + main_shape._shape_object = self + main_shape.get_rect = self.get_rect + main_shape.get_center = self.get_center + self.shape_item = main_shape + + create_simple_circle(x0 + 1000, y0 - 1000, 25, title=f"{self.shape_prefix}1", plot=self.parent.plot) + create_simple_circle(x0 + 1000, y0 - 2000, 30, title=f"{self.shape_prefix}2", plot=self.parent.plot) + create_simple_circle(x0 + 1000, y0 - 3000, 35, title=f"{self.shape_prefix}3", plot=self.parent.plot) + create_simple_circle(x0 + 1000, y0 - 4000, 40, title=f"{self.shape_prefix}4", plot=self.parent.plot) + + +# def _create_shape(self, do_it=True): +# """ +# create_osa(): description +# +# :returns: None +# """ +# if do_it: +# if self.center is None: +# self.center = (0, 0) +# xc, yc = self.center +# # Use self.base_rect for width and height +# x0, y0, x1, y1 = rect = self.base_rect +# # width = abs(x1 - x0) +# # height = abs(y1 - y0) +# # rect = [ +# # xc - width / 2, +# # yc - height / 2, +# # xc + width / 2, +# # yc + height / 2 +# # ] +# +# create_rectangle(rect, title="osa_rect", plot=self.parent.plot) +# +# create_simple_circle(x1 - 250, y1 - 250, 35, title="osa_1", plot=self.parent.plot) +# create_simple_circle(x1 - 250, y1 - 2250, 35, title="osa_2", plot=self.parent.plot) +# +# else: +# +# self.parent.blockSignals(True) +# shapes = self.parent.plot.get_items(item_type=IShapeItemType) +# for shape in shapes: +# if hasattr(shape, "shapeparam"): +# s = shape.shapeparam +# title = s._title +# +# if title.find("osa_") > -1: +# self.parent.delPlotItem(shape) +# +# self.parent.blockSignals(False) + + # if do_it: + # xc, yc = self.ss.get("OSA_CRYO.CENTER") + # rect = self.ss.get("OSA_CRYO.RECT") + # x2 = rect[2] + # y1 = rect[1] + # create_rectangle(rect, title="osa_rect", plot=self.plot) + # # from outboard to inboard + # create_simple_circle(x2 - 250, y1 - 250, 35, title="osa_1", plot=self.plot) + # create_simple_circle(x2 - 250, y1 - 2250, 35, title="osa_2", plot=self.plot) + # + # else: + # # remove the sample_holder + # + # self.blockSignals(True) + # shapes = self.plot.get_items(item_type=IShapeItemType) + # + # for shape in shapes: + # title = "" + # if hasattr(shape, "annotationparam"): + # title = shape.annotationparam._title + # elif hasattr(shape, "shapeparam"): + # title = shape.shapeparam._title + # + # if title.find("osa_") > -1: + # self.delPlotItem(shape) + # + # self.blockSignals(False) + # self.plot.replot() \ No newline at end of file diff --git a/cls/plotWidgets/shapes/sample_holders/__init__.py b/cls/plotWidgets/shapes/sample_holders/__init__.py new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/cls/plotWidgets/shapes/sample_holders/__init__.py @@ -0,0 +1 @@ + diff --git a/cls/plotWidgets/shapes/sample_holders/cryo_goniometer_holder.py b/cls/plotWidgets/shapes/sample_holders/cryo_goniometer_holder.py new file mode 100644 index 00000000..7dfc9fa0 --- /dev/null +++ b/cls/plotWidgets/shapes/sample_holders/cryo_goniometer_holder.py @@ -0,0 +1,122 @@ +import os + +from cls.plotWidgets.shapes.base_shape import BaseShape +from cls.plotWidgets.shapes.utils import create_rect_centerd_at + +class CryoGoniometerHolderShape(BaseShape): + def __init__(self,parent=None, shp_id=None): + name = "CryoGoniometerHolderShape" + if shp_id is not None: + name = f"CryoGoniometerHolderShape_{shp_id}" + + super().__init__(os.path.basename(os.path.dirname(__file__)), name, prefix='sh_', + parent=parent) + if parent is None: + raise ValueError("parent must be provided") + + self.parent = parent + self.center = (0,0) + self._circle_radius = 1250 #um + # Define the base rectangle for the holder + self.base_rect = [0.0, 600.0, 3000.0, -600.0] + self.set_rect(self.base_rect) + self.color = (0, 0, 255) # Blue color for the holder + self.rotation = 0 + # Holder dimensions + # self.bottom_width = 19000 + # self.top_width = 33000 + # self.height = 52000 + # self.bottom_width = 19000 + # self.top_width = 23000 + # self.height = 14000 + # + # x0, y0 = (self.bottom_width/2)*-1, (self.height/2)*-1 + # x1, y1 = (self.top_width/2)*-1, (self.height/2) + # x2, y2 = (self.top_width/2), (self.height/2) + # x3, y3 = (self.bottom_width/2), (self.height/2)*-1 + # + # self.holder_x_pts = [x0, x1, x2, x3] + # self.holder_y_pts = [y0, y1, y2, y3] + + def get_rect(self): + """ + Return a rectangle with the same size as `base_rect`, but centered at the current center. + + Uses the current center (from `get_center()`) and the width/height from `base_rect` + to compute the new rectangle coordinates. + + :return: List of rectangle coordinates [x0, y0, x1, y1] + """ + cx, cy = self.get_center() + x0, y0, x1, y1 = self.base_rect + width = abs(x1 - x0) + height = abs(y1 - y0) + rect = [ + cx - width / 2, + cy - height / 2, + cx + width / 2, + cy + height / 2 + ] + return rect + + def get_center(self): + if self.shape_item: + point = self.shape_item.boundingRect().center() + return (point.x(), point.y()) + else: + return self.center + + def _create_shape(self, do_it=True): + """ + Create the sample holder shape and its 6 holes, all positioned relative to the current center. + """ + + if self.center is None: + self.center = (0, 0) + xc, yc = self.center + + # rad = self.ss.get("%s.RADIUS" % SAMPLE_GONI) + # rect = self.ss.get("%s.RECT" % SAMPLE_GONI) + # xc, yc = self.ss.get("%s.CENTER" % SAMPLE_GONI) + + frame = (0.0, 600.0, 3000.0, -600.0) + frame_outbrd_edge = xc - ((frame[0] + frame[2]) / 2.0) + + hole = (-100, 400, 100, -400) + + # self.create_rectangle(new_rect, title='sh_rect') + (main_shape, shp_id) = create_rect_centerd_at(frame, xc, yc, title="sh_rect", plot=self.parent.plot) + # the following assignemnts are required for a shape otherwise the positions will not be tracked + main_shape._shape_object = self + main_shape.get_rect = self.get_rect + main_shape.get_center = self.get_center + self.shape_item = main_shape + + create_rect_centerd_at( + hole, frame_outbrd_edge + 385.0, yc, title="sh_1", plot=self.parent.plot + ) + create_rect_centerd_at( + hole, frame_outbrd_edge + 660.0, yc, title="sh_1", plot=self.parent.plot + ) + create_rect_centerd_at( + hole, frame_outbrd_edge + 935.0, yc, title="sh_2", plot=self.parent.plot + ) + create_rect_centerd_at( + hole, frame_outbrd_edge + 1210.0, yc, title="sh_3", plot=self.parent.plot + ) + create_rect_centerd_at( + hole, frame_outbrd_edge + 1485.0, yc, title="sh_4", plot=self.parent.plot + ) + create_rect_centerd_at( + hole, frame_outbrd_edge + 1760.0, yc, title="sh_5", plot=self.parent.plot + ) + create_rect_centerd_at( + hole, frame_outbrd_edge + 2035.0, yc, title="sh_6", plot=self.parent.plot + ) + create_rect_centerd_at( + hole, frame_outbrd_edge + 2310.0, yc, title="sh_7", plot=self.parent.plot + ) + create_rect_centerd_at( + hole, frame_outbrd_edge + 2585.0, yc, title="sh_8", plot=self.parent.plot + ) + diff --git a/cls/plotWidgets/shapes/sample_holders/standard_6_hole_holder.py b/cls/plotWidgets/shapes/sample_holders/standard_6_hole_holder.py new file mode 100644 index 00000000..0455dad9 --- /dev/null +++ b/cls/plotWidgets/shapes/sample_holders/standard_6_hole_holder.py @@ -0,0 +1,129 @@ +import os + +from cls.plotWidgets.shapes.base_shape import BaseShape +from cls.plotWidgets.shapes.utils import create_simple_circle, create_polygon + +class Standard6HoleHolderShape(BaseShape): + def __init__(self,parent=None, shp_id=None): + name = "Standard6HoleHolderShape" + if shp_id is not None: + name = f"Standard6HoleHolderShape_{shp_id}" + + + super().__init__(os.path.basename(os.path.dirname(__file__)), name, prefix='sh_', + parent=parent) + if parent is None: + raise ValueError("parent must be provided") + + self.parent = parent + self.center = (0,0) + self._circle_radius = 1250 #um + # Define the base rectangle for the holder + self.base_rect = [-9500, 5000, 9500, -5000] + self.set_rect(self.base_rect) + self.color = (0, 0, 255) # Blue color for the holder + self.rotation = 0 + # Holder dimensions + # self.bottom_width = 19000 + # self.top_width = 33000 + # self.height = 52000 + self.bottom_width = 19000 + self.top_width = 23000 + self.height = 14000 + + x0, y0 = (self.bottom_width/2)*-1, (self.height/2)*-1 + x1, y1 = (self.top_width/2)*-1, (self.height/2) + x2, y2 = (self.top_width/2), (self.height/2) + x3, y3 = (self.bottom_width/2), (self.height/2)*-1 + + self.holder_x_pts = [x0, x1, x2, x3] + self.holder_y_pts = [y0, y1, y2, y3] + + def get_rect(self): + """ + Return a rectangle with the same size as `base_rect`, but centered at the current center. + + Uses the current center (from `get_center()`) and the width/height from `base_rect` + to compute the new rectangle coordinates. + + :return: List of rectangle coordinates [x0, y0, x1, y1] + """ + cx, cy = self.get_center() + x0, y0, x1, y1 = self.base_rect + width = abs(x1 - x0) + height = abs(y1 - y0) + rect = [ + cx - width / 2, + cy - height / 2, + cx + width / 2, + cy + height / 2 + ] + return rect + + def get_center(self): + if self.shape_item: + point = self.shape_item.boundingRect().center() + return (point.x(), point.y()) + else: + return self.center + + def _create_shape(self, do_it=True): + """ + Create the sample holder shape and its 6 holes, all positioned relative to the current center. + """ + + if self.center is None: + self.center = (0, 0) + xc, yc = self.center + + # Polygon points (trapezoid), centered at (xc, yc) + half_bottom = self.bottom_width / 2 + half_top = self.top_width / 2 + half_height = self.height / 2 + + # Points: bottom left, top left, top right, bottom right + x_pts = [ + xc - half_bottom, # bottom left + xc - half_top, # top left + xc + half_top, # top right + xc + half_bottom # bottom right + ] + y_pts = [ + yc - half_height, # bottom left + yc + half_height, # top left + yc + half_height, # top right + yc - half_height # bottom right + ] + + (main_shape, shp_id) = create_polygon(x_pts=x_pts, y_pts=y_pts, title=f"{self.shape_prefix}rect", plot=self.parent.plot) + # the following assignemnts are required for a shape otherwise the positions will not be tracked + main_shape._shape_object = self + main_shape.get_rect = self.get_rect + main_shape.get_center = self.get_center + self.shape_item = main_shape + + # Hole parameters + hole_diam = 2500 + hole_rad = hole_diam / 2 + row_spacing = 2000 # vertical distance between rows + col_spacing = 2000 # horizontal distance between holes + holes_per_row = 3 + + # Bottom edge y + y_bottom = yc - half_height + + # First row (bottom), 2000um from bottom edge + y_row1 = y_bottom + 2000 + hole_rad + # Second row, above first row by (hole_diam + row_spacing) + y_row2 = y_row1 + hole_diam + row_spacing + + # Center holes horizontally + total_hole_width = (holes_per_row - 1) * (hole_diam + col_spacing) + x_start = xc - total_hole_width / 2 + + # Draw holes + for row, y in enumerate([y_row1, y_row2]): + for i in range(holes_per_row): + x = x_start + i * (hole_diam + col_spacing) + create_simple_circle(x, y, hole_rad, title=f"{self.shape_prefix}{row * 3 + i + 1}", plot=self.parent.plot) + diff --git a/cls/plotWidgets/shapes/settings/settings.json b/cls/plotWidgets/shapes/settings/settings.json new file mode 100644 index 00000000..ca48ee24 --- /dev/null +++ b/cls/plotWidgets/shapes/settings/settings.json @@ -0,0 +1 @@ +"{\n \"osa_holders\": {\n \"OSAHorizontalRowHolderShape\": {\n \"center\": [\n -250.28231498719515,\n -4501.599586623524\n ],\n \"name\": \"OSAHorizontalRowHolderShape\",\n \"rect\": [\n 0,\n 0,\n 2500,\n -10000.0\n ],\n \"rotation\": 0\n },\n \"OSAHorizontalRowHolderShape_0\": {\n \"center\": [\n 0,\n 0\n ],\n \"name\": \"OSAHorizontalRowHolderShape_0\",\n \"rect\": [\n 0,\n 0,\n 0,\n 0\n ],\n \"rotation\": 0\n },\n \"OSALaddPtychoHolderShape0\": {\n \"center\": [\n -431.69359271375924,\n -134.80866860919468\n ],\n \"name\": \"OSALaddPtychoHolderShape0\",\n \"rect\": [\n 0,\n 0,\n 3000,\n -6000.0\n ],\n \"rotation\": 0\n },\n \"OSALaddPtychoHolderShape_0\": {\n \"center\": [\n 526.5739694876752,\n -942.2726826813764\n ],\n \"name\": \"OSALaddPtychoHolderShape_0\",\n \"rect\": [\n 0,\n 0,\n 3000,\n -6000.0\n ],\n \"rotation\": 0\n }\n },\n \"sample_holders\": {\n \"CryoGoniometerHolderShape_0\": {\n \"center\": [\n 0,\n 0\n ],\n \"name\": \"CryoGoniometerHolderShape_0\",\n \"rect\": [\n 0,\n 0,\n 0,\n 0\n ],\n \"rotation\": 0\n },\n \"CryoGoniometerHolderShape_1\": {\n \"center\": [\n 0,\n 0\n ],\n \"name\": \"CryoGoniometerHolderShape_1\",\n \"rect\": [\n 0,\n 0,\n 0,\n 0\n ],\n \"rotation\": 0\n },\n \"CryoGoniometerHolderShape_2\": {\n \"center\": [\n -4421.486522669271,\n 4109.652936899234\n ],\n \"name\": \"CryoGoniometerHolderShape_2\",\n \"rect\": [\n -5924.452706913375,\n 3509.652936899234,\n -2924.4527069133746,\n 4709.652936899234\n ],\n \"rotation\": 0\n },\n \"Standard6HoleHolderShape\": {\n \"center\": [\n 0,\n 0\n ],\n \"name\": \"Standard6HoleHolderShape\",\n \"rect\": [\n 0,\n 0,\n 0,\n 0\n ],\n \"rotation\": 0\n },\n \"Standard6HoleHolderShape_0\": {\n \"center\": [\n 0,\n 0\n ],\n \"name\": \"Standard6HoleHolderShape_0\",\n \"rect\": [\n 0,\n 0,\n 0,\n 0\n ],\n \"rotation\": 0\n },\n \"Standard6HoleHolderShape_1\": {\n \"center\": [\n 0,\n 0\n ],\n \"name\": \"Standard6HoleHolderShape_1\",\n \"rect\": [\n 0,\n 0,\n 0,\n 0\n ],\n \"rotation\": 0\n },\n \"Standard6HoleHolderShape_2\": {\n \"center\": [\n 1427.33923940768,\n 43.05457539481358\n ],\n \"name\": \"Standard6HoleHolderShape_2\",\n \"rect\": [\n -8108.217254100697,\n -4954.412802523138,\n 10891.782745899303,\n 5045.587197476862\n ],\n \"rotation\": 0\n }\n }\n}" \ No newline at end of file diff --git a/cls/plotWidgets/shapes/utils.py b/cls/plotWidgets/shapes/utils.py index 21ec6350..e9af01bb 100644 --- a/cls/plotWidgets/shapes/utils.py +++ b/cls/plotWidgets/shapes/utils.py @@ -1,48 +1,14 @@ -# from PyQt5 import QtWidgets -# -# from cls.utils.save_settings import SaveSettings -# from cls.stylesheets import master_colors, get_style -# from cls.plotWidgets.stxm_osa_dflt_settings import ( -# make_dflt_stxm_osa_smplholder_settings_dct, -# ) - from plotpy.builder import make #from plotpy.builder import make import os -#from cls.utils.dict_utils import dct_put + curDir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "/") MIN_SHAPE_Z = 1001 shape_cntr = MIN_SHAPE_Z -# def make_dflt_stxm_osa_smplholder_settings_dct(fpath): -# dct = {} -# dct_put(dct, "OSA.CENTER", (0,0)) -# dct_put(dct, "OSA.RECT", (-1250,500,1250,-5500)) -# dct_put(dct, "OSA_AMBIENT.CENTER", ( -1247.7022682879685, -1595.9402372900463)) -# dct_put(dct, "OSA_AMBIENT.RECT", (-2497.7022682879715, 1404.0597627099448, 2.2977317120344196, -4595.9402372900377)) -# dct_put(dct, "OSA_CRYO.CENTER", ( -1187.5421670895232, -1000.5925262721269 )) -# dct_put(dct, "OSA_CRYO.RECT", ( -4187.5421670895175, 249.5951432086572, 1812.457832910471, -2250.780195752911)) -# dct_put(dct, "SAMPLE_GONI.CENTER", (320.4466858789624, -651.6853932584269 )) -# dct_put(dct, "SAMPLE_GONI.RADIUS", 1000) -# dct_put(dct, "SAMPLE_GONI.RECT",( -494.5533141210376, -511.68539325842687, 1135.4466858789624, -791.6853932584269)) -# dct_put(dct, "SAMPLE_STANDARD.CENTER",(-2550.3974645796065, 2707.6956184038504)) -# dct_put(dct, "SAMPLE_STANDARD.RADIUS", 1000) -# dct_put(dct, "SAMPLE_STANDARD.RECT", ( -3365.3974645796065, 2847.6956184038504, -1735.3974645796065, 2567.6956184038504 )) -# dct_put(dct, "SMPL_HLDR.CENTER", ( 0, 2500.0 )) -# dct_put(dct, "SMPL_HLDR.RADIUS", 1000) -# dct_put(dct, "SMPL_HLDR.RECT", ( -7000, 7000, 7000, -2000 )) -# dct_put(dct, "fpath", fpath) -# return(dct) - - -# class ShapeUtilsClass(QtWidgets.QObject): -# """Simple canvas with a sine plot.""" -# def __init__(self, xdata, ydatas, width=5, height=4, dpi=100, axes_bgrnd_color=AXES_BACKGROUND_COLOR): -# super(ShapeUtilsClass, self).__init__(width=width, height=height, dpi=dpi) - def create_segment( rect, @@ -97,7 +63,7 @@ def create_segment( return (r, z) -def create_rect_centerd_at(rect, xc, yc, title, plot=None): +def create_polygon(x_pts, y_pts, title="None", plot=None): """ self explanatory :param rect: @@ -107,17 +73,57 @@ def create_rect_centerd_at(rect, xc, yc, title, plot=None): :return: """ - dx = (rect[2] - rect[0]) * 0.5 - dy = (rect[1] - rect[3]) * 0.5 - r, z = create_rectangle((xc - dx, yc + dy, xc + dx, yc - dy), title=title) - # z = 999999999 + pts = [] + for i in range(len(x_pts)): + pts.append((x_pts[i], y_pts[i])) + + r = make.polygon( + x_pts, + y_pts, + closed=True, + title=title, + ) + sh = r.shapeparam + + r.set_resizable(False) + sh._title = title + sh.fill.alpha = 0.2 + sh.sel_fill.alpha = 0.2 + sh.symbol.alpha = 0.2 + sh.sel_symbol.alpha = 0.2 + sh.line._style = "SolidLine" + sh.line._color = "#ff5555" + sh.symbol.marker = "NoSymbol" + sh.sel_symbol.marker = "NoSymbol" + + r.set_item_parameters({"ShapeParam": sh}) + + global shape_cntr + shape_cntr += 1 + z = shape_cntr if plot: plot.add_item(r, z) return (r, z) +def create_rect_centerd_at(rect, xc, yc, title, plot=None): + """ + self explanatory + :param rect: + :param xc: + :param yc: + :param title: + :return: + """ + + dx = (rect[2] - rect[0]) * 0.5 + dy = (rect[1] - rect[3]) * 0.5 + r, z = create_rectangle((xc - dx, yc + dy, xc + dx, yc - dy), title=title, plot=plot) + return (r, z) + + def create_rectangle( rect, title="None", diff --git a/cls/plotWidgets/sls_pixelator_settings.json b/cls/plotWidgets/sls_pixelator_settings.json deleted file mode 100644 index 7ad67a2d..00000000 --- a/cls/plotWidgets/sls_pixelator_settings.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "OSA": { - "CENTER": [ - 0, - 0 - ], - "RECT": [ - -1250, - 500, - 1250, - -5500 - ] - }, - "OSA_AMBIENT": { - "CENTER": [ - 747.9177471091225, - -2493.6167624054115 - ], - "RECT": [ - -502.082252890881, - 506.3832375945781, - 1997.917747109126, - -5493.6167624054015 - ] - }, - "OSA_CRYO": { - "CENTER": [ - -1187.5421670895232, - -1000.5925262721269 - ], - "RECT": [ - -4187.5421670895175, - 249.5951432086572, - 1812.457832910471, - -2250.780195752911 - ] - }, - "SAMPLE_GONI": { - "CENTER": [ - 320.4466858789624, - -651.6853932584269 - ], - "RADIUS": 1000, - "RECT": [ - -494.5533141210376, - -511.68539325842687, - 1135.4466858789624, - -791.6853932584269 - ] - }, - "SAMPLE_STANDARD": { - "CENTER": [ - -2550.3974645796065, - 2707.6956184038504 - ], - "RADIUS": 1000, - "RECT": [ - -3365.3974645796065, - 2847.6956184038504, - -1735.3974645796065, - 2567.6956184038504 - ] - }, - "SMPL_HLDR": { - "CENTER": [ - 0, - 2500.0 - ], - "RADIUS": 1000, - "RECT": [ - -7000, - 7000, - 7000, - -2000 - ] - }, - "fpath": "C:\\controls\\sandbox\\branches\\zmq_after_linux\\pyStxm3\\cls\\plotWidgets\\sls_pixelator_settings.json" -} \ No newline at end of file diff --git a/cls/plotWidgets/striptool/stripToolWidget.py b/cls/plotWidgets/striptool/stripToolWidget.py index 9e24f570..c1a51324 100644 --- a/cls/plotWidgets/striptool/stripToolWidget.py +++ b/cls/plotWidgets/striptool/stripToolWidget.py @@ -190,10 +190,11 @@ def __init__(self, timespan, parent=None, sigList=[], energy_fbk_dev=None, label format="%d", title_color=master_colors["gray_255_rgb"]["rgb_str"], var_clr=master_colors["gray_255_rgb"]["rgb_str"], - #font=f, + font=f, scale_factor=self.scale_factor ) self.energyFbkLbl.setObjectName("stripToolFbkLbl") + self.countsFbkLbl.setObjectName("stripToolCountsFbkLbl") self.upd_style_btn = QtWidgets.QPushButton("Update Style") self.upd_style_btn.clicked.connect(self.update_stlye) diff --git a/cls/plotWidgets/tools/clsHorizSelectPositionTool.py b/cls/plotWidgets/tools/clsHorizSelectPositionTool.py index 1342e99d..10ca2053 100644 --- a/cls/plotWidgets/tools/clsHorizSelectPositionTool.py +++ b/cls/plotWidgets/tools/clsHorizSelectPositionTool.py @@ -54,7 +54,7 @@ def activate_command(self, plot, checked): def activate(self): """Activate tool""" - # if(self.action.isChecked()): + if self._my_checked_state: self.deactivate() return @@ -62,11 +62,13 @@ def activate(self): for baseplot, start_state in list(self.start_state.items()): baseplot.filter.set_state(start_state, None) + self.action.blockSignals(True) self.action.setChecked(True) self.manager.set_active_tool(self) if self.shape is not None: self.shape.setVisible(True) self._my_checked_state = True + self.action.blockSignals(False) def deactivate(self): """Deactivate tool""" diff --git a/cls/scanning/BaseScan.py b/cls/scanning/BaseScan.py index fdece7f0..558bb771 100644 --- a/cls/scanning/BaseScan.py +++ b/cls/scanning/BaseScan.py @@ -784,27 +784,34 @@ def calc_scan_velo(self, mtr, rng, npoints, dwell): dwell: is in milliseconds """ scan_velo = rng / ((npoints * dwell) * 0.001) - ret = self.check_scan_velo(mtr, scan_velo) + ret = self.check_scan_velo(mtr, scan_velo, rng, npoints, dwell) if not ret: #set an invalid scan velocity scan_velo = 0 return(scan_velo) - def check_scan_velo(self, mtr, desired_velo): + def check_scan_velo(self, mtr, desired_velo, rng, npoints, dwell): """ - a function that takes a motor and checks its max velocity against - what the desired scan velocity is, if it is greater then popup a - warning message that the user needs to alter their scan params - (num points increase dwell time) to reduce the scan velocity + Checks if the desired scan velocity exceeds the motor's max velocity. + If so, calculates and displays the minimum dwell time, minimum number of points, + and the maximum allowed range for the given dwell and number of points. """ ret = True if hasattr(mtr, "get_max_velo"): vmax = mtr.get_max_velo() if desired_velo > vmax: - notify("Error scan velo is faster than motor's max velocity", - f"Calculated scan velocity {desired_velo} is too fast, max is {vmax}, increase number of points or dwell time and try again\n", - "Ok") + min_dwell = (rng / (npoints * vmax)) * 1000.0 + min_npoints = int((rng / (dwell * 0.001 * vmax)) + 1) + max_range = vmax * npoints * (dwell * 0.001) + msg = ( + f"Calculated scan velocity {desired_velo:.2f} is too fast (max is {vmax:.2f}).\n" + f"Increase number of points, dwell time, or reduce the range and try again.\n\n" + f"Minimum dwell time (ms) for [{npoints}] points: set dwell={min_dwell:.2f}\n" + f"Minimum number of points for [{dwell}] ms dwell: set npoints={min_npoints}\n" + f"To use current dwell and points, range must be below {max_range:.2f} um" + ) + notify("Error: scan velocity exceeds motor's max velocity", msg, "Ok") ret = False else: notify("Warning: unable to check scan velocity", "The motor does not have the get_max_velo() method", "Ok") diff --git a/cls/scanning/base.py b/cls/scanning/base.py index a6a260d5..389c2b7b 100644 --- a/cls/scanning/base.py +++ b/cls/scanning/base.py @@ -1778,7 +1778,7 @@ def load_scan(self, ev_only=False, sp_only=False): self.data_file_pfx = self.main_obj.get_datafile_prefix() fname = getOpenFileName( "Load Scan", - filter_str="Scan Files (%s*.hdf5; *.json)" % self.data_file_pfx, + filter_str=f"Scan Files ({self.data_file_pfx}*.hdf5);; Scan Config Files (*.json)", search_path=datadir, ) if fname is None or len(fname) < 1: @@ -1870,7 +1870,7 @@ def load_scan_definition(self, ev_only=False, sp_only=False): # self.data_file_pfx = self.main_obj.get_datafile_prefix() fname = getOpenFileName( "Load Scan Definition", - filter_str="Scan Def Files (*.hdf5;*.json)", + filter_str="Scan Data Files (*.hdf5); Scan Config Files(*.json)", search_path=scanDefs_dir, ) @@ -1910,7 +1910,7 @@ def openfile(self, fname, ev_only=False, sp_only=False, counter_name="NO_COUNTER return if not ev_only: self.clear_params() - # tell the parent to clear the slate (plotteer) + # tell the parent to clear the slate (plotter) self.clear_all_sig.emit() reset_unique_roi_id() @@ -1926,100 +1926,23 @@ def openfile(self, fname, ev_only=False, sp_only=False, counter_name="NO_COUNTER data_io = self.data_io_class(data_dir, fprefix, options) - # if(not ev_only): - # #tell the parent to clear the slate (plotteer) - # self.clear_all_sig.emit() - - entry_dct = data_io.load() - if entry_dct is None: + h5_file_dct = data_io.load() + if h5_file_dct is None: + _logger.error(f"openfile: Failed to load data from file [{fname}]") return - # use this counter to control if to append or not when loading entries - i = 0 - ekeys = list(entry_dct.keys()) - ekeys.sort() - - # for now ignore the default attribute by removing it, mmy use it properly in future - if 'default' in ekeys: - ekeys.remove('default') - - for ekey in ekeys: - # ekey = entry_dct.keys()[0] - if load_image_data: - nx_datas = data_io.get_NXdatas_from_entry(entry_dct, ekey) - # currently only support 1 counter - counter_name = data_io.get_default_detector_from_entry(entry_dct) - data = data_io.get_signal_data_from_NXdata(nx_datas, counter_name) - wdg_com = data_io.get_wdg_com_from_entry(entry_dct, ekey) - sp_db = get_first_sp_db_from_wdg_com(wdg_com) - - if data is None: - _logger.warn(f"there apparently was no data in the file [{fname}]") - - loaded_scan_type = dct_get(sp_db, SPDB_SCAN_PLUGIN_SECTION_ID) - - if ( - ev_only - or (loaded_scan_type == self.section_id) - or ( - (self.section_id == "TOMO") - and (loaded_scan_type in allow_load_in_tomo_type) - ) - ): - - dct_put(wdg_com, WDGCOM_CMND, widget_com_cmnd_types.LOAD_SCAN) - dct_put(sp_db, WDGCOM_CMND, widget_com_cmnd_types.LOAD_SCAN) - if i == 0: - self.load_roi( - wdg_com, append=False, ev_only=ev_only, sp_only=sp_only - ) - else: - self.load_roi( - wdg_com, append=True, ev_only=ev_only, sp_only=sp_only - ) - i += 1 - - if not ev_only: - # THIS CALL IS VERY IMPORTANT IN ORDER TO KEEP TEHPLOT AND TABLES IN SYNC - add_to_unique_roi_id_list(sp_db[SPDB_ID_VAL]) - - if not load_image_data: - return - - acceptable_2dimages_list = [scan_types.COARSE_IMAGE, scan_types.SAMPLE_IMAGE, scan_types.COARSE_GONI, scan_types.PATTERN_GEN] - - if (dct_get(sp_db, SPDB_SCAN_PLUGIN_TYPE) == scan_types.SAMPLE_POINT_SPECTRUM ): - valid_data_dim = 1 - - #elif dct_get(sp_db, SPDB_SCAN_PLUGIN_TYPE) == scan_types.SAMPLE_IMAGE: - elif dct_get(sp_db, SPDB_SCAN_PLUGIN_TYPE) in acceptable_2dimages_list: - valid_data_dim = 2 - elif (dct_get(sp_db, SPDB_SCAN_PLUGIN_TYPE) == scan_types.SAMPLE_IMAGE_STACK ): - valid_data_dim = 3 - else: - valid_data_dim = 2 + ekey = h5_file_dct['default'] + default_counter = h5_file_dct[ekey]['default'] + # create a dictionary that loks like the mime data dict so that we can reuse the load_dict_based_data function + dct = {} + dct['h5_file_dct'] = h5_file_dct + dct['path'] = fname + dct['data'] = h5_file_dct[ekey]['sp_db_dct']['nxdata'][default_counter] + dct['wdg_com'] = h5_file_dct[ekey]['WDG_COM'] - if data.ndim == 3: - data = data[0] + # now treat it like the file was dropped on the scan plugin + self.load_dict_based_data(dct) - if data.ndim is not valid_data_dim: - _logger.error( - "Data in file [%s] is of wrong dimension, is [%d] should be [%d]" - % (fname, data.ndim, valid_data_dim) - ) - print( - "Data in file [%s] is of wrong dimension, is [%d] should be [%d]" - % (fname, data.ndim, valid_data_dim) - ) - return - # signal the main GUI that there is data to plot but only if is is a single image, ignore stack or point spectra scans - if len(list(entry_dct.keys())) == 1: - if data is not None: - self.plot_data.emit((fname, wdg_com, data)) - _logger.debug("[%s] scan loaded" % self.section_id) - else: - _logger.error("unable to load scan, wrong scan type") - break @exception def load_config(self, fname, ev_only=False, sp_only=False): @@ -2207,9 +2130,9 @@ def load_dict_based_data(self, dropped_data_dct: dict=None, ev_only: bool=False, self.plot_data.emit((fname, wdg_com, image_data)) _logger.debug("[%s] scan loaded" % self.section_id) else: - _logger.error("unable to load scan, data is None") + _logger.error(f"unable to load scan file [{fname}], data is None") else: - _logger.error("unable to load scan, wrong scan type") + _logger.error("unable to load scan file [{fname}], wrong scan type") def on_spatial_row_deleted(self, sp_db): diff --git a/cls/scanning/nexus/nxstxm.py b/cls/scanning/nexus/nxstxm.py index 3aeccb41..c61b2eae 100644 --- a/cls/scanning/nexus/nxstxm.py +++ b/cls/scanning/nexus/nxstxm.py @@ -3937,23 +3937,7 @@ def generate_spatial_roi_from_data(positioner_nm: str, data: [], roi_nm: str, en roi = get_base_roi(roi_nm, positioner_nm, cx, rx, nx, sx, enable=enable) return roi -# def generate_energy_roi_from_data(dwell, data, enable=True): -# npts = len(data) -# if len(data) > 1: -# energy_start = data[0] -# energy_stop = data[-1] -# rng = energy_stop - energy_start -# else: -# energy_start = energy_stop = data[0] -# rng = 0.0 -# -# pol_rois = get_epu_pol_dct(-1, 0.0, angle=0.0) -# -# e_roi = get_base_energy_roi(SPDB_EV,"DNM_ENERGY", energy_start, energy_stop, rng, npts, dwell, pol_rois, enable=enable) -# -# return e_roi - -def generate_energy_roi_from_data(dwell, ev_setpoints_arr, enable=True): +def generate_energy_roi_from_data(dwell, ev_setpoints_arr, polarization=None, enable=True): num_ev_regions = len(ev_setpoints_arr) e_rois = [] for ev_idx in range(num_ev_regions): @@ -3972,7 +3956,10 @@ def generate_energy_roi_from_data(dwell, ev_setpoints_arr, enable=True): rng = 0.0 #todo: this will need to be actual polarization values in future - pol_roi = get_epu_pol_dct(-1, 0.0, angle=0.0) + if polarization is not None and len(polarization) > 0: + pol_roi = get_epu_pol_dct(polarization['epu_polarization'], polarization['epu_offset'], angle=polarization['epu_angle']) + else: + pol_roi = get_epu_pol_dct(0, 0.0, angle=0.0) e_roi = get_base_energy_roi(SPDB_EV,"DNM_ENERGY", energy_start, energy_stop, rng, npts, dwell*1000.0, [pol_roi], enable=enable) e_roi[ID_VAL] = ev_idx @@ -4072,7 +4059,7 @@ def create_h5_file_dct_from_file_dct(file_dct): elif positioner_nm in ['DNM_ENERGY']: # need to make sure data contains ALL ev_regions ev_setpoint_region_arr = create_ev_region_data_from_1D_array(sp_db_dct[ax_nm].astype(float)) - e_roi = generate_energy_roi_from_data(sp_db_dct['count_time'], ev_setpoint_region_arr) + e_roi = generate_energy_roi_from_data(sp_db_dct['count_time'], ev_setpoint_region_arr, polarization=sp_db_dct['polarization']) elif positioner_nm in ['line_position']: if sp_db_dct['pystxm_enum_scan_type'] == 2: diff --git a/cls/stylesheets/dark_linux_hires_disp/QLabel.qss b/cls/stylesheets/dark_linux_hires_disp/QLabel.qss index 5c736f06..7103ccd3 100644 --- a/cls/stylesheets/dark_linux_hires_disp/QLabel.qss +++ b/cls/stylesheets/dark_linux_hires_disp/QLabel.qss @@ -66,6 +66,13 @@ QLabel#stripToolFbkLbl{ } +QLabel#stripToolCountsFbkLbl{ + + color: black; + font: bold 24px "MS Shell Dlg 2"; + +} + diff --git a/cls/templates/preferences/prefTemplate/prefTemplate.py b/cls/templates/preferences/prefTemplate/prefTemplate.py index cea2cc78..5079fcf7 100644 --- a/cls/templates/preferences/prefTemplate/prefTemplate.py +++ b/cls/templates/preferences/prefTemplate/prefTemplate.py @@ -188,7 +188,7 @@ def __init__(self, parent=None): ) self.a1FbkLbl = assign_aiLabelWidget( self.a1FbkLbl, - MAIN_OBJ.device("DNM_ZP_DEF_A"), + MAIN_OBJ.device("DNM_ZP_A1"), hdrText="A1", egu="", title_color="white", @@ -490,10 +490,10 @@ def get_local_params(self): import sys # zps = get_zp_dct() - # osas = get_osa_dct() + # osa_holders = get_osa_dct() # DEFAULTS.add_section('PRESETS.ZP_PARAMS', zps) - # DEFAULTS.add_section('PRESETS.OSA_PARAMS',osas) + # DEFAULTS.add_section('PRESETS.OSA_PARAMS',osa_holders) # DEFAULTS.add_section('PRESETS.ZP_FOCUS_PARAMS',{}) # DEFAULTS.add_section('PRESETS.ZP_FOCUS_PARAMS.ZP_IDX', 0) # DEFAULTS.add_section('PRESETS.ZP_FOCUS_PARAMS.ZP_A1', 0) diff --git a/cls/utils/arrays.py b/cls/utils/arrays.py index 99ee67d8..63a37f32 100644 --- a/cls/utils/arrays.py +++ b/cls/utils/arrays.py @@ -10,19 +10,6 @@ def flip_data_upsdown(data): _data = np.flipud(data).copy() return _data - -# def resize_1d_array(a, b): -# bb = np.zeros(len(b)) -# if len(a) < len(bb): -# c = bb.copy() -# c[:len(a)] += a -# else: -# c = a.copy() -# c[:len(bb)] += bb -# -# return(c) - - def resize_1d_array(a, b): """ resize a to be length of b @@ -85,28 +72,17 @@ def nulls_to_nans(obj): return obj def convert_numpy_to_python(obj): - """Convert numpy types to standard Python types for JSON serialization, replacing NaN with None. Handles tuples.""" - import numpy as np - if isinstance(obj, np.ndarray): - arr = obj.tolist() - return [ - convert_numpy_to_python(x) if not (isinstance(x, float) and np.isnan(x)) else None - for x in arr - ] + # Efficiently replace NaN with None + arr = obj.astype(float) + arr = np.where(np.isnan(arr), None, arr) + return arr.tolist() elif isinstance(obj, dict): return {k: convert_numpy_to_python(v) for k, v in obj.items()} elif isinstance(obj, list): - return [ - convert_numpy_to_python(x) if not (isinstance(x, float) and np.isnan(x)) else None - for x in obj - ] + return [convert_numpy_to_python(x) for x in obj] elif isinstance(obj, tuple): - # Convert tuple to list and handle NaN - return [ - convert_numpy_to_python(x) if not (isinstance(x, float) and np.isnan(x)) else None - for x in obj - ] + return [convert_numpy_to_python(x) for x in obj] elif isinstance(obj, np.integer): return int(obj) elif isinstance(obj, np.floating): @@ -119,9 +95,15 @@ def convert_numpy_to_python(obj): def clean_nans(obj): if isinstance(obj, dict): return {k: clean_nans(v) for k, v in obj.items()} - elif isinstance(obj, list): - return [clean_nans(v) for v in obj] + elif isinstance(obj, (list, tuple)): + # Try fast NumPy conversion for flat lists + try: + arr = np.array(obj, dtype=float) + arr = np.where(np.isnan(arr), None, arr) + return arr.tolist() + except Exception: + return [clean_nans(x) for x in obj] elif isinstance(obj, float) and np.isnan(obj): return None else: - return obj \ No newline at end of file + return obj diff --git a/cls/utils/bl_config_reader.py b/cls/utils/bl_config_reader.py new file mode 100644 index 00000000..d1254058 --- /dev/null +++ b/cls/utils/bl_config_reader.py @@ -0,0 +1,20 @@ +import configparser +import os + +from cls.applications.pyStxm import abs_path_to_ini_file, abs_path_to_top + +class BeamlineConfigReader: + """ + BeamlineConfigReader reads the beamline configuration based on the main application beamline config + specified in app.ini file. + """ + def __init__(self): + self.app_config = configparser.ConfigParser() + self.app_config.read(abs_path_to_ini_file) + bl_config_name = self.app_config.get('MAIN', 'bl_config') + bl_config_path = os.path.join(abs_path_to_top, 'cls/applications/pyStxm/bl_configs', bl_config_name, f'{bl_config_name}.ini') + self.bl_config = configparser.ConfigParser() + self.bl_config.read(bl_config_path) + + def get_setting(self, section, key): + return self.bl_config.get(section, key) \ No newline at end of file diff --git a/cls/utils/file_system_tools.py b/cls/utils/file_system_tools.py index 65f6ab45..dd521602 100644 --- a/cls/utils/file_system_tools.py +++ b/cls/utils/file_system_tools.py @@ -4,7 +4,10 @@ @author: control """ import os +import re +import datetime import string + from cls.types.stxmTypes import PLACEHOLDER_FILENAME def is_locked(filepath): @@ -154,44 +157,32 @@ def get_latest_file_num_in_dir(path, prefix_char="C", extension="hdf5"): return generate_new_seq_num(path, prefix_char) -def get_next_file_num_in_seq(path, prefix_char="C", extension="hdf5"): - _files = get_filenames_in_dir(path, extension) - if len(_files) == 0: - _files = get_filenames_in_dir(path, extension + ".tmp") - if len(_files) == 0: - _files = get_filenames_in_dir(path, extension + ".idx") - if len(_files) == 0: - _files = get_filenames_in_dir(path, extension + ".err") - if len(_files) == 0: - _files = get_cur_data_dir(path) - if len(_files) == 0: - _files = [get_next_dir_in_seq(path, prefix_char=prefix_char)] +def get_next_file_num_in_seq(path, prefix_char="A", extension="hdf5"): + file_pattern = re.compile(rf"{prefix_char}(\d+)\.{extension}$") + dir_pattern = re.compile(rf"{prefix_char}(\d+)$") + used_nums = set() - if len(_files) > 0: - #turf the prefix char whatever it is and remove the suffix - seq_num_str = _files[-1][1:].replace(".%s" % extension, "") - seq_num_str = seq_num_str.replace(".tmp", "") - seq_num_str = seq_num_str.replace(".idx", "") - seq_num_str = seq_num_str.replace(".err", "") - # seq_num = int(seq_num_str) + 1 - if seq_num_str.isnumeric(): - seq_num = int(seq_num_str) + 1 - else: - #assume its last 4 characters are _### - seq_num = int(seq_num_str[-3:]) + 1 + if not os.path.isdir(path): + raise FileNotFoundError(f"Directory `{path}` does not exist.") - # if(check_if_tmp_or_final_exist(path, seq_num, prefix_char=prefix_char, extension=extension)): - # #skip over the tmp/final file sequence number - # seq_num = seq_num + 1 - while check_if_tmp_or_final_exist( - path, seq_num, prefix_char=prefix_char, extension=extension - ): - # skip over the tmp/final file sequence number - seq_num = seq_num + 1 + for entry in os.listdir(path): + file_match = file_pattern.match(entry) + dir_match = dir_pattern.match(entry) + if file_match: + used_nums.add(int(file_match.group(1))) + elif dir_match and os.path.isdir(os.path.join(path, entry)): + used_nums.add(int(dir_match.group(1))) - return seq_num + if not used_nums: + # Directory is empty, use today's date and 000 + today = datetime.datetime.now() + next_num = int(today.strftime("%y%m%d") + "000") else: - return generate_new_seq_num(path, prefix_char) + next_num = max(used_nums) + 1 + while next_num in used_nums: + next_num += 1 + + return next_num def get_next_dir_in_seq(path, prefix_char="C"): @@ -614,20 +605,23 @@ def get_thumb_file_name_list(dct): # print ' what about %s' % path + '\\' + new_stack_dirname # os.mkdir(path + '\\' + new_stack_dirname) - path = r"C:\controls\stxm-data\2020\guest\0406" - d = master_get_seq_names( - path, - prefix_char="C", - thumb_ext="jpg", - dat_ext="hdf5", - stack_dir=False, - num_desired_datafiles=5, - new_stack_dir=False, - ) - if d is None: - print("the directory %s does not exist yet" % (path)) - else: - for k in list(d.keys()): - print(d[k]) - # path = r'C:\controls\stxm-data\guest\0110' - # check_if_tmp_or_final_exist(path, 200110041, prefix_char='C', extension='hdf5') + # path = r"C:\controls\stxm-data\2020\guest\0406" + # d = master_get_seq_names( + # path, + # prefix_char="C", + # thumb_ext="jpg", + # dat_ext="hdf5", + # stack_dir=False, + # num_desired_datafiles=5, + # new_stack_dir=False, + # ) + # if d is None: + # print("the directory %s does not exist yet" % (path)) + # else: + # for k in list(d.keys()): + # print(d[k]) + # # path = r'C:\controls\stxm-data\guest\0110' + # # check_if_tmp_or_final_exist(path, 200110041, prefix_char='C', extension='hdf5') + path = "/beamlinedata/SM/operations/STXM-data/ASTXM_upgrade_tmp/2025/2025-12-03" + # path = "/tmp/empty_dir" + print(get_next_file_num_in_seq(path, prefix_char="A", extension="hdf5")) diff --git a/cls/utils/calculations.py b/cls/utils/focus_calculations.py similarity index 86% rename from cls/utils/calculations.py rename to cls/utils/focus_calculations.py index e24d267e..8553463f 100644 --- a/cls/utils/calculations.py +++ b/cls/utils/focus_calculations.py @@ -1,9 +1,9 @@ - def focal_length(energy, a1): """ f = A1 * E """ f = a1 * energy - return f \ No newline at end of file + return f + diff --git a/cls/utils/images.py b/cls/utils/images.py index 2379ab9f..ad4760ed 100644 --- a/cls/utils/images.py +++ b/cls/utils/images.py @@ -134,30 +134,21 @@ def array_to_qpixmap(gray): return pixmap def data_to_rgb(data0, alpha=False): - """Interpret an MxNxP array as an MxNx3 RGB image.""" + """Interpret an MxNxP array as an MxNx3 RGB image (vectorized).""" data = np.nan_to_num(data0, copy=True, nan=0.) N = data.shape[2] - RGB = np.zeros((list(data.shape[:2]) + [3])) - total = np.empty((N, 3)) - C = hsv_cmap(N) - for k in range(N): - total[k, :] = C[k, :] - if data is None or np.any(data == None): - pass - else: - RGB = RGB + np.broadcast_to(C[k, :], [1, 1, 3]) * data[:, :, [k, k, k]] - RGB = RGB / np.sum(total, axis=0) + C = hsv_cmap(N) # shape (N, 3) + # Vectorized multiplication and sum over the last axis + RGB = np.tensordot(data, C, axes=([2], [0])) # shape (M, N, 3) + RGB_sum = np.sum(C, axis=0) + RGB = RGB / RGB_sum RGB = RGB / np.amax(RGB) - ## Debug:The following code adds the set of hues to the first N pixels of the image - # for k in range(N): - # ind = np.unravel_index(k,RGB.shape[:2]) - # RGB[ind[0],ind[1],:] = C[k,:] - # np.nan_to_num(RGB, copy=False,nan=0.) if alpha: return (255 * np.dstack((RGB, np.ones(RGB.shape[:2])))).astype(np.int64) else: return (255 * RGB).astype(np.int64) + def numpy_rgb_to_qpixmap(rgb_array, target_width=150, target_height=150): if rgb_array.dtype != np.uint8: rgb_array = rgb_array.astype(np.uint8) diff --git a/cls/utils/roi_dict_defs.py b/cls/utils/roi_dict_defs.py index 160fbd6d..65c93684 100644 --- a/cls/utils/roi_dict_defs.py +++ b/cls/utils/roi_dict_defs.py @@ -151,6 +151,7 @@ SPDB_SCAN_PLUGIN_IMG_EXP_DATA = "SCAN_PLUGIN.IMG_EXP_DATA" # for the pattern generator scan this holds teh loaded patterns image data converted to exposure time in millesconds SPDB_SCAN_PLUGIN_IMG_DETAILS = "SCAN_PLUGIN.IMG_DETAILS" # for the pattern generator scan this holds the loaded patterns image data details as a dictionary SPDB_SCAN_PLUGIN_STXM_SCAN_TYPE = "SCAN_PLUGIN.STXM_SCAN_TYPE" +SPDB_SCAN_PLUGIN_USE_HDWACCEL = "SCAN_PLUGIN.USE_HDWACCEL" # whether to use hardware acceleration for fine image scans SPDB_ACTIVE_DATA_OBJECT = "ACTIVE_DATA_OBJ" diff --git a/cls/utils/scan_estimation/estimator.py b/cls/utils/scan_estimation/estimator.py index f490f0c5..87aa7fba 100644 --- a/cls/utils/scan_estimation/estimator.py +++ b/cls/utils/scan_estimation/estimator.py @@ -21,8 +21,7 @@ appConfig = ConfigClass(abs_path_to_ini_file) BL_CFG_NM = appConfig.get_value("MAIN", "bl_config") -bl_scan_time_dir = os.path.join(os.getcwd(), "..", "..", "applications", "pyStxm", "bl_configs", BL_CFG_NM, - "scan_time_data") +bl_scan_time_dir = os.path.join(os.getcwd(), "bl_configs", BL_CFG_NM,"scan_time_data") _logger = get_module_logger(__name__) diff --git a/cls/utils/scan_estimation/mine_files_for_model_data.py b/cls/utils/scan_estimation/mine_files_for_model_data.py index 62224018..d5d227f6 100644 --- a/cls/utils/scan_estimation/mine_files_for_model_data.py +++ b/cls/utils/scan_estimation/mine_files_for_model_data.py @@ -240,8 +240,8 @@ def get_scan_name(scan_type_nm): # scan_nm_map['osa_focus'] = 'osa_focus_scan' # scan_nm_map['osa_image'] = 'osa_scan' # scan_nm_map['sample_focus'] = 'focus_scan' -# scan_nm_map['sample_image'] = 'fine_image_scans' -# scan_nm_map['sample_image_stack'] = 'fine_image_scans' +# scan_nm_map['sample_image'] = 'sample_image_scans' +# scan_nm_map['sample_image_stack'] = 'sample_image_scans' pprint.pprint(scan_type_dct) #model_dir = pathlib.PurePath.joinpath(pathlib.Path(__file__).parent, "models") diff --git a/cls/utils/test_data/fix_dnm_access.txt b/cls/utils/test_data/fix_dnm_access.txt deleted file mode 100644 index a8220a6a..00000000 --- a/cls/utils/test_data/fix_dnm_access.txt +++ /dev/null @@ -1,1548 +0,0 @@ ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(84): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(125): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(126): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(127): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(374): #scan_velo = self.get_mtr_max_velo(self.main_obj.device(DNM_SAMPLE_FINE_X)) -Found '.device(DNM_' 5 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\coarse_image_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\coarse_image_scan.py(144): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\coarse_image_scan.py(145): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\coarse_image_scan.py(181): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\coarse_image_scan.py(182): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\coarse_image_scan.py(206): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\coarse_image_scan.py(207): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\coarse_image_scan.py(249): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -Found '.device(DNM_' 7 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\DetectorScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\DetectorScan.py(64): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\DetectorScan.py(65): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\DetectorScan.py(66): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 3 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(112): # self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(113): # self.main_obj.device(DNM_OSAY_TRACKING).put(0) # off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(123): # self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(131): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(132): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(150): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(151): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(176): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(177): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(213): x_src = self.main_obj.device(DNM_DETECTOR_X).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(214): y_src = self.main_obj.device(DNM_DETECTOR_Y).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(220): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(237): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(238): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(276): osa_mtr = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(314): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\det_scan\det_scan.py(315): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -Found '.device(DNM_' 17 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(58): x_cntr = self.main_obj.device(DNM_GONI_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(59): y_cntr = self.main_obj.device(DNM_GONI_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(61): x_cntr = self.main_obj.device(DNM_SAMPLE_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(62): y_cntr = self.main_obj.device(DNM_SAMPLE_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(202): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(203): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(204): mtr_sfx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(205): mtr_sfy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(525): mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(526): mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(529): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(530): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(569): mtr_x = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(570): mtr_y = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(572): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\fine_image_scans.py(573): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 16 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageScan.py(84): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageScan.py(131): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageScan.py(132): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageScan.py(133): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 4 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(109): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(117): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(168): e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(169): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(170): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(171): ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(172): pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(235): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(236): # e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(237): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(238): # ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(239): # pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(318): ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(319): pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(684): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(685): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(689): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(690): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(737): self.main_obj.device(DNM_SAMPLE_FINE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(738): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(740): self.main_obj.device(DNM_SAMPLE_FINE_X).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(741): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(745): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(746): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(756): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(757): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(799): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(800): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(802): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(803): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(807): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(808): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(818): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(819): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(903): # ev = MAIN_OBJ.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1068): # self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1069): # self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1071): # # self.setupScan.set_positioner(1, self.main_obj.device(DNM_GONI_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1072): # # self.setupScan.set_positioner(2, self.main_obj.device(DNM_GONI_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1073): # # self.setupScan.set_positioner(3, self.main_obj.device(DNM_OSA_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1074): # # # self.setupScan.set_positioner(4, self.main_obj.device(DNM_OSA_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1081): # self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1082): # self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1103): # # # self.setupScan.put('P1PV', '%s.VAL' % self.main_obj.device(DNM_GONI_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1104): # # # self.setupScan.put('R1PV', '%s.RBV' % self.main_obj.device(DNM_GONI_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1109): # # # self.setupScan.put('P2PV', '%s.VAL' % self.main_obj.device(DNM_GONI_Y).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1110): # # # self.setupScan.put('R2PV', '%s.RBV' % self.main_obj.device(DNM_GONI_Y).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1115): # # # self.setupScan.put('P3PV', '%s.VAL' % self.main_obj.device(DNM_OSA_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1116): # # # self.setupScan.put('R3PV', '%s.RBV' % self.main_obj.device(DNM_OSA_X).get_name()) -Found '.device(DNM_' 49 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\fine_point_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\fine_point_scan.py(185): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\fine_point_scan.py(186): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\fine_point_scan.py(187): mtr_sfx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\fine_point_scan.py(188): mtr_sfy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -Found '.device(DNM_' 4 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\PointSpecScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\PointSpecScan.py(76): mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\PointSpecScan.py(78): # mtr_x = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\PointSpecScan.py(79): # mtr_y = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\PointSpecScan.py(82): # mtr_x = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\PointSpecScan.py(83): # mtr_y = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\PointSpecScan.py(84): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\PointSpecScan.py(85): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\PointSpecScan.py(86): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\fine_point_scan\PointSpecScan.py(126): mtr_x = self.main_obj.device(DNM_ZONEPLATE_X) -Found '.device(DNM_' 9 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusE712Scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusE712Scan.py(89): mtr_x = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusE712Scan.py(90): mtr_y = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusE712Scan.py(137): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusE712Scan.py(148): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusE712Scan.py(204): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusE712Scan.py(216): # mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusE712Scan.py(217): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusE712Scan.py(257): e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusE712Scan.py(271): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusE712Scan.py(275): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 10 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusScan.py(91): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusScan.py(92): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusScan.py(140): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusScan.py(141): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusScan.py(142): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\FocusScan.py(143): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 6 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(55): self.deltaA0FbkLbl = assign_aiLabelWidget(self.deltaA0FbkLbl, self.main_obj.device(DNM_DELTA_A0), -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(58): self.zpzFbkLbl = assign_aiLabelWidget(self.zpzFbkLbl, self.main_obj.device(DNM_ZPZ_RBV), hdrText='Zoneplate Z', -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(61): self.flFbkLbl = assign_aiLabelWidget(self.flFbkLbl, self.main_obj.device(DNM_FOCAL_LENGTH), -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(139): mtr_x = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(140): mtr_y = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(142): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(143): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(145): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(166): a0 = self.main_obj.device(DNM_DELTA_A0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(179): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(180): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(250): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(295): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(397): # mtrz = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(398): # fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(401): # idealA0 = self.main_obj.device(DNM_IDEAL_A0).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(419): mtrz = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(423): fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(444): # mtrz = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(448): # fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(464): #zpz_pos = self.main_obj.device(DNM_OSA_Z_BASE).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(519): # fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(521): # idealA0 = self.main_obj.device(DNM_IDEAL_A0).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(556): zpz_pos = self.main_obj.device(DNM_ZONEPLATE_Z).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(664): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(665): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(666): mtr_gz = self.main_obj.device(DNM_GONI_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(667): mtr_gt = self.main_obj.device(DNM_GONI_THETA) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(668): mtr_oz = self.main_obj.device(DNM_OSA_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(743): # mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(744): # mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(815): # mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(816): # mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(819): # mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\focus_scan\focus_scan.py(820): # mtr_gy = self.main_obj.device(DNM_GONI_Y) -Found '.device(DNM_' 35 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecScan.py(102): # ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecScan.py(103): # pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecScan.py(104): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecScan.py(158): ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecScan.py(159): pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecScan.py(160): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecScan.py(221): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecScan.py(222): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecScan.py(223): mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecScan.py(224): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 10 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(95): #mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(96): #mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(99): mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(100): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(142): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(156): # mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(157): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(198): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(199): # e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(200): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(201): # ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(202): # pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(280): e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(281): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(282): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(285): mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(286): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(514): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(515): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(517): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(518): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(522): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(523): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 23 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(53): x_cntr = self.main_obj.device(DNM_GONI_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(54): y_cntr = self.main_obj.device(DNM_GONI_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(56): x_cntr = self.main_obj.device(DNM_SAMPLE_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(57): y_cntr = self.main_obj.device(DNM_SAMPLE_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(161): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(162): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(377): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(378): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(446): # mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(447): # mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(450): # mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(451): # mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(491): # mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(492): # mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(495): # mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(496): # mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(544): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(545): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(546): mtr_gz = self.main_obj.device(DNM_GONI_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(547): mtr_gt = self.main_obj.device(DNM_GONI_THETA) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\line_scan\line_scan.py(548): mtr_oz = self.main_obj.device(DNM_OSA_Z) -Found '.device(DNM_' 21 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\OsaFocusScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\OsaFocusScan.py(79): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\OsaFocusScan.py(80): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\OsaFocusScan.py(81): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\OsaFocusScan.py(82): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 4 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(91): if (self.main_obj.device(DNM_OSAY_TRACKING, do_warn=False)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(93): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(94): self.main_obj.device(DNM_OSAY_TRACKING).put(0) #off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(103): if (self.main_obj.device(DNM_OSAY_TRACKING, do_warn=False)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(105): self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(112): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(113): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(114): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(137): mtr_zpx = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(138): mtr_zpy = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(180): x_roi = get_base_start_stop_roi(SPDB_X, DNM_OSA_X, sx, ex, nx, src=self.main_obj.device(DNM_OSA_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(181): y_roi = get_base_start_stop_roi(SPDB_Y, DNM_OSA_Y, sy, ey, ny, src=self.main_obj.device(DNM_OSA_Y).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(182): zz_roi = get_base_roi(SPDB_ZZ, DNM_ZONEPLATE_Z_BASE, cz, rz, nz, enable=False, src=self.main_obj.device(DNM_ZONEPLATE_Z_BASE).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(184): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(216): #mtrz = self.main_obj.device(DNM_ZONEPLATE_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(217): mtrz = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(218): mtrx = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(219): mtry = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(220): oz = self.main_obj.device(DNM_OSA_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(225): fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_focus_scan\osa_focus_scan.py(257): zpz_pos = self.main_obj.device(DNM_ZONEPLATE_Z).get_position() -Found '.device(DNM_' 21 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\OsaScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\OsaScan.py(56): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\OsaScan.py(57): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\OsaScan.py(58): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 3 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(63): if(self.main_obj.device(DNM_OSAY_TRACKING, do_warn=False)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(64): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(111): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(112): self.main_obj.device(DNM_OSAY_TRACKING).put(0) #off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(123): self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(131): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(132): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(150): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(151): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(175): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(176): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(216): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(236): mtrx = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(237): mtry = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(265): osax_mtr = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(266): osay_mtr = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(293): self.main_obj.device(DNM_OSA_X).move(x) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(294): self.main_obj.device(DNM_OSA_Y).move(y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(307): self.main_obj.device(DNM_OSA_X).move(xpos) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\osa_scan\osa_scan.py(308): self.main_obj.device(DNM_OSA_Y).move(ypos) -Found '.device(DNM_' 20 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(404): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(405): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(409): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(410): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(457): self.main_obj.device(DNM_SAMPLE_FINE_X).set_power(1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(458): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_power(1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(460): self.main_obj.device(DNM_SAMPLE_FINE_X).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(461): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(465): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(466): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(476): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(477): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(519): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(520): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(522): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(523): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(527): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(528): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(538): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenScan.py(539): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 20 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(66): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(74): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(119): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(120): # e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(121): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(122): # ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(123): # pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(529): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(530): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(534): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(535): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(582): self.main_obj.device(DNM_SAMPLE_FINE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(583): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(585): self.main_obj.device(DNM_SAMPLE_FINE_X).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(586): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(590): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(591): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(601): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(602): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(644): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(645): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(647): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(648): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(652): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(653): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(663): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(664): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 27 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(154): # mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(155): # mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(203): # mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(204): # mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(230): # mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(231): # mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(262): x_pos = self.main_obj.device(DNM_GONI_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(263): y_pos = self.main_obj.device(DNM_GONI_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(265): x_pos = self.main_obj.device(DNM_SAMPLE_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(266): y_pos = self.main_obj.device(DNM_SAMPLE_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(283): x_src = self.main_obj.device(DNM_SAMPLE_X).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(284): y_src = self.main_obj.device(DNM_SAMPLE_Y).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(289): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(573): # x_src = self.main_obj.device(DNM_SAMPLE_X).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(574): # y_src = self.main_obj.device(DNM_SAMPLE_Y).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(603): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -Found '.device(DNM_' 16 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\positioner_scan\PositionerScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\positioner_scan\PositionerScan.py(64): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 1 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\positioner_scan\positioner_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\positioner_scan\positioner_scan.py(84): if(self.main_obj.device(DNM_OSAY_TRACKING)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\positioner_scan\positioner_scan.py(86): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\positioner_scan\positioner_scan.py(87): self.main_obj.device(DNM_OSAY_TRACKING).put(0) #off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\positioner_scan\positioner_scan.py(96): if(self.main_obj.device(DNM_OSAY_TRACKING)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\positioner_scan\positioner_scan.py(98): self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\positioner_scan\positioner_scan.py(150): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -Found '.device(DNM_' 6 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\PtychographyScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\PtychographyScan.py(82): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\PtychographyScan.py(83): # ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\PtychographyScan.py(133): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\PtychographyScan.py(134): # ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\PtychographyScan.py(204): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\PtychographyScan.py(205): # ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\PtychographyScan.py(258): ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\PtychographyScan.py(294): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\PtychographyScan.py(295): # ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\PtychographyScan.py(425): gt_mtr = self.main_obj.device(DNM_GONI_THETA) -Found '.device(DNM_' 10 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(67): x_cntr = self.main_obj.device(DNM_SAMPLE_FINE_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(68): y_cntr = self.main_obj.device(DNM_SAMPLE_FINE_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(96): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(135): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(136): self.main_obj.device(DNM_OSAY_TRACKING).put(0) #off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(147): self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(163): mtr_x = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(164): mtr_y = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(182): mtr_x = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(183): mtr_y = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(215): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(216): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(218): mtr_sfx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(219): mtr_sfy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(258): mtr_zpx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(259): mtr_zpy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(261): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\ptychography_scan\ptychography_scan.py(262): mtr_gy = self.main_obj.device(DNM_GONI_Y) -Found '.device(DNM_' 18 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(84): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(124): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(125): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(126): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(373): #scan_velo = self.get_mtr_max_velo(self.main_obj.device(DNM_SAMPLE_FINE_X)) -Found '.device(DNM_' 5 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\coarse_image_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\coarse_image_scan.py(144): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\coarse_image_scan.py(145): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\coarse_image_scan.py(181): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\coarse_image_scan.py(182): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\coarse_image_scan.py(206): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\coarse_image_scan.py(207): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\coarse_image_scan\coarse_image_scan.py(249): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -Found '.device(DNM_' 7 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\DetectorScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\DetectorScan.py(64): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\DetectorScan.py(65): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\DetectorScan.py(66): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 3 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(112): # self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(113): # self.main_obj.device(DNM_OSAY_TRACKING).put(0) # off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(123): # self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(131): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(132): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(150): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(151): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(176): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(177): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(213): x_src = self.main_obj.device(DNM_DETECTOR_X).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(214): y_src = self.main_obj.device(DNM_DETECTOR_Y).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(220): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(237): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(238): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(276): osa_mtr = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(314): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\det_scan\det_scan.py(315): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -Found '.device(DNM_' 17 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(58): x_cntr = self.main_obj.device(DNM_GONI_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(59): y_cntr = self.main_obj.device(DNM_GONI_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(61): x_cntr = self.main_obj.device(DNM_SAMPLE_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(62): y_cntr = self.main_obj.device(DNM_SAMPLE_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(202): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(203): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(204): mtr_sfx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(205): mtr_sfy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(525): mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(526): mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(529): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(530): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(569): mtr_x = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(570): mtr_y = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(572): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\fine_image_scans.py(573): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 16 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageScan.py(84): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageScan.py(131): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageScan.py(132): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageScan.py(133): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 4 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(109): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(117): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(168): e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(169): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(170): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(171): ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(172): pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(235): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(236): # e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(237): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(238): # ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(239): # pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(318): ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(319): pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(684): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(685): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(689): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(690): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(737): self.main_obj.device(DNM_SAMPLE_FINE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(738): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(740): self.main_obj.device(DNM_SAMPLE_FINE_X).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(741): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(745): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(746): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(756): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(757): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(799): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(800): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(802): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(803): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(807): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(808): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(818): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(819): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(903): # ev = MAIN_OBJ.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1068): # self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1069): # self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1071): # # self.setupScan.set_positioner(1, self.main_obj.device(DNM_GONI_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1072): # # self.setupScan.set_positioner(2, self.main_obj.device(DNM_GONI_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1073): # # self.setupScan.set_positioner(3, self.main_obj.device(DNM_OSA_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1074): # # # self.setupScan.set_positioner(4, self.main_obj.device(DNM_OSA_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1081): # self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1082): # self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1103): # # # self.setupScan.put('P1PV', '%s.VAL' % self.main_obj.device(DNM_GONI_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1104): # # # self.setupScan.put('R1PV', '%s.RBV' % self.main_obj.device(DNM_GONI_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1109): # # # self.setupScan.put('P2PV', '%s.VAL' % self.main_obj.device(DNM_GONI_Y).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1110): # # # self.setupScan.put('R2PV', '%s.RBV' % self.main_obj.device(DNM_GONI_Y).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1115): # # # self.setupScan.put('P3PV', '%s.VAL' % self.main_obj.device(DNM_OSA_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1116): # # # self.setupScan.put('R3PV', '%s.RBV' % self.main_obj.device(DNM_OSA_X).get_name()) -Found '.device(DNM_' 49 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\fine_point_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\fine_point_scan.py(185): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\fine_point_scan.py(186): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\fine_point_scan.py(187): mtr_sfx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\fine_point_scan.py(188): mtr_sfy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -Found '.device(DNM_' 4 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\PointSpecScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\PointSpecScan.py(76): mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\PointSpecScan.py(78): # mtr_x = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\PointSpecScan.py(79): # mtr_y = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\PointSpecScan.py(82): # mtr_x = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\PointSpecScan.py(83): # mtr_y = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\PointSpecScan.py(84): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\PointSpecScan.py(85): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\PointSpecScan.py(86): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\fine_point_scan\PointSpecScan.py(126): mtr_x = self.main_obj.device(DNM_ZONEPLATE_X) -Found '.device(DNM_' 9 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusE712Scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusE712Scan.py(89): mtr_x = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusE712Scan.py(90): mtr_y = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusE712Scan.py(137): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusE712Scan.py(148): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusE712Scan.py(204): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusE712Scan.py(216): # mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusE712Scan.py(217): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusE712Scan.py(257): e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusE712Scan.py(271): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusE712Scan.py(275): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 10 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusScan.py(91): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusScan.py(92): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusScan.py(140): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusScan.py(141): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusScan.py(142): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\FocusScan.py(143): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 6 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(55): self.deltaA0FbkLbl = assign_aiLabelWidget(self.deltaA0FbkLbl, self.main_obj.device(DNM_DELTA_A0), -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(58): self.zpzFbkLbl = assign_aiLabelWidget(self.zpzFbkLbl, self.main_obj.device(DNM_ZPZ_RBV), hdrText='Zoneplate Z', -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(61): self.flFbkLbl = assign_aiLabelWidget(self.flFbkLbl, self.main_obj.device(DNM_FOCAL_LENGTH), -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(139): mtr_x = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(140): mtr_y = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(142): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(143): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(145): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(166): a0 = self.main_obj.device(DNM_DELTA_A0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(179): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(180): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(250): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(295): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(397): # mtrz = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(398): # fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(401): # idealA0 = self.main_obj.device(DNM_IDEAL_A0).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(419): mtrz = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(423): fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(444): # mtrz = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(448): # fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(464): #zpz_pos = self.main_obj.device(DNM_OSA_Z_BASE).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(519): # fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(521): # idealA0 = self.main_obj.device(DNM_IDEAL_A0).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(556): zpz_pos = self.main_obj.device(DNM_ZONEPLATE_Z).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(664): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(665): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(666): mtr_gz = self.main_obj.device(DNM_GONI_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(667): mtr_gt = self.main_obj.device(DNM_GONI_THETA) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(668): mtr_oz = self.main_obj.device(DNM_OSA_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(743): # mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(744): # mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(815): # mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(816): # mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(819): # mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\focus_scan\focus_scan.py(820): # mtr_gy = self.main_obj.device(DNM_GONI_Y) -Found '.device(DNM_' 35 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecScan.py(88): ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecScan.py(89): pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecScan.py(90): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecScan.py(152): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecScan.py(153): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecScan.py(154): mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecScan.py(155): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 7 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(95): #mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(96): #mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(99): mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(100): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(142): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(156): # mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(157): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(198): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(199): # e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(200): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(201): # ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(202): # pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(280): e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(281): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(282): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(285): mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(286): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(514): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(515): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(517): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(518): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(522): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(523): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 23 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(53): x_cntr = self.main_obj.device(DNM_GONI_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(54): y_cntr = self.main_obj.device(DNM_GONI_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(56): x_cntr = self.main_obj.device(DNM_SAMPLE_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(57): y_cntr = self.main_obj.device(DNM_SAMPLE_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(161): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(162): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(377): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(378): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(446): # mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(447): # mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(450): # mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(451): # mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(491): # mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(492): # mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(495): # mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(496): # mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(544): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(545): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(546): mtr_gz = self.main_obj.device(DNM_GONI_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(547): mtr_gt = self.main_obj.device(DNM_GONI_THETA) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\line_scan\line_scan.py(548): mtr_oz = self.main_obj.device(DNM_OSA_Z) -Found '.device(DNM_' 21 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\OsaFocusScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\OsaFocusScan.py(79): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\OsaFocusScan.py(80): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\OsaFocusScan.py(81): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\OsaFocusScan.py(82): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 4 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(91): if (self.main_obj.device(DNM_OSAY_TRACKING, do_warn=False)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(93): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(94): self.main_obj.device(DNM_OSAY_TRACKING).put(0) #off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(103): if (self.main_obj.device(DNM_OSAY_TRACKING, do_warn=False)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(105): self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(112): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(113): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(114): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(137): mtr_zpx = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(138): mtr_zpy = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(180): x_roi = get_base_start_stop_roi(SPDB_X, DNM_OSA_X, sx, ex, nx, src=self.main_obj.device(DNM_OSA_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(181): y_roi = get_base_start_stop_roi(SPDB_Y, DNM_OSA_Y, sy, ey, ny, src=self.main_obj.device(DNM_OSA_Y).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(182): zz_roi = get_base_roi(SPDB_ZZ, DNM_ZONEPLATE_Z_BASE, cz, rz, nz, enable=False, src=self.main_obj.device(DNM_ZONEPLATE_Z_BASE).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(184): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(216): #mtrz = self.main_obj.device(DNM_ZONEPLATE_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(217): mtrz = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(218): mtrx = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(219): mtry = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(220): oz = self.main_obj.device(DNM_OSA_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(225): fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_focus_scan\osa_focus_scan.py(257): zpz_pos = self.main_obj.device(DNM_ZONEPLATE_Z).get_position() -Found '.device(DNM_' 21 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\OsaScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\OsaScan.py(56): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\OsaScan.py(57): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\OsaScan.py(58): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 3 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(63): if(self.main_obj.device(DNM_OSAY_TRACKING, do_warn=False)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(64): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(111): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(112): self.main_obj.device(DNM_OSAY_TRACKING).put(0) #off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(123): self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(131): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(132): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(150): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(151): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(175): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(176): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(216): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(236): mtrx = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(237): mtry = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(265): osax_mtr = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(266): osay_mtr = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(293): self.main_obj.device(DNM_OSA_X).move(x) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(294): self.main_obj.device(DNM_OSA_Y).move(y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(307): self.main_obj.device(DNM_OSA_X).move(xpos) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\osa_scan\osa_scan.py(308): self.main_obj.device(DNM_OSA_Y).move(ypos) -Found '.device(DNM_' 20 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(404): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(405): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(409): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(410): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(457): self.main_obj.device(DNM_SAMPLE_FINE_X).set_power(1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(458): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_power(1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(460): self.main_obj.device(DNM_SAMPLE_FINE_X).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(461): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(465): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(466): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(476): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(477): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(519): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(520): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(522): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(523): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(527): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(528): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(538): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenScan.py(539): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 20 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(66): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(74): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(119): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(120): # e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(121): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(122): # ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(123): # pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(529): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(530): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(534): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(535): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(582): self.main_obj.device(DNM_SAMPLE_FINE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(583): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(585): self.main_obj.device(DNM_SAMPLE_FINE_X).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(586): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(590): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(591): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(601): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(602): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(644): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(645): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(647): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(648): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(652): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(653): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(663): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(664): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 27 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(158): # mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(159): # mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(207): # mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(208): # mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(234): # mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(235): # mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(266): x_pos = self.main_obj.device(DNM_GONI_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(267): y_pos = self.main_obj.device(DNM_GONI_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(269): x_pos = self.main_obj.device(DNM_SAMPLE_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(270): y_pos = self.main_obj.device(DNM_SAMPLE_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(287): x_src = self.main_obj.device(DNM_SAMPLE_X).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(288): y_src = self.main_obj.device(DNM_SAMPLE_Y).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(293): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(577): # x_src = self.main_obj.device(DNM_SAMPLE_X).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(578): # y_src = self.main_obj.device(DNM_SAMPLE_Y).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(607): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -Found '.device(DNM_' 16 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\positioner_scan\PositionerScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\positioner_scan\PositionerScan.py(64): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 1 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\positioner_scan\positioner_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\positioner_scan\positioner_scan.py(84): if(self.main_obj.device(DNM_OSAY_TRACKING)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\positioner_scan\positioner_scan.py(86): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\positioner_scan\positioner_scan.py(87): self.main_obj.device(DNM_OSAY_TRACKING).put(0) #off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\positioner_scan\positioner_scan.py(96): if(self.main_obj.device(DNM_OSAY_TRACKING)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\positioner_scan\positioner_scan.py(98): self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\positioner_scan\positioner_scan.py(150): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -Found '.device(DNM_' 6 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\PtychographyScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\PtychographyScan.py(82): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\PtychographyScan.py(83): # ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\PtychographyScan.py(133): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\PtychographyScan.py(134): # ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\PtychographyScan.py(204): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\PtychographyScan.py(205): # ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\PtychographyScan.py(258): ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\PtychographyScan.py(294): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\PtychographyScan.py(295): # ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\PtychographyScan.py(425): gt_mtr = self.main_obj.device(DNM_GONI_THETA) -Found '.device(DNM_' 10 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(67): x_cntr = self.main_obj.device(DNM_SAMPLE_FINE_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(68): y_cntr = self.main_obj.device(DNM_SAMPLE_FINE_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(96): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(135): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(136): self.main_obj.device(DNM_OSAY_TRACKING).put(0) #off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(147): self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(163): mtr_x = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(164): mtr_y = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(182): mtr_x = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(183): mtr_y = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(215): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(216): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(218): mtr_sfx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(219): mtr_sfy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(258): mtr_zpx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(259): mtr_zpy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(261): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\cosmic\scan_plugins\ptychography_scan\ptychography_scan.py(262): mtr_gy = self.main_obj.device(DNM_GONI_Y) -Found '.device(DNM_' 18 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\CoarseGoniScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\CoarseGoniScan.py(57): mtr_x = MAIN_OBJ.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\CoarseGoniScan.py(58): mtr_y = MAIN_OBJ.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\CoarseGoniScan.py(59): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 3 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(102): # self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(103): # self.main_obj.device(DNM_OSAY_TRACKING).put(0) # off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(113): # self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(118): mtr_x = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(119): mtr_y = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(138): mtr_x = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(139): mtr_y = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(164): mtr_x = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(165): mtr_y = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(205): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(224): mtrx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(225): mtry = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(278): #cx = self.main_obj.device(DNM_GONI_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\coarse_goni_scan\coarse_goni_scan.py(279): #cy = self.main_obj.device(DNM_GONI_Y).get_position() -Found '.device(DNM_' 14 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\DetectorScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\DetectorScan.py(64): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\DetectorScan.py(65): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\DetectorScan.py(66): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 3 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(108): # self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(109): # self.main_obj.device(DNM_OSAY_TRACKING).put(0) # off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(119): # self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(127): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(128): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(146): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(147): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(172): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(173): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(209): x_src = self.main_obj.device(DNM_DETECTOR_X).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(210): y_src = self.main_obj.device(DNM_DETECTOR_Y).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(216): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(233): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(234): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(272): osa_mtr = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(310): mtr_x = self.main_obj.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\det_scan\det_scan.py(311): mtr_y = self.main_obj.device(DNM_DETECTOR_Y) -Found '.device(DNM_' 17 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(58): x_cntr = self.main_obj.device(DNM_GONI_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(59): y_cntr = self.main_obj.device(DNM_GONI_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(61): x_cntr = self.main_obj.device(DNM_SAMPLE_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(62): y_cntr = self.main_obj.device(DNM_SAMPLE_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(204): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(205): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(206): mtr_sfx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(207): mtr_sfy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(535): mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(536): mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(539): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(540): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(579): mtr_x = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(580): mtr_y = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(582): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\fine_image_scans.py(583): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 16 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageScan.py(84): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageScan.py(126): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageScan.py(127): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageScan.py(128): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 4 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(109): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(117): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(168): e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(169): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(170): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(171): ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(172): pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(235): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(236): # e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(237): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(238): # ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(239): # pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(318): ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(319): pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(695): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(696): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(700): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(701): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(748): self.main_obj.device(DNM_SAMPLE_FINE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(749): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(751): self.main_obj.device(DNM_SAMPLE_FINE_X).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(752): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(756): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(757): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(767): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(768): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(810): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(811): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(813): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(814): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(818): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(819): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(829): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(830): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(914): # ev = MAIN_OBJ.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1079): # self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1080): # self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1082): # # self.setupScan.set_positioner(1, self.main_obj.device(DNM_GONI_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1083): # # self.setupScan.set_positioner(2, self.main_obj.device(DNM_GONI_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1084): # # self.setupScan.set_positioner(3, self.main_obj.device(DNM_OSA_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1085): # # # self.setupScan.set_positioner(4, self.main_obj.device(DNM_OSA_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1092): # self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1093): # self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1114): # # # self.setupScan.put('P1PV', '%s.VAL' % self.main_obj.device(DNM_GONI_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1115): # # # self.setupScan.put('R1PV', '%s.RBV' % self.main_obj.device(DNM_GONI_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1120): # # # self.setupScan.put('P2PV', '%s.VAL' % self.main_obj.device(DNM_GONI_Y).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1121): # # # self.setupScan.put('R2PV', '%s.RBV' % self.main_obj.device(DNM_GONI_Y).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1126): # # # self.setupScan.put('P3PV', '%s.VAL' % self.main_obj.device(DNM_OSA_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_image_scans\SampleFineImageWithE712WavegenScan.py(1127): # # # self.setupScan.put('R3PV', '%s.RBV' % self.main_obj.device(DNM_OSA_X).get_name()) -Found '.device(DNM_' 49 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_point_scan\fine_point_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_point_scan\fine_point_scan.py(181): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_point_scan\fine_point_scan.py(182): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_point_scan\fine_point_scan.py(183): mtr_sfx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_point_scan\fine_point_scan.py(184): mtr_sfy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -Found '.device(DNM_' 4 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_point_scan\PointSpecScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_point_scan\PointSpecScan.py(75): mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_point_scan\PointSpecScan.py(76): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_point_scan\PointSpecScan.py(77): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_point_scan\PointSpecScan.py(78): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\fine_point_scan\PointSpecScan.py(118): mtr_x = self.main_obj.device(DNM_ZONEPLATE_X) -Found '.device(DNM_' 5 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusE712Scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusE712Scan.py(89): mtr_x = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusE712Scan.py(90): mtr_y = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusE712Scan.py(144): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusE712Scan.py(155): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusE712Scan.py(211): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusE712Scan.py(223): # mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusE712Scan.py(224): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusE712Scan.py(264): e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusE712Scan.py(278): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusE712Scan.py(282): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 10 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusScan.py(91): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusScan.py(92): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusScan.py(140): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusScan.py(141): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusScan.py(142): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\FocusScan.py(143): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 6 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(50): self.deltaA0FbkLbl = assign_aiLabelWidget(self.deltaA0FbkLbl, self.main_obj.device(DNM_DELTA_A0), -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(53): self.zpzFbkLbl = assign_aiLabelWidget(self.zpzFbkLbl, self.main_obj.device(DNM_ZPZ_RBV), hdrText='Zoneplate Z', -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(56): self.flFbkLbl = assign_aiLabelWidget(self.flFbkLbl, self.main_obj.device(DNM_FOCAL_LENGTH), -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(134): mtr_x = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(135): mtr_y = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(137): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(138): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(140): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(161): a0 = self.main_obj.device(DNM_DELTA_A0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(174): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(175): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(245): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(290): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(392): # mtrz = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(393): # fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(396): # idealA0 = self.main_obj.device(DNM_IDEAL_A0).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(414): mtrz = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(418): fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(439): # mtrz = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(443): # fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(459): #zpz_pos = self.main_obj.device(DNM_OSA_Z_BASE).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(514): # fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(516): # idealA0 = self.main_obj.device(DNM_IDEAL_A0).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(551): zpz_pos = self.main_obj.device(DNM_ZONEPLATE_Z).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(659): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(660): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(661): mtr_gz = self.main_obj.device(DNM_GONI_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(662): mtr_gt = self.main_obj.device(DNM_GONI_THETA) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(663): mtr_oz = self.main_obj.device(DNM_OSA_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(738): # mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(739): # mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(810): # mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(811): # mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(814): # mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\focus_scan\focus_scan.py(815): # mtr_gy = self.main_obj.device(DNM_GONI_Y) -Found '.device(DNM_' 35 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecScan.py(102): ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecScan.py(103): pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecScan.py(104): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecScan.py(167): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecScan.py(168): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecScan.py(169): mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecScan.py(170): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 7 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(100): mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(101): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(143): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(157): # mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(158): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(199): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(200): # e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(201): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(202): # ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(203): # pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(281): e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(282): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(283): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(286): mtr_ev = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(287): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(515): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(516): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(518): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(519): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(523): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\LineSpecSSCANWithE712WavegenScan.py(524): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 21 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(53): x_cntr = self.main_obj.device(DNM_GONI_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(54): y_cntr = self.main_obj.device(DNM_GONI_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(56): x_cntr = self.main_obj.device(DNM_SAMPLE_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(57): y_cntr = self.main_obj.device(DNM_SAMPLE_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(161): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(162): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(377): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(378): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(446): # mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(447): # mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(450): # mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(451): # mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(491): # mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(492): # mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(495): # mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(496): # mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(544): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(545): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(546): mtr_gz = self.main_obj.device(DNM_GONI_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(547): mtr_gt = self.main_obj.device(DNM_GONI_THETA) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\line_scan\line_scan.py(548): mtr_oz = self.main_obj.device(DNM_OSA_Z) -Found '.device(DNM_' 21 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\OsaFocusScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\OsaFocusScan.py(77): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\OsaFocusScan.py(78): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\OsaFocusScan.py(79): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\OsaFocusScan.py(80): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 4 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(87): if (self.main_obj.device(DNM_OSAY_TRACKING, do_warn=False)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(89): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(90): self.main_obj.device(DNM_OSAY_TRACKING).put(0) #off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(99): if (self.main_obj.device(DNM_OSAY_TRACKING, do_warn=False)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(101): self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(108): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(109): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(110): mtr_z = self.main_obj.device(DNM_ZONEPLATE_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(133): mtr_zpx = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(134): mtr_zpy = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(176): x_roi = get_base_start_stop_roi(SPDB_X, DNM_OSA_X, sx, ex, nx, src=self.main_obj.device(DNM_OSA_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(177): y_roi = get_base_start_stop_roi(SPDB_Y, DNM_OSA_Y, sy, ey, ny, src=self.main_obj.device(DNM_OSA_Y).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(178): zz_roi = get_base_roi(SPDB_ZZ, DNM_ZONEPLATE_Z_BASE, cz, rz, nz, enable=False, src=self.main_obj.device(DNM_ZONEPLATE_Z_BASE).get_name()) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(180): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(212): #mtrz = self.main_obj.device(DNM_ZONEPLATE_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(213): mtrz = self.main_obj.device(DNM_ZONEPLATE_Z_BASE) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(214): mtrx = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(215): mtry = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(216): oz = self.main_obj.device(DNM_OSA_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(221): fl = self.main_obj.device(DNM_FOCAL_LEN).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_focus_scan\osa_focus_scan.py(253): zpz_pos = self.main_obj.device(DNM_ZONEPLATE_Z).get_position() -Found '.device(DNM_' 21 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\OsaScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\OsaScan.py(54): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\OsaScan.py(55): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\OsaScan.py(56): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 3 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(58): if(self.main_obj.device(DNM_OSAY_TRACKING, do_warn=False)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(59): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(106): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(107): self.main_obj.device(DNM_OSAY_TRACKING).put(0) #off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(118): self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(126): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(127): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(145): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(146): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(170): mtr_x = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(171): mtr_y = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(211): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(231): mtrx = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(232): mtry = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(260): osax_mtr = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(261): osay_mtr = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(288): self.main_obj.device(DNM_OSA_X).move(x) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(289): self.main_obj.device(DNM_OSA_Y).move(y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(302): self.main_obj.device(DNM_OSA_X).move(xpos) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\osa_scan\osa_scan.py(303): self.main_obj.device(DNM_OSA_Y).move(ypos) -Found '.device(DNM_' 20 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(404): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(405): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(409): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(410): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(457): self.main_obj.device(DNM_SAMPLE_FINE_X).set_power(1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(458): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_power(1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(460): self.main_obj.device(DNM_SAMPLE_FINE_X).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(461): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(465): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(466): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(476): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(477): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(519): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(520): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(522): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(523): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(527): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(528): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(538): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenScan.py(539): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 20 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(66): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(74): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(119): # e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(120): # e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(121): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(122): # ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(123): # pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(528): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(529): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(533): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(534): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(581): self.main_obj.device(DNM_SAMPLE_FINE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(582): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(584): self.main_obj.device(DNM_SAMPLE_FINE_X).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(585): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(589): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(590): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(600): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(601): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(643): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(644): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(646): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(647): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(651): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(652): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(662): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\PatternGenWithE712WavegenScan.py(663): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 27 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(154): # mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(155): # mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(203): # mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(204): # mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(230): # mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(231): # mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(262): x_pos = self.main_obj.device(DNM_GONI_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(263): y_pos = self.main_obj.device(DNM_GONI_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(265): x_pos = self.main_obj.device(DNM_SAMPLE_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(266): y_pos = self.main_obj.device(DNM_SAMPLE_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(283): x_src = self.main_obj.device(DNM_SAMPLE_X).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(284): y_src = self.main_obj.device(DNM_SAMPLE_Y).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(289): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(573): # x_src = self.main_obj.device(DNM_SAMPLE_X).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(574): # y_src = self.main_obj.device(DNM_SAMPLE_Y).get_name() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\pattern_gen_scan\pattern_gen_scan.py(603): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -Found '.device(DNM_' 16 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\positioner_scan\PositionerScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\positioner_scan\PositionerScan.py(62): shutter = self.main_obj.device(DNM_SHUTTER) -Found '.device(DNM_' 1 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\positioner_scan\positioner_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\positioner_scan\positioner_scan.py(84): if(self.main_obj.device(DNM_OSAY_TRACKING)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\positioner_scan\positioner_scan.py(86): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\positioner_scan\positioner_scan.py(87): self.main_obj.device(DNM_OSAY_TRACKING).put(0) #off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\positioner_scan\positioner_scan.py(96): if(self.main_obj.device(DNM_OSAY_TRACKING)): -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\positioner_scan\positioner_scan.py(98): self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\positioner_scan\positioner_scan.py(150): energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -Found '.device(DNM_' 6 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(80): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(81): # ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(131): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(132): # ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(202): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(203): # ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(267): ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(285): ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(351): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(352): ring_cur = self.main_obj.device(DNM_RING_CURRENT).get_ophyd_device() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(353): ccd = self.main_obj.device(DNM_GREATEYES_CCD) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(354): pmt = self.main_obj.device(DNM_DEFAULT_COUNTER) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\PtychographyScan.py(474): gt_mtr = self.main_obj.device(DNM_GONI_THETA) -Found '.device(DNM_' 13 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(63): x_cntr = self.main_obj.device(DNM_SAMPLE_FINE_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(64): y_cntr = self.main_obj.device(DNM_SAMPLE_FINE_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(92): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(131): self.osay_trcking_was = self.main_obj.device(DNM_OSAY_TRACKING).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(132): self.main_obj.device(DNM_OSAY_TRACKING).put(0) #off -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(143): self.main_obj.device(DNM_OSAY_TRACKING).put(self.osay_trcking_was) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(159): mtr_x = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(160): mtr_y = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(178): mtr_x = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(179): mtr_y = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(211): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(212): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(214): mtr_sfx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(215): mtr_sfy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(254): mtr_zpx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(255): mtr_zpy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(257): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\ptychography_scan\ptychography_scan.py(258): mtr_gy = self.main_obj.device(DNM_GONI_Y) -Found '.device(DNM_' 18 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(80): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(92): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(127): ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(128): pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(129): gx_mtr = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(130): gy_mtr = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(131): gz_mtr = self.main_obj.device(DNM_GONI_Z) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(132): gt_mtr = self.main_obj.device(DNM_GONI_THETA) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(133): zpz_adjust_posner = self.main_obj.device(DNM_ZONEPLATE_Z_ADJUST) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(483): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(484): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(488): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(489): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(536): self.main_obj.device(DNM_SAMPLE_FINE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(537): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(539): self.main_obj.device(DNM_SAMPLE_FINE_X).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(540): self.main_obj.device(DNM_SAMPLE_FINE_Y).set_velo(100000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(544): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(545): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(555): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(556): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(598): self.main_obj.device(DNM_ZONEPLATE_X).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(599): self.main_obj.device(DNM_ZONEPLATE_Y).set_power( 1) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(601): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(602): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(606): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_SAMPLE_X)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(607): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_SAMPLE_Y)) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(617): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(618): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(656): # self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(657): # self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(664): # self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\TomographyWithE712WavegenScan.py(665): # self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -Found '.device(DNM_' 33 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(66): x_cntr = self.main_obj.device(DNM_GONI_X).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(67): y_cntr = self.main_obj.device(DNM_GONI_Y).get_position() -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(253): mtr_t = self.main_obj.device(DNM_GONI_THETA) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(330): mtr_sx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(331): mtr_sy = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(332): mtr_sfx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(333): mtr_sfy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(721): mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(722): mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(725): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(726): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(765): mtr_x = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(766): mtr_y = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(769): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\uhv_bl10ID1\scan_plugins\tomography_scan\tomography_scan.py(770): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -Found '.device(DNM_' 15 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\preferences\focusAndZoneplateParms\focusAndZoneplateParms.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\preferences\focusAndZoneplateParms\focusAndZoneplateParms.py(239): #MAIN_OBJ.device(DNM_ZONEPLATE_SCAN_MODE).put('user_setpoint', 1) -Found '.device(DNM_' 1 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\beam_spot_fbk.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\beam_spot_fbk.py(35): self.cx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\beam_spot_fbk.py(36): self.cy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\beam_spot_fbk.py(38): self.cx = self.main_obj.device(DNM_COARSE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\beam_spot_fbk.py(39): self.cy = self.main_obj.device(DNM_COARSE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\beam_spot_fbk.py(42): self.fx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\beam_spot_fbk.py(43): self.fy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\beam_spot_fbk.py(45): self.fx = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\beam_spot_fbk.py(46): self.fy = self.main_obj.device(DNM_SAMPLE_FINE_Y) -Found '.device(DNM_' 8 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\camera_ruler.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\camera_ruler.py(131): #self.calib_camera = self.main_obj.device(DNM_CALIB_CAMERA_CLIENT) -Found '.device(DNM_' 1 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\camera_ruler_latest.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\camera_ruler_latest.py(126): #self.calib_camera = MAIN_OBJ.device(DNM_CALIB_CAMERA_SRVR) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\camera_ruler_latest.py(134): #self.calib_camera = MAIN_OBJ.device(DNM_CALIB_CAMERA_CLIENT) -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\camera_ruler_latest.py(143): #self.calib_camera = MAIN_OBJ.device(DNM_CALIB_CAMERA_CLIENT) -Found '.device(DNM_' 3 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\scan_table_view\evSelWidget.py' : -C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\widgets\scan_table_view\evSelWidget.py(325): init_ev = self.main_obj.device(DNM_ENERGY).get_position() -Found '.device(DNM_' 1 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\appWidgets\main_object.py' : -C:\controls\sandbox\pyStxm3\cls\appWidgets\main_object.py(155): posner = self.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\appWidgets\main_object.py(157): posner = self.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\appWidgets\main_object.py(160): posner = self.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\appWidgets\main_object.py(162): posner = self.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\appWidgets\main_object.py(175): posner = self.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\appWidgets\main_object.py(177): posner = self.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\appWidgets\main_object.py(180): posner = self.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\appWidgets\main_object.py(182): posner = self.device(DNM_SAMPLE_FINE_Y) -Found '.device(DNM_' 8 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\caWidgets\caLabelWidget.py' : -C:\controls\sandbox\pyStxm3\cls\caWidgets\caLabelWidget.py(470): self.evFbkLbl = ca_aiLabelWidget(MAIN_OBJ.device(DNM_ENERGY_RBV), hdrText='Energy', egu='eV', -C:\controls\sandbox\pyStxm3\cls\caWidgets\caLabelWidget.py(474): self.aiFbkLbl = ca_aiLabelWidget(MAIN_OBJ.device(DNM_AX2_INTERFER_VOLTS), hdrText='Ax2 Interferometer', egu='volts', -Found '.device(DNM_' 2 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\devWidgets\ophydLabelWidget.py' : -C:\controls\sandbox\pyStxm3\cls\devWidgets\ophydLabelWidget.py(525): #self.evFbkLbl = ophyd_aiLabelWidget(MAIN_OBJ.device(DNM_ENERGY_RBV), hdrText='Energy', egu='eV', -Found '.device(DNM_' 1 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\scanning\base.py' : -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(390): mtr_zpx = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(391): mtr_zpy = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(394): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(395): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(612): pol = self.main_obj.device(DNM_EPU_POLARIZATION).get_position() -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(613): offset = self.main_obj.device(DNM_EPU_OFFSET).get_position() -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(614): angle = self.main_obj.device(DNM_EPU_ANGLE).get_position() -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(1376): zpz_scanflag = self.main_obj.device(DNM_ZONEPLATE_SCAN_MODE) -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(1607): here energy_pos = self.main_obj.device(DNM_ENERGY).get_position() -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(2397): mtr_gx = self.main_obj.device(DNM_GONI_X) -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(2398): mtr_gy = self.main_obj.device(DNM_GONI_Y) -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(2399): mtr_gz = self.main_obj.device(DNM_GONI_Z) -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(2400): mtr_gt = self.main_obj.device(DNM_GONI_THETA) -C:\controls\sandbox\pyStxm3\cls\scanning\base.py(2401): mtr_oz = self.main_obj.device(DNM_OSA_Z) -Found '.device(DNM_' 14 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py' : -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(455): #def make_standard_metadata(self, entry_name, scan_type, dets=[self.main_obj.device(DNM_DEFAULT_COUNTER)], override_xy_posner_nms=False): -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(469): dets = [self.main_obj.device(DNM_DEFAULT_COUNTER)] -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(542): counter_dev = self.main_obj.device(DNM_DEFAULT_COUNTER) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(1377): if(self.main_obj.device(DNM_SHUTTER).is_auto()): -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(1378): self.main_obj.device(DNM_SHUTTER).close() -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(2207): if (self.main_obj.device(DNM_SHUTTER).is_auto()): -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(2208): self.main_obj.device(DNM_SHUTTER).close() -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(2572): # if (self.main_obj.device(DNM_SHUTTER).is_auto()): -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(2573): # self.main_obj.device(DNM_SHUTTER).close() -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(3570): if (self.main_obj.device(DNM_SHUTTER).is_auto()): -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(3571): self.main_obj.device(DNM_SHUTTER).open() -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4043): cx_pwr = self.main_obj.device(DNM_CX_AUTO_DISABLE_POWER, do_warn=False) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4044): cy_pwr = self.main_obj.device(DNM_CY_AUTO_DISABLE_POWER, do_warn=False) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4141): self.main_obj.device(DNM_ZONEPLATE_X).move(0.0) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4142): self.main_obj.device(DNM_ZONEPLATE_Y).move(0.0) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4154): #self.main_obj.device(DNM_OSA_X).move(0.0) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4447): #ox = self.main_obj.device(DNM_OSA_X) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4448): #oy = self.main_obj.device(DNM_OSA_Y) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4468): zxmtr = self.main_obj.device(DNM_ZONEPLATE_X, do_warn=False) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4469): zymtr = self.main_obj.device(DNM_ZONEPLATE_Y, do_warn=False) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4500): # self.setupScan.set_positioner(1, self.main_obj.device(DNM_GONI_X)) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4501): # self.setupScan.set_positioner(2, self.main_obj.device(DNM_GONI_Y)) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4502): # self.setupScan.set_positioner(3, self.main_obj.device(DNM_OSA_X)) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4503): # #self.setupScan.set_positioner(4, self.main_obj.device(DNM_OSA_Y)) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4513): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4514): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4582): # self.setupScan.put('P1PV', '%s.VAL' % self.main_obj.device(DNM_GONI_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4583): # self.setupScan.put('R1PV', '%s.RBV' % self.main_obj.device(DNM_GONI_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4586): # self.setupScan.put('P2PV', '%s.VAL' % self.main_obj.device(DNM_GONI_Y).get_name()) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4587): # self.setupScan.put('R2PV', '%s.RBV' % self.main_obj.device(DNM_GONI_Y).get_name()) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4590): # self.setupScan.put('P3PV', '%s.VAL' % self.main_obj.device(DNM_OSA_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4591): # self.setupScan.put('R3PV', '%s.RBV' % self.main_obj.device(DNM_OSA_X).get_name()) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4633): # self.sample_mtrx = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4634): # self.sample_mtry = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4637): # self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4638): # self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4640): # self.sample_finex = self.main_obj.device(DNM_SAMPLE_FINE_X) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(4641): # self.sample_finey = self.main_obj.device(DNM_SAMPLE_FINE_Y) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5228): # mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5229): # mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5231): # shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5295): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5326): e712_dev = self.main_obj.device(DNM_E712_OPHYD_DEV) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5327): e712_wdg = self.main_obj.device(DNM_E712_WIDGET) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5328): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5329): ev_mtr = self.main_obj.device(DNM_ENERGY) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5330): pol_mtr = self.main_obj.device(DNM_EPU_POLARIZATION) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5446): self.main_obj.device(DNM_ZONEPLATE_X).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5447): self.main_obj.device(DNM_ZONEPLATE_Y).set_velo(1000000.0) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5449): self.sample_mtrx = self.sample_finex = self.main_obj.device(DNM_ZONEPLATE_X) -C:\controls\sandbox\pyStxm3\cls\scanning\BaseScan.py(5450): self.sample_mtry = self.sample_finey = self.main_obj.device(DNM_ZONEPLATE_Y) -Found '.device(DNM_' 51 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\scanning\interfaces.py' : -C:\controls\sandbox\pyStxm3\cls\scanning\interfaces.py(26): xmtr = MAIN_OBJ.device(DNM_DETECTOR_X) -C:\controls\sandbox\pyStxm3\cls\scanning\interfaces.py(27): ymtr = MAIN_OBJ.device(DNM_DETECTOR_Y) -C:\controls\sandbox\pyStxm3\cls\scanning\interfaces.py(36): # self.gate = MAIN_OBJ.device(DNM_GATE) -C:\controls\sandbox\pyStxm3\cls\scanning\interfaces.py(37): # self.counter = MAIN_OBJ.device(DNM_COUNTER_APD) -C:\controls\sandbox\pyStxm3\cls\scanning\interfaces.py(38): # self.shutter = MAIN_OBJ.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\scanning\interfaces.py(96): MAIN_OBJ.device(DNM_DX_AUTO_DISABLE_POWER).put(0) -C:\controls\sandbox\pyStxm3\cls\scanning\interfaces.py(97): MAIN_OBJ.device(DNM_DY_AUTO_DISABLE_POWER).put(0) -C:\controls\sandbox\pyStxm3\cls\scanning\interfaces.py(123): MAIN_OBJ.device(DNM_DX_AUTO_DISABLE_POWER).put(1) # enable again -C:\controls\sandbox\pyStxm3\cls\scanning\interfaces.py(124): MAIN_OBJ.device(DNM_DY_AUTO_DISABLE_POWER).put(1) -Found '.device(DNM_' 9 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\scanning\ScanTableView-orig.py' : -C:\controls\sandbox\pyStxm3\cls\scanning\ScanTableView-orig.py(3153): init_ev = MAIN_OBJ.device(DNM_ENERGY).get_position() -Found '.device(DNM_' 1 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py' : -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(178): self.evFbkLbl = assign_aiLabelWidget(self.evFbkLbl, MAIN_OBJ.device(DNM_ENERGY_RBV), hdrText='Energy', egu='eV', title_color='white', var_clr='white') -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(179): self.a1FbkLbl = assign_aiLabelWidget(self.a1FbkLbl, MAIN_OBJ.device(DNM_ZP_DEF_A), hdrText='A1', egu='', title_color='white', var_clr='white',format='%5.4f') -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(180): self.a0MaxFbkLbl = assign_aiLabelWidget(self.a0MaxFbkLbl, MAIN_OBJ.device(DNM_A0MAX), hdrText=DNM_A0MAX, egu='um', title_color='white', var_clr='white',format='%5.2f') -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(181): self.flFbkLbl = assign_aiLabelWidget(self.flFbkLbl, MAIN_OBJ.device(DNM_FOCAL_LENGTH), hdrText='Fl', egu='um', title_color='white', var_clr='white',format='%5.2f') -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(182): self.sampleZFbkLbl = assign_aiLabelWidget(self.sampleZFbkLbl, MAIN_OBJ.device(DNM_IDEAL_A0), hdrText='Cz', egu='um', title_color='white', var_clr='white',format='%5.2f') -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(183): self.zpzFbkLbl = assign_aiLabelWidget(self.zpzFbkLbl, MAIN_OBJ.device(DNM_ZPZ_POS), hdrText='Zpz', egu='um', title_color='white', var_clr='white',format='%5.2f') -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(254): #MAIN_OBJ.device(DNM_ZONEPLATE_SCAN_MODE).put('user_setpoint', 1) -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(255): MAIN_OBJ.device(DNM_ZONEPLATE_SCAN_MODE).put(1) -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(273): #Jan16 2018 MAIN_OBJ.device(DNM_A0).put(A0) -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(275): MAIN_OBJ.device(DNM_ZP_SELECT).put('user_setpoint', zp_idx) -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(277): #zp_def = MAIN_OBJ.device(DNM_ZP_DEF) -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(289): MAIN_OBJ.device(DNM_A0).put(A0) -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(295): MAIN_OBJ.device(DNM_ZP_SELECT).put('user_setpoint', zp_idx) -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(300): MAIN_OBJ.device(DNM_OSA_SELECT).put('user_setpoint', osa_idx) -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(304): osasel_pv = MAIN_OBJ.device(DNM_OSA_SELECT) -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(305): osadef_pv = MAIN_OBJ.device(DNM_OSA_DEF) -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(354): #fl = MAIN_OBJ.device(DNM_FOCAL_LENGTH).get() -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(355): #Zpz_pos = MAIN_OBJ.device(DNM_ZPZ_POS).get() -C:\controls\sandbox\pyStxm3\cls\templates\preferences\prefTemplate\prefTemplate.py(380): # Zpz_pos = MAIN_OBJ.device(DNM_ZPZ_POS).get() -Found '.device(DNM_' 19 time(s). ----------------------------------------- -Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\utils\test_data\srch_rep_tst.py' : -C:\controls\sandbox\pyStxm3\cls\utils\test_data\srch_rep_tst.py(30): Find '.device(DNM_' in 'C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py' : -C:\controls\sandbox\pyStxm3\cls\utils\test_data\srch_rep_tst.py(31): C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(84): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\utils\test_data\srch_rep_tst.py(32): C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(125): mtr_x = self.main_obj.device(DNM_SAMPLE_X) -C:\controls\sandbox\pyStxm3\cls\utils\test_data\srch_rep_tst.py(33): C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(126): mtr_y = self.main_obj.device(DNM_SAMPLE_Y) -C:\controls\sandbox\pyStxm3\cls\utils\test_data\srch_rep_tst.py(34): C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(127): shutter = self.main_obj.device(DNM_SHUTTER) -C:\controls\sandbox\pyStxm3\cls\utils\test_data\srch_rep_tst.py(35): C:\controls\sandbox\pyStxm3\cls\applications\pyStxm\bl_configs\basic\scan_plugins\coarse_image_scan\CoarseSampleImageScan.py(374): #scan_velo = self.get_mtr_max_velo(self.main_obj.device(DNM_SAMPLE_FINE_X)) -C:\controls\sandbox\pyStxm3\cls\utils\test_data\srch_rep_tst.py(36): Found '.device(DNM_' 5 time(s). -Found '.device(DNM_' 7 time(s). -Search complete, found '.device(DNM_' 1265 time(s). (94 files.) \ No newline at end of file diff --git a/cls/utils/version.py b/cls/utils/version.py index 78c707d0..2f9ff492 100644 --- a/cls/utils/version.py +++ b/cls/utils/version.py @@ -4,9 +4,9 @@ def get_version(): - filename = r"./version.json" - if os.path.exists(filename): - js = file_to_json(filename) + ver_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "version.json") + if os.path.exists(ver_path): + js = file_to_json(ver_path) ver_dct = json_to_dict(js) else: diff --git a/nx_server/nx_server.py b/nx_server/nx_server.py index c0e82798..eced83dd 100644 --- a/nx_server/nx_server.py +++ b/nx_server/nx_server.py @@ -46,7 +46,7 @@ def get_data_subdirectories(directory, extension): Returns a list of dicts for all subdirectories that contain at least one file with the given extension, ordered from most recent to least recent by modification time. Each dict contains 'sub_dir' and 'num_h5_files'. - Handles missing directory gracefully. + Handles missing directory and permission errors gracefully. """ result = [] try: @@ -54,17 +54,19 @@ def get_data_subdirectories(directory, extension): d for d in os.listdir(directory) if os.path.isdir(os.path.join(directory, d)) ] - # Sort subdirs by modification time (most recent first) subdirs.sort( key=lambda d: os.path.getmtime(os.path.join(directory, d)), reverse=True ) for d in subdirs: subdir_path = os.path.join(directory, d) - num_files = len([ - f for f in os.listdir(subdir_path) - if os.path.isfile(os.path.join(subdir_path, f)) and f.endswith(extension) - ]) + try: + num_files = len([ + f for f in os.listdir(subdir_path) + if os.path.isfile(os.path.join(subdir_path, f)) and f.endswith(extension) + ]) + except PermissionError: + num_files = 0 result.append({'sub_dir': d, 'num_h5_files': num_files}) except FileNotFoundError: pass diff --git a/nx_server/talk_to_nx_server.py b/nx_server/talk_to_nx_server.py index f2372ac8..0ccf5434 100644 --- a/nx_server/talk_to_nx_server.py +++ b/nx_server/talk_to_nx_server.py @@ -19,7 +19,7 @@ 'is_windows': None, 'get_file_sequence_names': None, 'loadfile_directory': '{"cmd_args":{"directory":"/mnt/srv-unix-home/bergr/Data/2025-08-19","extension":".hdf5"}}', - 'loadfile_file': '{"cmd_args":{"file":"/mnt/srv-unix-home/bergr/Data/2025-08-20/A250820002/A250820002.hdf5"}}', + 'loadfile_file': '{"cmd_args":{"file":"/beamlinedata/SM/operations/STXM-data/ASTXM_upgrade_tmp/2025/2025-10-20/A251020035.hdf5"}}', #'loadfile_files': '{"cmd_args":{"files":["/mnt/srv-unix-home/bergr/Data/2025-08-19/OSA_2025-08-19_002.hdf5","/mnt/srv-unix-home/bergr/Data/2025-08-19/Detector_2025-08-19_001.hdf5"]}}', 'loadfile_files': '{ "directory": "/mnt/srv-unix-home/bergr/Data/2025-08-13", "file": "/mnt/srv-unix-home/bergr/Data/2025-08-13/.hdf5", "showHidden": 0, "fileExtension": ".hdf5", "directories": ["..", "discard"], "files": [], "pluginNumber": 0 }', 'list_directory': '{"cmd_args":{"directory":"/mnt/srv-unix-home/bergr/Data","fileExtension":".hdf5"}}', @@ -182,8 +182,9 @@ def send_request(self): NX_SERVER_PUB_PORT = 5565 app = QApplication(sys.argv) - host = 'vopi1610-005.clsi.ca' + # host = 'vopi1610-005.clsi.ca' # host = 'localhost' + host = '10.52.32.41' req_port = int(os.getenv('NX_SERVER_PORT', NX_SERVER_REP_PORT)) window = NXServerApp(host, req_port=NX_SERVER_REP_PORT, sub_port=NX_SERVER_PUB_PORT) window.show() diff --git a/requirements.txt b/requirements.txt index b33eaf82..65f17500 100755 Binary files a/requirements.txt and b/requirements.txt differ diff --git a/run_nx_server.sh b/run_nx_server.sh new file mode 100755 index 00000000..67051098 --- /dev/null +++ b/run_nx_server.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Function to find the conda command +find_conda() { + if command -v conda &> /dev/null; then + echo "$(command -v conda)" + else + echo "Conda command not found. Please ensure conda is installed and in your PATH." + exit 1 + fi +} + +# Find the conda command +CONDA_CMD=$(find_conda) + +# Initialize conda +eval "$($CONDA_CMD shell.bash hook)" &> /dev/null + +# Activate the conda environment +conda activate pyStxm &> /dev/null + +source ./reqd_env_vars.sh +python ./nx_server/nx_server.py + diff --git a/version.json b/version.json deleted file mode 100644 index 2451e538..00000000 --- a/version.json +++ /dev/null @@ -1 +0,0 @@ -"{\n \"auth\": \"Russ Berg\",\n \"commit\": \"147f6ed313135ce03f906b21d3d55f29e6aab4be\",\n \"date\": \" Mon Jun 26 11:20:25 2023 -0600\",\n \"major_ver\": \"3\",\n \"minor_ver\": \"0\",\n \"ver\": \"3.0\",\n \"ver_str\": \"Version 3.0\"\n}" \ No newline at end of file