Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add linux compatibility for thorlabs kinesis devices #48

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pylablib/devices/Thorlabs/kinesis.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import re
import time
import sys

import collections

Expand Down Expand Up @@ -40,8 +41,12 @@ class BasicKinesisDevice(comm_backend.ICommBackendWrapper):
"""
Error=ThorlabsError
def __init__(self, conn, timeout=3., is_rack_system=False):
defaults={"serial":{"baudrate":115200,"rtscts":True}, "ft232":{"baudrate":115200,"rtscts":True}}
instr=comm_backend.new_backend(conn,backend=("auto","ft232"),term_write=b"",term_read=b"",timeout=timeout,
if sys.platform == "linux" or sys.platform == "darwin":
backend_type = "serial"
elif sys.platform == "win32":
backend_type = "ft232"
defaults={"serial":{"baudrate":115200,"rtscts":True}, backend_type:{"baudrate":115200,"rtscts":True}}
instr=comm_backend.new_backend(conn,backend=("auto", backend_type),term_write=b"",term_read=b"",timeout=timeout,
defaults=defaults,reraise_error=ThorlabsBackendError)
instr.setup_cooldown(write=0.003)
try:
Expand Down