Пример #1
0
    def init(self):

        self.moving = False

        self.doBacklashCompensation = False

        self.current_energy = None
        self.current_state = None

        try:
            self.monodevice = DeviceProxy(self.getProperty("mono_device"))
        except BaseException:
            self.errorDeviceInstance(self.getProperty("mono_device"))

        # Nom du device bivu (Energy to gap) : necessaire pour amelioration du
        # positionnement de l'onduleur (Backlash)
        self.und_device = DeviceProxy(self.getProperty("undulator_device"))
        self.doBacklashCompensation = self.getProperty("backlash")

        # parameters for polling
        self.isConnected()

        self.energy_chan = self.getChannelObject("energy")
        self.energy_chan.connectSignal("update", self.energyChanged)

        self.stop_cmd = self.getCommandObject("stop")

        self.state_chan = self.getChannelObject("state")
        self.state_chan.connectSignal("update", self.stateChanged)
Пример #2
0
    def init(self):
        self.ready_event = gevent.event.Event()

        self.ruche_hwo = self.get_object_by_role("ruche")

        self.fluodet_hwo = self.get_object_by_role("fluodet")
        self.px1env_hwo = self.get_object_by_role("px1environment")

        self.mono_dp = DeviceProxy(self.get_property("mono_dev"))
        self.ble_dp = DeviceProxy(self.get_property("ble_dev"))
        self.fp_dp = DeviceProxy(self.get_property("fp_dev"))

        test_data_file = self.get_property("test_data")

        self.log.debug(" using test data %s" % test_data_file)

        self.test_data_mode = False

        if test_data_file:
            self.simul_data = self.load_data_file(test_data_file)
            if len(self.simul_data):
                self.test_data_mode = True

        # USING TEST. UNCOMMENT NEXT LINE TO USE REAL DATA IN ALL CASES
        # self.test_data_mode = False

        normdiode = self.get_property("normalization_diode")
        self.norm_diode_dev = DeviceProxy(normdiode)

        self.number_of_steps = self.get_property("number_of_steps")
        if self.number_of_steps is None:
            self.number_of_steps = self.default_steps
Пример #3
0
    def init(self):

        self.device = DeviceProxy(self.getProperty("tangoname"))

        try:
            self.state_chan = self.get_channel_object("State")
            self.state_chan.connectSignal("update", self.stateChanged)

        except KeyError:
            logging.getLogger().warning("%s: cannot report State", self.name())

        try:
            self.chanAuth = self.get_channel_object("beamlineMvtAuthorized")
            self.chanAuth.connectSignal("update", self.setAuthorizationFlag)
            # state = self.state_chan.getValue()

        except KeyError:
            logging.getLogger().warning("%s: cannot report State", self.name())

        try:
            self.usingCapillaryChannel = self.get_channel_object(
                "usingCapillary")
            self.setUsingCapillary(True)
        except BaseException:
            self.usingCapillaryChannel = None

        try:
            self.beamstopPositionChannel = self.get_channel_object(
                "beamstopPosition")
        except BaseException:
            self.beamstopPositionChannel = None

        if self.device is not None:
            self.setIsReady(True)

            self.cmds = {
                EnvironmentPhase.TRANSFER:
                self.device.GoToTransfertPhase,
                EnvironmentPhase.CENTRING:
                self.device.GoToCentringPhase,
                EnvironmentPhase.COLLECT:
                self.device.GoToCollectPhase,
                EnvironmentPhase.DEFAULT:
                self.device.GoToDefaultPhase,
                # EnvironmentPhase.BEAMVIEW: self.device.GoToBeamViewPhase,
                EnvironmentPhase.FLUOX:
                self.device.GoToFluoXPhase,
                EnvironmentPhase.MANUALTRANSFER:
                self.device.GoToManualTransfertPhase,
                EnvironmentPhase.VISUSAMPLE:
                self.device.GoToVisuSamplePhase,
            }
Пример #4
0
    def init(self):
        """
        Init method
        """

        self.collect_devname = self.get_property("tangoname")
        self.collect_device = DeviceProxy(self.collect_devname)

        self.collect_state_chan = self.get_channel_object("state")

        self.px1env_hwobj = self.get_object_by_role("environment")

        self.frontend_hwobj = self.get_object_by_role("frontend")

        self.lightarm_hwobj = self.get_object_by_role("lightarm")

        self.mxlocal_object = self.get_object_by_role("beamline_configuration")

        self.img2jpeg = self.get_property("imgtojpeg")
        undulators = self.get_undulators()

        self.exp_type_dict = {"Mesh": "raster", "Helical": "Helical"}

        det_px, det_py = HWR.beamline.detector.get_pixel_size()
        beam_div_hor, beam_div_ver = HWR.beamline.beam.get_beam_divergence()

        self.set_beamline_configuration(
            synchrotron_name="SOLEIL",
            directory_prefix=self.get_property("directory_prefix"),
            default_exposure_time=HWR.beamline.detector.
            get_default_exposure_time(),
            minimum_exposure_time=HWR.beamline.detector.
            get_minimum_exposure_time(),
            detector_fileext=HWR.beamline.detector.get_file_suffix(),
            detector_type=HWR.beamline.detector.get_detector_type(),
            detector_manufacturer=HWR.beamline.detector.get_manufacturer(),
            detector_model=HWR.beamline.detector.get_model(),
            detector_px=det_px,
            detector_py=det_py,
            undulators=undulators,
            focusing_optic=self.get_property("focusing_optic"),
            monochromator_type=self.get_property("monochromator"),
            beam_divergence_vertical=beam_div_ver,
            beam_divergence_horizontal=beam_div_hor,
            polarisation=self.get_property("polarisation"),
            input_files_server=self.get_property("input_files_server"),
        )

        self.emit("collectConnected", (True, ))
        self.emit("collectReady", (True, ))
Пример #5
0
    def init(self):
        self.ready_event = gevent.event.Event()

        self.session_hwo = self.getObjectByRole("session")
        self.ruche_hwo = self.getObjectByRole("ruche")
        self.db_connection_hwo = self.getObjectByRole("dbserver")

        self.fluodet_hwo = self.getObjectByRole("fluodet")
        self.fastshut_hwo = self.getObjectByRole("fast_shutter")
        self.safety_shutter_hwo = self.getObjectByRole("safety_shutter")
        self.px1env_hwo = self.getObjectByRole("px1environment")
        self.beaminfo_hwo = self.getObjectByRole("beaminfo")

        self.mono_dp = DeviceProxy(self.getProperty("mono_dev"))
        self.ble_dp = DeviceProxy(self.getProperty("ble_dev"))
        self.fp_dp = DeviceProxy(self.getProperty("fp_dev"))

        test_data_file = self.getProperty("test_data")

        self.log.debug(" using test data %s" % test_data_file)

        self.test_data_mode = False

        if test_data_file:
            self.simul_data = self.load_data_file(test_data_file)
            if len(self.simul_data):
                self.test_data_mode = True

        # USING TEST. UNCOMMENT NEXT LINE TO USE REAL DATA IN ALL CASES
        # self.test_data_mode = False

        normdiode = self.getProperty('normalization_diode')
        self.norm_diode_dev = DeviceProxy(normdiode)

        self.number_of_steps = self.getProperty("number_of_steps")
        if self.number_of_steps is None:
            self.number_of_steps = self.default_steps
Пример #6
0
    def init(self):

        super(PX1Cryotong, self).init()

        self.cats_device = DeviceProxy(self.getProperty("cats_device"))

        self.environment = self.getObjectByRole("environment")

        if self.environment is None:
            logging.error(
                "PX1Cats. environment object not available. Sample changer cannot operate. Info.mode only"
            )
            self.infomode = True
        else:
            self.infomode = False

        for channel_name in (
                "_chnSoftAuth",
                "_chnHomeOpened",
                "_chnDryAndSoakNeeded",
                "_chnIncoherentGonioSampleState",
                "_chnSampleIsDetected",
                "_chnCountDown",
        ):
            setattr(self, channel_name, self.get_channel_object(channel_name))

        self._chnSoftAuth.connectSignal("update", self._softwareAuthorization)
        self._chnHomeOpened.connectSignal("update", self._updateHomeOpened)
        self._chnIncoherentGonioSampleState.connectSignal(
            "update", self._updateAckSampleMemory)
        self._chnDryAndSoakNeeded.connectSignal("update",
                                                self._dryAndSoakNeeded)
        self._chnSampleIsDetected.connectSignal("update",
                                                self._updateSampleIsDetected)
        self._chnCountDown.connectSignal("update", self._updateCountDown)

        self._cmdDrySoak = self.add_command(
            {
                "type": "tango",
                "name": "_cmdDrySoak",
                "tangoname": self.tangoname
            },
            "DryAndSoak",
        )
Пример #7
0
    def init(self):
        """
        Init method
        """

        self.collect_devname = self.getProperty("tangoname")
        self.collect_device = DeviceProxy(self.collect_devname)

        self.collect_state_chan = self.getChannelObject("state")

        self.px1env_hwobj = self.getObjectByRole("environment")

        self.fastshut_hwobj = self.getObjectByRole("fastshut")
        self.frontend_hwobj = self.getObjectByRole("frontend")
        self.safshut_hwobj = self.getObjectByRole("safshut")

        self.lightarm_hwobj = self.getObjectByRole("lightarm")

        self.diffractometer_hwobj = self.getObjectByRole("diffractometer")
        self.mxlocal_object = self.getObjectByRole("beamline_configuration")

        self.omega_hwobj = self.getObjectByRole("omega")
        self.kappa_hwobj = self.getObjectByRole("kappa")
        self.phi_hwobj = self.getObjectByRole("phi")

        self.lims_client_hwobj = self.getObjectByRole("lims_client")
        self.machine_info_hwobj = self.getObjectByRole("machine_info")
        self.energy_hwobj = self.getObjectByRole("energy")
        self.resolution_hwobj = self.getObjectByRole("resolution")
        self.transmission_hwobj = self.getObjectByRole("transmission")
        self.detector_hwobj = self.getObjectByRole("detector")
        self.beam_info_hwobj = self.getObjectByRole("beam_info")
        # self.autoprocessing_hwobj = self.getObjectByRole("auto_processing")
        self.graphics_manager_hwobj = self.getObjectByRole("graphics_manager")
        self.flux_hwobj = self.getObjectByRole("flux")

        self.img2jpeg = self.getProperty("imgtojpeg")
        undulators = self.get_undulators()

        self.exp_type_dict = {'Mesh': 'raster',
                              'Helical': 'Helical'}

        det_px, det_py = self.detector_hwobj.get_pixel_size()

        self.set_beamline_configuration(\
             synchrotron_name="SOLEIL",
             directory_prefix=self.getProperty("directory_prefix"),
             default_exposure_time=self.detector_hwobj.get_default_exposure_time(),
             minimum_exposure_time=self.detector_hwobj.get_minimum_exposure_time(),
             detector_fileext=self.detector_hwobj.get_file_suffix(),
             detector_type=self.detector_hwobj.get_detector_type(),
             detector_manufacturer=self.detector_hwobj.get_manufacturer(),
             detector_model=self.detector_hwobj.get_model(),
             detector_px=det_px,
             detector_py=det_py,
             undulators=undulators,
             focusing_optic=self.getProperty('focusing_optic'),
             monochromator_type=self.getProperty('monochromator'),
             beam_divergence_vertical=self.beam_info_hwobj.get_beam_divergence_hor(),
             beam_divergence_horizontal=self.beam_info_hwobj.get_beam_divergence_ver(),
             polarisation=self.getProperty('polarisation'),
             input_files_server=self.getProperty("input_files_server"))

        self.emit("collectConnected", (True,))
        self.emit("collectReady", (True, ))