How to use the interface.simple_laser_interface.LaserState.ON function in Interface

To help you get started, we’ve selected a few Interface examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Ulm-IQO / qudi / hardware / laser / laserquantum_laser.py View on Github external
def get_laser_state(self):
        """ Get laser operation state

        @return LaserState: laser state
        """
        if self.psu == PSUTypes.SMD6000:
            state = self.inst.query('STAT?')
        else:
            state = self.inst.query('STATUS?')
        if 'ENABLED' in state:
            return LaserState.ON
        elif 'DISABLED' in state:
            return LaserState.OFF
        else:
            return LaserState.UNKNOWN
github Ulm-IQO / qudi / hardware / laser / millennia_ev_laser.py View on Github external
def get_laser_state(self):
        """ Get laser state.

        @return LaserState: current laser state
        """
        diode = int(self.inst.query('?D'))
        state = self.inst.query('?F')

        if state in ('SYS ILK', 'KEY ILK'):
            return LaserState.LOCKED
        elif state == 'SYSTEM OK':
            if diode == 1:
                return LaserState.ON
            elif diode == 0:
                return LaserState.OFF
            else:
                return LaserState.UNKNOWN
        else:
            return LaserState.UNKNOWN
github Ulm-IQO / qudi / hardware / laser / millennia_ev_laser.py View on Github external
def set_laser_state(self, status):
        """ Set laser state

        @param LaserState status: desited laser state
        @return LaserState: actual laser state
        """
        actstat = self.get_laser_state()
        if actstat != status:
            if status == LaserState.ON:
                self.inst.query('ON')
            elif status == LaserState.OFF:
                self.inst.query('OFF')
        return self.get_laser_state()
github Ulm-IQO / qudi / hardware / laser / coherent_obis_laser.py View on Github external
def set_laser_state(self, status):
        """ Set desited laser state.

        @param LaserState status: desired laser state
        @return LaserState: actual laser state
        """
        # TODO: this is big. cannot be called without having LaserState, 
        #       which is only defined in the simple laser interface.
        #       I think this shoudl be a private method.
        actstat = self.get_laser_state()
        if actstat != status:

            if status == LaserState.ON:
                self._communicate('SOUR:AM:STAT ON')
                #return self.get_laser_state()
            elif status == LaserState.OFF:
                self._communicate('SOUR:AM:STAT OFF')
                #return self.get_laser_state()
            return self.get_laser_state()
github Ulm-IQO / qudi / hardware / laser / laserquantum_laser.py View on Github external
def on(self):
        """ Turn laser on.

            @return LaserState: actual laser state
        """
        return self.set_laser_state(LaserState.ON)
github Ulm-IQO / qudi / hardware / laser / laserquantum_laser.py View on Github external
def get_laser_state(self):
        """ Get laser operation state

        @return LaserState: laser state
        """
        if self.psu == PSUTypes.SMD6000:
            state = self.inst.query('STAT?')
        else:
            state = self.inst.query('STATUS?')
        if 'ENABLED' in state:
            return LaserState.ON
        elif 'DISABLED' in state:
            return LaserState.OFF
        else:
            return LaserState.UNKNOWN
github Ulm-IQO / qudi / logic / interfuse / aom_laser_interfuse.py View on Github external
def on(self):
        """ Turn on laser.

            @return LaserState: actual laser state
        """
        return self.set_laser_state(LaserState.ON)
github Ulm-IQO / qudi / hardware / laser / millennia_ev_laser.py View on Github external
def get_laser_state(self):
        """ Get laser state.

        @return LaserState: current laser state
        """
        diode = int(self.inst.query('?D'))
        state = self.inst.query('?F')

        if state in ('SYS ILK', 'KEY ILK'):
            return LaserState.LOCKED
        elif state == 'SYSTEM OK':
            if diode == 1:
                return LaserState.ON
            elif diode == 0:
                return LaserState.OFF
            else:
                return LaserState.UNKNOWN
        else:
            return LaserState.UNKNOWN