forked from M-Labs/artiq
1
0
Fork 0

add Thorlabs T-Cube NDSP

This commit is contained in:
Yann Sionneau 2015-03-04 14:30:33 +00:00 committed by Sebastien Bourdeauducq
parent 6062b42117
commit 14c759ff89
5 changed files with 1621 additions and 0 deletions

View File

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,47 @@
#!/usr/bin/env python3
import argparse
from artiq.devices.thorlabs_tcube.driver import Tdc, Tpz, TdcSim, TpzSim
from artiq.protocols.pc_rpc import simple_server_loop
from artiq.tools import verbosity_args, init_logger
def get_argparser():
parser = argparse.ArgumentParser()
parser.add_argument("-d", "--device", required=True,
help="type of the Thorlabs T-Cube device to control",
choices=["TDC001", "TPZ001", "TDCSim", "TPZSim"])
parser.add_argument("--bind", default="::1",
help="hostname or IP address to bind to")
parser.add_argument("-p", "--port", default=3255, type=int,
help="TCP port to listen to")
parser.add_argument("-s", "--serial", default="/dev/ttyUSB0",
help="serial port: on Windows \"COMx\", on Linux a "
"device path (e.g. \"/dev/ttyUSB0\").")
verbosity_args(parser)
return parser
def main():
args = get_argparser().parse_args()
init_logger(args)
devname = args.device.lower()
if devname == "tdc001":
dev = Tdc(args.serial)
elif devname == "tpz001":
dev = Tpz(args.serial)
elif devname == "tdcsim":
dev = TdcSim()
elif devname == "tpzsim":
dev = TpzSim()
else:
raise ValueError("Device can be either TDC001, TPZ001, TDCSim"
" or TPZSim")
simple_server_loop({devname: dev}, args.bind, args.port)
if __name__ == "__main__":
main()

View File

@ -63,6 +63,29 @@ Controller
:ref: artiq.frontend.novatech409b_controller.get_argparser :ref: artiq.frontend.novatech409b_controller.get_argparser
:prog: novatech409b_controller :prog: novatech409b_controller
Thorlabs T-Cube
---------------
TDC001 Driver
+++++++++++++
.. autoclass:: artiq.devices.thorlabs_tcube.driver.Tdc
:members:
TPZ001 Driver
+++++++++++++
.. autoclass:: artiq.devices.thorlabs_tcube.driver.Tpz
:members:
Controller
++++++++++
.. argparse::
:ref: artiq.frontend.thorlabs_tcube_controller.get_argparser
:prog: thorlabs_controller
Default TCP port list Default TCP port list
--------------------- ---------------------
@ -81,3 +104,5 @@ When writing a new NDSP, choose a free TCP port and add it to this list.
+--------------------------+--------------+ +--------------------------+--------------+
| Novatech 409B | 3254 | | Novatech 409B | 3254 |
+--------------------------+--------------+ +--------------------------+--------------+
| Thorlabs T-Cube | 3255 |
+--------------------------+--------------+

View File

@ -19,6 +19,7 @@ scripts = [
"novatech409b_controller=artiq.frontend.novatech409b_controller:main", "novatech409b_controller=artiq.frontend.novatech409b_controller:main",
"pdq2_client=artiq.frontend.pdq2_client:main", "pdq2_client=artiq.frontend.pdq2_client:main",
"pdq2_controller=artiq.frontend.pdq2_controller:main", "pdq2_controller=artiq.frontend.pdq2_controller:main",
"thorlabs_tcube_controller=artiq.frontend.thorlabs_tcube_controller:main",
] ]
if os.getenv("ARTIQ_GUI") == "1": if os.getenv("ARTIQ_GUI") == "1":