Source code for msl.equipment.exceptions

"""
Exceptions used by MSL-Equipment.
"""
from __future__ import annotations


[docs] class MSLConnectionError(OSError): """Base class for all MSL :class:`~.connection.Connection` exceptions."""
[docs] class MSLTimeoutError(MSLConnectionError): """A timeout exception for I/O operations."""
[docs] class ResourceClassNotFound(MSLConnectionError): def __init__(self, record): """Exception if a resource class cannot be found to connect to the equipment.""" super().__init__( f'Cannot find a resource class for {record}\n' f'If you know that a resource class exists, define a ' f'"resource_class_name" property\nin the Connection ' f'Database with the name of the resource class as the ' f'property value.')
[docs] class AimTTiError(MSLConnectionError): """Exception for equipment from Aim and Thurlby Thandar Instruments."""
[docs] class AvantesError(MSLConnectionError): """Exception for equipment from Avantes."""
[docs] class BenthamError(MSLConnectionError): """Exception for equipment from Bentham."""
[docs] class CMIError(MSLConnectionError): """Exception for equipment from the Czech Metrology Institute."""
[docs] class DataRayError(MSLConnectionError): """Exception for equipment from DataRay Inc."""
[docs] class EnergetiqError(MSLConnectionError): """Exception for equipment from Energetiq."""
[docs] class GPIBError(MSLConnectionError): def __init__(self, message: str, *, name: str = '', ibsta: int = -1, iberr: int = -1) -> None: """Exception for equipment that use the GPIB interface. :param message: The error message. :param name: The GPIB function name. :param ibsta: The status value. :param iberr: The error code. """ if name: msg = f'{message} [{name}(), ibsta:{hex(ibsta)}, iberr:{hex(iberr)}]' else: msg = message super().__init__(msg)
[docs] class GreisingerError(MSLConnectionError): """Exception for equipment from Greisinger."""
[docs] class IsoTechError(MSLConnectionError): """Exception for equipment from IsoTech."""
[docs] class MKSInstrumentsError(MSLConnectionError): """Exception for equipment from MKS Instruments."""
[docs] class NKTError(MSLConnectionError): """Exception for equipment from NKT Photonics."""
[docs] class OmegaError(MSLConnectionError): """Exception for equipment from OMEGA."""
[docs] class OptoSigmaError(MSLConnectionError): """Exception for equipment from OptoSigma."""
[docs] class OptronicLaboratoriesError(MSLConnectionError): """Exception for equipment from Optronic Laboratories."""
[docs] class PicoTechError(MSLConnectionError): """Exception for equipment from Pico Technology."""
[docs] class PrincetonInstrumentsError(MSLConnectionError): """Exception for equipment from Princeton Instruments."""
[docs] class RaicolCrystalsError(MSLConnectionError): """Exception for equipment from Raicol Crystals."""
[docs] class ThorlabsError(MSLConnectionError): """Exception for equipment from Thorlabs."""