To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit b6a398d7 authored by mikolajr's avatar mikolajr
Browse files

In CryLas devices: fix type check errors, and copyright notice

parent 8dc263a2
# Copyright (c) 2019 ETH Zurich, SIS ID and HVL D-ITET
#
"""
Device classes for a CryLas pulsed laser controller and a CryLas laser attenuator,
using serial communication.
......@@ -28,6 +30,11 @@ from aenum import Enum, IntEnum
from .base import SingleCommDevice
from ..comm import SerialCommunication, SerialCommunicationConfig
from ..comm.serial import (
SerialCommunicationParity,
SerialCommunicationStopbits,
SerialCommunicationBytesize,
)
from ..configuration import configdataclass
Number = Union[int, float]
......@@ -40,18 +47,18 @@ class CryLasLaserSerialCommunicationConfig(SerialCommunicationConfig):
#: CryLas laser does not use parity
parity: Union[
str, SerialCommunicationConfig.Parity
] = SerialCommunicationConfig.Parity.NONE
str, SerialCommunicationParity
] = SerialCommunicationParity.NONE
#: CryLas laser uses one stop bit
stopbits: Union[
int, SerialCommunicationConfig.Stopbits
] = SerialCommunicationConfig.Stopbits.ONE
int, SerialCommunicationStopbits
] = SerialCommunicationStopbits.ONE
#: One byte is eight bits long
bytesize: Union[
int, SerialCommunicationConfig.Bytesize
] = SerialCommunicationConfig.Bytesize.EIGHTBITS
int, SerialCommunicationBytesize
] = SerialCommunicationBytesize.EIGHTBITS
#: The terminator is LF
terminator: bytes = b"\n"
......@@ -789,18 +796,18 @@ class CryLasAttenuatorSerialCommunicationConfig(SerialCommunicationConfig):
#: CryLas attenuator does not use parity
parity: Union[
str, SerialCommunicationConfig.Parity
] = SerialCommunicationConfig.Parity.NONE
str, SerialCommunicationParity
] = SerialCommunicationParity.NONE
#: CryLas attenuator uses one stop bit
stopbits: Union[
int, SerialCommunicationConfig.Stopbits
] = SerialCommunicationConfig.Stopbits.ONE
int, SerialCommunicationStopbits
] = SerialCommunicationStopbits.ONE
#: One byte is eight bits long
bytesize: Union[
int, SerialCommunicationConfig.Bytesize
] = SerialCommunicationConfig.Bytesize.EIGHTBITS
int, SerialCommunicationBytesize
] = SerialCommunicationBytesize.EIGHTBITS
#: No terminator
terminator: bytes = b""
......
# Copyright (c) 2019 ETH Zurich, SIS ID and HVL D-ITET
#
"""
Tests for the .dev.crylas sub-package.
"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment